query
stringlengths 7
5.25k
| document
stringlengths 15
1.06M
| metadata
dict | negatives
sequencelengths 3
101
| negative_scores
sequencelengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Retrieves the required type of Dispatcher according to the given page name. | private static final function getDispatcherType($page) {
// List here every AJAX pages
$pagesAJAX = array(
"cron"
);
// If the page is in the array
if (in_array($page, $pagesAJAX)) {
return new AJAX();
}
return new PHP();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_page( $name ) {\n\t\treturn $name ? $this->get_object( $name, 'page' ) : null;\n\t}",
"public function getContentTypeClass($pageName)\n {\n $pageName = $this->getFriendlyName($pageName);\n\n $allTypes = $this->getAllContentTypeClasses();\n\n return isset($allTypes[$pageName]) ? $allTypes[$pageName] : null;\n }",
"public function getPageType();",
"public function getPageType();",
"static public function get_page_by_name($post_name, $output = OBJECT, $post_type = 'page')\n {\n global $wpdb;\n\n $sql = $wpdb->prepare(\n \"SELECT\n ID\n FROM\n {$wpdb->posts}\n WHERE\n post_name = %s AND\n post_type = %s\",\n $post_name,\n $post_type\n );\n $page = $wpdb->get_var($sql);\n\n if ($page) {\n return get_post($page, $output);\n }\n\n return null;\n }",
"public static function get_wordpress_page_type()\n {\n global $wp_query;\n $loop = 'not-found';\n\n if ($wp_query->is_page) {\n $loop = is_front_page() ? 'front' : 'page';\n } elseif ($wp_query->is_home) {\n $loop = 'home';\n } elseif ($wp_query->is_single) {\n $loop = ($wp_query->is_attachment) ? 'attachment' : 'single';\n } elseif ($wp_query->is_category) {\n $loop = 'category';\n } elseif ($wp_query->is_tag) {\n $loop = 'tag';\n } elseif ($wp_query->is_tax) {\n $loop = 'tax';\n } elseif ($wp_query->is_archive) {\n if ($wp_query->is_day) {\n $loop = 'day';\n } elseif ($wp_query->is_month) {\n $loop = 'month';\n } elseif ($wp_query->is_year) {\n $loop = 'year';\n } elseif ($wp_query->is_author) {\n $loop = 'author';\n } else {\n $loop = 'archive';\n }\n } elseif ($wp_query->is_search) {\n $loop = 'search';\n } elseif ($wp_query->is_404) {\n $loop = 'not-found';\n } elseif ($wp_query->is_author) {\n $loop = 'author';\n }\n\n return $loop;\n }",
"public function get_current_page_type() {\n\n\t\tglobal $pagenow;\n\n\t\t$type = '';\n\n\t\tswitch ( $pagenow ) {\n\n\t\t\tcase 'post-new.php':\n\t\t\tcase 'post.php':\n\n\t\t\t\tif ( isset( $_GET['action'] ) && $_GET['action'] === 'elementor' ) {\n\n\t\t\t\t\t$type = 'widgets';\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$type = 'metabox';\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'term.php':\n\t\t\tcase 'edit-tags.php':\n\t\t\t\t$type = 'taxonomy';\n\t\t\t\tbreak;\n\n\t\t\tcase 'widgets.php':\n\t\t\t\t$type = 'widgets';\n\t\t\t\tbreak;\n\n\t\t\tcase 'nav-menus.php':\n\t\t\t\t$type = 'menus';\n\t\t\t\tbreak;\n\n\t\t\tcase 'profile.php':\n\t\t\tcase 'user-new.php':\n\t\t\tcase 'user-edit.php':\n\t\t\t\t$type = 'users';\n\t\t\t\tbreak;\n\n\t\t\tcase 'index.php':\n\t\t\t\t$type = 'dashboard';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif ( isset( $_GET['page'] ) && ( preg_match( '/^better-studio-/', $_GET['page'] ) || preg_match( '/^better-studio\\//', $_GET['page'] ) ) ) {\n\t\t\t\t\t$type = 'panel';\n\t\t\t\t}\n\n\t\t}\n\n\t\treturn $type;\n\t}",
"public static function getDispatcher($name = 'SHFactory')\n\t{\n\t\t$name = strtolower($name);\n\n\t\tif (!isset(self::$dispatcher[$name]))\n\t\t{\n\t\t\t// Something is up with the deprecation of JDispatcher in newer Joomla Versions\n\t\t\tif (class_exists('JDispatcher'))\n\t\t\t{\n\t\t\t\t// J2.5\n\t\t\t\tself::$dispatcher[$name] = new JDispatcher;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// J3.0+ and Platform\n\t\t\t\tself::$dispatcher[$name] = new JEventDispatcher;\n\t\t\t}\n\t\t}\n\n\t\treturn self::$dispatcher[$name];\n\t}",
"public function get_page_type()\n {\n switch ($this->type) {\n case self::TYPE_SLIDESHOW:\n return 'slideshow';\n break;\n default:\n return 'entry';\n }\n }",
"function owa_get_page_type() {\t\r\n\t\r\n\tif (is_home()):\r\n\t\t$type = \"Home\";\r\n\telseif (is_attachment()):\r\n\t\t$type = \"Attachment\";\r\n\telseif (is_page()):\r\n\t\t$type = \"Page\";\r\n\t// general page catch, should be after more specific post types\t\r\n\telseif (is_single()):\r\n\t\t$type = \"Post\";\r\n\telseif (is_feed()):\r\n\t\t$type = \"Feed\";\r\n\telseif (is_author()):\r\n\t\t$type = \"Author\";\r\n\telseif (is_category()):\r\n\t\t$type = \"Category\";\r\n\telseif (is_search()):\r\n\t\t$type = \"Search Results\";\r\n\telseif (is_month()):\r\n\t\t$type = \"Month\";\r\n\telseif (is_day()):\r\n\t\t$type = \"Day\";\r\n\telseif (is_year()):\r\n\t\t$type = \"Year\";\r\n\telseif (is_time()):\r\n\t\t$type = \"Time\";\r\n\telseif (is_tag()):\r\n\t\t$type = \"Tag\";\r\n\telseif (is_tax()):\r\n\t\t$type = \"Taxonomy\";\r\n\t// general archive catch, should be after specific archive types\t\r\n\telseif (is_archive()):\r\n\t\t$type = \"Archive\";\r\n\telse:\r\n\t\t$type = '(not set)';\r\n\tendif;\r\n\t\r\n\treturn $type;\r\n}",
"public function fetchPageClass( $page ) {\n\t\t$class = __CLASS__ . '\\\\' . ucFirst( $page );\n\t\tif ( $this->classExists( $class ) ) {\n\t\t\treturn new $class( $page );\n\t\t}\n\t}",
"public function __get($name)\n {\n switch ($name) {\n case 'blog':\n $blog = new PageList();\n $blog->filterByCollectionTypeHandle('city_blog');\n $blog->filterByParentID($this->page->getCollectionID());\n $this->blog = $blog->get(1)[0];\n return $this->blog;\n break;\n case 'facebook_url':\n return $this->facebook ? 'http://facebook.com/' . end(preg_split('/\\//', $this->facebook)) : null;\n break;\n case 'twitter_url':\n return $this->twitter ? 'http://twitter.com/' . end(preg_split('/[@\\/]/', $this->twitter)) : null;\n break;\n case 'website_url':\n return $this->website ? \n (0 === strpos($this->website, 'http')) ?\n $this->website : ('http://' . $this->website) :\n null;\n break;\n case 'url':\n return Loader::helper('navigation')->getCollectionURL($this->page);\n break;\n case 'totalWalks':\n $walks = new PageList();\n $walks->filterByParentID($page->getCollectionID());\n $walks->filterByAttribute('exclude_page_list', false);\n $walks->filterByCollectionTypeHandle('walk');\n $this->totalWalks = $walks->getTotal;\n return $this->totalWalks;\n break;\n }\n }",
"public static function get_page($name)\n {\n /**\n * Search for a post with the given name.\n */\n $args = [\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'posts_per_page' => 1,\n ];\n\n /**\n * Search for either the name, or the front page.\n */\n if ($name) {\n $args['name'] = $name;\n } else {\n $args['p'] = get_option('page_on_front');\n }\n\n $query = new \\WP_Query($args);\n if ($query->have_posts()) {\n while ($query->have_posts()) {\n $query->the_post();\n\n $response = [\n 'title' => get_the_title(),\n 'link' => get_the_permalink(),\n 'excerpt' => get_the_excerpt(),\n 'content' => get_the_content(),\n ];\n }\n\n wp_reset_postdata();\n } else {\n $response = [\n 'title' => 404,\n 'link' => '/',\n 'excerpt' => 'Niet gevonden',\n 'content' => '<p>De pagina is niet gevonden</p>',\n ];\n }\n\n return $response;\n }",
"private function determine_page_type() {\n\t\tswitch ( true ) {\n\t\t\tcase is_search():\n\t\t\t\t$type = 'SearchResultsPage';\n\t\t\t\tbreak;\n\t\t\tcase is_author():\n\t\t\t\t$type = 'ProfilePage';\n\t\t\t\tbreak;\n\t\t\tcase WPSEO_Frontend_Page_Type::is_posts_page():\n\t\t\tcase WPSEO_Frontend_Page_Type::is_home_posts_page():\n\t\t\tcase is_archive():\n\t\t\t\t$type = 'CollectionPage';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$type = 'WebPage';\n\t\t}\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_webpage_type' - Allow changing the WebPage type.\n\t\t *\n\t\t * @api string $type The WebPage type.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_webpage_type', $type );\n\t}",
"function getDataType($data)\n{\n\t$dataType = getData($data, \"Page/Type\");\n\treturn $dataType[0];\n}",
"public static function show($page_name)\n {\n return self::where('name', $page_name)->first();\n }",
"public function page($pageName)\n {\n return $this->page->get($pageName);\n }",
"public function getPageClass($page)\n {\n $class = get_class($this) . '_' . 'Page' . '_' . ucfirst($page);\n \n if (! $this->getPluginLoader('page', get_class($this))->load($page, false)) {\n $class = get_parent_class($this) . '_' . 'Page' . '_' . ucfirst($page);\n if (! $this->getPluginLoader('page', get_parent_class($this))->load($page, false)) {\n $class = get_parent_class($this) . '_' . 'Page';\n }\n }\n return $class;\n }",
"private function getClassFor($name)\n {\n $test = strtolower($name);\n foreach ($this->types as $class => $matchers) {\n foreach ($matchers as $matcher) {\n if ($test === $matcher) {\n return $class;\n }\n }\n }\n return $this->genericType;\n }",
"public static function getInstance() {\n\t\tif (!is_null(self::$INSTANCE)) {\n\t\t\treturn self::$INSTANCE;\n\t\t}\n\n\t\t$page = self::getPage(PhpBB::getInstance()->getRequest());\n\t\tself::$INSTANCE = self::getDispatcherType($page);\n\t\tself::$INSTANCE->page = $page;\n\t\tself::$INSTANCE->controller = AController::getInstance($page);\n\t\treturn self::$INSTANCE;\n\t}",
"function iron_get_page_for_post_type ( $post_type = '', $page_template = '' ) {\n\n\tif ( $post_type )\n\t{\n\t\t$page_id = get_iron_option('page_for_' . $post_type . 's');\n\n\t\tif ( empty($page_id) && ! empty($page_template) ) {\n\t\t\t$page = get_pages(array(\n\t\t\t\t'meta_key' => '_wp_page_template',\n\t\t\t\t'meta_value' => $page_template,\n\t\t\t\t'number' => 1\n\t\t\t));\n\n\t\t\tif ( ! empty($page) )\n\t\t\t\t$page_id = $page[0]->ID;\n\t\t}\n\n\t\tif ( $page_id )\n\t\t\treturn $page_id;\n\t}\n\n\treturn 0;\n}",
"public function fetch_class()\n\t{\n\t\treturn $this->route_stack[self::SEG_CLASS];\n\t}",
"public function get($name)\n {\n return $this->getClassName($name);\n }",
"public function getCurrentPageType()\n {\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_HOMEPAGE)) {\n return self::TYPE_HOMEPAGE;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_CATEGORY)) {\n return self::TYPE_CATEGORY;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_PRODUCT)) {\n return self::TYPE_PRODUCT;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_CART)) {\n return self::TYPE_CART;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_SEARCH)) {\n return self::TYPE_SEARCH;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_LANDING)) {\n return self::TYPE_LANDING;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_404)) {\n return self::TYPE_404;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_REGISTRATION)) {\n return self::TYPE_REGISTRATION;\n }\n\n if ($this->_hasMatch(Adabra_Tracking_Helper_Data::TYPE_CHECKOUT)) {\n return self::TYPE_CHECKOUT;\n }\n\n return self::TYPE_OTHER;\n }",
"public function GetType($name){\r\n\t\tself::Debug('Find type '.$name);\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($this->Types);\r\n\t\twhile(++$i<$len)\r\n\t\t\tif($this->Types[$i]->Name==$name){\r\n\t\t\t\tself::Debug('Found type at index '.$i);\r\n\t\t\t\treturn $this->Types[$i];\r\n\t\t\t}\r\n\t\treturn null;\r\n\t}",
"function culturefeed_get_searchable_type($name) {\n $options = culturefeed_get_searchable_types();\n return isset($options[$name]) ? $options[$name] : NULL;\n}",
"public function fetchPage($pageName)\n {\n $pageName = (string) $pageName;\n\n if (!array_key_exists($pageName, $this->pages))\n {\n if ('' == $pageName)\n {\n $page = ContentPageQuery::create()\n ->filterByIsPublished(true)\n ->filterByName(null, Criteria::ISNULL)\n ->_or()\n ->filterByName('')\n ->findOne()\n ;\n }\n else\n {\n $page = ContentPageQuery::create()\n ->filterByIsPublished(true)\n ->filterByName($pageName)\n ->findOne()\n ;\n }\n\n $this->pages[$pageName] = $page;\n }\n\n return $this->pages[$pageName];\n }",
"public static function getControllerName()\n {\n //get the name of the page from URL \n $page_name = request::get('page', 'home');\n //$page_uri = $_SERVER['REQUEST_URI'];//get the uri of the current page\n //$url_parts = explode('/',$page_uri);//break it into parts\n //$page_name = array_pop($url_parts);//gets the last part (contact from www.site.com/contact)\n //get the path to the proper controller file based on the page name\n\n //if(trim($page_name)=='') $page_name = 'home';//if none was specified, make ot home\n\n $controller_file = static::getControllerFile($page_name);\n //if such a controller exists\n if(file_exists($controller_file))\n {\n //return the name of the page \n return $page_name;\n }\n else\n {\n //otherwise throw a nice error!\n return 'error404';\n }\n }",
"protected function get($name)\n\t{\n\t\treturn $this->stores[ $name ] ?? $this->resolve($name);\n\t}",
"public function getType(string $name): ?Definition;",
"protected function getDispatcher()\n {\n return $this->di->getShared('dispatcher');\n }",
"public static function get() {\n\t\tstatic $singleton = NULL;\n\t\tis_null($singleton) && $singleton = new Dispatcher();\n\t\treturn $singleton;\n\t}",
"public function lookup($name) {\n return $this->_handler->lookup($name);\n }",
"public static function Get($name);",
"public function getType($name);",
"private function getController($page) { \r\n return self::PAGE_DIR . $this->module . '/' . $page . '-controller.php';\r\n \r\n }",
"protected function get($name)\n {\n return $this->app->{$name};\n }",
"protected function _type() {\r\n\r\n $urlParts = explode('/', $this->url);\r\n\r\n $type = array_pop($urlParts);\r\n\r\n return $type;\r\n\r\n }",
"function &getDispatcher() {\n $dispatcher =& Registry::get('dispatcher', true, null);\n\n if (is_null($dispatcher)) {\n import('ikto.classes.core.ScienceJournalDispatcher');\n\n // Implicitly set dispatcher by ref in the registry\n $dispatcher = new ScienceJournalDispatcher();\n\n // Inject dependency\n $dispatcher->setApplication(PKPApplication::getApplication());\n\n // Inject router configuration\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalComponentRouter', ROUTE_COMPONENT);\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalPageRouter', ROUTE_PAGE);\n }\n\n return $dispatcher;\n }",
"private function getRouterByType($type)\n {\n return $this->_types[(string) $type];\n }",
"protected function get($name)\n {\n return $this->stores[$name] ?? $this->resolve($name);\n }",
"protected function get($name)\n {\n return $this->stores[$name] ?? $this->resolve($name);\n }",
"protected function getPageClassName()\n {\n return ContainerPage::className();\n }",
"function getpage() {\n global $pages; /* so the included files know about it */\n\n $page = $_GET['page'];\n if ((preg_match('^/[a-z][a-z]/', $page)) && (in_array($page, $pages)))\n return $page;\n else\n return 'news';\n}",
"public function dispatch(string $page): array\n {\n if (isset($this->pages[$page])) {\n return [$page, $this->pages[$page]];\n }\n return ['404', $this->pages['404']];\n }",
"protected function getName()\r\n {\r\n return app::values()->page();\r\n }",
"public function get(string $name){\n foreach($this->routes as $route){\n\t\t\tif($route->matchName($name))\n\t\t\t\treturn $route;\n\t\t}\n\t\treturn null;\n }",
"public static function get_post_type( $id = '', $page = false ) {\n\n\t\t\tif ( self::$plugin ) {\n\n\t\t\t\treturn Codevz_Plus::get_post_type( $id, $page );\n\n\t\t\t} else {\n\n\t\t\t\treturn get_post_type( $id );\n\n\t\t\t}\n\n\t\t}",
"public function getPageTemplate($name)\n {\n if(array_key_exists($name, $this->pages)) {\n return $this->templates[$this->pages[$name]];\n }\n }",
"protected function get($name)\n {\n return isset($this->drivers[$name]) ? $this->drivers[$name] : $this->resolve($name);\n }",
"public static function dispatch()\n {\n\n // forward to backend router\n if(CAT_Backend::isBackend())\n return CAT_Backend::dispatch();\n\n $self = self::getInstance();\n\n // forward to assets controller (for css/js/...)\n if($self->router()->match('~^('.implode('|',self::$asset_paths).')~i'))\n return CAT_Helper_Assets::assets();\n\n // forward to modules\n if($self->router()->match('~^modules/~i'))\n require CAT_ENGINE_PATH.'/'.$self->router()->getRoute();\n\n // check if the system is in maintenance mode\n if(self::isMaintenance())\n {\n $result = CAT_Registry::getInstance()->db()->query(\n 'SELECT `value` FROM `:prefix:settings` WHERE `name`=\"maintenance_page\"'\n );\n }\n else\n {\n $route = $self->router()->getRoute();\n // no route -> get default page\n if($route == '')\n {\n $page_id = CAT_Helper_Page::getDefaultPage();\n }\n else // find page by route\n {\n // remove suffix from route\n $route = str_ireplace(CAT_Registry::get('PAGE_EXTENSION'), '', $route);\n $result = $self->db()->query(\n 'SELECT `page_id` FROM `:prefix:pages` WHERE `link`=?',\n array('/'.$route)\n );\n $data = $result->fetch();\n $page_id = $data['page_id'];\n }\n }\n // get page handler\n $page = CAT_Page::getInstance($page_id);\n // hand over to page handler\n $page->show();\n }",
"function getController($context) {\n\t\t$uri=$context->getURI();\n\t\t$path=$uri->getPart();\n\t\tswitch ($path) {\n\t\t\tcase 'admin':\n\t\t\t\treturn getAdminController($context);\n\t\t\tcase '':\n\t\t\t\t$uri->prependPart('home');\n\t\t\t\treturn 'Static';\n\t\t\tcase 'static':\n\t\t\t\treturn 'Static';\n\t\t\tcase 'login':\n\t\t\t\treturn 'Login';\n\t\t\tcase 'logout':\n\t\t\t\treturn 'Logout';\n\t\t\tcase \"checkout\":\n\t\t\t\treturn \"Checkout\";\n\t\t\tcase \"myShoppingCart\":\n\t\t\t return \"ShoppingCart\";\n\t\t\tdefault:\n\t\t\t\tthrow new InvalidRequestException (\"No such page \");\n\t\t}\n\t}",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function __get($name)\n\t{\n\t\tif(isset($this->data->$name)) {\n\t\t\tif(strpos($name, \"paths\") != false) {\n\t\t\t\tif(strpos($name, \"pages\") != false) {\n\t\t\t\t\treturn THEMES.$Alexya->theme_name.$this->data->$name;\n\t\t\t\t}\n\t\t\t\treturn $this->pages;\n\t\t\t}\n\t\t\treturn $this->data->$name;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"abstract public function\r\n\t\tget_admin_page_class_name();",
"public static function getType($name)\n {\n $pkg = self::$pkg;\n if (!isset(self::$types[$name])) {\n if (class_exists(\"\\\\{$pkg}\\\\Model\\\\Type\\\\{$name}Type\")) {\n self::addType(\"\\\\{$pkg}\\\\Model\\\\Type\\\\{$name}Type\");\n } elseif (class_exists(\"\\\\Pearly\\\\Model\\\\Type\\\\{$name}Type\")) {\n self::addType(\"\\\\Pearly\\\\Model\\\\Type\\\\{$name}Type\");\n }\n }\n return isset(self::$types[$name]) ? self::$types[$name] : self::$types['string'];\n }",
"public function getDispatcher(\\stdClass $module, CMSApplicationInterface $application, Input $input = null): DispatcherInterface\n\t{\n\t\treturn $this->dispatcherFactory->createDispatcher($module, $application, $input);\n\t}",
"public function getHandlerForType($type)\n {\n $bestHandler = $this->defaultHandler;\n foreach ($this->handlers as $handler) {\n if ($handler->getType() == $type && $handler->getPriority() > $bestHandler->getPriority()) {\n $bestHandler = $handler;\n }\n }\n\n return $bestHandler;\n }",
"protected function get($name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }",
"public function retrieveProductTypeByName($name)\n {\n if (isset($this->_productTypeModels[$name])) {\n return $this->_productTypeModels[$name];\n }\n return null;\n }",
"public function get_type(string $type_name)\n {\n }",
"public function getPage()\n {\n return Mage::registry('cms_page');\n }",
"public function getPage()\n {\n return Mage::registry('cms_page');\n }",
"public static function type()\n {\n foreach (self::typesConditions() as $type => $condition) {\n if ($condition()) {\n return $type;\n }\n }\n return '404';\n }",
"public function getPageTypes() {}",
"protected function get(string $name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }",
"public function get(string $type): mixed\n {\n if (array_key_exists($type, $this->store)) {\n return $this->store[$type];\n }\n\n return $this->getBinding($type)\n ->getInstance();\n }",
"public static function get_type($type = \"Posts\") {\r\n\t\t$_type = \"\\\\ESWP\\\\MyTypes\\\\\".\"$type\";\r\n\t\treturn new $_type();\r\n\t}",
"function charity_is_hope_trx_donations_get_blog_type($page, $query=null) {\n\t\tif (!empty($page)) return $page;\n\t\tif ($query && $query->is_tax(TRX_DONATIONS::TAXONOMY) || is_tax(TRX_DONATIONS::TAXONOMY))\n\t\t\t$page = 'donations_category';\n\t\telse if ($query && $query->get('post_type')==TRX_DONATIONS::POST_TYPE || get_query_var('post_type')==TRX_DONATIONS::POST_TYPE)\n\t\t\t$page = $query && $query->is_single() || is_single() ? 'donations_item' : 'donations';\n\t\treturn $page;\n\t}",
"public function getController()\n {\n if (is_null($this->_controller)) {\n $controller = $this->getConfiguration()\n ->get('router.controller', 'pages');\n if (isset($this->_params['controller'])) {\n $controller = $this->_params['controller'];\n }\n $this->_controllerName = $controller;\n $this->_controller = trim(\n \"{$this->namespace}\\\\\". ucfirst($controller),\n '\\\\'\n );\n }\n return $this->_controller;\n }",
"public function getDriver($name = '')\n {\n return $this->getWordpress()->getDriver($name);\n }",
"public function getRouteController(PageInterface $page, $routePath)\n {\n $skin = $page->getSkin();\n if (method_exists($skin, 'getThemeNamespaces')) {\n $controllerName = str_replace('/', ' ', $routePath);\n $controllerName = str_replace(' ', '\\\\', ucwords($controllerName));\n $controllerName = str_replace(' ', '', ucwords(str_replace('-', ' ', str_replace('_', '-', $controllerName))));\n $controllerClasses = ['%s\\Controller\\%sController', '%s\\Controller\\%s\\IndexController'];\n foreach ($skin->getThemeNamespaces() as $ns) {\n foreach ($controllerClasses as $controllerClass) {\n $controllerClass = sprintf($controllerClass, $ns, $controllerName);\n if (class_exists($controllerClass)) {\n return $controllerClass;\n }\n }\n }\n }\n return null;\n }",
"function charity_is_hope_team_get_blog_type($page, $query=null) {\n\t\tif (!empty($page)) return $page;\n\t\tif ($query && $query->is_tax('team_group') || is_tax('team_group'))\n\t\t\t$page = 'team_category';\n\t\telse if ($query && $query->get('post_type')=='team' || get_query_var('post_type')=='team')\n\t\t\t$page = $query && $query->is_single() || is_single() ? 'team_item' : 'team';\n\t\treturn $page;\n\t}",
"public function get_content_type_name_for_path($path) {\n $ct_paths = array(\n 'http://www.example2.com' => 'article',\n 'http://www.example3.com' => 'article',\n );\n\n if (isset($ct_paths[$path])) {\n return $ct_paths[$path];\n }\n else {\n return 'page';\n }\n }",
"public function getWidget($name){\n\t\t\t$class = null;\n\t\t\tif(is_file($this->config['widgetFolder'].$name.'.widget.php')){\n\t\t\t\trequire_once($this->config['widgetFolder'].$name.'.widget.php');\n\t\t\t\t$name = 'UIW_'.$name;\n\t\t\t\t$class = new $name();\n\t\t\t} \n\t\t\treturn $class;\n\t\t}",
"public static function qualifyShell($name)\n {\n // Test if the shell exist in the config namespace.\n $class = config('beluga.shell_namespace').'\\\\'.$name;\n\n if (class_exists($class)) {\n return $class;\n }\n\n // Test if the shell exist in the internal shell namespace.\n $class = config('beluga.internal_shell_namespace').'\\\\'.$name;\n\n if (class_exists($class)) {\n return $class;\n }\n\n return $name;\n }",
"public function get_page();",
"static function make($type)\n {\n $scraper = null;\n\n switch ($type) {\n case 'ElAderezo':\n $scraper = new ScraperElAderezo;\n break; \n case 'GastronomiaYCia':\n $scraper = new ScraperGastronomiaYCia;\n break;\n case 'UtensiliosDeCocina':\n $scraper = new ScraperUtensiliosDeCocina;\n break;\n } \n return $scraper;\n }",
"public static function qualifyAction($name)\n {\n $class = config('beluga.internal.action_namespace').'\\\\'.$name;\n\n if (class_exists($class)) {\n return $class;\n }\n\n return $name;\n }",
"static public function get($name) {}",
"protected function get_post_type() {\n\t\tif ( $post = get_post() ) {\n\t\t\treturn get_post_type( $post );\n\t\t}\n\n\t\tif ( isset( $_GET['post'] ) ) {\n\t\t\treturn get_post_type( sanitize_text_field( $_GET['post'] ) );\n\t\t}\n\n\t\tif ( isset( $_GET['post_type'] ) ) {\n\t\t\treturn strtolower( sanitize_text_field( $_GET['post_type'] ) );\n\t\t}\n\n\t\t$req_uri = $_SERVER['REQUEST_URI'];\n\t\t$exploded = explode( '/', $req_uri );\n\t\t$last = end( $exploded );\n\t\t$last = parse_url( $last, PHP_URL_PATH );\n\n\t\tif ( $last === 'post-new.php' || $last === 'edit.php' ) {\n\t\t\treturn 'post';\n\t\t}\n\n\t\treturn '';\n\t}",
"public static function getControllerName()\r\n {\r\n $page = request::get('page', 'homepage'); \r\n\r\n // if a controller file exists with this name\r\n $file_name = $page . '.controller.php';\r\n $file_path = CONTROLLERS_DIR . '/' . $file_name;\r\n if(file_exists($file_path))\r\n {\r\n // return the path to that file\r\n return $page;\r\n }\r\n else\r\n {\r\n // return the path to the error 404 file\r\n return 'error404';\r\n }\r\n }",
"public function getControllerName()\n {\n $current = static::class;\n $ancestry = ClassInfo::ancestry($current);\n $controller = null;\n while ($class = array_pop($ancestry)) {\n if ($class === self::class) {\n break;\n }\n if (class_exists($candidate = sprintf('%sController', $class))) {\n $controller = $candidate;\n break;\n }\n $candidate = sprintf('%sController', str_replace('\\\\Model\\\\', '\\\\Control\\\\', $class));\n if (class_exists($candidate)) {\n $controller = $candidate;\n break;\n }\n }\n if ($controller) {\n return $controller;\n }\n return PageController::class;\n }",
"public function getSysPage() {}",
"public function fetch_method()\n\t{\n\t\t$method = $this->route_stack[self::SEG_METHOD];\n\t\treturn ($method === $this->fetch_class()) ? 'index' : $method;\n\t}",
"private function get_page_type(){\n global $wp_query;\n \n //get the conditional values \n foreach( $this->mod_defaults as $key => $val ){\n $this->mod_defaults[ $key ] = $wp_query->{$key};\n }\n \n //check home page type\n if( $this->mod_defaults['is_home'] == 1 ){\n //reset home type\n $this->mod_defaults['is_home'] = false;\n \n if ( $this->is_home_static_page() ) {\n $this->mod_defaults[ 'is_home' ] = true; \n }\n elseif ( $this->is_home_posts_page() ) {\n $this->mod_defaults[ 'is_home_page' ] = true; \n }\n elseif ( $this->is_posts_page() ) {\n $this->mod_defaults[ 'is_home_index' ] = true; \n }\n }\n \n return true;\n }",
"function get_listings_header_type() {\n\t\t\n\t\tglobal $post;\n\t\t\n\t\t///// TRIES TO GET THE PAGE BY THE DDP FIRST\n\t\tif($page = get_post($post->ID)) {\n\t\t\t\n\t\t\tif(get_post_meta($post->ID, '_wp_page_template', true) == 'listings.php') {\n\t\t\t\t\n\t\t\t\t$list_type = get_post_meta($post->ID, 'list_map', true);\n\t\t\t\treturn $list_type;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t///// TRIES TO GET THE PAGE BY THE DDP FIRST\n\t\tif($page = get_post(ddp('listing_page'))) {\n\t\t\t\n\t\t\tif(get_post_meta($page->ID, '_wp_page_template', true) == 'listings.php') {\n\t\t\t\t\n\t\t\t\t$list_type = get_post_meta($page->ID, 'list_map', true);\n\t\t\t\treturn $list_type;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t$args = array('post_type' => 'page','meta_key' => '_wp_page_template','meta_value' => 'listings.php');\n\t\t$pageQuery = new WP_Query($args);\n\t\t\n\t\tif($pageQuery->found_posts > 0) { \n\t\t\n\t\t\t$the_post = $pageQuery->posts;\n\t\t\n\t\t\t$list_type = get_post_meta($the_post[0]->ID, 'list_map', true);\n\t\t\n\t\t} else { \n\t\t\n\t\t\t$list_type = 'on';\n\t\t\n\t\t}\n\t\t\n\t\treturn $list_type;\n\t\t\n\t}",
"public function get(string $name);",
"public function get($name) {}"
] | [
"0.58718884",
"0.58493096",
"0.58163655",
"0.58163655",
"0.58027726",
"0.56905025",
"0.56550765",
"0.5625911",
"0.56154585",
"0.5585284",
"0.5572647",
"0.55249774",
"0.5453267",
"0.52950674",
"0.5256691",
"0.5248824",
"0.5176613",
"0.51565754",
"0.5136357",
"0.51003456",
"0.5097673",
"0.50869614",
"0.50642663",
"0.5032343",
"0.5030716",
"0.49733683",
"0.49353027",
"0.49306265",
"0.49196556",
"0.49153233",
"0.49112058",
"0.49039704",
"0.4882877",
"0.48761943",
"0.48348552",
"0.48221263",
"0.48162407",
"0.48039353",
"0.47978052",
"0.478145",
"0.47794265",
"0.47794265",
"0.47700122",
"0.476648",
"0.4764951",
"0.47627386",
"0.47554913",
"0.47155058",
"0.47144797",
"0.47138602",
"0.4704401",
"0.47009924",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4699943",
"0.4697917",
"0.46961308",
"0.4687623",
"0.46872753",
"0.4677143",
"0.46760416",
"0.46676815",
"0.46646607",
"0.46582237",
"0.46582237",
"0.46559402",
"0.4647246",
"0.46470597",
"0.46449935",
"0.46334186",
"0.4631849",
"0.4628454",
"0.46279302",
"0.46181047",
"0.46156558",
"0.46150956",
"0.4611584",
"0.46004623",
"0.45999825",
"0.45929065",
"0.45782265",
"0.45762503",
"0.4572377",
"0.45637876",
"0.45624548",
"0.4548363",
"0.45464978",
"0.45464116",
"0.45455125",
"0.45412225",
"0.45400578"
] | 0.7577404 | 0 |
Retrieves the page from the $_GET. Also replaces "" into "_". | private static final function getPage(\phpbb\request\request $request) {
$page = $request->variable("page", ADispatcher::DEFAULT_CONTROLLER);
return str_replace("-", "_", strtolower($page));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bersihGET($papar) \n{\n\t$paparHTML = filter_input(INPUT_GET, $papar, FILTER_SANITIZE_SPECIAL_CHARS);\n\t$paparURL = filter_input(INPUT_GET, $papar, FILTER_SANITIZE_ENCODED);\n\t//$papar = filter_var($_GET[$papar], FILTER_SANITIZE_URL);\n\t\n\t//echo \"You have searched for $paparHTML.\\n\";\n\t//echo \"<a href='?search=$paparURL'>Search again.</a>\";\n \n //return $papar;\n return $paparHTML;\n}",
"private function rebuildGet()\n {\n $url = $_SERVER['REQUEST_URI'];\n $pos = strpos($url, '?');\n \n if ($pos !== false)\n {\n parse_str(substr($url, $pos+1, (strlen($url)-($pos+1))), $_GET);\n }\n }",
"function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}",
"function _get($str)\n{\n $val = !empty($_GET[$str]) ? $_GET[$str] : null;\n return $val;\n}",
"function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }",
"function _getn($v) {\r\n $r = isset($_GET[$v]) ? bwm_clean($_GET[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}",
"function get($key) {\n\tif(isset($_GET[$key])) {\n\t\treturn $_GET[$key];\n\t}\n\telse {\n\t\treturn '';\n\t}\n}",
"function getpage() {\n global $pages; /* so the included files know about it */\n\n $page = $_GET['page'];\n if ((preg_match('^/[a-z][a-z]/', $page)) && (in_array($page, $pages)))\n return $page;\n else\n return 'news';\n}",
"function get_page() {\n\n $page = (isset($_GET['page']) && is_numeric($_GET['page']) ) ? $_GET['page'] : 1;\n return $page;\n\n}",
"function page_title()\n{\n $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\n echo ucwords(str_replace('-', ' ', $page));\n}",
"function pageTitle()\n{\n $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\n echo ucwords(str_replace('-', ' ', $page));\n}",
"function get_url($page){\r\n\t\tif(strpos($this->url,'#NUM_PAGE#')!==false){\r\n\t\t\treturn str_replace('#NUM_PAGE#',$page,$this->url);\r\n\t\t}else{\r\n\t\t\treturn $this->url.(strpos($this->url,'?')!==false ? '&' : '?').'page='.$page;\r\n\t\t}\r\n\t}",
"public function obtenerURLData(){\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\n\t\tself::$urlPath = $urldata;\n\t\tif($urldata == ''){\n\t\t\tself::$urlBits[] = 'home';\n\t\t\tself::$urlPath = 'home';\n\t\t}else{\n\t\t\t$data = explode('/', $urldata);\n\t\t\twhile (!empty($data) && strlen(reset($data)) === 0){\n\t\t \tarray_shift( $data );\n\t\t }\n\t\t while (!empty($data) && strlen(end($data )) === 0){\n\t\t array_pop($data);\n\t\t }\n\t\t\tself::$urlBits = $this->array_trim( $data );\n\t\t}\n\t}",
"function get_page_id() {\n return isset($_GET['page']) && $_GET['page'] ? $_GET['page'] : 'home';\n}",
"public static function getPageUrl()\n {\n $db = DataAccess::getInstance();\n $url = $db->get_site_setting('classifieds_file_name') . '?';\n $gets = array();\n foreach ($_GET as $key => $val) {\n if (in_array($key, array('filterValue','setFilter','resetFilter', 'resetAllFilters', 'page'))) {\n //don't add this -- it's part of the filters\n //also don't add \"page\" so that adding a new filter always forces the user to \"page one\"\n continue;\n }\n $gets[] = \"$key=$val\";\n }\n $url .= implode('&', $gets);\n return $url;\n }",
"function get_uri($get_var='p')\n\t{\n\t\t// 1. Try to get request URI from $_SERVER['PATH_INFO']\n\t\t$path_info = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');\n\t\t$path_info = trim($path_info, '/');\n\t\tif ($path_info)\n\t\t\treturn $path_info;\n\n\t\t// 2. From $_GET[$get_var]\n\t\t$path_get = '';\n\t\tif (isset($_GET[$get_var])) {\n\t\t\t$path_get = $_GET[$get_var];\n\t\t}\n\n\t\t// 3. From the first $_GET key if the key's value is none, this is so\n\t\t// that requests to things like \"index.php?name/of/page&var=x&key=y\"\n\t\t// works properly.\n\t\telse {\n\t\t\tif (count($_GET)) {\n\t\t\t\t$key = key($_GET);\n\t\t\t\t$val = $_GET[$key];\n\t\t\t\tif ($val == '') {\n\t\t\t\t\t$path_get = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$path_get = trim($path_get, '/');\n\t\tif ($path_get)\n\t\t\treturn $path_get;\n\n\t\t// 4. From the whole QUERY_STRING\n\t\t$path_qs = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');\n\t\t$path_qs = trim($path_qs, '/');\n\t\tif ($path_qs)\n\t\t\treturn $path_qs;\n\n\t\treturn '';\n\t}",
"public function rewriteGet()\n {\n global $rlDb, $config;\n\n $this->fixRewrite();\n\n if ($this->debug) {\n echo '<pre>';\n print_r($_GET);\n echo '</pre>';\n }\n\n if (isset($_GET['reset_location'])) {\n $this->resetLocation();\n return false;\n }\n\n // Rewrite rule corrections\n if (isset($_GET['wildcard']) && $_GET['rlVareables'] && strpos($_GET['rlVareables'], '.html')) {\n $_GET['rlVareables'] = str_replace('.html', '', $_GET['rlVareables']);\n }\n\n if (isset($_GET['wildcard']) && $_GET['wildcard'] == '') {\n unset($_GET['wildcard']);\n }\n\n if (strlen($_GET['page']) == 2) {\n $rw_lang = $_GET['page'];\n\n $tmp = explode(\"/\", $_GET['rlVareables']);\n $page = array_splice($tmp, 0, 1)[0];\n\n if ($rlDb->getOne(\"Key\", \"`Path` = '\" . $page . \"' AND `Status` = 'active'\", 'data_formats')) {\n $_GET['page'] = $page;\n $_GET['rlVareables'] = implode(\"/\", $tmp);\n }\n } elseif (substr($_GET['rlVareables'], 2, 1) == '/') {\n $tmp = explode(\"/\", $_GET['rlVareables']);\n $page = array_splice($tmp, 0, 1)[0];\n\n if ($rlDb->getOne(\"Code\", \"`Code` = '\" . $page . \"'\", \"languages\")) {\n $rw_lang = $page;\n $_GET['rlVareables'] = implode(\"/\", $tmp);\n }\n }\n\n $get_vars = array();\n if ($_GET['page']) {\n $get_vars[] = $_GET['page'];\n\n if ($_GET['rlVareables']) {\n foreach (explode('/', $_GET['rlVareables']) as $k => $get_var) {\n $get_vars[] = $get_var;\n }\n }\n }\n\n if ($get_vars) {\n $this->geo_filter_data['applied_location'] = $this->prepareGetVars($get_vars);\n\n if ($this->geo_filter_data['applied_location']) {\n $this->saveLocation($this->geo_filter_data['applied_location']);\n\n foreach (explode('/', $this->geo_filter_data['applied_location']['Path']) as $k => $v) {\n $get_pos = array_search($v, $get_vars);\n unset($get_vars[$get_pos]);\n }\n\n unset($_GET['page']);\n unset($_GET['rlVareables']);\n\n if ($get_vars || $rw_lang) {\n if ($rw_lang) {\n array_unshift($get_vars, $rw_lang);\n }\n\n foreach (array_values($get_vars) as $k => $v) {\n if ($k == 0) {\n $_GET['page'] = $v;\n } elseif ($k > 0 && strlen($v) > 2) {\n $_GET['rlVareables'] .= $v . '/';\n }\n }\n\n if ($_GET['rlVareables']) {\n $_GET['rlVareables'] = trim($_GET['rlVareables'], '/');\n }\n }\n } elseif ($rw_lang && strlen($_GET['page']) > 2) {\n $_GET['rlVareables'] = $rw_lang . '/' . $_GET['rlVareables'];\n }\n } elseif ($rw_lang) {\n $_GET['page'] = $rw_lang;\n }\n\n // It's not possible to affect applied geo filter from Listing Details URL\n if ($_GET['listing_id']) {\n unset($this->geo_filter_data['applied_location']);\n }\n\n if ($this->debug) {\n echo '<pre> after rewrite';\n print_r($_GET);\n echo '</pre>';\n }\n }",
"function _get($v) {\r\n return isset($_GET[$v]) ? bwm_clean($_GET[$v]) : NULL;\r\n}",
"private function page($page){\n return '&page=' . $page;\n }",
"function page_title()\n {\n $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\n return ucwords(str_replace('-', ' ', $page));\n }",
"function post_slug($display = true) {\n\t\tif($display) echo $_GET['page'];\n\t\treturn $_GET['page'];\n\t}",
"function fct_decode_lien_url ($urlpage) {\nglobal $url_parlante;\n\t// recupere ligne de produits et criteres (separes par _)\n\t$pos = strpos($urlpage, \"_\");\n\tif ($pos === false) {\n\t\t$gauche = $urlpage;\n\t} else {\n\t\t$gauche= substr($urlpage,0,$pos);\n\t\t$droite = substr($urlpage,$pos+1);\n\t\tif (substr($droite,-5) == \".html\") $droite = substr($droite,0,-5);\n\t}\n\t// remplace libelles criteres par ref et code critere (ex: tho = 00801)\n\tif (isset($droite)) {\n\t\t$paramd = explode(\"_\", $droite);\n\t\tforeach ($paramd as $libelle) {\t\n//echo \"url\";print_r($libelle);\n\n\t\t\t$code_paire = array_search($libelle, $url_parlante);\n//echo \"code $code_paire - \";\n\t\t\tif ($code_paire === false) $code_paire = $libelle;\n\t\t\t$pos = strpos($code_paire,\"~\"); \n\t\t\t$couple = explode(\"~\",$code_paire);\n\t\t\t$_GET[$couple[0]] = $couple[1]; \n\t\t}\n\t}\n}",
"function publishs_url()\r\n {\r\n \t$query = '';\r\n \t$page = 'partlist.php';\r\n if(isset($_GET[\"key\"])){\r\n \t \t$value = trim($_GET[\"key\"]);\r\n \t \tif($value != \"\"){\r\n\t \t $query = '?key='.$value ; \t \t \t\r\n \t \t}\r\n \t}\r\n\t$url = $page.$query;\r\n\techo $url;\r\n }",
"function prg() \r\n{\r\n\tprintarr($_GET, '$_GET:');\r\n}",
"function queryparam_GET($key, $default_value = null) {\n\treturn common_param_GET($_GET, $key, $default_value);\n}",
"private function urlWithoutPageKey(): string\n {\n $queryString = http_build_query($this->query_without_page_key);\n\n return $this->request->url().$this->withQuestion($queryString);\n }",
"public function _GetPageTitle() {\n\t\t$page_title = 'Shirtswithstamps: T-Shirts with stamps for every ocassion';\n\t\t\n\t\tif (isset($_GET['DepartmentId']) && isset($_GET['CategoryId'])) {\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' » '.Catalog::GetCategoryName($_GET['CategoryId']).' - Shirts With Stamps';\n\t\t\t\n\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' » '.Catalog::GetCategoryName($_GET['CategoryId']).' - Page '.((int)$_GET['Page']).' - Shirtswithstamps';\t\n\t\t}\n\t\t\n\t\telseif (isset($_GET['DepartmentId'])) {\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' - Shirts With Stamps';\n\t\t\t\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' - Page '.((int)$_GET['Page']).' - Shirts With Stamps';\n\t\t}\n\t\t\n\t\telseif (isset($_GET['ProductId'])) {\n\t\t\t$page_title = Catalog::GetProductName($_GET['ProductId']).' - Shirts With Stamps';\n\t\t}\n\t\t\n\t\telseif (isset($_GET['SearchResults'])) {\n\t\t\t$page_title = '';\n\t\t\t\n\t\t\t// Display the search string\n\t\t\t$page_title = trim(str_replace('-', ' ', $_GET['SearchString'])).' (';\n\t\t\t\n\t\t\t// Display 'all-words' search or 'any-words' search\n\t\t\t$all_words = isset($_GET['AllWords']) ? $_GET['AllWords'] : 'off';\n\t\t\t\n\t\t\t$page_title .= (($all_words == 'on') ? 'all' : 'any').'-words search';\n\t\t\t\n\t\t\t// Display the page number\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page'] < 1))\n\t\t\t\t$page_title .= ', page '.((int)$_GET['Page']);\n\t\t\t\t\n\t\t\t$page_title .= ')';\n\t\t}\n\t\t\n\t\telse {\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t\t$page_title .= ' - Page '.((int)$_GET['Page']);\n\t\t}\n\t\t\n\t\treturn $page_title;\n\t}",
"public function getURLData()\r\n\t{\r\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\r\n\t\tself::$urlPath = $urldata;\r\n\t\tif( $urldata == '' )\r\n\t\t{\r\n\t\t\tself::$urlBits[] = 'home';\r\n\t\t\tself::$urlPath = 'home';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data = explode( '/', $urldata );\r\n\t\t\twhile ( !empty( $data ) && strlen( reset( $data ) ) === 0 ) \r\n\t\t\t{\r\n\t\t \tarray_shift( $data );\r\n\t\t }\r\n\t\t while ( !empty( $data ) && strlen( end( $data ) ) === 0) \r\n\t\t {\r\n\t\t array_pop($data);\r\n\t\t }\r\n\t\t\tself::$urlBits = $this->array_trim( $data );\r\n\t\t}\r\n\t}",
"private function sanitized_url() {\n $url = $_SERVER['SCRIPT_NAME'] . \"?\";\n /* the GET vars used by git-php */\n $git_get = array('p', 'dl', 'b', 'a', 'h', 't');\n foreach ($_GET as $var => $val) {\n if(!in_array($var, $git_get)){\n $get[$var] = $val;\n $url.=\"{$var}={$val}&\";\n }\n }\n return $url;\n }",
"private function getLastURL() {\n\t\tif (!isset($_SERVER['REQUEST_URI'])) {\n\t\t\t$serverrequri = $_SERVER['PHP_SELF'];\n\t\t} else {\n\t\t\t$serverrequri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\t$slcurrentPageName=str_replace('?&no_cache=1', '', $serverrequri);\n\t\t$slcurrentPageName=str_replace('?no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?L=0', '', $slcurrentPageName);\n\t\treturn $slcurrentPageName;\n\t}",
"private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}",
"private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}",
"private function what_page() {\n $query = (isset($_REQUEST['qa']) && $_SERVER['REQUEST_METHOD'] == \"GET\") ? $_REQUEST['qa'] : FALSE;\n if (!$query)\n return false;\n\n return $query;\n }",
"function rebuild($to_unset=\"block\"){\n\t\t\tglobal $_GET;\n\t\t\tunset($_GET[$to_unset]);\n\t\t\t\t\n\t\t\t$glue = \"?\";\n\t\t\treset($_GET);\n\t\t\twhile(list($key,$val)=each($_GET)){\n\t\t\t\t$val = str_replace(\" \",\"%20\",$val);\n\t\t\t\t$glue .= $key . \"=\" . $val . \"&\";\n\t\t\t}\n\t\t\treturn $glue;\n\t\t}",
"function waves_shop_req(){\n global $wp;\n $output='';\n if(count($_GET)){\n foreach ( $_GET as $key => $value ) {\n if($key!=='shop_load'&&$key!=='_'){\n $output.=(empty($output)?'?':'&').$key.'='.$value;\n }\n }\n }\n return home_url( $wp->request ).$output;\n}",
"function get_title() {\n\t\tglobal $Thesaurus;\n\t\tif (isset($_GET['p'])) {\n\t\t\techo ucwords($_GET['p']);\n\t\t} else if (isset($_GET['cat'])) {\n\t\t\techo ucwords($Thesaurus[$_GET['cat']]['T']);\n\t\t} else {\n\t\t\techo 'Home';\n\t\t}\n\t}",
"function gaming($page){\n $_GET[\"page\"] = $page;\n require_once(\"gaming/gamingIndex.php\");\n}",
"function cjpopups_remove_querystring_var($url, $key) {\n\t$url = preg_replace('/(.*)(?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&');\n\t$url = substr($url, 0, -1);\n\treturn $url;\n}",
"function url_get_param($name) {\n\tparse_str(parse_url(curPageURL(), PHP_URL_QUERY), $vars);\t\t\n\treturn isset($vars[$name]) ? $vars[$name] : null;\t\n}",
"function checkpage()\r\n\t{\r\n\tif(!isset($_GET['page']))\r\n\t{\r\n\t$GLOBALS['page']=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t$GLOBALS['page']=$_GET['page'];\r\n\t}\r\n\t}",
"public function nomepagina(){\n\t\t$url=basename($_SERVER['REQUEST_URI']);\n\t\treturn $url;\n\t}",
"function getCurrentPage($where){\n $currentPage = filter_input(INPUT_GET, $where, FILTER_SANITIZE_STRING);\n $currentPage = (empty($currentPage)) ? 'home' : $currentPage;\n return $currentPage;\n}",
"public static function get($query)\n {\n try {\n if (isset($_GET[$query])) {\n return htmlspecialchars($_GET[$query]);\n } else {\n return '';\n }\n } catch (Exception $e) {\n die($e);\n }\n }",
"function getQueryParm($parm) { // not working too good!\n $return = \"\";\n $uri = parse_url(rawurldecode($_SERVER['REQUEST_URI']));\n if (isset($uri['query'])) {\n $query = $uri['query'];\n if ($parm) {\n $pos = $this->stripos($query, $parm . \"=\");\n if ($pos)\n $return = substr($query, $pos + strlen($parm) + 1);\n }\n }\n return $return;\n }",
"function getCurrentURL() {\r\n\t$currentURL = basename($_SERVER[\"PHP_SELF\"]);\r\n\t$i = 0;\r\n\tforeach($_GET as $key => $value) {\r\n\t\t$i++;\r\n\t\tif($i == 1) { $currentURL .= \"?\"; }\r\n\t\telse { $currentURL .= \"&\"; }\r\n\t\t$currentURL .= $key.\"=\".$value;\r\n\t}\r\n\treturn $currentURL;\r\n}",
"public function cleanGet($filter='string'){\n return $this->purify($_GET,$filter);\n }",
"private function _getUrl()\r\n {\r\n $url = filter_input(INPUT_GET, 'url');\r\n $url = rtrim($url, '/');\r\n $url = filter_var($url,FILTER_SANITIZE_URL);\r\n $this->_url = explode('/', $url);\r\n }",
"function get($get = '', $replace = false) {\r\n $uri = $_SERVER['REQUEST_URI'];\r\n \t\r\n if(strpos($uri, '?')):\r\n \t$explode = explode('?', $uri);\r\n \t$uri = $explode[0];\r\n endif;\r\n \r\n if(!$replace):\r\n if(!empty($uri)):\r\n if(empty($get)):\r\n return (string) $uri;\r\n else:\r\n\r\n if(preg_match('#^\\/#', $uri)):\r\n $uri = substr($uri, 1);\r\n endif;\r\n\r\n if(preg_match('#\\/$#', $uri)):\r\n $uri = substr($uri, 0, -1);\r\n endif;\r\n\r\n if(empty($uri)):\r\n return 'index';\r\n endif;\r\n\r\n $list = array();\r\n $var = explode('/', $uri);\r\n $i = 1;\r\n foreach($var as $key):\r\n $list[$i] = $key;\r\n $i++;\r\n endforeach;\r\n\r\n if(isset($list[$get])):\r\n return $list[$get];\r\n else:\r\n return 'index';\r\n endif;\r\n endif;\r\n else:\r\n return 'index';\r\n endif;\r\n else:\r\n $getArray = explode('/', substr($uri, 1, -1));\r\n\t\tif ($getArray[0]==='') {\r\n\t\t\t$getArray = array_slice($getArray, 1);\r\n\t\t}\r\n for($i = 0; $i < $get; $i++):\r\n if(!isset($getArray[$i])):\r\n $getArray[$i] = 'index';\r\n endif;\r\n endfor;\r\n $getArray[$get-1] = $replace;\r\n\t\t$return = preg_replace('#\\/\\/#','/','/'.implode('/', $getArray).'/');\r\n\t\t$return = preg_replace('#\\/index\\/$#', '/', $return);\r\n return $return;\r\n endif;\r\n}",
"function getFolderFromGet()\r\n{\r\n\tglobal $field_name, $$field_name;\r\n\tif(empty($$field_name) && !empty($_GET[$field_name]))\r\n\t{\r\n\t\t$$field_name = $_GET[$field_name];\r\n\t}\r\n}",
"private static function getGetParams()\n\t{\n\t\treturn $_GET;\n\t}",
"function displayTxt($keyValue){\n\n if(isset($_GET[$keyValue]) && $_GET[$keyValue] !== '') {\n\n return $_GET[$keyValue];\n\n } //End if statement\n\n}",
"function current_page(){\n return isset($_GET['p']) ? (int)$_GET['p'] : 1;\n}",
"public static function cPage() {\n return isset($_GET[self::$_page]) ?\n $_GET[self::$_page] : 'index';\n //neu nhu bien page da duoc set thi ten trang chinh la bien page, neu chua duoc set thi la trang chu index\n }",
"private function getUrl()\n {\n //echo $_GET['url'];\n if(isset($_GET['url']))\n {\n $url=rtrim($_GET['url'],'/');\n $url=filter_var($url,FILTER_SANITIZE_URL);\n $url=explode('/',$url);\n return $url;\n }\n }",
"private function parseGET()\n {\n if (isset($_GET['method'])) {\n $this->method = $_GET['method'];\n unset($_GET['method']);\n }\n\n if (isset($_GET['output'])) {\n $this->output = $_GET['output'];\n unset($_GET['output']);\n }\n\n $testDN = Get_User_Principle_PI();\n if (empty($testDN) == false) {\n $this->identifier = $testDN;\n }\n\n if (count($_GET) > 0) {\n $this->params = $_GET;\n }\n }",
"function finalPageName()\n{\n\t$urlname = $_SERVER[\"REQUEST_URI\"]; //to get complete url //\n\t$urlurl = explode(\"/\",$urlname); // to explode based on '/' to get array of folders //\n\t$cnturl = count($urlurl); // count all folders in array //\n\t$finalpagename_q = $urlurl[$cnturl-1]; // to get last page of url //\n\t$arr_of_qs = explode(\"?\",$finalpagename_q); // to remove query string from last page //\n\t$finalpagename = $arr_of_qs[0]; // to get final page name //\n\treturn $finalpagename;\n}",
"private function generateURL()\n\t{\n\t\t// Is there's a query string, strip it from the URI\n\t\t$sURI\t= ($iPos = strpos($_SERVER['REQUEST_URI'], '?')) ?\n\t\t\t\t\tsubstr($_SERVER['REQUEST_URI'], 0, $iPos) :\n\t\t\t\t\t$_SERVER['REQUEST_URI'];\n\n\t\t// Is there's a ampersand string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '&')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// Is there's a hash string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '#')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// If we're on page 1\n\t\tif($this->iPage == 1)\n\t\t{\n\t\t\t$this->sURL\t\t= $sURI;\n\t\t}\n\t\t// Else we need to pull off the current page\n\t\telse\n\t\t{\n\t\t\t// Split the URI by / after trimming them off the front and end\n\t\t\t$aURI\t= explode('/', trim($sURI, '/'));\n\n\t\t\t// If the last part doesn't match the current page\n\t\t\t$iPage\t= array_pop($aURI);\n\t\t\tif($iPage != $this->iPage) {\n\t\t\t\ttrigger_error(__METHOD__ . ' Error: Invalid page passed. ' . $iPage . ' / ' . $this->iPage, E_USER_ERROR);\n\t\t\t}\n\n\t\t\t// If there is no other parts\n\t\t\tif(count($aURI) == 0) {\n\t\t\t\t$this->sURL = '/';\n\t\t\t} else {\n\t\t\t\t$this->sURL = '/' . implode('/', $aURI) . '/';\n\t\t\t}\n\t\t}\n\n\t\t// Set the query string\n\t\t$this->sQuery\t= ($iPos) ? substr($_SERVER['REQUEST_URI'], $iPos) : '';\n\t}",
"public function set_last_page() {\n\t\t\t$this->last_page = $_SERVER['PHP_SELF'];\n\t\t\t\n\t\t\t// If the GET array has \"add\" or \"rem\" values, we need to remove\n\t\t\t// those.\n\t\t\tif(isset($_GET)) { \n\t\t\t\tif (array_key_exists('add', $_GET)) \n\t\t\t\t\tunset($_GET['add']);\n\t\t\t\tif (array_key_exists('rem', $_GET))\n\t\t\t\t\tunset($_GET['rem']);\n\t\t\t\t\t\n\t\t\t\t// Set up an iterator and then loop through GET to get key-value\n\t\t\t\t// pairs, then append them to our last page.\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($_GET as $key=>$val) {\n\t\t\t\t\t$count = count($_GET);\n\t\t\t\t\tif ($count > 1) {\n\t\t\t\t\t\tif ($i == 0)\n\t\t\t\t\t\t\t$this->last_page .= '?' . $key . '=' . $val . '&';\n\t\t\t\t\t\telse if ($i == $count-1)\n\t\t\t\t\t\t\t$this->last_page .= $key . '=' . $val;\n\t\t\t\t\t\telse\t\n\t\t\t\t\t\t\t$this->last_page .= $key . '=' . $val . '&';\t\t\n\t\t\t\t\t} else\n\t\t\t\t\t\t$this->last_page .= '?' . $key . '=' . $val;\n\t\t\t\t\t\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t$this->last_page = substr($this->last_page, 1);\n\t\t$_SESSION['last_page'] = $this->last_page;\n\t\treturn $this->last_page;\n\t\t}",
"function GetCurrentPagePath()\r\n{\r\n\t$sPHPSelf = $_SERVER['QUERY_STRING']; \r\n\t$sCurrentPagePath = StripQEquals($sPHPSelf);\r\n\treturn $sCurrentPagePath;\r\n}",
"function secureGET(&$value, $key)\r\n\t{\r\n\t\t$_GET[$key] = htmlspecialchars(stripslashes($_GET[$key]));\r\n\t\t$_GET[$key] = str_ireplace(\"<script\", \"<-s-c-r-i-p-t\", $_GET[$key]);\r\n\t\t$_GET[$key] = mysql_escape_string($_GET[$key]);\r\n\t\treturn $_GET[$key];\r\n\t}",
"function get_param_string($name, $default = false, $no_security = false)\n{\n $ret = __param($_GET, $name, $default);\n if (($ret === '') && (isset($_GET['require__' . $name])) && ($default !== $ret) && ($_GET['require__' . $name] !== '0')) {\n // We didn't give some required input\n set_http_status_code('400');\n warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));\n }\n\n if ($ret === $default) {\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret);\n\n if ($ret === false) { // Should not happen, but have seen in the wild via malicious bots sending corrupt URLs\n $ret = $default;\n }\n\n return $ret;\n}",
"function pagina_actual() {\n return isset($_GET['p']) ? (int)$_GET['p'] : 1;\n}",
"function url($page='') {\n return $this->base_url . $page;\n }",
"function get_get_var($var)\r\n{\r\n if (isset($_GET[$var])) {\r\n return sanitizeAny($_GET[$var]);\r\n } else {\r\n return null;\r\n }\r\n}",
"function _page($var){\n\t$ext = \"\";\n switch($var):\n \tcase \"flightairticket\":\n \t\treturn get_bloginfo('url').\"/ve-may-bay\".$ext;\n case \"flightresult\":\n return get_bloginfo('url').\"/chon-hanh-trinh\".$ext;\n case \"passenger\":\n return get_bloginfo('url').\"/thong-tin-hanh-khach\".$ext;\n case \"payment\":\n return get_bloginfo('url').\"/thong-tin-thanh-toan\".$ext;\n case \"complete\":\n return get_bloginfo('url').\"/hoan-tat-don-hang\".$ext;\n case \"flightinfo\":\n return get_bloginfo('url').\"/get-flight-info\".$ext;\n case \"flightdetail\":\n return get_bloginfo('url').\"/get-flight-detail\".$ext;\n case \"paymentinfo\":\n return get_bloginfo(\"url\").\"/huong-dan-thanh-toan\".$ext;\n\t\tcase \"bookguideinfo\":\n return get_bloginfo(\"url\").\"/huong-dan-dat-ve\".$ext;\n case \"vnalink\":\n return get_bloginfo(\"url\").\"/resultvietnamairlines\".$ext;\n case \"vjlink\":\n return get_bloginfo(\"url\").\"/resultvietjet\".$ext;\n case \"jslink\":\n return get_bloginfo(\"url\").\"/resultjetstar\".$ext;\n case \"qhlink\":\n return get_bloginfo(\"url\").\"/resultbambooairways\".$ext;\n case \"sabrelink\":\n return get_bloginfo(\"url\").\"/resultsabre\".$ext;\n\t\tcase \"airportlink\":\n return get_bloginfo(\"url\").\"/get-airportcode\".$ext;\n\t\tcase \"checkcaptcha\":\n return get_bloginfo(\"url\").\"/check-captcha\".$ext;\n\t\tcase \"hotelresult\":\n return get_bloginfo(\"url\").\"/core/hotel-search.php\";\t\t\n\t\tcase \"hotelguest\":\n return get_bloginfo(\"url\").\"/dat-phong\";\t\n\t\tcase \"hotelcomplete\":\n return get_bloginfo(\"url\").\"/hoan-tat-dat-phong\";\n\t\t\t\n\t\tcase \"cheapflightsearch\":\n return get_bloginfo(\"url\").\"/ve-re-trong-thang\";\t\n\t\t\t\n endswitch;\n}",
"function getPage()\r\n{\r\n if (isPosted())\r\n {\r\n return getPostVar(\"page\",\"home\"); \r\n } \r\n else \r\n {\r\n return getUrlVar(\"page\",\"home\");\r\n } \r\n}",
"private function define_page()\n {\n isset($_GET['page']) && !empty($_GET['page']) && is_numeric($_GET['page']) ? $page = (int)$_GET['page'] : $page = 1;\n return $page;\n }",
"protected static function removeQueryString($url)\n {\n // echo $url;\n if($url)\n {\n $params = explode('&', $url, 2); // debug($params);\n if(strpos($params[0], '=') === false) // page/part1..\n {\n return rtrim($params[0], '/');\n }else{ // page = something\n return '';\n }\n }\n\n }",
"function getPage(){\n $current_location = \"index\";\n if($url_part = array_pop(explode(\"/\", $_SERVER[\"REQUEST_URI\"]))){\n $url_part = array_slice(explode(\".php\", $url_part),0,1);\n if(!empty($url_part)){\n return $url_part[0];\n }\n }\n return $current_location;\n}",
"public function get_page();",
"function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}",
"function fetch($name){\n \n return (isset($_GET[$name])? $_GET[$name]:''); \n }",
"function shGETGarbageCollect()\n{\n\t// builds up a string using all remaining GET parameters, to be appended to the URL without any sef transformation\n\t// those variables passed litterally must be removed from $string as well, so that they are not stored in DB\n\tglobal $shGETVars;\n\t$sefConfig = Sh404sefFactory::getConfig();\n\tif (!$sefConfig->shAppendRemainingGETVars || empty($shGETVars))\n\t\treturn '';\n\t$ret = '';\n\tksort($shGETVars);\n\tforeach ($shGETVars as $param => $value)\n\t{\n\t\tif (is_array($value))\n\t\t{\n\t\t\tforeach ($value as $k => $v)\n\t\t\t{\n\t\t\t\t$ret .= '&' . $param . '[' . $k . ']=' . $v;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ret .= '&' . $param . '=' . $value;\n\t\t}\n\n\t}\n\treturn $ret;\n}",
"private function _url($par = array()) {\n\t\t$get = $_GET;\n\t\t\n\t\tforeach ((array) $par AS $key => $val) { //overide value\n\t\t\tif ($key == 'path') //if path, encode\n\t\t\t\t$get['path'] = \\Crypt::encrypt($val);\n\t\t\telse\n\t\t\t\t$get[$key] = $val;\n\t\t}\n\t\t\n\t\t$url = '//';\n\t\t\n\t\t$url .= $this->_sanitize(g($_SERVER, 'HTTP_HOST').'/'.strtok(g($_SERVER, 'REQUEST_URI'), '?'));\n\t\t\n\t\treturn $url.'?'.http_build_query($get);\n\t}",
"function addURLQuery($query){\n\t\t$query = \"?\".$query.\"&\";\n\t\tforeach($_GET as $k=>$v){\n\t\t\t$query .= \"$k=$v\".\"&\";\n\t\t}\n\t\t$query = substr($query, 0, -1);//chop last ampersand off\n\t\t$curl = preg_replace('/\\?.*/', '', curPageURL()); //get current URL and remove the query string\n\t\treturn $curl.$query;\n\t}",
"function GetQueryString($name, $default=\"\") {\n return ValidRequiredQueryString($name) ? $_GET[$name] : $default;\n}",
"public function processUrl(){\n\t\t\n\t\tif (isset($_GET['url'])) {\n\t\t\treturn $url = explode('/',filter_var(rtrim($_GET['url'],'/'),FILTER_SANITIZE_URL));//what we're doing here is attempting to filter the url to make it clean and easy to use in our case we're going to explode the url into an array.\n\t\t}\n\n\n\t}",
"function current_path() {\n\t$test = $_GET['q'];\n\techo '$test';\n}",
"private function getPage() {\r\n $page = self::DEFAULT_PAGE;\r\n $this->module = self::DEFAULT_MODULE;\r\n //Check get for page to load, if page exists set page\r\n if (array_key_exists('page', $_GET)) {\r\n $page = $_GET['page'];\r\n }\r\n //Check get for module to load, if module exists set module\r\n if (array_key_exists('module', $_GET)) {\r\n $this->module = $_GET['module'];\r\n }\r\n return $this->checkPage($page);\r\n }",
"function parseURL()\n{\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n return $url;\n }\n}",
"function url($url, $mode) {\n\tglobal $gfe_url, $nice_url, $root_filename, $sort_by, $sort_order;\n\t$temp_url = '';\n\t$temp_url_nice = '';\n\t$GET_sortby = trim($_GET['by']);\n\t$GET_sortorder = trim($_GET['order']);\n\t$url = urldecode($url);\n\t$url = urlencode($url);\n\t$url = str_replace('%2F', '/', $url);\n\tswitch($mode) {\n\t\tcase 'dir':\n\t\t\tif($url == 'home') {\n\t\t\t\t$temp_url = $gfe_url.'/'.$root_filename;\n\t\t\t\t$temp_url_nice = $gfe_url.'/';\n\t\t\t} else {\n\t\t\t\t$temp_url = \"$gfe_url/$root_filename?dir=$url\";\n\t\t\t\t$temp_url_nice = \"$gfe_url/browse/$url/\";\n\t\t\t}\n\t\t\tif(!empty($GET_sortby)) {\n\t\t\t\tif(strpos($temp_url, '?') === false) {\n\t\t\t\t\t$temp_url .= \"?by=$sort_by&order=$GET_sortorder\";\n\t\t\t\t} else {\n\t\t\t\t\t$temp_url .= \"&by=$sort_by&order=$GET_sortorder\";\n\t\t\t\t}\n\t\t\t\t$temp_url_nice .= \"sortby/$sort_by/sortorder/$GET_sortorder/\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'file':\n\t\t\t$temp_url = \"$gfe_url/view.php?file=$url\";\n\t\t\t$temp_url_nice = \"$gfe_url/viewing/$url/\";\n\t\t\tbreak;\n\t\tcase 'download';\n\t\t\t$temp_url = \"$gfe_url/view.php?file=$url&dl=1\";\n\t\t\t$temp_url_nice = \"$gfe_url/download/$url/\";\n\t\t\tbreak;\n\t}\n\tif($nice_url) {\n\t\treturn $temp_url_nice;\n\t} else {\n\t\treturn $temp_url;\n\t}\n}",
"protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $catId = isset($_GET['c']) ? (int)$_GET['c'] : 0;\r\n \r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }",
"private function get_query_string()\n {\n $query_string = '';\n foreach (explode('&', $_SERVER['QUERY_STRING']) as $key)\n {\n if( !preg_match('/org_openpsa_qbpager/', $key)\n && $key != '')\n {\n $query_string .= '&'.$key;\n }\n }\n return $query_string;\n }",
"private function setPage(){\n\t if(!empty($_GET['page'])){\n\t if($_GET['page']>0){\n\t if($_GET['page'] > $this->pagenum){\n\t return $this->pagenum;\n\t }else{\n\t return $_GET['page'];\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }",
"public function get($par = null, $xss_clean = false)\n {\n return $this->_from_array($_GET, $par, $xss_clean);\n }",
"public function parseURL()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url\n $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack)\n $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array\n return $url;\n }\n }",
"function url_book(int $bid): string\n{\n $book = getOption('page_book', 'book');\n return url_build($book, \"bid=$bid\");\n}",
"public static function get(string $key)\n\t{\n\t\treturn static::value($_GET, $key);\n\t}",
"static function get_current_page_url() {\n\t\tif ( isset($_SERVER['REQUEST_URI']) ) {\n\t\t\t$_SERVER['REQUEST_URI'] = preg_replace('/&?offset=[0-9]*/', '', $_SERVER['REQUEST_URI']);\n\t\t}\n\t\treturn wp_kses($_SERVER['REQUEST_URI'], '');\n\t}",
"private static function loadUrl(){\n\n $uri = $_SERVER['REQUEST_URI'];\n\n if (ENCRYPTURL == '1')\n $uri = CR::decrypt($uri);\n\n BASEDIR == '/' || $uri = str_replace(BASEDIR,'', $uri);\n $uri = explode('/', $uri);\n\n array_walk($uri, function(&$item){\n strpos($item, '?') == false ||\n $item = substr($item, 0, strpos($item, '?'));\n });\n\n return $uri;\n }",
"function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }",
"function parseUrlGet (array $args): string {\n\t$return = '';\n\tif (count($args) > 0) {\n\t\t$return .= '?';\n\t\tforeach ($args as $key => $value) {\n\t\t\t$return .= $key.'='.$value.'&';\n\t\t}\n\t\t$return = str_removeFromEnd($return, '&');\n\t}\n\treturn $return;\n}",
"function _get_page_link($post = \\false, $leavename = \\false, $sample = \\false)\n {\n }",
"function url_current()\n{\n return url(@$_GET['GET_VARS']);\n}",
"public function nomepaginaoriginale(){\n\t\t$url=basename($_SERVER['PHP_SELF']);\n\t\treturn $url;\n\t}",
"public function getUrl(){\r\n if(isset($_GET['url'])){\r\n $url = rtrim($_GET['url'], '/');\r\n $url = filter_var($url, FILTER_SANITIZE_URL);\r\n $url = explode('/', $url);\r\n return $url;\r\n }\r\n }",
"function cleanQueryString(&$request){\n\tdelParam($request, 'pag');\n\tdelParam($request, 'first');\n\tdelParam($request, 'previous');\n\tdelParam($request, 'next');\n\tdelParam($request, 'last');\n\tdelParam($request, 'reload');\n\tdelParam($request, 'numpags');\n\tdelParam($request, 'regspag');\n}",
"function set_page_link($newqs = array(), $newpath = null) {\n $get = $_GET;\n unset($get['request_uri']);\n $allqet = array_merge($get, $newqs);\n if (empty($newpath)) {\n $qs = http_build_query($allqet);\n return Router::$page_url . (!empty($qs) ? \"?$qs\" : null);\n }\n $qs = http_build_query($allqet);\n return \"$newpath\" . (!empty($qs) ? \"?$qs\" : null);\n}",
"private function getInput($key)\n {\n return isset($_GET[$key]) ? $_GET[$key] : null;\n }",
"public static function GET($key, $default = '') {\n if (isset($_GET[$key])) {\n return $_GET[$key];\n }\n return $default;\n }"
] | [
"0.64691097",
"0.6289452",
"0.61375284",
"0.60681885",
"0.6035902",
"0.60167533",
"0.600143",
"0.5989319",
"0.5958492",
"0.5884145",
"0.5870913",
"0.5854474",
"0.58163035",
"0.58072394",
"0.5786383",
"0.5769944",
"0.57683516",
"0.5742934",
"0.5702014",
"0.5699888",
"0.56572884",
"0.5656264",
"0.56509584",
"0.5649544",
"0.56489825",
"0.5610287",
"0.5586763",
"0.558572",
"0.556541",
"0.5563848",
"0.5557222",
"0.5557222",
"0.5555475",
"0.55320686",
"0.55133134",
"0.5512719",
"0.5508924",
"0.54999894",
"0.54959744",
"0.5487326",
"0.5479797",
"0.547893",
"0.54651654",
"0.54641306",
"0.54538715",
"0.54520255",
"0.54403913",
"0.5422879",
"0.5394004",
"0.53931385",
"0.53889996",
"0.5385849",
"0.5384522",
"0.53715974",
"0.53382105",
"0.53304183",
"0.5316492",
"0.53015417",
"0.53013146",
"0.5299098",
"0.5286992",
"0.5284025",
"0.5272792",
"0.5265177",
"0.52539617",
"0.5245585",
"0.5244194",
"0.52238995",
"0.521699",
"0.5215404",
"0.51870763",
"0.5184458",
"0.5180803",
"0.51670176",
"0.5165497",
"0.5164518",
"0.5159312",
"0.5159126",
"0.5155823",
"0.5153975",
"0.5151457",
"0.51443964",
"0.5136821",
"0.5133419",
"0.5128436",
"0.5119634",
"0.5118106",
"0.51152676",
"0.51138395",
"0.51049304",
"0.50907755",
"0.5076689",
"0.5075243",
"0.5072323",
"0.506916",
"0.5068081",
"0.5062038",
"0.50618637",
"0.5058955",
"0.50490314"
] | 0.5855577 | 11 |
Dispatches the page, the action, and parameters to the right AController. | public final function dispatch() {
$request = PhpBB::getInstance()->getRequest();
if ($this->controller != NULL) {
return $this->handleResponse(
$this->controller->executeAction(
self::getAction($request),
self::getParameters($request)
)
);
}
return $this->handleResponse(new Error404());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dispatch()\n {\n $data = $this->router->getData();;\n $c = $data->controller;\n $ref = new $c($data->params);\n $a = $data->action;\n if (!is_null($a) && !empty($a)) call_user_func(array($ref, $a));\n return;\n }",
"public function dispatch ()\n {\n\n try\n {\n\n // initialize the controller\n $this->initialize();\n\n // get the application context\n $context = $this->getContext();\n\n // determine our module and action\n $moduleName = $context->getRequest()\n ->getParameter(MO_MODULE_ACCESSOR);\n\t\t\t\n\n $actionName = $context->getRequest()\n ->getParameter(MO_ACTION_ACCESSOR);\n\n if ($moduleName == null)\n {\n\n // no module has been specified\n $moduleName = MO_DEFAULT_MODULE;\n\n }\n\n if ($actionName == null)\n {\n\n // no action has been specified\n if ($this->actionExists($moduleName, 'Index'))\n {\n\n // an Index action exists\n $actionName = 'Index';\n\n } else\n {\n\n // use the default action\n $actionName = MO_DEFAULT_ACTION;\n\n }\n\n }\n\n // make the first request\n $this->forward($moduleName, $actionName);\n\n } catch (MojaviException $e)\n {\n\n $e->printStackTrace();\n\n } catch (Exception $e)\n {\n\n // most likely an exception from a third-party library\n $e = new MojaviException($e->getMessage());\n\n $e->printStackTrace();\n\n }\n\n }",
"public function dispatch()\n {\n $this->parseRoute();\n\n $controller = new BaseController();\n\n $controllerName = '\\\\Shopreview\\\\Mvc\\\\Controller\\\\' . $this->controller . self::CONTROLLER_POSTFIX;\n\n // controller test, if not found redirect to the homepage\n if (class_exists($controllerName)) {\n $controller = new $controllerName();\n } elseif(!empty($this->controller)) {\n header('Location: /');\n exit();\n }\n\n // finalizing method name\n $methodName = $this->action . self::ACTION_POSTFIX;\n if (!$this->action || !method_exists($controller, $methodName)) {\n $methodName = self::DEFAULT_ACTION . self::ACTION_POSTFIX;\n }\n\n // calling the proper class and method\n call_user_func_array(array($controller, $methodName), array());\n }",
"function callControllerAction() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n\n $route = $this->getMatchingRoute($santitizedUrl);\n if ($route != null) {\n $actionValues = explode('/', ltrim(str_replace($route->getUrl(), '', $santitizedUrl), '/'));\n $controllerName = $route->getControllerName();\n $controllerName = $controllerName . 'Controller'; \n $controller = new $controllerName;\n $action = $route->getActionName();\n $controller->$action($actionValues);\n } else {\n // If we've entered this else section, we've effectively been unable to match\n // the specified url to a registered route. Normally we would throw a 404\n // error and return a user friendly message stating so, however, I'm leaving\n // that as an exersize for the reader\n }\n \n }",
"public function dispatch($url){\n\n /*\n Before checking for a match we must get only the first GET Param,\n if others were added to the URL (?key=value), we must remove them\n */\n if($url != ''){\n $parts = explode('&', $url, 2);\n if( strpos($parts[0], '=') === false ){\n //if no '=' was not found, no extra GET params passed in, url is valid\n $url = $parts[0];\n }else {\n //only get vars were passed in, empty URL to send to Home Page\n $url = '';\n }\n }\n\n // Handle a match\n if( $this->match($url) ){\n // Filter Controller\n //route params are now inside object instance $this->params\n $controller = $this->params['controller'];\n //convert to StudlyCaps as this is how the actual Controller class should be defined\n $controller = $this->convertToStudlyCaps($controller);\n //Check if a namespace has been specified for the conroller in the route's params\n $controller = $this->getNamespace() . $controller;\n\n // Make sure that the controller class exists before we instantiate it\n if( !class_exists($controller) ){\n throw new \\Exception(\"Controller class: $controller not found\");\n }\n //class exists...create the object\n $controllerObj = new $controller($this->params);\n\n // Filter Action...default to index\n $action = (isset($this->params['action'])) ? $this->params['action'] : 'index';\n\n //convert action string to camelCase, as this is how the class method should be defined\n $action = $this->convertToCamelCase($action);\n //the actual method will have 'Action' appended to the end,\n //this is done to force execution of the __call function, this can be bypassed however,\n //if the user inputted URL has 'Action' explicitly appended to\n //...check that the action does not have action appeded to it\n if( preg_match( '/action$/i', $action) ){\n throw new \\Exception(\"Method $action in controller $controller cannot be called directly - remove the Action suffix to call this method\");\n }\n //Finally, call Action on controller\n //THE CONTROLLER METHOD WILL NOT EXIST, THIS WILL FORCE THE EXECUTION OF THE\n // __call METHOD THAT SHOULD BE DEFINED IN THE CONTAINING CLASS\n $controllerObj->$action();\n }else {\n //No route matched\n throw new \\Exception(\"No route matched for $url\", 404);\n }\n\n }",
"public function HandlePage()\n\t\t{\n\t\t\t$this->SetOrderData();\n\n\t\t\t$action = \"\";\n\t\t\tif(isset($_REQUEST['action'])) {\n\t\t\t\t$action = isc_strtolower($_REQUEST['action']);\n\t\t\t}\n\n\t\t\tswitch($action) {\n\t\t\t\tdefault: {\n\t\t\t\t\t$this->FinishOrder();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"abstract public function getControllerAction();",
"function dispatch()\n {\n $app = $this->app;\n $db = $this->db;\n $user = $this->user;\n $this->setupControllerClasses('/Page/*.php', $app, $db, $user, 'SynchWeb\\\\Page\\\\');\n\n // add specific routes which break the old convention\n $app->group('/users', function () use ($app)\n {\n $app->container['userController'];\n });\n\n $app->group('/assign', function () use ($app)\n {\n $app->container['assignController'];\n });\n\n $this->app->notFound(function () use ($app)\n {\n $app->halt(404, json_encode(array('status' => 404, 'message' => 'not found')));\n });\n\n $app->run();\n }",
"protected function callActionMethod() {}",
"protected function executeAction() {}",
"protected function executeAction() {}",
"protected function executeAction() {}",
"protected function executeAction() {}",
"public static function dispatch()\n {\n\n // forward to backend router\n if(CAT_Backend::isBackend())\n return CAT_Backend::dispatch();\n\n $self = self::getInstance();\n\n // forward to assets controller (for css/js/...)\n if($self->router()->match('~^('.implode('|',self::$asset_paths).')~i'))\n return CAT_Helper_Assets::assets();\n\n // forward to modules\n if($self->router()->match('~^modules/~i'))\n require CAT_ENGINE_PATH.'/'.$self->router()->getRoute();\n\n // check if the system is in maintenance mode\n if(self::isMaintenance())\n {\n $result = CAT_Registry::getInstance()->db()->query(\n 'SELECT `value` FROM `:prefix:settings` WHERE `name`=\"maintenance_page\"'\n );\n }\n else\n {\n $route = $self->router()->getRoute();\n // no route -> get default page\n if($route == '')\n {\n $page_id = CAT_Helper_Page::getDefaultPage();\n }\n else // find page by route\n {\n // remove suffix from route\n $route = str_ireplace(CAT_Registry::get('PAGE_EXTENSION'), '', $route);\n $result = $self->db()->query(\n 'SELECT `page_id` FROM `:prefix:pages` WHERE `link`=?',\n array('/'.$route)\n );\n $data = $result->fetch();\n $page_id = $data['page_id'];\n }\n }\n // get page handler\n $page = CAT_Page::getInstance($page_id);\n // hand over to page handler\n $page->show();\n }",
"public function process() {\r\n if(!in_array($this->getRouter()->getAction(), $this->getAllowActions()) || $this->getRouter()->getAction() == null) {\r\n $this->defaultAction();\r\n } else {\r\n $customAction = $this->getRouter()->getAction().Globals::getConfig()->action->suffix;\r\n $this->$customAction();\r\n }\r\n }",
"public function pageAction()\n {\n return $this->indexAction();\n }",
"public function call()\n {\n $controllerClass = self::toClass( $this->controller );\n $actionMethod = self::toMethod( $this->action );\n \n $controllerClass::$actionMethod( $this, $this->params );\n }",
"public function dispatch()\r\n {\r\n $this->_frontController->dispatch();\r\n }",
"public function onDispatch(MvcEvent $e)\r\n {\r\n \r\n $this->getPageOptions()->addParameter( 'pages', $this->params()->fromRoute('pages', false));\r\n $this->getPageOptions()->addParameter( 'section', $this->params()->fromRoute('section', false));\r\n $this->getPageOptions()->addParameter( 'article', $this->params()->fromRoute('article', false));\r\n $this->getPageOptions()->addParameter( 'category', $this->params()->fromRoute('category', false));\r\n $this->getPageOptions()->addParameter( 'categoryvalue', $this->params()->fromRoute('categoryvalue', false)); \r\n $this->getPageOptions()->addParameter( 'query', $this->params()->fromQuery());\r\n \r\n $authService = $this->getServiceLocator()->get('user_authentication');\r\n \r\n if ('index' !== $this->pageOptions->resource) { \r\n if (! $authService->hasIdentity()) {\r\n return $this->redirect()->toUrl('/login');\r\n } else {\r\n $this->setIdentity($authService->getIdentity());\r\n }\r\n } \r\n \r\n if (null === $this->getIdentity() && $authService->hasIdentity()){\r\n $this->setIdentity($authService->getIdentity());\r\n }\r\n \r\n $role = $this->getServiceLocator()->get('contentinum_acl_defaultrole');\r\n $acl = $this->getServiceLocator()->get('contentinum_acl_acl'); \r\n $this->setXmlHttpRequest($this->getRequest()->isXmlHttpRequest());\r\n \r\n if (method_exists($this, 'prepare')) {\r\n $this->prepare($this->getPageOptions(), $role, $acl);\r\n }\r\n\r\n if ($this->getRequest()->isPost()) {\r\n $app = $this->process($this->getPageOptions(), $role, $acl);\r\n } else {\r\n $e->getRouteMatch()->setParam('action', 'application');\r\n $app = $this->application($this->getPageOptions(), $role, $acl);\r\n }\r\n $e->setResult($app);\r\n return $app; \r\n }",
"public function run() {\r\n\t\tif (isset($_GET['action'])) {\r\n\t\t\t$action = strtolower($_GET['action']);\r\n\t\t} else {\r\n\t\t\t$action = 'index';\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->checkAccess($action)) {\r\n\t\t\t$action = \"action\" . ucwords($action);\r\n\t\t} else {\r\n\t\t\t$action = \"actionNotAllowed\";\r\n\t\t}\r\n\t\t\r\n\t\tif (method_exists($this, $action)) {\r\n\t\t\t$this->$action();\r\n\t\t} else {\r\n\t\t\t$this->invalidAction($action);\r\n\t\t}\r\n\t}",
"public function dispatch()\n\t{\n\t\t$this->register_actions();\n\t\t$this->register_scripts();\n\n\t\tif (isset($_GET['generate_letters']) && $_GET['page'] == 'kd-letters')\n\t\t{\n\t\t\t$this->generate();\n\t\t}\n\t}",
"public function run() \n\t{\n\t\tcall_user_func_array(array(new $this->controller, $this->action), $this->params);\t\t\n\t}",
"final function execute($request) {\t\t\n\t\t// Forward the action to execute page-specific logic\n\t\t$this->doExecute($request);\n\t}",
"public final function run()\n\t{\n\t\t$controllerClass = ucfirst(App::request()->getControllerName());\n\t\t$actionName = App::request()->getActionName().Request::ACTION_SUFFIX;\n\n\t\t$this->_execute($controllerClass, $actionName);\n\t}",
"public function execute() {\n\n\t\tif (!Utils::getGet('action')) {\n\t\t\t$_GET['action'] = 'show';\n\t\t}\n\n\t\tif ($_GET['action'] == 'show') {\n\t\t\t$this->show();\n\t\t}\n\n\t\tif ($_GET['action'] == 'modification') {\n\t\t\tif (Utils::getGet('id')) {\n\t\t\t\t$id = Utils::getGet('id');\n\t\t\t\t$id = intval($_GET['id']);\n\t\t\t\t$this->modification($id);\n\t\t\t} else {\n\t\t\t\t$this->modificationAll();\n\t\t\t}\n\t\t}\n\n\t\tif ($_GET['action'] == 'cree') {\n\t\t\t$this->creePage();\n\t\t}\n\n\t\tif ($_GET['action'] == 'supprimer') {\n\t\t\tif (Utils::getGet('id')) {\n\t\t\t\t$id = Utils::getGet('id');\n\t\t\t\t$id = intval($_GET['id']);\n\t\t\t\t$this->souprimePage($id);\n\t\t\t} else {\n\t\t\t\t$this->modificationAll();\n\t\t\t}\n\t\t}\n\n\t}",
"public function run()\n {\n $route = $this->route->mapRoute();\n\n $className = $this->controllerNamespace.$route[0];\n\n $action = $route[1];\n\n $controller = call_user_func([$className, 'getInstance']);\n\n $controller->$action();\n }",
"public function run()\n {\n call_user_func_array(array(new $this->controller, $this->action), $this->params);\n }",
"function execute(){\n $method = strtolower( $this->getRequest()->getMethod() );\n\n if( !method_exists( $this, $method ) )\n throw new RoutingException( \"Controller not implement {$method} method.\" );\n\n $result = call_user_func_array( array( $this, $method ), func_get_args() );\n\n if( is_array($result) ){\n $this->assignParams( $result );\n }\n }",
"public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}",
"function doAction() {\n\n\t\ttry {\n\t\t\t// Load the page definitition ...\n\t\t\t$pageDefinition = PageDefinition::fetch($this->context,\n\t\t\t\tRequest::post(\"page_definition_id\", Request::TYPE_INTEGER));\n\n\t\t\t// ... set the members ...\n\t\t\t$pageDefinition->title = Request::post(\n\t\t\t\t\"label\", Request::TYPE_STRING, new Str(\"\"));\n\t\t\t$pageDefinition->description = Request::post(\n\t\t\t\t\"description\", Request::TYPE_STRING, new Str(\"\"));\n\t\t\t$pageDefinition->action = Request::post(\n\t\t\t\t\"action\", Request::TYPE_STRING, new Str(\"\"));\n\t\t\t$pageDefinition->configOnly = Request::post(\n\t\t\t\t\"admin_only\", Request::TYPE_BOOLEAN);\n\t\t\t$pageDefinition->typeSet = Request::post(\n\t\t\t\t\"type_set\", Request::TYPE_INTEGER);\n\t\t\t$pageDefinition->defaultTabId = Request::post(\n\t\t\t\t\"default_tab_id\", Request::TYPE_INTEGER, -1);\n\n\t\t\t// ... and update the page definitition.\n\t\t\t$res = $pageDefinition->update();\n\n\t\t\t// Load the PageDefinititionHints::PARENT_PAGE_DEFINITION_COUNT\n\t\t\t// list ...\n\t\t\t$hnts = new PageDefinitionHints($this->context,\n\t\t\t\t$pageDefinition->id,\n\t\t\t\tPageDefinitionHints::PARENT_PAGE_DEFINITION_COUNT);\n\n\t\t\t// ... get the new values ...\n\t\t\tforeach ($hnts as $k=>$v) {\n\t\t\t\t$dat = $_POST[\"hint{$k}\"];\n\t\t\t\t$hnts[$k]->maxNoOfChildren =\n\t\t\t\t\tis_numeric($dat) ? intval($dat) : NULL;\n\t\t\t}\n\t\t\t// ... and update the list.\n\t\t\t$hnts->update();\n\n\t\t\t// Set action result.\n\t\t\t$this->setResult(self::SUCCESS);\n\n\t\t} catch(ApplicationException $e) {\n\n\t\t\t$this->setResult(self::FAIL, $e, $pageDefinition);\n\t\t}\n\t}",
"public function dispatch()\n\t{\n\t\t$this->segs = explode('/',$this->c->Router->route);\n\n\t\t/* classname seg1 (Controller) */\n\t\t$this->className = str_replace('-','_',array_shift($this->segs));\n\n\t\t/* method seg2 */\n\t\t$this->methodName = str_replace('-','_',array_shift($this->segs));\n\n\t\t/* call event */\n\t\t$this->c->Event->preController();\n\n\t\t/* This throws a error and 4004 - handle it in your error handler */\n\t\tif (!class_exists($this->className)) {\n\t\t\tthrow new \\Exception($this->className.' not found',4004);\n\t\t}\n\n\t\t/* create new controller inject the container */\n\t\t$controller = new $this->className($this->c);\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preMethod();\n\n\t\t/* This throws a error and 4005 - handle it in your error handler */\n\t\tif (!is_callable(array($controller,$this->methodName))) {\n\t\t\tthrow new \\Exception($this->className.' method '.$this->methodName.' not found',4005);\n\t\t}\n\n\t\t/* let's call our method and capture the output */\n\t\t$this->c->Response->body .= call_user_func_array(array($controller,$this->methodName),$this->segs);\n\t}",
"function executeController()\r\n{\r\n\t// Uri and figure out the path to the controller.\r\n\t$request = trim($_GET['request'], \"/ \");\r\n\t\r\n\tif ($request != '') {\r\n\t // Using the URL segments, construct the name of the class.\r\n\t // Note: The class name is mapped to the directory structure.\r\n\t $reqSegments = explode(\"/\", $request);\r\n\t}\r\n\t\r\n\t$controllerName = 'App_Pages_';\r\n\t$controllerName .= ($reqSegments[0])?$reqSegments[0]:'Index';\r\n\t$controllerName .= '_Controller';\r\n\t\r\n\t$actionName = ($reqSegments[1])?$reqSegments[1]:'index';\r\n\r\n\tif (class_exists($controllerName)) {\r\n\t\tif (method_exists($controllerName, $actionName)) {\r\n\t\t\t$controller = new $controllerName();\r\n\t\t\t$controller->$actionName();\r\n\t\t} else {\r\n\t\t\tdie('Page not found');\r\n\t\t}\r\n\t} else {\r\n\t\tdie('Page not found');\r\n\t}\r\n}",
"function dispatch() {\n\t\t$this->header();\n\n\t\t$step = empty( $_GET['step'] ) ? 0 : (int) $_GET['step'];\n\t\tswitch ( $step ) {\n\t\t\tcase 0:\n\t\t\t\t$this->analyze();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tcheck_admin_referer('woo_jigo_converter');\n\t\t\t\t$this->woo_import_jigo_orders();\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->footer();\n\t}",
"public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }",
"public function doAction($actionName);",
"private function run()\n {\n $dispatcher = $this->getDispatcher(self::getConfigSection('routes'));\n\n $routeInfo = $dispatcher->dispatch(self::getRequest('method'), self::getRequest('path'));\n\n switch ($routeInfo[0]) {\n case \\FastRoute\\Dispatcher::NOT_FOUND:\n $this->errorNotFound();\n break;\n case \\FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n $this->error405();\n break;\n case \\FastRoute\\Dispatcher::FOUND:\n $this->actionParams = $routeInfo[2];\n $handler = explode('.', $routeInfo[1]);\n $this->controllerName = 'app\\controllers\\\\' . ucfirst($handler[0]) . 'Controller';\n $controllerFile = ucfirst($handler[0]) . 'Controller.php';\n $this->actionName = 'action' . ucfirst($handler[1]);\n $this->actionSlug = $handler[0] . '.' . $handler[1];\n if (!file_exists(self::$request['root_path'] . '/app/controllers/' . $controllerFile) ||\n !method_exists($this->controllerName, $this->actionName)) {\n //there is not a controller file or action name == index\n if (App::getConfig('app.debug')) {\n echo 'There is not a controller file \"' . $controllerFile . '\" or action name == index';\n }\n $this->errorNotFound();\n }\n if (isset($handler[2])) {\n //part of hangler for checking permissions\n if ($handler[2] == 'auth') {\n //need login and not logged\n if (App::isGuest()) {\n $this->redirect(App::getConfig('app.login_url'));\n }\n } else {\n //check permission for $handler[2]\n $auth = self::getComponent('auth');\n $user = self::getUser();\n $checkUser = $user ? $auth->hasAccessTo($user->email, $handler[2]) : false;\n if (!$checkUser) {\n //user does not exists or user does not have a permission\n $this->error405();\n }\n }\n }\n break;\n }\n $this->startAction();\n }",
"public function dispatch()\n\t{\n\t\t$this->{$this->_action}();\n\t}",
"public function performAction()\n {\n if (isset($_SESSION['user_id'])) {\n $this->_userLoggedIn();\n } else if (isset($_POST['signin'])) {\n $this->_signInRequested();\n } else if (isset ($_POST['signup'])) {\n $this->_signUpPageRequested();\n } else {\n $this->_noActionTaken();\n }\n }",
"public function action() {\n // $this->view->page();\n }",
"public static function dispatch()\r\n\t{\r\n\t\t/**\r\n\t\t * Controllernames and methods saved in an array. It's solved manually to prevent that too many ressources are used to\r\n\t\t * scan every controller if the method exists etc.\r\n\t\t */\r\n\t\t$validControllerNames = array(\t\"Album\"\t\t\t=> array(\"index\",\"create\",\"doCreate\", \"edit\", \"doEdit\", \"delete\", \"doDelete\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Albums\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Home\" \t\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Login\"\t\t\t=> array(\"index\",\"doLogin\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Logout\"\t\t=> array(\"index\",\"doLogout\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Photo\"\t\t\t=> array(\"index\", \"edit\", \"doEdit\", \"delete\", \"doDelete\", \"addTo\", \"doAddTo\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Photos\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Register\"\t\t=> array(\"index\",\"doRegister\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Search\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Upload\"\t\t=> array(\"index\",\"doUpload\"),\r\n\t\t\t\t\t\t\t\t\t\t\"User\"\t\t\t=> array(\"index\", \"edit\", \"doEdit\", \"delete\", \"doDelete\", \"changepw\", \"doChangepw\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Error\"\t\t\t=> array(\"index\"));\r\n\r\n\t\t// Make an array of the data in the url, separated by \"/\"\r\n\t\t$url = explode('/', trim($_SERVER['REQUEST_URI'], '/'));\r\n\r\n\t\t// controllername which is setted in the url.\r\n\t\tif (!empty($url[0])) {\r\n\r\n\t\t\t// controllername exists\r\n\t\t\tif(array_key_exists(ucfirst($url[0]),$validControllerNames)) {\r\n\t\t\t\t$controllerName = ucfirst($url[0]);\r\n\r\n\t\t\t\t// Check if method exist and else call the index method of the controller.\r\n\t\t\t\tif (!empty($url[1]) && in_array($url[1],$validControllerNames[$controllerName])) {}\r\n\t\t\t\t$method \t\t= (!empty($url[1]) && in_array($url[1],$validControllerNames[$controllerName])) ? $url[1] : 'index';\r\n\t\t\t\t$args \t\t\t= array_slice($url, 2);\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$controllerName = 'Error';\r\n\t\t\t\t$method \t\t= 'index';\r\n\t\t\t\t$args \t\t\t= array();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t$controllerName = 'Home';\r\n\t\t\t$method \t\t= 'index';\r\n\t\t\t$args \t\t\t= array();\r\n\t\t}\r\n\r\n\t\t// Add controller and create object\r\n\t\trequire_once (\"controllers/\".$controllerName.\"Controller.php\");\r\n $controllerName = $controllerName.\"Controller\";\r\n\t\t$controller = new $controllerName();\r\n\t\tcall_user_func_array(array($controller, $method), $args);\r\n\r\n\t\t// Removes the useless Controllers and valid controller name array to save resources\r\n\t\tunset($controller);\r\n\t\tunset($validControllerNames);\r\n\t}",
"public function process() {\n // on va lui passer le contexte en premier paramètre\n // puis on va lui passer les paramètres du path comme\n // paramètres supplémentaires\n $args = array_merge(\n array($this->_context),\n $this->_context->route->params\n );\n\n $this->_context->require_part('controller', $this->controller);\n $controller = new $this->controller;\n\n // CALL STAGES BEFORE ACTION\n\n $stages = array(\n '_before_action'\n );\n\n $_response = null;\n $responses_stack = array();\n\n foreach($stages as $stage) {\n $_response = $this->call_stage($controller,$stage,$this->action, $responses_stack);\n\n // Si on obtient un objet de type Response, on stoppe\n\n if($_response instanceof Response) {\n return $this->output($_response); // ! RETURN\n }\n else {\n $responses_stack[$stage] = $_response;\n }\n }\n\n\n // CALL ACTION\n if(! method_exists($controller, $this->action)) {\n throw new \\InvalidArgumentException('Action '.$this->action.' does not exists in controller '. get_class($controller));\n }\n $action_response = call_user_func_array(array($controller, $this->action), $args);\n\n if($action_response instanceof Response) {\n return $this->output($action_response); // ! RETURN\n }\n\n\n if(is_null($action_response)) {\n // si la réponse est nulle, on ne fait rien tout simplement\n //@todo : faire autre chose, envoyer un 204 ?\n $class = get_class($controller);\n r(\"@todo : empty $class return\");\n return; // ! RETURN\n }\n elseif(is_string($action_response)) {\n $response = new Response($action_response, $headers=array());\n return self::output($response); // ! RETURN\n }\n\n\n }",
"public function map()\n {\n // If the url variable is passed we parse URL.\n // Otherwise default values are used.\n if (isset($_GET['url'])) {\n $this->extractRouteParams();\n }\n\n // Creates a new controller object based on the supplied parameters\n $controllerName = $this->_controller;\n $this->_controller .= 'Controller';\n\n // Verify that controller exist\n if (!class_exists($this->_controller)) {\n throw new Exception('The controller requested doesn't exist. Please check URL.');\n }\n\n $controller = new $this->_controller($controllerName, $this->_action);\n\n // Execute the init() method of the controller if exists\n if (method_exists($controller, 'init')) {\n $controller->init();\n }\n\n // If exists invoke the method defined in the URL\n if (method_exists($controller, $this->_action)) {\n $controller->{$this->_action}($this->_urlParams);\n } else {\n\t\t\t// As a fallback use index method as action instead\n\t\t\t// and action variable as method parameters.\n\t\t\t// That will cover URLs like: domain.com/news/name-of-the-news\n\t\t\t$controller = new $this->_controller($controllerName, 'index');\n\t\t\t$controller->{'index'}($this->_action);\n }\n }",
"public function dispatch()\n {\n try {\n list($this->controller, $this->method) = $this->getRegisteredControllerAndMethod();\n\n\n $this->parameters = $this->matchedRoute->attributes;\n\n $this->getReflectionClass($this->controller)\n ->getMethod($this->method)\n ->invokeArgs(\n new $this->controller($this->container),\n $this->parameters\n );\n } catch (\\ReflectionException $e) {\n throw new CfarException(\n CfarException::INVALID_DECLARATION . \". \" . $e->getMessage()\n );\n }\n }",
"public function HandlePage()\n\t{\n\t\t$action = \"\";\n\t\tif (isset($_REQUEST['action'])) {\n\t\t\t$action = isc_strtolower($_REQUEST['action']);\n\t\t}\n\n\t\tif($action == 'gateway_ping') {\n\t\t\t$this->GatewayPing();\n\t\t\texit;\n\t\t}\n\t\telse if($action == 'set_external_checkout') {\n\t\t\t$this->SetExternalCheckout();\n\t\t\texit;\n\t\t}\n\n\t\t// Check that there is items in the cart and store purchasing is allowed.\n\t\t// If cart is empty or purchasing is disabled or prices are hidden (inferring purchasing disabled), redirect back to the cart page.\n\t\tif($this->getQuote()->getNumItems() == 0 || !(bool)GetConfig('AllowPurchasing') || !(bool)GetConfig('ShowProductPrice')) {\n\t\t\tif(!isset($_GET['optimizer'])) {\n\t\t\t\theader('Location: '.GetConfig('AppPath').'/cart.php');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\tswitch($action) {\n\t\t\tcase \"process_gateway_callback\":\n\t\t\t\t$this->ProcessGatewayCallBack();\n\t\t\t\tbreak;\n\t\t\tcase \"process_payment\":\n\t\t\t\t$this->ProcessOrderPayment();\n\t\t\t\tbreak;\n\t\t\tcase \"pay_for_order\": {\n\t\t\t\t$this->PayForOrder();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"save_biller\": {\n\t\t\t\t$this->SaveBillingAddress();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"choose_billing_address\": {\n\t\t\t\t$this->ChooseBillingAddress();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"confirm_order\": {\n\t\t\t\t$this->ConfirmOrder();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"save_shipper\": {\n\t\t\t\t$this->SaveShippingProvider();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'save_multiple_shipping_addresses':\n\t\t\t\t$this->SaveMultipleShippingAddresses();\n\t\t\t\tbreak;\n\t\t\tcase \"choose_shipping_address\":\n\t\t\t\t$this->ChooseShippingAddress();\n\t\t\t\tbreak;\n\t\t\tcase \"choose_shipper\": {\n\t\t\t\t$this->ChooseShippingProvider();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"removegiftcertificate\": {\n\t\t\t\t$this->RemoveGiftCertificate();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'multiple':\n\t\t\t\t$this->BeginMultipleAddressCheckout();\n\t\t\t\tbreak;\n\t\t\tcase \"checkout\":\n\t\t\t\t$this->Checkout();\n\t\t\t\tbreak;\n\t\t\tdefault: {\n\t\t\t\t// If we're performing an express checkout, show that\n\t\t\t\tif(GetConfig('CheckoutType') == 'single' && $this->SinglePageCheckoutSupported()) {\n\t\t\t\t\t$this->ExpressCheckout();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->Checkout();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function executeAction()\n {\n $this->triggerEvent( __FUNCTION__ . '.pre');\n if ($this->flowEvaluator->executeActionInFlow()) {\n $this->triggerEvent(__FUNCTION__ . '.success');\n $this->manageExecutedAction();\n } else {\n $this->triggerEvent(__FUNCTION__ . '.fail');\n }\n $this->triggerEvent( __FUNCTION__ . '.post');\n }",
"public function dispatch() {\n if ($this->dispatching == null) {\n\n $this->dispatching = $this->router->getMatchedRoutes($this->request->getPath());\n }\n\n // Dispatch array is not empty\n while (!empty($this->dispatching)) {\n\n // Get the next available dispatch\n $dispatching = array_shift($this->dispatching);\n\n // Get the controller namespace\n $namespace = '\\modules\\\\' . $dispatching['module'] . '\\controllers\\\\' . $dispatching['controller'];\n\n // The controller does not exist\n if (class_exists($namespace) === false) {\n\n continue;\n }\n\n // Set the request vars\n $this->request->setVar(array_diff_key($dispatching, array_flip(['module', 'controller', 'action'])));\n // Set the dispatcher dispatched values\n $this->dispatched = array_intersect_key($dispatching, array_flip(['module', 'controller', 'action']));\n\n $controller = new $namespace($this->request, $this, $this->container);\n\n // We have a POST action defined\n if ($this->request->isPost() &&\n method_exists($controller, $this->getBaseActionName() . Router::ACTION_POST_SUFFIX)) {\n\n // Set the correct dispatching/dispatched action\n $dispatching['action'] = $this->dispatched['action'] = $this->getBaseActionName() . Router::ACTION_POST_SUFFIX;\n\n // A default controller action cannot be found\n } else if ($this->request->isGet() && method_exists($controller, $dispatching['action']) === false) {\n\n continue;\n }\n\n // Set the controller was forwarded to false\n $this->controllerWasForwarded = false;\n\n // The controller has a pre method defined\n if (method_exists($controller, 'pre')) {\n\n $controller->pre();\n }\n\n // The controller was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n $controller->{$dispatching['action']}();\n\n // The action was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n // The controller has a post method defined\n if (method_exists($controller, 'post')) {\n\n $controller->post();\n }\n\n // The action was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n // Render the view and set the response body\n $controller->getResponse()->setBody($controller->getView()->render());\n\n return;\n }\n\n // Empty the dispatched array so dispatcher not resolved event can switch to a different module if needed\n $this->dispatched = ['module' => '', 'controller' => '', 'action' => ''];\n\n $this->eventManager->emit($this->container->get('event', ['dispatcher:notResolved', $this]));\n $this->dispatch();\n }",
"public function execute() {\n\t\t$controller = $this->manager->get($this->getController());\n\t\t$reflection = new \\ReflectionClass($controller);\n\t\t$controller->run( $this->getAction($reflection) );\n\t}",
"public static function dispatch(&$request) {\r\n // inizializziamo la sessione\r\n session_start();\r\n\r\n if (isset($request[\"page\"])) {\r\n switch ($request[\"page\"]) {\r\n case \"master\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"accesso\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovi\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovicode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovicodeid\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"inserisci\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"inseriscicode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"logincode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"mappa\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"mappacode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"totaleprodotti\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"totaleprodotticode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contatta\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattacode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattaleggi\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattaleggiform\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"documentazione\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"logout\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n default:\r\n self::write404();\r\n break;\r\n }\r\n } else {\r\n $request[\"page\"] = \"master\";\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n echo '<script language=javascript>document.location.href=\"index.php?page=master\"</script>';\r\n }\r\n }",
"public static function dispatch()\n {\n // Melde alle Fehler außer E_NOTICE\n //error_reporting(E_ALL & ~E_NOTICE);\n\n $controllerName = UriParser::getControllerName().'Controller';\n $className = 'App\\\\Controller\\\\'.$controllerName;\n $methodName = UriParser::getMethodName();\n\n // Eine neue Instanz des Controllers wird erstellt und die gewünschte\n // Methode darauf aufgerufen.\n $controller = new $className();\n $controller->$methodName();\n }",
"public function dispatch()\n {\n $this->response = $this->frontController->execute();\n }",
"protected function executeAction() {\n \n }",
"function dispatch_route($controller, $action, array $parameters){\r\n\t\t$this->current_controller = $controller;\r\n\t\t$this->current_action = $action;\r\n\t\t\r\n\t\t$result = $this->call_action($controller, $action, $parameters);\r\n\t\t\r\n\t\t$response = $this->handle_result($result);\r\n\t\t\r\n\t\treturn $response;\r\n\t}",
"function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }",
"public function run()\n \t{\n \t\t$controller = $this->factoryController();\n\n \t\t$action = $this->_currentAction;\n\n \t\t$controller->$action();\n \t}",
"public function invoke()\r\n\t{\r\n\t\tif(isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$pageName = $_GET['page'];\r\n\t\t\t$this->loadPage($pageName);\r\n\t\t}\r\n\t\telseif(!isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$this->loadPage('home');\r\n\t\t}\r\n\t}",
"public function getControllerAction()\n\t{\n\t\tif (file_exists('Controller/' . $this->class_Name . 'Controller.php')) {\n\t\t\tinclude_once 'Controller/' . $this->class_Name . 'Controller.php';\n\t\t\t$executeClass = new $this->class_Name;\n\t\t\t$executeAction = $this->action_Name;\n\t\t} else {\n\t\t\t$this->pageDontExist();\n\t\t}\n\t\tif (method_exists($executeClass, $executeAction)) {\n\t\t\t$executeClass->$executeAction();\n\t\t\t}\n\t}",
"public function run()\n\t{\n\t\t$_controller = $this->getController();\n\t\t\n\t\tif ( ! ( $_controller instanceof IXLRest ) )\n\t\t{\n\t\t\t$_controller->missingAction( $this->getId() );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tCall the controllers dispatch method...\n\t\t$_controller->dispatchRequest( $this );\n\t}",
"public function redirect() : void\n {\n $controller = $this->getNamespace() . $this->params['controller'];\n $action = $this->capitalizeAction($this->params['action']);\n\n if (class_exists($controller)) \n {\n $controller = new $controller;\n unset($this->params['controller']);\n\n if (is_callable([$controller, $action])) \n {\n unset($this->params['action']);\n unset($this->params['namespace']);\n }\n else\n {\n die('Page not found.');\n }\n }\n else \n {\n header('location: ' . URLROOT);\n }\n\n call_user_func_array([$controller, $action], [$this->params]);\n }",
"protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }",
"public static function actionA() {\n // …\n }",
"public function executeRequest() {\n $this->splitURL();\n $this->validateRequest();\n\n // Create controller to dispatch our request, eg new BlogsController\n // Note format eg $dispatch = new BlogsController('Blog', 'blogs', 'index')\n $model = ucwords(rtrim($this->controller, 's'));\n $controller = ucwords($this->controller) . 'Controller';\n $dispatch = new $controller($model, $this->controller, $this->action);\n\n // Execute\n if (!isset($this->parameter1)) {\n call_user_func(array($dispatch, $this->action));\n } else if (!isset($this->parameter2)) {\n call_user_func(array($dispatch, $this->action), $this->parameter1);\n } else if (!isset($this->parameter3)) {\n call_user_func(array($dispatch, $this->action), $this->parameter1, $this->parameter2);\n } else {\n call_user_func(array($dispatch, $this->action), $this->parameter1, $this->parameter2, $this->parameter3);\n }\n }",
"public function invoke() {\r\n $this->action = Util::getAction($this->action);\r\n \r\n switch ($this->action) {\r\n case 'customer_login':\r\n $this->processCustomerLogin();\r\n break;\r\n case 'get_customer':\r\n $this->processGetCustomer();\r\n break;\r\n case 'show_registration':\r\n $this->processShowRegistration();\r\n break;\r\n case 'register_product':\r\n $this->processRegisterProduct();\r\n break;\r\n case 'logout':\r\n $this->processLogout();\r\n break;\r\n default:\r\n $this->processCustomerLogin();\r\n break;\r\n }\r\n }",
"public function\n\t\tdo_actions()\n\t{\n\t}",
"public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }",
"function call($controller, $action)\n{\n require_once('controllers/' . $controller . '_controller.php');\n\n // create a new instance of the needed controller\n switch ($controller) {\n //for non-data-driven pages use the PagesController class\n case 'body_parts':\n $controller = new BodyPartsController();\n break;\n case 'pages':\n $controller = new PagesController();\n break;\n case'difficulty':\n $controller = new DifficultyController();\n break; \n case'filter':\n $controller = new HomePageController();\n break;\n case 'users':\n $controller = new UsersController();\n break;\n case 'posts':\n $controller = new PostsController();\n break;\n case 'login':\n $controller = new LoginController();\n break;\n case 'comments':\n $controller = new CommentsController();\n break;\n case 'images':\n $controller = new ImagesController();\n break;\n\n //we will need to add a separate case for each controller\n default:\n //for all data-driven pages use a specific Controller class\n //we need the model to query the database later in the process\n require_once(\"models/{$controller}.php\");\n $controllerClassName = $controller . 'Controller';\n $controller = new $controllerClassName();\n break;\n }\n // call the requested action\n $controller->{$action}();\n}",
"public function controller()\r\n {\r\n $collector = $this->getControllerCollector();\r\n \r\n foreach (func_get_args() as $controller) {\r\n call_user_func([$collector, 'controller'], $controller);\r\n }\r\n }",
"public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function preDispatch()\n\t{\n\t\t$this->_actionController->initView();\n\t\t\n\t\t// We have to store the values here, because forwarding overwrites\n\t\t// the request settings.\n\t\t$request = $this->getRequest();\n\t\t$this->_lastAction = $request->getActionName();\n\t\t$this->_lastController = $request->getControllerName();\n\t}",
"private function Dispatch()\n {\n /*\n * for the security of the admin portal we will check every time here before any class get called if\n * this user is logged in or not, if not logged in then we will take him to the login,\n * else let him continue to the admin dashboard.\n * and same goes for the users. by this we ensure that no one will be able to access\n * any portal unless he is logged in with the right credentials.\n * also if the user tries to go to the login page and he's already logged in then we will\n * take him to the homepage, no logged in user should be able to go to the login page.\n * */\n// if ($this->_controller == 'admin') {\n// if (Session::Exists('logged_in') !== true || Session::Get('logged_in')->role !== 'admin') {\n// $this->_controller = 'login';\n// $this->_action = 'default';\n//// Redirect::To('login/login', true);\n// }\n// } elseif ($this->_controller == 'user') {\n// if (Session::Exists('logged_in') !== true || Session::Get('logged_in')->role !== 'user') {\n// $this->_controller = 'login';\n// $this->_action = 'default';\n//// Redirect::To('login/default', true);\n// }\n// } elseif ($this->_controller == 'login') {\n// if (Session::Exists('logged_in') == true) {\n// Redirect::Home();\n// }\n// }\n\n /*\n * first we make the controller name we got from the url full, which means add to it the namespace first,\n * then make the first litter of the class capital case (which is what we will do in all our classes),\n * then at the end add the work 'Controller'.\n * so now for example the work index we got from the URL will become: Qiggs\\Controllers\\IndexController\n * in this case, the autoload class will be able to know which class is this.\n * */\n $controllerClassName = 'Framework\\Controllers\\\\' . ucfirst($this->_controller) . 'Controller';\n\n /*\n * for the frontcontroller to be able to call a function at the controller automatically just by splitting the url,\n * we have to add Action after the function/action name, it's like a secret code between us so it can be able to\n * identify an action method and call it.\n * the DefaultAction get called if the url is: www.x.com/index/default ->\n * index: the controller class name,\n * default: the action/function's name\n */\n $actionName = ucfirst($this->_action) . 'Action';\n\n // check first if this controller class exists, if not then take him to the not found class\n if (!class_exists($controllerClassName)) {\n $controllerClassName = self::NOT_FOUND_CONTROLLER;\n }\n\n // if everything is ok so far then initiate the class\n $controller = new $controllerClassName();\n\n // check if the function (action) exists in that initiated class, if not then display 404 not found (not found action).\n if (!method_exists($controller, $actionName)) {\n $this->_action = $actionName = self::NOT_FOUND_ACTION;\n }\n\n // inside of the class that got initiated (in their parent class to be specific, inside Abstract Controller)\n // set these variables (the name of the controller and action and parameters)\n // in case of we needed to use them there and of course inside the controller class we don't have access\n // to this class so this is the perfect way to parse these values there.\n $controller->SetContActParam($this->_controller, $this->_action, $this->_params);\n\n // finally call the function (action) at the class (controller) that got initiated.\n $controller->$actionName();\n\n // now we called a class and also called an action/function in that class so this file will now go to the\n // called class and action.\n }",
"public function _doAction();",
"public function execute()\n {\n $path=$this->getPath();\n try\n {\n Log::info('Trying module '.$this->module);\n \t$this->page = $this->moduleInstance($this->module,$path,$this->params);\n\n \ttry\n \t{\n Log::info('Trying action '.$this->action);\n \t\t $this->page->executeAction($this->action);\n \t}\n catch (SecurityException $e) {\n $this->handleSecurity();\n }\n catch (Error404Exception $e) {\n $this->returnActionNotFound();\n }\n catch (Exception $e)\n {\n Log::info('Action '.$this->action.' rejected for module '.$this->module.', trying index instead ');\n Log::info('Reason : '.$e->getMessage());\n $this->page->handleException($e);\n }\n\n }\n catch (Error404Exception $e) {\n\n $this->returnModuleNotFound();\n }\n catch (SecurityException $e) {\n $this->handleSecurity();\n }\n catch (Exception $e)\n {\n\n Log::info('Error module '.$this->module.'. Revealing as 404');\n \t $this->page = $this->moduleInstance('error',$path);\n $this->page->executeAction('404');\n }\n Log::info($this->module.'/'.$this->action.' executed successfully');\n }",
"public function onDispatch(MvcEvent $e)\n {\n $uri = $this->getRequest()->getUri();\n $this->setHost($uri->getHost());\n $this->getPageOptions()->setArticle($this->params()->fromRoute('article', false));\n $this->getPageOptions()->setCategory($this->params()->fromRoute('category', false));\n $this->getPageOptions()->setTag($this->params()->fromRoute('tag', false));\n $this->getPageOptions()->setTagvalue($this->params()->fromRoute('tagvalue', false));\n \n $defaultRole = $this->getServiceLocator()->get('Contentinum\\Acl\\DefaultRole');\n $acl = $this->getServiceLocator()->get('Contentinum\\Acl\\Acl');\n \n if ('index' !== $this->pageOptions->resource) {\n $authService = $this->getServiceLocator()->get('User\\Authentication');\n if (! $authService->hasIdentity()) {\n return $this->redirect()->toUrl('/login');\n } else {\n $this->setIdentity($authService->getIdentity());\n }\n } \n \n \n if (method_exists($this, 'prepare')) {\n $this->prepare();\n }\n \n $this->setXmlHttpRequest($this->getRequest()->isXmlHttpRequest());\n $routeMatch = $e->getRouteMatch();\n if ($this->getRequest()->isPost()) {\n \n $app = $this->process($this->getPageOptions(), $this->page, $defaultRole, $acl);\n if (! $this->getXmlHttpRequest()){ \n $e->getRouteMatch()->setParam('action', 'application');\n $app = $this->application($this->getPageOptions(), $this->page, $defaultRole, $acl); \n }\n } else {\n $e->getRouteMatch()->setParam('action', 'application');\n $app = $this->application($this->getPageOptions(), $this->page, $defaultRole, $acl);\n }\n $e->setResult($app);\n return $app;\n }",
"public function execute()\n {\n if ($this->argument === NULL) {\n $this->controller->{$this->action}();\n }\n else {\n $this->controller->{$this->action}($this->argument);\n }\n\n // TODO: check for non-default template\n $template = DEFAULT_TEMPLATE;\n\n $view = new AppView($this->page, $template);\n $view->show_view_with_context_variables($this->controller->getModelViewContext());\n }",
"public function getControllerAction() {}",
"public function executeAction() {\r\n\t\t\r\n\t}",
"protected function executeAction() {\r\n\t\t$this->objectAction->validateAction();\r\n\t\t$this->objectAction->executeAction();\r\n\t\t\r\n\t\t$this->handleResult();\r\n\t}",
"public function action(){\n\t\t\t$this->__switchboard('action');\n\t\t}",
"function execute()\n\t{\t\n\t\t// Check for requested action\n\t\t$app_action = isset($_REQUEST['ax']) ? $_REQUEST['ax'] : 'startup_view';\n\t\t\n\t\tif(method_exists($this,$app_action))\n\t\t{\n\t\t\t// Call requested action\n\t\t\t$this->$app_action();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->default_action($app_action);\n\t\t}\n\t}",
"public function run()\n {\n if ($this->match()) {\n $path = 'AlDente\\controllers\\\\' . ucfirst($this->params['controller']) . 'Controller';\n if (class_exists($path)) {\n $action = $this->params['action'] . 'Action';\n if (method_exists($path, $action)) {\n $controller = new $path($this->params);\n $controller->$action();\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n }",
"public function postAction() {\n\t\t\t$this->_forward('index');\n\t }",
"private function actions()\n {\n }",
"function call($controller,$action)\n{\n //include the controller file that matches the controller needed\n require_once ('controllers/'.$controller.'_controller.php');\n //create an instance of the needed controller\n switch ($controller){\n case 'pages':\n $controller = new pagesController();\n break;\n case 'posts':\n require_once ('model/dataMappers/article/class.article.php');\n require_once ('model/dataMappers/article/class.rates.php');\n $controller = new Postscontroller();\n break;\n case 'signup':\n require_once('model/dataMappers/register/class.register.php');\n $controller = new Signupcontroller();\n break;\n case 'login':\n $controller = new Login();\n break;\n }\n //call the needed action\n //say home action is called, call will be $controller->home();\n $controller->{ $action }();\n}",
"public function action()\n {\n foreach ($this->actions as $action) {\n $action->run();\n }\n }",
"protected function action()\n {\n switch($this->action)\n {\n case 'load':\n $this->load();\n break;\n }\n }",
"private function executeAction($controller, $action) {\t\tif(!method_exists($controller, $action))\n\t\t\t$action = 'index';\n\t\t// Finally call controller method\n\t\t$controller->$action();\n\t}",
"function Execute()\n\t\t{\n\t\t\t$controller = new $this->CONTROLLER();\n\t\t\t$controller->Initialise($this->get, $this->post, $this->files);\n\t\t\t$controller->StartFilters();\n\t\t\t$controller->{$this->ACTION}();\n\t\t\t$controller->StopFilters();\n\t\t}",
"public function process(string $controller, string $action, array $parameters, CoreInterface $core);",
"private function do_action($params)\n {\n }",
"public function perform()\n {\n // template var with charset used for the html pages\n $this->viewVar['charset'] = $this->config->getModuleVar('common', 'charset');\n $this->viewVar['cssFolder'] = JAPA_PUBLIC_DIR . 'styles/'.$this->config->getModuleVar('common', 'styles_folder');\n $this->viewVar['urlBase'] = $this->router->getBase(); \n $this->viewVar['loggedUserRole'] = $this->controllerVar['loggedUserRole'];\n $this->viewVar['isUserLogged'] = $this->controllerVar['isUserLogged'];\n $this->viewVar['adminWebController'] = $this->config->getVar('default_module_application_controller'); \n \n $this->viewVar['text'] = array();\n\n // get text for the front page\n $this->model->action('misc','getText', \n array('id_text' => 1,\n 'result' => & $this->viewVar['text'],\n 'fields' => array('body'))); \n \n // get result of the header and footer controller\n // \n $this->viewVar['header'] = $this->controllerLoader->header(); \n $this->viewVar['footer'] = $this->controllerLoader->footer(); \n $this->viewVar['rightBorder'] = $this->controllerLoader->rightBorder(); \n }",
"public function pageAction($action = 'goToPage')\n {\n if ($this->dictionary['type'] != 'external') {\n $search = $this->createSearchObject();\n $result = $search->$action($this->view->volume, $this->view->page);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $volume = $this->view->volume === '' ? 'null' : $this->view->volume;\n $action = sprintf('%s::%s(%s, %s)', get_class($search), $action, $volume, $this->view->page);\n\n $this->view->actionTrace = [\n 'action' => $action,\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n }\n }",
"function execute($action) {\r\n // Use system set of templates\r\n $this->addHelper('form', 'format', 'html', 'page', 'pagination', 'url');\r\n \r\n // Use controller template if exists\r\n if($this->engine->helperExists($this->getControllerName())) {\r\n $this->addHelper($this->getControllerName());\r\n } // if\r\n \r\n try {\r\n $execution = parent::execute($action);\r\n if($this->getAutoRender()) {\r\n if(is_array($execution)) {\r\n $this->assignToView($execution);\r\n } // if\r\n $this->render(); // Auto render?\r\n } // if\r\n } catch(Angie_Controller_Error_ActionDnx $e) {\r\n $view_name = $action;\r\n $layout_name = $this->getControllerName();\r\n \r\n if($this->getAutoRender() && $this->engine->viewExists($view_name, $layout_name)) {\r\n $this->setView($view_name);\r\n $this->setLayout($layout_name);\r\n \r\n $this->render();\r\n } else {\r\n throw $e; // rethrow\r\n } // if\r\n } catch(Exception $e) {\r\n throw $e;\r\n } // try\r\n }",
"function handleAction(){\n\t\n\t$controller = getController();\n\t$viewState = getViewState();\t\n\n\t// ************************ THE FRONT CONTROLLER *********************** //\n\tif ( isset ($_GET[ ACTION_KEY ]) ){\n\n\t\tswitch ($_GET[ ACTION_KEY ]) {\n\t\t \n\t\t case 'deletetodo':\n\t\t \n\t\t $controller->deleteToDo( $_GET[ 'id' ] );\n\n\t\t $viewState->setView('list.php');\n\t\t \t$viewState->setData( $controller->listToDo() );\n\n\t\t \t$viewState->setResponse('The Todo Was Deleted', 'success');\n\t\t \n\t\t break;\n\n\t\t case 'edittodo':\n\n\t\t \t$viewState->setView('edit.php');\n\t\t \t$viewState->setData( $controller->getToDo( $_GET[ 'id' ] ) );\n\n\t\t break;\n\n\t\t case 'savetodo':\n\n\t\t \t// handle the checkbox\n\t\t \tif( !isset( $_POST['complete'] ) ){\n\t\t \t\t$_POST['complete'] = false;\n\t\t \t} else {\n\t\t \t\t$_POST['complete'] = true;\n\t\t \t}\n\n\t\t \t$controller->saveToDo($_POST);\n\n\t\t $viewState->setView('list.php');\n\t\t \t$viewState->setData( $controller->listToDo() );\n\n\t\t \t$viewState->setResponse('The Todo Was Saved', 'success');\n\n\t\t break;\n\n\t\t case 'deletecompleted':\n\n\t\t \t$controller->deleteCompleted();\n\n\t\t \t$viewState->setView('list.php');\n\t\t \t$viewState->setData( $controller->listToDo() );\n\n\t\t \t$viewState->setResponse('Completed ToDos Were Cleared', 'info');\n\n\t\t \tbreak;\n\t\t \n\t default:\n\t \n\t $viewState->setView('list.php');\n\t\t $viewState->setData( $controller->listToDo() );\n\t\t}\n\t} else {\n\n\t\t$viewState->setView('list.php');\n\t\t$viewState->setData( $controller->listToDo() );\t\n\t}\n}",
"public function dispatch($url){\n $url = $this->removeQueryStringVariables($url);\n \n if($this->match($url)){\n $controller = $this->params['controller'];\n $controller = $this->convertToStudlyCaps($controller);\n $controller = $this->getNamespace() . $controller;\n if(class_exists($controller)){\n $controller_object = new $controller($this->params);\n $action = $this->params['action'];\n $action = $this->convertToCamelCase($action);\n $methodVariable = array($controller_object, $action);\n if(is_callable($methodVariable, false)){\n $controller_object->$action();\n } else{\n //echo \"Method $action not found in $controller\";\n throw new \\Exception(\"Method $method nof found in (controller $controller)\");\n }\n } else{\n throw new \\Exception(\"Controller class $controller not found\");\n }\n \n } else{\n echo \"$url not found\";\n }\n \n }",
"abstract public function forward($actionName, $controllerName = null, $extensionName = null, array $arguments = null);",
"public function SetControllerAction ($controllerAction);",
"private static function dispatchAction($controller, $action = null) {\n\t\t//$_GET = self::filterGET();\n\t\t// Is er een action meegegeven, anders standaard actie gebruiken\n\t\tif ($action === null) {\n\t\t\t$action = self::getAction($controller);\n\t\t}\n\t\t\n\t\t// Als de action niet bestaat een ActionDoesNotExistException throwen\n\t\tif (!method_exists($controller, $action)) {\n\t\t\tthrow new ActionDoesNotExistException();\n\t\t\t//sreturn false;\n\t\t}\n\t\t\n\t\t// Call the before filter method\n\t\t$controller->beforeFilter();\n\t\t\n\t\t// Checken welke parameters de methode heeft, en welke vereist zijn en welke niet.\n\t\t$ref = new ReflectionMethod($controller, $action);\n\t\t$params = $ref->getParameters();\n\t\t$required = 0;\n\t\t\n\t\t// Als er parameters vereist zijn\n\t\tif (count($params) > 0) {\n\t\t\tforeach($params as $param) {\n\t\t\t\tif (!$param->isOptional()) {\n\t\t\t\t\t$required++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t$params = self::getParams($_GET, $controller);\n\t\t\t\n\t\t\t// Als het aantal gegeven parameters kleiner is dan het aantal vereiste parameters, dan zijn er parameters te kort.\n\t\t\tif (count($params) < $required) {\n\t\t\t\tthrow new MissingArgumentsException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tswitch(count($params)) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$controller->{$action}($params[0]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t$controller->{$action}($params[0], $params[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t$controller->{$action}($params[0], $params[1], $params[2]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\t$controller->{$action}($params[0], $params[1], $params[2], $params[3]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcall_user_func_array(array($controller, $action), $params);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Voer een action uit zonder parameters\n\t\t\t$controller->{$action}();\n\t\t}\n\t\t\n\t\t// Call the afterFilter method\n\t\t$controller->afterFilter();\n\t}",
"public static function forward() {\n\t\t\t\n\t\t\t$url = HttpRequest::parsedQuery();\n\t\t\t\n\t\t\tif ( isset($url[0]) ) {\n\t\t\t\n\t\t\t\t$url[0] = ucwords($url[0]);\n\t\t\t\t\n\t\t\t\tif ( file_exists(path('application').'controllers'.DS.$url[0].'.php') ) {\n\t\t\t\t\t\n\t\t\t\t\tstatic::$_controller = $url[0];\n\t\t\t\t\t\n\t\t\t\t\tunset($url[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trequire_once( path('application').'controllers'.DS.static::$_controller.'.php' );\n\t\t\t\n\t\t\tstatic::$_controller = new static::$_controller();\n\t\t\t\n\t\t\tif ( isset($url[1]) ) {\n\t\t\t\t\n\t\t\t\t$url[1] = strtolower($url[1]);\n\t\t\t\t\n\t\t\t\tif ( method_exists(static::$_controller, $url[1]) ) {\n\n\t\t\t\t\tstatic::$_action = $url[1];\n\t\t\t\t\t\n\t\t\t\t\tunset($url[1]);\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\t\tstatic::$_parameters = $url ? array_values($url) : [];\n\t\t\t\n\t\t\tunset($url);\n\t\t\t\n\t\t\tcall_user_func_array([static::$_controller, static::$_action], static::$_parameters);\n\t\t}",
"protected function getAction() {}",
"protected function ExecAction() {\r\n if (self::$sAction == \"new\")\r\n //self::$sAction = \"edit\";\r\n self::$sAction = \"add\";\r\n\r\n // Ищем контроллер\r\n $sControllerPath = \"/var/www/ad/app/controllers/\".self::$sController.\"_controller.php\";\r\n if (file_exists($sControllerPath)) {\r\n require_once($sControllerPath);\r\n\r\n $aClassPathComponents = explode(\"/\",self::$sController);\r\n $sClass = $aClassPathComponents[count($aClassPathComponents)-1];\r\n $sClass = ucfirst($sClass);\r\n $sClass = preg_replace_callback('/_([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $sClass);\r\n $sControllerClass = $sClass.\"Controller\";\r\n\r\n $this->oController = new $sControllerClass(self::$sController,self::$sAction);\r\n $this->oController->parameters = self::$aParameters;\r\n\r\n foreach(self::$aObjects as $oObject) {\r\n $sName = strtolower(get_class($oObject));\r\n $this->oController->$sName = $oObject;\r\n }\r\n call_user_func_array(array($this->oController,self::$sAction),self::$aObjects);\r\n\r\n return true;\r\n }\r\n }",
"public function dispatch($controller, $action, $params) {\n\t\t// Include Controller File\n\t\trequire_once \"src/{$controller}.php\";\n\t\t// Load Action\n\t\t$controller .= 'Controller';\n\t\t$action.= 'Action';\n\t\t$c = new $controller($controller, $action, $params);\n\t\t$c->$action($params);\n\t\treturn;\n\t}"
] | [
"0.685324",
"0.6655799",
"0.6588958",
"0.65379184",
"0.65329146",
"0.64895004",
"0.64130956",
"0.6410554",
"0.6375605",
"0.6331509",
"0.6330825",
"0.6330825",
"0.6330825",
"0.63155687",
"0.6293023",
"0.62606895",
"0.6225598",
"0.62163305",
"0.6216201",
"0.621201",
"0.6204824",
"0.6204095",
"0.6200487",
"0.6196683",
"0.61659825",
"0.6165746",
"0.6164071",
"0.6140146",
"0.6136182",
"0.6132449",
"0.61297774",
"0.6128502",
"0.61014813",
"0.61003065",
"0.60970545",
"0.6087977",
"0.6085648",
"0.60561204",
"0.6043138",
"0.60342354",
"0.60170037",
"0.6013446",
"0.6003404",
"0.5999971",
"0.59964633",
"0.59883",
"0.59878033",
"0.59867805",
"0.5978027",
"0.59717727",
"0.59643036",
"0.59584725",
"0.59378755",
"0.5936075",
"0.59061676",
"0.58966005",
"0.5893215",
"0.5885473",
"0.5885169",
"0.5881627",
"0.5877026",
"0.5874477",
"0.5869237",
"0.5854708",
"0.5854604",
"0.5853043",
"0.5839252",
"0.58350617",
"0.5825561",
"0.58231175",
"0.5820176",
"0.58190763",
"0.5806304",
"0.57958555",
"0.57896864",
"0.57710433",
"0.57707804",
"0.5761049",
"0.5759192",
"0.5753869",
"0.57537764",
"0.5747806",
"0.5746853",
"0.57443565",
"0.5735309",
"0.5732495",
"0.5728812",
"0.5717556",
"0.5714372",
"0.5710854",
"0.568551",
"0.56847584",
"0.56839395",
"0.56807274",
"0.5674501",
"0.5666735",
"0.56665367",
"0.5666307",
"0.5664567",
"0.565712"
] | 0.64251643 | 6 |
Retrieves the action from the $_GET. Also replaces "" into "_". | public static final function getAction(\phpbb\request\request $request) {
$action = $request->variable("action", AController::DEFAULT_ACTION);
return str_replace("-", "_", strtolower($action));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }",
"public function get_action() {\n\t\t$action\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (isset($_GET['action']))? preg_replace('@[^a-zA-Z0-9_]@', '', $_GET['action']) : $this->conf('default_action');\n\t\t\n\t\t# Return the Action\n\t\treturn $action;\n\t}",
"private static function getAction() {\n $action = \"index\";\n if (isset($_GET['action']) && trim($_GET['action']) != \"\") $action = $_GET['action'];\n return $action;\n }",
"public function getActionName(){\n\t\tif ( !isset($_GET['action'])){\n\t\t\treturn 'defaultAction';\n\t\t}\n\t\telse{\n\t\t\treturn $_GET['action'];\n\t\t}\n\t}",
"function getAction()\n {\n if (isset($_GET['_px_action'])) {\n return $_GET['_px_action'];\n }\n return $_SERVER['QUERY_STRING'];\n }",
"public function get_action() {\r\n\t\treturn esc_url_raw( $this->action ? $this->action : wp_unslash( $_SERVER['REQUEST_URI'] ) );\r\n\t}",
"function get_action() {\n \t\tglobal $argv;\n\t\treturn strtolower(trim($argv['1']));\n\t}",
"public function getActionName()\n\t{\n\t\t$explodedArray = explode('/', $_SERVER['REQUEST_URI']);\n\n\t\tif(array_key_exists(2, $explodedArray) && !empty($explodedArray[2])){\n\n\t\t\tif (strpos($explodedArray[2], '?')) {\n\t\t\t\t$localAction = explode('?', $explodedArray[2]);\n\t\t\t\t$this->actionName = $localAction[0];\n\t\t\t} else $this->actionName = $explodedArray[2];\n\n\t\t} else\n\t\t\t$this->actionName = 'index';\n\t}",
"public function getAction()\n\t{\n\t\t$action = strtolower($this->getParam(self::ACTION_PARAM));\n\t\tif ($action === '' or ! preg_match('/^[a-z0-9_-]+$/', $action)) {\n\t\t\treturn Controller::DEFAULT_ACTION;\n\t\t}\n\n\t\treturn $action;\n\t}",
"public function getAction($ucfirst=true){\r\n\t\tif(is_array($this->matchedRoute) && isset($this->matchedRoute['action_regex'])){\r\n\t\t\tif($this->matchedRoute['action_regex'] == true){\r\n\t\t\t\t$this->action = 'Reg'.sha1($this->matchedRoute['action']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($ucfirst){\r\n\t\t\t$o = ucfirst($this->action);\r\n\t\t} else {\r\n\t\t\t$o = strtolower($this->action);\r\n\t\t}\r\n\t\treturn $o;\r\n\t}",
"protected function getActionInput(): string\n\t{\n\t\treturn trim($this->option('action'));\n\t}",
"protected function getActionMethod(string $action): string\n {\n $sentence = preg_replace('/[\\W_]+/', ' ', $action);\n return lcfirst(str_replace(' ', '', ucwords($sentence)));\n }",
"public static function getAction() {\n\t return self::getPathParams()['action'];\n\t}",
"private function getActionName()\n {\n return strtolower($this->_request->getActionName());\n }",
"protected function validateAction() {\n\t\tif (isset($_POST['Action']) || isset($_POST['action'])) {\n\t\t\tif (isset($_POST['Action'])) {\n\t\t\t\t$action = htmlspecialchars($_POST['Action']);\n\t\t\t} else {\n\t\t\t\t$action = htmlspecialchars($_POST['action']);\n\t\t\t}\t\n\t\t\treturn strtolower($action);\n\t\t\t\n\t\t} else if (isset($_GET['Action']) || isset($_GET['action'])) {\n\t\t\tif (isset($_GET['Action'])) {\n\t\t\t\t$action = htmlspecialchars($_GET['Action']);\t\n\t\t\t} else {\n\t\t\t\t$action = htmlspecialchars($_GET['action']);\n\t\t\t}\n\t\t\treturn strtolower($action);\n\t\t\t\n\t\t} else {\n\t\t\tif (headers_sent()) {\n\t\t\t\treturn $this->getDefaultActionAfterHeaders();\n\t\t\t} else {\n\t\t\t\theader(\"Location: \".$this->getDefaultAction());\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}",
"private function fetchaction($data)\n\t{\n\t\t$pattern = \"<input type=\\\"hidden\\\" name=\\\"Action\\\" id=\\\"Action\\\" value=\\\"\";\n\t\t$pos = strpos($data, $pattern);\n\t\tif($pos > -1)\n\t\t\t$this->action = substr($data, $pos + strlen($pattern), strpos(substr($data, $pos + strlen($pattern)), \"\\\"\"));\n\t}",
"function map_action($action) {\n return $action . '_action';\n }",
"function getAction () {return $this->getFieldValue ('action');}",
"protected function getAction(): string\n\t{\n\t\treturn $this->getActionInput() ?: $this->getDefaultAction($this->getNameInput());\n\t}",
"public function handleGetAction($get_array)\n {\n $action = '';\n\n switch ($get_array['action']) {\n case 'bijwerken':\n // Indicate current action is update if id provided\n if (!is_null($get_array['vraagId'])) {\n $action = $get_array['action'];\n }\n break;\n\n case 'verwijderen':\n // Delete current id if provided\n if (!is_null($get_array['vraagId'])) {\n $this->verwijderVraag($get_array);\n }\n $action = 'verwijderen';\n break;\n default:\n // Oops\n break;\n }\n return $action;\n }",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"public function getAction()\n {\n return $this->joUrl['ACTION'];\n }",
"public static function getActionFunction()\n\t{\n\t\t$params = self::getAllURLParams();\n\t\t$pos = contrlPos + 1;\n\t\treturn (!empty($params[$pos])) ? $params[$pos] : 'index';\n\t}",
"static function get_action_parameter()\r\n {\r\n return self :: PARAM_ACTION;\r\n }",
"public function get_usable_action_name( $action_name ) {\n\n\t\t$action_name = sanitize_title_with_dashes( $action_name, false, 'save' );\n\t\t$action_name = str_replace( '-', '_', $action_name );\n\n\t\treturn $action_name;\n\n\t}",
"public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}",
"function gtags_action_clean( $action ) {\n\t$action = str_replace( ' started the discussion topic', ' started', $action );\n\t$action = str_replace( ' posted on the discussion topic', ' posted on', $action );\t\n\treturn $action;\n}",
"static public function actionToRequest($action)\n\t{\n\t\treturn $action . 'Rq';\n\t}",
"public function obfuscateMethodNames($action)\n\t{\n\treturn $action;\t\n\t}",
"protected function getActionMethod($action)\n {\n// $method = implode('', $action_arr);\n $method = 'handle_' . $action;\n return $method;\n }",
"protected function beforeAction($action) {\n\t\t/* Double urlencode should be performed in view files in order to avoid\n\t\t problem if \"AllowEncodedSlashes\" is disabled at web server.\n\t\t So additional urldecoding is required. */\n\t\tif (array_key_exists('name', $_GET)) {\n\t\t\t$_GET['name'] = urldecode($_GET['name']);\n\t\t}\n\t\treturn true;\n\t}",
"public function getAction() : string{\n return $this->action;\n }",
"public static function getPostAction(){\n if(isset($_POST['dg_action'])){\n return key($_POST['dg_action']);\n }\n }",
"function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}",
"static public function requestToAction($request)\n\t{\n\t\treturn substr($request, 0, -2);\n\t}",
"function action($action, $forwarder = \"\") {\n \n global $CONFIG;\n \n\t $query = parse_url($_SERVER['REQUEST_URI']);\n\t\t\tif (isset($query['query'])) {\n\t\t\t\t$query = $query['query'];\n\t\t\t\t$query = rawurldecode($query);\n\t\t\t\t$query = explode('&',$query);\n\t\t\t\tif (sizeof($query) > 0) {\n\t\t\t\t\tforeach($query as $queryelement) {\n\t\t\t\t\t\t$vals = explode('=',$queryelement);\n\t\t\t\t\t\tif (sizeof($vals) > 1) {\n\t\t\t\t\t\t\tset_input(trim($vals[0]),trim($vals[1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \n $forwarder = str_replace($CONFIG->url, \"\", $forwarder);\n $forwarder = str_replace(\"http://\", \"\", $forwarder);\n $forwarder = str_replace(\"@\", \"\", $forwarder);\n\n if (substr($forwarder,0,1) == \"/\") {\n $forwarder = substr($forwarder,1);\n }\n \n if (isset($CONFIG->actions[$action])) {\n \tif (\n \t\t(isadminloggedin()) ||\n \t\t(!$CONFIG->actions[$action]['admin'])\n \t) {\n\t if ($CONFIG->actions[$action]['public'] || $_SESSION['id'] != -1) {\n\t \t\n\t \t// Trigger action event TODO: This is only called before the primary action is called. We need to rethink actions for 1.5\n\t \t$event_result = true;\n\t \t$event_result = trigger_plugin_hook('action', $action, null, $event_result);\n\t \t\n\t \t// Include action\n\t \tif ($event_result) // Event_result being false doesn't produce an error - since i assume this will be handled in the hook itself. TODO make this better!\n\t \t{\n\t\t\t if (@include($CONFIG->actions[$action]['file'])) {\n\t\t\t } else {\n\t\t\t register_error(sprintf(elgg_echo('actionundefined'),$action));\n\t\t\t }\n\t \t}\n\t } else {\n\t register_error(elgg_echo('actionloggedout'));\n\t }\n \t}\n } else {\n \tregister_error(sprintf(elgg_echo('actionundefined'),$action));\n }\n forward($CONFIG->url . $forwarder);\n \n }",
"function utilSupportActionQuery()\n{\n\tprint <<<EOC\n<script>\nwindow.addEventListener('load', () => {\n\tlet forms = document.getElementsByTagName('FORM');\n\tfor (let i = 0; i < forms.length; i++) {\n\t\tlet form = forms.item(i);\n\t\tlet parsed = new URL(form.action);\n\t\tif (!parsed.search) {\n\t\t\tcontinue;\n\t\t}\n\t\tlet params = parsed.search.substr(1).split('&');\n\t\tparams.forEach(param => {\n\t\t\tlet name, value;\n\t\t\t[name, value] = param.split('=');\n\t\t\tlet input = document.createElement('INPUT');\n\t\t\tinput.type = 'hidden';\n\t\t\tinput.name = name;\n\t\t\tinput.value = decodeURIComponent(value);\n\t\t\tform.appendChild(input);\n\t\t});\n\t}\n});\n</script>\nEOC;\n}",
"public function getAction(): string\n {\n return $this->action;\n }",
"public function getAction(): string\n {\n return $this->action;\n }",
"public function get_action() {\n $this->process($this->urls);\n \n if (!empty($this->actionPath)) {\n return $this->actionPath;\n }\n return false;\n }",
"public function getCurrentAction() {\n\t\treturn $this->request->get('action','undefined');\n\t}",
"private function rebuildGet()\n {\n $url = $_SERVER['REQUEST_URI'];\n $pos = strpos($url, '?');\n \n if ($pos !== false)\n {\n parse_str(substr($url, $pos+1, (strlen($url)-($pos+1))), $_GET);\n }\n }",
"private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}",
"public function getActionName()\n {\n return $this->__get(\"action_name\");\n }",
"function erp_process_actions() {\n if ( isset( $_REQUEST['erp-action'] ) ) {\n $action = sanitize_text_field( wp_unslash( $_REQUEST['erp-action'] ) );\n\n do_action( 'erp_action_' .$action, $_REQUEST );\n }\n}",
"public function getAction(){\r\n return $this->sAction;\r\n }",
"function url_parse_controllerAction(&$value)\n{\n if (!$value) {\n return false;\n } else {\n return preg_match('/^[a-z][a-z\\_0-9]{1,30}$/i', (string)$value);\n }\n}",
"public function setAction($str);",
"public function get_action(): ?string {\n\t\treturn $this->action;\n\t}",
"public function get_action() {\r\n\t\treturn $this->action;\r\n\t}",
"public function get_action() {\n\t\treturn $this->action ? $this->action : 'import';\n\t}",
"public function getActionName() {\n\n\t\treturn $this->_action;\n\t}",
"public function getActionName()\n {\n return $this->_action;\n }",
"public function action()\n {\n return $this->reqaction;\n }",
"function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }",
"function get_action(){\r\n\t\t$task = $_POST['task'];\r\n\t\tswitch($task){\r\n\t\t\tcase \"LIST\":\r\n\t\t\t\t$this->master_jual_rawat_list();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"UPDATE\":\r\n\t\t\t\t$this->master_jual_rawat_update();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"CREATE\":\r\n\t\t\t\t$this->master_jual_rawat_create();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"CEK\":\r\n\t\t\t\t$this->master_jual_rawat_pengecekan();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"SEARCH\":\r\n\t\t\t\t$this->master_jual_rawat_search();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"PRINT\":\r\n\t\t\t\t$this->master_jual_rawat_print();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"EXCEL\":\r\n\t\t\t\t$this->master_jual_rawat_export_excel();\r\n\t\t\t\tbreak;\r\n case \"DDELETE\":\r\n\t\t\t\t$this->detail_jual_rawat_delete();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"BATAL\":\r\n\t\t\t\t$this->master_jual_rawat_batal();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\techo \"{failure:true}\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"protected function getAction() {}",
"function stage_do_action($action, $arg = '')\n{\n // If action starts with \"_\" we request a WooCommerce action\n $action = mb_substr($action, 0, 4) === 'get_' ? str_replace('get', 'woocommerce', $action) : $action;\n return do_action($action, $arg);\n}",
"function _action($action)\n\t{\n\t // Lay input\n\t $ids = $this->uri->rsegment(3);\n\t $ids = (!$ids) ? $this->input->post('id') : $ids;\n\t $ids = (!is_array($ids)) ? array($ids) : $ids;\n\t\n\t // Thuc hien action\n\t foreach ($ids as $id)\n\t {\n\t // Xu ly id\n\t $id = (!is_numeric($id)) ? 0 : $id;\n\t \t\n\t // Kiem tra id\n\t $info = model('user_bank')->get_info($id);\n\t if (!$info) continue;\n\t \n\t // Chuyen den ham duoc yeu cau\n\t $this->{'_'.$action}($info);\n\t }\n\t}",
"public function get_action()\n {\n return $this->_action;\n }",
"protected function _getFullActionName()\n {\n if ($this->_fullActionName == null) {\n $this->_fullActionName = $this->_request->getFullActionName();\n }\n return $this->_fullActionName;\n }",
"private function handleVars() {\n $vars = &$_GET;\n\n if(!isset($vars['game_action']))\n return;\n\n switch($vars['game_action']) {\n case 'roll':\n $this->roll();\n break;\n case 'save':\n $this->save();\n break;\n case 'clear':\n $this->clear();\n break;\n }\n }",
"protected function resolveActionMethodName() {}",
"public function getRouteName($action);",
"public function getActionName() {\n\t\treturn $this->action;\n\t}",
"private static function formatAsAction($str) {\n\t\tif (strpos($str, '_') !== false) {\n\t\t\tdo {\n\t\t\t\t$uPos = strpos($str, '_');\n\t\t\t\t$str = substr_replace($str, '', $uPos, 1);\n\t\t\t\t\n\t\t\t\t$str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1);\n\t\t\t}\n\t\t\twhile(strpos($str, '_') !== false);\n\t\t\t\n\t\t\treturn $str;\n\t\t}\n\t\telseif (strpos($str, '-') !== false) {\n\t\t\tdo {\n\t\t\t\t$uPos = strpos($str, '-');\n\t\t\t\t$str = substr_replace($str, '', $uPos, 1);\n\n\t\t\t\t$str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1);\n\t\t\t}\n\t\t\twhile(strpos($str, '-') !== false);\n\n\t\t\treturn $str;\n\t\t}\n\t\telse {\n\t\t\treturn $str;\n\t\t}\n\t}",
"public function getAction($key = null)\n {\n return PhandArr::get($this->action, $key);\n }",
"public function get_action() {\n return $this->_action;\n }",
"function admin_act_url( $action, $subaction ) {\r\n\t\t\t$url = $this->get_current_url();\r\n\t\t\t$url = add_query_arg( 'um_adm_action', $action, $url );\r\n\t\t\t$url = add_query_arg( 'sub', $subaction, $url );\r\n\t\t\t$url = add_query_arg( 'user_id', um_user('ID'), $url );\r\n\t\t\treturn $url;\r\n\t\t}",
"private function form_action($matches){\r\n\t\t// $matches[1] holds single or double quote - whichever was used by webmaster\r\n\t\t\r\n\t\t// $matches[2] holds form submit URL - can be empty which in that case should be replaced with current URL\r\n\t\tif(!$matches[2]){\r\n\t\t\t$matches[2] = $this->base_url;\r\n\t\t}\r\n\t\t$new_action = proxify_url($matches[2], $this->base_url);\r\n//\t\tconsole_log('form_action-debug ' . no_encode_proxify_url($matches[2], $this->base_url));\r\n//\t\tconsole_logs('form_action-debug-new_action ' . $new_action);\r\n\r\n\r\n\t\t// what is form method?\r\n\t\t$form_post = preg_match('@method=([\"\\'])post\\1@i', $matches[0]) == 1;\r\n//\t\tconsole_log('$form_post '. $form_post);\r\n\t\t// take entire form string - find real url and replace it with proxified url\r\n\t\t$result = str_replace($matches[2], $new_action, $matches[0]);\r\n\t\t\r\n\t\t// must be converted to POST otherwise GET form would just start appending name=value pairs to your proxy url\r\n\t\tif(!$form_post){\r\n\t\t\r\n\t\t\t// may throw Duplicate Attribute warning but only first method matters\r\n\t\t\t$result = str_replace(\"<form\", '<form method=\"POST\"', $result);\r\n\t\t\t\r\n\t\t\t// got the idea from Glype - insert this input field to notify proxy later that this form must be converted to GET during http\r\n\t\t\t$result .= '<input type=\"hidden\" name=\"convertGET\" value=\"1\">';\r\n//\t\t\tconsole_log('form_action-debug-result ' );\r\n\t\t}\r\n\r\n//\t\tconsole_log('$result '. $result);\r\n\t\treturn $result;\r\n\t}",
"public function getFullActionName()\n\t{\n\t\treturn $this->request->getFullActionName();\n\t}",
"public function getAction(): string;",
"public function getAction(): string;",
"public static function action()\n {\n return strtolower(static::name());\n }",
"private function toCamelCase($action) {\n\t\tif (strpos($action, '-') !== false) {\n\t\t\t$camelCaseName = str_replace(' ', '', ucwords(str_replace('-', ' ', $action)));\n\t\t\t$camelCaseName[0] = strtolower($camelCaseName[0]);\n\t\t\t$action = $camelCaseName;\n\t\t}\n\t\treturn $action;\n\t}",
"public static function fixUpActionName($actionToCheck)\n {\n if ( empty($actionToCheck) ) {\n return $actionToCheck;\n }\n $input = strtolower($actionToCheck);\n switch ($input)\n {\n case 'index':\n case 'listview':\n case 'subpanel':\n $output = 'list';\n break;\n case 'save':\n case 'popupeditview':\n case 'editview':\n case 'create':\n $output = 'edit';\n break;\n case 'read':\n case 'detail':\n case 'detailview':\n $output = 'view';\n break;\n default:\n $output = $input;\n }\n\n return $output;\n }",
"public function getSuggestedAction()\n {\n return $this->singleValue('//i:suggestedAction');\n }",
"function setAction($action) {\r\r\n\t\t$this->action = strtolower($action);\r\r\n\t}",
"private static function toMethod( $action )\n {\n $actionString = str_replace( ' ', '', ucwords( str_replace( '-', ' ', $action ) ) );\n $actionString[0] = strtolower( $actionString[0] );\n \n return 'action_' . $actionString;\n }",
"private static function get_method(){\n\t\t\tif(!self::$method)\n\t\t\t\tself::$method = $_SERVER['REQUEST_METHOD'];\n\t\t\t\t\n\t\t\treturn strtolower(self::$method);\n\t\t}",
"static function get_action_parameter()\r\n {\r\n return ComplexDisplay :: PARAM_DISPLAY_ACTION;\r\n }",
"public function getAction($key = null)\n {\n return $this->action;\n }",
"function format_href($p_action, $p_args = array()){\n\t$t_href = htmlspecialchars($p_action);\n\n\tif(count($p_args) > 0)\n\t\t$t_href .= '?';\n\n\tforeach($p_args as $t_key => $t_value)\n\t\t$t_href .= '&' . $t_key . (($t_value != '') ? '=' : '') . $t_value;\n\n\treturn $t_href;\n}",
"public static function getActionName()\r\n\t{\r\n\t\treturn TRequest::getCmd('controller');\r\n\t}",
"public function urlToActionName($name){\n // just turn dash-format into upperCamelCaseFormat\n return preg_replace(\"/\\-(.)/e\", \"strtoupper('\\\\1')\", $name) . 'Action';\n }",
"public function get_action_file()\n {\n if (!empty($this->action_map[$this->action])) {\n return $this->action_map[$this->action];\n }\n\n return strtr($this->action, '-', '_') . '.inc';\n }",
"protected function resolveActionMethodName(): string\n {\n switch ($this->request->getMethod()) {\n case 'HEAD':\n case 'GET':\n $actionName = ($this->request->hasArgument($this->resourceArgumentName)) ? 'show' : 'list';\n return $actionName . 'Action';\n\n // Not supported in Example\n case 'POST':\n case 'PUT':\n case 'DELETE':\n default:\n $this->throwStatus(400, null, 'Bad Request.');\n }\n $this->throwStatus(400, null, 'Bad Request.');\n return '';\n }",
"public function getFullActionName()\n {\n return $this->request->getFullActionName();\n }",
"public function action()\n {\n return $this->getAttribute('action');\n }",
"function compile_url($url) {\n\t\t$path=substr($url,1,strlen($url));\n\t\t$action_strings=explode(\"-\",$path);\n\n\t\t$actions=array();\n\t\t$last_controller=\"\";\n\t\twhile (list($k,$v) = each($action_strings)) {\n\t\t\t//echo $v;\n\n\t\t\t//echo $controller.$action.\"<br>\";\n\t\t\tif ($v!=\"\") {\n\t\t\t\t$case_values=explode(\"=\",$v);\n\t\t\t\tif (isset($case_values[1])) {\n\t\t\t\t\t$v2=$case_values[0];\n\t\t\t\t\t$action_string=explode(\".\",$v2);\n\t\t\t\t\t$controller=\"\";\n\t\t\t\t\t$action=\"\";\n\t\t\t\t\tif (isset($action_string[1])) {\n\t\t\t\t\t\t$controller=$action_string[0];\n\t\t\t\t\t\t$last_controller=$controller;\n\t\t\t\t\t\t$action=$action_string[1];\n\t\t\t\t\t} else if (isset($action_string[0])) {\n\t\t\t\t\t\tif ($last_controller!=\"\") {\n\t\t\t\t\t\t\t$action=$action_string[0];\n\t\t\t\t\t\t\t$controller=$last_controller;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t$action_item=array(\"controller\"=>$controller,\"action\"=>strtolower($action), \"case_items\"=>0);\n\t\t\t\t\t$case_default_controller=$controller;\n\t\t\t\t\t$case_items=explode(\"*\",$case_values[1]);\n\t\t\t\t\t$nbr_case=0;\n\t\t\t\t\twhile (list($k,$v) = each($case_items)) {\n\t\t\t\t\t\t$nbr_case++;\n\t\t\t\t\t\t$action_string=explode(\".\",$v);\n\t\t\t\t\t\t$case_controller=\"\";\n\t\t\t\t\t\t$case_action=\"\";\n\t\t\t\t\t\tif (isset($action_string[1])) {\n\t\t\t\t\t\t\t$case_controller=$action_string[0];\n\t\t\t\t\t\t\t$case_action=$action_string[1];\n\t\t\t\t\t\t} else if (isset($action_string[0])) {\n\t\t\t\t\t\t\tif ($case_default_controller!=\"\") {\n\t\t\t\t\t\t\t\t$case_action=$action_string[0];\n\t\t\t\t\t\t\t\t$case_controller=$case_default_controller;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t$action_item[]=array(\"controller\"=>$case_controller,\"action\"=>strtolower($case_action));\n\t\t\t\t\t}\n\t\t\t\t\t$action_item[\"case_items\"]=$nbr_case;\n\t\t\t\t\t$actions[]=$action_item;\n\t\t\t\t\t//verification des permissions du controlleur\n\t\t\t\t\t//verification des permissions de l'action\n\t\t\t\t} else {\n\t\t\t\t\t$action_string=explode(\".\",$v);\n\t\t\t\t\t$controller=\"\";\n\t\t\t\t\t$action=\"\";\n\t\t\t\t\tif (isset($action_string[1])) {\n\t\t\t\t\t\t$controller=$action_string[0];\n\t\t\t\t\t\t$last_controller=$controller;\n\t\t\t\t\t\t$action=$action_string[1];\n\t\t\t\t\t} else if (isset($action_string[0])) {\n\t\t\t\t\t\tif ($last_controller!=\"\") {\n\t\t\t\t\t\t\t$action=$action_string[0];\n\t\t\t\t\t\t\t$controller=$last_controller;\n\t\t\t\t\t\t} else continue;\n\t\t\t\t\t};\n\t\t\t\t\t$actions[]=array(\"controller\"=>$controller,\"action\"=>strtolower($action), \"case_items\"=>0);\n\t\t\t\t\t//verification des permissions du controlleur\n\t\t\t\t\t//verification des permissions de l'action\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $actions;\n\t}",
"public function getAction()\n {\n return $this->sAction;\n }",
"public function formatActionName($unformatted)\n {\n $formatted = $this->_formatName($unformatted, true);\n return strtolower(substr($formatted, 0, 1)) . substr($formatted, 1) . 'Action';\n }",
"public function action($strAction = \"\") {\r\n if ($strAction == \"\")\r\n $strActionName = $this->getAction();\r\n else\r\n $strActionName = $strAction;\r\n\r\n $this->strOriginalAction = $strActionName;\r\n\r\n if(!$this->checkMethodExistsInConcreteClass(\"action\".ucfirst($strActionName))) {\r\n\r\n foreach(self::$arrActionNameMapping as $strAutoMatchAction => $strAnnotation) {\r\n $this->autoMatchAction($strAutoMatchAction, $strAnnotation, $strActionName);\r\n }\r\n }\r\n\r\n return parent::action($strActionName);\r\n }",
"public function getAction(): ?string\n {\n return $this->action;\n }",
"function buildLink( $action ){\n\n\treturn getBaseURI() . 'index.php?action=' . $action;\n}",
"public function getActionNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[2];\r\n }",
"static function get_action_parameter()\r\n {\r\n return self :: PARAM_USER_RIGHT_ACTION;\r\n }",
"public function formatActionName($unformatted)\n {\n return strtolower(substr($this->_formatName($unformatted),0,1)) . substr($unformatted,1) . 'Action';\n }"
] | [
"0.791511",
"0.7254227",
"0.7140272",
"0.7133606",
"0.69927347",
"0.6904715",
"0.6876074",
"0.6832604",
"0.67941463",
"0.66802377",
"0.6647116",
"0.66080964",
"0.6598364",
"0.65678906",
"0.6386663",
"0.63134795",
"0.63092816",
"0.62517476",
"0.6231177",
"0.61898184",
"0.6129137",
"0.6129137",
"0.6129137",
"0.60503745",
"0.60055447",
"0.59906274",
"0.5954702",
"0.595328",
"0.59451777",
"0.59392935",
"0.5934609",
"0.5913056",
"0.58813107",
"0.5875507",
"0.5868048",
"0.5859161",
"0.5851307",
"0.58287823",
"0.58237725",
"0.57911146",
"0.57911146",
"0.575169",
"0.5751118",
"0.5750127",
"0.56724256",
"0.5668415",
"0.5657097",
"0.56293225",
"0.56272507",
"0.56212264",
"0.56211394",
"0.5618989",
"0.56183845",
"0.5617755",
"0.5613054",
"0.5606098",
"0.55883825",
"0.5583792",
"0.557461",
"0.5565805",
"0.5563658",
"0.55582654",
"0.5554053",
"0.55533844",
"0.55447745",
"0.554457",
"0.55439174",
"0.5543619",
"0.55351895",
"0.5530313",
"0.55247945",
"0.55182487",
"0.5517351",
"0.55163246",
"0.55163246",
"0.55003846",
"0.5494688",
"0.54870296",
"0.5479694",
"0.5472347",
"0.546936",
"0.54657054",
"0.5464689",
"0.5464174",
"0.5463433",
"0.5457802",
"0.5448751",
"0.54478794",
"0.544075",
"0.543832",
"0.5437849",
"0.5412015",
"0.5410079",
"0.5408305",
"0.54076576",
"0.5406399",
"0.5404214",
"0.539063",
"0.5384431",
"0.53837895"
] | 0.6473316 | 14 |
Merge GET and POST values into one single array. Also removes value from page and action used by ADispatcher and AController | public static final function getParameters(\phpbb\request\request $request) {
$values = array_merge_recursive(
array(),
$request->get_super_global(request_interface::GET),
$request->get_super_global(request_interface::POST)
);
if (array_key_exists("page", $values) && !empty($values['page'])) {
unset($values['page']);
}
if (array_key_exists("action", $values) && !empty($values['action'])) {
unset($values['action']);
}
$getParams = $request->variable("params", AController::DEFAULT_ACTION);
if (is_string($getParams)) {
unset($values['params']);
foreach (explode("/", $getParams) as $param) {
if (empty($param)) {
continue;
}
$values[] = $param;
}
}
return $values;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getActionParams() { return array_merge($_GET, $_POST); }",
"public function getActionParams()\n\t{\n\t\t$args = parent::getActionParams();\n\n\t\t// Add in the $_POST array, giving it precedence\n\t\treturn array_merge($args, $_POST);\n\t}",
"protected function __getPostRemoveEmpty(){\r\n if($this->request->isPost()){\r\n foreach($this->request->getPost() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_POST[$key]);\r\n }\r\n }\r\n }\r\n else{\r\n foreach($this->request->getQuery() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_GET[$key]);\r\n }\r\n }\r\n }\r\n }",
"private function _getRequestParams()\n {\n return array_merge(\n $this->CI->input->post(),\n $this->CI->input->get()\n );\n }",
"public static function allGet()\n {\n try {\n $form = [];\n foreach ($_GET as $name => $value) {\n $form[htmlspecialchars($name)] = htmlspecialchars($value);\n }\n return $form;\n } catch (Exception $e) {\n die($e);\n }\n }",
"function merge_request($origen)\n{\n\t$origen_final=array();\n\tfor ($i = 0; $i < strlen($origen); $i++)\n\t{\n\t\tswitch ($origen[$i])\n\t\t{\n\t\t\tcase \"P\":\n\t\t\t\t$temp=$_POST;\n\t\t\t\tbreak;\n\t\t\tcase \"G\":\n\t\t\t\t$temp=$_GET;\n\t\t\t\tbreak;\n\t\t\tcase \"S\":\n\t\t\t\t$temp=$_SESSION;\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t\t$origen_final=array_merge($origen_final,$temp);\n\t}\n\treturn $origen_final;\n}",
"public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }",
"protected function __bindAfterRemoveEmpty($type='post'){\r\n $results = array();\r\n switch ($type) {\r\n case 'post':\r\n foreach($this->request->getPost() as $key => $value){\r\n $results[$key] = $value;\r\n }\r\n return $results;\r\n break;\r\n \r\n case 'get':\r\n foreach($this->request->getQuery() as $key => $value){\r\n if($key !== '_url'){\r\n $results[$key] = $value;\r\n }\r\n }\r\n return $results;\r\n break;\r\n }\r\n }",
"function fix_request(){\n\t$var=array();\n\tforeach($_GET as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_GET[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\tforeach($_POST as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_POST[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\t$_REQUEST=$var;\n}",
"private function splitUrl()\n {\n if (isset($_GET['url'])) {\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n\n $this->url_params = array_values($url);\n // ::DEBUGGING\n // echo 'Controller: ' . $this->url_controller . '<br>';\n // echo 'Action: ' . $this->url_action . '<br>';\n // echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n // echo 'Parameters POST: ' . print_r($_POST, true) . '<br>';\n }\n }",
"public static function all() {\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET':\n\t\t\t\treturn $_GET;\n\t\t\t\tbreak;\n\n\t\t\tcase 'POST':\n\t\t\t\treturn $_POST;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE':\n\t\t\t\treturn static::getInputVars();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function getUnfilteredParameters()\n {\n return array_merge($this->get('postData'), $this->get('getData'));\n }",
"function filterGlobalArrays()\r\n{\r\n ### clean global namespace from register globals ###\r\n if (@ini_get('register_globals')) {\r\n foreach ($_REQUEST as $key => $value) {\r\n unset($GLOBALS[$key]);\r\n }\r\n }\r\n\r\n clearRequestVars();\r\n addRequestVars($_GET);\r\n addRequestVars($_POST);\r\n addRequestVars($_COOKIE);\r\n\r\n $_COOKIE= $_GET= $_POST=array();\r\n}",
"protected function actionParamsSets() {\n\t\treturn array();\n\t}",
"static function cleanup() {\n\t\tforeach ($_REQUEST as $p) {\n\t\t\tunset($p);\n\t\t}\n\t}",
"private function rebuildGet()\n {\n $url = $_SERVER['REQUEST_URI'];\n $pos = strpos($url, '?');\n \n if ($pos !== false)\n {\n parse_str(substr($url, $pos+1, (strlen($url)-($pos+1))), $_GET);\n }\n }",
"public function parseGetData(): array {\n $data = (array)$this->getRequest()->getQuery();\n $data = $this->sanitizeData($data);\n\n return $data;\n }",
"protected function getPost(): array {\n\t\t$post = array_diff_key($this->request->getParams(), array_flip(array( '_METHOD', )));\n\n\t\treturn $post;\n\t}",
"protected function get() : array\n {\n $barra = explode('/', $_SERVER[\"REQUEST_URI\"]);\n\n array_shift($barra);\n\n return $barra;\n }",
"private function setGetParameters() {\n\t\tforeach(array_keys($_GET) as $currentKey) {\n\t\t\t$this->getArray[$currentKey] = $_GET[$currentKey];\n\t\t}\n\t}",
"public static function fixArrays(){\n if( self::$postGetFixed ) return;\n if( count($_POST) > 0 )\n self::doFixArray($_POST);\n if( count($_GET) > 0 )\n self::doFixArray($_GET);\n self::$postGetFixed = true;\n }",
"function& collectControlerData()\n\t{\n\t\t$keys = array_keys($this->controllerData);\n\t\t\n\t\tforeach($keys as $key)\n\t\t{\n\t\t\t$value = null;\n\t\t\tif (key_exists($key, $_REQUEST))\n\t\t\t{\n\t\t\t\t$value = $_REQUEST[$key];\t\t\t\n\t\t\t\t$this->controllerData[$key] = $value;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->controllerData;\n\t}",
"public static function filterFormAction() {\n\n $query = Request::segments();\n\n\n foreach ($query as $k => $q) {\n if (preg_match(\"/page-[0-9]+$/\", $q, $match)) {\n unset($query[$k]);\n };\n }\n $query = implode('/', $query);\n $url = Request::root() . \"/$query/\";\n\n return $url;\n }",
"protected function getPostValues() {}",
"private function inputs(){\n\t\tswitch($_SERVER['REQUEST_METHOD']){ // Make switch case so we can add additional \n\t\t\tcase \"GET\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"GET\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"POST\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"POST\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"PUT\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"PUT\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"DELETE\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"DELETE\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->response('Forbidden',403);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static function all(): array\n\t{\n\t\treturn $_REQUEST;\n\t}",
"private static function getParams($get, Controller $controller = null) {\n\t\tif (!$controller instanceof PagesController) {\n\t\t\tunset($get[0]); unset($get[1]);\n\t\t}\n\t\telse {\n\t\t\tunset($get[0]);\n\t\t}\n\t\t\n\t\t$params = array();\n\t\t\n\t\tforeach($get as $param) {\n\t\t\tif ($param != \"\")\n\t\t\t\t$params[] = $param;\n\t\t}\n\t\t\n\t\treturn $params;\n\t}",
"public function posts()\n {\n $post = filter_input_array(INPUT_POST);\n array_walk_recursive($post, function(&$value) {\n $value = JORequest::setAntiInjection($value);\n });\n return $post;\n }",
"private function splitUrl() {\n\n if (isset($_GET['url'])) {\n\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n $this->url_params = array_values($url);\n\n // para debugging, descomente estas lineas si tiene problemas con la URL\n //echo 'Controller: ' . $this->url_controller . '<br>';\n //echo 'Action: ' . $this->url_action . '<br>';\n //echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n }\n }",
"public function parameters()\n {\n return array_merge($this->get, $this->post);\n }",
"private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }",
"public static function all()\n {\n return $_REQUEST;\n }",
"function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}",
"public function getGetValues()\n {\n // Define the check for params\n $get_check_array = array(\n // Action\n 'action' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'vraagId' => array('filter' => FILTER_VALIDATE_INT)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_GET, $get_check_array);\n // RTS\n return $inputs;\n }",
"public function getActionParams()\n\t{\n static $params = null;\n if($params === null)\n {\n if(isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'json'))\n $params = (array)CJSON::decode(Yii::app()->request->getRawBody());\n else\n {\n if($_SERVER['REQUEST_METHOD'] == 'GET')\n $params = $_GET;\n elseif($_SERVER['REQUEST_METHOD'] == 'POST')\n $params = $_POST;\n else\n $params = Yii::app()->request->getRestParams();\n }\n\n if(isset($_GET['id']))\n $params = array_merge(array('id' => $_GET['id']), $params);\n $_REQUEST = $params;\n }\n return $params;\n\t}",
"function _load_post_params(&$app, &$c) {\n\t\t$params =& $c->param('app.view_http.request.params');\n\t\tif (is_array($params)) {\n\t\t\tforeach($params as $p_name => $p_value) {\n\t\t\t\t$this->_http->addPostData($p_name, $p_value);\n\t\t\t}\n\t\t}\n\t}",
"function get_current_filters () \n{\n if (count($_GET) < 1) \n return array();\n \n foreach ($_GET as $field_name => $value) {\n if (strlen($value) < 1) continue;\n $filters[$field_name] = addslashes($value);\n }\n \n unset($filters[w]);\n \n return $filters;\n}",
"function allPost()\n {\n $post = $this->unsafeAllPost();\n return array_map(array($this->sec, 'clean'), $post);\n }",
"function sanitizeParams()\n{\n $array = array();\n $str = '';\n $frontParam = '';\n\n // REQUEST_URI of $_SERVER\n $str =& $_SERVER[\"REQUEST_URI\"];\n serverStringToArray($str, $array, $frontParam);\n sanitizeArray($array);\n arrayToServerString($array, $frontParam, $str);\n\n // QUERY_STRING of $_SERVER\n unset($str);\n $str =& $_SERVER[\"QUERY_STRING\"];\n serverStringToArray($str, $array, $frontParam);\n sanitizeArray($array);\n arrayToServerString($array, $frontParam, $str);\n\n // $_GET\n convArrayForSanitizing($_GET, $array);\n sanitizeArray($array);\n revertArrayForSanitizing($array, $_GET);\n\n // $_REQUEST (only GET param)\n convArrayForSanitizing($_REQUEST, $array);\n sanitizeArray($array);\n revertArrayForSanitizing($array, $_REQUEST);\n}",
"public static function all(): array {\r\n\r\n if(true === isset(static::$method['data'])) {\r\n return static::$method['data'];\r\n }\r\n\r\n parse_str(static :: getBody(), $vars);\r\n\r\n return [\r\n\r\n 'get' \t \t=> $_GET,\r\n 'post'\t \t=> $_POST,\r\n 'put' \t \t=> static :: isMethod('put') \t ? \t$vars : [],\r\n 'delete' \t=> static :: isMethod('delete') ? \t$vars : [],\r\n 'patch' \t=> static :: isMethod('patch') \t ? \t$vars : [],\r\n 'connect' \t=> static :: isMethod('connect') ? \t$vars : [],\r\n 'head' \t=> static :: isMethod('head')\t ? \t$vars : [],\r\n 'options' \t=> static :: isMethod('options') ? \t$vars : [],\r\n 'trace' \t=> static :: isMethod('trace') \t ? \t$vars : []\r\n ];\r\n }",
"function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}",
"function stripPost($p_sPrefix = '') {\n\t\t$aValues = array();\n\t\tif($p_sPrefix !== '' && $this->is('post')) {\n\t\t\t$aPost = $this->post();\n\t\t\t$aPrefixKeys = preg_grep(\"/{$p_sPrefix}/\", array_keys($aPost));\n\t\t\tforeach($aPrefixKeys as $prefixKey) {\n\t\t\t\t$aValues[$prefixKey] = $aPost[$prefixKey];\n\t\t\t}\n\t\t}\n\t\treturn $aValues;\n\t}",
"function convArrayForSanitizing($src, &$array)\n{\n $array = array();\n foreach ($src as $key => $val) {\n if (key_exists($key, $_GET)) {\n array_push($array, sprintf(\"%s=%s\", $key, $val));\n }\n }\n}",
"function getallrequest(){\r\n\tglobal $_REQUEST;\r\n\tforeach($_REQUEST as $index => $value){\r\n\t\tglobal $$index;\r\n\t\t$$index = $value;\r\n\t}\r\n}",
"public function actions(){\n $actions = parent::actions();\n unset($actions['index']);\n unset($actions['view']);\n unset($actions['create']);\n unset($actions['update']);\n unset($actions['delete']);\n return $actions;\n }",
"public function getPostValues()\n {\n // Define the check for params\n $post_check_array = array(\n // submit action\n 'toevoegen' => array('filter' => FILTER_SANITIZE_STRING),\n 'bijwerken' => array('filter' => FILTER_SANITIZE_STRING),\n 'verwijderen' => array('filter' => FILTER_SANITIZE_STRING),\n // question\n 'vraag' => array('filter' => FILTER_SANITIZE_STRING),\n // question type (open or closed)\n 'vraagId' => array('filter' => FILTER_SANITIZE_INT),\n // question type (open or closed)\n 'vraagSoort' => array('filter' => FILTER_SANITIZE_STRING),\n // Education\n 'opleiding' => array('filter' => FILTER_SANITIZE_STRING),\n // question send time\n 'verstuurTijd' => array('filter' => FILTER_SANITIZE_STRING)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n // RTS\n return $inputs;\n }",
"private function splitUrl()\n {\n if (isset($_GET['apps'])) {\n\n $url = rtrim($_GET['apps'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\t\t\t\n\n // for debugging. uncomment this if you have problems with the URL\t\t\t\n\t\t\t/*\n\t\t\t echo '<br/><br/><br/><br/><br/><br/><br/><br/>';\n echo 'Controller: ' . $this->url_controller . '<br />';\n echo 'Action: ' . $this->url_action . '<br />';\n echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t*/\n }\n\t\telse\n\t\t{\n\t\t\tif (empty($_GET))\n\t\t\t{\n\t\t\t\t$this->url_controller = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->url_controller = '404';\n\t\t\t}\n\t\t}\n\t\t\n }",
"private function parseUrl()\n {\n $url = $_SERVER['REQUEST_URI'];\n if (!empty($url)) {\n // parse url\n $this->params = explode(\"/\", filter_var(rtrim($url, \"/\"), FILTER_SANITIZE_URL));\n }\n\n if(empty($this->params[0])) {\n unset($this->params[0]);\n\n $this->params = array_values($this->params);\n }\n\n $this->getController();\n $this->getAction();\n\n $this->params = array_values($this->params);\n }",
"function emptyPost() {\n\t\t$_POST = array();\n\t}",
"private function _getUrlParamsForFormAction() {\n\n $param = $this->params()->fromRoute('param');\n $param2 = $this->params()->fromRoute('param2');\n $value = $this->params()->fromRoute('value', 0);\n $value2 = $this->params()->fromRoute('value2', 0);\n\n $params = array(\n 'productId' => 0,\n 'categoryId' => 0,\n 'parentId' => 0\n );\n\n// $productId = $categoryId = null;\n// if ($param == \"product\") {\n// $productId = $value;\n// $categoryId = $value2;\n// } else if ($param == \"category\") {\n// $productId = $value2;\n// $categoryId = $value;\n// }\n\n switch ($param) {\n case 'product':\n $params['productId'] = $value;\n $params['categoryId'] = $value2;\n break;\n case 'category':\n $params['productId'] = $value2;\n $params['categoryId'] = $value;\n break;\n case 'parent':\n $params['parentId'] = $value;\n break;\n default:\n break;\n }\n\n return $params;\n }",
"function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }",
"private static function getParams(): array\n {\n $getParams = [];\n\n if (!empty($_GET)) {\n $getParams = filter_input_array(INPUT_GET, FILTER_DEFAULT);\n }\n\n return $getParams;\n }",
"private static function postParams(): array\n {\n $postParams = [];\n\n if (!empty($_POST)) {\n $postParams = filter_input_array(INPUT_POST, FILTER_DEFAULT);\n }\n\n return $postParams;\n }",
"protected static function filter_data($action, $data) {\n\t\t$formFields = static::form_fields($action);\n\t\tforeach ($data as $fieldName => $_) {\n\t\t\tif (!isset($formFields[ $fieldName ])) {\n\t\t\t\tunset($data[ $fieldName ]);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"function parseURL($url){\r\n //Explodeo la url para convertirla en un array\r\n $urlExploded = explode('/' ,$_GET['action']);\r\n //Creo un nuevo array y en la posición 'action' le asigno la acción recibida\r\n $arrayReturn[ConfigApp::$ACTION] = $urlExploded[0];\r\n //Si esta seteado, llama al metodo array_slice(), lo que hace este metodo es crear un arrego a partir de una posición dada, en este caso desde la posición 1\r\n $arrayReturn[ConfigApp::$PARAMS] = isset($urlExploded[1]) ? array_slice($urlExploded, 1) : null;\r\n\r\n return $arrayReturn;\r\n }",
"public function getUriParams()\n {\n $values = array();\n $string = parse_url(filter_input(INPUT_SERVER, 'REQUEST_URI'));\n if (isset($string['query'])) {\n $exp = explode('&', $string['query']);\n $count = count($exp);\n for ($i = 0; $i < $count; $i++) {\n $value = explode('=', $exp[$i]);\n $values[$value[0]] = self::setAntiInjection($value[1]);\n }\n }\n return $values;\n }",
"protected function setRequestArgumentsFromGetPost() {\n\t\t$validArguments = array('vendorName', 'extensionName', 'pluginName', 'controllerName', 'actionName', 'formatName', 'arguments');\n\t\tforeach ($validArguments as $argument) {\n\t\t\tif (GeneralUtility::_GP($argument)) {\n\t\t\t\t$this->requestArguments[$argument] = GeneralUtility::_GP($argument);\n\t\t\t} else if (GeneralUtility::_GP('amp;' . $argument)) {\n\t\t\t\t// Something went wrong...\n\t\t\t\t$this->requestArguments[$argument] = GeneralUtility::_GP('amp;' . $argument);\n\t\t\t}\n\t\t}\n\t}",
"protected function mapRequest() {\n foreach($_REQUEST as $key => $value) {\n $this->data[$key] = $value;\n }\n }",
"public static function getAllURLParams()\n\t{\n\t\treturn explode('/', $_SERVER['REQUEST_URI']);\n\t}",
"public static function allPost()\n {\n try {\n $form = [];\n foreach ($_POST as $name => $value) {\n $form[htmlspecialchars($name)] = htmlspecialchars($value);\n }\n return $form;\n } catch (Exception $e) {\n die($e);\n }\n }",
"function get_params_array()\n {\n $values = array(\n 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),\n 'l' => (isset($_GET['l'])?$_GET['l']:(isset($_POST['l'])?$_POST['l']:'all')),\n 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),\n 'ip' => (isset($_GET['ip'])?$_GET['ip']:(isset($_POST['ip'])?$_POST['ip']:'')),\n 'vuid' => (isset($_GET['vuid'])?$_GET['vuid']:(isset($_POST['vuid'])?$_POST['vuid']:'')),\n 'sdate' => (isset($_GET['sdate'])?$_GET['sdate']:(isset($_POST['sdate'])?$_POST['sdate']:'')),\n 'edate' => (isset($_GET['edate'])?$_GET['edate']:(isset($_POST['edate'])?$_POST['edate']:'')),\n 'type' => (isset($_GET['type'])?$_GET['type']:(isset($_POST['type'])?$_POST['type']:'all')),\n 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),\n 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),\n 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))\n );\n\n return $values;\n }",
"function parseGetParams()\n {\n $this->parameters = array();\n\n $uriParts = explode('?', $this->userURI);\n $itemCount = count($uriParts);\n if ($itemCount == 0)\n {\n return;\n }\n\n //remove last item if it's empty\n if (isset($uriParts[$itemCount - 1]) && $uriParts[$itemCount - 1] == '')\n {\n array_pop($uriParts);\n }\n \n //remove first item if it's empty\n if (isset($uriParts[0]) && $uriParts[0] == '')\n {\n array_shift($uriParts);\n }\n\n //if has no valid item then return\n if (count($uriParts) == 0)\n {\n return;\n }\n writeLog(print_r($uriParts, true));\n \n foreach($uriParts as $inputData)\n {\n $data = html_entity_decode($inputData);\n $pair = explode('=', $data);\n\n if (count($pair)>1)\n {\n $this->parameters[$pair[0]] = $pair[1];\n }\n }\n \n writeLog(\"params = \".print_r($this->parameters, true));\n }",
"public function splitUrl() {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_STRING);\n $url = explode('/', $url);\n\n // parse custom urls\n $url = $this->parseRoutes($url);\n\n if ($this->app->language->enabled) {\n // set lang key\n $this->lang_key = isset($url[0]) ? $url[0] : null;\n // set controller\n $this->url_controller = isset($url[1]) ? $url[1] : null;\n // and action\n $this->url_action = isset($url[2]) ? $url[2] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1], $url[2]);\n } else {\n // set controller\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n // and action\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1]);\n }\n\n // store action params\n $this->action_params = array_values($url);\n\n }\n }",
"function UnsetRequest()\n {\n \n unset($_REQUEST[\"mco_proveedores__PVE_ID\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_NOMBRE\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_DIRECCION\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_TELEFONO\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_CELULAR\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_EMAIL\"]);\n }",
"function postToArrayOfFields($postArray){\n\t\t while (list($key, $val) = each($postArray)) {\n\t\t \t//Remove Non Fields From POST array\n\t \t if($key != \"function\" && $key != \"pk\" && $key != \"actionSelected\" && $key != \"sortKey\" && $key != \"ID\" && $key != \"id\"){\n\t\t $a_fields[] = $key;\n\t\t }\n\t\t}\n\t\treturn $a_fields;\n\t }",
"public function all()\n {\n $request = parent::all();\n foreach ($request as $key => $value){\n if(!$request[$key]){\n unset($request[$key]);\n }\n }\n return $request;\n }",
"protected function parseRequest()\n {\n $this->input = $this->request->getPostList()->toArray();\n }",
"public function valuesFromPost()\n {\n return $this->setDefaultValues($_POST);\n }",
"private function getUrls() {\n\t\t// reassign the array because of a php bug (solved later with php 5.2.x @see: http://bugs.php.net/39449)\n\t\t$arr = $this->formData;\n\n\t\t// build bas URL for replacement variables\n\t\t$protocol\t= 'http'\n . ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ? 's' : '' )\n . '://';\n\t\t$url\t\t= $_SERVER['HTTP_HOST'] . dirname( $_SERVER['PHP_SELF'] ) . '/';\n $url = str_replace( '//', '/', $url ); // some server add 2 /\n $url = $protocol . $url . 'index.php?route=payment/directebanking/';\n\n\t\tif( $this->_param['successUrlStd'] ) {\n\t\t\t$arr['user_variable_0'] = $url . 'success'\n\t\t\t. '&transaction=-TRANSACTION-&security_criteria=-SECURITY_CRITERIA-'\n\t\t\t. '&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['successUrl'] ) {\n\t\t\t\t$arr['user_variable_0'] = $this->_param['successUrl'];\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_param['cancelUrlStd'] ) {\n\t\t\t$arr['user_variable_1'] = $url . 'cancel'\n\t\t\t. '&transaction=-TRANSACTION-&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['cancelUrl'] ) {\n\t\t\t\t$arr['user_variable_1'] = $this->_param['cancelUrl'];\n\t\t\t}\n\t\t}\n\n\t\t// and reassign again\n\t\t$this->formData = $arr;\n\n\t\tunset( $arr );\n\t}",
"private function parseGET()\n {\n if (isset($_GET['method'])) {\n $this->method = $_GET['method'];\n unset($_GET['method']);\n }\n\n if (isset($_GET['output'])) {\n $this->output = $_GET['output'];\n unset($_GET['output']);\n }\n\n $testDN = Get_User_Principle_PI();\n if (empty($testDN) == false) {\n $this->identifier = $testDN;\n }\n\n if (count($_GET) > 0) {\n $this->params = $_GET;\n }\n }",
"function parse_incoming()\n {\n\t\t//-----------------------------------------\n\t\t// Attempt to switch off magic quotes\n\t\t//-----------------------------------------\n\n\t\t@set_magic_quotes_runtime(0);\n\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\n\t\t\n \t//-----------------------------------------\n \t// Clean globals, first.\n \t//-----------------------------------------\n \t\n\t\t$this->clean_globals( $_GET );\n\t\t$this->clean_globals( $_POST );\n\t\t$this->clean_globals( $_COOKIE );\n\t\t$this->clean_globals( $_REQUEST );\n \t\n\t\t# GET first\n\t\t$input = $this->parse_incoming_recursively( $_GET, array() );\n\t\t\n\t\t# Then overwrite with POST\n\t\t$input = $this->parse_incoming_recursively( $_POST, $input );\n\t\t\n\t\t$this->input = $input;\n\t\t\n\t\t$this->define_indexes();\n\n\t\tunset( $input );\n\t\t\n\t\t# Assign request method\n\t\t$this->input['request_method'] = strtolower($this->my_getenv('REQUEST_METHOD'));\n\t}",
"protected function buildRequestArray() {\n\n // isolate the action_data for the submission\n $field_map_data = $this->action_settings[ NF_ZohoCRM()->constants->field_map_action_key ];\n\n $auth_level = $this->auth_params->authLevel();\n\n $request_array_object = NF_ZohoCRM()->factory->buildRequestArray( $field_map_data, $auth_level );\n\n $field_map_array = $request_array_object->getFieldMapArray();\n\n NF_ZohoCRM()->stored_data->modifyCommData( $field_map_array, 'field_map_array', FALSE );\n\n $this->request_array = $request_array_object->getRequestArray();\n\n NF_ZohoCRM()->stored_data->modifyCommData( $this->request_array, 'request_array', FALSE );\n }",
"private static function setArray() {\n\tself::$requests = explode(\"/\", self::$uri);\n if(self::$requests[0] == 'api') {\n array_shift(self::$requests);\n self::$api = True;\n }\n }",
"function getParams()\n{\n $queryParams = array();\n $params = filter_input_array(INPUT_GET);\n if ($params) {\n foreach (array('page', 'pageSize', 'orderBy', 'fields', 'searchId') as $term) {\n if (filter_input(INPUT_GET, $term)) {\n $queryParams[$term] = filter_input(INPUT_GET, $term);\n unset($params[$term]);\n }\n }\n \n $queryParams['filter'] = http_build_query($params, null, ':');\n }\n \n return $queryParams;\n}",
"public function dispatch()\n {\n // Match all param keys\n $paramKeys = array();\n preg_match_all('/:' . $this->_paramPattern . '/i', $this->_uri, $paramKeys);\n \n // Remove leading :'s from keys\n $paramKeys = array_map(\n function($key) {\n $key = substr($key, 1);\n return $key;\n },\n $paramKeys[0]\n );\n \n // Match all param values\n $paramValues = array();\n preg_match_all($this->getPatternForUri(), $_SERVER['REQUEST_URI'], $paramValues, \\PREG_SET_ORDER);\n \n // Remove leading match\n $paramValues = $paramValues[0];\n array_shift($paramValues);\n \n // Set $_GET values. User has to filter all by himself!\n foreach ($paramValues as $idx => $value) {\n $_GET[$paramKeys[$idx]] = urldecode($value);\n }\n \n parent::dispatch();\n }",
"private function getOldGET()\n {\n $get = $_GET;\n $vars = '';\n foreach ($get as $key => $value) {\n if ($key != 'cdate') {\n $vars .= $this->compileOldGET($key, $value);\n }\n }\n return $vars;\n }",
"function _load_get_params(&$app, &$c) {\n\t\t$params =& $c->param('app.view_http.request.params');\n\t\tif (is_array($params)) {\n\t\t\tforeach($params as $p_name => $p_value) {\n\t\t\t\t$this->_http->addQueryString($p_name, $p_value);\n\t\t\t}\n\t\t}\n\t}",
"private function setParameters(){\n\t\tif(is_array($this->rawData) and count($this->rawData) > 2){\n\t\t\t$params = array();\n\t\t\tforeach($this->rawData as $paramid => $param){\n\t\t\t\tif($paramid > 1){ # Exclude page and method.\n\t\t\t\t\t$params[$paramid-1] = $param; \n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Store value */\n\t\t\treturn $params;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public function defaults($key = null, $value = null) {\n \n if($key !== null && $value !== null) return $this->defaults[$key] = $value;\n if($key !== null) return @$this->defaults[$key];\n \n return $this->defaults = array(\n 'method' => 'post',\n 'ajax' => false,\n 'required' => array(), \n 'keep' => array(), \n \n // on request event\n 'request' => function($self) {\n \n $requestMethod = strtoupper($_SERVER['REQUEST_METHOD']);\n $formMethod = strtoupper($self->option('method'));\n \n // check for a valid request method \n if($requestMethod != $formMethod) return false;\n\n // check for ajax requests\n if($self->option('ajax') && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') return false;\n \n // assign the request data \n $self->input = ($requestMethod == 'POST') ? $_POST : $_GET;\n\n // do some basic sanitizing\n $self->data = $self->input = array_map(array($self, 'sanitize'), $self->input);\n\n // check for missing fields\n foreach($self->option('required') as $required) {\n if(empty($self->data[$required])) $self->addMissing($required);\n }\n \n // remove unwanted fields from the input\n $keep = $self->option('keep');\n\n if(!empty($keep)) {\n $cleaned = array();\n foreach($keep as $key) {\n // only add wanted elements to the cleaned array\n $cleaned[$key] = @$self->data[$key];\n }\n $self->data = $cleaned;\n }\n \n // do more filtering\n $self->trigger('filter');\n \n // only submit the form if any data is left\n if(!empty($self->data)) {\n \n // check for invalid fields\n $self->trigger('validate');\n \n // react on missing fields \n if(!empty($self->missing) || !empty($self->invalid)) return $self->trigger('error');\n $self->submitted = true;\n $self->trigger('submit');\n \n }\n\n },\n\n 'filter' => function($self) {},\n 'validate' => function($self) {},\n 'submit' => function($self) { return $self->trigger('success'); },\n 'success' => function($self) {},\n 'error' => function($self) {},\n );\n \n }",
"public function getRequestParams()\n {\n return array_merge(\n array(\n 'page' => $this->getPage(),\n 'pageSize' => $this->getPageSize(),\n 'filter' => urldecode($this->getFiltersString())\n ),\n $this->getAdditionalParams()\n );\n }",
"public function parseURL() : array\n {\n if ($GLOBALS['config']['useUrlParsing']) {\n \n /**\n * @todo Create a parsing of url when the index is switched off\n */\n $this->_routes = '';\n } else {\n try {\n $this->_routes = $this->parseParams();\n \n if (!$this->_routes) return $this->indexPage;\n \n $path = explode('/', $this->_routes['r']);\n $controller = 'App\\\\Controllers\\\\'.ucfirst($path[0]) . 'Controller';\n $action = 'action'. ucfirst($path[1]);\n return [$controller, $action];\n } catch (Exception $ex) {\n \n }\n }\n }",
"private function _setParams()\n\t{\n\t\tforeach ($_GET as $key => $value) {\n\t\t\t$this->_params[$key] = $this->_sanitize($value);\n\t\t}\n\n\t\tforeach ($_POST as $key => $value) {\n\t\t\t$_POST[$key] = $this->_sanitize($value);\n\t\t}\n\n\t\t$nbElements = count($this->_requestVars);\n\t\tif ($nbElements > 3) {\n\t\t\t$i = 2;\n\t\t\twhile ($i < $nbElements and $i + 1 < $nbElements) {\n\t\t\t\tif (ctype_digit($this->_requestVars[$i])) {\n\t\t\t\t\t$i += 2;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this->_params[$this->_requestVars[$i]] = $this->_sanitize($this->_requestVars[$i + 1]);\n\t\t\t\t$i += 2;\n\t\t\t}\n\t\t}\n\n\t\tif ($nbElements > 2) {\n\t\t\t$i = 2;\n\t\t\twhile ($i < $nbElements) {\n\t\t\t\t$this->_params[$i - 2] = $this->_sanitize($this->_requestVars[$i]);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}",
"function shGETGarbageCollect()\n{\n\t// builds up a string using all remaining GET parameters, to be appended to the URL without any sef transformation\n\t// those variables passed litterally must be removed from $string as well, so that they are not stored in DB\n\tglobal $shGETVars;\n\t$sefConfig = Sh404sefFactory::getConfig();\n\tif (!$sefConfig->shAppendRemainingGETVars || empty($shGETVars))\n\t\treturn '';\n\t$ret = '';\n\tksort($shGETVars);\n\tforeach ($shGETVars as $param => $value)\n\t{\n\t\tif (is_array($value))\n\t\t{\n\t\t\tforeach ($value as $k => $v)\n\t\t\t{\n\t\t\t\t$ret .= '&' . $param . '[' . $k . ']=' . $v;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ret .= '&' . $param . '=' . $value;\n\t\t}\n\n\t}\n\treturn $ret;\n}",
"public function reset(){\n $this->_request_uri = '';\n self::$_request_vars = array();\n }",
"protected function getPreserveGetVars() {}",
"public function getPosts() {\n return isset($_POST) ? $_POST : array();\n }",
"public function getPostValues() {\n $post_check_array = array(\n// submit action\n 'add' => array('filter' => FILTER_SANITIZE_STRING),\n 'update' => array('filter' => FILTER_SANITIZE_STRING),\n // List all update form fields !!!\n// event type name.\n 'datum' => array('filter' => FILTER_SANITIZE_STRING),\n 'prioriteit' => array('filter' => FILTER_SANITIZE_STRING),\n 'username' => array('filter' => FILTER_SANITIZE_STRING),\n 'user' => array('filter' => FILTER_SANITIZE_STRING),\n 'password' => array('filter' => FILTER_SANITIZE_STRING),\n // Help text\n 'status' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'alarm_id' => array('filter' => FILTER_VALIDATE_INT),\n 'alarm_noticed' => array('filter' => FILTER_VALIDATE_INT),\n\t\t\t'alarm_origin' => array('filter' => FILTER_SANITIZE_STRING)\n );\n// Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n// RTS\n return $inputs;\n }",
"public function getInputFromGlobals()\n {\n\n switch (strtoupper($this->getMethod())) {\n case 'POST':\n $finalData = $_POST + FileUpload::fromGlobalFilesVariable($_FILES, true);\n break;\n\n case 'GET':\n $finalData = $_GET;\n break;\n\n // TODO other methods\n\n default:\n $finalData = [];\n break;\n }\n\n return $finalData;\n }",
"private function getQueryParams (): array\r\n {\r\n return $_GET;\r\n }",
"function removeURLQuery($query){\n\t\tif(is_array($query)){\n\t\t\tforeach ($query as $v){\n\t\t\t\tremoveURLQuery($v);\n\t\t\t}\n\t\t}\n\t\t$get = $_GET;\n\t\tif(array_key_exists($query, $get)) {\n\t\t\tunset($get[$query]);\n\t\t} \n\t\treturn $get;\n\t}",
"function extract_vars($method = INPUT_GET) {\n\n if (isset($_REQUEST[\"id\"])) {\n $in[\"id\"] = trim(filter_input($method,\"id\", FILTER_SANITIZE_STRING));\n }\n\n if (isset($_REQUEST[\"url\"])) {\n $in[\"url\"] = filter_input($method,\"url\", FILTER_SANITIZE_URL);\n }\n\n $in[\"category\"] = sanitize(\"category\", FILTER_SANITIZE_STRING, $method);\n $in[\"caption\"] = sanitize(\"caption\", FILTER_SANITIZE_STRING, $method);\n\n return $in;\n}",
"function rebuild($to_unset=\"block\"){\n\t\t\tglobal $_GET;\n\t\t\tunset($_GET[$to_unset]);\n\t\t\t\t\n\t\t\t$glue = \"?\";\n\t\t\treset($_GET);\n\t\t\twhile(list($key,$val)=each($_GET)){\n\t\t\t\t$val = str_replace(\" \",\"%20\",$val);\n\t\t\t\t$glue .= $key . \"=\" . $val . \"&\";\n\t\t\t}\n\t\t\treturn $glue;\n\t\t}",
"protected function validationData() {\n if (method_exists($this->route(), 'parameters')) {\n $this->request->add($this->route()->parameters());\n $this->query->add($this->route()->parameters());\n \n return array_merge($this->route()->parameters(), $this->all());\n }\n \n return $this->all();\n }",
"public function all($var=null, $default=null)\n {\n $all = array_merge($_GET, $_POST);\n\n if ($var) return $all[$var] ?? $default;\n\n return $all;\n }",
"public function actions_empty(){\n\n // Empty the internal actions array\n $this->actions = array();\n\n // Return the resulting array\n return $this->actions;\n\n }",
"protected function _fillMappingsArray()\n {\n if ($this->getRequest()->isPost())\n {\n $this->view->mappings_array = $this->getParam('mappings');\n }\n else\n {\n $this->view->mappings_array = $this->view->batch_upload_mapping_set->getMappingsArray();\n }\n }",
"function dev_get_submission_pages() {\n\n\t$submission = dev_get_option( 'ticket_submit' );\n\n\tif ( ! is_array( $submission ) ) {\n\t\t$submission = array_filter( (array) $submission );\n\t}\n\n\treturn $submission;\n\n}",
"protected function parseRequestVars($offset) {\n $explodedCleanRequestUrl = CleanRequestUrlParser::instance()->getExplodedCleanRequestUrl();\n if ($_SERVER[\"REQUEST_METHOD\"] === \"GET\") {\n $_GET['date'] = empty($explodedCleanRequestUrl[$offset+0])? null : $explodedCleanRequestUrl[$offset+0];\n $_GET['title'] = empty($explodedCleanRequestUrl[$offset+1])? null : $explodedCleanRequestUrl[$offset+1];\n } else { // assume it is a \"POST\"\n $_POST['date'] = empty($explodedCleanRequestUrl[$offset+0])? null : $explodedCleanRequestUrl[$offset+0];\n $_POST['title'] = empty($explodedCleanRequestUrl[$offset+1])? null : $explodedCleanRequestUrl[$offset+1];;\n }\n }",
"public static function all()\n {\n return array_merge(self::$__request, self::$__files);\n }",
"protected function getRequest(): array\n {\n return array_filter($this->request->all(), 'strlen');\n }"
] | [
"0.7287896",
"0.64479154",
"0.63948417",
"0.6167034",
"0.6009163",
"0.59874064",
"0.5962537",
"0.594242",
"0.58935344",
"0.58619934",
"0.5798575",
"0.5759933",
"0.57418805",
"0.56824875",
"0.5674535",
"0.5653743",
"0.56532925",
"0.5645066",
"0.5606732",
"0.5604698",
"0.55873704",
"0.5510244",
"0.55087227",
"0.55028254",
"0.5500007",
"0.548588",
"0.54788727",
"0.5441436",
"0.5438131",
"0.54285526",
"0.5421307",
"0.5419223",
"0.54085034",
"0.5386463",
"0.5374009",
"0.53606045",
"0.53362787",
"0.53313446",
"0.53291243",
"0.5304713",
"0.5293896",
"0.5288622",
"0.5281942",
"0.5259361",
"0.5256122",
"0.52517414",
"0.52506995",
"0.52469015",
"0.52364916",
"0.5229649",
"0.5217693",
"0.521671",
"0.5213123",
"0.52110136",
"0.51987916",
"0.51960564",
"0.51923716",
"0.51773",
"0.51583207",
"0.515789",
"0.5156312",
"0.51547265",
"0.51509213",
"0.51504165",
"0.5149915",
"0.51483786",
"0.5146567",
"0.5146206",
"0.514055",
"0.5140225",
"0.513751",
"0.51364917",
"0.5131953",
"0.51162297",
"0.50935054",
"0.50884414",
"0.50879306",
"0.5084268",
"0.50815344",
"0.5080351",
"0.507836",
"0.50768",
"0.5076484",
"0.50759524",
"0.5075916",
"0.50734884",
"0.5069856",
"0.5066596",
"0.50661635",
"0.506401",
"0.50599736",
"0.50519556",
"0.5048596",
"0.50441724",
"0.503647",
"0.50322354",
"0.5027373",
"0.5022495",
"0.5018332",
"0.5015344"
] | 0.5100032 | 74 |
Handles the response accordingly. | protected abstract function handleResponse(View $view); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'the item code was specified more than once') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['Level1Code'] = $this->request['Level1Code'];\n\t\t\t\n\t\t\tif (!$this->response['response']['error']) { // IF Error is False\n\t\t\t\tif (in_array($this->response['server']['http_code'], array('200', '201', '202', '204'))) {\n\t\t\t\t\t$this->log_sendlogitem($this->request['Level1Code']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->log_error($this->response['response']['Message']);\n\t\t\t}\n\t\t}",
"private function responseHandle() {\n // call hook function\n is_callable(config('hooks.onResponse')) && call_user_func(config('hooks.onResponse'), $this);\n // response data\n $this->responder->output();\n }",
"protected function _handleResponse(){\n $this->_results[] = array(\n 'http_code' => $this->getInfoHTTPCode(),\n 'response' => $this->getResponse(),\n 'server' => $this->getUrl()\n );\n }",
"protected function _response() {}",
"function _handler_response(&$app, &$c) {\n\t\t$c->param('app.view_http.response.status', $this->_http->getResponseCode());\n\t\t$c->param('app.view_http.response.body', $this->_http->getResponseBody());\n\t\t$c->param('app.view_http.response.headers', $this->_http->getResponseHeader());\n\t}",
"protected function sendResponse() {}",
"abstract public function response();",
"private function __send_response(){\n http_response_code($this->response_code);\n if($this->_redirect) header(\"Location: \".Config::WEB_DIRECTORY.\"{$this->_redirect_location}\");\n elseif($this->_JSON){\n header('Content-Type: application/json; charset=UTF-8');\n print json_encode($this->_JSON_contents, JSON_PRETTY_PRINT);\n }elseif($this->_HTML){\n if($this->_HTML_load_view) $this->_template->render();\n } /** @noinspection PhpStatementHasEmptyBodyInspection */ else{\n // Do nothing\n }\n }",
"abstract public function handle_request();",
"abstract public function processResponse($response);",
"public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }",
"protected abstract function handleRequest();",
"public function handleRequest() {}",
"private function processOptions()\r\n {\r\n $this->response = new Response(null, 200);\r\n }",
"function process() {\n\t\t\t$response = $this->response();\n\t\t\t$this->setSuccess($response);\n\t\t\treturn $this->responseVar;\n\t\t}",
"private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }",
"protected function processing()\n {\n $this->response = $this->response->withStatus(203);\n $this->jsonBody($this->payload->getOutput());\n }",
"protected function afterResponse()\n {\n }",
"public function response()\n {\n }",
"public function handleResponse($data)\n {\n // Retrieve the specific request data\n $requestData = current($data->getReturnsArray());\n\n // Initialize the rename pokemon response\n $setFavoritePokemonResponse = new SetFavoritePokemonResponse();\n\n // Unmarshall the response\n $setFavoritePokemonResponse->read($requestData);\n\n $this->setData($setFavoritePokemonResponse);\n }",
"function respond() {\n\n $request = & $this->request;\n $response = false;\n\n // first check for page refresh or first load\n if ($this->request->source == REQ_INDEX) {\n $state = $request->to_state(true);\n $response = $this->_do_index($state);\n\n } else {\n\n // next try for action event\n if ( ! $response) {\n $response = $this->_do_action($request);\n }\n\n // then fall back to state event\n if ( ! $response) {\n $state = $request->to_state();\n $response = $this->_do_state($state);\n }\n }\n\n // send response content to browser\n if ($response !== false) {\n if ($request->source == REQ_AJAX) {\n header('Content-type: application/json', true, 200);\n // no caching for ajax responses\n header(\"Cache-Control: no-cache, must-revalidate\");\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n $response = json_encode($response);\n } else {\n header('Content-type: text/html; charset=utf-8');\n }\n echo $response;\n return true;\n } else {\n return false;\n }\n }",
"public function handleShowResponse(array $data) {\n\t\t$this->template->json = $data;\n\t\t$this->template->parsedResponse = $this->iqrfAppManager->parseResponse($data);\n\t\t$this->redrawControl('responseChange');\n\t}",
"function handleRequest() ;",
"public function response ();",
"public function handleRequest();",
"public function handleRequest();",
"public function handleRequest();",
"public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }",
"public function handleResponse($data)\n {\n // Retrieve the specific request data\n $requestData = current($data->getReturnsArray());\n \n // Initialize the inventory response\n $inventoryResponse = new GetInventoryResponse();\n\n // Unmarshall the response\n $inventoryResponse->read($requestData);\n\n $this->setData($inventoryResponse);\n }",
"private function getResponse() {\n $this->response['status_code'] = $this->status->getStatusCode();\n $this->response['reason_phrase'] = $this->status->getReasonPhrase();\n \n $this->readHeaders();\n }",
"protected function response()\r\n {\r\n return true;\r\n }",
"public function response(){\r\n\t\t// register event on_shutdown\r\n\t\tregister_shutdown_function(function(){\r\n\t\t\t// on_shutdown\r\n\t\t\t\\M::get('event')->trigger('system.on_shutdown');\r\n\r\n\t\t\t// debug\r\n\t\t\t\\M::get('debug')->exception_fatal();\r\n\t\t});\r\n\r\n\t\tob_start();\r\n\t\t\t// load default config & controller core\r\n\t\t\trequire_once APP_PATH . 'config.php';\r\n\t\t\trequire_once SYSTEM_PATH . 'controller.php';\r\n\r\n\t\t\t// on load\r\n\t\t\t\\M::get('event')->trigger('system.on_load', DOMAIN);\r\n\r\n\t\t\t// parser url\r\n\t\t\t$this->parser_url();\r\n\t\t\t// load module\r\n\t\t\t$this->load_module(input('module', 'str', 'get'));\r\n\t\t\t// load extend module\r\n\t\t\t$this->load_extend(input('extend_module', 'str', 'get'));\r\n\t\t\t// load group controller & controller\r\n\t\t\tlist($lib, $instance) = $this->load_controller(input('group_controller', 'str', 'get'), input('controller', 'str', 'get'));\r\n\t\t\t// load action\r\n\t\t\t$this->load_action($lib, $instance);\r\n\t\t$html = ob_get_clean();\r\n\r\n\t\t// on response\r\n\t\tob_start();\r\n\t\t\\M::get('event')->change('system.on_response', $html);\r\n\r\n\t\t// display html & end all script\r\n\t\tdie($html);\r\n\t}",
"function deliver_response(){\n\n // --- Step 1: Initialize variables and functions\n //\n // Deliver HTTP Response\n // The desired HTTP response content type: [json, html, xml]\n // The desired HTTP response data\n\n\n header('HTTP/1.1 '.$this->response['status'] . // Set HTTP Response\n ' '.$this->http_response_code[$this->response['status'] ]);\n header('Content-Type: application/json; charset=utf-8'); // Set HTTP Response Content Type\n $json_response = json_encode($this->response['data']); // Format data into a JSON response\n echo $json_response; // Deliver formatted data\n }",
"public function Response($response) {\n\t\t\n\t}",
"public function handleGetData()\n\t{\n\t\t$data = $this->getData();\n\t\t$options = $this->getOptions();\n\n\t\t$this->presenter->sendResponse(\n\t\t\tnew JsonResponse(\n\t\t\t\t[\n\t\t\t\t\t\"data\" => $data,\n\t\t\t\t\t\"options\" => $options,\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t}",
"public function response();",
"public function getResponse($response) {\r\n\r\n\r\n }",
"private function handleOriginResponse( $response )\n\t{\n\t\t/**\n\t\t * Origin didn't have the object\n\t\t */\n\t\tif ( $response === false )\n\t\t{\n\t\t\t\\Output::render404( );\n\t\t}\n\n\t\t/**\n\t\t * We're good to go, start rendering\n\t\t */\n\t\t\\Output::sendHeader( $_SERVER['SERVER_PROTOCOL'] . ' 200 OK' );\n\n\t\t/**\n\t\t * Origin had the object, and it's now stored on disk, render the stored object\n\t\t */\n\t\tif ( $response === true )\n\t\t{\n\t\t\tif ( isset( $_COOKIE['is_redirecting'] ) === true )\n\t\t\t{\n\t\t\t\tsleep( 2 );\n\t\t\t}\n\n\t\t\t\\setcookie( 'is_redirecting', 1, time( ) + 5 );\n\t\t\t\\Output::sendHeader( 'Location: ' . $this->request['path'] );\n\t\t\t$this->isRedirect = true;\n\t\t}\n\n\t\tif ( is_object( $response ) === true )\n\t\t{\n\t\t\t/**\n\t\t\t * It's a streaming object, so we'll render it from here\n\t\t\t */\n\t\t\t\\Output::sendHeader( $_SERVER['SERVER_PROTOCOL'] . ' 200 OK' );\n\n\t\t\tif ($response->type && $response->type === 'js') {\n\t\t\t\t\\Output::sendHeader('Content-Type: text/javascript;');\n\t\t\t}\n\n\t\t\t\\Output::render( \\Output::decodeWireObject( $response->object ) );\n\t\t}\n\t}",
"public function handle_result() {\n\t\t\t\tif ( ! isset( $_REQUEST['order-id'] ) || empty( $_REQUEST['order-id'] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$response = file_get_contents( 'php://input' );\n\t\t\t\t$jsonResponse = json_decode( $response );\n\t\t\t\t$responseArray = json_decode($response,true);\n\t\t\t\t\n\t\t\t\t$order = wc_get_order( $_REQUEST['order-id'] );\n\t\t\t\t\n\t\t\t $order->add_order_note( $this->generateTable($responseArray),'success' );\n\t\t\t // Only Log when test mode is enabled\n\t\t\t if( 'yes' == $this->get_option( 'test_enabled' ) ) {\n\t\t\t \t$order->add_order_note( $response );\n\t\t\t }\n\t\t\t \n\n\t\t\t\tif ( isset( $jsonResponse->transactionStatus ) && 'APPROVED' == $jsonResponse->transactionStatus ) {\n\t\t\t\t\t\t// Complete this order, otherwise set it to another status as per configurations\n\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t$order->update_status( $this->get_option( 'success_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t} else {\n\t\t\t\t\t$order->update_status( $this->get_option( 'errored_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t}\n\t\t\t}",
"public function send_response() {\n\t\n\t\t$return = $this->get_response();\n\t\t\n\t\t/* send it and terminate this instance */\n\t\tif($this->get_errors()) {\n\t\t\twp_send_json_error($return);\t\t\t\t\t\t\n\t\t} else {\n \t\tif( null === $this->wp_query ) {\n \t\t\twp_send_json_success($return); \t\t \t\t\n \t\t} else {\n \t\t\n \t\t\t$data = array(\n \t\t\t'success' => true,\n \t\t\t'data' => $return,\n \t\t\t'query' => $this->parse_wp_query_object_2_js( $this->wp_query )\n \t\t\t);\n \t\t\twp_send_json($data); // build a custom wp_send_json_success with an extra property \n \t\t}\t\t\t\n\t\t}\n\t}",
"abstract protected function handleResult();",
"protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }",
"public function sendResponse();",
"public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }",
"public function process()\n {\n $this->send_status();\n $this->send_headers();\n $this->send_content();\n exit(0);\n }",
"function handleResponse($response) : void\n{\n print_r(json_encode($response));\n die();\n}",
"abstract protected function checkExistingResponse();",
"abstract public function responseProvider();",
"function response($code){\n $this->response_code = $code;\n }",
"protected function handleResultRequest() {\n\t\t// no longer letting people in without these things. If this is\n\t\t// preventing you from doing something, you almost certainly want to be\n\t\t// somewhere else.\n\t\t$deadSession = false;\n\t\tif ( !$this->adapter->session_hasDonorData() ) {\n\t\t\t$deadSession = true;\n\t\t}\n\t\t$oid = $this->adapter->getData_Unstaged_Escaped( 'order_id' );\n\n\t\t$request = $this->getRequest();\n\t\t$referrer = $request->getHeader( 'referer' );\n\t\t$liberated = false;\n\t\tif ( $this->adapter->session_getData( 'order_status', $oid ) === 'liberated' ) {\n\t\t\t$liberated = true;\n\t\t}\n\n\t\t// XXX need to know whether we were in an iframe or not.\n\t\tglobal $wgServer;\n\t\tif ( $this->isReturnFramed() && ( strpos( $referrer, $wgServer ) === false ) && !$liberated ) {\n\t\t\t$sessionOrderStatus = $request->getSessionData( 'order_status' );\n\t\t\t$sessionOrderStatus[$oid] = 'liberated';\n\t\t\t$request->setSessionData( 'order_status', $sessionOrderStatus );\n\t\t\t$this->logger->info( \"Resultswitcher: Popping out of iframe for Order ID \" . $oid );\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setHeaders();\n\t\t$userAgent = $request->getHeader( 'User-Agent' );\n\t\tif ( !$userAgent ) {\n\t\t\t$userAgent = 'Unknown';\n\t\t}\n\n\t\tif ( $this->isRepeatReturnProcess() ) {\n\t\t\t$this->logger->warning(\n\t\t\t\t'Donor is trying to process an already-processed payment. ' .\n\t\t\t\t\"Adapter Order ID: $oid.\\n\" .\n\t\t\t\t\"Cookies: \" . print_r( $_COOKIE, true ) . \"\\n\" .\n\t\t\t\t\"User-Agent: \" . $userAgent\n\t\t\t);\n\t\t\t$this->displayThankYouPage( 'repeat return processing' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $deadSession ) {\n\t\t\tif ( $this->adapter->isReturnProcessingRequired() ) {\n\t\t\t\twfHttpError( 403, 'Forbidden', wfMessage( 'donate_interface-error-http-403' )->text() );\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t'Resultswitcher: Request forbidden. No active donation in the session. ' .\n\t\t\t\t\t\"Adapter Order ID: $oid.\\n\" .\n\t\t\t\t\t\"Cookies: \" . print_r( $_COOKIE, true ) . \"\\n\" .\n\t\t\t\t\t\"User-Agent: \" . $userAgent\n\t\t\t\t);\n\t\t\t}\n\t\t\t// If it's possible for a donation to go through without our\n\t\t\t// having to do additional processing in the result switcher,\n\t\t\t// we don't want to falsely claim it failed just because we\n\t\t\t// lost the session data. We also don't want to give any\n\t\t\t// information to scammers hitting this page with no session,\n\t\t\t// so we always show the thank you page. We don't want to do\n\t\t\t// any post-processing if we're not sure whether we actually\n\t\t\t// originated this attempt, so we return right after.\n\t\t\t$this->logger->warning(\n\t\t\t\t'Resultswitcher: session is dead, but the ' .\n\t\t\t\t'donor may have made a successful payment.'\n\t\t\t);\n\t\t\t$this->displayThankYouPage( 'dead session' );\n\t\t\treturn;\n\t\t}\n\t\t$this->logger->info( \"Resultswitcher: OK to process Order ID: \" . $oid );\n\n\t\tif ( $this->adapter->checkTokens() ) {\n\t\t\t// feed processDonorReturn all the GET and POST vars\n\t\t\t$requestValues = $this->getRequest()->getValues();\n\t\t\t$result = $this->adapter->processDonorReturn( $requestValues );\n\t\t\t$this->markReturnProcessed();\n\t\t\t$this->renderResponse( $result );\n\t\t\treturn;\n\t\t} else {\n\t\t\t$this->logger->error( \"Resultswitcher: Token Check Failed. Order ID: $oid\" );\n\t\t}\n\t\t$this->displayFailPage();\n\t}",
"private function responseHandler($response){\n\n if ($response === FALSE) { \n\n throw new Exception(curl_error($curl), curl_errno($curl)); //Return a string containing error and error number\n } else { // response is True\n\n $reponseArray = json_decode($response, true); // Decode a $response and save it as array.\n\n // in case return offers with response .\n if (isset($reponseArray['offers']) && !empty($reponseArray['offers'])) {\n\n return $reponseArray['offers']['Hotel'];\n\n } else {\n return false;\n }\n }\n \n }",
"protected function sendResponse() {\n $this->eventManager->triggerEvent(self::EVENT_PRE_RESPONSE, array('web' => $this));\n\n $this->setSessionCookie();\n\n $this->renderView();\n\n // send the response\n if ($this->log) {\n $this->log->logDebug('Sending response', 'Status code ' . $this->response->getStatusCode(), System::LOG_SOURCE);\n\n $headers = $this->response->getHeaders();\n foreach ($headers as $header) {\n $this->log->logDebug('Sending header', $header, System::LOG_SOURCE);\n }\n\n $cookies = $this->response->getCookies();\n foreach ($cookies as $cookie) {\n $this->log->logDebug('Sending header', Header::HEADER_SET_COOKIE . ': ' . $cookie, System::LOG_SOURCE);\n }\n\n $view = $this->response->getView();\n if ($view) {\n $this->log->logDebug('Rendering and sending view', get_class($view), System::LOG_SOURCE);\n }\n }\n\n $this->response->send($this->request);\n\n $this->eventManager->triggerEvent(self::EVENT_POST_RESPONSE, array('web' => $this));\n\n $this->writeSession();\n }",
"public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }",
"public function setResponse() {\n }",
"public function handleResponse(Player $player, $data): void {\n\t\t// TODO: Implement handleResponse() method.\n\t}",
"public function ajax_response()\n {\n }",
"public function onResponseLate(FilterResponseEvent $event)\n {\n if (!$this->isActive($event)) {\n return;\n }\n $request = $event->getRequest();\n $response = $event->getResponse();\n if ($request->getRequestFormat() === self::FORMAT_JSON\n && $request->query->has('callback')\n && $response instanceof JsonResponse\n ) {\n switch ($request->query->get('_wrapper')) {\n case self::WRAPPER_POST_MESSAGE:\n $response->setContent(\n $this->twig->render(\n 'MediaMonksRestApiBundle::post_message.html.twig',\n [\n 'request' => $request,\n 'response' => $response,\n 'callback' => $request->query->get('callback'),\n 'origin' => $this->getOrigin()\n ]\n )\n )->headers->set('Content-Type', 'text/html');\n break;\n default:\n $response->setCallback($request->query->get('callback'));\n break;\n }\n }\n }",
"public function onEndRequest()\n {\n $response = self::getAjaxResponse()->getArray();\n if ($this->getAjaxResponseValidator()->validate($response)) {\n echo json_encode($response);\n }\n }",
"public function handlePost()\n {\n return parent::handlePost();\n }",
"public function sendResponse()\n {\n $this->_response = Mage::app()->getResponse();\n\n //check redirect\n if ($this->_response->isRedirect()) {\n $headers = $this->_response->getHeaders();\n $redirect = '';\n foreach ($headers as $header) {\n if (\"Location\" == $header[\"name\"]) {\n $redirect = $header[\"value\"];\n break;\n }\n }\n if ($redirect) {\n $this->setRedirect($redirect);\n }\n }\n\n $this->_response->clearHeaders();\n $this->_response->setHeader('Content-Type', 'application/json');\n $this->_response->clearBody();\n $this->_response->setBody($this->toJson());\n $this->_response->sendResponse();\n exit;\n }",
"public function prepareResponse();",
"public function afterAction()\r\n\t\t{\r\n\t\t\t//\r\n\t\t\tif (empty( $this->response )) {\r\n\t\t\t\t//\r\n\t\t\t\t$isNeedRender = !empty( $this->view ) && !$this->view->isRendered();\r\n\t\t\t\t//\r\n\t\t\t\t$this->response = new HttpResponse();\r\n\t\t\t\t//\r\n\t\t\t\tif ( $isNeedRender ) {\r\n\t\t\t\t\t//\r\n\t\t\t\t\t$this->response->setData( $this->view->render() );\r\n\t\t\t\t} else {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\tif (!$this->response->isSent()) {\r\n\t\t\t\t//\r\n\t\t\t\t$this->response->send();\r\n\t\t\t}\r\n\t\t}",
"public function respond()\n\t{\n\t\t$this->setTemplate();\n\t\t$this->template->setGuid( $this->request['guid'] );\n\t\t$this->template->setContent( $this->view->getContent() );\n\t\n\t\techo $this->template->request();\t\n\t}",
"protected function found()\n {\n $this->response = $this->response->withStatus(200);\n $this->jsonBody($this->payload->getOutput());\n }",
"protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}",
"public function handle_response () {\n // callback URL: https://{service}.e-com.plus/session/sso_login\n // call this function on route specified above\n if (isset($_GET['sso']) && isset($_GET['sig'])) {\n // get user object\n return $this->user_info($_GET['sso'], $_GET['sig']);\n } else {\n // invalid URL query string\n return null;\n }\n }",
"public function story_response()\n {\n $user_id = $this->_require_login();\n $this->_require_register();\n\n $post_data = $this->input->post(NULL, TRUE);\n $story_id = $post_data['story_id'];\n $story = $this->story_model->get($story_id);\n\n if($this->_is_user_bottle($story_id) == 0 && $story[0]['story_user_id'] != $user_id){\n redirect('/pick');\n }else{\n\n $reply_to_id = $story[0]['story_user_id'];\n\n $reply_data = array(\n 'reply_sender_id' => $user_id,\n 'reply_story_id' => $story_id,\n 'reply_to_id' => $post_data['reply_to_id'],\n 'reply_text' => $post_data['response_content'],\n 'reply_time' => date(\"Y-m-d H:i:s\")\n );\n\n $reply_id = $this->reply_model->insert($reply_data);\n redirect('/bottles/'.$story_id);\n }\n }",
"public function onResponse($rep) \n {\n if($rep->get('correlation_id') == $this->correlation_id) {\n $this->response = $rep->body;\n }\n }",
"protected function process(): \\Botomatic\\Engine\\Facebook\\Entities\\Response\n {\n if ($this->isFirstStep())\n {\n // advance to the next step\n $this->nextStep();\n\n return $this->response->askForAge();\n }\n else\n {\n if ($this->message->userSentAge())\n {\n /**\n * Extract the age, show message and move to the next state\n */\n return $this->response->finish($this->message->extractAge());\n }\n else\n {\n return $this->response->notAValidAge();\n }\n }\n }",
"public function post() {\n\t\t$data = self::getPostData();\n\t\t/*\n\t\t * Return not found by defaut, just in case you don't override it when \n\t\t * extending it.\n\t\t */\n\t\tHook::fire(Hook::EVENT_RESPONSE_NOT_FOUND);\n\t}",
"public function process_interac_response()\n\t{\n\t\t$idebit_merchantdata = strtolower(ee()->input->get_post('IDEBIT_MERCHDATA'));\n\t\tif($idebit_merchantdata)\n\t\t{\n\t\t\t$transaction = ee()->db->select('store_notify_url')->from('store_beanstream_interac')->where('interac_merchant_data', $idebit_merchantdata)->get();\n\t\t\tif($transaction->num_rows() == 1)\n\t\t\t{\n\t\t\t\t$_POST['funded'] = $_GET['funded'];\n\t\t\t\t$url = $transaction->row('store_notify_url').'&'.http_build_query($_POST);\n\t\t\t\tee()->functions->redirect($url);\n\t\t\t}\n\t\t}\n\t}",
"protected function handleResultRequest() {\n\t\t//no longer letting people in without these things. If this is\n\t\t//preventing you from doing something, you almost certainly want to be\n\t\t//somewhere else.\n\t\t$deadSession = false;\n\t\tif ( !$this->adapter->session_hasDonorData() ) {\n\t\t\t$deadSession = true;\n\t\t}\n\t\t$oid = $this->adapter->getData_Unstaged_Escaped( 'order_id' );\n\n\t\t$request = $this->getRequest();\n\t\t$referrer = $request->getHeader( 'referer' );\n\t\t$liberated = false;\n\t\tif ( $this->adapter->session_getData( 'order_status', $oid ) === 'liberated' ) {\n\t\t\t$liberated = true;\n\t\t}\n\n\t\t// XXX need to know whether we were in an iframe or not.\n\t\tglobal $wgServer;\n\t\tif ( $this->isReturnFramed() && ( strpos( $referrer, $wgServer ) === false ) && !$liberated ) {\n\t\t\t$sessionOrderStatus = $request->getSessionData( 'order_status' );\n\t\t\t$sessionOrderStatus[$oid] = 'liberated';\n\t\t\t$request->setSessionData( 'order_status', $sessionOrderStatus );\n\t\t\t$this->logger->info( \"Resultswitcher: Popping out of iframe for Order ID \" . $oid );\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setHeaders();\n\n\t\tif ( $deadSession ){\n\t\t\tif ( $this->adapter->isReturnProcessingRequired() ) {\n\t\t\t\twfHttpError( 403, 'Forbidden', wfMessage( 'donate_interface-error-http-403' )->text() );\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t'Resultswitcher: Request forbidden. No active donation in the session. ' .\n\t\t\t\t\t\"Adapter Order ID: $oid\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t// If it's possible for a donation to go through without our\n\t\t\t// having to do additional processing in the result switcher,\n\t\t\t// we don't want to falsely claim it failed just because we\n\t\t\t// lost the session data. We also don't want to give any\n\t\t\t// information to scammers hitting this page with no session,\n\t\t\t// so we always show the thank you page. We don't want to do\n\t\t\t// any post-processing if we're not sure whether we actually\n\t\t\t// originated this attempt, so we return right after.\n\t\t\t$this->logger->warning(\n\t\t\t\t'Resultswitcher: session is dead, but the ' .\n\t\t\t\t'donor may have made a successful payment.'\n\t\t\t);\n\t\t\t$this->displayThankYouPage( 'dead session' );\n\t\t\treturn;\n\t\t}\n\t\t$this->logger->info( \"Resultswitcher: OK to process Order ID: \" . $oid );\n\n\t\tif ( $this->adapter->checkTokens() ) {\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t// FIXME: do we really need this again?\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\t// processResponse expects some data, so let's feed it all the\n\t\t\t// GET and POST vars\n\t\t\t$response = $this->getRequest()->getValues();\n\t\t\t// TODO: run the whole set of getResponseStatus, getResponseErrors\n\t\t\t// and getResponseData first. Maybe do_transaction with a\n\t\t\t// communication_type of 'incoming' and a way to provide the\n\t\t\t// adapter the GET/POST params harvested here.\n\t\t\t$this->adapter->processResponse( $response );\n\t\t\t$status = $this->adapter->getFinalStatus();\n\t\t\tswitch ( $status ) {\n\t\t\tcase FinalStatus::COMPLETE:\n\t\t\tcase FinalStatus::PENDING:\n\t\t\t\t$this->displayThankYouPage( $status );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->logger->info( \"Displaying fail page for final status $status\" );\n\t\t} else {\n\t\t\t$this->logger->error( \"Resultswitcher: Token Check Failed. Order ID: $oid\" );\n\t\t}\n\t\t$this->displayFailPage();\n\t}",
"public static function handleResponse()\n {\n Yii::import('application.components.aws.CustomSns.Notification');\n \n // Make sure the request is POST\n if ($_SERVER['REQUEST_METHOD'] !== 'POST') {\n throw new Exception(\"Method Not Allowed\", 405);\n }\n \n try {\n // Create a message from the post data and validate its signature\n $message = Message::fromRawPostData();\n $validator = new MessageValidator();\n $validator->validate($message);\n } catch (Exception $e) {\n // Pretend we're not here if the message is invalid\n throw new Exception(\"Not Found\", 404);\n }\n\n if ($message->get('Type') === 'SubscriptionConfirmation') {\n // Send a request to the SubscribeURL to complete subscription\n $client = new Client();\n $subscribeURL = $message->get('SubscribeURL');\n $client->get($subscribeURL)->send();\n }\n elseif ($message->get('Type') === 'Notification') {\n $msg = json_decode($message->get('Message'), true);\n \n if (!empty($msg) && isset($msg['notificationType']) && in_array($msg['notificationType'], array(NotificationType::BOUNCE, NotificationType::COMPLAINT))) {\n return new Notification($message);\n }\n }\n \n return null;\n }",
"public function renderResponse(): void\n {\n $methodName = $this->methodName;\n $this->$methodName()->send();\n\t}",
"protected function processContent(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\t\t$contentType = $this->moduleConfig->getControllerConfig()->getContentType();\r\n\t\tif ($contentType != '') {\r\n\t\t\t$response->setContentType($contentType);\r\n\t\t}\r\n\t}",
"public function post()\n\t{\n\t\t\n\t\t$this->plugin->setResponse( $result );\n\t}",
"public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }",
"abstract protected function parseResponse($response);",
"public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }",
"public function processResponses() {\n\t\t$receivedResponses = $this->receivedResponseMapper->findAll();\n\t\tforeach ($receivedResponses as $receivedResponse) {\n\t\t\t$requestId = $receivedResponse->getRequestId();\n\t\t\t$answer = $receivedResponse->getAnswer();\n\t\t\n\t\t\t$queuedRequest = $this->queuedRequestMapper->find($requestId);\n\t\t\tif ($queuedRequest) {\n\t\t\t\t$type = $queuedRequest->getRequestType();\n\t\t\t\t$field1 = $queuedRequest->getField1();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//request no longer exists, so just delete response\n\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase Request::USER_EXISTS:\n\t\t\t\t\tif ($answer !== \"1\" AND $answer !== \"0\") {\n\t\t\t\t\t\t$this->api->log(\"ReceivedResponse for Request USER_EXISTS, request_id = {$receivedResponse->getId()} had invalid response = {$answer}\"); \n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($answer === \"0\") {\n\t\t\t\t\t\t$friendships = $this->friendshipMapper->findAllByUser($field1);\n\t\t\t\t\t\tforeach ($friendships as $friendship) {\n\t\t\t\t\t\t\t$this->friendshipMapper->delete($friendship);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t//Don't need destination for delete since they should all be this instance\n\t\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n \t\t\t\t\t$this->queuedRequestMapper->delete($receivedResponse);\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Request::FETCH_USER: \n\t\t\t\t\tif ($answer !== \"1\" AND $answer !== \"0\") {\n\t\t\t\t\t\t$this->api->log(\"ReceivedResponse for Request FETCH_USER, request_id = {$receivedResponse->getId()} had invalid response = {$answer}\"); \n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->api->beginTransaction();\n\t\t\t\t\t//Don't need destination for delete since they should all be this instance\n\t\t\t\t\t$this->receivedResponseMapper->delete($receivedResponse);\n \t\t\t\t\t$this->queuedRequestMapper->delete($receivedResponse);\n\t\t\t\t\t$this->api->commit();\n\t\t\t\t\t\n\t\t\t\t\tbreak;\t\n\t\t\t\tdefault:\n\t\t\t\t\t$this->api->log(\"Invalid request_type {$type} for request id {$requestId}\");\n\t\t\t\t\tcontinue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"function response() {\n\t\t\t$this->setInfo('Function incorrectly structured.');\n\t\t\treturn false;\n\t\t}",
"protected function handleGET() {\n /* ... Do the stuff ... */\n\n return $this->render('default.html', array());\n }",
"protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }",
"public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}",
"protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}",
"public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }",
"public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}",
"function handleRequest($request, &$response){ \n switch($request->getHeader($HEADER_CONTENT_TYPE)){\n case $CONTENT_TYPE_JSON:\n if(json_decode($request)!=null){ // basic JSON validation\n $response->getBody()->write($SAMPLE_RESPONSE_JSON);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_JSON);\n $response->withStatus(200, $STATUS_REASON_200);\n }else\n $response->withStatus(400, $STATUS_REASON_400);\n break;\n case $CONTENT_TYPE_HTML:\n $response->getBody()->write($SAMPLE_RESPONSE_HTML);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_HTML);\n $response->withStatus(200, $STATUS_REASON_200);\n break;\n // other content types can be added as needed\n default:\n $response->withStatus(400, $STATUS_REASON_400);\n }\n}",
"protected function accepted()\n {\n $this->response = $this->response->withStatus(202);\n $this->jsonBody($this->payload->getOutput());\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public function getResponse()\n {\n }",
"public function respond() {\n\t\thttp_response_code($this->code);\n\n\t\t// Additional headers\n\t\tforeach ($this->head as $header) {\n\t\t\theader($header);\n\t\t}\n\n\t\t// Write the body\n\t\tforeach ($this->body as $toStringable) {\n\t\t\techo $toStringable;\n\t\t}\n\t}",
"public function return_handler() {\n\t\t@ob_clean();\n\t\theader( 'HTTP/1.1 200 OK' );\n\n\t\tif ( isset( $_REQUEST['reference'] ) && isset( $_REQUEST['paymentId'] ) && isset( $_REQUEST['signature'] ) ) {\n\t\t\t$signature = strtoupper( md5( $_REQUEST['amount'] . $_REQUEST['reference'] . $_REQUEST['paymentId'] . $_REQUEST['paymentDate'] . $_REQUEST['paymentStatus'] . $this->private_key ) );\n\t\t\t$order_id = absint( $_REQUEST['reference'] );\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\tif ( hash_equals( $signature, $_REQUEST['signature'] ) ) {\n\t\t\t\t$order_complete = $this->process_order_status( $order, $_REQUEST['paymentId'], $_REQUEST['paymentStatus'], $_REQUEST['paymentDate'] );\n\n\t\t\t\tif ( ! $order_complete ) {\n\t\t\t\t\t$order->update_status( 'failed', __( 'Payment was declined by Simplify Commerce.', 'woocommerce' ) );\n\t\t\t\t}\n\n\t\t\t\twp_redirect( $this->get_return_url( $order ) );\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\n\t\twp_redirect( wc_get_page_permalink( 'cart' ) );\n\t\texit();\n\t}",
"public function executeResponse($response)\n {\n if($response instanceof View)\n {\n $response->setFolderViewController($this->requestUrl->getController());\n }\n \n if ($response instanceof Response)\n {\n $response->execute();\n } \n else\n {\n exit('Respuesta no valida');\n }\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public static function sendOkResponse(){\n http_response_code(200);\n die();\n }",
"protected abstract function render(Response $response);",
"public function processResponseData($rawResponseData);",
"public function sendResponse() {\n\n header('Content-Type: ' . SabreAMF_Const::MIMETYPE);\n $this->amfResponse->setEncoding($this->amfRequest->getEncoding());\n $this->amfResponse->serialize($this->amfOutputStream);\n echo($this->amfOutputStream->getRawData());\n\n }"
] | [
"0.77262974",
"0.772563",
"0.7590391",
"0.73592067",
"0.7097606",
"0.7097482",
"0.7087113",
"0.69908226",
"0.6897515",
"0.6848459",
"0.6693331",
"0.6671048",
"0.6668582",
"0.6638462",
"0.66298544",
"0.6606334",
"0.6536513",
"0.6512884",
"0.64772254",
"0.6461064",
"0.6454721",
"0.64532024",
"0.64488596",
"0.6445472",
"0.64148676",
"0.64148676",
"0.64148676",
"0.6409091",
"0.6406588",
"0.63783216",
"0.6315117",
"0.6308046",
"0.62765914",
"0.62723833",
"0.6248732",
"0.6228572",
"0.62272066",
"0.62207556",
"0.6198433",
"0.6162714",
"0.6148255",
"0.61414874",
"0.6139737",
"0.6139577",
"0.61377",
"0.6133849",
"0.61271644",
"0.61219674",
"0.61210066",
"0.6118979",
"0.6105748",
"0.6100115",
"0.6097028",
"0.60819536",
"0.60797894",
"0.60796547",
"0.6067876",
"0.6061577",
"0.60613215",
"0.60579234",
"0.6057129",
"0.6056228",
"0.6043909",
"0.6041652",
"0.60414743",
"0.60380393",
"0.6025024",
"0.6024448",
"0.60081935",
"0.5997033",
"0.59915245",
"0.59788173",
"0.5977603",
"0.59722364",
"0.5970694",
"0.59651816",
"0.59492546",
"0.5930267",
"0.59001595",
"0.5899885",
"0.58995163",
"0.58770126",
"0.5869265",
"0.5866291",
"0.5863179",
"0.5862454",
"0.5862241",
"0.58576715",
"0.5857069",
"0.58548677",
"0.5853836",
"0.5852635",
"0.5843713",
"0.582701",
"0.5823143",
"0.5821181",
"0.58188576",
"0.5814164",
"0.58079445",
"0.58041114"
] | 0.72486347 | 4 |
This function returns all the testcases inside one parent category and their subcategories | function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch){
global $clientID,$categoriesItemTypeID,$categoryParentPropertyID,$testcasesItemTypeID,$testCasesCategoryPropertyID,$testcasesNamePropertyID,$testcasesOrderPropertyID,$inDebug;
// build return properties array
$returnProperties = array();
$returnProperties[] = array('ID' => $testcasesNamePropertyID, 'name' => 'testcaseName');
$returnProperties[] = array('ID' => $testCasesCategoryPropertyID, 'name' => 'testCategoryParentID');
$returnProperties[] = array('ID' => $testcasesOrderPropertyID, 'name' => 'order');
//build the filter
$filters = array();
$filters[] = array('ID' => $testCasesCategoryPropertyID, 'value' => $parentCategoryID);
$testCases = getFilteredItemsIDs($testcasesItemTypeID, $clientID, $filters, $returnProperties);
//Next, save only the test cases that are inside the relation
$resultTC = array();
for ($i=0;$i<count($testCases);$i++){
foreach ($idsToSearch as $rel){
if ($testCases[$i]['ID']==$rel){
//test found in relation, add to returning array
$resultTC[]=$testCases[$i];
break;
}
}
}
//And return the testCases
return($resultTC);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside\n $allCategories = getAllTestCategoriesInsideACategory($parentCategoryID, $clientID);\n\n $toFilter = implode(',', $allCategories);\n\n //When we have all the categories inside, get their test cases\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}",
"function getAllTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //First, we need the tree categories\n $tree = getItemsTree($itemTypeTestCasesCategoriesID, $clientID, $testCategoryParentPropertyID, $parentCategoryID);\n\n //Transform the items tree and store the ids in an unidimensional array\n $allCategories = array();\n\n //First, add the parentCategoryID\n $allCategories[] = $parentCategoryID;\n\n if ($tree) {\n foreach ($tree as $parid => $parent) {\n\n if (!in_array($parid, $allCategories)) {\n //Add the value\n $allCategories[] = $parid;\n }\n\n foreach ($parent as $child) {\n $id = $child['ID'];\n\n //Check if the values does not exist in the allCategories array.\n if (!in_array($id, $allCategories)) {\n //Add the value\n $allCategories[] = $id;\n }\n }\n }\n }\n\n //And return the testCategories\n return ($allCategories);\n}",
"function getTestCasesInsideACategory($testCategoryID, $theSubjectID, $roundID, $clientID) {\n global $definitions;\n\n $categoriesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n $testCasesArray = array();\n\n //First, get the internal structure of testCategories\n $tcatTree = getItemsTree($categoriesItemTypeID, $clientID, $categoryParentPropertyID, $testCategoryID);\n\n $idsToRetrieve = array();\n\n //Store all testCategories ids found in a plain array\n foreach ($tcatTree as $tc) {\n for ($j = 0; $j < count($tc); $j++) {\n if (!(in_array($tc[$j]['parent'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['parent'];\n }\n if (!(in_array($tc[$j]['ID'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['ID'];\n }\n }\n }\n\n //Get the relations item\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n if ((count($relations) - 1) == 0) {\n //Get the test cases ids inside an array\n $idsToSearch = explode(',', $relations[0]['testCasesIDs']);\n for ($i = 0; $i < count($idsToRetrieve); $i++) {\n //Get the test cases and filter\n $availableTestCases = array();\n $availableTestCases = getFilteredTestCasesInsideCategory($idsToRetrieve[$i], $idsToSearch, $clientID);\n //And add to results\n for ($j = 0; $j < count($availableTestCases); $j++) {\n $partRes = array();\n $partRes['ID'] = $availableTestCases[$j]['ID'];\n $testCasesArray[] = $partRes;\n }\n }\n }\n\n return $testCasesArray;\n}",
"function getTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $parentCategoryID);\n\n $testCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}",
"function getParentCategoriesForTestCase($testCaseID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //First, get the parent test category for the test case\n $categoryID = getItemPropertyValue($testCaseID, $testCasesParentPropertyID, $clientID);\n\n //return all categories\n return getParentCategoriesForCategory($categoryID, $clientID);\n}",
"function getTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentPropertyID, 'value' => $parentCategoryID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}",
"public function testGetAllParents() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $ph_kb_category_child = $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get all categories\n $categories = $this->kb_category->get_all_parents( $ph_kb_category_child->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( self::NAME, $category->name );\n }",
"function getParentCategoriesForCategory($categoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //start loop with passed category\n $aux = $categoryID;\n\n $categoriesArray = array();\n\n //search parent category until 0 level reached\n while ($aux != 0) {\n $categoriesArray[] = $aux;\n $aux = getItemPropertyValue($aux, $testCategoryParentPropertyID, $clientID);\n }\n\n //return categories array\n return $categoriesArray;\n}",
"function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch, $clientID) {\n global $definitions;\n\n $testcasesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n $testCaseParentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n $testcasesNamePropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesName'], $clientID);\n $testcasesOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesOrder'], $clientID);\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $testcasesNamePropertyID, 'name' => 'testcaseName');\n $returnProperties[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'name' => 'testCategoryParentID');\n $returnProperties[] = array('ID' => $testcasesOrderPropertyID, 'name' => 'order');\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $testCaseParentTestCategoryPropertyID, 'value' => $parentCategoryID);\n\n $testCases = getFilteredItemsIDs($testcasesItemTypeID, $clientID, $filters, $returnProperties);\n\n //Next, clear all the test cases that are not inside the relation\n $appliedTestCases = array();\n for ($i = 0; $i < count($testCases); $i++) {\n if (in_array($testCases[$i]['ID'], $idsToSearch)) {\n $appliedTestCases[] = $testCases[$i];\n }\n }\n //And return the testCases\n return ($appliedTestCases);\n}",
"public function testGetByParent() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get the categories\n $categories = $this->kb_category->get_by_parent( $ph_kb_category->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( $name, $category->name );\n }",
"function getCategories($parent=0)\n {\n $sql=\"select * from itf_category where parent ='\".$parent.\"' and status='1' order by catname\";\n $res = $this->dbcon->FetchAllResults($sql);\n\n if(count($res) > 0){\n foreach($res as &$r)\n {\n $re = $this->getCategories($r['id']);\n $r[\"subcat\"] = $re;\n\n }\n }\n return $res;\n\n }",
"function getAllTestCategoriesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentGroupID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryGroupID'], $clientID);\n\n //First, we need get all the categories that has the parent groupID\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentGroupID, 'value' => $groupID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}",
"function getAllTestCasesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside group\n $onlyIds = getAllTestCategoriesInsideAGroup($groupID, $clientID);\n\n //Next, create a string with all the categories inside the group\n $toFilter = implode(',', $onlyIds);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $allTestCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($allTestCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}",
"public function getChildCategories()\n {\n if (!$this->hasData('category_tabs')) {\n $currentCategory = $this->getMainCategory();\n $results = [];\n if ($currentCategory) {\n $tabIds = $currentCategory->getData('sss_category_tab_ids');\n if (!is_array($tabIds)) {\n $tabIds = explode(',', $tabIds);\n }\n /**\n * Enable Catalog Category Flat ... \n * @var $tabCollection \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat\\Collection\n */\n if ($currentCategory->getUseFlatResource()) {\n $tabCollection = $currentCategory->getCollection();\n\n $tabCollection\n ->addIsActiveFilter()\n ->addAttributeToSelect('include_in_menu')\n ->addAttributeToSelect('sss_custom_tab_title')\n ->addAttributeToSelect('position')\n ->addAttributeToSelect('sss_tab_position')\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES)\n ->addFieldToFilter('parent_id', ['eq' => $currentCategory->getId()]);\n\n $tabCollection->getSelect()\n ->orWhere('main_table.entity_id in (?)', $tabIds, \\Magento\\Framework\\DB\\Select::TYPE_CONDITION);\n\n $results = $tabCollection->getItems();\n } else {\n $tabCollection = $currentCategory->getChildrenCategories();\n if ($tabCollection instanceof AbstractCollection) {\n $tabCollection->setLoadProductCount(false);\n $tabCollection->addAttributeToSelect('sss_custom_tab_title');\n $tabCollection->addLevelFilter(3);\n try {\n $tabCollection->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES);\n } catch (\\Exception $e) {\n }\n $results = $tabCollection->getItems();\n } else {\n foreach ($tabCollection as $childCategory) {\n if (3 == $childCategory->getLevel()) {\n $results[] = $childCategory;\n }\n }\n }\n }\n usort($results, function ($first, $second) {\n if ($first->getData('sss_tab_position') || $second->getData('sss_tab_position')) {\n return $first->getData('sss_tab_position') >= $second->getData('sss_tab_position');\n } else {\n return $first->getData('position') >= $second->getData('position');\n }\n });\n }\n $this->setData('category_tabs', $results);\n }\n return $this->getData('category_tabs');\n }",
"public function getPartialTreeDataProvider()\n {\n // Case #0.\n $cat1 = $this->buildCategory(\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $out[] = [new \\ArrayIterator([$cat1]), 5, 'cat1', [$cat1]];\n\n // Case #1 test finding in deeper level with multiple side categories.\n $cat2 = $this->buildCategory(\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat3 = $this->buildCategory(\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ]\n );\n\n $cat4 = $this->buildCategory(\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat41 = $this->buildCategory(\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat42 = $this->buildCategory(\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat421 = $this->buildCategory(\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ]\n );\n\n $tree = [$cat1, $cat2, $cat3, $cat4];\n\n $cat4->setChild('cat42', $cat42);\n $cat4->setChild('cat41', $cat41);\n $cat42->setChild('cat421', $cat421);\n\n $out[] = [new \\ArrayIterator($tree), 5, 'cat42', [$cat42]];\n\n // Case #2 test with improper arguments.\n $out[] = [[], 0, null, null, 'Category Id must be defined on getPartialTree() method'];\n\n return $out;\n }",
"function getAllActiveChildCategoriesForSearch($parent_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_sub_categories WHERE sub_cate_status = 1 AND \tparent_id = \".$parent_id.\" ORDER BY \tsub_cate_title ASC\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }",
"public function testGetAllChildren() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get\n $categories = $this->kb_category->get_all_children( $ph_kb_category->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( $name, $category->name );\n }",
"public function subCategorylist()\n {\n $data = [];\n $sub_categories = Category::where('parent', '!=' ,'0')->get();\n if(count($sub_categories)){\n $data = ['status' => true, 'code' => 200, 'data'=>$sub_categories];\n }else{\n $data = ['status' => false, 'code' => 404, 'message' => \"data not found\"];\n }\n return $data;\n }",
"function listTestCategory() {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_category_table);\n\t\t$this->db->where('status !=', 0);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}",
"private function get_parent_categories(){\r\n\t\t$rslt = array();\r\n\r\n\t\t$args = array('taxonomy'=>'market_reports_category', 'hide_empty' => false, 'parent'=>0, 'orderby'=>'term_id','order'=>'ASC');\r\n\t\t$parent_cats = get_terms($args);\r\n\t\t// $rslt['-1'] = 'None';\r\n\t\t// wp_die(var_dump($parent_cats));\r\n\t\tforeach ($parent_cats as $key => $parent_cat) {\r\n\t\t\t$rslt[$parent_cat->term_id] = $parent_cat->name;\r\n\t\t}\r\n\t\t// rsort($rslt);\r\n\t\treturn $rslt;\r\n\t}",
"public static function getSubCategories($parent_cat_id) {\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=$parent_cat_id\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }",
"public function subcategories()\n {\n return $this->hasMany(Category::class, 'parent_id')->where('status', 1);\n }",
"function get_simple_categories($type='all', $parentid=false, $order=false){\n $parentid = intval($parentid);\n $where=$orderby='';\n if($type=='root') $where = 'WHERE parentid = -1';\n elseif ($type=='sub' && $parentid) $where = \"WHERE parentid = '$parentid'\";\n if($order) $orderby = ' order by name '.$order;\n $sql = \"SELECT id as catId, name as catName FROM categories \" . $where . $orderby; //, marketplaceCount\n $cats = $this->db->query($sql)->result_array();\n foreach($cats as $key=>$value){\n //$cats[$key]['marketplaceCount'] = number_format($value['marketplaceCount']);\n $haveSubCategories = $this->db_getone(\"SELECT id from categories where parentid='{$value['catId']}'\", 'id');\n if($haveSubCategories) $cats[$key]['haveSubCategories'] = 1;\n else $cats[$key]['haveSubCategories'] = 0;\n }\n return $cats;\n }",
"function showParentCategoriesForSearch( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tcategory_title asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function testCategoriesAreFilteredByParent()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $visibleCategory->parent()->associate(factory(Category::class)->create());\n $visibleCategory->save();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.parent_id]='.$visibleCategory->parent->id)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }",
"public function subcategories()\n {\n \treturn $this->hasMany('App\\Category', 'parent_id')->where('status', 1);\n }",
"function showParentCategories( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tsort_order asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }",
"public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }",
"public static function parentCategories()\n {\n return Category::with('children')\n ->orderBy('priority')\n ->where([\n 'category_type' => static::class,\n 'parent_id' => null,\n ])->get();\n }",
"public function getTestCases ()\n {\n return $this->_testCases;\n }",
"function get_sub_categories($category_ID)\n {\n $get_sub_category_query=site_query(\"select * from Category where parentID=\".$category_ID.\" order by displayOrder\",\"get_sub_categories()\",$dev);\n return $get_sub_category_query;\n }",
"public function get_sub_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"type\"=>2))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}",
"function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}",
"public function getCategories($parent_id = 0) {\n\t\t$category_data = FALSE;\n\t\t\n\t\tif (! $category_data) {\n\t\t\t$category_data = array ();\n\t\t\t\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\tc.category_id,\r\n\t\t\t\t\tc.parent_id,\r\n\t\t\t\t\tcd.name,\r\n\t\t\t\t\t(SELECT COUNT(*) FROM `\" . DB_PREFIX . \"category` cc WHERE cc.parent_id = c.category_id) as children\r\n\t\t\tFROM `\" . DB_PREFIX . \"category` c\r\n\t\t\tLEFT JOIN `\" . DB_PREFIX . \"category_description` cd\r\n\t\t\t\tON (c.category_id = cd.category_id)\r\n\t\t\tWHERE c.parent_id = \" . ( int ) $parent_id . \"\r\n\t\t\tAND c.status = 1\r\n\t\t\tAND cd.language_id = \" . ( int ) $this->config->get ( 'config_language_id' ) . \"\r\n\t\t\tORDER BY c.sort_order, cd.name ASC\";\n\t\t\t\n\t\t\t$query = $this->db->query ( $sql );\n\t\t\t\n\t\t\tforeach ( $query->rows as $result ) {\n\t\t\t\t$category_data [] = array (\n\t\t\t\t\t\t'category_id' => $result ['category_id'],\n\t\t\t\t\t\t'parent_id' => $result ['parent_id'],\n\t\t\t\t\t\t'name' => $result ['name'],\n\t\t\t\t\t\t'children' => $result ['children'],\n\t\t\t\t\t\t'disabled' => ((in_array ( $result ['category_id'], $this->config->get ( 'msconf_restrict_categories' ) ) || ($this->config->get ( 'msconf_additional_category_restrictions' ) == 1 && $result ['parent_id'] == 0) || ($this->config->get ( 'msconf_additional_category_restrictions' ) == 2 && $result ['children'] > 0)) ? TRUE : FALSE) \n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// Recursive call of the function and merge of all the categories together\n\t\t\t\t$category_data = array_merge ( $category_data, $this->getCategories ( $result ['category_id'] ) );\n\t\t\t}\n\t\t\t\n\t\t\t// $this->cache->set('category.' . (int)$this->config->get('config_language_id') . '.' . (int)$parent_id, $category_data);\n\t\t}\n\t\t\n\t\t// The first calls of the function (for the root categories), where indentation takes place\n\t\tif ($parent_id == 0) {\n\t\t\t$category_data_indented = array ();\n\t\t\tforeach ( $category_data as $category ) {\n\t\t\t\t$category_data_indented [] = array (\n\t\t\t\t\t\t'category_id' => $category ['category_id'],\n\t\t\t\t\t\t'name' => str_repeat ( ' ', $this->_getDepth ( $category_data, $category ['category_id'] ) ) . $category ['name'],\n\t\t\t\t\t\t'parent_id' => $category ['parent_id'],\n\t\t\t\t\t\t'children' => $category ['children'],\n\t\t\t\t\t\t'disabled' => $category ['disabled'] \n\t\t\t\t);\n\t\t\t}\n\t\t\treturn $category_data_indented;\n\t\t}\n\t\t\n\t\treturn $category_data;\n\t}",
"public function run()\n {\n $categories =\n [\n [\n 'id' => 1,\n 'title' => 'product',\n 'slug' => 'product',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => null,\n ],\n [\n 'id' => 2,\n 'title' => 'post',\n 'slug' => 'nuts-and-seeds',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => null,\n ],\n [\n 'id' => 3,\n 'title' => 'DRIED FRUITS',\n 'slug' => 'dried-fruits',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 1,\n ],\n [\n 'id' => 4,\n 'title' => 'HERBS&SPICES',\n 'slug' => 'herb-and-spices',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 1,\n ],\n [\n 'id' => 5,\n 'title' => 'WHOLEFOODS & LEGUMES',\n 'slug' => 'nuts-and-seeds',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 1,\n ],\n [\n 'id' => 6,\n 'title' => 'NUTS',\n 'slug' => 'nuts',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 3,\n ],\n [\n 'id' => 7,\n 'title' => 'TEAS',\n 'slug' => 'teas',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 1,\n ],\n [\n 'id' => 8,\n 'title' => 'Raw Almonds',\n 'slug' => 'raw-almonds',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 5,\n ],\n [\n 'id' => 9,\n 'title' => 'Roasted Almonds',\n 'slug' => 'roasted-almonds',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 5,\n ],\n [\n 'id' => 10,\n 'title' => 'Walnut',\n 'slug' => 'walnut',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 5,\n ],\n [\n 'id' => 11,\n 'title' => 'Pumpkin Seeds',\n 'slug' => 'pumpkin-seeds',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 6,\n ],\n [\n 'id' => 12,\n 'title' => 'Sunflower Seeds',\n 'slug' => 'sunflower-seeds',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 6,\n ],\n [\n 'id' => 13,\n 'title' => 'Fruit Tea',\n 'slug' => 'fruit-tea',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 7,\n ],\n [\n 'id' => 14,\n 'title' => 'Yellow Apricot',\n 'slug' => 'yellow-apricot',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 2,\n ],\n [\n 'id' => 15,\n 'title' => 'Natural Brown Apricot',\n 'slug' => 'natural-brown-apricot',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 2,\n ],\n [\n 'id' => 16,\n 'title' => 'Herbs',\n 'slug' => 'herbs',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 3,\n ],\n [\n 'id' => 17,\n 'title' => 'Spices',\n 'slug' => 'spices',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 3,\n ],\n [\n 'id' => 18,\n 'title' => 'Cinnamon Powder',\n 'slug' => 'cinnamon-powder',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 16,\n ],\n [\n 'id' => 19,\n 'title' => 'Cinnamon Sticks',\n 'slug' => 'cinnamon-sticks',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 16,\n ],\n [\n 'id' => 20,\n 'title' => 'Paprika',\n 'slug' => 'paprika',\n 'seo_title' => 'Register Seo Title',\n 'seo_description' => 'Register Seo Description',\n 'parent_id' => 17,\n ],\n\n ];\n\n\n Category::insert($categories);\n //Category::factory(1)->create();\n }",
"public function getParentCategories()\n {\n return [\n 1 => [\n 'ru' => 'Готовые наборы для аэрографии',\n 'uk' => 'Готові набори для аерографії',\n 'en' => 'Ready-made airbrush kits',\n ],\n 2 => [\n 'ru' => 'Дополнительное оборудование и аксессуары для аэрографии',\n 'uk' => 'Додаткове обладнання та аксесуари для аерографії',\n 'en' => 'Additional equipment and accessories for airbrushing'\n ],\n 3 => [\n 'ru' => 'Аэрографы и компрессоры Fengda',\n 'uk' => 'Аерографи і компресори Fengda',\n 'en' => 'Fengda Airbrushes and Compressors',\n ],\n 4 => [\n 'ru' => 'Товары для аэрографии на ногтях (nail art)',\n 'uk' => 'Товари для аерографії на нігтях (nail art)',\n 'en' => 'Goods for airbrushing on nails (nail art)',\n ],\n 6 => [\n 'ru' => 'Товары для аэрографии визажистов, гримеров и др.',\n 'uk' => 'Товари для аерографії візажистів, гримерів і ін.',\n 'en' => 'Goods for aerography of make-up artists, make-up artists, etc.',\n ],\n 5 => [\n 'ru' => 'Товары для аэрографии на кондитерских изделиях',\n 'uk' => 'Товари для аерографії на кондитерських виробах',\n 'en' => 'Goods for airbrushing confectionery products',\n ],\n 7 => [\n 'ru' => 'Краски для аэрографии Createx и Wicked Colors',\n 'uk' => 'Фарби для аерографії Createx і Wicked Colors',\n 'en' => 'Paints for airbrushing Createx and Wicked Colors',\n 'not_active' => true\n ],\n 8 => [\n 'ru' => 'Краски для аэрографии Auto Air Colors',\n 'uk' => 'Фарби для аерографії Auto Air Colors',\n 'en' => 'Paints for airbrushing Auto Air Colors',\n 'not_active' => true\n ],\n 9 => [\n 'ru' => 'Аэрографы и запчасти H&S/Hansa',\n 'uk' => 'Аерографи і запчастини H&S/Hansa',\n 'en' => 'Airbrushes and spare parts H&S/Hansa',\n ]\n ];\n }",
"function get_categories($params=''){\n $sql = ('SELECT id, name, parentid, level FROM categories ORDER BY name');\n $cat_array = $this->db->query($sql)->result_array();\n \n //this will generate html output - probably faster, but html code is out of templates!!!\n //$output_html = $this->generate_list_html(\"-1\",$cat_array);\n \n //this is slower method, but no html code in php\n //for this option, smarty modifier(compiler) need to be installed(compiler.defun.php)\n $arr = array();\n if(!empty($params['catId']) && $params['catId'] > 0){\t\t\n //generate top category, because it is not back from recursion function \t\n $this->CreateNestedArray($cat_array, $arr, $params['catId'], 0, 20);\n $arr2[0] = $this->get_category($params['catId']);\n $arr2[0]['children'] = $arr;\n return $arr2;\n }else{\n //get all categories\n $this->CreateNestedArray($cat_array, $arr, \"-1\", 0, 20);\n return $arr;\n }\n \n return;\n }",
"public function findCategories();",
"public function testGetItemSubCategoryByFilter()\n {\n }",
"public function testListCategories()\n {\n }",
"function getCategoryTree($db) {\n // Make Category Tree\n $query = \"SELECT `COMPLAINT_TYPE`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $category['name'] = trim($row[\"COMPLAINT_TYPE\"], ' /');\n $category['COMPLAINT_TYPE'] = $row[\"COMPLAINT_TYPE\"];\n $category['slug'] = slugify($category['name']);\n $category['count'] = $row[\"COUNT(*)\"];\n if( $category['slug'] != 'n-a' && $category['slug'] != 'select-one' && $category['slug'] != 'other' ){\n $topCategories[$category['slug']]=$category;\n }\n }\n\n $query = \"SELECT `COMPLAINT_TYPE`, `DESCRIPTOR`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE`, `DESCRIPTOR` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $subCategory['name'] = trim($row[\"DESCRIPTOR\"], ' /');\n $subCategory['DESCRIPTOR'] = $row[\"DESCRIPTOR\"];\n $subCategory['slug'] = slugify($subCategory['name']);\n $subCategory['count'] = $row[\"COUNT(*)\"];\n if(\n trim($row['COMPLAINT_TYPE']) != ''\n && $subCategory['slug'] != 'n-a'\n && $subCategory['slug'] != 'select'\n ){\n $topCategories[slugify($row['COMPLAINT_TYPE'])]['subCategories'][$subCategory['slug']]=$subCategory;\n }\n }\n\n return $topCategories;\n}",
"public function getSearchData($parentCategory = 2);",
"public function run()\n {\n\n $categories = [\n ['name'=>'Electronics','is_parent'=>1], //1\n ['name'=>'Mobile','parent_id'=>1], //2\n ['name'=>'Tablets','parent_id'=>1], \n ['name'=>'Laptops','parent_id'=>1], \n \n ['name'=>'kitchn','is_parent'=>true], //5\n ['name'=>'cup','parent_id'=>5], //4\n ['name'=>'furniture','parent_id'=>5], //4\n\n ['name'=>'Personal Care','is_parent'=>true], //8\n ['name'=>'Mens grooming','parent_id'=>8], //4\n ['name'=>'Foundation','parent_id'=>8], //4\n\n ['name'=>'Grocery & Pets','is_parent'=>true], //11\n ['name'=>'Beverages','parent_id'=>11], //4\n ['name'=>'Breakfast','parent_id'=>11], //4\n \n ];\n foreach($categories as $category){\n Category::create([\n 'name'=>$category['name'],\n 'slug'=>Str::slug($category['name']),\n 'is_parent'=>$category['is_parent'] ?? 0,\n 'parent_id'=>$category['parent_id'] ?? null\n ]);\n }\n\n // $categories = [\n // [\n // 'name' => 'Electronics',\n // 'subCategory' => ['Mobile', 'Tablets', 'Laptops', 'Desktops', 'Televisions', 'Gaming Consoles', 'Printers']\n // ],\n // [\n // 'name' => 'Electronic Accessories',\n // 'subCategory' => ['Phone Cases', 'Chargers', 'Headphones', 'SmartWatches', 'BlueTooth Speakers', 'Screen protectors']\n // ],\n // [\n // 'name' => 'Personal Care',\n // 'subCategory' => ['Mens grooming', 'Mens grooming', 'Foundation', 'Deodrants', 'Female hygiene', 'Soap handwash', 'Skin care', 'Hair care']\n // ],\n // [\n // 'name' => 'Babys & Toys',\n // 'subCategory' => ['Disposable Diapers', 'Baby Gear', 'Personal Care', 'Toys & Games']\n // ],\n // [\n // 'name' => 'Grocery & Pets',\n // 'subCategory' => ['Beverages', 'Breakfast', 'Fruits', 'Vegetables', 'Pet Food', 'Daily Food']\n // ],\n // [\n // 'name' => 'Home & Lifestyle',\n // 'subCategory' => ['Bath', 'Bedding', 'Decor', 'Furniture', 'Appliances & Electicals', 'Kitchen Utensils']\n // ],\n // [\n // 'name' => 'Sports & Outdoors',\n // 'subCategory' => ['Mens Collections', 'Womens Collections', 'Exercise & Fitness', 'Travel & Luggage']\n // ],\n // [\n // 'name' => 'AutoMotive & Motorbike',\n // 'subCategory' => ['Auto Motive', 'Motorcycle', 'Moto Parts & Accessories', 'Riding gear']\n // ],\n // ];\n\n // foreach ($categories as $category) {\n\n // $newCategory = Category::create([\n // 'category_name' => $category['name'],\n // ]);\n // foreach ($category['subCategory'] as $item) {\n // $subcategory = SubCategory::create([\n // 'category_id' => $newCategory->id,\n // 'subCategory_name' => $item,\n // ]);\n // }\n // }\n }",
"function getCategoryHierarchyAsArray()\n{\n return array\n (\n array\n (\n 'idString' => '1' ,\n 'idParentString' => null ,\n 'name' => 'Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1' ,\n 'idParentString' => '1' ,\n 'name' => 'Cons',\n 'children' => array\n (\n array('idString' => '1-1-1', 'idParentString' => '1-1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-1-2', 'idParentString' => '1-1', 'name' => 'ConsultingB', 'children' => array()),\n array('idString' => '1-1-3', 'idParentString' => '1-1', 'name' => 'Management ', 'children' => array()),\n array\n (\n 'idString' => '1-1-4' ,\n 'idParentString' => '1-1' ,\n 'name' => 'More Categories',\n 'children' => array\n (\n array('idString' => '1-1-4-1', 'idParentString' => '1-1-4', 'name' => 'Cat1', 'children' => array()),\n array('idString' => '1-1-4-2', 'idParentString' => '1-1-4', 'name' => 'Cat2', 'children' => array()),\n array\n (\n 'idString' => '1-1-4-3' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Still more categories',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1-4-3-1',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatA' ,\n 'children' => array()\n ),\n array\n (\n 'idString' => '1-1-4-3-2',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatB' ,\n 'children' => array()\n )\n )\n ),\n array\n (\n 'idString' => '1-1-4-4' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Category 3',\n 'children' => array()\n )\n )\n )\n )\n ),\n array('idString' => '1-2', 'idParentString' => '1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-3', 'idParentString' => '1', 'name' => 'ConsultingB', 'children' => array())\n )\n ),\n array\n (\n 'idString' => '2' ,\n 'idParentString' => null ,\n 'name' => 'Not Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '2-1' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 1',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-2' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 2',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-3' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 3',\n 'children' => array()\n )\n )\n )\n );\n}",
"public function Categorylist()\n{\n $CI = & get_instance();\n $CI->load->model(array('Common_model'));\n $data['categories'] = $CI->Common_model->get_category(0,0,0,1,1);//(1,1)//(getting only parent is vechicles,show_in_navigation_menu is yes)\n //echo $CI->db->last_query();\n return $data;\n}",
"public function getCategories($parent_id) {\n// if (!$category_data) {\n\t$category_data = array();\n\n\t$rows = Make::a('catalog/category')\n\t\t->table_alias('c')\n\t\t->select_expr('c.category_id,c.ref_category_code,c.status,c.sort_order')\n\t\t->left_outer_join('category_description', array('c.category_id', '=', 'cd.category_id'), 'cd')\n\t\t->where('c.parent_id', $parent_id)\n\t\t->where('cd.language_id', QS::app()->config->get('config_language_id'))\n\t\t->order_by_asc('c.sort_order')\n\t\t->order_by_asc('cd.name')\n\t\t->find_many(true);\n\n\tforeach ($rows as $result) {\n\t $category_data[] = array(\n\t\t'category_id' => $result['category_id'],\n\t\t'ref_category_code' => $result['ref_category_code'],\n\t\t'name' => $this->getPath($result['category_id']),\n\t\t'status' => $result['status'],\n\t\t'sort_order' => $result['sort_order']\n\t );\n\n\t $category_data = array_merge($category_data, $this->getCategories($result['category_id']));\n\t}\n\n// QS::app()->cache->set('category.' . QS::app()->config->get('config_language_id') . '.' . $parent_id, $category_data);\n//}\n\n\treturn $category_data;\n }",
"private function get_category_by_parent($parent){\n $query = DB::table('ps_category as a')\n ->select('a.id_category','b.name')\n ->join('ps_category_lang as b','a.id_category','b.id_category')\n ->where('a.id_parent',$parent)\n ->where('a.active',1)\n ->groupBy('a.id_category')\n ->get();\n return $query;\n }",
"public function subCategories()\n {\n return $this->belongsToMany(Category::class, 'solution_categories', 'solution_id', 'category_id')->isChild();\n }",
"public function allSubCategory() {\n return $this->db->get_where('r_category',array('subCategory !='=>0))->result_array();\n }",
"function get_parent_categories()\n \t{\n \t\treturn $this->conn_db->get_parent_categories($this->uid);\t\n \t\t\n \t}",
"function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}",
"function get_subcategories($categoryid) {\r\n global $DB;\r\n\r\n $subcategories = $DB->get_records('question_categories', array('parent' => $categoryid), 'id');\r\n\r\n foreach ($subcategories as $subcategory) {\r\n $subcategories = array_merge($subcategories, get_subcategories($subcategory->id));\r\n }\r\n\r\n return $subcategories;\r\n}",
"function getMainCategory()\n {\n $sql = \"select * from tbl_issue_category where parent_id=0\";\n $query = $this->db->query($sql);\n return $query->result_array();\n }",
"function achieve_get_sub_category()\r\n{\r\n global $sql;\r\n\r\n $sub_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, ParentID, Name FROM achievement_category WHERE ParentID<>-1 ORDER BY `GroupID` ASC\");\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n while ($sub_cat[$temp[\"ParentID\"]][$temp[\"ID\"]] = $temp[\"Name\"])\r\n {\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n }\r\n return $sub_cat;\r\n}",
"public function testDescendants() {\n $decendants = $this->traverser->descendants('Category:Root category', function ($pageInfo, $parentCatName) {\n if ($parentCatName === 'Category:Root category') {\n $this->assertEquals('Test page A1', $pageInfo['title']);\n }\n if ($parentCatName === 'Category:Sub category C') {\n $this->assertEquals('Test page C1', $pageInfo['title']);\n }\n });\n $this->assertCount(4, $decendants);\n }",
"function getParentCategories(){\n\t\t$categoryId = JRequest::getInt('category_id', 0);\n\t\t$parents = array();\t\t\n\t\twhile ( true ){\n\t\t\t$sql = \"SELECT id, name, parent FROM #__eb_categories WHERE id = \".$categoryId.\" AND published=1\";\n\t\t\t$this->_db->setQuery( $sql );\n\t\t\t$row = $this->_db->loadObject();\n\t\t\tif ($row){\n\t\t\t\t$sql = 'SELECT COUNT(*) FROM #__eb_categories WHERE parent='.$row->id.' AND published = 1 ';\n\t\t\t\t$this->_db->setQuery($sql) ;\n\t\t\t\t$total = $this->_db->loadResult();\n\t\t\t\t$row->total_children = $total ;\t\t\t\t\n\t\t\t\t$parents[] = $row ;\n\t\t\t\t$categoryId = $row->parent ;\t\t\t\t\n\t\t\t} else {\t\t\t\t\t\t\t\n\t\t\t \tbreak;\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn $parents ;\t\n\t}",
"public function getCategoriesForSettings() {\n \n $qb = $this->_em->createQueryBuilder();\n $qb->select('c')\n ->from('ABOMainBundle:Category', 'c')\n ->join('c.parent', 'p')\n ->addSelect('p')\n ->where('c.level = :level')\n ->setParameter('level', 2);\n \n return $qb->getQuery()->getResult();\n }",
"public function testGetItemSubCategoryById()\n {\n }",
"public function run()\n {\n Category::create([\n 'name' => 'Imunitet',\n 'slug' => 'imunitet'\n \n ]);\n Category::create([\n 'name' => 'Bebi Program',\n 'slug' => 'bebi-program'\n ]);\n Category::create([\n 'name' => 'Mršavljenje',\n 'slug' => 'mrsavljenje'\n ]);\n Category::create([\n 'name' => 'Kozmetika',\n 'slug' => 'kozmetika'\n ]);\n Category::create([\n 'name' => 'Potencija',\n 'slug' => 'potencija'\n ]);\n \n // Subcategories \n Category::create([\n 'name' => 'Vitamini',\n 'slug' => 'imunitet-vitamini',\n 'parent_id' => 1\n ]);\n Category::create([\n 'name' => 'Minerali',\n 'slug' => 'imunitet-minerali',\n 'parent_id' => 1\n ]);\n Category::create([\n 'name' => 'Čajevi',\n 'slug' => 'imunitet-cajevi',\n 'parent_id' => 1\n ]); \n Category::create([\n 'name' => 'Vitamini',\n 'slug' => 'bebi-program-vitamini',\n 'parent_id' => 2\n ]);\n Category::create([\n 'name' => 'Minerali',\n 'slug' => 'bebi-program-minerali',\n 'parent_id' => 2\n ]);\n Category::create([\n 'name' => 'Čajevi',\n 'slug' => 'bebi-program-cajevi',\n 'parent_id' => 2\n ]); \n Category::create([\n 'name' => 'Vitamini',\n 'slug' => 'mrsavljenje-vitamini',\n 'parent_id' => 3\n ]);\n Category::create([\n 'name' => 'Minerali',\n 'slug' => 'mrsavljenje-minerali',\n 'parent_id' => 3\n ]);\n Category::create([\n 'name' => 'Čajevi',\n 'slug' => 'mrsavljenje-cajevi',\n 'parent_id' => 3\n ]); \n Category::create([\n 'name' => 'Vitamini',\n 'slug' => 'kozmetika-vitamini',\n 'parent_id' => 4\n ]);\n Category::create([\n 'name' => 'Minerali',\n 'slug' => 'kozmetika-minerali',\n 'parent_id' => 4\n ]);\n Category::create([\n 'name' => 'Čajevi',\n 'slug' => 'kozmetika-cajevi',\n 'parent_id' => 4\n ]); \n Category::create([\n 'name' => 'Vitamini',\n 'slug' => 'potencija-vitamini',\n 'parent_id' => 5\n ]);\n Category::create([\n 'name' => 'Minerali',\n 'slug' => 'potencija-minerali',\n 'parent_id' => 5\n ]);\n Category::create([\n 'name' => 'Čajevi',\n 'slug' => 'potencija-cajevi',\n 'parent_id' => 5\n ]); \n }",
"public function run()\n {\n /*-------------------------------------------*/\n Category::create([ //root id:1\n 'parent_id' => null,\n 'name' => 'programming languages'\n ]);\n Category::create([ //id:2\n 'parent_id' => 1,\n 'name' => 'web'\n ]);\n Category::create([ //id:3\n 'parent_id' => 1,\n 'name' => 'mobile'\n ]);\n Category::create([ //web //id:4\n 'parent_id' => 2, //parent:web\n 'name' => 'php'\n ]);\n Category::create([ //web //id:5\n 'parent_id' => 2, //parent:web\n 'name' => 'html'\n ]);\n Category::create([ //web //id:6\n 'parent_id' => 2, //parent:web\n 'name' => 'css'\n ]);\n Category::create([ //mobile //id:7\n 'parent_id' => 3, //parent:mobile\n 'name' => 'flutter'\n ]);\n Category::create([ //mobile //id:8\n 'parent_id' => 3, //parent:mobile\n 'name' => 'java'\n ]);\n Category::create([ //php //id:9\n 'parent_id' => 4, //parent:web\\php\n 'name' => 'laravel'\n ]);\n Category::create([ //php //id:10\n 'parent_id' => 4, //parent:web\\php\n 'name' => 'lumen'\n ]);\n\n /*-------------------------------------------*/\n\n Category::create([ //root id:11\n 'parent_id' => null, //parent\n 'name' => 'multimedia'\n ]);\n\n Category::create([ //images id:12\n 'parent_id' => 11, //parent:multimedia\n 'name' => 'images'\n ]);\n Category::create([ //sounds id:13\n 'parent_id' => 11, //parent:multimedia\n 'name' => 'sounds'\n ]);\n\n Category::create([ //root id:14\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'gif'\n ]);\n Category::create([ //root id:15\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'png'\n ]);\n Category::create([ //root id:16\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'jpg'\n ]);\n Category::create([ //root id:17\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'bmp'\n ]);\n\n Category::create([ //root id:18\n 'parent_id' => 13, //parent:multimedia\\sounds\n 'name' => 'ogg'\n ]);\n Category::create([ //root id:19\n 'parent_id' => 13, //parent:multimedia\\sounds\n 'name' => 'mp3'\n ]);\n\n\n }",
"function createTree($categories)\n{\n $tree = [];\n\n foreach ($categories as $category) {\n if (empty($category[\"parent_uid\"])) {\n $tree[] = $category;\n unset($category);\n }\n }\n\n // уровень вложенности 2\n foreach ($tree as &$itemTree) {\n foreach ($categories as $category) {\n /* if(!empty($category[\"parent_uid\"])) {\n print_r($itemTree);\n print_r($category);\n echo \"\\n\";\n echo \"tree:\\n\";\n print_r($itemTree[\"uid\"]);\n echo \"\\n category\";\n print_r($category[\"parent_uid\"]);\n exit();\n }*/\n if ($itemTree[\"uid\"] == $category[\"parent_uid\"]) {\n $itemTree[\"categories\"] = $category;\n unset($category);\n }\n }\n }\n\n return $tree;\n}",
"public function getChildCat($parent = array(0), $type = false, $data = false)\n {\n global $rlDb;\n\n foreach ($parent as $parent_id) {\n $parent_id = (int) $parent_id;\n\n $sql = \"SELECT *, `Modified` \";\n $sql .= \"FROM `{db_prefix}categories` \";\n $sql .= \"WHERE `Type` = '{$type['Key']}' AND `Status` = 'active' AND `Parent_ID` = '{$parent_id}'\";\n if ($type['Cat_hide_empty']) {\n $sql .= \"AND `Count` > 0 \";\n }\n $sql .= \"ORDER BY `Position`\";\n\n if ($tmp_categories = $rlDb->getAll($sql)) {\n foreach ($tmp_categories as $cKey => $cValue) {\n $ids[] = $cValue['ID'];\n\n $categories[$cValue['ID']] = $cValue;\n $categories[$cValue['ID']]['pName'] = 'categories+name+' . $cValue['Key'];\n $categories[$cValue['ID']]['pTitle'] = 'categories+title+' . $cValue['Key'];\n\n /* get subcategories */\n if ($type['Cat_show_subcats']) {\n // TODO - add this condition in output if needs\n $rlDb->calcRows = true;\n $subCategories = $rlDb->fetch(array('ID', 'Count', 'Path`, CONCAT(\"categories+name+\", `Key`) AS `pName`, CONCAT(\"categories+title+\", `Key`) AS `pTitle', 'Key'), array('Status' => 'active', 'Parent_ID' => $cValue['ID']), \"ORDER BY `Position`\", null, 'categories');\n $rlDb->calcRows = false;\n\n if (!empty($subCategories)) {\n $categories[$cValue['ID']]['sub_categories'] = $subCategories;\n $categories[$cValue['ID']]['sub_categories_calc'] = $rlDb->foundRows;\n }\n\n unset($subCategories);\n }\n }\n unset($tmp_categories);\n\n $data[$parent_id] = $categories;\n\n unset($categories);\n } else {\n continue;\n }\n }\n\n if ($parent) {\n return $this->getChildCat($ids, $type, $data);\n } else {\n return $data;\n }\n }",
"public function run()\n\t{\n\t\t$now = date('Y-m-d H:i:s');\n\t\t$subcategories = [\n\t\t\t[\n\t\t\t\t'id' => 1,\n\t\t\t\t'catid' => 1,\n\t\t\t\t'userid' => 1,\n\t\t\t\t'subcatTitle' => 'Rules',\n\t\t\t\t'subcatDescription' => 'Here are the rules',\n\t\t\t\t'subcatTotalposts' =>1,\n\t\t\t\t'created_at' => $now,\n\t\t\t\t'updated_at' => $now\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 2,\n\t\t\t\t'catid' => 1,\n\t\t\t\t'userid' => 1,\n\t\t\t\t'subcatTitle' => 'More Rules',\n\t\t\t\t'subcatDescription' => 'Another subcat',\n\t\t\t\t'subcatTotalposts' =>1,\n\t\t\t\t'created_at' => $now,\n\t\t\t\t'updated_at' => $now\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 3,\n\t\t\t\t'catid' => 3,\n\t\t\t\t'userid' => 1,\n\t\t\t\t'subcatTitle' => 'Buttons',\n\t\t\t\t'subcatDescription' => 'About buttons',\n\t\t\t\t'subcatTotalposts' =>1,\n\t\t\t\t'created_at' => $now,\n\t\t\t\t'updated_at' => $now\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 4,\n\t\t\t\t'catid' => 3,\n\t\t\t\t'userid' => 2,\n\t\t\t\t'subcatTitle' => 'Wells',\n\t\t\t\t'subcatDescription' => 'About wells',\n\t\t\t\t'subcatTotalposts' =>1,\n\t\t\t\t'created_at' => $now,\n\t\t\t\t'updated_at' => $now\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 5,\n\t\t\t\t'catid' => 4,\n\t\t\t\t'userid' => 2,\n\t\t\t\t'subcatTitle' => 'Models',\n\t\t\t\t'subcatDescription' => 'stupid things...',\n\t\t\t\t'subcatTotalposts' =>1,\n\t\t\t\t'created_at' => $now,\n\t\t\t\t'updated_at' => $now\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 6,\n\t\t\t\t'catid' => 4,\n\t\t\t\t'userid' => 1,\n\t\t\t\t'subcatTitle' => 'databases',\n\t\t\t\t'subcatDescription' => 'eloquent is weird',\n\t\t\t\t'subcatTotalposts' =>1,\n\t\t\t\t'created_at' => $now,\n\t\t\t\t'updated_at' => $now\n\t\t\t]\n\t\t];\n\t\t\n\t\tDB::table('subcategories')->insert($subcategories);\n\n\t}",
"public function getCategories()\n {\n $categories = ClassInfo::subclassesFor('ConsultationCategory');\n return $this->Children()->filter('Classname', $categories);\n }",
"function showChildCategories($category_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_sub_categories WHERE sub_cate_status = 1 AND \tparent_id = \".$category_id.\" order by sub_cate_title ASC\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function getCategoryTree() {\n $categories = TableRegistry::get('Categories');\n\n $first_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'slug'\n ])->where([\n 'level' => '0',\n 'status' => '1'\n ])->toArray();\n\n $second_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '1',\n 'status' => '1'\n ])->toArray();\n\n $second_category_array = array();\n\n foreach ($second_level_categories as $second_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($second_category_array [$second_category ['parent_id']]))\n $second_category_array [$second_category ['parent_id']] = array();\n $second_category_array [$second_category ['parent_id']] [] = $second_category;\n }\n\n $third_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '2',\n 'status' => '1'\n ])->toArray();\n\n $third_category_array = array();\n\n foreach ($third_level_categories as $third_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($third_category_array [$third_category ['parent_id']]))\n $third_category_array [$third_category ['parent_id']] = array();\n $third_category_array [$third_category ['parent_id']] [] = $third_category;\n }\n\n return [\n $first_level_categories,\n $second_category_array,\n $third_category_array\n ];\n }",
"function get_parent_cats($context) {\n global $COURSE;\n\n switch ($context->contextlevel) {\n // a category can be the parent of another category\n // there is no limit of depth in this case\n case CONTEXT_COURSECAT:\n static $categoryparents = null; // cache for parent categories\n if (!isset($categoryparents)) {\n $categoryparents = array();\n }\n if (array_key_exists($context->instanceid, $categoryparents)) {\n return $categoryparents[$context->instanceid];\n }\n\n if (!$cat = get_record('course_categories','id',$context->instanceid)) {\n //error?\n return array();\n }\n $parents = array();\n while (!empty($cat->parent)) {\n if (!$catcontext = get_context_instance(CONTEXT_COURSECAT, $cat->parent)) {\n debugging('Incorrect category parent');\n break;\n }\n $parents[] = $catcontext->id;\n $cat = get_record('course_categories','id',$cat->parent);\n }\n return $categoryparents[$context->instanceid] = array_reverse($parents);\n break;\n \n // a course always fall into a category, unless it's a site course\n // this happens when SITEID == $course->id\n // in this case the parent of the course is site context\n case CONTEXT_COURSE:\n static $courseparents = null; // cache course parents\n if (!isset($courseparents)) {\n $courseparents = array();\n }\n if (array_key_exists($context->instanceid, $courseparents)) {\n return $courseparents[$context->instanceid];\n }\n\n if (count($courseparents) > 1000) {\n $courseparents = array(); // max cache size when looping through thousands of courses\n }\n if ($context->instanceid == SITEID) {\n return $courseparents[$context->instanceid] = array(); // frontpage course does not have parent cats\n }\n if ($context->instanceid == $COURSE->id) {\n $course = $COURSE;\n } else if (!$course = get_record('course', 'id', $context->instanceid)) {\n //error?\n return array();;\n }\n\n if (empty($course->category)) {\n // this should not happen\n return $courseparents[$context->instanceid] = array();\n }\n \n if (!$catcontext = get_context_instance(CONTEXT_COURSECAT, $course->category)) {\n debugging('Incorect course category');\n return array();;\n }\n\n return $courseparents[$context->instanceid] = array_merge(get_parent_cats($catcontext), array($catcontext->id)); //recursion :-)\n break;\n\n default:\n // something is very wrong!\n return array();\n break;\n }\n}",
"public function getAllTopLevelCat($cat_id, $needle) {\n// echo $cat_id;\n// echo \"\\ngetAllTopLevelCat 1 \";\n// echo $needle;\n// \n// echo \"\\ngetAllTopLevelCat 2 \";\n\n $basesql = \"SELECT c.category_id AS itemid, c.image AS imageurl, cd.NAME AS itemheading, cd.description AS itemdesc, c.parent_id, cd.icomoon AS icomoon_code\n\t\t\t\t\tFROM oc_category c \n\t\t\t\t\tLEFT JOIN oc_category_description cd ON c.category_id=cd.category_id \n\t\t\t\t\tWHERE c.category_id='\" . $cat_id . \"'\";\n\n $catdata = $this->queryRun($basesql, 'select');\n\n\n\n if (!empty($catdata)) {\n if ($catdata['parent_id'] == $needle) {\n// echo \"\\nin here\";\n// echo $catdata['parent_id'];\n// var_dump($catdata);\n\n return $catdata;\n } else {\n// echo \"\\nin else\";\n// echo $catdata['parent_id'];\n if ($catdata['parent_id'] != 0)\n $this->getAllTopLevelCat($catdata['parent_id'], $needle);\n }\n }\n }",
"function printCategory($parent_id, $role)\n{\n $cats = new Category();\n $cate = $cats->getByParentId($parent_id);\n if ($parent_id == 0) {\n\n if ($role == 'admin') {\n }\n if ($role == 'client') {\n foreach ($cate as $r) {\n echo '<li><a href=\"posts-list-category.php?id=' . $r['id'] . '\">' . $r['name'] . '</a>';\n printCategory($r['id'], $role);\n echo '</li>';\n }\n }\n } else {\n //nếu là danh mục con\n if ($role == 'admin') {\n }\n if ($role == 'client') {\n echo '<ul class=\"sub-menu\">';\n foreach ($cate as $r) {\n echo '<li><a href=\"posts-list-category.php?id=' . $r['id'] . '\">' . $r['name'] . '</a></li>';\n }\n echo '</ul>';\n }\n }\n}",
"function get_subcategories_list() {\n $query = $this->db->get('subcategories');\n return $query->result_array();\n }",
"private function getCaseNodes(): array\n {\n $caseNodes = $this->xml->xpath('//testcase');\n $cases = [];\n foreach ($caseNodes as $node) {\n $caseFilename = (string) $node['file'];\n if (! isset($cases[$caseFilename])) {\n $cases[$caseFilename] = [];\n }\n\n $cases[$caseFilename][] = $node;\n }\n\n return $cases;\n }",
"public function subcategory()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->pro->prifix.$this->pro->category);\n\t\t$this->db->order_by($this->pro->category.'_id','desc');\n\t\t$this->db->order_by($this->pro->category.'_parent','desc');\n\t\t$this->db->where($this->pro->category.'_status','1');\n\t\t$this->db->where($this->pro->category.'_parent>',0);\n\t\t$rs = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\treturn $rs->result_array();\n\t\t\n\t}",
"public function testGetItemSubCategoryTags()\n {\n }",
"function getCategories($object) { \n\n $R1 = new Category(); // R1 --\n $R11 = new Category(); // | | - R11 --\n $R111 = new Category(); // | | - R111\n $R112 = new Category(); // | | - R112\n $R11->addSubcategory($R111); // |\n $R11->addSubcategory($R112); // |\n $R1->addSubcategory($R11); // |\n $R2 = new Category(); // R2 --\n $R21 = new Category(); // | - R21 --\n $R211 = new Category(); // | | - R211\n $R22 = new Category(); // |\n $R221 = new Category(); // | - R22 --\n $R21->addSubcategory($R211); // | - R221\n $R22->addSubcategory($R221);\n $R2->addSubcategory($R21);\n $R2->addSubcategory($R22);\n\n $object->addCollectionEntry($R1); \n $object->addCollectionEntry($R2); \n}",
"private function categoryTree($parent_id = 0, $sub_mark = '')\n {\n $query = DB::table('category')\n ->select('*')\n ->where('parent_id',$parent_id)\n ->get()\n ->pluck('cat_name','id');\n\n \n foreach ($query as $id => $value)\n {\n //echo $key.\" : \".$sub_mark.$value.\"</br>\";\n array_push($this->categories, $sub_mark.$value.':'.$id);\n $this->categoryTree($id, $sub_mark.'---');\n }\n return $this->categories;\n }",
"public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }",
"public function get_sub_categories($parent_id) {\n $parent_id = $this->real_escape_string($parent_id);\n return $this->query(\"SELECT * FROM sub_cat WHERE parent_id = '\"\n . $parent_id . \"' order by id \");\n }",
"public function fetch_subcategory() {\n $this->db->where('parent_id!=', '0');\n $r = $this->db->get('category');\n return $r->result_array();\n }",
"public static function getDressSubacategories($parent_cat_id) {\n Db_Actions::DbSelect(\"SELECT * FROM cscart_dress_type_subcategory WHERE dress_type_category_id=$parent_cat_id\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n ?><ul><?php\n foreach ($result as $subcat) {\n ?>\n <li><a href=\"#\" data-typec=\"<?php echo $subcat->id ?>\"><?php echo $subcat->label ?></a></li>\n <?php\n }\n ?></ul><?php\n }\n }",
"function getSubCategoryTab($parent, $ajax)\n{\n\t$ci =& get_instance();\n\t$sc = '';\n\t$qs = $ci->db->query(\"SELECT * FROM product_tab WHERE id_parent = \".$parent);\n\n\tif( $qs->num_rows() > 0 )\n\t{\n\t\tforeach( $qs->result() as $rs )\n\t\t{\n\t\t\tif( hasChild($rs->id) === TRUE ) //----- ถ้ามี sub category\n\t\t\t{\n\t\t\t\t$sc .= '<li class=\"dropdown-hover\" onmouseover=\"expandTab((this))\" onmouseout=\"collapseTab((this))\">';\n\t\t\t\t$sc .= '<a id=\"ul-'.$rs->id.'\" class=\"dropdown-toggle\" href=\"#cat-'.$rs->id.'\" data-toggle=\"tab\" onClick=\"'.$ajax.'(\\''.$rs->id.'\\')\">';\n\t\t\t\t$sc .= $rs->name.'</a>';\n\t\t\t\t$sc .= \t'<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"ul-'.$rs->id.'\">';\n\t\t\t\t$sc .= \tgetSubTab($rs->id, $ajax);\n\t\t\t\t$sc .= '</ul>';\n\t\t\t\t$sc .= '</li>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sc .= '<li class=\"menu\"><a href=\"#cat-'.$rs->id.'\" role=\"tab\" data-toggle=\"tab\" onClick=\"'.$ajax.'(\\''.$rs->id.'\\')\">'.$rs->name.'</a></li>';\n\t\t\t}\n\n\t\t}\n\t}\n\treturn $sc;\n}",
"public function getCategories();",
"public function getCategories();",
"public function getCategories() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE parent is null ORDER BY name ASC\");\n $stmt->setFetchMode(\\PDO::FETCH_CLASS, '\\App\\Model\\Category\\ProductCategoryModel');\n $stmt->execute();\n return $stmt->fetchAll();\n }",
"public function get_sub_cat_list1($parentid,$subcatid){\n\t\t\n\t\t$parentid= trim($parentid);\n\t\t$subcatid= trim($subcatid);\n\t\t\n\t\treturn $this->db->query(\"select a.*,b.* from subcategory_name as a inner join subcategory as b on a.subcategory_name_id=b.subcategory_name_id where b.subcategory_name_id='$subcatid' and b.ParentCategory='$parentid'\")->result_array();\n\t\n\t\t\n\t}",
"public function getChildrenIterative(): array\n {\n //not using $this->getTopLevelParents, it would be concerns violation\n $topLevelParents = $this->categoryRepository->getTopLevelParents();\n\n $results[0] = $topLevelParents;\n $parents = $topLevelParents;\n\n $results = $this->iterate($results);\n\n return $results;\n }",
"public function getMenu(){\n $bigCategory = $this->getBigCategory();\n $medCategory = $this->getMediumCategory();\n foreach($bigCategory as $bigKey => $value){\n foreach($medCategory as $medKey => $val){\n if($val['parentId'] == $value['id']){\n $bigCategory[$bigKey]['subCategory'][] = $val;\n }\n }\n }\n return $bigCategory;\n }",
"public function showSubcategories(){\n return ArticleModel::showSubcategories();\n }",
"public function all_parent_units()\n\t{\n\t\t$this->db->where('units_status = 1 AND units_parent = 0');\n\t\t$this->db->order_by('units_name', 'ASC');\n\t\t$query = $this->db->get('units');\n\t\t\n\t\treturn $query;\n\t}",
"public function run()\n {\n $categories = [\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Gear', 'slug' => 'gear', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Parts', 'slug' => 'parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Casual', 'slug' => 'casual', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'News', 'slug' => 'news', 'sortorder' => 4, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Clothes', 'slug' => 'clothes', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Helmets', 'slug' => 'helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Boots', 'slug' => 'boots', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Suspension', 'slug' => 'suspension', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'maintenance', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Oils', 'slug' => 'oils', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'T-Sirts', 'slug' => 'tshirts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'Caps', 'slug' => 'caps', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Jerseys', 'slug' => 'jerseys', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Pants', 'slug' => 'pants', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-helmets', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-boots', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-boots', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Fork', 'slug' => 'fork-parts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Shock', 'slug' => 'shock-parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Airfilter', 'slug' => 'airfilter', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Oilfilter', 'slug' => 'oilfilter', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Brakepads', 'slug' => 'brakepads', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Engine Oils', 'slug' => 'engine-oils', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Suspension Oils', 'slug' => 'suspension-oils', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'bike-maintenance', 'sortorder' => 3, 'active' => 1],\n ];\n\n DB::table('categories')->insert($categories);\n }",
"public function treeDataProvider()\n {\n $catData = [\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ],\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ],\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ],\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ],\n [\n 'id' => 'cat422',\n 'active' => true,\n 'sort' => 1,\n 'left' => 6,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ],\n [\n 'id' => 'cat5',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat6',\n 'active' => true,\n 'sort' => 1,\n 'left' => 9,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n ];\n\n $data = [];\n foreach ($catData as $category) {\n $data[$category['id']] = $this->buildCategory($category);\n }\n\n return [['data' => $data]];\n }",
"public function findChildren($id_parent){\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.parent', $queryBuilder->createNamedParameter($id_parent))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.sys_language_uid', $queryBuilder->createNamedParameter($GLOBALS['TSFE']->sys_language_uid, \\PDO::PARAM_INT))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.deleted', $queryBuilder->createNamedParameter(0))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.hidden', $queryBuilder->createNamedParameter(0))\n )\n ->execute();\n $list_cat=[];\n while ($row = $statement->fetch()) {\n\n $list= array(\n 'uid' => $row['uid'],\n 'title' => $row['title'],\n 'parent' => $row['parent'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n );\n array_push($list_cat, $list);\n }\n\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.uid', $queryBuilder->createNamedParameter($id_parent))\n )\n \n ->execute();\n while ($row = $statement->fetch()) {\n $list=array(\n 'uid' =>$row['uid'],\n 'title' =>$row['title'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n 'children' => $list_cat);\n }\n return $list;\n }",
"function getCategories($categories, &$result, $parent_id = 0, $depth = 0)\n {\n $cats = $categories->filter(function ($item) use ($parent_id) {\n return $item->parent_id == $parent_id;\n });\n\n //loop through them\n foreach ($cats as $cat)\n {\n //add category. Don't forget the dashes in front. Use ID as index\n $result[$cat->id] = str_repeat('-', $depth) . ($depth ? ' ' : '') . $cat->name;\n //go deeper - let's look for \"children\" of current category\n $this->getCategories($categories, $result, $cat->id, $depth + 1);\n }\n }",
"public function subcategories(){\n return $this->hasMany(Category::class,'parent_category_id')->where('hidden', 0);\n }",
"public function getSubCategoryList($category_id)\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_category');\r\n\t\t$this->db->where('category_status', '1');\r\n\t\t$this->db->where('category_parent_id', $category_id);\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}",
"public function categoryList()\n {\n $data = [];\n $categories = Category::where('parent', 0)->get();\n if($categories){\n $data = ['status' => true, 'code' => 200, 'data'=>$categories];\n }else{\n $data = ['status' => false, 'code' => 404, 'message' => \"data not found\"];\n }\n return $data;\n }",
"function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\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\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}",
"public function getParentCategory() {\r\n\t\t$postID = $_POST['id'];\r\n\t\t$parentList = '<select id=\"ExpenseCategory[]\" class=\"form-control xxx ExpenseCategory exParentCat\" name=\"ExpenseParentCategory[]\">';\r\n\t\t$parentList .= '<option value=\"-1\" > Select Sub Category</option>'; \r\n\t\t$parentCat = getCategoryParent($_POST['CatType']); \r\n\t\tif( !empty( $parentCat ))\r\n\t\t{\r\n\t\t\tforeach($parentCat as $val){\r\n\t\t\t\tif( getCategoryParentId($postID) == $val->id)\r\n\t\t\t\t\t$parentList .= '<option value=\"'.$val->id.'\" selected=\"selected\"> '.$val->title.' </option>';\r\n\t\t\t\telse\t\r\n\t\t\t\t\t$parentList .= '<option value=\"'.$val->id.'\" > '.$val->title.' </option>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$parentList .= '</select>'; \r\n\t\techo $parentList; \r\n\t}",
"public function testAddParentsOfCategoryWithSuccess()\n {\n $categoriesCreatedArray = $this->createCategoriesDataForTest();\n\n $lastValueArray = end($categoriesCreatedArray);\n $firstValueArray = $categoriesCreatedArray[0];\n\n $this->assertInstanceOf(InlineResponse2011::class, $lastValueArray);\n\n $this->resourceAPI->deleteCategoryById($firstValueArray->getData()[0]->getId());\n }"
] | [
"0.7702972",
"0.75852704",
"0.7377731",
"0.7181234",
"0.71775866",
"0.7006619",
"0.68165207",
"0.6547832",
"0.65261054",
"0.6519886",
"0.6500176",
"0.6454018",
"0.64258707",
"0.6258138",
"0.62468475",
"0.6177269",
"0.6156098",
"0.6149857",
"0.610501",
"0.6096779",
"0.6071637",
"0.6070662",
"0.6050388",
"0.60232455",
"0.60231",
"0.5949792",
"0.59414417",
"0.59337807",
"0.5932246",
"0.5927026",
"0.5909384",
"0.5869301",
"0.5867467",
"0.58667046",
"0.5861087",
"0.58534706",
"0.58488715",
"0.58436257",
"0.5832334",
"0.58294064",
"0.5825357",
"0.5817282",
"0.5803414",
"0.57998645",
"0.57825136",
"0.57800037",
"0.57761115",
"0.57661146",
"0.5763256",
"0.57534534",
"0.57493806",
"0.5740457",
"0.573544",
"0.5729225",
"0.5711416",
"0.5705755",
"0.5703458",
"0.5698961",
"0.56974345",
"0.566834",
"0.5647886",
"0.56440794",
"0.5641151",
"0.563431",
"0.5617143",
"0.56155074",
"0.5607714",
"0.5605211",
"0.5604854",
"0.56008697",
"0.5596364",
"0.5595383",
"0.5592977",
"0.55921346",
"0.55896163",
"0.5586681",
"0.5585792",
"0.55830127",
"0.55587023",
"0.55493045",
"0.5545147",
"0.55440414",
"0.55426645",
"0.55426645",
"0.5539604",
"0.55367404",
"0.5525362",
"0.5521041",
"0.55031556",
"0.5500996",
"0.54971296",
"0.5490062",
"0.5480197",
"0.5479729",
"0.5479158",
"0.54702693",
"0.5453055",
"0.5448861",
"0.5448387",
"0.54482853"
] | 0.65188265 | 10 |
Determine whether the user can view the homeSection. | public function view(User $user, HomeSection $homeSection)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isHomePage() {\n return $this->uri === $this->kirby->options['home'];\n }",
"public function isHomePage()\n\t{\n\t\treturn $this->home_page;\n\t}",
"private function isHome(): bool\n {\n if (! $this->context->get('is_entry')) {\n return false;\n }\n\n if (! $this->context->get('page')) {\n return false;\n }\n\n return $this->context->get('parent') === null;\n }",
"public function getIsHomePage()\n {\n return $this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true));\n }",
"public function getIsHomePage()\n {\n return $this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true));\n }",
"public function is_home();",
"public function is_home()\n {\n }",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }",
"public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }",
"public function canAccessPage(){\n\n\t\t\t$nav = $this->getNavigationArray();\n\t\t\t$page = '/' . trim(getCurrentPage(), '/') . '/';\n\n\t\t\t$page_limit = 'author';\n\n\t\t\tforeach($nav as $item){\n\t\t\t\tif(General::in_array_multi($page, $item['children'])){\n\n\t\t\t\t\tif(is_array($item['children'])){\n\t\t\t\t\t\tforeach($item['children'] as $c){\n\t\t\t\t\t\t\tif($c['type'] == 'section' && $c['visible'] == 'no' && preg_match('#^' . $c['link'] . '#', $page)) {\n\t\t\t\t\t\t\t\t$page_limit = 'developer';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($c['link'] == $page && isset($c['limit'])) {\n\t\t\t\t\t\t\t\t$page_limit\t= $c['limit'];\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($item['limit']) && $page_limit != 'primary'){\n\t\t\t\t\t\tif($page_limit == 'author' && $item['limit'] == 'developer') $page_limit = 'developer';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telseif(isset($item['link']) && ($page == $item['link']) && isset($item['limit'])){\n\t\t\t\t\t$page_limit\t= $item['limit'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($page_limit == 'author')\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}",
"public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }",
"public function getIsHomepage()\n {\n return $this->isHomepage;\n }",
"public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}",
"public function accessibleByCurrentUser(){\n // return true if AYC user\n if(\\Auth::isSuperAdmin()) return true;\n\n // otherwise check if personally added to this\n $allowedPages = \\Auth::getAllowedPages();\n if(in_array($this->id, $allowedPages)) return true;\n\n // if not specifically added personally to this page\n // check the user group can access this page\n if($this->groupHasPermission(\\Auth::getUserLevel())) return true;\n\n // otherwise return false\n return false;\n\n }",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }",
"function userCanViewPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageView(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}",
"public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestudy_Menu::first_index');\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }",
"function tc_is_home() {\r\n \r\n //get info whether the front page is a list of last posts or a page\r\n return ( (is_home() && ( 'posts' == get_option( 'show_on_front' ) || 'nothing' == get_option( 'show_on_front' ) ) ) || is_front_page() ) ? true : false;\r\n }",
"function checkIfUserCanAccessPage()\n{\n $permissionGranted = false;\n\n $request = Request::path();\n $path = $request[\"path\"];\n $currentUrlString = rtrim(str_replace(Request::server('SCRIPT_NAME'), '', $path), '/');\n\n $getUserPermissions = session()->get('user_permissions');\n\n if (in_array($currentUrlString, $getUserPermissions)) {\n $permissionGranted = true;\n }\n\n return $permissionGranted;\n}",
"private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }",
"public function canShow()\n {\n return $this->_authSession->isFirstPageAfterLogin() && $this->_getLatestItem();\n }",
"public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }",
"public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}",
"private function hasAccess() {\n\t\tif ($GLOBALS['BE_USER']->isAdmin()) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn $this->userHasAccessToPages() && $this->userHasAccessToTables();\n\t}",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }",
"public static function pageAuth() {\r\n if (isset($_SESSION['username']) && (($_SESSION['authorized'] == 'ADMIN')\r\n OR ($_SESSION['authorized'] == 'SUPERUSER')\r\n OR ($_SESSION['authorized'] == 'MEMBER')))\r\n return true;\r\n else {\r\n exit();\r\n //header('location:index');\r\n }\r\n }",
"public function isAuthorized($user)\n {\n if (isset($user['V_ROL']) and $user['V_ROL']==='Viewer')\n {\n if (in_array($this->request->action,['home','view','logout']))\n {\n return true;\n }\n }\n return parent::isAuthorized($user);\n }",
"public function home(){\n\t\t//debug($this->Session->read('Auth.User'));\n\t\t//juste verifier :\n\t\t//debug($this->Session->check('Auth.User'));\n\t\tif($this->Session->check('Auth.User')){\n\t\t\tif($this->Session->read('Auth.User.role')=='admin'){\n\t\t\t\t$this->redirect('/admins/home');\n\t\t\t}\n\t\t\telse{\n\n\t\t\t}\n\t\t}\n\t\telse {\n\n\t\t}\n\t}",
"public function goHome() {\r\n\t\tif ($this->_home->door->isOpen()) {\r\n\t\t\t$this->_home->letCatIn($this);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }",
"public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function canManagePages();",
"function tc_is_home_empty() {\r\n //check if the users has choosen the \"no posts or page\" option for home page\r\n return ( (is_home() || is_front_page() ) && 'nothing' == get_option( 'show_on_front' ) ) ? true : false;\r\n }",
"public static function canDisplayAccountsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ACCOUNT);\n\t}",
"public function canShowTab()\n {\n if (!$this->getPage()->getId()\n || !Mage::helper('gri_cms/hierarchy')->isEnabled()\n || !Mage::getSingleton('admin/session')->isAllowed('cms/hierarchy'))\n {\n return false;\n }\n return true;\n }",
"public static function isAllowedViewSite()\n {\n if ((int) SettingService::getSetting('application_disable_site')) {\n $user = UserIdentityService::getCurrentUserIdentity();\n\n if ($user['role'] != AclBaseModel::DEFAULT_ROLE_ADMIN) {\n // get a visitor IP\n $remote = new RemoteAddress;\n $remote->setUseProxy(true);\n\n $userIp = $remote->getIpAddress();\n\n // get list of allowed ACL roles\n if (null != ($allowedAclRoles = SettingService::getSetting('application_disable_site_acl'))) {\n if (!is_array($allowedAclRoles)) {\n $allowedAclRoles = [$allowedAclRoles];\n }\n }\n\n // get list of allowed IPs\n if (null != ($allowedIps = SettingService::getSetting('application_disable_site_ip'))) {\n $allowedIps = explode(',', $allowedIps);\n }\n\n if ($allowedAclRoles || $allowedIps) {\n if (($allowedAclRoles && in_array($user['role'], $allowedAclRoles)) \n || ($allowedIps && in_array($userIp, $allowedIps))) {\n\n return true;\n }\n }\n\n return false;\n }\n }\n\n return true;\n }",
"public function canLoginHere()\n {\n if (! $this->_hasVar('can_login_here')) {\n $this->_setVar('can_login_here', true);\n if ($orgId = $this->userLoader->getOrganizationIdByUrl()) {\n if (! $this->isAllowedOrganization($orgId)) {\n $this->_setVar('can_login_here', false);;\n }\n }\n }\n return $this->_getVar('can_login_here');\n }",
"public function isLoggedIn(): bool\n {\n return $this->getRights() > self::GUEST;\n }",
"public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}",
"function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn();\n\t\t}",
"public function canAccessDashboard()\n {\n return $this->isAdmin();\n }",
"public function user_can_see_home_page()\n {\n $user = factory(User::class)->create();\n $this->get('/')\n ->assertStatus(200);\n }",
"public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('magjah_dash/dash');\n }",
"private function canView(): bool\n {\n return true;\n }",
"public static function is_permit_to_see($section) {\n\t\t$db = new Database ();\n\t\t$query = 'SELECT COUNT(privileges) AS privileges FROM authorize WHERE auth_level <= \\'' . self::$auth_level . '\\' AND section = \\'' . $section . '\\'';\n\t\tforeach ( $db->query ( $query ) as $result ) {\n\t\t\tif ($result ['privileges'] > 0)\n\t\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function getShowInHome();",
"public function has_access() { \n\n\t\tif (!Access::check('interface','25')) { \n\t\t\treturn false; \n\t\t} \n\t\tif ($this->user == $GLOBALS['user']->id) { \n\t\t\treturn true; \n\t\t} \n\t\telse {\n\t\t\treturn Access::check('interface','100'); \n\t\t} \t\n\n\t\treturn false; \n\n\t}",
"function euphony_is_hero_content_active( $control ) {\n\t\t$enable = $control->manager->get_setting( 'euphony_hero_content_visibility' )->value();\n\n\t\treturn euphony_check_section( $enable );\n\t}",
"public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }",
"public static function isAdministration()\n {\n $permissions = [\"Vice direzione\", \"Direzione\"];\n return in_array($_SESSION[\"permission\"], $permissions);\n }",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"protected function passesAuthorization(): bool\n {\n return $this->hasNestedMenu();\n }",
"public function authorize()\n {\n $contact = $this->route('contact');\n\n return $contact->user_id == auth()->id() || user()->acl < 9;\n }",
"public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }",
"protected function is_sections_front_page() {\n\n\t\tif ( get_option( 'show_on_front' ) !== 'page' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$frontpage_id = get_option( 'page_on_front' );\n\n\t\tif ( empty( $frontpage_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->post_id !== $frontpage_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$page_template = get_post_meta( $frontpage_id, '_wp_page_template', true );\n\t\tif ( ! empty( $page_template ) && 'default' !== $page_template ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$disabled_frontpage = get_theme_mod( 'disable_frontpage_sections', false );\n\t\tif ( true === (bool) $disabled_frontpage ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public function is_home_static_page() {\n return ( is_front_page() && 'page' == get_option( 'show_on_front' ) && is_page( get_option( 'page_on_front' ) ) );\n }",
"function segments_is_private() { \n $login_id = get_theme_mod( 'workforce_pages_login', null );\n $is_private = false;\n\n if ( 'page-private.php' === get_page_template_slug() ) {\n $is_private = true;\n }\n\n if ( defined( 'WORKFORCE_ACTIVE' ) && \\Workforce\\Controller\\UserController::is_private() ) {\n $is_private = true;\n }\n \n if ( $is_private && ! is_user_logged_in() ) {\n if ( empty( $login_id ) ) {\n wp_redirect( get_permalink( $login_id ) );\n exit();\n }\n\n auth_redirect();\n exit();\n }\n\n return $is_private;\n}",
"public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}",
"public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }",
"function check_access() {\n if (!get_site()) {\n return true; // no access check before site is fully set up\n }\n $context = empty($this->context) ? get_context_instance(CONTEXT_SYSTEM) : $this->context;\n foreach($this->req_capability as $cap) {\n if (is_valid_capability($cap) and has_capability($cap, $context)) {\n return true;\n }\n }\n return false;\n }",
"public static function canDisplayTitlesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_TITLE);\n\t}",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"protected function user_authorized()\n\t{\n\t\t// If the user has the super role, then allow access\n\t\t$super_role = Kohana::config('acl.super_role');\n\t\tif ($super_role AND in_array($super_role, $this->user->roles_list()))\n\t\t\treturn TRUE;\n\t\t// If the user is in the user list, then allow access\n\t\tif (in_array($this->user->id, $this->rule['users']))\n\t\t\treturn TRUE;\n\t\t\t\n\t\t// If the user has all (AND) the capabilities, then allow access\n\t\t$difference = array_diff($this->rule['capabilities'], $this->user->capabilities_list());\n\t\tif ( ! empty($this->rule['capabilities']) AND empty($difference))\n\t\t\treturn TRUE;\n\n\t\t// If there were no capabilities allowed, check the roles\n\t\tif (empty($this->rule['capabilities']))\n\t\t{\n\t\t\t// If the user has one (OR) the roles, then allow access\n\t\t\t$intersection = array_intersect($this->rule['roles'], $this->user->roles_list());\n\t\t\tif ( ! empty($intersection))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }",
"private function checkPageAllowed() {\n\n if (!$this->user->isPersonnalManager()) {\n\n header('Location: ./index.php');\n exit();\n }\n }",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\treturn $this->user()->can('create', WorkFunction::class) && $this->user()->can('update', $this->workplace);\n\t}",
"public function isAllowed() {\n\t\tif (!$this->session->has('auth')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = User::findFirst(array('username' => $this->session->get('auth')));\n\n\t\treturn $user->getSuperUser() ? true : false;\n\t}",
"public function authorize()\n {\n return $this->user() != null;\n }",
"public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }",
"private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public static function canDisplayAttorneysMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY);\n\t}",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function authorize()\n {\n return $this->user('office')->isActive();\n }",
"public function canViewAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && ($this->auth->isSuperAdmin()\n || $this->auth->isAgent()\n || $this->isSelf());\n }",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"function is_home()\n{\n $CI =& get_instance();\n return (!$CI->uri->segment(1))? TRUE: FALSE;\n}",
"public static function show(){\n return Auth::check() && Auth::user()->isAdmin();\n }",
"public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return Auth::guest() || isMember();\n }",
"public function authorize() {\n\t\t$this->sport = $this->route('sport');\n\t\tif ($this->competitionDay = $this->route('competitionDay')) {\n\t\t\treturn $this->user()->can('update', $this->competitionDay);\n\t\t}\n\n\t\t$this->competitionDay = new CompetitionDay();\n\t\treturn $this->user()->can('create', CompetitionDay::class);\n\t}",
"function hasAccess(): bool\n {\n return isLoggedInAndHasRole($this->ci, [Role::ROLE_ADMIN]);\n }",
"public function canShowTab()\n {\n if ($this->_scopeConfig->getValue('brainacts_storelocator/item/separate_page')) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }",
"function user_can_access_admin_page()\n {\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function currentUserHasManagerAccess()\n {\n $user = Service::getCurrentUser();\n \n if (!$user) {\n return false;\n }\n \n if ($this->userManagesSite($user)) {\n return true;\n }\n \n if ($user->isAdmin()) {\n return true;\n }\n \n return false;\n }",
"public static function canLoad($pageid)\n\t{\n\t\t$pages = PageController::pages();\n\n\t\t// Is the page defined (in the database)?\n\t\tif (!$pageid || empty($pages[$pageid]))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$page = $pages[$pageid];\n\n\t\t// Access is granted without further ado for homepage and to superusers\n\t\tif (devMode() || PageController::isHome($pageid))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// Are the defined model and method valid (i.e. callable)?\n\t\tif (!is_callable(PageController::handler($pageid)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Deny if parent exists (page's module) and is not allowed\n\t\tif ($page['parent'] && !self::canLoad($page['parent']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read credentials, if set\n\t\tif (is_callable([$Hnd, 'pagecredentials']))\n\t\t{\n\t\t\t$credentials = (array)$Hnd->pagecredentials();\n\n\t\t\tif (!empty($credentials[$method]))\n\t\t\t{\n\t\t\t\t// Explicitly allowed if set to true\n\t\t\t\tif ($credentials[$method] === true)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Explicitly denied if any related permission is denied\n\t\t\t\t\tforeach ((array)$credentials[$method] as $permission)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!self::can($permission))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// If not explicitly allowed/denied, use default access\n\t\treturn !empty($Hnd->pageaccess);\n\t}",
"public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}",
"function visible () {\n\t\treturn isadmin();\n\t}",
"public function isNavbarSectionmenu()\r\n\t{\r\n\t\treturn $this->navbarSectionmenu;\r\n\t}",
"public function accessPanel()\n {\n return $this->role->section === 'panel';\n }"
] | [
"0.68453467",
"0.6793855",
"0.6749943",
"0.66786456",
"0.66786456",
"0.64784837",
"0.64718413",
"0.6413568",
"0.6413568",
"0.6398466",
"0.6382212",
"0.6364407",
"0.6335144",
"0.6242335",
"0.6231097",
"0.6227865",
"0.6203153",
"0.6201138",
"0.61946094",
"0.61342824",
"0.61235094",
"0.6070673",
"0.60509044",
"0.6046357",
"0.6033213",
"0.601982",
"0.6013705",
"0.59795874",
"0.59724844",
"0.59620357",
"0.5952577",
"0.5941701",
"0.59365004",
"0.5930308",
"0.59170765",
"0.59120226",
"0.58935857",
"0.5886593",
"0.58830935",
"0.5874134",
"0.5865878",
"0.5857245",
"0.58564276",
"0.58530384",
"0.581646",
"0.5809554",
"0.58068347",
"0.5800078",
"0.57998365",
"0.5790983",
"0.5784572",
"0.57727796",
"0.5768861",
"0.5765859",
"0.5762205",
"0.5760835",
"0.5760835",
"0.5760357",
"0.5758356",
"0.5756839",
"0.57494515",
"0.57413083",
"0.57387257",
"0.57381326",
"0.5737215",
"0.5731622",
"0.57292897",
"0.56983525",
"0.56971747",
"0.5684573",
"0.56811816",
"0.568108",
"0.56796277",
"0.5676164",
"0.56750804",
"0.56680876",
"0.5664475",
"0.56644386",
"0.5663113",
"0.56588686",
"0.5653876",
"0.56462294",
"0.56459177",
"0.56449455",
"0.5639785",
"0.56389534",
"0.5629974",
"0.5629974",
"0.5628618",
"0.5625948",
"0.56239307",
"0.5623539",
"0.56203663",
"0.56182444",
"0.5618227",
"0.56157535",
"0.5614973",
"0.5613741",
"0.5613172",
"0.5608983",
"0.5608053"
] | 0.0 | -1 |
Determine whether the user can create homeSections. | public function create(User $user)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }",
"function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }",
"public function canCreateNewPages() {}",
"public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function canManagePages();",
"public function can_add_homework($courseid) {\n $mode = $this->get_mode();\n if ($mode == 'teacher' || $mode == 'student') {\n\n $context = context_course::instance($courseid);\n return has_capability('block/homework_diary:addhomework', $context);\n }\n return false;\n }",
"function CanCreateSegment()\n\t{\n\t\tif ($this->SegmentAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($this->HasAccess('Segments', 'Create')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }",
"public function canCreateSitepages($row) {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitepages\n if (!Engine_Api::_()->authorization()->isAllowed('sitepage_page', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitepages\n if (!Engine_Api::_()->authorization()->isAllowed('sitepage_page', $viewer, 'create')) {\n return false;\n }\n \n if(Zend_Registry::isRegistered('Zend_View') && $row->name == 'sitepage_main_create') {\n $view = Zend_Registry::get('Zend_View');\n $view->headScript()->appendFile($view->layout()->staticBaseUrl . 'application/modules/Sitepage/externals/scripts/menus.js');\n $view->headLink()->appendStylesheet($view->layout()->staticBaseUrl . 'application/modules/Sitepage/externals/styles/global.css');\n }\n return true;\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestudy_Menu::first_index');\n }",
"function canCreate(){\n\t\t\tif(!isset($_POST['action'])) return false;\n\t\t\tif($_POST['action'] !== 'create_profile') return false;\n\t\t\tif($_POST['profile_folder'] === '') return false;\n\t\t\tif($_POST['profile_name'] === '') return false;\n\t\t\treturn true;\n\t\t}",
"public function canCreateListing() {\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n if( !$viewer || !$viewer->getIdentity() ) {\r\n return false;\r\n }\r\n\t\t\r\n\t\t$listingtype_id = Engine_Api::_()->ynmultilisting()->getCurrentListingTypeId();\r\n\t\tif (!$listingtype_id) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$listingtype = Engine_Api::_()->ynmultilisting()->getCurrentListingType();\r\n if( !$listingtype->checkPermission($viewer, 'ynmultilisting_listing', 'create')) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"function CanCreateList()\n\t{\n\t\tif (!verify($this->userid)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($this->ListAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$maxlists = $this->GetMaxLists();\n\n\t\t// if there is no maximum set, double check they have permission to create a list.\n\t\tif ($maxlists == 0) {\n\t\t\tif ($this->HasAccess('Lists', 'Create')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t$mylists = count(array_keys($this->GetLists()));\n\t\tif ($mylists < $maxlists) {\n\t\t\tif ($this->HasAccess('Lists', 'Create')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t\treturn false;\n\t}",
"private function isHome(): bool\n {\n if (! $this->context->get('is_entry')) {\n return false;\n }\n\n if (! $this->context->get('page')) {\n return false;\n }\n\n return $this->context->get('parent') === null;\n }",
"public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }",
"public function authorize()\n {\n return auth()->user()->can('create-buildings');\n }",
"public function authorize()\n {\n return $this->user()->can('create', MarEntry::class);\n }",
"public function canAccessPage(){\n\n\t\t\t$nav = $this->getNavigationArray();\n\t\t\t$page = '/' . trim(getCurrentPage(), '/') . '/';\n\n\t\t\t$page_limit = 'author';\n\n\t\t\tforeach($nav as $item){\n\t\t\t\tif(General::in_array_multi($page, $item['children'])){\n\n\t\t\t\t\tif(is_array($item['children'])){\n\t\t\t\t\t\tforeach($item['children'] as $c){\n\t\t\t\t\t\t\tif($c['type'] == 'section' && $c['visible'] == 'no' && preg_match('#^' . $c['link'] . '#', $page)) {\n\t\t\t\t\t\t\t\t$page_limit = 'developer';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($c['link'] == $page && isset($c['limit'])) {\n\t\t\t\t\t\t\t\t$page_limit\t= $c['limit'];\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($item['limit']) && $page_limit != 'primary'){\n\t\t\t\t\t\tif($page_limit == 'author' && $item['limit'] == 'developer') $page_limit = 'developer';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telseif(isset($item['link']) && ($page == $item['link']) && isset($item['limit'])){\n\t\t\t\t\t$page_limit\t= $item['limit'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($page_limit == 'author')\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}",
"public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public static function isAdministration()\n {\n $permissions = [\"Vice direzione\", \"Direzione\"];\n return in_array($_SESSION[\"permission\"], $permissions);\n }",
"public function create(User $user)\n {\n return $user->hasPermission('create-reference-section');\n }",
"public function create()\n {\n\n if(Auth::user()) {\n\n if(Auth::user()->hasRole('user admin')) {\n return view('pages.new_section');\n }\n } \n return back();\n }",
"private function canCreate()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}",
"public function authorize()\n {\n $user = Auth::user();\n\n $foodAddition = new FoodAddition();\n\n if((!$user->can('create', $foodAddition)) || (!$user->can('create-food-addition'))) {\n return false;\n }\n\n return true;\n }",
"protected function passesAuthorization(): bool\n {\n return $this->hasNestedMenu();\n }",
"public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }",
"private function userHasAccessToPages() {\n\t\t$configurationProxy = tx_oelib_configurationProxy::getInstance('realty');\n\n\t\t$objectsPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForRealtyObjectsAndImages'\n\t\t);\n\t\t$canWriteObjectsPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $objectsPid), 16\n\t\t);\n\n\t\t$auxiliaryPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForAuxiliaryRecords'\n\t\t);\n\t\t$canWriteAuxiliaryPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $auxiliaryPid), 16\n\t\t);\n\n\t\tif (!$canWriteObjectsPage) {\n\t\t\t$this->storeErrorMessage('objects_pid', $objectsPid);\n\t\t}\n\t\tif (!$canWriteAuxiliaryPage) {\n\t\t\t$this->storeErrorMessage('auxiliary_pid', $auxiliaryPid);\n\t\t}\n\n\t\treturn $canWriteObjectsPage && $canWriteAuxiliaryPage;\n\t}",
"public function canCreatePlaces()\n\t{\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\tif( !$viewer || !$viewer->getIdentity() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Must be able to create blogs\n\t\t/*\n\t\tif( !Engine_Api::_()->authorization()->isAllowed('blog', $viewer, 'create') ) {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\treturn true;\n\t}",
"public function canCreate();",
"public function canCreate();",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"public function canCreateSitegroups() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'create')) {\n return false;\n }\n return true;\n }",
"public function isHomePage()\n\t{\n\t\treturn $this->home_page;\n\t}",
"public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }",
"public function has_sections() {\n\t\t\tif ( !isset( $this->registered_sections ) ) {\n\t\t\t\tglobal $wp_settings_sections;\n\t\t\t\t$i = 1;\n\t\t\t\tforeach ( $wp_settings_sections[$this->default_group] as $id => $section ) {\n\t\t\t\t\t$this->registered_sections[$i]['id'] = $id;\n\t\t\t\t\t$this->registered_sections[$i]['title'] = $section['title'];\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t$this->_display_count++;\n\t\t\t\n\t\t\tif ( isset( $this->registered_sections[$this->_display_count] ) ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->_display_count = 0;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }",
"protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Site());\n }",
"public function create()\n {\n\n if (Auth::guest()) {\n return view('home');\n } elseif (Auth::user()->permission(1 or 3)) {\n $learning_section = Cws::all();\n return view('learning_material.new_learningSection', ['cws' => $learning_section]);\n } else {\n return view('home');\n }\n\n }",
"private function canListAndCreate()\n {\n return true;\n }",
"public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }",
"public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }",
"public function authorize(): bool\n {\n return auth()->user()->can('create academic year unit levels');\n }",
"public function authorize()\n { \n if($this->user()->hasRole(['unidadeEnsino', 'articulador', 'superadministrador']))\n {\n return true;\n }else {\n $this->error = 'Desculpe, voce nao possui permissão para adicionar espaços';\n return false;\n }\n }",
"public function create()\n {\n return isAdmin();\n }",
"public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\n }",
"public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }",
"public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}",
"public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n {\n return $this->user()->can('user.create');\n }",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"public function page_administration_exists() {\n $menuxpath = \"//section[contains(@class,'block_settings')]//div[@id='settingsnav']\";\n $this->ensure_element_exists($menuxpath, 'xpath_element');\n }",
"function check_permission()\n\t{\n\t\t$CFG = $this->config->item('language_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}",
"public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"function user_can_access_admin_page()\n {\n }",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\treturn $this->user()->can('create', WorkFunction::class) && $this->user()->can('update', $this->workplace);\n\t}",
"public function canShowTab()\n {\n if (!$this->getPage()->getId()\n || !Mage::helper('gri_cms/hierarchy')->isEnabled()\n || !Mage::getSingleton('admin/session')->isAllowed('cms/hierarchy'))\n {\n return false;\n }\n return true;\n }",
"public static function canDisplayTitlesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_TITLE);\n\t}",
"protected function canCreate() {}",
"public function authorize(): bool\n {\n return $this->user()->can('create_contact');\n }",
"private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }",
"public function is_home()\n {\n }",
"public function authorize()\n {\n return auth()->user()->can('create', Pizza::class);\n }",
"public function authorize() {\n\t\t$this->sport = $this->route('sport');\n\t\tif ($this->competitionDay = $this->route('competitionDay')) {\n\t\t\treturn $this->user()->can('update', $this->competitionDay);\n\t\t}\n\n\t\t$this->competitionDay = new CompetitionDay();\n\t\treturn $this->user()->can('create', CompetitionDay::class);\n\t}",
"public function is_home();",
"public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }",
"function get_can_create_user ()\r\n {\r\n return $_SESSION[\"can_create_user\"];\r\n }",
"public function isHomePage() {\n return $this->uri === $this->kirby->options['home'];\n }",
"public function create()\n {\n if(Auth::user()->user_type==1)\n {\n return view('backend.sections.create');\n }\n else{\n return redirect('welcome');\n }\n }",
"public function accessibleByCurrentUser(){\n // return true if AYC user\n if(\\Auth::isSuperAdmin()) return true;\n\n // otherwise check if personally added to this\n $allowedPages = \\Auth::getAllowedPages();\n if(in_array($this->id, $allowedPages)) return true;\n\n // if not specifically added personally to this page\n // check the user group can access this page\n if($this->groupHasPermission(\\Auth::getUserLevel())) return true;\n\n // otherwise return false\n return false;\n\n }",
"public function create(User $user)\n {\n return $user->hasPermissionTo('create meetingrooms');\n }",
"function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Vetting Step?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Vetting Step?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing Vetting Steps?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step's order?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX\n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Vetting Step?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }",
"private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}",
"public function authorize()\n {\n return auth()->user()->can('create', Task::class);\n }",
"function segments_is_private() { \n $login_id = get_theme_mod( 'workforce_pages_login', null );\n $is_private = false;\n\n if ( 'page-private.php' === get_page_template_slug() ) {\n $is_private = true;\n }\n\n if ( defined( 'WORKFORCE_ACTIVE' ) && \\Workforce\\Controller\\UserController::is_private() ) {\n $is_private = true;\n }\n \n if ( $is_private && ! is_user_logged_in() ) {\n if ( empty( $login_id ) ) {\n wp_redirect( get_permalink( $login_id ) );\n exit();\n }\n\n auth_redirect();\n exit();\n }\n\n return $is_private;\n}",
"private function hasAccess() {\n\t\tif ($GLOBALS['BE_USER']->isAdmin()) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn $this->userHasAccessToPages() && $this->userHasAccessToTables();\n\t}",
"public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }",
"function CheckLibraryAccess(){\n if ($this->listSettings->HasSection(\"ACCESS\")) {\n if ($this->listSettings->HasItem(\"ACCESS\", \"GROUPS\")) {\n $this->Page->access_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"GROUPS\"));\n\n }\n if ($this->listSettings->HasItem(\"ACCESS\", \"USERS\")) {\n $this->Page->access_user_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"USERS\"));\n }\n if ($this->listSettings->HasItem(\"ACCESS\", \"ROLES\")) {\n $this->Page->access_role_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"ROLES\"));\n }\n\n $this->Page->Auth->isLogged();\n }\n }",
"public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}",
"public function getIsHomepage()\n {\n return $this->isHomepage;\n }",
"public function checkIfUserCanAddToAllLocations() {\n if (empty($this->request->params['pass']) || $this->request->params['pass'][0] === '') {\n return false;\n }\n\n return $this->request->params['pass'][0] === $this->userLocation; \n }",
"public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }",
"public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function hasAdmin() {\n\n return database::getInstance()->has(\"staff\",[\"Path[!]\" => null]);\n\n }",
"protected function isInAdministration()\n\t{\n\t\treturn (bool) $GLOBALS['tree']->isGrandChild(SYSTEM_FOLDER_ID,$this->getCurrentObject()->getRefId());\n\t}",
"public function adminInit()\n {\n $this->loadConfig();\n $userID = get_current_user_id();\n\n if (!$this->checkRoleExist($this->role_slug)) {\n add_role(\n $this->role_slug,\n $this->role_name,\n $this->getRoleCapabilities()\n );\n }\n\n if (empty($this->configParams)) {\n return false;\n }\n\n if ($this->userInRole($userID, $this->role_slug)) {\n if (isset($GLOBALS['menu'])) {\n foreach ($GLOBALS['menu'] as $value) {\n if (!in_array($value[2], $this->getConfigExclude())) {\n remove_menu_page($value[2]);\n }\n }\n }\n\n if (!empty($this->getConfigInclude())) {\n foreach ($this->getConfigInclude() as $value) {\n add_menu_page($value[0], $value[1], 'read', $value[2], '', 'dashicons-paperclip', 1);\n }\n }\n }\n\n return true;\n\n }",
"public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }",
"public function can_approve_homework($courseid) {\n $mode = $this->get_mode();\n if ($mode == 'teacher') {\n $context = context_course::instance($courseid);\n return has_capability('block/homework_diary:approvehomework', $context);\n }\n return false;\n }",
"protected function is_sections_front_page() {\n\n\t\tif ( get_option( 'show_on_front' ) !== 'page' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$frontpage_id = get_option( 'page_on_front' );\n\n\t\tif ( empty( $frontpage_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->post_id !== $frontpage_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$page_template = get_post_meta( $frontpage_id, '_wp_page_template', true );\n\t\tif ( ! empty( $page_template ) && 'default' !== $page_template ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$disabled_frontpage = get_theme_mod( 'disable_frontpage_sections', false );\n\t\tif ( true === (bool) $disabled_frontpage ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\n\t}",
"function canCreatePost() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }",
"public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }",
"public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }",
"function checkPermissions() {\n\t\t$current_user = wp_get_current_user();\n\t\tif(current_user_can('manage-lepress') || is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }",
"function checkPermissions() {\n \t//If blog owner or super user\n \t$current_user = wp_get_current_user();\n\t\tif(is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}"
] | [
"0.70002526",
"0.66863817",
"0.6412139",
"0.62274444",
"0.6181688",
"0.6132528",
"0.6110069",
"0.6045707",
"0.60447246",
"0.6036616",
"0.5991477",
"0.5986806",
"0.59731597",
"0.5950675",
"0.5930091",
"0.5846387",
"0.5845461",
"0.583233",
"0.5827489",
"0.5822666",
"0.581772",
"0.58148485",
"0.58022714",
"0.57840765",
"0.5772114",
"0.5762392",
"0.5757607",
"0.5749756",
"0.57344675",
"0.5727957",
"0.5712787",
"0.5712787",
"0.57109636",
"0.5707147",
"0.56999373",
"0.5689899",
"0.56750786",
"0.56722945",
"0.56567824",
"0.564941",
"0.5649369",
"0.5648673",
"0.5635616",
"0.56279683",
"0.56277084",
"0.5619939",
"0.5614882",
"0.56039447",
"0.56027883",
"0.5591435",
"0.55829203",
"0.55829203",
"0.5580808",
"0.55671954",
"0.5561693",
"0.5554182",
"0.5542966",
"0.5534568",
"0.55302554",
"0.55281967",
"0.552382",
"0.5520617",
"0.55113745",
"0.55070084",
"0.55011046",
"0.54961896",
"0.54915935",
"0.54880214",
"0.5486911",
"0.5484391",
"0.5478905",
"0.5477799",
"0.54769886",
"0.5465654",
"0.5465626",
"0.5464",
"0.54612213",
"0.5455393",
"0.5453022",
"0.5449285",
"0.5446328",
"0.543857",
"0.54371476",
"0.5432159",
"0.5428485",
"0.5428261",
"0.54265195",
"0.5416461",
"0.54110503",
"0.541098",
"0.54100937",
"0.5409331",
"0.5407954",
"0.5403165",
"0.5400061",
"0.5400011",
"0.5397459",
"0.53951967",
"0.5388446",
"0.53879035",
"0.5387653"
] | 0.0 | -1 |
Determine whether the user can update the homeSection. | public function update(User $user, HomeSection $homesection)
{
// dd($homesection->user_id);
return $user->id == $homesection->user_id && $user->role == 'admin';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}",
"public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }",
"public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }",
"static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }",
"public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }",
"public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }",
"public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }",
"protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }",
"public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }",
"public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }",
"public function authorize()\n {\n return $this->user()->can('update_users');\n }",
"public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }",
"function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}",
"function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}",
"public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}",
"function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}",
"public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }",
"public function canEdit()\n {\n return $this->is_locked == 0;\n }",
"function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}",
"public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }",
"public function isUpdateSecurityRelevant() {}",
"public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }",
"public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }",
"public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public static function isAdministration()\n {\n $permissions = [\"Vice direzione\", \"Direzione\"];\n return in_array($_SESSION[\"permission\"], $permissions);\n }",
"public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return Auth::check();\n }",
"public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }",
"public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }",
"public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Lof_Outlet::outlet_edit');\n }",
"protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }",
"private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }",
"protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }",
"public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\treturn $this->user()->can('create', WorkFunction::class) && $this->user()->can('update', $this->workplace);\n\t}",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }",
"function userCanEditPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}",
"protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }",
"public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"function EditOwnSettings()\n\t{\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->editownsettings;\n\t}",
"public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }",
"public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }",
"public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }",
"public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }",
"protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }",
"public function authorize() {\n\t\t$this->sport = $this->route('sport');\n\t\tif ($this->competitionDay = $this->route('competitionDay')) {\n\t\t\treturn $this->user()->can('update', $this->competitionDay);\n\t\t}\n\n\t\t$this->competitionDay = new CompetitionDay();\n\t\treturn $this->user()->can('create', CompetitionDay::class);\n\t}",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }",
"public function update(User $user, Section $section)\n {\n return $user->hasPermission('update-reference-section');\n }",
"public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }",
"function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"function isAuthed ()\r\n\t{\r\n\t\tif ((strlen($this->acUserAuth) > 0 ? $this->acUserAuth : 0) >= $this->acPageAuth)\r\n\t\t{\r\n\t\t\t$status = true;\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$status = false;\r\n\t\t}\r\n\t\treturn $status;\r\n\t}",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }",
"public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Codilar_Image360::image360_settings_edit');\n }",
"protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }",
"function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}",
"public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }",
"public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }",
"public function checkAdmin() {\n if (self::redirectIfNotLoggedIn()) {\n return TRUE;\n }\n\n if (!LoggedInUserDetails::isCrew() && !LoggedInUserDetails::hasFullRights()) {\n if (\\Drupal::moduleHandler()->moduleExists('iish_conference_login_logout')) {\n $link = Link::fromTextAndUrl(\n iish_t('log out and login'),\n Url::fromRoute(\n 'iish_conference_login_logout.login_form',\n array(),\n array('query' => \\Drupal::destination()->getAsArray())\n )\n );\n\n drupal_set_message(new ConferenceHTML(\n iish_t('Access denied.') . '<br>' .\n iish_t('Current user ( @user ) is not a conference crew member.',\n array('@user' => LoggedInUserDetails::getUser())) . '<br>' .\n iish_t('Please @login as a crew member.',\n array('@login' => $link->toString())), TRUE\n ), 'error');\n }\n else {\n drupal_set_message(iish_t('Access denied.') . '<br>' .\n iish_t('Current user ( @user ) is not a conference crew member.',\n array('@user' => LoggedInUserDetails::getUser())), 'error');\n }\n\n return TRUE;\n }\n\n return FALSE;\n }",
"function checkSessionAll(){\r\n \tif($this->Session->check('User')){\r\n \t\t//the user is logged in, allow the wiki edit featur\r\n \t\t//the layout will know more than we do now \r\n \t\t$cuser = $this->Session->read('User');\r\n \t\tif($cuser['account_type'] == 'admin'){\r\n \t\t\t$this->set('admin_enable', true);\r\n \t\t}else{\r\n \t\t\t$this->set('admin_enable', false);\r\n \t\t}\r\n \t\t\r\n \t}else{\r\n \t\t$this->set('admin_enabled', false);\r\n \t}\r\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagicToolbox_MagicZoomPlus::magiczoomplus_settings_edit');\n }",
"public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }",
"public function canShow()\n {\n return $this->_authSession->isFirstPageAfterLogin() && $this->_getLatestItem();\n }",
"protected function _isAllowed()\n {\n return $this->_getAclHelper()->isActionAllowed($this->_aclSection);\n }",
"protected function isCurrentPageEditableByUser() {\n\n\t\t$title = $this->getTitle();\n\t\t$user = $this->getUser();\n\t\treturn $title->quickUserCan( 'edit', $user )\n\t\t\t&& ( $title->exists() || $title->quickUserCan( 'create', $user ) );\n\t}",
"public function accessibleByCurrentUser(){\n // return true if AYC user\n if(\\Auth::isSuperAdmin()) return true;\n\n // otherwise check if personally added to this\n $allowedPages = \\Auth::getAllowedPages();\n if(in_array($this->id, $allowedPages)) return true;\n\n // if not specifically added personally to this page\n // check the user group can access this page\n if($this->groupHasPermission(\\Auth::getUserLevel())) return true;\n\n // otherwise return false\n return false;\n\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }",
"public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }",
"public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }",
"public function get_update_availability()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $payload = $this->request('CheckForUpdate');\n\n if (preg_match('/' . self::CONSTANT_DO_UPDATE . 'true/i', $payload))\n return TRUE;\n else\n return FALSE;\n }",
"public function check_admin()\n {\n return current_user_can('administrator');\n }",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }",
"public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_edit' );\n\t}",
"public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}",
"private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}",
"public function is_edit_page() {\n\t\t\tglobal $current_screen;\n\n\t\t\treturn in_array( $current_screen->id, (array) $this->_meta_box['pages'] );\n\t\t}",
"public function authorize()\n {\n $user = auth()->user();\n $course = Course::find($this->input('course_id'));\n if (isset($user) && $user->can('update', $course)) {\n $class = $this->input('class');\n $ids = array_map(function ($order) {\n return $order[0];\n }, $this->input('orders'));\n switch ($class) {\n case \"Lesson\":\n return Lesson::whereIn('id', $ids)->where('course_id', '<>', $course->getKey())->doesntExist();\n case \"Topic\":\n return Topic::whereIn('id', $ids)->whereHas('lesson', function(Builder $query) use($course) {\n $query->where('course_id', $course->getKey());\n })->doesntExist();\n }\n\n return true;\n }\n\n return false;\n }",
"private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }",
"function userCanEditInterim( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 8;\r\n\t}",
"public function isHomePage()\n\t{\n\t\treturn $this->home_page;\n\t}",
"public function isAllowedToChangeTemplate() {\n \treturn ($this->settings->tpl_ajax_template_change == 2 || ($this->settings->tpl_ajax_template_change && isset($_SESSION['User'])));\t\n }",
"public function update(User $user, User $model)\n {\n if ($model->hasRole(AuthServiceProvider::SUPER)) return false;\n if ($user->hasRole(AuthServiceProvider::ADMIN)) return true;\n if ($user->hasPermissionTo('benutzer-bearbeiten')) {\n foreach ($model->homeCities as $city) {\n if ($city->administeredBy($user)) return true;\n }\n }\n return false;\n }",
"public function check_admin() {\n return current_user_can('administrator');\n }"
] | [
"0.6591029",
"0.6449361",
"0.6357467",
"0.63551825",
"0.6342069",
"0.63266003",
"0.62959164",
"0.62945354",
"0.6255443",
"0.62160176",
"0.6201601",
"0.6196519",
"0.61929685",
"0.61834997",
"0.6091546",
"0.6091546",
"0.60856473",
"0.6083612",
"0.6080879",
"0.60437894",
"0.6036964",
"0.6015918",
"0.600935",
"0.5998032",
"0.59904253",
"0.59874755",
"0.5945367",
"0.5930625",
"0.5922342",
"0.59122515",
"0.5907442",
"0.5902898",
"0.5883693",
"0.5880625",
"0.587316",
"0.5870501",
"0.58697945",
"0.5867764",
"0.58625203",
"0.58625203",
"0.58625203",
"0.58625203",
"0.58625203",
"0.58625203",
"0.58625203",
"0.58625203",
"0.58625203",
"0.5852607",
"0.58502114",
"0.5839377",
"0.5833942",
"0.58331543",
"0.58317876",
"0.5815097",
"0.5813911",
"0.58000153",
"0.5771996",
"0.5770295",
"0.5762372",
"0.57531524",
"0.57499105",
"0.57491183",
"0.5735475",
"0.57335925",
"0.57335925",
"0.57251906",
"0.57193506",
"0.5705225",
"0.5686842",
"0.56726235",
"0.56705886",
"0.5665936",
"0.566411",
"0.5661017",
"0.56588644",
"0.5648184",
"0.5641755",
"0.56370294",
"0.5630745",
"0.5628449",
"0.5622599",
"0.5622599",
"0.562244",
"0.56158906",
"0.5608055",
"0.55926585",
"0.55915433",
"0.5590224",
"0.55698806",
"0.5568361",
"0.55672187",
"0.55625254",
"0.55617666",
"0.55615515",
"0.5560741",
"0.5555471",
"0.55538327",
"0.5552174",
"0.5550507",
"0.5547054"
] | 0.65515465 | 1 |
Determine whether the user can delete the homeSection. | public function delete(User $user, HomeSection $homeSection)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}",
"function canDelete() {\n return true;\n }",
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"public function canDeletePages();",
"function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}",
"public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }",
"public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }",
"public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }",
"function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }",
"public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }",
"public function canDeleteAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && $this->auth->isSuperAdmin();\n }",
"public function canDelete()\n {\n return $this->canGet();\n }",
"private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }",
"public function canDelete()\n {\n return in_array('delete', $this->actions);\n }",
"function canDelete(User $user) {\n return $user->canManageTrash();\n }",
"public function delete(User $user, Section $section)\n {\n return $user->hasPermission('delete-reference-section');\n }",
"public function canDelete()\n {\n return 1;\n }",
"public function canDelete()\n {\n $translate = $this->getTranslate();\n\n if ($this->_usedInSales()) {\n return $translate->_('This store location cannot be removed because it is used in an invoice.');\n }\n\n return true;\n }",
"public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }",
"public function authorize()\n {\n return $this->can('delete');\n }",
"public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }",
"function userCanDeleteInterim( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 8;\r\n\t}",
"public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }",
"public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }",
"protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }",
"public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }",
"function test_restrict_deletion_of_Home_page(){}",
"function delete()\n\t{\n\t\t// DISABLED\n\t\treturn false;\n\n\t\t// always call parent delete function first!!\n\t\tif (!parent::delete())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t// put here userfolder specific stuff\n\n\t\t// always call parent delete function at the end!!\n\t\treturn true;\n\t}",
"private function can_remove() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'remove' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }",
"public function canDELETE($collection = null) {\r\n $rights = $this->getRights($collection, 'delete');\r\n return is_bool($rights) ? $rights : true;\r\n }",
"public function allowDeletion()\n {\n return $this->allowDeletion;\n }",
"public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }",
"public function isDelete();",
"function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }",
"private function deleteSection() {\n $courseID = $_POST['courseID'];\n $sectionID = $_POST['sectionID'];\n\n $this->openConn();\n\n $sql = \"DELETE FROM Section WHERE courseID= :courseID and sectionID = :sectionID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=> $courseID, ':sectionID'=> $sectionID));\n\n if($stmt === TRUE) {\n $this->closeConn();\n return true;\n }\n else {\n $this->closeConn();\n return false;\n }\n\n }",
"public function isDeleteGranted($entity): bool;",
"public function sure_delete_block(){\r\n\t\tif($this->has_admin_panel()) return $this->module_sure_delete_block();\r\n return $this->module_no_permission();\r\n\t}",
"public function canDelete($curMenuset)\n {\n $canDelete = true;\n if ($curMenuset == self::getDefaultMenuset()) {\n $canDelete = false;\n }\n \n return $canDelete;\n }",
"public function authorizedToDelete(Request $request)\n {\n return false;\n }",
"public function canDelete()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}",
"protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t return Factory::getUser()->authorise(\n\t\t\t\t\"core.delete\",\n\t\t\t\t\"com_dinning_philosophers.dinning_philosophers.\".$record->id\n\t\t\t);\n\t\t}\n\t}",
"protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }",
"function userCanDeleteContact( $sessionID, $contactID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}",
"public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }",
"function checkPermissionDelete() {\n\t\tif ($_SESSION['log_delete']!=='1'){\n\t\t\theader('Location: start.php');\n\t\t\tdie();\n\t\t}\n\t}",
"public function deleteAdmin() {\n\t\t$numRows = $this->db->delete();\n\t\tif($numRows===1) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"protected function CanDelete(Site $site)\n {\n return self::Guard()->Allow(BackendAction::Delete(), $site);\n }",
"public function delete(string $section, string $key) : bool;",
"protected function canDelete($record)\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->state != -2)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$user = JFactory::getUser();\n\t\t\t\n\t\t\treturn $user->authorise('core.delete', 'com_cooltouraman.course.' . (int) $record->id);\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function canDelete($record) { return false; }",
"protected function beforeDelete()\n\t{\n\t\tif(parent::beforeDelete()){\n\t\t\t$avaiable = $this->chkAvaiableDelete($this->id);\n\t\t\tif($avaiable!=''){\n\t\t\t\techo $avaiable;\n\t\t\t\treturn false;\n\t\t\t}else\n\t\t\t\treturn true;\n\t\t}else \n\t\t\treturn false;\n\t}",
"public function destroy(User $user, Section $section)\n {\n return $user->hasPermission('destroy-reference-section');\n }",
"abstract public function shouldIDelete();",
"public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }",
"abstract function allowDeleteAction();",
"public function sure_delete_local(){\r\n\t\tif($this->has_admin_panel()) return $this->module_sure_delete_local();\r\n return $this->module_no_permission();\r\n\t}",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }",
"public function canDelete($userId = \"\")\n {\n\n if ($userId == \"\")\n $userId = Yii::$app->user->id;\n\n if ($this->user_id == $userId)\n return true;\n\n if (Yii::$app->user->isAdmin()) {\n return true;\n }\n\n if ($this->container instanceof Space && $this->container->isAdmin($userId)) {\n return true;\n }\n\n return false;\n }",
"public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }",
"public function canDelete(ConclusionInterface $conclusion);",
"public function isDeleteResource();",
"public function isDelete(): bool {}",
"function canTrash(User $user) {\n if ($this->object->getState() == STATE_TRASHED) {\n return false;\n } // if\n\n\t $user_id = $user->getId();\n\n\t if(!array_key_exists($user_id, $this->can_delete)) {\n\t\t if($this->object->isOwner() || $user->getCompanyId() == $this->object->getId()) {\n\t\t\t $this->can_delete[$user_id] = false;\n\t\t } else {\n\t\t\t $has_last_admin = false;\n\n\t\t\t $users = $this->object->users()->get($user);\n\t\t\t if(is_foreachable($users)) {\n\t\t\t\t foreach($users as $v) {\n\t\t\t\t\t if($v->isLastAdministrator()) {\n\t\t\t\t\t\t $this->can_delete[$user_id] = false;\n\n\t\t\t\t\t\t $has_last_admin = true;\n\t\t\t\t\t\t break;\n\t\t\t\t\t } // if\n\t\t\t\t } // foreach\n\t\t\t } // if\n\n\t\t\t if(!$has_last_admin) {\n\t\t\t\t $this->can_delete[$user_id] = $user->isPeopleManager();\n\t\t\t } // if\n\t\t } // if\n\t } // if\n\n\t return $this->can_delete[$user_id];\n }",
"abstract public function isUndeleting();",
"abstract public function isUndeleting();",
"protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}",
"public function canDelete($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}",
"protected function isDeleting()\n {\n return $this->option('delete') == 'true';\n }",
"public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }",
"public function canDelete(IdentityInterface $user, sketch $sketch)\n {\n return true;\n }",
"public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }",
"function ondelete(){\n\t\tforeach($this->get_sections() as $one){\n\t\t\t$one->dbdelete();\n\t\t}\n\t\treturn true;\n\t}",
"public function canDelete($identifier = null);",
"public function delete(User $user, Poll $poll)\n {\n return $user->hasRole('editor') || $user->hasRole('admin');\n }",
"function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }",
"function userCanDeleteUser( $sessionID, $username ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}",
"protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.tariff.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tableRoomType = $this->getTable('RoomType');\n\t\t\t$tableRoomType->load($record->room_type_id);\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $tableRoomType->reservation_asset_id);\n\t\t}\n\t}",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }",
"public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }",
"public function isDeleteable()\n {\n return $this->_isDeleteable;\n }",
"public function can_delete_instance($instance) {\n $context = context_course::instance($instance->courseid);\n return has_capability('enrol/profilefield:config', $context);\n }",
"function canDelete(User $user) {\n return $user->isFinancialManager();\n }",
"protected function canDelete($record)\n {\n return true;\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('magjah_dash/dash');\n }",
"public function delete() {\n\t\tglobal $wpdb;\n\n\t\t$bp = buddypress();\n\n\t\tdo_action_ref_array( 'xprofile_data_before_delete', array( $this ) );\n\n\t\tif ( !$wpdb->query( $wpdb->prepare( \"DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d\", $this->field_id, $this->user_id ) ) )\n\t\t\treturn false;\n\n\t\tdo_action_ref_array( 'xprofile_data_after_delete', array( $this ) );\n\n\t\treturn true;\n\t}",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_MpAuction::auc_auto_bid_delete');\n }",
"public function delete(User $user, Area $area, Governorate $governorate)\n {\n return $user->isAdmin() && $governorate->is($area->governorate);\n }",
"protected function canDelete()\n {\n if (!Validate::isLoadedObject($this)) {\n return true;\n }\n\n /** @var Gamifications $module */\n $module = Module::getInstanceByName('gamifications');\n $em = $module->getEntityManager();\n\n /** @var GamificationsRewardRepository $rewardRepository */\n $rewardRepository = $em->getRepository(__CLASS__);\n $isInUse = $rewardRepository->isRewardInUse($this->id);\n\n return !$isInUse;\n }",
"public function deleteUser() {\r\n\t\tif($this->session->userdata('SISBW')['level'] === 'superAdmin') {\r\n\t\t\t$this->user->deleteUser();\r\n\t\t\tredirect('adminUser');\r\n\t\t} else {\r\n\t\t\tredirect('adminUser');\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"private function canDelete(Cinema $cinema, TokenInterface $token): bool\n {\n if (!$this->mayHallsBeDeleted($cinema, $token)) {\n return false;\n }\n\n return true;\n }",
"public function delete(): bool\n {\n return $this->actionHandler->delete();\n }",
"public function interceptDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$rows = $this->getModel()->getList();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t$topic = $this->getService('com://site/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($row->ninjaboard_topic_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $row->created_by != $user->id) {\n\t\t\t\tJError::raiseError(403, JText::_('COM_NINJABOARD_YOU_DONT_HAVE_THE_PERMISSIONS_TO_DELETE_OTHERS_TOPICS'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"public function delete(User $user, AreaPricing $area_pricing)\n {\n return $user->isAdmin() || $user->isSupervisor();\n }",
"public function delete(User $user, User $model)\n {\n if ($model->hasRole(AuthServiceProvider::SUPER)) return false;\n if ($user->hasRole(AuthServiceProvider::ADMIN) || $user->hasPermissionTo('benutzer-bearbeiten')) {\n foreach ($model->homeCities as $city) {\n if ($city->administeredBy($user)) return true;\n }\n }\n return false;\n }",
"public function delete()\n\t{\n\t\t$iQuiz = (int)$this->get('iQuiz');\n\t\t$bDeleted = Phpfox::getService('quiz.process')->deleteQuiz($iQuiz, Phpfox::getUserId());\n\n\t\tif ($bDeleted == true)\n\t\t{\n\t\t\tif ($this->get('type') == 'viewing')\n\t\t\t{\n\t\t\t\tPhpfox::addMessage(Phpfox::getPhrase('quiz.quiz_successfully_deleted'));\n\t\t\t\t\n\t\t\t\t$this->call('window.location.href = \\'' . Phpfox::getLib('url')->makeUrl('quiz') . '\\';');\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$this->call('$(\"#js_quiz_' . $iQuiz . '\").hide(\"slow\", function(){$(\"#js_quiz_' . $iQuiz . '\").remove();});')\n\t\t\t\t\t->call('$Core.quiz_moderate.decreaseCounters();');\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->alert(Phpfox::getPhrase('quiz.your_membership_does_not_allow_you_to_delete_this_quiz'));\n\t\t}\n\t\treturn false;\n\t}",
"public function isDelete() {\n if($this->method === 'DELETE') {\n return true;\n } else {\n return false;\n }\n }"
] | [
"0.7144526",
"0.6601688",
"0.6566402",
"0.65225285",
"0.65159494",
"0.64713407",
"0.64658165",
"0.6396663",
"0.63796335",
"0.63678294",
"0.63438267",
"0.63352984",
"0.6299225",
"0.6288657",
"0.62610406",
"0.6225199",
"0.62093264",
"0.6184597",
"0.6183365",
"0.6183202",
"0.6168484",
"0.61494565",
"0.6142658",
"0.61390245",
"0.61028224",
"0.60919684",
"0.6064394",
"0.60626155",
"0.60573477",
"0.605393",
"0.6015044",
"0.60040957",
"0.6002692",
"0.59987885",
"0.5983308",
"0.59792376",
"0.5970124",
"0.5923842",
"0.5912208",
"0.5907857",
"0.58893603",
"0.5880569",
"0.58751786",
"0.5861353",
"0.58602995",
"0.58546937",
"0.5848168",
"0.58321965",
"0.5830447",
"0.57970905",
"0.5785439",
"0.57728344",
"0.5771849",
"0.5771015",
"0.5769124",
"0.576844",
"0.57527614",
"0.57344884",
"0.5710059",
"0.569961",
"0.56987256",
"0.569601",
"0.5685899",
"0.5677251",
"0.5674973",
"0.5660442",
"0.5659104",
"0.5659104",
"0.5631168",
"0.56299037",
"0.5622145",
"0.5621045",
"0.5615602",
"0.5615075",
"0.5608429",
"0.5606225",
"0.5603595",
"0.55890775",
"0.5584852",
"0.5582299",
"0.5579443",
"0.5576582",
"0.55753493",
"0.55681765",
"0.5564535",
"0.5557587",
"0.5552289",
"0.55463815",
"0.55399746",
"0.5537516",
"0.5524257",
"0.55205053",
"0.55179304",
"0.55137956",
"0.5511621",
"0.55092305",
"0.54941696",
"0.5493995",
"0.5485502",
"0.54793316"
] | 0.6353949 | 10 |
constructor with $db as database connection | public function __construct($db){
$this->conn = $db;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct($db) {\n $this->db = $db;\n }",
"function __construct($db) {\r\n\t\t$this->db = $db;\r\n\t}",
"public function __construct($db) {\r\n\r\n $this->conn = $db;\r\n\r\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db) {\r\n $this->conn = $db;\r\n }",
"public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }",
"public function __construct($db) \n\t{\n\t\t$this->db = $db->getConn(); \n\t}",
"public function __construct($db) {\n $this->db = $db;\n }",
"public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->_db = $db;\n }",
"public function __construct(&$db) {\n $this->db = $db;\n }",
"public function __construct(&$db) {\n $this->db = $db;\n }",
"public function __construct(&$db) {\n $this->db = $db;\n }",
"public function __construct($db) {\n\t\t\t$this->conn = $db;\n\t\t}",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n\t{\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db) {\n\t\t$this->db = $db;\n\t}",
"public function __construct($db) {\n $this->_db = $db;\n }",
"public function __construct($db) {\n $this->_db = $db;\n }",
"public function __construct($db)\n {\n $this->db = $db;\n }",
"public function __construct($db)\n {\n $this->db = $db;\n }",
"public function __construct($db)\n {\n $this->db = $db;\n }",
"public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct(&$db)\r\n {\r\n $this->_db = $db;\r\n }",
"public function __construct($db){\r\n $this->db = $db;\r\n }",
"public function __construct($db=null)\n {\n $this->db = $db;\n }",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"function __construct($db) {\n\t\t\n\t\t// set db object to given db object\n\t\t$this->db = $db;\n\t\t\n\t}",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n\t\t\t$this->conn = $db;\n\t\t}",
"public function __construct($db){\n\t\t\t$this->conn = $db;\n\t\t}",
"public function __construct($db){\n $this->conn = $db;\n \n }",
"public function __construct($db){\n $this->conn = $db;\n \t}",
"public function __construct($db){\n $this->conn = $db;\n \t}",
"public function __construct($db){\r\n \t$this->conn = $db;\r\n }",
"public function __construct($db) {\n\t\t\t$this->myDB = $db;\n\t\t}",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n $this->conn = $db;\n }"
] | [
"0.887094",
"0.8836854",
"0.8794315",
"0.8782656",
"0.8782656",
"0.87762517",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8766189",
"0.87605137",
"0.87567043",
"0.87561655",
"0.87505203",
"0.87446517",
"0.87446517",
"0.87446517",
"0.87418157",
"0.87323743",
"0.87323743",
"0.87323743",
"0.87268746",
"0.8717069",
"0.8717069",
"0.8717069",
"0.8711909",
"0.87075186",
"0.8702426",
"0.87023294",
"0.8700695",
"0.8700695",
"0.86997926",
"0.8695736",
"0.8695736",
"0.8693924",
"0.86638135",
"0.8661487",
"0.86138576",
"0.86036575",
"0.8598794",
"0.8598794",
"0.8598794",
"0.8598794",
"0.85930413",
"0.8577493",
"0.8576936",
"0.8576936",
"0.8568375",
"0.8566628",
"0.8566628",
"0.8555083",
"0.8549572",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204",
"0.85491204"
] | 0.0 | -1 |
Returns the last ZaloRequest that was sent. Useful for debugging and testing. | public function getLastRequest()
{
return $this->lastRequest;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLastRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getLastRequest() {\n\t\treturn $this->_lastRequest;\n\t}",
"public function getLastRequest() {\n\t\treturn $this->lastRequest;\n\t}",
"public function getLastRequest()\n {\n return $this->api->getRequest();\n }",
"public function lastRequest()\n\t{\n\t\treturn $this->_source->lastRequest();\n\t}",
"public function getLastRequest()\n {\n return $this->__getLastRequest();\n }",
"public function getLastRequest()\n {\n $last = end($this->transactions);\n\n return $last['request'];\n }",
"public function get_last_request(){\n\t\treturn $this->request_data;\n\t}",
"public function __getLastRequest()\n {\n return $this->lastRequest;\n }",
"public function getLastRequestDetails(){\n return $this->lastRequest;\n }",
"public function getRequest()\n {\n return $this->riak->getLastRequest();\n }",
"public function getRequest()\n {\n return $this->riak->getLastRequest();\n }",
"public function getMostRecentRequest() {\n return array_slice($this->statusRequests, -1)[0];\n }",
"public function getRequest() {\n return $this->client->getLastRequest();\n }",
"public function __getLastRequest() {\n\t\tif(!$this->debug) {\n\t\t\ttrigger_error(\"debugging functions not available unless debug is set to true\", E_USER_WARNING);\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->soap->__getLastRequest();\n\t}",
"public function getRequest()\n {\n if (null === $this->lastRequest) {\n $this->lastRequest = $this->requestStack->getMasterRequest();\n }\n\n\n return $this->lastRequest;\n }",
"public function get_last_url_request() {\n\t\treturn $this->_last_url_request;\n\t}",
"public function getRequestInfo() {\n\t\treturn $this->_lastInfo;\n\t}",
"public function lastProbeRequest() {\n return $this->probe_requests()\n ->orderBy('ts', 'desc')\n ->first();\n }",
"public function getRequestFormatted()\n {\n if($client = $this->getClient()) {\n return $client->getLastRequest();\n }\n\n return null;\n }",
"public function getLastRequestURL()\n {\n return $this->requestUrl;\n \n }",
"function get_http_request() {\n\n return $this->last_request;\n\n}",
"public function getLastRequestId()\n\t{\n\t\treturn $this->_lastRequestId;\n\t}",
"public static function getLastRequestUri()\n {\n return self::$lastRequestUri;\n }",
"public function getLastRequestUri()\n\t{\n\t\treturn $this->_lastRequestUri;\n\t}",
"public function lastResponse()\n\t{\n\t\treturn $this->_source->lastResponse();\n\t}",
"public function getLastRequestUri()\n {\n return $this->_lastRequestUri;\n }",
"public function getLastResponse() {\n\t\treturn $this -> data['lastResponse'];\n\t}",
"public function getCurrentRequest()\n\t\t{\n\t\t\treturn $this->currentRequest;\n\t\t}",
"public function getLastRequestKey()\n {\n return $this->_lastRequestKey;\n }",
"public function getLastResponse() {\n\t\treturn $this->lastResponse;\n\t}",
"public function getLastResponse() {\n\t\treturn $this->lastResponse;\n\t}",
"public function getLastResponse() {\n\t\treturn $this->_lastResponse;\n\t}",
"public function getLastResponse() {\n\t\treturn $this->_lastResponse;\n\t}",
"public function get_last_response(){\n\t\treturn $this->response_data;\n\t}",
"public function getLastResponse()\n\t{\n\t\treturn $this->response;\n\t}",
"function last_response() {\n\t\treturn $this->last_response;\n\t}",
"public function get_last_request_sent_to_ist(){\n $last_served_ist = $this->login_model->get_last_request_sent_to();\n return $last_served_ist;\n }",
"public function getLastResponse()\n {\n return $this->__getLastResponse();\n }",
"public function getLastResponse()\n {\n return $this->lastResponse;\n }",
"public function getLastResponse()\n {\n return $this->lastResponse;\n }",
"public function getLastResponse()\n {\n return $this->lastResponse;\n }",
"function getRequest() {\n\t\treturn $this->m_request;\n\t}",
"public function getLastResponse()\n\t{\n\t\treturn $this->__getLastResponse();\n\t}",
"public function request() {\n return $this->requestStack->getCurrentRequest();\n }",
"public function GetLastRequestStatus() { return self::$status; }",
"function getRequest()\n {\n return $this->current_request;\n }",
"public function getRequestLog()\n {\n return $this->requestLog;\n }",
"public function getLastResponse()\n {\n return $this->last_response;\n }",
"public function getLastResponse()\n {\n return $this->last_response;\n }",
"public function getCurrentRequest()\n {\n return $this->container['request'];\n }",
"public function get_request()\n\t{\n\t\treturn $this->request;\n\t}",
"public function get_request()\n\t{\n\t\treturn $this->request;\n\t}",
"public function __getLastResponse()\n {\n return $this->lastResponse;\n }",
"public function getLastResponse() {}",
"public static function popRequest()\n {\n $removed = array_pop(static::$_requests);\n $last = end(static::$_requests);\n if ($last) {\n static::setRequestContext($last);\n reset(static::$_requests);\n }\n\n return $removed;\n }",
"function getRequest() {\n\t\treturn $this->Request;\n\t}",
"public function getRequest()\n {\n return $this->data->request;\n }",
"public function getLastResponse()\n {\n return null;\n }",
"public function request()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getRequest() {\n return $this->Request;\n }",
"public function request()\r\n {\r\n return $this->request;\r\n }",
"public function request()\n {\n return $this->request;\n }",
"public function request()\n {\n return $this->request;\n }",
"public function getNextRequest()\n\t\t{\n\t\t\treturn $this->nextRequest;\n\t\t}",
"public function getResponse()\n {\n return $this->lastResponse;\n }",
"public function getRequest() {\n return $this->_request;\n }",
"protected function getRequest() {\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n {\n return $this->_request;\n }",
"public function getRequest()\n {\n return $this->_request;\n }",
"public function getRequest() {\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"protected function getCurrentRequest() {\n return \\Drupal::request();\n }",
"public function getRequest()\n {\n return $this->get(self::_REQUEST);\n }",
"public function lastResponse(): Response\n\t{\n\t\treturn $this->lastResponse;\n\t}",
"public function getRequest()\r\n {\r\n return Mage::registry('current_request');\r\n }",
"private function getRequest()\n {\n if ($this->request === null) {\n $this->request = $this->container->get('request_stack')->getCurrentRequest();\n }\n return $this->request;\n }",
"public function getRequest() {\r\n\t\treturn $this->context->getState('request');\r\n\t}",
"public function getLastRequestHeaders()\n {\n return $this->__getLastRequestHeaders();\n }",
"function getRequest() {\n return $this->request;\n }",
"protected function getRequest() {\n return $this->request;\n }",
"public function getRequest() {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->get('request');\n }",
"public function getRequest()\n {\n return $this->get('request');\n }",
"public function getRequest()\n {\n return $this->get('request');\n }",
"public function getRequest()\n {\n return $this->get('request');\n }",
"public function getLastParsedResponse()\n\t{\n\t\treturn $this->_lastParsedResponse;\n\t}",
"public function getLastReply()\n {\n return $this->last_reply;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }"
] | [
"0.83514535",
"0.8264668",
"0.8244768",
"0.82447493",
"0.81521535",
"0.8120553",
"0.8098079",
"0.80263853",
"0.7826246",
"0.772541",
"0.7668181",
"0.7668181",
"0.7569289",
"0.7482106",
"0.7479831",
"0.7414334",
"0.73830605",
"0.7339468",
"0.717909",
"0.70524704",
"0.6957466",
"0.6951323",
"0.68137306",
"0.68080074",
"0.6785731",
"0.67287284",
"0.672817",
"0.6700961",
"0.6696719",
"0.6673073",
"0.66516817",
"0.66516817",
"0.6643211",
"0.6643211",
"0.66348225",
"0.6619552",
"0.6615015",
"0.6546031",
"0.65427786",
"0.65033925",
"0.65033925",
"0.65033925",
"0.64956397",
"0.6491627",
"0.6490461",
"0.6486506",
"0.6474025",
"0.6453871",
"0.6450987",
"0.6450987",
"0.64191955",
"0.63875324",
"0.63875324",
"0.6353495",
"0.6321118",
"0.63188714",
"0.63115644",
"0.63046986",
"0.6294563",
"0.6287307",
"0.6247792",
"0.6235401",
"0.6220881",
"0.6220881",
"0.6220367",
"0.6208552",
"0.6170577",
"0.61657923",
"0.6162702",
"0.6162702",
"0.61619544",
"0.61573726",
"0.61573726",
"0.61573726",
"0.6118234",
"0.6115081",
"0.6104364",
"0.61033887",
"0.6094414",
"0.60842186",
"0.6076252",
"0.60687876",
"0.6067885",
"0.6066983",
"0.60664904",
"0.60664904",
"0.60664904",
"0.60664904",
"0.60532105",
"0.60531574",
"0.6051049",
"0.6051049",
"0.6051049",
"0.6051049",
"0.6051049",
"0.6051049",
"0.6051049",
"0.6051049",
"0.6051049"
] | 0.8119629 | 7 |
Generates an authorization URL to begin the process of authenticating a user. | public function getAuthorizationUrlByUser($redirectUrl, $codeChallenge, $state, $separator = '&')
{
$params = [
'app_id' => $this->app->getId(),
'redirect_uri' => $redirectUrl,
'code_challenge' => $codeChallenge,
'state' => $state
];
return static::BASE_AUTHORIZATION_URL . '/' . static::DEFAULT_OAUTH_VERSION . '/permission?' . http_build_query($params, null, $separator);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}",
"public function get_user_authorization_url()\n\t{\n\t\tif ($this->auth_oauth_response != SPOAuthClient::OAUTH_USER_AUTH || !$this->oauth_token)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn $this->auth_url_userauth . (strpos($this->auth_url_userauth, \"?\") === false ? \"?oauth_token=\" : \"&oauth_token=\") . rawurlencode($this->oauth_token);\n\t}",
"public function urlAuthorize() {\n return $this->host . '/oauth/authorize';\n }",
"public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}",
"public function getUserAuthorizationUrl()\n {\n return $this->getAuthorizeUrl();\n }",
"abstract protected function auth_url();",
"public function urlAuthorize() {\n return $this->api_location.\"/authorize\";\n }",
"public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}",
"public function getAuthorizationUrl()\n {\n return sprintf($this->_endpointUrls['authorize'],\n $this->_config['client_id'],\n $this->_config['redirect_uri'],\n self::RESPONSE_CODE_PARAM);\n }",
"public function urlAuthorization()\n {\n return 'https://api.twitter.com/oauth/authenticate';\n }",
"public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}",
"public function authorize()\n\t{\n\t\t $args = phpSmug::processArgs( func_get_args() );\n\t\t $perms = ( array_key_exists( 'Permissions', $args ) ) ? $args['Permissions'] : 'Public';\n\t\t $access = ( array_key_exists( 'Access', $args ) ) ? $args['Access'] : 'Read';\n \t\t return \"https://secure.smugmug.com/services/oauth/authorize.mg?Access=$access&Permissions=$perms&oauth_token={$this->oauth_token}\";\n\t }",
"public function getBaseAuthorizationUrl()\n {\n return $this->domain() . '/oauth/authorize';\n }",
"public function urlOfAuthorizePage()\n {\n return sprintf(\n '%s/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code',\n $this->root,\n $this->client_id,\n $this->redirect_uri\n );\n }",
"public function urlOfAuthorizePage()\n {\n return sprintf(\n '%s/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code',\n $this->root,\n $this->client_id,\n $this->redirect_uri\n );\n }",
"public function openAuthorizationUrl()\n {\n header('Location: ' . $this->getAuthorizationUrl());\n exit(1);\n }",
"public function _getAuthorizationUrl()\n {\n // Generate new authorization url\n $helper = $this->_getProvider()->getRedirectLoginHelper();\n $permissions = ['email', 'public_profile'];\n return $helper->getLoginUrl(APP_URL.'/app/modules/coinstackapp-facebookoauth/src/actions/callback.php', $permissions);\n }",
"public function getBaseAuthorizationUrl(): string\n {\n return $this->domain . '/id/authorize';\n }",
"public function getAuthUrl()\n\t{\n\t\treturn $this->createAuthUrl();\n\t}",
"protected function _getAuthUrl()\n {\n\t\t$url = CS_REST_General::authorize_url(\n\t\t\t$this->_getClientId(),\n\t\t\t$this->_getAuthRedirectUri(),\n\t\t\t'ImportSubscribers,ManageLists'\n\t\t);\n\t\t\n return $url;\n }",
"public function getAuthUrl();",
"public function getAuthorizationURL()\n {\n return $this->get('AuthorizationURL');\n }",
"public function getBaseAuthorizationUrl()\n {\n return $this->getHost().'/oauth2/authorize';\n }",
"public function authenticationURL()\n {\n $clientId = config('twitch-api.client_id');\n $scopes = implode('+', config('twitch-api.scopes'));\n $redirectURL = config('twitch-api.redirect_url');\n return config('twitch-api.api_url') . '/kraken/oauth2/authorize?api_version=5&response_type=code&client_id=' . $clientId . '&redirect_uri=' . $redirectURL . '&scope=' . $scopes;\n }",
"public function getAuthUrl()\n {\n return $this->client->createAuthUrl();\n }",
"public function getAuthorizationUrl()\n {\n // Check for required items\n if (!$this->clientId) {\n throw new Exception('Client ID is required');\n }\n if (!$this->scope) {\n throw new Exception('Scope is required');\n }\n if (!$this->redirectUri) {\n throw new Exception('Redirect URI is required');\n }\n\n // Start building url (enpoint is the same for public and member APIs)\n $url = 'https://';\n $url .= (!empty($this->environment)) ? $this->environment . '.' : '';\n $url .= self::HOSTNAME . '/' . self::AUTHORIZE;\n $url .= '?client_id=' . $this->clientId;\n $url .= '&scope=' . $this->scope;\n $url .= '&redirect_uri=' . urlencode($this->redirectUri);\n $url .= '&response_type=code';\n\n // Process non-required fields\n $url .= ($this->showLogin) ? '&show_login=true' : '';\n $url .= (isset($this->state)) ? '&state=' . $this->state : '';\n $url .= (isset($this->familyNames)) ? '&family_names=' . $this->familyNames : '';\n $url .= (isset($this->givenNames)) ? '&given_names=' . $this->givenNames : '';\n $url .= (isset($this->email)) ? '&email=' . urlencode($this->email) : '';\n\n return $url;\n }",
"public function getBaseAuthorizationUrl()\n {\n return $this->webUrl . '/oauth/authorize';\n }",
"public function authenticateUri()\n {\n $args = array(\n 'client_id' => $this->_clientId,\n 'client_secret' => $this->_clientSecret,\n 'response_type' => 'code',\n 'redirect_url' => $this->_redirectUri,\n );\n\n return 'https://untappd.com/oauth/authenticate/?' . http_build_query($args);\n }",
"public function getAuthorisationLink()\n {\n\n $authorisationLink = $this->urlAuthorize();\n $authorisationLink .= '?client_id=' . $this->clientId;\n $authorisationLink .= '&response_type=code';\n $authorisationLink .= '&redirect_uri=' . $this->redirectUri;\n $authorisationLink .= '&approval_prompt=' .$this->aprovalPrompt;\n $scopes = str_replace(' ', '',implode(', ', $this->scopes));\n $authorisationLink .= '&scope=' . $scopes;\n\n return $authorisationLink;\n }",
"private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }",
"abstract public function getAuthorizeUrl(): string;",
"public function getBaseAuthorizationUrl()\n {\n return 'https://acesso.dgp.eb.mil.br/authorize';\n }",
"public function getBaseAuthorizationUrl()\n {\n return 'https://redbooth.com/oauth2/authorize';\n }",
"public function getAuthorizationURL() {\n\t\treturn $this->selectedEndpoint['authorization_url'];\n\t}",
"public function generateAuthCodeURL(string $scope, string $userDefinedState = \"state\") : string\n {\n if ($this->isUserPassState($userDefinedState)) {\n $this->setState($userDefinedState);\n } else {\n $this->generateStateIfNotSet();\n }\n $this->setScope($scope);\n\n return $this->getDiscoveryURLs()->getAuthorizationEndpointUrl() .\n \"?\" . $this->generateQueryParemeterStringForAuthorizationCodeURL();\n }",
"abstract public function url_authorize();",
"public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }",
"public function createUrl()\n\t{\n\t\tif (!$this->getOption('authurl') || !$this->getOption('clientid'))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Authorization URL and client_id are required');\n\t\t}\n\n\t\t$url = $this->getOption('authurl');\n\n\t\tif (strpos($url, '?'))\n\t\t{\n\t\t\t$url .= '&';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url .= '?';\n\t\t}\n\n\t\t$url .= 'response_type=code';\n\t\t$url .= '&client_id=' . urlencode($this->getOption('clientid'));\n\n\t\tif ($this->getOption('redirecturi'))\n\t\t{\n\t\t\t$url .= '&redirect_uri=' . urlencode($this->getOption('redirecturi'));\n\t\t}\n\n\t\tif ($this->getOption('scope'))\n\t\t{\n\t\t\t$scope = is_array($this->getOption('scope')) ? implode(' ', $this->getOption('scope')) : $this->getOption('scope');\n\t\t\t$url .= '&scope=' . urlencode($scope);\n\t\t}\n\n\t\tif ($this->getOption('state'))\n\t\t{\n\t\t\t$url .= '&state=' . urlencode($this->getOption('state'));\n\t\t}\n\n\t\tif (is_array($this->getOption('requestparams')))\n\t\t{\n\t\t\tforeach ($this->getOption('requestparams') as $key => $value)\n\t\t\t{\n\t\t\t\t$url .= '&' . $key . '=' . urlencode($value);\n\t\t\t}\n\t\t}\n\n\t\treturn $url;\n\t}",
"function genAuthURL($perms)\n\t{\n\t\t$args['perms'] = $perms;\n\t\t$api_sig = md5($this->api_sig(false,$args));\n\t\treturn 'http://www.rememberthemilk.com/services/auth/?api_key='.$this->apikey.'&perms='.$perms.'&api_sig='.$api_sig;\n\t}",
"public function getAuthorizationUrl(): string\n {\n // urlAuthorize option and generates and applies any necessary parameters\n // (e.g. state).\n $authorizationUrl = $this->provider->getAuthorizationUrl([\n // Optional, only use this if you want to ask for scopes the user previously denied.\n 'approval_prompt' => 'force',\n // Optional, a list of scopes. Defaults to only 'organizations.read'.\n 'scope' => [\n Mollie::SCOPE_PAYMENTS_READ,\n Mollie::SCOPE_PAYMENTS_WRITE,\n Mollie::SCOPE_REFUNDS_READ,\n Mollie::SCOPE_REFUNDS_WRITE,\n Mollie::SCOPE_CUSTOMERS_READ,\n Mollie::SCOPE_CUSTOMERS_WRITE,\n Mollie::SCOPE_MANDATES_READ,\n Mollie::SCOPE_MANDATES_WRITE,\n Mollie::SCOPE_SUBSCRIPTIONS_READ,\n Mollie::SCOPE_SUBSCRIPTIONS_WRITE,\n Mollie::SCOPE_PROFILES_READ,\n Mollie::SCOPE_PROFILES_WRITE,\n Mollie::SCOPE_INVOICES_READ,\n Mollie::SCOPE_SETTLEMENTS_READ,\n Mollie::SCOPE_ORDERS_READ,\n Mollie::SCOPE_ORDERS_WRITE,\n Mollie::SCOPE_SHIPMENTS_READ,\n Mollie::SCOPE_SHIPMENTS_WRITE,\n Mollie::SCOPE_ORGANIZATIONS_READ,\n Mollie::SCOPE_ORGANIZATIONS_WRITE,\n Mollie::SCOPE_ONBOARDING_READ,\n Mollie::SCOPE_ONBOARDING_WRITE,\n ],\n ]);\n\n return $authorizationUrl;\n }",
"public function buildAuthUrl($user_id)\n {\n return $this->getClient()->buildAuthUrl([\n 'redirect_uri' => $this->buildRedirectUri(),\n 'user_id' => $user_id,\n ]);\n }",
"public function generateAuthUrl(Request $request)\n {\n return $this->setCurrentBankInSession($request, 'monzo')->authorizer->generateAuthUrl('https://auth.monzo.com/');\n }",
"public function getBaseAuthorizationUrl()\n {\n return 'https://app.intercom.io/oauth';\n }",
"public function getAuthorizationUri()\n {\n $url = \"https://twinoid.com/oauth/auth?response_type=code&client_id=\".$this->_clientId.\"&redirect_uri=\".$this->_redirectUri.\"&state=connexion\";\n if ($this->_scope)\n {\n $url .= \"&scope=\" . $this->_scope;\n }\n return $url;\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase('https://auth.kodular.io/oska/authorize', $state);\n }",
"public function getAuthorizationUrl(ServerRequest $request);",
"public function actionAuthLink() {\n $localAt = gp('localAt');\n if ($localAt) {\n $s = Yii::$app->getSession();\n $s->set('localAt', $localAt);\n $s->set('linkRequestTs', time());\n $direction = ['site/auth'] + ['authclient' => gp('authclient')];\n $this->redirect($direction);\n } else {\n throw new \\yii\\web\\NotFoundHttpException();\n }\n\n }",
"public function authLink() {\n return $this->direct();\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase($this->baseUrl.'/oauth2.0/authorize', $state);\n }",
"public function get_authorize_url()\n\t{\n\t\t$params = array(\n\t\t\t'client_id' => $this->client_id,\n\t\t\t'scope' => $this->scope,\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->redirect_uri,\n\t\t);\n\n\t\t// Authentication request\n\t\t$authorize_url = 'https://api.instagram.com/oauth/authorize';\n\t\treturn \"{$authorize_url}?\" . http_build_query($params);\n\t}",
"public function getAuthorizationUrl(array $options = []) {\n\t\t// than in this options array,\n\t\t$options['state'] = $this->getState();\n\n\t\tif(!empty($this->scopes)) {\n\t\t\t$options['scope'] = $this->scopes;\n\t\t}\n\n\t\treturn parent::getAuthorizationUrl($options);\n\n\t}",
"public function getBaseAuthorizationUrl()\n {\n return \"https://$this->dataCenter.adobesign.com/public/oauth\";\n }",
"public function authorize() {\n\t\ttry {\n\t\t\t$authenticationStatus = $this->OAuth2Lib->checkUserCredentials(\n\t\t\t\t\t\t\t\t\t\t$this->data['client_id'], \n\t\t\t\t\t\t\t\t\t\t$this->data['username'], \n\t\t\t\t\t\t\t\t\t\t$this->data['password']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\n\t\t\t$this->OAuth2Lib->finishClientAuthorization(\n\t\t\t\t(boolean) $authenticationStatus,\n\t\t\t\tarray(\n\t\t\t\t\t'response_type' => $this->data['response_type'],\n\t\t\t\t\t'client_id' => $this->data['client_id'],\n\t\t\t\t\t'redirect_uri' => $this->data['redirect_uri'],\n\t\t\t\t\t'state' => $this->data['state'],\n\t\t\t\t\t'scope' => $this->data['scope'],\n\t\t\t\t\t'username' => $this->data['username']\n\t\t\t\t)\n\t\t\t);\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}",
"public function getAuthorizationUri() : string\r\n {\r\n return $this->authorization_uri;\r\n }",
"public function getAuthorization(): string\n {\n return self::PREFIX . base64_encode($this->username . ':' . $this->password);\n }",
"public function getAuthorizeUrl() {\n return 'https://api.instagram.com/oauth/authorize?client_id='.$this->getClientID().'&redirect_uri='.$this->getRedirectUri().'&response_type='.$this->getResponseType();\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase(\n 'https://login.eveonline.com/oauth/authorize', $state\n );\n }",
"public function createAuthUrl($clientId = '')\n {\n $query = [\n 'client_id' => $clientId == '' ? $this->getClientId() : $this->clientId,\n 'redirect_uri' => $this->getRedirectUri(),\n 'scope' => implode(' ', $this->getScope()),\n 'response_type' => \"code\"\n ];\n $url = $this->oauth2_auth_uri . '?' . http_build_query($query);\n\n return $url;\n }",
"public function getBaseAuthorizationUrl()\n {\n return \"https://api.weibo.com/oauth2/authorize\";\n }",
"public function getLoginUrl()\n\t{\n\t\treturn \"$this->authorizationBaseUrl?client_id=$this->clientId&redirect_uri=$this->redirectUri&scope=$this->scope\";\n\t}",
"public function createAuthUrl(array $scope) {\n $params= array(\n 'response_type=code',\n 'redirect_uri='.urlencode($this->redirectUri),\n 'client_id='.urlencode($this->clientId),\n 'scope='.urlencode(implode(' ', $scope)),\n 'access_type='.urlencode($this->accessType),\n 'approval_prompt='.urlencode($this->approvalPrompt)\n );\n\n if (isset($this->state)) {\n $params[]= 'state='.urlencode($this->state);\n }\n\n return $this->provider->getOauthUrl().'?'.implode('&', $params);\n }",
"abstract protected function getAuthUrl($state);",
"public function getAuthorizeUrl()\n {\n if (! $this->authorizeUrl && $this->siteUrl) {\n return rtrim($this->siteUrl, '/') . '/authorize';\n }\n return $this->authorizeUrl;\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase('https://open.weixin.qq.com/connect/oauth2/authorize', $state);\n }",
"public function authorize()\n\t{\n\t\t$state = md5(uniqid(rand(), TRUE));\n\t\t$this->oauth->ci->session->set_userdata('state', $state);\n\t\t\t\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'state' => $state,\n\t\t\t'scope' => 'email'\n\t\t);\n\t\t\n\t\t$url = $this->_authorize_endpoint.http_build_query($params);\n\t\tredirect($url);\n\t}",
"public function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase($this->withStoreName('admin/user/auth'), $state);\n }",
"public function authUrl(Request $request)\n {\n return redirect($this->generateAuthUrl($request));\n }",
"public function getAuthUrl()\n {\n $return = $this->baseUrl .\n '/' . $this->authNamespace .\n '/' . $this->authVersion .\n '/token?url=' . $this->baseUrl . '/' . $this->apiNamespace;\n\n return $return;\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase('https://bitbucket.org/site/oauth2/authorize', $state);\n }",
"protected function authorize() {\r\n\t\t$authurl = $this->tmhOAuth->url(\"oauth/authorize\", '') . \"?oauth_token={$_SESSION['oauth']['oauth_token']}\";\r\n\t\theader(\"Location: \".$authurl);\r\n\t\texit;\r\n\r\n\t\t// in case the redirect doesn't fire\r\n\t\t$this->addMsg('<p>To complete the OAuth flow please visit URL: <a href=\"' . $authurl . '\">' . $authurl . '</a></p>');\r\n\t}",
"protected function buildAuthorizeUrl($prompt, $returnTo=null) {\n global $base_root;\n\n $auth0Api = new Authentication($this->domain, $this->client_id);\n\n $response_type = 'code';\n $redirect_uri = \"$base_root/auth0/callback\";\n $connection = null;\n $state = $this->getNonce($returnTo);\n $additional_params = [];\n $additional_params['scope'] = AUTH0_DEFAULT_SCOPES;\n if ($this->offlineAccess) $additional_params['scope'] .= ' offline_access';\n if ($prompt) $additional_params['prompt'] = $prompt;\n\n return $auth0Api->get_authorize_link($response_type, $redirect_uri, $connection, $state, $additional_params);\n }",
"abstract public function getAuthUri(): string;",
"function authenticateURL() { return 'http://www.tumblr.com/oauth/authorize'; }",
"public function getAuthorizeUrl()\n {\n return Mage::helper('adminhtml')->getUrl('adminhtml/mautic/authorize');\n }",
"public function authorize();",
"public function authorize();",
"public function getAuthUrl()\n {\n return $this->authUrl;\n }",
"public function getAuthUrl()\n {\n return $this->authUrl;\n }",
"protected function _generateOpauthCompleteUrl()\n {\n $url = Configure::read('Opauth.complete_url');\n if (!is_array($url)) {\n $url = Router::parse($url);\n }\n $url['?'] = ['social' => $this->request->query('code')];\n return Router::url($url, true);\n }",
"public function authorization_url()\n {\n // Arrange\n $service = new ServiceImplementation();\n\n // Act\n $authorizationUrl = $service->authorizationUrl();\n\n // Assert\n $this->assertEquals('https://service.com/oauth/dialog', $authorizationUrl);\n }",
"abstract public function authorize();",
"abstract public function authorize();",
"public function get_auth_url()\r\n\t{\r\n\t\treturn PicasaAPI::$QUERY_URLS['auth'];\r\n\t}",
"public function authorize_url($options) {\n\n if (!isset($options['redirect_uri'])) {\n throw new GoCardless_ArgumentsException('redirect_uri required');\n }\n\n $endpoint = '/oauth/authorize';\n\n $url = GoCardless_Client::$base_url . $endpoint .\n '?client_id='. urlencode($this->account_details['app_id']) .\n '&redirect_uri=' . urlencode($options['redirect_uri']) .\n '&scope=manage_merchant' .\n '&response_type=code';\n\n return $url;\n\n }",
"protected function getAuthUrl($state): string\n {\n return $this->buildAuthUrlFromBase($this->getAuthorizeUrl(), $state);\n }",
"public function authorize() {\r\n\t\t\r\n\t\t$user_id = $this->Session->read('Auth.' . $this->authorizeActionSettings['userIdKey']);\r\n\t\tif (empty($user_id)) {\r\n\t\t\t$this->Session->write('Auth.redirect', Router::reverse($this->request));\r\n\t\t\treturn $this->redirect($this->authorizeActionSettings['loginUrl'], 401);\r\n\t\t}\r\n\t\t\r\n\t\t$client_data = $this->OAuth2->validateAuthorizeRequest();\r\n\t\t\r\n\t\tif (empty($client_data)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$api_key = $client_data['client_id'];\r\n\t\t\r\n\t\t$post_scope = !empty($this->request->data['scope']) ? $this->request->data['scope'] : null;\r\n\t\t$get_scope = !empty($this->request->query['scope']) ? $this->request->query['scope'] : null;\r\n\t\t$scope = !empty($post_scope) ? $post_scope : $get_scope;\r\n\t\t\r\n\t\tif (!isset($this->OAuth2Authorization)) {\r\n\t\t\t$this->loadModel('OAuth2.OAuth2Authorization');\r\n\t\t}\r\n\t\t\r\n\t\t$existing_authorization = $this->OAuth2Authorization->getExisting(\r\n\t\t\t$api_key,\r\n\t\t\t$user_id,\r\n\t\t\t$scope\r\n\t\t);\r\n\t\t\t\r\n\t\t$show_permissions_page = false;\r\n\t\tif (empty($existing_authorization) && $this->request->is('get')) {\r\n\t\t\t$show_permissions_page = true;\r\n\t\t}\r\n\t\t\r\n\t\t$proceed_with_authorization = false;\r\n\t\tif (!empty($existing_authorization) || $this->request->is('post')){\r\n\t\t\t$proceed_with_authorization = true;\r\n\t\t}\r\n\t\t\r\n\t\tif ($show_permissions_page) {\r\n\t\t\r\n\t\t\t$this->set('client', $client_data);\r\n\t\t\t\r\n\t\t} elseif ($proceed_with_authorization) {\r\n\t\t\t\r\n\t\t\t$allow = false;\r\n\t\t\tif (!empty($existing_authorization) || !empty($this->request->data['allow'])) {\r\n\t\t\t\t$allow = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$response = $this->OAuth2->handleAuthorizeRequest($allow, $user_id);\r\n\t\t\t\r\n\t\t\tif (empty($response)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->redirect($response->getHttpHeader('Location'), $response->getStatusCode());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"public static function build_oauth_url() {\n\n\t\t$response = \"https://login.live.com/oauth20_authorize.srf?client_id=\".client_id.\"&scope=wl.signin%20wl.offline_access%20wl.skydrive_update%20wl.basic&response_type=code&redirect_uri=\".urlencode(callback_uri);\n\n\t\treturn $response;\n\n\t}",
"public function getAuthURL($withState = true)\n {\n $url = 'https://api.nightbot.tv/oauth2/authorize'.\n '?response_type='.config('nightbot.response_type').\n '&client_id='.config('nightbot.client_id').\n '&redirect_uri='.urlencode(config('nightbot.redirect_url')).\n '&scope='.implode(' ', config('nightbot.scopes'));\n\n if ($withState) {\n $url .= '&state='.config('nightbot.state');\n }\n\n return $url;\n }",
"public function actionAuthorize()\n {\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n if ($this->isOauthRequest) {\n $this->finishAuthorization();\n } else {\n return $this->goBack();\n }\n } else {\n $this->layout = false;\n return $this->render('authorize', [\n 'model' => $model,\n ]);\n }\n }",
"public function getAuthUrl ()\n {\n\n $url = 'https://oauth.vk.com/authorize?client_id='.$this->client_id.'&scope=photos,friends&redirect_uri='.$this->redirect_uri.'&response_type=code&v=5.0';\n return $url;\n }",
"public function GetAuthorizationUrl($credentials, $server = NULL) {\n $endpoint = $this->GetAuthorizeEndpoint($server, NULL);\n\n $params = array('oauth_token' => $credentials['oauth_token']);\n return UrlUtils::AddParamsToUrl($endpoint, $params);\n }",
"function fsl_gauth_getauthurl()\n\t{\n\t\n\t$gClient = new Google_Client();\n $gClient->setApplicationName('Login');\n $gClient->setClientId(option('clientId'));\n $gClient->setClientSecret(option('clientSecret'));\n $gClient->setRedirectUri(option('redirectURL')); \n\t//\t$gClient->setHd(option('hd')); \n $google_oauthV2 = new Google_Oauth2Service($gClient);\n $authUrl = $gClient->createAuthUrl();\n return $authUrl;\n}",
"public function generateUserTokenUrl(AccountInterface $account);",
"abstract public function getAuthUrlComponents();",
"public function getAuthorizationString();",
"public function woo_slg_linkedin_auth_url() {\n\t\t\t\n\t\t\t//Remove unused scope for login\n\t\t\t\n\t\t\t$scope\t= array( 'r_emailaddress', 'r_liteprofile' );\n\t\t\t\n\t\t\t//load linkedin class\n\t\t\t$linkedin = $this->woo_slg_load_linkedin();\n\t\t\t\n\t\t\t//check linkedin loaded or not\n\t\t\tif( !$linkedin ) return false;\n\t\t\t\n\t\t\t//Get Linkedin config\n\t\t\t$config\t= $this->linkedinconfig;\n\t\t\t\n\t\t\ttry {//Prepare login URL\n\t\t\t\t$preparedurl\t= $this->linkedin->getAuthorizeUrl( $config['appKey'], $config['callbackUrl'], $scope );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\t$preparedurl\t= '';\n\t }\n\t \n\t\t\treturn $preparedurl;\n\t\t}",
"public function getURL()\n {\n $client = new Google_Client();\n $client->setAuthConfigFile($this->path);\n $client->setAccessType('offline');\n $client->setApprovalPrompt('force');\n $client->addScope(array(\n Google_Service_Compute::DEVSTORAGE_FULL_CONTROL,\n Google_Service_Oauth2::PLUS_ME\n )\n );\n $client->setRedirectUri($this->getRedirectURL());\n return $client->createAuthUrl();\n }",
"public function oauth()\n {\n // TODO: Check user's preference if to ask user every time when new application trying to identify visitor\n\n $redirect_uri = YY::Config('tokens')->createOAuth([\n 'user' => YY::$ME,\n 'state' => $this['state'],\n 'redirect_uri' => $this['redirect_uri'],\n 'where' => $this['where'],\n 'title' => $this['title'],\n ]);\n\n if ($redirect_uri) {\n\n YY::Log('system', 'JS client redirection to: ' . $this['redirect_uri']);\n $redirect_uri = json_encode($redirect_uri);\n YY::clientExecute(\"location.replace($redirect_uri)\");\n// YY::redirectUrl($redirect_uri);\n\n } else {\n\n YY::Log('system', 'Redirect impossible (redirect_uri is empty)');\n $errorMessage = YY::Translate('Something went wrong sorry');\n $errorMessage = json_encode($errorMessage);\n YY::clientExecute(\"alert($errorMessage)\");\n }\n }",
"public function getBaseAuthorizationUrl()\n {\n return 'https://www.sageone.com/oauth2/auth/central';\n }",
"public function authorize($callback){\n\t\t$req = OAuthRequest::from_consumer_and_token(\n\t\t\t$this->oauth_consumer, \n\t\t\tNULL, \n\t\t\t\"GET\",\n\t\t\t$this->e_authorize, \n\t\t\tarray(\n\t\t\t\t\"oauth_callback\" => $callback\n\t\t\t)\n\t\t);\n\t\t$req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->oauth_consumer, NULL);\n\t\treturn $req->to_url();\n\t}",
"public function getLoginUrl() {\n return $this->client->createAuthUrl();\n }"
] | [
"0.7304819",
"0.724317",
"0.71096873",
"0.6946465",
"0.68703794",
"0.68235534",
"0.68028384",
"0.67311007",
"0.66889876",
"0.6643993",
"0.6611109",
"0.6606323",
"0.65896595",
"0.6572925",
"0.6572925",
"0.6568854",
"0.6568253",
"0.6563203",
"0.65117663",
"0.6499312",
"0.6496088",
"0.64750403",
"0.6470548",
"0.64646643",
"0.64618456",
"0.64315283",
"0.64291054",
"0.64283425",
"0.6412477",
"0.6388216",
"0.6367485",
"0.6364324",
"0.62865525",
"0.6271779",
"0.6230284",
"0.62280846",
"0.621014",
"0.6205983",
"0.61946696",
"0.6178769",
"0.6164505",
"0.6103126",
"0.60990363",
"0.6085815",
"0.6068331",
"0.60330176",
"0.6027354",
"0.6019047",
"0.6001306",
"0.59884286",
"0.59451294",
"0.59407204",
"0.5927053",
"0.5921108",
"0.59149563",
"0.5895",
"0.5892427",
"0.58909464",
"0.5885798",
"0.58791953",
"0.58692634",
"0.58624065",
"0.585932",
"0.5853173",
"0.5850449",
"0.58437556",
"0.58348525",
"0.58272535",
"0.58215994",
"0.58201563",
"0.58017087",
"0.57886547",
"0.5785624",
"0.57840765",
"0.57623583",
"0.57623583",
"0.5759008",
"0.5759008",
"0.5752357",
"0.57480824",
"0.5732043",
"0.5732043",
"0.5721451",
"0.57069814",
"0.570332",
"0.5681716",
"0.56810224",
"0.5671737",
"0.56687427",
"0.56669104",
"0.5665625",
"0.5665068",
"0.5658499",
"0.56492734",
"0.56291264",
"0.5627909",
"0.5626203",
"0.5625234",
"0.5624754",
"0.56194985",
"0.55998266"
] | 0.0 | -1 |
Generates an authorization URL to begin the process of authenticating a official account. | public function getAuthorizationUrlByOA($redirectUrl, $codeChallenge, $state, $separator = '&')
{
$params = [
'app_id' => $this->app->getId(),
'redirect_uri' => $redirectUrl,
'code_challenge' => $codeChallenge,
'state' => $state
];
return static::BASE_AUTHORIZATION_URL . '/' . static::DEFAULT_OAUTH_VERSION . '/oa/permission?' . http_build_query($params, null, $separator);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}",
"public function urlAuthorize() {\n return $this->host . '/oauth/authorize';\n }",
"public function urlAuthorize() {\n return $this->api_location.\"/authorize\";\n }",
"public function getBaseAuthorizationUrl()\n {\n return 'https://redbooth.com/oauth2/authorize';\n }",
"public function getBaseAuthorizationUrl()\n {\n return $this->domain() . '/oauth/authorize';\n }",
"public function getBaseAuthorizationUrl()\n {\n return 'https://acesso.dgp.eb.mil.br/authorize';\n }",
"public function getBaseAuthorizationUrl()\n {\n return $this->getHost().'/oauth2/authorize';\n }",
"public function getAuthorizationUrl()\n {\n // Check for required items\n if (!$this->clientId) {\n throw new Exception('Client ID is required');\n }\n if (!$this->scope) {\n throw new Exception('Scope is required');\n }\n if (!$this->redirectUri) {\n throw new Exception('Redirect URI is required');\n }\n\n // Start building url (enpoint is the same for public and member APIs)\n $url = 'https://';\n $url .= (!empty($this->environment)) ? $this->environment . '.' : '';\n $url .= self::HOSTNAME . '/' . self::AUTHORIZE;\n $url .= '?client_id=' . $this->clientId;\n $url .= '&scope=' . $this->scope;\n $url .= '&redirect_uri=' . urlencode($this->redirectUri);\n $url .= '&response_type=code';\n\n // Process non-required fields\n $url .= ($this->showLogin) ? '&show_login=true' : '';\n $url .= (isset($this->state)) ? '&state=' . $this->state : '';\n $url .= (isset($this->familyNames)) ? '&family_names=' . $this->familyNames : '';\n $url .= (isset($this->givenNames)) ? '&given_names=' . $this->givenNames : '';\n $url .= (isset($this->email)) ? '&email=' . urlencode($this->email) : '';\n\n return $url;\n }",
"public function getBaseAuthorizationUrl()\n {\n return 'https://app.intercom.io/oauth';\n }",
"public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}",
"public function getBaseAuthorizationUrl()\n {\n return $this->webUrl . '/oauth/authorize';\n }",
"public function _getAuthorizationUrl()\n {\n // Generate new authorization url\n $helper = $this->_getProvider()->getRedirectLoginHelper();\n $permissions = ['email', 'public_profile'];\n return $helper->getLoginUrl(APP_URL.'/app/modules/coinstackapp-facebookoauth/src/actions/callback.php', $permissions);\n }",
"public function urlAuthorization()\n {\n return 'https://api.twitter.com/oauth/authenticate';\n }",
"public function getBaseAuthorizationUrl(): string\n {\n return $this->domain . '/id/authorize';\n }",
"public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}",
"public function authenticationURL()\n {\n $clientId = config('twitch-api.client_id');\n $scopes = implode('+', config('twitch-api.scopes'));\n $redirectURL = config('twitch-api.redirect_url');\n return config('twitch-api.api_url') . '/kraken/oauth2/authorize?api_version=5&response_type=code&client_id=' . $clientId . '&redirect_uri=' . $redirectURL . '&scope=' . $scopes;\n }",
"public function getAuthorizationUrl()\n {\n return sprintf($this->_endpointUrls['authorize'],\n $this->_config['client_id'],\n $this->_config['redirect_uri'],\n self::RESPONSE_CODE_PARAM);\n }",
"public function getBaseAuthorizationUrl()\n {\n return \"https://$this->dataCenter.adobesign.com/public/oauth\";\n }",
"public function getAuthorisationLink()\n {\n\n $authorisationLink = $this->urlAuthorize();\n $authorisationLink .= '?client_id=' . $this->clientId;\n $authorisationLink .= '&response_type=code';\n $authorisationLink .= '&redirect_uri=' . $this->redirectUri;\n $authorisationLink .= '&approval_prompt=' .$this->aprovalPrompt;\n $scopes = str_replace(' ', '',implode(', ', $this->scopes));\n $authorisationLink .= '&scope=' . $scopes;\n\n return $authorisationLink;\n }",
"public function get_user_authorization_url()\n\t{\n\t\tif ($this->auth_oauth_response != SPOAuthClient::OAUTH_USER_AUTH || !$this->oauth_token)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn $this->auth_url_userauth . (strpos($this->auth_url_userauth, \"?\") === false ? \"?oauth_token=\" : \"&oauth_token=\") . rawurlencode($this->oauth_token);\n\t}",
"public function getAuthUrl()\n {\n return $this->client->createAuthUrl();\n }",
"public function getBaseAuthorizationUrl()\n {\n return 'https://www.sageone.com/oauth2/auth/central';\n }",
"public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}",
"public function authorize()\n\t{\n\t\t $args = phpSmug::processArgs( func_get_args() );\n\t\t $perms = ( array_key_exists( 'Permissions', $args ) ) ? $args['Permissions'] : 'Public';\n\t\t $access = ( array_key_exists( 'Access', $args ) ) ? $args['Access'] : 'Read';\n \t\t return \"https://secure.smugmug.com/services/oauth/authorize.mg?Access=$access&Permissions=$perms&oauth_token={$this->oauth_token}\";\n\t }",
"public function urlOfAuthorizePage()\n {\n return sprintf(\n '%s/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code',\n $this->root,\n $this->client_id,\n $this->redirect_uri\n );\n }",
"public function urlOfAuthorizePage()\n {\n return sprintf(\n '%s/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code',\n $this->root,\n $this->client_id,\n $this->redirect_uri\n );\n }",
"abstract protected function auth_url();",
"function genAuthURL($perms)\n\t{\n\t\t$args['perms'] = $perms;\n\t\t$api_sig = md5($this->api_sig(false,$args));\n\t\treturn 'http://www.rememberthemilk.com/services/auth/?api_key='.$this->apikey.'&perms='.$perms.'&api_sig='.$api_sig;\n\t}",
"public static function build_oauth_url() {\n\n\t\t$response = \"https://login.live.com/oauth20_authorize.srf?client_id=\".client_id.\"&scope=wl.signin%20wl.offline_access%20wl.skydrive_update%20wl.basic&response_type=code&redirect_uri=\".urlencode(callback_uri);\n\n\t\treturn $response;\n\n\t}",
"public function openAuthorizationUrl()\n {\n header('Location: ' . $this->getAuthorizationUrl());\n exit(1);\n }",
"public function authenticateUri()\n {\n $args = array(\n 'client_id' => $this->_clientId,\n 'client_secret' => $this->_clientSecret,\n 'response_type' => 'code',\n 'redirect_url' => $this->_redirectUri,\n );\n\n return 'https://untappd.com/oauth/authenticate/?' . http_build_query($args);\n }",
"public function getAuthorizationUri()\n {\n $url = \"https://twinoid.com/oauth/auth?response_type=code&client_id=\".$this->_clientId.\"&redirect_uri=\".$this->_redirectUri.\"&state=connexion\";\n if ($this->_scope)\n {\n $url .= \"&scope=\" . $this->_scope;\n }\n return $url;\n }",
"public function getBaseAuthorizationUrl()\n {\n return \"https://api.weibo.com/oauth2/authorize\";\n }",
"private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }",
"public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }",
"protected function _getAuthUrl()\n {\n\t\t$url = CS_REST_General::authorize_url(\n\t\t\t$this->_getClientId(),\n\t\t\t$this->_getAuthRedirectUri(),\n\t\t\t'ImportSubscribers,ManageLists'\n\t\t);\n\t\t\n return $url;\n }",
"public function getAuthorizationURL()\n {\n return $this->get('AuthorizationURL');\n }",
"abstract public function getAuthorizeUrl(): string;",
"public function getAuthorizationUrl(): string\n {\n // urlAuthorize option and generates and applies any necessary parameters\n // (e.g. state).\n $authorizationUrl = $this->provider->getAuthorizationUrl([\n // Optional, only use this if you want to ask for scopes the user previously denied.\n 'approval_prompt' => 'force',\n // Optional, a list of scopes. Defaults to only 'organizations.read'.\n 'scope' => [\n Mollie::SCOPE_PAYMENTS_READ,\n Mollie::SCOPE_PAYMENTS_WRITE,\n Mollie::SCOPE_REFUNDS_READ,\n Mollie::SCOPE_REFUNDS_WRITE,\n Mollie::SCOPE_CUSTOMERS_READ,\n Mollie::SCOPE_CUSTOMERS_WRITE,\n Mollie::SCOPE_MANDATES_READ,\n Mollie::SCOPE_MANDATES_WRITE,\n Mollie::SCOPE_SUBSCRIPTIONS_READ,\n Mollie::SCOPE_SUBSCRIPTIONS_WRITE,\n Mollie::SCOPE_PROFILES_READ,\n Mollie::SCOPE_PROFILES_WRITE,\n Mollie::SCOPE_INVOICES_READ,\n Mollie::SCOPE_SETTLEMENTS_READ,\n Mollie::SCOPE_ORDERS_READ,\n Mollie::SCOPE_ORDERS_WRITE,\n Mollie::SCOPE_SHIPMENTS_READ,\n Mollie::SCOPE_SHIPMENTS_WRITE,\n Mollie::SCOPE_ORGANIZATIONS_READ,\n Mollie::SCOPE_ORGANIZATIONS_WRITE,\n Mollie::SCOPE_ONBOARDING_READ,\n Mollie::SCOPE_ONBOARDING_WRITE,\n ],\n ]);\n\n return $authorizationUrl;\n }",
"public function getAuthUrl()\n\t{\n\t\treturn $this->createAuthUrl();\n\t}",
"public function getUserAuthorizationUrl()\n {\n return $this->getAuthorizeUrl();\n }",
"public function createUrl()\n\t{\n\t\tif (!$this->getOption('authurl') || !$this->getOption('clientid'))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Authorization URL and client_id are required');\n\t\t}\n\n\t\t$url = $this->getOption('authurl');\n\n\t\tif (strpos($url, '?'))\n\t\t{\n\t\t\t$url .= '&';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url .= '?';\n\t\t}\n\n\t\t$url .= 'response_type=code';\n\t\t$url .= '&client_id=' . urlencode($this->getOption('clientid'));\n\n\t\tif ($this->getOption('redirecturi'))\n\t\t{\n\t\t\t$url .= '&redirect_uri=' . urlencode($this->getOption('redirecturi'));\n\t\t}\n\n\t\tif ($this->getOption('scope'))\n\t\t{\n\t\t\t$scope = is_array($this->getOption('scope')) ? implode(' ', $this->getOption('scope')) : $this->getOption('scope');\n\t\t\t$url .= '&scope=' . urlencode($scope);\n\t\t}\n\n\t\tif ($this->getOption('state'))\n\t\t{\n\t\t\t$url .= '&state=' . urlencode($this->getOption('state'));\n\t\t}\n\n\t\tif (is_array($this->getOption('requestparams')))\n\t\t{\n\t\t\tforeach ($this->getOption('requestparams') as $key => $value)\n\t\t\t{\n\t\t\t\t$url .= '&' . $key . '=' . urlencode($value);\n\t\t\t}\n\t\t}\n\n\t\treturn $url;\n\t}",
"public function getAuthUrl();",
"public function getAuthorizationURL() {\n\t\treturn $this->selectedEndpoint['authorization_url'];\n\t}",
"public function generateAuthUrl(Request $request)\n {\n return $this->setCurrentBankInSession($request, 'monzo')->authorizer->generateAuthUrl('https://auth.monzo.com/');\n }",
"protected function _generateOpauthCompleteUrl()\n {\n $url = Configure::read('Opauth.complete_url');\n if (!is_array($url)) {\n $url = Router::parse($url);\n }\n $url['?'] = ['social' => $this->request->query('code')];\n return Router::url($url, true);\n }",
"public function getURL()\n {\n $client = new Google_Client();\n $client->setAuthConfigFile($this->path);\n $client->setAccessType('offline');\n $client->setApprovalPrompt('force');\n $client->addScope(array(\n Google_Service_Compute::DEVSTORAGE_FULL_CONTROL,\n Google_Service_Oauth2::PLUS_ME\n )\n );\n $client->setRedirectUri($this->getRedirectURL());\n return $client->createAuthUrl();\n }",
"public function get_authorize_url()\n\t{\n\t\t$params = array(\n\t\t\t'client_id' => $this->client_id,\n\t\t\t'scope' => $this->scope,\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->redirect_uri,\n\t\t);\n\n\t\t// Authentication request\n\t\t$authorize_url = 'https://api.instagram.com/oauth/authorize';\n\t\treturn \"{$authorize_url}?\" . http_build_query($params);\n\t}",
"public function getAuthUrl()\n {\n $return = $this->baseUrl .\n '/' . $this->authNamespace .\n '/' . $this->authVersion .\n '/token?url=' . $this->baseUrl . '/' . $this->apiNamespace;\n\n return $return;\n }",
"public function generateLoginUrl(): string\n {\n // This is why we 'fake' the username to a uniqid, to use the test system's token storage.\n return sprintf(\n '%s/login/%s',\n $this->accountEndpoint,\n $this->generateToken(\"login\" . uniqid())\n );\n }",
"public function getAuthorizeUrl() {\n return 'https://api.instagram.com/oauth/authorize?client_id='.$this->getClientID().'&redirect_uri='.$this->getRedirectUri().'&response_type='.$this->getResponseType();\n }",
"function fsl_gauth_getauthurl()\n\t{\n\t\n\t$gClient = new Google_Client();\n $gClient->setApplicationName('Login');\n $gClient->setClientId(option('clientId'));\n $gClient->setClientSecret(option('clientSecret'));\n $gClient->setRedirectUri(option('redirectURL')); \n\t//\t$gClient->setHd(option('hd')); \n $google_oauthV2 = new Google_Oauth2Service($gClient);\n $authUrl = $gClient->createAuthUrl();\n return $authUrl;\n}",
"public function getLoginUrl()\n\t{\n\t\treturn \"$this->authorizationBaseUrl?client_id=$this->clientId&redirect_uri=$this->redirectUri&scope=$this->scope\";\n\t}",
"public function getAuthUrl ()\n {\n\n $url = 'https://oauth.vk.com/authorize?client_id='.$this->client_id.'&scope=photos,friends&redirect_uri='.$this->redirect_uri.'&response_type=code&v=5.0';\n return $url;\n }",
"public function getAuthorizationUri() : string\r\n {\r\n return $this->authorization_uri;\r\n }",
"public function getLoginUrl() {\n return $this->client->createAuthUrl();\n }",
"public function getAuthorizationUrl(array $options = []) {\n\t\t// than in this options array,\n\t\t$options['state'] = $this->getState();\n\n\t\tif(!empty($this->scopes)) {\n\t\t\t$options['scope'] = $this->scopes;\n\t\t}\n\n\t\treturn parent::getAuthorizationUrl($options);\n\n\t}",
"protected function buildAuthorizeUrl($prompt, $returnTo=null) {\n global $base_root;\n\n $auth0Api = new Authentication($this->domain, $this->client_id);\n\n $response_type = 'code';\n $redirect_uri = \"$base_root/auth0/callback\";\n $connection = null;\n $state = $this->getNonce($returnTo);\n $additional_params = [];\n $additional_params['scope'] = AUTH0_DEFAULT_SCOPES;\n if ($this->offlineAccess) $additional_params['scope'] .= ' offline_access';\n if ($prompt) $additional_params['prompt'] = $prompt;\n\n return $auth0Api->get_authorize_link($response_type, $redirect_uri, $connection, $state, $additional_params);\n }",
"public function generateAuthCodeURL(string $scope, string $userDefinedState = \"state\") : string\n {\n if ($this->isUserPassState($userDefinedState)) {\n $this->setState($userDefinedState);\n } else {\n $this->generateStateIfNotSet();\n }\n $this->setScope($scope);\n\n return $this->getDiscoveryURLs()->getAuthorizationEndpointUrl() .\n \"?\" . $this->generateQueryParemeterStringForAuthorizationCodeURL();\n }",
"private function buildUrl() : string\n {\n $redirectUri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $params = http_build_query([\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'checkid_setup',\n 'openid.return_to' => (string) $redirectUri,\n 'openid.realm' => (string) $redirectUri,\n 'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',\n 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',\n ]);\n\n return (string) (new Uri($this->getOpenIdUrl().'/login'))->withQuery($params);\n }",
"function generate_api_url(){\n\t\t$parameters = array(\n\t\t\t'uid' \t\t => $this->uid,\n\t\t\t'pswd' \t\t => $this->pswd,\n\t\t\t'api' \t\t => $this->api,\n\t\t\t'apiversion' => $this->apiversion\t\t\t\n\t\t);\n\t\t\n\t\tif(!empty($this->sid) && !empty($this->encrypted_pswd)){\n\t\t\t$parameters['sid'] = $this->sid;\n\t\t\t$parameters['pswd'] = $this->encrypted_pswd;\n\t\t}\n\t\t\n\t\t//var_dump($parameters);\n\t\t\n\t\treturn self::api_end_point . '?' . http_build_query($parameters);\n\t}",
"public function createAuthUrl(array $scope) {\n $params= array(\n 'response_type=code',\n 'redirect_uri='.urlencode($this->redirectUri),\n 'client_id='.urlencode($this->clientId),\n 'scope='.urlencode(implode(' ', $scope)),\n 'access_type='.urlencode($this->accessType),\n 'approval_prompt='.urlencode($this->approvalPrompt)\n );\n\n if (isset($this->state)) {\n $params[]= 'state='.urlencode($this->state);\n }\n\n return $this->provider->getOauthUrl().'?'.implode('&', $params);\n }",
"abstract public function getAuthUri(): string;",
"public function getAudienceSyncAuthorizationURL()\n\t{\n\t\t$url = 'https://disqus.com/api/oauth/2.0/authorize/';\n\n\t\treturn $url .\"?\". http_build_query(array(\n\t\t\t\t'client_id'=>$this->app[\"config\"][\"disqus.audsync.publickey\"],\n\t\t\t\t'response_type'=>'audiencesync',\n\t\t\t\t'forum_id'=>$this->app[\"config\"]['disqus.forumname'],\n\t\t\t\t'redirect_uri'=>$this->app[\"config\"]['disqus.audsync.redirect_uri']\n\t\t\t));\n\t}",
"public function get_bitbucket_auth_url(){\n\t\tif( empty($this->unauth_token) ){\n\t\t\t$this->request_unauth_token();\n\t\t}\n\t\t\n\t\t$auth_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->unauth_token, \"GET\", $this->oauth_urls['login']);\n\t\t$auth_req->sign_request($this->signature_method, $this->consumer, $this->unauth_token);\n\t\treturn $auth_req->to_url();\n\t}",
"public function getAuthorizationUrl(ServerRequest $request);",
"public function getAuthorizeUrl()\n {\n if (! $this->authorizeUrl && $this->siteUrl) {\n return rtrim($this->siteUrl, '/') . '/authorize';\n }\n return $this->authorizeUrl;\n }",
"public function get_auth_url()\r\n\t{\r\n\t\treturn PicasaAPI::$QUERY_URLS['auth'];\r\n\t}",
"public function createAuthUrl($clientId = '')\n {\n $query = [\n 'client_id' => $clientId == '' ? $this->getClientId() : $this->clientId,\n 'redirect_uri' => $this->getRedirectUri(),\n 'scope' => implode(' ', $this->getScope()),\n 'response_type' => \"code\"\n ];\n $url = $this->oauth2_auth_uri . '?' . http_build_query($query);\n\n return $url;\n }",
"public function authorization_url()\n {\n // Arrange\n $service = new ServiceImplementation();\n\n // Act\n $authorizationUrl = $service->authorizationUrl();\n\n // Assert\n $this->assertEquals('https://service.com/oauth/dialog', $authorizationUrl);\n }",
"public function getAuthorization(): string\n {\n return self::PREFIX . base64_encode($this->username . ':' . $this->password);\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase('https://auth.kodular.io/oska/authorize', $state);\n }",
"public function actionAuthLink() {\n $localAt = gp('localAt');\n if ($localAt) {\n $s = Yii::$app->getSession();\n $s->set('localAt', $localAt);\n $s->set('linkRequestTs', time());\n $direction = ['site/auth'] + ['authclient' => gp('authclient')];\n $this->redirect($direction);\n } else {\n throw new \\yii\\web\\NotFoundHttpException();\n }\n\n }",
"public function getAuthorizeUrl()\n {\n return Mage::helper('adminhtml')->getUrl('adminhtml/mautic/authorize');\n }",
"public function authorize_url($options) {\n\n if (!isset($options['redirect_uri'])) {\n throw new GoCardless_ArgumentsException('redirect_uri required');\n }\n\n $endpoint = '/oauth/authorize';\n\n $url = GoCardless_Client::$base_url . $endpoint .\n '?client_id='. urlencode($this->account_details['app_id']) .\n '&redirect_uri=' . urlencode($options['redirect_uri']) .\n '&scope=manage_merchant' .\n '&response_type=code';\n\n return $url;\n\n }",
"public function oauthUrl(string $oauthToken): string\n {\n return sprintf('%s/%s?%s', self::API_URL, 'oauth/authorize', http_build_query([\n 'oauth_token' => $oauthToken,\n ]));\n }",
"public function getLoginUrl() {\n $url = CURL::urljoin($this->authorization_uri, array(\n 'client_id' => $this->client_id,\n 'scope' => $this->scope,\n 'response_type' => 'code',\n 'redirect_uri' => $this->getConnectUrl(),\n 'state' => $this->state,\n 'display' => 'popup',\n ));\n return $url;\n }",
"function getAuthorizeURL($token,$callback='') {\n\t\tif (is_array($token)) {\n\t\t\t$token = $token['oauth_token'];\n\t\t}\n\t\treturn $this->authorizeURL() . \"?oauth_token={$token}&oauth_callback=\".urlencode($callback);\n\t}",
"public function oauth()\n {\n // TODO: Check user's preference if to ask user every time when new application trying to identify visitor\n\n $redirect_uri = YY::Config('tokens')->createOAuth([\n 'user' => YY::$ME,\n 'state' => $this['state'],\n 'redirect_uri' => $this['redirect_uri'],\n 'where' => $this['where'],\n 'title' => $this['title'],\n ]);\n\n if ($redirect_uri) {\n\n YY::Log('system', 'JS client redirection to: ' . $this['redirect_uri']);\n $redirect_uri = json_encode($redirect_uri);\n YY::clientExecute(\"location.replace($redirect_uri)\");\n// YY::redirectUrl($redirect_uri);\n\n } else {\n\n YY::Log('system', 'Redirect impossible (redirect_uri is empty)');\n $errorMessage = YY::Translate('Something went wrong sorry');\n $errorMessage = json_encode($errorMessage);\n YY::clientExecute(\"alert($errorMessage)\");\n }\n }",
"public static function callback_url() {\n global $CFG;\n\n return new moodle_url('/admin/oauth2callback.php');\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase('https://bitbucket.org/site/oauth2/authorize', $state);\n }",
"public function getLoginUrl()\n {\n $url = sprintf(\"%s/authorize?response_type=code&client_id=%s&state=%s\",\n $this->client->getBaseUrl(),\n $this->client->getConfig('client_id'),\n md5(uniqid())\n );\n\n return $url;\n }",
"public function get_login_url() {\n\n $returnurl = new moodle_url('/repository/repository_callback.php');\n $returnurl->param('callback', 'yes');\n $returnurl->param('repo_id', $this->id);\n $returnurl->param('sesskey', sesskey());\n $returnurl->param('reloadparentpage', true);\n\n $url = new moodle_url($this->client->createAuthUrl());\n $url->param('state', $returnurl->out_as_local_url(false));\n return '<a target=\"repo_auth\" href=\"'.$url->out(false).'\">'.get_string('connectyourgoogleaccount', 'repository_googledrive').'</a>';\n }",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase('https://open.weixin.qq.com/connect/oauth2/authorize', $state);\n }",
"public function getAccessTokenUrl() {\n return Mage::helper('adminhtml')->getUrl('adminhtml/aw_vidtest_authsub/auth', array('api_model_code' => $this->getApiModelCode()));\n }",
"private function authorisationRequest() \n {\n $url = 'https://oauth2.constantcontact.com/oauth2/oauth/siteowner/authorize?';\n $url.='response_type=code';\n $url.='&client_id='.$this->apikey;\n $url.='&redirect_uri='.$this->redirectURL;\n \n $response = $this->makeRequest($url);\n echo $response;\n die($response);\n //now wait for redirectURL to be called\n }",
"function url($clientid, $redirect, $scope)\n{\n\treturn 'https://discordapp.com/oauth2/authorize?response_type=code&client_id=' . $clientid . '&redirect_uri=' . $redirect . '&scope=' . $scope;\n}",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase(\n 'https://login.eveonline.com/oauth/authorize', $state\n );\n }",
"public function authorize($callback){\n\t\t$req = OAuthRequest::from_consumer_and_token(\n\t\t\t$this->oauth_consumer, \n\t\t\tNULL, \n\t\t\t\"GET\",\n\t\t\t$this->e_authorize, \n\t\t\tarray(\n\t\t\t\t\"oauth_callback\" => $callback\n\t\t\t)\n\t\t);\n\t\t$req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->oauth_consumer, NULL);\n\t\treturn $req->to_url();\n\t}",
"function buildAuthUrl($frob ='', $key = '', $secret = '', $perms = 'delete') {\n\t\t$params = array();\n if ($frob != '') {\n $params['frob'] = $frob;\n }\n\t\tif ($key == '') {\n\t\t\t$key = $this->modx->getOption('xflickr.api_key');\n\t\t}\n\t\tif ($secret == '') {\n\t\t\t$secret = $this->modx->getOption('xflickr.api_secret');\n\t\t}\n\t\t$params['api_key'] = $key;\n\t\t$params['perms'] = $perms;\n //return 'http://flickr.com/services/auth/?'.$this->signParams($params);\n $signing = '';\n $values = array();\n ksort($params);\n foreach($params as $key => $value) {\n\t\t\t$signing .= $key . $value;\n\t\t\t$values[] = $key . '=' . urlencode($value);\n }\n $values[] = 'api_sig=' . md5($secret . $signing);\n return 'http://flickr.com/services/auth/?'.implode('&', $values);\n }",
"function get_reddit_oauth_url()\n{\n\t$state = sprintf(\"%s,%s\", time(), hash_hmac('sha256', strval(time()), REDDIT_OAUTH_CLIENT_SECRET));\n\treturn sprintf(\"https://www.reddit.com/api/v1/authorize?client_id=%s&response_type=code&state=%s&redirect_uri=%s&duration=temporary&scope=identity,read,mysubreddits\",\n\t\tREDDIT_OAUTH_CLIENT_ID,\n\t\t$state,\n\t\tget_reddit_redirect_uri()\n\t);\n}",
"public function urlAccessToken() {\n return $this->host . '/oauth/token';\n }",
"protected function getFetchUrl() {\n $url = 'sites/' . $this->site->get('id') . '/authorizations';\n return $url;\n }",
"public function GetAuthorizationUrl($credentials, $server = NULL) {\n $endpoint = $this->GetAuthorizeEndpoint($server, NULL);\n\n $params = array('oauth_token' => $credentials['oauth_token']);\n return UrlUtils::AddParamsToUrl($endpoint, $params);\n }",
"abstract public function url_authorize();",
"public function authLink() {\n return $this->direct();\n }",
"function getAuthorizeURL($token,$callback = '') {\n\t\tif (is_array ( $token ))\n\t\t\t$token = $token ['oauth_token'];\n\t\tif(!empty($callback)) {\n\t\t\t$callback = \"&oauth_callback=\".urlencode($callback);\n\t\t}\n\t\treturn $this->authorizeURL () . '?oauth_token=' . $token . $callback;\n\t}",
"protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase($this->baseUrl.'/oauth2.0/authorize', $state);\n }",
"public function getOauthUri(): string\r\n {\r\n return 'https://www.facebook.com/dialog/oauth?';\r\n }",
"public function connect() {\n\n // Set params\n $params = array(\n 'response_type' => 'code',\n 'client_id' => $this->client_id,\n 'redirect_uri' => $this->redirect_uri,\n 'state' => time(),\n 'scope' => 'w_share r_basicprofile r_liteprofile rw_organization_admin r_organization_social w_organization_social'\n );\n \n // Get redirect url\n $url = $this->endpoint . '/authorization?' . http_build_query($params);\n \n // Redirect\n header('Location:' . $url);\n\n }",
"protected function generateString()\n\t{\n\t\t// start with the scheme\n\t\t$url = $this->scheme . '://';\n\t\t\n\t\t// user and password\n\t\tif( !empty( $this->user ) )\n\t\t{\n\t\t\t$url .= $this->user;\n\t\t\tif( !empty( $this->pass ) ) $url .= ':'.$this->pass.'@';\n\t\t\telse $url .= '@';\n\t\t}\n\t\t\n\t\t// add the host and path\n\t\t$url .= $this->host . '/';\n\t\t$url .= $this->path;\n\t\t\n\t\t// add the URL-encoded parameters\n\t\tif( !empty( $this->params ) )\n\t\t{\n\t\t\t$url .= '?';\n\t\t\tforeach( $this->params as $f => $v ) $url .= $f . '=' . urlencode( $v ) . '&';\n\t\t\t$url = rtrim( $url, '&' );\n\t\t}\n\t\t\n\t\t// add the anchor if any\n\t\tif( !empty( $this->anchor ) ) $url .= '#' . $this->anchor;\n\t\t\n\t\t$this->url = $url;\n\t\t$this->modified = false;\n\t\treturn $url;\n\t}"
] | [
"0.7636061",
"0.73171246",
"0.71295434",
"0.7105079",
"0.70463043",
"0.7043609",
"0.70413375",
"0.7040529",
"0.70289844",
"0.7008467",
"0.6986752",
"0.6944371",
"0.6943936",
"0.69139266",
"0.6871955",
"0.6855001",
"0.68522453",
"0.685121",
"0.6831284",
"0.6825356",
"0.67651844",
"0.67612016",
"0.6730176",
"0.67180526",
"0.6705897",
"0.6705897",
"0.6690021",
"0.6672977",
"0.66580844",
"0.6653416",
"0.6630841",
"0.6630813",
"0.66270393",
"0.662337",
"0.6589736",
"0.6572928",
"0.6541411",
"0.6539508",
"0.6478054",
"0.6464527",
"0.6448125",
"0.64472556",
"0.64263266",
"0.6342249",
"0.632059",
"0.6239519",
"0.6213844",
"0.62013286",
"0.6162234",
"0.61595047",
"0.61555076",
"0.61510646",
"0.6125898",
"0.61233044",
"0.61188304",
"0.61132365",
"0.6097512",
"0.6085257",
"0.60645825",
"0.60640544",
"0.6063472",
"0.6055262",
"0.605355",
"0.6051519",
"0.60495937",
"0.60391456",
"0.60342157",
"0.60210955",
"0.6011687",
"0.6003317",
"0.6001033",
"0.60002655",
"0.5969806",
"0.596137",
"0.5957023",
"0.5955952",
"0.5954771",
"0.5948752",
"0.59468186",
"0.59239864",
"0.5918922",
"0.5913325",
"0.5891924",
"0.5885267",
"0.58776927",
"0.58741605",
"0.58624196",
"0.5855591",
"0.5854306",
"0.58484775",
"0.5848385",
"0.5845808",
"0.5844884",
"0.58365643",
"0.5833612",
"0.5824568",
"0.5822394",
"0.58169454",
"0.57885516",
"0.5776264",
"0.57726246"
] | 0.0 | -1 |
Get Zalo Token by user from a oauth code. | public function getZaloTokenFromCodeByUser($code, $codeVerifier)
{
$endpoint = '/access_token';
return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function userByToken();",
"public function requestToken($code) {\n $client = new Zend_Http_Client();\n $queryParams = array(\n 'client_id' => self::CLIENT_ID,\n 'client_secret' => self::CLIENT_SECRET,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n )),\n 'code' => $code\n );\n $client->setUri(self::OAUTH_CALLBACK);\n $client->setParameterGet($queryParams);\n\n try {\n $response = $client->request();\n } catch (Zend_Http_Client_Exception $e) { // timeout or host not accessible\n return;\n }\n\n // error in response\n if ($response->isError()) {\n return;\n }\n\n $result = Zend_Json::decode($response->getBody());\n if (isset($result['access_token'])) {\n $token = $result['access_token'];\n return $token;\n }\n return;\n }",
"public function get_token( $type = 'access_token' ){\n\t\t$token = NULL;\n\t\tif( $this->token_storage == 'file' ){\n\t\t\tif( is_file($this->token_files[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( file_get_contents($this->token_files[$type]) );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// add method to get token from cookie\n\t\t\tif( !empty($_COOKIE[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( $_COOKIE[$type] );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}",
"public function getAuthorizationCode()\n {\n $oauth_param = array(\n 'grant_type' => $this->grant_type, \n 'client_id' => config::$clientId,\n 'client_secret' => config::$secretKey,\n 'scope' => implode(',', $this->scope));\n\n $url = config::$apiUrl . 'oauth/access_token';\n $response = $this->curl->request('post', $url, $oauth_param);\n\n if( $response )\n {\n $res = json_decode($response);\n if( isset($res->access_token) )\n {\n $this->setExpiresAtFromTimeStamp($res->expires);\n $this->session->write('access_token',$res->access_token);\n $this->session->write('expires', $this->expiresAt);\n\n $read = $this->session->read('access_token');\n session_write_close();\n }\n elseif( isset($res->error) )\n {\n die($response);\n }\n }\n }",
"private function getAccessToken($user) {\n return $user->createToken('Token')->accessToken;\n }",
"public function getAccessTokenResponse($code)\n {\n $response = $this->getHttpClient()->get($this->getTokenUrl(), [\n 'query' => [\n 'grant_type' => 'authorization_code',\n 'client_id' => env('YAHOOJP_CLIENT_ID'),\n 'client_secret' => env('YAHOOJP_CLIENT_SECRET'),\n 'redirect_uri' => env('YAHOOJP_REDIRECT'),\n 'code' => $code\n ]\n ]);\n\n $user_token = json_decode($response->getBody(), true);\n $this->user = $user_token;\n\n return $user_token;\n }",
"private function get_token($user)\n\t\t{\n\t\t\treturn $user->id . ';' . $this->ip_lock($this->getAuthToken($user)) . ';' . $_SERVER['REMOTE_ADDR'];\n\t\t}",
"public function get_token($code = \"\") {\n global $cfg;\n\n $method = \"oauth.access\";\n\n $payload = array(\n 'code' => $code,\n );\n\n // Make the API request.\n if ($result = $this->apicall($method, $payload)) {\n \n $this->app_id = $result['app_id'];\n $this->app_user_id = $result['app_user_id'];\n $this->installer_user_id = $result['installer_user']['user_id'];\n $this->access_token = $result['access_token'];\n $this->userid = $result['user_id'];\n $this->teamid = $result['team_id'];\n $this->teamname = $result['team_name'];\n $this->webhook->channel_id = $result['incoming_webhook']['channel_id'];\n $this->webhook->channel = $result['incoming_webhook']['channel'];\n $this->webhook->configuration_url = $result['incoming_webhook']['configuration_url'];\n $this->webhook->url = $result['incoming_webhook']['url'];\n $this->bot->user_id = $result['bot']['bot_user_id'];\n $this->bot->access_token = $result['bot']['bot_access_token'];\n\n // write to file (for now; DB later)\n if ($this->store_token()) {\n return TRUE;\n }\n }\n return FALSE;\n }",
"public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }",
"public function get_access_token($oauth_token, $oauth_addon);",
"function get_oauth_identity($wpoa) {\n\t// set the access token param:\n\t$params = array(\n\t\t'access_token' => $_SESSION['WPOA']['ACCESS_TOKEN'], // PROVIDER SPECIFIC: the access_token is passed to Google via POST param\n\t);\n\t$url_params = http_build_query($params);\n\t// perform the http request:\n\tswitch (strtolower(HTTP_UTIL)) {\n\t\tcase 'curl':\n\t\t\t$url = URL_USER . $url_params; // TODO: we probably want to send this using a curl_setopt...\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\t\t// PROVIDER NORMALIZATION: Github/Reddit require a User-Agent here...\n\t\t\t// PROVIDER NORMALIZATION: PayPal/Reddit require that we send the access token via a bearer header, PayPal also requires a Content-Type: application/json header, LinkedIn requires an x-li-format: json header...\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t$result = curl_exec($curl);\n \n\t\t\t$result_obj = json_decode($result, true);\n\t\t\tbreak;\n\t\tcase 'stream-context':\n\t\t\t$url = rtrim(URL_USER, \"?\");\n\t\t\t$opts = array('http' =>\n\t\t\t\tarray(\n\t\t\t\t\t'method' => 'GET',\n\t\t\t\t\t// PROVIDER NORMALIZATION: Reddit/Github requires User-Agent here...\n\t\t\t\t\t'header' => \"Authorization: Bearer \" . $_SESSION['WPOA']['ACCESS_TOKEN'] . \"\\r\\n\" . \"x-li-format: json\\r\\n\", // PROVIDER SPECIFIC: i think only LinkedIn uses x-li-format...\n\t\t\t\t)\n\t\t\t);\n\t\t\t$context = $context = stream_context_create($opts);\n\t\t\t$result = @file_get_contents($url, false, $context);\n\t\t\tif ($result === false) {\n\t\t\t\t$wpoa->wpoa_end_login(\"Sorry, we couldn't log you in. Could not retrieve user identity via stream context. Please notify the admin or try again later.\");\n\t\t\t}\n\t\t\t$result_obj = json_decode($result, true);\n\t\t\tbreak;\n\t}\n\t// parse and return the user's oauth identity:\n \n\t$oauth_identity = array();\n\t$oauth_identity['provider'] = $_SESSION['WPOA']['PROVIDER'];\n\t$oauth_identity['id'] = $result_obj['id']; // PROVIDER SPECIFIC: Google returns the user's OAuth identity as id\n $_SESSION['WPOA']['USERSELF'] = $result_obj;\n\t//$oauth_identity['email'] = $result_obj['emails'][0]['value']; // PROVIDER SPECIFIC: Google returns an array of email addresses. To respect privacy we currently don't collect the user's email address.\n\tif (!$oauth_identity['id']) {\n\t\t$wpoa->wpoa_end_login(\"Sorry, we couldn't log you in. User identity was not found. Please notify the admin or try again later.\");\n\t}\n \n\treturn $oauth_identity;\n}",
"public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}",
"public function user($code){\r\n\r\n $this->client->authenticate($code);\r\n\r\n if($this->client->getAccessToken()){\r\n\r\n return $this->serviceOauth->userinfo->get();\r\n \r\n }\r\n }",
"public function getToken(string $userToken): ?Token;",
"public function get_request_token($callback);",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function byUser( User $user )\n {\n return $user->google_access_token;\n }",
"public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }",
"public function gettoken()\n{\n if (isset($_GET['code'])) {\n // Check that state matches\n if (isset($_GET['state']) && isset($_SESSION['oauth_state'])) {\n if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth_state'])) {\n exit('State provided in redirect does not match expected value.');\n } \n // Clear saved state\n unset($_SESSION['oauth_state']); \n }\n\n // Initialize the OAuth client\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => $this->config->item('OAUTH_APP_ID'),\n 'clientSecret' => $this->config->item('OAUTH_APP_PASSWORD'),\n 'redirectUri' => $this->config->item('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => $this->config->item('OAUTH_SCOPES')\n ]);\n\n try {\n\n // Make the token request\n $accessToken = $oauthClient->getAccessToken('authorization_code', [\n 'code' => $_GET['code']\n ]);\n\n //echo 'Access token: '.$accessToken->getToken();\n return $accessToken->getToken();\n }\n catch (League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException $e) {\n exit('ERROR getting tokens: '.$e->getMessage());\n }\n exit();\n }\n elseif (isset($_GET['error'])) {\n exit('ERROR: '.$_GET['error'].' - '.$_GET['error_description']);\n }\n}",
"private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }",
"public function findToken($userId, $code, $type)\n {\n return $this->createTokenQuery()->where(['user_id' => $userId, 'code' => $code, 'type' => $type])->one();\n }",
"function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t} \n\t\t$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);\n\t\t$token = OAuthUtil::parse_parameters($request);\n\t\t$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}",
"public function getAccessToken($user = null)\r\n {\r\n if (!in_array('curl', get_loaded_extensions()))\r\n {\r\n throw new \\RuntimeException('php curl extension not found inside your loaded php extensions, please install this module otherwise this bundle won\\'t work!');\r\n }\r\n\r\n $this->assertion['audience'] = urlencode($this->audience_url);\r\n if (isset($_POST['assertion'])&&($_POST['assertion'])) $this->assertion['assertion'] = $_POST['assertion'];\r\n\r\n $verifier_token = json_decode($this->__verifierPost($this->verifier_url, $this->assertion)); // 'https://verifier.login.persona.org/verify'\r\n if ($verifier_token && $verifier_token->status === 'okay')\r\n {\r\n // temporary save the access token values ...\r\n $this->session->set('persona_email', $verifier_token->email);\r\n $this->session->set('persona_expires', $verifier_token->expires);\r\n $this->session->set('persona_status', $verifier_token->status);\r\n\r\n // toke verfied and valid (not expired)\r\n return $verifier_token;\r\n }\r\n\r\n /* Return null for failure */\r\n return null;\r\n }",
"public function getToken($dataUser)\n {\n $v = new Validator($dataUser);\n $v->rule('required', ['email', 'password'])->message('{field} - is required');\n if (!$v->validate()) {\n return $this->fail($v->errors());\n }\n\n $authorize = $this->request('post', '/auth', $dataUser);\n try {\n $response = $authorize->getContent('data');\n\n if (isset($response['errors']['error'])) {\n return $this->fail($response['errors']['error']);\n }\n if (!$response['token'] && $response['error']) {\n return $this->fail($response['error']);\n }\n self::$token = $response['token'];\n return $this->success($response);\n } catch (\\Exception $e) {\n return null;\n }\n return null;\n }",
"abstract protected function getUserByToken($token);",
"public function get_auth_code( $code ) {\n\t\t$tokens = new Token_User( '_indieauth_code_' );\n\t\treturn $tokens->get( $code );\n\t}",
"public static function get_token() {\n global $USER;\n $sid = session_id();\n return self::get_token_for_user($USER->id, $sid);\n }",
"public function getAccessTokenByCode()\n {\n $data = [\n 'client_id' => $this->oauth_client_id,\n 'client_secret' => $this->oauth_client_secret,\n // Normally redirect_uri is not required, but for convenience when login to FB it's here\n 'redirect_uri' => $this->oauth_redirect_uri,\n 'grant_type' => 'authorization_code',\n 'code' => isset($_GET['code']) ? $_GET['code'] : '',\n ];\n return $this->sendRequest($this->oauth_access_token_url, $data);\n }",
"public function get_user()\n {\n $token = $this->CI->input->get_request_header('Authorization', TRUE);\n $token_json = base64_decode($token);\n $token = json_decode($token_json);\n $userid = $token->userId;\n $username = $token->userName;\n return ['id'=>$userid,'name'=>$username];\n }",
"public function retrieveUserCodeUsingAPIKey($user_code)\n {\n $post_data = array(\n 'user_code' => $user_code\n );\n return $this->startAnonymous()->uri(\"/oauth2/device/user-code\")\n ->bodyHandler(new FormDataBodyHandler($post_data))\n ->get()\n ->go();\n }",
"private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }",
"function retrieveUserByAccessToken($accessToken);",
"public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"protected function __token($user, $pass){\n $response = $this->cURL->post($this->endpoint . '/' . $this->args['oauth'],\n $vars = array('client_id' => $this->clientID, 'client_secret' => $this->clientSecret, 'grant_type' => 'password','password' => $pass,'username' => $user));\n if($response->headers['Status-Code'] == 401){\n throw new RuntimeException($response->body);\n return 0;\n }\n $res = json_decode($response->body, TRUE);\n $_SESSION['access_token'] = $this->access_token = $res['access_token'];\n return $this->access_token;\n }",
"public static function get_oauth_token($auth) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&code=\".$auth.\"&grant_type=authorization_code\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"protected function get_token()\n\t{\n\t\t$args = func_get_args();\n\t\t$url = \"\";\n\t\t$auto_load_response = false;\n\n\t\tforeach ($args as $v)\n\t\t{\n\t\t\tif (is_string($v))\n\t\t\t{\n\t\t\t\t$url = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_bool($v))\n\t\t\t{\n\t\t\t\t$auto_load_response = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!$url)\n\t\t{\n\t\t\ttrigger_error(\"Method get_token expects a url.\");\n\t\t}\n\n\t\t$this->execute_request($this->auth_http_method == SPOAuthClient::HTTP_AUTH_HEADER ? SPOAuthClient::HTTP_AUTH_GET : $this->auth_http_method, $url);\n\n\t\t//! remove oauth_token and oauth_secret, they will be loaded (if any returned) in the next lines of code)\n\t\t$this->oauth_token = null;\n\t\t$this->oauth_token_secret = null;\n\t\t$this->__oauth_access_token = null;\n\n\t\tif ($auto_load_response && $this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\t$response_data = SPUtils::parse_query($this->http_response_body);\n\n\t\t\tif (is_array($response_data))\n\t\t\t{\n\t\t\t\tforeach ($response_data as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$this->__oauth[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}",
"public function getBearerToken()\n\t{\n\t\t$ch = curl_init($this->oauthURI);\n\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->generateHeader());\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->oauthBody);\n\n\t\t$results = curl_exec($ch);\n\t\t\n\t\t$this->lastCurlInfo = curl_getinfo($ch);\n\n\t\tif($this->lastCurlInfo['http_code'] != 200)\n\t\t\tthrow new OAuthException('Token request failed', \n\t\t\t\t\t\t\t\t\t $this->lastCurlInfo);\n\n\t\t$token = json_decode($results);\n\t\t$this->bearerToken = $token->access_token;\n\n\t\treturn $this->bearerToken;\n\t}",
"function retrieveAddressForToken()\n{\n $usertoken = $_SESSION['usertoken'];\n\n $payload = array(\n 'identifier' => $usertoken, //required\n );\n\n //this will return a jsonencoded array with a payment information about the user if found\n $endpoint = 'https://api.coinbee.io/retrieve/address/identifier';\n\n return doCurl($endpoint, $payload);\n}",
"public function get($code)\n\t{\n\t\t$result = $this->run('SELECT * FROM oauth_auth_codes WHERE auth_code = ?', [$code]);\n\t\tif (count($result) === 1) {\n\t\t\t$token = new AuthCodeEntity($this->server);\n\t\t\t$token->setId($result[0]['auth_code']);\n\t\t\t$token->setRedirectUri($result[0]['client_redirect_uri']);\n\t\t\t$token->setExpireTime($result[0]['expire_time']);\n\t\t\treturn $token;\n\t\t}\n\t\treturn null;\n\t}",
"public function access($code)\n\t{\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'client_secret' => $this->_config['app_secret'],\n\t\t\t'code' => $code\t\t\n\t\t);\n\t\t\n\t\t$url = $this->_access_token_endpoint.http_build_query($params);\n\t\t\n\t\t$response = file_get_contents($url);\n\t\t$params = null;\n\t\tparse_str($response, $params); \n\t\t\n\t\tif(isset($params['error']))\n\t\t{\n\t\t\treturn $this->oauth->response('failure', array(\n\t\t\t\t\t'error' => $params['error->message']\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$params = http_build_query(array(\n\t\t\t\t\t'access_token' => $params['access_token']\n\t\t\t\t)\n\t\t\t);\n\t\t\t$graph_url = $this->_graph_url.$params;\n\t\t\t$user = json_decode(file_get_contents($graph_url));\n\n\t\t\treturn $this->oauth->response('success', array(\n\t\t\t\t\t'user' => array(\n\t\t\t\t\t\t'id'\t\t=> $user->id,\n\t\t\t\t\t\t'name'\t\t=> $user->name,\n\t\t\t\t\t\t'username'\t=> $user->username,\n\t\t\t\t\t\t'email'\t\t=> $user->email\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"private function get_token(&$request, $consumer, $token_type=\"access\") {\n $token_field = @$request->get_parameter('oauth_token');\n $token = $this->data_store->lookup_token(\n $consumer, $token_type, $token_field\n );\n if (!$token) {\n throw new OAuthException(\"Invalid $token_type token: $token_field\");\n }\n return $token;\n }",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }",
"function getAccessToken($uid = FALSE, $oauth_token = NULL) {\n\t\t$parameters = array();\n\t\t//if (!empty($uid)) {\n\t\t\t//$parameters['uid'] = $uid;\n\t\t//}\n\t\tif (!empty($oauth_token)) {\n\t\t\t$parameters['oauth_token'] = $oauth_token;\n\t\t\t//$this->token = $oauth_token;\n\t\t}\n\t\t$request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters);\n\t\t$token = OAuthUtil::parse_parameters($request);\n\t\t$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}",
"public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }",
"public function generateRefreshToken($code, $client_id, $client_secret) {\n //get crm token credentials\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n\n if(is_null($zohoCredentials)) {\n $this::create([\n 'user_id' => Auth::user()->id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n ]);\n }\n\n\n $token = AccessToken::where('user_id', Auth::user()->id)->first();\n\n $post = [\n 'code' => $code,\n 'redirect_uri' => 'http://example.com/callbackurl',\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n // curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/x-www-form-urlencoded'\n ));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n if(isset(json_decode($response, true)['access_token'])) {\n if(is_null($token)){\n AccessToken::create([\n 'user_id'=>Auth::user()->id,\n 'value'=>$response,\n ]);\n\n return response(['Zoho - Token successfully created'], 200);\n }else{\n $token->value=$response;\n $token->save();\n }\n } else {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'access_token' => [$response],\n ]);\n throw $error;\n }\n }",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"function genera_token ($user, $profile)\r\n{\r\n\t$token = \"\";\r\n\r\n\t/* Aqui estaria el algoritmo para la generacion\r\n\tdel token */\r\n\r\n\treturn $token;\r\n}",
"public function tokenAction() {\n // load global variables\n $validator = $this->view->validator;\n $site = $this->view->site;\n $errors = $this->view->errors;\n\n // read the token info from `headers: { Authorization }`\n $tokenInfo = $validator->checkOAuthToken( $site, 'read', true, $errors, false);\n $user = $tokenInfo['user'];\n\n // echo '$tokenInfo[user] => <pre>'.print_r($tokenInfo['user'], true).'</pre>';\n\n header('Content-Type: application/json');\n if ($user) {\n http_response_code(200);\n BeMaverick_Cookie::updateUserCookie( $user );\n echo json_encode(array(\n 'status' => 'success',\n 'message' => 'User authenticated successfully',\n ));\n exit();\n } else {\n http_response_code(401);\n echo json_encode(array(\n 'status' => 'error',\n 'message' => 'User not authenticated',\n ));\n exit();\n }\n }",
"private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials',\n 'app_id' => C( 'SMS_189_KEY' ),\n 'app_secret' => C( 'SMS_189_SECRET' )\n ) ) );\n\n }",
"public function getToken()\n {\n $authHeader = $this->getHeader('AUTHORIZATION');\n $authQuery = $this->getQuery('token');\n\n return $authQuery ? $authQuery : $this->parseBearerValue($authHeader);\n }",
"public function GetToken($data){ \n \n return $this->token;\n \n }",
"function lookup_token($consumer, $token_type, $token) {/*{{{*/\n $tokEnt = oauth_lookup_token_entity($token, $token_type, $consumer);\n if ($tokEnt) {\n return oauth_token_from_entity($tokEnt);\n } else {\n return NULL;\n }\n }",
"public function getBearerToken()\n {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->returnResponse(ATHORIZATION_HEADER_NOT_FOUND, null, 'Access Token Not found');\n }",
"public function requestToken($code)\n {\n $parameters = [\n 'client_id' => config('twitch-api.client_id'),\n 'client_secret' => config('twitch-api.client_secret'),\n 'redirect_uri' => config('twitch-api.redirect_url'),\n 'code' => $code,\n 'grant_type' => 'authorization_code'\n ];\n\n try {\n $client = new Client();\n $response = $client->post(config('twitch-api.api_url') . '/kraken/oauth2/token?api_version=5', ['body' => $parameters]);\n $response = json_decode($response->getBody()->getContents(), true);\n if (isset($response['access_token'])) {\n return $response['access_token'];\n }\n\n } catch (\\Exception $e) {\n\n throw $e;\n }\n }",
"function requestToken() {\n\t\t$conn = new Connection('DB-Name');\n\n\t\t//instantiate login information, api_key, username, and password\n\t\t$api = $conn->tokenGrab(x);\n\t\t$user = $conn->tokenGrab(x);\n\t\t$pass = $conn->tokenGrab(x);\n\n\t\t//build fields to send to the token giver\n\t\t$fields = array(\n\t\t\t'grant_type' \t=> urlencode('password')\n\t\t\t, 'client_id' \t=> urlencode($api)\n\t\t\t, 'username' \t=> urlencode($user)\n\t\t\t, 'password'\t=> urlencode($pass));\n\n\t\t$fields_string = '';\n\t\tforeach ($fields as $key=>$value) { $fields_string .= $key . '=' . $value . '&'; }\n\t\trtrim($fields_string, '&');\n\n\t\t//send the request to token giver via cURL\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $conn->tokenGrab(x));\n\t\tcurl_setopt($ch, CURLOPT_POST, count($fields));\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t 'Content-Type' => urlencode('application/x-www-form-urlencoded')\n\t\t\t, 'Content-Length' => urlencode(strlen($fields_string))\n\t\t));\n\n\t\t$cherwellApiResponse = json_decode(curl_exec($ch), TRUE);\n\t\treturn $cherwellApiResponse['access_token'];\n\t}",
"public function getZaloTokenFromCodeByOA($code, $codeVerifier)\n {\n $endpoint = '/oa/access_token';\n return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);\n }",
"public function getSecurityToken($accessCode);",
"abstract public function getAuthToken();",
"function getAccessToken($userID);",
"public function obtenerAuthToken()\n {\n $controller = new SignaBlockController;\n $response = $controller->auth();\n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->token;\n }\n }\n return response()->json($this->jsonError);\n }",
"public function getToken(Request $request)\n {\n $email = $request->input('username');\n $password = $request->input('password');\n //checking if user exists\n $user = User::where('email', $email)->get();\n if ($user->count() > 0) {\n $user = $user[0];\n if (Hash::check($password, $user->password)) {\n $role = $user->app_role;\n\n $oauth_client = DB::table('oauth_clients')->where('password_client', 1)->first();\n $request->request->add([\n 'grant_type' => 'password',\n 'client_id' => $oauth_client->id,\n 'client_secret' => $oauth_client->secret,\n 'scope' => '*',\n ]);\n $tokenRequest = Request::create(\n '/oauth/token',\n 'post'\n );\n return Route::dispatch($tokenRequest);\n\n// $temp = Route::dispatch($tokenRequest);\n// return $temp->expires_in;\n// return Carbon::parse($temp->expires_in)->toDateTimeString();\n } else {\n //type = 2 => incorrect passowrd\n return [\n 'error' => '2',\n 'errorType' => 'auth'];\n }\n } else {\n //type= 1 => no such user exists\n return [\n 'error' => '1',\n 'errorType' => 'auth'];\n }\n }",
"public function generateAccessToken($token){\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n $tokenval = json_decode($token->value);\n $refresh_token=$tokenval->refresh_token;\n\n $post = [\n 'refresh_token' => $refresh_token,\n 'redirect_uri' => 'http://example.com/callbackurl',\n 'client_id' => $zohoCredentials->client_id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_secret' => $zohoCredentials->client_secret,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'grant_type' => 'refresh_token',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n\n if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200) {\n $tokenval->access_token = json_decode($response)->access_token;\n $token->value=json_encode($tokenval);\n $token->save();\n }\n\n return json_decode($token->value)->access_token;\n }",
"private function __get_access_token() {\r\n // Access token exists in a cookie\r\n if($_COOKIE[ACCESS_TOKEN_COOKIE_NAME]) {\r\n parse_str($_COOKIE[ACCESS_TOKEN_COOKIE_NAME], $tok); \r\n return $tok;\r\n }\r\n\r\n // Handling a redirect back from login\r\n else if($_COOKIE[REQUEST_TOKEN_COOKIE_NAME] && $_REQUEST['oauth_verifier'] && $_REQUEST['oauth_token']) {\r\n $tok = YMClient::oauth_token_from_query_string($_COOKIE[REQUEST_TOKEN_COOKIE_NAME]);\r\n\r\n if($tok['oauth_token'] != $_REQUEST['oauth_token']) {\r\n throw new Exception(\"Cookie and URL disagree about request token value\");\r\n }\r\n\r\n $tok['oauth_verifier'] = $_REQUEST['oauth_verifier']; \r\n $newtok = $this->ymc->oauth_get_access_token($tok);\r\n\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, \"\", time()-3600);\r\n setcookie(ACCESS_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($newtok));\r\n return $newtok;\r\n }\r\n\r\n // Sending the user to login to grant access to this app\r\n else {\r\n list ($tok, $url) = $this->ymc->oauth_get_request_token($this->callbackURL);\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($tok));\r\n header(\"Location: $url\");\r\n }\r\n }",
"public function LoginToken_get()\n {\n $tokenData['user_id'] = '1';\n $tokenData['role'] = 'admin';\n $tokenData['first_name'] = 'Al';\n $tokenData['last_name'] = 'Mobin';\n $tokenData['phone'] = '+8801921040960';\n $jwtToken = $this->tokenHandler->GenerateToken($tokenData);\n $token = $jwtToken;\n echo json_encode(array('Token'=>$jwtToken));\n }",
"public function actionAccesstoken()\n {\n $authParam = Yii::$app->getRequest()->getBodyParam('auth');\n \n if (!$authParam) {\n throw new NotFoundHttpException(\"There's no authorization code provided.\");\n }\n \n $model = Customer::find()->where(['auth_code' => $authParam])->andWhere(['>', 'auth_expired', time()])->one();\n \n if ($model === null) {\n throw new NotFoundHttpException(\"Invalid authorization code.\");\n }\n \n $model->token_code = md5(uniqid());\n $model->token_expired = time() + (60 * 60 * 24 * 60); // 60 days\n $model->save(false);\n \n $data = [\n 'access_token' => $model->token_code,\n 'expired_at' => $model->tokenExpired\n ];\n \n return $data;\n }",
"private function getUserFromAccessToken($token) {\n\t\t$clientId = $this->getClientIdFromAccessToken($token);\n\t\t$user = $this->dm->getRepository('MongoDocs\\User')->findOneByApiClientId($clientId);\n\t\treturn $user;\n\t}",
"public function voxy_login_by_user()\n {\n $data = $this->input->post();\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n\n $api_data = $this->m_voxy_connect->get_a_user_auth_token($data['external_user_id']);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Lấy link vào học Voxy thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\n }",
"public static function find_token_for_user($user) {\n\t\tif(is_null($user) OR str::e($user)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif(!is_object($user)) {\n\t\t\t$user = new Model_User($user);\n\t\t}\n\t\t\n\t\t$data = self::db()->where('user_token_user_id', $user->id)->get('user_tokens')->row_array();\n\t\tif($data === FALSE) {\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\t$token = new Model_UserToken(NULL, FALSE);\n\t\t\t$token->set($data);\n\t\t\treturn $token;\n\t\t}\n\t}",
"protected function getToken()\n {\n // We have a stateless app without sessions, so we use the cache to\n // retrieve the temp credentials for man in the middle attack\n // protection\n $key = 'oauth_temp_'.$this->request->input('oauth_token');\n $temp = $this->cache->get($key, '');\n\n return $this->server->getTokenCredentials(\n $temp,\n $this->request->input('oauth_token'),\n $this->request->input('oauth_verifier')\n );\n }",
"public function getToken($user_id)\n {\n $url = $this->url . '/user/assign/token';\n\n $postData = json_encode([\n \"authCode\" => $user_id\n ]);\n\n $url = $url . '?' . $this->getParam([], $postData);\n\n $data = [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'app_key' => $this->key\n ],\n 'body' => $postData\n ];\n $result = $this->urlpost($url, $data);\n if (isset($result['success']) and $result['success'] == 1) {\n $token_key = 'token_' . $user_id;\n $this->redis->set($token_key, $result['data']['token']);\n }\n return $result['data']['token'];\n }",
"public function getOAuthToken(Request $request)\n {\n $bridgedRequest = \\OAuth2\\HttpFoundationBridge\\Request::createFromRequest($request->instance());\n\n $bridgedResponse = new \\OAuth2\\HttpFoundationBridge\\Response();\n\n /*Log::info('$bridgedRequest'. print_r($bridgedRequest, true));\n Log::info('$bridgedResponse'. print_r($bridgedResponse, true));*/\n\n\n $bridgedResponse = \\App::make('oauth2')->handleTokenRequest($bridgedRequest, $bridgedResponse);\n\n return $bridgedResponse;\n }",
"public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }",
"private function get_token() {\n $uri = $this->settings->hostname.\"oauth/token\";\n //echo \"POST $uri\\n\";\n\n $data = array(\n \"grant_type\" => \"password\",\n \"client_id\" => $this->settings->client_id,\n \"client_secret\" => $this->settings->client_secret,\n \"username\" => $this->settings->username,\n \"password\" => $this->settings->password\n );\n $postdata = http_build_query($data);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $uri);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/x-www-form-urlencoded'));\n\n $curl_response = curl_exec($ch);\n\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $curl_error_number = curl_errno($ch);\n $curl_error = curl_error($ch);\n\n //echo $curl_response.\"\\n\"; // output entire response\n //echo $http_code.\"\\n\"; // output http status code\n\n curl_close($ch);\n $token = NULL;\n if ($http_code == 200) {\n $token = json_decode($curl_response);\n //var_dump($token); // print entire token object\n }\n return $token;\n }",
"function get_oauth_code($wpoa) {\n\t$params = array(\n\t\t'response_type' => 'code',\n\t\t'client_id' => CLIENT_ID,\n\t\t'scope' => SCOPE,\n\t\t'state' => uniqid('', true),\n\t\t'redirect_uri' => REDIRECT_URI,\n\t);\n\t$_SESSION['WPOA']['STATE'] = $params['state'];\n\t$url = URL_AUTH . http_build_query($params);\n\theader(\"Location: $url\");\n\texit;\n}",
"function getBearerToken() {\n $headers = getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n}",
"protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}",
"public static function generateNewToken( \\app\\models\\User $user)\n {\n $accessToken = ApiAccessToken::find()->where(['user_id' => $user->id])->one();\n if (!$accessToken) {\n $accessToken = new ApiAccessToken();\n $accessToken->user_id = $user->id;\n }\n $accessToken->access_token = Yii::$app->security->generateRandomString( self::ACCESS_TOKEN_LENGTH );\n $accessToken->exp_date = date('Y-m-d H:i:s', strtotime(\"now +\" . self::EXPIRATION_PERIOD ));\n return $accessToken;\n }",
"public function actionToken(){\n try{\n $params = Yii::$app->request->post();\n\n $user = $this->auth($params['username'], $params['password']);\n if ($user === null){\n throw new UnauthorizedHttpException('Wrong username or password');\n }\n $response['success'] = true;\n $response['token'] = User::findByUsername($user->username)->auth_key;\n $response['id'] = $user->id;\n } catch (\\Exception $e){\n throw $e;\n }\n return $response;\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->throwError( ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public static function getUser();",
"abstract public function url_access_token();",
"public function userTokenAuth(Request $request)\n {\n $header = $request->header('Authorization');\n if (Str::startsWith($header, 'Bearer ')) {\n $header = Str::substr($header, 7);\n }else{\n response()->json($this->apiResponse(false,null,'Authorization syntax error'),200)->send();\n die();\n }\n\n /*\n * Check the User Token\n */\n $user = User::where('token',$header)->get()->first();\n\n if($user != null){\n\n if($user->status == 0){\n\n /*\n * Blocked User\n */\n response()->json($this->apiResponse(false,null,'هذا الحساب تم حظره من قبل مسؤول النظام' ),200)->send();\n die();\n }else{\n\n return $user;\n\n }\n\n }else{\n\n response()->json($this->apiResponse(false,null,'يجب ان تقوم بتسجيل الدخول لكي تتمكن من تصفح التطبيق'),200)->send();\n die();\n }\n }",
"private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}",
"private function _getToken()\n {\n $postData = array(\n 'UserApiKey' => $this->username,\n 'SecretKey' => $this->password,\n 'System' => 'joomla_acy_3_5_v_3_0'\n );\n $postString = json_encode($postData);\n\n $ch = curl_init($this->apidomain.$this->getApiTokenUrl());\n curl_setopt(\n $ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n )\n );\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);\n\n $result = curl_exec($ch);\n curl_close($ch);\n\n $response = json_decode($result);\n $resp = false;\n if (is_object($response)) {\n @$IsSuccessful = $response->IsSuccessful;\n if ($IsSuccessful == true) {\n @$TokenKey = $response->TokenKey;\n $resp = $TokenKey;\n } else {\n $resp = false;\n }\n }\n return $resp;\n }",
"public function fetch_request_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // no token required for the initial token request\n $token = NULL;\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $callback = $request->get_parameter('oauth_callback');\n $new_token = $this->data_store->new_request_token($consumer, $callback);\n\n return $new_token;\n }",
"public function getBearerToken()\r\n {\r\n $header = $this->getAuthorizationHeader();\r\n // HEADER: Get the access token from header\r\n if(!empty($header))\r\n {\r\n if(preg_match('/Bearer\\s(\\S+)/', $header, $matches))\r\n {\r\n return $matches[1];\r\n }\r\n }\r\n $this->throwError(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not Found.');\r\n }",
"public static function apiLogin($user, $array = []){\n foreach ($user->validOauthAccessTokens as $validOauthAccessToken) {\n return ArrayHelper::merge($array, [\n 'access-token' => $validOauthAccessToken->access_token\n ]);\n }\n // no access tokens found\n $fm = (new MuffinHelper())->init();\n $token = $fm->create(OauthAccessTokenMuffin::className(),[\n 'user_id' => $user->id\n ]);\n return ArrayHelper::merge($array, [\n 'access-token' => $token->access_token\n ]);\n }",
"private function selectUserToken()\n {\n return $this->selectParsedData( ['id_komisu'] );\n }",
"public function createToken();",
"private function getAuthToken(Authenticatable $user, AuthorizationHeaderToken $token): AuthToken\n {\n return AuthToken::where('user_id', '=', $user->getAuthIdentifier())\n ->where('token', '=', $token->getToken())\n ->first();\n }",
"public function auth() {\n \n // state 1 requires a GET variable to exist\n if($this->state == 1 && !isset($_GET['oauth_verifier'])) {\n $this->state = 0;\n }\n\n // Step 1: Get a request token\n if($this->state == 0) {\n return $this->getRequestToken();\n }\n\n // Step 2: Get an access token\n elseif($this->state == 1) {\n return $this->getAccessToken();\n }\n\n // Step 3: Verify the access token\n return $this->verifyAccessToken();\n }"
] | [
"0.6548133",
"0.62418205",
"0.6216023",
"0.61993533",
"0.616934",
"0.6165256",
"0.6163069",
"0.61442304",
"0.6139946",
"0.611449",
"0.6088107",
"0.60616255",
"0.60541344",
"0.60380435",
"0.6021874",
"0.60201627",
"0.6005444",
"0.60038644",
"0.5966843",
"0.59653574",
"0.59642434",
"0.59437406",
"0.5939351",
"0.59368527",
"0.59281397",
"0.59236836",
"0.5909527",
"0.5901398",
"0.590007",
"0.588922",
"0.58646685",
"0.58630353",
"0.5859042",
"0.5854535",
"0.5844611",
"0.5841058",
"0.58357894",
"0.58116585",
"0.5808737",
"0.58028954",
"0.57982576",
"0.5796125",
"0.5790982",
"0.5790982",
"0.5790982",
"0.5790982",
"0.57757217",
"0.57715565",
"0.5771268",
"0.5769858",
"0.5748219",
"0.5748219",
"0.5748219",
"0.5748219",
"0.5748219",
"0.57463855",
"0.5744994",
"0.5732335",
"0.5730717",
"0.5725057",
"0.57187396",
"0.569075",
"0.56846243",
"0.5681196",
"0.56755173",
"0.5674104",
"0.56731236",
"0.5667216",
"0.56584746",
"0.5657069",
"0.5652936",
"0.56510705",
"0.56443983",
"0.5628164",
"0.5624579",
"0.56241894",
"0.5617167",
"0.56168187",
"0.5613408",
"0.5611023",
"0.5602389",
"0.56017685",
"0.55920535",
"0.5591679",
"0.55912066",
"0.5568055",
"0.55649424",
"0.5563469",
"0.55601543",
"0.5558213",
"0.5556778",
"0.5538721",
"0.55331534",
"0.55236316",
"0.5522878",
"0.5522162",
"0.55135727",
"0.5508281",
"0.55034983",
"0.54929876"
] | 0.6042526 | 13 |
Get Zalo Token by OA from a oauth code. | public function getZaloTokenFromCodeByOA($code, $codeVerifier)
{
$endpoint = '/oa/access_token';
return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_oauth_code($wpoa) {\n\t$params = array(\n\t\t'response_type' => 'code',\n\t\t'client_id' => CLIENT_ID,\n\t\t'scope' => SCOPE,\n\t\t'state' => uniqid('', true),\n\t\t'redirect_uri' => REDIRECT_URI,\n\t);\n\t$_SESSION['WPOA']['STATE'] = $params['state'];\n\t$url = URL_AUTH . http_build_query($params);\n\theader(\"Location: $url\");\n\texit;\n}",
"public function get_access_token($oauth_token, $oauth_addon);",
"public function requestToken($code) {\n $client = new Zend_Http_Client();\n $queryParams = array(\n 'client_id' => self::CLIENT_ID,\n 'client_secret' => self::CLIENT_SECRET,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n )),\n 'code' => $code\n );\n $client->setUri(self::OAUTH_CALLBACK);\n $client->setParameterGet($queryParams);\n\n try {\n $response = $client->request();\n } catch (Zend_Http_Client_Exception $e) { // timeout or host not accessible\n return;\n }\n\n // error in response\n if ($response->isError()) {\n return;\n }\n\n $result = Zend_Json::decode($response->getBody());\n if (isset($result['access_token'])) {\n $token = $result['access_token'];\n return $token;\n }\n return;\n }",
"public function get_token($code = \"\") {\n global $cfg;\n\n $method = \"oauth.access\";\n\n $payload = array(\n 'code' => $code,\n );\n\n // Make the API request.\n if ($result = $this->apicall($method, $payload)) {\n \n $this->app_id = $result['app_id'];\n $this->app_user_id = $result['app_user_id'];\n $this->installer_user_id = $result['installer_user']['user_id'];\n $this->access_token = $result['access_token'];\n $this->userid = $result['user_id'];\n $this->teamid = $result['team_id'];\n $this->teamname = $result['team_name'];\n $this->webhook->channel_id = $result['incoming_webhook']['channel_id'];\n $this->webhook->channel = $result['incoming_webhook']['channel'];\n $this->webhook->configuration_url = $result['incoming_webhook']['configuration_url'];\n $this->webhook->url = $result['incoming_webhook']['url'];\n $this->bot->user_id = $result['bot']['bot_user_id'];\n $this->bot->access_token = $result['bot']['bot_access_token'];\n\n // write to file (for now; DB later)\n if ($this->store_token()) {\n return TRUE;\n }\n }\n return FALSE;\n }",
"public function getAuthorizationCode()\n {\n $oauth_param = array(\n 'grant_type' => $this->grant_type, \n 'client_id' => config::$clientId,\n 'client_secret' => config::$secretKey,\n 'scope' => implode(',', $this->scope));\n\n $url = config::$apiUrl . 'oauth/access_token';\n $response = $this->curl->request('post', $url, $oauth_param);\n\n if( $response )\n {\n $res = json_decode($response);\n if( isset($res->access_token) )\n {\n $this->setExpiresAtFromTimeStamp($res->expires);\n $this->session->write('access_token',$res->access_token);\n $this->session->write('expires', $this->expiresAt);\n\n $read = $this->session->read('access_token');\n session_write_close();\n }\n elseif( isset($res->error) )\n {\n die($response);\n }\n }\n }",
"public function getAccessTokenByCode()\n {\n $data = [\n 'client_id' => $this->oauth_client_id,\n 'client_secret' => $this->oauth_client_secret,\n // Normally redirect_uri is not required, but for convenience when login to FB it's here\n 'redirect_uri' => $this->oauth_redirect_uri,\n 'grant_type' => 'authorization_code',\n 'code' => isset($_GET['code']) ? $_GET['code'] : '',\n ];\n return $this->sendRequest($this->oauth_access_token_url, $data);\n }",
"public function getZaloTokenFromRefreshTokenByOA($refreshToken)\n {\n $endpoint = '/oa/access_token';\n return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);\n }",
"public function getBearerToken()\n\t{\n\t\t$ch = curl_init($this->oauthURI);\n\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->generateHeader());\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->oauthBody);\n\n\t\t$results = curl_exec($ch);\n\t\t\n\t\t$this->lastCurlInfo = curl_getinfo($ch);\n\n\t\tif($this->lastCurlInfo['http_code'] != 200)\n\t\t\tthrow new OAuthException('Token request failed', \n\t\t\t\t\t\t\t\t\t $this->lastCurlInfo);\n\n\t\t$token = json_decode($results);\n\t\t$this->bearerToken = $token->access_token;\n\n\t\treturn $this->bearerToken;\n\t}",
"public function getSecurityToken($accessCode);",
"function getAccessToken($token = NULL) {\n\t\t$r = $this->oAuthRequest ( $this->accessTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"public function get($code)\n\t{\n\t\t$result = $this->run('SELECT * FROM oauth_auth_codes WHERE auth_code = ?', [$code]);\n\t\tif (count($result) === 1) {\n\t\t\t$token = new AuthCodeEntity($this->server);\n\t\t\t$token->setId($result[0]['auth_code']);\n\t\t\t$token->setRedirectUri($result[0]['client_redirect_uri']);\n\t\t\t$token->setExpireTime($result[0]['expire_time']);\n\t\t\treturn $token;\n\t\t}\n\t\treturn null;\n\t}",
"public function get_token( $type = 'access_token' ){\n\t\t$token = NULL;\n\t\tif( $this->token_storage == 'file' ){\n\t\t\tif( is_file($this->token_files[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( file_get_contents($this->token_files[$type]) );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// add method to get token from cookie\n\t\t\tif( !empty($_COOKIE[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( $_COOKIE[$type] );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }",
"public static function get_oauth_token($auth) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&code=\".$auth.\"&grant_type=authorization_code\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"public function gettoken()\n{\n if (isset($_GET['code'])) {\n // Check that state matches\n if (isset($_GET['state']) && isset($_SESSION['oauth_state'])) {\n if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth_state'])) {\n exit('State provided in redirect does not match expected value.');\n } \n // Clear saved state\n unset($_SESSION['oauth_state']); \n }\n\n // Initialize the OAuth client\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => $this->config->item('OAUTH_APP_ID'),\n 'clientSecret' => $this->config->item('OAUTH_APP_PASSWORD'),\n 'redirectUri' => $this->config->item('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => $this->config->item('OAUTH_SCOPES')\n ]);\n\n try {\n\n // Make the token request\n $accessToken = $oauthClient->getAccessToken('authorization_code', [\n 'code' => $_GET['code']\n ]);\n\n //echo 'Access token: '.$accessToken->getToken();\n return $accessToken->getToken();\n }\n catch (League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException $e) {\n exit('ERROR getting tokens: '.$e->getMessage());\n }\n exit();\n }\n elseif (isset($_GET['error'])) {\n exit('ERROR: '.$_GET['error'].' - '.$_GET['error_description']);\n }\n}",
"public function requestToken($code)\n {\n $parameters = [\n 'client_id' => config('twitch-api.client_id'),\n 'client_secret' => config('twitch-api.client_secret'),\n 'redirect_uri' => config('twitch-api.redirect_url'),\n 'code' => $code,\n 'grant_type' => 'authorization_code'\n ];\n\n try {\n $client = new Client();\n $response = $client->post(config('twitch-api.api_url') . '/kraken/oauth2/token?api_version=5', ['body' => $parameters]);\n $response = json_decode($response->getBody()->getContents(), true);\n if (isset($response['access_token'])) {\n return $response['access_token'];\n }\n\n } catch (\\Exception $e) {\n\n throw $e;\n }\n }",
"private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials',\n 'app_id' => C( 'SMS_189_KEY' ),\n 'app_secret' => C( 'SMS_189_SECRET' )\n ) ) );\n\n }",
"public function actionAccesstoken()\n {\n $authParam = Yii::$app->getRequest()->getBodyParam('auth');\n \n if (!$authParam) {\n throw new NotFoundHttpException(\"There's no authorization code provided.\");\n }\n \n $model = Customer::find()->where(['auth_code' => $authParam])->andWhere(['>', 'auth_expired', time()])->one();\n \n if ($model === null) {\n throw new NotFoundHttpException(\"Invalid authorization code.\");\n }\n \n $model->token_code = md5(uniqid());\n $model->token_expired = time() + (60 * 60 * 24 * 60); // 60 days\n $model->save(false);\n \n $data = [\n 'access_token' => $model->token_code,\n 'expired_at' => $model->tokenExpired\n ];\n \n return $data;\n }",
"public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }",
"function get_oauth_identity($wpoa) {\n\t// set the access token param:\n\t$params = array(\n\t\t'access_token' => $_SESSION['WPOA']['ACCESS_TOKEN'], // PROVIDER SPECIFIC: the access_token is passed to Google via POST param\n\t);\n\t$url_params = http_build_query($params);\n\t// perform the http request:\n\tswitch (strtolower(HTTP_UTIL)) {\n\t\tcase 'curl':\n\t\t\t$url = URL_USER . $url_params; // TODO: we probably want to send this using a curl_setopt...\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\t\t// PROVIDER NORMALIZATION: Github/Reddit require a User-Agent here...\n\t\t\t// PROVIDER NORMALIZATION: PayPal/Reddit require that we send the access token via a bearer header, PayPal also requires a Content-Type: application/json header, LinkedIn requires an x-li-format: json header...\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t$result = curl_exec($curl);\n \n\t\t\t$result_obj = json_decode($result, true);\n\t\t\tbreak;\n\t\tcase 'stream-context':\n\t\t\t$url = rtrim(URL_USER, \"?\");\n\t\t\t$opts = array('http' =>\n\t\t\t\tarray(\n\t\t\t\t\t'method' => 'GET',\n\t\t\t\t\t// PROVIDER NORMALIZATION: Reddit/Github requires User-Agent here...\n\t\t\t\t\t'header' => \"Authorization: Bearer \" . $_SESSION['WPOA']['ACCESS_TOKEN'] . \"\\r\\n\" . \"x-li-format: json\\r\\n\", // PROVIDER SPECIFIC: i think only LinkedIn uses x-li-format...\n\t\t\t\t)\n\t\t\t);\n\t\t\t$context = $context = stream_context_create($opts);\n\t\t\t$result = @file_get_contents($url, false, $context);\n\t\t\tif ($result === false) {\n\t\t\t\t$wpoa->wpoa_end_login(\"Sorry, we couldn't log you in. Could not retrieve user identity via stream context. Please notify the admin or try again later.\");\n\t\t\t}\n\t\t\t$result_obj = json_decode($result, true);\n\t\t\tbreak;\n\t}\n\t// parse and return the user's oauth identity:\n \n\t$oauth_identity = array();\n\t$oauth_identity['provider'] = $_SESSION['WPOA']['PROVIDER'];\n\t$oauth_identity['id'] = $result_obj['id']; // PROVIDER SPECIFIC: Google returns the user's OAuth identity as id\n $_SESSION['WPOA']['USERSELF'] = $result_obj;\n\t//$oauth_identity['email'] = $result_obj['emails'][0]['value']; // PROVIDER SPECIFIC: Google returns an array of email addresses. To respect privacy we currently don't collect the user's email address.\n\tif (!$oauth_identity['id']) {\n\t\t$wpoa->wpoa_end_login(\"Sorry, we couldn't log you in. User identity was not found. Please notify the admin or try again later.\");\n\t}\n \n\treturn $oauth_identity;\n}",
"protected function get_token()\n\t{\n\t\t$args = func_get_args();\n\t\t$url = \"\";\n\t\t$auto_load_response = false;\n\n\t\tforeach ($args as $v)\n\t\t{\n\t\t\tif (is_string($v))\n\t\t\t{\n\t\t\t\t$url = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_bool($v))\n\t\t\t{\n\t\t\t\t$auto_load_response = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!$url)\n\t\t{\n\t\t\ttrigger_error(\"Method get_token expects a url.\");\n\t\t}\n\n\t\t$this->execute_request($this->auth_http_method == SPOAuthClient::HTTP_AUTH_HEADER ? SPOAuthClient::HTTP_AUTH_GET : $this->auth_http_method, $url);\n\n\t\t//! remove oauth_token and oauth_secret, they will be loaded (if any returned) in the next lines of code)\n\t\t$this->oauth_token = null;\n\t\t$this->oauth_token_secret = null;\n\t\t$this->__oauth_access_token = null;\n\n\t\tif ($auto_load_response && $this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\t$response_data = SPUtils::parse_query($this->http_response_body);\n\n\t\t\tif (is_array($response_data))\n\t\t\t{\n\t\t\t\tforeach ($response_data as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$this->__oauth[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}",
"public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }",
"public function getBearerToken()\n {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->returnResponse(ATHORIZATION_HEADER_NOT_FOUND, null, 'Access Token Not found');\n }",
"public function fetch_access_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // requires authorized request token\n $token = $this->get_token($request, $consumer, \"request\");\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $verifier = $request->get_parameter('oauth_verifier');\n $new_token = $this->data_store->new_access_token($token, $consumer, $verifier);\n\n return $new_token;\n }",
"public function generateRefreshToken($code, $client_id, $client_secret) {\n //get crm token credentials\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n\n if(is_null($zohoCredentials)) {\n $this::create([\n 'user_id' => Auth::user()->id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n ]);\n }\n\n\n $token = AccessToken::where('user_id', Auth::user()->id)->first();\n\n $post = [\n 'code' => $code,\n 'redirect_uri' => 'http://example.com/callbackurl',\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n // curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/x-www-form-urlencoded'\n ));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n if(isset(json_decode($response, true)['access_token'])) {\n if(is_null($token)){\n AccessToken::create([\n 'user_id'=>Auth::user()->id,\n 'value'=>$response,\n ]);\n\n return response(['Zoho - Token successfully created'], 200);\n }else{\n $token->value=$response;\n $token->save();\n }\n } else {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'access_token' => [$response],\n ]);\n throw $error;\n }\n }",
"private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }",
"private function ga_auth_get_access_token( $access_code ) {\n\t\t$request = array(\n\t\t\t'code' => $access_code,\n\t\t\t'grant_type' => 'authorization_code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => $this->config['client_id'],\n\t\t\t'client_secret' => $this->config['client_secret']\n\t\t);\n\n\t\t$response = Ga_Lib_Api_Request::get_instance()->make_request( self::OAUTH2_TOKEN_ENDPOINT, $request );\n\n\t\treturn new Ga_Lib_Api_Response( $response );\n\t}",
"public function generateAccessToken($token){\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n $tokenval = json_decode($token->value);\n $refresh_token=$tokenval->refresh_token;\n\n $post = [\n 'refresh_token' => $refresh_token,\n 'redirect_uri' => 'http://example.com/callbackurl',\n 'client_id' => $zohoCredentials->client_id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_secret' => $zohoCredentials->client_secret,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'grant_type' => 'refresh_token',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n\n if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200) {\n $tokenval->access_token = json_decode($response)->access_token;\n $token->value=json_encode($tokenval);\n $token->save();\n }\n\n return json_decode($token->value)->access_token;\n }",
"public function get_access_token($code)\n\t{\n\t\tif (!$code)\n\t\t\treturn false;\n\n\t\t$params = array(\n\t\t\t'client_id' => $this->client_id,\n\t\t\t'client_secret' => $this->client_secret,\n\t\t\t'grant_type' => 'authorization_code',\n\t\t\t'code' => $code,\n\t\t\t'redirect_uri' => $this->redirect_uri,\n\t\t);\n\n\t\t$access_token_url = 'https://api.instagram.com/oauth/access_token';\n\n\t\t// Access Token request\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $access_token_url);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $params);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t$token = json_decode($response);\n\n\t\tif (!$token)\n\t\t\treturn false;\n\n\t\treturn $token;\n\t}",
"public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }",
"public function getAccessTokenResponse($code)\n {\n $response = $this->getHttpClient()->get($this->getTokenUrl(), [\n 'query' => [\n 'grant_type' => 'authorization_code',\n 'client_id' => env('YAHOOJP_CLIENT_ID'),\n 'client_secret' => env('YAHOOJP_CLIENT_SECRET'),\n 'redirect_uri' => env('YAHOOJP_REDIRECT'),\n 'code' => $code\n ]\n ]);\n\n $user_token = json_decode($response->getBody(), true);\n $this->user = $user_token;\n\n return $user_token;\n }",
"public static function getBearerToken() {\n $headers = Authorization::extractHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n }",
"function getBearerToken() {\n $headers = getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n}",
"private function get_token(&$request, $consumer, $token_type=\"access\") {\n $token_field = @$request->get_parameter('oauth_token');\n $token = $this->data_store->lookup_token(\n $consumer, $token_type, $token_field\n );\n if (!$token) {\n throw new OAuthException(\"Invalid $token_type token: $token_field\");\n }\n return $token;\n }",
"function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t} \n\t\t$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);\n\t\t$token = OAuthUtil::parse_parameters($request);\n\t\t$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->throwError( ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"function lookup_token($consumer, $token_type, $token) {/*{{{*/\n $tokEnt = oauth_lookup_token_entity($token, $token_type, $consumer);\n if ($tokEnt) {\n return oauth_token_from_entity($tokEnt);\n } else {\n return NULL;\n }\n }",
"public static function tokenizeAuthorizationCode($environment = null, $code = null) {\r\n\r\n\t\t$user = elgg_get_logged_in_user_entity();\r\n\t\tif (!$user) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$token_request_body = array(\r\n\t\t\t'grant_type' => 'authorization_code',\r\n\t\t\t'client_secret' => self::getClientSecret($environment),\r\n\t\t\t'client_id' => self::getClientId($environment),\r\n\t\t\t'code' => $code,\r\n\t\t);\r\n\r\n\t\t$ch = curl_init(self::TokenURI);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($token_request_body));\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t\t$token_json = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$token = json_decode($token_json);\r\n\r\n\t\tif ($token && !$token->error) {\r\n\t\t\t$user->setPrivateSetting('stripe_access_token', $token->access_token);\r\n\t\t\t$user->setPrivateSetting('stripe_publishable_key', $token->stripe_publishable_key);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn $token;\r\n\t}",
"public function getBearerToken() {\n\t\t $headers = $this->getAuthorizationHeader();\n\t\t // HEADER: Get the access token from the header\n\t\t if (!empty($headers)) {\n\t\t if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n\t\t return $matches[1];\n\t\t }\n\t\t }\n\t\t return null;\n\t\t}",
"public function getBearerToken()\r\n {\r\n $header = $this->getAuthorizationHeader();\r\n // HEADER: Get the access token from header\r\n if(!empty($header))\r\n {\r\n if(preg_match('/Bearer\\s(\\S+)/', $header, $matches))\r\n {\r\n return $matches[1];\r\n }\r\n }\r\n $this->throwError(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not Found.');\r\n }",
"protected function getAccessToken($oauth_token) {\n\n\t}",
"protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}",
"public function getOAuthToken($code, $token = false)\n {\n $apiData = array(\n 'code' => $code,\n 'api_key' => $this->getApiSecret(),\n 'account_id' => $this->getAccountId(),\n 'redirect_url' => $this->getApiCallback(),\n 'grant_type' => 'authorization_code'\n );\n\n $result = $this->_makeOAuthCall($apiData);\n\n return !$token ? $result : $result->access_token;\n }",
"private function __get_access_token() {\r\n // Access token exists in a cookie\r\n if($_COOKIE[ACCESS_TOKEN_COOKIE_NAME]) {\r\n parse_str($_COOKIE[ACCESS_TOKEN_COOKIE_NAME], $tok); \r\n return $tok;\r\n }\r\n\r\n // Handling a redirect back from login\r\n else if($_COOKIE[REQUEST_TOKEN_COOKIE_NAME] && $_REQUEST['oauth_verifier'] && $_REQUEST['oauth_token']) {\r\n $tok = YMClient::oauth_token_from_query_string($_COOKIE[REQUEST_TOKEN_COOKIE_NAME]);\r\n\r\n if($tok['oauth_token'] != $_REQUEST['oauth_token']) {\r\n throw new Exception(\"Cookie and URL disagree about request token value\");\r\n }\r\n\r\n $tok['oauth_verifier'] = $_REQUEST['oauth_verifier']; \r\n $newtok = $this->ymc->oauth_get_access_token($tok);\r\n\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, \"\", time()-3600);\r\n setcookie(ACCESS_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($newtok));\r\n return $newtok;\r\n }\r\n\r\n // Sending the user to login to grant access to this app\r\n else {\r\n list ($tok, $url) = $this->ymc->oauth_get_request_token($this->callbackURL);\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($tok));\r\n header(\"Location: $url\");\r\n }\r\n }",
"public function getOAuthToken(Request $request)\n {\n $bridgedRequest = \\OAuth2\\HttpFoundationBridge\\Request::createFromRequest($request->instance());\n\n $bridgedResponse = new \\OAuth2\\HttpFoundationBridge\\Response();\n\n /*Log::info('$bridgedRequest'. print_r($bridgedRequest, true));\n Log::info('$bridgedResponse'. print_r($bridgedResponse, true));*/\n\n\n $bridgedResponse = \\App::make('oauth2')->handleTokenRequest($bridgedRequest, $bridgedResponse);\n\n return $bridgedResponse;\n }",
"public function getAccessToken($code){\n $params = array();\n $params[\"client_id\"] = $this->client_id;\n $params[\"client_secret\"] = $this->client_secret;\n $params[\"code\"] = $code;\n if(!empty($this->callback_url)){\n $params[\"redirect_uri\"] = $this->callback_url;\n }\n $url = self::AccessTokenUrl.\"?\".OAuthUtil::build_http_query($params);\n $contents = $this->http($url, self::$METHOD_GET);\n\n if($this->http_code == 200){\n parse_str($contents, $vars);\n $this->access_token = $vars['access_token'];\n if(!empty($vars['expires'])) $this->expires = (time() + $vars['expires']);\n return $vars;\n }\n\n //if the http status is not 200 OK, return the content to see the errors.\n return $this->decode_JSON ? json_decode($contents) : $contents;\n }",
"public function step2($code)\n {\n $url = \"https://app.engagor.com/oauth/access_token/\";\n\n $params = [\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'grant_type' => 'authorization_code',\n 'code' => (string) $code,\n ];\n\n $request = $this->requestFactory->createRequest(\n 'GET',\n $url . '?' . http_build_query($params)\n );\n\n $response = $this->client->sendRequest($request);\n\n $responseAsArray = json_decode($response->getBody(), true);\n\n if (isset($responseAsArray['error'])) {\n throw AuthenticationFailed::fromResponseArray($responseAsArray);\n }\n\n return new Tokens(\n $responseAsArray['access_token'],\n new DateTimeImmutable('@' . (time() + $responseAsArray['expires_in'])),\n explode(' ', $responseAsArray['scope']),\n $responseAsArray['refresh_token']\n );\n }",
"public function getAccessToken($code)\n {\n $args = array(\n 'response_type' => 'code',\n 'redirect_url' => $this->_redirectUri,\n 'client_id' => $this->_clientId,\n 'client_secret' => $this->_clientSecret,\n 'code' => $code,\n );\n\n $uri = 'https://untappd.com/oauth/authorize/';\n\n $result = $this->_request($uri, $args, false);\n\n $this->_accessToken = $result->response->access_token;\n\n return $this->_accessToken;\n }",
"function getAccessToken($token) {\n $this->getToken(\"grant_type=authorization_code&code=$token&redirect_uri=\" . urlencode($this->redirectUri));\n }",
"protected function getBearer(){\n\t\t$a = $this->param->getServer('REDIRECT_HTTP_AUTHORIZATION');\n\t\tif(!$a){\n\t\t\t$a = $this->param->getServer('HTTP_AUTHORIZATION');\n\t\t}\n\n\t\tif($a){\n\t\t\t$authorization = $a;\n\t\t} else {\n\t\t\t$authorization = 'Bearer ' . $this->param->getParam('token');\n\t\t}\n\n\t\tif($authorization){\n\t\t\t$authorization = explode(' ', $authorization);\n\t\t\tif(isset($authorization[1])){\n\t\t\t\t$token = explode('.', $authorization[1]);\n\t\t\t\tif(count($token) == 3){\n\t\t\t\t\treturn $token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function getCodeFromRequest()\n {\n $query = $this->request->getQuery();\n if($query->offsetExists($this->options->stage1Response->error->accessKey)) {\n throw new OAuth2Exception('Error gaining authorisation: '.$query->get($this->options->stage1Response->error->accessKey));\n }\n if($query->offsetExists($this->options->stage1Response->code->accessKey)) {\n if($query->get($this->options->stage1Response->state->accessKey) !== $this->session->state) {\n throw new OAuth2Exception('Error gaining authorisation: state mismatch');\n }\n return $query->get($this->options->stage1Response->code->accessKey);\n }\n return null;\n }",
"public static function getAccessTokenFromCode($code)\n {\n return self::_getAccessToken($code, self::$ACCESS_TOKEN_FROM_CODE);\n }",
"private function crearToken(){\n \n $headers = Yii::$app->request->headers;\n\n if (preg_match('/^Bearer\\s+(.*?)$/', $headers['authorization'], $matches)) {\n $token = $matches[1];\n } else {\n throw new \\yii\\web\\HttpException(500, 'Token invalido');\n }\n \n return $token;\n }",
"protected static function getBearerToken() \n {\n $headers = self::getAuthorizationHeader();\n // HEADER: Get the access token from the header\n \n if ((! empty($headers)) && (! is_null($headers))) {\n // if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n // return $matches[1];\n // }\n return $headers;\n }\n Utils::json_respond(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }",
"public function fetch_request_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // no token required for the initial token request\n $token = NULL;\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $callback = $request->get_parameter('oauth_callback');\n $new_token = $this->data_store->new_request_token($consumer, $callback);\n\n return $new_token;\n }",
"function getBearerToken() {\n $headers = $this->getHeaders();\n $auth = $headers->get('Authorization', null);\n\n if ($auth !== null) {\n if (preg_match('/Bearer\\s(\\S+)/', $auth, $matches)) {\n return $matches[1];\n }\n }\n\n return null;\n }",
"function curl_getToken($login, $password)\n{\n $url = set_url('auth');\n $postRequest = \"grant_type=password&username={$login}&password={$password}\";\n\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $postRequest);\n curl_setopt($cURLConnection, CURLOPT_USERPWD, otomoto_api());\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n\n $apiResponse = json_decode(curl_exec($cURLConnection));\n\n curl_close($cURLConnection);\n\n $_SESSION['token'] = $apiResponse->access_token;\n}",
"public function lookup_token($consumer, $token_type, $token)\n {\n return new OAuthToken($consumer, \"\");\n }",
"private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }",
"public function access($code)\n\t{\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'client_secret' => $this->_config['app_secret'],\n\t\t\t'code' => $code\t\t\n\t\t);\n\t\t\n\t\t$url = $this->_access_token_endpoint.http_build_query($params);\n\t\t\n\t\t$response = file_get_contents($url);\n\t\t$params = null;\n\t\tparse_str($response, $params); \n\t\t\n\t\tif(isset($params['error']))\n\t\t{\n\t\t\treturn $this->oauth->response('failure', array(\n\t\t\t\t\t'error' => $params['error->message']\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$params = http_build_query(array(\n\t\t\t\t\t'access_token' => $params['access_token']\n\t\t\t\t)\n\t\t\t);\n\t\t\t$graph_url = $this->_graph_url.$params;\n\t\t\t$user = json_decode(file_get_contents($graph_url));\n\n\t\t\treturn $this->oauth->response('success', array(\n\t\t\t\t\t'user' => array(\n\t\t\t\t\t\t'id'\t\t=> $user->id,\n\t\t\t\t\t\t'name'\t\t=> $user->name,\n\t\t\t\t\t\t'username'\t=> $user->username,\n\t\t\t\t\t\t'email'\t\t=> $user->email\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"public function getAccessTokenByCode($code)\n {\n return $this->post('/api/oauth/accessToken', [\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => $this->redirect_uri,\n 'code' => $code,\n ]);\n }",
"public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }",
"public function get_auth_code( $code ) {\n\t\t$tokens = new Token_User( '_indieauth_code_' );\n\t\treturn $tokens->get( $code );\n\t}",
"public function getAccessToken($code)\n {\n $response = $this->getHttpClient()->get($this->getTokenUrl(), [\n 'query' => $this->getTokenFields($code),\n ]);\n\n return $this->parseAccessToken($response->getBody()->getContents());\n }",
"public function getAccessTokenFromAuthCode($auth_code,$state) {\n\t\t//Compare state to make sure it is the same. It is your job to retreive the state from your database and compare it\n\t\t//to what was echoed back to you after authorizing.\n\n\t\tif($this->state != $state) return null; //state did not match\n\t\t\n\t\t//array causes Content-Type:multipart/form-data\t\t\n\t\t$post = array(\"grant_type\"=>\"authorization_code\",\"code\"=>$auth_code,'vers'=>$this->app_version,'os'=>$this->os_version,'device'=>$this->device_name,'udid'=>$this->device_id);\n\t\t\n\t\t//str causes Content-Type:application/x-www-form-urlencoded (both work for code exchange)\n\t\t//$post = \"grant_type=authorization_code&code=\".$auth_code;\n\n\n\t\t$ci = curl_init();\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_USERPWD, $this->clientID . \":\" . $this->clientSecret);\n\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $post);\n\t\tcurl_setopt($ci, CURLOPT_URL, $this->token_url);\n\t\t$response = curl_exec($ci);\n\t\tcurl_close ($ci);\n\n\t\t$response = json_decode($response,true);\n\t\treturn $response;\n\t}",
"public function getAccessTokenByCode($code)\n {\n return $this->post('/api/oauth/accessToken', [\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'grant_type' => 'authorization_code',\n 'scope' => $this->scope,\n 'redirect_uri' => $this->redirect_uri,\n 'code' => $code,\n ]);\n }",
"public function GetToken($data){ \n \n return $this->token;\n \n }",
"function insta_f_get_access($insta_f_code){\n\t\t$url = 'https://api.instagram.com/oauth/access_token';\n\t\t$data = array(\n\t\t 'client_id' => INSTA_CLIENT_ID,\n\t\t 'client_secret' => INSTA_CLIENT_SECRET,\n\t\t 'grant_type' => 'authorization_code',\n\t\t 'redirect_uri' => MY_REDIRECT_URI . \"?return_uri=\".INSTA_FOLIO_URL,\n\t\t 'code' => $insta_f_code\n\t\t\t\t\t);\n\n\t\t$args = array(\n\t\t\t\t'headers' => array('Accept: application/json'),\n\t\t\t\t'body' => $data,\n\t\t\t\t'timeout' => 20\n\t\t\t);\n\n\t\t$result = wp_remote_post($url, $args);\n\n\t\t$json = wp_remote_retrieve_body($result);\n\t\t$json_object = json_decode($json);\n\n\t\treturn $json_object;\n\t}",
"public function access_token(array $results) {\n\t\tif(!array_key_exists(\"oauth_token\", $results) ||\n\t\t !array_key_exists(\"oauth_token_secret\", $results) ||\n\t\t !array_key_exists(\"oauth_verifier\", $results) )\n\t\t {\n\t\t \tthrow new Kanedo_Readability_Exception('wrong parameter');\n\t\t }\n\t\t \n\t\t$token = new OAuthToken($results['oauth_token'], $results['oauth_token_secret']);\n\t\t$req = OAuthRequest::from_consumer_and_token(\n\t\t\t\t\t$this->oauth_consumer, \n\t\t\t\t\t$token, \n\t\t\t\t\t'GET',\n\t\t\t\t\t$this->e_access, \n\t\t\t\t\tarray('oauth_verifier' => $results['oauth_verifier'])\n\t\t\t\t);\n\t\t$req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->oauth_consumer, $token);\n\t\ttry{\n\t\t\t$result = $this->makeHTTPRequest($req->to_url());\n\t\t}catch (Kanedo_Readability_Exception $e) {\n\t\t\t$this->error = $e->getMessage();\n\t\t\t$this->errnr = $e->getCode();\n\t\t\treturn false;\n\t\t}\n\t\t$token_credencials = ($this->parseUrlQuery($result));\n\t\treturn $this->access_token = new OAuthToken($token_credencials['oauth_token'], $token_credencials['oauth_token_secret']);\n\t}",
"private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}",
"protected function get_access_token()\n\t{\n $result = array();\n\n try\n {\n $oauth_verifier = \\Session::get('evernote_oauthVerifier');\n\n $oauth = new \\OAuth( $this->tokens['consumer_key'], $this->tokens['consumer_secret'] );\n\n $request_token = $this->get_request_token();\n $request_token_secret = $this->get_request_secret();\n\n $oauth->setToken($request_token, $request_token_secret);\n $access_token_info = $oauth->getAccessToken($this->access_token_url, null, $oauth_verifier);\n\n echo '$access_token_info<pre>'.print_r($access_token_info, 1).'</pre>';\n\n if ( $access_token_info ){\n $this->set_access_key( $access_token_info['oauth_token'] );\n $this->set_access_secret( $access_token_info['oauth_token_secret'] );\n\n $this->tokens['oauth_token'] = $access_token_info['oauth_token'];\n $this->tokens['oauth_token_secret'] = $access_token_info['oauth_token_secret'];\n $this->tokens['shard_id'] = $access_token_info['edam_shard'];\n $this->tokens['evernote_user_id'] = $access_token_info['edam_userId'];\n $this->tokens['expires'] = $access_token_info['edam_expires'];\n\n return $this->tokens;\n }\n return false;\n }catch ( \\Exception $e ){\n return false;\n }\n\n\t}",
"public static function findIdentityByAccessToken($token, $type = null)\n {\n return static::findOne(['auth_key' => $token]);\n }",
"public function exchangeCodeForToken(\n string $apiKey,\n string $sharedSecret,\n string $shopDomain,\n array $requiredScopes,\n string $code\n ): string {\n $url = sprintf(\n 'https://%s/admin/oauth/access_token',\n trim($shopDomain, '/')\n );\n\n $response = $this->httpClient->request('POST', $url, [\n 'json' => [\n 'client_id' => $apiKey,\n 'client_secret' => $sharedSecret,\n 'code' => $code\n ]\n ]);\n\n $data = json_decode($response->getBody(), true);\n $grantedScopes = explode(',', $data['scope'] ?? '');\n $missingScopes = array_diff($requiredScopes, $grantedScopes);\n\n if (!empty($missingScopes)) {\n throw new RuntimeException(sprintf(\n 'Missing authorization for: \"%s\"',\n implode(', ', $missingScopes)\n ));\n }\n\n return $data['access_token'];\n }",
"public function authenticate()\n\t{\n\t\tif ($data['code'] = $this->input->get('code', false, 'raw'))\n\t\t{\n\t\t\t$data['grant_type'] = 'authorization_code';\n\t\t\t$data['redirect_uri'] = $this->getOption('redirecturi');\n\t\t\t$data['client_id'] = $this->getOption('clientid');\n\t\t\t$data['client_secret'] = $this->getOption('clientsecret');\n\t\t\t$response = $this->http->post($this->getOption('tokenurl'), $data);\n\n\t\t\tif ($response->code >= 200 && $response->code < 400)\n\t\t\t{\n\n\t\t\t\tif ($response->headers['Content-Type'] == 'application/json')\n\t\t\t\t{\n\t\t\t\t\t$token = array_merge(json_decode($response->body, true), array('created' => time()));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tparse_str($response->body, $token);\n\t\t\t\t\t$token = array_merge($token, array('created' => time()));\n\t\t\t\t}\n\n\t\t\t\t$this->setToken($token);\n\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new RuntimeException('Error code ' . $response->code . ' received requesting access token: ' . $response->body . '.');\n\t\t\t}\n\t\t}\n\n\t\tif ($this->getOption('sendheaders'))\n\t\t{\n\t\t\t$this->application->redirect($this->createUrl());\n\t\t}\n\t\treturn false;\n\t}",
"public function authenticate($code = NULL)\n {\n $code = $code ? $code : $_GET['code'];\n\n $url = 'https://oauth.vk.com/access_token'\n . '?client_id=' . urlencode($this->getAppId())\n . '&client_secret=' . urlencode($this->getSecret())\n . '&code=' . urlencode($code)\n . '&redirect_uri=' . urlencode($this->getRedirectUri());\n\n $token = $this->curl($url);\n $data = json_decode($token);\n $data->created = time();\n $token = json_encode($data);\n\n $this->setAccessToken($token);\n\n return $this;\n }",
"public static function get_access_token( $code, $settings ) {\n\n\t\t// Construct the body for the access token request\n\t\t$authentication_request_body = http_build_query(\n\t\t\tarray(\n\t\t\t\t'grant_type' => 'authorization_code',\n\t\t\t\t'code' => $code,\n\t\t\t\t'redirect_uri' => $settings->redirect_uri,\n\t\t\t\t'resource' => $settings->graph_endpoint,\n\t\t\t\t'client_id' => $settings->client_id,\n\t\t\t\t'client_secret' => $settings->client_secret\n\t\t\t)\n\t\t);\n\n\t\treturn self::get_and_process_access_token( $authentication_request_body, $settings );\n\t}",
"public function requestAccessToken($code)\n {\n $this->validateClientGrantState();\n /**\n * curl -F grant_type=authorization_code \\\n -F client_id=CLIENT_ID \\\n -F client_secret=CLIENT_SECRET \\\n -F code=AUTHORIZATION_CODE_FROM_REDIRECT \\\n -F redirect_uri=REDIRECT_URI \\\n -X POST https://api.rightsignature.com/oauth/token\n */\n $grantRequest = OauthCodeRequest::createAuthRequest($this->clientId, $this->clientSecret, $this->redirectUri);\n\n $grantRequest->setCode($code);\n\n $uri = $this->getFullTokenUri();\n $formData = $grantRequest->getFormData('access');\n\n return $this->guzzleClient->post($uri, [\n 'json' => $formData,\n ]);\n }",
"public function getOAuthToken()\n {\n return $this->oauthToken->getToken();\n }",
"public function processGrantTypeAuthorizationCode(Oauth_Model_Request $request) {\n\n $modelLoader = $this->_helper->ModelLoader;\n //client \n $client = $this->retrieveClientFromHeader($request);\n //code\n $code_val = $request->getCode();\n $code = $this->_code_factory->consume($code_val);\n //resource owner\n $resource_owner_id = $code->getResourceOwnerId();\n $resource_owner = $modelLoader->loadResourceOwner($resource_owner_id);\n //scopes\n $scopes = $code->getScopes();\n //token\n $token = $this->_token_factory->create($resource_owner, $scopes);\n //refresh token\n $refresh_token = $this->_refresh_token_factory->create($client, $scopes, $resource_owner);\n //response\n return $this->compose_response($token, $refresh_token);\n }",
"abstract public function url_access_token();",
"public function get_access_token($hash) {\n\t\t$tokens = $this->get_access_tokens();\n\t\tforeach ($tokens as $token) {\n\t\t\tif ($token['hash'] == $hash) {\n\t\t\t\treturn Tyk_Token::init($token, $this);\n\t\t\t}\n\t\t}\n\t\t// if we get here, we didn't find the token\n\t\tthrow new OutOfBoundsException('Invalid token id');\n\t}",
"public function get($code)\n {\n foreach ($this->getDbConnection()->fetchAll(\n 'SELECT * from oauth_auth_code\n WHERE auth_code = :authCode AND expire_time > :ts',\n [\n 'authCode' => $code,\n 'ts' => time()\n ]\n ) as $row) {\n if ($row) {\n return (new AuthCodeEntity($this->server))\n ->setRedirectUri($row['client_redirect_uri'])\n ->setExpireTime($row['expire_time'])\n ->setId($row['auth_code']);\n }\n }\n return null;\n }",
"public function getOauthCode()\n {\n $date = new \\DateTime();\n return $date->getTimestamp();\n }",
"public function getToken()\n {\n $authHeader = $this->getHeader('AUTHORIZATION');\n $authQuery = $this->getQuery('token');\n\n return $authQuery ? $authQuery : $this->parseBearerValue($authHeader);\n }",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"protected function buildZaloTokenFromZaloResponse($response)\n {\n $data = $response->getDecodedBody();\n\n if (!isset($data['access_token'])) {\n throw new ZaloSDKException('Access token was not returned from request.', 401);\n }\n $accessToken = $data['access_token'];\n\n if (!isset($data['refresh_token'])) {\n throw new ZaloSDKException('Refresh token was not returned from request.', 401);\n }\n $refreshToken = $data['refresh_token'];\n\n $accessTokenExpiresIn = 0;\n if (isset($data['expires_in'])) {\n $accessTokenExpiresIn = $data['expires_in'];\n }\n\n return new ZaloToken($accessToken, $refreshToken, $accessTokenExpiresIn);\n }",
"public function createToken();",
"public function getZaloTokenFromCodeByUser($code, $codeVerifier)\n {\n $endpoint = '/access_token';\n return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);\n }",
"public function getAccessTokenFromAuthorizationCode($code)\n {\n if ($this->getAccessTokenUri() && $this->getClientId() && $this->getClientSecret()) {\n return \\json_decode($this->httpRequest($this->getAccessTokenUri(), 'POST', array(\n Constants::PARAM_GRANT_TYPE => Constants::GRANT_TYPE_AUTH_CODE,\n Constants::PARAM_CLIENT_ID => $this->getClientId(),\n Constants::PARAM_CODE => $code,\n Constants::PARAM_REDIRECT_URI => $this->getRedirectUri())\n ), true);\n }\n\n return null;\n }",
"public function getAccessTokenResponse($code)\n {\n $response = $this->getHttpClient()->post($this->getTokenUrl(), [\n 'headers' => ['Accept' => 'application/json'],\n 'form_params' => $this->getTokenFields($code),\n ]);\n\n return json_decode($response->getBody(), true);\n }",
"#[\n OpenApi\\Operation(\n tags: ['Auth/Tokens'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: AuthTokenParameters::class)]\n #[OpenApi\\Response(factory: TokenIndexResponse::class, statusCode: 200)]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function index() {\n $this->verifyNoDemo();\n\n return response()->pagination(\n fn($perPage) => AuthTokenResource::collection(\n authUser()\n ->tokens()\n ->active()\n ->type(TokenType::REFRESH)\n ->paginate($perPage)\n )\n );\n }",
"public function fetch_access_token($options){\n\n if (!isset($options['redirect_uri'])) {\n throw new GoCardless_ArgumentsException('redirect_uri required');\n }\n\n $path = '/oauth/access_token';\n\n $options['http_authorization'] = $this->account_details['app_id'] . ':' . $this->account_details['app_secret'];\n\n $response = $this->request('post', $path, $options);\n\n $merchant = explode(':', $response['scope']);\n $merchant_id = $merchant[1];\n $access_token = $response['access_token'];\n\n $return = array(\n 'merchant_id' => $merchant_id,\n 'access_token' => $access_token\n );\n\n return $return;\n\n }",
"public static function getRealToken(Oauth_TokenModel $token)\n {\n $provider = craft()->oauth->getProvider($token->providerHandle);\n\n if($provider)\n {\n switch($provider->getOauthVersion())\n {\n case 1:\n $realToken = new \\League\\OAuth1\\Client\\Credentials\\TokenCredentials();\n $realToken->setIdentifier($token->accessToken);\n $realToken->setSecret($token->secret);\n break;\n\n\n case 2:\n $realToken = new \\League\\OAuth2\\Client\\Token\\AccessToken([\n 'access_token' => $token->accessToken,\n 'refresh_token' => $token->refreshToken,\n 'secret' => $token->secret,\n 'expires' => $token->endOfLife,\n ]);\n\n break;\n }\n\n return $realToken;\n }\n }"
] | [
"0.63158053",
"0.6271524",
"0.6168491",
"0.61228997",
"0.60891896",
"0.60217106",
"0.59315324",
"0.5885841",
"0.5882335",
"0.58086056",
"0.57784075",
"0.5776831",
"0.5759412",
"0.5757447",
"0.57286817",
"0.5711065",
"0.5688519",
"0.568213",
"0.5679922",
"0.56456864",
"0.56436324",
"0.5637089",
"0.56340986",
"0.56178343",
"0.56159675",
"0.56096566",
"0.55860513",
"0.5584084",
"0.55725336",
"0.55704004",
"0.5565114",
"0.5550488",
"0.55333394",
"0.55147725",
"0.5514499",
"0.5514492",
"0.5507028",
"0.5505683",
"0.5490254",
"0.54810697",
"0.54671013",
"0.5466696",
"0.54371864",
"0.54334575",
"0.54307765",
"0.5421013",
"0.54122555",
"0.5408635",
"0.53945476",
"0.53908306",
"0.5385181",
"0.5375194",
"0.5370691",
"0.5354457",
"0.53544074",
"0.5350056",
"0.53412515",
"0.53359896",
"0.5326094",
"0.5313268",
"0.5301618",
"0.5281904",
"0.5275674",
"0.5250478",
"0.5248971",
"0.52427405",
"0.5241525",
"0.5221593",
"0.5213338",
"0.5208799",
"0.5207615",
"0.52001005",
"0.51993656",
"0.5198347",
"0.5198039",
"0.5181521",
"0.51730376",
"0.51717204",
"0.51652",
"0.51586896",
"0.51524746",
"0.51520294",
"0.5134174",
"0.5132254",
"0.5124161",
"0.5123213",
"0.51224816",
"0.5120402",
"0.5114415",
"0.5114415",
"0.5114415",
"0.5114415",
"0.51122063",
"0.5110281",
"0.50969297",
"0.5096633",
"0.5095431",
"0.508992",
"0.50845003",
"0.5081355"
] | 0.67076296 | 0 |
Get Zalo Token from a oauth code. | public function getZaloTokenFromCode($code, $codeVerifier, $endpoint)
{
$params = [
'code' => $code,
'app_id' => $this->app->getId(),
'grant_type' => 'authorization_code',
'code_verifier' => $codeVerifier
];
$response = $this->sendRequest($endpoint, $params);
return $this->buildZaloTokenFromZaloResponse($response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function requestToken($code) {\n $client = new Zend_Http_Client();\n $queryParams = array(\n 'client_id' => self::CLIENT_ID,\n 'client_secret' => self::CLIENT_SECRET,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n )),\n 'code' => $code\n );\n $client->setUri(self::OAUTH_CALLBACK);\n $client->setParameterGet($queryParams);\n\n try {\n $response = $client->request();\n } catch (Zend_Http_Client_Exception $e) { // timeout or host not accessible\n return;\n }\n\n // error in response\n if ($response->isError()) {\n return;\n }\n\n $result = Zend_Json::decode($response->getBody());\n if (isset($result['access_token'])) {\n $token = $result['access_token'];\n return $token;\n }\n return;\n }",
"public function getAuthorizationCode()\n {\n $oauth_param = array(\n 'grant_type' => $this->grant_type, \n 'client_id' => config::$clientId,\n 'client_secret' => config::$secretKey,\n 'scope' => implode(',', $this->scope));\n\n $url = config::$apiUrl . 'oauth/access_token';\n $response = $this->curl->request('post', $url, $oauth_param);\n\n if( $response )\n {\n $res = json_decode($response);\n if( isset($res->access_token) )\n {\n $this->setExpiresAtFromTimeStamp($res->expires);\n $this->session->write('access_token',$res->access_token);\n $this->session->write('expires', $this->expiresAt);\n\n $read = $this->session->read('access_token');\n session_write_close();\n }\n elseif( isset($res->error) )\n {\n die($response);\n }\n }\n }",
"public function get_token($code = \"\") {\n global $cfg;\n\n $method = \"oauth.access\";\n\n $payload = array(\n 'code' => $code,\n );\n\n // Make the API request.\n if ($result = $this->apicall($method, $payload)) {\n \n $this->app_id = $result['app_id'];\n $this->app_user_id = $result['app_user_id'];\n $this->installer_user_id = $result['installer_user']['user_id'];\n $this->access_token = $result['access_token'];\n $this->userid = $result['user_id'];\n $this->teamid = $result['team_id'];\n $this->teamname = $result['team_name'];\n $this->webhook->channel_id = $result['incoming_webhook']['channel_id'];\n $this->webhook->channel = $result['incoming_webhook']['channel'];\n $this->webhook->configuration_url = $result['incoming_webhook']['configuration_url'];\n $this->webhook->url = $result['incoming_webhook']['url'];\n $this->bot->user_id = $result['bot']['bot_user_id'];\n $this->bot->access_token = $result['bot']['bot_access_token'];\n\n // write to file (for now; DB later)\n if ($this->store_token()) {\n return TRUE;\n }\n }\n return FALSE;\n }",
"public function getAccessTokenByCode()\n {\n $data = [\n 'client_id' => $this->oauth_client_id,\n 'client_secret' => $this->oauth_client_secret,\n // Normally redirect_uri is not required, but for convenience when login to FB it's here\n 'redirect_uri' => $this->oauth_redirect_uri,\n 'grant_type' => 'authorization_code',\n 'code' => isset($_GET['code']) ? $_GET['code'] : '',\n ];\n return $this->sendRequest($this->oauth_access_token_url, $data);\n }",
"public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }",
"public function requestToken($code)\n {\n $parameters = [\n 'client_id' => config('twitch-api.client_id'),\n 'client_secret' => config('twitch-api.client_secret'),\n 'redirect_uri' => config('twitch-api.redirect_url'),\n 'code' => $code,\n 'grant_type' => 'authorization_code'\n ];\n\n try {\n $client = new Client();\n $response = $client->post(config('twitch-api.api_url') . '/kraken/oauth2/token?api_version=5', ['body' => $parameters]);\n $response = json_decode($response->getBody()->getContents(), true);\n if (isset($response['access_token'])) {\n return $response['access_token'];\n }\n\n } catch (\\Exception $e) {\n\n throw $e;\n }\n }",
"public function get($code)\n\t{\n\t\t$result = $this->run('SELECT * FROM oauth_auth_codes WHERE auth_code = ?', [$code]);\n\t\tif (count($result) === 1) {\n\t\t\t$token = new AuthCodeEntity($this->server);\n\t\t\t$token->setId($result[0]['auth_code']);\n\t\t\t$token->setRedirectUri($result[0]['client_redirect_uri']);\n\t\t\t$token->setExpireTime($result[0]['expire_time']);\n\t\t\treturn $token;\n\t\t}\n\t\treturn null;\n\t}",
"public function gettoken()\n{\n if (isset($_GET['code'])) {\n // Check that state matches\n if (isset($_GET['state']) && isset($_SESSION['oauth_state'])) {\n if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth_state'])) {\n exit('State provided in redirect does not match expected value.');\n } \n // Clear saved state\n unset($_SESSION['oauth_state']); \n }\n\n // Initialize the OAuth client\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => $this->config->item('OAUTH_APP_ID'),\n 'clientSecret' => $this->config->item('OAUTH_APP_PASSWORD'),\n 'redirectUri' => $this->config->item('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => $this->config->item('OAUTH_SCOPES')\n ]);\n\n try {\n\n // Make the token request\n $accessToken = $oauthClient->getAccessToken('authorization_code', [\n 'code' => $_GET['code']\n ]);\n\n //echo 'Access token: '.$accessToken->getToken();\n return $accessToken->getToken();\n }\n catch (League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException $e) {\n exit('ERROR getting tokens: '.$e->getMessage());\n }\n exit();\n }\n elseif (isset($_GET['error'])) {\n exit('ERROR: '.$_GET['error'].' - '.$_GET['error_description']);\n }\n}",
"public static function get_oauth_token($auth) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&code=\".$auth.\"&grant_type=authorization_code\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"public function get_access_token($oauth_token, $oauth_addon);",
"public function get_token( $type = 'access_token' ){\n\t\t$token = NULL;\n\t\tif( $this->token_storage == 'file' ){\n\t\t\tif( is_file($this->token_files[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( file_get_contents($this->token_files[$type]) );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// add method to get token from cookie\n\t\t\tif( !empty($_COOKIE[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( $_COOKIE[$type] );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}",
"public function getBearerToken()\n\t{\n\t\t$ch = curl_init($this->oauthURI);\n\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->generateHeader());\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->oauthBody);\n\n\t\t$results = curl_exec($ch);\n\t\t\n\t\t$this->lastCurlInfo = curl_getinfo($ch);\n\n\t\tif($this->lastCurlInfo['http_code'] != 200)\n\t\t\tthrow new OAuthException('Token request failed', \n\t\t\t\t\t\t\t\t\t $this->lastCurlInfo);\n\n\t\t$token = json_decode($results);\n\t\t$this->bearerToken = $token->access_token;\n\n\t\treturn $this->bearerToken;\n\t}",
"function get_oauth_code($wpoa) {\n\t$params = array(\n\t\t'response_type' => 'code',\n\t\t'client_id' => CLIENT_ID,\n\t\t'scope' => SCOPE,\n\t\t'state' => uniqid('', true),\n\t\t'redirect_uri' => REDIRECT_URI,\n\t);\n\t$_SESSION['WPOA']['STATE'] = $params['state'];\n\t$url = URL_AUTH . http_build_query($params);\n\theader(\"Location: $url\");\n\texit;\n}",
"public function getAccessTokenFromAuthCode($auth_code,$state) {\n\t\t//Compare state to make sure it is the same. It is your job to retreive the state from your database and compare it\n\t\t//to what was echoed back to you after authorizing.\n\n\t\tif($this->state != $state) return null; //state did not match\n\t\t\n\t\t//array causes Content-Type:multipart/form-data\t\t\n\t\t$post = array(\"grant_type\"=>\"authorization_code\",\"code\"=>$auth_code,'vers'=>$this->app_version,'os'=>$this->os_version,'device'=>$this->device_name,'udid'=>$this->device_id);\n\t\t\n\t\t//str causes Content-Type:application/x-www-form-urlencoded (both work for code exchange)\n\t\t//$post = \"grant_type=authorization_code&code=\".$auth_code;\n\n\n\t\t$ci = curl_init();\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_USERPWD, $this->clientID . \":\" . $this->clientSecret);\n\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $post);\n\t\tcurl_setopt($ci, CURLOPT_URL, $this->token_url);\n\t\t$response = curl_exec($ci);\n\t\tcurl_close ($ci);\n\n\t\t$response = json_decode($response,true);\n\t\treturn $response;\n\t}",
"public function getAccessTokenResponse($code)\n {\n $response = $this->getHttpClient()->get($this->getTokenUrl(), [\n 'query' => [\n 'grant_type' => 'authorization_code',\n 'client_id' => env('YAHOOJP_CLIENT_ID'),\n 'client_secret' => env('YAHOOJP_CLIENT_SECRET'),\n 'redirect_uri' => env('YAHOOJP_REDIRECT'),\n 'code' => $code\n ]\n ]);\n\n $user_token = json_decode($response->getBody(), true);\n $this->user = $user_token;\n\n return $user_token;\n }",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function getSecurityToken($accessCode);",
"public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }",
"private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }",
"public function getAccessToken($code){\n $params = array();\n $params[\"client_id\"] = $this->client_id;\n $params[\"client_secret\"] = $this->client_secret;\n $params[\"code\"] = $code;\n if(!empty($this->callback_url)){\n $params[\"redirect_uri\"] = $this->callback_url;\n }\n $url = self::AccessTokenUrl.\"?\".OAuthUtil::build_http_query($params);\n $contents = $this->http($url, self::$METHOD_GET);\n\n if($this->http_code == 200){\n parse_str($contents, $vars);\n $this->access_token = $vars['access_token'];\n if(!empty($vars['expires'])) $this->expires = (time() + $vars['expires']);\n return $vars;\n }\n\n //if the http status is not 200 OK, return the content to see the errors.\n return $this->decode_JSON ? json_decode($contents) : $contents;\n }",
"public function getZaloTokenFromCodeByOA($code, $codeVerifier)\n {\n $endpoint = '/oa/access_token';\n return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);\n }",
"public function authenticate()\n\t{\n\t\tif ($data['code'] = $this->input->get('code', false, 'raw'))\n\t\t{\n\t\t\t$data['grant_type'] = 'authorization_code';\n\t\t\t$data['redirect_uri'] = $this->getOption('redirecturi');\n\t\t\t$data['client_id'] = $this->getOption('clientid');\n\t\t\t$data['client_secret'] = $this->getOption('clientsecret');\n\t\t\t$response = $this->http->post($this->getOption('tokenurl'), $data);\n\n\t\t\tif ($response->code >= 200 && $response->code < 400)\n\t\t\t{\n\n\t\t\t\tif ($response->headers['Content-Type'] == 'application/json')\n\t\t\t\t{\n\t\t\t\t\t$token = array_merge(json_decode($response->body, true), array('created' => time()));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tparse_str($response->body, $token);\n\t\t\t\t\t$token = array_merge($token, array('created' => time()));\n\t\t\t\t}\n\n\t\t\t\t$this->setToken($token);\n\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new RuntimeException('Error code ' . $response->code . ' received requesting access token: ' . $response->body . '.');\n\t\t\t}\n\t\t}\n\n\t\tif ($this->getOption('sendheaders'))\n\t\t{\n\t\t\t$this->application->redirect($this->createUrl());\n\t\t}\n\t\treturn false;\n\t}",
"public function generateRefreshToken($code, $client_id, $client_secret) {\n //get crm token credentials\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n\n if(is_null($zohoCredentials)) {\n $this::create([\n 'user_id' => Auth::user()->id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n ]);\n }\n\n\n $token = AccessToken::where('user_id', Auth::user()->id)->first();\n\n $post = [\n 'code' => $code,\n 'redirect_uri' => 'http://example.com/callbackurl',\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n // curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/x-www-form-urlencoded'\n ));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n if(isset(json_decode($response, true)['access_token'])) {\n if(is_null($token)){\n AccessToken::create([\n 'user_id'=>Auth::user()->id,\n 'value'=>$response,\n ]);\n\n return response(['Zoho - Token successfully created'], 200);\n }else{\n $token->value=$response;\n $token->save();\n }\n } else {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'access_token' => [$response],\n ]);\n throw $error;\n }\n }",
"public function getAccessToken($code)\n {\n $args = array(\n 'response_type' => 'code',\n 'redirect_url' => $this->_redirectUri,\n 'client_id' => $this->_clientId,\n 'client_secret' => $this->_clientSecret,\n 'code' => $code,\n );\n\n $uri = 'https://untappd.com/oauth/authorize/';\n\n $result = $this->_request($uri, $args, false);\n\n $this->_accessToken = $result->response->access_token;\n\n return $this->_accessToken;\n }",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t} \n\t\t$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);\n\t\t$token = OAuthUtil::parse_parameters($request);\n\t\t$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}",
"public static function tokenizeAuthorizationCode($environment = null, $code = null) {\r\n\r\n\t\t$user = elgg_get_logged_in_user_entity();\r\n\t\tif (!$user) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$token_request_body = array(\r\n\t\t\t'grant_type' => 'authorization_code',\r\n\t\t\t'client_secret' => self::getClientSecret($environment),\r\n\t\t\t'client_id' => self::getClientId($environment),\r\n\t\t\t'code' => $code,\r\n\t\t);\r\n\r\n\t\t$ch = curl_init(self::TokenURI);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($token_request_body));\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t\t$token_json = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$token = json_decode($token_json);\r\n\r\n\t\tif ($token && !$token->error) {\r\n\t\t\t$user->setPrivateSetting('stripe_access_token', $token->access_token);\r\n\t\t\t$user->setPrivateSetting('stripe_publishable_key', $token->stripe_publishable_key);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn $token;\r\n\t}",
"public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }",
"public function get_auth_code( $code ) {\n\t\t$tokens = new Token_User( '_indieauth_code_' );\n\t\treturn $tokens->get( $code );\n\t}",
"public function get_access_token($code)\n\t{\n\t\tif (!$code)\n\t\t\treturn false;\n\n\t\t$params = array(\n\t\t\t'client_id' => $this->client_id,\n\t\t\t'client_secret' => $this->client_secret,\n\t\t\t'grant_type' => 'authorization_code',\n\t\t\t'code' => $code,\n\t\t\t'redirect_uri' => $this->redirect_uri,\n\t\t);\n\n\t\t$access_token_url = 'https://api.instagram.com/oauth/access_token';\n\n\t\t// Access Token request\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $access_token_url);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $params);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t$token = json_decode($response);\n\n\t\tif (!$token)\n\t\t\treturn false;\n\n\t\treturn $token;\n\t}",
"public function get_request_token($callback);",
"private function get_token() {\n $uri = $this->settings->hostname.\"oauth/token\";\n //echo \"POST $uri\\n\";\n\n $data = array(\n \"grant_type\" => \"password\",\n \"client_id\" => $this->settings->client_id,\n \"client_secret\" => $this->settings->client_secret,\n \"username\" => $this->settings->username,\n \"password\" => $this->settings->password\n );\n $postdata = http_build_query($data);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $uri);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/x-www-form-urlencoded'));\n\n $curl_response = curl_exec($ch);\n\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $curl_error_number = curl_errno($ch);\n $curl_error = curl_error($ch);\n\n //echo $curl_response.\"\\n\"; // output entire response\n //echo $http_code.\"\\n\"; // output http status code\n\n curl_close($ch);\n $token = NULL;\n if ($http_code == 200) {\n $token = json_decode($curl_response);\n //var_dump($token); // print entire token object\n }\n return $token;\n }",
"protected function get_token()\n\t{\n\t\t$args = func_get_args();\n\t\t$url = \"\";\n\t\t$auto_load_response = false;\n\n\t\tforeach ($args as $v)\n\t\t{\n\t\t\tif (is_string($v))\n\t\t\t{\n\t\t\t\t$url = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_bool($v))\n\t\t\t{\n\t\t\t\t$auto_load_response = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!$url)\n\t\t{\n\t\t\ttrigger_error(\"Method get_token expects a url.\");\n\t\t}\n\n\t\t$this->execute_request($this->auth_http_method == SPOAuthClient::HTTP_AUTH_HEADER ? SPOAuthClient::HTTP_AUTH_GET : $this->auth_http_method, $url);\n\n\t\t//! remove oauth_token and oauth_secret, they will be loaded (if any returned) in the next lines of code)\n\t\t$this->oauth_token = null;\n\t\t$this->oauth_token_secret = null;\n\t\t$this->__oauth_access_token = null;\n\n\t\tif ($auto_load_response && $this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\t$response_data = SPUtils::parse_query($this->http_response_body);\n\n\t\t\tif (is_array($response_data))\n\t\t\t{\n\t\t\t\tforeach ($response_data as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$this->__oauth[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}",
"private function ga_auth_get_access_token( $access_code ) {\n\t\t$request = array(\n\t\t\t'code' => $access_code,\n\t\t\t'grant_type' => 'authorization_code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => $this->config['client_id'],\n\t\t\t'client_secret' => $this->config['client_secret']\n\t\t);\n\n\t\t$response = Ga_Lib_Api_Request::get_instance()->make_request( self::OAUTH2_TOKEN_ENDPOINT, $request );\n\n\t\treturn new Ga_Lib_Api_Response( $response );\n\t}",
"public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials',\n 'app_id' => C( 'SMS_189_KEY' ),\n 'app_secret' => C( 'SMS_189_SECRET' )\n ) ) );\n\n }",
"public function getCodeFromRequest()\n {\n $query = $this->request->getQuery();\n if($query->offsetExists($this->options->stage1Response->error->accessKey)) {\n throw new OAuth2Exception('Error gaining authorisation: '.$query->get($this->options->stage1Response->error->accessKey));\n }\n if($query->offsetExists($this->options->stage1Response->code->accessKey)) {\n if($query->get($this->options->stage1Response->state->accessKey) !== $this->session->state) {\n throw new OAuth2Exception('Error gaining authorisation: state mismatch');\n }\n return $query->get($this->options->stage1Response->code->accessKey);\n }\n return null;\n }",
"private function __get_access_token() {\r\n // Access token exists in a cookie\r\n if($_COOKIE[ACCESS_TOKEN_COOKIE_NAME]) {\r\n parse_str($_COOKIE[ACCESS_TOKEN_COOKIE_NAME], $tok); \r\n return $tok;\r\n }\r\n\r\n // Handling a redirect back from login\r\n else if($_COOKIE[REQUEST_TOKEN_COOKIE_NAME] && $_REQUEST['oauth_verifier'] && $_REQUEST['oauth_token']) {\r\n $tok = YMClient::oauth_token_from_query_string($_COOKIE[REQUEST_TOKEN_COOKIE_NAME]);\r\n\r\n if($tok['oauth_token'] != $_REQUEST['oauth_token']) {\r\n throw new Exception(\"Cookie and URL disagree about request token value\");\r\n }\r\n\r\n $tok['oauth_verifier'] = $_REQUEST['oauth_verifier']; \r\n $newtok = $this->ymc->oauth_get_access_token($tok);\r\n\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, \"\", time()-3600);\r\n setcookie(ACCESS_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($newtok));\r\n return $newtok;\r\n }\r\n\r\n // Sending the user to login to grant access to this app\r\n else {\r\n list ($tok, $url) = $this->ymc->oauth_get_request_token($this->callbackURL);\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($tok));\r\n header(\"Location: $url\");\r\n }\r\n }",
"private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}",
"public function step2($code)\n {\n $url = \"https://app.engagor.com/oauth/access_token/\";\n\n $params = [\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'grant_type' => 'authorization_code',\n 'code' => (string) $code,\n ];\n\n $request = $this->requestFactory->createRequest(\n 'GET',\n $url . '?' . http_build_query($params)\n );\n\n $response = $this->client->sendRequest($request);\n\n $responseAsArray = json_decode($response->getBody(), true);\n\n if (isset($responseAsArray['error'])) {\n throw AuthenticationFailed::fromResponseArray($responseAsArray);\n }\n\n return new Tokens(\n $responseAsArray['access_token'],\n new DateTimeImmutable('@' . (time() + $responseAsArray['expires_in'])),\n explode(' ', $responseAsArray['scope']),\n $responseAsArray['refresh_token']\n );\n }",
"function getAccessToken($token) {\n $this->getToken(\"grant_type=authorization_code&code=$token&redirect_uri=\" . urlencode($this->redirectUri));\n }",
"public function getBearerToken()\n {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->returnResponse(ATHORIZATION_HEADER_NOT_FOUND, null, 'Access Token Not found');\n }",
"public function getOauthCode()\n {\n $date = new \\DateTime();\n return $date->getTimestamp();\n }",
"public function getOAuthToken($code, $token = false)\n {\n $apiData = array(\n 'code' => $code,\n 'api_key' => $this->getApiSecret(),\n 'account_id' => $this->getAccountId(),\n 'redirect_url' => $this->getApiCallback(),\n 'grant_type' => 'authorization_code'\n );\n\n $result = $this->_makeOAuthCall($apiData);\n\n return !$token ? $result : $result->access_token;\n }",
"public function getAccessTokenResponse($code)\n {\n $response = $this->getHttpClient()->post($this->getTokenUrl(), [\n 'headers' => ['Accept' => 'application/json'],\n 'form_params' => $this->getTokenFields($code),\n ]);\n\n return json_decode($response->getBody(), true);\n }",
"protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}",
"private function createAccessToken($authorization_code) {\n\n error_log(\"Authorization: \" . \"$this->client_id:$this->client_secret\");\n\n $authorization = base64_encode(\"$this->client_id:$this->client_secret\");\n $header = array(\"Authorization: Basic {$authorization}\",\"Content-Type: application/x-www-form-urlencoded\");\n $content = \"grant_type=authorization_code&code=$authorization_code&redirect_uri=$this->callback_uri\";\n\n\n //var_export(\"Content: \".$content);\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $this->token_url,\n CURLOPT_HTTPHEADER => $header,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $content\n ));\n $response = curl_exec($curl);\n\n if ($response === false || curl_errno($curl)) {\n echo \"Failed\";\n echo curl_error($curl);\n echo \"Failed\";\n\n curl_close($curl);\n\n throw new Exception('curl failed');\n }\n \n curl_close($curl);\n\n $json = json_decode($response, true);\n\n if ($json === false) {\n throw new Exception('json_decode returned false');\n } elseif (array_key_exists('error', $json)) {\n echo \"Error:<br />\";\n echo $authorization_code;\n echo $response;\n }\n\n $access_token = $json['access_token'];\n\n error_log(\"Access token recevied by createToken(): \" . $access_token);\n return $access_token;\n }",
"public function getZaloTokenFromCodeByUser($code, $codeVerifier)\n {\n $endpoint = '/access_token';\n return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);\n }",
"public function getToken()\n {\n $authHeader = $this->getHeader('AUTHORIZATION');\n $authQuery = $this->getQuery('token');\n\n return $authQuery ? $authQuery : $this->parseBearerValue($authHeader);\n }",
"public function getAccessToken($code)\n {\n $response = $this->getHttpClient()->get($this->getTokenUrl(), [\n 'query' => $this->getTokenFields($code),\n ]);\n\n return $this->parseAccessToken($response->getBody()->getContents());\n }",
"protected function getToken()\n {\n // We have a stateless app without sessions, so we use the cache to\n // retrieve the temp credentials for man in the middle attack\n // protection\n $key = 'oauth_temp_'.$this->request->input('oauth_token');\n $temp = $this->cache->get($key, '');\n\n return $this->server->getTokenCredentials(\n $temp,\n $this->request->input('oauth_token'),\n $this->request->input('oauth_verifier')\n );\n }",
"public function processGrantTypeAuthorizationCode(Oauth_Model_Request $request) {\n\n $modelLoader = $this->_helper->ModelLoader;\n //client \n $client = $this->retrieveClientFromHeader($request);\n //code\n $code_val = $request->getCode();\n $code = $this->_code_factory->consume($code_val);\n //resource owner\n $resource_owner_id = $code->getResourceOwnerId();\n $resource_owner = $modelLoader->loadResourceOwner($resource_owner_id);\n //scopes\n $scopes = $code->getScopes();\n //token\n $token = $this->_token_factory->create($resource_owner, $scopes);\n //refresh token\n $refresh_token = $this->_refresh_token_factory->create($client, $scopes, $resource_owner);\n //response\n return $this->compose_response($token, $refresh_token);\n }",
"public static function getAccessTokenFromCode($code)\n {\n return self::_getAccessToken($code, self::$ACCESS_TOKEN_FROM_CODE);\n }",
"private function get_token(&$request, $consumer, $token_type=\"access\") {\n $token_field = @$request->get_parameter('oauth_token');\n $token = $this->data_store->lookup_token(\n $consumer, $token_type, $token_field\n );\n if (!$token) {\n throw new OAuthException(\"Invalid $token_type token: $token_field\");\n }\n return $token;\n }",
"public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }",
"private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }",
"protected function createToken()\n {\n if ($this->client->getRefreshToken()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n } else {\n // Request authorization from the user.\n $authUrl = $this->client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $this->client->fetchAccessTokenWithAuthCode($authCode);\n $this->client->setAccessToken($accessToken);\n\n // Check to see if there was an error.\n if (array_key_exists('error', $accessToken)) {\n throw new Exception(join(', ', $accessToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($this->token))) {\n mkdir(dirname($this->token), 0700, true);\n }\n file_put_contents($this->token, json_encode($this->client->getAccessToken()));\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->throwError( ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public function run()\n {\n GrantType::checkGrantType(Yii::$app->request->post('grant_type'), GrantType::GRANT_TYPE_AUTHORIZATION_CODE);\n Client::checkClientSecret(Client::checkClientId(Yii::$app->request->post('client_id')), Yii::$app->request->post('client_secret'));\n AuthorizationCode::checkAuthorizationCode(Yii::$app->request->post('code'), Yii::$app->request->post('redirect_uri'));\n\n return AccessToken::createAccessToken(Yii::$app->request->post('client_id'), Yii::$app->request->post('code'));\n }",
"function requestAccessToken ($code, $server_domain) {\n $url = 'https://' . $server_domain . '/oauth/token/?' .\n 'grant_type=authorization_code'.\n '&client_id='.urlencode(APP_ID).\n '&client_secret='.urlencode(APP_SECRET_CODE).\n '&code='.urlencode($code);\n return executeHTTPRequest($url);\n}",
"public function processCallback($auth_code)\n {\n try {\n // set additional options\n $addional_option_arr = [];\n\n // get provider\n $provider = $this->getShopifyOauth2Provider();\n\n // obtain the access token\n $this->access_token = $provider->getAccessToken('authorization_code', ['code' => $auth_code]);\n\n // store shop data\n if ($this->shop_resource = ShopifyShop::storeResource($this->getResourceOwner())) {\n\n // store token information\n ShopifyShopAccessToken::storeResource($this->shop_resource, $this->access_token, $this->getAccessTokenValues());\n }\n\n } catch (\\Exception $e) {\n throw new ShopifyOauthCallbackException('Something went wrong: '. $e->getMessage());\n }\n\n return $this->access_token->getToken();\n }",
"public function actionAccesstoken()\n {\n $authParam = Yii::$app->getRequest()->getBodyParam('auth');\n \n if (!$authParam) {\n throw new NotFoundHttpException(\"There's no authorization code provided.\");\n }\n \n $model = Customer::find()->where(['auth_code' => $authParam])->andWhere(['>', 'auth_expired', time()])->one();\n \n if ($model === null) {\n throw new NotFoundHttpException(\"Invalid authorization code.\");\n }\n \n $model->token_code = md5(uniqid());\n $model->token_expired = time() + (60 * 60 * 24 * 60); // 60 days\n $model->save(false);\n \n $data = [\n 'access_token' => $model->token_code,\n 'expired_at' => $model->tokenExpired\n ];\n \n return $data;\n }",
"public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }",
"public function getBearerToken()\r\n {\r\n $header = $this->getAuthorizationHeader();\r\n // HEADER: Get the access token from header\r\n if(!empty($header))\r\n {\r\n if(preg_match('/Bearer\\s(\\S+)/', $header, $matches))\r\n {\r\n return $matches[1];\r\n }\r\n }\r\n $this->throwError(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not Found.');\r\n }",
"protected function getAccessToken($oauth_token) {\n\n\t}",
"public function getToken()\n {\n // curl:Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld\n // flags:0\n // forcedownlevel:0\n // formdir:3\n // username:<xxx>\n // password:<password>\n // SubmitCreds:Aanmelden\n // trusted:0\n\n $client = new \\GuzzleHttp\\Client(['cookies' => true]);\n $response = $client->request('POST', $_ENV['HANZE_LOGON_URL'], [\n 'headers' => [\n 'Origin' => 'https://www.hanze.nl',\n 'Refer' => 'https://www.hanze.nl/CookieAuth.dll?GetLogon?curl=Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld&reason=0&formdir=3',\n 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'\n ],\n 'allow_redirects' => false,\n 'form_params' => [\n 'curl' => 'Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld',\n 'flags' => 0,\n 'forcedownlevel' => 0,\n 'formdir' => 3,\n 'username' => $_ENV['HANZE_USERNAME'],\n 'password' => $_ENV['HANZE_PASSWORD'],\n 'SubmitCreds' => 'Aanmelden',\n 'trusted' => 0\n ]\n ]);\n return $client; \n }",
"public function getAccess($code)\n {\n $this->googleClient->setRedirectUri($this->redirectUrl);\n $this->addScopesToClient();\n\n $this->validateRedirectUrl();\n $this->validateScope();\n\n $token = $this->googleClient->fetchAccessTokenWithAuthCode($code);\n $this->googleClient->setAccessToken($token);\n\n return $token;\n }",
"public function getTokenData(string $code)\n {\n $parameters = [\n 'client_id' => config('nightbot.client_id'),\n 'client_secret' => config('nightbot.secret_id'),\n 'code' => $code,\n 'grant_type' => config('nightbot.grant_type'),\n 'redirect_uri' => config('nightbot.redirect_url'),\n ];\n\n $response = $this->client->request('POST', 'https://api.nightbot.tv/oauth2/token', [\n 'form_params' => $parameters,\n ])->getBody();\n\n return json_decode($response->getContents(), true);\n }",
"private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"function getAccessToken($token = NULL) {\n\t\t$r = $this->oAuthRequest ( $this->accessTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function getRefreshAndAccessToken($code)\n {\n $response = $this->getHttpClient()->post($this->getTokenUrl(), [\n 'headers' => ['Accept' => 'application/json'],\n 'form_params' => $this->getTokenFields($code),\n ]);\n\n $tokens = json_decode( $response->getBody(), true );\n $this->refresh_token = $tokens['refresh_token'];\n\n return $tokens['access_token'];\n }",
"public function getAccessToken($auth)\n {\n\n // Define URL for the request\n $post_url = self::$OAUTH.\"/accessToken\";\n\n // Prepare the POST data\n $data = [\n \"grant_type\" => \"authorization_code\",\n \"code\" => $auth,\n \"redirect_uri\" => $this->callback,\n \"client_id\" => $this->clientId,\n \"client_secret\" => $this->clientSecret\n ];\n\n // Build the complete request URL\n $data = http_build_query($data);\n\n // Initialize cURL\n $curl = curl_init();\n\n // Set the options\n curl_setopt($curl,CURLOPT_URL, $post_url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl,CURLOPT_POST, sizeof($data));\n curl_setopt($curl,CURLOPT_POSTFIELDS, $data);\n\n // Execute the request\n $result = curl_exec($curl);\n curl_close($curl);\n\n $codes = json_decode($result);\n if(!isset($codes->access_token) || isset($codes->error))\n {\n Throw new AccessTokenExchangeFailureException();\n }\n\n else {\n $this->accessToken = $codes->access_token;\n return $this->accessToken;\n }\n }",
"protected function request_token() {\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/request_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_callback' => SocialHelper::php_self()\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$_SESSION['oauth'] = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->authorize();\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}",
"protected function getAuthorizationCode()\n {\n $code = null;\n if ($this->responseMode === 'query' && isset($_GET['code'])) {\n $code = $_GET['code'];\n } else if ($this->responseMode === 'form_post' && isset($_POST['code'])) {\n $code = $_POST['code'];\n }\n\n return $code;\n }",
"public function getOAuthToken()\n {\n return $this->oauthToken->getToken();\n }",
"public function getToken(){\n\n if( $this->hasToken() )\n return $this->token;\n\n $token = $this->asObj('/authorize', self::POST);\n\n if( $token and isset($this->data) )\n return new Token($token);\n\n throw new ClientException(\"Could not retrieve token. Please check your credentials and try again.\");\n\n }",
"public function requestAccessToken($code)\n {\n $this->validateClientGrantState();\n /**\n * curl -F grant_type=authorization_code \\\n -F client_id=CLIENT_ID \\\n -F client_secret=CLIENT_SECRET \\\n -F code=AUTHORIZATION_CODE_FROM_REDIRECT \\\n -F redirect_uri=REDIRECT_URI \\\n -X POST https://api.rightsignature.com/oauth/token\n */\n $grantRequest = OauthCodeRequest::createAuthRequest($this->clientId, $this->clientSecret, $this->redirectUri);\n\n $grantRequest->setCode($code);\n\n $uri = $this->getFullTokenUri();\n $formData = $grantRequest->getFormData('access');\n\n return $this->guzzleClient->post($uri, [\n 'json' => $formData,\n ]);\n }",
"public function getAccessTokenFromAuthorizationCode($code)\n {\n if ($this->getAccessTokenUri() && $this->getClientId() && $this->getClientSecret()) {\n return \\json_decode($this->httpRequest($this->getAccessTokenUri(), 'POST', array(\n Constants::PARAM_GRANT_TYPE => Constants::GRANT_TYPE_AUTH_CODE,\n Constants::PARAM_CLIENT_ID => $this->getClientId(),\n Constants::PARAM_CODE => $code,\n Constants::PARAM_REDIRECT_URI => $this->getRedirectUri())\n ), true);\n }\n\n return null;\n }",
"private function getAuthorization()\n {\n // Post id_token\n if (new DateTime() > $this->tokenExpire) {\n $this->refreshToken();\n }\n $data = [\n 'authenticationToken' => $this->idToken,\n ];\n $url = \"https://api2.ov-chipkaart.nl/femobilegateway/v1/api/authorize\";\n $authorizationResponse = (self::Execute($url, $data));\n\n // Returns string\n $this->authorizationToken = $authorizationResponse['o'];\n }",
"public function access($code)\n\t{\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'client_secret' => $this->_config['app_secret'],\n\t\t\t'code' => $code\t\t\n\t\t);\n\t\t\n\t\t$url = $this->_access_token_endpoint.http_build_query($params);\n\t\t\n\t\t$response = file_get_contents($url);\n\t\t$params = null;\n\t\tparse_str($response, $params); \n\t\t\n\t\tif(isset($params['error']))\n\t\t{\n\t\t\treturn $this->oauth->response('failure', array(\n\t\t\t\t\t'error' => $params['error->message']\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$params = http_build_query(array(\n\t\t\t\t\t'access_token' => $params['access_token']\n\t\t\t\t)\n\t\t\t);\n\t\t\t$graph_url = $this->_graph_url.$params;\n\t\t\t$user = json_decode(file_get_contents($graph_url));\n\n\t\t\treturn $this->oauth->response('success', array(\n\t\t\t\t\t'user' => array(\n\t\t\t\t\t\t'id'\t\t=> $user->id,\n\t\t\t\t\t\t'name'\t\t=> $user->name,\n\t\t\t\t\t\t'username'\t=> $user->username,\n\t\t\t\t\t\t'email'\t\t=> $user->email\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"public function getAccessTokenByCode($code)\n {\n return $this->post('/api/oauth/accessToken', [\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => $this->redirect_uri,\n 'code' => $code,\n ]);\n }",
"protected function getBearer(){\n\t\t$a = $this->param->getServer('REDIRECT_HTTP_AUTHORIZATION');\n\t\tif(!$a){\n\t\t\t$a = $this->param->getServer('HTTP_AUTHORIZATION');\n\t\t}\n\n\t\tif($a){\n\t\t\t$authorization = $a;\n\t\t} else {\n\t\t\t$authorization = 'Bearer ' . $this->param->getParam('token');\n\t\t}\n\n\t\tif($authorization){\n\t\t\t$authorization = explode(' ', $authorization);\n\t\t\tif(isset($authorization[1])){\n\t\t\t\t$token = explode('.', $authorization[1]);\n\t\t\t\tif(count($token) == 3){\n\t\t\t\t\treturn $token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function get($code)\n {\n foreach ($this->getDbConnection()->fetchAll(\n 'SELECT * from oauth_auth_code\n WHERE auth_code = :authCode AND expire_time > :ts',\n [\n 'authCode' => $code,\n 'ts' => time()\n ]\n ) as $row) {\n if ($row) {\n return (new AuthCodeEntity($this->server))\n ->setRedirectUri($row['client_redirect_uri'])\n ->setExpireTime($row['expire_time'])\n ->setId($row['auth_code']);\n }\n }\n return null;\n }",
"function getSpotifyToken($redirectUri, $clientId, $code){\n\t$result = null;\n\t$error = false;\n\t$ch = setUpSpotifyCurl($clientId, [\n\t\t\t'grant_type' => 'authorization_code',\n\t\t\t'code' => $code,\n\t\t\t'redirect_uri' => $redirectUri\n\t]);\n\t\n\t// Run query\n\t$result = curl_exec($ch);\n\t\n\t// Something failed during the request\n\tif(curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400){\n\t\t$error = true;\n\t}\n\tcurl_close($ch);\n\t\n\tif($error) return setErrorHeader($result);\n\t\n\t// Return our token data\n\treturn setSuccessHeader($result);\n}",
"private function tokenInit()\n {\n $tempSession = uniqid();\n echo \"************************************************* MONZO AUTHENTICATION WORKFLOW ***********************************************************\\n\";\n echo \"Please visit the following URL in your browser and follow instructions \\n\";\n echo \"###########\\n\";\n echo \"\\n\";\n echo \"https://auth.monzo.com/?client_id=$this->clientId&redirect_uri=$this->redirectUri&response_type=code&state=$tempSession \\n\";\n echo \"\\n\";\n echo \"###########\\n\";\n echo \"When you get email from Monzo, copy the link button (Right click -> Copy link Location) from the email and paste here. Do not click it. \\n\";\n echo \"*********************************************************************************************************************************************\\n\";\n $verificationUrl = readline(\"Email link: \");\n parse_str(parse_url($verificationUrl, PHP_URL_QUERY) , $urlParams);\n if (array_key_exists('code', $urlParams) && array_key_exists('state', $urlParams))\n {\n if ($urlParams['state'] === $tempSession)\n {\n $data = array(\n 'grant_type' => 'authorization_code',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'redirect_uri' => $this->redirectUri,\n 'code' => $urlParams['code']\n );\n $tokenData = $this->getJson('/oauth2/token', $data, false);\n if (isset($tokenData['access_token']) && isset($tokenData['refresh_token']))\n {\n $this->bearerToken = $tokenData['access_token'];\n $this->refreshToken = $tokenData['refresh_token'];\n if ($this->validateTokens())\n {\n $this->storeTokens($tokenData['access_token'], $tokenData['refresh_token']);\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Newly created tokens not valid\");\n throw new Exception('Monzo: Newly created Tokens not valid');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Tokens not found\");\n throw new Exception('Monzo: Tokens not found');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: State does not match the one that was sent to Monzo.\");\n throw new Exception('Monzo: State does not match the one that was sent to Monzo.');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Code and State ids not found in the email URL\");\n throw new Exception('Monzo: Code and State ids not found in the email URL');\n }\n }",
"function get_reddit_access_token($authorization_code)\n{\n\t$ch = curl_init();\n\t\n\t$parameters = [\n\t\t'grant_type' => 'authorization_code',\n\t\t'code' => $authorization_code,\n\t\t'redirect_uri' => get_reddit_redirect_uri(),\n\t];\n\t\n\tcurl_setopt($ch, CURLOPT_URL, REDDIT_OAUTH_PREFIX . 'access_token');\n\tcurl_setopt($ch, CURLOPT_USERAGENT, REDDIT_USER_AGENT);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($parameters));\n\tcurl_setopt($ch, CURLOPT_USERPWD, sprintf(\"%s:%s\", REDDIT_OAUTH_CLIENT_ID, REDDIT_OAUTH_CLIENT_SECRET));\n\t\n\t$response = curl_exec($ch);\n\tif (curl_errno($ch) === 0 && ($status = curl_getinfo($ch, CURLINFO_HTTP_CODE)) === 200) {\n\t\t$data = json_decode($response, true);\n\t\tif (isset($data['access_token'])) {\n\t\t\t$data['expires'] = time() + $data['expires_in'];\n\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tthrow new \\RuntimeException(\"Request succeeded but no access_token in response: $response\");\n\t}\n\t\n\tthrow new \\RuntimeException(\"Request for access token failed with status $status.\\nResponse: $response\");\n}",
"public function GetToken($data){ \n \n return $this->token;\n \n }",
"protected static function getBearerToken() \n {\n $headers = self::getAuthorizationHeader();\n // HEADER: Get the access token from the header\n \n if ((! empty($headers)) && (! is_null($headers))) {\n // if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n // return $matches[1];\n // }\n return $headers;\n }\n Utils::json_respond(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public function fetchAccessTokenFromCode($code, AccountInterface $account);",
"function getBearerToken() {\n $headers = getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n}",
"public function getAccessTokenByCode($code)\n {\n return $this->post('/api/oauth/accessToken', [\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'grant_type' => 'authorization_code',\n 'scope' => $this->scope,\n 'redirect_uri' => $this->redirect_uri,\n 'code' => $code,\n ]);\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n }"
] | [
"0.7473007",
"0.74613917",
"0.69956553",
"0.6934205",
"0.6928433",
"0.6862946",
"0.68281823",
"0.6772642",
"0.67095494",
"0.6702045",
"0.66770226",
"0.6670247",
"0.6662462",
"0.6651413",
"0.6650898",
"0.6649306",
"0.663062",
"0.658401",
"0.6549713",
"0.6542398",
"0.651721",
"0.65118134",
"0.6511142",
"0.64892733",
"0.6484576",
"0.6482676",
"0.6476543",
"0.6459088",
"0.64579594",
"0.6446881",
"0.6391702",
"0.6359809",
"0.63426226",
"0.63423514",
"0.6342163",
"0.6333412",
"0.6333412",
"0.6333412",
"0.6333412",
"0.6328051",
"0.63158184",
"0.63152075",
"0.628866",
"0.627351",
"0.62441397",
"0.6237136",
"0.6233296",
"0.6223613",
"0.622344",
"0.62206656",
"0.62059075",
"0.6177721",
"0.6176597",
"0.6175234",
"0.61649173",
"0.61647266",
"0.61608046",
"0.616032",
"0.6160178",
"0.61430454",
"0.6139708",
"0.613328",
"0.61179805",
"0.61173344",
"0.6112851",
"0.6105223",
"0.6102744",
"0.61017156",
"0.610084",
"0.6098987",
"0.60989034",
"0.6097829",
"0.6089065",
"0.6084675",
"0.6084675",
"0.6084675",
"0.6084675",
"0.6084675",
"0.60815585",
"0.60814553",
"0.606856",
"0.6058571",
"0.6057035",
"0.6056641",
"0.60556483",
"0.6055425",
"0.60550743",
"0.6050594",
"0.60479057",
"0.6037952",
"0.6037733",
"0.6033324",
"0.6032362",
"0.60315275",
"0.60245395",
"0.6021908",
"0.6008629",
"0.6000607",
"0.59925514",
"0.5990197",
"0.59877473"
] | 0.0 | -1 |
Get Zalo Token by user from a refresh token. | public function getZaloTokenFromRefreshTokenByUser($refreshToken)
{
$endpoint = '/access_token';
return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRefreshToken();",
"public function refreshToken($refreshToken,$userIdentifier){\r\n return $oAuthTokens = $this->oAuthClient->generateAccessTokenFromRefreshToken($refreshToken,$userIdentifier);\r\n }",
"public function getRefreshToken($refreshToken);",
"public function userByToken();",
"private function getRefreshToken() {\n if (!empty($this->refresh_token)) {\n return $this->refresh_token;\n } else {\n $api_keys=db_asocquery(\"SELECT * FROM cfgesitoken WHERE `tokenID` = '$this->tokenID';\");\n if (count($api_keys) == 1) {\n if (isset($api_keys[0]['token'])) {\n $this->refresh_token = $api_keys[0]['token'];\n return $this->refresh_token;\n }\n }\n }\n\treturn FALSE;\n }",
"public function getToken(string $userToken): ?Token;",
"public function getZaloTokenFromRefreshTokenByOA($refreshToken)\n {\n $endpoint = '/oa/access_token';\n return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);\n }",
"public function generateAccessToken($token){\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n $tokenval = json_decode($token->value);\n $refresh_token=$tokenval->refresh_token;\n\n $post = [\n 'refresh_token' => $refresh_token,\n 'redirect_uri' => 'http://example.com/callbackurl',\n 'client_id' => $zohoCredentials->client_id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_secret' => $zohoCredentials->client_secret,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'grant_type' => 'refresh_token',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n\n if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200) {\n $tokenval->access_token = json_decode($response)->access_token;\n $token->value=json_encode($tokenval);\n $token->save();\n }\n\n return json_decode($token->value)->access_token;\n }",
"public function byUser( User $user )\n {\n return $user->google_access_token;\n }",
"private function get_token($user)\n\t\t{\n\t\t\treturn $user->id . ';' . $this->ip_lock($this->getAuthToken($user)) . ';' . $_SERVER['REMOTE_ADDR'];\n\t\t}",
"public static function get_token() {\n global $USER;\n $sid = session_id();\n return self::get_token_for_user($USER->id, $sid);\n }",
"public function get_refresh_token()\n\t{\n\t\treturn $this->fetch(\n\t\t\t'https://graph.instagram.com/refresh_access_token',\n\t\t\t['grant_type' => 'ig_refresh_token']\n\t\t);\n\t}",
"private static function getGFusionOAuthRefreshToken() {\n\t\treturn '1/zuRSQC5Q12yBoJ1idPljEw4xlolOWXrp4hyoKSC1C2o';\n\t}",
"public function getRefreshToken()\n {\n return $this->get('RefreshToken');\n }",
"private function getAccessToken($user) {\n return $user->createToken('Token')->accessToken;\n }",
"public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }",
"public function refreshToken()\n {\n return $this->token['refresh_token'] ?? null;\n }",
"public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}",
"public function refreshToken()\n {\n return $this->refreshToken;\n }",
"public function getRefreshToken() {\n\t\treturn $this->refresh_token;\n\t}",
"public function refreshToken(Authenticatable $user) {\n $claims = [\n 'name' => $user->name,\n 'email' => $user->email,\n 'locale' => config('app.locale')\n ];\n \n return $this->repository->encode($user->getAuthIdentifier(), $claims);\n }",
"public function getToken($forceRefresh = false)\n {\n $cacheKey = $this->getCacheKey();\n $cached = $this->getCache()->fetch($cacheKey);\n\n if ($forceRefresh || empty($cached)) {\n $token = $this->getTokenFromServer();\n\n // XXX: T_T... 7200 - 1500\n $this->getCache()->save($cacheKey, $token['authorizer_access_token'], $token['expires_in'] - 1500);\n\n return $token['authorizer_access_token'];\n }\n\n return $cached;\n }",
"public function getIdToken()\n {\n $clientId = $this->scopeConfig->getValue('transiteo_activation/general/client_id', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $refreshToken = $this->scopeConfig->getValue('transiteo_activation/general/refresh_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $response = $this->doRequest(\n self::API_AUTH_REQUEST_URI . \"oauth2/token\",\n [\n 'headers' => [\n 'Content-type' => 'application/x-www-form-urlencoded',\n ],\n 'form_params' => [\n 'grant_type' => 'refresh_token',\n 'client_id' => $clientId,\n 'refresh_token' => $refreshToken\n ],\n 'http_errors' => false\n ],\n Request::HTTP_METHOD_POST\n );\n\n $status = $response->getStatusCode(); // 200 status code\n $responseBody = $response->getBody();\n $responseContent = $responseBody->getContents(); // here you will have the API response in JSON format\n\n if ($status == 200) {\n $responseArray = $this->serializer->unserialize($responseContent);\n\n $this->idToken = $responseArray['id_token'];\n //$this->cookie->set(self::COOKIE_NAME, $this->idToken, 3500);\n $this->flagManager->saveFlag(self::ID_TOKEN_FLAG_NAME, $this->idToken);\n $accessToken = $responseArray['access_token'];\n $this->flagManager->saveFlag(self::ACCESS_TOKEN_FLAG_NAME, $accessToken);\n $expires_in = $responseArray['expires_in'];\n $this->flagManager->saveFlag(self::TOKEN_EXPIRES_IN_FLAG_NAME, $expires_in);\n $token_type = $responseArray['token_type'];\n $this->flagManager->saveFlag(self::TOKEN_TYPE_FLAG_NAME, $token_type);\n $date = new \\DateTime();\n $this->flagManager->saveFlag(self::TOKEN_RECEIVED_TIMESTAMP, $date->getTimestamp());\n }\n\n return $responseContent;\n }",
"public function get_access_token() {\n $access_token = get_transient( 'yith-wcbk-gcal-access-token' );\n if ( !$access_token ) {\n $refresh_token = $this->get_option( 'refresh-token' );\n if ( $refresh_token ) {\n $data = array(\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'refresh_token' => $refresh_token,\n 'grant_type' => 'refresh_token',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token refreshed successfully', compact( 'access_token', 'expires_in', 'body' ) );\n } else {\n $this->error( 'Error while refreshing Access Token: ', $response );\n }\n }\n }\n\n return $access_token;\n }",
"public function getRefreshToken(): ?string;",
"public function refreshToken()\n\t{\n\t\tAuth::user()->generateToken()->didUpdate()->save();\n\n\t\t// Return token\n\t\treturn response()->json([\n\t\t\t'status' => 'Token updated',\n\t\t\t'token' => Auth::user()->token,\n\t\t], 200);\n\t}",
"public function get($token)\n {\n $this->db->query('SELECT * FROM oauth_refresh_tokens WHERE refresh_token = \"'.$this->db->real_escape($token).'\"');\n if ($this->db->num_rows() === 1) {\n $this->db->next_record(MYSQL_ASSOC);\n $token = new RefreshTokenEntity($this->server);\n $token->setId($this->db->Record['refresh_token']);\n $token->setExpireTime($this->db->Record['expire_time']);\n $token->setAccessTokenId($this->db->Record['access_token']);\n return $token;\n }\n return null;\n }",
"public function getUserToken()\n {\n return !is_null($this->authToken) ? $this->authToken : $this->cookieHelper->getRequestCookie('auth');\n }",
"public function getAccessTokenFromRefreshToken($refresh_token) {\n\t\n\t\t//array causes Content-Type:multipart/form-data\t\t\n\t\t$post = array(\"grant_type\"=>\"refresh_token\",\"refresh_token\"=>$refresh_token,'vers'=>$this->app_version,'os'=>$this->os_version,'device'=>$this->device_name,'udid'=>$this->device_id);\n\t\t\n\t\t//str causes Content-Type:application/x-www-form-urlencoded (both work for token exchange)\n\t\t//$post = \"grant_type=refresh_token&refresh_token=\".$refresh_token;\n\n\t\t$ci = curl_init();\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_USERPWD, $this->clientID . \":\" . $this->clientSecret);\n\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $post);\n\t\tcurl_setopt($ci, CURLOPT_URL, $this->token_url);\n\t\t$response = curl_exec($ci);\n\t\tcurl_close ($ci);\n\n\t\t$response = json_decode($response,true);\n\t\treturn $response;\n\t}",
"private function getAuthToken(Authenticatable $user, AuthorizationHeaderToken $token): AuthToken\n {\n return AuthToken::where('user_id', '=', $user->getAuthIdentifier())\n ->where('token', '=', $token->getToken())\n ->first();\n }",
"public static function generateNewToken( \\app\\models\\User $user)\n {\n $accessToken = ApiAccessToken::find()->where(['user_id' => $user->id])->one();\n if (!$accessToken) {\n $accessToken = new ApiAccessToken();\n $accessToken->user_id = $user->id;\n }\n $accessToken->access_token = Yii::$app->security->generateRandomString( self::ACCESS_TOKEN_LENGTH );\n $accessToken->exp_date = date('Y-m-d H:i:s', strtotime(\"now +\" . self::EXPIRATION_PERIOD ));\n return $accessToken;\n }",
"private function checkToken()\n {\n\t\ttry {\n\t\t\t$user = JWTAuth::GetJWTUser();\n\t\t\t$this->token = JWTAuth::CheckJWTToken($user->id);\n return $user;\n } catch (\\UnexpectedValueException $e) {\n return $this->sendResponse($e->getMessage());\n }\n }",
"public function get_refresh_token() {\n return $this->refreshtoken;\n }",
"public function getRefreshToken()\n {\n return $this->refreshToken;\n }",
"public function getToken()\n {\n $authHeader = $this->getHeader('AUTHORIZATION');\n $authQuery = $this->getQuery('token');\n\n return $authQuery ? $authQuery : $this->parseBearerValue($authHeader);\n }",
"function getUserFromToken() {\n\t\treturn $this->_storage->loadUserFromToken();\n\t}",
"private function resolveCurrentRefreshToken(UserInterface $user): ?RefreshToken\n {\n $refreshToken = $this->storage->findOneByUser($user);\n if (!$refreshToken || $refreshToken->isExpired()) {\n return null;\n }\n\n return $refreshToken;\n }",
"public function getNewRefreshToken() {\n return new RefreshToken();\n }",
"abstract protected function getUserByToken($token);",
"protected function getUserLastToken($user, $guard)\n {\n $uid = $user->getKey();\n // User.api.1:LastToken\n $key = sprintf(\"User.%s-%s:LastToken\", $guard, $uid);\n return Cache::get($key);\n }",
"public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }",
"public function generateRefreshToken($code, $client_id, $client_secret) {\n //get crm token credentials\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n\n if(is_null($zohoCredentials)) {\n $this::create([\n 'user_id' => Auth::user()->id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n ]);\n }\n\n\n $token = AccessToken::where('user_id', Auth::user()->id)->first();\n\n $post = [\n 'code' => $code,\n 'redirect_uri' => 'http://example.com/callbackurl',\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n // curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/x-www-form-urlencoded'\n ));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n if(isset(json_decode($response, true)['access_token'])) {\n if(is_null($token)){\n AccessToken::create([\n 'user_id'=>Auth::user()->id,\n 'value'=>$response,\n ]);\n\n return response(['Zoho - Token successfully created'], 200);\n }else{\n $token->value=$response;\n $token->save();\n }\n } else {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'access_token' => [$response],\n ]);\n throw $error;\n }\n }",
"public function userTokenAuth(Request $request)\n {\n $header = $request->header('Authorization');\n if (Str::startsWith($header, 'Bearer ')) {\n $header = Str::substr($header, 7);\n }else{\n response()->json($this->apiResponse(false,null,'Authorization syntax error'),200)->send();\n die();\n }\n\n /*\n * Check the User Token\n */\n $user = User::where('token',$header)->get()->first();\n\n if($user != null){\n\n if($user->status == 0){\n\n /*\n * Blocked User\n */\n response()->json($this->apiResponse(false,null,'هذا الحساب تم حظره من قبل مسؤول النظام' ),200)->send();\n die();\n }else{\n\n return $user;\n\n }\n\n }else{\n\n response()->json($this->apiResponse(false,null,'يجب ان تقوم بتسجيل الدخول لكي تتمكن من تصفح التطبيق'),200)->send();\n die();\n }\n }",
"public function getNewRefreshToken()\n {\n // TODO: Implement getNewRefreshToken() method.\n }",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"protected function __token($user, $pass){\n $response = $this->cURL->post($this->endpoint . '/' . $this->args['oauth'],\n $vars = array('client_id' => $this->clientID, 'client_secret' => $this->clientSecret, 'grant_type' => 'password','password' => $pass,'username' => $user));\n if($response->headers['Status-Code'] == 401){\n throw new RuntimeException($response->body);\n return 0;\n }\n $res = json_decode($response->body, TRUE);\n $_SESSION['access_token'] = $this->access_token = $res['access_token'];\n return $this->access_token;\n }",
"public function getNewRefreshToken()\n {\n return new RefreshTokenEntity;\n }",
"public function getToken(Request $request)\n {\n $email = $request->input('username');\n $password = $request->input('password');\n //checking if user exists\n $user = User::where('email', $email)->get();\n if ($user->count() > 0) {\n $user = $user[0];\n if (Hash::check($password, $user->password)) {\n $role = $user->app_role;\n\n $oauth_client = DB::table('oauth_clients')->where('password_client', 1)->first();\n $request->request->add([\n 'grant_type' => 'password',\n 'client_id' => $oauth_client->id,\n 'client_secret' => $oauth_client->secret,\n 'scope' => '*',\n ]);\n $tokenRequest = Request::create(\n '/oauth/token',\n 'post'\n );\n return Route::dispatch($tokenRequest);\n\n// $temp = Route::dispatch($tokenRequest);\n// return $temp->expires_in;\n// return Carbon::parse($temp->expires_in)->toDateTimeString();\n } else {\n //type = 2 => incorrect passowrd\n return [\n 'error' => '2',\n 'errorType' => 'auth'];\n }\n } else {\n //type= 1 => no such user exists\n return [\n 'error' => '1',\n 'errorType' => 'auth'];\n }\n }",
"public function retrieveRefreshTokenById($tokenId)\n {\n return $this->start()->uri(\"/api/jwt/refresh\")\n ->urlSegment($tokenId)\n ->get()\n ->go();\n }",
"public function getRefreshToken(): string\n {\n return $this->refreshToken;\n }",
"public function LoginToken_get()\n {\n $tokenData['user_id'] = '1';\n $tokenData['role'] = 'admin';\n $tokenData['first_name'] = 'Al';\n $tokenData['last_name'] = 'Mobin';\n $tokenData['phone'] = '+8801921040960';\n $jwtToken = $this->tokenHandler->GenerateToken($tokenData);\n $token = $jwtToken;\n echo json_encode(array('Token'=>$jwtToken));\n }",
"function genera_token ($user, $profile)\r\n{\r\n\t$token = \"\";\r\n\r\n\t/* Aqui estaria el algoritmo para la generacion\r\n\tdel token */\r\n\r\n\treturn $token;\r\n}",
"function retrieveUserByAccessToken($accessToken);",
"public function retrieveRefreshTokens($userId)\n {\n return $this->start()->uri(\"/api/jwt/refresh\")\n ->urlParameter(\"userId\", $userId)\n ->get()\n ->go();\n }",
"function getSpotifyRefreshToken($clientId, $refreshToken){\n\t$result = null;\n\t$error = false;\n\t$ch = $ch = setUpSpotifyCurl($clientId, [\n\t\t\t'grant_type' => 'refresh_token',\n\t\t\t'refresh_token' => $refreshToken\n\t]);\n\t\n\t// Run query\n\t$result = curl_exec($ch);\n\t\n\t// Something failed during the request\n\tif(curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400){\n\t\t$error = true;\n\t}\n\tcurl_close($ch);\n\t\n\tif($error) return setErrorHeader($result);\n\t\n\t// Return our token data\n\treturn setSuccessHeader($result);\n}",
"public function getBearerToken()\n {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->returnResponse(ATHORIZATION_HEADER_NOT_FOUND, null, 'Access Token Not found');\n }",
"function getRdioRefreshToken($clientId, $refreshToken){\n $result = null;\n $error = false;\n $ch = $ch = setUpRdioCurl($clientId, [\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $refreshToken\n ]);\n \n // Run query\n $result = curl_exec($ch);\n \n // Something failed during the request\n if(curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400){\n $error = true;\n }\n curl_close($ch);\n \n if($error) return setErrorHeader($result);\n \n // Return our token data\n return setSuccessHeader($result);\n}",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->throwError( ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"private function getUserToken(User $user) {\n return $this->get('lexik_jwt_authentication.encoder.default')\n ->encode([\n 'username' => $user->getUsername(),\n 'exp' => time() + 30 // 1 hour expiration\n ]);\n }",
"public function getRefreshToken()\n {\n if (! $this->refreshToken) {\n $this->exchange();\n }\n\n return $this->refreshToken;\n }",
"public function refreshToken()\n {\n return $this->hasOne('Deploy\\Models\\DeployRefreshToken', 'deploy_access_token_id')->first();\n }",
"public function getAccessTokenFromRefreshToken($refresh_token): AccessToken;",
"public function getToken($user_id)\n {\n $url = $this->url . '/user/assign/token';\n\n $postData = json_encode([\n \"authCode\" => $user_id\n ]);\n\n $url = $url . '?' . $this->getParam([], $postData);\n\n $data = [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'app_key' => $this->key\n ],\n 'body' => $postData\n ];\n $result = $this->urlpost($url, $data);\n if (isset($result['success']) and $result['success'] == 1) {\n $token_key = 'token_' . $user_id;\n $this->redis->set($token_key, $result['data']['token']);\n }\n return $result['data']['token'];\n }",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"public function getUserTokens();",
"public function getBearerToken()\r\n {\r\n $header = $this->getAuthorizationHeader();\r\n // HEADER: Get the access token from header\r\n if(!empty($header))\r\n {\r\n if(preg_match('/Bearer\\s(\\S+)/', $header, $matches))\r\n {\r\n return $matches[1];\r\n }\r\n }\r\n $this->throwError(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not Found.');\r\n }",
"private function refreshToken()\n {\n syslog(LOG_DEBUG, \"Monzo: Refreshing Token\");\n $data = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'refresh_token' => $this->refreshToken\n );\n $jsonResponse = $this->getJson('/oauth2/token', $data, false);\n if (isset($jsonResponse['access_token']) && isset($jsonResponse['refresh_token']))\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validating\");\n $this->refreshToken = $jsonResponse['refresh_token'];\n $this->bearerToken = $jsonResponse['access_token'];\n if ($this->validateTokens())\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validated and stored\");\n $this->storeTokens($this->bearerToken, $this->refreshToken);\n return true;\n }else {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, but failed to validate\");\n return false;\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Not able to refresh token\");\n throw new Exception('Monzo Not able to refresh token');\n return false;\n }\n }",
"public function receiveUserToken(User $user, $password);",
"public function getNewRefreshToken() {\n return new RefreshTokenEntity();\n }",
"function getBearerToken() {\n $headers = getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n}",
"private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }",
"public function GetToken($data){ \n \n return $this->token;\n \n }",
"public static function passwordless_get_user_token( $user_id ) {\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT token FROM {$wpdb->base_prefix}pp_passwordless WHERE user_id = $user_id\";\n\n\t\treturn $wpdb->get_var( $sql );\n\t}",
"public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }",
"public function withAuthToken()\n {\n $user = Auth::user();\n return $this->withToken($user->access_token)->withRefreshToken($user->refresh_token);\n }",
"public function getToken() {\n return $this->accessToken;\n }",
"public static function get_oauth_token($auth) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&code=\".$auth.\"&grant_type=authorization_code\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"protected function buildZaloTokenFromZaloResponse($response)\n {\n $data = $response->getDecodedBody();\n\n if (!isset($data['access_token'])) {\n throw new ZaloSDKException('Access token was not returned from request.', 401);\n }\n $accessToken = $data['access_token'];\n\n if (!isset($data['refresh_token'])) {\n throw new ZaloSDKException('Refresh token was not returned from request.', 401);\n }\n $refreshToken = $data['refresh_token'];\n\n $accessTokenExpiresIn = 0;\n if (isset($data['expires_in'])) {\n $accessTokenExpiresIn = $data['expires_in'];\n }\n\n return new ZaloToken($accessToken, $refreshToken, $accessTokenExpiresIn);\n }",
"public function obtenerAuthToken()\n {\n $controller = new SignaBlockController;\n $response = $controller->auth();\n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->token;\n }\n }\n return response()->json($this->jsonError);\n }",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function getToken(): TokenInterface;",
"public function getToken(): TokenInterface;",
"public function generateToken(User $user)\n {\n $token = new Token();\n $token->setAttribute('user_id', $user->getAttribute('id'));\n $token->setAttribute('token', md5($user->getAttribute('email') . microtime() . rand(0, 100)));\n $this->renewToken($token);\n $token->save();\n return $token;\n }",
"public function refreshToken() {\n $token = $this->controller->refreshToken();\n\n return $this->response(compact('token'));\n }",
"public function get_user()\n {\n $token = $this->CI->input->get_request_header('Authorization', TRUE);\n $token_json = base64_decode($token);\n $token = json_decode($token_json);\n $userid = $token->userId;\n $username = $token->userName;\n return ['id'=>$userid,'name'=>$username];\n }",
"public function refresh()\n {\n try {\n if ($token = $this->guard()->refresh()) {\n return response()\n ->json([\n 'error' => false,\n 'message' => 'Your token already refreshed',\n 'data' => [\n 'token' => $token\n ]\n ], 200)\n ->header('Authorization', $token)\n ;\n }\n \n return response()->json([\n 'error' => true,\n 'message' => 'Your credentials is invalid, failed to refresh token',\n 'data' => []\n ], 401);\n } catch (\\Throwable $th) {\n $this->guard()->logout();\n\n return response()->json([\n 'error' => false,\n 'message' => 'Successfully logging out from system'\n ], 200);\n }\n }",
"function requestToken() {\n\t\t$conn = new Connection('DB-Name');\n\n\t\t//instantiate login information, api_key, username, and password\n\t\t$api = $conn->tokenGrab(x);\n\t\t$user = $conn->tokenGrab(x);\n\t\t$pass = $conn->tokenGrab(x);\n\n\t\t//build fields to send to the token giver\n\t\t$fields = array(\n\t\t\t'grant_type' \t=> urlencode('password')\n\t\t\t, 'client_id' \t=> urlencode($api)\n\t\t\t, 'username' \t=> urlencode($user)\n\t\t\t, 'password'\t=> urlencode($pass));\n\n\t\t$fields_string = '';\n\t\tforeach ($fields as $key=>$value) { $fields_string .= $key . '=' . $value . '&'; }\n\t\trtrim($fields_string, '&');\n\n\t\t//send the request to token giver via cURL\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $conn->tokenGrab(x));\n\t\tcurl_setopt($ch, CURLOPT_POST, count($fields));\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t 'Content-Type' => urlencode('application/x-www-form-urlencoded')\n\t\t\t, 'Content-Length' => urlencode(strlen($fields_string))\n\t\t));\n\n\t\t$cherwellApiResponse = json_decode(curl_exec($ch), TRUE);\n\t\treturn $cherwellApiResponse['access_token'];\n\t}",
"public function get($token)\n {\n foreach ($this->getDbConnection()->fetchAll(\n 'SELECT * FROM oauth_refresh_token\n WHERE refresh_token = :token', [\n 'token' => $token\n ]\n ) as $row) {\n if ($row) {\n return (new RefreshTokenEntity($this->server))\n ->setAccessTokenId($row['access_token'])\n ->setExpireTime($row['expire_time'])\n ->setId($row['refresh_token']);\n }\n }\n return null;\n }",
"public function getToken(): object\n {\n $token = (object) [];\n\n if ($this->accessToken && $this->refreshToken && $this->instanceUrl) {\n $token = (object) [\n 'accessToken' => $this->accessToken,\n 'refreshToken' => $this->refreshToken,\n 'instanceUrl' => $this->instanceUrl,\n 'tokenExpiry' => $this->tokenExpiry\n ];\n }\n\n return $token;\n }",
"public static function user_token($salt)\r\n {\r\n return self::hash($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'], $salt);\r\n }",
"public function getToken()\n {\n return $this->accessToken;\n }",
"public function loginWithRefreshToken() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('refresh_token', 'Token', 'required');\n $this->form_validation->set_rules('uuid', 'UUID', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n // verify token\n if ($this->user_model->getValue('refresh_token') != $this->input->post('refresh_token')) {\n \tlog_message('debug', 'token provided: ' . $this->input->post('refresh_token') . ' local: ' . $this->user_model->getValue('refresh_token'));\n \t$this->error(404, 'Verification error');\n }\n \n \tif ($this->user_model->getValue('confirmed') == 0) {\n \t\t$this->error(206, 'Please confirm the account');\n \t}\n \n\t\t// refresh token\n\t\t$refresh_token = $this->generateToken();\n\t\t$this->user_model->setValue('refresh_token', $refresh_token);\n\t\t\n\t\t// update refresh token\n\t\tif (! $this->user_model->updateToken($this->input->post('refresh_token'))) {\n\t\t\t$this->error(400, 'Error while creating token');\n\t\t}\n\n\t\t// save userid into session and send token\n\t\t$this->session->userid = $this->user_model->getValue('id');\n\t\t$data['refresh_token'] = $refresh_token;\n\t\t$this->response($data);\n }",
"public function generateToken() {\n // we randomly generate an API token\n $api_token = Str::random(80);\n // we check whether the generated token already exists in the users table\n $api_token_found = User::where('api_token', $api_token)->first();\n while ($api_token_found) {\n // if the generated token is already associated with a registered user, we generates a new token\n $api_token = Str::random(80);\n // we check whether also this newly generated token already exists in the users table\n $api_token_found = User::where('api_token', $api_token)->first();\n }\n // we get the logged in user\n $user = Auth::user();\n // we associate to this user the generated token (this token will certainly be different from those of the other users)\n $user->api_token = $api_token;\n $user->save();\n return redirect()->route('admin.profile');\n }",
"public function recentlyCreatedToken(CanResetPassword $user);",
"public static function getFastlinkToken()\n\t\t{\n\t\t\t$url = \"https://developer.api.yodlee.com/ysl/restserver/v1/user/accessTokens?appIds=10003600\";\n\n\t\t\t$curl = curl_init();\n\n\t\t\tcurl_setopt_array($curl, array(\n\t\t\t CURLOPT_SSL_VERIFYPEER => false,\n\t\t\t CURLOPT_URL => $url,\n\t\t\t CURLOPT_RETURNTRANSFER => 1,\n\t\t\t CURLOPT_TIMEOUT => 360,\n\t\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Authorization: {cobSession='.self::$cobSession.',userSession='.self::$userSession.'}'\n\t\t\t )\n\t\t\t));\n\n\t\t\t$response = json_decode(curl_exec($curl), TRUE);\n\n\t\t\tif ($response) {\n\t\t\t\tself::$fastlinkAppId = $response['user']['accessTokens'][0]['appId'];\n\t\t\t\tself::$fastlinkUrl = $response['user']['accessTokens'][0]['url'];\n\t\t\t\tself::$fastlinkValue = $response['user']['accessTokens'][0]['value'];\n\t\t\t}\n\t\t}",
"public function find($id)\n {\n return Passport::refreshToken()->findById($id);\n }",
"public function generate(User $user): PasswordToken;"
] | [
"0.7064229",
"0.67303157",
"0.66610783",
"0.663927",
"0.64334583",
"0.64309305",
"0.64272475",
"0.6382374",
"0.63475156",
"0.628991",
"0.62442255",
"0.6195381",
"0.6168231",
"0.614821",
"0.61375743",
"0.61200464",
"0.6115424",
"0.6108219",
"0.61064184",
"0.61057794",
"0.6094268",
"0.6094041",
"0.6090525",
"0.6037472",
"0.598037",
"0.59779114",
"0.5964689",
"0.59614027",
"0.5956785",
"0.59519637",
"0.5951151",
"0.59500617",
"0.59464335",
"0.5917705",
"0.59129274",
"0.5898919",
"0.5895631",
"0.58842385",
"0.58766323",
"0.5868155",
"0.586476",
"0.5863734",
"0.5855532",
"0.5852974",
"0.5851533",
"0.5851533",
"0.5851533",
"0.5851533",
"0.5838601",
"0.5825244",
"0.5824963",
"0.5817781",
"0.58135635",
"0.58098644",
"0.5807393",
"0.58005875",
"0.57992107",
"0.57974666",
"0.5797152",
"0.57946044",
"0.57906234",
"0.5787836",
"0.57870334",
"0.5779888",
"0.5776378",
"0.5772325",
"0.5761911",
"0.57559973",
"0.57540315",
"0.5752767",
"0.5751543",
"0.5745689",
"0.5740194",
"0.5739181",
"0.5730894",
"0.57303166",
"0.57222897",
"0.57148474",
"0.57072335",
"0.5705779",
"0.56992495",
"0.56878674",
"0.56857395",
"0.56804603",
"0.56804603",
"0.5678553",
"0.5674995",
"0.5669566",
"0.5659964",
"0.5648165",
"0.56476545",
"0.5646789",
"0.5643478",
"0.5636437",
"0.5632816",
"0.56179065",
"0.5617181",
"0.5617132",
"0.56170404",
"0.5614908"
] | 0.7421615 | 0 |
Get Zalo Token by OA from a refresh token. | public function getZaloTokenFromRefreshTokenByOA($refreshToken)
{
$endpoint = '/oa/access_token';
return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generateAccessToken($token){\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n $tokenval = json_decode($token->value);\n $refresh_token=$tokenval->refresh_token;\n\n $post = [\n 'refresh_token' => $refresh_token,\n 'redirect_uri' => 'http://example.com/callbackurl',\n 'client_id' => $zohoCredentials->client_id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_secret' => $zohoCredentials->client_secret,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'grant_type' => 'refresh_token',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n\n if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200) {\n $tokenval->access_token = json_decode($response)->access_token;\n $token->value=json_encode($tokenval);\n $token->save();\n }\n\n return json_decode($token->value)->access_token;\n }",
"public function getZaloTokenFromRefreshTokenByUser($refreshToken)\n {\n $endpoint = '/access_token';\n return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);\n }",
"public function get_access_token() {\n $access_token = get_transient( 'yith-wcbk-gcal-access-token' );\n if ( !$access_token ) {\n $refresh_token = $this->get_option( 'refresh-token' );\n if ( $refresh_token ) {\n $data = array(\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'refresh_token' => $refresh_token,\n 'grant_type' => 'refresh_token',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token refreshed successfully', compact( 'access_token', 'expires_in', 'body' ) );\n } else {\n $this->error( 'Error while refreshing Access Token: ', $response );\n }\n }\n }\n\n return $access_token;\n }",
"public function getRefreshToken();",
"public function get_access_token($oauth_token, $oauth_addon);",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"public function refreshToken($refreshToken,$userIdentifier){\r\n return $oAuthTokens = $this->oAuthClient->generateAccessTokenFromRefreshToken($refreshToken,$userIdentifier);\r\n }",
"public static function get_oauth_token($auth) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&code=\".$auth.\"&grant_type=authorization_code\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"public function getBearerToken()\n\t{\n\t\t$ch = curl_init($this->oauthURI);\n\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->generateHeader());\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->oauthBody);\n\n\t\t$results = curl_exec($ch);\n\t\t\n\t\t$this->lastCurlInfo = curl_getinfo($ch);\n\n\t\tif($this->lastCurlInfo['http_code'] != 200)\n\t\t\tthrow new OAuthException('Token request failed', \n\t\t\t\t\t\t\t\t\t $this->lastCurlInfo);\n\n\t\t$token = json_decode($results);\n\t\t$this->bearerToken = $token->access_token;\n\n\t\treturn $this->bearerToken;\n\t}",
"public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }",
"public function getBearerToken()\n {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->returnResponse(ATHORIZATION_HEADER_NOT_FOUND, null, 'Access Token Not found');\n }",
"public function getRefreshToken($refreshToken);",
"private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->throwError( ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"function getBearerToken() {\n $headers = getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n}",
"public function generateRefreshToken($code, $client_id, $client_secret) {\n //get crm token credentials\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n\n if(is_null($zohoCredentials)) {\n $this::create([\n 'user_id' => Auth::user()->id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n ]);\n }\n\n\n $token = AccessToken::where('user_id', Auth::user()->id)->first();\n\n $post = [\n 'code' => $code,\n 'redirect_uri' => 'http://example.com/callbackurl',\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n // curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/x-www-form-urlencoded'\n ));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n if(isset(json_decode($response, true)['access_token'])) {\n if(is_null($token)){\n AccessToken::create([\n 'user_id'=>Auth::user()->id,\n 'value'=>$response,\n ]);\n\n return response(['Zoho - Token successfully created'], 200);\n }else{\n $token->value=$response;\n $token->save();\n }\n } else {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'access_token' => [$response],\n ]);\n throw $error;\n }\n }",
"public function fetch_access_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // requires authorized request token\n $token = $this->get_token($request, $consumer, \"request\");\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $verifier = $request->get_parameter('oauth_verifier');\n $new_token = $this->data_store->new_access_token($token, $consumer, $verifier);\n\n return $new_token;\n }",
"public function getBearerToken()\r\n {\r\n $header = $this->getAuthorizationHeader();\r\n // HEADER: Get the access token from header\r\n if(!empty($header))\r\n {\r\n if(preg_match('/Bearer\\s(\\S+)/', $header, $matches))\r\n {\r\n return $matches[1];\r\n }\r\n }\r\n $this->throwError(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not Found.');\r\n }",
"#[\n OpenApi\\Operation(\n tags: ['Auth/Tokens'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: AuthTokenParameters::class)]\n #[OpenApi\\Response(factory: TokenIndexResponse::class, statusCode: 200)]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function index() {\n $this->verifyNoDemo();\n\n return response()->pagination(\n fn($perPage) => AuthTokenResource::collection(\n authUser()\n ->tokens()\n ->active()\n ->type(TokenType::REFRESH)\n ->paginate($perPage)\n )\n );\n }",
"protected function buildZaloTokenFromZaloResponse($response)\n {\n $data = $response->getDecodedBody();\n\n if (!isset($data['access_token'])) {\n throw new ZaloSDKException('Access token was not returned from request.', 401);\n }\n $accessToken = $data['access_token'];\n\n if (!isset($data['refresh_token'])) {\n throw new ZaloSDKException('Refresh token was not returned from request.', 401);\n }\n $refreshToken = $data['refresh_token'];\n\n $accessTokenExpiresIn = 0;\n if (isset($data['expires_in'])) {\n $accessTokenExpiresIn = $data['expires_in'];\n }\n\n return new ZaloToken($accessToken, $refreshToken, $accessTokenExpiresIn);\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n }",
"public static function getBearerToken() {\n $headers = Authorization::extractHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n }",
"public function getBearerToken() {\n\t\t $headers = $this->getAuthorizationHeader();\n\t\t // HEADER: Get the access token from the header\n\t\t if (!empty($headers)) {\n\t\t if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n\t\t return $matches[1];\n\t\t }\n\t\t }\n\t\t return null;\n\t\t}",
"private function getRefreshToken() {\n if (!empty($this->refresh_token)) {\n return $this->refresh_token;\n } else {\n $api_keys=db_asocquery(\"SELECT * FROM cfgesitoken WHERE `tokenID` = '$this->tokenID';\");\n if (count($api_keys) == 1) {\n if (isset($api_keys[0]['token'])) {\n $this->refresh_token = $api_keys[0]['token'];\n return $this->refresh_token;\n }\n }\n }\n\treturn FALSE;\n }",
"public static function refresh_oauth_token($refresh) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&refresh_token=\".$refresh.\"&grant_type=refresh_token\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"public function getAccessTokenFromRefreshToken($refresh_token) {\n\t\n\t\t//array causes Content-Type:multipart/form-data\t\t\n\t\t$post = array(\"grant_type\"=>\"refresh_token\",\"refresh_token\"=>$refresh_token,'vers'=>$this->app_version,'os'=>$this->os_version,'device'=>$this->device_name,'udid'=>$this->device_id);\n\t\t\n\t\t//str causes Content-Type:application/x-www-form-urlencoded (both work for token exchange)\n\t\t//$post = \"grant_type=refresh_token&refresh_token=\".$refresh_token;\n\n\t\t$ci = curl_init();\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_USERPWD, $this->clientID . \":\" . $this->clientSecret);\n\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $post);\n\t\tcurl_setopt($ci, CURLOPT_URL, $this->token_url);\n\t\t$response = curl_exec($ci);\n\t\tcurl_close ($ci);\n\n\t\t$response = json_decode($response,true);\n\t\treturn $response;\n\t}",
"private static function getGFusionOAuthRefreshToken() {\n\t\treturn '1/zuRSQC5Q12yBoJ1idPljEw4xlolOWXrp4hyoKSC1C2o';\n\t}",
"public function getAccessTokenFromRefreshToken($refresh_token): AccessToken;",
"private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials',\n 'app_id' => C( 'SMS_189_KEY' ),\n 'app_secret' => C( 'SMS_189_SECRET' )\n ) ) );\n\n }",
"function getAccessToken($token = NULL) {\n\t\t$r = $this->oAuthRequest ( $this->accessTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function getIdToken()\n {\n $clientId = $this->scopeConfig->getValue('transiteo_activation/general/client_id', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $refreshToken = $this->scopeConfig->getValue('transiteo_activation/general/refresh_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $response = $this->doRequest(\n self::API_AUTH_REQUEST_URI . \"oauth2/token\",\n [\n 'headers' => [\n 'Content-type' => 'application/x-www-form-urlencoded',\n ],\n 'form_params' => [\n 'grant_type' => 'refresh_token',\n 'client_id' => $clientId,\n 'refresh_token' => $refreshToken\n ],\n 'http_errors' => false\n ],\n Request::HTTP_METHOD_POST\n );\n\n $status = $response->getStatusCode(); // 200 status code\n $responseBody = $response->getBody();\n $responseContent = $responseBody->getContents(); // here you will have the API response in JSON format\n\n if ($status == 200) {\n $responseArray = $this->serializer->unserialize($responseContent);\n\n $this->idToken = $responseArray['id_token'];\n //$this->cookie->set(self::COOKIE_NAME, $this->idToken, 3500);\n $this->flagManager->saveFlag(self::ID_TOKEN_FLAG_NAME, $this->idToken);\n $accessToken = $responseArray['access_token'];\n $this->flagManager->saveFlag(self::ACCESS_TOKEN_FLAG_NAME, $accessToken);\n $expires_in = $responseArray['expires_in'];\n $this->flagManager->saveFlag(self::TOKEN_EXPIRES_IN_FLAG_NAME, $expires_in);\n $token_type = $responseArray['token_type'];\n $this->flagManager->saveFlag(self::TOKEN_TYPE_FLAG_NAME, $token_type);\n $date = new \\DateTime();\n $this->flagManager->saveFlag(self::TOKEN_RECEIVED_TIMESTAMP, $date->getTimestamp());\n }\n\n return $responseContent;\n }",
"public function getToken($forceRefresh = false)\n {\n $cacheKey = $this->getCacheKey();\n $cached = $this->getCache()->fetch($cacheKey);\n\n if ($forceRefresh || empty($cached)) {\n $token = $this->getTokenFromServer();\n\n // XXX: T_T... 7200 - 1500\n $this->getCache()->save($cacheKey, $token['authorizer_access_token'], $token['expires_in'] - 1500);\n\n return $token['authorizer_access_token'];\n }\n\n return $cached;\n }",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"protected static function getBearerToken() \n {\n $headers = self::getAuthorizationHeader();\n // HEADER: Get the access token from the header\n \n if ((! empty($headers)) && (! is_null($headers))) {\n // if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n // return $matches[1];\n // }\n return $headers;\n }\n Utils::json_respond(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public function get_refresh_token()\n\t{\n\t\treturn $this->fetch(\n\t\t\t'https://graph.instagram.com/refresh_access_token',\n\t\t\t['grant_type' => 'ig_refresh_token']\n\t\t);\n\t}",
"function getBearerToken() {\n $headers = $this->getHeaders();\n $auth = $headers->get('Authorization', null);\n\n if ($auth !== null) {\n if (preg_match('/Bearer\\s(\\S+)/', $auth, $matches)) {\n return $matches[1];\n }\n }\n\n return null;\n }",
"protected function getBearer(){\n\t\t$a = $this->param->getServer('REDIRECT_HTTP_AUTHORIZATION');\n\t\tif(!$a){\n\t\t\t$a = $this->param->getServer('HTTP_AUTHORIZATION');\n\t\t}\n\n\t\tif($a){\n\t\t\t$authorization = $a;\n\t\t} else {\n\t\t\t$authorization = 'Bearer ' . $this->param->getParam('token');\n\t\t}\n\n\t\tif($authorization){\n\t\t\t$authorization = explode(' ', $authorization);\n\t\t\tif(isset($authorization[1])){\n\t\t\t\t$token = explode('.', $authorization[1]);\n\t\t\t\tif(count($token) == 3){\n\t\t\t\t\treturn $token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function getToken(): object\n {\n $token = (object) [];\n\n if ($this->accessToken && $this->refreshToken && $this->instanceUrl) {\n $token = (object) [\n 'accessToken' => $this->accessToken,\n 'refreshToken' => $this->refreshToken,\n 'instanceUrl' => $this->instanceUrl,\n 'tokenExpiry' => $this->tokenExpiry\n ];\n }\n\n return $token;\n }",
"private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }",
"public function get_access_token($hash) {\n\t\t$tokens = $this->get_access_tokens();\n\t\tforeach ($tokens as $token) {\n\t\t\tif ($token['hash'] == $hash) {\n\t\t\t\treturn Tyk_Token::init($token, $this);\n\t\t\t}\n\t\t}\n\t\t// if we get here, we didn't find the token\n\t\tthrow new OutOfBoundsException('Invalid token id');\n\t}",
"function get_long_lived_access_token( $accesstoken ) {\n\t\n\t\t$extend_url = 'https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id=' . AppInfo::appID() . '&client_secret=' . AppInfo::appSecret() . '&fb_exchange_token=' . $accesstoken;\n\n\t\t$response = file_get_contents( $extend_url ); \n\t\tparse_str( $response, $parsed_resp );\n\n\t\t$new_access_token = $parsed_resp['access_token'];\n\n\t\treturn $new_access_token; \n\t}",
"function curl_getToken($login, $password)\n{\n $url = set_url('auth');\n $postRequest = \"grant_type=password&username={$login}&password={$password}\";\n\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $postRequest);\n curl_setopt($cURLConnection, CURLOPT_USERPWD, otomoto_api());\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n\n $apiResponse = json_decode(curl_exec($cURLConnection));\n\n curl_close($cURLConnection);\n\n $_SESSION['token'] = $apiResponse->access_token;\n}",
"public function get($token)\n {\n $this->db->query('SELECT * FROM oauth_refresh_tokens WHERE refresh_token = \"'.$this->db->real_escape($token).'\"');\n if ($this->db->num_rows() === 1) {\n $this->db->next_record(MYSQL_ASSOC);\n $token = new RefreshTokenEntity($this->server);\n $token->setId($this->db->Record['refresh_token']);\n $token->setExpireTime($this->db->Record['expire_time']);\n $token->setAccessTokenId($this->db->Record['access_token']);\n return $token;\n }\n return null;\n }",
"public function fetch_request_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // no token required for the initial token request\n $token = NULL;\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $callback = $request->get_parameter('oauth_callback');\n $new_token = $this->data_store->new_request_token($consumer, $callback);\n\n return $new_token;\n }",
"function getRdioRefreshToken($clientId, $refreshToken){\n $result = null;\n $error = false;\n $ch = $ch = setUpRdioCurl($clientId, [\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $refreshToken\n ]);\n \n // Run query\n $result = curl_exec($ch);\n \n // Something failed during the request\n if(curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400){\n $error = true;\n }\n curl_close($ch);\n \n if($error) return setErrorHeader($result);\n \n // Return our token data\n return setSuccessHeader($result);\n}",
"public function getAccessToken($access_token);",
"public static function accessToken(){\n $appInfo = WxAppInfo::get(1);\n if($appInfo->is_over_time){\n // 过期重新获取access token\n $appid = $appInfo->appid;\n $appsecret = $appInfo->appsecret;\n $grantType = 'client_credential';\n $url = 'https://api.weixin.qq.com/cgi-bin/token?appid=' . $appid . '&secret=' . $appsecret . '&grant_type=' . $grantType;\n $api = curl_init();\n curl_setopt($api, CURLOPT_URL, $url);\n curl_setopt($api, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($api, CURLOPT_HEADER, false);\n $tokenObj = curl_exec($api);\n curl_close($api);\n $tokenObj = json_decode($tokenObj);\n $appInfo->access_token = $tokenObj->access_token;\n $appInfo->expires_in = $tokenObj->expires_in;\n $appInfo->isUpdate(true)->save();\n $token = $tokenObj->access_token;\n }else{\n // 未过期\n $token = $appInfo->access_token;\n }\n\n return $token;\n }",
"private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }",
"public function get_access_token()\n\t\t{\n\t\t\tif(isset($_COOKIE['bing_access_token']))\n\t\t\t\treturn $_COOKIE['bing_access_token'];\n\t\t\n\t\t\t// Get a 10-minute access token for Microsoft Translator API.\n\t\t\t$url = 'https://datamarket.accesscontrol.windows.net/v2/OAuth2-13';\n\t\t\t$postParams = 'grant_type=client_credentials&client_id='.urlencode($this->clientID).\n\t\t\t'&client_secret='.urlencode($this->clientSecret).'&scope=http://api.microsofttranslator.com';\n\t\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url); \n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\t\t$rsp = curl_exec($ch); \n\t\t\t$rsp = json_decode($rsp);\n\t\t\t$access_token = $rsp->access_token;\n\t\t\t\n\t\t\tsetcookie('bing_access_token', $access_token, $rsp->expires_in);\n\t\t\t\n\t\t\treturn $access_token;\n\t\t}",
"public function getZaloTokenFromCodeByOA($code, $codeVerifier)\n {\n $endpoint = '/oa/access_token';\n return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);\n }",
"private function refreshToken()\n {\n syslog(LOG_DEBUG, \"Monzo: Refreshing Token\");\n $data = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'refresh_token' => $this->refreshToken\n );\n $jsonResponse = $this->getJson('/oauth2/token', $data, false);\n if (isset($jsonResponse['access_token']) && isset($jsonResponse['refresh_token']))\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validating\");\n $this->refreshToken = $jsonResponse['refresh_token'];\n $this->bearerToken = $jsonResponse['access_token'];\n if ($this->validateTokens())\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validated and stored\");\n $this->storeTokens($this->bearerToken, $this->refreshToken);\n return true;\n }else {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, but failed to validate\");\n return false;\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Not able to refresh token\");\n throw new Exception('Monzo Not able to refresh token');\n return false;\n }\n }",
"public function getOAuthToken()\n {\n return $this->oauthToken->getToken();\n }",
"public function getToken()\n {\n $authHeader = $this->getHeader('AUTHORIZATION');\n $authQuery = $this->getQuery('token');\n\n return $authQuery ? $authQuery : $this->parseBearerValue($authHeader);\n }",
"private function __get_access_token() {\r\n // Access token exists in a cookie\r\n if($_COOKIE[ACCESS_TOKEN_COOKIE_NAME]) {\r\n parse_str($_COOKIE[ACCESS_TOKEN_COOKIE_NAME], $tok); \r\n return $tok;\r\n }\r\n\r\n // Handling a redirect back from login\r\n else if($_COOKIE[REQUEST_TOKEN_COOKIE_NAME] && $_REQUEST['oauth_verifier'] && $_REQUEST['oauth_token']) {\r\n $tok = YMClient::oauth_token_from_query_string($_COOKIE[REQUEST_TOKEN_COOKIE_NAME]);\r\n\r\n if($tok['oauth_token'] != $_REQUEST['oauth_token']) {\r\n throw new Exception(\"Cookie and URL disagree about request token value\");\r\n }\r\n\r\n $tok['oauth_verifier'] = $_REQUEST['oauth_verifier']; \r\n $newtok = $this->ymc->oauth_get_access_token($tok);\r\n\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, \"\", time()-3600);\r\n setcookie(ACCESS_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($newtok));\r\n return $newtok;\r\n }\r\n\r\n // Sending the user to login to grant access to this app\r\n else {\r\n list ($tok, $url) = $this->ymc->oauth_get_request_token($this->callbackURL);\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($tok));\r\n header(\"Location: $url\");\r\n }\r\n }",
"protected function getAccessToken($oauth_token) {\n\n\t}",
"public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }",
"private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}",
"public function refreshAccessToken () {\n\n if ( $this->refresh_token ) {\n \t\n $body = array (\n\t\t\t \"grant_type\" \t=> \"refresh_token\", \n\t\t\t \"client_id\" \t=> $this->client_id, \n\t\t\t \"client_secret\" => $this->client_secret, \n\t\t\t \"refresh_token\" => $this->refresh_token\n );\n\n $opts = array (\n\t\t\t CURLOPT_POST \t\t=> true, \n\t\t\t CURLOPT_POSTFIELDS \t=> $body\n );\n \n $request = $this->execute ( self::$OAUTH_URL, $opts );\n\n if ( $request[\"httpCode\"] == 200 ) {\n \t \n $this->access_token = $request[\"body\"]->access_token;\n\n if ( $request[\"body\"]->refresh_token ) {\n \n \t$this->refresh_token = $request[\"body\"]->refresh_token;\n }\n \n return $request;\n\n } else {\n \t\n return $request;\n } \n \n } else {\n \t\n $result = array (\n\t\t\t \t'error' \t=> 'Offline-Access is not allowed.',\n\t\t\t \t'httpCode' => null\n );\n \n return $result;\n } \n }",
"public function getAccessToken() {\n if (is_null($this->tokenID) || empty($this->tokenID)) return FALSE;\n if (!empty($this->access_token) && ($this->access_token_expire > time())) {\n return $this->access_token;\n } else {\n //first, obtain auth token using saved refresh_token\n $token = get_access_token($this->getRefreshToken());\n //check if we've got a valid Bearer token\n if ($this->DEBUG) var_dump($token);\n if (!(isset($token->access_token) && isset($token->token_type) && isset($token->expires_in) && $token->token_type=='Bearer' && $token->expires_in>0)) {\n //problem with token, bail!\n warning(\"ESI\",\"EVE SSO: Invalid Bearer token received from SSO login site.\");\n return FALSE;\n }\n //we've got a valid token\n $this->access_token = $token->access_token;\n $this->access_token_expire = time() + $token->expires_in;\n //let's fetch the characterID\n $verify=verify_token($token);\n //check if required fileds are set\n if (!(isset($verify->CharacterID) && isset($verify->CharacterName) && isset($verify->TokenType))) {\n //problem with verify, bail!\n warning(\"ESI\",\"EVE SSO: Invalid Verify response received from SSO login site.\");\n return FALSE;\n }\n if ($this->DEBUG) var_dump($verify);\n //we have characterID\n $this->characterID = $verify->CharacterID;\n }\n return $this->access_token;\n }",
"public function testGetAccessTokenByRefreshToken() {\n $tokenResponse = Json::decode($this->getMockResponseContents(self::ACCESS_TOKEN_RESPONSE));\n $refreshToken = 'tGzv3JOkF0XG5Qx2TlKW';\n\n $eloquaApiClient = $this->getMockBuilder('Drupal\\eloqua_api_redux\\Service\\EloquaApiClient')\n ->setConstructorArgs([\n $this->configFactory,\n $this->loggerFactory,\n $this->cacheBackend,\n $this->httpClientFactory,\n ])\n ->setMethods(['getEloquaApiCache', 'doTokenRequest'])\n ->getMock();\n\n $eloquaApiClient->expects($this->at(0))\n ->method('getEloquaApiCache')\n ->with('access_token')\n ->will($this->returnValue(NULL));\n\n $eloquaApiClient->expects($this->at(1))\n ->method('getEloquaApiCache')\n ->with('refresh_token')\n ->will($this->returnValue($refreshToken));\n\n $eloquaApiClient->expects($this->any())\n ->method('doTokenRequest')\n ->will($this->returnValue($tokenResponse));\n\n $response = $eloquaApiClient->getAccessTokenByRefreshToken();\n $this->assertNotNull($response);\n }",
"public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}",
"function getAccessTokenByRefreshToken($refresh_token, $scope)\n\t{\n\t\t$data = array(\n\t\t\t\t'grant_type' => \"refresh_token\",\n\t\t\t\t'refresh_token' => $refresh_token,\n\t\t\t\t'client_id' => $this->_clientId,\n\t\t\t\t'client_secret' => $this->_clientSecret,\n\t\t\t\t'scope' => $scope,\n\t\t);\n\t\t$request = $this->call('get', $this->_accessTokenURL, $data);\n\t\treturn $request;\n\t}",
"public function getRefreshToken(): ?string;",
"public function getAccessToken()\n {\n // maybe the token will expire in next 10 seconds\n $expiryCutoff = new \\DateTime('+10 seconds');\n\n // if the token expires try to reauthenticate\n if (!$this->accessToken or $this->getExpires() < $expiryCutoff->getTimestamp()) {\n $this->authenticate();\n }\n\n return $this->accessToken->getToken();\n }",
"public function getNewRefreshToken() {\n return new RefreshToken();\n }",
"public function get($token)\n {\n foreach ($this->getDbConnection()->fetchAll(\n 'SELECT * FROM oauth_refresh_token\n WHERE refresh_token = :token', [\n 'token' => $token\n ]\n ) as $row) {\n if ($row) {\n return (new RefreshTokenEntity($this->server))\n ->setAccessTokenId($row['access_token'])\n ->setExpireTime($row['expire_time'])\n ->setId($row['refresh_token']);\n }\n }\n return null;\n }",
"abstract public function url_access_token();",
"public function refreshAccessToken(): AccessToken;",
"public function getAuthorizationCode()\n {\n $oauth_param = array(\n 'grant_type' => $this->grant_type, \n 'client_id' => config::$clientId,\n 'client_secret' => config::$secretKey,\n 'scope' => implode(',', $this->scope));\n\n $url = config::$apiUrl . 'oauth/access_token';\n $response = $this->curl->request('post', $url, $oauth_param);\n\n if( $response )\n {\n $res = json_decode($response);\n if( isset($res->access_token) )\n {\n $this->setExpiresAtFromTimeStamp($res->expires);\n $this->session->write('access_token',$res->access_token);\n $this->session->write('expires', $this->expiresAt);\n\n $read = $this->session->read('access_token');\n session_write_close();\n }\n elseif( isset($res->error) )\n {\n die($response);\n }\n }\n }",
"public static function getRealToken(Oauth_TokenModel $token)\n {\n $provider = craft()->oauth->getProvider($token->providerHandle);\n\n if($provider)\n {\n switch($provider->getOauthVersion())\n {\n case 1:\n $realToken = new \\League\\OAuth1\\Client\\Credentials\\TokenCredentials();\n $realToken->setIdentifier($token->accessToken);\n $realToken->setSecret($token->secret);\n break;\n\n\n case 2:\n $realToken = new \\League\\OAuth2\\Client\\Token\\AccessToken([\n 'access_token' => $token->accessToken,\n 'refresh_token' => $token->refreshToken,\n 'secret' => $token->secret,\n 'expires' => $token->endOfLife,\n ]);\n\n break;\n }\n\n return $realToken;\n }\n }",
"public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }",
"private function crearToken(){\n \n $headers = Yii::$app->request->headers;\n\n if (preg_match('/^Bearer\\s+(.*?)$/', $headers['authorization'], $matches)) {\n $token = $matches[1];\n } else {\n throw new \\yii\\web\\HttpException(500, 'Token invalido');\n }\n \n return $token;\n }",
"public function getOAuthToken(Request $request)\n {\n $bridgedRequest = \\OAuth2\\HttpFoundationBridge\\Request::createFromRequest($request->instance());\n\n $bridgedResponse = new \\OAuth2\\HttpFoundationBridge\\Response();\n\n /*Log::info('$bridgedRequest'. print_r($bridgedRequest, true));\n Log::info('$bridgedResponse'. print_r($bridgedResponse, true));*/\n\n\n $bridgedResponse = \\App::make('oauth2')->handleTokenRequest($bridgedRequest, $bridgedResponse);\n\n return $bridgedResponse;\n }",
"public function get($token)\n {\n $result = $this->getConnection()->table('oauth_access_tokens')\n ->where('oauth_access_tokens.access_token', $token)\n ->first();\n\n if (is_null($result)) {\n return;\n }\n\n return (new AccessTokenEntity($this->getServer()))\n ->setId($result->access_token)\n ->setExpireTime(time()+3600);\n //->setExpireTime((int) $result->expire_time);\n }",
"private function tokenInit()\n {\n $tempSession = uniqid();\n echo \"************************************************* MONZO AUTHENTICATION WORKFLOW ***********************************************************\\n\";\n echo \"Please visit the following URL in your browser and follow instructions \\n\";\n echo \"###########\\n\";\n echo \"\\n\";\n echo \"https://auth.monzo.com/?client_id=$this->clientId&redirect_uri=$this->redirectUri&response_type=code&state=$tempSession \\n\";\n echo \"\\n\";\n echo \"###########\\n\";\n echo \"When you get email from Monzo, copy the link button (Right click -> Copy link Location) from the email and paste here. Do not click it. \\n\";\n echo \"*********************************************************************************************************************************************\\n\";\n $verificationUrl = readline(\"Email link: \");\n parse_str(parse_url($verificationUrl, PHP_URL_QUERY) , $urlParams);\n if (array_key_exists('code', $urlParams) && array_key_exists('state', $urlParams))\n {\n if ($urlParams['state'] === $tempSession)\n {\n $data = array(\n 'grant_type' => 'authorization_code',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'redirect_uri' => $this->redirectUri,\n 'code' => $urlParams['code']\n );\n $tokenData = $this->getJson('/oauth2/token', $data, false);\n if (isset($tokenData['access_token']) && isset($tokenData['refresh_token']))\n {\n $this->bearerToken = $tokenData['access_token'];\n $this->refreshToken = $tokenData['refresh_token'];\n if ($this->validateTokens())\n {\n $this->storeTokens($tokenData['access_token'], $tokenData['refresh_token']);\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Newly created tokens not valid\");\n throw new Exception('Monzo: Newly created Tokens not valid');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Tokens not found\");\n throw new Exception('Monzo: Tokens not found');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: State does not match the one that was sent to Monzo.\");\n throw new Exception('Monzo: State does not match the one that was sent to Monzo.');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Code and State ids not found in the email URL\");\n throw new Exception('Monzo: Code and State ids not found in the email URL');\n }\n }",
"public function get_access_token() {\r\n\t\t$session = $_SESSION['auth_baidu']['last_key'];;\r\n\t\tif (isset ( $session ['access_token'] )) {\r\n\t\t\treturn $session ['access_token'];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t} \n\t\t$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);\n\t\t$token = OAuthUtil::parse_parameters($request);\n\t\t$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}",
"public function refreshToken()\n {\n return $this->token['refresh_token'] ?? null;\n }",
"public function get_token( $type = 'access_token' ){\n\t\t$token = NULL;\n\t\tif( $this->token_storage == 'file' ){\n\t\t\tif( is_file($this->token_files[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( file_get_contents($this->token_files[$type]) );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// add method to get token from cookie\n\t\t\tif( !empty($_COOKIE[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( $_COOKIE[$type] );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}",
"public static function getBearer()\n {\n $token = explode(\" \", $_SERVER['HTTP_AUTHORIZATION']);\n if(isset($token[1])){\n return $token[1];\n }\n throw new GlobalException(\"Authorization bearer token not found in HTTP_AUTHORIZATION header\");\n }",
"public function generateToken($liveApi = false){\n\n $tokenLiveUrl = $this->safaricomLiveUrl.'/oauth/v1/generate?grant_type=client_credentials';\n $tokenSandboxUrl = $this->safaricomSandboxUrl.'/oauth/v1/generate?grant_type=client_credentials';\n\n $tokenUrl = $liveApi ? $tokenLiveUrl : $tokenSandboxUrl;\n try{\n $credentials = base64_encode($this->consumerKey.':'.$this->consumerSecret);\n\n $client = new Client();\n $response = $client->get($tokenUrl,\n [\n 'headers' => [\n 'Authorization' => 'Basic ' . $credentials,\n ],\n ]);\n\n $response = (string) $response->getBody();\n $json = json_decode($response);\n $access_token = $json->access_token;\n\n return $access_token;\n }catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }",
"public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }",
"public function getNewRefreshToken()\n {\n return new RefreshTokenEntity;\n }",
"public function getZaloTokenFromRefreshToken($refreshToken, $endpoint)\n {\n $params = [\n 'refresh_token' => $refreshToken,\n 'app_id' => $this->app->getId(),\n 'grant_type' => 'refresh_token'\n ];\n\n $response = $this->sendRequest($endpoint, $params);\n return $this->buildZaloTokenFromZaloResponse($response);\n }",
"public function getTokenFromServer()\n {\n $params = [\n 'component_appid' => $this->component_token->getAppId(),\n 'authorizer_appid' => $this->appId,\n 'authorizer_refresh_token' => $this->refresh_token,\n ];\n\n $http = $this->getHttp();\n $url = sprintf(self::API_AUTHORIZER_TOKEN, $this->component_token->getToken());\n $token = $http->parseJSON($http->json($url, $params));\n\n if (empty($token['authorizer_access_token'])) {\n throw new HttpException('Request AccessToken fail. response: '.json_encode($token, JSON_UNESCAPED_UNICODE));\n }\n\n return $token;\n }",
"protected function get_access_token()\n\t{\n $result = array();\n\n try\n {\n $oauth_verifier = \\Session::get('evernote_oauthVerifier');\n\n $oauth = new \\OAuth( $this->tokens['consumer_key'], $this->tokens['consumer_secret'] );\n\n $request_token = $this->get_request_token();\n $request_token_secret = $this->get_request_secret();\n\n $oauth->setToken($request_token, $request_token_secret);\n $access_token_info = $oauth->getAccessToken($this->access_token_url, null, $oauth_verifier);\n\n echo '$access_token_info<pre>'.print_r($access_token_info, 1).'</pre>';\n\n if ( $access_token_info ){\n $this->set_access_key( $access_token_info['oauth_token'] );\n $this->set_access_secret( $access_token_info['oauth_token_secret'] );\n\n $this->tokens['oauth_token'] = $access_token_info['oauth_token'];\n $this->tokens['oauth_token_secret'] = $access_token_info['oauth_token_secret'];\n $this->tokens['shard_id'] = $access_token_info['edam_shard'];\n $this->tokens['evernote_user_id'] = $access_token_info['edam_userId'];\n $this->tokens['expires'] = $access_token_info['edam_expires'];\n\n return $this->tokens;\n }\n return false;\n }catch ( \\Exception $e ){\n return false;\n }\n\n\t}",
"public function getAccessTokenType(){\n $this->tokenType = variable_get(EBConsts::EBS_CONFIG_AUTHTOKEN_TYPE, 'bearer');\n return $this;\n }",
"public function getNewRefreshToken()\n {\n // TODO: Implement getNewRefreshToken() method.\n }",
"public function getAuthBean(OAuthToken $token);",
"public function refreshToken()\n {\n return $this->hasOne('Deploy\\Models\\DeployRefreshToken', 'deploy_access_token_id')->first();\n }",
"public function refreshAccessTokenIfNecessary()\n {\n $user = auth()->user();\n // dd(json_decode($user->xero_access_token,true));\n $accessToken = new AccessToken(json_decode($user->xero_access_token,true));\n\n if ($accessToken->hasExpired()) {\n $accessToken = $this->getOAuth2()->refreshAccessToken($accessToken);\n\n $user->xero_access_token = json_encode($accessToken);\n dd(json_encode($accessToken));\n $user->save();\n $successMessage=\"New Access Token generated\";\n return $this->successResponse($user, $successMessage, 200);\n }\n $successMessage=\"Token Didn't expired\";\n return $this->successResponse($user, $successMessage, 200);\n }",
"public static function acquire_token() {\n\n\t\t\n\n\t\t$response = skydrive_tokenstore::get_tokens_from_store();\n\n\t\tif (empty($response['access_token'])) {\t// No token at all, needs to go through login flow. Return false to indicate this.\n\n\t\t\treturn false;\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\tif (time() > (int)$response['access_token_expires']) { // Token needs refreshing. Refresh it and then return the new one.\n\n\t\t\t\t$refreshed = skydrive_auth::refresh_oauth_token($response['refresh_token']);\n\n\t\t\t\tif (skydrive_tokenstore::save_tokens_to_store($refreshed)) {\n\n\t\t\t\t\t$newtokens = skydrive_tokenstore::get_tokens_from_store();\n\n\t\t\t\t\treturn $newtokens['access_token'];\n\n\t\t\t\t}\n\n\t\t\t\texit;\n\n\t\t\t} else {\n\n\t\t\t\treturn $response['access_token']; // Token currently valid. Return it.\n\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"public function hastoken()\n\t{\n\t return $this->tokauth;\n\t}",
"public function getRefreshToken() {\n\t\treturn $this->refresh_token;\n\t}",
"public static function getFastlinkToken()\n\t\t{\n\t\t\t$url = \"https://developer.api.yodlee.com/ysl/restserver/v1/user/accessTokens?appIds=10003600\";\n\n\t\t\t$curl = curl_init();\n\n\t\t\tcurl_setopt_array($curl, array(\n\t\t\t CURLOPT_SSL_VERIFYPEER => false,\n\t\t\t CURLOPT_URL => $url,\n\t\t\t CURLOPT_RETURNTRANSFER => 1,\n\t\t\t CURLOPT_TIMEOUT => 360,\n\t\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Authorization: {cobSession='.self::$cobSession.',userSession='.self::$userSession.'}'\n\t\t\t )\n\t\t\t));\n\n\t\t\t$response = json_decode(curl_exec($curl), TRUE);\n\n\t\t\tif ($response) {\n\t\t\t\tself::$fastlinkAppId = $response['user']['accessTokens'][0]['appId'];\n\t\t\t\tself::$fastlinkUrl = $response['user']['accessTokens'][0]['url'];\n\t\t\t\tself::$fastlinkValue = $response['user']['accessTokens'][0]['value'];\n\t\t\t}\n\t\t}",
"protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}",
"public function getRefreshToken()\n {\n return $this->get('RefreshToken');\n }",
"public function getNewRefreshToken() {\n return new RefreshTokenEntity();\n }",
"static function BearerToken()\n {\n return trim(str_replace('Bearer', '', self::GetHeader()));\n }",
"public function bearerToken($request)\n {\n $header = $request->header('Authorization', '');\n if($header){\n if (Str::startsWith($header, 'Bearer ')) {\n $token = Str::substr($header, 7);\n \n // Verify the token with the user.\n $check = User::where('api_token', $token)->first();\n if($check){\n return ['msg' => 'User is authorized.', 'status'=>100];\n }else{\n return ['msg' => 'Unauthorized user.', 'status'=>101];\n }\n }\n } else{\n return ['msg' => 'Authentication token is missing.', 'status'=>101];\n }\n }"
] | [
"0.6578652",
"0.6435746",
"0.6199668",
"0.61013776",
"0.5993337",
"0.5982597",
"0.5947403",
"0.5947034",
"0.5908615",
"0.5903045",
"0.5868388",
"0.58446217",
"0.5836059",
"0.58323646",
"0.58042264",
"0.58040535",
"0.5799324",
"0.5785068",
"0.5777068",
"0.5756752",
"0.5737968",
"0.5729177",
"0.5724059",
"0.5714261",
"0.5713842",
"0.571062",
"0.56876075",
"0.5661125",
"0.5651446",
"0.56505543",
"0.5649133",
"0.56299716",
"0.5628582",
"0.5622938",
"0.5618003",
"0.56179684",
"0.54735607",
"0.5464167",
"0.5463518",
"0.5455446",
"0.5447893",
"0.54462177",
"0.5419533",
"0.5418123",
"0.53989357",
"0.5378561",
"0.5338057",
"0.5327013",
"0.53229946",
"0.53223854",
"0.5316484",
"0.5312063",
"0.5310403",
"0.53099394",
"0.5308427",
"0.53060895",
"0.5297184",
"0.5296244",
"0.52946395",
"0.52945155",
"0.5277446",
"0.527009",
"0.52694774",
"0.5268446",
"0.5264398",
"0.5263482",
"0.5248163",
"0.5243743",
"0.52331114",
"0.523014",
"0.5224638",
"0.522071",
"0.52202785",
"0.5220099",
"0.5215945",
"0.5213546",
"0.5210224",
"0.5206367",
"0.51996547",
"0.51912385",
"0.51908106",
"0.5189374",
"0.51881653",
"0.5182649",
"0.51747096",
"0.51731753",
"0.51704615",
"0.5168952",
"0.5165014",
"0.5162257",
"0.5152684",
"0.5146635",
"0.5143522",
"0.5124326",
"0.5121803",
"0.5121205",
"0.51188016",
"0.5109689",
"0.5109502",
"0.5103355"
] | 0.78807735 | 0 |
Get a ZaloToken from a refresh token. | public function getZaloTokenFromRefreshToken($refreshToken, $endpoint)
{
$params = [
'refresh_token' => $refreshToken,
'app_id' => $this->app->getId(),
'grant_type' => 'refresh_token'
];
$response = $this->sendRequest($endpoint, $params);
return $this->buildZaloTokenFromZaloResponse($response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRefreshToken();",
"public function getRefreshToken($refreshToken);",
"public function getZaloTokenFromRefreshTokenByUser($refreshToken)\n {\n $endpoint = '/access_token';\n return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);\n }",
"public function getZaloTokenFromRefreshTokenByOA($refreshToken)\n {\n $endpoint = '/oa/access_token';\n return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);\n }",
"public function getNewRefreshToken() {\n return new RefreshToken();\n }",
"public function refreshToken()\n {\n return $this->token['refresh_token'] ?? null;\n }",
"public function getRefreshToken()\n {\n return $this->get('RefreshToken');\n }",
"public function getNewRefreshToken()\n {\n return new RefreshTokenEntity;\n }",
"public function getNewRefreshToken() {\n return new RefreshTokenEntity();\n }",
"public function getRefreshToken()\n {\n if (! $this->refreshToken) {\n $this->exchange();\n }\n\n return $this->refreshToken;\n }",
"public function getRefreshToken() {\n\t\treturn $this->refresh_token;\n\t}",
"public function refreshToken()\n {\n return $this->refreshToken;\n }",
"public function getAccessTokenFromRefreshToken($refresh_token): AccessToken;",
"public function get($token)\n {\n $this->db->query('SELECT * FROM oauth_refresh_tokens WHERE refresh_token = \"'.$this->db->real_escape($token).'\"');\n if ($this->db->num_rows() === 1) {\n $this->db->next_record(MYSQL_ASSOC);\n $token = new RefreshTokenEntity($this->server);\n $token->setId($this->db->Record['refresh_token']);\n $token->setExpireTime($this->db->Record['expire_time']);\n $token->setAccessTokenId($this->db->Record['access_token']);\n return $token;\n }\n return null;\n }",
"public function getRefreshToken()\n {\n return $this->refreshToken;\n }",
"public function getRefreshToken(): ?string;",
"private function getRefreshToken() {\n if (!empty($this->refresh_token)) {\n return $this->refresh_token;\n } else {\n $api_keys=db_asocquery(\"SELECT * FROM cfgesitoken WHERE `tokenID` = '$this->tokenID';\");\n if (count($api_keys) == 1) {\n if (isset($api_keys[0]['token'])) {\n $this->refresh_token = $api_keys[0]['token'];\n return $this->refresh_token;\n }\n }\n }\n\treturn FALSE;\n }",
"public function get($token)\n {\n foreach ($this->getDbConnection()->fetchAll(\n 'SELECT * FROM oauth_refresh_token\n WHERE refresh_token = :token', [\n 'token' => $token\n ]\n ) as $row) {\n if ($row) {\n return (new RefreshTokenEntity($this->server))\n ->setAccessTokenId($row['access_token'])\n ->setExpireTime($row['expire_time'])\n ->setId($row['refresh_token']);\n }\n }\n return null;\n }",
"public function get_refresh_token()\n\t{\n\t\treturn $this->fetch(\n\t\t\t'https://graph.instagram.com/refresh_access_token',\n\t\t\t['grant_type' => 'ig_refresh_token']\n\t\t);\n\t}",
"public function get_access_token() {\n $access_token = get_transient( 'yith-wcbk-gcal-access-token' );\n if ( !$access_token ) {\n $refresh_token = $this->get_option( 'refresh-token' );\n if ( $refresh_token ) {\n $data = array(\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'refresh_token' => $refresh_token,\n 'grant_type' => 'refresh_token',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token refreshed successfully', compact( 'access_token', 'expires_in', 'body' ) );\n } else {\n $this->error( 'Error while refreshing Access Token: ', $response );\n }\n }\n }\n\n return $access_token;\n }",
"public function getNewRefreshToken()\n {\n // TODO: Implement getNewRefreshToken() method.\n }",
"public function get_refresh_token() {\n return $this->refreshtoken;\n }",
"protected function buildZaloTokenFromZaloResponse($response)\n {\n $data = $response->getDecodedBody();\n\n if (!isset($data['access_token'])) {\n throw new ZaloSDKException('Access token was not returned from request.', 401);\n }\n $accessToken = $data['access_token'];\n\n if (!isset($data['refresh_token'])) {\n throw new ZaloSDKException('Refresh token was not returned from request.', 401);\n }\n $refreshToken = $data['refresh_token'];\n\n $accessTokenExpiresIn = 0;\n if (isset($data['expires_in'])) {\n $accessTokenExpiresIn = $data['expires_in'];\n }\n\n return new ZaloToken($accessToken, $refreshToken, $accessTokenExpiresIn);\n }",
"public function retrieveRefreshTokenById($tokenId)\n {\n return $this->start()->uri(\"/api/jwt/refresh\")\n ->urlSegment($tokenId)\n ->get()\n ->go();\n }",
"public function getIdToken()\n {\n $clientId = $this->scopeConfig->getValue('transiteo_activation/general/client_id', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $refreshToken = $this->scopeConfig->getValue('transiteo_activation/general/refresh_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $response = $this->doRequest(\n self::API_AUTH_REQUEST_URI . \"oauth2/token\",\n [\n 'headers' => [\n 'Content-type' => 'application/x-www-form-urlencoded',\n ],\n 'form_params' => [\n 'grant_type' => 'refresh_token',\n 'client_id' => $clientId,\n 'refresh_token' => $refreshToken\n ],\n 'http_errors' => false\n ],\n Request::HTTP_METHOD_POST\n );\n\n $status = $response->getStatusCode(); // 200 status code\n $responseBody = $response->getBody();\n $responseContent = $responseBody->getContents(); // here you will have the API response in JSON format\n\n if ($status == 200) {\n $responseArray = $this->serializer->unserialize($responseContent);\n\n $this->idToken = $responseArray['id_token'];\n //$this->cookie->set(self::COOKIE_NAME, $this->idToken, 3500);\n $this->flagManager->saveFlag(self::ID_TOKEN_FLAG_NAME, $this->idToken);\n $accessToken = $responseArray['access_token'];\n $this->flagManager->saveFlag(self::ACCESS_TOKEN_FLAG_NAME, $accessToken);\n $expires_in = $responseArray['expires_in'];\n $this->flagManager->saveFlag(self::TOKEN_EXPIRES_IN_FLAG_NAME, $expires_in);\n $token_type = $responseArray['token_type'];\n $this->flagManager->saveFlag(self::TOKEN_TYPE_FLAG_NAME, $token_type);\n $date = new \\DateTime();\n $this->flagManager->saveFlag(self::TOKEN_RECEIVED_TIMESTAMP, $date->getTimestamp());\n }\n\n return $responseContent;\n }",
"public function getAccessTokenFromRefreshToken($refresh_token) {\n\t\n\t\t//array causes Content-Type:multipart/form-data\t\t\n\t\t$post = array(\"grant_type\"=>\"refresh_token\",\"refresh_token\"=>$refresh_token,'vers'=>$this->app_version,'os'=>$this->os_version,'device'=>$this->device_name,'udid'=>$this->device_id);\n\t\t\n\t\t//str causes Content-Type:application/x-www-form-urlencoded (both work for token exchange)\n\t\t//$post = \"grant_type=refresh_token&refresh_token=\".$refresh_token;\n\n\t\t$ci = curl_init();\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_USERPWD, $this->clientID . \":\" . $this->clientSecret);\n\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $post);\n\t\tcurl_setopt($ci, CURLOPT_URL, $this->token_url);\n\t\t$response = curl_exec($ci);\n\t\tcurl_close ($ci);\n\n\t\t$response = json_decode($response,true);\n\t\treturn $response;\n\t}",
"public function refreshToken()\n {\n return $this->hasOne('Deploy\\Models\\DeployRefreshToken', 'deploy_access_token_id')->first();\n }",
"public function getRefreshToken(): string\n {\n return $this->refreshToken;\n }",
"private function refreshToken()\n {\n syslog(LOG_DEBUG, \"Monzo: Refreshing Token\");\n $data = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'refresh_token' => $this->refreshToken\n );\n $jsonResponse = $this->getJson('/oauth2/token', $data, false);\n if (isset($jsonResponse['access_token']) && isset($jsonResponse['refresh_token']))\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validating\");\n $this->refreshToken = $jsonResponse['refresh_token'];\n $this->bearerToken = $jsonResponse['access_token'];\n if ($this->validateTokens())\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validated and stored\");\n $this->storeTokens($this->bearerToken, $this->refreshToken);\n return true;\n }else {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, but failed to validate\");\n return false;\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Not able to refresh token\");\n throw new Exception('Monzo Not able to refresh token');\n return false;\n }\n }",
"public static function retrieve(bool $refresh = false): string\n\t{\n\t\tif ($refresh)\n\t\t{\n\t\t\tself::$token = '';\n\t\t}\n\n\t\tif (empty(self::$token))\n\t\t{\n\t\t\tthrow new TokensException('Token not in memory.');\n\t\t}\n\n\t\treturn self::$token;\n\t}",
"public function getToken(): object\n {\n $token = (object) [];\n\n if ($this->accessToken && $this->refreshToken && $this->instanceUrl) {\n $token = (object) [\n 'accessToken' => $this->accessToken,\n 'refreshToken' => $this->refreshToken,\n 'instanceUrl' => $this->instanceUrl,\n 'tokenExpiry' => $this->tokenExpiry\n ];\n }\n\n return $token;\n }",
"public function generateAccessToken($token){\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n $tokenval = json_decode($token->value);\n $refresh_token=$tokenval->refresh_token;\n\n $post = [\n 'refresh_token' => $refresh_token,\n 'redirect_uri' => 'http://example.com/callbackurl',\n 'client_id' => $zohoCredentials->client_id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_secret' => $zohoCredentials->client_secret,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'grant_type' => 'refresh_token',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n\n if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200) {\n $tokenval->access_token = json_decode($response)->access_token;\n $token->value=json_encode($tokenval);\n $token->save();\n }\n\n return json_decode($token->value)->access_token;\n }",
"public function refreshToken(Token $token)\n {\n return api(['data' => $token->generateDataForKey(current_app_key())]);\n }",
"private static function getGFusionOAuthRefreshToken() {\n\t\treturn '1/zuRSQC5Q12yBoJ1idPljEw4xlolOWXrp4hyoKSC1C2o';\n\t}",
"public function getToken($forceRefresh = false)\n {\n $cacheKey = $this->getCacheKey();\n $cached = $this->getCache()->fetch($cacheKey);\n\n if ($forceRefresh || empty($cached)) {\n $token = $this->getTokenFromServer();\n\n // XXX: T_T... 7200 - 1500\n $this->getCache()->save($cacheKey, $token['authorizer_access_token'], $token['expires_in'] - 1500);\n\n return $token['authorizer_access_token'];\n }\n\n return $cached;\n }",
"public function refreshToken($refreshToken,$userIdentifier){\r\n return $oAuthTokens = $this->oAuthClient->generateAccessTokenFromRefreshToken($refreshToken,$userIdentifier);\r\n }",
"public function getLwaRefreshToken(): ?string\n {\n return $this->auth->getLwaRefreshToken();\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->throwError( ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public function refreshToken() {\n $token = $this->controller->refreshToken();\n\n return $this->response(compact('token'));\n }",
"function getSpotifyRefreshToken($clientId, $refreshToken){\n\t$result = null;\n\t$error = false;\n\t$ch = $ch = setUpSpotifyCurl($clientId, [\n\t\t\t'grant_type' => 'refresh_token',\n\t\t\t'refresh_token' => $refreshToken\n\t]);\n\t\n\t// Run query\n\t$result = curl_exec($ch);\n\t\n\t// Something failed during the request\n\tif(curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400){\n\t\t$error = true;\n\t}\n\tcurl_close($ch);\n\t\n\tif($error) return setErrorHeader($result);\n\t\n\t// Return our token data\n\treturn setSuccessHeader($result);\n}",
"public function refreshToken()\n {\n $token = $this->getToken();\n }",
"public function getBearerToken()\r\n {\r\n $header = $this->getAuthorizationHeader();\r\n // HEADER: Get the access token from header\r\n if(!empty($header))\r\n {\r\n if(preg_match('/Bearer\\s(\\S+)/', $header, $matches))\r\n {\r\n return $matches[1];\r\n }\r\n }\r\n $this->throwError(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not Found.');\r\n }",
"public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }",
"public function getRefreshResponse($refreshToken);",
"public function getToken()\n {\n $authHeader = $this->getHeader('AUTHORIZATION');\n $authQuery = $this->getQuery('token');\n\n return $authQuery ? $authQuery : $this->parseBearerValue($authHeader);\n }",
"public function getBearerToken()\n {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->returnResponse(ATHORIZATION_HEADER_NOT_FOUND, null, 'Access Token Not found');\n }",
"public static function refresh_oauth_token($refresh) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&refresh_token=\".$refresh.\"&grant_type=refresh_token\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"public function refreshToken($token = null)\n\t{\n\t\tif (!$this->getOption('userefresh'))\n\t\t{\n\t\t\tthrow new RuntimeException('Refresh token is not supported for this OAuth instance.');\n\t\t}\n\n\t\tif (!$token)\n\t\t{\n\t\t\t$token = $this->getToken();\n\n\t\t\tif (!array_key_exists('refresh_token', $token))\n\t\t\t{\n\t\t\t\tthrow new RuntimeException('No refresh token is available.');\n\t\t\t}\n\t\t\t$token = $token['refresh_token'];\n\t\t}\n\t\t$data['grant_type'] = 'refresh_token';\n\t\t$data['refresh_token'] = $token;\n\t\t$data['client_id'] = $this->getOption('clientid');\n\t\t$data['client_secret'] = $this->getOption('clientsecret');\n\t\t$response = $this->http->post($this->getOption('tokenurl'), $data);\n\n\t\tif ($response->code >= 200 || $response->code < 400)\n\t\t{\n\t\t\tif ($response->headers['Content-Type'] == 'application/json')\n\t\t\t{\n\t\t\t\t$token = array_merge(json_decode($response->body, true), array('created' => time()));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparse_str($response->body, $token);\n\t\t\t\t$token = array_merge($token, array('created' => time()));\n\t\t\t}\n\n\t\t\t$this->setToken($token);\n\n\t\t\treturn $token;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Error code ' . $response->code . ' received refreshing token: ' . $response->body . '.');\n\t\t}\n\t}",
"public function getBearerToken()\n\t{\n\t\t$ch = curl_init($this->oauthURI);\n\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->generateHeader());\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->oauthBody);\n\n\t\t$results = curl_exec($ch);\n\t\t\n\t\t$this->lastCurlInfo = curl_getinfo($ch);\n\n\t\tif($this->lastCurlInfo['http_code'] != 200)\n\t\t\tthrow new OAuthException('Token request failed', \n\t\t\t\t\t\t\t\t\t $this->lastCurlInfo);\n\n\t\t$token = json_decode($results);\n\t\t$this->bearerToken = $token->access_token;\n\n\t\treturn $this->bearerToken;\n\t}",
"public function get()\n {\n if ($token = $this->cachedToken()) {\n return $token;\n }\n\n return $this->newToken();\n }",
"function getRdioRefreshToken($clientId, $refreshToken){\n $result = null;\n $error = false;\n $ch = $ch = setUpRdioCurl($clientId, [\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $refreshToken\n ]);\n \n // Run query\n $result = curl_exec($ch);\n \n // Something failed during the request\n if(curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400){\n $error = true;\n }\n curl_close($ch);\n \n if($error) return setErrorHeader($result);\n \n // Return our token data\n return setSuccessHeader($result);\n}",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"public function getToken() {\n return $this->accessToken;\n }",
"public static function getAccessTokenFromRefreshToken($refreshToken)\n {\n return self::_getAccessToken($refreshToken, self::$ACCESS_TOKEN_FROM_REFRESH);\n }",
"public function getToken()\n {\n return $this->accessToken;\n }",
"public function getBearerToken() {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n }",
"function getBearerToken() {\n $headers = getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n}",
"public function getBearerToken() {\n\t\t $headers = $this->getAuthorizationHeader();\n\t\t // HEADER: Get the access token from the header\n\t\t if (!empty($headers)) {\n\t\t if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n\t\t return $matches[1];\n\t\t }\n\t\t }\n\t\t return null;\n\t\t}",
"public function refreshToken($refreshToken)\n {\n return $this->proxy('refresh_token', [\n 'refresh_token' => $refreshToken\n ]);\n }",
"public function refreshToken()\n\t{\n\t\tAuth::user()->generateToken()->didUpdate()->save();\n\n\t\t// Return token\n\t\treturn response()->json([\n\t\t\t'status' => 'Token updated',\n\t\t\t'token' => Auth::user()->token,\n\t\t], 200);\n\t}",
"public static function get_oauth_token($auth) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&code=\".$auth.\"&grant_type=authorization_code\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}",
"public function refreshToken(Request $request)\n {\n return $this->access('refresh_token', [\n 'refresh_token' => $request->cookie(self::REFRESH_TOKEN),\n ]);\n }",
"public function removeRefreshToken();",
"public function refreshAccessToken(): AccessToken;",
"public function getToken()\n {\n $accessToken = null;\n if (file_exists($_SERVER['DOCUMENT_ROOT'].$this->tokenFile)) {\n $accessToken = unserialize(file_get_contents($_SERVER['DOCUMENT_ROOT'].$this->tokenFile));\n }\n\n return json_decode($accessToken);\n }",
"public static function getBearerToken() {\n $headers = Authorization::extractHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n return null;\n }",
"function getBearerToken() {\n $headers = $this->getHeaders();\n $auth = $headers->get('Authorization', null);\n\n if ($auth !== null) {\n if (preg_match('/Bearer\\s(\\S+)/', $auth, $matches)) {\n return $matches[1];\n }\n }\n\n return null;\n }",
"public function getOAuthToken()\n {\n return $this->oauthToken->getToken();\n }",
"public static function acquire_token() {\n\n\t\t\n\n\t\t$response = skydrive_tokenstore::get_tokens_from_store();\n\n\t\tif (empty($response['access_token'])) {\t// No token at all, needs to go through login flow. Return false to indicate this.\n\n\t\t\treturn false;\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\tif (time() > (int)$response['access_token_expires']) { // Token needs refreshing. Refresh it and then return the new one.\n\n\t\t\t\t$refreshed = skydrive_auth::refresh_oauth_token($response['refresh_token']);\n\n\t\t\t\tif (skydrive_tokenstore::save_tokens_to_store($refreshed)) {\n\n\t\t\t\t\t$newtokens = skydrive_tokenstore::get_tokens_from_store();\n\n\t\t\t\t\treturn $newtokens['access_token'];\n\n\t\t\t\t}\n\n\t\t\t\texit;\n\n\t\t\t} else {\n\n\t\t\t\treturn $response['access_token']; // Token currently valid. Return it.\n\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"function getAccessTokenByRefreshToken($refresh_token, $scope)\n\t{\n\t\t$data = array(\n\t\t\t\t'grant_type' => \"refresh_token\",\n\t\t\t\t'refresh_token' => $refresh_token,\n\t\t\t\t'client_id' => $this->_clientId,\n\t\t\t\t'client_secret' => $this->_clientSecret,\n\t\t\t\t'scope' => $scope,\n\t\t);\n\t\t$request = $this->call('get', $this->_accessTokenURL, $data);\n\t\treturn $request;\n\t}",
"protected static function getBearerToken() \n {\n $headers = self::getAuthorizationHeader();\n // HEADER: Get the access token from the header\n \n if ((! empty($headers)) && (! is_null($headers))) {\n // if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n // return $matches[1];\n // }\n return $headers;\n }\n Utils::json_respond(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public function token()\n {\n if ($this->accessToken === null) {\n $this->initToken();\n }\n return $this->accessToken;\n }",
"public function getToken(): TokenInterface;",
"public function getToken(): TokenInterface;",
"public function getSpotifyRefreshToken()\n {\n return $this->spotifyRefreshToken;\n }",
"public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }",
"public function refreshPasswordCredentialsToken()\n {\n // Setup our auth parameters\n $params = [\n 'headers' => [\n // Use directly to prevent infinite loops\n 'Authorization' => $this->token,\n ],\n 'form_params' => [\n 'auth_type' => 'token',\n ],\n ];\n\n // Make the Request and process the response\n $response = $this->guzzle->request('POST', $this->getAuthUrl(), $params);\n $result = json_decode((string) $response->getBody());\n\n $this->setToken($result->access_token)\n ->setTokenExpiry(\n Carbon::now()\n ->addMinutes(120)\n );\n\n return $this->token;\n }",
"public function refreshAccessToken(): string\n {\n // TODO: check the current token expiry\n $updatedToken = null;\n\n return $updatedToken;\n }",
"public function find($id)\n {\n return Passport::refreshToken()->findById($id);\n }",
"public function load(string $token): JWT;",
"public function refresh()\n {\n try {\n if ($token = $this->guard()->refresh()) {\n return response()\n ->json([\n 'error' => false,\n 'message' => 'Your token already refreshed',\n 'data' => [\n 'token' => $token\n ]\n ], 200)\n ->header('Authorization', $token)\n ;\n }\n \n return response()->json([\n 'error' => true,\n 'message' => 'Your credentials is invalid, failed to refresh token',\n 'data' => []\n ], 401);\n } catch (\\Throwable $th) {\n $this->guard()->logout();\n\n return response()->json([\n 'error' => false,\n 'message' => 'Successfully logging out from system'\n ], 200);\n }\n }",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function generateRefreshToken($code, $client_id, $client_secret) {\n //get crm token credentials\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n\n if(is_null($zohoCredentials)) {\n $this::create([\n 'user_id' => Auth::user()->id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n ]);\n }\n\n\n $token = AccessToken::where('user_id', Auth::user()->id)->first();\n\n $post = [\n 'code' => $code,\n 'redirect_uri' => 'http://example.com/callbackurl',\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n // curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/x-www-form-urlencoded'\n ));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n if(isset(json_decode($response, true)['access_token'])) {\n if(is_null($token)){\n AccessToken::create([\n 'user_id'=>Auth::user()->id,\n 'value'=>$response,\n ]);\n\n return response(['Zoho - Token successfully created'], 200);\n }else{\n $token->value=$response;\n $token->save();\n }\n } else {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'access_token' => [$response],\n ]);\n throw $error;\n }\n }",
"public static function getRealToken(Oauth_TokenModel $token)\n {\n $provider = craft()->oauth->getProvider($token->providerHandle);\n\n if($provider)\n {\n switch($provider->getOauthVersion())\n {\n case 1:\n $realToken = new \\League\\OAuth1\\Client\\Credentials\\TokenCredentials();\n $realToken->setIdentifier($token->accessToken);\n $realToken->setSecret($token->secret);\n break;\n\n\n case 2:\n $realToken = new \\League\\OAuth2\\Client\\Token\\AccessToken([\n 'access_token' => $token->accessToken,\n 'refresh_token' => $token->refreshToken,\n 'secret' => $token->secret,\n 'expires' => $token->endOfLife,\n ]);\n\n break;\n }\n\n return $realToken;\n }\n }",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function GetToken($data){ \n \n return $this->token;\n \n }",
"public function revokeRefreshTokenByToken($token)\n {\n return $this->start()->uri(\"/api/jwt/refresh\")\n ->urlParameter(\"token\", $token)\n ->delete()\n ->go();\n }",
"public function getRefreshToken($refresh_token)\n {\n $refreshToken = $this->getRefreshTokenProvider()->find($refresh_token);\n if (!$refreshToken) {\n return null;\n }\n\n // Get Client\n $client = $refreshToken->getClient();\n\n return array(\n 'refresh_token' => $refreshToken->getToken(),\n 'client_id' => $client->getClientId(),\n 'user_id' => $refreshToken->getUser()->getUsername(),\n 'expires' => $refreshToken->getExpires()->getTimestamp(),\n 'scope' => $refreshToken->getScope()\n );\n }",
"public function get_access_token()\n\t\t{\n\t\t\tif(isset($_COOKIE['bing_access_token']))\n\t\t\t\treturn $_COOKIE['bing_access_token'];\n\t\t\n\t\t\t// Get a 10-minute access token for Microsoft Translator API.\n\t\t\t$url = 'https://datamarket.accesscontrol.windows.net/v2/OAuth2-13';\n\t\t\t$postParams = 'grant_type=client_credentials&client_id='.urlencode($this->clientID).\n\t\t\t'&client_secret='.urlencode($this->clientSecret).'&scope=http://api.microsofttranslator.com';\n\t\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url); \n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\t\t$rsp = curl_exec($ch); \n\t\t\t$rsp = json_decode($rsp);\n\t\t\t$access_token = $rsp->access_token;\n\t\t\t\n\t\t\tsetcookie('bing_access_token', $access_token, $rsp->expires_in);\n\t\t\t\n\t\t\treturn $access_token;\n\t\t}",
"public function getToken(string $userToken): ?Token;",
"public function refreshToken()\n {\n return $this->response->array([]);\n }",
"public function obtainCurrentToken(): Token\n {\n if (null === $this->currentToken || ! $this->currentToken->isValid()) {\n $this->currentToken = $this->authenticate();\n }\n return $this->currentToken;\n }",
"public function getToken(){\n\n if( $this->hasToken() )\n return $this->token;\n\n $token = $this->asObj('/authorize', self::POST);\n\n if( $token and isset($this->data) )\n return new Token($token);\n\n throw new ClientException(\"Could not retrieve token. Please check your credentials and try again.\");\n\n }",
"public function getRefreshToken()\n {\n if (!$this->psAccountsService) {\n return false;\n }\n\n return $this->psAccountsService->getRefreshToken();\n }",
"public function refreshToken()\n {\n $client = new Client();\n\n try {\n $resp = $client->request('POST', 'https://bitbucket.org/site/oauth2/access_token', [\n 'auth' => [\n env('BITBUCKET_CLIENT_ID'),\n env('BITBUCKET_SECRET')\n ],\n 'form_params' => [\n 'grant_type' => 'refresh_token',\n \"refresh_token\" => $this->sourceProvider->refresh_token\n ]\n ]);\n\n $resp = json_decode($resp->getBody()->getContents());\n\n $this->sourceProvider->access_token = $resp->access_token;\n $this->sourceProvider->refresh_token = $resp->refresh_token;\n $this->sourceProvider->save();\n\n } catch (\\Exception $e) {\n \\Log::info($e);\n }\n }",
"public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }",
"public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }"
] | [
"0.75672966",
"0.752618",
"0.73875654",
"0.7093878",
"0.6966197",
"0.6947219",
"0.6862143",
"0.68446887",
"0.68046284",
"0.67479366",
"0.6725597",
"0.6703755",
"0.6703114",
"0.66802675",
"0.663067",
"0.66197187",
"0.6618539",
"0.6602108",
"0.6600503",
"0.6596477",
"0.6576707",
"0.6521661",
"0.6468429",
"0.6433411",
"0.64190966",
"0.63597286",
"0.63429415",
"0.6334352",
"0.6317336",
"0.631468",
"0.6313918",
"0.630737",
"0.6302022",
"0.6284293",
"0.62693965",
"0.6268018",
"0.6267025",
"0.6215235",
"0.6195005",
"0.6181886",
"0.6153021",
"0.6151509",
"0.61368454",
"0.61105394",
"0.6103",
"0.6099346",
"0.60769504",
"0.6054267",
"0.6032059",
"0.6024318",
"0.6014617",
"0.6014401",
"0.6014253",
"0.5987385",
"0.5985571",
"0.59754586",
"0.59468853",
"0.59463114",
"0.5944656",
"0.59409124",
"0.5916652",
"0.5909907",
"0.59047264",
"0.59006643",
"0.58980143",
"0.58898455",
"0.5886759",
"0.58499753",
"0.5840442",
"0.58292794",
"0.5819642",
"0.5818602",
"0.5804101",
"0.5804101",
"0.57929975",
"0.5786688",
"0.5780657",
"0.5772267",
"0.57719314",
"0.57681936",
"0.5767231",
"0.57646513",
"0.57646513",
"0.57646513",
"0.57646513",
"0.5745108",
"0.5716157",
"0.57139915",
"0.571202",
"0.5703251",
"0.5699343",
"0.5693525",
"0.56751186",
"0.5669185",
"0.5669172",
"0.56668884",
"0.5662732",
"0.5661452",
"0.5655494",
"0.5654841"
] | 0.6353746 | 26 |
Build a ZaloToken from a ZaloResponse | protected function buildZaloTokenFromZaloResponse($response)
{
$data = $response->getDecodedBody();
if (!isset($data['access_token'])) {
throw new ZaloSDKException('Access token was not returned from request.', 401);
}
$accessToken = $data['access_token'];
if (!isset($data['refresh_token'])) {
throw new ZaloSDKException('Refresh token was not returned from request.', 401);
}
$refreshToken = $data['refresh_token'];
$accessTokenExpiresIn = 0;
if (isset($data['expires_in'])) {
$accessTokenExpiresIn = $data['expires_in'];
}
return new ZaloToken($accessToken, $refreshToken, $accessTokenExpiresIn);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tokenFromResponse($response){\n parse_str($response);\n $this->token = $access_token;\n }",
"protected function _createNewToken(Eway_Rapid31_Model_Response $response)\n {\n try {\n $customer = $response->getCustomer();\n\n $tokenInfo = array(\n 'Token' => $response->getTokenCustomerID(),\n 'Card' => $customer['CardNumber'] ? substr_replace($customer['CardNumber'], '******', 6, 6) : 'Paypal',\n 'Owner' => $customer['CardName'],\n 'StartMonth' => $customer['CardStartMonth'],\n 'StartYear' => $customer['CardStartYear'],\n 'IssueNumber' => $customer['CardIssueNumber'],\n 'ExpMonth' => $customer['CardExpiryMonth'],\n 'ExpYear' => (strlen($customer['CardExpiryYear']) == 2 ? '20' . $customer['CardExpiryYear'] : $customer['CardExpiryYear']),\n 'Type' => $this->checkCardType($customer['CardNumber']),\n 'Address' => Mage::getModel('ewayrapid/field_customer')->addData($customer),\n );\n\n Mage::helper('ewayrapid/customer')->addToken($tokenInfo);\n return true;\n } catch (Exception $e) {\n return false;\n }\n }",
"protected function parseResponse(Response $response): Token\n {\n $body = json_decode((string)$response->getBody(), true);\n\n return new Token($body['access_token'], $body['token_type']);\n }",
"protected function populate(stdClass $response)\n\t{\n\t\t$cardToken = clone $this;\n\t\t$cardToken->data = new stdClass();\n\t\t$cardToken->data->id = $this->getIfSet('id', $response);\n\t\t$cardToken->data->card = new stdClass();\n\n\t\t$card = $this->getIfSet('card', $response);\n\n\t\t$cardToken->data->card->id = $this->getIfSet('id', $card);\n\t\t$cardToken->data->card->card_brand = $this->getIfSet('card_brand', $card);\n\t\t$cardToken->data->card->first4_digits = $this->getIfSet('first4_digits', $card);\n\t\t$cardToken->data->card->expiration_month = $this->getIfSet('expiration_month', $card);\n\t\t$cardToken->data->card->expiration_year = $this->getIfSet('expiration_year', $card);\n\t\t$cardToken->data->card->holder_name = $this->getIfSet('holder_name', $card);\n\n\t\treturn $cardToken;\n\t}",
"public function saveTokenById(Eway_Rapid31_Model_Response $response, $ccNumber = null)\n {\n $this->unsetData();\n\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n $customerParam->setTokenCustomerID($response->getTokenCustomerID());\n $this->setCustomer($customerParam);\n $payment = Mage::getModel('ewayrapid/field_payment');\n $payment->setTotalAmount(1);\n $this->setPayment($payment);\n $this->setRedirectUrl(Mage::getBaseUrl() . '/ewayrapid/sharedpage/saveToken');\n $this->setMethod('');\n\n $response = $this->_doRapidAPI('AccessCodesShared');\n $token = true;\n if ($response->isSuccess()) {\n if (!$ccNumber) {\n $token = $this->_createNewToken($response);\n } else {\n $token = $this->_updateToken($response, $ccNumber);\n }\n\n } else {\n Mage::throwException(Mage::helper('ewayrapid')->__('An error occurred while creating new token. Please try again. (Error message: %s)',\n $response->getMessage()));\n }\n if (!$token) {\n Mage::throwException(Mage::helper('ewayrapid')->__('An error occurred while process token. Please try again.'));\n }\n return $response;\n }",
"private function generateToken($resp) {\n //Chave para a encriptação\n $key = 'klEpFG93';\n\n //Configuração do JWT\n $header = [\n 'alg' => 'HS256',\n 'typ' => 'JWT'\n ];\n\n $header = json_encode($header);\n $header = base64_encode($header);\n\n //Obter o nome do fornecedor\n //Dados \n $payload = [\n 'iss' => 'WMenu 2',\n 'id' => $resp['id'],\n 'nome' => $resp['nome'],\n 'email' => $resp['email'],\n 'negocio' => $resp['negocio']\n ];\n\n $payload = json_encode($payload);\n $payload = base64_encode($payload);\n\n //Signature\n\n $signature = hash_hmac('sha256', \"$header.$payload\", $key, true);\n $signature = base64_encode($signature);\n // echo $header.$payload.$signature;\n\n return \"$header.$payload.$signature\";\n }",
"protected function buildToken() {\n }",
"public function createToken();",
"public function getTokenResponse() {\n return $this->generateToken();\n \n }",
"public static function parseTokenResponse(Response $response)\n {\n $parsedJson = $response->getResponse();\n Util::ensureNot('invalid_client', Arrays::get($parsedJson, 'error'), 'Invalid Credentials');\n Util::ensure(200, $response->getHttpCode(), Arrays::get($parsedJson, 'error_description', 'Unknown API error'));\n return [$parsedJson['access_token'], Arrays::get($parsedJson, 'refresh_token'), time() + (int)$parsedJson['expires_in']];\n }",
"public function getToken()\n {\n // curl:Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld\n // flags:0\n // forcedownlevel:0\n // formdir:3\n // username:<xxx>\n // password:<password>\n // SubmitCreds:Aanmelden\n // trusted:0\n\n $client = new \\GuzzleHttp\\Client(['cookies' => true]);\n $response = $client->request('POST', $_ENV['HANZE_LOGON_URL'], [\n 'headers' => [\n 'Origin' => 'https://www.hanze.nl',\n 'Refer' => 'https://www.hanze.nl/CookieAuth.dll?GetLogon?curl=Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld&reason=0&formdir=3',\n 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'\n ],\n 'allow_redirects' => false,\n 'form_params' => [\n 'curl' => 'Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld',\n 'flags' => 0,\n 'forcedownlevel' => 0,\n 'formdir' => 3,\n 'username' => $_ENV['HANZE_USERNAME'],\n 'password' => $_ENV['HANZE_PASSWORD'],\n 'SubmitCreds' => 'Aanmelden',\n 'trusted' => 0\n ]\n ]);\n return $client; \n }",
"private function tokenInit()\n {\n $tempSession = uniqid();\n echo \"************************************************* MONZO AUTHENTICATION WORKFLOW ***********************************************************\\n\";\n echo \"Please visit the following URL in your browser and follow instructions \\n\";\n echo \"###########\\n\";\n echo \"\\n\";\n echo \"https://auth.monzo.com/?client_id=$this->clientId&redirect_uri=$this->redirectUri&response_type=code&state=$tempSession \\n\";\n echo \"\\n\";\n echo \"###########\\n\";\n echo \"When you get email from Monzo, copy the link button (Right click -> Copy link Location) from the email and paste here. Do not click it. \\n\";\n echo \"*********************************************************************************************************************************************\\n\";\n $verificationUrl = readline(\"Email link: \");\n parse_str(parse_url($verificationUrl, PHP_URL_QUERY) , $urlParams);\n if (array_key_exists('code', $urlParams) && array_key_exists('state', $urlParams))\n {\n if ($urlParams['state'] === $tempSession)\n {\n $data = array(\n 'grant_type' => 'authorization_code',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'redirect_uri' => $this->redirectUri,\n 'code' => $urlParams['code']\n );\n $tokenData = $this->getJson('/oauth2/token', $data, false);\n if (isset($tokenData['access_token']) && isset($tokenData['refresh_token']))\n {\n $this->bearerToken = $tokenData['access_token'];\n $this->refreshToken = $tokenData['refresh_token'];\n if ($this->validateTokens())\n {\n $this->storeTokens($tokenData['access_token'], $tokenData['refresh_token']);\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Newly created tokens not valid\");\n throw new Exception('Monzo: Newly created Tokens not valid');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Tokens not found\");\n throw new Exception('Monzo: Tokens not found');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: State does not match the one that was sent to Monzo.\");\n throw new Exception('Monzo: State does not match the one that was sent to Monzo.');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Code and State ids not found in the email URL\");\n throw new Exception('Monzo: Code and State ids not found in the email URL');\n }\n }",
"public function generateAccessToken($token){\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n $tokenval = json_decode($token->value);\n $refresh_token=$tokenval->refresh_token;\n\n $post = [\n 'refresh_token' => $refresh_token,\n 'redirect_uri' => 'http://example.com/callbackurl',\n 'client_id' => $zohoCredentials->client_id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_secret' => $zohoCredentials->client_secret,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'grant_type' => 'refresh_token',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n\n if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200) {\n $tokenval->access_token = json_decode($response)->access_token;\n $token->value=json_encode($tokenval);\n $token->save();\n }\n\n return json_decode($token->value)->access_token;\n }",
"private function generateToken() {\n $response = null;\n $args = [\n 'body' => $this->body,\n 'timeout' => '5',\n 'redirection' => '5',\n 'httpversion' => '1.0',\n 'blocking' => true,\n 'headers' => [],\n 'cookies' => [],\n ];\n \n $response = wp_remote_post($this->url, $args);\n \n if ($response instanceof WP_Error) {\n throw new Exception(\"Error trying to connect to instance\");\n } else {\n $responseBody = json_decode($response['body']);\n\n if (isset($responseBody->error)) {\n throw new Exception(\"Error with Salesforce login credentials\");\n } else {\n return $responseBody;\n }\n }\n }",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"function generateToken($resp) {\n //Chave para a encriptação\n $key='klEpFG93';\n\n //Configuração do JWT\n $header = [\n 'alg' => 'HS256',\n 'typ' => 'JWT'\n ];\n\n $header = json_encode($header);\n $header = base64_encode($header);\n\n //Dados \n $payload = [\n 'iss' => 'CALIKA',\n 'nome' => $resp->nome,\n ];\n\n $payload = json_encode($payload);\n $payload = base64_encode($payload);\n\n //Signature\n\n $signature = hash_hmac('sha256', \"$header.$payload\", $key,true);\n $signature = base64_encode($signature);\n // echo $header.$payload.$signature;\n $this->db->query(\"UPDATE users SET token=:token WHERE id=:id\", [':token'=>$header.'.'.$payload.'.'.$signature, ':id'=>$resp->id]);\n\n return \"$header.$payload.$signature\";\n }",
"public function generateToken();",
"public function decode($response);",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken()\n\t{\n\t\t$this->setCurlHeaders(false);\n\t\t\n\t\t$request_params = array\n\t\t(\n\t\t\t'client_key' => $this->client_key,\n\t\t\t'client_secret' => $this->client_secret\n\t\t);\n\t\t\n\t\treturn $this->makeCurlRequest($this->public_api_url . \"v1/token/generate\", false, \"POST\", $request_params);\n\t}",
"public function create_token()\n {\n $this->load->library('wsresponse');\n $this->load->library('wschecker');\n $this->wsresponse->setOptionsResponse();\n \n $this->load->model('rest_model');\n $remote_addr = $this->wschecker->getHTTPRealIPAddr();\n $user_agent = $this->wschecker->getHTTPUserAgent();\n $prepare_str = $remote_addr . \"@@\" . $user_agent . \"@@\" . time();\n $ws_token = hash(\"SHA256\", $this->wschecker->encrypt($prepare_str));\n\n $inser_arr['vWSToken'] = $ws_token;\n $inser_arr['vIPAddress'] = $remote_addr;\n $inser_arr['vUserAgent'] = $user_agent;\n $inser_arr['dLastAccess'] = date(\"Y-m-d H:i:s\");\n $res = $this->rest_model->insertToken($inser_arr);\n if ($res) {\n $settings_arr['success'] = 1;\n $settings_arr['message'] = \"Token generated successfully..!\";\n $data_arr['ws_token'] = $ws_token;\n } else {\n $settings_arr['success'] = 0;\n $settings_arr['message'] = \"Token generation failed..!\";\n $data_arr = array();\n }\n $responce_arr['settings'] = $settings_arr;\n $responce_arr['data'] = $data_arr;\n $this->wsresponse->sendWSResponse($responce_arr);\n }",
"function build_token_meta( $token ) {\n\t\t$this->set_token(\n\t\t\tnew Keyring_Access_Token(\n\t\t\t\t$this->get_name(),\n\t\t\t\tnew OAuthToken(\n\t\t\t\t\t$token['oauth_token'],\n\t\t\t\t\t$token['oauth_token_secret']\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$response = $this->request( $this->verify_url, array( 'method' => $this->verify_method ) );\n\t\tif ( Keyring_Util::is_error( $response ) ) {\n\t\t\t$meta = array();\n\t\t} else {\n\t\t\t$meta = array(\n\t\t\t\t'user_id' => $response->Profile->{'@attributes'}->ref,\n\t\t\t\t'username' => $response->Profile->screen_name,\n\t\t\t\t'name' => $response->Profile->public_display_name,\n\t\t\t\t'picture' => $response->Profile->photo_url,\n\t\t\t);\n\t\t}\n\n\t\treturn apply_filters( 'keyring_access_token_meta', $meta, $this->get_name(), $token, $response, $this );\n\t}",
"public function obtenerAuthToken()\n {\n $controller = new SignaBlockController;\n $response = $controller->auth();\n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->token;\n }\n }\n return response()->json($this->jsonError);\n }",
"public function createPaymenttoken(\n Requestmodels\\Paymenttokencreate $requestModel\n ) {\n $chargeMapper = new Chargesmapper($requestModel);\n\n $requestPayload = array(\n 'authorization' => $this->apiSetting->getSecretKey(),\n 'mode' => $this->apiSetting->getMode(),\n 'postedParam' => $chargeMapper->requestPayloadConverter(),\n );\n\n $processCharge = Apihttpclient::postRequest(\n $this->apiUrl->getPaymenttokensApiUri(),\n $this->apiSetting->getSecretKey(), $requestPayload\n );\n\n return new Responsemodels\\Paymenttoken($processCharge);\n }",
"public function token(ApiResponse $response)\n {\n $this->validateLogin($this->request);\n if ($this->hasTooManyLoginAttempts($this->request)) {\n $this->fireLockoutEvent($this->request);\n $seconds = $this->limiter()->availableIn($this->throttleKey($this->request));\n $message = $this->translator->get('auth.throttle', ['seconds' => $seconds]);\n\n return $response->withParams([\n 'code' => 403,\n 'message' => $message,\n ])->generateHttpResponse();\n }\n $credentials = $this->credentials($this->request);\n if ($this->guard()->attempt($credentials, $this->request->has('remember'))) {\n $this->request->session()->regenerate();\n $this->clearLoginAttempts($this->request);\n try {\n $this->request->offsetSet('grant_type', 'password');\n $this->request->offsetSet('client_id', $this->client_id);\n $this->request->offsetSet('client_secret', $this->client_secret);\n $this->request->offsetSet('username', $this->request->offsetGet($this->username()));\n $this->request->offsetSet('password', $this->request->offsetGet('password'));\n $this->request->offsetSet('scope', '*');\n $request = (new DiactorosFactory)->createRequest($this->request);\n $back = $this->server->respondToAccessTokenRequest($request, new Psr7Response());\n $back = json_decode((string)$back->getBody(), true);\n if (isset($back['access_token']) && isset($back['refresh_token'])) {\n return $response->withParams([\n 'status' => 'success',\n 'message' => $this->translator->trans('administration::login.success'),\n ])->withParams($back)->generateHttpResponse();\n }\n } catch (Exception $exception) {\n return $response->withParams([\n 'code' => $exception->getCode(),\n 'message' => $exception->getMessage(),\n 'trace' => $exception->getTraceAsString(),\n ])->generateHttpResponse();\n }\n }\n\n return $response->withParams([\n 'code' => 403,\n 'message' => $this->translator->trans('administration::login.fail'),\n ])->generateHttpResponse();\n }",
"private function _getToken()\n {\n $postData = array(\n 'UserApiKey' => $this->username,\n 'SecretKey' => $this->password,\n 'System' => 'joomla_acy_3_5_v_3_0'\n );\n $postString = json_encode($postData);\n\n $ch = curl_init($this->apidomain.$this->getApiTokenUrl());\n curl_setopt(\n $ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n )\n );\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);\n\n $result = curl_exec($ch);\n curl_close($ch);\n\n $response = json_decode($result);\n $resp = false;\n if (is_object($response)) {\n @$IsSuccessful = $response->IsSuccessful;\n if ($IsSuccessful == true) {\n @$TokenKey = $response->TokenKey;\n $resp = $TokenKey;\n } else {\n $resp = false;\n }\n }\n return $resp;\n }",
"public function getIdToken()\n {\n $clientId = $this->scopeConfig->getValue('transiteo_activation/general/client_id', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $refreshToken = $this->scopeConfig->getValue('transiteo_activation/general/refresh_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $response = $this->doRequest(\n self::API_AUTH_REQUEST_URI . \"oauth2/token\",\n [\n 'headers' => [\n 'Content-type' => 'application/x-www-form-urlencoded',\n ],\n 'form_params' => [\n 'grant_type' => 'refresh_token',\n 'client_id' => $clientId,\n 'refresh_token' => $refreshToken\n ],\n 'http_errors' => false\n ],\n Request::HTTP_METHOD_POST\n );\n\n $status = $response->getStatusCode(); // 200 status code\n $responseBody = $response->getBody();\n $responseContent = $responseBody->getContents(); // here you will have the API response in JSON format\n\n if ($status == 200) {\n $responseArray = $this->serializer->unserialize($responseContent);\n\n $this->idToken = $responseArray['id_token'];\n //$this->cookie->set(self::COOKIE_NAME, $this->idToken, 3500);\n $this->flagManager->saveFlag(self::ID_TOKEN_FLAG_NAME, $this->idToken);\n $accessToken = $responseArray['access_token'];\n $this->flagManager->saveFlag(self::ACCESS_TOKEN_FLAG_NAME, $accessToken);\n $expires_in = $responseArray['expires_in'];\n $this->flagManager->saveFlag(self::TOKEN_EXPIRES_IN_FLAG_NAME, $expires_in);\n $token_type = $responseArray['token_type'];\n $this->flagManager->saveFlag(self::TOKEN_TYPE_FLAG_NAME, $token_type);\n $date = new \\DateTime();\n $this->flagManager->saveFlag(self::TOKEN_RECEIVED_TIMESTAMP, $date->getTimestamp());\n }\n\n return $responseContent;\n }",
"protected function createNewToken($token){\n return response()->json([\n 'access_token' => $token,\n 'token_type' => 'bearer',\n 'expires_in' => auth('api')->factory()->getTTL() * 60,\n 'user' => auth()->user()\n ]);\n\n\n }",
"private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }",
"protected function _parseResponse(Zend_Http_Response $response = null)\n\t{\n\t\tif (is_null($response)) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Exception('Response should not be null.');\n\t\t}\n\n $xml = Zend_Xml_Security::scan($response->getBody());\n\n if ($xml !== false) {\n // Fetch all namespaces\n $namespaces = array_merge($xml->getNamespaces(true), $xml->getDocNamespaces(true));\n\n // Register all namespace prefixes\n foreach ($namespaces as $prefix => $ns) {\n if ($prefix != '') {\n $xml->registerXPathNamespace($prefix, $ns);\n }\n }\n }\n\n return $xml;\n\t}",
"function create_client_token(){\n \t$clientToken = Braintree_ClientToken::generate();\n \treturn $clientToken;\n }",
"public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }",
"public static function create(\\GuzzleHttp\\Psr7\\Response $response)\n {\n // - validate body\n $data = json_decode($response->getBody(), true, 512, JSON_BIGINT_AS_STRING);\n if (empty($data)) {\n throw new ApiException('Invalid response body');\n }\n // - validate internal data\n if (isset($data['status'])) {\n if ($data['status'] != 0) {\n throw new ApiException('Remote error: ' .\n (isset($data['status_message']) ? $data['status_message'] : '-'),\n $data['status']);\n }\n $item = new self();\n $item->data = $data;\n return $item;\n }\n throw new ApiException('Invalid response json');\n }",
"public function getPayerAuthenticationResponse();",
"private function crearToken(){\n \n $headers = Yii::$app->request->headers;\n\n if (preg_match('/^Bearer\\s+(.*?)$/', $headers['authorization'], $matches)) {\n $token = $matches[1];\n } else {\n throw new \\yii\\web\\HttpException(500, 'Token invalido');\n }\n \n return $token;\n }",
"public function getBearerToken()\n\t{\n\t\t$ch = curl_init($this->oauthURI);\n\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->generateHeader());\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->oauthBody);\n\n\t\t$results = curl_exec($ch);\n\t\t\n\t\t$this->lastCurlInfo = curl_getinfo($ch);\n\n\t\tif($this->lastCurlInfo['http_code'] != 200)\n\t\t\tthrow new OAuthException('Token request failed', \n\t\t\t\t\t\t\t\t\t $this->lastCurlInfo);\n\n\t\t$token = json_decode($results);\n\t\t$this->bearerToken = $token->access_token;\n\n\t\treturn $this->bearerToken;\n\t}",
"static function generateToken($survey_id, $email)\r\n\t{\r\n\t\tif(!$surveyResponse)\r\n\t\t{\r\n\t\t\t$surveyResponse = new SurveyResponse();\r\n\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$code = \"\";\r\n\r\n\t\t\t\tfor($i = 0; $i < 5; ++$i)\r\n\t\t\t\t{\r\n\t\t\t\t\t$code .= chr(rand(ord('A'), ord('Z')));\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$surveyResponse->token = $code;\r\n\t\t\t\t$surveyResponse->survey_id = $survey_id;\r\n\t\t\t\t$surveyResponse->email = $email;\r\n\t\t\t\t$surveyResponse->status = \"not_started\";\r\n\t\t\t}\r\n\t\t\twhile(!$surveyResponse->insert());\r\n\t\t}\r\n\r\n\t\treturn $surveyResponse;\r\n\t}",
"public function tokenizeCreditCard($body)\n {\n \n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling tokenizeCreditCard');\n }\n \n // parse inputs\n $resourcePath = \"/tokenize/credit_card\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"POST\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n \n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\Token'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\Token', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\Token', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 422:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\ApiError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }",
"abstract protected function createResponse(GuzzleResponse $response);",
"public function __construct ($response)\r\n\t{\r\n\t\t$this->transactionId = $response ['transactionId'];\r\n\t\t$this->date = $response ['date'];\r\n\t\t$this->comment = $response ['comment'];\r\n\t\t$this->purchasePrice = $response ['purchasePrice'];\r\n\t\t$this->purchaseDate = $response ['purchaseDate'];\r\n\t\t$this->propertySize = $response ['propertySize'];\r\n\t\tif (isset ($response ['multipleOwners']))//individual\r\n\t\t\t$this->multipleOwners = $response ['multipleOwners'];\r\n\t\telse if (isset ($response ['multiple']))//business\r\n\t\t\t$this->multipleOwners = $response ['multiple'];\r\n\t\t$this->share = $response ['share'];\r\n\t\t$this->dateOfBirthOrIDNumber = $response ['dateOfBirthOrIDNumber'];\r\n\t\t$this->erf = $response ['erf'];\r\n\t\t$this->propertyType = $response ['propertyType'];\r\n\t\t$this->farm = $response ['farm'];\r\n\t\tif (isset ($response ['propertyName']))//individual\r\n\t\t\t$this->propertyName = $response ['propertyName'];\r\n\t\telse if (isset ($response ['buyerName']))//business\r\n\t\t\t$this->propertyName = $response ['buyerName'];\r\n\t\t$this->schemeName = $response ['schemeName'];\r\n\t\t$this->schemeNumber = $response ['schemeNumber'];\r\n\t\t$this->portion = $response ['portion'];\r\n\t\t$this->title = $response ['title'];\r\n\t\t$this->township = $response ['township'];\r\n\t\t$this->deedsOffice = $response ['deedsOffice'];\r\n\t\t$this->street = $response ['street'];\r\n\t\t$this->province = $response ['province'];\r\n\t\t$this->streetNumber = $response ['streetNumber'];\r\n\t}",
"public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }",
"public function buildResponse($embedlyResponse);",
"public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }",
"public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }",
"public function __construct($response)\n {\n @list($this->rawHeaders, $this->body) = explode(\"\\r\\n\\r\\n\", $response, 2);\n\n $this->buildHeaders($this->rawHeaders);\n }",
"protected function respondWithToken($token)\n{\n return response()->json([\n 'access_token' => $token,\n 'token_type' => 'bearer',\n 'user'=> $this->guard()->user(),\n 'expires_in' => $this->guard()->factory()->getTTL() * 60\n ]);\n}",
"protected function create_token()\n {\n do {\n $token = sha1(uniqid(\\Phalcon\\Text::random(\\Phalcon\\Text::RANDOM_ALNUM, 32), true));\n } while (Tokens::findFirst(array('token=:token:', 'bind' => array(':token' => $token))));\n\n return $token;\n }",
"public static function getObject()\n {\n return new CreditCardToken(self::getJson());\n }",
"public function deserializeResponse(string $response): Response;",
"public function response()\n {\n return new Response(\n $this->getService('service.token')->sendToken($this->response)\n );\n }",
"public function __construct($response)\n {\n $this->address = $response['address'];\n $this->url = $response['url'];\n $this->id = $response['id'];\n }",
"protected function Transform_Response($response)\n\t{\n\t\t\n\t\tif (is_string($response))\n\t\t{\n\t\t\t$response = new OLP_Response($response);\n\t\t}\n\t\t\n\t\t// we want the merged result so we have tokens for promo_id, etc.\n\t\t$data = array_merge($response->Signature()->To_Array(), $response->Collection()->To_Array());\n\t\t\n\t\t$proxy = new stdClass();\n\t\t$proxy->session_id = $response->Unique_ID();\n\t\t$proxy->page = $response->Page();\n\t\t$proxy->data = $data;\n\t\t$proxy->errors = $response->Errors()->To_Array();\n\t\t$proxy->event = array();\n\t\t\n\t\t// if we have a <section> element, turn it into\n\t\t// the eds_page in the response, using XSLT\n\t\tif (count($response->Content()->Sections()))\n\t\t{\n\t\t\t\n\t\t\t// which style-sheet?\n\t\t\t$xslt = DIR_SHARED.\"/xsl/{$response->Page()}.xsl\";\n\t\t\t\n\t\t\tif (is_file($xslt))\n\t\t\t{\n\t\t\t\t// transform our response\n\t\t\t\t$content = Transform_XML($xslt, $response->Received());\n\t\t\t\t$proxy->eds_page = array('content'=>$content, 'type'=>'text/html');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $proxy;\n\t\t\n\t}",
"public function authentication()\n {\n $response = new RESTAPI_CLASS_Response();\n $headers = self::getRequestHeaders();\n if (!isset($headers['Authorization'])) {\n return $response->error(401, \"Token is not exist.\");\n }\n\n $auth = explode(' ', $headers['Authorization']);\n if ($model = RESTAPI_BOL_Service::getInstance()->checkToken($auth[1])) {\n $this->token = $auth[1];\n return $model;\n } else {\n return $response->error(401, \"Your access denied.\");\n }\n }",
"public function parseResponse($response) {\n $this->_rawresponse = $response;\n $_response = new Payment_Response($this);\n $this->_response = $_response;\n return $this;\n }",
"public function __construct(Response $response)\n {\n $decoded = json_decode($response->getBody());\n\n //If things did not go well.\n if ($response->getStatusCode() >= 400 && $response->getStatusCode() < 600) {\n $this->success = false;\n\n if (isset($decoded->error)) {\n $this->errors = $decoded->error;\n }\n\n if (!$this->errors) {\n // API calls don't always provide an error :(\n $this->errors[] = 'An error occurred, however, no error message was given. Use the response body, HTTP status code and URL to help troubleshoot the issue.';\n }\n\n //If things went well.\n } else {\n $this->body = $decoded;\n }\n\n $this->statusCode = $response->getStatusCode();\n\n //DME's request limit meta data.\n if (isset($response->getHeaders()['x-dnsme-requestId'])) {\n $this->requestId = $response->getHeaders()['x-dnsme-requestId'];\n }\n\n if (isset($response->getHeaders()['x-dnsme-requestsRemaining'])) {\n $this->requestsRemaining = $response->getHeaders()['x-dnsme-requestsRemaining'];\n }\n\n if (isset($response->getHeaders()['x-dnsme-requestLimit'])) {\n $this->requestLimit = $response->getHeaders()['x-dnsme-requestLimit'];\n }\n\n if(!$this->success){\n \tthrow new ResultErrorException($this);\n }\n }",
"public function getAuthDataFromResponse(): array;",
"public function storeToken($requestResult)\n {\n parse_str($requestResult, $params);\n\n $this->oauthToken->setToken($params['oauth_token']);\n $this->oauthToken->setTokenSecret($params['oauth_token_secret']);\n\n return $this->oauthToken;\n }",
"public function getCreateAccountToken() {\n $queryData = array();\n $queryData['action'] = 'query';\n $queryData['meta'] = 'tokens';\n $queryData['type'] = 'createaccount';\n $queryData['format'] = 'json';\n\n $url = $this->apiUrl . \"?\" . http_build_query($queryData);\n\n try {\n $this->fetch($url, null, OAUTH_HTTP_METHOD_POST);\n } catch (Exception $e) {\n $msg = 'MediaWikiApiClient error getting createaccount token: ' . $e->getMessage();\n if(Configure::read('debug')) {\n CakeLog::write('error', $msg);\n CakeLog::write('error', 'Query data was ' . print_r($queryData, true));\n CakeLog::write('error', 'URL was ' . print_r($url, true));\n }\n throw new MediaWikiApiClientException($msg, 1, $e);\n }\n\n $responseInfo = $this->getLastResponseInfo();\n\n if ($responseInfo['http_code'] != 200 || !preg_match('/^application\\/json/', $responseInfo['content_type'])) {\n $msg = \"MediaWikiApiClient error getting createaccount token\";\n if(Configure::read('debug')) {\n CakeLog::write('error', $msg);\n CakeLog::write('error', 'MediaWikiApiClient response code was ' . $responseInfo['http_code']);\n CakeLog::write('error', 'MediaWikiApiClient content type was ' . $responseInfo['content_type']);\n }\n throw new MediaWikiApiClientException($msg, 1);\n }\n\n $response = json_decode($this->getLastResponse(), true);\n\n if (!isset($response['query']['tokens']['createaccounttoken'])) {\n $msg = \"MediaWikiApiClient error getting createaccount token\";\n if(Configure::read('debug')) {\n CakeLog::write('error', $msg);\n CakeLog::write('error', 'MediaWikiApiClient response was ' . $print_r($response, true));\n }\n throw new MediaWikiApiClientException($msg, 1);\n }\n\n $createAccountToken = $response['query']['tokens']['createaccounttoken'];\n\n return $createAccountToken;\n }",
"function decode_get() {\n $token = $this->head('Token');\n $auth = $this->head('Auth');\n $resp = array();\n\n if ($token) {\n $tokendt = JWT::decode($token, $this->config->item('jwt_key'));\n $resp['token'] = $tokendt;\n }\n\n if ($auth) {\n $authdt = JWT::decode($auth, $this->config->item('jwt_key'));\n $resp['auth'] = $authdt;\n }\n\n $this->response($resp, 200); \n }",
"function getToken($thisString) {\n $Tokens = array(\n \"Status\",\n \"StatusDetail\",\n \"VendorTxCode\",\n \"VPSTxId\",\n \"TxAuthNo\",\n \"Amount\",\n \"AVSCV2\", \n \"AddressResult\", \n \"PostCodeResult\", \n \"CV2Result\", \n \"GiftAid\", \n \"3DSecureStatus\", \n \"CAVV\",\n\t\"AddressStatus\",\n\t\"CardType\",\n\t\"Last4Digits\",\n\t\"PayerStatus\");\n\n // Initialise arrays\n $output = array();\n $resultArray = array();\n \n // Get the next token in the sequence\n for ($i = count($Tokens)-1; $i >= 0 ; $i--){\n // Find the position in the string\n $start = strpos($thisString, $Tokens[$i]);\n\t// If it's present\n if ($start !== false){\n // Record position and token name\n $resultArray[$i]->start = $start;\n $resultArray[$i]->token = $Tokens[$i];\n }\n }\n \n // Sort in order of position\n sort($resultArray);\n\t// Go through the result array, getting the token values\n for ($i = 0; $i<count($resultArray); $i++){\n // Get the start point of the value\n $valueStart = $resultArray[$i]->start + strlen($resultArray[$i]->token) + 1;\n\t// Get the length of the value\n if ($i==(count($resultArray)-1)) {\n $output[$resultArray[$i]->token] = substr($thisString, $valueStart);\n } else {\n $valueLength = $resultArray[$i+1]->start - $resultArray[$i]->start - strlen($resultArray[$i]->token) - 2;\n\t $output[$resultArray[$i]->token] = substr($thisString, $valueStart, $valueLength);\n } \n\n }\n\n // Return the ouput array\n return $output;\n}",
"public static function createFromToken($token) {\n $jwt = new JWTManager();\n $stdClass = $jwt->decode($token, self::$secret);\n $jwt->setAll(get_object_vars($stdClass));\n return $jwt;\n }",
"public function create($access_token)\n {\n// $service_url = $GLOBALS['service_url'] . '/api/v2/rubenaorborc/contact-php-v2/form/Deals';\n// //Authorization: Zoho-oauthtoken access_token\n// $data = array('data' => array('' => '') );\n// $header = array(\n// 'Authorization: Zoho-oauthtoken ' . $access_token,\n// 'Content-Type: application/json'\n// );\n//\n// $ch = curl_init();\n// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n// curl_setopt($ch, CURLOPT_URL, $service_url);\n// curl_setopt($ch, CURLOPT_POST, 1);\n// curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n// curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n// $result = curl_exec($ch);\n// curl_close($ch);\n// var_dump($result);\n }",
"protected function _updateToken(Eway_Rapid31_Model_Response $response, $ccNumber = null)\n {\n try {\n $customer = $response->getCustomer();\n\n $tokenInfo = array(\n 'Token' => $response->getTokenCustomerID(),\n 'Card' => $customer['CardNumber'] ? substr_replace($customer['CardNumber'], '******', 6, 6) : 'Paypal',\n 'Owner' => $customer['CardName'],\n 'StartMonth' => $customer['CardStartMonth'],\n 'StartYear' => $customer['CardStartYear'],\n 'IssueNumber' => $customer['CardIssueNumber'],\n 'ExpMonth' => $customer['CardExpiryMonth'],\n 'ExpYear' => (strlen($customer['CardExpiryYear']) == 2 ? '20' . $customer['CardExpiryYear'] : $customer['CardExpiryYear']),\n 'Type' => $this->checkCardType($customer['CardNumber']),\n 'Address' => Mage::getModel('ewayrapid/field_customer')->addData($customer),\n );\n\n Mage::helper('ewayrapid/customer')->updateToken($ccNumber, $tokenInfo);\n return true;\n } catch (Exception $e) {\n return false;\n }\n }",
"protected function handleResponse($response)\n {\n $manifest = $this->manifest();\n\n $scopes = explode(' ', Arr::get($response, 'scope'));\n\n return $manifest->setToken(Arr::get($response, 'access_token'))\n ->setRefreshToken(Arr::get($response, 'refresh_token'))\n ->setScopes($scopes)\n ->setExpiresIn(Arr::get($response, 'expires_in'));\n }",
"private function getToken()\n {\n\n try {\n $result = $this->makeRequest($this->api_url.'/token','POST', [],[\n 'Accept: application/json',\n 'ClientKey: ' . $this->client_key,\n 'ClientSecret: ' . $this->client_secret\n ]);\n $this->token = $result['body']['data'];\n return $this;\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n\n }",
"public function generateToken()\n {\n if (empty($this->username) || empty($this->api_token)) {\n throw new \\Exception(\"Username and Api Token must be set\");\n }\n $time = time();\n return hash_hmac(\"sha256\", $this->username . \"::\" . $this->api_token . \"::\" . $time, $this->api_token);\n }",
"private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }",
"function makeResponse($response)\n {\n $result = current(Util::toArray($response));\n\n $response = new Response([\n 'raw_body' => $result,\n\n ## get response message as array\n 'default_expected' => function($rawBody) use ($result) {\n return $result;\n }\n ]);\n // TODO handle exceptions\n\n /** @var iResponse $response */\n $response = $this->exceptionHandler($response);\n \n\n return $response;\n }",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public static function make(Response $response)\n {\n return new static($response->response, $response->attributes);\n }",
"public function getToken()\n {\n $api_key = \"lv_I4EE93OHHDADBW7DVLNJ\";\n $secret_key = \"lv_HTCYZPYLQG7O12C0DC5PXMLWLZ02T2\";\n \\Unirest\\Request::verifyPeer(false);\n $headers = array('content-type' => 'application/json');\n $query = array('apiKey' => $api_key, 'secret' => $secret_key);\n $body = \\Unirest\\Request\\Body::json($query);\n $response = \\Unirest\\Request::post('https://live.moneywaveapi.co/v1/merchant/verify', $headers, $body);\n $response = json_decode($response->raw_body, true);\n $status = $response['status'];\n if (!$status == 'success') {\n echo 'INVALID TOKEN';\n } else {\n $token = $response['token'];\n return $token;\n }\n }",
"public function createNewToken()\n {\n return $this->getBandrek()->generateToken();\n }",
"public function getOAuthToken(Request $request)\n {\n $bridgedRequest = \\OAuth2\\HttpFoundationBridge\\Request::createFromRequest($request->instance());\n\n $bridgedResponse = new \\OAuth2\\HttpFoundationBridge\\Response();\n\n /*Log::info('$bridgedRequest'. print_r($bridgedRequest, true));\n Log::info('$bridgedResponse'. print_r($bridgedResponse, true));*/\n\n\n $bridgedResponse = \\App::make('oauth2')->handleTokenRequest($bridgedRequest, $bridgedResponse);\n\n return $bridgedResponse;\n }",
"private function get_token() {\n $uri = $this->settings->hostname.\"oauth/token\";\n //echo \"POST $uri\\n\";\n\n $data = array(\n \"grant_type\" => \"password\",\n \"client_id\" => $this->settings->client_id,\n \"client_secret\" => $this->settings->client_secret,\n \"username\" => $this->settings->username,\n \"password\" => $this->settings->password\n );\n $postdata = http_build_query($data);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $uri);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/x-www-form-urlencoded'));\n\n $curl_response = curl_exec($ch);\n\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $curl_error_number = curl_errno($ch);\n $curl_error = curl_error($ch);\n\n //echo $curl_response.\"\\n\"; // output entire response\n //echo $http_code.\"\\n\"; // output http status code\n\n curl_close($ch);\n $token = NULL;\n if ($http_code == 200) {\n $token = json_decode($curl_response);\n //var_dump($token); // print entire token object\n }\n return $token;\n }",
"protected function createNewToken($token){\n return response()->json([\n 'access_token' => $token,\n 'token_type' => 'bearer',\n 'expires_in' => auth('api')->factory()->getTTL() * 60,\n 'user' => auth()->user()\n ]);\n }",
"private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }",
"public function createResponseSignature(Response $response, $salt);",
"protected function createNewToken($token){\n return response()->json([\n 'access_token' => $token,\n 'token_type' => 'bearer',\n 'expires_in' => auth()->factory()->getTTL() * 60,\n 'user' => auth()->user()\n ]);\n }",
"public function _response($response) {\n\t\treturn $this->_instance($this->_classes['response'], array(\n\t\t\t'body' => $response\n\t\t));\n\t}",
"function parse_response($response)\n {\n $data = $response->getBody();\n\n // Note we could not use Guzzle XML method becuase Endicia does not return valid XML it seems\n $sxe = new SimpleXMLElement($data);\n\n if ($sxe->status == 0) {\n $return_data = array();\n $return_data['Status'] = (string)$sxe->Status;\n $return_data['Base64LabelImage'] = (string)$sxe->Base64LabelImage;\n $return_data['TrackingNumber'] = (string)$sxe->TrackingNumber;\n $return_data['FinalPostage'] = (string)$sxe->FinalPostage;\n $return_data['TransactionID'] = (string)$sxe->TransactionID;\n $return_data['PostmarkDate'] = (string)$sxe->PostmarkDate;\n $return_data['DeliveryTimeDays'] = (string)$sxe->PostagePrice->DeliveryTimeDays;\n\t $return_data['error'] = (string)$data;\n \n\t\treturn $return_data;\n } else {\n return array('status' => 'error', 'message' => $sxe);\n }\n }",
"public function userDetails($response, AccessToken $token) {\n return $response;\n }",
"private function makeTicket(Response $response)\n {\n $this->ticket = $response;\n $this->status = $response->getStatusCode();\n\n }",
"protected function createToken()\n {\n if ($this->client->getRefreshToken()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n } else {\n // Request authorization from the user.\n $authUrl = $this->client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $this->client->fetchAccessTokenWithAuthCode($authCode);\n $this->client->setAccessToken($accessToken);\n\n // Check to see if there was an error.\n if (array_key_exists('error', $accessToken)) {\n throw new Exception(join(', ', $accessToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($this->token))) {\n mkdir(dirname($this->token), 0700, true);\n }\n file_put_contents($this->token, json_encode($this->client->getAccessToken()));\n }",
"public function createAuthToken() {\n $url = URIResource::Make($this->path, array($this->id, 'tokens'));\n $token = $this->client->post($url, null);\n return new EndpointsToken($token);\n }",
"public function generateRefreshToken($code, $client_id, $client_secret) {\n //get crm token credentials\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n\n if(is_null($zohoCredentials)) {\n $this::create([\n 'user_id' => Auth::user()->id,\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n ]);\n }\n\n\n $token = AccessToken::where('user_id', Auth::user()->id)->first();\n\n $post = [\n 'code' => $code,\n 'redirect_uri' => 'http://example.com/callbackurl',\n // 'client_id' => '1000.DCKGTZMMMJJVOBZE0K8DTZUVG5WBYE',\n 'client_id' => $client_id,\n // 'client_secret' => '8f3baa9e9419d00a6047269e54f3e581735ce808b4',\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n ];\n\n $ch=curl_init();\n\n for($i=0; $i<count($this->domains); $i++) {\n curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.'. $this->domains[$i] .'/oauth/v2/token');\n // curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/x-www-form-urlencoded'\n ));\n\n $response = curl_exec($ch);\n\n if(isset(json_decode($response, true)['access_token']) ){\n break;\n }\n }\n\n if(isset(json_decode($response, true)['access_token'])) {\n if(is_null($token)){\n AccessToken::create([\n 'user_id'=>Auth::user()->id,\n 'value'=>$response,\n ]);\n\n return response(['Zoho - Token successfully created'], 200);\n }else{\n $token->value=$response;\n $token->save();\n }\n } else {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'access_token' => [$response],\n ]);\n throw $error;\n }\n }",
"private function createPingToken(): Token\n {\n return new Token(\n TokenUUID::createById($this->pingToken),\n ''\n );\n }",
"protected function respondWithToken($token,$id)\n {\n $user=Customer::where('cust_id',$id)->first();\n\n return response()->json([\n 'access_token' => $token,\n 'id' =>$user->cust_id,\n\n 'name' => $user->name ==null ? '0' : $user->name,\n\n 'email' => $user->email ==null ? '0' : $user->email,\n\n 'password' => $user->password ==null ? '0' : $user->password,\n\n 'city' => $user->city ==null ? '0' : $user->city,\n\n 'phone_no' => $user->phone_no ==null ? '0' : $user->phone_no,\n\n 'zip_code' => $user->zip_code ==null ? '0' : $user->zip_code,\n\n 'street_address' => $user->street_address ==null ? '0' : $user->street_address,\n 'user_image'=>$user->user_image ==null ? '0' : asset('public/userimage/' . $user->user_image),\n\n 'datetime'=>Carbon::parse($user->created_at)->diffForHumans(),\n\n 'token_res' => 'true',\n 'token_type' => 'bearer',\n 'expires_in' => auth('api')->factory()->getTTL() * 60000000000\n ]);\n }",
"public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }",
"public function getResponse($response) {\r\n\r\n\r\n }",
"public function token_response($params){\n $params['refresh_token'] = 'refresh_token';\n $params['issued_at'] = 'issued_at';\n \t\t$params['signature'] \t = 'signature';\n \t\t$params['scope'] \t\t = 'scope';\n \t\t$params['id_token'] \t = 'id_token';\n \t\t$params['instance_url'] = 'instance_url';\n $params['id'] = 'id';\n \t\t$params['error_description'] = 'error_description';\n \t\treturn $params;\n \t}",
"public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }",
"public function createToken() {\r\n\t\t$characters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',\r\n\t\t\t'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9');\r\n\t\t$counter = 0;\r\n\t\t$resultString = \"\";\r\n\t\t\r\n\t\twhile ($counter < Page::TOKEN_LENGTH) {\r\n\t\t\t$nextRand = mt_rand(0, (count($characters) - 1));\r\n\t\t\t\r\n\t\t\tif (!Strings::contains($resultString, sprintf('%1$s', $characters[$nextRand]))) {\r\n\t\t\t\t$resultString .= $characters[$nextRand];\r\n\t\t\t\t\r\n\t\t\t\t$counter++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $resultString;\r\n\t}",
"private static function generateFailedAuthResponse(&$response) {\n $response->getHeaders()->addHeaders([\n 'Date' => gmdate('D, d M Y H:i:s T'),\n 'Content-Type' => 'application/json; charset=UTF-8'\n ]);\n $response->setContent(\\Zend\\Json\\Json::encode(['success' => false, 'data' => false, 'errors' => 'Request authorization failed, check keys/payload']));\n $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');\n $response->setStatusCode(403);\n }",
"public function createPasswordCredentialsToken()\n {\n\n $authorization_token = base64_encode($this->getUsername() . ':' . $this->getPassword());\n\n $params = [\n 'headers' => [ 'Authorization' => 'Basic '. $authorization_token],\n 'form_params' => ['grant_type' => env('DW_GRANT_TYPE', 'client_credentials')]\n ];\n\n // Make the Request and process the response\n $response = $this->guzzle->request('POST', $this->getAuthUrl(), $params);\n $result = json_decode((string) $response->getBody());\n\n $this->setToken($result->access_token)\n ->setTokenExpiry(\n Carbon::now()\n ->addSeconds($result->expires_in)\n );\n\n return $this->token;\n }",
"protected static function getBearerToken() \n {\n $headers = self::getAuthorizationHeader();\n // HEADER: Get the access token from the header\n \n if ((! empty($headers)) && (! is_null($headers))) {\n // if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n // return $matches[1];\n // }\n return $headers;\n }\n Utils::json_respond(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }",
"public function generateToken()\n\t{\n\t\treturn Token::make();\n\t}",
"public function generateToken()\n {\n $request = $this->call('v1/auth/token', Constants::METHOD_POST, [\n 'timestamp' => time(),\n 'nonce' => $this->generateNonce(),\n ]);\n\n return isset($request['token']) ? $request['token'] : false;\n }"
] | [
"0.6656247",
"0.638981",
"0.6044114",
"0.594295",
"0.5584943",
"0.5584056",
"0.55710405",
"0.5568637",
"0.55299413",
"0.55171824",
"0.55137736",
"0.5434297",
"0.5419445",
"0.5346053",
"0.53301066",
"0.53043735",
"0.5287231",
"0.52536833",
"0.51734364",
"0.51734364",
"0.51734364",
"0.51734364",
"0.51666933",
"0.51666504",
"0.5160645",
"0.51461554",
"0.5145958",
"0.51265883",
"0.51032907",
"0.50817287",
"0.5038207",
"0.503512",
"0.5027436",
"0.5020538",
"0.5007667",
"0.50067",
"0.5004363",
"0.49989286",
"0.4995671",
"0.49902564",
"0.4981242",
"0.49689308",
"0.49638185",
"0.496168",
"0.4957045",
"0.49541992",
"0.4953455",
"0.49419358",
"0.49381506",
"0.49299014",
"0.49292108",
"0.4927503",
"0.49253327",
"0.4920862",
"0.49192125",
"0.49089178",
"0.4906019",
"0.49049136",
"0.49031594",
"0.48975915",
"0.4897066",
"0.48910704",
"0.48844132",
"0.48826706",
"0.48809972",
"0.48786515",
"0.48783052",
"0.48763737",
"0.48660874",
"0.48658454",
"0.48620608",
"0.485111",
"0.48396608",
"0.48390877",
"0.4837321",
"0.48371556",
"0.48300996",
"0.48300606",
"0.48284143",
"0.4828324",
"0.48178524",
"0.47988445",
"0.47975746",
"0.47974643",
"0.47930288",
"0.47894686",
"0.47863773",
"0.47850063",
"0.4779469",
"0.47746873",
"0.4765799",
"0.4759429",
"0.4756771",
"0.4754842",
"0.47546536",
"0.47546536",
"0.4754512",
"0.47537157",
"0.47523645",
"0.4752106"
] | 0.809194 | 0 |
Escapes HTML for output | function escape($html) {
return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function escape()\n\t{\n\t\treturn ! $this->escaped ? esc_html($this->content) : $this->content;\n\t}",
"public function renderEscaped(): string\n {\n $this->escapeHtml(true);\n\n return $this->render();\n }",
"function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }",
"function html_escape($value)\n{\n return apply_filters('html_escape', $value);\n}",
"function esc_html($text) {\n return htmlspecialchars($text);\n }",
"public abstract function asHTML();",
"function html($data) {\n $data = htmlspecialchars($data, ENT_QUOTES); // <>\n return $data;\n }",
"public function testEscapesHtml()\n {\n $this->assertEquals(\n '<script>Hello</script>',\n $this->outputHelper->escape('<script>Hello</script>')\n );\n }",
"public static function escapeForHtml($value)\n {\n return htmlspecialchars(\n $value,\n static::htmlEscapeFlags(),\n self::CHARSET,\n true\n );\n }",
"function html_escape($v) {\n\treturn escape($v, TRUE);\n}",
"function html_escape($var, bool $double_encode = true)\n {\n if ($double_encode === false) {\n throw new NotSupportedException(\n '$double_encode = false is not supported.'\n );\n }\n\n return esc($var, 'html');\n }",
"function ailyak_facebook_group_feed_html_escape(&$text) {\n $text = htmlspecialchars($text);\n}",
"public function getSafeHtml()\n {\n return Html::safe($this->render());\n }",
"public function escapeHtml($html) {\n\t\t//[roman] da es die schöne double_encode Sache bei htmlentities erst ab der PHP 5.2.3 gibt hier ein fieser Mist...\n\t\tif (version_compare(PHP_VERSION, '5.2.3', '>=')) {\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8', FALSE);\n\t\t} else {\n\t\t\t$html= html_entity_decode($html, ENT_QUOTES, 'UTF-8');\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8');\n\t\t}\n\t\treturn $html;\n\t}",
"public function it_can_be_escaped_for_html()\n {\n $object = new Testee(self::TEST_NULL_VALUE_TO_ESCAPE);\n $this->assertEquals(self::TEST_HTML_ESCAPED_STRING, $object->escape(EscapeTarget::HTML));\n }",
"public function escapeForHtml() {\n $rawString = htmlspecialchars($this->rawString, ENT_QUOTES, $this->charset);\n\n return new static($rawString, $this->charset);\n }",
"public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes>$this->content</$this->tag_name>$this->after\";\n }",
"function escape_html($string) {\n $text = htmlspecialchars($string);\n // $text = strip_tags($string);\n\n return $text;\n}",
"public function toHTML();",
"public function escape($output)\n\t{\n\t\treturn $output;\n\t}",
"function esc_html($text)\n {\n }",
"static public function encode($html) {\r\n\t\t\treturn htmlspecialchars($html);\r\n\t\t}",
"public function escape($text);",
"public function toHTML()\n {\n }",
"protected function escape() {\n\t\t$this->text = htmlspecialchars($this->text);\n\t\tReturn $this;\n\t}",
"public function escapeHtml($data, $allowedTags = null){\n return $data;\n }",
"public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes />$this->after\";\n }",
"public static function echoEscaped($input) {\r\n\t\t//htmlentities escapes all characters which have HTML character entity \r\n\t\techo htmlentities($input, ENT_QUOTES | ENT_HTML5 | ENT_IGNORE, 'ISO-8859-1', false);\r\n\t}",
"function htmlOut($text) {\n\techo html($text);\n}",
"function esc_html($value) {\n return $value;\n}",
"function html($text)\n{\n\treturn htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\n}",
"public static function escape($value) {}",
"private function htmlspecialcarfy(&$value) {\r\n $value = htmlspecialchars($value);\r\n }",
"public function html() {}",
"private static function html() : string\n {\n return '<(.|\\n)*?>';\n }",
"public function renderHTML()\n {\n }",
"private function _escape($data)\n {\n return htmlspecialchars($data, ENT_QUOTES);\n }",
"public function escape($value);",
"public function escape($value);",
"function esc_html( $text ) {\n\t$safe_text = wp_check_invalid_utf8( $text );\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n\t/**\n\t * Filter a string cleaned and escaped for output in HTML.\n\t *\n\t * Text passed to esc_html() is stripped of invalid or special characters\n\t * before output.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $safe_text The text after it has been escaped.\n \t * @param string $text The text prior to being escaped.\n\t */\n\treturn apply_filters( 'esc_html', $safe_text, $text );\n}",
"public function escapeHtml($option = ENT_QUOTES)\n {\n $this->text = htmlspecialchars($this->text, $option, 'UTF-8', false);\n\n return $this;\n }",
"protected function quote_escaped()\n {\n }",
"public function testOutputIsHtmlEncoded()\n {\n $option = new Option('<h1>foo</h1>', 'Foo & Bar');\n\n self::assertSame('<option value=\"<h1>foo</h1>\">Foo & Bar</option>', $option->getHtml());\n self::assertSame('<option value=\"<h1>foo</h1>\">Foo & Bar</option>', $option->__toString());\n }",
"protected function echoHtml($value) {\r\n\t\t$this->autoencodeFormat -= 0xFFFF;\r\n\t\techo $value === null ? '' : \\htmlspecialchars($value, \\ENT_QUOTES, 'UTF-8');\r\n\t\t$this->autoencodeFormat += 0xFFFF;\r\n\t}",
"function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}",
"abstract public function convert_to_html();",
"public function html();",
"function formathtml($text){\n $text=stripslashes($text);\n $text=str_replace(\"\\r\\n\",\"<BR>\\n\",$text);\n $text=str_replace(\"\\n\",\"<BR>\\n\",$text);\n //$text=\"<html><body>\".$text.\"</body></html>\";\nreturn $text;\n}",
"function esc($str) {\n return htmlEnt($str);\n}",
"public function escape($text, $flags = ENT_COMPAT, $charset = null, $doubleEncode = true);",
"function escape($value) {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n}",
"public function wrap_HTML_with_HTML_tags()\n\t{\n\t\t$this->HTML = '<html><body>'.$this->HTML.'</body></html>';\n\t}",
"function h($value){\n return htmlspecialchars($value, ENT_QUOTES);\n }",
"public function escape($data)\n {\n }",
"public function getHtml()\n {\n $html = '';\n foreach ($this->entries as $entry) {\n if ($entry == '') {\n $html .= '<br>';\n } else {\n list($msg, $style) = $entry;\n $msg = htmlspecialchars($msg);\n if ($style == 'bold') {\n $html .= '<b>' . $msg . '</b>';\n } elseif ($style == 'italic') {\n $html .= '<i>' . $msg . '</i>';\n } else {\n $html .= $msg;\n }\n }\n }\n return $html;\n }",
"protected function printOpenHtml()\n {\n echo '<HTML>';\n }",
"function esc($value)\n{\n return htmlentities($value);\n}",
"protected function safeToHtml($data) \n {\n if (get_magic_quotes_gpc()) {\n $data = stripslashes($data);\n }\n\n return htmlspecialchars($data);\n }",
"public function escape($content = NULL)\n\t{\n\t\treturn htmlentities($content, ENT_COMPAT, $this->_mail->getMail()->getCharset());\n\t}",
"function tohtml($strValue)\n{\n return htmlspecialchars($strValue);\n}",
"public static function escapeForDisplay($input) {\r\n if (get_magic_quotes_gpc()) {\r\n $input = stripslashes($input);\r\n }\r\n $result = htmlspecialchars($input, ENT_QUOTES);\r\n return $result;\r\n }",
"abstract protected function _escape($s);",
"function _twig_escape_html_attr_callback($matches)\n{\n /*\n * While HTML supports far more named entities, the lowest common denominator\n * has become HTML5's XML Serialisation which is restricted to the those named\n * entities that XML supports. Using HTML entities would result in this error:\n * XML Parsing Error: undefined entity\n */\n static $entityMap = array(\n 34 => 'quot', /* quotation mark */\n 38 => 'amp', /* ampersand */\n 60 => 'lt', /* less-than sign */\n 62 => 'gt', /* greater-than sign */\n );\n $chr = $matches[0];\n $ord = ord($chr);\n /**\n * The following replaces characters undefined in HTML with the\n * hex entity for the Unicode replacement character.\n */\n if (($ord <= 0x1f && $chr != \"\\t\" && $chr != \"\\n\" && $chr != \"\\r\") || ($ord >= 0x7f && $ord <= 0x9f)) {\n return '�';\n }\n /**\n * Check if the current character to escape has a name entity we should\n * replace it with while grabbing the hex value of the character.\n */\n if (strlen($chr) == 1) {\n $hex = strtoupper(substr('00'.bin2hex($chr), -2));\n } else {\n $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');\n $hex = strtoupper(substr('0000'.bin2hex($chr), -4));\n }\n $int = hexdec($hex);\n if (array_key_exists($int, $entityMap)) {\n return sprintf('&%s;', $entityMap[$int]);\n }\n /**\n * Per OWASP recommendations, we'll use hex entities for any other\n * characters where a named entity does not exist.\n */\n return sprintf('&#x%s;', $hex);\n}",
"function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}",
"function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}",
"function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}",
"function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}",
"function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}",
"public abstract function html(): string;",
"public static function html($string) {\n return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n }",
"public static function escape($som) {}",
"function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }",
"public function render_html() {\n global $USER;\n $courseid = \\mod_customcert\\element_helper::get_courseid($this->get_id());\n $content = $this->get_decoded_data()->content;\n $text = format_text($content, FORMAT_HTML, ['context' => \\context_course::instance($courseid)]);\n\n return \\mod_customcert\\element_helper::render_html_content($this, $this->render_table($text, $USER, true));\n }",
"function esc_attr($value) {\n return htmlspecialchars($value, ENT_QUOTES);\n }",
"function write_html()\n {\n echo\n \"\\n<div class=ref-header>\\n\\n\",\n \"<p><b><font size=\\\"+1\\\">$this->title</font></b></p>\\n\",\n \"<p>$this->author</p>\\n\",\n \"<p>$this->year</p>\\n\";\n if ($this->html) {\n print \"\\n<p>\\n\";\n echo \"$this->html\\n\\n\";\n }\n // keywords\n echo \"<p>[ $this->keywords ]</p>\\n\";\n // bibtex popup and link to file\n $this->write_bibtex_popup_javascript_code();\n echo\n \"<p>\\n\",\n \" [ <a href=\\\"javascript:void(0)\\\" onclick=\\\"show_bibtex()\\\">bibtex</a> | \\n\",\n \" file ]\\n\",\n \"</p>\\n\";\n echo \"\\n</div>\\n\\n\";\n // inline bibtex\n $this->write_bibtex();\n // print notes\n foreach ($this->notes as $note) {\n print \"\\n<p>\\n\";\n $note->write_html();\n }\n // edit form\n print \"\\n<p>\\n\\n\";\n echo \"<form method=GET action=edit-reference.php>\\n\";\n echo \"<input type=hidden name=id value=$this->id>\\n\";\n echo \"<input type=submit value=Edit>\\n\";\n echo \"</form>\\n\";\n }",
"protected function toHtml($value) {\r\n\t\treturn $value === null ? '' : \\htmlspecialchars($value, \\ENT_QUOTES, 'UTF-8');\r\n\t}",
"function formatHTML($s) {\n return str_replace('\\n',\"\\n\",$s);\n}",
"function formatHTML($s) {\n return str_replace('\\n',\"\\n\",$s);\n}",
"public abstract function escape($string);",
"function encode_html($str)\r\n\t{\r\n\t\t$_POST[$this->_current_field] = htmlspecialchars($str, ENT_COMPAT, \"UTF-8\");\r\n\t}",
"public function escape(mixed $value): string\n {\n return htmlspecialchars($value, ENT_QUOTES);\n }",
"function h($text){\n\treturn htmlspecialchars($text, ENT_QUOTES, Yii::app()->charset);\n}",
"function encode_special_characters(string $html, bool $double_encoding = true, ?string $encoding = null): string\n{\n $encoding = Internal\\internal_encoding($encoding);\n\n return htmlspecialchars($html, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE, $encoding, $double_encoding);\n}",
"public function getCompiledHtml();",
"protected function surround($html)\r\n\t{\r\n\t\t//on utilise des accolades pour mettre une propriete entre crochet\r\n\t\treturn \"<{$this->tag}>{$html}</{$this->tag}>\";\r\n\t}",
"function h($text) {\r\n echo(htmlspecialchars($text, ENT_QUOTES));\r\n }",
"public function toHtml()\n\t{\n\t\treturn $this->to(self::RENDER_HTML);\n\t}",
"public function _escape($data)\n {\n }",
"public static function encodeHtml($string)\n\t{\n\t\treturn htmlspecialchars($string, ENT_QUOTES, static::$defaultCharset);\n\t}",
"function escape($str) {\n return htmlspecialchars($str, ENT_QUOTES);\n}",
"function htmlout($text)\n{\n\techo html($text);\n}",
"static public function esc($txt) {\n return htmlspecialchars($txt);\n }",
"public static function escape($s) {}",
"function escape($v, $html = FALSE) {\n\tglobal $cfg;\n\n\t// Handle arrays recursively\n\tif (is_array($v)) {\n\t\tforeach ($v AS $k => $aval) {\n\t\t\t$v[$k] = escape($aval, $html);\n\t\t}\n\n\t\treturn $v;\n\t}\n\n\treturn tw_isloaded('sql') && !$html\n\t\t\t? mysqli_real_escape_string($cfg['sql']['con'], $v)\n\t\t\t: htmlspecialchars($v, ENT_QUOTES, 'UTF-8');\n}",
"function html($text) {\n\t\t// Sanitizing html text\n\t\t$text = Sanitize::html($text);\n\t\t// Adding <br />\n\t\t$text = nl2br($text);\n\t\t// Transform http:// into links\n\t\t$text = $this->convertLinks($text);\n\n\t\treturn $text;\n\t}",
"abstract public function generateHtml();",
"protected function surround($html){\n return \"<{$this->surround}>{$html}</{$this->surround}>\";\n }",
"public function escape($string);",
"public function escape($string);",
"function doHtmlSpecChars() {\n $this->description = htmlspecialchars($this->description);\n $this->postsHeader = htmlspecialchars($this->postsHeader);\n $this->postBody = htmlspecialchars($this->postBody);\n $this->postsFooter = htmlspecialchars($this->postsFooter);\n $this->formLogged = htmlspecialchars($this->formLogged);\n $this->form = htmlspecialchars($this->form);\n $this->navigation = htmlspecialchars($this->navigation);\n $this->name = htmlspecialchars($this->name);\n $this->nameLin = htmlspecialchars($this->nameLin);\n $this->memberName = htmlspecialchars($this->memberName);\n $this->date = htmlspecialchars($this->date);\n $this->time = htmlspecialchars($this->time); \n $this->nextPage = htmlspecialchars($this->nextPage);\n $this->previousPage =htmlspecialchars($this->previousPage);\n $this->firstPage = htmlspecialchars($this->firstPage);\n $this->lastPage = htmlspecialchars($this->lastPage);\n\t$this->gravDefault = htmlspecialchars($this->gravDefault);\n }"
] | [
"0.7599932",
"0.7566792",
"0.7518149",
"0.7114036",
"0.7030297",
"0.70085686",
"0.6928343",
"0.6913884",
"0.68620974",
"0.6840841",
"0.6694448",
"0.66618204",
"0.6648232",
"0.66341335",
"0.66086787",
"0.66071266",
"0.6585318",
"0.6581215",
"0.6574279",
"0.65725774",
"0.65547496",
"0.6526111",
"0.6517443",
"0.64954454",
"0.64914244",
"0.64660895",
"0.646593",
"0.64644754",
"0.6422366",
"0.6416386",
"0.6413821",
"0.6409452",
"0.6405146",
"0.6377423",
"0.6377292",
"0.6372094",
"0.6369931",
"0.63662696",
"0.63662696",
"0.63622665",
"0.6361891",
"0.6360165",
"0.6347391",
"0.6315987",
"0.63009256",
"0.6293243",
"0.6293016",
"0.62820715",
"0.6273778",
"0.62407756",
"0.6216391",
"0.6211834",
"0.6208283",
"0.61823374",
"0.6182281",
"0.61718667",
"0.6164986",
"0.61643267",
"0.6160354",
"0.61601895",
"0.6151611",
"0.6136984",
"0.6131258",
"0.61267626",
"0.6126596",
"0.6126596",
"0.6120336",
"0.6111765",
"0.6105303",
"0.61031276",
"0.61003894",
"0.6072726",
"0.6071676",
"0.60591424",
"0.6059071",
"0.6048779",
"0.604728",
"0.604728",
"0.60413134",
"0.6040434",
"0.6034908",
"0.60334545",
"0.6025493",
"0.6021851",
"0.6014948",
"0.60115117",
"0.599786",
"0.59971637",
"0.5995869",
"0.5991972",
"0.59911364",
"0.59903795",
"0.5987005",
"0.5983682",
"0.5969955",
"0.59690875",
"0.5965762",
"0.59635305",
"0.59635305",
"0.59608626"
] | 0.7069538 | 4 |
/ Plugin Name: Ajax page load Plugin URI: Description: Ajax the world, yolo! Version: 0.0.1 Author: Cesare Cocito Author URI: License: GPL2 License URI: Domain Path: /languages Text Domain: ajpl | function asdotrack_skin_scripts() {
wp_register_script('ajpl-ajax', plugin_dir_url(__FILE__) . 'js/ajax.js', array( 'jquery' ) );
wp_localize_script( 'ajpl-ajax', 'ajpl', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'ajplNonce' => wp_create_nonce( 'ajpl-nonce' ),
//'before' => false,
'after' => false
)
);
wp_enqueue_script('ajpl-ajax', false, array(), false, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loading_page_admin_init(){\n load_plugin_textdomain( LOADING_PAGE_TD, false, LOADING_PAGE_PLUGIN_DIR . '/languages/' );\n\n // Set plugin links\n $plugin = plugin_basename(__FILE__);\n add_filter('plugin_action_links_'.$plugin, 'loading_page_links');\n\n // Load resources\n add_action('admin_enqueue_scripts', 'loading_page_admin_resources');\n\n }",
"function wp_ajax_install_plugin()\n {\n }",
"function wp_ajax_update_plugin()\n {\n }",
"public function plugins_loadedWPaction() {\n\t\tload_plugin_textdomain ( get_class ( $this ), false, dirname ( plugin_basename ( $this->application()->filename ) ) . \"/languages/\" );\n\t\twp_enqueue_style ( 'jquery-ui_smoothness', $this->application ()->pluginuri () . '/library/public/css/smoothness/jquery-ui-1.8.13.custom.css', null, $this->application ()->version () );\n\t\twp_enqueue_style ( 'v35v_style_css', $this->application ()->pluginuri () . '/library/public/css/style.css', null, $this->application ()->version () );\n\t\twp_enqueue_script ( 'v35v_script_js', $this->application ()->pluginuri () . '/library/public/js/script.js', null, $this->application ()->version () );\n\t}",
"function add_ajax_file(){\n\twp_enqueue_script('eg-portfolio',plugins_url('/js/ajax.js',__FILE__),array('jquery'),'1.1.0', true);\n\twp_localize_script('eg-portfolio','my_ajax_url',array(\n\t\t'ajax_url' => admin_url('admin-ajax.php',__FILE__)\n\t));\n}",
"function admin_page_load() {\n\t\t$this->jetpack->admin_page_load();\n\t}",
"function CPWP_load_static()\n{\n\n wp_enqueue_style('bootstrap-css', 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css');\n wp_enqueue_script('bootstrap-js', 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js', 'jQuery');\n wp_enqueue_style('CPCSS', CPWP_PLUGIN_DIR_URL . 'assets/css/cyberpanel.css');\n wp_enqueue_script('CPJS', CPWP_PLUGIN_DIR_URL . 'assets/js/cyberpanel.js', 'jQuery');\n\n $title_nonce = wp_create_nonce('CPWP');\n\n wp_localize_script('CPJS', 'CPWP', array(\n 'ajax_url' => admin_url('admin-ajax.php'),\n 'nonce' => $title_nonce,\n ));\n}",
"protected function _Load_AJAX() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/ajax');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_ajax_init',$this);\r\n }",
"function qpi_load() {\n\tadd_action( 'wp_ajax_qpi-install-plugin', 'qpi_install_plugin' );\n\tadd_action( 'wp_ajax_qpi-activate', 'qpi_activate_plugin' );\n\n\tadd_action( 'admin_enqueue_scripts', 'qpi_admin_enqueue_scripts' );\n}",
"function b_script_enqueuer() \n{\n wp_register_script('tf_our_people', plugin_dir_url(__FILE__).'tf_our_people.js', array('jquery'));\n\n // localize the script to your domain name, so that you can reference the url to admin-ajax.php file easily\n wp_localize_script('tf_our_people', 'myAjax', array('ajaxurl' => admin_url('admin-ajax.php')));\n\n // enqueue jQuery library and the script you registered above\n wp_enqueue_script('jquery');\n wp_enqueue_script('tf_our_people');\n}",
"static function AjaxAutoload()\r\n\t{\r\n\t\t\r\n\t}",
"function wp_ajax_edit_theme_plugin_file()\n {\n }",
"function CPWP_load_static_frontend()\n{\n\n wp_enqueue_style('CPCSSFE', CPWP_PLUGIN_DIR_URL . 'assets/css/cyberpanel-frontend.css');\n wp_enqueue_script('CPJSFE', CPWP_PLUGIN_DIR_URL . 'assets/js/cyberpanel-frontend.js', array('jquery'));\n\n $title_nonce = wp_create_nonce('CPWP');\n\n wp_localize_script('CPJSFE', 'CPWP', array(\n 'ajax_url' => admin_url('admin-ajax.php'),\n 'nonce' => $title_nonce,\n ));\n}",
"function custom_print_script(){\r\r\n\r\r\n ?>\r\r\n\r\r\n <script>\r\r\n var siteUrl = '<?php echo site_url(); ?>';\r\r\n //ajaxUrl = '<?php echo admin_url('admin-ajax.php'); ?>';\r\r\n var templateDirRootUrl = '<?php echo site_url(); ?>/wp-content/plugins/oel-cmp/templates/';\r\r\n var pluginsDirUr = '<?php echo site_url(); ?>/wp-content/plugins/oel-cmp';\r\r\n </script>\r\r\n <?php\r\r\n\r\r\n}",
"function plugin_loading_options_page() {\r\n\t\twp_enqueue_script('common');\r\n\t\twp_enqueue_script('wp-lists');\r\n\t\twp_enqueue_script('postbox');\r\n\t}",
"function yomee_assets() {\n\twp_enqueue_script( 'main', get_template_directory_uri() . '/assets/js/main.js',false,'1.1','all');\n\twp_localize_script( 'main', 'wpInfos',\n\tarray( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );\n}",
"public function plugins_page() {\n\t\t$this->init_i18n_support();\n\t\t// add additional links on Plugins page\n\t\tadd_filter( 'plugin_action_links_' . IGGOGRID_BASENAME, array( $this, 'add_plugin_action_links' ) );\n\t\tadd_filter( 'plugin_row_meta', array( $this, 'add_plugin_row_meta' ), 10, 2 );\n\t}",
"function load_my_plugin_scripts($hook) {\n if ($hook != 'toplevel_page_webnotik-real-estate') { \n return; \n } \n // Load style & scripts. \n wp_enqueue_style('re-webnotik'); \n wp_enqueue_script('re-webnotik'); \n}",
"function wp_ajax_search_plugins()\n {\n }",
"function wp_ajax_update_welcome_panel()\n {\n }",
"function ajx_plugin_menu() {\r\n\t\t\r\n\t\tadd_options_page( 'Ajaxify Plugin Options', 'Ajaxify', 'manage_options', 'aj-id', 'ajaxify_options' );\r\n\t}",
"function br_allocator() {\n readfile(plugins_url(\"allocator-content.php\", __FILE__));\n\n}",
"static function init(){\n\t\t\t\tadd_action('wp_ajax_gdlr_core_get_pb_template', 'gdlr_core_page_builder_template::get_template');\n\t\t\t}",
"function _manually_load_plugin() {\n\trequire dirname( dirname( __FILE__ ) ) . '/news-parser.php';\n\t\n\n}",
"function saleforce_scripts_plug() {\n if (is_admin()) {\n wp_register_script('backcallscc', plugins_url('js/cussaleforce.js', __FILE__), array('jquery'));\n \n wp_enqueue_script('backcallscc');\n \n $file_for_jav = admin_url('admin-ajax.php');\n $tran_arr = array('jaxfile' => $file_for_jav);\n wp_localize_script('backcallscc', 'fromphp', $tran_arr);\n }\n}",
"function WPLMS_plugin_init()\n{\n // Load translation support\n $domain = 'wp_lms'; // This is the translation locale.\n\n // Check the WordPress language directory for /wp-content/languages/wp_lms/wp_lms-en_US.mo first\n $locale = apply_filters('plugin_locale', get_locale(), $domain);\n load_textdomain($domain, WP_LANG_DIR . '/wp_lms/' . $domain . '-' . $locale . '.mo');\n\n // Then load the plugin version\n load_plugin_textdomain($domain, FALSE, dirname(plugin_basename(__FILE__)) . '/language/');\n\n // Run setup\n WPLMS_plugin_setup(false);\n\n // ### Admin\n if (is_admin()) {\n // Menus\n add_action('admin_menu', 'WPLMS_menu_MainMenu');\n add_action('admin_menu', 'WPLMS_excludeFromMenu');\n }else{\n\n }\n\n //Admin Scripts\n add_action('admin_enqueue_scripts', 'WPLMS_adminScripts');\n\n //AJAX calls\n add_action('wp_ajax_add_new_user_course', 'WPLMS_add_new_user_course');\n\n //ShortCodes\n add_shortcode('lms_course_info', 'WPLMS_courseInfo');\n add_shortcode('lms_choose_product', 'WPLMS_chooseProduct');\n add_shortcode('lms_shopping_cart', 'WPLMS_shoppingCart');\n add_shortcode('lms_checkout', 'WPLMS_checkout');\n add_shortcode('lms_lessons', 'WPLMS_lessons');\n add_shortcode('lms_mycourses', 'WPLMS_mycourses');\n\tadd_shortcode('lms_quiz', 'WPLMS_quiz');\n\n\n\t//add_shortcode('process_product_page', 'process_product_page_shortcode');\n}",
"function wpsl_get_ajax_url() {\n\n $i18n = new WPSL_i18n();\n\n $param = '';\n\n if ( $i18n->wpml_exists() && defined( 'ICL_LANGUAGE_CODE' ) ) {\n $param = '?lang=' . ICL_LANGUAGE_CODE;\n }\n\n $ajax_url = admin_url( 'admin-ajax.php' . $param );\n\n return $ajax_url;\n}",
"function gsCustomPageExtensions() {\r\n /* Load Langauge Files */\r\n $langDir = dirname(plugin_basename(__FILE__)) . '/lang';\r\n load_plugin_textdomain('custom-page-extensions', false, $langDir, $langDir);\r\n\r\n /* Set the plugin name to use the selected language. */\r\n $this->pluginName = __('Custom Page Extensions', 'custom-page-extensions');\r\n\r\n global $wp_rewrite;\r\n\r\n /* Plugin paths */\r\n $this->pluginPath = WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__));\r\n $this->pluginURL = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__));\r\n\r\n // Get the extension.\r\n $this->load_settings();\r\n\r\n /* Add Options Pages and Links */\r\n add_action('admin_menu', array(&$this, 'admin_menu'));\r\n add_action('admin_init', array(&$this, 'admin_init'));\r\n add_action('update_option_' . $this->optionsName, array(&$this, 'update_option'), 10);\r\n add_action('wp_loaded', array(&$this, 'flush_rules'));\r\n\r\n add_filter('plugin_action_links', array(&$this, \"plugin_action_links\"), 10, 2);\r\n add_filter('user_trailingslashit', array(&$this, 'no_page_slash'), 66, 2);\r\n }",
"function sport_core_plugin_load_to_back() {\r\n\r\n\t\t//scripts (js)\r\n\t\twp_enqueue_script('jquery');\r\n\t\twp_enqueue_script('jquery-ui', false, array(), false, false);\r\n\t\twp_enqueue_script('jquery-ui-sortable', false, array(), false, true);\r\n\t\twp_enqueue_script('thickbox', false, array(), false, true);\t\t\t\t\t\r\n\t\twp_enqueue_script('media-upload', false, array(), false, true);\r\n\t\t// wp_enqueue_script('canon_colorpicker', get_template_directory_uri() . '/js/colorpicker.js', array(), false, true);\r\n\t\twp_enqueue_script('sport_core_plugin_backend_scripts', plugins_url('', __FILE__ ) . '/js/backend_scripts.js', array(), false, true);\r\n\r\n\t\t//style (css)\t\r\n\t\twp_enqueue_style('sport_core_plugin_style', plugins_url('', __FILE__ ) . '/css/style.css');\r\n\r\n\t}",
"function inject_js() {\nglobal $wp;\n$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );\nif($current_url == 'url zeljene stranice stranice'){\n\techo '<script src=\"'. esc_url( plugins_url( __FILE__ ) ).'/imeJSfajlaGdeSeNalazi.js\"></script>';\n \t }\n}",
"function managePollsPage() {\n include(plugin_dir_path(__FILE__) . '/add-poll.php');\n}",
"function wp_ajax_search_install_plugins()\n {\n }",
"public function wplt_ajax_response(){\n global $sitepress;\n $sitepress->switch_lang('all');\n }",
"function so_enqueue_scripts(){\r\n wp_register_script('jquery3','https://code.jquery.com/jquery-3.3.1.js');\r\n wp_enqueue_script( 'jquery3');\r\n wp_register_script(\r\n 'ajaxHandle',\r\n '/wp-content/plugins/refresh-plugin/js/refresh-plugin.js',\r\n array(),\r\n false,\r\n true\r\n );\r\n wp_enqueue_script( 'ajaxHandle' );\r\n wp_localize_script(\r\n 'ajaxHandle',\r\n 'ajax_object',\r\n array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'pluginurl' => plugin_dir_url( __FILE__ ) )\r\n );\r\n}",
"public function load_php_files()\n {\n // Load Template function\n require_once self::$plugin_path . '/template-function.php';\n\n /**\n * Load Custom UI Ajax Loading Component\n *\n * 1) Overhang.js | https://paulkr.github.io/overhang.js/\n * 2) PlaceHolder Loading | https://github.com/zalog/placeholder-loading\n * 3) Jquery Confirm | https://craftpip.github.io/jquery-confirm/\n * 4) Box Cover Modal\n */\n if (apply_filters('rewrite_api_request_ui_component', true) === true) {\n require_once self::$plugin_path . '/ui-component.php';\n }\n }",
"function sv_plugin_admin_page() {\n\t// http://justintadlock.com/archives/2011/07/12/how-to-load-javascript-in-the-wordpress-admin\n\t// Thanks, Justin.\n\t$hook = add_options_page( 'Source View Options', __('Source View','source-view'), 'manage_options', 'source-view', 'sv_plugin_options' );\n\tadd_action('admin_print_scripts-'.$hook, 'sv_load_script',10);\n\tadd_action('admin_footer-'.$hook, 'sv_load_script_footer',11);\n\tadd_action('admin_print_styles-'.$hook, 'sv_load_style',10);\n}",
"function add_ind_script($plugins) {\n\t$dir_name = '/wp-content/plugins/indizar';\n\t$url=get_bloginfo('wpurl');\n\t$pluginURL = $url.$dir_name.'/tinymce/editor_plugin.js?ver='.INDIZAR_HEADER_V;\n\t$plugins['Indizar'] = $pluginURL;\n\treturn $plugins;\n}",
"function load_transfer_plugin_scripts( $hook ) {\n // if( $hook != 'toplevel_page_get-user' ) {\n \n // return;\n \n // }\n\n // Load style & scripts.\n wp_enqueue_style( 'getUser-css-plugin' );\n wp_enqueue_style( 'bootstrap-plugin' );\n \n wp_enqueue_script( 'my-plugin' );\n \n}",
"function _manually_load_plugin() {\n\trequire dirname( dirname( __FILE__ ) ) . '/tyk_dev_portal.php';\n}",
"function slider_backend_enqueue_script($hook) {\r\n wp_enqueue_script ('jquery-ui-sortable');\r\n wp_enqueue_script ('slideshow-admin-script', plugins_url( '_inc/admin-script.js', __FILE__ ),array(\"jquery\")); \r\n\r\n wp_localize_script( 'slideshow-admin-script', 'admin_ajax_object',\r\n array( \r\n 'ajaxurl' => admin_url( 'admin-ajax.php' )\r\n )\r\n );\r\n}",
"function admin_enqueue_scripts($hook) {\n if( \"toplevel_page_wp-plugin-sample\" == $hook ){\n wp_enqueue_script('wp-plugin-sample-email-search', plugins_url(\"js/ajax-email-search.js\", __FILE__), array('jquery'), '20160627');\n }\n }",
"function script_enqueuer() {\n wp_register_script( \"vote_display\", plugin_dir_url(__FILE__).'vote_display.js', array('jquery') );\n\n // localize the script to your domain name, so that you can reference the url to admin-ajax.php file easily\n wp_localize_script( 'vote_display', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' )));\n\n // enqueue jQuery library and the script you registered above\n wp_enqueue_script( 'jquery' );\n wp_enqueue_script( 'vote_display' );\n}",
"function ozh_yourls_gsb_add_page() {\n\tyourls_register_plugin_page( 'ozh_yourls_gsb', 'Recherche sûre par Google', 'ozh_yourls_gsb_admin_page' );\n \n if( ! yourls_get_option( 'ozh_yourls_gsb' ) ) {\n ozh_yourls_gsb_please_configure();\n }\n}",
"function admin_load()\n {\n }",
"function wpbm_plugin_text_domain(){\n load_plugin_textdomain( 'wp-blog-manager', false, basename( dirname( __FILE__ ) ) . '/languages/' );\n }",
"public function setup_plugin_url()\n {\n }",
"function admin_load() {\n\n\t}",
"public function update_monitor_page() {\n //$plugins = json_encode(get_plugins(), JSON_PRETTY_PRINT);\n $plugins = print_r(get_plugins(), true);\n require_once plugin_dir_path(__FILE__)\n . 'partials/update-monitor-admin-display.php';\n }",
"function dk_speakup_loadimporter(){\n\t\tif(function_exists('dk_speakup_meta_links')){\n\t\t\tload_plugin_textdomain( 'speakupimport', false, 'speakup-email-petitions-importer/languages' );\n\t\t\tinclude_once( dirname( __FILE__ ) . '/class.importer.php' );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( 'dk_Speakup_Import', 'scripts'));\n\t\t\t\n\t\t\tadd_action('admin_menu', array( 'dk_Speakup_Import', 'menu'),1000);\n\t\t}\n\t}",
"function wp_dashboard_plugins()\n {\n }",
"function theme_register_scripts() {\n wp_register_script('pavi_load_post', PAVI_PLUGIN_ASSETS_URL . '/js/load-post.js', array('jquery') );\n\n /** Localize Scripts */\n wp_localize_script( 'pavi_load_post', 'php_array', array( 'admin_ajax' => admin_url( 'admin-ajax.php' ) ) );\n}",
"function level_ajax_enqueue() {\n\twp_enqueue_script(\n\t\t'level-ajax-script', get_template_directory_uri() . '/js/feedback_level.js',array('jquery'));\n\n// The wp_localize_script allows us to output the ajax_url path for our script to use.\n\twp_localize_script('level-ajax-script','level_ajax_obj',array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ));\n}",
"public function plugin_page() {\n\t\tinclude 'admin-approval.php';\n\t}",
"function loadPlugins() {\r\n\t\tforeach ($this->modx->ms2Plugins->plugins as $plugin) {\r\n\t\t\tif (!empty($plugin['manager']['msProductData'])) {\r\n\t\t\t\t$this->addJavascript($plugin['manager']['msProductData']);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function loaded() {\n\t\tload_plugin_textdomain( GOG_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) );\n\t}",
"function au_load_frontpage() {\n\n}",
"function escalate_network_admin_ajax_callback() { include($this->plugin_basename . '/core/admin/ajax/admin-ajax.php'); die(); }",
"function print_gather_ua_jobs_tools_page() {\n\n\t// Include the file\n\trequire plugin_dir_path( __FILE__ ) . 'includes/display-gather-ua-jobs-tools-page.php';\n\n}",
"function WPLMS_dashboard(){\n require_once WPLMS_PLUGIN_PATH . \"/pages/admin/dashboard_page.php\";\n}",
"function wp_smpro_script() {\r\n\t?>\r\n\t<script type=\"text/javascript\">\r\n\t\tfunction wp_smpro_activate_plugin(action, smpro_nonce) {\r\n\t\t\tjQuery('.smushit-pro-status').removeClass('error');\r\n\t\t\tjQuery('.smushit-pro-status').addClass('updated');\r\n\t\t\tjQuery('.smushit-pro-status p').html('<strong>Smushit Pro:</strong> Activating WPMU DEV Dashboard...');\r\n\t\t\tvar param = {\r\n\t\t\t\taction: action,\r\n\t\t\t\t_ajax_nonce: smpro_nonce\r\n\t\t\t};\r\n\t\t\tjQuery.post(ajaxurl, param, function (data) {\r\n//\t\t\t\tdata = jQuery.parseJSON( data );\r\n\t\t\t\tif (data.success == true) {\r\n\t\t\t\t\tjQuery('.smushit-pro-status p').html('<strong>Smushit Pro:</strong> WPMU DEV Dashbaord activated.');\r\n\t\t\t\t\tlocation.reload();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tjQuery('.smushit-pro-status p').html('<strong>Smushit Pro:</strong> There is some problem. Please try again.');\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t}\r\n\t</script><?php\r\n}",
"function training_ajax_callback_text() {\n drupal_add_js(drupal_get_path('module', 'training') . '/js/training.js');\n $commands = array();\n $commands[] = array(\n 'command' => 'reload',\n 'some_param' => rand(2, 4),\n );\n print ajax_render($commands);\n exit;\n}",
"abstract public function LowAjax();",
"function ob_add_amazon_script() {\n\twp_enqueue_script('amazon_get_links', plugins_url( 'amazon_get_links.js', __FILE__ ), array( 'jquery' ), false, true );\n\twp_localize_script( 'amazon_get_links', 'ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );\n}",
"static function wck_fep_print_ajax_url() {\n\t\t/* ajax url for frontend */\n\t\techo '<script type=\"text/javascript\">var wckAjaxurl = \"'. admin_url('admin-ajax.php') .'\";</script>';\n\t}",
"public function arvan_wp_enqueue_scripts(){\n \n wp_register_script('arvan-plugin-custom-script', plugin_dir_url(__FILE__) . '/js/custom.js', array('jquery'));\n wp_localize_script( 'arvan-plugin-custom-script', 'WPData', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ))); \n wp_enqueue_script( 'arvan-plugin-custom-script');\n \n\n }",
"function fast_plugin_header_prive($flux){\r\n\t$page = get_fast_plugin();\r\n\t$exec = $_GET[\"exec\"];\r\n\t\r\n\tif (autoriser('acces','fast_plugin',$exec)) {\r\n\t\t$plugin = $page[$exec][\"plugin\"];\r\n\t\t\r\n\t\tif (file_exists(\"../plugins/$plugin/js/$exec.js\"))\t$flux .=\"<script type='text/javascript' src='../plugins/$plugin/js/$exec.js'></script>\";\r\n\t\tif (file_exists(\"../plugins/$plugin/css/$exec.css\"))$flux .=\"<link type='text/css' rel='stylesheet' href='../plugins/$plugin/css/$exec.css' />\";\r\n\t\t\r\n\t\t/* ajout des css / jss */\r\n\t\tif ($page[$exec][\"addCss\"]){\r\n\t\t\t$a = explode(\",\",$page[$exec][\"addCss\"]);\r\n\t\t\tfor ($i = 0; $i < count($a); $i++) {\r\n\t\t\t\t$file = $a[$i];\r\n\t\t\t\tif (file_exists($file))$flux .=\"<link type='text/css' rel='stylesheet' href='$file' />\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\tif ($page[$exec][\"addJS\"]){\r\n\t\t\t$a = explode(\",\",$page[$exec][\"addJS\"]);\r\n\t\t\tfor ($i = 0; $i < count($a); $i++) {\r\n\t\t\t\t$file = $a[$i];\r\n\t\t\t\tif (file_exists($file)) $flux .=\"<script type='text/javascript' src='$file'></script>\";;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\treturn $flux;\r\n}",
"function add_plugins_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"function wpscLoadInit() {\r\n load_plugin_textdomain('wpsc-support-tickets', false, '/wpsc-support-tickets/languages/');\r\n\r\n wp_enqueue_script('wpsc-support-tickets', plugins_url() . '/wpsc-support-tickets/js/wpsc-support-tickets.js', array('jquery'));\r\n $wpscst_params = array(\r\n 'wpscstPluginsUrl' => plugins_url(),\r\n 'wpscstAjaxUrl' => admin_url('admin-ajax.php'),\r\n );\r\n wp_localize_script('wpsc-support-tickets', 'wpscstScriptParams', $wpscst_params);\r\n}",
"function the_champ_admin_sharing_scripts(){\r\n\t?>\r\n\t<script type=\"text/javascript\"> var theChampSharingAjaxUrl = '<?php echo get_admin_url() ?>admin-ajax.php';</script>\r\n\t<?php\r\n\twp_enqueue_script('the_champ_sharing', plugins_url('js/admin/sharing/admin.js', __FILE__), array('jquery', 'jquery-ui-sortable'), THE_CHAMP_SS_VERSION);\r\n}",
"function lang() {\r\n\t\t\tload_plugin_textdomain( 'rv-portfolio', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\r\n\t\t}",
"private function pageGetPlugins() {\n\t\techo \"<reply action=\\\"ok\\\">\\n\";\r\n\t\t\r\n\t\t//To get the status of all plugins, they must all be started first.\n\t\t//As a safety measure, check that it's not running at boot.\n\t\t$this->framework->startAllPlugins ( false );\r\n\t\t\r\n\t\t//Print each plugin\n\t\tforeach ( $this->data as $plugin ) {\r\n\t\t\t$plugin_object = $this->framework->getPlugin ( ( string ) $plugin ['name'] );\r\n\t\t\t$status = \"\";\r\n\t\t\tif (isset ( $plugin_object )) {\r\n\t\t\t\t$status = $plugin_object->getStatus ();\r\n\t\t\t} else if (( string ) $plugin ['enabled'] == \"true\") {\r\n\t\t\t\tthrow new Exception('The module '.$plugin['name'].' could not be retrieved');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<plugin status=\\\"{$status}\\\" \";\r\n\t\t\t//also print all other attributes the plugin has.\n\t\t\tforeach ( $plugin->attributes () as $name => $value ) {\r\n\t\t\t\techo \" $name = \\\"$value\\\"\";\r\n\t\t\t}\r\n\t\t\techo \"/>\\n\"; //Closing tag of plugin\n\t\t}\r\n\t\techo \"</reply>\";\r\n\t}",
"function enqueue_script($hook){\n\t\t\t\tif( strpos($hook, 'page_' . $this->settings['slug']) !== false ){\n\t\t\t\t\t\t\n\t\t\t\t\tgdlr_core_include_utility_script();\n\n\t\t\t\t\t// include the admin style\n\t\t\t\t\twp_enqueue_style('font-awesome', GDLR_CORE_URL . '/plugins/font-awesome/css/font-awesome.min.css');\n\t\t\t\t\twp_enqueue_style('gdlr-core-getting-start', GDLR_CORE_URL . '/framework/css/getting-start.css');\n\t\t\t\t\twp_enqueue_style('open-sans-css', 'https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic&subset=latin,latin-ext');\n\t\t\t\t\t\n\t\t\t\t\t// include the admin script\n\t\t\t\t\twp_enqueue_script('gdlr-core-getting-start', GDLR_CORE_URL . '/framework/js/getting-start.js', array('jquery'), false, true);\n\t\t\t\t\twp_localize_script('gdlr-core-getting-start', 'gdlr_core_ajax_message', array(\n\t\t\t\t\t\t'ajaxurl' => GDLR_CORE_AJAX_URL,\n\t\t\t\t\t\t'error_head' => esc_html__('An error occurs', 'goodlayers-core'),\n\t\t\t\t\t\t'error_message' => esc_html__('Please try again. If the problem still persists, please contact administrator for this.', 'goodlayers-core'),\n\t\t\t\t\t\t'nonce' => wp_create_nonce('gdlr_core_demo_import'),\n\n\t\t\t\t\t\t'importing_head' => esc_html__('Importing demo content. Please wait...', 'goodlayers-core'),\n\t\t\t\t\t\t'importing_content' => esc_html__('If you choose to download images from demo site, it can take up to 7-8 minutes so please be patient.', 'goodlayers-core'),\n\t\t\t\t\t));\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}",
"public static function func_ajax_load_menu() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n\t\t\t\t echo self::load_listings();\n\t\t\t\t die();\n\t\t\t\t}\n\t\t\n\t\t}",
"function url_admin_ajax(): string\n{\n return \\admin_url('admin-ajax.php');\n}",
"public function index() {\n\t\t$params = func_get_args();\n\t\t$this->_loadPlugin(...$params);\n\t}",
"function aurum_wp_print_scripts() {\n\t?><script type=\"text/javascript\">\n\tvar ajaxurl = ajaxurl || '<?php echo esc_attr( admin_url( 'admin-ajax.php' ) ); ?>';\n\t</script><?php\n}",
"function wp_ajax_wp_link_ajax()\n {\n }",
"function admin_print_scripts() {\r\n wp_enqueue_script('custom-page-extensions-js');\r\n }",
"function load_plugin_textdomain($domain, $deprecated = \\false, $plugin_rel_path = \\false)\n {\n }",
"public function ajax_includes() {\n\t\tinclude_once( 'includes/class-kopa-ajax.php' );\n\t}",
"function sec_init() {\n\tload_plugin_textdomain(EVNT_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) );\n}",
"function ajax_fetchProviderAPIs()\n{\n\n $cc = new CapabilityCheck('fetchProviderAPIs');\n if (!$cc->checkCapability()) {\n return;\n }\n\n check_ajax_referer('CPWP');\n\n $cpjm = new CPJobManager('fetchProviderAPIs', $_POST);\n $cpjm->RunJob();\n}",
"function add_myjavascript()\n {\n wp_localize_script('ajax-login-script','ajax_login_object',\n array('ajaxurl' => admin_url('admin-ajax.php')));\n }",
"function fuzzloc_load() {\n\n\t/**\n\t * \n\t * Our plugin will attach in three places.\n\t * The first is just prior to storing a local post.\n\t *\n\t */\n\n\tregister_hook('post_local', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_post_hook');\n\n\t/**\n\t *\n\t * Then we'll attach into the plugin settings page, and also the \n\t * settings post hook so that we can create and update\n\t * user preferences.\n\t *\n\t */\n\n\tregister_hook('feature_settings', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings');\n\tregister_hook('feature_settings_post', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings_post');\n\n\tlogger(\"loaded fuzzloc\");\n}",
"function ssSearchPluginsLoadedHandlers() {\n //-- register ajax search shortcode\n add_shortcode( 'wp6_training', array( $this, 'ssSearchShortcodeCreate' ) );\n\n //-- enqueue css and js\n add_action( 'wp_enqueue_scripts', array( $this, 'ssSearchEnqueueScript' ) );\n\n //-- action to call ajax\n add_action( 'wp_ajax_ssSearchHandleAjaxRequest', array( $this, 'ssSearchHandleAjaxRequest' ) );\n \n //-- call ajax on front end\n add_action( 'wp_ajax_ssSearchHandleAjaxRequest', array( $this, 'ssSearchHandleAjaxRequest' ) );\n add_action( 'wp_ajax_nopriv_ssSearchHandleAjaxRequest', array( $this, 'ssSearchHandleAjaxRequest' ) );\n }",
"function register_livereload() {\n wp_register_script( 'livereload', 'http://localhost:35729/livereload.js' );\n \n // Enqueue livereload script\n wp_enqueue_script( 'livereload' );\n\n }",
"static function print_scripts(){\n\t\twp_register_style('athlates-board-white-board', ATHLATESWHITEBOARD_URL . 'css/white-board.css');\n\t\twp_enqueue_style('athlates-board-white-board');\n\t\t\n\t\t//js\n\t\twp_enqueue_script('jquery');\n\t\twp_register_script('athlates_white_board_jquery', ATHLATESWHITEBOARD_URL . 'js/Cf-front-end.js', array('jquery'));\n\t\twp_enqueue_script('athlates_white_board_jquery');\n\t\t\n\t\twp_localize_script('athlates_white_board_jquery', 'AthlatesAjax', array( \n\t\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' )\n\t\t));\n\t}",
"function voyage_mikado_set_ajax_url() {\n echo '<script type=\"application/javascript\">var MikadofAjaxUrl = \"'.admin_url('admin-ajax.php').'\"</script>';\n }",
"function hello_yoda_load(){\n if (current_user_can('activate_plugins')){\n add_action( 'admin_head', 'vader_css' );\n add_action( 'admin_notices', 'hello_yoda' );\n } else{\n add_action( 'admin_head', 'yoda_css' );\n add_action( 'admin_notices', 'hello_yoda' );\n }\n\n }",
"private function load_localization() {\n $plugin_i18n = new PLUGINNAME_i18n($this->getter()->get_translation_slug);\n add_action('plugins_loaded', array($plugin_i18n, 'load_plugin_textdomain'));\n }",
"public function i18n() {\n load_plugin_textdomain( 'elementor-lightx-widgets' );\n }",
"abstract public function HighAjax();",
"function fyxt_hook_javascript() {\n\t\n\t$whitelist = array(\n\t\t\t\t\t\t'127.0.0.1',\n\t\t\t\t\t\t'::1'\n\t\t\t\t\t\t);\n\t\n\tif( !in_array( $_SERVER['REMOTE_ADDR'], $whitelist ) ){\n\t\t// remote\n\t\tif ( is_page( 1772 ) || is_page( 3917 ) || is_page( 7112 ) ) {\n\t\t\t$output = '<script type=\"text/javascript\" src=\"/wp-content/themes/ata-child-files/js/plupload.full.min.js\" charset=\"UTF-8\"></script>\n\t\t\t\t<script type=\"text/javascript\" src=\"/wp-content/themes/ata-child-files/js/jquery.ui.plupload/jquery.ui.plupload.min.js\" charset=\"UTF-8\"></script>\n\t\t\t\t<link type=\"text/css\" rel=\"stylesheet\" href=\"/wp-content/themes/ata-child-files/js/jquery.ui.plupload/css/jquery.ui.plupload.css\" media=\"screen\" />\n\t\t\t\t<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">';\n\t\t}\n\t} else { \n //local\n\t\tif ( is_page( 1772 ) || is_page( 3917 )|| is_page( 3932 ) ) {\n\t\t\t$output = '<script type=\"text/javascript\" src=\"/fyxtrpg.com/wp-content/themes/ata-child-files/js/plupload.full.min.js\" charset=\"UTF-8\"></script>\n\t\t\t\t<script type=\"text/javascript\" src=\"/fyxtrpg.com/wp-content/themes/ata-child-files/js/jquery.ui.plupload/jquery.ui.plupload.min.js\" charset=\"UTF-8\"></script>\n\t\t\t\t<link type=\"text/css\" rel=\"stylesheet\" href=\"/fyxtrpg.com/wp-content/themes/ata-child-files/js/jquery.ui.plupload/css/jquery.ui.plupload.css\" media=\"screen\" />\n\t\t\t\t<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">';\n\t\t}\n\t}\nadd_action('wp_head','fyxt_hook_javascript');\n\n\techo $output;\n}",
"function onLoad(){\r\n\t\t$this->sendMessage(\"テストのプラグインが読み込まれたよ!?\\n[onLoad]っていうイベントの取得だよ!?\");\r\n\t}",
"function wck_print_ajax_url(){\r\n\t\techo '<script type=\"text/javascript\">var wppbWckAjaxurl = \"'. apply_filters( 'wck_ajax_url', admin_url('admin-ajax.php') ) .'\";</script>';\r\n\t}",
"function cil_admin_listOptions_externalFileLoad()\n{\n\t//load javascript specific to this option menu.\n\tglobal $cilPluginURL;\n\n\t//load javascript\n\t//required for the wordpress media upload panel\n\twp_enqueue_script('media-upload');\n\twp_enqueue_script('thickbox');\n\twp_register_script('imageUpload', $cilPluginURL.'/js/imageUpload.js', array('jquery','media-upload','thickbox'));\n\twp_enqueue_script('imageUpload');\n\t//page specific javascript\n\twp_register_script('cil_optionScript', $cilPluginURL.'/js/cil_listOptionMenu.js',array('jquery','jquery-ui-sortable'));\n\twp_enqueue_script('cil_optionScript');\n\n\n\t//load styles\n\twp_enqueue_style('cil_optionStyle', $cilPluginURL.'/css/cil_admin_listOptions.css');\n\twp_enqueue_style('cil_optionHelpStyle', $cilPluginURL.'/css/cil_help_window.css');\n\twp_enqueue_style('thickbox');\n}",
"public function initializePlugin();",
"function localize_plugin()\r\n{\r\n load_plugin_textdomain( 'favicon', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/');\r\n}",
"function WordpressConnect(){\n\n\t\t$this->add_init_hook();\n\n\t}",
"function loadScripts() {\n\t\twp_enqueue_script('jquery');\n\t\twp_enqueue_script('jquery.tmpl', $this->pluginPath . 'js/jquery.tmpl.js');\n\t\twp_enqueue_script('hashee_app', $this->pluginPath . 'js/hashee_app.js');\n?>\n \t\t<script type=\"text/javascript\" src=\"http://maps.googleapis.com/maps/api/js?sensor=false\"></script>\n\t\t<script id=\"hasheeBubbleTemplate\" type=\"text/x-jquery-tmpl\">\n\t\t\t<div class=\"tweet\"><div id=\"${from_user_id}\"><img src=\"${profile_image_url}\" style=\"float:left; margin-right: 5px;\" />${text} by ${from_user}<br><small>${pp_created_on}</small></div></div>\n\t\t</script>\n<?php\n\t}"
] | [
"0.6979065",
"0.65815854",
"0.64389163",
"0.6437674",
"0.6396322",
"0.6391373",
"0.6377355",
"0.6371476",
"0.63523334",
"0.6337274",
"0.6297271",
"0.62650955",
"0.6252879",
"0.624005",
"0.6203887",
"0.6177601",
"0.61650836",
"0.6155671",
"0.6154683",
"0.6151414",
"0.6149632",
"0.6114984",
"0.6100873",
"0.60964704",
"0.6089008",
"0.60847384",
"0.60770303",
"0.6065696",
"0.60644925",
"0.60606366",
"0.60566664",
"0.6028768",
"0.6017824",
"0.60173184",
"0.5977345",
"0.5967809",
"0.59655327",
"0.5964449",
"0.5952765",
"0.59510636",
"0.59394336",
"0.59204733",
"0.5919118",
"0.59176505",
"0.59138715",
"0.59122777",
"0.5904357",
"0.5903042",
"0.5900744",
"0.58919317",
"0.58900106",
"0.58845943",
"0.5880398",
"0.5880369",
"0.58712375",
"0.58665025",
"0.58575267",
"0.5839432",
"0.5839025",
"0.58387935",
"0.5834368",
"0.58335376",
"0.58325773",
"0.5832254",
"0.5824017",
"0.58209294",
"0.58146375",
"0.5811622",
"0.58058",
"0.5802549",
"0.57947487",
"0.57834584",
"0.5781698",
"0.57805127",
"0.57793176",
"0.57737124",
"0.57724863",
"0.57720876",
"0.57711524",
"0.57580453",
"0.5755624",
"0.5751485",
"0.5751366",
"0.5744932",
"0.57297975",
"0.5722371",
"0.57207376",
"0.5717977",
"0.57127744",
"0.5711175",
"0.5710842",
"0.57107705",
"0.5708241",
"0.5702938",
"0.5698511",
"0.56971514",
"0.56967896",
"0.5694314",
"0.5693163",
"0.5693004"
] | 0.63921356 | 5 |
recupera l'id della pagina dal permalink | function load_post_callback() {
if ( isset($_POST['id'] ) ) {
$id = $_POST['id'];
} elseif ($_POST['permalink']){
$id = url_to_postid( $_POST['permalink'] );
} else {
wp_send_json_error('No page requested');
}
if ($id == 0){
wp_send_json_error('No page requested');
}
// recupera il post
$args = array(
'post__in' => array( $id ),
'post_type' => 'any'
);
$the_query = new WP_Query($args);
if($the_query->have_posts()) : while ( $the_query->have_posts() ) : $the_query->the_post();
global $more;
global $post;
$more = 1;
// recupera il nome del template, se impostato, altrimenti
// get_page_template_slug() ritorna stringa vuota...
$template = get_page_template_slug( $post->ID );
$pagename = $post->post_name;
$id = $post->ID;
$type = $post->post_type;
// ...in tal caso ipotizza la gerarchia dei template da usare
// (https://core.trac.wordpress.org/browser/tags/4.4.2/src/wp-includes/template.php#L323)
$templates = array();
if ( $template && 0 === validate_file( $template ) )
$templates[] = $template;
if ( $pagename )
$templates[] = "$type-$pagename.php";
if ( $id )
$templates[] = "$type-$id.php";
$templates[] = "$type.php";
$templates[] = "single.php";
$template_file = get_query_template( $type, $templates );
endwhile; endif;
// inizializza la query
query_posts( $args );
// recupera l'output del template
ob_start();
if (locate_template($templates)){
include($template_file);
} else {
echo 'meh';
}
$var = ob_get_contents();
ob_end_clean();
// recupera quali script sono in queue per la pagina richiesta
global $wp_scripts;
$registered_scripts = (array) $wp_scripts->registered;
// confronta la queue con gli script registrati e estrae la stampa
// del tag <script> per preservare le dipendenze
//
// TODO: check 'in_footer' e 'conditional'
foreach ($wp_scripts->queue as $handle) {
ob_start();
$wp_scripts->print_scripts($handle);
$scripts[] = ob_get_contents();
ob_end_clean();
}
// compone la risposta
$result['permalink'] = get_the_permalink();
$result['title'] = get_the_title();
$result['featured_img'] = wp_get_attachment_image_src( get_post_thumbnail_id() );
$result['template'] = $template_file;
$result['content'] = $var;
$result['scripts'] = $scripts;
$result['id'] = $id;
$result['query'] = $the_query;
$result['post'] = $post;
wp_send_json_success($result);
exit;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPermalinkID($db, $safeButUnescapedPath) {\n $path = $db->doEscapeParam($safeButUnescapedPath);\n $query = \"SELECT * FROM permalinks WHERE path ='$path'\";\n $rows = $db->doQuery($query);\n return (count($rows) === 1) ? $rows[0]['id'] : 0;\n }",
"public function getUrlId();",
"public function getPageId() {}",
"public function getPageId() {}",
"protected function determinePageId() {}",
"protected function determinePageId() {}",
"public function getPermalink();",
"function url_to_postid($url)\n {\n }",
"abstract protected function determinePageId() ;",
"function replacePermalink($link, $id) {\r\n\t\t/*\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $link;\r\n\t\t}\r\n\t\tif (UWR1RESULTS_PAGE_ID_INDEX == $id) {\r\n\t\t\t$link = UWR1RESULTS_URL;\r\n\t\t} else if (UWR1RESULTS_PAGE_ID_PX == substr($id, 0, 2) && strlen($id) == strlen(UWR1RESULTS_PAGE_ID_PX) + 6) {\r\n\t\t\t$twoChars = str_split($id, 2);\r\n\t\t\t$link = UWR1RESULTS_URL.'/'.$twoChars[1].$twoChars[2];\r\n\t\t\tif ('00' != $twoChars[3]) {\r\n\t\t\t\t$link .= '/'.$twoChars[3];\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t\treturn $link;\r\n\t}",
"function get_permalink_by_name($page_name) {\n global $post;\n global $wpdb;\n $pageid_name = $wpdb->get_var(\"SELECT ID FROM $wpdb->posts WHERE post_title = '\" . $page_name . \"' LIMIT 0, 1\");\n return get_permalink($pageid_name);\n}",
"public function getPageID(){\n\t\t\n\t\tif(self::USE_SPLASH)\n\t\t{\n\t\t\t$this->setSplashID();\n\t\t}\n\t\telse $this->setPageID();\n\t\t\n\t}",
"private function getPageId()\n {\n return $this->getRequest()->getParam('id') ?: $this->getRequest()->getParam('page_id');\n }",
"public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }",
"function alaya_page_id($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 getPageId()\n {\n return $this->page_id;\n }",
"public static function page_url_get($id) {\n\n\t\t\t\t// $k = 0;\n\t\t\t\t// $pageUrl = '/';\n\t\t\t\t//\n\t\t\t\t// do {\n\t\t\t\t//\n\t\t\t\t// \t$sql = 'SELECT\n\t\t\t\t// \t\t\t\tparent_id,\n\t\t\t\t// \t\t\t\tref\n\t\t\t\t// \t\t\tFROM\n\t\t\t\t// \t\t\t\t' . DB_T_PREFIX . 'page\n\t\t\t\t// \t\t\tWHERE\n\t\t\t\t// \t\t\t\tid = ? AND\n\t\t\t\t// \t\t\t\tdeleted = \"0000-00-00 00:00:00\"';\n\t\t\t\t//\n\t\t\t\t// \t$parameters = [];\n\t\t\t\t// \t$parameters[] = intval($pageId);\n\t\t\t\t//\n\t\t\t\t// \tif ($row = $db->fetch_row($sql, $parameters)) {\n\t\t\t\t// \t\t$pageId = $row['parent_id'];\n\t\t\t\t// \t\t$pageUrl = '/' . $row['ref'] . $pageUrl;\n\t\t\t\t// \t} else {\n\t\t\t\t// \t\treturn NULL;\n\t\t\t\t// \t}\n\t\t\t\t//\n\t\t\t\t// } while ($pageId > 0 && $k++ < 10);\n\t\t\t\t//\n\t\t\t\t// if ($pageUrl == '/home/') {\n\t\t\t\t// \treturn '/';\n\t\t\t\t// } else {\n\t\t\t\t// \treturn $pageUrl;\n\t\t\t\t// }\n\n\t\t\t}",
"function get_blog_permalink($blog_id, $post_id)\n {\n }",
"function permalink_link()\n {\n }",
"public function getPageId() {\r\n\t\treturn $this->_id;\r\n\t}",
"function permalink_anchor($mode = 'id')\n {\n }",
"function get_page_id() {\n return isset($_GET['page']) && $_GET['page'] ? $_GET['page'] : 'home';\n}",
"public function get_url_to_postid($url){\n\t\tglobal $wp_rewrite;\n\n\t\t$url = apply_filters('tm_url_to_postid', $url);\n\n\t\t// First, check to see if there is a 'p=N' or 'page_id=N' to match against\n\t\tif ( preg_match('#[?&](p|page_id|attachment_id)=(\\d+)#', $url, $values) )\t{\n\t\t\t$id = absint($values[2]);\n\t\t\tif ( $id )\n\t\t\t\treturn $id;\n\t\t}\n\n\t\t// Check to see if we are using rewrite rules\n\t\t$rewrite = $wp_rewrite->wp_rewrite_rules();\n\n\t\t// Not using rewrite rules, and 'p=N' and 'page_id=N' methods failed, so we're out of options\n\t\tif ( empty($rewrite) )\n\t\t\treturn 0;\n\n\t\t// Get rid of the #anchor\n\t\t$url_split = explode('#', $url);\n\t\t$url = $url_split[0];\n\n\t\t// Get rid of URL ?query=string\n\t\t$url_split = explode('?', $url);\n\t\t$url = $url_split[0];\n\n\t\t// Add 'www.' if it is absent and should be there\n\t\tif ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )\n\t\t\t$url = str_replace('://', '://www.', $url);\n\n\t\t// Strip 'www.' if it is present and shouldn't be\n\t\tif ( false === strpos(home_url(), '://www.') )\n\t\t\t$url = str_replace('://www.', '://', $url);\n\n\t\t// Strip 'index.php/' if we're not using path info permalinks\n\t\tif ( !$wp_rewrite->using_index_permalinks() )\n\t\t\t$url = str_replace('index.php/', '', $url);\n\n\t\tif ( false !== strpos($url, home_url()) ) {\n\t\t\t// Chop off http://domain.com\n\t\t\t$url = str_replace(home_url(), '', $url);\n\t\t} else {\n\t\t\t// Chop off /path/to/blog\n\t\t\t$home_path = parse_url(home_url());\n\t\t\t$home_path = isset( $home_path['path'] ) ? $home_path['path'] : '' ;\n\t\t\t$url = str_replace($home_path, '', $url);\n\t\t}\n\n\t\t// Trim leading and lagging slashes\n\t\t$url = trim($url, '/');\n\n\t\t$request = $url;\n\t\t// Look for matches.\n\t\t$request_match = $request;\n\t\tforeach ( (array)$rewrite as $match => $query) {\n\t\t\t// If the requesting file is the anchor of the match, prepend it\n\t\t\t// to the path info.\n\t\t\tif ( !empty($url) && ($url != $request) && (strpos($match, $url) === 0) )\n\t\t\t\t$request_match = $url . '/' . $request;\n\n\t\t\tif ( preg_match(\"!^$match!\", $request_match, $matches) ) {\n\t\t\t\t// Got a match.\n\t\t\t\t// Trim the query of everything up to the '?'.\n\t\t\t\t$query = preg_replace(\"!^.+\\?!\", '', $query);\n\n\t\t\t\t// Substitute the substring matches into the query.\n\t\t\t\t$query = addslashes(WP_MatchesMapRegex::apply($query, $matches));\n\n\t\t\t\t// Filter out non-public query vars\n\t\t\t\tglobal $wp;\n\t\t\t\tparse_str($query, $query_vars);\n\t\t\t\t$query = array();\n\t\t\t\tforeach ( (array) $query_vars as $key => $value ) {\n\t\t\t\t\tif ( in_array($key, $wp->public_query_vars) )\n\t\t\t\t\t\t$query[$key] = $value;\n\t\t\t\t}\n\n\t\t\t// Taken from class-wp.php\n\t\t\tforeach ( $GLOBALS['wp_post_types'] as $post_type => $t )\n\t\t\t\tif ( $t->query_var )\n\t\t\t\t\t$post_type_query_vars[$t->query_var] = $post_type;\n\n\t\t\tforeach ( $wp->public_query_vars as $wpvar ) {\n\t\t\t\tif ( isset( $wp->extra_query_vars[$wpvar] ) )\n\t\t\t\t\t$query[$wpvar] = $wp->extra_query_vars[$wpvar];\n\t\t\t\telseif ( isset( $_POST[$wpvar] ) )\n\t\t\t\t\t$query[$wpvar] = $_POST[$wpvar];\n\t\t\t\telseif ( isset( $_GET[$wpvar] ) )\n\t\t\t\t\t$query[$wpvar] = $_GET[$wpvar];\n\t\t\t\telseif ( isset( $query_vars[$wpvar] ) )\n\t\t\t\t\t$query[$wpvar] = $query_vars[$wpvar];\n\n\t\t\t\tif ( !empty( $query[$wpvar] ) ) {\n\t\t\t\t\tif ( ! is_array( $query[$wpvar] ) ) {\n\t\t\t\t\t\t$query[$wpvar] = (string) $query[$wpvar];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach ( $query[$wpvar] as $vkey => $v ) {\n\t\t\t\t\t\t\tif ( !is_object( $v ) ) {\n\t\t\t\t\t\t\t\t$query[$wpvar][$vkey] = (string) $v;\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($post_type_query_vars[$wpvar] ) ) {\n\t\t\t\t\t\t$query['post_type'] = $post_type_query_vars[$wpvar];\n\t\t\t\t\t\t$query['name'] = $query[$wpvar];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t// Do the query\n\t\t\t\t$query = new WP_Query($query);\n\t\t\t\tif ( !empty($query->posts) && $query->is_singular )\n\t\t\t\t\treturn $query->post->ID;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public function getPageId(\\TV\\HZ\\Ask\\Entry $data)\n {\n return md5($data->getUrl());\n }",
"function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}",
"function aquamin_id() {\n\n\t$the_id = $GLOBALS[ 'aquamin_current_id' ] ?? null;\n\n\tif ( ! $the_id ) {\n\n\t\t// start with a default\n\t\t$the_id = get_the_id();\n\n\t\t// use page set as the \"posts page\" for blog-like templates\n\t\tif ( get_option( 'page_for_posts' )\n\t\t\t&& ( is_singular( 'post' )\n\t\t\t\t|| is_post_type_archive( 'post' )\n\t\t\t\t|| is_category()\n\t\t\t\t|| is_tag()\n\t\t\t\t|| is_home()\n\t\t\t)\n\t\t) {\n\t\t\t$the_id = get_option( 'page_for_posts' );\n\t\t// use a page with slug \"404-page\" for the 404 page id\n\t\t} elseif ( is_404() ) {\n\t\t\tif ( $post = get_page_by_path( '404-page', OBJECT, 'page' ) ) {\n\t\t\t\t$the_id = $post->ID;\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS[ 'aquamin_current_id' ] = $the_id;\n\n\t}\n\n\treturn $the_id;\n}",
"public function get_permalink()\n {\n }",
"function getPageID() {\n \tglobal $post;\n \t$postid = $post->ID;\n \t$queried_object = get_queried_object();\n \tif(is_home() && get_option('page_for_posts')) {\n\t\t$postid = get_option('page_for_posts');\n \t}\n \telse if (is_front_page()) {\n \t\t$postid = get_option( 'page_on_front' );\n \t}\n \telse if (is_archive()) {\n \t\t$postid = get_queried_object();\n \t}\n \telse if ( $queried_object ) {\n \t$postid = $queried_object->ID;\n \t}\n\n \treturn $postid;\n}",
"public function get_permalink() {\n\t\treturn apply_filters( 'the_permalink', get_permalink( $this->get_id() ) );\n\t}",
"public function id() { return $this->post->ID; }",
"function getPageURL($id) {\n $this->db->select(\"pageURL\");\n $this->db->where(\"pageID\", $id);\n $query = $this->db->get('page_attributes');\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $rows) {\n $pageURL = $rows->pageURL;\n return $pageURL;\n }\n }\n }",
"function origincode_gallery_video_get_video_gallery_id()\n{\n if (isset($_GET['page']) && $_GET['page'] == 'video_galleries_origincode_video_gallery') {\n if (isset($_GET[\"id\"])) {\n $id = absint($_GET[\"id\"]);\n } else {\n $id = 0;\n }\n }\n return $id;\n}",
"function redart_ID(){\r\n\t$post = redart_global_variables('post');\r\n\t$postID = false;\r\n\r\n\tif( ! is_404() ){\r\n\r\n\t\tif( function_exists('is_woocommerce') && is_woocommerce() ){\r\n\r\n\t\t\t$postID = woocommerce_get_page_id( 'shop' );\r\n\r\n\t\t} elseif( is_search() ){\r\n\r\n\t\t\t$postID = false;\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$postID = get_the_ID();\r\n\r\n\t\t}\r\n\t}\r\n\r\n\treturn $postID;\r\n}",
"function url($id)\r\n\t{\r\n\t\treturn '';\r\n\t}",
"public function getPageUri($entryId);",
"function get_ID_by_slug($page_slug)\n{\n $page = get_page_by_path($page_slug);\n if ($page) {\n return $page->ID;\n } else {\n return null;\n }\n}",
"public function pageRoute($id)\n {\n return 'page_page_show_'.$id;\n }",
"public function getPageId()\n {\n return $this->_pageId;\n }",
"function get_id_from_blogname($slug)\n {\n }",
"public function get_url_to_postid( $url ) {\n\t\tif ( function_exists( 'url_to_postid' ) ) {\n\t\t\treturn url_to_postid( $url );\n\t\t}\n\t\tglobal $wp_rewrite;\n\n\t\t$url = apply_filters( 'tm_url_to_postid', $url );\n\n\t\t// First, check to see if there is a 'p=N' or 'page_id=N' to match against\n\t\tif ( preg_match( '#[?&](p|page_id|attachment_id)=(\\d+)#', $url, $values ) ) {\n\t\t\t$id = absint( $values[2] );\n\t\t\tif ( $id )\n\t\t\t\treturn $id;\n\t\t}\n\n\t\t// Check to see if we are using rewrite rules\n\t\t$rewrite = $wp_rewrite->wp_rewrite_rules();\n\n\t\t// Not using rewrite rules, and 'p=N' and 'page_id=N' methods failed, so we're out of options\n\t\tif ( empty( $rewrite ) )\n\t\t\treturn 0;\n\n\t\t// Get rid of the #anchor\n\t\t$url_split = explode( '#', $url );\n\t\t$url = $url_split[0];\n\n\t\t// Get rid of URL ?query=string\n\t\t$url_split = explode( '?', $url );\n\t\t$url = $url_split[0];\n\n\t\t// Add 'www.' if it is absent and should be there\n\t\tif ( FALSE !== strpos( home_url(), '://www.' ) && FALSE === strpos( $url, '://www.' ) )\n\t\t\t$url = str_replace( '://', '://www.', $url );\n\n\t\t// Strip 'www.' if it is present and shouldn't be\n\t\tif ( FALSE === strpos( home_url(), '://www.' ) )\n\t\t\t$url = str_replace( '://www.', '://', $url );\n\n\t\t// Strip 'index.php/' if we're not using path info permalinks\n\t\tif ( !$wp_rewrite->using_index_permalinks() )\n\t\t\t$url = str_replace( 'index.php/', '', $url );\n\n\t\tif ( FALSE !== strpos( $url, home_url() ) ) {\n\t\t\t// Chop off http://domain.com\n\t\t\t$url = str_replace( home_url(), '', $url );\n\t\t} else {\n\t\t\t// Chop off /path/to/blog\n\t\t\t$home_path = parse_url( home_url() );\n\t\t\t$home_path = isset( $home_path['path'] ) ? $home_path['path'] : '';\n\t\t\t$url = str_replace( $home_path, '', $url );\n\t\t}\n\n\t\t// Trim leading and lagging slashes\n\t\t$url = trim( $url, '/' );\n\n\t\t$request = $url;\n\t\t// Look for matches.\n\t\t$request_match = $request;\n\t\tforeach ( (array) $rewrite as $match => $query ) {\n\t\t\t// If the requesting file is the anchor of the match, prepend it\n\t\t\t// to the path info.\n\t\t\tif ( !empty( $url ) && ($url != $request) && (strpos( $match, $url ) === 0) )\n\t\t\t\t$request_match = $url . '/' . $request;\n\n\t\t\tif ( preg_match( \"!^$match!\", $request_match, $matches ) ) {\n\t\t\t\t// Got a match.\n\t\t\t\t// Trim the query of everything up to the '?'.\n\t\t\t\t$query = preg_replace( \"!^.+\\?!\", '', $query );\n\n\t\t\t\t// Substitute the substring matches into the query.\n\t\t\t\t$query = addslashes( WP_MatchesMapRegex::apply( $query, $matches ) );\n\n\t\t\t\t// Filter out non-public query vars\n\t\t\t\tglobal $wp;\n\t\t\t\tparse_str( $query, $query_vars );\n\t\t\t\t$query = array();\n\t\t\t\tforeach ( (array) $query_vars as $key => $value ) {\n\t\t\t\t\tif ( in_array( $key, $wp->public_query_vars ) )\n\t\t\t\t\t\t$query[ $key ] = $value;\n\t\t\t\t}\n\n\t\t\t\t// Taken from class-wp.php\n\t\t\t\tforeach ( $GLOBALS['wp_post_types'] as $post_type => $t )\n\t\t\t\t\tif ( $t->query_var )\n\t\t\t\t\t\t$post_type_query_vars[ $t->query_var ] = $post_type;\n\n\t\t\t\tforeach ( $wp->public_query_vars as $wpvar ) {\n\t\t\t\t\tif ( isset( $wp->extra_query_vars[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $wp->extra_query_vars[ $wpvar ];\n\t\t\t\t\telseif ( isset( $_POST[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $_POST[ $wpvar ];\n\t\t\t\t\telseif ( isset( $_GET[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $_GET[ $wpvar ];\n\t\t\t\t\telseif ( isset( $query_vars[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $query_vars[ $wpvar ];\n\n\t\t\t\t\tif ( !empty( $query[ $wpvar ] ) ) {\n\t\t\t\t\t\tif ( !is_array( $query[ $wpvar ] ) ) {\n\t\t\t\t\t\t\t$query[ $wpvar ] = (string) $query[ $wpvar ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tforeach ( $query[ $wpvar ] as $vkey => $v ) {\n\t\t\t\t\t\t\t\tif ( !is_object( $v ) ) {\n\t\t\t\t\t\t\t\t\t$query[ $wpvar ][ $vkey ] = (string) $v;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isset( $post_type_query_vars[ $wpvar ] ) ) {\n\t\t\t\t\t\t\t$query['post_type'] = $post_type_query_vars[ $wpvar ];\n\t\t\t\t\t\t\t$query['name'] = $query[ $wpvar ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Do the query\n\t\t\t\t$query = new WP_Query( $query );\n\t\t\t\tif ( !empty( $query->posts ) && $query->is_singular )\n\t\t\t\t\treturn $query->post->ID;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}",
"function get_id_by_slug($page_slug) {\n\t# Try grab page by title.\n $obj = get_page_by_title($page_slug);\n\n if ($obj) {\n return $obj->ID;\n\t}else{\n\t\t# If no-go, try by full page path:\n\t\t$obj = get_page_by_path($page_slug);\t\t\n\n\t\treturn ($obj) ? $obj->ID : false;\n\t}\n}",
"function L_getIdBySlug($page_slug) {\n\t\t\n\t\t$page = get_page_by_path($page_slug);\n\t\t\n\t\tif ($page) {\n\t\t\t\n\t\t\treturn $page->ID;\n\t\t\n\t\t} else {\n\t\t\n\t\t\treturn null;\n\t\t\n\t\t}\n\t\n\t}",
"function getPageID() \n {\n return (int) $this->getValueByFieldName( 'page_id' );\n }",
"function get_page_id($page_name){\n\tglobal $wpdb;\n\t$page_name = $wpdb->get_var(\"SELECT ID FROM $wpdb->posts WHERE post_name = '\".$page_name.\"'\");\n\treturn $page_name;\n}",
"function get_post_id($slug = '', $display = true) {\n\tif($slug == '') { $slug = $_GET['page']; }\n\t\n\tinclude('connect.php');\t\t\n\t\n\t$get = $db->prepare('SELECT id FROM posts WHERE slug = :slug');\n\t$get->execute(array(':slug' => $slug));\n\t\n\t$return = $get->fetch(PDO::FETCH_OBJ);\t\t\n\t\n\tif($display) echo $return->id;\n\treturn $return->id;\n}",
"private static function get_id_from_url(string $url): string {\n\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$url'\";\n $id = $wpdb->get_var($query);\n\n return $id;\n }",
"function linkId() \n \t{\n \t\treturn $this->linkId;\n \t}",
"public function get_id();",
"public function get_id();",
"function get_post_permalink($postid){\n if(defined('CLEANURLS')){\n return str_replace('%postid%',$postid,URL_POST);\n }\n else{\n return BLOGURL.'?postid='.$postid;\n }\n }",
"function post_permalink($post = 0)\n {\n }",
"public function getPermalink()\n {\n return $this->permalink = $this->get()->guid;\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 }",
"function entry_id_to_page_uri($entry_id, $site_id = '')\n\t{\n\t\t\n\t\t$site_id = ($site_id != '') ? $site_id : $this->site_id;\n\t\t\n\t\tif($site_id != $this->site_id)\n\t\t{\n\t\t\t$this->load_pages($site_id);\n\t\t}\n\t\t\n\t\t$site_pages = ee()->config->item('site_pages');\n\n\t\tif ($site_pages !== FALSE && isset($site_pages[$site_id]['uris'][$entry_id]))\n\t\t{\n\t\t\t$site_url = $site_pages[$site_id]['url'];\n\t\t\t$node_url = $site_url.$site_pages[$site_id]['uris'][$entry_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// not sure what else to do really?\n\t\t\t$node_url = NULL;\n\t\t}\n\t\t\n\t\treturn $node_url;\n\t\t\n\t}",
"function findPageId($name){\n $conditions = array('Content.type' => 'pages',\n 'Content.status' => 'published',\n 'Content.title' => $name,\n \n );\n $result = $this->find('first', array('conditions' => $conditions, 'fields' => 'Content.id'));\n if(!empty($result)){\n\t\t\t\treturn $result;\n }else{\n\t\t\t\treturn false;\n\t\t\t}\n }",
"public static function getGlossaryIndexPageId() {\n\t\t$glossaryPageID = apply_filters( 'cmtt_get_glossary_index_page_id', get_option( 'cmtt_glossaryID' ) );\n\t\t/*\n\t\t * WPML integration\n\t\t */\n\t\tif ( function_exists( 'icl_object_id' ) && defined( 'ICL_LANGUAGE_CODE' ) ) {\n\t\t\t$glossaryPageID = icl_object_id( $glossaryPageID, 'page', ICL_LANGUAGE_CODE );\n\t\t}\n\t\treturn $glossaryPageID;\n\t}",
"function get_blog_id_from_url($domain, $path = '/')\n {\n }",
"function yt_get_post_id(){\n\n\tglobal $post, $wp_query;\n\n\t$post_id = isset( $post->ID ) ? $post->ID : 0;\n\n\tif( $wp_query->is_home && get_option('page_for_posts' ) )\n\t\t$post_id = get_option('page_for_posts' );\n\n\tif( yt_is_woocommerce() && wc_get_page_id('shop') )\n\t\t$post_id = wc_get_page_id('shop');\n\n\treturn $post_id;\n\n}",
"protected function getPostIdFromLink($link) {\n $postId = null;\n preg_match('~\\/([0-9]+)\\/~', $link, $postId);\n return $postId[1];\n }",
"public function getPermalink($contentId)\n {\n $this->getContentData($contentId);\n\n $year = CakeTime::format('Y', $this->content[$this->contentModel]['created']);\n $month = CakeTime::format('m', $this->content[$this->contentModel]['created']);\n $day = CakeTime::format('d', $this->content[$this->contentModel]['created']);\n\n if ($this->contentType == 'post') {\n switch (Configure::read('Permalink.common')) {\n case 'default':\n $permalink = Router::url(\"/p/\" . $this->content[$this->contentModel]['id'], true);\n break;\n\n case 'day_name':\n $permalink = Router::url(\n '/' . $year . \"/\" . $month . \"/\" . $day . \"/\" . $this->content[$this->contentModel]['slug'],\n true\n );\n break;\n\n case 'month_name':\n $permalink = Router::url(\n '/' . $year . \"/\" . $month . \"/\" . $this->content[$this->contentModel]['slug'],\n true\n );\n break;\n\n default:\n break;\n }\n } elseif ($this->contentType == 'page') {\n if (Configure::read('Permalink.common') == 'default') {\n $permalink = Router::url(\n \"/page/\" . $this->content[$this->contentModel]['id'],\n true\n );\n } else {\n $permalink = Router::url(\n \"/page/\" . $this->content[$this->contentModel]['slug'],\n true\n );\n }\n }\n\n return $permalink;\n }",
"Public function getPageId() {\n\t\tif(!empty($this->pageid))\n\t\t\treturn $this->pageid;\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"function _wp_link_page($i)\n {\n }",
"public function setPageID(){/*ACTUALLY NOT DEFINED*/}",
"protected function getCurrentPageId() {}",
"protected function getCurrentPageId() {}",
"protected function getCurrentPageId() {}",
"protected function getCurrentPageId() {}",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"function GetPageAliasFromID( $id )\n\t{\n\t\tglobal $gCms;\n\t\t$db = &$gCms->GetDb();\n\n\t\tif (!is_numeric($id) && strpos($id,'.') == TRUE && strpos($id,',') == TRUE)\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\n\t\t$params = array($id);\n\t\t$query = \"SELECT content_alias FROM \".cms_db_prefix().\"content WHERE content_id = ?\";\n\t\t$row = $db->GetRow($query, $params);\n\n\t\tif ( !$row )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn $row['content_alias'];\n\t}",
"public function getSiteId();",
"function the_permalink($post = 0)\n {\n }",
"function get_the_slug( $id=null ){\n if( empty($id) ):\n global $post;\n if( empty($post) )\n return ''; // No global $post var available.\n $id = $post->ID;\n endif;\n $slug = basename( get_permalink($id) );\n return $slug;\n}",
"function WallpaperUrl($id, $seo_name, $cat_id) {\n\tglobal $setting;\n\t\t\n\tif ($setting['seo_on'] == 0) {\n\t\t$url = $setting['site_url'].'/index.php?task=view&id='.$id;\n\t}\n\telse if ($setting['seo_on'] == 2) {\n\t\t$cat_name = mysql_fetch_array(mysql_query(\"SELECT name FROM wss_cats WHERE id=$cat_id\"));\n\t\t$seo_cat_name = seoname($cat_name['name']);\n\t\t$url = $setting['site_url'].'/'.$seo_cat_name.'/'.$id.'/'.$seo_name.$setting['seo_extension'];\n\t}\n\telse if ($setting['seo_on'] == 3) {\n\t\t$cat_name = mysql_fetch_array(mysql_query(\"SELECT name FROM wss_cats WHERE id=$cat_id\"));\n\t\t$seo_cat_name = seoname($cat_name['name']);\n\t\t$url = $setting['site_url'].'/'.$seo_cat_name.'/'.$seo_name.$setting['seo_extension'];\n\t}\n\treturn $url;\n}",
"public function set_page_id() {\n\n\t\t\t$page_id = false;\n\t\t\t$object_id = get_queried_object_id();\n\n\t\t\tif ( get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) && is_home() ) {\n\t\t\t\t$page_id = get_option( 'page_for_posts' );\n\t\t\t} else {\n\n\t\t\t\t// Use the $object_id if available.\n\t\t\t\tif ( isset( $object_id ) ) {\n\t\t\t\t\t$page_id = $object_id;\n\t\t\t\t}\n\n\t\t\t\t// If we're not on a singular post, set to false.\n\t\t\t\tif ( ! is_singular() ) {\n\t\t\t\t\t$page_id = false;\n\t\t\t\t}\n\n\t\t\t\t// Front page is the posts page.\n\t\t\t\tif ( isset( $object_id ) && 'posts' == get_option( 'show_on_front' ) && is_home() ) {\n\t\t\t\t\t$page_id = $object_id;\n\t\t\t\t}\n\n\t\t\t\t// The woocommerce shop page.\n\t\t\t\tif ( class_exists( 'WooCommerce' ) && ( is_shop() || is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) ) {\n\t\t\t\t\t$page_id = get_option( 'woocommerce_shop_page_id' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->current_page_id = $page_id;\n\n\t\t\treturn $page_id;\n\t\t}",
"public function link_id()\n {\n return $this->Link_ID;\n }",
"function attachment_url_to_postid($url)\n {\n }",
"function dahz_get_attachment_id_from_url( $url ) {\n\tglobal $wpdb;\n\n\t$prefix = $wpdb->prefix;\n\n\t$posts = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $url ) ); \n \n\treturn array_shift( $posts );\n}",
"function NextUrl($id, $text)\n\t{\n\t\t$path = ARTICLE;\n\t\t$new_id = $id + 1;\n\t\t$last = LastArticle('parameters/last_article_id');\n\t\tif ($new_id > (int)$last)\n\t\t{\n\t\t\treturn \"\";\t\n\t\t// jump an article because this is deleted\n\t\t}else if (file_exists($path . $new_id) == false){\n\t\t\treturn NextUrl($new_id, $text);\t\n\t\t}else{\n\t\t\t$string = '<a href=\"' . ARTICLE_HOME . '?id=' . $new_id . '\">' . $text . '</a>';\n\t\t\treturn $string;\n\t\t}\n \t}",
"protected function getCurrentPageIdFromCurrentSiteRoot() {}",
"function the_terms_conditions_url(){\n $pages = get_pages(array(\n 'meta_key' => '_wp_page_template',\n 'meta_value' => 'terms-conditions.php'\n ));\n $id = $pages[0]->ID;\n echo get_permalink($id);\n}",
"static function id(): string { return 'website'; }",
"function NewsUrl($id, $seo_title) {\n\tglobal $setting;\n\t\n\tif ($setting['seo_on'] == 0) {\n\t\t$url = '/index.php?task=news&id='.$id;\n\t}\n\telse if ($setting['seo_on'] == 3) {\n\t\t$url = '/news/'.$seo_title.$setting['seo_extension'];\n\t}\n\telse {\n\t\t$url = '/news/item/'.$id.'/'.$seo_title.$setting['seo_extension'];\n\t}\n\n\treturn $setting['site_url'].$url;\n}",
"function getIdFromLinkVnExpress($url) {\n // tra ve dc id cua url truyen vao\n // url thi la bat ky link nao theo dung dinh dang cua VNExpress\n $arrUrl = explode('-', $url); // chuyen chuoi ve mang\n $strId = end($arrUrl); // lay ra phan tu cuoi cung cua mang va khong lam thay doi mang ban dau\n $id = intval($strId);\n return $id;\n}",
"function dvs_change_blog_links($post_link, $id=0){\n\n $post = get_post($id);\n\n if( is_object($post) && $post->post_type == 'post'){\n return home_url('/my-prefix/'. $post->post_name.'/');\n }\n\n return $post_link;\n}",
"public function fetch_the_id() {}",
"function fumseck_linked_title( $id ) {\n\t$post_title = get_the_title( $id );\n\techo '<a href=\"' . esc_url( get_permalink( $id ) ) . '\" title=\"' . esc_attr( $post_title, 'fumseck' ) . '\">'. $post_title . '</a>' ;\n}",
"public function get_id() {\n\t\treturn $this->_post->ID;\n\t}",
"function get_the_ID()\n {\n }",
"public function setPageID(){\n\t\t\n\t\t$id = 'page';\n\t\t$s = '-';\n\t\t$pound = (!self::USE_SPLASH)?'#':'';\n\t\t$prefix = $pound.$id.$s;\n\t\t$this->headerContainerId = $prefix.'header'.$s.'container';\n\t\t$this->headerId = $prefix.'header';\n\t\t$this->subtitleId = $prefix.'subtitle';\n\t\t$this->brandId = $prefix.'brand';\n\t\t\n\t}",
"function entry_id_from_url_title($url_title)\n\t{\n ee()->db->where('url_title', $url_title)->limit(1);\n $entry = ee()->db->get('channel_titles')->row_array(); \n if($entry)\n {\n return $entry['entry_id'];\n }\n return false;\n\t}",
"private function pageUrl($page_id) {\n\t\t$url = \"pages/\";\n\t\tif (is_string($page_id) && $page_id !== 'home') {\n\t\t\t$url .= '=';\n\t\t}\n\t\t$url .= $page_id;\n\t\treturn $url;\n\t}",
"public function getID();",
"public function getID();"
] | [
"0.7064595",
"0.6859658",
"0.6698544",
"0.6698517",
"0.65625405",
"0.65625405",
"0.647614",
"0.6378253",
"0.63410705",
"0.63195163",
"0.6318693",
"0.628233",
"0.6270037",
"0.62672615",
"0.62601656",
"0.6241309",
"0.6206426",
"0.61797935",
"0.61594635",
"0.6143704",
"0.6135692",
"0.6128166",
"0.6112601",
"0.6098066",
"0.60935616",
"0.60909235",
"0.60615546",
"0.6060706",
"0.6054575",
"0.60415006",
"0.6025305",
"0.60003686",
"0.59913665",
"0.5985402",
"0.5984277",
"0.5975331",
"0.5973608",
"0.59656334",
"0.5962415",
"0.5957689",
"0.5949223",
"0.5948312",
"0.5945723",
"0.59434646",
"0.5935412",
"0.59256434",
"0.59152573",
"0.5900784",
"0.5900784",
"0.58876294",
"0.58795357",
"0.58574384",
"0.5850223",
"0.58434045",
"0.58379376",
"0.583031",
"0.5830036",
"0.58216786",
"0.5812252",
"0.5805886",
"0.58039016",
"0.5801562",
"0.5799763",
"0.57872015",
"0.57845235",
"0.57845235",
"0.57845235",
"0.5773724",
"0.5773724",
"0.5773724",
"0.5773724",
"0.5773724",
"0.5773724",
"0.5773724",
"0.5773724",
"0.5773724",
"0.57674515",
"0.576413",
"0.5748311",
"0.5748181",
"0.57474625",
"0.57465196",
"0.57380134",
"0.57362115",
"0.5730282",
"0.57262224",
"0.5725166",
"0.57125175",
"0.5710535",
"0.57096404",
"0.57059",
"0.56906563",
"0.56832486",
"0.5681837",
"0.5679003",
"0.5673171",
"0.56705064",
"0.5665726",
"0.5663027",
"0.56625134",
"0.56625134"
] | 0.0 | -1 |
search backwards starting from haystack length characters from the end | function startsWith($haystack, $needle) {
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function strpos_last($haystack, $needle) {\r\n\t\tif(strlen($needle) === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$len_haystack = strlen($haystack);\r\n\t\t$len_needle = strlen($needle);\t\t\r\n\t\t$pos = strpos(strrev($haystack), strrev($needle));\r\n\t\tif($pos === false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn $len_haystack - $pos - $len_needle;\r\n\t}",
"function rstrpos ($haystack, $needle, $offset)\n\t{\n\t\t$size = strlen ($haystack);\n\t\t$pos = strpos (strrev($haystack), $needle, $offset);\n \tif ($pos === false) return false;\n return $size - $pos;\n\t}",
"function my_strrpos($haystack, $needle)\n{\n\t$index = strpos(strrev($haystack), strrev($needle));\n\tif($index === false)\n\t\treturn false;\n\t$index = strlen($haystack) - strlen($needle) - $index;\n\treturn $index;\n}",
"function lastIndexOf($sourceString, $searchString) \r\n{\r\n\t$index = strpos(strrev($sourceString), strrev($searchString));\r\n\t$index = strlen($sourceString) - strlen($index) - $index;\r\n\treturn $index;\r\n}",
"function strripos($haystack, $needle, $offset=0) {\n if($offset<0){\n $temp_cut = strrev( substr( $haystack, 0, abs($offset) ) );\n }\n else{\n $temp_cut = strrev( substr( $haystack, $offset ) );\n }\n $pos = strlen($haystack) - (strpos($temp_cut, strrev($needle)) + $offset + strlen($needle));\n if ($pos == strlen($haystack)) { $pos = 0; }\n \n if(strpos($temp_cut, strrev($needle))===false){\n return false;\n }\n else return $pos;\n }",
"function strrevpos($instr, $needle)\n{\n $rev_pos = strpos (strrev($instr), strrev($needle));\n if ($rev_pos===false) return false;\n else return strlen($instr) - $rev_pos - strlen($needle);\n}",
"function reverse_strrchr($haystack, $needle) {\n\tif (!is_string($haystack)) {\n\t\treturn;\n\t}\n\treturn strrpos($haystack, $needle) ? substr($haystack, 0, strrpos($haystack, $needle) +1) : false;\n}",
"function strrpos ($haystack, $needle, $offset)\n\t{\n\t $size = strlen ($haystack);\n\t $pos = strpos (strrev($haystack), strrev($needle), $size - $offset);\n\t \n\t if ($pos === false)\n\t return false;\n\t \n\t return $size - $pos - strlen($needle);\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}",
"function ends_with($haystack, $needle) {\r\n $length = strlen($needle);\r\n $start = $length *-1; //negative\r\n return (substr($haystack, $start, $length) === $needle);\r\n}",
"function endsBy(string $haystack, string $needle) : bool\n{\n $length = strlen($needle);\n\n return $length === 0 ||\n (substr($haystack, -$length) === $needle);\n}",
"public function beforeLast($search) {\n return $this->sideInternal('mb_strrpos', $search, -1);\n }",
"function startsWith($haystack, $needle) {\n // search backwards starting from haystack length characters from the end\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== false;\n}",
"function endsWith($haystack, $needle){\n $length = strlen($needle);\n return $length === 0 ||\n (substr($haystack, -$length) === $needle);\n }",
"function reverse_strrchr( $haystack, $needle, $trail ) {\n\t\treturn strrpos( $haystack, $needle ) ? substr( $haystack, 0, strrpos( $haystack, $needle ) + $trail ) : false;\n\t}",
"function levenshtein_strip_search($to_strip,$subject,$backwards,$i)\n\t{\n\t\t$best=mixed();\n\t\t$best_at=$i;\n\n\t\t// Find all tag start/end positions (comparison reference points), loading them into the search list, ordered by position\n\t\t$up_to=min(strlen($subject),intval(floatval(strlen($to_strip))*1.5));\n\t\t$positions=array();\n\t\tfor (;$i<$up_to;$i++)\n\t\t{\n\t\t\tif ($i!=0)\n\t\t\t{\n\t\t\t\tif ($backwards)\n\t\t\t\t{\n\t\t\t\t\t$next_tag_a=strrpos(substr($subject,0,strlen($subject)-$i),'<'); // Makes performance reasonable, by only checking at tag points\n\t\t\t\t\t$next_tag_b=strrpos(substr($subject,0,strlen($subject)-$i),'>');\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$next_tag_a=strpos($subject,'<',$i); // Makes performance reasonable, by only checking at tag points\n\t\t\t\t\t$next_tag_b=strpos($subject,'>',$i);\n\t\t\t\t}\n\t\t\t\t$next_tag=(($next_tag_b!==false) && (($next_tag_a===false) || ((!$backwards) && ($next_tag_b<$next_tag_a)) || (($backwards) && ($next_tag_b>$next_tag_a))))?($next_tag_b+1):$next_tag_a;\n\t\t\t\tif ($next_tag===false)\n\t\t\t\t{\n\t\t\t\t\t$i=(strlen($subject)-1);\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$possible_i=$backwards?(strlen($subject)-$next_tag):$next_tag;\n\t\t\t\t\tif ($possible_i!=$i) $i=$possible_i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lev=NULL;\n\t\t\t//$lev=fake_levenshtein($backwards?substr($subject,-$i):substr($subject,0,$i),$to_strip);\t\tFor efficiency the next loop has a more intelligent searching algorithm, to narrow down on the peak\n\t\t\t$positions[]=array($i,$lev);\n\t\t}\n\n\t\tdo\n\t\t{\n\t\t\t$cnt=count($positions);\n\t\t\t$point_a=intval(3.0*floatval($cnt)/8.0);\n\t\t\t$point_b=intval(5.0*floatval($cnt)/8.0);\n\t\t\tif (($cnt<24)/*The peak algorithm breaks down on small data sets due to integer rounding problems and local maxima*/ || ($point_a==$point_b)) break; // Okay now we need to scan manually over the few that are left\n\n\t\t\t// Take the 3/8 point of the search list, and find it's levenshtein distance\n\t\t\tif (is_null($positions[$point_a][1]))\n\t\t\t\t$positions[$point_a][1]=fake_levenshtein($backwards?substr($subject,-$positions[$point_a][0]):substr($subject,0,$positions[$point_a][0]),$to_strip);\n\n\t\t\t// Take the 5/8 point of the search list, and find it's levenshtein distance\n\t\t\tif (is_null($positions[$point_b][1]))\n\t\t\t\t$positions[$point_b][1]=fake_levenshtein($backwards?substr($subject,-$positions[$point_b][0]):substr($subject,0,$positions[$point_b][0]),$to_strip);\n\t\t\t// If the 3/8 point has a higher or equal levenshtein distance, throw away everything to the left of the 3/8 point\n\t\t\tif ($positions[$point_a][1]>=$positions[$point_b][1])\n\t\t\t{\n\t\t\t\tarray_splice($positions,0,$point_a);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t// Therefore the 5/8 point has a higher levenshtein distance: throw away everything to the right of the 5/8 point\n\t\t\t\tarray_splice($positions,$point_b);\n\t\t\t}\n\t\t}\n\t\twhile (true);\t// Repeats until the 3/8 or 5/8 points are the same, due to indivisibility ('break' line does this)\n\n\t\t// Loop over the remaining results, finding the smallest levenshtein distance remaining- this is our result\n\t\tforeach ($positions as $p)\n\t\t{\n\t\t\tlist($i,$lev)=$p;\n\t\t\tif (is_null($lev)) $lev=fake_levenshtein(substr($subject,0,$i),$to_strip);\n\n\t\t\tif ((is_null($best)) || ($lev<$best))\n\t\t\t{\n\t\t\t\t$best=$lev;\n\t\t\t\t$best_at=$i;\n\t\t\t}\n\t\t}\n\t\t$ret=$backwards?substr($subject,0,(strlen($subject)-$best_at)):substr($subject,$best_at);\n\n\t\treturn $ret;\n\t}",
"function endsWith($haystack, $needle) {\n // search forward starting from end minus needle length characters\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n }",
"function endWith($haystack, $needle) { \n\n\t\t $length = strlen($needle); \n\t\t if($length == 0)\n\t\t { \n\t\t\t return true; \n\t\t } \n\t\t return (substr($haystack, -$length) === $needle);\n\t }",
"function endsWith($needle, $haystack)\n{\n $needle = strrev($needle);\n $haystack = strrev($haystack);\n return (strpos($haystack, $needle) === 0);\n}",
"function startsWith2bm($haystack, $needle) {\r\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== false;\r\n}",
"function esquerda($str, $length) \n{\n\t$length++;\n return substr($str, (strlen($str) - $length), $length - 1);\n}",
"public function remainingChars();",
"static function beforeLast(string $s, string $search): string {\n $p = mb_strrpos($s, $search);\n\n return $p ? mb_substr($s, 0, $p) : '';\n }",
"public static function reverse_strrchr($haystack, $needle, $trail) {\r\n return strrpos($haystack, $needle) ? substr($haystack, 0, strrpos($haystack, $needle) + $trail) : false;\r\n }",
"function str_removeFromEnd (string $str, string $needle) : string {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\n\tif($strLen >= $needleLen and str_endsWith($str, $needle)){\n\t\treturn substr($str, 0, $strLen - $needleLen);\n\t}\n\treturn $str;\n}",
"function ends_with($haystack, $needle) {\n\treturn $needle === substr($haystack, -strlen($needle));\n}",
"protected function lastIndexOf($sourceString, $searchString) {\n\t\t$index = strpos(strrev($sourceString), strrev($searchString));\n\t\t$index = strlen($sourceString) - strlen($index) - $index;\n\t\treturn $index;\n\t}",
"function boyermoore_search( $haystack, $needle )\n{\n /*\n * Calc string sizes\n */\n// $needle_len;\n// $haystack_len;\n $needle_len = strlen( $needle );\n $haystack_len = strlen( $haystack );\n\n /*\n * Simple checks\n */\n if( $haystack_len == 0 )\n {\n return NULL;\n }\n if( $needle_len == 0 )\n {\n return $haystack;\n }\n\n $badcharacter = array();\n $goodsuffix = array();\n /*\n * Initialize heuristics\n */\n $badcharacter[ALPHABET_SIZE];\n $goodsuffix[$needle_len + 1];\n\n prepare_badcharacter_heuristic( $needle, $needle_len, $badcharacter );\n prepare_goodsuffix_heuristic( $needle, $needle_len, $goodsuffix );\n\n /*\n * Boyer-Moore search\n */\n $s = 0;\n while( $s <= ( $haystack_len - $needle_len ))\n {\n $j = $needle_len;\n while( $j > 0 && $needle[$j - 1] == $haystack[$s + $j - 1] )\n $j--;\n\n if( $j > 0 )\n {\n $k = $badcharacter[( int ) $haystack[$s + $j - 1]];\n if( $k < ( int ) $j && ( $m = $j - $k - 1 ) > $goodsuffix[$j] ) { $s += $m; }\n else { $s += $goodsuffix[$j]; }\n }\n else\n {\n return $haystack + $s;\n }\n }\n\n return NULL;\n}",
"public function strrpos($haystack, $needle, $offset = 0) {\r\n return iconv_strrpos($haystack, $needle, $offset, $this->charset);\r\n }",
"public function getLastCharIndex() {}",
"public function strrpos($haystack, $needle) {\n\t\treturn grapheme_strrpos($haystack, $needle);\n\t}",
"public function afterLast($search) {\n return $this->sideInternal('mb_strrpos', $search, 1);\n }",
"function ends_with($haystack, $needles)\n {\n foreach ((array)$needles as $needle) {\n if (substr($haystack, -strlen($needle)) === (string)$needle) {\n return true;\n }\n }\n return false;\n }",
"function endsWith($haystack, $needle) {\n\t\t$length = strlen($needle);\n\t\tif ($length == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (substr($haystack, -$length) == $needle);\n\t}",
"function endsWith($str1,$str2){\n \tif(mb_substr($str1, -mb_strlen($str2)) == $str2){\n \t\treturn mb_substr($str1, 0, mb_strlen($str1)- mb_strlen($str2));\n \t} else {\n \t\treturn -1;\n \t}\n\t}",
"public static function strrpos($haystack, $needle) {\n $pos = strrpos($haystack, $needle);\n\n if ($pos === false)\n return false;\n else\n return UTF8::strlen(substr($haystack, 0, $pos));\n }",
"function endsWith($haystack, $needle) {\r\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\r\n}",
"function isPalindromreUseRecursion($string)\n{\n $stringLength = strlen($string);\n echo 'We have : ' . $stringLength . ' chars<br>';\n echo 'Compare first: '\n . $string[0]\n . ' >< '\n . 'last: '\n . $string[$stringLength - 1] . ' chars<br><br>';\n\n // Check Base case\n if (3 > $stringLength) {\n return true;\n }\n\n if ($string[0] === $string[$stringLength - 1]) {\n $stringTrimmed = substr($string, 1, -1);\n\n isPalindromreUseRecursion($stringTrimmed);\n }\n\n return false;\n}",
"public function indexOfLast($needle, $offset = 0)\n {\n return UTF8::strrpos($this->str, (string) $needle, (int) $offset, $this->encoding);\n }",
"static function endsWith($haystack, $needle)\n {\n // search forward starting from end minus needle length characters\n return $needle === \"\" ||\n (($temp = strlen($haystack) - strlen($needle)) >= 0 &&\n strpos($haystack, $needle, $temp) !== false);\n }",
"function strallpos($haystack, $needle, $offset = 0) {\n $result = array();\n\n // Loop through the $haystack/string starting at offset \n for ($i = $offset; $i < strlen($haystack); $i++) {\n $pos = strpos($haystack, $needle, $i);\n if ($pos !== FALSE) {\n $offset = $pos;\n if ($offset >= $i) {\n $i = $offset;\n\n // Add found results to return array \n $result[] = $offset;\n }\n }\n }\n return $result;\n }",
"function check_str_end(string $string, string $end, int $len, $endLength): bool\n{\n return substr($string, $len - $endLength, $endLength) == $end;\n}",
"function strEndsWith($haystack,$needle){\n\n if(strlen($haystack)<=strlen($needle)){\n return false;\n }\n $pos=stripos($haystack,$needle,0-strlen($needle));\n\n if($pos==(strlen($haystack)-strlen($needle))){\n return true;\n }\n return false;\n}",
"function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n}",
"function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n}",
"protected static function strrstr($haystack, $needle, $before_needle = false) {\n\t\t\t$result = false;\n\t\t\t$pos = strrpos($haystack, $needle);\n\t\t\tif ($pos !== false) {\n\t\t\t\tif (!$before_needle) {\n\t\t\t\t\t$pos += strlen($needle);\n\t\t\t\t\t$result = substr($haystack, $pos);\n\t\t\t\t} else {\n\t\t\t\t\t$result = substr($haystack, 0, $pos);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $result;\n\t\t}",
"function endsWith($haystack, $needle) // Colorize: green\n { // Colorize: green\n $length = strlen($needle); // Colorize: green\n // Colorize: green\n if ($length == 0) // Colorize: green\n { // Colorize: green\n return true; // Colorize: green\n } // Colorize: green\n // Colorize: green\n return substr($haystack, -$length) === $needle; // Colorize: green\n }",
"function ends_with($haystack, $needle)\n{\n\treturn substr($haystack, -strlen($needle))===$needle;\n}",
"function endsWith($haystack, $needle)\n{\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}",
"function endsWith($haystack, $needle)\n{\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}",
"function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}",
"function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}",
"function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}",
"public static function beforeLast($subject, $search)\n {\n if ($search === '') {\n return $subject;\n }\n\n $pos = mb_strrpos($subject, $search);\n\n if ($pos === false) {\n return $subject;\n }\n\n return static::substr($subject, 0, $pos);\n }",
"function str_removeFromStart (string $str, string $needle) : string {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\n\tif($strLen >= $needleLen and str_startsWith($str, $needle)){\n\t\treturn substr($str, $needleLen);\n\t}\n\treturn $str;\n}",
"function substr_right($string, $length)\n{\n\treturn substr($string, -$length, $length);\n}",
"protected function findEnd($str, $open, $end){\n\t\t$opens = 1;\n\t\t$ends = 0;\n\t\tfor($i=0; $i<strlen($str); $i++){\n\t\t\tif($str[$i]===$end )$ends++;\n\t\t\tif($opens==$ends)\n\t\t\t\tbreak;\n\t\t\tif($str[$i]===$open)$opens++;\n\t\t}\n\t\treturn $i;\n\t}",
"public static function beforeLast(string $haystack, string $needle): string\n {\n if ($needle === '') {\n return $haystack;\n }\n $position = strrpos($haystack, $needle);\n return $position !== false ? substr($haystack, 0, $position) : $haystack;\n }",
"function right($str, $length) {\n return substr($str, -$length);\n}",
"static function afterLast(string $s, string $search): string {\n $p = mb_strrpos($s, $search);\n\n return $p ? mb_substr($s, $p + mb_strlen($search)) : '';\n }",
"function strapos($haystack,$needles,$offset=0) {\n $results = array();\n foreach($needles as $n) {\n $results[] = strpos($haystack, $n);\n }\n $results = array_filter($results);\n sort($results);\n if(isset($results[$offset])) return $results[$offset];\n else return false;\n}",
"function startFrom(string $haystack, string $needle) : bool\n{\n $length = strlen($needle);\n return (substr($haystack, 0, $length) === $needle);\n}",
"public static function strUntil($haystack, $until, &$strPos = 0) {\n\t\t\tif ($strPos >= strlen($haystack)) {\n\t\t\t\t$strPos = strlen($haystack);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$untilPos = strpos($haystack, $until, $strPos);\n\t\t\tif ($untilPos === false) $untilPos = strlen($haystack);\n\t\t\t$nbr = $untilPos - $strPos;\n\t\t\t$result = substr($haystack, $strPos, $nbr);\n\t\t\t$strPos += $nbr + strlen($until);\n\n\t\t\t$strLen = strlen($haystack);\n\t\t\tif ($strPos > $strLen) {\n\t\t\t\t$strPos = $strLen;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}",
"function substrGB($string, $start = 0,$length = 30){\r\n\t\tif (strlen($string) > $length){ \r\n\t\t\tfor($i=0; $i < $length; $i++){\r\n\t\t\t\tif (ord($string[$i]) > 128){\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$string = substr($string,$start,$i); \r\n\t\t} \r\n\t\treturn $string; \r\n\t}",
"function right($string, $count){\n return substr($string, (strlen($string) - $count), strlen($string));\n}",
"function endsWith($haystack, $needle) {\n\t\t$pos = strlen($haystack) - strlen($needle);\n\t\treturn (strpos($haystack, $needle) === $pos);\n\t}",
"function endsWith($haystack, $needle) {\n\t\t\t$needle_length = strlen($needle);\n\t\t\t$offset = strlen($haystack) - $needle_length;\n\t\t\t$length = $needle_length;\n\t\t\treturn @substr_compare($haystack, $needle, $offset, $length) === 0;\n\t\t}",
"function wsod_strposall($haystack,$needle){ \n $s=0; $i=0; \n while (is_integer($i)){ \n $i = strpos($haystack,$needle,$s); \n if (is_integer($i)) { \n $aStrPos[] = $i; \n $s = $i+strlen($needle); \n } \n } \n if (isset($aStrPos)) { \n return $aStrPos; \n } else { \n return false; \n } \n}",
"function ends_with($haystack, $needles)\n {\n return Str::endsWith($haystack, $needles);\n }",
"function string_ends_with( $haystack, $needle ) {\n\t\treturn substr($haystack, -strlen($needle))===$needle;\n\t}",
"function substring_between($haystack,$start,$end) {\n if (strpos($haystack,$start) === false || strpos($haystack,$end) === false) {\n return false;\n } else {\n $start_position = strpos($haystack,$start)+strlen($start);\n $end_position = strpos($haystack,$end);\n return substr($haystack,$start_position,$end_position-$start_position);\n }\n}",
"public static function removeEnd(string $haystack, string $needle): string\n {\n return static::endsWith($haystack, $needle) ? substr($haystack, 0, -strlen($needle)) : $haystack;\n }",
"protected static function endsWith($haystack, $needle) {\n\t\t// search forward starting from end minus needle length characters\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n\t}",
"protected static function endsWith($haystack, $needle) {\n\t\t// search forward starting from end minus needle length characters\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n\t}",
"public static function strrpos_in_byte(string $haystack, string $needle, int $offset = 0)\n {\n if ($haystack === '' || $needle === '') {\n return false;\n }\n\n if (self::$SUPPORT['mbstring_func_overload'] === true) {\n // \"mb_\" is available if overload is used, so use it ...\n return \\mb_strrpos($haystack, $needle, $offset, 'CP850'); // 8-BIT\n }\n\n return \\strrpos($haystack, $needle, $offset);\n }",
"function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n }",
"function right($value, $count){\n return substr($value, ($count*-1));\n}",
"function ends_with($string,...$end)\n{\n if(!$string)\n return false;\n foreach( $end as $e )\n if( substr($string,strlen($string)-strlen($e)) == $e )\n return true;\n return false;\n}",
"function pos(string $string) {\n $result = \"\";\n\n for ($x = strlen($string) - 1; $x >= 0; $x--) {\n $result .= substr($string, $x, 1);\n }\n return $result;\n}",
"function str_ends_with($needle, $haystack)\n {\n return str::endsWith($needle, $haystack);\n }",
"function endsWith($haystack, $needle) {\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n\t}",
"public static function excludefromSearch($string)\r\n {\r\n $exploded= explode(\" \",$string);\r\n\r\n $indice= DiccionarioIndexacion::pivotsForSearch();\r\n // ldd($indice);\r\n $words=DiccionarioIndexacion::excludedWordsForSearch();\r\n foreach ($exploded as $pos=>$value)\r\n {\r\n\r\n $value=lcfirst($value);\r\n if(strlen($value)==0)\r\n continue;\r\n $exploded[$pos]=DiccionarioIndexacion::normalizeString($value);\r\n $val = $value[0];\r\n if (is_numeric($val)) {\r\n // ld($value[0]);\r\n continue;\r\n }\r\n $numericValue = ord($value{0});\r\n $iterator= $numericValue;\r\n if (!isset($indice[$iterator]))\r\n continue;\r\n $end=$indice[$iterator];\r\n if ($iterator==\"97\")\r\n $start=0;\r\n else\r\n {\r\n while (!isset($indice[$iterator-1]))\r\n $iterator--;\r\n $start=$indice[$iterator-1];\r\n }\r\n\r\n // $letter = chr(98);\r\n for ($i=$start;$i<$end;$i++)\r\n {\r\n\r\n if ($value == $words[$i])\r\n {\r\n unset($exploded[$pos]);\r\n }\r\n }\r\n }\r\n return $exploded;\r\n\r\n }",
"function windowString($str1, $str2) {\n if (empty($str1) || empty($str2)) {\n return \"\";\n }\n $expected = [];\n for ($i=0; $i < strlen($str2); $i++) { \n if (!isset($expected[$str2[$i]])) {\n $expected[$str2[$i]] = 1;\n } else {\n $expected[$str2[$i]]++;\n }\n }\n $actual = [];\n list($left, $right) = [0, 0];\n $result = []; // start and end index of the result string.\n while ($left < strlen($str1) && $right < strlen($str1)) {\n // all chars in str2 are in current left right boundaries in str1\n if (sizeof($expected) == sizeof($actual)) {\n // move ahead left pointer as long as char is not in expected table\n while (!isset($expected[$str1[$left]])) {\n $left++;\n }\n // left is now pointing to the first char that's also in expected\n if (empty($result) || $result[1] - $result[0] > $right - $left) {\n $result = [$left, $right];\n }\n // unset the char in actual table.\n if ($actual[$str1[$left]] == 1) {\n unset($actual[$str1[$left]]);\n } else {\n $actual[$str1[$left]]--;\n }\n $left++;\n } else { // not all chars are in yet\n if (isset($expected[$str1[$right]])) {\n if (!isset($actual[$str1[$right]])) {\n $actual[$str1[$right]] = 1;\n } else {\n $actual[$str1[$right]]++;\n }\n }\n if ($right < strlen($str1)-1) {\n $right++;\n } else {\n $left++;\n }\n }\n print_r($result);\n }\n return substr($str1, $result[0], $result[1] - $result[0]+1);\n}",
"public function strrchr($haystack, $needle)\n {\n return strrchr($haystack, $needle);\n }",
"function endsWith($haystack, $needle) {\r\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\r\n\t}",
"function lastCharOf($s1, $chars){\n\t\t$array = preg_split('//u', $s1, -1, PREG_SPLIT_NO_EMPTY);\n\t\t$array = array_reverse($array);\n\t\tforeach($array as $ch){\n\t\t\tif(in_array($ch, $chars)){\n\t\t\t\treturn $ch;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"function str_iends_with($needle, $haystack)\n {\n return str::endsWithIgnoreCase($needle, $haystack);\n }",
"function finishOnWord($string, $limit, $stop=\" \")\r\n{\r\n if(strlen($string) <= $limit) return $string;\r\n\r\n // is $stop present between $limit and the end of the string?\r\n if(false !== ($stoppoint = strpos($string, $stop, $limit))) {\r\n if($stoppoint < strlen($string) - 1) {\r\n $string = substr($string, 0, $stoppoint);\r\n }\r\n }\r\n\r\n return $string;\r\n}",
"public function indexOfLast($needle, $offset = 0)\n {\n return UTF8::strrpos\n (\n $this->scalarString,\n (string)$needle,\n (int)$offset,\n $this->encoding\n );\n }",
"function endsWith($haystack, $needle) {\n if(!empty($haystack)) {\n return $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n }\n}",
"function endsWith($haystack, $needle) {\n if(!empty($haystack)) {\n return $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n }\n}",
"public static function endsWith($haystack, $needle) {\n return (strrpos($haystack, $needle) == (strlen($haystack) - strlen(\n $needle\n )));\n }",
"function strposa( $haystack, $needles = array( ), $offset = 0 ) {\n$chr = array( );\nforeach ( $needles as $needle )\n {\n $res = strpos( $haystack, $needle, $offset );\n if ( $res !== false )\n return $needle;\n }\nreturn 'no';\n}",
"function solution($str) {\n return strrev($str);\n}",
"function my_stripos($haystack,$needle,$offset = 0)\r\n{\r\n return(strpos(strtolower($haystack),strtolower($needle),$offset));\r\n}",
"function strcut_utf8($str, $len, $checkmb=false, $tail='') {\n\tpreg_match_all('/[\\xE0-\\xFF][\\x80-\\xFF]{2}|./', $str, $match); // target for BMP\n\t$m = $match[0];\n\t$slen = strlen($str); // length of source string\n\t$tlen = strlen($tail); // length of tail string\n\t$mlen = count($m); // length of matched characters\n\tif ($slen <= $len) return $str;\n\tif (!$checkmb && $mlen <= $len) return $str;\n\t$ret = array();\n\t$count = 0;\n\tfor ($i=0; $i<$len; $i++) {\n\t\t$count += ($checkmb && strlen($m[$i]) > 1)?2:1;\n\t\tif ($count + $tlen > $len) break;\n\t\t$ret[] = $m[$i];\n\t}\n\t$result = join('', $ret).$tail;\n\treturn ($result == $str) ? $result : $result.'..';\n}",
"static function startsWith($haystack, $needle)\n {\n // search backwards starting from haystack length characters from the end\n return\n $needle === \"\" ||\n strrpos($haystack, $needle, -strlen($haystack)) !== false;\n }",
"function endsWith($haystack, $needle)\r\n {\r\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\r\n }",
"function endsWith($haystack, $needle) {\n return $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n}",
"public static function rpos($haystack, $needle, $offset = 0)\n {\n if (self::isMBString()) {\n return mb_strrpos($haystack, $needle, $offset, self::$encoding);\n } else {\n\n // @codeCoverageIgnoreStart\n return strrpos($haystack, $needle, $offset);\n // @codeCoverageIgnoreEnd\n }\n }",
"public function strStr(string $haystack, string $needle)\n {\n // return $result === false ? -1 : $result;\n $needleLen = strlen($needle);\n $haystackLen = strlen($haystack);\n if (0 === $needleLen) {\n return 0;\n }\n if ($needleLen > $haystackLen) {\n return -1;\n }\n\n $next = $this->getNext($needle, $needleLen);\n $j = 0;\n for ($i = 0; $i < $haystackLen; $i++) {\n while ($j > 0 && $haystack[$i] !== $needle[$j]) {\n $j = $next[$j - 1];\n }\n if ($needle[$j] === $haystack[$i]) {\n $j++;\n }\n if ($j === $needleLen) {\n return $i - $needleLen + 1;\n }\n }\n\n return -1;\n }"
] | [
"0.65940523",
"0.6586245",
"0.65789247",
"0.64274114",
"0.6359162",
"0.6305681",
"0.62781745",
"0.6266382",
"0.61677057",
"0.61317486",
"0.6023471",
"0.59243816",
"0.58941704",
"0.5891455",
"0.58855695",
"0.58644915",
"0.5817055",
"0.5791456",
"0.57525593",
"0.56922936",
"0.5668518",
"0.56658214",
"0.5646817",
"0.5545776",
"0.5526673",
"0.5522533",
"0.551497",
"0.5512281",
"0.5477527",
"0.54688776",
"0.5467903",
"0.54657006",
"0.5432307",
"0.54311675",
"0.54162526",
"0.5407967",
"0.54063535",
"0.53998876",
"0.53804815",
"0.5371141",
"0.5351628",
"0.53470874",
"0.5339919",
"0.5329764",
"0.5329764",
"0.5329385",
"0.53240144",
"0.5323708",
"0.532311",
"0.532311",
"0.53119814",
"0.53119814",
"0.53119814",
"0.5283616",
"0.528326",
"0.52759564",
"0.52603954",
"0.52435577",
"0.5228605",
"0.5215005",
"0.5214637",
"0.51941544",
"0.5192074",
"0.51752055",
"0.51661706",
"0.5158356",
"0.5156878",
"0.51527804",
"0.51478964",
"0.51476324",
"0.51437676",
"0.5138017",
"0.51286864",
"0.51286864",
"0.51186335",
"0.5109859",
"0.51054406",
"0.5105025",
"0.5088842",
"0.5077402",
"0.5071657",
"0.5070999",
"0.5068543",
"0.5061009",
"0.50582206",
"0.5039895",
"0.50345784",
"0.5020195",
"0.50178784",
"0.5015524",
"0.5015524",
"0.501479",
"0.5010461",
"0.5004725",
"0.49997568",
"0.4995539",
"0.49935657",
"0.49925023",
"0.49841857",
"0.4975242",
"0.49712375"
] | 0.0 | -1 |
De render functie ontvangt het gevraagde bestandsnaam en heeft een data array als niet verplichte variabele Allereerst wordt er door de data array heen gelopen en wordt elk item omgezet in een variabele. Bijvoorbeeld: $data["voornaam"] wordt in de view beschikbaar als $voornaam Daarna worden er 3 bestanden ingeladen. De templates/header.php, jouw gewenste pagina en de templates/footer.php. Merk op dat .php hier al staat en je die dus niet mee hoeft te geven. | function render($filename, $data = null)
{
if ($data) {
foreach($data as $key => $value) {
$$key = $value;
}
}
require('templates\header.php');
require($filename . '.php');
require('templates\footer.php');
die();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render($filename, $data = null)\n{\n\tif ($data && is_array($data)) { //ik heb de core hier aangepast zodat als je render('', array($val1 /*is an array*/, $val2)) doet dat ie ook al the variables goed regeld\n\t\tforeach ($data as $key => $value){\n\t\t\tif(!is_object($value)){// we wilen niet dat de code dit bij een object uitvoerd (bvb een PDO object)\n\t\t\t\tforeach($value as $key => $val) {\n\t\t\t\t\t$$key = $val;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$$key = $value;//zodat we wel kunnen zeggen $object_naam\n\t\t\t}\n\t\t}\n\t} \n\n\trequire(ROOT . 'view/templates/header.php');\n\trequire(ROOT . 'view/' . $filename . '.php');\n\trequire(ROOT . 'view/templates/footer.php');\n}",
"function render_data($vista, $data) {\n\t$html = '';\n\tif(($vista) && ($data)) {\n\t\t$diccionario = armar_diccionario($vista, $data);//vista es un get\n\t\tif($diccionario) {\n\t\t\t$html = file_get_contents('plantilla_' . $vista . '.html');\n\t\t\tforeach ($diccionario as $clave => $valor) {\n\t\t\t\t$html = str_replace('{' . $clave . '}', $valor, $html);\n\t\t\t}\n\t\t}\n\t}\n\tprint $html;//print $html es lo que hace imprime todo \n}",
"public function renderData();",
"public function render($data);",
"public function show($file, array $data = array()){\n \n //incluant le chemin vers nos vues\n $engine = new \\League\\Plates\\Engine(self::PATH_VIEWS);\n\n //charge nos extensions (nos fonctions personnalisées)\n $engine->loadExtension(new \\W\\View\\Plates\\PlatesExtensions());\n\n $app = getApp();\n\n // Rend certaines données disponibles à tous les vues\n // accessible avec $w_user & $w_current_route dans les fichiers de vue\n $engine->addData(\n [\n 'w_user' => $this->getUser(),\n 'w_current_route' => $app->getCurrentRoute(),\n 'w_site_name' => $app->getConfig('site_name'),\n ]\n );\n\n // Je peux ajouter des variables qui seront disponible dans tout les fichier view\n // $this->tabVariableView = [\n // \"var1\" => date(\"Y\"),\n // ];\n \n // $this->setVar(\"var1\", date('Y'));\n\n //$engine->addData($this->tabVariableView);\n\n // On peut ajouter des fonctions supplementaire dans la partie view\n // $engine->registerFunction('afficherDate', function(){\n // echo date(\"Y\");\n // });\n\n $engine->registerFunction('afficherVarGlob', function($nomVar){\n if (isset($GLOBALS[\"$nomVar\"])){echo $GLOBALS[\"$nomVar\"];};\n });\n\n\n // Retire l'éventuelle extension .php\n $file = str_replace('.php', '', $file);\n\n // Affiche le template\n echo $engine->render($file, $data);\n die();\n }",
"protected function renderData()\n {\n $this->view->baseUrl = $this->_baseUrl;\n $this->view->staticUrl = Zend_Registry::get('static');\n $this->view->version = Zend_Registry::get('version');\n $this->view->hostUrl = Zend_Registry::get('host');\n $this->view->photoUrl = Zend_Registry::get('photo');\n $this->view->adminUser = $this->_user;\n\n $this->view->isSuperUser = $this->_isSuperUser;\n $this->view->isViewer = $this->_isViewer;\n $this->view->isWatcher = $this->_isWatcher;\n $this->view->isEditor = $this->_isEditor;\n }",
"public function render($data){\n $html = \"<html><body><table border = 1>\";\n\t $html .= \"<tr>\";\n\t foreach($data[0] as $header){\n\t $html .=\"<th>\" .$header. \"</th>\";\n\t }\n\t $html .= \"</tr>\";\n\t for ($i=1;$i<count($data);$i++){\n\t $html .= \"<tr>\";\n\t foreach ($data[$i] as $row) {\n\t $html .= \"<td>\" .$row. \"</td>\";\n\t }\n\t $html .=\"</tr>\";\n\t }\n\t $html .=\"</table>\";\n\t return $html; \n }",
"public function index($data = array())\n\t{\n\t\t/*\n\t\t* 컨트로러에서 에코 확인하려면 left메뉴 안보이게 설정하고 해야 뷰페이지에서 보임.. (application > hooks > Common.php 맨 아래 주석참고)\n\t\t* 귀찮으면 개발자 도구에서 body 에 padding-left : 300px 설정해서 하면 보임.. ㅠㅠ 부트스트랩 css가..음..\n\t\t\n\t\t* 요건 배열 확인할때 앞에 pre 태그 써주면 정렬해서 보기 편함!\n\t\techo '<pre>';\n\t\tprint_r($data);\n\t\techo '</pre>';\n\t\t*/\n\t\t$this->load->view('admin/admin_dashboard_v', $data);\n\t\t\n\t}",
"abstract public function render($data);",
"public function render($filename, $data = [])\r\n {\r\n\r\n\r\n //on demare le buffer\r\n // ob_start();\r\n\r\n // require_once(ROOT. 'views/'.strtolower(get_class($this)).'/'.$fichier.'.php');\r\n\r\n // $content = ob_get_clean();\r\n // require_once(ROOT.'views/layouts/default.php');\r\n\r\n\r\n\r\n $loader = new \\Twig\\Loader\\FilesystemLoader(\"views/\");\r\n $twig = new \\Twig\\Environment($loader, [\r\n 'cache' => false,\r\n ]);\r\n\r\n\r\n // On charge notre vue\r\n $view = $twig->load($filename);\r\n\r\n // On récupère le contenu de la vue en lui passant nos données pour que la vue puisse les exploiter\r\n echo $view->render($data);\r\n }",
"public abstract function render($data);",
"function render($data) {\n\t\t$this->body->set_template('report_geolocation.tpl');\n\t\t$this->body->set('latest_visits', $this->get('latest_visits'));\n\t\t$this->body->set('site_id', $this->get('site_id') );\n\t\t$this->setjs('jmaps', 'base/js/includes/jquery/jquery.jmap-r72.js');\n\t\t$this->setjs('owa.map', 'base/js/owa.map.js');\n\t}",
"public function _render_page($data = [])\n {\n \t$this->load->view('layouts/main', $data);\n }",
"function render_html( $data ) {\n\n \trequire_once( dirname( __FILE__ ) . '/bootstrap/header.html' );\n\n \t//err out if no results\n\t\tif ( empty( $data ) ) {\n\t\t $this->error( 'No results found', 404 );\n\t\t return;\n\t\t}\n\t\t\n\t\t//page title\n\t\techo \"<h1>Results</h1>\";\n\t\t\n\t\t//render table headings\n\t\techo \"<table class='table table-striped'>\\n<thead>\\n<tr>\\n\";\n\n\t\tforeach ( array_keys( get_object_vars( reset( $data ) ) ) as $heading ) {\n \t\techo \"\\t<th>$heading</th>\\n\";\n\t\t}\n\t\t\n\t\techo \"</tr>\\n</thead>\\n\";\n\t\t\n\t\t//loop data and render\n\t\tforeach ( $data as $row ) {\n \t\t\n \t\techo \"<tr>\\n\";\n \t\t\n \t\tforeach ( $row as $cell ) {\n \t\t\n \t\techo \"\\t<td>$cell</td>\\n\";\n \t\t\n \t\t}\n \t\t\n \t\techo \"</tr>\";\n \t\t\n\t\t}\n\t\t\n\t\techo \"</table>\";\n\t\t\n \trequire_once( dirname( __FILE__ ) . '/bootstrap/footer.html' );\t\t\n\t\t\n\t}",
"function render($name, $data = [])\r\n{\r\n foreach ($data as $key => $value) {\r\n $$key = $value;\r\n }\r\n\r\n $name = str_replace(\".\", \"/\", $name);\r\n\r\n include VIEW_FOLDER . $name . \".php\";\r\n}",
"function render($view, $data)\n {\n\n $smarty = new Smarty();\n\n //Indicamos las carpetas a usar por SMARTY\n $smarty->template_dir = \"views\";\n $smarty->compile_dir = \"templates_c\";\n\n //Toda la data que se muestre la mando\n foreach ($data as $key => $value) {\n $smarty->assign($key, $value);\n\n }\n //mando la view a mostrar al layout, y hago que displayee el layout\n $smarty->assign(\"viewFile\", $view . \".tpl\");\n $smarty->display(\"layout.tpl\");\n }",
"public function render($data)\n\t{\n\t\t$m = new Mustache();\n\t\t\n\t\t$data = Tools_Php::convert_object_to_array($data);\n\t\t\n\t\treturn $m->render($this->text, $data);\n\t}",
"public function display($data) {\n\t\t\tif (isset($data[$this->get_field_name('image_id')])) {\n\t\t\t\t$image_src = wp_get_attachment_image_src(intval($data[$this->get_field_name('image_id')]), esc_attr($data[$this->get_field_name('image_id').'-size']), false);\n\t\t\t\t$image_alignment = esc_attr(str_replace('-', ' ', $data[$this->get_field_name('hero_alignment')]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$image_src = '';\n\t\t\t\t$image_alignment = '';\n\t\t\t}\n\t\t\t$title = (!empty($data[$this->get_field_name('title')]) ? esc_html($data[$this->get_field_name('title')]) : '');\n\t\t\t$content = (!empty($data[$this->get_field_name('content')]) ? $this->wp_formatting($data[$this->get_field_name('content')]) : '');\n\t\t\t$box_height = (!empty($data[$this->get_field_name('box-height')]) ? intval($data[$this->get_field_name('box-height')]) : 0);\n\t\t\t$id_base = $this->id_base;\n\t\t\t$url = $this->get_link_url($data);\n\t\t\t\n\t\t\treturn $this->load_view($data, compact('image_src', 'title', 'content', 'box_height', 'image_alignment', 'id_base', 'url'));\n\t\t\t//return $html;\n\t\t}",
"public function renderJson($data) { //--{{{\n header(\"Content-Type: application/json; charset=utf-8\");\n echo json_encode($data);\n exit;\n }",
"protected function view() {\n global $str;\n\n $data = parent::view();\n // name, inhalt, opt -> rechte, label,tooltip\n $data[] = new d_feld('prod_land', self::getProdLand(), null, 698);\n $data[] = new d_feld('gattung', $str->getStr($this->content['gattung']), null, 579);\n $data[] = new d_feld('prodtech', self::getThisProdTech(), null, 571);\n $data[] = new d_feld('laenge', $this->content['laenge'], null, 580);\n $data[] = new d_feld('fsk', $this->content['fsk'], null, 581);\n $data[] = new d_feld('praedikat', $str->getStr($this->content['praedikat']), null, 582);\n $data[] = new d_feld('bildformat', self::getBildformat(), null, 608);\n $data[] = new d_feld('mediaspezi', self::getThisMediaSpez(), null, 583);\n $data[] = new d_feld('urauff', $this->content['urauffuehr'], null, 584);\n $data[] = new d_feld('regie', self::getRegie(), null, 1000);\n\n return $data;\n }",
"public function index(){\n\n\t\t//memanggil file view\n\t\t$this->load->view('variabelview', $data);//file view\n\t\t//deklarasi data\n\t\t$data = ['variabel1' => 'Data variabel ke-1', 'variabel2' => 'Data variabel ke-2'];\n\t}",
"function view($data)\n{\n\t\t\n\tstartOfPage();\n\tstartContent();\t\n\t$users = $data[\"users\"];\n\techo '<table><tr><th>USERNAME</th><th>EMAIL</th></tr>';\n\tif (!empty($users))\n\t{\n\tforeach ($users as $user)\n\t\t{\n\t\techo '<tr><td>',$user[\"username\"],'</td>';\n\t\techo '<td>',$user[\"email\"],'</td></tr>';\n\t\t}\n\n }\n echo '</table>';\n\tendContent();\n\tendOfPage();\n\n}",
"function generalTemplate ($data){\n\t\t\tob_start();\t\t\n\t\t\tif(isset($data['title']) and isset($data['description'])):\n\t\t\t?>\n\t\t\t<div class=\"title text\">\n\t\t\t\t<h1><?php echo $data['title']; ?></h1>\n\t\t\t</div>\n \n <div id=\"description text\">\n\t\t\t\t<?php echo $data['description']; ?>\n </div>\n\t\t\t<?php\n\t\t\tendif;\n\t\t\t$output = ob_get_contents();\n\t\t\tob_end_clean();\t\n\t\t\t\n\t\t\treturn $output;\n\t\t}",
"function render(){\n\t\tinclude '../Locale/Strings_' . $_SESSION['idioma'] . '.php';\n\n\t\t?>\n\t\t<head>\n\t\t\t<title class=\"TShowC\"><?php echo $strings['TShowC']; ?></title>\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"../View/css/estilo.css\"> \n\t\t</head>\n\n\t\t<?php include '../View/Header.php'; //header necesita los strings ?>\n\n\t\t<h1 class=\"TShowC\"><?php echo $strings['TShowC']; ?></h1>\n\t\t<table border=\"1\">\n\t\t\t<!--Campos que se van a mostrar-->\n\t\t\t<th>\n\t\t\t\tDNI\n\t\t\t</th>\n\t\t\t<th class=\"name\">\n\t\t\t\t<?php echo $strings['name']; ?>\n\t\t\t</th>\n\t\t\t<th class=\"surname\">\n\t\t\t\t<?php echo $strings['surname']; ?>\n\t\t\t</th>\n\t\t\t<th class=\"Area\">\n\t\t\t\tArea\n\t\t\t</th>\n\t\t\t<th class=\"departamento\">\n\t\t\t\t<?php echo $strings['departamento']; ?>\n\t\t\t</th>\n\n\t\t\t<tr>\n\t\t\t\t<!--Campos con los valores del usuario del dni-->\n\t\t\t\t<td>\n\t\t\t\t\t<?php echo $this->lista['DNI'] ; ?>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<?php \n\t\t\t\t\techo $this->lista['NOMBREPROFESOR']; ?>\t\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<?php echo $this->lista['APELLIDOSPROFESOR'] ; ?>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<?php echo $this->lista['AREAPROFESOR'] ; ?>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<?php echo $this->lista['DEPARTAMENTOPROFESOR'] ; ?>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<a href = \"../Controller/PROFESOR_Controller.php?action=EDIT&&DNI=<?php echo $this->lista['DNI']; ?>\" > \n\t\t\t\t\t\t<img src='../View/icon/edituser.ico'>\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<a href = \"../Controller/PROFESOR_Controller.php?action=DELETE&&DNI=<?php echo $this->lista['DNI']; ?>\" > \n\t\t\t\t\t\t<img src='../View/icon/deleteuser.ico'>\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t</table>\n\n\t\t<p><?php echo $strings['profTitAso']; ?></p>\n\t\t<?php if($this->titulaciones != null){ ?>\n\t\t<ul>\n\t\t\t<?php foreach ($this->titulaciones as $key ) { ?>\n\n\t\t\t\t<li>\n\t\t\t\t\t<a href = \"../Controller/PROF_TITULACION_Controller.php?action=SHOWCURRENT&&DNI=<?php echo $key['DNI']; ?>&&codT=<?php echo $key['CODTITULACION']; ?>\">\n\t\t\t\t\t\t<?php echo $key['DNI'] . \"-\" . $key['CODTITULACION'] ; ?>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t<?php } ?>\n\t\t</ul>\n\t\t<?php } ?>\n\n\t\t<p><?php echo $strings['profEspAso']; ?></p>\n\t\t<?php if($this->espacios != null){ ?>\n\t\t<ul>\n\t\t\t<?php foreach ($this->espacios as $key ) {?>\n\n\t\t\t\t<li>\n\t\t\t\t\t<a href = \"../Controller/PROF_ESPACIO_Controller.php?action=SHOWCURRENT&&DNI=<?php echo $key['DNI']; ?>&&codE=<?php echo $key['CODESPACIO']; ?>\">\n\t\t\t\t\t\t<?php echo $key['DNI'] . \"-\" . $key['CODESPACIO'] ; ?>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t<?php } ?>\n\t\t</ul>\n\n\t\t<?php } ?>\n\n\t\t<br>\n\n\t\t<a href='../Controller/PROFESOR_Controller.php'><img src=\"../View/icon/back.ico\" height=\"32\" width=\"32\"> </a>\n\n\t\t<?php\n\t\tinclude '../View/Footer.php';\n\t}",
"protected abstract function renderOne(array $data);",
"function render($data){\n\t $head = new htmlHeader($this);\n\t\t$data2['title'] = \"Five Thousand Characters - Write Something\";\n\t\t$head->render($data2);\n\n// $data['title']=\"\";\n// $data['author']=\"\";\n// $data['identifier']=\"\";\n// $data['story']=\"\";\n\t\t?>\n\t\t<h1 style=\"text-align: center\">\n\t\t\t<a href=\"index.php?c=GodController&m=loadLandingPage\">\n\t\t\tFive Thousand Characters</a> - Write Something\n </h1>\n\n\t\t<form method=\"post\" action=\"index.php\">\n <input type=\"hidden\" name=\"c\" value=\"GodController\">\n <input type=\"hidden\" name=\"m\" value=\"processWriteSomething\">\n\t\t\t\t<label for=\"title\">Title</label> <br>\n\t\t\t\t\t<input type=\"text\" id =\"title\" name =\"title\" value=\"<?=$data['title']?>\"/>\n\t\t\t\t\t<br> <!-- -->\n\t\t\t\t<label for=\"author\">Author</label> <br>\n\t\t\t\t\t<input type=\"text\" id =\"author\" name=\"author\" value=\"<?=$data['author']?>\"/>\n\t\t\t\t\t<br>\n\t\t\t\t<label for=\"identifier\">Identifier</label> <br>\n\t\t\t\t\t<input type=\"text\" id =\"identifier\" name=\"identifier\" value=\"<?=$data['identifier']?>\"/>\n\t\t\t\t\t<br>\n <label for=\"Genre\">Genre</label><br>\n <?php\n $genreSelector = new GenreSelector();\n $genreSelector->render($data);\n ?>\n <br>\n <label for=\"story\">Story</label><br>\n\t\t\t\t<textarea id=\"story\" name = \"story\" rows=\"5\" cols=\"40\"><?=$data['story']?></textarea> <br>\n\n\t\t\t\t<button type=\"reset\">Reset</button>\n\t\t\t\t<button type=\"submit\">Save</button>\n\t\t\t</form>\n <label><?=$data['Message'] ?></label>\n\t\t\t<?php\n\n\t\t\t$footer = new htmlFooter($this);\n\t\t\t$footer->render($this);\n\t}",
"protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $limit = $this->property('limit') ?: 0;\n $this->vars['rows'] = $limit > 0\n ? array_slice($rows, 0, $limit)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotals();\n }",
"protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $number = $this->property('number') ?: 0;\n $this->vars['rows'] = $number > 0\n ? array_slice($rows, 0, $number)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotalsForAllResults()[$this->property('metric')];\n }",
"public function render(array $__data = array())\n {\n // bring variables forward\n foreach ($__data as $_name => $_value) {\n $$_name = $_value;\n }\n\n // buffer handling\n ob_start();\n include $this->_template;\n $_response = ob_get_contents();\n ob_end_clean();\n\n // return rendered response\n return $_response;\n }",
"public function render(array $data): string;",
"public function render($name, array $data = array());",
"public function afficheOeuvres($aData = Array()) {\n\t\t\n\t\t?>\n\t\t <section class=\"contenu listeOeuvres\">\n \t<section class=\"recherche\"></section>\n <section class=\"oeuvres flex flex-col\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ($aData as $cle => $oeuvre) {\n\t\t\t\t\t\t\textract($oeuvre);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<section class=\"oeuvre flex flex-row\">\n\t\t\t <span class=\"titre\"><?php echo $Titre?></span>\n\t\t\t <span class =\"description\"> <?php echo $Description ?> </span>\n\t\t\t <span class=\"arrondissement\"><?php echo $Arrondissement?></span>\n\t\t\t <span class=\"action flex-droite\">[x] <a href=\"/artPublic/api/admin/oeuvre/<?php echo $id ?>\">[modif]</a></span>\n\t\t\t \n\t\t\t </section>\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</section>\n\t\t\t\t\n\t\t\t</section>\n\t\t\t\n\t\t<?php\n\t\t\n\t}",
"public static function renderContent($page_data) {\n\t\techo '<h1>SOFTBAL</h1>'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Jak říká <a href=\"http://cs.wikipedia.org/wiki/Softball\" target=\"_blank\" title=\"Softbal na wikipedii\">wikipedie</a>: \"Softbal je kolektivní míčový sport, vyvinutý z baseballu jako jeho rychlejší a na prostor méně náročná verze.\" Rozepisovat tu pravidla podle mého cenu nemá, každý nechť si to v případě zájmu dohledá. Důležitější je, že je pro mě softbal důležitou součástí života, oblíbenou volnočasovou aktivitou, záminkou k cestování a také společenskou záležitostí.'.PHP_EOL;\n\t\techo '</p>'.PHP_EOL;\n\t\techo '<h2>KARIÉRA</h2>'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Softbalisti hrají na statistiky. Kdo říká, že ne, tak kecá :) Současný klub <strong>Mistrál Praha</strong> mi mé výkony posledních dvou sezón zatím tají, tak aspoň přehled z předchozích šesti let v <strong>MFF Neratovice</strong>'.PHP_EOL;\n\t\techo '</p>'.PHP_EOL;\n\t\t// stats\n\t\techo '<table>'.PHP_EOL;\n\t\t\techo '<tr>'.PHP_EOL;\n\t\t\t\techo '<th>Sezóna</th>'.PHP_EOL;\n\t\t\t\techo '<th></th>'.PHP_EOL;\n\t\t\t\techo '<th>G</th>'.PHP_EOL;\n\t\t\t\techo '<th>AB</th>'.PHP_EOL;\n\t\t\t\techo '<th>BA</th>'.PHP_EOL;\n\t\t\t\techo '<th>H</th>'.PHP_EOL;\n\t\t\t echo '<th>2B</th>'.PHP_EOL;\n\t\t\t\techo '<th>3B</th>'.PHP_EOL;\n\t\t\t\techo '<th>HR</th>'.PHP_EOL;\n\t\t\t\techo '<th>R</th>'.PHP_EOL;\n\t\t\t\techo '<th>RBI</th>'.PHP_EOL;\n\t\t\t\techo '<th>BB</th>'.PHP_EOL;\n\t\t\t\techo '<th>HB</th>'.PHP_EOL;\n\t\t\t\techo '<th>SH</th>'.PHP_EOL;\n\t\t\t\techo '<th>SB</th>'.PHP_EOL;\n\t\t\t\techo '<th>SO</th>'.PHP_EOL;\n\t\t\t\techo '<th>O</th>'.PHP_EOL;\n\t\t\t\techo '<th></th>'.PHP_EOL;\n\t\t\t\techo '<th>IP</th>'.PHP_EOL;\n\t\t\t\techo '<th>PO</th>'.PHP_EOL;\n\t\t\t\techo '<th>A</th>'.PHP_EOL;\n\t\t\t\techo '<th>E</th>'.PHP_EOL;\n\t\t\t\techo '<th>FA</th>'.PHP_EOL;\n\t\t\techo '</tr>'.PHP_EOL;\n\t\t\tif (!empty($page_data[\"stats\"])) {\n\t\t\t\tforeach ($page_data[\"stats\"] as $row) {\n\t\t\t\t\techo '<tr>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"year\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td></td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"G\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"AB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"BA\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"H\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"2B\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"3B\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"HR\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"R\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"RBI\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"BB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"HB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"SH\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"SB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"SO\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"O\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td></td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"IP\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"PO\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"A\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"E\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"FA\"].'</td>'.PHP_EOL;\n\t\t\t\t\techo '</tr>'.PHP_EOL;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// no stats found\n\t\t\t\techo '<tr><td colspan=\"23\">Nenalezeny žádné statistiky</td></tr>'.PHP_EOL;\n\t\t\t}\n\t\techo '</table>'.PHP_EOL;\n\t\t// other soft\n\t\techo '<h2>ČESKÉ AKADEMICKÉ HRY</h2>'.PHP_EOL;\n\t\techo '<img src=\"/web/images/soft_akada.jpg\" title=\"ČAH\" alt=\"ČAH\" />'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Od roku 2009 se pravidelně účastním Českých akademických her v softbalu. Nejprve dvakrát v dresu Univerzity Karlovy a od roku 2011 zkoušíme prorazit s týmem VŠE. Jsem tronásobný akademický mistr republiky v tomto sportu: 2009 v Plzni s UK, 2010 v Praze s UK a 2014 v Liberci s VŠE.'.PHP_EOL;\n\t\techo '</p>'.PHP_EOL;\n\t\techo '<h2>ROZHODČÍ</h2>'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Krom toho, že mě softbal baví hrát, věnuju se také funkci rozhodčího. Rozhodčím není příliš těžké se u nás stát - stačí chtít, začít je možné prakticky hned. I já začal jako samouk v nižších soutěžích, kde si týmy často pískají navzájem, od počátku roku 2012 jsem pak oficiálně vyškolen ČSA. Od podzimu 2012 pak občas vypomáhám i v nižších soutěžích pražského baseballu. Ačkoliv je to občas vypjaté, tak mě baví zodpovědnost, kterou tato pozice přináší. A samozřejmě je tu motivační faktor finanční odměny, která není vůbec špatná.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\t\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'V roce 2012 jsem odřídil něco přes 40 zápasů, v roce 2013 celkem 110, v roce 2014 asi 35 a v roce 2015 kolem třiceti. Nakoukl jsem už i do nejvyšší mužské a ženské soutěže u nás a letos jsem byl dokonce vyslán na jeden dvojzápas do Rakouska.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\t\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Zde je můj <a href=\"http://softball.cz/modules.php?op=modload&name=infosys&file=index&do=umpires&co=dirview&umid=85&pda=2\">rozhodcovský profil</a> na webu ČSA, kde jsou uvedeny počty nominací v nejvyšších dvou soutěžích a ligových pohárech.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\t\n\t\techo '<h2>ZAPISOVATEL</h2>'.PHP_EOL;\t\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'O tomto víc <a href=\"/work-scorer\" title=\"Zápis baseball/softbal\">na jiné stránce</a>, ale patří to k softbalu také.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\n\t}",
"private function render_data()\n\t{\n\t\t// create if the headers exists\n\t\t// 2 header style table\n\t\tif(count($this->headers) == 2 && isset($this->headers[0][0]) && isset($this->headers[1][0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr><th></th>';\n\t\t\tforeach($this->headers[0] as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the row headers and the data\n\t\t\tfor($i=0; $i<count($this->headers[1]); $i++)\n\t\t\t{\n\t\t\t\t// the header\n\t\t\t\t$html .= \"<tr><th>{$this->headers[1][$i]}</th>\";\n\t\t\t\t\n\t\t\t\t// and now the data\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\t// 1 header style table\n\t\tif(count($this->headers) > 0 && isset($this->headers[0]) && !is_array($this->headers[0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr>';\n\t\t\tforeach($this->headers as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the data\n\t\t\tfor($i=0; $i<count($this->data); $i++)\n\t\t\t{\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\treturn '';\n\t}",
"function setFormData($data) {\r\n\t\t$data['why_use'] = $this->load->view('common/why_use_view', $data, TRUE);\r\n\t\t\r\n\t\t// load search block\r\n\t\t$data = buildTourSearchCriteria($data);\r\n\t\t\r\n\t\t$data['inc_css'] = get_static_resources('ads.min.css');\r\n\t\t\r\n\t\treturn $data;\r\n\t}",
"public function load( $data ){\n\t\t\n\t\t//\tshow current user\n\t\tif($this->currentUser){\n\t\t\t$data['currentUser'] = $this->ci->load->view('templates/current_user', $this->currentUser, TRUE);\n\t\t} else {\n\t\t\t$data['currentUser'] = '';\n\t\t}\n\t\t\n\t\t$data['title'] = $this->PRE_TITLE . $data['title'];\n\t\t\n\t\t//\tprep JavaScript\n\t\tif( empty( $data['js'] ) || !isset( $data['js'] ) ){\n\t\t\t$data['js'] = array( 'main.js' );\n\t\t} else {\n\t\t\tarray_unshift( $data['js'], 'main.js' );\t\n\t\t}\n\t\t//\tprepend JS url to each\n\t\tfor($i=0; $i<count($data['js']); $i++){\n\t\t\tif( strpos( $data['js'][$i], 'http' ) === FALSE ){\n\t\t\t\t$data['js'][$i] = $this->JS_URL . $data['js'][$i];\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\tprep CSS\n\t\tif( empty( $data['css'] ) || !isset( $data['css'] ) ){\n\t\t\t$data['css'] = $this->CSS_URL . 'main.css';\n\t\t} else {\n\t\t\t$data['css'] = $this->CSS_URL . $data['css'];\n\t\t}\n\t\t\n\t\t$this->ci->load->view('templates/template', $data);\n\t}",
"public function render()\r\n {\r\n $this->data['menu'] = build_menu(\r\n $this->choices, $this->uri->segment(1));\r\n \r\n $this->data['header'] = $this->parser->parse(\r\n '_header', $this->data, true);\r\n $this->data['content'] = $this->parser->parse(\r\n $this->data['page_body'], $this->data, true);\r\n $this->data['footer'] = $this->parser->parse(\r\n '_footer', $this->data, true);\r\n \r\n $this->data['data'] = &$this->data;\r\n \r\n $this->parser->parse('_template', $this->data);\r\n }",
"public function render( $data = null )\r\n\t{\r\n\t\tload_bootstrap( 'intouch' );\r\n\t\t\r\n\t\t// Compatibility check\r\n\t\tif (! check_compatible( 'dunamis' ) ) $this->setAlert( 'alert.dunamis.compatible', 'error' );\r\n\t\t\r\n\t\t$title\t= $this->buildTitle();\r\n\t\t$navbar\t= $this->buildNavigation();\r\n\t\t$alerts\t= $this->buildAlerts();\r\n\t\t$modals\t= $this->buildModals();\r\n\t\t\r\n\t\t$baseurl = get_baseurl( 'intouch' );\r\n\t\t$doc = dunloader( 'document', true );\r\n\t\t\r\n\t\t$doc->addStyleDeclaration( '#contentarea > div > h1, #content > h1 { display: none; }' );\t// Wipes out WHMCS' h1\r\n\t\t$doc->addStyleDeclaration( '.contentarea > h1 { display: none; }' );\t// Wipes out WHMCS' h1 in 5.0.3\r\n\t\t$doc->addStylesheet( get_baseurl( 'intouch' ) . 'assets/admin.css' );\r\n\t\t\r\n\t\treturn \t\t'<div style=\"float:left;width:100%;\">'\r\n\t\t\t\t.\t'<div id=\"intouch\">'\r\n\t\t\t\t.\t'\t' . $title\r\n\t\t\t\t.\t'\t' . $navbar\r\n\t\t\t\t.\t'\t' . $alerts\r\n\t\t\t\t.\t'\t' . $data\r\n\t\t\t\t.\t'\t' . $modals\r\n\t\t\t\t.\t'</div>'\r\n\t\t\t\t.\t'</div>';\r\n\t}",
"public function renderData(array $data)\n\t{\n\t\treturn $this->_format($this->_print($data));\n\t}",
"protected function render( $data ) {\n\n\t\t// begin rendering\n\t\techo $data[ 'headelement' ];\n\t\t?>\n\t\t<div id=\"mw-mf-viewport\">\n\t\t\t<div id=\"mw-mf-page-left\" class=\"navigation-drawer\">\n\t\t\t\t<?php\n\t\t\t\t\t$this->renderMainMenu( $data );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<div id='mw-mf-page-center'>\n\t\t\t\t<?php\n\t\t\t\t\tforeach( $this->data['banners'] as $banner ):\n\t\t\t\t\t\techo $banner;\n\t\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t\t<div class=\"header\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$this->html( 'menuButton' );\n\t\t\t\t\t\tif ( $data['disableSearchAndFooter'] ) {\n\t\t\t\t\t\t\techo $data['specialPageHeader'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<form action=\"<?php echo $data['wgScript'] ?>\" class=\"search-box\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo $this->makeSearchInput( $data['searchBox'] );\n\t\t\t\t\t\t\t// FIXME: change this into a search icon instead of a text button\n\t\t\t\t\t\t\techo $this->makeSearchButton(\n\t\t\t\t\t\t\t\t'fulltext',\n\t\t\t\t\t\t\t\tarray( 'class' => 'searchSubmit mw-ui-button mw-ui-progressive' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo $data['secondaryButton'];\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<!--placeHolderForHeader 资料-->\n\t\t\t\t<div id=\"content_wrapper\">\n\t\t\t\t<?php\n\t\t\t\t\t$this->renderContentWrapper( $data );\n\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t\t\t$this->renderFooter( $data );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t\techo $data['reporttime'];\n\t\t\techo $data['bottomscripts'];\n\t\t?>\n\t\t</body>\n\t\t</html>\n\t\t<?php\n\t}",
"function jabatan_data()\n\t{\t\t\n\t\t$data['j'] = $this->M_master->data_jabatan();\t\n\t\t$data['title'] = 'Data Jabatan';\t\t\n\t\t$data['isi'] = 'contents/jabatan_data';\n\t\t$this->load->view('wrapper', $data);\n\t}",
"public function render($data = null)\n {\n $templateData = is_null($data) ? $this->data : $data;\n $html = $this->template;\n // Substitute the actual values into the token locations\n foreach ($templateData as $key => $value) {\n $token = '{{' . $key . '}}'; // {{content}}\n $html = str_replace($token, $value, $html);\n }\n return $html;\n }",
"protected function render($passedData =array(),$view_file= '',$returnData=FALSE,$header_tpl='common/header.tpl.php',$footer_tpl='common/footer.tpl.php')\r\r\n {\r\r\n try\r\r\n {\r\r\n $returnViewData = '';\r\r\n if($view_file==''){\r\r\n $view_file .= $this->router->class;\r\r\n $view_file .='/'.$this->router->method.'.tpl.php'; \r\r\n }\r\r\n $passedData['site_title'] = 'Mydealfo';\r\r\n $passedData['site_meta_keywords'] = '';\r\r\n $passedData['site_meta_description'] = '';\r\r\n $passedData['site_meta_tags'] = '';\r\r\n $passedData['site_copyright'] = '© Deal Aggregator';\r\r\n \r\r\n $returnViewData .= $this->load->view($header_tpl,$passedData,$returnData);\r\r\n $returnViewData .= $this->load->view($view_file,$passedData,$returnData);\r\r\n $returnViewData .= $this->load->view($footer_tpl,$passedData,$returnData);\r\r\n return $returnViewData;\r\r\n }\r\r\n catch(Exception $err_obj)\r\r\n {\r\r\n show_error($err_obj->getMessage());\r\r\n } \r\r\n\r\r\n }",
"public function index()\n {\n \t$data=$this->data;\n \t$this->load->view('template',$data);\n \t\n }",
"public function render($data)\n {\n $result = array();\n $sizes = array();\n foreach($data as $i => $row)\n {\n foreach($this->columns as $c)\n {\n $sizes[$c] = max(mb_strlen($row[$c]), mb_strlen($c), isset($sizes[$c]) ? $sizes[$c] : 8);\n }\n }\n\n // render headers\n $this->renderSeparatorLine($sizes);\n foreach($this->columns as $c)\n {\n $size = $sizes[$c];\n printf(' %-'.$size.'s |', $c);\n }\n echo \"\\n\";\n $this->renderSeparatorLine($sizes);\n\n foreach($data as $i => $row)\n {\n foreach($this->columns as $c)\n {\n $item = $row[$c];\n $size = $sizes[$c];\n printf(' %-'.$size.'s |', $item);\n }\n echo \"\\n\";\n }\n $this->renderSeparatorLine($sizes);\n }",
"public function render($data): string;",
"abstract public function render($data, $args = array());",
"private function render( $file_name, $data = array() )\n {\n \\extract($data);\n \\ob_start();\n include PROJECT_DIR . '/src/views/' . $file_name;\n }",
"function render($view, $data = array(), $return_html = FALSE) {\n\t\t\n\t\textract($data);\n\t\t\n\t\t// globalize variables as workaround to weird extract bug\n\t\tforeach($data AS $key => $val){\n\t\t\tglobal ${$key};\n\t\t\t${$key} = $val;\n\t\t}\n\n\t\t\n\t\t$view = str_replace(EXT,\"\",$view); // just a little clean up here\n\t\t\t\t\n\t\t$projectnum = $this->config->item('projectnum');\n\t\t\t\t\n\t\t$module = str_replace(APPPATH,\"\",$this->module_path);\n\t\t$module = str_replace(\"custom_modules/\",\"\",$module);\n\t\t$module = str_replace(\"core_modules/\",\"\",$module);\t\n\t\t$module = str_replace($projectnum . \"_modules/\",\"\",$module);\t\n\t\t$module = str_replace(\"/widgets/\",\"\",$module);\t\n\t\t\n\n\n\t\t$viewfiles = array();\n\t\t\n\t\t$pathfix = str_replace(APPPATH,\"\",$this->module_path);\n\t\t$pathfix = str_replace(\"core_modules\",\"modules\",$pathfix);\n\t\t$pathfix = str_replace(\"custom_modules\",\"modules\",$pathfix);\n\t\t\n\t\t\n\t\t$viewfiles[] = TEMPLATEPATH . \"/modules/{$projectnum}/{$module}/standard/widgets/\" . $view.EXT;\n\t\t$viewfiles[] = TEMPLATEPATH . \"/modules/default/{$module}/standard/widgets/\" . $view.EXT;\n\t\t\n\t\t$viewfiles[] = APPPATH . $projectnum . \"/\" . $pathfix . \"views/standard/\" . $view.EXT;\n\t\t\n\t\t$viewfiles[] = APPPATH . $projectnum . \"/\" . $pathfix . \"views/\" . $view.EXT;\n\t\t\n\t\t$viewfiles[] = $this->module_path.'views/'.$projectnum . \"/\" . $view.EXT;\n\t\t\n\t\t$viewfiles[] = $this->module_path.'views/'.$view.EXT;\n\t\t\n\t\t\t\n\t\tforeach($viewfiles as $file){\n\t\t\t\t\n\t\t\t//echo \" SEEKING $file <br />\";\n\t\n\t\t\tif(file_exists($file)){\n\t\t\t\n\t\t\t\tif($return_html){\n\t\t\t\t\tob_start();\n\t\t\t\t}\t\n\t\t\t\tinclude($file);\n\t\t\t\t\n\t\t\t\tif($return_html){\n\t\t\t\t\n\t\t\t\t\t$return_html = ob_get_contents();\n\t\t\t\t\tob_end_clean();\n\t\t\t\t\t\n\t\t\t\t\treturn $return_html;\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\t\t\n\t}",
"private function _template($data, $view)\n\t{\n\t\t$this->load->view('mahasiswa/views/' . $view, $data);\n\t}",
"private function _template($data, $view)\n\t{\n\t\t$this->load->view('mahasiswa/views/' . $view, $data);\n\t}",
"public static function render($filePath, array $data = null) \n {\n //this try block is excecuted to enable throwing and catching of errors as appropriate\n try {\n\n //get the variables passed and make them available to the view\n if ( $data != null)\n {\n //loop through the array setting the respective variables\n foreach ($data as $key => $value) \n {\n $$key = $value;\n\n }\n\n }\n\n //get the parsed contents of the template file\n $contents = self::getContents($filePath);\n\n //start the output buffer\n ob_start();\n\n //evaluate the contents of this view file\n eval(\"?>\" . $contents . \"<?\");\n\n //get the evaluated contents\n $contents = ob_get_contents();\n\n //clean the output buffer\n ob_end_clean();\n\n //return the evaluated contents\n echo $contents;\n\n //stop further script execution\n exit();\n \n }\n\n catch(BaseException $e) {\n\n //echo $e->getMessage();\n $e->show();\n\n }\n\n catch(Exception $e) {\n\n echo $e->getMessage();\n \n }\n\n }",
"function index() {\n #Création d'un objet Data\n $data = new Data();\n #On récupère la vue correspondante\n $data->content = \"homeView.php\";\n #On crée le bouton Home du menu\n $data->menu['Home'] = \"index.php\";\n #On crée le bouton A propos du menu\n $data->menu['A Propos'] = \"index.php?action=aPropos\";\n #On définit la taille par défaut des images\n $size = 480;\n #On crée le bouton Voir photos du menu qui permet de voir les photos\n $data->menu['Voir Photos'] = \"index.php?controller=photo&action=index&size=$size\";\n #On vérifie qu'un utilisateur est connecté\n #Si aucun utilisateur est connecté on crée les boutons Identification est S'inscrire\n if(!isset($_SESSION['id'])) {\n $data->menuHeader['Identification'] = \"index.php?controller=login&action=index\";\n $data->menuHeader['S\\'inscrire'] = \"index.php?controller=inscription&action=index\";\n #Sinon on crée un bouton déconnexion\n } else {\n $data->menuHeader['Déconnexion'] = \"index.php?controller=login&action=deconnexion\";\n }\n #On récupère la vue principale\n require_once \"view/mainView.php\";\n }",
"protected function render($view, $data){\n\n\t\tif(! $this->input->is_ajax_request()){\n\n\t\t\t$this->load->view($this->_header, $data);\n\t\t\t$this->load->view($this->_sidebar, $data);\n\t\t}\n\n\t\t$this->load->view($view, $data);\n\n\t\tif(! $this->input->is_ajax_request())\n\t\t\t$this->load->view($this->_footer, $data);\n\t}",
"public function renderJSON($data)\n {\n header('Content-Type: application/json');\n echo json_encode($data);\n }",
"public function render($data, $file)\n\t{\n\t\t\\Base::instance()->mset($data);\n\t\treturn \\Template::instance()->render($file);\n\t}",
"function renderRow(& $data) \n {\n $title = $this->_highlightText($data['title']);\n $text = $this->_highlightText($data['text']);\n if ($data['persite'] != 0) {\n $row = str_replace('{title}', $title, $this->_rowTemplate);\n $row = str_replace('{text}', $text, $row);\n $row = str_replace('{url}', $data['url'], $row);\n $this->_html .= $row;\n $row = str_replace('{title}', \n $data['persite'].\" results\", \n $this->_rowDetailTemplate);\n $row = str_replace('{text}', $data['lastmod'], $row);\n $url = $_SERVER['PHP_SELF'].'?'.\n $this->_http_parameters['query'].'='.\n urlencode($this->_query).\n '&'.$this->_http_parameters['siteid'].'='.$data['siteid'];\n $row = str_replace('{url}', $url, $row);\n $this->_html .= $row;\n } else {\n $row = str_replace('{title}', $title, $this->_rowTemplate);\n $row = str_replace('{text}', $text, $row);\n $row = str_replace('{url}', $data['url'], $row);\n $this->_html .= $row;\n $row = str_replace('{title}', \"\", $this->_rowDetailTemplate);\n $row = str_replace('{text}', $data['lastmod'], $row);\n $row = str_replace('{url}', $data['url'], $row);\n $this->_html .= $row;\n }\n }",
"protected function render( $page_name , $data )\n\t {\n\t \t//append security headers\n\t \t$this->append_security_headers( $data );\n\t \tif( $this->_app_mode === 'json' )\n\t \t{\n\t \t\t//exits at once !\n\t \t\treturn $this->render_json( $data );\n\t \t}\n\t \t$this->load->view('admin/html/partials/head' , $data );\n\t \t$this->load->view('admin/html/' . $page_name , $data );\n\t \t//$this->load->view\n\t }",
"public function data_blok()\n {\n $data = ['aktif' => 'blok',\n 'data_blok' => $this->M_prospektus->tampil_data_blok(),\n 'kawasan' => $this->M_prospektus->get_data_kawasan()->result_array()\n ];\n\n $this->template->load('template','prospektus/V_data_blok', $data);\n }",
"function index()\n {\n //call some deafaults not to spoil template\n $data=$this->default_data();\n $this->template($data);\n\n }",
"public function run() {\n\n $data = [\n [\n 'title' => 'Über uns',\n 'text' => '<p>Unser veggiemobil Foodtruck zeichnet sich durch seine abwechslungsreiche und wechselnde, vegane Speisekarte aus. Alle Speisen werden täglich frisch selbst gekocht. Hierbei verwenden wir nur beste Zutaten.<br>\n Die Zusammensetzung unserer Gerichte entwickeln wir ständig neu und selbst. Keine Fertig-Patties, keine Fertig-Soßen, keine Fertig-Dips! Bei unserem Champion-Burger zum Beispiel werden unter anderem frische Champignons, Walnüsse, Kräuter zum Bratling verarbeitet.</p>\n <p>Der veggiemobil Foodtruck vereint gute vegane Hausmannskost, moderne arabische und europäische Küche.</p>',\n 'menus' => [ 1, 2 ],\n 'template' => 'page'\n ], [\n 'title' => 'Speisen',\n 'template' => 'speisen',\n 'text' => '<p>Uns zeichnet ein vielfältiges variierendes Angebot aus, welches wir ständig durch neue eigene Kreationen erweitern.</p><p>Für Anregungen und Wünsche sind wir immer gerne offen.</p>',\n 'menus' => [ 1, 2 ]\n ], [\n 'title' => 'Events',\n 'text' => '<p>Hier finden Sie Bilder zu einigen Highlights unser Truck-Touren.</p><p>Buchen auch Sie uns für Ihr Event!</p>',\n 'menus' => [ 1, 2 ],\n 'template' => 'events'\n ], [\n 'title' => 'Kontakt',\n 'text' => '<p><a href=\"mailto:[email protected]\">[email protected]</a><br />mobil 0160 7744836<br />tel 06082 931144<br /><br />Birgit Jung<br />Vordergasse 10<br />65529 Waldems</p>',\n 'menus' => [ 2 ],\n 'template' => 'page'\n ], [\n 'title' => 'Facebook',\n 'text' => '',\n 'external_url' => 'https://de-de.facebook.com/Veggiemobil-1058562850840870/',\n 'menus' => [ 4 ]\n ], [\n 'title' => 'Instagram',\n 'text' => '',\n 'external_url' => 'https://instagram.com/veggiemobil?igshid=5e3hggofsvla',\n 'menus' => [ 4 ]\n ], [\n 'title' => 'Impressum',\n 'text' => '<p>Angaben gemäß § 5 TMG:</p>\n <p>Veggiemobil<br>\n Birgit Jung<br>\n Vordergasse 10<br>\n 65529 Waldems<br>\n <h3>Kontakt:</h3>\n <p>E-Mail: <a href=\"mailto:[email protected]\">[email protected]</a></p>\n <h2 class=\"mb-3\">Haftungsausschluss</h2>\n <h3>Haftung für Inhalte</h3>\n <p>Die Inhalte unserer Seiten wurden mit größter Sorgfalt erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 TMG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntnis einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von entsprechenden Rechtsverletzungen werden wir diese Inhalte umgehend entfernen.</p>\n <h3>Haftung für Links</h3>\n <p>Unser Angebot enthält Links zu externen Webseiten Dritter, auf deren Inhalte wir keinen Einfluss haben. Deshalb können für diese fremden Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten Seiten ist stets der jeweilige Anbieter oder Betreiber der Seiten verantwortlich. Die verlinkten Seiten wurden zum Zeitpunkt der Verlinkung auf mögliche Rechtsverstöße überprüft. Rechtswidrige Inhalte waren zum Zeitpunkt der Verlinkung nicht erkennbar. Eine permanente inhaltliche Kontrolle der verlinkten Seiten ist jedoch ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht zumutbar. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Links umgehend entfernen.</p>\n <h3>Urheberrecht</h3>\n <p>Die durch die Seitenbetreiber erstellten Inhalte und Werke auf diesen Seiten unterliegen dem deutschen Urheberrecht. Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung außerhalb der Grenzen des Urheberrechtes bedürfen der schriftlichen Zustimmung des jeweiligen Autors bzw. Erstellers. Downloads und Kopien dieser Seite sind nur für den privaten, nicht kommerziellen Gebrauch gestattet. Soweit die Inhalte auf dieser Seite nicht vom Betreiber erstellt wurden, werden die Urheberrechte Dritter beachtet. Insbesondere werden Inhalte Dritter als solche gekennzeichnet. Solltest du trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitte ich um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte umgehend entfernen.</p>\n <h3>Nachweise</h3>\n <p>Hintergrundbild von <a target=\"_blank\" href=\"https://pixabay.com/de/users/messomx-755571/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=1256804\">messomx</a> auf <a target=\"_blank\" href=\"https://pixabay.com/de/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=1256804\">Pixabay</a></p>\n ',\n 'menus' => [ 3 ]\n ], [\n 'title' => 'Datenschutz',\n 'text' => '\n <p>Wir freuen uns sehr über Ihr Interesse an unserem Service. Eine Nutzung der Internetseiten des Veggiemobils ist grundsätzlich ohne jede Angabe personenbezogener Daten möglich. Sofern eine betroffene Person besondere Services unseres Restaurants über unsere Internetseite in Anspruch nehmen möchte, könnte jedoch eine Verarbeitung personenbezogener Daten erforderlich werden. Ist die Verarbeitung personenbezogener Daten erforderlich und besteht für eine solche Verarbeitung keine gesetzliche Grundlage, holen wir generell eine Einwilligung der betroffenen Person ein.</p>\n <p>Die Verarbeitung personenbezogener Daten, beispielsweise des Namens, der Anschrift, E-Mail-Adresse oder Telefonnummer einer betroffenen Person, erfolgt stets im Einklang mit der Datenschutz-Grundverordnung und in Übereinstimmung mit den für das Veggiemobil geltenden landesspezifischen Datenschutzbestimmungen. Mittels dieser Datenschutzerklärung möchte unser Ensemble die Öffentlichkeit über Art, Umfang und Zweck der von uns erhobenen, genutzten und verarbeiteten personenbezogenen Daten informieren. Ferner werden betroffene Personen mittels dieser Datenschutzerklärung über die ihnen zustehenden Rechte aufgeklärt.</p>\n <p>Das Veggiemobil hat als für die Verarbeitung Verantwortlicher zahlreiche technische und organisatorische Maßnahmen umgesetzt, um einen möglichst lückenlosen Schutz der über diese Internetseite verarbeiteten personenbezogenen Daten sicherzustellen. Dennoch können internetbasierte Datenübertragungen grundsätzlich Sicherheitslücken aufweisen, sodass ein absoluter Schutz nicht gewährleistet werden kann. Aus diesem Grund steht es jeder betroffenen Person frei, personenbezogene Daten auch auf alternativen Wegen, beispielsweise telefonisch, an uns zu übermitteln.</p>\n <h4>1. Begriffsbestimmungen</h4>\n <p>Die Datenschutzerklärung beruht auf den Begrifflichkeiten, die durch den Europäischen Richtlinien- und Verordnungsgeber beim Erlass der Datenschutz-Grundverordnung (DS-GVO) verwendet wurden. Unsere Datenschutzerklärung soll für die Öffentlichkeit einfach lesbar und verständlich sein. Um dies zu gewährleisten, möchten wir vorab die verwendeten Begrifflichkeiten erläutern.</p>\n <p>Wir verwenden in dieser Datenschutzerklärung unter anderem die folgenden Begriffe:</p>\n <ul style=\"list-style: none;\">\n <li>\n <h4>a) personenbezogene Daten</h4>\n <p>Personenbezogene Daten sind alle Informationen, die sich auf eine identifizierte oder identifizierbare natürliche Person (im Folgenden „betroffene Person“) beziehen. Als identifizierbar wird eine natürliche Person angesehen, die direkt oder indirekt, insbesondere mittels Zuordnung zu einer Kennung wie einem Namen, zu einer Kennnummer, zu Standortdaten, zu einer Online-Kennung oder zu einem oder mehreren besonderen Merkmalen, die Ausdruck der physischen, physiologischen, genetischen, psychischen, wirtschaftlichen, kulturellen oder sozialen Identität dieser natürlichen Person sind, identifiziert werden kann.</li>\n <li>\n <h4>b) betroffene Person</h4>\n <p>Betroffene Person ist jede identifizierte oder identifizierbare natürliche Person, deren personenbezogene Daten von dem für die Verarbeitung Verantwortlichen verarbeitet werden.</li>\n <li>\n <h4>c) Verarbeitung</h4>\n <p>Verarbeitung ist jeder mit oder ohne Hilfe automatisierter Verfahren ausgeführte Vorgang oder jede solche Vorgangsreihe im Zusammenhang mit personenbezogenen Daten wie das Erheben, das Erfassen, die Organisation, das Ordnen, die Speicherung, die Anpassung oder Veränderung, das Auslesen, das Abfragen, die Verwendung, die Offenlegung durch Übermittlung, Verbreitung oder eine andere Form der Bereitstellung, den Abgleich oder die Verknüpfung, die Einschränkung, das Löschen oder die Vernichtung.</li>\n <li>\n <h4>d) Einschränkung der Verarbeitung</h4>\n <p>Einschränkung der Verarbeitung ist die Markierung gespeicherter personenbezogener Daten mit dem Ziel, ihre künftige Verarbeitung einzuschränken.</li>\n <li>\n <h4>e) Profiling</h4>\n <p>Profiling ist jede Art der automatisierten Verarbeitung personenbezogener Daten, die darin besteht, dass diese personenbezogenen Daten verwendet werden, um bestimmte persönliche Aspekte, die sich auf eine natürliche Person beziehen, zu bewerten, insbesondere, um Aspekte bezüglich Arbeitsleistung, wirtschaftlicher Lage, Gesundheit, persönlicher Vorlieben, Interessen, Zuverlässigkeit, Verhalten, Aufenthaltsort oder Ortswechsel dieser natürlichen Person zu analysieren oder vorherzusagen.</li>\n <li>\n <h4>f) Pseudonymisierung</h4>\n <p>Pseudonymisierung ist die Verarbeitung personenbezogener Daten in einer Weise, auf welche die personenbezogenen Daten ohne Hinzuziehung zusätzlicher Informationen nicht mehr einer spezifischen betroffenen Person zugeordnet werden können, sofern diese zusätzlichen Informationen gesondert aufbewahrt werden und technischen und organisatorischen Maßnahmen unterliegen, die gewährleisten, dass die personenbezogenen Daten nicht einer identifizierten oder identifizierbaren natürlichen Person zugewiesen werden.</li>\n <li>\n <h4>g) Verantwortlicher oder für die Verarbeitung Verantwortlicher</h4>\n <p>Verantwortlicher oder für die Verarbeitung Verantwortlicher ist die natürliche oder juristische Person, Behörde, Einrichtung oder andere Stelle, die allein oder gemeinsam mit anderen über die Zwecke und Mittel der Verarbeitung von personenbezogenen Daten entscheidet. Sind die Zwecke und Mittel dieser Verarbeitung durch das Unionsrecht oder das Recht der Mitgliedstaaten vorgegeben, so kann der Verantwortliche beziehungsweise können die bestimmten Kriterien seiner Benennung nach dem Unionsrecht oder dem Recht der Mitgliedstaaten vorgesehen werden.</li>\n <li>\n <h4>h) Auftragsverarbeiter</h4>\n <p>Auftragsverarbeiter ist eine natürliche oder juristische Person, Behörde, Einrichtung oder andere Stelle, die personenbezogene Daten im Auftrag des Verantwortlichen verarbeitet.</li>\n <li>\n <h4>i) Empfänger</h4>\n <p>Empfänger ist eine natürliche oder juristische Person, Behörde, Einrichtung oder andere Stelle, der personenbezogene Daten offengelegt werden, unabhängig davon, ob es sich bei ihr um einen Dritten handelt oder nicht. Behörden, die im Rahmen eines bestimmten Untersuchungsauftrags nach dem Unionsrecht oder dem Recht der Mitgliedstaaten möglicherweise personenbezogene Daten erhalten, gelten jedoch nicht als Empfänger.</li>\n <li>\n <h4>j) Dritter</h4>\n <p>Dritter ist eine natürliche oder juristische Person, Behörde, Einrichtung oder andere Stelle außer der betroffenen Person, dem Verantwortlichen, dem Auftragsverarbeiter und den Personen, die unter der unmittelbaren Verantwortung des Verantwortlichen oder des Auftragsverarbeiters befugt sind, die personenbezogenen Daten zu verarbeiten.</li>\n <li>\n <h4>k) Einwilligung</h4>\n <p>Einwilligung ist jede von der betroffenen Person freiwillig für den bestimmten Fall in informierter Weise und unmissverständlich abgegebene Willensbekundung in Form einer Erklärung oder einer sonstigen eindeutigen bestätigenden Handlung, mit der die betroffene Person zu verstehen gibt, dass sie mit der Verarbeitung der sie betreffenden personenbezogenen Daten einverstanden ist.</li>\n </ul>\n <h4>2. Name und Anschrift des für die Verarbeitung Verantwortlichen</h4>\n <p>Verantwortlicher im Sinne der Datenschutz-Grundverordnung, sonstiger in den Mitgliedstaaten der Europäischen Union geltenden Datenschutzgesetze und anderer Bestimmungen mit datenschutzrechtlichem Charakter ist die:</p>\n <p>Veggiemobil</p>\n <p>Birgit Jung<br>\n Vordergasse 10<br>\n 65529 Waldems<br>\n Deutschland<br>\n Tel.: 06082 931144<br>\n E-Mail: [email protected]</p>\n <p>Website: veggiemobil.com</p>\n <h4>3. Cookies</h4>\n <p>Die Internetseite des Veggiemobils verwendet Cookies. Cookies sind Textdateien, welche über einen Internetbrowser auf einem Computersystem abgelegt und gespeichert werden.</p>\n <p>Zahlreiche Internetseiten und Server verwenden Cookies. Viele Cookies enthalten eine sogenannte Cookie-ID. Eine Cookie-ID ist eine eindeutige Kennung des Cookies. Sie besteht aus einer Zeichenfolge, durch welche Internetseiten und Server dem konkreten Internetbrowser zugeordnet werden können, in dem das Cookie gespeichert wurde. Dies ermöglicht es den besuchten Internetseiten und Servern, den individuellen Browser der betroffenen Person von anderen Internetbrowsern, die andere Cookies enthalten, zu unterscheiden. Ein bestimmter Internetbrowser kann über die eindeutige Cookie-ID wiedererkannt und identifiziert werden.</p>\n <p>Durch den Einsatz von Cookies kann das Veggiemobil den Nutzern dieser Internetseite nutzerfreundlichere Services bereitstellen, die ohne die Cookie-Setzung nicht möglich wären.</p>\n <p>Mittels eines Cookies können die Informationen und Angebote auf unserer Internetseite im Sinne des Benutzers optimiert werden. Cookies ermöglichen uns, wie bereits erwähnt, die Benutzer unserer Internetseite wiederzuerkennen. Zweck dieser Wiedererkennung ist es, den Nutzern die Verwendung unserer Internetseite zu erleichtern. Der Benutzer einer Internetseite, die Cookies verwendet, muss beispielsweise nicht bei jedem Besuch der Internetseite erneut seine Zugangsdaten eingeben, weil dies von der Internetseite und dem auf dem Computersystem des Benutzers abgelegten Cookie übernommen wird. Ein weiteres Beispiel ist das Cookie eines Warenkorbes im Online-Shop. Der Online-Shop merkt sich die Artikel, die ein Kunde in den virtuellen Warenkorb gelegt hat, über ein Cookie.</p>\n <p>Die betroffene Person kann die Setzung von Cookies durch unsere Internetseite jederzeit mittels einer entsprechenden Einstellung des genutzten Internetbrowsers verhindern und damit der Setzung von Cookies dauerhaft widersprechen. Ferner können bereits gesetzte Cookies jederzeit über einen Internetbrowser oder andere Softwareprogramme gelöscht werden. Dies ist in allen gängigen Internetbrowsern möglich. Deaktiviert die betroffene Person die Setzung von Cookies in dem genutzten Internetbrowser, sind unter Umständen nicht alle Funktionen unserer Internetseite vollumfänglich nutzbar.</p>\n <p><strong>Verwendetete Cookies</strong></p>\n <p><em>veggiemobil_session</em><br>\n Dieses Cookie enthält die eindeutige ID der sog. <em>Session</em>. Es wird beim Schließen der Browser-Sitzung gelöscht.</p>\n <p><em>XSRF-Token</em><br>\n XSRF (=Cross-Site-Request-Forgery). Durch dieses Token kann sichergestellt werden, dass ein Angreifer sich nicht der Session eines legitimen Nutzers bemächtigen kann, um schädliche HTTP-Anfragen auszuführen.</p>\n <h4>4. Erfassung von allgemeinen Daten und Informationen</h4>\n <p>Die Internetseite des Veggiemobils erfasst mit jedem Aufruf der Internetseite durch eine betroffene Person oder ein automatisiertes System eine Reihe von allgemeinen Daten und Informationen. Diese allgemeinen Daten und Informationen werden in den Logfiles des Servers gespeichert. Erfasst werden können die (1) verwendeten Browsertypen und Versionen, (2) das vom zugreifenden System verwendete Betriebssystem, (3) die Internetseite, von welcher ein zugreifendes System auf unsere Internetseite gelangt (sogenannte Referrer), (4) die Unterwebseiten, welche über ein zugreifendes System auf unserer Internetseite angesteuert werden, (5) das Datum und die Uhrzeit eines Zugriffs auf die Internetseite, (6) eine Internet-Protokoll-Adresse (IP-Adresse), (7) der Internet-Service-Provider des zugreifenden Systems und (8) sonstige ähnliche Daten und Informationen, die der Gefahrenabwehr im Falle von Angriffen auf unsere informationstechnologischen Systeme dienen.</p>\n <p>Bei der Nutzung dieser allgemeinen Daten und Informationen zieht das Veggiemobil keine Rückschlüsse auf die betroffene Person. Diese Informationen werden vielmehr benötigt, um (1) die Inhalte unserer Internetseite korrekt auszuliefern, (2) die Inhalte unserer Internetseite sowie die Werbung für diese zu optimieren, (3) die dauerhafte Funktionsfähigkeit unserer informationstechnologischen Systeme und der Technik unserer Internetseite zu gewährleisten sowie (4) um Strafverfolgungsbehörden im Falle eines Cyberangriffes die zur Strafverfolgung notwendigen Informationen bereitzustellen. Diese anonym erhobenen Daten und Informationen werden durch das Veggiemobil daher einerseits statistisch und ferner mit dem Ziel ausgewertet, den Datenschutz und die Datensicherheit in unserem Ensemble zu erhöhen, um letztlich ein optimales Schutzniveau für die von uns verarbeiteten personenbezogenen Daten sicherzustellen. Die anonymen Daten der Server-Logfiles werden getrennt von allen durch eine betroffene Person angegebenen personenbezogenen Daten gespeichert.</p>\n <h4>5. Kontaktmöglichkeit über die Internetseite</h4>\n <p>Die Internetseite des Veggiemobils enthält aufgrund von gesetzlichen Vorschriften Angaben, die eine schnelle elektronische Kontaktaufnahme zu unserem Restaurant sowie eine unmittelbare Kommunikation mit uns ermöglichen, was ebenfalls eine allgemeine Adresse der sogenannten elektronischen Post (E-Mail-Adresse) umfasst. Sofern eine betroffene Person per E-Mail den Kontakt mit dem für die Verarbeitung Verantwortlichen aufnimmt, werden die von der betroffenen Person übermittelten personenbezogenen Daten automatisch gespeichert. Solche auf freiwilliger Basis von einer betroffenen Person an den für die Verarbeitung Verantwortlichen übermittelten personenbezogenen Daten werden für Zwecke der Bearbeitung oder der Kontaktaufnahme zur betroffenen Person gespeichert. Es erfolgt keine Weitergabe dieser personenbezogenen Daten an Dritte.</p>\n <h4>6. Routinemäßige Löschung und Sperrung von personenbezogenen Daten</h4>\n <p>Der für die Verarbeitung Verantwortliche verarbeitet und speichert personenbezogene Daten der betroffenen Person nur für den Zeitraum, der zur Erreichung des Speicherungszwecks erforderlich ist oder sofern dies durch den Europäischen Richtlinien- und Verordnungsgeber oder einen anderen Gesetzgeber in Gesetzen oder Vorschriften, welchen der für die Verarbeitung Verantwortliche unterliegt, vorgesehen wurde.</p>\n <p>Entfällt der Speicherungszweck oder läuft eine vom Europäischen Richtlinien- und Verordnungsgeber oder einem anderen zuständigen Gesetzgeber vorgeschriebene Speicherfrist ab, werden die personenbezogenen Daten routinemäßig und entsprechend den gesetzlichen Vorschriften gesperrt oder gelöscht.</p>\n <h4>7. Rechte der betroffenen Person</h4>\n <ul style=\"list-style: none;\">\n <li>\n <h4>a) Recht auf Bestätigung</h4>\n <p>Jede betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber eingeräumte Recht, von dem für die Verarbeitung Verantwortlichen eine Bestätigung darüber zu verlangen, ob sie betreffende personenbezogene Daten verarbeitet werden. Möchte eine betroffene Person dieses Bestätigungsrecht in Anspruch nehmen, kann sie sich hierzu jederzeit an einen Mitarbeiter des für die Verarbeitung Verantwortlichen wenden.</li>\n <li>\n <h4>b) Recht auf Auskunft</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, jederzeit von dem für die Verarbeitung Verantwortlichen unentgeltliche Auskunft über die zu seiner Person gespeicherten personenbezogenen Daten und eine Kopie dieser Auskunft zu erhalten. Ferner hat der Europäische Richtlinien- und Verordnungsgeber der betroffenen Person Auskunft über folgende Informationen zugestanden:</p>\n <ul style=\"list-style: none;\">\n <li>die Verarbeitungszwecke</li>\n <li>die Kategorien personenbezogener Daten, die verarbeitet werden</li>\n <li>die Empfänger oder Kategorien von Empfängern, gegenüber denen die personenbezogenen Daten offengelegt worden sind oder noch offengelegt werden, insbesondere bei Empfängern in Drittländern oder bei internationalen Organisationen</li>\n <li>falls möglich die geplante Dauer, für die die personenbezogenen Daten gespeichert werden, oder, falls dies nicht möglich ist, die Kriterien für die Festlegung dieser Dauer</li>\n <li>das Bestehen eines Rechts auf Berichtigung oder Löschung der sie betreffenden personenbezogenen Daten oder auf Einschränkung der Verarbeitung durch den Verantwortlichen oder eines Widerspruchsrechts gegen diese Verarbeitung</li>\n <li>das Bestehen eines Beschwerderechts bei einer Aufsichtsbehörde</li>\n <li>wenn die personenbezogenen Daten nicht bei der betroffenen Person erhoben werden: Alle verfügbaren Informationen über die Herkunft der Daten</li>\n <li>das Bestehen einer automatisierten Entscheidungsfindung einschließlich Profiling gemäß Artikel 22 Abs.1 und 4 DS-GVO und — zumindest in diesen Fällen — aussagekräftige Informationen über die involvierte Logik sowie die Tragweite und die angestrebten Auswirkungen einer derartigen Verarbeitung für die betroffene Person</li>\n </ul>\n <p>Ferner steht der betroffenen Person ein Auskunftsrecht darüber zu, ob personenbezogene Daten an ein Drittland oder an eine internationale Organisation übermittelt wurden. Sofern dies der Fall ist, so steht der betroffenen Person im Übrigen das Recht zu, Auskunft über die geeigneten Garantien im Zusammenhang mit der Übermittlung zu erhalten.</p>\n <p>Möchte eine betroffene Person dieses Auskunftsrecht in Anspruch nehmen, kann sie sich hierzu jederzeit an einen Mitarbeiter des für die Verarbeitung Verantwortlichen wenden.</li>\n <li>\n <h4>c) Recht auf Berichtigung</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, die unverzügliche Berichtigung sie betreffender unrichtiger personenbezogener Daten zu verlangen. Ferner steht der betroffenen Person das Recht zu, unter Berücksichtigung der Zwecke der Verarbeitung, die Vervollständigung unvollständiger personenbezogener Daten — auch mittels einer ergänzenden Erklärung — zu verlangen.</p>\n <p>Möchte eine betroffene Person dieses Berichtigungsrecht in Anspruch nehmen, kann sie sich hierzu jederzeit an einen Mitarbeiter des für die Verarbeitung Verantwortlichen wenden.</li>\n <li>\n <h4>d) Recht auf Löschung (Recht auf Vergessen werden)</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, von dem Verantwortlichen zu verlangen, dass die sie betreffenden personenbezogenen Daten unverzüglich gelöscht werden, sofern einer der folgenden Gründe zutrifft und soweit die Verarbeitung nicht erforderlich ist:</p>\n <ul style=\"list-style: none;\">\n <li>Die personenbezogenen Daten wurden für solche Zwecke erhoben oder auf sonstige Weise verarbeitet, für welche sie nicht mehr notwendig sind.</li>\n <li>Die betroffene Person widerruft ihre Einwilligung, auf die sich die Verarbeitung gemäß Art. 6 Abs. 1 Buchstabe a DS-GVO oder Art. 9 Abs. 2 Buchstabe a DS-GVO stützte, und es fehlt an einer anderweitigen Rechtsgrundlage für die Verarbeitung.</li>\n <li>Die betroffene Person legt gemäß Art. 21 Abs. 1 DS-GVO Widerspruch gegen die Verarbeitung ein, und es liegen keine vorrangigen berechtigten Gründe für die Verarbeitung vor, oder die betroffene Person legt gemäß Art. 21 Abs. 2 DS-GVO Widerspruch gegen die Verarbeitung ein.</li>\n <li>Die personenbezogenen Daten wurden unrechtmäßig verarbeitet.</li>\n <li>Die Löschung der personenbezogenen Daten ist zur Erfüllung einer rechtlichen Verpflichtung nach dem Unionsrecht oder dem Recht der Mitgliedstaaten erforderlich, dem der Verantwortliche unterliegt.</li>\n <li>Die personenbezogenen Daten wurden in Bezug auf angebotene Dienste der Informationsgesellschaft gemäß Art. 8 Abs. 1 DS-GVO erhoben.</li>\n </ul>\n <p>Sofern einer der oben genannten Gründe zutrifft und eine betroffene Person die Löschung von personenbezogenen Daten, die beim Veggiemobil gespeichert sind, veranlassen möchte, kann sie sich hierzu jederzeit an den Betreiber der Website wenden. Dieser wird veranlassen, dass dem Löschverlangen unverzüglich nachgekommen wird.</p>\n <p>Wurden die personenbezogenen Daten durch das Veggiemobil öffentlich gemacht und ist unser Restaurant als Verantwortlicher gemäß Art. 17 Abs. 1 DS-GVO zur Löschung der personenbezogenen Daten verpflichtet, so trifft das Veggiemobil unter Berücksichtigung der verfügbaren Technologie und der Implementierungskosten angemessene Maßnahmen, auch technischer Art, um andere für die Datenverarbeitung Verantwortliche, welche die veröffentlichten personenbezogenen Daten verarbeiten, darüber in Kenntnis zu setzen, dass die betroffene Person von diesen anderen für die Datenverarbeitung Verantwortlichen die Löschung sämtlicher Links zu diesen personenbezogenen Daten oder von Kopien oder Replikationen dieser personenbezogenen Daten verlangt hat, soweit die Verarbeitung nicht erforderlich ist. Der Mitarbeiter des Veggiemobils wird im Einzelfall das Notwendige veranlassen.</li>\n <li>\n <h4>e) Recht auf Einschränkung der Verarbeitung</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, von dem Verantwortlichen die Einschränkung der Verarbeitung zu verlangen, wenn eine der folgenden Voraussetzungen gegeben ist:</p>\n <ul style=\"list-style: none;\">\n <li>Die Richtigkeit der personenbezogenen Daten wird von der betroffenen Person bestritten, und zwar für eine Dauer, die es dem Verantwortlichen ermöglicht, die Richtigkeit der personenbezogenen Daten zu überprüfen.</li>\n <li>Die Verarbeitung ist unrechtmäßig, die betroffene Person lehnt die Löschung der personenbezogenen Daten ab und verlangt stattdessen die Einschränkung der Nutzung der personenbezogenen Daten.</li>\n <li>Der Verantwortliche benötigt die personenbezogenen Daten für die Zwecke der Verarbeitung nicht länger, die betroffene Person benötigt sie jedoch zur Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen.</li>\n <li>Die betroffene Person hat Widerspruch gegen die Verarbeitung gem. Art. 21 Abs. 1 DS-GVO eingelegt und es steht noch nicht fest, ob die berechtigten Gründe des Verantwortlichen gegenüber denen der betroffenen Person überwiegen.</li>\n </ul>\n <p>Sofern eine der oben genannten Voraussetzungen gegeben ist und eine betroffene Person die Einschränkung von personenbezogenen Daten, die beim Veggiemobil gespeichert sind, verlangen möchte, kann sie sich hierzu jederzeit an einen Mitarbeiter des für die Verarbeitung Verantwortlichen wenden. Der Mitarbeiter des Veggiemobils wird die Einschränkung der Verarbeitung veranlassen.</li>\n <li>\n <h4>f) Recht auf Datenübertragbarkeit</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, die sie betreffenden personenbezogenen Daten, welche durch die betroffene Person einem Verantwortlichen bereitgestellt wurden, in einem strukturierten, gängigen und maschinenlesbaren Format zu erhalten. Sie hat außerdem das Recht, diese Daten einem anderen Verantwortlichen ohne Behinderung durch den Verantwortlichen, dem die personenbezogenen Daten bereitgestellt wurden, zu übermitteln, sofern die Verarbeitung auf der Einwilligung gemäß Art. 6 Abs. 1 Buchstabe a DS-GVO oder Art. 9 Abs. 2 Buchstabe a DS-GVO oder auf einem Vertrag gemäß Art. 6 Abs. 1 Buchstabe b DS-GVO beruht und die Verarbeitung mithilfe automatisierter Verfahren erfolgt, sofern die Verarbeitung nicht für die Wahrnehmung einer Aufgabe erforderlich ist, die im öffentlichen Interesse liegt oder in Ausübung öffentlicher Gewalt erfolgt, welche dem Verantwortlichen übertragen wurde.</p>\n <p>Ferner hat die betroffene Person bei der Ausübung ihres Rechts auf Datenübertragbarkeit gemäß Art. 20 Abs. 1 DS-GVO das Recht, zu erwirken, dass die personenbezogenen Daten direkt von einem Verantwortlichen an einen anderen Verantwortlichen übermittelt werden, soweit dies technisch machbar ist und sofern hiervon nicht die Rechte und Freiheiten anderer Personen beeinträchtigt werden.</p>\n <p>Zur Geltendmachung des Rechts auf Datenübertragbarkeit kann sich die betroffene Person jederzeit an einen Mitarbeiter des Veggiemobils wenden.</li>\n <li>\n <h4>g) Recht auf Widerspruch</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, aus Gründen, die sich aus ihrer besonderen Situation ergeben, jederzeit gegen die Verarbeitung sie betreffender personenbezogener Daten, die aufgrund von Art. 6 Abs. 1 Buchstaben e oder f DS-GVO erfolgt, Widerspruch einzulegen. Dies gilt auch für ein auf diese Bestimmungen gestütztes Profiling.</p>\n <p>Das Veggiemobil verarbeitet die personenbezogenen Daten im Falle des Widerspruchs nicht mehr, es sei denn, wir können zwingende schutzwürdige Gründe für die Verarbeitung nachweisen, die den Interessen, Rechten und Freiheiten der betroffenen Person überwiegen, oder die Verarbeitung dient der Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen.</p>\n <p>Verarbeitet das Veggiemobil personenbezogene Daten, um Direktwerbung zu betreiben, so hat die betroffene Person das Recht, jederzeit Widerspruch gegen die Verarbeitung der personenbezogenen Daten zum Zwecke derartiger Werbung einzulegen. Dies gilt auch für das Profiling, soweit es mit solcher Direktwerbung in Verbindung steht. Widerspricht die betroffene Person gegenüber des Veggiemobils der Verarbeitung für Zwecke der Direktwerbung, so wird das Veggiemobil die personenbezogenen Daten nicht mehr für diese Zwecke verarbeiten.</p>\n <p>Zudem hat die betroffene Person das Recht, aus Gründen, die sich aus ihrer besonderen Situation ergeben, gegen die sie betreffende Verarbeitung personenbezogener Daten, die beim Veggiemobil zu wissenschaftlichen oder historischen Forschungszwecken oder zu statistischen Zwecken gemäß Art. 89 Abs. 1 DS-GVO erfolgen, Widerspruch einzulegen, es sei denn, eine solche Verarbeitung ist zur Erfüllung einer im öffentlichen Interesse liegenden Aufgabe erforderlich.</p>\n <p>Zur Ausübung des Rechts auf Widerspruch kann sich die betroffene Person direkt an den Betreiber der Website des Veggiemobils. Der betroffenen Person steht es ferner frei, im Zusammenhang mit der Nutzung von Diensten der Informationsgesellschaft, ungeachtet der Richtlinie 2002/58/EG, ihr Widerspruchsrecht mittels automatisierter Verfahren auszuüben, bei denen technische Spezifikationen verwendet werden.</li>\n <li>\n <h4>h) Automatisierte Entscheidungen im Einzelfall einschließlich Profiling</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, nicht einer ausschließlich auf einer automatisierten Verarbeitung — einschließlich Profiling — beruhenden Entscheidung unterworfen zu werden, die ihr gegenüber rechtliche Wirkung entfaltet oder sie in ähnlicher Weise erheblich beeinträchtigt, sofern die Entscheidung (1) nicht für den Abschluss oder die Erfüllung eines Vertrags zwischen der betroffenen Person und dem Verantwortlichen erforderlich ist, oder (2) aufgrund von Rechtsvorschriften der Union oder der Mitgliedstaaten, denen der Verantwortliche unterliegt, zulässig ist und diese Rechtsvorschriften angemessene Maßnahmen zur Wahrung der Rechte und Freiheiten sowie der berechtigten Interessen der betroffenen Person enthalten oder (3) mit ausdrücklicher Einwilligung der betroffenen Person erfolgt.</p>\n <p>Ist die Entscheidung (1) für den Abschluss oder die Erfüllung eines Vertrags zwischen der betroffenen Person und dem Verantwortlichen erforderlich oder (2) erfolgt sie mit ausdrücklicher Einwilligung der betroffenen Person, trifft das Veggiemobil angemessene Maßnahmen, um die Rechte und Freiheiten sowie die berechtigten Interessen der betroffenen Person zu wahren, wozu mindestens das Recht auf Erwirkung des Eingreifens einer Person seitens des Verantwortlichen, auf Darlegung des eigenen Standpunkts und auf Anfechtung der Entscheidung gehört.</p>\n <p>Möchte die betroffene Person Rechte mit Bezug auf automatisierte Entscheidungen geltend machen, kann sie sich hierzu jederzeit an einen Mitarbeiter des für die Verarbeitung Verantwortlichen wenden.</li>\n <li>\n <h4>i) Recht auf Widerruf einer datenschutzrechtlichen Einwilligung</h4>\n <p>Jede von der Verarbeitung personenbezogener Daten betroffene Person hat das vom Europäischen Richtlinien- und Verordnungsgeber gewährte Recht, eine Einwilligung zur Verarbeitung personenbezogener Daten jederzeit zu widerrufen.</p>\n <p>Möchte die betroffene Person ihr Recht auf Widerruf einer Einwilligung geltend machen, kann sie sich hierzu jederzeit an einen Mitarbeiter des für die Verarbeitung Verantwortlichen wenden.</li>\n </ul>\n <h4>8. Rechtsgrundlage der Verarbeitung</h4>\n <p>Art. 6 I lit. a DS-GVO dient unserem Restaurant als Rechtsgrundlage für Verarbeitungsvorgänge, bei denen wir eine Einwilligung für einen bestimmten Verarbeitungszweck einholen. Ist die Verarbeitung personenbezogener Daten zur Erfüllung eines Vertrags, dessen Vertragspartei die betroffene Person ist, erforderlich, wie dies beispielsweise bei Verarbeitungsvorgängen der Fall ist, die für eine Lieferung von Waren oder die Erbringung einer sonstigen Leistung oder Gegenleistung notwendig sind, so beruht die Verarbeitung auf Art. 6 I lit. b DS-GVO. Gleiches gilt für solche Verarbeitungsvorgänge die zur Durchführung vorvertraglicher Maßnahmen erforderlich sind, etwa in Fällen von Anfragen zur unseren Produkten oder Leistungen. Unterliegt unser Restaurant einer rechtlichen Verpflichtung durch welche eine Verarbeitung von personenbezogenen Daten erforderlich wird, wie beispielsweise zur Erfüllung steuerlicher Pflichten, so basiert die Verarbeitung auf Art. 6 I lit. c DS-GVO. In seltenen Fällen könnte die Verarbeitung von personenbezogenen Daten erforderlich werden, um lebenswichtige Interessen der betroffenen Person oder einer anderen natürlichen Person zu schützen. Dies wäre beispielsweise der Fall, wenn ein Besucher in unserem Betrieb verletzt werden würde und daraufhin sein Name, sein Alter, seine Krankenkassendaten oder sonstige lebenswichtige Informationen an einen Arzt, ein Krankenhaus oder sonstige Dritte weitergegeben werden müssten. Dann würde die Verarbeitung auf Art. 6 I lit. d DS-GVO beruhen.<br>\n Letztlich könnten Verarbeitungsvorgänge auf Art. 6 I lit. f DS-GVO beruhen. Auf dieser Rechtsgrundlage basieren Verarbeitungsvorgänge, die von keiner der vorgenannten Rechtsgrundlagen erfasst werden, wenn die Verarbeitung zur Wahrung eines berechtigten Interesses unseres Restaurants oder eines Dritten erforderlich ist, sofern die Interessen, Grundrechte und Grundfreiheiten des Betroffenen nicht überwiegen. Solche Verarbeitungsvorgänge sind uns insbesondere deshalb gestattet, weil sie durch den Europäischen Gesetzgeber besonders erwähnt wurden. Er vertrat insoweit die Auffassung, dass ein berechtigtes Interesse anzunehmen sein könnte, wenn die betroffene Person ein Kunde des Verantwortlichen ist (Erwägungsgrund 47 Satz 2 DS-GVO).</p>\n <h4>9. Berechtigte Interessen an der Verarbeitung, die von dem Verantwortlichen oder einem Dritten verfolgt werden</h4>\n <p>Basiert die Verarbeitung personenbezogener Daten auf Artikel 6 I lit. f DS-GVO ist unser berechtigtes Interesse die Durchführung unserer Geschäftstätigkeit zugunsten des Wohlergehens all unserer Mitarbeiter und unserer Anteilseigner.</p>\n <h4>10. Dauer, für die die personenbezogenen Daten gespeichert werden</h4>\n <p>Das Kriterium für die Dauer der Speicherung von personenbezogenen Daten ist die jeweilige gesetzliche Aufbewahrungsfrist. Nach Ablauf der Frist werden die entsprechenden Daten routinemäßig gelöscht, sofern sie nicht mehr zur Vertragserfüllung oder Vertragsanbahnung erforderlich sind.</p>\n <h4>11. Gesetzliche oder vertragliche Vorschriften zur Bereitstellung der personenbezogenen Daten; Erforderlichkeit für den Vertragsabschluss; Verpflichtung der betroffenen Person, die personenbezogenen Daten bereitzustellen; mögliche Folgen der Nichtbereitstellung</h4>\n <p>Wir klären Sie darüber auf, dass die Bereitstellung personenbezogener Daten zum Teil gesetzlich vorgeschrieben ist (z.B. Steuervorschriften) oder sich auch aus vertraglichen Regelungen (z.B. Angaben zum Vertragspartner) ergeben kann.<br>\n Mitunter kann es zu einem Vertragsschluss erforderlich sein, dass eine betroffene Person uns personenbezogene Daten zur Verfügung stellt, die in der Folge durch uns verarbeitet werden müssen. Die betroffene Person ist beispielsweise verpflichtet uns personenbezogene Daten bereitzustellen, wenn unser Restaurant mit ihr einen Vertrag abschließt. Eine Nichtbereitstellung der personenbezogenen Daten hätte zur Folge, dass der Vertrag mit dem Betroffenen nicht geschlossen werden könnte.<br>\n Vor einer Bereitstellung personenbezogener Daten durch den Betroffenen muss sich der Betroffene an einen unserer Mitarbeiter wenden. Unser Mitarbeiter klärt den Betroffenen einzelfallbezogen darüber auf, ob die Bereitstellung der personenbezogenen Daten gesetzlich oder vertraglich vorgeschrieben oder für den Vertragsabschluss erforderlich ist, ob eine Verpflichtung besteht, die personenbezogenen Daten bereitzustellen, und welche Folgen die Nichtbereitstellung der personenbezogenen Daten hätte.</p>\n <h4>12. Bestehen einer automatisierten Entscheidungsfindung</h4>\n <p>Als verantwortungsbewusstes Restaurant verzichten wir auf eine automatische Entscheidungsfindung oder ein Profiling.</p>\n ',\n 'menus' => [ 3 ]\n ]\n ];\n\n foreach( $data as $key => $arr ) {\n $object = new Page();\n $object->title = $arr[ 'title' ];\n $object->text = $arr[ 'text' ];\n $object->live = 1;\n if( array_key_exists( 'template', $arr ) ) {\n $object->template = $arr[ 'template' ];\n }\n if( array_key_exists( 'external_url', $arr ) ) {\n $object->external_url = $arr[ 'external_url' ];\n }\n $object->save();\n if( array_key_exists( 'menus', $arr ) ) {\n $object->menus()->sync( $arr[ 'menus' ] );\n }\n }\n }",
"function view($fileName, $data=null) {\n if(is_array($data)) {\n extract($data);\n }\n require_once('html/' . $fileName);\n }",
"protected function render($view, $data = null) {\n \n if (!is_null($data)) {\n extract($data);\n }\n\n include \"../views/$view.phtml\"; //$view: quer dizer o ficheiro que vier com .phtml ele processa.\n }",
"function index( $data = array() ) {\n\n/* ... define values for template variables to display on page */\n if (!array_key_exists( \"title\", $data )) {\n $data['title'] = \"Playoffs - \".$this->config->item( 'siteName' );\n }\n\n/* ... set the name of the page to be displayed */\n if (!array_key_exists( \"main\", $data )) {\n $data['main'] = \"schedule/sched_tournamentMaster\";\n }\n\n/* ... determine which view for the small left hand contextual navigation menu */\n if (array_key_exists( 'UserId', $_SESSION )) {\n $data['contextNav'] = \"loggedIn\";\n }\n else {\n $data['contextNav'] = \"loggedOut\";\n }\n\n/* ... enable our template variables and then display the template, as we want it shown */ \n $this->load->vars( $data );\n $this->load->view( \"template\" );\n\n/* ... time to go */\n return;\n }",
"function render(){\n $productos = $this->model->get();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }",
"public function view($view, $data = []): void\n {\n foreach ($data as $name => $value) {\n ${$name} = $value;\n }\n ob_start();\n $dir = __DIR__ . '/../Views/';\n include $dir . 'header.php';\n include $dir . $view . '.php';\n include $dir . 'footer.php';\n ob_flush();\n }",
"public function index() {\n $this->load->model('persoon_model');\n $data['beheerders'] = $this->persoon_model->getAllBeheerders();\n $data['title'] = 'Beheerders bekijken';\n $data['nobox'] = true; // geen extra rand rond hoofdmenu\n $data['user'] = $this->authex->getUserInfo();\n $data['auteur'] = 'Jarne Peeters, Bart Buyens';\n\n $partials = array('header' => 'main_header', 'content' => 'beheerders_beheren', 'menu' => 'main_menu');\n $this->template->load('main_master', $partials, $data);\n }",
"public function display($data) {\n\t\t\t// url\n\t\t\t$url = null;\n\t\t\tif (!empty($data[$this->get_field_name('url')])) {\n\t\t\t\t$url = esc_attr($data[$this->get_field_name('url')]);\n\t\t\t}\t\n\t\t\t\n\t\t\t$title = null;\t\n\t\t\tif (!empty($data[$this->get_field_name('title')])) {\n\t\t\t\t$title = esc_html($data[$this->get_field_name('title')]);\n\t\t\t\tif (!empty($url)) {\n\t\t\t\t\t$title = '<a href=\"'.$url.'\">'.$title.'</a>';\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t$image = null;\n\t\t\tif (!empty($data[$this->get_field_name('featured_image')])) {\n\t\t\t\t$img_id = intval($data[$this->get_field_name('featured_image')]);\n\t\t\t\t$the_image = get_post($img_id);\n\t\t\t\tif (!empty($the_image)) {\n\t\t\t\t\t$atts = array(\n\t\t\t\t\t\t'class' => 'cfct-mod-image '.(!empty($data[$this->get_field_id('image-alignment')]) ? ' '.$data[$this->get_field_name('image-alignment')] : '')\n\t\t\t\t\t);\n\t\t\t\t\t$size = (!empty($data[$this->get_field_name('featured_image').'-size']) ? $data[$this->get_field_name('featured_image').'-size'] : 'thumbnail');\n\t\t\t\t\t$image = wp_get_attachment_image($the_image->ID, $size, false, $atts);\n\t\t\t\t}\n\t\t\t\tif (!empty($url) && !empty($image)) {\n\t\t\t\t\t$image = '<a href=\"'.$url.'\">'.$image.'</a>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// content\n\t\t\t$content = null;\n\t\t\tif (!empty($data[$this->get_field_name('content')])) {\n\t\t\t\t$content = $this->wp_formatting($data[$this->get_field_name('content')]);\n\t\t\t}\n\n\t\t\treturn $this->load_view($data, compact('title', 'image', 'content', 'url'));\n\t\t}",
"public function show() {\n\t\t$variables = $this->sanitize($this->data);\n\t\tif (is_array($variables)) {\n\t\t\textract($variables);\n\t\t}\n\n\t\t$this->setHeaders();\n\n\t\tob_start();\n\t\tif ($this->isPartial) {\n\t\t\trequire_once $this->pathToPartial;\n\t\t} else {\n\t\t\trequire_once $this->pathToLayout;\n\t\t}\n\t\t$this->performReplacements();\n\t\tif (ob_get_length() !== false) {\n\t\t\tob_end_flush();\n\t\t}\n\t}",
"public function index()\n\t{\n\t\t$harga = [\n\t\t\t$this->request->getVar('out_proc'),\n\t\t\t$this->request->getVar('out_mobo'),\n\t\t\t$this->request->getVar('out_ram'),\n\t\t\t$this->request->getVar('out_vga'),\n\t\t\t$this->request->getVar('out_psu'),\n\t\t\t$this->request->getVar('out_hdd'),\n\t\t\t$this->request->getVar('out_ssd'),\n\t\t\t$this->request->getVar('out_case'),\n\t\t\t$this->request->getVar('out_cooler'),\n\t\t\t$this->request->getVar('out_per'),\n\t\t\t$this->request->getVar('out_mon')\n\t\t];\n\t\t$filter = array_filter($harga);\n\t\t$total = array_sum($filter);\n\n\n\t\t$data = [\n\t\t\t'title' => 'Preview Simulasi Rakitan | Cipta Mandiri Komputer',\n\t\t\t'autoinv' => $this->simulasi->autoinvsm(),\n\t\t\t'g_total' => $total,\n\n\t\t\t'proc1' => $this->barang->getNameItem($this->request->getVar('proc')),\n\t\t\t'mobo' => $this->barang->getNameItem($this->request->getVar('mobo')),\n\t\t\t'ram' => $this->barang->getNameItem($this->request->getVar('ram')),\n\t\t\t'vga' => $this->barang->getNameItem($this->request->getVar('vga')),\n\t\t\t'psu' => $this->barang->getNameItem($this->request->getVar('psu')),\n\t\t\t'hdd' => $this->barang->getNameItem($this->request->getVar('hdd')),\n\t\t\t'ssd' => $this->barang->getNameItem($this->request->getVar('ssd')),\n\t\t\t'case' => $this->barang->getNameItem($this->request->getVar('case')),\n\t\t\t'cooler' => $this->barang->getNameItem($this->request->getVar('cooler')),\n\t\t\t'peri' => $this->barang->getNameItem($this->request->getVar('per')),\n\t\t\t'monitor' => $this->barang->getNameItem($this->request->getVar('monitor')),\n\n\t\t\t'qtyprc' => $this->request->getVar('qty_proc'),\n\t\t\t'qtymb' => $this->request->getVar('qty_mobo'),\n\t\t\t'qtyram' => $this->request->getVar('qty_ram'),\n\t\t\t'qtyvga' => $this->request->getVar('qty_vga'),\n\t\t\t'qtypsu' => $this->request->getVar('qty_psu'),\n\t\t\t'qtyhdd' => $this->request->getVar('qty_hdd'),\n\t\t\t'qtyssd' => $this->request->getVar('qty_ssd'),\n\t\t\t'qtycase' => $this->request->getVar('qty_case'),\n\t\t\t'qtycooler' => $this->request->getVar('qty_cooler'),\n\t\t\t'qtyperi' => $this->request->getVar('qty_per'),\n\t\t\t'qtymonitor' => $this->request->getVar('qty_mon'),\n\n\t\t\t'hrgprc' => $this->request->getVar('out_proc'),\n\t\t\t'hrgmb' => $this->request->getVar('out_mobo'),\n\t\t\t'hrgram' => $this->request->getVar('out_ram'),\n\t\t\t'hrgvga' => $this->request->getVar('out_vga'),\n\t\t\t'hrgpsu' => $this->request->getVar('out_psu'),\n\t\t\t'hrghdd' => $this->request->getVar('out_hdd'),\n\t\t\t'hrgssd' => $this->request->getVar('out_ssd'),\n\t\t\t'hrgcase' => $this->request->getVar('out_case'),\n\t\t\t'hrgcooler' => $this->request->getVar('out_cooler'),\n\t\t\t'hrgperi' => $this->request->getVar('out_per'),\n\t\t\t'hrgmonitor' => $this->request->getVar('out_mon'),\n\n\t\t\t'nama' => $this->request->getVar('nama'),\n\t\t\t'hp' => $this->request->getVar('hp'),\n\t\t\t'alamat' => $this->request->getVar('alamat'),\n\n\n\n\t\t];\n\t\treturn view('pages/view_simulasi', $data);\n\t}",
"static private function render($file, $data){\n extract($data);\n // Extract data retreived from the Sharer\n if(Sharer::get() !== null){\n extract(Sharer::get());\n }\n\n // Merge data into the hive\n self::$hive = array_merge(self::$hive, get_defined_vars());\n unset($data);\n\n ob_start();\n include($file);\n $input = ob_get_contents();\n ob_end_clean();\n\n $output = preg_replace_callback('!\\{\\{(.*?)\\}\\}!', 'Viewer::replace', $input);\n\n\n echo($output);\n }",
"function beneficiariesView_views_data()\n{\n $data = array();\n\n $data['aj_registration']['table']['group'] = t('Registration');\n\n $data['aj_registration']['table']['base'] = array(\n 'title' => t('Registration'),\n 'help' => t('This is data from the aj_registration table.'),\n );\n\n $data['aj_registration']['table']['join'] = array(\n 'eck_provider' => array(\n 'left_field' => 'id',\n 'field' => 'provider_id',\n ),\n );\n\n\n// The ID field\n$data['aj_registration']['uuid'] = array(\n\t'group' => t('Registration'),\n 'title' => t('UUID'),\n 'help' => t('The beneficiary UUID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The nombre field\n$data['aj_registration']['nombre'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Nombre'),\n 'help' => t('The beneficiary name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The apellido field\n$data['aj_registration']['apellido'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apellido'),\n 'help' => t('The beneficiary surname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The apodo field\n$data['aj_registration']['apodo'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apodo'),\n 'help' => t('The beneficiary nickname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The Estecolateralparticipante field\n$data['aj_registration']['Estecolateralparticipante'] = array(\n\t'group' => t('Registration'),\n 'title' => t('¿Indirecto?'),\n 'help' => t('The beneficiary type.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The DOB field\n$data['aj_registration']['DOB'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Nacimiento'),\n 'help' => t('The beneficiary date of birth.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n// The Fecha field\n$data['aj_registration']['Fecha'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Registro'),\n 'help' => t('The Beneficiary date of registration.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n\n// The provider_name field\n$data['aj_registration']['provider_name'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Organización name'),\n 'help' => t('The organización name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The provider_id field\n$data['aj_registration']['provider_id'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Esto es provider_id'),\n 'help' => t('The organización ID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_numeric',\n ),\n 'relationship' => array(\n 'base' => 'eck_provider',\n 'base field' => 'id',\n \t 'field' => 'provider_id',\n 'handler' => 'views_handler_relationship',\n 'label' => t('aj_registration retlation'),\n \t 'help' => t('This is the relationship with aj_registration and eck_provider'),\n \t 'title' => t('aj_registration relationship'),\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument',\n 'numeric' => TRUE,\n ),\n);\n return $data;\n}",
"protected function render($template, $data=array()) {\n\n //Add extra data to the array\n $data['breadcrumb_array'] = $this->breadcrumb_array;\n $data['activity_link'] = false; //Need to create links to activity module\n\n //Metas & titles\n\n $data['meta_title'] = Config::get('modules.'.$this->module.'.title');\n\n $data['page_title'] = Config::get('modules.'.$this->module.'.title');\n\n $data['page_subtitle'] = $this->page_subtitle;\n if($data['page_subtitle']) $data['meta_title'] .= \" - \".$data['page_subtitle'];\n\n\n $data['page_shortcut'] = Auth::User()->hasAdminShortcut(\"/\".request()->path());\n\n return view($template, $data);\n }",
"public function load_data_templates(){\n\n\t$notificaciones = new NotificacionesController();\n\t$base = new BaseController();\n\t$menu = $base->menu();\n\n\t$data = [\n\t\t'js' => $this->js,\n\t\t'session' => $_SESSION,\n\t\t'nombre' => $this->nombre,\n\t\t'notificaciones' => $notificaciones->get_notificaciones(),\n\t\t'menu' => $menu['modulos']\n\t];\n\n\treturn $data;\n\n}",
"public function CetakDetail($data) {\n\t\t$filter = $this->input->post('filter');\n\t\t$length = $this->input->post('length');\n\t\t$start = $this->input->post('start');\t\t\t\t\n\t\t$draw = $this->input->post('draw');\t\t\t\n\t\t$saringan = array();\n\t\tif($filter){\n\t\t\tforeach($filter as $value) {\n\t\t\t\t$saringan[str_replace(\"[]\",\"\",$value['name'])][] = $value['value'];\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t$data = $this->get_dash_list_item($saringan);\t\n\t\t$recordsTotal = count($data['pritem']);\n\t\t$data = array_slice($data['pritem'],$start,$length);\n\t\t$recordsFiltered = count($data);\n\t\t$result = array(\n\t\t\t\"length\"=>$length,\n\t\t\t\"start\"=>$start,\n\t\t\t\"draw\" => intval($draw), \n\t\t\t\"recordsTotal\" => intval($recordsTotal), \n\t\t\t\"recordsFiltered\" => intval($recordsTotal),\n\t\t\t\"data\" => $data \n\t\t\t); \n\t\techo\"<pre>\"; \n\t\tprint_r($result);die;\n\n\t\t$this -> load -> helper(array('dompdf', 'file'));\n\t\t$html = $this -> load -> view('ec_cetak_log', $result, true);\n\t\t$filename = 'Auction';\n\t\t$paper = 'A4';\n\t\t$orientation = 'potrait';\n\t\tpdf_create($html, $filename, $paper, $orientation, false);\n\n\t}",
"function renderBoreholeDetails($data,$municipalities,$settlements,$hareas,$districts){\n\nglobal $twig;\n\n foreach ($data as $borehole){\n\n $navigation[0] = array('href' => 'index.php', 'caption' => 'Home', 'class'=>'active');\n\n $borehole->municipality = $municipalities[(int)$borehole->municipality]->name;\n $borehole->settlement = $settlements[(int)$borehole->settlement]->name;\n $borehole->h_area = $hareas[(int)$borehole->h_area]->name;\n $borehole->district = $districts[(int)$borehole->district]->name;\n\n $template = $twig->loadTemplate('boreholedetail.html');\n $buffer = $template->render(array('navigation' => $navigation, 'data'=>$borehole));\n\n renderHTML($buffer,$borehole->bh.'.html');\n }\n}",
"public function render(array $data = array())\n {\n $this->data($data);\n $path = ($this->engine->getResolveTemplatePath())($this->name);\n\n try {\n $level = ob_get_level();\n ob_start();\n\n (function() {\n extract($this->data);\n include func_get_arg(0);\n })($path);\n\n $content = ob_get_clean();\n\n if (isset($this->layoutName)) {\n $layout = $this->engine->make($this->layoutName);\n $layout->sections = array_merge($this->sections, array('content' => $content));\n $content = $layout->render($this->layoutData);\n }\n\n return $content;\n } catch (Throwable $e) {\n while (ob_get_level() > $level) {\n ob_end_clean();\n }\n\n throw $e;\n }\n }",
"public function getData()\n {\n $users = User::All();\n $voertuigen = Voertuig::orderBy('voertuigtype_voertuigtype_id')->get();\n $lespakketten = Lespakket::orderBy('voertuigtype_voertuigtype_id', 'DESC')->get();\n $feestdagen = Feestdagen::orderBy('datum')->get();\n\n return view('beheer', [\n 'users' => $users,\n 'voertuigen' => $voertuigen,\n 'lespakketten' => $lespakketten,\n 'feestdagen' => $feestdagen\n ]);\n }",
"function render( $block_data )\n\t{\n\t\treturn \"<\".$block_data['header_type'].\">\".$block_data['h_content'].\"</\".$block_data['header_type'].\">\";\n\t}",
"public function view($halaman, $data = null)\n {\n $sidebar = '';\n $levelAkses = $this->CI->session->userdata('level_akses');\n\n if($levelAkses == 'ADMIN'){\n $sidebar=$this->CI->menu->sidebar();\n }elseif($levelAkses == 'AGEN'){\n $sidebar=$this->CI->menu->Agen();\n }elseif($levelAkses == 'MANAGER'){\n $sidebar=$this->CI->menu->Agen();\n }else{\n redirect(base_url('Login/Logout'));\n }\n\n $menu['menu'] = $sidebar;\n\n\n $this->CI->load->view('PARTIAL/head');\n $this->CI->load->view('PARTIAL/menu_mobile',$menu);\n $this->CI->load->view('PARTIAL/menu_desktop',$menu);\n $this->CI->load->view('PARTIAL/header_desktop');\n $this->CI->load->view(\"DALAM/$halaman\",$data);\n $this->CI->load->view('PARTIAL/footer');\n }",
"function _template($data=NULL,$templatename=NULL)\n {\n $header = ($this->tank_auth->get_user_id()) ? 'header-2':'header';\n $data['template'] = $templatename;\n\t $data['header'] = 'includes/'.$header; \n $this->load->view('includes/template',$data); \n }",
"public function data_dosen()\n\t{\n\t\t$data['content'] = 'dosen/data_dosen';\n\t\t$data['data'] = $this->m_aka->data_dosen();\n\t\t$data['pagination'] = $this->pagination->create_links();\t\t\n\t\t$this->load->view('content', $data);\n\t}",
"public function index() {\n if ($this->session->has_userdata('user')) {\n $tipKorisnika = $this->session->userdata('user')['tip'];\n } else {\n $tipKorisnika = \"gost\";\n }\n //Iscitavanje obavestenja iz baze\n $data[\"middle_data\"] = [\"obavestenja\" => $this->ObavModel->dohvatiObavestenja($tipKorisnika)];\n $data[\"middle\"] = \"middle/obavestenje\";\n \n //Pozivanje viewTamplate sa obavestenjima kao podacima\n $this->load->view('viewTemplate', $data);\n }",
"public function load_view($view=false, $data = array(), $data_includes = array(), $folder = 'dashboard', $ext = '.html'){\n $ext = ($ext!='.html')? '' : $ext; \n // Header\n $base_url = base_url();\n $parse['base_url'] = $base_url;\n $parse['APPTITLE'] = utf8_decode($this->vars->cfg['site_title']);\n $parse['URLPATH'] = URLPATH;\n $parse['TEMPLATEPATH'] = $base_url.'assets/template/';\n $parse['IMG_PATH'] = $base_url.'assets/img/';\n $parse['anio'] = date('Y');\n\n $includes_header =(isset($data_includes['header']))?$data_includes['header']:$data_includes;\n $includes_footer =(isset($data_includes['footer']))?$data_includes['footer']:false;\n\n // INCLUDES HEADER Y WIDGETS\n // SE CARGAN EL CORE Y LOS PLUGINS DEL SISTEMA ADEMAS DE LOS JS Y CSS EXTRAS\n $dataheader['includes_header'] = $this->load_view_unique($folder.'/includes-header', $parse, true, $includes_header);\n $dataheader['includes_widgets'] = $this->load_view_unique($folder.'/includes-widgets' , $parse, true);\n //FIN HEADER Y WIDGETS\n\n //CONSTRUCCION DEL MENU\n $menu = $this->user_menu($this->session->userdata('user_menu'));\n $parse['MENU_DESKTOP'] = $menu['MENU_DESKTOP'];\n $parse['MENU_MOBILE'] = $menu['MENU_MOBILE'];\n $parse['MENU_MOBILE_SUBMENUS'] = $menu['MENU_MOBILE_SUBMENUS'];\n // debug($parse['MENU_MOBILE_SUBMENUS']);\n $parse['nombre_completo'] = $this->session->userdata('nombre_completo');\n $parse['reset_password'] = ($this->session->userdata('externo'))?'<li><a href=\"'.$base_url.'reset\"> Reset Password </a></li>':'';\n // Estructura de la pagina\n $dataheader['page_header'] = $this->load_view_unique($folder.'/page-header', $parse, true);\n // $dataheader['page_content'] = $this->load_view_unique($folder.'/page-content', $parse, true);\n $dataheader['page_footer'] = $this->load_view_unique($folder.'/page-footer',$parse, true); \n //SE CARGA EL CONTENIDO DE LA PAGINA\n if($view){\n $dataContent['content'] = $this->load_view_unique($view, $data, true);\n $dataContent['title'] = $data['titulo'];\n $dataContent['subtitle'] = isset($data['subtitulo'])? $data['subtitulo'] : '';\n $dataheader['page_content'] = $this->load_view_unique($folder.'/page-content', $dataContent, true);\n // $dataheader['page_content'] = $this->load_view_unique($view, $data, true);\n }else{\n $dataheader['page_content'] = false;\n }\n // FOOTER\n $dataheader['includes_footer'] = $this->load_view_unique($folder.'/includes-footer', $parse, true, $includes_footer);\n // Output\n $this->parser->parse($folder.'/dashboard'.$ext , $dataheader);\n }",
"function rekamPasien(){\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/rekam_medis',$data);\n\t\t$this->load->view('static/footer');\n\t}",
"public function render()\n\t{\n\t\t$template = $this->template;\n\t\t$template->setFile( __DIR__ . '/dataGrid.latte' );\n\n\t\t$template->grid = $this;\n\t\t$template->stencils = $this->stencils;\n\t\t$template->actionWidth = $this->actionWidth;\n\t\t$template->actitle = $this->actitle;\n\t\t$template->acfooter = $this->acfooter;\n\t\t$template->cmd = self::CMD;\n\t\t$template->labels = $this->labels;\n\t\t$template->columns = $this->columns;\n\t\t$template->key = $this->key;\n\t\t$template->isSorting = $this->isSorting();\n\t\t$template->isFiltering = $this->isFiltering();\n\t\t$template->isAdding = $this->isAdding();\n\t\t$template->isRemoving = $this->isRemoving();\n\t\t$template->isEditing = $this->isEditing();\n\t\t$template->hasActions = $this->hasActions();\n\t\t$template->sortable = $this->sortable;\n\t\t$template->sorting = $this->sorting;\n\t\t$template->filtering = $this->filtering;\n\t\t$template->id = $this->id;\n\t\t$template->pgbtn = $this->getPagerButtons();\n\t\t$template->currentPage = $this->getCurrentPage();\n\t\t$template->rowsPerPage = $this->getRowsPerPage();\n\t\t$template->pageCount = $this->getPageCount();\n\n\t\tif ( count( $this->dataSnippet ) ) $template->data = $this->dataSnippet;\n\t\telse $template->data = $this->getData();\n\n\t\t$template->render();\n\t}",
"public function showDataObservado()\n {\n #1. Obtengo la información solicitada\n $estado = 4;\n $data = ExpedienteSdaUr::getDataExpediente($estado);\n #2. retorno al menu principal\n return view($this->path.'.data-observado', compact('data'));\n }",
"public function render()\n {\n $tempData = $this->getData();\n $this->listData = $tempData;\n\n $data = get_object_vars($this);\n $this->appData = $data;\n\n //report via ray() if turned on\n if ($this->debugWithRay) {\n $this->showDebugOutput();\n }\n\n //make list view up internally\n return view('lwcrud::layouts.lw-base', ['listData' => $this->listData, 'appData' => $this->appData]);\n }",
"function index()\r\n\t{\r\n\t\t$setting['sd_left']\t= array('cur_menu'\t=> \"LAPORAN\");\r\n\t\t$setting['page']\t= array('pg_aktif'\t=> \"datatables\");\r\n\t\t$template\t\t\t= $this->template->load($setting); #load static template file\t\t\r\n\t\t$data = null;\r\n\t\t$template['konten']\t= $this->load->view('laporan/relevansi_v',$data,true); #load konten template file\r\n\t\t\r\n\t\t#load container for template view\r\n\t\t$this->load->view('template/container',$template);\r\n\t}",
"private function manageResponse(array $data): string\n {\n $_mainLayout = $this->defaultLayout;\n extract($data, EXTR_SKIP);\n\n ob_start();\n require app_path($this->viewsUri . '/' . $this->view . '.php');\n $contentInLayout = ob_get_clean();\n\n ob_start();\n require app_path($this->viewsUri . '/' . $_mainLayout . '.php');\n\n return ob_get_clean();\n }",
"public function vista($vista, $data=[])\n {\n //verificar si existe\n if (file_exists(\"../App/View/\" . $vista . \".php\")) \n {\n require_once \"../App/View/\" . $vista . \".php\" ;\n }\n else \n {\n die(\"No existe la vista\");\n }\n }",
"private function __generate($data) {\n extract($this->__settings);\n $html = '';\n\n $id = '';\n if ($depth == 0) {\n $id = ' id=\"' . $div . '\"';\n }\n\n $whitespace = str_repeat(\"\\t\", $depth);\n\n $html .= \"<ul\" . $id . \">\\n\";\n foreach ($data as $item) {\n $html .= \"<li>\";\n if ($link) {\n\n if ($ajaxtarget == null) {\n $html .= $this->Html->link(\n $item[$model][$title], array(\n 'controller' => $controller,\n 'action' => $action,\n $item[$model]['id']\n ));\n } else {\n $html .= $this->Js->link(\n $item[$model][$title], array(\n 'controller' => $controller,\n 'action' => $action,\n $item[$model]['id']\n ), array(\n 'update' => '#' . $ajaxtarget,\n 'before' => $this->Js->get('#' . $ajaxtarget)->effect('fadeOut'),\n 'complete' => $this->Js->get('#' . $ajaxtarget)->effect('fadeIn'),\n )\n );\n }\n } else {\n $html .= $item[$model][$title];\n }\n if (count($item['children']) > 0) {\n $this->__settings['depth'] = $depth + 1;\n $html .= $this->__generate($item['children'], $this->__settings);\n }\n $html .= \"</li>\\n\";\n }\n $html .= \"</ul>\\n\";\n $html = str_replace(\"\\n\", \"\\n\" . $whitespace, $html);\n return $html;\n }",
"function tanda_terima($data){\n $rdata['nomor_surat'] = $data['nomor_surat'];\n $rdata['tgl_surat'] = $data['tgl_surat'];\n $rdata['perihal'] = $data['perihal'];\n $rdata['kd_jns_surat'] = $data['kd_jns_surat'];\n $rdata['asal'] = $this->opd->desc;\n $data['qrcode'] = $this->print_qrcode->genQR($rdata);\n $this->load->view('tanda_terima', $data);\n }",
"public function render($page, $data = []) {\n\n\t\t$data['isDashboard'] = TRUE;\n\t\t$data['breadcrumbs'] = $this->breadcrumbs->get();\n\t\t$data['user_type'] = $this->session->userdata('mode');\n\t\t\n\t\t$page = 'pages/members/' . $page;\n\n\t\t$this->load->view('components/header', $data);\n\n\t\t$this->load->view($page, $data);\n\n\t\t$this->load->view('components/footer', $data);\n\t}",
"public function addData()\n {\n $data['city'] = $this->admin_m->getCities();\n $data['deptt'] = $this->admin_m->getDeptt();\n $data['pName'] = $this->admin_m->getPapers();\n $data['cat'] = $this->admin_m->getCategories();\n\n $data['content'] = 'admin/admin_v';\n $this->load->view('components/template', $data);\n }",
"function plantilla($vista, $data = null)\n{\n if (!logueado()) {\n redirect(site_url('login'));\n }\n\n $ci = get_instance();\n\n $datosesion = $ci->session->userdata('usuario_sesion');\n $data_header['dato_sesion'] = $datosesion;\n\n if (!isset($datosesion)){\n redirect(site_url('login'));\n }\n $menu_items = $ci->session->userdata('menu');\n $ci->multi_menu->set_items($menu_items);\n\n $array_controladores = array();\n $index = 0;\n// foreach ($menu_items as $row) {\n// $array_controladores[$index] = $row['slug'];\n// $index++;\n// }\n\n// if (!tieneAcceso($array_controladores)) {\n// show_error('Usted no cuenta con los permisos necesarios.<br><br><a class=\"btn btn-danger\" href=\"' . base_url() . 'inicio\"> Volver</a> ', 'Error de acceso', '<b>Restriccion de Acceso</b>');\n// }\n\n $ci->load->view('plantilla/header', $data_header);\n $ci->load->view($vista, $data);\n $ci->load->view('plantilla/footer');\n}",
"public function data_kohort(){\n\t\t$tahun = \"t_tahun_akademik\";\n\t\t$kelas = \"t_kelas\";\n\t\t$prodi = \"t_prodi\";\n\t\t$data['content'] = \"report/kohort\";\n\t\t$data['data_tahun'] = $this->m_aka->get_all($tahun);\n\t\t$data['kelas'] = $this->m_aka->get_all($kelas);\n\t\t$data['prodi'] = $this->m_aka->get_all($prodi);\n\t\t$this->load->view(\"content\", $data);\n\t}",
"public function render($data = [], $layout = 'master')\n {\n require './views/layout/' . $layout . '.php';\n }",
"public function render($template, $data=[]) {\n $data = ArrayHelper::merge($this->templateData, $this->data, $data);\n\t\treturn parent::render($template, $data);\n\t}",
"public function render($data, $options = array()) {\n\t\tif (!$data) {\n\t\t\treturn $this->Html->tag('p', __('There is no data to show.', true), array('class' => 'mh-message mh-alert'));\n\t\t}\n\t\t\n\t\tif (empty($options['columns'])) {\n\t\t\t$options['columns'] = array();\n\t\t}\n\n\t\t// Set table Options\n\t\tif(!empty($options['table'])) {\n\t\t\t$this->tableOptions = array_merge($this->tableOptions, $options['table']);\n\t\t\t$this->tableOptions['attr']['class'] = $this->tableOptions['class'];\n\t\t\t$this->tableOptions['attr']['id'] = $this->tableOptions['id'];\n\t\t\tunset($options['table']);\n\t\t}\n\t\t// Get default model \n\t\t$this->defaultModel = $this->params['models'][0];\n\t\tif (!empty($this->tableOptions['model'])) {\n\t\t\t$this->defaultModel = $this->tableOptions['model'];\n\t\t}\n\t\t\n\t\tif (!isset($this->Paginator->params['paging'])) {\n\t\t\t$this->Paginator->params['paging'] = array(\n\t\t\t\t$this->defaultModel => array(\n\t\t\t\t\t'defaults' => array(\n\t\t\t\t\t\t'page' => 1,\n\t\t\t\t\t\t'limit' => null\n\t\t\t\t\t),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'page' => 1,\n\t\t\t\t\t\t'limit' => null\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\n\t\t$this->setFields($data);\n\t\t// Set and normalize data for table\n\t\t$this->normalize($data);\n\t\tif (isset($options['actions'])) {\n\t\t\t$options['columns']['actions']['actions'] = $options['actions'];\n\t\t\t$options['columns']['actions']['type'] = 'actions';\n\t\t}\n\t\tif (!empty($this->tableOptions['selection'])) {\n\t\t\techo $this->Html->script('/ui/js/selection', array('inline' => false));\n\t\t\t$selectionColumn = array('selection' => array('type' => 'selection'));\n\t\t\t$options['columns'] = array_merge($selectionColumn, $options['columns']);\n\t\t}\n\t\t// Set and normalize visible columns\n\t\t$this->setColumns($options['columns']);\n\t\t$code = $this->headers();\n\t\t$code .= $this->body();\n\t\t$code = $this->Html->tag('table', $code, $this->tableOptions['attr']);\n\t\t\n\t\tif (!empty($this->tableOptions['selection'])) {\n\t\t\t$code = $this->_buildSelectionForm($code);\n\t\t}\n\t\treturn $code;\n\t}"
] | [
"0.73604995",
"0.68902063",
"0.6707959",
"0.6618832",
"0.6528438",
"0.6436547",
"0.6355825",
"0.62887096",
"0.62724173",
"0.6236665",
"0.6235162",
"0.6198221",
"0.6194328",
"0.61886233",
"0.6139481",
"0.6127642",
"0.6093501",
"0.60799205",
"0.6079408",
"0.6076341",
"0.6033123",
"0.60159516",
"0.6001495",
"0.5996692",
"0.59929055",
"0.5986929",
"0.5953846",
"0.5948377",
"0.5938996",
"0.59375036",
"0.5935888",
"0.5924644",
"0.5921738",
"0.59153265",
"0.59081113",
"0.5895229",
"0.58937174",
"0.5891687",
"0.5887049",
"0.58661014",
"0.58617413",
"0.58478737",
"0.5821736",
"0.5820127",
"0.5816254",
"0.58124936",
"0.5805595",
"0.5804081",
"0.5768992",
"0.57660115",
"0.57660115",
"0.57624084",
"0.5757209",
"0.5744311",
"0.5742865",
"0.5735047",
"0.5734835",
"0.57314676",
"0.57158846",
"0.57097805",
"0.57033515",
"0.5702802",
"0.57017154",
"0.56904376",
"0.56768167",
"0.5669221",
"0.56637686",
"0.56574243",
"0.56421715",
"0.5642109",
"0.5642051",
"0.5639964",
"0.5638214",
"0.5633529",
"0.56297624",
"0.5626555",
"0.5625205",
"0.56249833",
"0.5621233",
"0.56183",
"0.56104815",
"0.56096286",
"0.5601526",
"0.5599608",
"0.55908674",
"0.55894655",
"0.55859345",
"0.5578799",
"0.5577778",
"0.55745405",
"0.5570784",
"0.55684745",
"0.5566649",
"0.5565203",
"0.55640835",
"0.5561987",
"0.55610096",
"0.5556134",
"0.5551145",
"0.5545557"
] | 0.62253404 | 11 |
echo ('T_group_info Model init!!'); | protected static function init()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display() {\r\n\t\t$model = $this->getModel ( 'gruppi' );\r\n\t\t//$model->importJUser();\r\n\t\tparent::display();\r\n\t}",
"function groupmessageboard_init() {\n\n\telgg_extend_view('groups/tool_latest','gmessageboard/group_module',1);\n}",
"function __construct()\n {\n // load model\n Load::loadModel(\"group\");\n }",
"function miguel_mMain()\r\n {\t\r\n\t\t$this->base_Model();\r\n }",
"public function create_group()\r\n\t{\r\n\t\t// Load template\r\n\t\tinclude(BLUPATH_TEMPLATES .'/site/modules/create_group.php');\r\n\t}",
"function show( $id )\n{\n$data = $this->model_group->get( $id );\n$fields = $this->model_group->fields( TRUE );\n$this->template->assign( 'id', $id );\n$this->template->assign( 'group_fields', $fields );\n$this->template->assign( 'group_data', $data );\n$this->template->assign( 'table_name', 'Group' );\n$this->template->assign( 'template', 'show_group' );\n$this->template->display( 'frame_admin.tpl' );\n}",
"public function create_group() {\r\n $this->layout = '';\r\n\r\n $this->displayGroupType();\r\n\r\n $this->loadModel('GetRegisteredGroupData');\r\n $group_info = $this->GetRegisteredGroupData->find('all', array(\r\n 'order' => array('GetRegisteredGroupData.group_name' => 'asc')));\r\n\r\n $this->set('groupInfo', $group_info);\r\n }",
"function model()\n {\n return \"\";\n }",
"public function info(){\n $this->display('Main/Person/info') ;\n }",
"function __construct () {\n\n\t\techo 'I am in Model';\n\n\t}",
"public function groups() {\n\t\t//variabel\n\t\t$data['datas'] = $this->PbkGroups_model->get_all();\n\t\t\n\t\t$template_data['title'] = 'SMS Gateway ';\n\t\t$template_data['subtitle'] = 'Kirim SMS';\n $template_data['crumb'] = ['SMS Gateway' => 'smsgateway', 'SMS Groups' => 'smsgateway/kirimsms/groups',];\n\t\t//view\n\t\t$this->layout->set_wrapper('groups_form', $data);\n\t\t$this->layout->auth();\n\t\t$this->layout->render('admin', $template_data);\n\t}",
"function save_group() {\n\n // Load::loadModel(\"group\");\n\n $groupObj=new groupModel();\n\n $groupObj->savegroupData($_POST);\n }",
"public function display() {\n\t}",
"public function create()\n\t{\n\t\t//\n\t\techo'create';\n\t}",
"function displaySetup(& $tpl)\n {\n\n $return_string = '';\n\n\n $this->admin_auth_handler_->perm_->addLanguage('en', 'english', 'English language');\n $this->admin_auth_handler_->perm_->setCurrentLanguage('en');\n $app_id = $this->admin_auth_handler_->perm_->addApplication('HEM', 'Heuristic Evaluation Manager');\n if(PEAR::isError($app_id))\n {\n\t$return_string.= \"<pre>Adding App:\";\n\t$return_string.= var_export($app_id);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Application $app_id<br/>\";\n \n $area_id = $this->admin_auth_handler_->perm_->addArea($app_id, 'AREA', 'The Only Area');\n \n if(PEAR::isError($area_id))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($area_id);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Area $area_id<br/>\"; \n \n\n $group_id_1 = $this->admin_auth_handler_->perm_->addGroup('evaluator', 'The Evaluators', TRUE, 'EVALUATOR');\n if(PEAR::isError($group_id_1))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_1);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_1<br/>\"; \n\n $group_id_2 = $this->admin_auth_handler_->perm_->addGroup('manager', 'The Managers', TRUE, 'MANAGER');\n if(PEAR::isError($group_id_2))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_2);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_2<br/>\"; \n\n $group_id_3 = $this->admin_auth_handler_->perm_->addGroup('admin', 'The Administrators', TRUE, 'ADMIN');\n if(PEAR::isError($group_id_3))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_3);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_3<br/>\"; \n\n\n\n $tpl->setCurrentBlock('main_block');\n \n $tpl->setVar('CONTENT', $return_string);\n \n $tpl->parseCurrentBlock();\n\n return 1;\n\n }",
"function __construct()\n\t{\n\t\tparent :: __construct();\n\t\t$this -> load -> model('getinfo','m');\n\t}",
"function index( $page = 0 )\n{\n$this->model_group->pagination( TRUE );\n$data_info = $this->model_group->lister( $page );\n$fields = $this->model_group->fields( TRUE );\n\n$this->template->assign( 'pager', $this->model_group->pager );\n$this->template->assign( 'group_fields', $fields );\n$this->template->assign( 'group_data', $data_info );\n$this->template->assign( 'table_name', 'group' );\n$this->template->assign( 'template', 'list_group' );\n$this->template->display( 'frame_admin.tpl' );\n}",
"function miguel_MCourse() \r\n {\t\r\n $this->base_Model();\r\n }",
"public function Say()\n\t{\n\t\treturn 'X em models';\n\t}",
"function halamanbaru(){\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_halaman->halamanstatis();\n\t\t$data['record2'] = $this->model_halaman->en_halamanstatis();\n\t\t$this->load->view('administrator/mod_halaman/view_halaman2',$data);\n\t}",
"public function info(){\n }",
"function MENU_startGroup($name)\n{\n\t echo(\"<li>$name<br>\n\t <table> \n\t \");\n}",
"function field_group_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\t}",
"public function execute()\n {\n //echo __('Hello Webkul Team.');\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }",
"public function mostrar(){\n\t\t\t\techo \"<p> Hola soy un $this->marca, modelo $this->modelo</php> \";\n\t\t\t}",
"function display() {\r parent::display();\r }",
"public function __construct() {\n $this->dbUtil = DatabaseAccess::getInstance();\n echo '<h2>IS 218 Program 2</h2>';\n }",
"public function displayGroupType() {\r\n\r\n $this->loadModel('SelectGroupType');\r\n $group_types = $this->SelectGroupType->find('all');\r\n\r\n $this->set('groupTypes', $group_types);\r\n }",
"public function account_group()\n {\n //goal: one controller and one module for complete genric Creation.\n $form_validation='account_group';\n $table_name='account_group';\n $view='accounts/account_group';\n $field='account_group_name';\n $this->insert_genric($form_validation,$table_name,$view,$field);\n }",
"public function account_group()\n {\n //goal: one controller and one module for complete genric Creation.\n $form_validation='account_group';\n $table_name='account_group';\n $view='accounts/account_group';\n $field='account_group_name';\n $this->insert_genric($form_validation,$table_name,$view,$field);\n }",
"function init_groups() {\r\n\tif (!HYPEGALLERY_GROUP_ALBUMS) {\r\n\t\treturn;\r\n\t}\r\n\tadd_group_tool_option('albums', elgg_echo('gallery:groupoption:enable'), true);\r\n\telgg_extend_view('groups/tool_latest', 'framework/gallery/group_module');\r\n}",
"function system_addto_group($paramv)\n{\n}",
"function display( $tpl = null )\n\t{\n\t\t$document = & JFactory::getDocument();\n\t\t$uri = &JFactory::getURI();\t\t\n\t\t\t\t\n\t\t\n \n //$model =& $this->getModel( 'jlxmlexports' ); \n $model =& $this->getModel();\n \n /*\n echo '<pre>';\n\t\tprint_r($model);\n\t\techo '</pre>';\n\t\t*/\n\t\t\n $model->exportData();\n\n\t\tparent::display( $tpl );\n\t}",
"private function newModel(){\n\t\t$this->assign('title', 'New Model');\n\t\t$this->assign('types', $this->getModelTypes());\n\t\t$this->display('model/new.tpl');\n\t}",
"function system_add_group($paramv)\n{\n}",
"public function actionCreate() \n {\n $model = new HrGroup();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->save();\n return $this->redirect(['index', 'id' => $model->smartgroup_code]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n 'kd_group'=>Yii::$app->ambilkode->Kodegroup_company()\n ]);\n }\n }",
"function display($tpl = null)\n\t{\n\t\t// print \"Hello from JoomoogalleryViewJoomoogallerygroups::display()<br />\\n\";\n\t\t// print \"tpl = \\\"\" . $tpl . \"\\\"<br />\\n\";\n\t\t// $tpl = 'html'; // loads tmpl/default_html.php (instead of tmpl/default.php)\n\n\t\tparent::display($tpl);\n\t}",
"public function __construct(){\n $this->individualGroupModel = $this->model('IndividualGroupModel');\n }",
"public function show()\n {\n echo $this->constructGrid();\n }",
"function __construct()\n {\n // load model\n Load::loadModel(\"helpDesk\");\n }",
"public function __construct()\n {\n echo \"constructeur model\";\n }",
"public function run()\n {\n $group = new Group();\n $group->name = 'quan tri he thong';\n $group->save();\n\n $group = new Group();\n $group->name = 'quan ly nhan su';\n $group->save();\n\n $group = new Group();\n $group->name = 'le tan';\n $group->save();\n\n $group = new Group();\n $group->name = 'quan ly phong';\n $group->save();\n\n $group = new Group();\n $group->name = 'quan ly dich vu';\n $group->save();\n }",
"public function admin_add(){\n \n $this->set(\"title_for_layout\",\"Create a Satellite Group\");\n \n // Load all existing satellites\n $this->set('satellites', $this->Satellite->find('all'));\n }",
"public function label()\n {\n\n }",
"function infoScreenObject()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function displayTest( ) {\n }",
"function classname()\n\t\t{\n\t\t\techo \"</br>constructor with name of class \";\n\t\t\t\n\t\t}",
"public function display() {}",
"public function display() {}",
"function display() {\r\n\t\tparent::display ();\r\n\t}",
"public function init()\n {\n// $this->model = new Application_Model_DbTable_Material();\n $authorization = Zend_Auth::getInstance();\n if ($authorization->hasIdentity()) {\n $this->view->user_id = Zend_Auth::getInstance()->getStorage()->read()->id;\n $this->view->is_admin=Zend_Auth::getInstance()->getStorage()->read()->is_Admin;\n }\n\n $this->_helper->layout->setLayout('admin');\n $this->model1 = new Application_Model_DbTable_MaterialType();\n }",
"private function getHelpMessage()\n {\n return <<<EOT\nO comando <info>cekurte:group:update</info> atualiza o nome de um grupo na base de dados:\n\n<info>php app/console cekurte:group:update NomeAntigo NovoNome</info>\nEOT;\n }",
"public function info()\n {\n }",
"public function models()\n {\n $this->_display('models');\n }",
"public function init() {\n\t\t//$this->_helper->viewRenderer->setNoRender(true);\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->view->basePath = $registry->get('basepath'); \n\t\t$this->basePath = $registry->get('basepath'); \n $this->view->pathUPLD = $registry->get('pathUPLD');\n $this->view->procPath = $registry->get('procpath');\n\t // $ssogroup = new Zend_Session_Namespace('ssogroup');\n\t //echo \"TEST \".$ssogroup->n_user_grp.\" \".$ssogroup->i_user.\" \".$ssogroup->i_peg_nip;\n\t $this->user = 'cdr';\n\t // $this->username = 'Yuliah';\n\t //$this->nip = strtoupper($this->id['nip']);\n\t // $this->usernip = '060046350';\n\t // $this->kdorg = 'SK1201';\n\t // $this->modul = '5';\n\t // $this->category = 'A';\n\t\t\n\t\t$this->pengumuman_serv = Aplikasi_Pengumuman_Service::getInstance();\n\t\t\n\t\t// $this->sdm_caripeg_serv = Sdm_Caripegawai_Service::getInstance();\n }",
"public function hello()\n {\n return \"beep! I am a <i>\" . $this -> model . \"</i><br />\";\n }",
"function infoView()\n{\n require('model/modelAll.php');\n require('model/modelPronos.php');\n require('view/infoView.php');\n require('view/template/siteweb.php');\n}",
"public function run()\n {\n $group = new group([\n 'name'=> 'Assemblée Générale',\n 'description' =>'Le grand groupe assemblée générale',\n 'user_ID' => 1,\n 'logo' => 'default.png'\n ]);\n $group->save();\n\n /**on le role de administrateur pour AG****/\n $admin = new Role();\n $admin->name = 'admin_1';\n $admin->display_name = 'User Administrator of AG group'; // optional\n $admin->description = 'User is allowed to manage and edit other users'; // optional\n $admin->group_ID = 1; // optional\n $admin->save();\n\n $permission = \\App\\Permission::find(1);\n $admin->attachPermission($permission);\n\n //on attache le rôle admin au créateur du groupe\n $user = \\App\\User::find(1);\n $user->attachRole($admin);\n\n $user = \\App\\User::find(2);\n $user->attachRole($admin);\n\n $user = \\App\\User::find(3);\n $user->attachRole($admin);\n\n $user = \\App\\User::find(4);\n $user->attachRole($admin);\n }",
"function display()\r\n\t {\r\n\t parent::display();\r\n\t }",
"function lagarto() {\n $this->name=\"lagarto\";\n $this->title=\"Lagarto (panStamp)\";\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}",
"public function run()\n\t{\n\t\tDB::table('gg_modules')->delete();\n\t\t$modules = array(\n\t\t\tarray('id' => 1,'name' => 'Organization' ,'status' => \"1\")\n\t\t);\n\t\tDB::table('gg_modules')->insert($modules);\n\t}",
"public function show()\n\t{\n\t\t\n\t}",
"public function show()\n\t{\n\n\t}",
"public function show(){\n return 'hola desde la funcion show';\n }",
"public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}",
"function ParmsView() { \n $render = new AdminModel(); \n echo '<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-1\"></div>\n <div class=\"col-md-4\">\n <h2>Administrators:\n <a href=\"'.DIR.'index.php?page=adminView&action=insertNewAdmin\"><i class=\"fa fa-plus-square\"></a></i>\n </h2><br>';\n \n $displayAdmins = $render->getAdmins();\n foreach ($displayAdmins as $admin) {\n echo '<div class=\"box\"><a href=\"'.DIR.'index.php/?page=adminView&action=adminDetails&id='.$admin['adminId'].'\">' .$admin['adminName'].'</a>, </br>'.\n '<img src=\"'.DIR.'upload/'.$admin['adminImage'].'\"/>'. $admin['adminPhone'] . '</br>'. $admin['adminRole'] . '</br>'. $admin['adminEmail'] .'</div></br>';\n };\n\n\t\techo '</div>\n <div class=\"col-md-5\">';\n }",
"function display()\n {\n parent::display();\n }",
"function display()\n {\n parent::display();\n }",
"function display()\n {\n parent::display();\n }",
"public function mostrarInfo()\n {\n // $datos.= \"Cuatrimestre\".$this->cuatrimestre;\n // return parent::mostrarInfo().\" \".$datos;\n }",
"public function display(){}",
"public function admin_init(){\n\n\t}",
"function __construct() \r\n{\r\n $this->name=\"scheduled_job\";\r\n $this->title=\"scheduled job module\";\r\n $this->module_category=\"<#LANG_SECTION_SYSTEM#>\";\r\n //$this->checkInstalled();\r\n}",
"function __construct(){\n parent::__construct();\n $this->includeModel(\"TPrograma\");\n $this->vista->setTitle('Programas');\n // $smarty = new Smarty;\n }",
"public function show()\n { \n }",
"function hola(){\n $pruebas = new model_pruebas(\"bd\");\n $pruebas->pruebas();\n }",
"function system_mod_group($paramvect)\n{\n}",
"public function action_init()\n\t{\n\t\t$this->add_template('statusnet.tpl', dirname(__FILE__) . '/statusnet.tpl.php');\n\t}",
"public function init()\n {\n \n \n \n \n $this->setName('Add Pysiciangroup');\n\n\n $this->addElement(\"text\",\"id\",array('label'=>'Physician id :','required'=>true));\n \n $this->addElement(\"text\",\"name\",array('label'=>'physician name:','required'=>TRUE));\n \n \n #$physiciangroupName = new Zend_Form_Element_Text('physiciangroup');\n #$physiciangroupName->setLabel('Physiciangroup Name :')->setAttrib(\"placeholder\", \"Type Name\")\n #->setRequired(true)->addPhysiciangroup('NotEmpty');\n\n # $submit = new Zend_Form_Element_Submit('submit');\n # $submit->setLabel('Add');\n\n \n $this->addElement(\"submit\",\"id\",array('label'=>'Add'));\n \n \n $this->addElements(array($physiciangroupName, $submit));\n \n \n \n \n }",
"function b_system_info_show($options)\n{\n $xoops = Xoops::getInstance();\n $xoops->db();\n global $xoopsDB;\n $myts = MyTextSanitizer::getInstance();\n $block = array();\n if (!empty($options[3])) {\n $block['showgroups'] = true;\n $result = $xoopsDB->query(\"SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM \" . $xoopsDB->prefix(\"groups_users_link\") . \" l LEFT JOIN \" . $xoopsDB->prefix(\"users\") . \" u ON l.uid=u.uid LEFT JOIN \" . $xoopsDB->prefix(\"groups\") . \" g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid\");\n if ($xoopsDB->getRowsNum($result) > 0) {\n $prev_caption = \"\";\n $i = 0;\n while ($userinfo = $xoopsDB->fetchArray($result)) {\n if ($prev_caption != $userinfo['groupname']) {\n $prev_caption = $userinfo['groupname'];\n $block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);\n }\n if ($xoops->isUser()) {\n $block['groups'][$i]['users'][] = array(\n 'id' => $userinfo['uid'],\n 'name' => $myts->htmlspecialchars($userinfo['uname']),\n 'pm_link' => XOOPS_URL . \"/pmlite.php?send2=1&to_userid=\" . $userinfo['uid'],\n 'avatar' => XOOPS_UPLOAD_URL . '/' . $userinfo['user_avatar']\n );\n } else {\n if ($userinfo['user_viewemail']) {\n $block['groups'][$i]['users'][] = array(\n 'id' => $userinfo['uid'],\n 'name' => $myts->htmlspecialchars($userinfo['uname']),\n 'msg_link' => $userinfo['email'],\n 'avatar' => XOOPS_UPLOAD_URL . '/' . $userinfo['user_avatar']\n );\n } else {\n $block['groups'][$i]['users'][] = array(\n 'id' => $userinfo['uid'],\n 'name' => $myts->htmlspecialchars($userinfo['uname'])\n );\n }\n }\n $i++;\n }\n }\n } else {\n $block['showgroups'] = false;\n }\n $block['logourl'] = XOOPS_URL . '/images/' . $options[2];\n $block['recommendlink'] = \"<a href=\\\"javascript:openWithSelfMain('\" . XOOPS_URL . \"/misc.php?action=showpopups&type=friend&op=sendform&t=\" . time() . \"','friend',\" . $options[0] . \",\" . $options[1] . \")\\\">\" . SystemLocale::RECOMMEND_US . \"</a>\";\n return $block;\n}",
"public function create()\n\t{\n\t\t//\n\t\techo \"create\";\n\t}",
"public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('UMS/m_umgroup');\n\t\t$this->load->model('UMS/m_umsystem');\n\t\t$this->load->model('UMS/m_umgpermission');\n\t\t$this->load->model('UMS/m_ummenu');\n\t}",
"public function create()\n {\n //\n echo \"create\";\n }",
"public function create()\n {\n //\n echo \"create\";\n }",
"public function show_product_name()\n {\n $data['all_value'] = $this->Common_model->get_all_info_orderby('create_product_name',\"record_id\",\"DESC\");\n $result=$this->load->view('admin/show_product_name', $data,true);\n echo $result;\n exit;\n }",
"public function add(){\n echo \"Add a module !\\n\";\n }",
"function index()\n {\n $data['groups'] = $this->Group_model->get_all_groups();\n \n $data['_view'] = 'group/index';\n $this->load->view('layouts/main',$data);\n }",
"Public function displayInfo(){ \r\n\t\t\techo \"The info about the dress.\"; \r\n\t\t\techo $this->color; \r\n\t\t\techo $this->fabric ; \r\n\t\t\techo $this->design;\r\n\t\t\techo self::MEDIUM;\r\n\t\t}",
"public function tambah_toko(){\n\t}",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function preDisplay()\n {\n if (!$GLOBALS['current_user']->isAdminForModule('Users') && !$GLOBALS['current_user']->isDeveloperForModule('Users'))\n dotb_die(\"Unauthorized access to administration.\");\n\n\n //Customize Team Management - By Lap Nguyen\n include_once(\"custom/modules/Teams/_helper.php\");\n $ss = new Dotb_Smarty();\n $region = $GLOBALS['app_list_strings']['region_list'];\n $nodes = getTeamNodes();\n $ss->assign(\"MOD\", $GLOBALS['mod_strings']);\n $ss->assign(\"NODES\", json_encode($nodes));\n $ss->assign(\"APPS\", $GLOBALS['app_strings']);\n $ss->assign(\"CURRENT_USER_ID\", $GLOBALS['current_user']->id);\n\n $detail = getTeamDetail('1');\n $ss->assign(\"team_name\", $detail['team']['team_name']);\n $ss->assign(\"legal_name\", $detail['team']['legal_name']);\n $ss->assign(\"short_name\", $detail['team']['short_name']);\n $ss->assign(\"prefix\", $detail['team']['prefix']);\n $ss->assign(\"phone_number\", $detail['team']['phone_number']);\n $ss->assign(\"team_id\", $detail['team']['team_id']);\n $ss->assign(\"parent_name\", $detail['team']['parent_name']);\n $ss->assign(\"parent_id\", $detail['team']['parent_id']);\n $ss->assign(\"manager_user_id\", $detail['team']['manager_user_id']);\n $ss->assign(\"manager_user_name\", $detail['team']['manager_user_name']);\n $ss->assign(\"description\", $detail['team']['description']);\n $ss->assign(\"count_user\", $detail['team']['count_user']);\n $ss->assign(\"region\", $detail['team']['region']);\n $ss->assign(\"select_region\", $region);\n\n echo $ss->fetch('custom/modules/Teams/tpls/TeamManagement.tpl');\n dotb_die();\n }",
"public function create()\n {\n echo \"create\";\n }",
"public function create()\n {\n echo \"create\";\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }"
] | [
"0.6496339",
"0.6377201",
"0.6340512",
"0.63042873",
"0.6286095",
"0.62701666",
"0.61889595",
"0.6051195",
"0.59630615",
"0.5939663",
"0.5930781",
"0.59022796",
"0.5858376",
"0.5831459",
"0.579548",
"0.5780874",
"0.57636833",
"0.5745324",
"0.57064694",
"0.5687466",
"0.568454",
"0.5673083",
"0.5668017",
"0.56578475",
"0.56553763",
"0.56533617",
"0.562698",
"0.5626293",
"0.561059",
"0.561059",
"0.5606584",
"0.5599949",
"0.55946076",
"0.5584185",
"0.55820644",
"0.5579623",
"0.5575084",
"0.5547234",
"0.5546722",
"0.55433756",
"0.55349475",
"0.5530295",
"0.5523736",
"0.551717",
"0.5516748",
"0.5512929",
"0.5512929",
"0.5510802",
"0.5510802",
"0.55022705",
"0.5499423",
"0.54980874",
"0.54980874",
"0.54940134",
"0.54933774",
"0.549159",
"0.54913867",
"0.54851717",
"0.54835826",
"0.5482925",
"0.5476052",
"0.54699254",
"0.546653",
"0.5461421",
"0.54592806",
"0.544437",
"0.54318213",
"0.54307836",
"0.5426792",
"0.5425183",
"0.54246074",
"0.54246074",
"0.54246074",
"0.54240185",
"0.5419369",
"0.54175186",
"0.54151917",
"0.5413155",
"0.5407758",
"0.54046875",
"0.5400459",
"0.5379863",
"0.5379154",
"0.53787416",
"0.5378615",
"0.53773886",
"0.53688365",
"0.53688365",
"0.5358746",
"0.53571355",
"0.5354772",
"0.5353107",
"0.5352212",
"0.5350193",
"0.53473234",
"0.53412193",
"0.53412193",
"0.53398234",
"0.53398234",
"0.53398234",
"0.5338707"
] | 0.0 | -1 |
//$this>errMsgsArr[$fieldName] = array("errCode"=>$errCode, "msg"=>$msg, "fieldName"=>$fieldName); | protected function addErrMsg($msg, $fieldName, $errCode, $severity) //should be in abstract class
{
$this->errMsgsArr[$fieldName] = new ERR($msg, $fieldName, $errCode, $severity);
//if required then "Required field $fieldName" + msg
//msg either "field is not of expected data type integer" or "is not of expected data type integer"
//or msg = "field cannot be blank" or "field cannot be null"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_to_error_array($field = '', $message = '')\n {\n if ( ! isset($this->_error_array[$field]))\n {\n $this->_error_array[$field] = $message;\n }\n\n return;\n }",
"private function _error($msg = '')\n {\n return array('error' => $msg);\n }",
"function insertErrorList($msg){\n\t\t$this->_errorList[] = array(\"msg\" => $msg);\n\t}",
"function set_errArr ($err, $err_code, $err_descr, &$errArr) {\n\t$errArr[ERR_CODE] = $err_code;\n\t$errArr[ERR_DESCR] = $err_descr; \n\tif ($err == NULL) {\n\t\t$errArr[ERR_LONG_DESCR] = ZERO_LENGTH_STRING;\n\t}\n\telse {\n\t\t$errArr[ERR_LONG_DESCR] = $err->getMessage();\n\t}\n}",
"function init_errArr ($function_name) {\n\treturn(array(ERR_CODE=>0, ERR_FUNCTION_NAME=>$function_name, ERR_DESCR=>\"\",\n\t\tERR_LONG_DESCR=>\"\", ERR_SQLSTATE=>\"\", ERR_SQLSTATE_MSG=>\"\", ERR_AFFECTED_ROWS=>0, ERR_INSERT_ID=>0));\n}",
"function PushError($fctname,$msg,$desc=false){\n\t\t$error=array();\n\t\t$error['time']=time();\n\t\t$error['fctname']=$fctname;\n\t\t$error['msg']=$msg;\n\t\t$error['desc']=$desc;\n\t\tif($desc) $tmp=' ('.$desc.')'; else $tmp='';\n\t\t$this->SendMSG($fctname.': '.$msg.$tmp);\n\t\treturn(array_push($this->_error_array,$error));\n\t}",
"function setError ($msg) {\r\n $this->errors[]=$msg;\r\n }",
"function uniqueField($fieldName,$msg=\"Already taken.\"){\n\n\t\t$this->unique[$fieldName]['msg'] = $msg;\n\n\t}",
"public static function getErrorObject($key){\n $arr = [\n\n //----------------------------------------------------------------------------------------------------------\n // success messeges : 200\n 'Login_success' => [\n 'msg' => 'logging in successfuly',\n 'code' => 200\n ],\n 'Register_success' => [\n 'msg' => 'you have been registered successfuly',\n 'code' => 200\n ],\n 'VerifyAccount_success' => [\n 'msg' => 'your account has been verified successfuly!',\n 'code' => 200\n ],\n 'ChangePassword_success' => [\n 'msg' => 'password has been changed successfuly!',\n 'code' => 200\n ],\n 'editUser_success' => [\n 'msg' => 'user has been edited successfuly!',\n 'code' => 200\n ],\n 'logout_success' => [\n 'msg' => 'user has been logged out successfuly!',\n 'code' => 200\n ],\n 'getUserProfile_success' => [\n 'msg' => 'getting your profile successfuly!',\n 'code' => 200\n ],\n 'resetPassword_success' => [\n 'msg' => 'your password has been set successfuly!',\n 'code' => 200\n ],\n 'verificationCode_success' => [\n 'msg' => 'the verification code has been sent to you successfuly!',\n 'code' => 200\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // General Messeges : -1 -> -3\n 'missingVal' => [\n 'msg' => '',\n 'code' => -1\n ],\n 'GeneralError' => [\n 'msg' => 'something went wrong!',\n 'code' => -2\n ],\n 'Session_Offline' => [\n 'msg' => 'this action cant be done offline!',\n 'code' => -3\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // login messeges : -4 -> -9\n 'wrongPassword' => [ ////////////////////////////////////////////\n 'msg' => 'wrong Password!',\n 'code' => -4\n ],\n 'Login_verifyNeeded' => [\n 'msg' => 'you need to verify your account before logging in!',\n 'code' => -5\n ],\n 'userNameNotExist' => [ ////////////////////////////////////////////\n 'msg' => 'userName is not exist!',\n 'code' => -6\n ],\n 'Login_Blocked' => [\n 'msg' => 'you cant logged in by blocked account',\n 'code' => -7\n ],\n 'Login_SessionError' => [\n 'msg' => 'this session cant be opened cause of some error',\n 'code' => -8\n ],\n 'Login_VerificationCode' => [\n 'msg' => 'verification code cant be added',\n 'code' => -9\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // register messeges : -10\n 'Register_repeatedElement' => [\n 'msg' => '',\n 'code' => -10\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // VerifyAccount messeges : -11 -> -13\n 'VerifyAccount_verifiedbefore' => [\n 'msg' => 'your account is verified before!',\n 'code' => -11\n ],\n 'VerifyAccount_Blocked' => [\n 'msg' => 'you cant verify your account if you are blocked!',\n 'code' => -13\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // VerifyResetingPassword messeges : -14 -> -16\n 'VerifyResetingPassword_Blocked' => [\n 'msg' => 'you cant reset your password if your account are blocked',\n 'code' => -14\n ],\n 'VerifyResetingPassword_unverified' => [\n 'msg' => 'you cant reset your password if your account are unverified',\n 'code' => -16\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // ChangePassword messeges : -15 -> -17\n 'ChangePassword_unverifiedAccount' => [\n 'msg' => 'you need to verify your account to change your password!',\n 'code' => -15\n ],\n 'ChangePassword_blockedAccount' => [\n 'msg' => 'you cant change your password if your account is blocked!',\n 'code' => -16\n ],\n 'ChangePassword_loggedoutAccount' => [\n 'msg' => 'you cant change your password if your are offline!',\n 'code' => -17\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // sendVerificationCodeRegistering messeges : -18 -> -19\n 'sendVerificationCodeRegistering_unverified' => [\n 'msg' => 'you cant resend verification code if your account is verified',\n 'code' => -18\n ],\n 'sendVerificationCodeRegistering_Blocked' => [\n 'msg' => 'you cant resend verification code if your account is blocked',\n 'code' => -19\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // sendVerificationCodeResetingPasssword messeges : -20 -> -21\n 'sendVerificationCodeResetingPasssword_unverified' => [\n 'msg' => 'your cant resend verification code if your account isnt verified yet!',\n 'code' => -20\n ],\n 'sendVerificationCodeResetingPasssword_Blocked' => [\n 'msg' => 'your cant resend verification code if your account isnt blocked!',\n 'code' => -21\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // logout messeges : -22\n 'logout_loggedoutbefore' => [\n 'msg' => 'you are logged out before!',\n 'code' => -22\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // resetpassword messeges : -23 -> -24\n 'reset_verifyNeeded' => [\n 'msg' => 'you need to verify your account before reseting password!',\n 'code' => -23\n ],\n 'reset_Blocked' => [\n 'msg' => 'you cant reset your password if your account is blocked',\n 'code' => -24\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // editUser messeges : -25\n 'editUser_repeatedVal' => [\n 'msg' => '',\n 'code' => -25\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n\n ];\n return $arr[$key];\n }",
"function recordError($errorMessage){\n \n\t\t if(!is_array($this->errors)){\n\t\t\t\t$errors = array();\n\t\t }\n\t\t else{\n\t\t\t\t$errors = $this->errors;\n\t\t }\n\t\t\n\t\t $errors[] = $errorMessage;\n\t\t $this->errors = $errors;\n \n\t }",
"public function getErrorMessages(){\n return $this->arr_msg; \n }",
"function add_error($msg) {\n\t\t$this->errors[] = $msg;\n\t}",
"abstract protected function setValidationMessages(): array;",
"function setMsgField($mod, $sec, $field, $type, $note) {\n //success\n //information\n //warning\n //error\n\n if (!isset($_SESSION['msg_er']))\n $_SESSION['msg_er'] = array();\n\n if (!isset($_SESSION['msg_er'][$mod]))\n $_SESSION['msg_er'][$mod] = array();\n if (!isset($_SESSION['msg_er'][$mod][$sec]))\n $_SESSION['msg_er'][$mod][$sec] = array();\n\n if (!isset($_SESSION['msg_er'][$mod][$sec]['field']))\n $_SESSION['msg_er'][$mod][$sec]['field'] = array();\n\n $_SESSION['msg_er'][$mod][$sec]['field'][$field] = array(\n 'type' => $type,\n 'note' => $note\n );\n}",
"function err($msg, $field)\r\n\t\t{\r\n\t\t\t$this->msg->add($msg);\r\n\t\t\t$form_errors\t=\t$this->event->get('form_errors', array());\r\n\t\t\t$form_errors[]\t=\t$field;\r\n\t\t\t$this->event->set('form_errors', $form_errors);\r\n\t\t\t$this->error\t=\ttrue;\r\n\t\t}",
"public function manual_error($field, $message)\n\t{\n\t\t$this->_error_array[$field] = $message;\n\t}",
"public function serialize_form_error($arr){\n $errors=array();\n foreach ($arr as $value) {\n $errors[$value]=form_error($value);\n }\n return $errors;\n }",
"protected function _addError($msg)\n {\n\tif ( $this->name )\n\t{\n\t $this->errors[]= sprintf('%s (%s): %s', $this->name, get_class($this), $msg);\n\t}\n\telse\n\t{\n\t $this->errors[]= '%s '. sprintf('(%s): %s',get_class($this), $msg);\n\t}\n }",
"private function addError($key, $err_message){\n $this->errors[$key] = $err_message;\n }",
"private function log_error( $field_name, $code ) {\n\t\tself::$errors[$field_name] = $code;\n\t}",
"public function set_error($msg)\n\t{\n\t\tif (is_array($msg))\n\t\t{\n\t\t\tforeach ($msg as $val)\n\t\t\t{\n\t\t\t\t$msg = ($this->CI->lang->line($val) == FALSE) ? $val : $this->CI->lang->line($val);\n\t\t\t\t$this->error_msg[] = $msg;\n\t\t\t\tlog_message('error', $msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = ($this->CI->lang->line($msg) == FALSE) ? $msg : $this->CI->lang->line($msg);\n\t\t\t$this->error_msg[] = $msg;\n\t\t\tlog_message('error', $msg);\n\t\t}\n\t}",
"function label( $field_name, $label ) {\n// okay, the reason this is failing, is that I think it is being called before the array is being created. The fields array does not have any contents until validate() method is invoked. So during form setup, it has no content.\n// what I did was adde a labels list so the calling program can create the labels as an assoc. array before validate is invoked.\n\n// debug\n//print \"Setting Label: $label on Field: $field_name\";\n$this->fields[$field_name][label] = $label;\n//print \"Label Set To: \". $this->fields[$field_name][label];\n\t\t\n}",
"function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}",
"private function correctRequest($msg){\n return array(\"error\" => false,\"msg\" => $msg);\n }",
"function messages( $array ) {\n\t\t$this->messages_list = $array;\n\t\t}",
"function errorLogin() {\n\t\t\t\n\t$loginError = new stdClass();\n\t$loginError->type = 'message';\n\t$loginError->message = $GLOBALS['lang']['error_login_login'];\n\t\n\t$returnArray = array(\n\t\t'error' => array()\n\t);\n\tarray_push($returnArray['error'], $loginError);\n\t\n\treturn $returnArray;\n}",
"public function errorMessage($errorCode){\n switch ($errorCode) {\n case \"001\":\n $arr = array('code_metier' => '001', 'message' => \"Une erreur interne s'est produite.\");\n break;\n case \"002\":\n $arr = array('code_metier' => '002', 'message' => \"Paramètre(s) manquant(s).\");\n break;\n case \"003\":\n $arr = array('code_metier' => '003', 'message' => \"Le login ou le mot de passe est incorrect.\");\n break;\n case \"004\":\n $arr = array('code_metier' => '004', 'message' => \"Accès refusé.\");\n break;\n case \"005\":\n $arr = array('code_metier' => '005', 'message' => \"Votre token est expiré.\");\n break;\n case \"006\":\n $arr = array('code_metier' => '006', 'message' => \"Cet utilisateur existe déjà.\");\n break;\n case \"007\":\n $arr = array('code_metier' => '007', 'message' => \"Vous n'êtes pas administrateur.\");\n break;\n case \"008\":\n $arr = array('code_metier' => '008', 'message' => \"Utilisateur inconnu.\");\n break;\n case \"009\":\n $arr = array('code_metier' => '009', 'message' => \"Cette communauté existe déjà.\");\n break;\n case \"010\":\n $arr = array('code_metier' => '010', 'message' => \"Cette communauté n'existe pas.\");\n break;\n case \"011\":\n $arr = array('code_metier' => '011', 'message' => \"Cette idée n'existe pas.\");\n break;\n case \"012\":\n $arr = array('code_metier' => '012', 'message' => \"Ce commentaire n'existe pas.\");\n break;\n case \"013\":\n $arr = array('code_metier' => '013', 'message' => \"Les champs doivent être remplis.\");\n break;\n case \"014\":\n $arr = array('code_metier' => '014', 'message' => \"Ce commentaire n'existe pas.\");\n break;\n default:\n $arr = array('code_metier' => '001', 'message' => \"Une erreur interne s'est produite.\");\n }\n\n $reponse = $arr = array('error' => $arr);\n $reponse = json_encode($reponse,JSON_UNESCAPED_UNICODE);\n\n return new JsonResponse($reponse, 500);\n }",
"function tbldef($tbl)\n{\n$memp=array();$mfields=array();\n$sql_fields=\"select fieldid,tblid,name,alias,type from field where tblid=(select tblid from config where name='$tbl')\";\necho $sql_fields;\n$resultf=mysql_query($sql_fields) or die(\"from here\".mysql_error());\nwhile($rowf=mysql_fetch_array($resultf))\n{\n$mfields[$rowf['alias']]=$rowf['name'];\n$mfields[$rowf['name'].'type']=$rowf['type'];\n$mfields[$rowf['name'].'fieldid']=$rowf['fieldid'];\n$mfields[$rowf['name'].'tblid']=$rowf['tblid'];\n}\n//$memp[$empid]=$mfields;\n\n//$memp['1011']=array('vipul'=>'great');\n//$memp['1011']=array_add('neha');\n//var_dump($mfields);\nreturn $mfields;\n}",
"public function arr() {\n $customer_msgs = array();\n /* for ($i = 1; $i <= 10; $i++) {\n /* $msgs = array(); */\n /* $msgs[$i] = \"Message \" . $i;\n /* array_push($arrs, $msgs); */\n /* } */\n $customer_msgs['1'] = \"This Email is not Registered\";\n $customer_msgs['2'] = \"Name is required\";\n $customer_msgs['3'] = \"Age is required\";\n $customer_msgs['4'] = \"Breed is required\";\n $customer_msgs['5'] = \"Seassion token was expired.\"; /* token */\n $customer_msgs['6'] = \"Your unique id is missing\";\n $customer_msgs['7'] = \"Image is required\";\n $customer_msgs['8'] = \"Invalid Input\";\n $customer_msgs['9'] = \"Token Expired\";\n $customer_msgs['10'] = \"Owner ID not Found\";\n $customer_msgs['11'] = \"Not a valid token\";\n $customer_msgs['12'] = \"No Dogs Found\";\n $customer_msgs['13'] = \"Driver not Found\";\n $customer_msgs['14'] = 'PayPal unique id is missing.';\n $customer_msgs['15'] = 'Contact numbers are required.';\n $customer_msgs['16'] = 'Your ETA is required.';\n $customer_msgs['17'] = 'No Credit Found';\n $customer_msgs['18'] = 'Successfully Log-Out';\n $customer_msgs['19'] = \"Id of Request is required\";\n $customer_msgs['20'] = \"Already Rated\";\n $customer_msgs['21'] = \"Walk is not completed\";\n $customer_msgs['22'] = \"Walk ID doesnot matches with Dog ID\";\n $customer_msgs['23'] = \"Walk ID Not Found\";\n $customer_msgs['24'] = 'Invalid Phone Number';\n $customer_msgs['25'] = 'Phone number must be required.';\n $customer_msgs['26'] = 'Social Login unique id must be required.';\n $customer_msgs['27'] = 'Email ID already Registred';\n $customer_msgs['28'] = 'Password field is required.';\n $customer_msgs['29'] = 'Email field is required';\n $customer_msgs['30'] = 'Name field is required.';\n $customer_msgs['31'] = 'Last Name field is required.';\n $customer_msgs['32'] = 'Push notification token is required.';\n $customer_msgs['33'] = 'Device type must be android or ios';\n $customer_msgs['34'] = 'Login type is required.';\n $customer_msgs['35'] = 'Login by mismatch';\n $customer_msgs['36'] = 'Invalid Username and Password';\n $customer_msgs['37'] = 'Not a Registered User';\n $customer_msgs['38'] = 'Not a valid social registration User';\n $customer_msgs['39'] = 'Card number\\'s last four digits are missing.';\n $customer_msgs['40'] = 'Unique payment token is missing.';\n $customer_msgs['41'] = 'Could not create client ID';\n $customer_msgs['42'] = 'Unique card ID is missing.';\n $customer_msgs['43'] = 'Card ID and ' . Config::get('app.generic_keywords.User') . ' ID Doesnot matches';\n $customer_msgs['44'] = 'Card not found';\n $customer_msgs['45'] = 'This user does not have a referral code';\n $customer_msgs['46'] = 'No Card Found';\n $customer_msgs['47'] = 'Invalid Old Password';\n $customer_msgs['48'] = 'Old Password must not be blank';\n $customer_msgs['49'] = \"location points are missing\";\n $customer_msgs['50'] = '' . Config::get('app.generic_keywords.User') . 'ID not Found';\n $customer_msgs['51'] = 'Request ID doesnot matches with' . Config::get('app.generic_keywords.User') . ' ID';\n $customer_msgs['52'] = 'Request ID Not Found';\n $customer_msgs['53'] = '' . Config::get('app.generic_keywords.User') . ' ID not Found';\n $customer_msgs['54'] = 'No walker found';\n $customer_msgs['55'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found matching the service type'; /* remaining from here */\n $customer_msgs['56'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found';\n $customer_msgs['57'] = 'Selected provider\\'s unique id is missing.';\n $customer_msgs['58'] = 'Your previous Request is Pending.';\n $customer_msgs['59'] = 'Please add card first for payment.';\n $customer_msgs['60'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found matching the service type for scheduled request.';\n $customer_msgs['61'] = 'Invalid Promo Code';\n $customer_msgs['62'] = 'You can not apply multiple code for single trip.';\n $customer_msgs['63'] = 'Promotional code successfully applied.';\n $customer_msgs['64'] = 'Promotional code is not available';\n $customer_msgs['65'] = 'Promotional code already used.';\n $customer_msgs['66'] = 'Promotion feature is not active on card payment.';\n $customer_msgs['67'] = 'Promotion feature is not active on cash payment.';\n $customer_msgs['68'] = 'Promotion feature is not active.';\n $customer_msgs['69'] = 'You can\\'t apply promotional code without creating request.';\n $customer_msgs['70'] = 'Payment mode is paypal';\n $customer_msgs['71'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found for the selected service in your area currently';\n $customer_msgs['72'] = 'You are already in debt';\n $customer_msgs['73'] = 'Distance is required.';\n $customer_msgs['74'] = 'Time is required.';\n $customer_msgs['75'] = 'Request ID doesnot matches with ' . Config::get('app.generic_keywords.User') . ' ID';\n $customer_msgs['76'] = 'On going ' . Config::get('app.generic_keywords.Trip') . '.';\n $customer_msgs['77'] = 'No on going ' . Config::get('app.generic_keywords.Trip') . ' found.';\n $customer_msgs['78'] = 'Searching for ' . Config::get('app.generic_keywords.Provider') . 's.';\n $customer_msgs['79'] = 'No ' . Config::get('app.generic_keywords.Provider') . 's are available currently. Please try after sometime.';\n $customer_msgs['80'] = '' . Config::get('app.generic_keywords.Provider') . ' not Confirmed yet';\n $customer_msgs['81'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found around you.';\n $customer_msgs['82'] = 'Time-Zone is required';\n $customer_msgs['83'] = 'Schedule date and time must be required.';\n $customer_msgs['84'] = \"Sorry, You can't create schedule morethen two week faar from today.\";\n $customer_msgs['85'] = 'update successfully';\n $customer_msgs['86'] = 'Payment mode not updated';\n $customer_msgs['87'] = \"Destination Set Successfully\";\n $customer_msgs['88'] = 'Sorry You can\\'t create event earlier then 14 days.';\n $customer_msgs['89'] = 'Yo have invited maximum members for event.';\n $customer_msgs['90'] = 'Please change braintree as default gateway';\n $customer_msgs['91'] = \"Sorry, You have apready apply the refereel code.\";\n $customer_msgs['92'] = 'Referral process successfully completed.';\n $customer_msgs['93'] = \"Sorry, You can't apply your refereel code.\";\n $customer_msgs['94'] = 'Invalid referral code';\n $customer_msgs['95'] = 'You have skipped for referral process';\n $customer_msgs['96'] = 'No Dog Found';\n $customer_msgs['97'] = 'Payment type must be required.';\n $customer_msgs['98'] = 'Event Unique Id is missing.';\n $customer_msgs['99'] = 'Sorry you can\\'t delte past or ongoing event.';\n $customer_msgs['100'] = 'Event not found.';\n $customer_msgs['101'] = 'Event successfully deleted.';\n /* print_r($customer_msgs); */\n $provider_msgs = array();\n $provider_msgs['1'] = \"This Email is not Registered\";\n $provider_msgs['2'] = 'Password field is required.';\n $provider_msgs['3'] = 'Email field is required';\n $provider_msgs['4'] = 'Name field is required.';\n $provider_msgs['5'] = 'Last Name field is required.';\n $provider_msgs['6'] = 'Image is required';\n $provider_msgs['7'] = 'Push notification token is required.';\n $provider_msgs['8'] = 'Device type must be android or ios';\n $provider_msgs['9'] = 'Login type is required.';\n $provider_msgs['10'] = 'Phone number must be required.';\n $provider_msgs['11'] = 'Social Login unique id must be required.';\n $provider_msgs['12'] = 'Invalid Input';\n $provider_msgs['13'] = 'Invalid Phone Number';\n $provider_msgs['14'] = 'Email ID already Registred';\n $provider_msgs['15'] = 'Login by mismatch';\n $provider_msgs['16'] = 'Invalid Username and Password';\n $provider_msgs['17'] = 'Not a Registered User';\n $provider_msgs['18'] = 'Not a valid social registration User';\n $provider_msgs['19'] = 'Id of Request is required.';\n $provider_msgs['20'] = 'Your unique id is missing.';\n $provider_msgs['21'] = 'Already Rated';\n $provider_msgs['22'] = 'Service ID doesnot matches with ' . Config::get('app.generic_keywords.Provider') . ' ID';\n $provider_msgs['23'] = 'Service ID Not Found';\n $provider_msgs['24'] = 'Token Expired';\n $provider_msgs['25'] = '' . Config::get('app.generic_keywords.Provider') . ' ID not Found';\n $provider_msgs['26'] = 'Not a valid token';\n $provider_msgs['27'] = 'Service Already Started';\n $provider_msgs['28'] = 'location points are missing.';\n $provider_msgs['29'] = 'accept or reject must be required.';\n $provider_msgs['30'] = 'Request ID does not matches' . Config::get('app.generic_keywords.Provider') . ' ID';\n $provider_msgs['31'] = 'Request Canceled.';\n $provider_msgs['32'] = 'Request ID Not Found';\n $provider_msgs['33'] = '' . Config::get('app.generic_keywords.Provider') . ' not yet confirmed';\n $provider_msgs['34'] = 'Service not yet started';\n $provider_msgs['35'] = '' . Config::get('app.generic_keywords.Provider') . ' not yet arrived';\n $provider_msgs['36'] = 'Distance is required.';\n $provider_msgs['37'] = 'Time is required.';\n $provider_msgs['38'] = 'Invalid Old Password';\n $provider_msgs['39'] = 'Old Password must not be blank';\n $provider_msgs['40'] = 'Successfully Log-Out';\n\n\n foreach ($customer_msgs as $key => $value) {\n echo '<string name=\"error_' . $key . '\">' . $value . '</string>';\n }\n echo \"\\n ################################################################################ \\n\";\n foreach ($provider_msgs as $key => $value) {\n echo '<string name=\"error_' . $key . '\">' . $value . '</string>';\n }\n /* $i = 0;\n foreach ($customer_msgs as $customer_msg) {\n\n echo '<string name=\"error_' . $i . '\">' . $customer_msg . '</string>';\n $i++;\n } */\n exit;\n /* $response_array = array('success' => false, 'error' => 'Invalid Input', 'error_code' => 401, 'error_messages_client' => $customer_msgs, 'error_messages_provider' => $provider_msgs);\n $response_code = 200;\n $response = Response::json($response_array, $response_code);\n return $response; */\n }",
"function __validationErrors() {\n\t\tif ($validationErrors = $this->Session->read('validationErrors')) {\n\t\t\tforeach ($validationErrors as $k => $i) {\n\t\t\t\t$obj = ClassRegistry::init($k);\n\t\t\t\t$obj->validationErrors = $i;\n\t\t\t}\n\t\t\t$this->Session->write('validationErrors', null);\n\t\t}\n\t}",
"function validate_fields( $array ) {\n\t\t$this->validate_list = $array;\n\t\t}",
"public function posa_error($msg)\n {\n $this->error [] = $msg;\n }",
"public function setError($msg)\n {\n array_push($this->errors, $msg);\n }",
"public function addError($msg)\n\t{\n\t\t// Add to error array\n\t\t$this->errors[] = $msg;\n\t}",
"public function addField($fieldName,$fieldValue,$fieldParams=array()){\r\n if($fieldName=='CodSegRegDetalhe_G039' and $fieldValue==\"P\"){ \r\n $this->QtdeTitulos++; \r\n } else if($fieldName==\"QtdeTitCobranca1_C070\"){ //Informa o numero de titulos para o campo QtdeTitCobranca_C070\r\n $fieldValue = $this->QtdeTitulos;\r\n }\r\n //Se o campo informado for o valor do titulo soma com o valor anterior para totalizar\r\n if($fieldName=='VlrNominalTit_G070'){ \r\n //echo \"<h3>\".$fieldValue.\"</h3>\";\r\n $this->vlrTotTitulos = $fieldValue + $this->vlrTotTitulos;\r\n } else if($fieldName==\"ValorTotTitCart1_C071\"){ //Informa a soma dos titulos para o campo ValorTotTitCart1_C071\r\n $fieldValue = $this->vlrTotTitulos;\r\n } \r\n //Soma quantidade de registros do arquivo conforme o tipo 0,1,3,5,9 \r\n if($fieldName=='QtdeRegistArquivo_G056'){ \r\n $fieldValue = $this->QtdeRegsArquivo_G056;\r\n }\r\n //Numero sequencial de registros do lote (Ex: 1P, 2Q, 3P, 4Q)\r\n if($fieldName=='NumSeqRegLote_G038'){\r\n $fieldValue = $this->NumSeqRegLote_G038++;\r\n } \r\n //Soma quantidade de lotes do arquivo conforma o tipo 1,3,4,5\r\n if($fieldName=='TipoRegistro_G003' and $fieldValue>=1 and $fieldValue<=5){\r\n $this->QtdeRegistLote_G057++;\r\n } else if($fieldName=='QtdeRegistLote_G057'){\r\n $fieldValue=$this->QtdeRegistLote_G057;\r\n }\r\n //Verifica se o campo informado existe no dataset\r\n if(array_key_exists($fieldName, $this->dataSet)){\r\n $this->castType = new castType($this->dataSet[$fieldName]);\r\n \r\n //var_dump($this->dataSet[$fieldName]); exit;\r\n //var_dump($this->castType->value($fieldValue)); exit;\r\n \r\n if($this->castType->value($fieldValue)['status']){\r\n $this->lineArray[$fieldName]=$this->castType->value($fieldValue)['retorno'];\r\n $this->lineString .= $this->castType->value($fieldValue)['retorno'];\r\n //$this->lineString .= \"-\".$this->castType->value($fieldValue)['retorno']; \r\n }\r\n }else{//se nao existe o campo no dataset verifica qual o nome mais próximo para o campo \r\n $words = array_keys($this->dataSet);\r\n $msg = \"Campo \".$fieldName.\" inexistente, o mais proximo seria o campo \".$this->wordMatch($words, $fieldName, 2);\r\n $this->Exception($msg);\r\n $this->logMsg($msg);\r\n return $msg;\r\n }\r\n }",
"private function err_to_array() {\n return array(\n 'code' => $this->code,\n 'reason' => $this->http_status_code_string($this->code),\n 'message' => $this->message,\n );\n }",
"function addMember($arr, $key, $name, $birthday, $email){\n\t\t$arr[$key]['name'] = $name;\n\t\t$arr[$key]['birthday'] = $birthday;\n\t\t$arr[$key]['email'] = $email;\n\t\treturn $arr;\n\t}",
"public function __construct() \n {\n $this->_errorList = array();\n }",
"public function __construct() \n {\n $this->_errorList = array();\n }",
"function newFormErrorMessage($messageTitle, $messageText, $messageIcon, $messageType, $messageId) {\n\t\t$result = array();\n\t\t$result['messageTitle'] = $messageTitle;\n\t\t$result['messageText'] = $messageText;\n\t\t$result['messageIcon'] = $messageIcon;\n\t\t$result['messageType'] = $messageType;\n\t\t$result['messageId'] = $messageId;\n\t\treturn $result;\n\t}",
"private function _setReponseArray() {\n try {\n $this->RESP = array(\n 'MSG' => $this->MSG,\n 'STATUS' => $this->STATUS\n );\n } catch (Exception $ex) {\n throw new Exception('Crud Model : Error in _setReponseArray function - ' . $ex);\n }\n }",
"function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->description->value;\n\t\t/*\n\t\tforeach($this as $key => $value) {\n\n\t\t\t$obj[$key] = $value;\n\n\t\t}\n\t*/\n\t\treturn $obj;\n\t}",
"private function returnErrors() {\n\n return array(\n 'Settings' => array(\n 'type' => 'Client Side Errors',\n 'message' => $this->errors\n )\n );\n }",
"function setErrors( array $errors );",
"function getMsgList($key = \"\") {\n $msgListArr = array(\n 0 => \"Invalid email and password combination.\",\n 1 => \"Your account is not active.Please contact administrator.\",\n 2 => \"Invalid old password. Please enter correct password.\",\n 3 => \"Password updated Successfully.\",\n 4 => \"Please select another Username.\",\n 5 => \"Record Added Sucessfully.\",\n 6 => \"Record Updated Sucessfully.\",\n 7 => \"Record Removed Sucessfully.\",\n 8 => \"Please select another category name.\",\n 9 => \"Invalid email address.\",\n 10 => \"Error in sending email.\",\n );\n if (isset($msgListArr[$key]))\n return $msgListArr[$key];\n else\n return $msgListArr;\n}",
"static function set_error($errors, $message = '') {\r\n\t\t$old_error\t= \\Config::get('user_error');\r\n \r\n if(is_array($errors)) {\r\n foreach ($errors as $errors_key => $errors_value) {\r\n foreach ($errors_value as $error_key => $error_value) {\t\t\t\t\r\n $old_error[$errors_key][]\t= $error_value;\r\n }\r\n }\r\n }else {\r\n $old_error[$errors][]\t= $message;\r\n }\r\n\r\n\t\t\\Config::set('user_error',$old_error);\r\n\t\treturn $old_error;\r\n }",
"function split_validationdataArray($validationData)\n{\n\tglobal $log;\n\t$log->debug(\"Entering split_validationdataArray() method ...\");\n\t$fieldName = '';\n\t$fieldLabel = '';\n\t$fldDataType = '';\n\t$rows = count($validationData);\n\tforeach($validationData as $fldName => $fldLabel_array)\n\t{\n\t\tif($fieldName == '')\n\t\t{\n\t\t\t$fieldName=\"'\".$fldName.\"'\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fieldName .= \",'\".$fldName .\"'\";\n\t\t}\n\t\tforeach($fldLabel_array as $fldLabel => $datatype)\n\t\t{\n\t\t\tif($fieldLabel == '')\n\t\t\t{\n\t\t\t\t$fieldLabel = \"'\".$fldLabel .\"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fieldLabel .= \",'\".$fldLabel .\"'\";\n\t\t\t}\n\t\t\tif($fldDataType == '')\n\t\t\t{\n\t\t\t\t$fldDataType = \"'\".$datatype .\"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fldDataType .= \",'\".$datatype .\"'\";\n\t\t\t}\n\t\t}\n\t}\n\t$data['fieldname'] = $fieldName;\n\t$data['fieldlabel'] = $fieldLabel;\n\t$data['datatype'] = $fldDataType;\n\t$log->debug(\"Exiting split_validationdataArray method ...\");\n\treturn $data;\n}",
"function get_error() {\n\n if ($this->error_code === null)\n return false;\n\n return array('code' => $this->error_code,\n 'message' => $this->error_message,\n 'details' => $this->error_details);\n\n}",
"private function addError($fieldname, $error){\n $this->_errors[$fieldname] = $error;\n }",
"private function send_die_message($msg){\n\t\t$die_msg_arr['error']['code'] = 1;\n\t\t$die_msg_arr['error']['msg'] = $msg;\n\t\treturn $die_msg_arr;\n\t}",
"public function getError() {\n\t\t$error = array();\n\t\t$error['message'] = $this->err_message;\n\t\t$error['code'] = $this->err_code;\n\t\treturn $error;\n\t}",
"public function Msghandle(){\n\n\t\t\t$this->message = $this->msglog = $this->asciilog = $this->status = NULL;\n\t\t\t$this->showclassnames = TRUE;\n\n\t\t\t$this->msgcode = array(\n\t\t\t\t\t\t\t\t\t\t\"000\" => array(\"message\" => \"Message code not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"001\" => array(\"message\" => \"Connection resource is not set\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"002\" => array(\"message\" => \"Missing parameters\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"003\" => array(\"message\" => \"Statement is not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"004\" => array(\"message\" => \"Email address already taken\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"005\" => array(\"message\" => \"No row affected\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"006\" => array(\"message\" => \"Password not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"007\" => array(\"message\" => \"User data not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"008\" => array(\"message\" => \"Username doesn't exist\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"009\" => array(\"message\" => \"Wrong password\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"010\" => array(\"message\" => \"URL format is not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"011\" => array(\"message\" => \"No URL specified\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"012\" => array(\"message\" => \"BabelNet connection failed\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"013\" => array(\"message\" => \"Method is not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"014\" => array(\"message\" => \"Parameters are not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"015\" => array(\"message\" => \"Conflictual settings\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"016\" => array(\"message\" => \"Required attribute not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"017\" => array(\"message\" => \"Microsoft Translator auth token not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"018\" => array(\"message\" => \"A parameter is an array\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"019\" => array(\"message\" => \"A parameter is not an array\", \"status\" => \"Error\"),\n\n\t\t\t\t\t\t\t\t\t\t\"998\" => array(\"message\" => \"Operation successful\", \"status\" => \"Notice\"),\n\t\t\t\t\t\t\t\t\t\t\"999\" => array(\"message\" => \"Class instanced successfully\", \"status\" => \"Notice\"),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$this->log(\"999\", __METHOD__);\n\t\t}",
"protected function pushError($field, $field_error)\n {\n if (!empty($field_error)) {\n $this->errors[$field][] = $field_error;\n }\n }",
"function result_array_error($re)\n{\n return rjErr(get_return_errormsg($re));\n}",
"function add_error(&$log, $message){\n if(!is_array($log)) return;\n\n $log[] = array(\n \"type\" => \"error\",\n \"message\" => $message\n );\n}",
"public final function addError($fld, $msg)\n {\n if (!isset($this->errors[$fld]))\n $this->errors[$fld] = array();\n\n if (!is_array($msg))\n $msg = array(\n $msg\n );\n\n foreach ( $msg as $val )\n $this->errors[$fld][] = $val;\n\n return $this;\n }",
"function split_validationdataArray($validationData) {\n\tglobal $log;\n\t$log->debug('> split_validationdataArray', $validationData);\n\t$fieldName = '';\n\t$fieldLabel = '';\n\t$fldDataType = '';\n\tforeach ($validationData as $fldName => $fldLabel_array) {\n\t\tif ($fieldName == '') {\n\t\t\t$fieldName=\"'\".$fldName.\"'\";\n\t\t} else {\n\t\t\t$fieldName .= \",'\".$fldName .\"'\";\n\t\t}\n\t\tforeach ($fldLabel_array as $fldLabel => $datatype) {\n\t\t\tif ($fieldLabel == '') {\n\t\t\t\t$fieldLabel = \"'\".addslashes($fldLabel).\"'\";\n\t\t\t} else {\n\t\t\t\t$fieldLabel .= \",'\".addslashes($fldLabel).\"'\";\n\t\t\t}\n\t\t\tif ($fldDataType == '') {\n\t\t\t\t$fldDataType = \"'\".$datatype .\"'\";\n\t\t\t} else {\n\t\t\t\t$fldDataType .= \",'\".$datatype .\"'\";\n\t\t\t}\n\t\t}\n\t}\n\t$data['fieldname'] = $fieldName;\n\t$data['fieldlabel'] = $fieldLabel;\n\t$data['datatype'] = $fldDataType;\n\t$log->debug('< split_validationdataArray');\n\treturn $data;\n}",
"public function validateTableData($postArray,$editId) \n{\n \n $fldErrors=array();\n $tblErrors=array();\n $errorMesg=array();\n \n $fldErrors=$this->validateFieldData($postArray);\n \n $tblErrors=$this->validateTableDataToFile($postArray,$editId); \n\n $errorMesg=$this->mergeErrorArrays($fldErrors,$tblErrors);\n \n return $errorMesg;\n \n}",
"public function setError($error, $code, $msg){\n $this->errors[$error] = array('code'=>$code, 'message'=>$msg);\n }",
"function appendErrorMsg($string){\n\t\t$this->error[$this->errorIndex] = $string;\n\t\t$this->errorIndex++;\n\t}",
"function validate_presences_non_post($required_fields, $record,$warning_me=false) {\n global $errors;\n global $warnings;\n\n $msg_presence=array();\n foreach($required_fields as $field) {\n $value = trim($record[$field]);\n if (!has_presence($value)) {\n\n if ($warning_me) {\n $warnings[$field] = fieldname_as_text($field) . \" n'est pas rempli\";\n\n $msg_presence[$field]=$warnings[$field];\n // $msg_presence[$field]=get_warning_error($warnings[$field],$warning_me);\n\n // var_dump($warnings[$field]);\n }else{\n $errors[$field] = fieldname_as_text($field) . \" n'est pas rempli \";\n $msg_presence[$field]=$errors[$field];\n // $msg_presence[$field]=get_warning_error($errors[$field],$warning_me);;\n\n\n }\n // var_dump(debug_backtrace());\n\n }\n }\n\n return $msg_presence;\n}",
"function validateEmailFields($emailFields, $errorMsg=NULL)\n{\n\t $errorOut =\"\";\n\t $errorArray =\tarray();\n\t\n\t foreach($emailFields as $fieldName => $displayName)\n\t\t{\n\t\t\tif(!filter_var($_REQUEST[$fieldName], FILTER_VALIDATE_EMAIL)) \n\t\t\t{\n\t\t\t\tif(count($errorArray)> 0)\n\t\t\t\t\tarray_push($errorArray,\" & \". $displayName);\n\t\t\t\telse\n\t\t\t\t\tarray_push($errorArray, $displayName);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\n\t if(count($errorArray)> 0)\n\t\t {\n\t\t\t\n\t\t\tif($errorMsg!=NULL) // inserting the error message, if any at the first \n\t\t\t\t$errorArray=array_insert($errorArray, $errorMsg, 0);\n\t\t\t\n\t\t\tforeach($errorArray as $error)\n\t\t\t{\n\t\t\t\t$errorOut .= $error.'<br/>';\n\t\t\t}\n\t \n\t\t\t\n\t\t }\n\t\n\treturn $errorOut;\n}",
"function addMessage($texte)\n {\n $this->errorData[][\"message\"] = $texte;\n }",
"public function getErrors():array;",
"private function addError($rule,$msg=\"\") {\n\t\t$this->errors[] = (isset($rule['message'])) ? (string)$rule['message'] : $msg;\n\t}",
"function result_array_error_static($re)\n{\n return return_status_err(get_return_errormsg($re));\n}",
"protected function validationMessages(): array\n {\n return [];\n }",
"protected function structureValidationErrorMessages($validation_result)\n {\n\n }",
"function fields( $array ) {\n\t\t$this->fields_list = $array;\n\t\t}",
"public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}",
"function cis_login_error($err) {\n\tglobal $cis_login_error;\n\t$cis_login_error[] = $err;\n}",
"public function exchangeArray(array $array) {\n // $this->USR_NAME = isset($array['USR_NAME']) ? $array['USR_NAME'] : null;\n // $this->USR_AGE = isset($array['USR_AGE']) ? $array['USR_AGE'] : null;\n //$this->USR_AVATAR = isset($array['USR_AVATAR']) ? $array['USR_AVATAR'] : null;\n $this->USER_OID = isset($array['USER_OID']) ? $array['USER_OID'] : null;\n //$this->USR_GENDER = isset($array['USR_GENDER']) ? $array['USR_GENDER'] : null;\n $this->USR_LANGUAGE = isset($array['USR_LANGUAGE']) ? $array['USR_LANGUAGE'] : null;\n $this->GL_MODULE_ID = isset($array['GL_MODULE_ID']) ? $array['GL_MODULE_ID'] : null;\n $this->GL_MODULE_NAME = isset($array['GL_MODULE_NAME']) ? $array['GL_MODULE_NAME'] : null;\n $this->GL_LEVEL_ID = isset($array['GL_LEVEL_ID']) ? $array['GL_LEVEL_ID'] : null;\n $this->GL_LEVEL_NAME = isset($array['GL_LEVEL_NAME']) ? $array['GL_LEVEL_NAME'] : null;\n $this->GL_LEVEL_KNOWLEDGE_DOMAIN = isset($array['GL_LEVEL_KNOWLEDGE_DOMAIN']) ? $array['GL_LEVEL_KNOWLEDGE_DOMAIN'] : null;\n $this->GL_LEVEL_COGNITIVE_DOMAIN = isset($array['GL_LEVEL_COGNITIVE_DOMAIN']) ? $array['GL_LEVEL_COGNITIVE_DOMAIN'] : null;\n $this->GL_LEVEL_TYPE = isset($array['GL_LEVEL_TYPE']) ? $array['GL_LEVEL_TYPE'] : null;\n $this->GL_LEVEL_INTERACTIVITY = isset($array['GL_LEVEL_INTERACTIVITY']) ? $array['GL_LEVEL_INTERACTIVITY'] : null;\n $this->GL_QUESTION_ID = isset($array['GL_QUESTION_ID']) ? $array['GL_QUESTION_ID'] : null;\n $this->GL_QUESTION_COGNITIVE = isset($array['GL_QUESTION_COGNITIVE']) ? $array['GL_QUESTION_COGNITIVE'] : null;\n $this->GL_QUESTION_ACTION_VERB = isset($array['GL_QUESTION_ACTION_VERB']) ? $array['GL_QUESTION_ACTION_VERB'] : null;\n $this->LL_QUESTION_TYPE = isset($array['LL_QUESTION_TYPE']) ? $array['LL_QUESTION_TYPE'] :null;\n $this->TR_USER_SCORE = isset($array['TR_USER_SCORE']) ? $array['TR_USER_SCORE'] : null;\n $this->HOST_IP = isset($array['HOST_IP']) ? $array['HOST_IP'] : null;\n $this->DEVICE_BROWSER_VERSION = isset($array['DEVICE_BROWSER_VERSION']) ? $array['DEVICE_BROWSER_VERSION'] : null;\n $this->DEVICE_MODEL = isset($array['DEVICE_MODEL']) ? $array['DEVICE_MODEL'] : null;\n $this->DEVICE_KERNEL_VERSION = isset($array['DEVICE_KERNEL_VERSION']) ? $array['DEVICE_KERNEL_VERSION'] :null;\n $this->DEVICE_SERIAL_NUMBER = isset($array['DEVICE_SERIAL_NUMBER']) ? $array['DEVICE_SERIAL_NUMBER'] :null;\n $this->DEVICE_PLATFORM = isset($array['DEVICE_PLATFORM']) ? $array['DEVICE_PLATFORM'] :null;\n $this->ATTEMPTED_ON = isset($array['ATTEMPTED_ON']) ? $array['ATTEMPTED_ON'] :null; \n }",
"function getErrorByFieldName($a_str_fieldName)\n\t{\n\t\t//print_r($this->arr_validationErrors);\n\t\tfor($i = 0; $i < sizeof($this->arr_validationErrors); $i++)\n\t\t{\n\t\t\tif($this->arr_validationErrors[$i]->getFieldName() == $a_str_fieldName)\n\t\t\t{\n\t\t\t\treturn $this->arr_validationErrors[$i]->getErrorMessage();\n\t\t\t}\n\t\t}\n\t}",
"protected static function GroupNoticeValidatorArray(){\n\t\t\tstatic $validator = array('object'=>array(array(\n\t\t\t\t'GroupID' => array('string'=>array()),\n\t\t\t\t'NoticeID' => array('string'=>array()),\n\t\t\t\t'Timestamp' => array('integer'=>array()),\n\t\t\t\t'FromName' => array('string'=>array()),\n\t\t\t\t'Subject' => array('string'=>array()),\n\t\t\t\t'Message' => array('string'=>array()),\n\t\t\t\t'HasAttachment' => array('boolean'=>array()),\n\t\t\t\t'ItemID' => array('string'=>array()),\n\t\t\t\t'AssetType' => array('integer'=>array()),\n\t\t\t\t'ItemName' => array('string'=>array())\n\t\t\t)));\n\t\t\treturn $validator;\n\t\t}",
"private function set_error( $key )\n\t{\n\t\tglobal $path;\n\t\tif( isset($this->err_code[$key]) && isset($this->err_code[$key]) )\n\t\t{\t\n\t\t\t$this->arr_error[].= $this->err_label[$key]; // => array_push\n\t\t\t// DEV -->\n\t\t\t$this->num_error += $this->err_code[$key];\n\t\t\t// <-- DEV\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error( $key . ' undefined');\n\t\t\texit;\n\t\t}\n\t}",
"function addFields($controler_name, $postVar, $authType, $error) {\n $index = $this->id++;\n\n $this->check_vars [$index] ['data'] = $postVar; //store control field data to be validated \n $this->check_vars [$index] ['authtype'] = $authType; //store type of validation required\n $this->check_vars [$index] ['error'] = $error; //store error message for in case of validation failed\n $this->check_vars [$index] ['controler_name'] = $controler_name; //store error message for in case of validation failed\n }",
"function tblarray($tbl,$qual)\n{\n$sql_master=\"select * from $tbl where $qual\";//--\necho $sql_master;\n$resultm=mysql_query($sql_master) or die(mysql_error());\n$memp=array();$mfields=array();\n$sql_fields=\"select name,alias from field where tblid=(select tblid from config where name='$tbl')\";\necho $sql_fields;\n$resultf=mysql_query($sql_fields) or die(\"from here\".mysql_error());\nwhile($rowm=mysql_fetch_array($resultm))\n{\n$resultf=mysql_query($sql_fields) or die(mysql_error());\nwhile($rowf=mysql_fetch_array($resultf))\n{\n$mfields[$rowf['name']]=$rowm[$rowf['name']];\n}\n//$memp[$empid]=$mfields;\n$memp[$rowm['id']]=$mfields;\n}\n//$memp['1011']=array('vipul'=>'great');\n//$memp['1011']=array_add('neha');\n//var_dump($mfields);\nreturn $memp;\n}",
"function triggerError(&$rec, $attrib, $err, $msg=\"\", $tab=\"\", $label='', $module='atk')\n{\n\tif($msg==\"\") $msg = atktext($err, $module);\n\t$rec['atkerror'][] = array( \"attrib_name\"=> $attrib, \"err\" => $err, \"msg\" => $msg, \"tab\" => $tab, \"label\" => $label);\n}",
"function options( $field_name, $options ) {\n// could test to see if this is an array here, warn if not?\n\t\n\t$this->fields[$field_name]['options'] = $options;\n\t\n\t//$this->debug( \"Fieldx Value\", $this->fields[$field_name]['value'] );\n}",
"function _flashdata_mark()\n\t{\n\t\tforeach ($this->userdata as $name => $value)\n\t\t{\n\t\t\t$parts = explode(':new:', $name);\n\t\t\tif (is_array($parts) && count($parts) === 2)\n\t\t\t{\n\t\t\t\t$new_name = $this->flashdata_key.':old:'.$parts[1];\n\t\t\t\t$this->userdata[$new_name] = $value;\n\t\t\t\tunset($this->userdata[$name]);\n\t\t\t}\n\t\t}\n\t}",
"public static function setErrors($msg){\n $_SESSION[UtilMessage::SET_ERRORS] = $msg;\n }",
"function GetOldData($TableName,$FieldNames) {\n $Query = \"SELECT * FROM `\".$TableName.\"`;\";\n $Result = mysql_query($Query) or die(\"Error in query: $query \".mysql_error());\n $NumResults = mysql_num_rows($Result);\n if ($NumResults > 0) {\n while ($row = mysql_fetch_array($Result,MYSQL_ASSOC)) {\n foreach ($FieldNames as $FieldName) {\n $array[$row[DmrID]][$FieldName] = $row[$FieldName]; //AM I OVERTHINKING THIS?\n }\n }\n }\n if (is_null($array))\n {\n return array();\n }\n else\n {\n return $array;\n }\n}",
"public function addError(String $fieldName, String $ruleName, Array $params = []): void\n {\n $message = $this->errorMessages()[$ruleName] ?? '';\n foreach ($params as $key => $value) {\n $message = str_replace(\"{{$key}}\", $value, $message);\n }\n $this->errors[$fieldName][] = $message;\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"function getArray(){\n\t\t\t\t\t$fieldArray = array('username'=> $this->_username, 'password'=>$this->_password);\n\t\t\t\t\treturn $fieldArray;\n\t\t\t\t}",
"function errors_list() \n {\n $errors = array();\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n if (!$obj->errors->not_errors())\n {\n $list = array();\n foreach ($obj->errors as $error) \n {\n $list[] = $error;\n }\n $errors[$obj->name] = $list;\n } \n }\n }\n return $errors;\n }",
"private function addValidationError()\n {\n $validationError = new ValidationError();\n $validationError->setValidationCode($this->validation->getValidationCode());\n if ($this->eachFieldName && $this->eachIndex) {\n $eachField = $this->formDataHandler->getFormValue($this->eachFieldName);\n $eachFieldValue = $eachField[$this->eachIndex][$this->formFieldName];\n $validationError->setFormValue($eachFieldValue);\n $validationError->setFormField($this->eachFieldName);\n $validationError->setEachFieldName($this->formFieldName);\n $validationError->setEachIndex($this->eachIndex);\n } else {\n $validationError->setFormValue($this->formDataHandler->getFormValue($this->formFieldName));\n $validationError->setFormField($this->formFieldName);\n }\n if ($this->errorText) {\n $validationError->setCustomErrorText($this->errorText);\n }\n $this->validationErrorHandler->addValidationError($validationError);\n }",
"public function addError($field, $error) {\n $this->errors[$field] = $error;\n }",
"function addFields($table,$postedArray) \t{\n\t\tforeach($postedArray as $key=>$val){\n\t\t\t$postedArray[$key] = mysql_real_escape_string($postedArray[$key]); \n\t\t}\n\t\treturn $this->insert($this->tablePrefix.$table, $postedArray);\n\t}",
"private function addError( $key, $val ) {\r\n $this->errors[$key] = $val;\r\n }",
"private function _setflashdataarray($data)\n {\n foreach ($data as $key => $value)\n $_SESSION[$this->sess_name]['flashdata'][$key] = $value;\n }",
"protected function errorAdd($error){\r\n //array_merge($this->errors,array('error'=>$error));\r\n $this->_errors['error']=$error;\r\n $this->_errorcnt++;\r\n }",
"public function addError($field, $rule, $message) {\n if (!isset($this->_errors[$field])) $this->_errors[$field] = array();\n $this->_errors[$field][$rule] = array(\n 'message' => $message\n );\n }",
"public function addErrorMsg( $strMsg ) {\n\t\t$this->m_strErrorMsgs[] = $strMsg;\n\t}",
"private function addValidationError($key, $code, $msg = null)\n\t\t{\n\t\t\tif($this->_validationErrors === null)\n\t\t\t\tthrow new CDFInvalidOperationException('Initial validation not performed first');\n\t\t\t$err = new CDFDataObjectValidationError($key, $code);\n\t\t\tif($msg !== null)\n\t\t\t\t$err->setErrorDescription($msg);\n\t\t\t$this->_validationErrors[] = $err;\n\t\t}",
"function cis_login_message($msg) {\n\tglobal $cis_login_message;\n\t$cis_login_message[] = $msg;\n}",
"public function errorsArray()\n {\n return $this->errors;\n }",
"public function __construct(){\r\n\t\t$this->errors = [];\r\n\t\t$this->general_messages = [];\r\n\t\t$this->all_messages = [];\r\n\t}",
"function validateIpFields($ipFields, $errorMsg=NULL)\n{\n\t $errorOut =\"\";\n\t $errorArray =\tarray();\n\t\n\t foreach($ipFields as $fieldName => $displayName)\n\t\t{\n\t\t\tif(!filter_var($_REQUEST[$fieldName], FILTER_VALIDATE_IP)) \n\t\t\t{\n\t\t\t\tif(count($errorArray)> 0)\n\t\t\t\t\tarray_push($errorArray,\" & \". $displayName);\n\t\t\t\telse\n\t\t\t\t\tarray_push($errorArray, $displayName);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\n\t if(count($errorArray)> 0)\n\t\t {\n\t\t\t\n\t\t\tif($errorMsg!=NULL) // inserting the error message, if any at the first \n\t\t\t\t$errorArray=array_insert($errorArray, $errorMsg, 0);\n\t\t\t\n\t\t\tforeach($errorArray as $error)\n\t\t\t{\n\t\t\t\t$errorOut .= $error.'<br/>';\n\t\t\t}\n\t \n\t\t\t\n\t\t }\n\t\n\treturn $errorOut;\n}"
] | [
"0.6842536",
"0.66193515",
"0.65815634",
"0.6542045",
"0.63488364",
"0.6211707",
"0.6080832",
"0.6058984",
"0.6033558",
"0.6026323",
"0.59879583",
"0.59748214",
"0.58849835",
"0.5875412",
"0.5833254",
"0.5830733",
"0.5822193",
"0.58094937",
"0.57812786",
"0.57648045",
"0.5752752",
"0.5751667",
"0.5688773",
"0.5683531",
"0.5675568",
"0.5653019",
"0.56396645",
"0.56342185",
"0.56296575",
"0.5620124",
"0.56137353",
"0.56044924",
"0.5598825",
"0.55959094",
"0.55948275",
"0.55891323",
"0.5566529",
"0.5544337",
"0.5544337",
"0.5524505",
"0.55084276",
"0.5502978",
"0.5474058",
"0.5470377",
"0.54640985",
"0.54518086",
"0.54423547",
"0.54315954",
"0.54311025",
"0.5431028",
"0.5430983",
"0.5427258",
"0.5415709",
"0.5412727",
"0.54068595",
"0.53878295",
"0.5358566",
"0.5357076",
"0.53501034",
"0.5347414",
"0.5342798",
"0.5340822",
"0.53376335",
"0.5332853",
"0.53263754",
"0.53204334",
"0.5319227",
"0.5317639",
"0.5315752",
"0.52986205",
"0.5284905",
"0.52830577",
"0.52824056",
"0.5277883",
"0.5273998",
"0.52673596",
"0.5257875",
"0.5252075",
"0.52394676",
"0.5232027",
"0.5226813",
"0.5221835",
"0.5220343",
"0.5214301",
"0.5214301",
"0.52091706",
"0.520227",
"0.51986736",
"0.51972824",
"0.5191272",
"0.51894045",
"0.5189003",
"0.51855356",
"0.51848215",
"0.51810265",
"0.5177952",
"0.5174796",
"0.5167151",
"0.51659924",
"0.51631147"
] | 0.6425753 | 4 |
Get how many result from a posinc header. | function posinc_headers_count_by_criteria($field_name = '', $field_type = '', $field_content = '', $date_from = '', $date_to = '', $status = 0, $sort = '') {
if(empty($field_content))
$field_content = '';
if(empty($date_from))
$date_from = '';
if(empty($date_to))
$date_to = '';
if(empty($field_content))
$field_content = '';
$this->db->from('t_posinc_header');
// start of searching
if(!empty($field_content)) {
switch($field_name) {
case 'a':
$field_name_ori = 'waste_no';
break;
case 'b':
$field_name_ori = 'stockoutlet_no';
break;
}
if($field_type == 'part')
$this->db->like($field_name_ori, $field_content);
else if($field_type == 'all')
$this->db->where($field_name_ori, $field_content);
}
$date_from2 = $date_from.' 00:00:00';
$date_to2 = $date_to.' 23:59:59';
if( (!empty($date_from)) || (!empty($date_to)) ) {
if( (!empty($date_from)) || (!empty($date_to)) ) {
$this->db->where("posting_date BETWEEN '$date_from2' AND '$date_to2'");
} else if( (!empty($date_from))) {
$this->db->where("posting_date >= '$date_from2'");
} else if( (!empty($date_to))) {
$this->db->where("posting_date <= '$date_from2'");
}
}
if(!empty($status))
$this->db->where('status', $status);
$this->db->where('plant', $this->session->userdata['ADMIN']['plant']);
// end of searching
// start of sorting
if(!empty($sort)) {
switch($sort) {
case 'ay':
$field_sort_name = 'id_posinc_header';
$field_sort_type = 'asc';
break;
case 'az':
$field_sort_name = 'id_posinc_header';
$field_sort_type = 'desc';
break;
case 'by':
$field_sort_name = 'total_remintance';
$field_sort_type = 'asc';
break;
case 'bz':
$field_sort_name = 'total_remintance';
$field_sort_type = 'desc';
break;
case 'cy':
$field_sort_name = 'posting_date';
$field_sort_type = 'asc';
break;
case 'cz':
$field_sort_name = 'posting_date';
$field_sort_type = 'desc';
break;
case 'dy':
$field_sort_name = 'status';
$field_sort_type = 'asc';
break;
case 'dz':
$field_sort_name = 'status';
$field_sort_type = 'desc';
break;
case 'ey':
$field_sort_name = 'waste_no';
$field_sort_type = 'asc';
break;
case 'ez':
$field_sort_name = 'waste_no';
$field_sort_type = 'desc';
break;
case 'fy':
$field_sort_name = 'stockoutlet_no';
$field_sort_type = 'asc';
break;
case 'fz':
$field_sort_name = 'stockoutlet_no';
$field_sort_type = 'desc';
break;
}
$this->db->order_by($field_sort_name, $field_sort_type);
}
// end of sorting
$query = $this->db->get();
//echo $this->db->last_query();
if($query->num_rows() > 0) {
return $query->num_rows();
} else {
return FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countHeader()\n {\n $headerCount = 0;\n foreach ($this->data[0] as $transactionData) {\n if($transactionData) $headerCount += 1;\n }\n return $headerCount;\n }",
"public function getHeaderLength()\n {\n return $this->headerLength;\n }",
"public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }",
"public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }",
"public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }",
"public function getFieldCount(): int {\n $record = $this->readRecord();\n // ensure that the header can be read again after field count\n $this->headerRead = false;\n $this->rewind();\n\n return null === $record ? 0 : count($record);\n }",
"function get_response_code($header) {\r\n\t$parts = explode(\"\\r\\n\", $header);\r\n\treturn $part[0];\r\n}",
"function ifx_num_fields($result_id)\n{\n}",
"public function getPO104(){\n\t\treturn $this->getPO1IndexOf(4);\n\t}",
"public function count(): int\n {\n return count($this->headers);\n }",
"public function count()\n {\n return count($this->headers);\n }",
"public function count() {\r\n return count($this->headers);\r\n }",
"private function getOffset()\n {\n $this->current_offset = null;\n \n $headers = $this->getHead();\n \n if (isset($headers['Offset']) === true) {\n $this->current_offset = $headers['Offset'];\n }\n \n return $this->current_offset;\n }",
"public function headersize() {\n return $this->info['header_size'];\n }",
"function numFields( $res );",
"private function getFileCount()\n {\n $this->seek($this->offset + 4);\n\n return $this->readLong();\n }",
"function getCount() {\n $this->putCount();\n //opens countlog.data to read the number of hits\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n return $count;\n }",
"function rawpheno_count_rows($xls_obj) {\n // Row of 5 chars or more long is a row.\n $count_rows = 0;\n foreach ($xls_obj as $row) {\n if (strlen(implode('', $row)) > 5) {\n $count_rows++;\n }\n }\n\n // Less header row.\n return $count_rows - 1;\n}",
"public function getLineCount() {}",
"function get_counter(){\nglobal $indb;\n\tif ( $indb && connected($indb[\"db\"]) ) {\n\t\t// find where is the element\n\t\t$ctr = _FFDBDIR_.$indb[\"db\"].\"/\".$indb[\"db\"].\".ctr\";\n\t\t$octr = fopen($ctr,\"r\");\n\t\t$ctrstr = fread($octr,filesize($ctr));\n\t\t\tif ( is_numeric($ctrstr) && !is_nan($ctrstr) && is_finite($ctrstr) ){\n\t\t\t\t$ctrnum = (int)$ctrstr;\n\t\t\t\treturn $ctrnum;\n\t\t\t}\n\t\t\telse return false;\n\t\t}\n}",
"public function count()\n {\n return imap_num_msg($this->stream());\n }",
"public function getHeaderSize()\n {\n return 30 + $this->properties[\"fileNameLength\"] + $this->properties[\"extraFieldLength\"];\n }",
"public static function getHTTPStatusCode($header) {\n $first_line = strtok($header, \"\\n\");\n\n preg_match(\"# [0-9]{3}#\", $first_line, $match);\n\n if (isset($match[0]))\n return (int) trim($match[0]);\n else\n return null;\n }",
"function invoices_count()\n {\n $this->company_db->from('tbl_invoice_header');\n return $this->company_db->count_all_results();\n }",
"public function getCount() {\n\t\tif ($this->_count === null) {\n\t\t\tif ($this->name === null) {\n\t\t\t\tthrow new Exception(get_class($this).\" requires a name!\");\n\t\t\t}\n\t\t\t$this->_count = $this->getConnection()->getClient()->hlen($this->name);\n\t\t}\n\t\treturn $this->_count;\n\t}",
"public function rowTotalCount() {\n if (is_null($this->response)) {\n throw new Exception('Response in NULL');\n }\n return $this->response->found;\n }",
"public function getCount()\n\t{\n\t\t$res = $this->pdo->queryOneRow('SELECT COUNT(id) AS num FROM xxxinfo');\n\t\treturn ($res === false ? 0 : $res['num']);\n\t}",
"protected function readHeader($ch, $header) {\r\n \tpreg_match('/([^:]+):\\s*(.*)/', $header, $matches);\r\n \tif(isset($matches[1]) && isset($matches[2])) {\r\n \t\t$this->headers[strtolower($matches[1])] = $matches[2];\r\n \t}\r\n return strlen($header);\r\n }",
"public function getCode()\n\t{\n\t\t$matches = array();\n\t\tif (isset($this->headers) && isset($this->headers[0]))\n\t\t\tpreg_match('|HTTP/\\d\\.\\d\\s+(\\d+)\\s+.*|', $this->headers[0], $matches);\n\t\treturn isset($matches[1]) ? (int)$matches[1] : 0;\n\t}",
"protected static function num_code(): mixed\n\t{\n\t\treturn self::$query->num_code;\n\t}",
"function gttn_tpps_file_len($fid) {\n $file = file_load($fid);\n $location = drupal_realpath($file->uri);\n $extension = gttn_tpps_get_path_extension($location);\n $count = 0;\n $options = array(\n 'count' => &$count,\n );\n if ($extension == 'vcf') {\n $options['skip_prefix'] = '#';\n }\n gttn_tpps_file_iterator($fid, 'gttn_tpps_file_len_helper', $options);\n return $count;\n}",
"public function getNbResults()\n {\n $this->sphinxQL->execute();\n\n $helper = Helper::create($this->sphinxQL->getConnection());\n $meta = $helper->showMeta()->execute()->fetchAllAssoc();\n\n foreach ($meta as $item) {\n if ('total_found' === $item['Variable_name']) {\n return (int) $item['Value'];\n }\n }\n\n return 0;\n }",
"public function getFieldCount() {}",
"function record_count()\n\t{\n\t\t $sql = \"SELECT COUNT(*) As cnt FROM pof\";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t}",
"function read_header($curl, $string) {\n print \"Received header: $string\\n\\n\";\n return strlen($string);\n}",
"public function countHeadCountWip($item)\n {\n return number_format($item->head_count, 4) + 0;\n }",
"public function getFieldCount(): int\n {\n return oci_num_fields($this->resultID);\n }",
"public function count(): int\n {\n return $this->keyTotal;\n }",
"function getresponseheader($header = false){\n $headers = $this->getLastResponseHeaders();\n foreach ($headers as $head){\n if ( is_integer(strpos ($head, $header) )){\n $hstart = strpos ($head, \": \");\n $head = trim(substr($head,$hstart+2,100));\n return $head;\n }\n }\n }",
"public function count() {\n // response without using iterator_count (which actually consumes \n // our iterator to calculate the size, and we cannot perform a rewind)\n return $this->_replySize;\n }",
"private function checkForNumberOfHits()\n {\n // Get number of hits per page\n $hits = $this->app->request->getGet(\"hits\", 4);\n\n if (!(is_numeric($hits) && $hits > 0 && $hits <= 8)) {\n $hits = 4;\n }\n return $hits;\n }",
"public function getPageNumber();",
"public function getPageNumber();",
"public function numLines()\n {\n if($this->state['numlines']) {\n return $this->state['numlines'];\n } else {\n $numRows = self::numRowsInFile($this->vars['ifn']);\n if($numRows < 100){\n $numRows = self::numRowsInFileAccurate($this->vars['ifn'],$this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n }\n $this->state['numlines'] = $numRows;\n return $this->state['numlines'];\n }\n }",
"private function msgCount()\n {\n $msg = request('message');\n $final_msg = $msg . ' ' . env('OPT_OUT');\n\n if (strlen($final_msg) <= 160) {\n return $msg_count = 1;\n } else {\n return $msg_count = ceil(utf8_encode(strlen($final_msg))/env('SMS_LENGTH'));\n }\n }",
"public function getFoundCount()\n {\n return $this->provider->foundCount;\n }",
"function fiftyone_degrees_get_signature_length($signature, $headers) {\n $last_node_index = $signature['node_indexs'][count($signature['node_indexs'])-1];\n $last_node = fiftyone_degrees_read_node($last_node_index, $headers);\n $last_node_length = fiftyone_degrees_get_node_length($last_node, $headers);\n return $last_node['position'] + $last_node_length + 1;\n}",
"public static function getStatusCodeFromHeader($header)\r\r\n {\r\r\n preg_match('|HTTP/\\d\\.\\d\\s+(\\d+)\\s+.*|', $header, $match);\r\r\n return (int) $match[1];\r\r\n }",
"public function getCounter();",
"public function getPageNumber() {}",
"public function getPageNumber() {}",
"public function incLen() { return $this->_m_incLen; }",
"function RowCount() {}",
"public function getPO103(){\n\t\treturn $this->getPO1IndexOf(3);\n\t}",
"public function getStatus()\n {\n return (int)substr($this->response, 9, 3);\n }",
"public function getTotalNumberOfResults();",
"public function NextReadSize() {\n switch($this->state) {\n case INITIAL:\n case IN_HEADER:\n case ENDOFDATA:\n return 1;\n case DATA:\n return $this->length - $this->position;\n case SUCCESS:\n return 0;\n default:\n throw new Exception(\"Invalid decoder state $this->state\");\n }\n }",
"abstract public function getHitCount() : string;",
"function gettotalpageno(){\n\t $qry = \"SELECT * FROM countries\";\n\t return $result = $this->modelObj->numRows($qry);\n\t}",
"function RecordCount() {}",
"public function count()\n\t{\n\t\t$content = $this->resource->get($this->name)->getContent();\n\t\t\n\t\treturn $content['doc_count'];\n\t}",
"public function getCount() {\n\treturn $this->parseQuery->getCount()->count;\n }",
"function get_count() {\n\t\t$count=0;\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute(\"select count(pr_id) as num from \".$this->_db_table);\n\t\tif (!$rs) {\n\t\t\tprint $db->ErrorMsg();\n\t\t} else {\n\t\t\t$count = $rs->fields[\"num\"];\n\t\t}\n\t\treturn $count;\n\t}",
"abstract public function getFieldCount(): int;",
"abstract public function recordCount(): int;",
"function getRowCounter()\n {\n $this->getRows();\n return $this->row_counter;\n }",
"function extract_count($data) {\n return ($data == NULL || is_int($data)) ? $data : current(current($data));\n }",
"public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"partdata\");\n\t}",
"public function count($q = '*', $db = null): int\n {\n if ($this->emulateExecution) {\n return 0;\n }\n $command = $this->createCommand($db, 'count');\n\n $result = $command->execute('head');\n\n /* @var $result \\yii\\web\\HeaderCollection */\n return $result->get($command->db->totalCountHeader);\n }",
"public function computeCount() {\n if ($str = elis_consumer_http_request($this->url_pattern . '&rows=0', array('Accept' => 'application/json'))) {\n if ($json = json_decode($str)) {\n $this->totalCount = $json->response->numFound;\n }\n }\n return $this->totalCount;\n }",
"public function lenchapter ()\n {\n $db = $this->dbConnect ();\n $req = $db->query ('SELECT COUNT(number_chapter) FROM chapter WHERE 1 ');\n $len = $req->fetch ();\n return $len;\n }",
"function readHeader($ch, $string) {\n $length = strlen($string);\n //only display the headers with content\n if (trim($string) != '')\n echo \"<center>Header: $string</center><br />\\n\";\n return $length;\n }",
"public static function totinprimopiano(){\r\n $query = \"SELECT count(idev) FROM primopiano\";\r\n\t\t$result = self::$conn->query($query);\r\n $id =array();\r\n if($result){\r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n return (int)$row[0];\r\n }\r\n return 0;\r\n }",
"public function num_fields($result){\r\n\t\treturn $result->FieldCount();\r\n\t}",
"public function getLineNumber(){\n if( $this->index ){\n return substr_count($this->input, \"\\n\", 0, $this->index) + 1;\n }\n return 1;\n }",
"public function getFieldsNum($result)\n {\n return $result->columnCount();\n }",
"public function count()\n {\n return $this->client->count($this->compile())['count'];\n }",
"public function RowCount() {\n return $this->_row == '' ? $this->_rown : $this->_rown + 1;\n }",
"public function numCOI() {\r\n $numCOI = 0;\r\n foreach($this->coi AS $coi) {\r\n if($coi->hasDeclarations() == true) {\r\n $numCOI++;\r\n }\r\n }\r\n return $numCOI;\r\n }",
"public function getCount(): int;",
"public function getCount(): int;",
"function record_count_posdelivery()\n\t{\n\t\t $sql = \"SELECT COUNT(*) As cnt FROM pof WHERE pof.is_allocated='1'\";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t}",
"public function getHits()\n {\n return (int)$this->data['hits'];\n }",
"public function countData($qr){\n\t\t$totalRow = mysql_num_rows($qr);\n\t\treturn $totalRow;\n\t}",
"public function getLineupCount()\n {\n return $this->count(self::_LINEUP);\n }",
"function NumRows() {}",
"public function getLineupCount()\n {\n return $this->count(self::_LINEUP);\n }",
"public function count()\n {\n return ++$this->count;\n }",
"public function count()\n {\n return ++$this->count;\n }",
"public function count()\n {\n return ++$this->count;\n }",
"public function count()\n {\n return ++$this->count;\n }",
"protected function handleCurlResponseHeaders($ch, $header)\n {\n print($header);\n return strlen($header);\n }",
"public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}",
"public function getElementCounter() {}",
"function gttn_tpps_file_len_helper($row, array &$options = array()) {\n if (empty($options['skip_prefix'])) {\n $options['count']++;\n }\n else {\n if (substr(current($row), 0, strlen($options['skip_prefix'])) != $options['skip_prefix']) {\n $options['count']++;\n }\n }\n}",
"function nbLine($req) {\r\n $crs = $this->query($req) ;\r\n return count($crs->fetchAll()) ;\r\n }",
"public function getPageNo(\\SetaPDF_Core_Document $document) {}",
"public function getNumber_hits()\n {\n return $this->number_hits;\n }",
"private function readHeader($ch, $header) {\r\n\t\t\t$len = strlen($header);\r\n\t\t\t$pair = explode(':',trim($header),2);\r\n\t\t\tif ( count($pair) !=2) return $len;\r\n\t\t\t$this ->responseHeader[$pair[0]] = $pair[1];\r\n\t\t\treturn $len;\r\n\t\t}",
"public function getPageNo()\n\t{\n\t\treturn ($this->page == 0) ? 1 : $this->page;\n\t}",
"function GetHeader() {\n return ($this->ses['response']['header']);\n }"
] | [
"0.6723938",
"0.6068429",
"0.6056738",
"0.6056738",
"0.6056738",
"0.5998293",
"0.59429556",
"0.59142464",
"0.5859364",
"0.585819",
"0.5840473",
"0.58282596",
"0.58222246",
"0.5785394",
"0.57710683",
"0.5702341",
"0.5662599",
"0.5603648",
"0.55612063",
"0.5546585",
"0.55403155",
"0.5515147",
"0.548764",
"0.5486608",
"0.54858786",
"0.5480361",
"0.54618853",
"0.5453694",
"0.54393154",
"0.5433223",
"0.54310447",
"0.54271924",
"0.54152256",
"0.54072994",
"0.5401722",
"0.53794277",
"0.53779024",
"0.53693956",
"0.536195",
"0.53618217",
"0.53557897",
"0.53551894",
"0.53551894",
"0.5354839",
"0.5340102",
"0.53394556",
"0.5337569",
"0.53335524",
"0.5307352",
"0.5306344",
"0.5306344",
"0.5300385",
"0.52995795",
"0.52840704",
"0.52788836",
"0.527048",
"0.52699625",
"0.5267923",
"0.5266411",
"0.52662474",
"0.5251102",
"0.5249186",
"0.5246826",
"0.52392805",
"0.5229856",
"0.52290666",
"0.5226725",
"0.5219083",
"0.52179205",
"0.5217408",
"0.52096003",
"0.5201861",
"0.5200777",
"0.5193932",
"0.5191122",
"0.51806444",
"0.51789606",
"0.51717407",
"0.5171653",
"0.5171388",
"0.5171388",
"0.5170811",
"0.5170649",
"0.51697063",
"0.5166231",
"0.5165843",
"0.5165168",
"0.5148178",
"0.5148178",
"0.5148178",
"0.5148178",
"0.51474345",
"0.5145452",
"0.5144952",
"0.51444596",
"0.514427",
"0.51417625",
"0.51416796",
"0.5139841",
"0.5139122",
"0.5136532"
] | 0.0 | -1 |
end of browse start of input | function posinc_header_select($id) {
$this->db->from('t_posinc_header');
$this->db->order_by('id_posinc_header');
$this->db->where('id_posinc_header', $id);
$query = $this->db->get();
if($query->num_rows() > 0)
return $query->row_array();
else
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getEndInput(): Input {\n return $this->upperInput;\n }",
"public function GoToEnd()\n {\n $this->setItemPointer(($this->Length() - 1));\n }",
"public function get_end_cursor()\n {\n }",
"public function eof();",
"public function eof();",
"public function eof() {}",
"public function input_scrollend() {\n $script = '<script>jQuery(\".one-theme-page input[type=text]\").each(function ()\n { this.scrollLeft = this.scrollWidth; });</script>';\n\n print $script;\n }",
"public function eof()\n {\n }",
"function seekToEnd() : void;",
"public function endPath() {}",
"public function fileEnd(): void;",
"public function getEnd();",
"function seekToStart() : void;",
"public function renderEndActiveFileInput()\n {\n return Html::endTag(isset($this->options['tag']) ? $this->options['tag'] : 'div');\n }",
"public function impliesPositioningCursorAtTheEnd()\n {\n return $this->base == 'a';\n }",
"public function end() {\n\n $this->current = 0;\n\n // remove the suffix which was set by self::start()\n $suffixes = Zend_Registry::get(\"pimcore_tag_block_current\");\n array_pop($suffixes);\n Zend_Registry::set(\"pimcore_tag_block_current\", $suffixes);\n\n $this->outputEditmode(\"</div>\");\n }",
"protected function eof() { \n\t\treturn !isset($this->lines[$this->cursor]); \n\t}",
"public function getEnd() {}",
"protected function onInputEnd()\n {\n foreach ($this->container[0][\"data\"] as $key => $rows) {\n if (isset($this->container[1][\"data\"][$key])) {\n foreach ($rows as $first) {\n foreach ($this->container[1][\"data\"][$key] as $second) {\n $this->next(array_merge($first, $second));\n }\n }\n unset($this->container[1][\"data\"][$key]);\n }\n unset($this->container[0][\"data\"][$key]);\n }\n }",
"function reEnterInput()\n{\n\t//go back to recipe info input \n\theader(\"Location: http://localhost/RecipeFish/view/addRecipePhoto.php\"); \n\texit(); \n}",
"public function getEndCursor()\n {\n return $this->end_cursor;\n }",
"public function end();",
"public function end();",
"public function end();",
"public function end();",
"public function end($end);",
"public function lastLine()\n {\n $this->line()->application->cursor->previousLine();\n }",
"function end()\n\t{\n\t\t$this->over = true;\n\t}",
"public function end() {\n return $this->end;\n }",
"public function EOF()\n {\n return $this->EOF;\n }",
"public function getCharEnd();",
"public function getEndIn()\n {\n return $this->end_in;\n }",
"public function eof(): bool;",
"function end();",
"function EOF()\n\t{\n\t\tif( $this->_currentRow < $this->_numOfRows) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$this->EOF = true;\n\t\t\treturn true;\n\t\t}\n\t}",
"public function goBack()\n {\n if (fseek($this->filePointer, -1, SEEK_CUR) == -1)\n return false;\n\n $char = fgetc($this->filePointer);\n\n if ($this->isNewLine($char))\n $this->currentLine--;\n\n fseek($this->filePointer, -1, SEEK_CUR);\n $this->currentPos--;\n \n return true;\n }",
"private function getStartInput(): Input {\n return $this->lowerInput;\n }",
"function _endpage()\n\t\t{\n\t\t\t$this->state=1;\n\t\t}",
"public function end() {\n return $this->_end;\n }",
"public function rewind () {\n prev($this->__fields);\n }",
"public function getEnd(): int;",
"public function endPage() {}",
"function input ()\n\t{}",
"function reEnterInput()\n{\n\t//go back to recipe times input \n\theader(\"Location: http://localhost/RecipeFish/view/addRecipeTimes.php\"); \n\texit(); \n}",
"public function getInput();",
"public function getInput();",
"public function getInput();",
"function reEnterInput()\n{\n\t//go back to recipe features input \n\theader(\"Location: http://localhost/RecipeFish/view/addRecipeFeatures.php\"); \n\t\n\tunsetArrays();\n\t\n\texit(); \n}",
"public function eof() : bool {\n return !$this->append && ($this->offset >= $this->size);\n }",
"public function rewind(): void\n {\n $this->selection->rewind();\n }",
"public function end() {}",
"public function end() {}",
"public function end() {}",
"public function getFocus() {}",
"function print_next()\n\t{\n\t // check if anything left to print\n\t if( $this->print_offset >= count($this->inputs) ){\n\t return false;\n\t }\n\t \n\t // get this input\n\t $input = $this->inputs[$this->print_offset];\n\t \n\t // print this input\n\t $this->print_input( $input );\n\t \n\t // increase offset\n\t $this->print_offset++;\n\t \n\t // success return\n\t return true;\n\t}",
"public function getInputBuffer()\n {\n }",
"public function prev(): void {\n // current position and then store its location\n if (fseek($this->fileHandle,\n ($this->position - $this->blockSize)) === 0) {\n // Set new location\n $this->updatePosition();\n $this->readBlock();\n } else {\n // Otherwise mark the position invalid and throw an exception\n $this->isValid = false;\n throw new OutOfBoundsException();\n }\n }",
"public function next() {\n // Intentionally empty, cursor is forwaded inside valid()\n }",
"public function rewind()\n\t{\n\t\techo'Rewinding \\n';\n\t\treset($this ->var);\n\t}",
"function getEnd() {\n\t\t\treturn $this->end;\n\t\t}",
"abstract protected function doEnd();",
"public function ended();",
"public function advance();",
"private function end() {\n return $this->formats['end'];\n }",
"public function endClipboard() {}",
"function baseQueryForFileSelection() {\n\t\tassert(false);\n\t}",
"protected function printUploadInput()\n {\n $accepts = \"\";\n\n if (sizeof($this->filters) > 0) {\n $accepts = \" accept=\\\"\" . implode(\",\", $this->filters) . \"\\\"\";\n }\n\n ?>\n <input type=\"file\" name=\"<?= $this->getIndexedPresenterPath(); ?>\" id=\"<?= $this->getIndexedPresenterPath(); ?>\"\n presenter-name=\"<?= $this->presenterName ?>\"<?= $accepts . $this->getHtmlAttributeTags() . $this->getClassTag() ?>/>\n <?php\n }",
"public function end()\n {\n }",
"public function get_start_cursor()\n {\n }",
"public function getIndexEnd();",
"public function impliesPositioningCursorAtTheBeginning()\n {\n return $this->base != 'a';\n }",
"public function next ()\n {\n $this->inputs->next();\n $this->offset++;\n }",
"private function import_start()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\t//check for form tampering\n\t\t$this->inp\t= JFactory::getApplication()->input;\n\t\t$files\t\t= $this->inp->files;\n\t\t$this->file\t= reset($files->getArray());\t\t\t//first (and only) file\n\t\t$this->ok\t= !empty($this->file);\t\t\t\t//file ok?\n\t\treturn\t\t$this->ok;\n\t}",
"function nc__dlg__end(){\n\n\t\t//output function name\n\t\tnc__util__func('class', 'nc__dlg__end');\n\n\t\t\t\t\t\t//end dialog for content body (starts in another function)\n\t\t\t\t\t\techo \"</div>\" .\n\n\t\t\t\t\t//end dialog content window (starts in another function)\n\t\t\t\t\t\"</div>\" .\n\n\t\t\t\t//end dialog body (starts in another function)\n\t\t\t\t\"</div>\" .\n\n\t\t\t//end end dialog bounding DIV (starts in another function)\n\t\t\t\"</div>\";\n\n\t}",
"public function previous()\n {\n $this->cursor--;\n }",
"public function endTabs() {\n\t\t\treturn \"\"; \n\t\t}",
"public function get_input()\n {\n }",
"public function seek()\r\n\t{\r\n\t}",
"function doc_end () {\r\n\t}",
"function format_input_hover_end(){\n\treturn '</span>';\n}",
"function rewind();",
"public function eof()\n {\n return $this->rendered;\n }",
"protected function scanEOS()\n {\n if (mb_strlen($this->input)) {\n return;\n }\n\n return $this->lastIndents-- > 0 ? $this->takeToken('outdent') : $this->takeToken('eos');\n }",
"public function moveToStartOfNextLine() {}",
"public function moveToStartOfNextLine() {}",
"function doc_begin () {\r\n\t\treturn($this->docbegin);\r\n\t}",
"public function getInput() {}",
"public final function __end() : bool {\n\t\t\treturn false;\n\t\t}",
"public function getPagerInput();",
"public function rewind(){\n $this->index = 0;\n }",
"abstract public function getInput();",
"public function get_cursor_post()\n {\n }",
"public function current() {\r\n\t\treturn $this->lastLine;\r\n }",
"function update_end()\n {\n }",
"public function end()\n\t{\n\t\t$this->show('</ul>' . LF);\n\t}",
"public function getStartIndex();",
"function setEnd($end) {\n\t\t\t$this->end = $end;\n\t\t\treturn TRUE;\n\t\t}",
"public /*void*/ function rewind(){}",
"public function getEndPosition()\n\t{\n\t\treturn -1;\n\t}",
"function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}",
"public function getEditInput();"
] | [
"0.6146185",
"0.5944995",
"0.5735529",
"0.5630303",
"0.5630303",
"0.56229395",
"0.5612025",
"0.56011957",
"0.5398812",
"0.5387007",
"0.53679657",
"0.5256146",
"0.525614",
"0.52152336",
"0.51474357",
"0.512471",
"0.5117081",
"0.508345",
"0.508312",
"0.50801855",
"0.5076219",
"0.5073492",
"0.5073492",
"0.5073492",
"0.5073492",
"0.50364625",
"0.50201297",
"0.5017946",
"0.5006591",
"0.4999685",
"0.49833313",
"0.49747178",
"0.4974013",
"0.49592617",
"0.49567834",
"0.49533224",
"0.49384776",
"0.4929943",
"0.4921185",
"0.49189827",
"0.4897499",
"0.48800406",
"0.4859246",
"0.48573986",
"0.485109",
"0.485109",
"0.485109",
"0.48474047",
"0.4845083",
"0.48432362",
"0.48401144",
"0.48401144",
"0.48401144",
"0.48132056",
"0.480843",
"0.4804456",
"0.47952783",
"0.47844538",
"0.47840872",
"0.47831434",
"0.47783825",
"0.47764",
"0.47756365",
"0.47740835",
"0.4764144",
"0.47554848",
"0.4748189",
"0.47468904",
"0.47459307",
"0.47370052",
"0.4734465",
"0.4728105",
"0.47160688",
"0.4707412",
"0.47039822",
"0.47016758",
"0.46829262",
"0.46694836",
"0.46549675",
"0.46523258",
"0.46351278",
"0.46296778",
"0.46223688",
"0.46213055",
"0.46213055",
"0.4620997",
"0.46144733",
"0.46084374",
"0.46080872",
"0.46055278",
"0.46003243",
"0.45978916",
"0.45950374",
"0.4592436",
"0.45924112",
"0.45881572",
"0.45817134",
"0.45795614",
"0.4556141",
"0.45556998",
"0.45555836"
] | 0.0 | -1 |
Specifies the type of the organization in the hierachy. Only suborganizations can be newly created. (required) | public function type(OrganizationType $type)
{
$this->type = $type;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setOrganization() {}",
"public function setOrganization($val)\n {\n $this->_propDict[\"organization\"] = $val;\n return $this;\n }",
"public function setOwnerType($val)\n {\n $this->_propDict[\"ownerType\"] = $val;\n return $this;\n }",
"function Organization( $org )\r\n\t\t{\r\n\t\tif( trim( $org != \"\" ) )\r\n\t\t\t$this->organization= $org;\r\n\t\t}",
"public function setOrganization($var)\n {\n GPBUtil::checkString($var, True);\n $this->organization = $var;\n\n return $this;\n }",
"public function organization()\n {\n return Organization::i();\n }",
"public function setType(EntityType $type);",
"public function organization() {\n return $this->belongsTo('App\\Models\\Organization');\n }",
"static function addOrg($org, $parent=null)\n {\n /** Add the org in the org array */\n self::$orgs[$org] = ['parent' => $parent];\n\n /** Add the org in the permission array */\n self::$permissions['orgs'][$org] = [\n 'roles' => [],\n 'permissions' => []\n ];\n\n return __CLASS__;\n }",
"public function initialize()\n\t{\n\t // attributes\n\t\t$this->setName('organisatie');\n\t\t$this->setPhpName('Organisatie');\n\t\t$this->setClassname('Organisatie');\n\t\t$this->setPackage('CRM_TI');\n\t\t$this->setUseIdGenerator(true);\n\t\t// columns\n\t\t$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);\n\t\t$this->addColumn('NAAM', 'Naam', 'VARCHAR', true, 255, null);\n\t\t$this->addColumn('POSTBUS_POST', 'PostbusPost', 'VARCHAR', false, 64, null);\n\t\t$this->addColumn('POSTCODE_POST', 'PostcodePost', 'VARCHAR', false, 16, null);\n\t\t$this->addColumn('STAD_POST', 'StadPost', 'VARCHAR', false, 255, null);\n\t\t$this->addColumn('STRAAT_BEZOEK', 'StraatBezoek', 'VARCHAR', false, 255, null);\n\t\t$this->addColumn('NUMMER_BEZOEK', 'NummerBezoek', 'VARCHAR', false, 16, null);\n\t\t$this->addColumn('POSTCODE_BEZOEK', 'PostcodeBezoek', 'VARCHAR', false, 16, null);\n\t\t$this->addColumn('STAD_BEZOEK', 'StadBezoek', 'VARCHAR', false, 255, null);\n\t\t$this->addColumn('TELEFOON_ALGEMEEN', 'TelefoonAlgemeen', 'VARCHAR', false, 32, null);\n\t\t$this->addColumn('WEBSITE', 'Website', 'VARCHAR', false, 255, null);\n\t\t$this->addForeignKey('PROVINCIE_ID', 'ProvincieId', 'INTEGER', 'provincie', 'ID', false, null, null);\n\t\t$this->addForeignKey('TYPE_ID', 'TypeId', 'INTEGER', 'organisatie_type', 'ID', false, null, null);\n\t\t$this->addColumn('DELETED_AT', 'DeletedAt', 'TIMESTAMP', false, null, null);\n\t\t// validators\n\t\t$this->addValidator('NAAM', 'unique', 'propel.validator.UniqueValidator', '', 'Organisatienamen mogen niet identiek zijn');\n\t\t$this->addValidator('NAAM', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'De organisatienaam mag niet langer dan 255 tekens zijn');\n\t\t$this->addValidator('NAAM', 'required', 'propel.validator.RequiredValidator', '', 'De organisatienaam opgeven is verplicht');\n\t\t$this->addValidator('POSTBUS_POST', 'maxLength', 'propel.validator.MaxLengthValidator', '64', 'De postbus mag niet langer dan 64 tekens zijn');\n\t\t$this->addValidator('POSTCODE_POST', 'maxLength', 'propel.validator.MaxLengthValidator', '16', 'De postcode van het postadres mag niet langer dan 16 tekens zijn');\n\t\t$this->addValidator('STAD_POST', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'De stad van het postadres mag niet langer dan 255 tekens zijn');\n\t\t$this->addValidator('STRAAT_BEZOEK', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'De straatnaam van het bezoekadres mag niet langer dan 255 tekens zijn');\n\t\t$this->addValidator('NUMMER_BEZOEK', 'maxLength', 'propel.validator.MaxLengthValidator', '16', 'Het nummer van het bezoekadres mag niet langer dan 16 tekens zijn');\n\t\t$this->addValidator('POSTCODE_BEZOEK', 'maxLength', 'propel.validator.MaxLengthValidator', '16', 'De postcode van het bezoekadres mag niet langer dan 16 tekens zijn');\n\t\t$this->addValidator('STAD_BEZOEK', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'De stad van het bezoekadres mag niet langer dan 255 tekens zijn');\n\t\t$this->addValidator('TELEFOON_ALGEMEEN', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Het algemene telefoonnummer mag niet langer dan 32 tekens zijn');\n\t\t$this->addValidator('WEBSITE', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'De website mag niet langer dan 255 tekens zijn');\n\t}",
"function organization ($org) {\n if(!empty($org)) $this->xheaders['Organization'] = $org;\n }",
"public function findOneTypo3OrgRepository() {}",
"public function __construct($organization)\n {\n $this->organization = $organization;\n }",
"public function create()\n {\n return view('v1.auth_pages.organization.create_organization');\n }",
"public function CreateTaphonomyOrgAdmin()\n {\n // Test user login\n $user = ['email' => '[email protected]', 'password' => 'Password!23'];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->select('@search-type-selector','SE-P1')\n ->pause(1000)\n ->type('@cora-search','888')\n ->keys('@cora-search','{enter}')\n\n // Search Result Assertions for humerus ABC999-888-777-555\n ->waitForLink('ABC999-888-777-555')\n ->assertSeeLink('ABC999-888-777-555')\n ->assertSee('Humerus')\n ->assertSee('Left')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('DNA Sampled')\n\n // Specimen Assertions\n ->clickLink('ABC999-888-777-555')\n ->assertSee('View Specimen - ABC999-888-777-555')\n ->click('@se-details-menu')\n ->click('@se-taphonomys-menu')\n ->assertSee('Taphonomies: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/taphonomys')\n\n // Open Edit Functions\n ->click('@se-taphonomys-menu')\n ->click('@taphonomy-actions-edit')\n ->assertSee('Taphonomies: ABC999-888-777-555')\n ->assertSee('Save')\n ->assertPathIs('/skeletalelements/1220/associatetaphonomys')\n\n // Add and Save a new taphonomy\n ->select('@se-taphonomy-list','Adherent Materials-Iron')\n ->click('@se-taphonomy-save')\n ->acceptDialog()\n ->assertSee('Taphonomies successfully associated')\n ->assertPathIs('/skeletalelements/1220/associatetaphonomys')\n\n ->logoutUser();\n });\n }",
"public function getTypeAttribute(){\n return 'company';\n }",
"public function schemaOrg()\n {\n return $this->morphOne(SchemaOrg::class, 'model');\n }",
"public function setTyp( $type );",
"private function register_organization_fields() {\n\n $details_children = [\n 'url' => new \\Fieldmanager_Link( esc_html__( 'URL', 'pedestal' ), [\n 'name' => 'url',\n 'required' => false,\n ] ),\n 'full_name' => new \\Fieldmanager_Textfield( esc_html__( 'Full Name', 'pedestal' ), [\n 'name' => 'full_name',\n 'description' => esc_html__( 'The full name of the organization, if it\\'s not the common name / title.', 'pedestal' ),\n ] ),\n 'num_employees' => new \\Fieldmanager_Textfield( esc_html__( 'Number of Employees', 'pedestal' ), [\n 'name' => 'num_employees',\n ] ),\n 'founding_date' => new \\Fieldmanager_Textfield( esc_html__( 'Founding Date', 'pedestal' ), [\n 'name' => 'founding_date',\n ] ),\n ];\n $details = new \\Fieldmanager_Group( false, [\n 'name' => 'org_details',\n 'children' => $details_children,\n 'serialize_data' => false,\n ] );\n $details->add_meta_box( esc_html__( 'Details', 'pedestal' ), [ 'pedestal_org' ], 'normal', 'high' );\n\n }",
"public function organization()\n {\n return $this->belongsTo('App\\Organization');\n }",
"function setCompanyTypeAdmin( $value )\n {\n $this->CompanyTypeAdmin = $value;\n }",
"public static function organization($slug)\n {\n ResourceQuery::$defaultOrganisationSlug = $slug;\n }",
"function setOrg( $org )\n {\n $org = trim( $org );\n $this->properties['ORG'] = $org;\n }",
"function csc_related_organizations_info($subtype, $conf, $contexts) {\n if (!empty($conf)) {\n $block = new stdClass;\n $block->title = 'Related Organizational Units';\n $block->content = 'CSC Related Organizations widget';\n return $block;\n }\n}",
"public function createAction($type)\n {\n if (!$type) {\n return $this->redirect($this->generateUrl('resymf_admin_dashboard'), 301);\n }\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->container->get('request');\n $routeName = $request->get('_route');\n\n $adminConfigurator = $this->get('resymfcms.configurator.admin');\n $objectConfigurator = $this->get('resymfcms.configurator.object');\n\n $objectMapper = $this->get('resymfcms.object.mapper');\n\n $objectType = $objectMapper->getMappedObject($type);\n $annotationReader = $this->get('resymfcms.annotation.reader');\n\n $formConfig = $annotationReader->readFormAnnotation($objectType);\n\n if ($request->isMethod('POST')) {\n $object = new $objectType();\n\n// echo '<pre>';\n// print_r($formConfig->fields);\n// die();\n foreach ($formConfig->fields as $field) {\n $fieldType = $field['type'];\n $fieldRelationType = $field['relationType'];\n $methodName = 'set' . $field['name'];\n\n// if()\n switch ($fieldType) {\n case 'relation':\n $class = $field['class'];\n $targetEntityField = $field['targetEntityField'];\n $relationObjects = $em->getRepository($class)\n ->createQueryBuilder('q')\n ->where('q.id IN(:id)')\n ->setParameter('id', $request->get($field['name']))\n// ->setMaxResults()\n ->getQuery()\n ->getResult();\n// print_r($relationObject);\n $addMethodName2 = 'set' . $field['name'];\n if($fieldRelationType == 'manyToOne' || $fieldRelationType == 'oneToOne') {\n $object->$addMethodName2($relationObjects[0]);\n }else {\n $object->$addMethodName2($relationObjects);\n }\n foreach ($relationObjects as $relationObject) {\n\n if ($relationObject) {\n\n $addMethodName = 'set' . $type;\n $addMethodName2 = 'set' . $field['name'];\n\n if ($fieldRelationType == 'oneToMany') {\n $addMethodName2 = 'add' . $field['name'];\n\n }\n if ($fieldRelationType = 'manyToMany' || $fieldRelationType = 'multiselect') {\n $addMethodName2 = 'add' . $targetEntityField;\n } else { ///toOne\n $relationObject->$addMethodName($object);\n }\n\n }\n }\n\n \n break;\n case 'date':\n $object->$methodName(new \\DateTime($request->get($field['name'])));\n break;\n case 'file':\n// echo $field['name'];\n// print_r($request->get($field['name']));\n// die();\n $object->$methodName(json_encode($request->get($field['name'])));\n break;\n default:\n $object->$methodName($request->get($field['name']));\n }\n\n }\n\n $objectConfigurator->setInitialValuesFromAnnotations($objectType, $object, $type);\n $em->persist($object);\n $em->flush();\n return $this->redirect($this->generateUrl('object_edit', array('type' => $type, 'id' => $object->getId())), 301);\n }\n\n if (!isset($object)) {\n $object = false;\n }\n $multiSelectValues = $objectConfigurator->generateMultiSelectOptions($objectType, $object);\n\n return $this->render('ReSymfCmsBundle:adminmenu:create.html.twig', array('menu' => $adminConfigurator->getAdminConfig(), 'site_config' => $adminConfigurator->getSiteConfig(), 'form_config' => $formConfig, 'route' => $routeName, 'multi_select' => $multiSelectValues));\n }",
"public function create(OrganizationCreateRequest $request)\n {\n $data = $request->all();\n $organization = Organization::create($data);\n if(!empty($request->icon)){\n $path = Files::qualityCompress($request->icon, \"organizations/{$organization->id}/icon\");\n $organization->icon = $path;\n } else {\n $organization->icon = 'https://s3-eu-west-1.amazonaws.com/bck-lessons/default/group.jpg'; //TODO: temporary\n }\n if(!empty($request->cover)){\n $path = Files::qualityCompress($request->cover, \"organizations/{$organization->id}/cover\");\n $organization->cover = $path;\n } else {\n $organization->cover = 'https://s3-eu-west-1.amazonaws.com/bck-lessons/default/cover.png'; //TODO: temporary\n }\n if(isset($request['color'])){\n $organization->color = $request['color'];\n }\n\n $organization->save();\n if($organization){\n if($request->tags){\n Tag::assignTag($organization, $request);\n }\n }\n $user = Auth::guard('api')->user();\n DB::table('organization_user')->insert(\n ['user_id' => $user->id, 'organization_id' => $organization->id ,'role'=>'owner']\n );\n\n $defaultGroup = Organization::createDefaultGroup($organization, $user->id);\n\n if(is_array($request['members']) && count($request['members']) > 0){\n foreach ($request['members'] as $userId) {\n $organization->users()->attach([$userId => ['role'=>'member']]);\n User::find($userId)->groups()->attach($defaultGroup->id);\n }\n }\n if(is_array($request['admins']) && count($request['admins']) > 0){\n $addAdmins = $request['admins'];\n foreach ($addAdmins as $userId) {\n $organization->users()->attach([$userId => ['role'=>'admin']]);\n User::find($userId)->groups()->attach($defaultGroup->id);\n }\n }\n\n $orgThumbnail = (isset($organization->icon)) ? $organization->icon : null;\n event(new ElasticOrganisationAddToIndex($organization->id, $organization['name'], $orgThumbnail));\n\n return Response::json($organization->toArray(), 200);\n }",
"public function createAction(Request $request, $type = 'item')\n {\n $em = $this->getDoctrine()->getManager();\n\n if ($type == 'group') {\n $menu = new MenuGroup();\n } else {\n $menu = new MenuItem();\n }\n\n $form = $this->createForm(new MenuType(), $menu);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em->persist($menu);\n $em->flush();\n\n return $this->redirectToRoute('opifer_cms_menu_index');\n }\n\n return $this->render('OpiferCmsBundle:Backend/Menu:edit.html.twig', [\n 'menu' => $menu,\n 'localeMenu' => '',\n 'form' => $form->createView(),\n ]);\n }",
"public function setPermissionType($val)\n {\n $this->_propDict[\"permissionType\"] = $val;\n return $this;\n }",
"public function create()\n {\n //\n return view('backend.access.organizations.create');\n }",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function getOrganization()\n {\n return $this->organization;\n }",
"public function actionCreate() {\n $organization = new Organization();\n $login = new Login();\n $organizationLocation = new OrganizationLocation();\n if ($organization->load(Yii::$app->request->post()) && $organizationLocation->load(Yii::$app->request->post()) && $login->load(Yii::$app->request->post())) {\n $passwordConfirmation = Yii::$app->request->post()[\"password_conf\"];\n $login->active = 1;\n $login->confirmed = 1;\n $login->type = 'Organization';\n $login->name = $organization->name;\n if ($login->validatePassword($login->password, $passwordConfirmation)) {\n $login->password = sha1($login->password);\n if ($organization->save()) {\n $login->organization_id = $organization->id;\n if ($login->save()) {\n $organizationLocation->organization_id = $organization->id;\n if ($organizationLocation->save()) {\n return $this->redirect(['view', 'id' => $organization->id]);\n }\n }\n }\n }\n }\n return $this->render('create', [\n 'organization' => $organization,\n 'login' => $login,\n 'organizationLocation' => $organizationLocation,\n ]);\n }",
"public function setUserType($type)\n\t{\n\t\t$this->type = $type;\n\t}",
"public function setOrganisation($organisation)\n\t{\n\t\t$this->_organisation = $organisation;\n\t}",
"function RenderOrganization( $identifier, &$renderer) {\n\t\tif( $identifier == '' || $identifier == '-resource-' ) {\t// no organization => resources\n\t\t\treturn $this->RenderResourceOrganization( $renderer); \n\t\t} \n\t\t$organization = $this->GetOrganization( $identifier );\n\t\t$itemInfo['identifier'] = $identifier;\n\t\t$itemInfo['isLast'] = TRUE; // the organization is always the last\n $itemInfo['identifierref'] = FALSE;\n $itemInfo['isvisible'] = TRUE;\n $itemInfo['parameters'] = FALSE;\n \n\t\t$nodeTitle = $this->getFirstElementNode($organization, 'title');\n\t\t$title = $nodeTitle->getFirstChild();\n\t\t$itemInfo['title'] = $title->getContent();\n \n\t\t$elem = $this->getFirstElementNode( $organization, 'item' );\n if( $elem )\n\t\t\t$itemInfo['isLeaf'] = FALSE;\n\t\telse\n\t\t $itemInfo['isLeaf'] = TRUE;\n\n $renderer->RenderStartItem( $this, $itemInfo );\n \n\t\twhile( $elem ) {\n\t\t\tif( ($elem->getNodeType() == XML_ELEMENT_NODE) && ($elem->getNodeName() == \"item\") ) {\n\t\t\t\t$this->RenderItem( $elem, $renderer, true );\n\t\t\t}\n\t\t\t$elem = $elem->getNextSibling();\n\t\t}\n\t\t\n\t\t$renderer->RenderStopItem( $this, $itemInfo );\n\t\t\n\t}",
"public function testOrganization()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->type('email', '[email protected]')\n ->type('password', 'password') // Enter plain password\n ->press('Login')\n ->visit(new Pages\\OrganizationPage)\n ->assertSee('Add Organization');\n });\n }",
"static function getEntityType()\n\t{\n\t\treturn 'node';\n\t}",
"function add_type_menu($owner_guid) {\n\t$owner = get_entity($owner_guid);\n\tif (!$owner) {\n\t\treturn;\n\t}\n\n\t$plugin_types = elgg_get_tags(array(\n\t\t'threshold' => 0,\n\t\t'limit' => 10,\n\t\t'tag_names' => array('plugin_type'),\n\t\t'type' => 'object',\n\t\t'subtype' => 'plugin_project',\n\t\t'container_guid' => $owner_guid,\n\t));\n\n\tif ($plugin_types) {\n\t\tforeach ($plugin_types as $type) {\n\n\t\t\t$tag = $type->tag;\n\t\t\t$label = elgg_echo(\"plugins:type:\" . $tag);\n\n\t\t\t$url = \"/plugins/developer/$owner->username/type/$tag/\";\n\n\t\t\telgg_register_menu_item('page', array('name' => $label, 'text' => $label, 'href' => $url));\n\t\t}\n\t}\n}",
"public function organisationName();",
"public function contragenttype() {\n return $this->belongsTo('ContragentOrganizationType', 'company_organization_types_id', 'id');\n }",
"public function createNode($type, Node $parent = null) {\n $node = $this->createData();\n $node->type = $type;\n\n if ($parent) {\n $node->parent = $parent->getPath();\n $node->settings = new NodeSettings($node, $parent->settings);\n } else {\n $node->settings = new NodeSettings($node);\n }\n\n return $node;\n }",
"public function setType($type) {}",
"public function setType($type){ }",
"function setPersonTypeAdmin( $value )\n {\n $this->PersonTypeAdmin = $value;\n }",
"public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }",
"public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}",
"public function store(Request $request)\n {\n try {\n $v = Validate::firstErrorByRequest($request, new OrganizationRequest);\n if ($v !== true) $this->response->errorForbidden($v);\n\n $organization = new Organization;\n\n $req = $request->all();\n if ($request->get('parent_id')) {\n $parent = Organization::where('id', $request->get('parent_id'))->first();\n if (!$parent) $this->response->errorNotFound('父级机构不存在');\n @$req['level'] = $parent['level'] ? $parent['level'] : 0;\n }\n\n $organization->fill($req);\n $organization->saveOrFail();\n return $this->response->created();\n } catch (ModelNotFoundException $exception) {\n $this->response->errorNotFound($exception->getMessage());\n } catch (\\Exception $exception) {\n $this->response->errorInternal($exception->getMessage());\n }\n }",
"public function testValidGetByType() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/?\\'type\\'=\\'' . $this->VALID_TYPE . '\\'', [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations just checking (enough to make sure the right thing was obtained)\n\t\t//0th entry is the organization for the volunteers, so need to check against the 1st\n\t\t$this->assertSame($retrievedOrg->data[1]->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data[1]->orgType, $this->VALID_TYPE);\n\n\t}",
"public function organization_structure(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\t\tredirect('pages/Login');\n\t\t} else {\n\t\t$this->M_auditTrail->auditTrailRead('Organization Structure', $this->session->userdata['type']);\n\n\t\t$data = [\n\t\t\t'content' => $this->M_organizationStructure->getStrukturOrganisasi(),\n\t\t\t'judul' => 'Organization Structure - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/strukturOrganisasi',\n\t\t\t'admModal' => ['home/adm_modal_strukturOrganisasi'],\n\t\t\t'footerGraph' => []\n\t\t];\n\t\t$this->load->view('adm_layout/master',$data);\t\n\t\t} \n\t}",
"function companyTypeAdmin( )\n {\n return $this->CompanyTypeAdmin;\n }",
"function csc_related_organizations_render($subtype, $conf, $panel_args, $context = NULL) {\n module_load_include('inc', 'csc_related', 'csc_related');\n\n $type = 'organization';\n $nids = csc_related_get_nodes($type);\n\n if($nids){\n $output = '<div class=\"see-all\"><a href=\"'. url('list/organization/' . csc_related_current_nid()) .'\">SEE ALL</a></div>';\n $class = 'csc-item-num-' . sizeof($nids);\n foreach($nids as $nid){\n $node = node_load($nid);\n $lng = $node->language;\n $output .= theme('csc_related_organizations_item', array('title' => $node->title,\n 'body' => $node->field_small_teaser[$lng][0]['value'],\n 'nid' => $node->nid,\n 'image' => ($node->field_featured_image) ? $node->field_featured_image[$lng][0]['uri'] : '',\n 'class' => $class,\n ));\n }\n\n switch($node->type){\n case 'initiatives':\n case 'research':\n case 'learning':\n case 'engagement':\n $title = 'Partners';\n break;\n default:\n $title = 'Affiliations';\n break;\n }\n\n $block = new stdClass();\n $block->title = $title;\n $block->content = $output;\n\n return $block;\n }\n\n}",
"public function organization()\n {\n return $this->belongsTo('F3\\Models\\Organization', 'party_id', 'party_id');\n }",
"public function getDataModel()\n {\n return new Organization();\n }",
"public function getEntityType();",
"public function set_parent_type($parent_type)\n {\n $this->set_default_property(self::PROPERTY_PARENT_TYPE, $parent_type);\n }",
"public function __construct()\n {\n $this->name = 'Organizer';\n $this->typeModule = 'back';\n }",
"public function __construct($type) {\n $this->type = $type;\n }",
"public function setOrganization($organization)\n {\n $this->organization = $organization;\n return $this;\n }",
"public function store(Request $request)\n {\n $model = new Organization();\n if ($model->validate($request->all())) {\n $model = Organization::create($request->all());\n $parentId = $request->input('parent_id');\n if('' != $parentId){\n $parent = Organization::select('parent_path')->where('id','=',$parentId)->first();\n $model->parent_path = $parent->parent_path.\".\".$model->id;\n $model->save();\n }else{\n $model->parent_path = $model->id;\n $model->save();\n }\n return response()->json($model);\n } else {\n return response()->json($model->errors, 500);\n }\n }",
"public function create($type)\n {\n //\n }",
"public function __construct($type)\n {\n $this->plant = new PlantFactory($type);\n }",
"public function setType($type) :ISEntity\n {\n array_walk($this->types, function($name, $index) use ($type) {\n if($type === $name){\n $this->type = $index;\n }\n });\n if(is_null($this->type)) {\n if(isset($this->types[$type])) {\n $this->type = $type;\n }\n }\n return $this;\n }",
"function ctools_term_parent_settings_form($conf) {\n $form['type'] = array(\n '#type' => 'select',\n '#title' => t('Relationship type'),\n '#options' => array('parent' => t('Immediate parent'), 'top' => t('Top level term')),\n '#default_value' => $conf['type'],\n );\n\n return $form;\n}",
"abstract protected function getEntityType(): string;",
"public function store(OrganizationRequest $request)\n {\n $organization = new Organization();\n $organization->fill([\n 'name' => $request->name,\n 'citie_id' => $request->citie_id,\n 'email' => $request->email,\n 'phone' => $request->phone,\n 'address' => $request->address,\n 'postal_code' => $request->postal_code,\n 'photo_path' => $request->file('photo') ? $request->file('photo')->store('organizations') : null,\n ]);\n $organization->save();\n $request->user()->organizations()->attach($organization);\n\n $organization->type='organizations';\n\n return response()->json([\n 'data' => $organization,\n ]);\n }",
"public function getOrganization()\n {\n if (array_key_exists(\"organization\", $this->_propDict)) {\n return $this->_propDict[\"organization\"];\n } else {\n return null;\n }\n }",
"public function getChildType(): string;",
"function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}",
"function create_package_type_taxonomy() {\n \n $labels = array(\n 'name' => _x( 'Package Type', '' ),\n 'singular_name' => _x( 'Package Type', '' ),\n 'search_items' => __( 'Search Package Type' ),\n 'all_items' => __( 'All Package Type' ),\n 'parent_item' => __( 'Parent Package Type' ),\n 'parent_item_colon' => __( 'Parent Package Type:' ),\n 'edit_item' => __( 'Edit Package Type' ), \n 'update_item' => __( 'Update Package Type' ),\n 'add_new_item' => __( 'Add New Package Type' ),\n 'new_item_name' => __( 'New Package Type Name' ),\n 'menu_name' => __( 'Package Type' ),\n );\n\n $args = array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_in_rest' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'package-type' ),\n );\n \n // Registering the Taxonomy\n register_taxonomy('package_type',array('packages'), $args);\n}",
"function node_add($type) {\n global $user;\n\n $types = node_get_types();\n $type = isset($type) ? str_replace('-', '_', $type) : NULL;\n // If a node type has been specified, validate its existence.\n if (isset($types[$type]) && node_access('create', $type)) {\n // Initialize settings:\n $node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');\n\n drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));\n $output = drupal_get_form($type .'_node_form', $node);\n }\n\n return $output;\n}",
"public function createOrEnableResAppRole( $subspecialtyType, $roleType, $institution, $testing=false ) {\n $em = $this->em;\n $user = $this->security->getUser();\n $userSecUtil = $this->container->get('user_security_utility');\n //process.py script: replaced namespace by ::class: ['AppUserdirectoryBundle:SiteList'] by [SiteList::class]\n $site = $em->getRepository(SiteList::class)->findOneByAbbreviation('resapp');\n\n $count = 0;\n\n //1) name: ROLE_RESAPP_DIRECTOR_WCM_BREASTPATHOLOGY\n //get ROLE NAME: Pathology Informatics => PATHOLOGYINFORMATCS\n $roleNameBase = str_replace(\" \",\"\",$subspecialtyType->getName());\n $roleNameBase = strtoupper($roleNameBase);\n //echo \"roleNameBase=$roleNameBase<br>\";\n\n //create Director role\n $roleName = \"ROLE_RESAPP_\".$roleType.\"_WCM_\".$roleNameBase;\n //echo \"roleName=$roleName<br>\";\n //process.py script: replaced namespace by ::class: ['AppUserdirectoryBundle:Roles'] by [Roles::class]\n $role = $em->getRepository(Roles::class)->findOneByName($roleName);\n\n if( !$role ) {\n $roleTypeStr = ucfirst(strtolower($roleType));\n //exit('1: '.$roleTypeStr);\n\n $role = new Roles();\n $role = $userSecUtil->setDefaultList($role, null, $user, $roleName);\n $role->setAlias('Residency Program '.$roleTypeStr.' WCM ' . $subspecialtyType->getName());\n $role->setDescription('Access to specific residency track as '.$roleTypeStr);\n $role->addSite($site);\n $role->setInstitution($institution);\n $role->setResidencyTrack($subspecialtyType);\n\n if( $roleType == \"INTERVIEWER\" ) {\n $role->setLevel(30);\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Submit an interview evaluation\",\"Interview\",\"create\");\n }\n\n if( $roleType == \"COORDINATOR\" ) {\n $role->setLevel(40);\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Create a New Residency Application\",\"ResidencyApplication\",\"create\");\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Modify a Residency Application\",\"ResidencyApplication\",\"update\");\n }\n\n if( $roleType == \"DIRECTOR\" ) {\n $role->setLevel(50);\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Create a New Residency Application\",\"ResidencyApplication\",\"create\");\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Modify a Residency Application\",\"ResidencyApplication\",\"update\");\n }\n\n if( $count > 0 && !$testing ) {\n $em->persist($role);\n $em->flush($role);\n }\n\n } else {\n $roleType = $role->getType();\n //exit('2: '.$roleType);\n if( $roleType != 'default' && $roleType != 'user-added' ) {\n $role->setType('default');\n if( !$testing ) {\n $em->persist($role);\n $em->flush($role);\n }\n $count++;\n }\n }\n\n return $count;\n }",
"function setType($type) {\n $this->type = $type;\n }",
"public function setOrganization($organization = null)\n {\n $this->organization = $organization;\n\n return $this;\n }",
"public function setType( $type )\n {\n }",
"public function __construct($type)\n {\n $this->type = $type;\n }",
"function __construct($type) {\n\t$this->type = $type;\n\t}",
"public function newSubdepartment($title, $type = self::TYPE_PUBLIC)\n\t{\n\t\t$new_department = kyDepartment::createNew($title, $type, $this->getModule());\n\t\t$new_department->setParentDepartment($this);\n\t\treturn $new_department;\n\t}",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setMappedEntityType($entity_type);",
"public function setOrganizationalUnit($var)\n {\n GPBUtil::checkString($var, True);\n $this->organizational_unit = $var;\n\n return $this;\n }",
"protected function save_tree_visibility($p_obj_type = null, $p_category = null)\n {\n global $g_comp_database;\n\n $l_dao = isys_component_dao_user::instance($g_comp_database);\n\n $l_settings = $l_dao->get_user_settings();\n\n if (!$l_settings)\n {\n try\n {\n // Some configuration is missing (entry in isys_user_ui)... Try to create it.\n $l_settings = $l_dao->prepare_user_setting()\n ->get_user_settings();\n }\n catch (Exception $e)\n {\n isys_notify::error($e->getMessage(), ['sticky' => true]);\n\n return false;\n } // try\n } // if\n\n $l_visibility = (int) $l_settings['isys_user_ui__tree_visible'];\n\n // 1 = object types.\n if ($p_obj_type !== null)\n {\n if ($p_obj_type)\n {\n $l_visibility = ($l_visibility & 1) ? $l_visibility - 1 : $l_visibility;\n }\n else\n {\n $l_visibility = $l_visibility | 1;\n } // if\n } // if\n\n // 2 = categories.\n if ($p_category !== null)\n {\n if ($p_category)\n {\n $l_visibility = ($l_visibility & 2) ? $l_visibility - 2 : $l_visibility;\n }\n else\n {\n $l_visibility = $l_visibility | 2;\n } // if\n } // if\n\n $l_dao->save_settings(C__SETTINGS_PAGE__THEME, ['menu_visibility' => $l_visibility], false);\n\n return true;\n\n throw new isys_exception_general('Could not find out which user is logged in!');\n }",
"abstract public function getAdminType();",
"public function setLicenseType($val)\n {\n $this->_propDict[\"licenseType\"] = $val;\n return $this;\n }",
"public function category($type)\n {\n $this->lang->help->menu = $this->help->createModuleMenu();\n\n $this->lang->category = $this->lang->directory;\n $this->lang->tree->menu = $this->lang->help->menu;\n $this->lang->menuGroups->tree = 'help';\n\n $this->view->categoryBox = $this->help->getCategoryBox($type);\n $this->view->title = $this->lang->category->common;\n $this->view->type = $type;\n $this->view->root = $root;\n $this->view->children = $this->loadModel('tree')->getChildren(0, $type);\n\n $this->display();\n }",
"public function __construct($type)\n {\n $this->type=$type;\n }",
"public function setType($type)\n{\n$this->type = $type;\n\nreturn $this;\n}",
"public function addCalendarType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_calendar_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}",
"public function CreateTaphonomyMultipleOrgAdmin()\n {\n // Test user login\n $user = ['email' => '[email protected]', 'password' => 'Password!23'];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->select('@search-type-selector','SE-P1')\n ->pause(1000)\n ->type('@cora-search','888')\n ->keys('@cora-search','{enter}')\n\n // Search Result Assertions for humerus ABC999-888-777-555\n ->waitForLink('ABC999-888-777-555')\n ->assertSeeLink('ABC999-888-777-555')\n ->assertSee('Humerus')\n ->assertSee('Left')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('DNA Sampled')\n\n // Specimen Assertions\n ->clickLink('ABC999-888-777-555')\n ->assertSee('View Specimen - ABC999-888-777-555')\n ->click('@se-details-menu')\n ->click('@se-taphonomys-menu')\n ->assertSee('Taphonomies: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/taphonomys')\n\n // Open Edit Functions\n ->click('@se-taphonomys-menu')\n ->click('@taphonomy-actions-edit')\n ->assertSee('Taphonomies: ABC999-888-777-555')\n ->assertSee('Save')\n ->assertPathIs('/skeletalelements/1220/associatetaphonomys')\n\n // Add and Save a multiple new taphonomies\n ->select('@se-taphonomy-list','General Color-Natural')\n ->select('@se-taphonomy-list','Human Modification-Other')\n ->select('@se-taphonomy-list','Physical-Weathering')\n ->click('@se-taphonomy-save')\n ->acceptDialog()\n ->assertSee('Taphonomies successfully associated')\n ->assertPathIs('/skeletalelements/1220/associatetaphonomys')\n\n ->logoutUser();\n });\n }",
"protected function getTypeAttribute()\n {\n return $this->is_organizational ? $this->organization_goal->type : $this->custom_type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }"
] | [
"0.5971098",
"0.58305913",
"0.56215245",
"0.560196",
"0.5576466",
"0.5368283",
"0.5294454",
"0.5226254",
"0.520699",
"0.5192983",
"0.51843065",
"0.5158562",
"0.5157589",
"0.5147624",
"0.5146748",
"0.5135818",
"0.50923425",
"0.50736207",
"0.50725406",
"0.5053438",
"0.50439733",
"0.50127053",
"0.50063986",
"0.50037795",
"0.49555588",
"0.49344382",
"0.49213773",
"0.49132982",
"0.4910501",
"0.49081308",
"0.49081308",
"0.49081308",
"0.49033725",
"0.49029115",
"0.48921326",
"0.48904672",
"0.48893094",
"0.48819914",
"0.48804998",
"0.48721454",
"0.48542437",
"0.48492146",
"0.48468778",
"0.48443532",
"0.48419455",
"0.48400807",
"0.48394865",
"0.48358652",
"0.4834817",
"0.4830159",
"0.4811939",
"0.481086",
"0.48091206",
"0.48036477",
"0.48011625",
"0.47881308",
"0.4788074",
"0.47794876",
"0.4778965",
"0.47725388",
"0.47709346",
"0.47658896",
"0.47597465",
"0.47553954",
"0.47519547",
"0.4740287",
"0.47274396",
"0.4713981",
"0.4711164",
"0.4706799",
"0.47065035",
"0.4702885",
"0.46987614",
"0.46976042",
"0.46956077",
"0.46944782",
"0.4681786",
"0.4676109",
"0.46697095",
"0.46697095",
"0.46697095",
"0.46697095",
"0.46697095",
"0.46697095",
"0.46697095",
"0.46697095",
"0.46662265",
"0.46657684",
"0.4663261",
"0.46614972",
"0.46573755",
"0.46572354",
"0.46561065",
"0.46495295",
"0.46427992",
"0.46328297",
"0.46166268",
"0.46092695",
"0.46092695",
"0.46092695"
] | 0.6149541 | 0 |
Run the database seeds. | public function run()
{
$category = new Category();
$category->name = "Men's Fashion";
$category->slug = "A new style cloths for men.";
$category->save();
$category = new Category();
$category->name = "Women's Fashion";
$category->slug = "A new style cloths for women.";
$category->save();
$category = new Category();
$category->name = "Electronic Devices";
$category->slug = "Phone, Laptop, PC, Gaming Console, etc.";
$category->save();
$category = new Category();
$category->name = "Electronic Accessories";
$category->slug = "Electronic parts of Phone, Laptop, PC, and so on.";
$category->save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }",
"public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }",
"public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }",
"public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }",
"public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }",
"public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }",
"public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}",
"public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }",
"public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }",
"public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }",
"public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }",
"public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }",
"public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }",
"public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}",
"public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }",
"public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }",
"public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }",
"public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }",
"public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }",
"public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }",
"public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }",
"public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }",
"public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }",
"public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}",
"public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }",
"public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }",
"public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }"
] | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.7841468",
"0.7834583",
"0.7827792",
"0.7819104",
"0.78088796",
"0.7802872",
"0.7802348",
"0.78006834",
"0.77989215",
"0.7795819",
"0.77903426",
"0.77884805",
"0.77862066",
"0.7778816",
"0.7777486",
"0.7765202",
"0.7762492",
"0.77623445",
"0.77621746",
"0.7761383",
"0.77606887",
"0.77596676",
"0.7757001",
"0.7753607",
"0.7749522",
"0.7749292",
"0.77466977",
"0.7729947",
"0.77289546",
"0.772796",
"0.77167094",
"0.7714503",
"0.77140456",
"0.77132195",
"0.771243",
"0.77122366",
"0.7711113",
"0.77109736",
"0.7710777",
"0.7710086",
"0.7705484",
"0.770464",
"0.7704354",
"0.7704061",
"0.77027386",
"0.77020216",
"0.77008796",
"0.7698617",
"0.76985973",
"0.76973504",
"0.7696405",
"0.7694293",
"0.7692694",
"0.7691264",
"0.7690576",
"0.76882726",
"0.7687433",
"0.7686844",
"0.7686498",
"0.7685065",
"0.7683827",
"0.7679184",
"0.7678287",
"0.76776296",
"0.76767945",
"0.76726556",
"0.76708084",
"0.76690495",
"0.766872",
"0.76686716",
"0.7666299",
"0.76625943",
"0.7662227",
"0.76613766",
"0.7659881",
"0.7656644",
"0.76539344",
"0.76535016",
"0.7652375",
"0.7652313",
"0.7652022"
] | 0.0 | -1 |
Create a new torrents controller instance. | public function __construct()
{
$this->middleware('auth');
//$this->middleware('auth', ['only' => 'create']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createController()\n {\n $this->createClass('controller');\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }",
"private function createTorrent(TorrentRequest $request)\n {\n $collection = \\Tmdb::getMoviesApi()->getMovie($request->input('tmdb_id'))['belongs_to_collection'];\n\n if ($collection['name'] != null) {\n $serie = Serie::firstOrCreate(['title' => $collection['name'], 'tmdb_id' => $collection['id']]);\n } else {\n $serie['id'] = 0;\n }\n\n $movie = Movie::firstOrCreate(['serie_id' => $serie['id'], 'title' => $request->input('title'), 'tmdb_id' => $request->input('tmdb_id')]);\n\n $request->request->add(['movie_id' => $movie->id, 'serie_id' => $serie['id']]);\n\n $torrent = Auth::user()->torrents()->create($request->all());\n\n $this->syncTags($movie, $request->input('tag_list'));\n\n return $torrent;\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }",
"protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }",
"private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}",
"public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }",
"public function __construct()\n {\n $this->controller = new DHTController();\n }",
"public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se creó correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}",
"public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }",
"public function createController( ezcMvcRequest $request );",
"private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }",
"public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}",
"public function __construct() {\n $this->twitterController = new TwitterController;\n\t}",
"public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }",
"public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }",
"public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}",
"public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }",
"public function __construct()\n {\n $this->art = new Article();\n $this->img = new Image();\n $this->article = new ArticlesController($this->art);\n $this->image = new ImagesController();\n $this->landing = new ConfigurationsController();\n $this->cover = new CoversController();\n $this->video = new Video();\n }",
"public function makeTestController(TestController $controller)\r\n\t{\r\n\t}",
"public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }",
"private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}",
"public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}",
"public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }",
"public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }",
"public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}",
"public function __construct()\n {\n // echo \"application 호출 성공\";\n // application 의 가장 중요한 역활은 url routing 입니다.\n // url을 받으면 다음과 같은 방식으로 URL을 분석하여\n // 배엘에 저장을 하게 됩니다.\n\n $url = \"\";\n\n // 1. url이 있는지 확인 합니다.\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'],'/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n }\n\n // 2. URL을 분석합니다.\n $params = explode('/', $url);\n $counts = count($params);\n\n $param['menu'] = (!isset($params[0]) || $params[0] == '') ? \"home\" : $params[0];\n $param['action'] = (!isset($params[1]) || $params[1] == '') ? \"index\" : $params[1];\n $param['catagory'] = (!isset($params[2]) || $params[2] == '') ? \"story\" : $params[2];\n $param['contentNo'] = (!isset($params[3]) || $params[3] == '') ? 1 : $params[3];\n $param['pageNo'] = (!isset($params[4]) || $params[4] == '') ? 1 : $params[4];\n\n // 3. 해당 URL을 기준으로 controller를 호출합니다.\n $controllerName = '\\application\\controllers\\\\'.$param['menu'].'controller';\n new $controllerName($param['action'], $param['catagory'], $param['contentNo'], $param['pageNo']);\n //new \\application\\controllers\\BoardController($param['action'], $param['catagory'], $param['contentNo'], $param['pageNo']);\n }",
"public function create()\n\t{\n\t\t// handled by backbone routes\n\t}",
"protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}",
"public function create()\n {\n //Se crea la vista para dar de alta entrenador\n return view('trainers.create');\n }",
"private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }",
"public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"index\"\n ));\n }\n\n $vehicletype = new Vehicletypes();\n\n $vehicletype->setName($this->request->getPost(\"name\"));\n\n if (!$vehicletype->save()) {\n foreach ($vehicletype->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"vehicletype was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"index\"\n ));\n\n }",
"public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }",
"public function create()\n {\n $this->title = 'Upload Unity Game';\n $this->engines = Engine::all();\n return $this->view();\n }",
"private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }",
"public function store(TorrentRequest $request)\n {\n $this->createTorrent($request);\n\n flash('Votre torrent a été ajouté');\n\n return redirect('torrents');\n }",
"public function create()\n {\n // handled by client\n }",
"public function create()\n {\n return view('trackers.create');\n\n }",
"public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }",
"public function create()\n {\n // \n return view('backend.create_class'); \n }",
"public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }",
"public function create()\n {\n //\n return view('admin.class/index');\n }",
"public function actionCreate()\n {\n $model = new Trivia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}",
"static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }",
"function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}",
"public function create() {\r\n require $this->views_folder . 'create.php';\r\n }",
"public function create()\n {\n //TODO\n }",
"public function create()\n {\n if (Auth::guest())\n {\n return redirect()->guest('admin/login');\n }\n else{\n if(!hasTask('admin/drivers/create')){\n return view('errors.404');\n }\n $settings = Settings::find(1);\n SEOMeta::setTitle('Create Driver - '.$this->site_name);\n SEOMeta::setDescription('Create Driver - '.$this->site_name);\n return view('admin.drivers.create')->with('settings', $settings);\n }\n }",
"public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }",
"protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}",
"private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }",
"public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }",
"private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }",
"public function controller(array $params): void\n {\n if (!isset($params['name'])) {\n Console::fatal('Missing name parameter.');\n }\n\n $entityName = studly_case($params['name']);\n $options = [\n 'entityName' => $entityName,\n 'className' => 'App\\\\Controller\\\\' . str_plural($entityName) . 'Controller',\n 'fileKind' => 'controller',\n 'replace' => [\n 'tags' => ['{entityName}', '{controllerName}'],\n 'values' => [$entityName, str_plural($entityName)],\n ],\n 'filePath' => 'Controller/' . str_plural($entityName) . 'Controller.php',\n ];\n\n $this->createFile($options);\n }",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }",
"public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}",
"public function create() {\n\t \n }",
"public function __construct()\n {\n $url = $this->getUrl();\n /**Tomamos el primer valor para el Controlador y \n * verificamos si existe el archivo.\n * Ponemos en Mayúscula primer letra de la Palabra\n **/\n \n if (file_exists('../app/controllers/' . ucwords($url[0]) . 'Controller.php')) {\n /**Si existe seteamos el controlador y blanqueamos \n * la primer posición del array $url.\n **/\n $this->currentController = ucwords($url[0]).'Controller';\n unset($url[0]);\n }\n\n /**\n * Requerimos el Controlador y lo Intanciamos.\n */\n require_once '../app/controllers/' . $this->currentController.'.php';\n $this->currentController = new $this->currentController;\n\n /**\n * Verificamos la segunda parte de la url.\n * Para ver si estamos pasando un método.\n */\n if (isset($url[1])) {\n /**Verificamos si el Método existe en la clase.\n * Si existe o Seteamos.\n * Blanqueamos la posición del array url.\n */\n if (method_exists($this->currentController, $url[1])) {\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n /**\n * Verificamos si el array url tiene valores.\n * Si tiene seteamos params, sino lo dejamos vacío.\n */\n $this->params = $url ? array_values($url) : [];\n\n /**\n * Llamamos al método con un array de parámetros.\n */\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }",
"public function create() {}",
"public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}",
"public function create(CityController $cityController)\n {\n //\n }",
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"private function createController($moduleName = 'items', $modelName = 'Item')\n {\n make_twill_directory('Http/Controllers/Admin');\n\n $controllerClassName = $modelName . 'Controller';\n\n $stub = str_replace(\n ['{{moduleName}}', '{{controllerClassName}}'],\n [$moduleName, $controllerClassName],\n $this->files->get(__DIR__ . '/stubs/controller.stub')\n );\n\n twill_put_stub(twill_path('Http/Controllers/Admin/' . $controllerClassName . '.php'), $stub);\n\n $this->info(\"Controller created successfully! Define your index/browser/form endpoints options!\");\n }",
"protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }",
"public function create()\n {\n return view('klass-create', ['CurrentKlass' => session('current_klass')]);\n }",
"public function create(): void\n {\n if (!is_dir(DIR_TESTS . '/' . $this->module)) {\n throw new \\RuntimeException('Error while creating ' . $this->getFilename() . ' : Module doesn\\'t exists.');\n }\n\n if (!is_dir(DIR_TESTS . '/' . $this->module . '/Controller')) {\n mkdir(DIR_TESTS . '/' . $this->module . '/Controller');\n }\n\n parent::create();\n }",
"public function create()\n {\n return view('Tac.create');\n }",
"public function create()\n {\n $tune = new Tune;\n return view('tunes.create', ['tune'=>$tune, 'taggings'=>'']);\n }",
"private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }",
"public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }",
"public function create()\n {\n //Not Used because using API Route\n }",
"public function create() {\n\n\t\t\n\t}",
"public static function create() {\n self::check_logged_in();\n self::render_view('unit/new.html');\n }",
"public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }",
"public function create() {\r\n }",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create()\n {\n return view('driver.create_travels');\n }",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}"
] | [
"0.68487304",
"0.6648464",
"0.6401117",
"0.6321797",
"0.6211108",
"0.6195524",
"0.61517876",
"0.6067127",
"0.6062295",
"0.6059265",
"0.6003153",
"0.5977132",
"0.5966941",
"0.5956305",
"0.59340405",
"0.5931451",
"0.5896649",
"0.588841",
"0.5834794",
"0.58190525",
"0.57721466",
"0.5771538",
"0.5768135",
"0.5692717",
"0.56837183",
"0.56717753",
"0.566543",
"0.5620207",
"0.561772",
"0.5610396",
"0.55944574",
"0.5588737",
"0.5558402",
"0.5545352",
"0.5538695",
"0.5519656",
"0.54953074",
"0.5486603",
"0.5483691",
"0.54731137",
"0.5470558",
"0.5459263",
"0.54576933",
"0.5455864",
"0.54527855",
"0.5452532",
"0.54504216",
"0.54465085",
"0.5419807",
"0.5409588",
"0.5406511",
"0.5406351",
"0.5403889",
"0.540165",
"0.5386335",
"0.53811896",
"0.5380367",
"0.5371192",
"0.53680193",
"0.5364695",
"0.5362115",
"0.5359507",
"0.53577864",
"0.5354416",
"0.53518844",
"0.5351457",
"0.53376895",
"0.53286195",
"0.53266704",
"0.5323422",
"0.5313729",
"0.53132194",
"0.53099126",
"0.5304865",
"0.5303543",
"0.5298173",
"0.5295104",
"0.5294792",
"0.5282172",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52726096",
"0.52725935",
"0.52716225",
"0.52716225",
"0.52716225",
"0.52716225",
"0.52716225",
"0.52716225",
"0.52716225",
"0.52716225",
"0.52716225",
"0.52716225"
] | 0.0 | -1 |
show all torrent or one based on search. | public function index(Request $request)
{
//$output = \Tmdb::getSearchApi()->searchMovies('saw',array('language' => 'fr'));
$perPage = 2;
$input = $request->input('q');
$tags = '';
if ($request->input('tags') != '') {
$tags = explode(',', $request->input('tags'));
}
if ($input && !$tags) {
$rows = Movie::title($input)->sortAndPaginate($perPage);
} elseif ($tags) {
$rows = Movie::title($input)->tags($tags)->sortAndPaginate($perPage);
} else {
$rows = Movie::sortAndPaginate($perPage);
}
if (!$tags) {
$tags = [];
}
$table = \Table::create($rows, ['test']);
$table->addColumn('title', 'Nom', function ($torrent) {
return $torrent->title;
});
$table->addColumn('created_at', 'Ajouté', function ($torrent) {
return $torrent->created_at->diffForHumans();
});
return view('torrents.index', ['table' => $table, 'input' => $input, 'tags' => implode(',', $tags)]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function search()\n {\n $vereinRepository = new VereinRepository();\n $searchTerm = $_GET['searchTerm'];\n $view = new View('verein_index');\n $view->heading = 'Suchbegriff: '. $searchTerm;\n $view->title = 'Vereine';\n $view->vereine = $vereinRepository->search($searchTerm);\n\n $view->display();\n }",
"public function showtorrents()\n {\n// if(Auth::user() != null) {\n $tr=DB::table(\"torrent\")->get('*');\n// $tr = torrent::query()->get('*');\n return response()->json([\n 'data' => $tr\n ],\n 200);\n// } else {\n// return response()->json([\n// 'data' => 'Пользователь не аутентифицирован'\n// ],401);\n// }\n\n }",
"public function search(){\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$this->title = 'Search Media';\r\n\t\t$this->list = $this->Results();\r\n\t\treturn $this->renderWith(array('Media_results','App'));\r\n\t}",
"public function indexAction()\n {\n $query = !empty(trim($_GET['s'])) ? trim($_GET['s']) : null;\n if($query)\n {\n $products = \\R::find('product', \"title LIKE ? AND status = '1'\", [\"%{$query}%\"]);\n }\n $this->setMeta('Поиск по: ' . h($query));\n $this->set(compact('products', 'query'));\n }",
"function showSearchResult() {\t\t\t\t\t\n\t\t$this->setWhereArray();\n\t\t\n\t\tif(empty($_GET['order'])) {\n\t\t\t$order = \"size\";\n\t\t} else {\n\t\t\t$order = $_GET['order'];\n\t\t}\n\t\t\n\t\tif(empty($_GET['pageLimit'])) {\n\t\t\t$pl = 5;\n\t\t} else {\n\t\t\t$pl = $_GET['pageLimit'];\n\t\t}\n\t\t\n\t\tif(empty($_GET['page'])) {\n\t\t\t$currentPage = 0;\n\t\t\t$currentFinds = 1;\n\t\t} else {\n\t\t\t$currentPage = $_GET['page'];\n\t\t\t$currentFinds = (($currentPage - 1) * $pl) + 1;\n\t\t}\n\t\t\n\t\t$advsAll = \\App\\SearchModel::where($this->whereArray);\n\t\t$all = $advsAll->count();\n\t\t$advs=$advsAll->orderBy('Highlighted','desc')->orderBy($order,'desc')->paginate($pl);\n\t\t\n\t\t$currentFindsMax = $this->getCurrentMaxPage($all, $pl, $currentPage);\n\t\t\n\t\treturn view('search',['in'=>$advs, 'order'=>$order, 'pageLimit'=>$pl, 'finds'=>$all, 'cf'=>$currentFinds, 'cfm'=>$currentFindsMax, 'linkArray' => $this->linkArray]);\n\t}",
"public function show(Search $search)\n {\n //\n }",
"public function show(Search $search)\n {\n //\n }",
"public function show(Search $search)\n {\n //\n }",
"public function showall()\n\t{\n\t\t$restaurants = DB::table('restaurants')->get();\n //use one page with search\n return View::make('search',array('str'=>'ALL', 'restaurants'=>$restaurants));\n\n\t}",
"public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }",
"function showSearch () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_SEARCH###');\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// hide the radisus search by using a subpart\n\t\tif ($this->config['search']['radiusSearch'] != 1) {\n\t\t\t$subpartArray['###HIDE_RADIUSSEARCH###'] = '';\n\t\t}\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry']; // set the default country\n\t\t$markerArray['###DEFAULT_ZIP###'] = htmlspecialchars($this->piVars['zip']);\n\t\t$markerArray['###AUTOSUBMIT###'] = ($this->piVars['zip'] == '') ? '//' : '';\n\n\t\t// fetch the allowed categories as option list\n\t\t$markerArray['###CATEGORY###'] = $this->helperGetRecursiveCat($this->config['categories']);\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}",
"public function search()\n {\n $param = $_GET['search'];\n $resultados = Article::where('name', 'like', \"%$param%\")\n ->orWhere('nomenclature', 'like', \"%$param%\")\n ->orderBy('name', 'ASC')\n ->get();\n // ->paginate(6);\n // $resultados->withPath(\"resultados?search=$param\");\n\n return view(\"/resultados\", compact('resultados', 'param'));\n }",
"private function searchTrack() {\n $id = intval($_POST['query']);\n $data = $this->system->getDB()->query(\"SELECT * FROM track WHERE track_id=?\", array($id));\n echo(json_encode($data[0]));\n }",
"public function show()\n {\n $articles = $this->getArticles();\n $selectedTitle=$_GET['title'];\n\n foreach ($articles as $article)\n if ($selectedTitle== $article->title){\n $articleDescription = $article->description;\n } \n\n require 'View/articles/show.php';\n\n }",
"function mediaPage()\n{\n\n $search = isset($_GET['title']) ? $_GET['title'] : null;\n $medias = Media::showMedias(null, \"SELECT title,trailer_url,release_date,type,season_series FROM media GROUP BY title ORDER BY release_date DESC\");\n $AllType = Media::getTypeOfShow();\n require('view/mediaListView.php');\n}",
"public function show(Torrent $torrent)\n {\n return view('series.show', compact('torrent'));\n }",
"public function showSearch()\n\t{\n\t\t$languages = WordLanguage::all();\n\t\t$types = WordType::all();\n\n\t\treturn view('search.index', compact('languages', 'types'));\n\t}",
"public function search() {\n\t\t// Equivalent to $_GET['track_name']\n\t\t$track_name = request('track_name');\n\t\t$genre = request('genre');\n\n\t\t$track = new Track();\n\n\t\t$results = $track->select('tracks.name AS track_name', 'composer', 'genres.name AS genre');\n\n\t\tif( isset($track_name) && !empty($track_name) ) {\n\t\t\t$results = $results->where('tracks.name', 'LIKE' , '%' . $track_name .'%');\n\t\t}\n\t\tif( isset($genre) && !empty($genre) ) {\n\t\t\t$results = $results->where('tracks.genre_id', '=' , $genre);\n\t\t}\n\t\t$results = $results->leftJoin('genres', 'tracks.genre_id', '=', 'genres.genre_id');\n\n\n\t\treturn view('search_results', [\n\t\t\t'tracks' => $results->get()\n\t\t]);\n\n\t}",
"public function index()\n {\n $search = request('search');\n \n $movies = Movie::where([\n ['title','like','%'.$search.'%']])\n ->orwhere([['genre','like','%'.$search.'%']])\n ->orwhere([['release','like','%'.$search.'%']])\n ->orwhere([['rating','like','%'.$search.'%']])\n ->get();\n\n return view('movies.movies', compact('movies','search'));\n }",
"public function show($id)\n {\n\n return view('browse.search');\n }",
"function show_results()\n\t{\n\t\tglobal $ibforums, $std;\n\n\t\t$this->result_type = $ibforums->input['result_type'];\n\t\t$this->search_in = $ibforums->input['search_in'];\n\n\t\t//------------------------------------------------\n\t\t// We have a search ID, so lets get the parsed results.\n\t\t//------------------------------------------------\n\n\t\t$this->unique_id = $ibforums->input['searchid'];\n\n\t\tif (!$this->unique_id)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$stmt = $ibforums->db->query(\"SELECT *\n\t\t\t\t FROM ibf_search_results\n\t\t\t\t WHERE id='{$this->unique_id}'\");\n\n\t\t$sr = $stmt->fetch();\n\n\t\t$tmp_topics = $sr['topic_id'];\n\t\t$topic_max_hits = \"\"; //$sr['topic_max'];\n\t\t$tmp_posts = $sr['post_id'];\n\t\t$post_max_hits = \"\"; //$sr['post_max'];\n\n\t\t$this->sort_order = $sr['sort_order'];\n\t\t$this->sort_key = $sr['sort_key'];\n\n\t\t//------------------------------------------------\n\t\t// Remove duplicates from the topic_id and post_id\n\t\t//------------------------------------------------\n\n\t\t$topic_max_hits = self::unique_string_items($tmp_topics);\n\t\t$post_max_hits = self::unique_string_items($tmp_posts);\n\n\t\t$topics = $tmp_topics;\n\t\t$posts = $tmp_posts;\n\n\t\t//-------------------------------------\n\n\t\tif (!$topics and !$posts)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$url_words = $this->convert_highlite_words($ibforums->input['highlite']);\n\n\t\t$count = 0;\n\n\t\tif ($this->result_type == 'topics')\n\t\t{\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t FROM\n\t\t\t\t\t\tibf_topics t, ibf_forums f\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND f.id=t.forum_id\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY t.pinned DESC,\";\n\n\t\t\t\t// search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// we have tid and pid to sort out, woohoo NOT\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t// Array for forum id of each message\n\t\t\t\t$forum_posts = array();\n\n\t\t\t\tif ($posts)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tforum_id,\n\t\t\t\t\t\ttopic_id\n\t\t\t\t\tFROM ibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tpid IN({$posts})\n\t\t\t\t\t\tAND queued != 1\");\n\n\t\t\t\t\tif ($topics)\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = explode(',', $topics);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = array();\n\t\t\t\t\t}\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!in_array($pr['topic_id'], $topics))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$topics[] = $pr['topic_id'];\n\t\t\t\t\t\t\t$topic_max_hits++;\n\n\t\t\t\t\t\t\t$forum_posts[$pr['topic_id']] = $pr['forum_id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$topics = implode(',', $topics);\n\t\t\t\t}\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t \t FROM ibf_topics t\n\t\t\t\t\t LEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY\n\t\t\t\t\t\tt.pinned DESC,\";\n\n\t\t\t\t// Search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\tif ($stmt->rowCount())\n\t\t\t{\n\t\t\t\twhile ($row = $stmt->fetch())\n\t\t\t\t{\n\t\t\t\t\t// club tool\n\t\t\t\t\tif ($row['club'] and $std->check_perms($ibforums->member['club_perms']) == FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$count++;\n\n\t\t\t\t\t$row['keywords'] = $url_words;\n\n\t\t\t\t\tif ($row['pinned'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderPinnedRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$std->Error(array(\n\t\t\t\t 'LEVEL' => 1,\n\t\t\t\t 'MSG' => 'no_search_results'\n\t\t\t\t ));\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\t$this->output .= View::make(\n\t\t\t\t\"search.end\",\n\t\t\t\t[\n\t\t\t\t\t'Data' => array(\n\t\t\t\t\t\t'SHOW_PAGES' => $this->links,\n\t\t\t\t\t\t'modform_close' => ($this->modfunctions)\n\t\t\t\t\t\t\t? View::make(\"search.modform_close\")\n\t\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} else // ( $this->result_type == 'posts' )\n\t\t{\n\n\t\t\t$this->parser = new PostParser();\n\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t\tFROM ibf_topics t\n\t\t\t\t\tLEFT JOIN ibf_posts p\n\t\t\t\t\t\tON (t.tid=p.topic_id\n\t\t\t\t\t\t AND p.new_topic=1\n\t\t\t\t\t\t AND p.use_sig=0)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tt.tid IN({$topics})\n\t\t\t\t\t\tAND p.queued != 1\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t$this->parser->prepareIcons();\n\n\t\t\t\tif ($topics)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tpid\n\t\t\t\t\tFROM\n\t\t\t\t\t\tibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttopic_id IN({$topics}) AND\n\t\t\t\t\t\tnew_topic=1 AND\n\t\t\t\t\t\tqueued != 1\");\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!preg_match(\"/,\" . $pr['pid'] . \",/\", $posts))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$posts .= $pr['pid'] . \",\";\n\t\t\t\t\t\t\t$post_max_hits++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$posts = str_replace(\",,\", \",\", $posts);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= $this->start_page($post_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tp.use_emo,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.forum_highlight,\n\t\t\t\t\t\tf.highlight_fid as hid,\n\t\t\t\t\t\tf.name as forum_name,\n\t\t\t\t\t\tf.use_html,\n\t\t\t\t\t\tg.g_dohtml,\n\t\t\t\t\t\tp.ip_address\n\t\t\t\t\tFROM ibf_posts p\n\t\t\t\t\tLEFT JOIN ibf_topics t\n\t\t\t\t\t\tON (t.tid=p.topic_id)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=p.forum_id)\n\t\t\t\t\tLEFT JOIN ibf_members m\n\t\t\t\t\t\tON (m.id=p.author_id)\n\t\t\t\t\tLEFT JOIN ibf_groups g\n\t\t\t\t\t\tON (m.mgroup=g.g_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.pid IN({$posts}) AND\n\t\t\t\t\t\tp.use_sig=0 AND\n\t\t\t\t\t\tp.queued != 1 AND\n\t\t\t\t\t\tt.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\t\t\t}\n\n\t\t\twhile ($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\tif ($ibforums->member['g_is_supmod'])\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"( <a href='{$ibforums->base_url}&act=modcp&CODE=ip&incoming={$row['ip_address']}' target='_blank'>{$row['ip_address']}</a> )\";\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"\";\n\t\t\t\t}\n\n\t\t\t\tif ($row['club'] and\n\t\t\t\t $std->check_perms($ibforums->member['club_perms']) == FALSE\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$count++;\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'TEXT' => $row['post'],\n\t\t\t\t\t'SMILIES' => $row['use_emo'],\n\t\t\t\t\t'CODE' => 1,\n\t\t\t\t\t'SIGNATURE' => 0,\n\t\t\t\t\t'HTML' => 1,\n\t\t\t\t\t'HID' => ($row['forum_highlight'])\n\t\t\t\t\t\t? $row['hid']\n\t\t\t\t\t\t: -1,\n\t\t\t\t\t'TID' => $row['topic_id'],\n\t\t\t\t\t'MID' => $row['author_id'],\n\t\t\t\t);\n\n\t\t\t\t$row['post'] = $this->parser->prepare($data);\n\n\t\t\t\tif (!trim($row['post']))\n\t\t\t\t{\n\t\t\t\t\t$count--;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$row['keywords'] = $url_words;\n\t\t\t\t$row['post_date'] = $std->get_date($row['post_date']);\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Parse HTML tag on the fly\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($row['use_html'] == 1)\n\t\t\t\t{\n\t\t\t\t\t// So far, so good..\n\n\t\t\t\t\tif (stristr($row['post'], '[dohtml]'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// [doHTML] tag found..\n\n\t\t\t\t\t\t$parse = ($row['use_html'] AND $row['g_dohtml'])\n\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t: 0;\n\n\t\t\t\t\t\t$row['post'] = $this->parser->post_db_parse($row['post'], $parse);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Do word wrap?\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($ibforums->vars['post_wordwrap'] > 0)\n\t\t\t\t{\n\t\t\t\t\t$row['post'] = $this->parser->my_wordwrap($row['post'], $ibforums->vars['post_wordwrap']);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= View::make(\"search.RenderPostRow\", ['Data' => $this->parse_entry($row, 1)]);\n\t\t\t}\n\n\t\t\t$this->output .= View::make(\"search.end_as_post\", ['Data' => array('SHOW_PAGES' => $this->links)]);\n\t\t}\n\n\t\tif ($count <= 0)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$this->page_title = $ibforums->lang['search_results'];\n\n\t\tif ($ibforums->input['nav'] == 'lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'my_lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['my_nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'lt')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_lt']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'au')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_au']);\n\t\t} else\n\t\t{\n\t\t\t$this->nav = array(\n\t\t\t\t\"<a href='{$this->base_url}&act=Search'>{$ibforums->lang['search_form']}</a>\",\n\t\t\t\t$ibforums->lang['search_title']\n\t\t\t);\n\t\t}\n\t}",
"public function search()\n {\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View('search');\n echo $view->render();\n }",
"public function showall()\n {\n }",
"public function searchAction()\n {\n $user_id = $this->getSecurityContext()->getUser()->getId();\n $drive = $this->_driveHelper->getRepository()->getDriveByUserId($user_id);\n\n $q = $this->getScalarParam('q');\n // $hits = $this->getResource('drive.file_indexer')->searchInDrive($q, $drive->drive_id);\n $hits = $this->getResource('drive.file_indexer')->search($q);\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\n echo '<strong>', $hits->hitCount, '</strong> hits<br/>';\n foreach ($hits->hits as $hit) {\n $file = $this->_driveHelper->getRepository()->getFile($hit->document->file_id);\n if (empty($file)) {\n echo 'Invalid file ID: ', $hit->document->file_id;\n }\n if ($file && $this->_driveHelper->isFileReadable($file)) {\n echo '<div>', '<strong>', $file->name, '</strong> ', $this->view->fileSize($file->size), '</div>';\n }\n }\n exit;\n }",
"public function index(){\n $search = null;\n if(isset($_GET['search'])){\n $search = $_GET['search'];\n $devices = Device::where('name','LIKE','%'.$search.'%', true);\n }else {\n $devices = Device::loadAll();\n }\n $this->render('devices/index.html.twig', ['devices' => $devices, 'search' => $search]);\n }",
"public function show(torrent $torrent)\n {\n //здесь отправим письмо о том, что началась загрузка или нет и что делать\n $user = $torrent->belongsTo('App/User','name');\n $email = $torrent->belongsTo('App/User','email');\n\n //------------нужна проверка какая нибудь началась загрузка или нет------------\n\n }",
"public function index()\n {\n $tvshows = Tv_show::orderBy('title', 'asc')->paginate(10);\n if(empty($tvshows)){abort(404);}\n return view('tvshow.index')->with('tvshows', $tvshows);\n }",
"public function show($id)\n {\n // search the task\n //return a view(show.blede.php\n // pass with the return\n }",
"public function actionIndex()\n\t{\n\t\t$searchModel = new TrailerSearch;\n\t\t$dataProvider = $searchModel->search($_GET);\n\n Url::remember();\n\t\treturn $this->render('index', [\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'searchModel' => $searchModel,\n\t\t]);\n\t}",
"public function search(){}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tubes = $em->getRepository('MoteurRechercheBundle:Tube')->findAll();\n\n return $this->render('tube/index.html.twig', array(\n 'tubes' => $tubes,\n ));\n }",
"public function getSearch(){\n\t\t$this->layout->content = View::make('search')->with('teetimes', Teetime::orderBy('date')->get());\n\t}",
"public function search()\n {\n $cats = Category::where('status',1)->get();\n $item = request()->input('search');\n $posts = Post::where('status', 1)->where('title', 'like', \"%$item%\")->orWhere('text', 'like', \"%$item%\")->get();\n return View('main.search', compact('cats', 'posts'));\n }",
"public function index()\n {\n $keputusan = Keputusan::paginate(10);\n\n $filter = request()->query('search');\n\n if($filter) {\n $keputusan = Keputusan::where('nama', 'LIKE', \"%$filter%\")->paginate(15)->withQueryString();\n }\n\n return view('keputusan.index', compact('keputusan'));\n }",
"public function show(Tvrtka $tvrtka)\n {\n //\n }",
"public function index()\n {\n $searchResults =Input::get('search');\n $beritas = Berita::where('tajuk','like','%'.$searchResults.'%');\n $beritas = Berita::with('user')->where('user_id', Auth::user()->id)->paginate(5);\n return view('berita.index', compact('beritas'));\n\n }",
"public function searchCarte()\n {\n $this->utils->Restreindre($this->userConnecter->admin, $this->utils->Est_autoriser(40, $this->userConnecter->profil));\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $params = array('view' => 'compte/search-carte');\n $this->view($params, $data);\n }",
"public function search($query)\n {\n $articles = $this->article->recherche($query);\n require ('views/articlesView.php');\n }",
"public function show(Tivy $tivy)\n {\n //\n }",
"public function actionSearch()\n {\n $this->render(\"Search\");\n }",
"public function show(Town $town)\n {\n //\n }",
"public function show(Tramites $tramites)\n {\n //\n }",
"public function show($id)\n {\n //$photes = Phote::paginate(10);\n //搜尋\n $photealbum = Photealbum::find($id);\n $photes = Phote::where('belong', '=', $photealbum->title)->paginate(10);\n return view('photes.index', compact('photes','photealbum'));\n }",
"function search()\n{\n global $dir, $search_forum;\n if ($dir == 'forum' || $search_forum) {\n return show(\"menu/search_forum\", array(\"submit\" => _button_value_search, \"search\" => _search_word));\n }\n\n return show(\"menu/search\", array(\"submit\" => _button_value_search, \"searchword\" => (empty($_GET['searchword']) ? _search_word : up($_GET['searchword']))));\n}",
"public function showAll()\n {\n }",
"public function index()\n {\n //\n \n // $search = \\Request::get('search');\n // $thread = Thread::where('name', 'like', '%' .$search. '%')->get();\n // return view('threads.index', compact('thread'));\n $search = \\Request::get('search');\n if($search){\n $thread = Thread::where('name', 'like', '%' .$search. '%')->get();\n return view('threads.result', compact('thread'));\n }\n $thread = Thread::paginate(10);\n $recent_thread = Thread::orderBy('created_at', 'desc')->take(5)->get();\n return view('threads.index', compact('thread'))->with('recent', $recent_thread);\n }",
"public function show(array $params = []);",
"public function index()\r\n {\r\n // Case movie detail\r\n if (!empty($_GET['id'])) {\r\n $this->model->id['col'] = 'id_movie';\r\n $this->model->id['val'] = $_GET['id'];\r\n \r\n $detail = $this->model->read();\r\n \r\n if (!empty($detail)) {\r\n $detail[0]->id_genre = $this->model->hasOne(Genre::class, $detail[0]->id_genre)[0]->name;\r\n $detail[0]->id_publisher = $this->model->hasOne(publisher::class, $detail[0]->id_publisher)[0]->name;\r\n }\r\n\r\n $this->render('detail', ['movie' => !empty($detail) ? $detail[0] : 'id is invalid']);\r\n exit;\r\n }\r\n \r\n // Case searoching for movie\r\n if (!empty($this->params['search'])) {\r\n\r\n // time to pagination\r\n\r\n // to serach for a movie\r\n // get query \r\n // display results\r\n // if search result is one then go to detail page (by redirecting) else go to index page\r\n // $this->model->params['WHERE'] => \"title LIKE '%\" . $this->model->params['search'] . \"%'\";\r\n\r\n $this->render('index', ['movies' => $this->model->read()]);\r\n exit;\r\n } \r\n\r\n \r\n \r\n // pagination\r\n $offset = 20;\r\n $p = isset($_GET['p']) ? ($_GET['p'] - 1) * $offset : 0;\r\n $this->model->params = [\r\n 'LIMIT' => $p . ', ' . $offset\r\n ];\r\n\r\n $this->render('index', ['movies' => $this->model->read()]);\r\n }",
"public function search();",
"public function search();",
"public function show(TarifasRuta $tarifasRuta)\n {\n //\n }",
"public function search()\n {\n $query = $term = Input::get('global_query');\n $page_title = \"Search- $query : Beerhit!\";\n $page_descs = \"beerhit.com - search: $query\";\n\n $beers = DB::table('beers')->where('beer', 'LIKE','%'.strtolower($query).'%')->take(15)->get();\n $brewery = DB::table('brewery')->where('name', 'LIKE','%'.$query.'%')->take(15)->get();\n\n return view('pages.search',compact('page_title','page_descs','beers','brewery'));\n }",
"public function listing();",
"function show_restaurants()\n \t{\n\t\t\t$conn = connect_to_server();\n\t \t\t$sql = \"SELECT nazev, id_provozovna FROM Provozovna;\";\n\t \t\t\n\t \t\tif ($result = $conn->query($sql))\n\t \t\t\t// output data of each row\n\t\t \t\twhile($row = $result->fetch_assoc()) {\n\t\t \techo \"<a href=\\\"projekt.php?show_food_list=\". $row[\"id_provozovna\"]. \"\\\">\". $row[\"nazev\"]. \"</a><br>\";\n\t\t \t}\n\t\t}",
"public function searchList() {\n include 'views/search-list.php';\n }",
"public function index()\n {\n if (request('query')) {\n $cars = Car::where('name', 'like', '%'.request('query').'%')->orderBy('created_at', 'desc')\n ->paginate(10)->appends(request()->except('page'));\n } else {\n $cars = Car::orderBy('created_at', 'desc')->paginate(10);\n }\n\n return view('admin.car.index', compact('cars'));\n }",
"public function showAll() {\n $qry = $this->db->prepare('SELECT DISTINCT NAME,ADDRESS,SUBURB,LATITUDE,LONGITUDE FROM n8598177.items;');\n $qry->execute();\n foreach ($qry as $hotspot) {\n include('server/includes/recentReview.tpl.php');\n }\n }",
"public function searchAction()\n\t{\n\t\t// search query\n\t\tif (empty($_GET['query'])) {\n\t\t\t$this->_forward('index');\n\t\t}\n\n\t\t$raw_query = urldecode($_GET['query']);\n\n\t\t// explicitly check to see if it's a barcode\n\t\t$tickets = Tickets::getByBarcode($raw_query);\n\n\t\t// that didn't work; now do a generic search\n\t\tif (empty($tickets)) {\n\t\t\t// split the query up into terms; these are ANDed together by the search function\n\t\t\t// TODO: fullstop too\n\t\t\t$terms = preg_split('/[\\s\\t-_()\\[\\]\\/\\\\,\"\\']+/', $raw_query, PREG_SPLIT_NO_EMPTY);\n\t\t\t$tickets = Tickets::getBySearch($terms, User::isAdmin());\n\t\t}\n\n\t\tif (!empty($tickets)) {\n\t\t\t$this->view->tickets = $tickets;\n\n\t\t\t// if a single ticket, run a check to see if it has been scanned before, \n\t\t\t// or is invalid\n\t\t\tif (count($tickets) == 1) {\n\t\t\t\t$ticket = reset($tickets);\n\n\t\t\t\tif (!$ticket['received_payment']) {\n\t\t\t\t\t$this->view->flagNoPayment = TRUE;\n\t\t\t\t}\n\t\t\t\t$day = date('l', time());\n\n\t\t\t\t// HACK TODO: Magic numbers.\n\t\t\t\tif (($ticket['ticket_type_id'] == 2 && $day == 'Sunday') ||\n\t\t\t\t ($ticket['ticket_type_id'] == 3 && $day == 'Saturday'))\n\t\t\t\t{\n\t\t\t\t\t$this->view->flagWrongDay = TRUE;\n\t\t\t\t}\n\n\t\t\t\t// has this been scanned before?\n\t\t\t\t$scans = Tickets::getScans($ticket['barcode']);\n\t\t\t\tif (!empty($scans)) {\n\t\t\t\t\t$this->view->flagScannedBefore = TRUE;\n\t\t\t\t\t$this->view->scans = $scans;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// no tickets, bail out.\n\t\t$this->view->flagFailedSearch = TRUE;\n\t\t$this->_forward('index');\n\t}",
"public function show()\n {\n\n $search = request('search');\n\n if ($search) {\n $eventos = Evento::where([\n ['title', 'like', '%' . $search . '%']\n ])->get();\n } else {\n $eventos = Evento::all(); //ESTÁ PEGANDO TODOS OS EVENTOS QUE JÁ FORAM CADASTRADOS NO BANCO DE DADOS\n }\n\n return view('events.viewEvents', ['eventos' => $eventos, 'search' => $search]); //está retornando na view todos os eventos que foram cadastrados\n\n }",
"public function actionIndex1()\n {\n $searchModel = new VideoSearch();\n $params = Yii::$app->request->queryParams;\n $params['VideoSearch']['type'] = '1';\n $dataProvider = $searchModel->search($params);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'type' => '1',\n ]);\n }",
"public function show(Trabalho $trabalho)\n {\n //\n }",
"public function show()\n {\n $tvshow = Tv_show::where('slug', $slug)->first();\n if(empty($tvshow)){abort(404);}\n return view('tvshow.show')->with('tvshow', $tvshow);\n }",
"public function search() {\n\t\t\tif (!empty($this->params['form']['query'])) {\n\t\t\t\t/* Get query */\n\t\t\t\t$query = Sanitize::escape($this->params['form']['query']);\n\t\t\t\n\t\t\t\t/* Get list of menu items filtered by query */\n\t\t\t\t$this->menuList = $this->getThreadedList($query);\n\t\t\t} else {\n\t\t\t\t/* Get list of menu items */\n\t\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t}\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}",
"public function PressSearch()\n {\n $term = trim(request()->input('search'));\n $press = Press::where('title', 'like', '%' . $term . '%')\n ->orWhere('content', 'like', '%' . $term . '%')\n ->orderBy('date', 'desc')\n ->get();\n\n return view('pages.press.index', [\n 'title' => 'Search',\n 'press' => $press\n ]);\n }",
"public function actionIndex() {\n\n if (($term = Yii::app()->getRequest()->getParam('s'))) {\n \n $index = new Zend_Search_Lucene(Yii::getPathOfAlias('application.' . $this->_indexFiles));\n Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding(\"UTF-8\");\n $results = $index->find($term);\n $query = Zend_Search_Lucene_Search_QueryParser::parse($term);\n $dataProvider = new CArrayDataProvider($results, array(\n 'pagination' => array(\n 'pageSize' => 1,\n 'params'=>array('s'=>$term),\n ),\n ));\n \n \n $this->render('search', array('results' => $results, 'term' => $term, 'query' => $query, 'data' => $dataProvider));\n } else {\n $this->redirect(array('site/index'));\n }\n }",
"public function search() {\n if (!isset($this->params['searchText'])) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n $blog = new News();\n\n $data['title'] = $this->__('Search results');\n $data['body_class'] = 'index_news';\n $data['selected_menu'] = 'news';\n $data['left'] = PlayerHelper::playerLeftSide();\n $data['right'] = PlayerHelper::playerRightSide();\n\n $list = array();\n $this->appendCategories($list, $news, false);\n\n //crumb adding\n $this->addCrumb($this->__('Search results'));\n $list['crumb'] = $this->getCrumb();\n\n $totalResults = $news->getSearchTotal(urldecode($this->params['searchText']));\n $pager = $this->appendPagination($list, new stdClass(), $totalResults > 0 ? $totalResults : 1, MainHelper::site_url('news/search/' . urlencode($this->params['searchText'])));\n\n $list['hideHeader'] = true;\n $list['searchText'] = urldecode($this->params['searchText']);\n $list['resultCount'] = $totalResults;\n $list['newsList'] = $news->getSearch(urldecode($this->params['searchText']), $pager->limit);\n\n $data['content'] = $this->renderBlock('news/searchResults', $list);\n\n $data['footer'] = MainHelper::bottomMenu();\n $data['header'] = MainHelper::topMenu();\n $this->render3Cols($data);\n }",
"public function contents()\n\t{\n\t\tglobal $db, $ws;\n\n\t\t$result='';\n\t\t$albumsfound='';\n\t\t$photosfound='';\n\n\t\tif(!isset($_POST['search'])||(empty($_POST['search']))){\n\t\t\treturn '<h1 class=\"\">Enter keyword to search, and try again.</h1>';\n\t\t}\n\n\t\t$search=filter_var($_POST['search'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\n\t\t$q=$db->query(\"SELECT *,\n\t\t IFNULL(\n\t\t (SELECT `filename` FROM `photos` WHERE `photos`.`aid`=`albums`.`aid`\n\t\t ORDER BY `phid` DESC LIMIT 1), '') AS `photo`\n\t\t FROM `albums` WHERE (`name` LIKE '\".$search.\"%' OR `name` LIKE '%\".$search.\"%') \");\n\t\tif($db->num_rows($q)>0){\n\t\t\twhile($a=$db->fetch_array($q)){\n\t\t\t\t$albumsfound.=$ws->albumPreview(0, $a['aid'], $a['uid'], $a['photo'], $a['name'], $a['created']);\n\t\t\t}\n\t\t}else{\n\t\t\t$albumsfound.='<h2 class=\"errormsg\">We didn‘t find any albums with that keyword</h2>';\n\t\t}\n\n\t\t$q=$db->query(\"SELECT * FROM `photos` WHERE (`name` LIKE '\".$search.\"%' OR `name` LIKE '%\".$search.\"%') \");\n\t\tif($db->num_rows($q)>0){\n\t\t\twhile($a=$db->fetch_array($q)){\n\t\t\t\t$photosfound.=$ws->photoPreview(0, $a['phid'], $a['uid'], $a['filename'], $a['name'], $a['created'],$a['aid']);\n\t\t\t}\n\t\t}else{\n\t\t\t$photosfound.='<h2 class=\"errormsg\">We didn‘t find any photos with that keyword</h2>';\n\t\t}\n\n\t\t$result.='\n\t\t<div id=\"search-results\">\n\t\t\t<div id=\"search-results-albums\">\n\t\t\t\t<h1 class=\"search-results-title\">Found albums:</h1>\n\t\t\t\t<div class=\"search-results-items\">\n\t\t\t\t\t'.$albumsfound.'\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div id=\"search-results-photos\">\n\t\t\t\t<h1 class=\"search-results-title\">Found photos:</h1>\n\t\t\t\t<div class=\"search-results-items\">\n\t\t\t\t\t'.$photosfound.'\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>';\n\n\n\t\treturn $result;\n\t}",
"public function index()\n {\n $videos = Video::published()->orderBy('id', 'desc');\n if(request()->has('search') && request()->get('search') != ''){\n $videos = $videos->where('name', 'like', '%'.request()->get('search').'%');\n }\n $videos = $videos->paginate(30);\n return view('home', compact('videos'));\n }",
"function search() {}",
"public function index()\n {\n $art_name=request()->art_name;\n $where=[];\n if($art_name){\n $where[]=['art_name','like',\"%$art_name%\"];\n }\n $data=Art::where($where)->paginate(2);\n $query=request()->all();\n return view('admin.article.index',['data'=>$data,'query'=>$query]);\n\n }",
"public function actionSearch()\n {\n $currentPage = Yii::$app->request->get('page') ? Yii::$app->request->get('page') : 1;\n $query = Yii::$app->request->get('search');\n\n $repos = GitHubApi::findRepo($query, $currentPage);\n $pages = new Pagination(['totalCount' => $repos['total_count'], 'pageSize' => 20]);\n $pages->pageSizeParam = false;\n\n return $this->render('search', [\n 'repos' => $repos,\n 'pages' => $pages,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new ArticleSearch();\n if(isset($_GET['kind'])) $searchModel->kind=$_GET['kind'];\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function searchResults($string, $type, $power_search = false) {\n\t\t\tglobal $cms_type,$jzSERVICES; \n\t\t\t\n\t\t\t$display = &new jzDisplay();\n\t\t\t$blocks = &new jzBlocks();\n\t\t\t$tracks = array();\n\t\t\t$nodes = array();\n\t\t\t\n\t\t\t// remember, $this is a frontend.\n\t\t\t// This has to go before SQL querries.\n\t\t\t// If our keywords say to play the results\n\t\t\t// we cannot print any HTML.\n\t\t\tif ($power_search === false) {\n\t\t\t $check = splitKeywords($string);\n\t\t\t if (!muteOutput($check['keywords'])) {\n\t\t\t $display->preheader('Search Results',$this->width,$this->align);\n\t\t\t $this->pageTop('Search Results');\n\t\t\t }\n\t\t\t \n\t\t\t $results = handleSearch($string, $type);\n\t\t\t if (sizeof($results) == 0 && muteOutput($check['keywords'])) {\n\t\t\t $display->preheader('Search Results',$this->width,$this->align);\n\t\t\t $this->pageTop('Search Results');\n\t\t\t }\n\t\t\t} else {\n\t\t\t // Power search:\n\t\t\t $display->preheader('Search Results',$this->width,$this->align);\n\t\t\t $this->pageTop('Search Results');\n\t\t\t $root = new jzMediaNode();\n\t\t\t $results = $root->powerSearch();\n\t\t\t}\n\t\t\t\n\t\t\techo '<table width=\"100%\" cellpadding=\"3\"><tr><td>';\n\n\t\t\tforeach ($results as $val) {\n\t\t\t\tif ($val->isLeaf()) {\n\t\t\t\t\t$tracks[] = $val;\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$nodes[] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// show the page\n\t\t\tif (sizeof($tracks) > 0) {\n\t\t\t\t$blocks->blockHeader(sizeof($tracks). \" \". word(\"Matching Tracks\"). \" \". word(\"for search\"). ' \"'. $_POST['search_query']. '\"');\n\t\t\t\t$blocks->blockBodyOpen();\n\t\t\t\t$blocks->trackTable($tracks, \"search\");\n\t\t\t\t$blocks->blockBodyClose();\n\t\t\t\t$blocks->blockSpacer();\n\t\t\t}\n\t\t\tif (sizeof($nodes) > 0) {\n\t\t\t\t$blocks->blockHeader(sizeof($nodes). \" \". word(\"Other Matches\"). \" \". word(\"for search\"). ' \"'. $_POST['search_query']. '\"');\n\t\t\t\t$blocks->blockBodyOpen();\n\t\t\t\t$blocks->nodeTable($nodes,\"search\");\n\t\t\t\t$blocks->blockBodyClose();\n\t\t\t\t$blocks->blockSpacer();\n\t\t\t}\n\t\t\tif (sizeof($nodes) == 0 && sizeof($tracks) == 0) {\n\t\t\t\t$blocks->blockHeader(word(\"No matches found\"));\n\t\t\t}\n\t\t\t$this->footer();\n\t\t\t$jzSERVICES->cmsClose();\n\t\t}",
"public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }",
"public function searchPageAction(){\n // Get entity Manager\n $em = $this->get('doctrine')->getManager();\n\n\t$searchTxt = $_POST['search'];\n\n\n\t$films = $em->createQuery('SELECT f FROM VideotechBundle:Film f\n\t \t\t\t\t WHERE f.title like :search')\n ->setParameter('search', '%' . $searchTxt . '%')\n\t\t ->execute();\n\n\n $categories = $em->createQuery('SELECT c FROM VideotechBundle:Category c\n\t \t\t\t\t WHERE c.name like :search')\n ->setParameter('search', '%' . $searchTxt . '%')\n\t\t ->execute();\n\n // Render display\n return $this->render('@Videotech/Film/search.twig', array(\n \"films\" => $films,\n\t \"categories\" => $categories\n ));\n }",
"public function index()\n {\n if(request()->has('search')){\n $posts=post::where('id',request('search'))\n ->Orwhere('title','Like','%'.request('search').'%')\n ->paginate(8);\n }\n else{\n $posts=post::paginate(8);\n }\n return view('admin/post/show',compact('posts'));\n }",
"public function index()\n {\n $posts = Post::when(request('search'), function($q) {\n return $q->where('title', 'like', '%' . request('search') . '%');\n })->latest()->paginate();\n return view('trumbowyg.index', compact('posts'));\n }",
"public function actionSearch(){\n $q = htmlentities($_GET['q']);\n if(!empty($q)){\n $result = array();\n $users = Users::find()->where('display_name LIKE \"'.$q.'%\" AND active = 1 AND authKey IS NULL')->limit(5)->all();\n $ul = '<ul class=\"search-results-ul col-md-3\">';\n foreach ($users as $key => $value) {\n $ul .= '<li><a href=\"' . Url::to(['user/profile/'.$value->display_name]) . '\"><img src=\"' . \\Yii::getAlias('@web/images/users/'.$value->profilePic) . '\" height=\"30\" class=\"img-circle\" style=\"margin-right: 10px\"> '.$value->display_name.'</a></li>';\n }\n $ul .= '</ul>';\n echo $ul;\n }\n }",
"public function index(Request $request)\n {\n $searchText=trim($request->get('searchText'));\n $musicas = DB::table('musics as m')\n ->join('disks as d','m.disk_id','=','d.id')\n ->select('m.id','m.artist','m.image','m.title','m.year','m.country','d.name')\n ->where('m.artist','LIKE','%'.$searchText.'%')\n ->orwhere('d.name','LIKE','%'.$searchText.'%')\n ->where('m.title','LIKE','%'.$searchText.'%')\n ->orwhere('d.name','LIKE','%'.$searchText.'%')\n ->orderBy('m.artist','ASC')\n ->paginate(9);\n return view('admin.musicas.index', compact('musicas','searchText'));\n }",
"public function show()\n {\n\t\t//$result = $a->selectAll();\n include(\"view/bureau.html\");\n }",
"public function showIndex()\n\t{\n\n\t\t//var_dump(Parser::GetRazdely());\n\n\t\t//var_dump(Parser::getCarPost('prodam-mikroavtobus-26483298'));\n\n\t\t//var_dump(Parser::getPosts('realty/sell_flats', 5));\n\n\t\t//var_dump(Parser::getPosts('auto/sale', 5, 5));\n\n\t\tvar_dump(Parser::getPosts('free', 4, 1, 10));\n\t}",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionIndex()\r\n {\r\n\r\n $criteria = new CDbCriteria; \t\t\r\n $items = Letters::model()->findAll($criteria);\r\n \r\n $this->render('search', array(\r\n\t\t\t\t'docs'=>$items,));\r\n\t\t\r\n\t}",
"public function index()\n {\n $search = \\Request::get('search');\n $alunos = Aluno::where('Nome','like','%'.$search.'%')->orderBy('id')->paginate(15);\n //$medicamentos = Medicamento::all();\n return view('alunos.index',['alunos' => $alunos]);\n }",
"public function show()\n\t{\n\t\techo $this->tags();\n\t}",
"public function index()\n {\n if (isset($_GET['search'])) {\n $key = $_GET['search'];\n $content = Konten::where('judul', 'LIKE', \"%$key%\")->where('status', 2)->latest()->paginate(10);\n } else {\n $content = Konten::all();\n }\n return view('artikel.index', compact('content'));\n \n }",
"public function findAction() {\n // todo log access\n $cardname = $this->_request->getParam('cardname');\n if (empty($cardname)) {\n $this->getHelper('redirector')->goto('index', 'index');\n }\n else {\n $this->getHelper('redirector')->gotoUrl('/index/search/card/' . rawurlencode($cardname));\n }\n }",
"public function search() {\n if (!Request::get('s')) {\n return view('home.layout');\n }\n\n SearchHistory::record_user_search(\n Request::get('s'),\n Auth::user() ? Auth::user()->id : -1\n );\n\n return view('search.layout', [\n 'results' => $this->get_search_results(\n Request::get('s')\n )\n ]);\n }",
"public function index()\n {\n \t\tif (isset($_GET[\"search\"])){\n \t\t\t$search = $_GET[\"search\"];\n \t\t\t$items = Item::where('name','LIKE','%'.$search.'%')->orWhere('description','LIKE','%'.$search.'%')->orWhere('barcode','LIKE','%'.$search.'%')->orderBy('name','asc')->paginate(20);\n \t\t} else {\n \t\t\t$items = Item::orderBy('name','asc')->paginate(20);\n \t\t}\n return view('items.index', compact('items'));\n }",
"function searchs()\n\t{\n\t $url1 = explode('/',$_GET['url']);\t\n\t\t$this->view->title = 'Search seance hemodialyse';\n\t $this->view->userListviewo = $_GET['o']; //criter de choix\n\t $this->view->userListviewq = $_GET['q']; //key word \n\t\t$this->view->userListviewp =$url1[2]; // parametre 2 page limit 2,3\n\t\t$this->view->userListviewl =10; // parametre 3 nombre de ligne par page limit 2,3 \n\t\t$this->view->userListviewb =20; // parametre nombre de chiffre dan la barre navigation\n\t\t$this->view->userListview = $this->model->userSearchs($this->view->userListviewo,$this->view->userListviewq,$this->view->userListviewp,$this->view->userListviewl);\n\t\t$this->view->userListview1= $this->model->userSearchs1($this->view->userListviewo,$this->view->userListviewq); // compte total pour bare de navigation\n\t\t$this->view->render($this->route.'/seance');\n\t}",
"function index() {\r\n \t\r\n // The default action is the showall action\r\n $this->browse();\r\n }",
"public function show(Ruta $ruta)\n {\n //\n }",
"public function index(){\n $artistes = $this->Artiste->findArtiste();\n\n $this->render('admin.artistes.index', compact('artistes'));\n }",
"public function actionSearch()\n {\n //el asunto esta en que no hay datos confiables en la base. Hay que tocar el modelo de registro para que guarde un par de cosas mas.\n $tarifa= new TarifasModelo();\n\n $agenciaModel= new AgenciaModelo();\n $result = $agenciaModel->GetInfoAgencia(null,null,null,null,null,null,null,null);\n //for ($i = 0; $i < $length; $i++)\n //{\n \t\n //}\n $i=-1;\n foreach ($result as $value)\n {\n $i++;\n \tif($value[\"DireccionCoordenada\"] !=null){ // asi no vamos a buscar las tarifas de remiserias que no se van a mostrar\n //array_push($value,$tarifa->GetInfoTarifas(null,null,$value[\"AgenciaID\"],null,null,null,null)) ;\n $result[$i]['Tarifa'] = $tarifa->GetInfoTarifas(null,null,$value[\"AgenciaID\"],null,null,null,null)[0]; //casos en los que tienen mas de una tarifa, nose por que\n }\n }\n \n $this->setHeader(200);\n Yii::$app->response->format = Response::FORMAT_JSON;\n return Json::encode($result);\n \n }",
"public function search() {\n\t\t// Use the list members view\n\t\t$this->view = 'list_members';\n\n\t\t// If search term is not set, list all the members\n\t\tif (!isset($this->params['url']['query'])) {\n\t\t\treturn $this->redirect( array('controller' => 'members', 'action' => 'listMembers') );\n\t\t}\n\n\t\t$keyword = trim($this->params['url']['query']);\n\n\t\t$this->__paginateMemberList($this->Member->getMemberSummaryForSearchQuery(true, $keyword));\n\t}",
"function show()\r\n {\r\n $script = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&sort='.$this->sort.'&fltr='.$this->fltr.'&fln='.$this->fln;\r\n $script = $_SERVER['PHP_SELF'].\"?$script\";\r\n\r\n if( !$this->sort ) $this->sort='id';\r\n\t\tif($this->sort=='result') $this->sort='`result` desc';\r\n //if( strstr( $this->sort, 'seria' ) )$this->sort = $this->sort.' desc';\r\n $q = \"SELECT * FROM \".TblModSearchResult.\" where 1 order by \".$this->sort.\"\";\r\n //if( $this->srch ) $q = $q.\" and (name LIKE '%$this->srch%' OR email LIKE '%$this->srch%')\";\r\n if( $this->fltr ) $q = $q.\" and $this->fltr\";\r\n $res = $this->Right->Query( $q, $this->user_id, $this->module );\r\n //echo '<br>$q='.$q.' $res='.$res.'$this->Right->result='.$this->Right->result.' $this->user_id='.$this->user_id;\r\n if( !$res )return false;\r\n $rows = $this->Right->db_GetNumRows();\r\n\r\n /* Write Form Header */\r\n $this->Form->WriteHeader( $script );\r\n\r\n /* Write Table Part */\r\n AdminHTML::TablePartH();\r\n\r\n /* Write Links on Pages */\r\n echo '<TR><TD COLSPAN=17>';\r\n $script1 = 'module='.$this->module.'&fltr='.$this->fltr;\r\n $script1 = $_SERVER['PHP_SELF'].\"?$script1\";\r\n\t\tif( !$this->display ) $this->display = 20;\r\n //$this->Form->WriteLinkPages( $script1, $rows, $this->display, $this->start, $this->sort );\r\n\t\t$this->Form->WriteLinkPages( $script1.'&fltr='.$this->fltr, $rows, $this->display, $this->start, $this->sort );\r\n\r\n echo '<TR><TD COLSPAN=5>';\r\n $this->Form->WriteTopPanel( $script );\r\n\r\n echo '<td colspan=5>';\r\n echo $this->Form->TextBox('srch', $this->srch, 25);\r\n echo '<input type=submit value='.$this->Msg->show_text('_BUTTON_SEARCH',TblSysTxt).'>';\r\n\r\n /*\r\n echo '<td><td><td><td><td colspan=2>';\r\n $this->Form->WriteSelectLangChange( $script, $this->fln);\r\n */\r\n\r\n $script2 = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&task=show&fltr='.$this->fltr;\r\n $script2 = $_SERVER['PHP_SELF'].\"?$script2\";\r\n ?>\r\n <TR>\r\n <td class=\"THead\">*</Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=id><?=$this->Msg->show_text('FLD_ID')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=query><?=$this->Msg->show_text('FLD_QUERY')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=ip><?=$this->Msg->show_text('FLD_IP')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=date><?=$this->Msg->show_text('FLD_DATE')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=time><?=$this->Msg->show_text('FLD_TIME')?></A></Th>\r\n \r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=result><?=$this->Msg->show_text('FLD_RESULT')?></A></Th>\r\n \r\n <?\r\n\r\n $up = 0;\r\n $down = 0;\r\n $a = $rows;\r\n $j = 0;\r\n $row_arr = NULL;\r\n for( $i = 0; $i < $rows; $i++ )\r\n {\r\n $row = $this->Right->db_FetchAssoc();\r\n if( $i >= $this->start && $i < ( $this->start+$this->display ) )\r\n {\r\n $row_arr[$j] = $row;\r\n $j = $j + 1;\r\n }\r\n }\r\n\r\n $style1 = 'TR1';\r\n $style2 = 'TR2';\r\n for( $i = 0; $i < count( $row_arr ); $i++ )\r\n {\r\n $row = $row_arr[$i];\r\n\r\n if ( (float)$i/2 == round( $i/2 ) )\r\n {\r\n echo '<TR CLASS=\"'.$style1.'\">';\r\n }\r\n else echo '<TR CLASS=\"'.$style2.'\">';\r\n\r\n echo '<TD>';\r\n $this->Form->CheckBox( \"id_del[]\", $row['id'] );\r\n\r\n echo '<TD>';\r\n $this->Form->Link( $script.\"&task=edit&id=\".$row['id'], stripslashes( $row['id'] ) );\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['query'] )!='' ) echo $row['query'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['ip'] )!='' ) echo $row['ip'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['date'] )!='' ) echo $row['date'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['time'] )!='' ) echo $row['time'];\r\n\r\n echo '<TD align=center>';\r\n if( trim($row['result'])!='' ) echo $row['result'];\r\n\r\n } //-- end for\r\n\r\n AdminHTML::TablePartF();\r\n $this->Form->WriteFooter();\r\n return true;\r\n\r\n \r\n}",
"public function buscar()\n {\n $search = \\Request::get('search');\n \n $locales = Local::where('Nombre', 'like', '%'.$search.'%')\n ->orderBy('CodLocal')\n ->paginate(15);\n return view('local.lista_local', ['locales' => $locales]);\n }",
"public function search()\n {\n $keyword = Input::get('q');\n $items = with(new MasterCategory())->search($keyword);\n\n return $this->renderList($items);\n }",
"public function index($param = null) \n\t{\n\t\t$this->render('index', null, 'Northern BC Native Tree Farm', 'Locally owned and operated native tree and shrub nursery. We grow coniferous and deciduous trees, shrubs, and woody plants native to the interior Pacific North West.');\n\t}",
"public function show(tarifas $tarifas)\n {\n //\n\n }",
"public function actionIndex()\n {\n $get = Yii::$app->request->get();\n $session = Yii::$app->session;\n if(empty($get['StreamSearch'])){\n $session['search'] = [];\n }else{\n $session['search'] = $get['StreamSearch'];\n }\n $searchModel = new StreamSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $this->module->params['pageSize']);\n //$dataProvider->setSort(false);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }"
] | [
"0.6373711",
"0.62420404",
"0.6092526",
"0.60694516",
"0.604872",
"0.60119194",
"0.60119194",
"0.60119194",
"0.5934348",
"0.5917506",
"0.5807493",
"0.58016276",
"0.5770522",
"0.57559943",
"0.57195836",
"0.5716357",
"0.5687029",
"0.56843454",
"0.5675398",
"0.56733894",
"0.56680655",
"0.5667896",
"0.5659573",
"0.56408703",
"0.5625997",
"0.5625302",
"0.56188226",
"0.56031936",
"0.5603013",
"0.5577729",
"0.5573457",
"0.5573021",
"0.5572269",
"0.5571139",
"0.55668813",
"0.55630535",
"0.5558426",
"0.555698",
"0.5550761",
"0.5541015",
"0.55276656",
"0.5521528",
"0.55200624",
"0.5516057",
"0.55145764",
"0.550685",
"0.55032396",
"0.5500483",
"0.5493392",
"0.5493392",
"0.54928374",
"0.5484264",
"0.54459596",
"0.5432065",
"0.54315406",
"0.5425873",
"0.5424846",
"0.5424377",
"0.54203916",
"0.5419723",
"0.5416456",
"0.5415223",
"0.54043317",
"0.5397548",
"0.5395917",
"0.5386958",
"0.53847396",
"0.53846645",
"0.53794366",
"0.53789604",
"0.53769237",
"0.53761846",
"0.53758484",
"0.53758454",
"0.5363298",
"0.535793",
"0.53529865",
"0.53514135",
"0.53487694",
"0.5347371",
"0.5340305",
"0.5339962",
"0.5335338",
"0.53303754",
"0.53240883",
"0.53208226",
"0.5320342",
"0.53195757",
"0.53183186",
"0.5314901",
"0.53142965",
"0.53126156",
"0.5303773",
"0.5300535",
"0.5289144",
"0.5288138",
"0.528792",
"0.52874196",
"0.52870387",
"0.5284629",
"0.52844304"
] | 0.0 | -1 |
Show the series page according to the torrent. | public function show(Torrent $torrent)
{
return view('series.show', compact('torrent'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n $series = ContentHandler::getLatestSeriesSimplePaginate(9);\n\n $subscribed = UserHandler::checkSubscription();\n\n return Theme::view('series.index', [\n 'content' => $series, \n 'subscribed' => $subscribed,\n ]);\n }",
"public function index()\n {\n $series = Serie::latest()->paginate(10);\n return view('admin.series.index', ['series' => $series]);\n }",
"public function show(PlaySeries $playSeries)\n {\n //\n }",
"public function show(Series $series)\n {\n\n\n $episodes = $series->episodes()->paginate(6);\n\n $series->genres = substr($series->genres, 0, -2);\n $series->genres = explode(', ', $series->genres);\n\n if(Auth::user()) {\n $user = Auth::user();\n $library = Library::select('id', 'user_id', 'status', 'last_watched_episode', 'is_fav', 'rating')->where('series_id', $series->id)->where('user_id', $user->id)->first();\n } else {\n $library = null;\n }\n\n return View::component('Series', [\n 'series' => $series,\n 'episodes' => $episodes,\n 'library' => $library,\n ]);\n }",
"public function index()\n {\n $series = Series::select('name', 'id', 'poster')->orderBy('popularity', 'ASC')->paginate(18);\n\n return View::component('SeriesHome', [\n 'series' => $series,\n 'genre' => 'genre',\n ]);\n }",
"public function index()\n {\n $series = Serie::all();\n return view ('admin.series.index', compact('series'));\n }",
"public function index()\n {\n $series = Serie::all();\n\n return view('series.index', compact('series'));\n }",
"public function series()\n {\n $series = Serie::all();\n return view('series', ['series' => $series]);\n }",
"public function index()\n {\n $series = Serie::with('grifo')->get();\n\n return view('grifos.series.gestion.index',compact('series'));\n }",
"function getShow() {\n\n global $f3;\n global $tvdb;\n\n $series = $f3->get('PARAMS.param1');\n $data = $tvdb->getSeries($series);\n\n echo json_encode($data);\n }",
"private function welcome_series()\n {\n $results = '';\n foreach($this->series->all() as $series)\n {\n $results .= $this->parser->parse('_seriescell', $series, true);\n }\n \n $this->data['seriesdisplay'] = $results;\n }",
"function series($id)\n{\n global $app;\n\n $details = $app->calibre->seriesDetails($id);\n if (is_null($details)) {\n $app->getLog()->debug('no series ' . $id);\n $app->notFound();\n }\n $app->render('series_detail.html', [\n 'page' => mkPage(getMessageString('series_details'), 5, 3),\n 'series' => $details['series'],\n 'books' => $details['books']]);\n}",
"public function printSeries()\n {\n echo json_encode($this->series);\n }",
"public function show() {\n $this->buildPage();\n echo $this->_page;\n }",
"public function index(){\n $series = Serie::all();\n // Get all genres\n $genres = Genre::all();\n $series = Serie::with('genres')->get();\n // Return view with homepage with series and genres\n return view('homepage', compact('series', 'genres'));\n }",
"public function index()\n {\n Config::setJsConfig('curPage', 'downloads-index');\n parent::displayIndex(get_class());\n }",
"public function show(Serie $serie)\n {\n return view('admin.series.show', compact('serie'));\n }",
"public function show($id)\n {\n $series = ContentHandler::getSeries($id);\n\n if($series == null)\n return Theme::view('series.show', [\n 'content' => null,\n 'seriesLength' => null,\n 'seasonsLength' => null\n ]);\n\n $length = ContentHandler::getSeriesSeasonsLength($series);\n \n if($series == null || isset($series[0]) == false)\n return abort(404);\n\n return Theme::view('series.show', [\n 'content' => $series,\n 'seriesLength' => $length['seriesLength'],\n 'seasonsLength' => $length['seasonsLength']\n ]);\n }",
"public function show(Serie $serie)\n {\n return view('series.show', compact('serie'));\n }",
"public function indexAction(){\n \t$logger \t= new Frogg_Log('/home2/bleachse/public_html/seriando/log/new_series.log');\n \t$control = new Application_Model_NewSeriesControl(1);\n \t$series_control = $control->nextSeries();\n \tif(!$series_control){ $logger->warn('No new series'); $logger->close(); die();}\n \t\n \t$xml = new XMLReader();\n\t if(!$xml->open('http://services.tvrage.com/feeds/full_show_info.php?sid='.$series_control->rage_id)){\n\t \t$logger->err('Failed to open input file : '.$series_control->rage_id);\n\t \t\t$logger->close();\n\t die();\n\t }\n\t $logger->info('Starting to log new_series_id : '.$series_control->rage_id);\n\t $series = new Application_Model_Series();\n\t while ($xml->read()){\n\t \twhile($xml->read() && $xml->name != 'name');\n\t \tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'name'){\n\t\t\t\t$series->name = $xml->readString();\n\t \t}\n \t\twhile($xml->read() && $xml->name != 'showid');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'showid'){\n \t\t\t$series->rage_id = $xml->readString();\n \t\t\t$double_check = new Application_Model_Series();\n \t\t\t$logger->info('Double check [my_id]:[rage_id] '.$series_control->rage_id.':'.$series->rage_id);\n \t\t\tif($double_check->loadField('rage_id', $series->rage_id)){\n \t\t\t\t//This piece of code will probably NEVER run.\n \t\t\t\t//Why? NewSeriesControl only fetches UNREAD series AND 'newseries.rage_id' MUST be unique.\n \t\t\t\t//If this ever happen: Either you forgot to set 'rage_id' as unique or the DB crapped itself\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::ERROR;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->err('Series already registered rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'origin_country');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'origin_country'){\n \t\t\tif(!$this->allowedCountry($xml->readString())){\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::INVALID;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->warn('Series country not allowed rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'status');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'status'){\n \t\t\t$series->status = $this->parseStatus($xml->readString());\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'classification');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'classification'){\n \t\t\tif($this->avoidedClassification($xml->readString())){\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::INVALID;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->warn('Series classification invalid rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'runtime');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'runtime'){\n \t\t\t$series->runtime = $xml->readString();\n \t\t}\n \t\t$series->image\t = 'default.png';\n \t\t$series->timestamp = time();\n \t\t$series->permalink = $series->permalinkFor('name');\n \t\t$series->order\t = NEW_SERIES;\n\t \tif(!$series->rage_id){\n\t \t\t$series_control->flag = Application_Model_NewSeries::ERROR;\n\t \t\t$series_control->update();\n\t \t\t$logger->err('Empty XML');\n\t \t\t$logger->close();\n\t \t\tdie;\n\t \t}\n \t\t$series_id = $series->save();\n \t\t$logger->ok('Saved');\n \t\t\n \t\t$series_bucket = new Application_Model_SeriesBucket($series->name,$series->permalink);\n \t\t$series_bucket->save();\n \t\t\n\t \t$has_episodes = $xml->next('Episodelist');\n \t\tif($has_episodes){\n \t\t\twhile($xml->read() && !($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'Episodelist')){\n \t\t\t\twhile($xml->read() && $xml->name != 'Season');//Goes to next <Season>\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'Season'){\n\t\t \t\t\t$season_num = $xml->getAttribute('no');\n\t\t \t\t\t$season = new Application_Model_Series();\n\t\t \t\t\t$season->series_id \t= $series_id;\n\t\t \t\t\t$season->name \t \t= $season_num.'ª Temporada';\n\t\t \t\t\t$season->order\t\t= $season_num * 1000; //According to format XXX.000 for seasons \n\t\t \t\t\tif($season_num < 10){ $season_num = '0'.$season_num; }\n\t\t \t\t\t$season->release \t= $series->name.' Season '.$season_num;\n\t\t \t\t\t$season->timestamp \t= time();\n\t\t \t\t\t$season_id \t\t\t= $season->save();\n\t\t \t\t\t$release\t\t\t= new Application_Model_Release($season_id,$season->release,time());\n\t\t \t\t\t$release->save();\n \t\t\t\t}\n \t\t\t\twhile($xml->read()){ //Season episodes reading\n\t \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'episode'){ //Found new episode\n\t\t \t\t\t\t$episode = new Application_Model_Series();\n\t\t \t\t\t\t$episode->season_id = $season_id;\n\t\t \t\t\t\t$episode->series_id = $series_id;\n\t\t \t\t\t\t$episode->timestamp = time();\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'seasonnum');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'seasonnum'){\n\t\t\t\t \t\t\t$episode_num = $xml->readString();\n\t\t\t\t \t\t\t$episode->release = $series->name.' S'.$season_num.'E'.$episode_num;\n\t\t\t\t \t\t\t$episode->order = $season->order + ($episode_num*1); //According to format XXX.yyy for episodes\n\t\t\t \t\t\t}\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'airdate');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'airdate'){\n\t\t\t\t \t\t\t$date = new Frogg_Time_Time($xml->readString());\n \t\t\t\t\t\t\t$episode->airdate = $date->getUnixTstamp();\n\t\t\t \t\t\t}\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'title');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'title'){\n\t\t\t\t \t\t\t$episode->name = $xml->readString();\n\t\t\t \t\t\t}\n\t\t\t \t\t\t$episode_id = $episode->save();\n\t\t\t \t\t\t$release\t= new Application_Model_Release($episode_id,$episode->release,$episode->airdate);\n\t\t \t\t\t\t$release->save();\n\t\t \t\t\t\t$xml->next('episode');\n\t\t\t\t\t\t} else if($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'Season'){ //Found season finale\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n \t\t\t\t}//END - Season episodes reading\n \t\t\t}\n \t\t}\n \t\t$series_control->flag = Application_Model_NewSeries::READ;\n \t\t$series_control->update();\n\t\t\t$logger->ok('Great Success !!');\n \t\t$logger->close(); \t\t\n\t\t\tdie;\n\t }\n }",
"public function show(Serie $serie)\n {\n return redirect(route('browse.show_serie', compact('serie')));\n }",
"public function showIndex()\n\t{\n\n\t\t//var_dump(Parser::GetRazdely());\n\n\t\t//var_dump(Parser::getCarPost('prodam-mikroavtobus-26483298'));\n\n\t\t//var_dump(Parser::getPosts('realty/sell_flats', 5));\n\n\t\t//var_dump(Parser::getPosts('auto/sale', 5, 5));\n\n\t\tvar_dump(Parser::getPosts('free', 4, 1, 10));\n\t}",
"public function index()\n {\n $tvshows = Tv_show::orderBy('title', 'asc')->paginate(10);\n if(empty($tvshows)){abort(404);}\n return view('tvshow.index')->with('tvshows', $tvshows);\n }",
"function accouk_display_post_series() {\n\n $first_post_series = get_the_terms(get_the_id(), 'post-series')[0]; //Only displays one post series\n if(empty($first_post_series)) return;\n\n $link = get_category_link($first_post_series->term_id);\n $series = $first_post_series->name;\n $html = 'Part of the “<a href=\"' . $link . '\">' . $series . '</a>” post series';\n\n echo $html;\n}",
"public function index() {\n// $series_response = json_decode($apiobj->GetSeries());\n//\n// $series = object_get($series_response, 'Seasons');\n// $categories = object_get($series_response, 'Categories');\n//\n// return view('series', ['content' => $series,\n// 'content_pagetitle' => 'مسلسلات',\n// 'categories' => $categories]);\n return redirect()->to('relatedshows/30348/%D9%85%D8%B3%D9%84%D8%B3%D9%84%D8%A7%D8%AA');\n }",
"public function index()\n {\n // On vérifie que l'utilisateur est déjà connecté ou non au site\n if(!isset($_SESSION['id'])){\n return view('propre');\n //return view('inscription', ['message' => 'Vous devez d\\'abord vous connecter ou vous inscrire']);\n }\n $infoSeries = DB::table('series')->select('*')->orderBy('popularity', 'desc')->paginate(18);\n return view('home', ['infoSeries' => $infoSeries]);\n }",
"public function show($id)\n {\n session_start();\n $_SESSION['id_serie']=$id;\n\n $seasons = Seasons::where('serie_id',$id)->get();\n\n $serie = Series::find($id);\n\n $titulo = $serie->title;\n\n return view('admin.indexseason',compact('seasons','id','titulo'));\n\n }",
"public function show(Season $season)\n {\n //\n }",
"public function show(Season $season)\n {\n //\n }",
"public function test_list_series()\n {\n $this->withoutExceptionHandling();\n\n factory(Serie::class, 3)->create();\n\n $response = $this->get('api/v1/series',\n $this->authHeader($this->createSession())\n );\n\n $response\n ->assertStatus(200)\n ->assertJsonCount(3)\n ;\n }",
"public function show( Track $track )\n {\n //\n }",
"public function show(ProductSeries $productSeries)\n {\n $this->vars = array_add($this->vars, 'serial', $productSeries);\n\n return $this->renderOutput();\n }",
"function showPage() \n\t{\n\t\t$this->xt->display($this->templatefile);\n\t}",
"public function index($moviepage = 1)\n {\n \n $pages = json_decode(Popcorn::pages());\n \n if($moviepage > Count($pages))\n {\n echo 'not sure how to handle that';\n }\n else\n {\n $page = preg_replace('/[^0-9]/', '' , $moviepage);\n $pages = preg_replace('/[^0-9]/', '' , $pages);\n $movies = json_decode(Popcorn::movies($page));\n $settings = DB::table('settings')->get();\n $this->seo()->setTitle($settings[0]->name . ' - Movie & TV streaming platform for the masses');\n $this->seo()->setDescription($settings[0]->description);\n $this->seo()->opengraph()->setUrl($settings[0]->url);\n $this->seo()->opengraph()->addProperty('type', 'articles');\n $this->seo()->twitter()->setSite('@cine-stream');\n \n \n if($settings[0]->live == 1)\n {\n return view('default.home', ['settings' => $settings, 'movies' => $movies, 'page' => $pages]);\n }\n else\n {\n \n }\n }\n }",
"public function serieList()\n {\n $series = Serie::all();\n return view('serieList', ['series' => $series]);\n }",
"function emc_get_the_series() {\r\n\r\n\t$series = get_the_terms( get_the_ID(), 'emc_series' );\r\n\r\n\tif ( $series && ! is_wp_error( $series ) ) {\r\n\r\n\t\t$series = array_shift( $series );\r\n\t\t$html = sprintf( __( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a>', 'emc' ),\r\n\t\t\tesc_url( get_term_link( $series ) ),\r\n\t\t\tsprintf( __( 'View all posts in %s', 'emc' ), esc_attr( $series->name ) ),\r\n\t\t\tesc_html( $series->name )\r\n\t\t);\r\n\t\treturn $html;\r\n\r\n\t}\r\n\r\n\treturn false;\r\n\r\n}",
"public function index()\n {\n $data[\"page_id\"] = 1;\n $data[\"page_tag\"] = \"Articulos\";\n $data[\"page_title\"] = \"Articulos - Yo contribuyo\";\n $data[\"page_name\"] = \"articulos\";\n $data[\"nav_articulos\"] = \"active\";\n $data[\"script\"] = \"Articulo/articulos.js\";\n $this->getView(\"Articulo/articulos\", $data);\n }",
"public function showHomepage($params)\n {\n $manager = new EpisodeManager();\n $episodes = $manager->findAll();\n\n $myView = new View('homepage');\n $myView->render(array('episodes' => $episodes));\n }",
"public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }",
"public function showAction()\n {\n // Do not show pager when nothing to page.\n if ($this->pagerCollection->getItemCount() <= 0) {\n return '';\n }\n\n $pager = $this->pagerCollection->getPagerByIdentifier($this->pagerIdentifier);\n \n $this->view->assign('pagerCollection', $this->pagerCollection);\n $this->view->assign('pager', $pager);\n }",
"public function index(VideoRepository $video)\n {\n $sermons = Sermon::where('ministry', '=', null)->latest('published_at')->published()->get();\n\n foreach ($sermons as $sermon) {\n $video->setUrl($sermon->video);\n $sermon->image = $video->getThumbnail();\n }\n\n return view('dashboard.sermons.index', compact('sermons'));\n }",
"public function indexAction() {\n\t\t$this->view->title = \"Visualisations disponibles\";\n\t $this->view->headTitle($this->view->title, 'PREPEND');\n\t}",
"public function indexAction() {\n\t\t$this->view->title = \"Visualisations disponibles\";\n\t $this->view->headTitle($this->view->title, 'PREPEND');\n\t}",
"public function index()\n {\n $title = 'All Tracks';\n\n $tracks = $this->tracks->query()\n ->whereNotNull('trackable_id')\n ->latest()\n ->paginate(20);\n\n $index = 0;\n foreach ($tracks as $track) {\n $track->index = $index;\n $index++;\n }\n\n if (request()->wantsJson()) {\n return $tracks;\n }\n\n $description = 'Stream and Download All South African and International MP3 Songs. Download and Stream All Songs Free at NambaNamba.COM';\n $url = route('frontend.music.tracks.index');\n\n // SEO Tags\n SEOMeta::setTitle($title)\n ->setDescription($description)\n ->setCanonical($url);\n\n OpenGraph::setDescription($description)\n ->setTitle($title)\n ->setUrl($url)\n ->addProperty('type', 'music.albums');\n\n Twitter::setTitle($title)\n ->setSite('@NambaNamba_Downloads');\n\n return view('frontend.music.tracks.index', compact('title', 'tracks'));\n }",
"public function show()\n {\n $tvshow = Tv_show::where('slug', $slug)->first();\n if(empty($tvshow)){abort(404);}\n return view('tvshow.show')->with('tvshow', $tvshow);\n }",
"public function index($page = 1) {\n // $items = Magazine::all(false);\n $p = new Pager(new Magazine(), 4, false);\n if(!$pager_set = $p->feed($page)) abort(404);\n $pager = $pager_set['pager'];\n $items = $pager_set['result_set'];\n require_once ROOT . '/view/main/index.php';\n }",
"public function showMovies()\n {\n $context = $this->session->get('movie_data');\n $page = $this->getQueryParam(\n 'page'\n ); // if there is no session data or nobody tried to go to a different page, show existing data\n if (is_null($context) || !is_null($page) || !empty($page)) {\n return $this->getFilteredMovies();\n } else {\n $html = $this->render('index', array('context' => $context));\n $this->session->set('movie_data', null);\n\n return $html;\n }\n }",
"function Index($f3,$params) {\n $db_show = new DB\\SQL\\Mapper($f3->get('DB'), 'shows');\n // virtual fields for some additional metadata\n $db_show->episode_count = 'SELECT count(*) FROM episodes WHERE episodes.show_id = shows.show_id';\n $db_show->category_name = 'SELECT category_name FROM categories WHERE categories.category_id = shows.category_id';\n $db_show->category_group = 'SELECT category_group FROM categories WHERE categories.category_id = shows.category_id';\n\n // get data for display from the database\n $f3->set('shows', $db_show->find(\n array('active IS TRUE'), // filter\n array('order' => 'title') // sorting\n ));\n\n $this->RenderPage('show/index.htm', 'Shows', 'Show Directory');\n }",
"public function showAction() {\n $news = $this->newsRepository->findByUid($GLOBALS['TSFE']->id);\n $this->view->assign('news', $news)\n ->assign('settings', $this->settings);\n }",
"public function index()\n {\n return Serie::with([\n 'genre1',\n 'genre2',\n 'authors'\n ])\n ->public()\n ->paginate(RESULTS_PER_PAGE);\n }",
"function rss_simplepie_show_feed() {\r\n}",
"public function show() {\n\t\treturn view('page.telat',$this->page());\n\t}",
"public function index()\n {\n $datas = $this->_model->getTakes();\n $this->render('Take/index', ['datas' => $datas, 'title' => 'Page d\\'emprunt']);\n }",
"public function index()\n {\n $data = SlovenskoRss::orderBy('pubDate', 'ASC')->paginate(3);\n return view('reader.index',compact('data'));\n }",
"function mediaPage()\n{\n\n $search = isset($_GET['title']) ? $_GET['title'] : null;\n $medias = Media::showMedias(null, \"SELECT title,trailer_url,release_date,type,season_series FROM media GROUP BY title ORDER BY release_date DESC\");\n $AllType = Media::getTypeOfShow();\n require('view/mediaListView.php');\n}",
"public function index()\n {\n $tapes = Mixtape::where('published_at', '<=', Carbon::now())\n ->orderBy('published_at', 'desc')\n ->paginate(10);\n return view('mixtapes.index')->with('mixtapes', $tapes);\n }",
"public function index()\n {\n $tvShows = TvShow::all();\n return view(\"tvshows.index\", [\n \"tvShows\" => $tvShows\n ]);\n }",
"function show()\n\t{\n\n\t\t$prefs = array(\n\t\t\t\t'show_next_prev'\t=> TRUE,\n\t\t\t\t'next_prev_url'\t\t=> site_url(\"Calendar/show/\")\n\t\t\t);\n\n\t\t// Load Library Calendar dengan parameter tambahan.\n\t\t$this->load->library(\"calendar\", $prefs);\n\n\t\t$data[\"varkal\"] = $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));\n\n\t\t/*\n\t\t*\tsegment(3)\t=> tahun\n\t\t*\tsegment(4)\t=> bulan\n\t\t*/\n\n\t\t$data[\"judul\"] = \"Navigasi Kalender\";\n\n\t\t$this->load->view(\"kalender/calendar_view\", $data);\n\t}",
"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}",
"public function show($page)\n {\n header('Content-Type: image/png');\n echo $this->image[$page]->encode('png');\n\n }",
"public function index()\n {\n $title = 'Download All MP3 Tracks';\n\n $tracks = $this->tracks->query()\n ->whereNotNull('trackable_id')\n ->latest()\n ->paginate(20);\n\n $index = 0;\n foreach ($tracks as $track) {\n $track->index = $index;\n $index++;\n }\n // dd($tracks);\n\n if (request()->wantsJson()) {\n return $tracks;\n }\n\n $description = 'Download All South African, Nigerian and American MP3 Songs. Download and Stream All Songs Free at NambaNamba.COM';\n $url = route('frontend.music.tracks.index');\n\n // SEO Tags\n SEOMeta::setTitle($title)\n ->setDescription($description)\n ->setCanonical($url)\n ->addMeta('robots', 'noindex,follow');\n\n OpenGraph::setDescription($description)\n ->setTitle($title)\n ->setUrl($url)\n ->addProperty('type', 'music.albums');\n\n Twitter::setTitle($title)\n ->setSite('@NambaNamba_Downloads');\n\n return view('frontend.music.tracks.index', compact('title', 'tracks', 'description'));\n }",
"public function show(Driver $conductor)\n {\n //\n }",
"public function show(Tvrtka $tvrtka)\n {\n //\n }",
"public function show(ScrapeData $scrapeData)\n {\n //\n }",
"function seriesSlice($index = 0)\n{\n global $app, $globalSettings;\n\n // parameter checking\n if (!is_numeric($index)) {\n $app->getLog()->warn('seriesSlice: invalid series index ' . $index);\n $app->halt(400, \"Bad parameter\");\n }\n\n $search = $app->request()->get('search');\n if (isset($search)) {\n $app->getLog()->debug('seriesSlice: search ' . $search);\n $tl = $app->calibre->seriesSlice($index, $globalSettings[PAGE_SIZE], trim($search));\n } else {\n $tl = $app->calibre->seriesSlice($index, $globalSettings[PAGE_SIZE]);\n }\n $app->render('series.html', [\n 'page' => mkPage(getMessageString('series'), 5, 1),\n 'url' => 'serieslist',\n 'series' => $tl['entries'],\n 'curpage' => $tl['page'],\n 'pages' => $tl['pages'],\n 'search' => $search]);\n $app->getLog()->debug('seriesSlice ended');\n}",
"public function index()\n {\n Config::setJsConfig('curPage', 'suppliers-index');\n parent::displayIndex(get_class());\n }",
"public function show(Sermon $sermon, VideoRepository $video)\n {\n $video->setUrl($sermon->video);\n $texttrack = $video->getTextTracks(true);\n $sermon->iframe = $video->getEmbedCode(true);\n $coverimage = $video->getThumbnail();\n $sermon->plays = $video->getVideoPlays();\n\n return view('dashboard.sermons.show',\n compact('sermon', 'coverimage', 'texttrack', 'plays'))\n ->with('title', $sermon->title)\n ->with('ogdescription', $sermon->excerpt);\n }",
"public function showPortfolio() {\n Page::$title = 'Arthub - Portfolio';\n require(APP_NON_WEB_BASE_DIR . 'views/portfolio.php');\n }",
"public function myShowPage() {\n $request = $_REQUEST;\n $action = !empty($request['action']) ? $request['action'] : '';\n\n\n if (empty($this->pagedata)) {\n//\t\t\t$driver = $this->FreePBX->Config->get_conf_setting('ASTSIPDRIVER');\n\n $this->pagedata = array(\n \"general\" => array(\n \"name\" => _(\"General SCCP Settings\"),\n \"page\" => 'views/server.setting.php'\n ),\n \"sccpdevice\" => array(\n \"name\" => _(\"SCCP Device\"),\n \"page\" => 'views/server.device.php'\n ),\n \"sccpntp\" => array(\n \"name\" => _(\"SCCP Time\"),\n \"page\" => 'views/server.datetime.php'\n ),\n \"sccpcodec\" => array(\n \"name\" => _(\"SCCP Codec\"),\n \"page\" => 'views/server.codec.php'\n ),\n \"sccpadv\" => array(\n \"name\" => _(\"Advanced SCCP Settings\"),\n \"page\" => 'views/server.advanced.php'\n ),\n \"sccpinfo\" => array(\n \"name\" => _(\"SCCP info\"),\n \"page\" => 'views/server.info.php'\n ),\n );\n\n foreach ($this->pagedata as &$page) {\n ob_start();\n include($page['page']);\n $page['content'] = ob_get_contents();\n ob_end_clean();\n }\n }\n\n return $this->pagedata;\n }",
"public function indexAction()\n {\n View::renderTemplate('Tvshows/index.html');\n }",
"function series_episodes ($baseurl, $series_id) {\n $res = curl_http_get(\"{$baseurl}&action=get_series_info&series_id={$series_id}\");\n $episodes = [];\n if (isset($res['episodes'])) {\n foreach ($res['episodes'] as $season) {\n foreach ($season as $episode) {\n $episodes[] = $episode;\n }\n }\n }\n return $episodes;\n}",
"function index() {\r\n $this->page();\r\n }",
"public function index()\n {\n Sitemap::addTag(route('pages.about'));\n\n $this->getPosts();\n $this->getProjects();\n $this->getSeries();\n\n return Sitemap::renderSitemap();\n }",
"public function index()\n {\n $amount = $this->titularRepository->all()->count();\n $titulars = $this->titularRepository->paginate(20);\n\n return view('titular.index', compact('titulars', 'amount'));\n }",
"function display() {\r\n\t\tJRequest::setVar('view', 'charts');\r\n\t\tJRequest::setVar('layout', 'charts');\r\n\t\tparent::display();\t\r\n }",
"public function index()\n {\n $this->show();\n }",
"public function show(Serologia $serologia)\n {\n //\n }",
"public function show(Page $page)\n {\n\n }",
"function seriesDetailsSlice($id, $index = 0)\n{\n global $app, $globalSettings;\n\n // parameter checking\n if (!is_numeric($id) || !is_numeric($index)) {\n $app->getLog()->warn('seriesDetailsSlice: invalid series id ' . $id . ' or page id ' . $index);\n $app->halt(400, \"Bad parameter\");\n }\n\n $filter = getFilter();\n $tl = $app->calibre->seriesDetailsSlice($globalSettings['lang'], $id, $index, $globalSettings[PAGE_SIZE], $filter);\n if (is_null($tl)) {\n $app->getLog()->debug('seriesDetailsSlice: no series ' . $id);\n $app->notFound();\n }\n $books = array_map('checkThumbnail', $tl['entries']);\n $app->render('series_detail.html', [\n 'page' => mkPage(getMessageString('series_details'), 5, 2),\n 'url' => 'series/' . $id,\n 'series' => $tl['series'],\n 'books' => $books,\n 'curpage' => $tl['page'],\n 'pages' => $tl['pages']]);\n}",
"public function show(MJasa $mJasa)\n {\n //\n }",
"public function show(Page $page)\n {\n //\n }",
"public function show(Page $page)\n {\n //\n }",
"public function show(Page $page)\n {\n //\n }",
"public function show()\n {\n $articles = $this->getArticles();\n $selectedTitle=$_GET['title'];\n\n foreach ($articles as $article)\n if ($selectedTitle== $article->title){\n $articleDescription = $article->description;\n } \n\n require 'View/articles/show.php';\n\n }",
"public function show(Drivers $drivers)\n {\n //\n }",
"public function indexAction() {\r\n\r\n\t\tOpenContext_SocialTracking::update_referring_link('space_index', $this->_request->getRequestUri(), @$_SERVER['HTTP_USER_AGENT'], @$_SERVER['HTTP_REFERER']);\r\n\t\t$requestParams = $this->_request->getParams();\r\n\t\tif(isset($requestParams['page'])){\r\n\t\t $page = $requestParams['page'];\r\n\t\t}\r\n\t\telse{\r\n\t\t $page = 1;\r\n\t\t}\r\n\t\t\r\n\t\t$host = OpenContext_OCConfig::get_host_config();\r\n\t\t\r\n\t\t$archiveFeed = new ArchiveFeed;\r\n\t\t$archiveFeed->set_up_feed_page($page, \"spatial\");\r\n\t\t$archiveFeed->getItemList();\r\n\t\t$this->view->archive = $archiveFeed;\r\n\t}",
"public function show()\n {\n /** Configure generic views */\n $this->setupViews();\n /** Render views */\n ?>\n <html>\n <body>\n <?php\n /** Render views */\n $this->head_view->render();\n $this->secondary_nav_bar->render();\n $this->tree_view->render();\n $this->title_view->render();\n $this->primary_nav_bar->render();\n $this->render_page();\n ?>\n </body>\n </html>\n <?php\n }",
"public function index()\n {\n $shows = Show::orderBy(Config::get('constants.fields.IdField'),'DESC')->paginate(5);\n \n if(empty($shows)){\n\n return view('shows.show') \n -> with('shows', $shows);\n }\n \n return view('shows.show')\n -> with('shows', $shows);\n }",
"public function show(sections $sections)\n {\n //\n }",
"public function show(finance $finance)\n {\n //\n }",
"public function index()\n\t{\n parent::show();\n\t\t//\n\t}",
"public function show_settings_page() : void {\n\t\t\t$categories = self::get_categories();\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'support/help',\n\t\t\t\tarray(\n\t\t\t\t\t'categories' => $categories,\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}",
"public function index()\n {\n $aporTasa = AporTasa::orderBy('id', 'desc')->firstOrFail();\n\n $date = Carbon::now();\n\n $data = array(\n 'date' => $date->format('m-Y'),\n 'aporTasa' => $aporTasa\n\n );\n\n return view('tasas.index', $data);\n }",
"public function getIndex()\n\t{\n\t\t$teasers = Teaser::orderBy('id', 'DESC')->paginate(10); \n\n\t\treturn View::make('teaser.getIndex')->withTeasers($teasers);\n\t}",
"public function moviesAndSeriesByGenre() {\n $model = $this->model;\n $request = $this->request;\n $genre = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_genre_{$this->request->genre}\",\n function() use($model, $request) {\n return $model->getByGenre($request->genre);\n }\n );\n\n if (count($genre[\"movie\"]) + count($genre[\"serie\"]) > 0) {\n $this->view->addParameter(\"movies\", $genre[\"movie\"]);\n $this->view->addParameter(\"series\", $genre[\"serie\"]);\n } else {\n $this->view->addParameter(\"error\", \"Nothing found :/\");\n }\n }",
"public function show_slider_detail()\n\t{\n\t\t$sql=\"select * from slider\";\n\t\t$result=$this->db->query($sql);\n\t\twhile($data=$result->fetch_array())\n\t\t{\n\t\t\techo \"<li><h3>$data[title]</h3><p>$data[description]</p></li>\";\n\t\t}\n\t}",
"function showListing ($listType,$sort,$alevel){\n\t\tif($alevel == 0){$aonly = \"AND aonly='0'\";}\n\t\telse if ($alevel == 3){$aonly = \"AND aonly<='1'\";}\n\t\telse{$aonly = '';}\n\t\tif($sort == NULL)\n\t\t{\n\t\t\t$sql = \"SELECT UPPER(SUBSTRING(seriesName,1,1)) AS letter, id, fullSeriesName FROM series WHERE seriesList='$listType' \".$aonly.\"ORDER BY fullSeriesName\";\n\t\t}\n\t\telse {\n\t\t\t$sql = \"SELECT UPPER(SUBSTRING(seriesName,1,1)) AS letter, id, fullSeriesName FROM series WHERE seriesList='$listType' \".$aonly.\"AND category LIKE '%\".mysqli_real_escape_string($conn, $sort).\"%' ORDER BY seriesName\";\n\t\t}\n\t\t$query = mysqli_query ($sql) or die (mysqli_error());\n\t\t$total_rows = mysqli_num_rows($query) or die(\"Error: \". mysqli_error(). \" with query \". $query);\n\t\twhile ($records = @mysqli_fetch_array ($query)) {\n\t\t\t$alpha[$records['letter']] += 1;\n\t\t\t${$records['letter']}[$records['id']] = $records['fullSeriesName'];\n\t\t}\n\t\techo '<div align=\"center\">';\n\t\tforeach(range('A','Z') as $i) {\n\t\t\techo (array_key_exists (\"$i\", $alpha)) ? '<a href=\"#'.$i.'\" title=\"'.$alpha[\"$i\"].' results\">'.$i.'</a>' : \"$i\";\n\t\t\techo ($i != 'Z') ? ' | ':'';\n\t\t}\n\t\techo '</div><br />';\n\t\t// Create Data Listing\n\t\t$countup = 1;\n\t\t$columncount = 1; \n\t\t$col = 2;\n\t\techo \"<div id=\\\"col1\\\">\\n\";\n\t\tfloor($total_rows/3);\n\t\tforeach(range('A','Z') as $i) {\n\t\t\tif (array_key_exists (\"$i\", $alpha)) {\n\t\t\t\techo '\t\t<a name=\"'.$i.'\"></a><h2>'.$i.\"</h2>\\n\";\n\t\t\t\tforeach ($$i as $key=>$value) {\n\t\t\t\t\techo \"\t\t<div>\".checkSeriesWIconsV2($key).\"</div>\\n\";\n\t\t\t\t\t$countup++;\n\t\t\t\t\tif($countup == (floor($total_rows/3)) || $countup == (floor(($total_rows/3)*2)) || $countup == (floor(($total_rows/3)*3)) || $countup == floor(($total_rows/3)*4))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($columncount == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\techo \"\t\t\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\techo \"\t\t</div>\\n\";\n\t\t\t\t\t\t\tif($columncount == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo \"\t\t<div id=\\\"col2outer\\\">\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo \"\t\t<div id=\\\"col$col\\\">\\n\";\n\t\t\t\t\t\t\t$columncount++;\n\t\t\t\t\t\t\t$col++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo \"\t\t<br />\\n\";\n\t\t\t}\n\t\t}\n\t\techo '</div></div></div>';\n\t}",
"public function show(Tank $tank)\n {\n //\n }",
"public function filter_posts_by_series() {\n\t\tglobal $typenow, $wp_query;\n\n\t\tif ( $typenow != 'post' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t$current_series = isset( $_REQUEST['post_series'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['post_series'] ) ) : '';\n\t\t$post_series_terms = get_terms(\n\t\t\t'post_series',\n\t\t\tarray(\n\t\t\t\t'hide_empty' => true,\n\t\t\t\t'orderby' => 'name',\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $post_series_terms ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<select name=\"post_series\">\n\t\t\t<option value=\"\"><?php esc_html_e( 'Show all series', 'wp-post-series' ); ?></option>\n\t\t\t<?php foreach ( $post_series_terms as $series ) : ?>\n\t\t\t\t<option value=\"<?php echo esc_attr( $series->slug ); ?>\" <?php selected( $current_series, $series->slug ); ?>><?php echo esc_html( $series->name ); ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select>\n\t\t<?php\n\t}",
"function getEpisode() {\n \n global $f3;\n global $tvdb;\n\n $series = $f3->get('PARAMS.param1');\n $episode_index = $f3->get('PARAMS.param2');\n $data = $tvdb->getSeries($series);\n\n $chunks = explode(\",\", $episode_index);\n $season = $chunks[0]; //\techo \"Season \" . $season;\n $ep = $chunks[1]; //\t\techo \"Ep\" . $ep;\n\n $episode = $tvdb->getEpisode($data[0]->id, $season, $ep, 'en');\n\n echo json_encode($episode);\n }"
] | [
"0.68016213",
"0.67161155",
"0.670912",
"0.65621823",
"0.64823246",
"0.64804983",
"0.6376649",
"0.6353893",
"0.60920006",
"0.6072526",
"0.60561466",
"0.60531056",
"0.59571636",
"0.583245",
"0.5817992",
"0.5738484",
"0.57279515",
"0.56740916",
"0.56675434",
"0.5604933",
"0.55481863",
"0.5524228",
"0.5522784",
"0.5496872",
"0.54898876",
"0.5474346",
"0.5466312",
"0.54527617",
"0.54527617",
"0.5448655",
"0.5423444",
"0.54230213",
"0.5422117",
"0.54126817",
"0.5384138",
"0.53564656",
"0.5318843",
"0.5313193",
"0.5311922",
"0.5308699",
"0.53082234",
"0.52968043",
"0.52968043",
"0.5291877",
"0.52907395",
"0.529036",
"0.52884495",
"0.52861565",
"0.527294",
"0.5272751",
"0.52716494",
"0.5269055",
"0.5266098",
"0.5261608",
"0.5243378",
"0.5236961",
"0.5218934",
"0.52172214",
"0.5216248",
"0.5180111",
"0.5178858",
"0.5176927",
"0.516163",
"0.5156485",
"0.51288795",
"0.5128609",
"0.51285744",
"0.5126452",
"0.51195383",
"0.51148945",
"0.5113812",
"0.5111163",
"0.51090366",
"0.5105279",
"0.5104211",
"0.509487",
"0.50920475",
"0.50855446",
"0.5080614",
"0.5078333",
"0.50775695",
"0.50775695",
"0.50775695",
"0.50726414",
"0.5060651",
"0.5060218",
"0.5057603",
"0.505721",
"0.50552845",
"0.5055116",
"0.5051831",
"0.504566",
"0.5045314",
"0.5042776",
"0.5039881",
"0.50370204",
"0.502992",
"0.50258595",
"0.5024356",
"0.5023261"
] | 0.6659827 | 3 |
Save new torrent in BD. | public function store(TorrentRequest $request)
{
$this->createTorrent($request);
flash('Votre torrent a été ajouté');
return redirect('torrents');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `tours` values('\".addslashes($this->id).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->duration).\"' , '\".addslashes($this->description).\"' , '\".addslashes($this->tcid).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }",
"public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }",
"public abstract function save();",
"public function saveToDB()\n {\n }",
"public function saveToDb()\n\t{\n\t\tparent::saveToDb();\n\t\t$this->insertAttachment();\n\t}",
"public function save() {\n\t\t\t\n\t\t}",
"public function save()\n {\n try {\n $name = $this->getName();\n $age = $this->getAge();\n if (!$this->getDriverId()) {\n $this->_pdo->query(\"INSERT INTO driver (name, age) VALUES ('$name', '$age')\");\n } else {\n $this->_pdo->query(\n \"UPDATE drive SET name = '$name', age = '$age'\" .\n \" WHERE driver_id = \" . $this->getDriverId()\n );\n }\n } catch (PDOException $e) {\n echo \"Error: \" . $e;\n }\n }",
"public function store(Request $request)\n {\n //при закачивании торрента\n $torrent = new torrent();\n //записываем файл в переменную\n $file=$request->file('torrent');\n\n //------------нужна проверка во избежании дублирующих файлов в хранилище!!!------------\n $valid=Validator::make($file->getPathname(),$torrent::$double);\n\n //Если файл существует и прошёл валидацию, то закидываем его в хранилище\n if($file && $valid->passes()) {\n //закидываем на жёский диск файл\n Storage::disk('local')->put($file->getPathname(),File::get($file));\n\n //закидываем имя файла и дату закачки в модель torrent\n $torrent->torrent = $file->getPathname();\n //дата есть в updated_at\n $torrent->save();\n } else {\n //Показать что такой файл уже существует в вёрстке\n }\n }",
"public final function save() {\n }",
"public function save () {\n // Atualiza\n // @ verifico se o atributo \"idturma\" existe neste objeto.\n // lembrando que este atributo é apagado se criamos uma nova turma.\n if ( isset($this->idturma) ) {\n $this->db->update('turmas', $this, array('idturma' => $this->idturma));\n }\n // Salva\n else {\n $this->db->insert('turmas', $this);\n }\n }",
"function save() {\n \n\t if ($this->id == NULL) {\n\t \t\n\t\t mysql_query(\"INSERT INTO `videothumbs` ( `videoid`, `url`) VALUES ( '\".$this->videoid.\"', '\".$this->url.\"');\") or die(\"Query failed with error: \".mysql_error());\n\t\t $this->id = mysql_insert_id();\n\t \n\t } else {\n\t\t\t\t\n\t\t mysql_query(\"UPDATE `videothumbs` SET `videoid` = '\".$this->videoid.\"', `url` = '\".$this->url.\"' WHERE `id` = \".$this->id.\";\") or die(\"Query failed with error: \".mysql_error());\n\t }\n\t \n }",
"public function save()\r\n {\r\n \r\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"function save() {\n \tfile_put_contents(\"threads/{$this->id}\", serialize($this));\n }",
"public function testSaveWithNoAnnounce() {\n $target = tempnam(sys_get_temp_dir(), 'PHP\\BitTorrent');\n $this->torrent->save($target);\n }",
"public function save()\n {\n }",
"public final function save()\n {\n }",
"public function save():void;",
"public function save()\n {\n // For V2.0\n }",
"public function save() {\n }",
"public function save() {\n }",
"public function save()\n\t{\n\n\t}",
"public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}",
"public function save()\r\n {\r\n //\r\n }",
"public function save() {\n }",
"public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }",
"function plugin_tb_save($url, $tb_id)\n{\n\tglobal $vars, $trackback;\n\tstatic $fields = array( /* UTIME, */ 'url', 'title', 'excerpt', 'blog_name');\n\n\t$die = '';\n\tif (! $trackback) $die .= 'TrackBack feature disabled. ';\n\tif ($url == '') $die .= 'URL parameter is not set. ';\n\tif ($tb_id == '') $die .= 'TrackBack Ping ID is not set. ';\n\tif ($die != '') return array(PLUGIN_TB_ERROR, $die);\n\n\tif (! file_exists(TRACKBACK_DIR)) return array(PLUGIN_TB_ERROR, 'No such directory: TRACKBACK_DIR');\n\tif (! is_writable(TRACKBACK_DIR)) return array(PLUGIN_TB_ERROR, 'Permission denied: TRACKBACK_DIR');\n\n\t$page = tb_id2page($tb_id);\n\tif ($page === FALSE) return array(PLUGIN_TB_ERROR, 'TrackBack ID is invalid.');\n\n\t// URL validation (maybe worse of processing time limit)\n\t$result = http_request($url, 'HEAD');\n\tif ($result['rc'] !== 200) return array(PLUGIN_TB_ERROR, 'URL is fictitious.');\n\n\t// Update TrackBack Ping data\n\t$filename = tb_get_filename($page);\n\t$data = tb_get($filename);\n\n\t$items = array(UTIME);\n\tforeach ($fields as $key) {\n\t\t$value = isset($vars[$key]) ? $vars[$key] : '';\n\t\tif (preg_match('/[,\"' . \"\\n\\r\" . ']/', $value))\n\t\t\t$value = '\"' . str_replace('\"', '\"\"', $value) . '\"';\n\t\t$items[$key] = $value;\n\t}\n\t$data[rawurldecode($items['url'])] = $items;\n\n\t$fp = fopen($filename, 'w');\n\tset_file_buffer($fp, 0);\n\tflock($fp, LOCK_EX);\n\trewind($fp);\n\tforeach ($data as $line) {\n\t\t$line = preg_replace('/[\\r\\n]/s', '', $line); // One line, one ping\n\t\tfwrite($fp, join(',', $line) . \"\\n\");\n\t}\n\tflock($fp, LOCK_UN);\n\tfclose($fp);\n\n\treturn array(PLUGIN_TB_NOERROR, '');\n}",
"private function PostSaver(){\n if ($this->updateMode){\n $post = Post::find($this->postId);\n } else {\n $post = new Post();\n }\n $post->user_id = Auth::user()->id;\n $post->title = $this->title;\n $post->category_id = (int)$this->categories;\n $post->caption = $this->caption;\n $post->url = $this->imagePath;\n $post->save();\n $post->Tag()->sync($this->tags);\n }",
"public function save_to_db() {\r\n if ($this->id) {\r\n $stmt = $this->pdo->prepare(\"UPDATE contract SET\r\n companyName=:companyName,\r\n Signature=:Signature\r\n WHERE id=:identity\r\n \");\r\n $input_parameters = array(\r\n ':identity' => $this->id,\r\n ':companyName' => $this->companyName,\r\n ':sygnatura' => $this->signature,\r\n );\r\n $upload = $stmt->execute(\r\n $input_parameters\r\n );\r\n }\r\n//po��czenie z baz� i sprawdzenie czy ju� jest taka umowa\r\n else {\r\n $stmt = $this->pdo->prepare(\"SELECT * FROM contract WHERE Signature=:signature\");\r\n $stmt->bindParam(':signature', $this->signature, PDO::PARAM_STR);\r\n\r\n if ($stmt->rowCount() > 0)\r\n return self::SAVE_ERROR_DUPLICATE_SIGNATURE;\r\n $stmt = $this->pdo->prepare(\"INSERT INTO contract VALUES (NULL, :companyName, :signature,NULL, NULL )\");\r\n $upload = $stmt->execute(\r\n array(\r\n ':signature' => $this->signature,\r\n ':companyName' => $this->companyName\r\n )\r\n );\r\n }\r\n// komunikat o zapisie\r\n if ($upload)\r\n return self::SAVE_OK;\r\n else\r\n return self::SAVE_ERROR_DB;\r\n }",
"public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }",
"public function save()\n {\n }",
"public function save()\n {\n }",
"protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}",
"public function save()\n {\n $this->persist($this->state);\n }",
"public function save()\n {\n //\n }",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"function save();",
"function save();",
"function saveFile($torrentFile, $torrentLink) {\n\techo 'downloading torrent' . PHP_EOL;\n\t$torrentPath = TORRENT_DIRECTORY . DIRECTORY_SEPARATOR . $torrentFile;\n\t\n\tif ( !file_exists($torrentPath) ) {\n\t\t$torrentFileContents = file_get_contents($torrentLink);\n\t\t\n\t\tif ( !empty($torrentFileContents) ) {\n\t\t\tfile_put_contents($torrentPath, $torrentFileContents);\n\t\t}\n\t\telse {\n\t\t\techo 'empty contents for ' . $torrentLink . PHP_EOL;\n\t\t}\n\t}\n\telse {\n\t\techo 'file exists' . PHP_EOL;\n\t}\n}",
"public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function save(){\n }",
"public function saveTo(string $path);",
"public function save() {\n\n }",
"public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}",
"function salva()\n\t{\n\t\trestauraConObj($this->mapa,$this->postgis_mapa);\n\t\t$this->mapa->save($this->arquivo);\n\t}",
"function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }",
"public function save()\n {\n $data = $this->read_file();\n\n if (( ! $data))\n {\n $data = array();\n }\n\n $data[$this->id] = array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'firstname' => $this->firstname,\n 'lastname' => $this->lastname,\n 'password' => $this->password,\n 'token' => $this->token,\n 'logins' => $this->logins,\n );\n\n $this->write_file($data);\n }",
"public function saveData()\r\n {\r\n \r\n }",
"public function save()\n {\n if(!$this->canSave())\n return false;\n\n try\n {\n if ($this->id == null) //new object\n {\n $stmt = $this->connection->prepare(\"insert into \" . self::$table_name . \"(ticketID, filename) values(?, ?)\");\n $stmt->execute([$this->ticket->id, $this->filename]);\n $this->id = $this->connection->lastInsertId();\n }\n else //updating is not possible\n {\n return false;\n }\n\n return true;\n }\n catch (\\PDOException $e)\n {\n print_r($e->errorInfo);\n return false;\n }\n }",
"public function save()\n \t{\n \t $this->getMapper()->save($this);\n \t}",
"function saveVister()\n {\n \n }",
"public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }",
"public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}",
"public function save($path);",
"public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\n\t\t$this->db->query('UPDATE `'.$table_prefix.'indicator_lang` SET indicator_title = ?, indicator_description = ? WHERE indicator_id = ? AND locale = ?',\n\t\t\t$this->indicator_title, $this->indicator_description, $this->id, $this->locale\n\t\t);\n\t}",
"function save()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$post\t= JRequest::get('post');\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\t$post['id'] = (int) $cid[0];\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_( 'Weblink Saved' );\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Weblink' );\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\t\t$link = 'index.php?option=com_weblinks';\n\t\t$this->setRedirect($link, $msg);\n\t}",
"public function save () {\n\t\t\t$insert = $this->db->prepare(\"INSERT INTO HISTORIC(nameFile, idArt) \n\t\t\t\tVALUES (?, ?)\");\n\t\t\treturn $insert->execute(array($this->nameFile, $this->idArt));\n\t\t}",
"public function save()\n {\n $db = DatabaseUtil::db_connect($this->database);\n $db->query('update ' . $this->table . 'set ' . $this->column . ' = ' . $this->value . ' where ID=' . $this->ID);\n $db->close();\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function persist();",
"public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }",
"public function store()\n\t{ \n $nextId = OrdenEsM::nextId();\n $input = Input::all();\n $ordenD = new OrdenEsD();\n $ordenD->upc = $input['upc'];\n $ordenD->epc = $input['epc'];\n $ordenD->quantity = $input['quantity'];\n $ordenD->created_at = $input['created_at'];\n $ordenD->updated_at = $input['updated_at'];\n $ordenD->orden_es_m_id = $nextId;\n $ordenD->save();\n\t}",
"public function save()\n\t{\n\t\t//creat and fill Media object\n\t\t$footer = $this->cloneFooter();\n\t\t\n\t\t$pdo = Base::getConnection();\n\t\t$pdo->exec('TRUNCATE TABLE footer');\n\n\t\tBase::insert($footer, \"footer\");\n\t}",
"protected function saving() {\n // This will get reimplemented by children when necessary\n }",
"public function save(){\r\n $db = new Database();\r\n $sql = \"\";\r\n $stm = null;\r\n if (empty($this->id)){\r\n $sql = \"insert into interests (name) values (:name)\";\r\n $stm = $db->pdo->prepare($sql);\r\n }\r\n else{\r\n $sql = \"update interests set name=:name where id=:id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':id', $this->id);\r\n }\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n }",
"function insertIntoTrack($URL, $album, $artist, $track, $featuring) {\n scraperwiki::save_sqlite(array(\"UniqURL\"), array(\"UniqURL\"=>$URL, \"Album\"=>$album, \"Artist\"=>$artist, \"Track\"=>$track, \"Featuring\"=>$featuring), $table_name=\"Track\");\n}",
"function insertIntoTrack($URL, $album, $artist, $track, $featuring) {\n scraperwiki::save_sqlite(array(\"UniqURL\"), array(\"UniqURL\"=>$URL, \"Album\"=>$album, \"Artist\"=>$artist, \"Track\"=>$track, \"Featuring\"=>$featuring), $table_name=\"Track\");\n}",
"public function save()\r\n\t{\r\n\t\t// save the parent object and thus the status table\r\n\t\tparent::save();\r\n\t\t// grab the newly inserted status ID\r\n\t\t$id = $this->getID();\r\n\t\t// insert into the link status table, using the same ID\r\n\t\t$extended = array();\r\n\t\t$extended['id'] = $id;\r\n\t\t$extended['URL'] = $this->url;\r\n\t\t$extended['description'] = $this->description;\r\n\t\t$this->registry->getObject('db')->insertRecords( 'statuses_links', $extended );\r\n\t}",
"public function save()\n {\n file_put_contents(\"address.json\", json_encode($this->content));\n }",
"public function saved(Chapter $chapter)\n {\n //\n }",
"function save() {\n if ($this->nid && $this->license_uri) {\n $data = serialize($this);\n $data = str_replace(\"'\", \"\\'\", $data);\n $result = db_query(\"INSERT INTO {creativecommons} (nid, data) VALUES (%d, '%s')\", $this->nid, $data);\n return $result;\n }\n return;\n }"
] | [
"0.64194536",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.6206342",
"0.6206342",
"0.6205829",
"0.61354375",
"0.61354375",
"0.61354375",
"0.61354375",
"0.61354375",
"0.61284184",
"0.61165756",
"0.6100475",
"0.60937005",
"0.6086383",
"0.60341746",
"0.6020486",
"0.6014567",
"0.60006034",
"0.5997206",
"0.5990312",
"0.59740084",
"0.5953469",
"0.5953438",
"0.5924466",
"0.58948076",
"0.5890343",
"0.58823377",
"0.588026",
"0.586954",
"0.5790943",
"0.5790943",
"0.57858276",
"0.57386756",
"0.57295614",
"0.5725081",
"0.57065624",
"0.5696211",
"0.5647402",
"0.5633559",
"0.55994666",
"0.5585556",
"0.5585556",
"0.557059",
"0.5570503",
"0.5568036",
"0.55663204",
"0.55613977",
"0.55613977",
"0.555736",
"0.55454063",
"0.55217475",
"0.5507879",
"0.55009717",
"0.5489566",
"0.54842806",
"0.54835606",
"0.54444444",
"0.54401284",
"0.54343325",
"0.5430472",
"0.54274327",
"0.5425733",
"0.54209876",
"0.5420077",
"0.54170424",
"0.54019284",
"0.5396854",
"0.53913325",
"0.5389195",
"0.538494",
"0.5381982",
"0.53814524",
"0.5380994",
"0.53701156",
"0.53668857",
"0.5366807",
"0.5360529",
"0.5360529",
"0.53504354",
"0.5347079",
"0.5330884",
"0.53305113"
] | 0.6107702 | 29 |
Sync up the list of tags in the database. | private function syncTags(Movie $movie, array $tags)
{
$movie->tags()->sync($tags);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pico_sync_tags($mydirname)\n{\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\t// get all tags in tags table\n\t$all_tags_array = [];\n\t$result = $db->query('SELECT label FROM ' . $db->prefix($mydirname . '_tags'));\n\twhile (list($label) = $db->fetchRow($result)) {\n\t\t$all_tags_array[$label] = [];\n\t}\n\n\t// count tags from contents table\n\t$result = $db->query('SELECT content_id,tags FROM ' . $db->prefix($mydirname . '_contents'));\n\twhile (list($content_id, $tags) = $db->fetchRow($result)) {\n\t\tforeach (explode(' ', $tags) as $tag) {\n\t\t\tif ('' == trim($tag)) {\n continue;\n }\n\t\t\t$all_tags_array[$tag][] = $content_id;\n\t\t}\n\t}\n\n\t// delete/insert or update tags table\n\tforeach( $all_tags_array as $tag => $content_ids ) {\n\t\t$label4sql = $db->quoteString( $tag ) ;\n\t\t$content_ids4sql = implode( ',' , $content_ids ) ;\n\t\t$count = sizeof( $content_ids ) ;\n\t\t$result = $db->queryF( \"INSERT INTO \".$db->prefix($mydirname.\"_tags\" ).\" SET label=$label4sql,weight=0,count='$count',content_ids='$content_ids4sql',created_time=UNIX_TIMESTAMP(),modified_time=UNIX_TIMESTAMP()\" ) ;\n\t\tif( ! $result ) {\n\t\t\t$db->queryF( \"UPDATE \".$db->prefix($mydirname.\"_tags\" ).\" SET count=$count,content_ids='$content_ids4sql',modified_time=UNIX_TIMESTAMP() WHERE label=$label4sql\" ) ;\n\t\t}\n\t}\n\n\treturn true;\n}",
"public function run()\n\t{\n\t\t$tag = App\\Models\\Tag::first();\n\t\t$link = App\\Models\\Link::first();\n\n\t\t$link->tags()->sync( [ $tag->id ] );\n\t}",
"public function run()\n {\n Post::find(1)->tags()->attach([3,4]);\n Post::find(2)->tags()->attach([1,2]);\n Post::find(3)->tags()->attach(1);\n Post::find(4)->tags()->attach(2);\n Post::find(5)->tags()->attach(1);\n }",
"public function run()\n {\n $SQL_FILES = [\n 'resources/developer_docs/tags.sql',\n 'resources/developer_docs/photo_tag.sql'\n ];\n \n Eloquent::unguard();\n for ($i=0; $i < count($SQL_FILES); $i++) { \n DB::unprepared(file_get_contents($SQL_FILES[$i]));\n }\n $this->command->info('tags data seeded!');\n }",
"public function run()\n {\n $tags = ['cronaca', 'cronaca nera', 'mafie', 'mondi', 'ambiente & veleni'];\n\n foreach ($tags as $tag) {\n $tagDB = new Tag();\n $tagDB->tag_name = $tag;\n $tagDB->save();\n }\n }",
"private function insertTags($taglist) {\n $query = \"INSERT INTO tag (tag) VALUES #values#\";\n $this->db->listInsert($query, $taglist);\n\n //ugly, but thing based on last insert id wouldn't work\n //see: http://stackoverflow.com/questions/3677557/is-bulk-insert-atomic\n $new_tags = $this->tagIdsByTaglist($taglist); \n\n return $new_tags;\n }",
"public function salvaTags(){\r\n require_once \"classes/conexao.class.php\";\r\n $conexao = new Conexao();\r\n $tags = $this->tags;\r\n\r\n for($i = 0; $i < count($tags); $i++){\r\n $query = \"INSERT INTO tags VALUES(\".$this->codigo.\", '\".$tags[$i].\"');\";\r\n $conexao->executaComando($query) or die(\"É, parece que deu erro na inserção da tag \".$tags[$i].\" na pergunta \".$this->numPergunta.\"...<br><br>\".$query);\r\n }\r\n \r\n }",
"public function save_tag_list($tags)\n\t{\n\t\t$tags = explode(',', $tags);\n\n\t\t$tag_ids = $this->_get_tags_ids_array();\n\n\t\tforeach($tags as $tag)\n\t\t{\n\t\t\t// New tag ? Add it !\n\t\t\tif( FALSE == preg_match( '/^\\d*$/' , $tag))\n\t\t\t{\n\t\t\t\tif (strlen($tag) > self::$_MAX_TAG_LENGTH)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$id_tag = $this->save($tag);\n\n\t\t\t\tif ( in_array($id_tag, $tag_ids))\n\t\t\t\t\t$tag_ids = array_diff($tag_ids, array($id_tag));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Keep existing tags : Remove them from $tag_ids array;\n\t\t\t\tif ( in_array($tag, $tag_ids))\n\t\t\t\t\t$tag_ids = array_diff($tag_ids, array($tag));\n\t\t\t}\n\t\t}\n\n\t\t// Delete remaining ids : they are not in saved list anymore\n\t\tif ( ! empty($tag_ids))\n\t\t{\n\t\t\t$this->{$this->db_group}->where_in('id_tag', $tag_ids);\n\t\t\t$this->{$this->db_group}->delete($this->get_table());\n\t\t}\n\t}",
"public function run()\n\t{\n\t\t$tagDescriptions = ['Tag 01','Tag 02','Tag 03','Tag 04','Tag 05','Tag 06','Tag 07'];\n\n\t\tforeach( $tagDescriptions as $tagDescription )\n\t\t{\n\t\t\t$uuid = ListAppController::getUUID( 'tags', 'tagid' );\n\t\t\t$tag = new \\ListApp\\Tag();\n\t\t\t$tag->tagid = $uuid;\n\t\t\t$tag->description = $tagDescription;\n\t\t\t$tag->save();\n\t\t}\n\t}",
"public function run()\n {\n\n $tags = [\n [\n 'name' => 'capacitacion',\n ],\n [\n 'name' => 'workshop',\n ],\n [\n 'name' => 'cumpleaños',\n ],\n [\n 'name' => 'empresa',\n ],\n [\n 'name' => 'aniversario',\n ],\n [\n 'name' => 'despedida',\n ],\n [\n 'name' => 'almuerzo',\n ],\n [\n 'name' => 'cena',\n ],\n [\n 'name' => 'fin de año',\n ]\n ];\n\n DB::table('tags')->insert($tags);\n }",
"public function run()\n {\n DB::table('tags')->insert([\n ['post_id'=>'1', 'tag'=> 'PHP'],\n ['post_id'=>'1', 'tag'=> 'JS'],\n ['post_id'=>'2', 'tag'=> 'C'],\n ['post_id'=>'2', 'tag'=> 'C++'],\n ['post_id'=>'1', 'tag'=> 'C++'],\n ['post_id'=>'3', 'tag'=> 'JAVA'],\n ['post_id'=>'2', 'tag'=> 'C#'],\n ['post_id'=>'3', 'tag'=> 'C++'],\n ['post_id'=>'3', 'tag'=> 'JS'],\n ['post_id'=>'2', 'tag'=> '.NET'],\n\n ]);\n }",
"public function run()\n {\n DB::table('tags')->truncate();\n DB::table('post_tag')->truncate();\n\n $php = new Tag();\n $php->name = \"PHP\";\n $php->slug = \"php\";\n $php->save();\n\n $laravel = new Tag();\n $laravel->name = \"Laravel\";\n $laravel->slug = \"laravel\";\n $laravel->save();\n\n $symphony = new Tag();\n $symphony->name = \"Symphony\";\n $symphony->slug = \"symphony\";\n $symphony->save();\n\n $vue = new Tag();\n $vue->name = \"Vue JS\";\n $vue->slug = \"vuejs\";\n $vue->save();\n\n $trend = new Tag();\n $trend->name = \"Trend\";\n $trend->slug = \"trend\";\n $trend->save();\n\n $important = new Tag();\n $important->name = \"Important\";\n $important->slug = \"important\";\n $important->save();\n\n $overrated = new Tag();\n $overrated->name = \"Overrated\";\n $overrated->slug = \"overrated\";\n $overrated->save();\n\n $underrated = new Tag();\n $underrated->name = \"Underrated\";\n $underrated->slug = \"underrated\";\n $underrated->save();\n\n $best = new Tag();\n $best->name = \"Best\";\n $best->slug = \"best\";\n $best->save();\n\n $friend = new Tag();\n $friend->name = \"Friend\";\n $friend->slug = \"friend\";\n $friend->save();\n\n $tags = [\n $php->id,\n $laravel->id,\n $symphony->id,\n $vue->id,\n $trend->id,\n $important->id,\n $overrated->id,\n $underrated->id,\n $best->id,\n $friend->id,\n ];\n\n foreach (Post::all() as $post) \n {\n shuffle($tags);\n\n for ($i=0; $i <= rand(0, 2); $i++) \n { \n $post->tags()->detach($tags[$i]);\n $post->tags()->attach($tags[$i]);\n }\n }\n }",
"protected function save(){\n $this->getTags();\n foreach ($this->posts as $post){\n $createdPost = Post::create(['habr_id' => $post['postId'],\n 'post' => $post['full'],\n 'unix_time' => $post['time']]);\n $this->attachPostTags($createdPost,$post['tags']);\n }\n }",
"public function sync()\n {\n $class = explode('\\\\', get_called_class());\n $manager = \\Str::studly(str_replace('EntryModel', null, end($class)));\n\n $existingAddons = $manager::getAll();\n $databaseAddons = $this->all();\n\n // Sync TO the database\n foreach ($existingAddons as $addon) {\n if (!$databaseAddons->findBySlug($addon->slug)) {\n $this->addons->insert(\n array(\n 'slug' => $addon->slug,\n )\n );\n }\n }\n }",
"public function run()\n {\n DB::table('tags')->insert([\n 'tag_text' => \"Fortnite\",\n 'creator_id' => 1\n ]);\n\n DB::table('tags')->insert([\n 'tag_text' => \"Multiplayer\",\n 'creator_id' => 1\n ]);\n }",
"public function run()\n {\n $tags = [\n 'Samsung',\n 'Netflix',\n 'Apple',\n 'İnstagram',\n 'Whatsapp',\n 'Apple',\n 'İphone'\n ];\n\n foreach($tags as $tag) {\n $t = new Tag();\n $t->name = $tag;\n $t->slug = Str::slug($tag);\n $t->save();\n }\n }",
"public function run()\n {\n DB::table('tags')->insert([\n 'nombre'=>'Informática',\n 'slug'=>'informatica'\n ]);\n\n DB::table('tags')->insert([\n 'nombre'=>'Fixter',\n 'slug'=>'fixter'\n ]);\n }",
"protected function saveTags()\n {\n $this->checkConstants();\n $articleId = $this->id;\n $tags = $this->tags;\n if ( $this->isNewRecord )\n {\n if ( !empty( $tags ) )\n {\n $this->addTags( $articleId, $tags );\n }\n }\n else\n {\n if ( is_array( $tags ) &&( !empty( $tags ) ) )\n {\n /*\n we received array with the same or different values of tags -\n in any case that will be an array with numbers\n */\n if ( is_numeric( $tags[0] ) )\n {\n $this->changeTags( $articleId, $tags );\n }\n /*\n if $tags was filled with models and user has removed from form all tags\n we will receive empty array and $tags will be the same as after initialization\n */\n elseif( is_object( $tags[0] ) )\n {\n $this->deleteAllTags( $articleId );\n }\n }\n }\n }",
"public function run()\n {\n \tDB::table('tags')->delete();\n\n $tags = array(\n \t['name'=>'art', 'slug'=>'art'],\n \t['name'=>'love', 'slug'=>'love'],\n \t['name'=>'education', 'slug'=>'education'],\n \t['name'=>'star wars', 'slug'=>'star-wars']\n );\n\n // Uncomment the below to run the seeder\n DB::table('tags')->insert($tags);\n }",
"public function run()\n {\n DB::table('tags')->insert([\n \t['name' => 'alpha'],\n \t['name' => 'beta'],\n \t['name' => 'gamma'],\n \t['name' => 'delta'],\n \t['name' => 'omega'],\n \t['name' => 'epsilon']\n ]);\n }",
"public function run()\n {\n //\n DB::table('tags')->insert([\n [\n 'name' => 'lasers',\n ],\n [\n 'name' => 'casques',\n ],\n [\n 'name' => 'star wars',\n ],\n [\n 'name' => 'dark vador',\n ],\n [\n 'name' => 'yoda',\n ],\n ]);\n }",
"private function syncTags(Post $post, array $tags = NULL)\n {\n if (!$tags) {\n $post->tags()->detach();\n return;\n }\n\n $tags = $this->createNewTags($tags);\n\n $post->tags()->sync($tags);\n }",
"public function run()\n {\n // tag数\n $tagCount = Tag::all()->count();\n // tag数ゼロならinfo\n if (0 === $tagCount) {\n $this->command->info('No tags found, skipping assigning tags to blog posts');\n }\n // 各postにつけるtag数の最小値\n $howManyMin = (int) $this->command->ask('Minimun tags no blog post?', 0);\n // 各postにつけるtag数の最大値\n $howManyMax = min((int) $this->command->ask('Maximum tags on blog post?', $tagCount), $tagCount);\n\n // postsのそれぞれに対してrelationでtagをsync\n BlogPost::all()->each(function (BlogPost $post) use ($howManyMin, $howManyMax) {\n // このpostで使用するtag数\n $take = random_int($howManyMin, $howManyMax);\n // tagsをランダムに並べなおしてtag数分のcollectionを取得し、idのみ抽出\n $tags = Tag::inRandomOrder()->take($take)->get()->pluck('id');\n // relationでpostにtagをsync\n $post->tags()->sync($tags);\n });\n }",
"public function persist()\n {\n //using eloquent insert or update to mass insert\n $tagCollection = collect($this->data)->map( fn($item) => [\n 'name' => strtolower($item),\n 'slug' => Str::slug($item)\n ] )->unique('name');\n Tag::upsert($tagCollection->toArray(), ['name'], ['name']);\n\n// $tags = $this->fetch();\n// $dataCollection = $this->getCollectionInLowerCase();\n// $filtered = $this->removeDuplicate($dataCollection,$tags)->getNewCollection();\n//\n// if($filtered->isNotEmpty()){\n// return $this->tag->insert($filtered->toArray());\n// }\n\n //before for reference\n// $filtered = $dataCollection\n// ->reject( fn($value, $key) => $tags->contains($value) )\n// ->unique()\n// ->map(function($item){\n// $data['name'] = $item;\n// $data['slug'] = Str::slug($item);\n// $data['created_at'] = now();\n// $data['updated_at'] = now();\n// return $data;\n// })->values();\n }",
"public function run()\n\t{\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\t\tDB::table('post_tag')->truncate();\n\n\t\t$post_tags = array(\n [\n 'post_id'=>'1',\n 'tag_id'=>'1'\n ],\n [\n 'post_id'=>'2',\n 'tag_id'=>'1'\n ],\n [\n 'post_id'=>'3',\n 'tag_id'=>'2'\n ],\n [\n 'post_id'=>'4',\n 'tag_id'=>'5'\n ],\n [\n 'post_id'=>'5',\n 'tag_id'=>'2'\n ],\n [\n 'post_id'=>'6',\n 'tag_id'=>'4'\n ]\n\t\t);\n\n\t\t// Uncomment the below to run the seeder\n\t\tDB::table('post_tag')->insert($post_tags);\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n\t}",
"public function run()\n {\n App\\Tag::create(factory(App\\Tag::class)->make()->toArray())->save();\n App\\Tag::create(factory(App\\Tag::class)->make()->toArray())->save();\n App\\Tag::create(factory(App\\Tag::class)->make()->toArray())->save();\n App\\Tag::create(factory(App\\Tag::class)->make()->toArray())->save();\n App\\Tag::create(factory(App\\Tag::class)->make()->toArray())->save();\n App\\Tag::create(factory(App\\Tag::class)->make()->toArray())->save();\n }",
"public function run()\n {\n Tag::insert([\n [\n 'tag_id' => '1',\n 'tag_name' => 'mobile',\n 'slug' => 'mobile',\n ],\n [\n 'tag_id' => '2',\n 'tag_name' => 'camera',\n 'slug' => 'camera',\n ],\n [\n 'tag_id' => '3',\n 'tag_name' => 'computer',\n 'slug' => 'computer',\n ],\n ]);\n }",
"public function run()\n\t{\n\t\t$fake = Faker::create();\n\n\t\t\\DB::table('fs_content_tags')->truncate();\n\n\t\tforeach(range(1,20) as $index)\n\t\t{\n\t\t\t$items[] = [\n\t\t\t\t'tag_id' => $fake->numberBetween(1, 10),\n\t\t\t\t'content_id' => $fake->numberBetween(1, 10)\n\t\t\t];\n\t\t}\n\n\t\t\\DB::table('fs_content_tags')->insert($items);\n\t}",
"private function syncTags(Article $article, array $tags){\n\n $article->tags()->sync($tags);\n }",
"public function run()\n {\n \n\n \\DB::table('tags')->delete();\n \n \\DB::table('tags')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'simpson',\n 'created_at' => '2018-12-28 13:22:52',\n 'updated_at' => '2018-12-28 13:22:52',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'aplauso',\n 'created_at' => '2018-12-28 13:23:13',\n 'updated_at' => '2018-12-28 13:27:06',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'marron',\n 'created_at' => '2018-12-28 13:23:29',\n 'updated_at' => '2018-12-28 13:23:29',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => 'sarita',\n 'created_at' => '2018-12-28 15:19:26',\n 'updated_at' => '2018-12-28 15:19:26',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'payaso',\n 'created_at' => '2018-12-28 15:20:31',\n 'updated_at' => '2018-12-28 15:20:31',\n ),\n 5 => \n array (\n 'id' => 10,\n 'name' => 'wonka',\n 'created_at' => '2019-01-06 12:48:33',\n 'updated_at' => '2019-01-06 12:48:33',\n ),\n 6 => \n array (\n 'id' => 11,\n 'name' => 'alegria',\n 'created_at' => '2019-01-06 12:48:54',\n 'updated_at' => '2019-01-06 12:48:54',\n ),\n 7 => \n array (\n 'id' => 12,\n 'name' => 'churrito',\n 'created_at' => '2019-01-06 12:49:40',\n 'updated_at' => '2019-01-06 12:49:40',\n ),\n 8 => \n array (\n 'id' => 13,\n 'name' => 'ostion',\n 'created_at' => '2019-01-06 12:50:10',\n 'updated_at' => '2019-01-06 12:50:10',\n ),\n 9 => \n array (\n 'id' => 14,\n 'name' => 'tetas',\n 'created_at' => '2019-01-06 12:56:40',\n 'updated_at' => '2019-01-06 12:56:40',\n ),\n 10 => \n array (\n 'id' => 15,\n 'name' => 'baile',\n 'created_at' => '2019-01-06 12:57:42',\n 'updated_at' => '2019-01-06 12:57:42',\n ),\n 11 => \n array (\n 'id' => 16,\n 'name' => 'niño',\n 'created_at' => '2019-01-06 12:58:35',\n 'updated_at' => '2019-01-06 12:58:35',\n ),\n 12 => \n array (\n 'id' => 17,\n 'name' => 'sacapuntas',\n 'created_at' => '2019-01-06 12:59:03',\n 'updated_at' => '2019-01-06 12:59:03',\n ),\n 13 => \n array (\n 'id' => 18,\n 'name' => 'travesti',\n 'created_at' => '2019-01-06 13:00:36',\n 'updated_at' => '2019-01-06 13:00:36',\n ),\n 14 => \n array (\n 'id' => 19,\n 'name' => 'cabra',\n 'created_at' => '2019-01-06 13:01:31',\n 'updated_at' => '2019-01-06 13:01:31',\n ),\n 15 => \n array (\n 'id' => 20,\n 'name' => 'risa',\n 'created_at' => '2019-01-06 13:02:11',\n 'updated_at' => '2019-01-06 13:02:11',\n ),\n 16 => \n array (\n 'id' => 21,\n 'name' => 'sorpresa',\n 'created_at' => '2019-01-06 13:08:53',\n 'updated_at' => '2019-01-06 13:08:53',\n ),\n 17 => \n array (\n 'id' => 22,\n 'name' => 'ralphie',\n 'created_at' => '2019-01-06 13:10:19',\n 'updated_at' => '2019-01-06 13:10:19',\n ),\n 18 => \n array (\n 'id' => 23,\n 'name' => 'culo',\n 'created_at' => '2019-01-06 13:13:22',\n 'updated_at' => '2019-01-06 13:13:22',\n ),\n 19 => \n array (\n 'id' => 24,\n 'name' => 'chupabarbas',\n 'created_at' => '2019-01-06 13:14:39',\n 'updated_at' => '2019-01-06 13:14:39',\n ),\n 20 => \n array (\n 'id' => 25,\n 'name' => 'fiesta',\n 'created_at' => '2019-01-16 09:59:05',\n 'updated_at' => '2019-01-16 09:59:05',\n ),\n 21 => \n array (\n 'id' => 26,\n 'name' => 'enfadado',\n 'created_at' => '2019-01-16 09:59:17',\n 'updated_at' => '2019-01-16 09:59:17',\n ),\n 22 => \n array (\n 'id' => 27,\n 'name' => 'golpe',\n 'created_at' => '2019-01-16 09:59:26',\n 'updated_at' => '2019-01-16 09:59:26',\n ),\n 23 => \n array (\n 'id' => 28,\n 'name' => 'mono',\n 'created_at' => '2019-01-16 09:59:36',\n 'updated_at' => '2019-01-16 09:59:36',\n ),\n 24 => \n array (\n 'id' => 29,\n 'name' => 'corre',\n 'created_at' => '2019-01-16 09:59:55',\n 'updated_at' => '2019-01-16 09:59:55',\n ),\n 25 => \n array (\n 'id' => 31,\n 'name' => 'padredefamilia',\n 'created_at' => '2019-01-16 10:00:21',\n 'updated_at' => '2019-01-16 10:00:21',\n ),\n 26 => \n array (\n 'id' => 32,\n 'name' => 'wow',\n 'created_at' => '2019-01-16 10:00:31',\n 'updated_at' => '2019-01-16 10:00:31',\n ),\n 27 => \n array (\n 'id' => 33,\n 'name' => 'art api',\n 'created_at' => '2019-01-16 10:00:40',\n 'updated_at' => '2019-01-16 10:00:40',\n ),\n 28 => \n array (\n 'id' => 34,\n 'name' => 'facepalm',\n 'created_at' => '2019-01-16 10:00:54',\n 'updated_at' => '2019-01-16 10:00:54',\n ),\n 29 => \n array (\n 'id' => 35,\n 'name' => 'tonto',\n 'created_at' => '2019-01-16 10:01:09',\n 'updated_at' => '2019-01-16 10:01:09',\n ),\n 30 => \n array (\n 'id' => 36,\n 'name' => 'frankestein',\n 'created_at' => '2019-01-16 10:01:55',\n 'updated_at' => '2019-01-16 10:01:55',\n ),\n 31 => \n array (\n 'id' => 37,\n 'name' => 'flipando',\n 'created_at' => '2019-01-16 10:02:10',\n 'updated_at' => '2019-01-16 10:02:10',\n ),\n 32 => \n array (\n 'id' => 38,\n 'name' => 'roto',\n 'created_at' => '2019-01-16 10:02:30',\n 'updated_at' => '2019-01-16 10:02:30',\n ),\n 33 => \n array (\n 'id' => 39,\n 'name' => 'mentos',\n 'created_at' => '2019-01-21 14:19:54',\n 'updated_at' => '2019-01-21 14:19:54',\n ),\n 34 => \n array (\n 'id' => 40,\n 'name' => 'toro',\n 'created_at' => '2019-01-22 09:14:50',\n 'updated_at' => '2019-01-22 09:14:50',\n ),\n 35 => \n array (\n 'id' => 41,\n 'name' => 'torero',\n 'created_at' => '2019-01-22 09:14:58',\n 'updated_at' => '2019-01-22 09:14:58',\n ),\n 36 => \n array (\n 'id' => 42,\n 'name' => 'explosion',\n 'created_at' => '2019-01-22 09:15:46',\n 'updated_at' => '2019-01-22 09:15:46',\n ),\n 37 => \n array (\n 'id' => 43,\n 'name' => 'catapulta',\n 'created_at' => '2019-01-22 10:00:55',\n 'updated_at' => '2019-01-22 10:00:55',\n ),\n 38 => \n array (\n 'id' => 44,\n 'name' => 'lluvia',\n 'created_at' => '2019-01-22 11:28:05',\n 'updated_at' => '2019-01-22 11:28:05',\n ),\n 39 => \n array (\n 'id' => 45,\n 'name' => 'dolor',\n 'created_at' => '2019-01-23 14:19:55',\n 'updated_at' => '2019-01-23 14:19:55',\n ),\n 40 => \n array (\n 'id' => 46,\n 'name' => 'futbolin',\n 'created_at' => '2019-01-23 14:20:05',\n 'updated_at' => '2019-01-23 14:20:05',\n ),\n 41 => \n array (\n 'id' => 47,\n 'name' => 'saludo',\n 'created_at' => '2019-01-23 15:15:25',\n 'updated_at' => '2019-01-23 15:15:25',\n ),\n 42 => \n array (\n 'id' => 48,\n 'name' => 'maldad',\n 'created_at' => '2019-01-23 15:21:27',\n 'updated_at' => '2019-01-23 15:21:27',\n ),\n 43 => \n array (\n 'id' => 49,\n 'name' => 'sueño',\n 'created_at' => '2019-01-23 15:21:49',\n 'updated_at' => '2019-01-23 15:21:49',\n ),\n 44 => \n array (\n 'id' => 50,\n 'name' => 'conejo',\n 'created_at' => '2019-01-23 15:21:58',\n 'updated_at' => '2019-01-23 15:21:58',\n ),\n 45 => \n array (\n 'id' => 51,\n 'name' => 'ordenador',\n 'created_at' => '2019-01-23 15:22:34',\n 'updated_at' => '2019-01-23 15:22:34',\n ),\n 46 => \n array (\n 'id' => 52,\n 'name' => 'jodete',\n 'created_at' => '2019-01-23 15:23:03',\n 'updated_at' => '2019-01-23 15:23:03',\n ),\n 47 => \n array (\n 'id' => 53,\n 'name' => 'mirada',\n 'created_at' => '2019-01-23 15:23:43',\n 'updated_at' => '2019-01-23 15:23:43',\n ),\n 48 => \n array (\n 'id' => 54,\n 'name' => 'calculando',\n 'created_at' => '2019-01-23 15:23:58',\n 'updated_at' => '2019-01-23 15:23:58',\n ),\n 49 => \n array (\n 'id' => 55,\n 'name' => 'platillos',\n 'created_at' => '2019-01-23 15:24:20',\n 'updated_at' => '2019-01-23 15:24:20',\n ),\n 50 => \n array (\n 'id' => 56,\n 'name' => 'llorar',\n 'created_at' => '2019-01-23 15:24:48',\n 'updated_at' => '2019-01-23 15:24:48',\n ),\n 51 => \n array (\n 'id' => 57,\n 'name' => 'pena',\n 'created_at' => '2019-01-23 15:24:54',\n 'updated_at' => '2019-01-23 15:24:54',\n ),\n 52 => \n array (\n 'id' => 58,\n 'name' => 'no',\n 'created_at' => '2019-01-23 15:25:21',\n 'updated_at' => '2019-01-23 15:25:21',\n ),\n 53 => \n array (\n 'id' => 59,\n 'name' => 'paseo',\n 'created_at' => '2019-01-23 15:27:03',\n 'updated_at' => '2019-01-23 15:27:03',\n ),\n 54 => \n array (\n 'id' => 60,\n 'name' => 'hagamoslo',\n 'created_at' => '2019-01-23 15:27:35',\n 'updated_at' => '2019-01-23 15:27:35',\n ),\n 55 => \n array (\n 'id' => 61,\n 'name' => 'kraken',\n 'created_at' => '2019-01-23 15:28:15',\n 'updated_at' => '2019-01-23 15:28:15',\n ),\n 56 => \n array (\n 'id' => 62,\n 'name' => 'tiempo',\n 'created_at' => '2019-01-23 15:28:33',\n 'updated_at' => '2019-01-23 15:28:33',\n ),\n 57 => \n array (\n 'id' => 63,\n 'name' => 'reloj',\n 'created_at' => '2019-01-23 15:28:43',\n 'updated_at' => '2019-01-23 15:28:43',\n ),\n 58 => \n array (\n 'id' => 64,\n 'name' => 'reverencia',\n 'created_at' => '2019-01-23 15:28:58',\n 'updated_at' => '2019-01-23 15:28:58',\n ),\n 59 => \n array (\n 'id' => 65,\n 'name' => 'vikingo',\n 'created_at' => '2019-01-23 15:30:40',\n 'updated_at' => '2019-01-23 15:30:40',\n ),\n 60 => \n array (\n 'id' => 66,\n 'name' => 'planificacion',\n 'created_at' => '2019-01-23 15:31:15',\n 'updated_at' => '2019-01-23 15:31:15',\n ),\n 61 => \n array (\n 'id' => 67,\n 'name' => 'cuidado',\n 'created_at' => '2019-01-23 15:32:09',\n 'updated_at' => '2019-01-23 15:32:09',\n ),\n 62 => \n array (\n 'id' => 68,\n 'name' => 'dibujos',\n 'created_at' => '2019-01-23 15:32:22',\n 'updated_at' => '2019-01-23 15:32:22',\n ),\n 63 => \n array (\n 'id' => 69,\n 'name' => 'caca',\n 'created_at' => '2019-01-23 15:33:45',\n 'updated_at' => '2019-01-23 15:33:45',\n ),\n 64 => \n array (\n 'id' => 70,\n 'name' => 'cactus',\n 'created_at' => '2019-01-23 15:34:51',\n 'updated_at' => '2019-01-23 15:34:51',\n ),\n 65 => \n array (\n 'id' => 71,\n 'name' => 'droga',\n 'created_at' => '2019-01-23 15:35:04',\n 'updated_at' => '2019-01-23 15:35:04',\n ),\n 66 => \n array (\n 'id' => 72,\n 'name' => 'susto',\n 'created_at' => '2019-01-23 15:35:27',\n 'updated_at' => '2019-01-23 15:35:27',\n ),\n 67 => \n array (\n 'id' => 73,\n 'name' => 'programando',\n 'created_at' => '2019-01-23 15:36:04',\n 'updated_at' => '2019-01-23 15:36:04',\n ),\n 68 => \n array (\n 'id' => 74,\n 'name' => 'gustavo',\n 'created_at' => '2019-01-23 15:36:38',\n 'updated_at' => '2019-01-23 15:36:38',\n ),\n 69 => \n array (\n 'id' => 75,\n 'name' => 'espia',\n 'created_at' => '2019-01-23 15:37:48',\n 'updated_at' => '2019-01-23 15:37:48',\n ),\n 70 => \n array (\n 'id' => 76,\n 'name' => 'enano',\n 'created_at' => '2019-01-23 15:38:03',\n 'updated_at' => '2019-01-23 15:38:03',\n ),\n 71 => \n array (\n 'id' => 77,\n 'name' => 'diana',\n 'created_at' => '2019-01-23 15:38:09',\n 'updated_at' => '2019-01-23 15:38:09',\n ),\n 72 => \n array (\n 'id' => 78,\n 'name' => 'despierta',\n 'created_at' => '2019-01-23 15:39:28',\n 'updated_at' => '2019-01-23 15:39:28',\n ),\n 73 => \n array (\n 'id' => 79,\n 'name' => 'viento',\n 'created_at' => '2019-01-23 15:39:56',\n 'updated_at' => '2019-01-23 15:39:56',\n ),\n 74 => \n array (\n 'id' => 80,\n 'name' => 'jugar',\n 'created_at' => '2019-01-23 15:46:27',\n 'updated_at' => '2019-01-23 15:46:27',\n ),\n 75 => \n array (\n 'id' => 81,\n 'name' => 'magic',\n 'created_at' => '2019-01-23 15:47:08',\n 'updated_at' => '2019-01-23 15:47:08',\n ),\n 76 => \n array (\n 'id' => 82,\n 'name' => 'nauseas',\n 'created_at' => '2019-01-23 15:48:14',\n 'updated_at' => '2019-01-23 15:48:14',\n ),\n 77 => \n array (\n 'id' => 83,\n 'name' => 'sospecha',\n 'created_at' => '2019-01-23 15:52:12',\n 'updated_at' => '2019-01-23 15:52:12',\n ),\n 78 => \n array (\n 'id' => 84,\n 'name' => 'power',\n 'created_at' => '2019-01-23 15:52:52',\n 'updated_at' => '2019-01-23 15:52:52',\n ),\n 79 => \n array (\n 'id' => 85,\n 'name' => 'robot',\n 'created_at' => '2019-01-23 15:52:57',\n 'updated_at' => '2019-01-23 15:52:57',\n ),\n 80 => \n array (\n 'id' => 86,\n 'name' => 'gato',\n 'created_at' => '2019-01-23 15:54:01',\n 'updated_at' => '2019-01-23 15:54:01',\n ),\n 81 => \n array (\n 'id' => 87,\n 'name' => 'nba',\n 'created_at' => '2019-01-23 15:54:17',\n 'updated_at' => '2019-01-23 15:54:17',\n ),\n 82 => \n array (\n 'id' => 88,\n 'name' => 'fuego',\n 'created_at' => '2019-01-23 15:54:37',\n 'updated_at' => '2019-01-23 15:54:37',\n ),\n 83 => \n array (\n 'id' => 89,\n 'name' => 'solitario',\n 'created_at' => '2019-01-23 15:55:00',\n 'updated_at' => '2019-01-23 15:55:00',\n ),\n 84 => \n array (\n 'id' => 90,\n 'name' => 'gemelos',\n 'created_at' => '2019-01-23 15:55:16',\n 'updated_at' => '2019-01-23 15:55:16',\n ),\n 85 => \n array (\n 'id' => 91,\n 'name' => 'coordinando',\n 'created_at' => '2019-01-23 15:55:42',\n 'updated_at' => '2019-01-23 15:55:42',\n ),\n 86 => \n array (\n 'id' => 92,\n 'name' => 'careto',\n 'created_at' => '2019-01-23 15:56:05',\n 'updated_at' => '2019-01-23 15:56:05',\n ),\n 87 => \n array (\n 'id' => 93,\n 'name' => 'final',\n 'created_at' => '2019-01-23 15:59:04',\n 'updated_at' => '2019-01-23 15:59:04',\n ),\n 88 => \n array (\n 'id' => 94,\n 'name' => 'alonso',\n 'created_at' => '2019-01-23 15:59:23',\n 'updated_at' => '2019-01-23 15:59:23',\n ),\n 89 => \n array (\n 'id' => 95,\n 'name' => 'burbuja',\n 'created_at' => '2019-01-23 15:59:52',\n 'updated_at' => '2019-01-23 15:59:52',\n ),\n 90 => \n array (\n 'id' => 96,\n 'name' => 'triste',\n 'created_at' => '2019-01-23 16:00:10',\n 'updated_at' => '2019-01-23 16:00:10',\n ),\n 91 => \n array (\n 'id' => 97,\n 'name' => 'policia',\n 'created_at' => '2019-01-23 16:02:27',\n 'updated_at' => '2019-01-23 16:02:27',\n ),\n 92 => \n array (\n 'id' => 98,\n 'name' => 'perro',\n 'created_at' => '2019-01-23 16:02:47',\n 'updated_at' => '2019-01-23 16:02:47',\n ),\n 93 => \n array (\n 'id' => 99,\n 'name' => 'pedo',\n 'created_at' => '2019-01-23 16:03:04',\n 'updated_at' => '2019-01-23 16:03:04',\n ),\n 94 => \n array (\n 'id' => 100,\n 'name' => 'smoke',\n 'created_at' => '2019-01-23 16:03:29',\n 'updated_at' => '2019-01-23 16:03:29',\n ),\n 95 => \n array (\n 'id' => 101,\n 'name' => 'fauno',\n 'created_at' => '2019-01-23 16:03:43',\n 'updated_at' => '2019-01-23 16:03:43',\n ),\n 96 => \n array (\n 'id' => 102,\n 'name' => 'girasol',\n 'created_at' => '2019-01-23 16:04:31',\n 'updated_at' => '2019-01-23 16:04:31',\n ),\n 97 => \n array (\n 'id' => 103,\n 'name' => 'moai',\n 'created_at' => '2019-01-23 16:04:52',\n 'updated_at' => '2019-01-23 16:04:52',\n ),\n 98 => \n array (\n 'id' => 104,\n 'name' => 'cerdo',\n 'created_at' => '2019-01-23 16:05:09',\n 'updated_at' => '2019-01-23 16:05:09',\n ),\n 99 => \n array (\n 'id' => 105,\n 'name' => 'peggy',\n 'created_at' => '2019-01-23 16:05:15',\n 'updated_at' => '2019-01-23 16:05:15',\n ),\n 100 => \n array (\n 'id' => 106,\n 'name' => 'hormiga',\n 'created_at' => '2019-01-23 16:06:52',\n 'updated_at' => '2019-01-23 16:06:52',\n ),\n 101 => \n array (\n 'id' => 107,\n 'name' => 'perseguido',\n 'created_at' => '2019-01-23 16:07:12',\n 'updated_at' => '2019-01-23 16:07:12',\n ),\n 102 => \n array (\n 'id' => 108,\n 'name' => 'cuentame',\n 'created_at' => '2019-01-23 16:09:48',\n 'updated_at' => '2019-01-23 16:09:48',\n ),\n 103 => \n array (\n 'id' => 109,\n 'name' => 'pirivuelta',\n 'created_at' => '2019-01-23 16:10:09',\n 'updated_at' => '2019-01-23 16:10:09',\n ),\n 104 => \n array (\n 'id' => 110,\n 'name' => 'puñetazo',\n 'created_at' => '2019-01-23 16:11:49',\n 'updated_at' => '2019-01-23 16:11:49',\n ),\n 105 => \n array (\n 'id' => 111,\n 'name' => 'desprecio',\n 'created_at' => '2019-01-23 16:12:22',\n 'updated_at' => '2019-01-23 16:12:22',\n ),\n 106 => \n array (\n 'id' => 112,\n 'name' => 'basura',\n 'created_at' => '2019-01-23 16:13:04',\n 'updated_at' => '2019-01-23 16:13:04',\n ),\n 107 => \n array (\n 'id' => 113,\n 'name' => 'romper',\n 'created_at' => '2019-01-23 16:13:28',\n 'updated_at' => '2019-01-23 16:13:28',\n ),\n 108 => \n array (\n 'id' => 114,\n 'name' => 'telefono',\n 'created_at' => '2019-01-23 16:13:45',\n 'updated_at' => '2019-01-23 16:13:45',\n ),\n 109 => \n array (\n 'id' => 115,\n 'name' => 'vago',\n 'created_at' => '2019-01-23 16:14:06',\n 'updated_at' => '2019-01-23 16:14:06',\n ),\n 110 => \n array (\n 'id' => 116,\n 'name' => 'teleñecos',\n 'created_at' => '2019-01-23 16:15:15',\n 'updated_at' => '2019-01-23 16:15:15',\n ),\n 111 => \n array (\n 'id' => 117,\n 'name' => 'linchamiento',\n 'created_at' => '2019-01-23 16:15:42',\n 'updated_at' => '2019-01-23 16:15:42',\n ),\n ));\n \n \n }",
"private function syncTags($values)\n\t{\n\t\t// Initialize variables.\n\t\t$tags = array();\n\t\t$db = $this->getDbo();\n\n\t\t// Build the query to see if the items already exist.\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->quoteName(array('tag_id', 'tag')))\n\t\t\t->from($db->quoteName('#__code_tags'));\n\n\t\tforeach ($values as $k => $value)\n\t\t{\n\t\t\t$query->where($db->quoteName('tag') . ' = ' . $db->quote($value), 'OR');\n\t\t}\n\n\t\t$db->setQuery($query);\n\n\t\t// Execute the query to find out if the items exist.\n\t\t$exists = (array) $db->loadObjectList();\n\n\t\t// Build out the array of tags based on those that already exist.\n\t\tforeach ($exists as $exist)\n\t\t{\n\t\t\t$tags[(int) $exist->tag_id] = $exist->tag;\n\t\t}\n\n\t\t// Get the list of tags to store.\n\t\t$store = array_diff(array_values($values), array_values($tags));\n\n\t\tif (empty($store))\n\t\t{\n\t\t\treturn $tags;\n\t\t}\n\n\t\t// Store the values.\n\t\tforeach ($store as $value)\n\t\t{\n\t\t\t// Insert the new tag.\n\t\t\t$db->setQuery(\n\t\t\t\t$db->getQuery(true)\n\t\t\t\t\t->insert($db->quoteName('#__code_tags'))\n\t\t\t\t\t->columns(array($db->quoteName('tag')))\n\t\t\t\t\t->values($db->quote($value))\n\t\t\t)->execute();\n\n\t\t\t$tags[(int) $db->insertid()] = $value;\n\t\t}\n\n\t\treturn $tags;\n\t}",
"public function run()\n {\n \t// DB::table('tasks_tags')->delete();\n\n $tasks_tags = array(\n \tarray(\n \t\t'task_id' => 1,\n \t\t'tag_id' => 1\n \t),\n );\n\n // Uncomment the below to run the seeder\n DB::table('tasks_tags')->insert($tasks_tags);\n }",
"public function run()\n {\n DB::table('tags')->delete();\n\n Tags::create(['nama' => 'Lucu']);\n Tags::create(['nama' => 'Shitpost']);\n Tags::create(['nama' => 'Parodi']);\n Tags::create(['nama' => 'Twitter']);\n Tags::create(['nama' => 'Screenshot']);\n }",
"public function run()\n {\n $data = ['Happy','Angry','Sad','Easy','Busy','Dizzy','Crazy','Messy','Noisy','Grumpy','Funny','Jolly'];\n foreach($data as $tagName) {\n $tag = new \\P4\\Tag();\n $tag->name = $tagName;\n $tag->save();\n }\n }",
"public function run()\n {\n DB::table('tags')->insert([\n 'name' => \"Problem\",\n\t\t\t'type' => \"Post\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Idea\",\n\t\t\t'type' => \"Post\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Project\",\n\t\t\t'type' => \"Post\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Java\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Javascript\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"CSS\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"C++\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Python\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"PHP\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Ruby\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"R\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Bash\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"NET\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"LAMP\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"SQL\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"MySQL\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"MongoDB\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"PostgreSQL\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Redis\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"SQL Server\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Relational Databases\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Linux\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Android\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Ubuntu\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Data Analysis\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Hadoop\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Data Mining\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Cloud Computing\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Node.js\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Django\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Ruby on Rails\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Blackbone.js\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"MAGENTO\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"CakePHP\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Zend Framework\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"jQuerry\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"D3.js\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Coffeescript\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Ember.js\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Zepto\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Programming\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Machine Learning\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Cloud Computing\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Apache\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Backend Development\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Mobile Development\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Facebook API\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"DevOps\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Management\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"CSS\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Product Development\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Graphic Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"User Experience Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Web Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"User Ineterface Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Visual Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Mobile Application Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Interface Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Photoshop\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Interaction Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Print Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Responsive Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Brand Design and strategy\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Desigh Thinking\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Game Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Industrial Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Brand and Identity Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"IOS Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Icon Design\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"HTML\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Project Management\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Business Development\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Sales\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"C\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Marketing Management\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Research\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"English\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Chinese\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Japanese\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"German\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"French\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Spanish\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Portugese\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Organisation\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Product Development\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Leadership\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Advertising\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Business Strategy\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Customer Service\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Git\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Documentation\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Security\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Matlab\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Scilab\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Hindi\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Music\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"History of arts\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Painting\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Drawing\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Event organising\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Public health\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Medcine\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Biology\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Geology\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Astrology\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Photography\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Indesin\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\tDB::table('tags')->insert([\n 'name' => \"Aftereffect\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\tDB::table('tags')->insert([\n 'name' => \"Film making\",\n\t\t\t'type' => \"Skill\",\n\t\t\t'created_at' => Carbon::now(),\n\t\t\t'updated_at' => Carbon::now()\n ]);\n\t\t\n\t\t\n\t\t\n\t\t \n }",
"public function run()\n {\n $tags = [\n ['name' => '家電'],\n ['name' => 'パソコン周辺機器'],\n ['name' => 'ゲーム機'],\n ['name' => 'ゲーム周辺機器'],\n ['name' => 'スマートフォン'],\n ['name' => 'カメラ'],\n ['name' => '掃除機'],\n ['name' => 'ホビー'],\n ['name' => 'キッチン用品'],\n ['name' => 'ドリンク'],\n ['name' => '食品'],\n ['name' => 'ペット'],\n ['name' => '本'],\n ['name' => 'CD'],\n ['name' => 'DVD'],\n ['name' => 'スポーツ'],\n ['name' => '腕時計'],\n ['name' => '保険'],\n ['name' => 'アウトドア'],\n ['name' => 'インテリア'],\n ['name' => '家具'],\n ];\n\n DB::table('tags')->insert($tags);\n }",
"public function run()\n {\n $tags = array (\n array('name' => 'Sport' ,'created_at' => Carbon::now(),'updated_at' => Carbon::now()),\n array('name' => 'Music','created_at' => Carbon::now(),'updated_at' => Carbon::now()),\n array('name' => 'Festival','created_at' => Carbon::now(),'updated_at' => Carbon::now()),\n array('name' => 'Travel','created_at' => Carbon::now(),'updated_at' => Carbon::now()),\n array('name' => 'Fashion','created_at' => Carbon::now(),'updated_at' => Carbon::now())\n );\n Tag::insert($tags);\n }",
"protected function saveTagsToQuestionnaire(array $list)\n\t{\n\t\t$TagList = TagList::findOrNew($list['id']);\n\t\t$TagList->name = $TagList->name ? $TagList->name : $list['name'];\n\t\tforeach ($list['tagged'] as $tag) {\n\t\t\tforeach ($TagList->tags as $Existing) {\n\t\t\t\tif ($Existing->name === $tag) {\n\t\t\t\t\tcontinue 2; // don't duplicate tags\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$TagList->tags()->save(Tag::create(['name' => $tag, 'tag_list_id' => $TagList->id]));\n\t\t}\n\n\t\t$TagList->save();\n\t}",
"public function run()\n {\n DB::table('tags')->insert(\n [\n ['name'=>'Healthy cung FFD'],\n ['name'=>'Sale up 70%'],\n ['name'=>'Bua an 1k'],\n ['name'=>'An cung nguoi noi tieng'],\n ]\n );\n }",
"public function run()\n {\n DB::table('tags')->insert([\n\n [\n 'name' => 'Похудение',\n 'link' => 'weight_loss',\n ],\n [\n 'name' => 'Спина',\n 'link' => 'back',\n ],\n [\n 'name' => 'застой',\n 'link' => 'stagnation',\n ],\n\n [\n 'name' => 'пресс',\n 'link' => 'press',\n ],\n [\n 'name' => 'Сила',\n 'link' => 'power',\n ],\n [\n 'name' => 'жим лежа',\n 'link' => 'bench_press',\n ],\n ]);\n }",
"public function run()\n {\n $tags = ['PHP', 'Laravel', 'HTML', 'CSS', 'JavaScript', 'Vue.js'];\n\n foreach ($tags as $tag) {\n\n // 1) Creo Istanza - !use App\\Tag;!\n $newTag = new Tag();\n\n // 2) Valorizzo\n $newTag->name = $tag;\n $newTag->slug = Str::slug($tag, '-'); // !use Illuminate\\Support\\Str;!\n\n // 3) Salvataggio\n $newTag->save();\n\n // Eseguo Seeder - php artisan db:seed --class=TagSeeder - Controllo il DB\n\n }\n }",
"public function run()\n {\n $tagList = [\n 'affari',\n 'cinema',\n 'cronaca',\n 'intrattenimento',\n 'musica',\n 'opinione',\n 'salute',\n 'scienza e tecnologia',\n 'sport',\n 'turismo',\n ];\n\n foreach($tagList as $tag) {\n $tagObject = new Tag();\n $tagObject->name = $tag;\n $tagObject->save();\n }\n }",
"function handle_tags_save($tags, $rel_id, $rel_type)\n{\n $CI =& get_instance();\n\n $affectedRows = 0;\n if ($tags == '') {\n $CI->db->where('rel_id', $rel_id);\n $CI->db->where('rel_type', $rel_type);\n $CI->db->delete('tbltags_in');\n if ($CI->db->affected_rows() > 0) {\n $affectedRows++;\n }\n } else {\n $tags_array = array();\n if (!is_array($tags)) {\n $tags = explode(',', $tags);\n }\n\n foreach ($tags as $tag) {\n $tag = trim($tag);\n if ($tag != '') {\n array_push($tags_array, $tag);\n }\n }\n\n // Check if there is removed tags\n $current_tags = get_tags_in($rel_id, $rel_type);\n\n foreach ($current_tags as $tag) {\n if (!in_array($tag, $tags_array)) {\n $tag = get_tag_by_name($tag);\n $CI->db->where('rel_id', $rel_id);\n $CI->db->where('rel_type', $rel_type);\n $CI->db->where('tag_id', $tag->id);\n $CI->db->delete('tbltags_in');\n if ($CI->db->affected_rows() > 0) {\n $affectedRows++;\n }\n }\n }\n\n // Insert new ones\n $order = 1;\n foreach ($tags_array as $tag) {\n $tag = str_replace('\"', '\\'', $tag);\n\n $CI->db->where('name', $tag);\n $tag_row = $CI->db->get('tbltags')->row();\n if ($tag_row) {\n $tag_id = $tag_row->id;\n } else {\n // Double quotes not allowed\n $CI->db->insert('tbltags', array('name'=>$tag));\n $tag_id = $CI->db->insert_id();\n }\n\n if (total_rows('tbltags_in', array('tag_id'=>$tag_id, 'rel_id'=>$rel_id, 'rel_type'=>$rel_type)) == 0) {\n $CI->db->insert('tbltags_in',\n array(\n 'tag_id'=>$tag_id,\n 'rel_id'=>$rel_id,\n 'rel_type'=>$rel_type,\n 'tag_order'=>$order\n ));\n\n if ($CI->db->affected_rows() > 0) {\n $affectedRows++;\n }\n }\n $order++;\n }\n }\n\n return ($affectedRows > 0 ? true : false);\n}",
"private function syncTags(Article $article, array $tags)\n {\n $article->tags()->sync($tags);\n }",
"public function run()\n {\n DB::table('taggables')->truncate();\n DB::table('tags')->truncate();\n\n $tags = [\n [\n 'name' => 'Code',\n 'slug' => Str::slug('Code'),\n ],\n [\n 'name' => 'Agile',\n 'slug' => Str::slug('Agile'),\n ],\n array('name' => 'Framework', 'slug' => Str::slug('Framework'))\n ];\n\n // Uncomment the below to run the seeder\n foreach ($tags as $tag) {\n Tag::create($tag);\n }\n\n // $this->command->info('Tags table seeded !');\n }",
"public function run()\n {\n $tags = ['Guides', 'Assets', 'Streaming', 'StreamLabs', 'Twitch', 'OBS', 'Gaming', 'Fortnite', 'CS:GO', 'PUBG'];\n foreach($tags as $t)\n {\n $tag = new Tag;\n $tag->name = $t->name;\n $tag->slug = strtolower(str_slug($t->name));\n $tag->save();\n }\n }",
"public function addTags($tags) {\n foreach ($tags as $tag) {\n Database::insert(\"post_tags\", [\n \"post_id\" => $this->getId(),\n \"tag_id\" => $tag\n ]);\n }\n }",
"public function run()\n {\n DB::table('tags')->insert([\n \t'name' => 'Julia',\n \t'slug' => str_slug('Julia')\n ]);\n DB::table('tags')->insert([\n \t'name' => 'C++',\n \t'slug' => str_slug('C++')\n ]);\n DB::table('tags')->insert([\n \t'name' => 'Wordpress 4.8',\n \t'slug' => str_slug('Wordpress 4.8')\n ]);\n DB::table('tags')->insert([\n 'name' => 'Last Judgement',\n 'slug' => str_slug('Last Judgement')\n ]);\n DB::table('tags')->insert([\n 'name' => 'Michelangelo',\n 'slug' => str_slug('Michelangelo')\n ]);//renaissance\n DB::table('tags')->insert([\n 'name' => 'Renaissance',\n 'slug' => str_slug('Renaissance')\n ]);\n DB::table('tags')->insert([\n 'name' => 'Art',\n 'slug' => str_slug('Art')\n ]);\n DB::table('tags')->insert([\n 'name' => 'Art of History',\n 'slug' => str_slug('Art of History')\n ]);\n }",
"public function run()\n {\n $tags = [\n 'Gluten Free',\n 'Vegan',\n 'Ricetta della Nonna',\n 'Ricco',\n 'Vegetariano',\n 'Tradizionale'\n ];\n\n foreach ($tags as $tag_name){\n $new_tag= new Tag();\n $new_tag->name= $tag_name;\n $new_tag->slug=Str::slug($new_tag->name, '-');\n $new_tag->save();\n\n }\n }",
"public function run()\n {\n DB::table('tags')->insert([\n 'id' => 1,\n 'name' => 'Politics',\n 'created_at'=>'2020-12-03 05:11:19',\n 'updated_at'=>'2020-12-03 05:11:19'\n ]);\n DB::table('tags')->insert([\n 'id' => 2,\n 'name' => 'Economics',\n 'created_at'=>'2020-12-03 06:17:36',\n 'updated_at'=>'2020-12-03 06:17:36'\n ]);\n DB::table('tags')->insert([\n 'id' => 3,\n 'name' => 'Programming',\n 'created_at'=>'2020-12-03 06:17:47',\n 'updated_at'=>'2020-12-03 06:17:47'\n ]);\n DB::table('tags')->insert([\n 'id' => 4,\n 'name' => 'Management',\n 'created_at'=>'2020-12-03 06:17:57',\n 'updated_at'=>'2020-12-03 06:17:57'\n ]);\n DB::table('tags')->insert([\n 'id' => 5,\n 'name' => 'Psychology',\n 'created_at'=>'2020-12-03 06:18:07',\n 'updated_at'=>'2020-12-03 06:18:07'\n ]);\n DB::table('tags')->insert([\n 'id' => 6,\n 'name' => 'Sport',\n 'created_at'=>'2020-12-03 06:18:14',\n 'updated_at'=>'2020-12-03 06:18:14'\n ]);\n\n }",
"public function run()\n {\n $time = date('Y-m-d H:i:s',time());\n $data = [\n ['name' => '操作简单','create_time' => $time],\n ['name' => '门槛超低','create_time' => $time],\n ['name' => '不上征信','create_time' => $time],\n ['name' => '额度高','create_time' => $time],\n ['name' => '审核简单','create_time' => $time],\n ['name' => '通过率高','create_time' => $time],\n ['name' => '无视黑白','create_time' => $time],\n ['name' => '无地域限制','create_time' => $time],\n ];\n\n $this->table('tags')->insert($data)->save();\n }",
"public function run()\n {\n $tags = ['Html', 'CSS', 'JS', 'NPM', 'Siti', 'Soldi', 'Europa', 'Euro', 'Covid', 'Calcio', 'Calciomercato', 'Tennis', 'Ospedali', 'Italia']; \n\n for($i=0; $i < count($tags); $i++) {\n $new_tag = new Tag();\n $new_tag->name = $tags[$i];\n $new_tag->slug = Str::slug($tags[$i], '-');\n $new_tag->save();\n }\n }",
"public function run()\n {\n DB::table('tags_posts')->insert([\n \"id_tag\" => 1,\n \"id_post\" => 1\n ]);\n }",
"function qruqsp_core_tagsUpdate(&$q, $object, $station_id, $key_name, $key_value, $type, $list) {\n //\n // All arguments are assumed to be un-escaped, and will be passed through dbQuote to\n // ensure they are safe to insert.\n //\n\n // Required functions\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbQuote');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbHashIDQuery');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbDelete');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbInsert');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbUUID');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'objectLoad');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'makePermalink');\n\n //\n // Don't worry about autocommit here, it's taken care of in the calling function\n //\n \n //\n // Load the object definition\n //\n $rc = qruqsp_core_objectLoad($q, $object);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $obj = $rc['object'];\n $module = $rc['pkg'] . '.' . $rc['mod'];\n\n //\n // Get the existing list of tags for the item\n //\n $strsql = \"SELECT id, uuid, $key_name, tag_type AS type, tag_name AS name \"\n . \"FROM \" . $obj['table'] . \" \"\n . \"WHERE $key_name = '\" . qruqsp_core_dbQuote($q, $key_value) . \"' \"\n . \"AND tag_type = '\" . qruqsp_core_dbQuote($q, $type) . \"' \"\n . \"AND station_id = '\" . qruqsp_core_dbQuote($q, $station_id) . \"' \"\n . \"\";\n $rc = qruqsp_core_dbHashIDQuery($q, $strsql, $module, 'tags', 'name');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['tags']) || $rc['num_rows'] == 0 ) {\n $dbtags = array();\n } else {\n $dbtags = $rc['tags'];\n }\n\n //\n // Delete tags no longer used\n //\n foreach($dbtags as $tag_name => $tag) {\n if( !in_array($tag_name, $list, true) ) {\n //\n // The tag does not exist in the new list, so it should be deleted.\n //\n $strsql = \"DELETE FROM \" . $obj['table'] . \" \"\n . \"WHERE id = '\" . qruqsp_core_dbQuote($q, $tag['id']) . \"' \"\n . \"AND station_id = '\" . qruqsp_core_dbQuote($q, $station_id) . \"' \"\n . \"\";\n $rc = qruqsp_core_dbDelete($q, $strsql, $module);\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n qruqsp_core_dbAddModuleHistory($q, $module, $obj['history_table'], $station_id,\n 3, $obj['table'], $tag['id'], '*', '');\n\n //\n // Sync push delete\n //\n $q['syncqueue'][] = array('push'=>$object, \n 'args'=>array('delete_uuid'=>$tag['uuid'], 'delete_id'=>$tag['id']));\n }\n }\n\n //\n // Add new tags lists\n //\n foreach($list as $tag) {\n if( $tag != '' && !array_key_exists($tag, $dbtags) ) {\n //\n // Get a new UUID\n //\n $rc = qruqsp_core_dbUUID($q, $module);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $uuid = $rc['uuid'];\n\n if( isset($obj['fields']['permalink']) ) {\n //\n // Make the permalink\n //\n $permalink = qruqsp_core_makePermalink($q, $tag);\n\n // \n // Setup the SQL statement to insert the new thread\n //\n $strsql = \"INSERT INTO \" . $obj['table'] . \" (uuid, station_id, $key_name, tag_type, tag_name, \"\n . \"permalink, date_added, last_updated) VALUES (\"\n . \"'\" . qruqsp_core_dbQuote($q, $uuid) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $station_id) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $key_value) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $type) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $tag) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $permalink) . \"', \"\n . \"UTC_TIMESTAMP(), UTC_TIMESTAMP())\";\n } else {\n // \n // Setup the SQL statement to insert the new thread\n //\n $strsql = \"INSERT INTO \" . $obj['table'] . \" (uuid, station_id, $key_name, tag_type, tag_name, \"\n . \"date_added, last_updated) VALUES (\"\n . \"'\" . qruqsp_core_dbQuote($q, $uuid) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $station_id) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $key_value) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $type) . \"', \"\n . \"'\" . qruqsp_core_dbQuote($q, $tag) . \"', \"\n . \"UTC_TIMESTAMP(), UTC_TIMESTAMP())\";\n }\n $rc = qruqsp_core_dbInsert($q, $strsql, $module);\n // \n // Only return the error if it was not a duplicate key problem. Duplicate key error\n // just means the tag name is already assigned to the item.\n //\n if( $rc['stat'] != 'ok' && $rc['err']['code'] != 'qruqsp.core.73' ) {\n return $rc;\n }\n if( isset($rc['insert_id']) ) {\n $tag_id = $rc['insert_id'];\n //\n // Add history\n //\n qruqsp_core_dbAddModuleHistory($q, $module, $obj['history_table'], $station_id,\n 1, $obj['table'], $tag_id, 'uuid', $uuid);\n qruqsp_core_dbAddModuleHistory($q, $module, $obj['history_table'], $station_id,\n 1, $obj['table'], $tag_id, $key_name, $key_value);\n qruqsp_core_dbAddModuleHistory($q, $module, $obj['history_table'], $station_id,\n 1, $obj['table'], $tag_id, 'tag_type', $type);\n qruqsp_core_dbAddModuleHistory($q, $module, $obj['history_table'], $station_id,\n 1, $obj['table'], $tag_id, 'tag_name', $tag);\n //\n // Sync push\n //\n $q['syncqueue'][] = array('push'=>$module . '.' . $object, 'args'=>array('id'=>$tag_id));\n }\n }\n }\n\n return array('stat'=>'ok');\n}",
"public function run()\n {\n DB::table('tags')->insert(\n [\n \t[\n \t 'key' => 'opensource',\n \t 'name' => 'Open Source',\n \t 'description' => 'Codigo fuente disponible para ser copiado, estudiado, modificado',\n \t 'css_class' => 'label-opensource',\n 'order' => 700\n \t],\n [\n 'key' => 'responsive',\n 'name' => 'Responsive',\n 'description' => 'Diseño ajustable a todo tipo de dispositivo',\n 'css_class' => 'label-responsive',\n 'order' => 400\n ],\n [\n 'key' => 'auto',\n 'name' => 'Autogestionables',\n 'description' => 'Autogestión de contenido mediante un panel de administración',\n 'css_class' => 'label-auto',\n 'order' => 800\n ],\n [\n 'key' => 'game',\n 'name' => 'Juegos',\n 'description' => 'Experimentación con juegos',\n 'css_class' => 'label-game',\n 'order' => 500\n ],\n [\n 'key' => 'research',\n 'name' => 'Investigación',\n 'description' => 'Investigación con distintas tecnologías',\n 'css_class' => 'label-research',\n 'order' => 600\n ],\n [\n 'key' => 'abml',\n 'name' => 'Sistemas de gestión',\n 'description' => 'Desarrollo de sistema de gestión a medida',\n 'css_class' => 'label-intr',\n 'order' => 900,\n ],\n [\n 'key' => 'highlighted',\n 'name' => 'Destacados',\n 'description' => 'Proyecto destacado',\n 'css_class' => 'label-highlighted',\n 'order' => 1000\n ],\n [\n 'key' => 'library',\n 'name' => 'Librería',\n 'description' => 'Libreria',\n 'css_class' => 'label-library',\n 'order' => 710\n ],\n\n ]\n );\n }",
"public function run()\n {\n DB::table('tags')->insert([\n 'id' => 1,\n 'name' => 'New',\n 'slug' => 'new',\n 'color' => '#11cdef',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('tags')->insert([\n 'id' => 2,\n 'name' => 'DevStudyJæm',\n 'slug' => 'devstudyjaem',\n 'color' => '#11cdef',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('tags')->insert([\n 'id' => 3,\n 'name' => 'Sophia',\n 'slug' => 'sophia',\n 'color' => '#155724',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('tags')->insert([\n 'id' => 4,\n 'name' => 'AEproject',\n 'slug' => 'aeproject',\n 'color' => '#004085',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('tags')->insert([\n 'id' => 5,\n 'name' => 'IPFS',\n 'slug' => 'ipfs',\n 'color' => '#383d41',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('tags')->insert([\n 'id' => 6,\n 'name' => 'Beginner',\n 'slug' => 'beginner',\n 'color' => '#004085',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('tags')->insert([\n 'id' => 7,\n 'name' => 'Jæmer',\n 'slug' => 'jaemer',\n 'color' => '#383d41',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n }",
"public function run()\n {\n $tags = Tag::all();\n $posts = Post::all();\n\n foreach ($posts as $post){\n if($post->id % 2 == 0){\n $post->tags()->attach($tags->first());\n }else{\n $post->tags()->attach($tags->last());\n\n }\n }\n\n }",
"public function store(Request $request)\n {\n $request['description'] = trim($request['description']);\n if($request['description']=='<br>')\n $request['description'] ='';\n \n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required',\n 'status' => 'required',\n ]);\n\n $Tag = new Tag([\n 'title' => $request['title'],\n 'description' => htmlentities($request['description']),\n 'status' => $request['status']\n ]);\n\n $Tag->save();\n\n // $tag = \\App\\Tag::find( 1 );\n // $tag->posts()->sync([1001,1002,1003,990]);\n\n return redirect()->route('tag.index')\n ->with('success','Created successfully'); \n }",
"public function updateTags($tagArray) {\n\t\t// include files\n\t\trequire_once(WCF_DIR.'lib/data/tag/TagEngine.class.php');\n\t\trequire_once(WCF_DIR.'lib/data/linkList/link/TaggedLinkListLink.class.php');\n\t\t\n\t\t// save tags\n\t\t$tagged = new TaggedLinkListLink(null, array(\n\t\t\t'linkID' => $this->linkID,\n\t\t\t'taggable' => TagEngine::getInstance()->getTaggable('de.chrihis.wcf.linkList.link')\n\t\t));\n\n\t\t$languageID = 0;\n\t\tif (count(Language::getAvailableContentLanguages()) > 0) {\n\t\t\t$languageID = WCF::getLanguage()->getLanguageID();\n\t\t}\n\t\t\n\t\t// delete old tags\n\t\tTagEngine::getInstance()->deleteObjectTags($tagged, array($languageID));\n\t\t\n\t\t// save new tags\n\t\tif (count($tagArray) > 0) {\n\t\t\tTagEngine::getInstance()->addTags($tagArray, $tagged, $languageID);\n\t\t}\n\t}",
"public function run()\n {\n $adminEmail = '[email protected]';\n $user = User::whereEmail($adminEmail)->firstOrfail();\n $tags = Tag::whereVisibility(1)->get();\n $user->tags()->attach($tags);\n }",
"public function run()\n {\n //\n DB::table('blog_tags')->insert([\n 'tag' => \"Pink\",\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),\n ]);\n\n DB::table('blog_tags')->insert([\n 'tag' => \"T-Shirt\",\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),\n ]);\n }",
"public function syncTags(Article $article, $tags)\n {\n $article->tags()->sync($tags);\n }",
"public function run()\n {\n //\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Area de niños'\n \t]);\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Bar'\n \t]);\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Buffet'\n \t]);\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Cortes'\n \t]);\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Coctelería'\n \t]);\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Deportivo'\n \t]);\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Desayunos'\n \t]);\n DB::table('tags')->insert([\n \t\t'name'\t=>\t'Familiar'\n \t]);\n }",
"public function run()\n {\n $values = [\n 'Blogging',\n 'Freelancing',\n 'How to Succeed'\n ];\n\n //App\\Tag::truncate(); //brise sve tagove\n\n foreach($values as $value){\n App\\Tag::create([\n 'name'=>$value\n ]);\n } //kreiramo za svaki clan gore od niza po tag\n\n App\\Post::all()->each(function(App\\Post $post){\n $randIds = \\App\\Tag::inRandomOrder()->select('id')->take(2)->pluck('id');\n $post->tags()->attach($randIds);\n //za svaki post atacuje po 2 random izabrana taga\n });\n }",
"protected function setTags()\n {\n /*todo check role and flush based on tags*/\n $this->authBasedTag();\n }",
"public function run()\n {\n $tags = [\n 'Gluten Free',\n 'Vegetariano',\n 'Vegano',\n 'Ricetta dell nonna',\n 'Piatto veloce',\n 'Mediterranea',\n 'Tradizionale',\n 'Internazionale'\n ];\n \n foreach($tags as $tag_name) {\n $new_tag = new Tag();\n $new_tag->name = $tag_name;\n $new_tag->slug = Str::slug($new_tag->name, '-');\n $new_tag->save();\n }\n \n }",
"public function run()\n {\n News::whereNotNull('id')->delete();\n DB::statement('ALTER TABLE `'.((new News())->getTable()).'` AUTO_INCREMENT=1');\n \n foreach (range(1, 20) as $index) {\n $input = [\n 'slug' => $this->faker->slug(),\n 'position' => $index,\n 'status' => 1,\n 'image' => $this->faker->imageUrl(250, 250, 'business'),\n ];\n \n foreach (Config::get('app.locales') as $locale) {\n $input[$locale] = [\n 'name' => $this->getLocalizedFaker()->realText(rand(20, 50)),\n 'short_content' => '<p>'.$this->getLocalizedFaker()->realText(250).'</p>',\n 'content' => '<p>'.$this->getLocalizedFaker()->realText(500).'</p>',\n 'meta_title' => $this->getLocalizedFaker()->sentence(rand(5, 10)),\n 'meta_keywords' => $this->getLocalizedFaker()->sentence(rand(5, 10)),\n 'meta_description' => $this->getLocalizedFaker()->text(150),\n ];\n }\n \n $model = new News($input);\n $model->save();\n \n $tags = Tag::all()->random(rand(2, 5))->toArray();\n foreach ((array) $tags as $tag) {\n $tagged = new Tagged(['tag_id' => $tag['id']]);\n \n $model->tags()->save($tagged);\n }\n }\n }",
"private function _insertTags($objectId,$tags){\n\t\t$tagObj = Doctrine_Core::getTable('Tag');\n\t\t\n\t\tforeach($tags as $tag){\n\t\t\t$result = $tagObj->findOneByNume($tag);\n\t\t\tif ($result->id) {\n\t\t\t\t$this->_insertTagObiect($objectId,$result->id);\n\t\t\t}else {\n\t\t\t\t$newTagObj = new Tag;\n\t\t\t\t$newTagObj->nume = $tag;\n\t\t\t\t$newTagObj->save();\n\t\t\t\t\n\t\t\t\t$this->_insertTagObiect($objectId,$newTagObj->id);\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function sync()\n\t{\n\t\t// Loop through the template partials\n\t\tforeach ($this->dbPartials as $dbKey => $dbVal) {\n\t\t\t// If the file does not exist, or does not have html extension\n\t\t\t// Delete the DB partial\n\t\t\tif (! isset($this->filePartials[$dbKey]) ||\n\t\t\t\t$this->filePartials[$dbKey]->extension !== 'html'\n\t\t\t) {\n\t\t\t\t$dbVal->delete();\n\t\t\t}\n\t\t}\n\t}",
"public function run()\n {\n $faker = Faker::create();\n\n $categoryIds = \\App\\Category::lists('id')->toArray();\n $tagIds = \\App\\Tag::lists('id')->toArray();\n\n foreach (range(1, 30) as $index) {\n\n $post = \\App\\Post::create([\n 'title' => $faker->title(),\n 'description' => $faker->sentence(),\n 'category_id' => $faker->randomElement($categoryIds),\n 'content' => $faker->paragraph()\n ]);\n\n $tags = $faker->randomElements($tagIds, 3);\n\n $post->tags()->sync($tags);\n\n }\n }",
"function twitter_store_tags(int $uriId, array $taglist)\n{\n\tforeach ($taglist as $tag) {\n\t\tTag::storeByHash($uriId, $tag[0], $tag[1], $tag[2]);\n\t}\n}",
"public function flushByTags(array $tags): int;",
"public function updateTags()\n {\n\n $this->syncTags();\n $ticker = $this->request->ticker;\n\n return redirect('/data/' . $ticker);\n\n }",
"public function run()\n {\n for($i=0;$i<=50;$i++){\n DB::table('tags')->insert([\n 'name'=>str_random(10),\n 'created_at'=>date('Y-m-d H:i:m',time()),\n 'updated_at'=>date('Y-m-d H:i:m',time()),\n ]);\n }\n\n //factory('\\App\\Http\\Model\\Tag',50)->create();\n }",
"public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }",
"public function run()\n {\n \tDB::table('tags')->truncate();\n\t\t$tag1 = Tag::create([\n\t\t\t'name' \t\t\t\t=> 'Tutorial',\n\t\t\t'description' \t\t=> 'Everything instructional.',\n\t\t\t'background_color' \t=> '#c200c9',\n\t\t\t'text_color'\t\t=> null,\n\t\t\t'created_by' \t\t=> 1,\n\t\t\t'updated_by' \t\t=> 1\n\t\t]);\n\t\t\n\t\t$tag2 = Tag::create([\n\t\t\t'name' \t\t\t\t=> 'Programming',\n\t\t\t'description' \t\t=> 'Making software by coding.',\n\t\t\t'background_color' \t=> '#3c3b37',\n\t\t\t'text_color'\t\t=> null,\n\t\t\t'created_by' \t\t=> 1,\n\t\t\t'updated_by' \t\t=> 1\n\t\t]);\n\t\t\n\t\t$tag3 = Tag::create([\n\t\t\t'name' \t\t\t\t=> 'Mobile Dev',\n\t\t\t'description' \t\t=> 'Everything related to mobile apps development.',\n\t\t\t'background_color' \t=> '#7fb348',\n\t\t\t'text_color'\t\t=> null,\n\t\t\t'created_by' \t\t=> 1,\n\t\t\t'updated_by' \t\t=> 1\n\t\t]);\n\t\t\n\t\t$tag4 = Tag::create([\n\t\t\t'name' \t\t\t\t=> 'HEMA',\n\t\t\t'description' \t\t=> 'Historical European Martial Art.',\n\t\t\t'background_color' \t=> null,\n\t\t\t'text_color'\t\t=> null,\n\t\t\t'created_by' \t\t=> 5,\n\t\t\t'updated_by' \t\t=> 5\n\t\t]);\n\t\t\n\t\t$tag5 = Tag::create([\n\t\t\t'name' \t\t\t\t=> 'Dragonball Training',\n\t\t\t'description' \t\t=> 'Training programme for non-Saiyans.',\n\t\t\t'background_color' \t=> '#f8a333',\n\t\t\t'text_color'\t\t=> null,\n\t\t\t'created_by' \t\t=> 4,\n\t\t\t'updated_by' \t\t=> 4\n\t\t]);\n }",
"public function updateTags($tags)\n {\n $tagtypes = ['disciplines' => 1, 'applications' => 2,\n 'techniques' => 3, 'facilities' => 4];\n\n $currentTags = $this->getTagIds();\n if (!empty($currentTags)) {\n // merge all input tags for comparison\n $inputTags = [];\n foreach ($tagtypes as $type) {\n if (!empty($tags[$type]) && is_array($tags[$type])) {\n array_merge($inputTags, $tags[$type]);\n }\n }\n // detach all tags that were not input\n foreach ($currentTags as $curTag) {\n if (!in_array($curTag, $inputTags)) {\n $this->tags()->detach($curTag);\n }\n }\n }\n\n foreach ($tagtypes as $type => $key) {\n if (!empty($tags[$type])) {\n foreach ($tags[$type] as $element) {\n $id = is_numeric($element)\n ? $element\n : Tag::create(['name' => $element,\n 'category' => 'Other', 'tagtype_id' => $key]);\n $this->tags()->attach($id);\n }\n }\n }\n }",
"public function run()\n\t{\n\t\tDB::table('posts_tags')->truncate();\n\n\t\t$arrayPost = $arrayTag = array();\n\n\t\tif (Schema::hasTable('posts') && Schema::hasTable('tags')) {\n\t\t\tfor ($i = 0 ; $i <= 20 ; $i++) {\n\t\t\t\tdo {\n\t\t\t\t\t$posts = Post::all()->lists('id')->toArray();\n\t\t\t\t\t$arrayPost[$i] = $posts[array_rand($posts)];\n\t\t\t\t} while (!in_array($arrayPost[$i], $arrayPost));\n\n\t\t\t\tdo {\n\t\t\t\t\t$tags = Tag::all()->lists('id')->toArray();\n\t\t\t\t\t$arrayTag[$i] = $tags[array_rand($tags)];\n\t\t\t\t} while (!in_array($arrayTag[$i], $arrayTag));\n\t\t\t}\n\n\t\t\tfor ($i = 0 ; $i <= 20 ; $i++) {\n\t\t\t\tDB::table('posts_tags')->insert(['post_id' => $arrayPost[$i], 'tag_id' => $arrayTag[$i]]);\n\t\t\t}\n\t\t}\n\t}",
"function _migrateLyftenTags()\n\t{\n\t // no relations created for each blog vs tag\n\n\t $db \t= EasyBlogHelper::db();\n\t $suId = $this->_getSAUserId();\n\t $now\t= EasyBlogHelper::getDate();\n\n\t $query = 'insert into `#__easyblog_tag` (`created_by`, `title`, `alias`, `created`, `published`)';\n\t\t$query .= ' select ' . $db->Quote($suId) . ', `name`, `slug`, '. $db->Quote($now->toMySQL()).', ' . $db->Quote('1');\n\t\t$query .= ' from `#__bloggies_tags`';\n\t\t$query .= ' where `name` not in (select `title` from `#__easyblog_tag`)';\n\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\n\t\treturn true;\n\t}",
"public function run()\n {\n $tag = new Tag([\n \t'name' => 'Web Programming'\n ]);\n $tag->save();\n\n $tag = new Tag([\n \t'name' => 'Mobile Programming'\n ]);\n $tag->save();\n\n $tag = new Tag([\n \t'name' => 'Desktop Programming'\n ]);\n $tag->save();\n\n $tag = new Tag([\n \t'name' => 'Laravel'\n ]);\n $tag->save();\n }",
"public function run()\n {\n /* 태그 */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n\n $tags = config('project.tags');\n\n foreach(array_transpose($tags) as $slug => $names) {\n App\\Tag::create([\n 'name' => $names['ko'],\n 'ko' => $names['ko'],\n 'en' => $names['en'],\n 'slug' => Str::slug($slug)\n ]);\n }\n\n // foreach($tags as $slug => $name) {\n // App\\Tag::create([\n // 'name' => $name,\n // 'slug' => Str::slug($slug)\n // ]);\n // }\n\n /**\n * 별도의 seeder class로 추출하고 마스터시더에서 call()할 때는 \n * command구문없이도 콘솔에 결과가 출력된다.\n */\n // $this->command->info('Seeded : tags table');\n\n /* 변수 선언 */\n $faker = app(Faker\\Generator::class);\n $users = App\\User::all();\n $articles = App\\Article::all();\n $tags = App\\Tag::all();\n\n /* 아티클과 태그 연결 */\n foreach($articles as $article) {\n $article->tags()->sync(\n $faker->randomElements($tags->pluck('id')->toArray(), rand(1, 3))\n );\n }\n\n // $this->command->info('Seed : article_tag table');\n }",
"public function run()\n {\n DB::table('post_tag')->truncate();\n\n $post_ids = range(1, 30);\n $tag_ids = range(1, 10);\n\n foreach($post_ids as $post_id)\n {\n $i = rand(1, 3);\n $keys = array_rand($tag_ids, $i);\n $keys = is_array($keys) ? $keys : [$keys];\n foreach($keys as $j)\n {\n DB::table('post_tag')->insert([\n 'post_id' => $post_id,\n 'tag_id' => $tag_ids[$j]\n ]);\n }\n }\n }",
"public function UpdateTags() {\n\t\t$tags = TaxonomyTerm::get()\n\t\t\t->innerJoin('BasePage_Terms', '\"TaxonomyTerm\".\"ID\"=\"BasePage_Terms\".\"TaxonomyTermID\"')\n\t\t\t->innerJoin(\n\t\t\t\t'SiteTree',\n\t\t\t\tsprintf('\"SiteTree\".\"ID\" = \"BasePage_Terms\".\"BasePageID\" AND \"SiteTree\".\"ParentID\" = \\'%d\\'', $this->ID)\n\t\t\t)\n\t\t\t->sort('Name');\n\n\t\treturn $tags;\n\t}",
"public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}",
"public function addTags($tags, $delimiter = ',')\n {\n //parse tags\n if(!is_array($tags)) {\n $tags = Tag::strToArray($tags, $delimiter);\n }\n\n //create un-available tags\n $availableTagObjs = Tag::find()->where(['name' => $tags])->all();\n\t $availableTags = ArrayHelper::getColumn($availableTagObjs, 'name');\n\t $unavailabelTags = array_diff($tags, $availableTags);\n\t\tforeach($unavailabelTags as $tag){\n\t\t\t$objTag = new Tag();\n\t\t\t$objTag->name = $tag;\n\t\t\t$objTag->save();\n\n\t\t\t$availableTagObjs[] = $objTag;\n\t\t}\n\n\t\t//unlink all old tags\n\t //TODO :: instead of un-linking all old tags, just remove missing only\n\t $this->unlinkAll('tags', true);\n\n\t\t//link new tags to post\n\t\tforeach ($availableTagObjs as $objTag){\n\t\t\t$this->link('tags', $objTag);\n\t\t}\n\n\t\treturn true;\n }",
"protected static function bootTaggable()\n {\n //calling tags on model, adding new manytomany with sync having all the tags returned by function\n static::updating(function ($model) {\n $model->tags()->sync(static::findTagsInContent($model->content));\n });\n\n static::created(function ($model) {\n $model->tags()->sync(static::findTagsInContent($model->content));\n });\n }",
"private function preloadTags(){\n if(Tag::all()->count()==0){\n //if no tag in db, load into db from infusionsoft\n\n $infusionsoftHelper = new InfusionsoftHelper();\n $allTags = $infusionsoftHelper->getAllTags()->all();\n $tagsArray = [];\n\n foreach ($allTags as $tag)\n $tagsArray[] = [\n 'tag_id'=>$tag->id,\n 'name'=>$tag->name,\n 'slug'=>str_slug($tag->name) //give each tag a slug for easily finding it later\n ];\n\n Tag::insert($tagsArray);\n }\n }",
"public function syncTag(ad $ad, array $tags)\n {\n return $ad->tags()->sync($tags);\n }",
"public function save() {\n // Check to see if another tag exists with the same name\n $duplicate_tag = ORM::factory(\"tag\")\n ->where(\"name\", \"=\", $this->name)\n ->where(\"id\", \"!=\", $this->id)\n ->find();\n if ($duplicate_tag->loaded()) {\n // If so, tag its items with this tag so as to merge it\n $duplicate_tag_items = ORM::factory(\"item\")\n ->join(\"items_tags\", \"items.id\", \"items_tags.item_id\")\n ->where(\"items_tags.tag_id\", \"=\", $duplicate_tag->id)\n ->find_all();\n foreach ($duplicate_tag_items as $item) {\n $this->add($item);\n }\n\n // ... and remove the duplicate tag\n $duplicate_tag->delete();\n }\n\n if (isset($this->object_relations[\"items\"])) {\n $added = array_diff($this->changed_relations[\"items\"], $this->object_relations[\"items\"]);\n $removed = array_diff($this->object_relations[\"items\"], $this->changed_relations[\"items\"]);\n if (isset($this->changed_relations[\"items\"])) {\n $changed = array_merge($added, $removed);\n }\n $this->count = count($this->object_relations[\"items\"]) + count($added) - count($removed);\n }\n\n $result = parent::save();\n\n if (!empty($changed)) {\n foreach (ORM::factory(\"item\")->where(\"id\", \"IN\", $changed)->find_all() as $item) {\n module::event(\"item_related_update\", $item);\n }\n }\n\n return $result;\n }",
"private function sync_pedido()\n {\n //listar os pedidos\n $this->get_pedidos();\n //verificar se existe em shopify\n\n //update no shopfy\n }",
"public function processTag()\n {\n $tags = '';\n\n $articles = $this->dao->select('id, keywords')->from(TABLE_ARTICLE)->fetchPairs('id', 'keywords'); \n foreach($articles as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_ARTICLE)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags = $keywords;\n }\n\n $products = $this->dao->select('id, keywords')->from(TABLE_PRODUCT)->fetchPairs('id', 'keywords'); \n foreach($products as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_PRODUCT)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags .= ',' . $keywords;\n }\n\n $categories = $this->dao->select('id, keywords')->from(TABLE_CATEGORY)->fetchPairs('id', 'keywords'); \n foreach($categories as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_CATEGORY)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags .= ',' . $keywords;\n }\n\n $this->loadModel('tag')->save($tags);\n }",
"private function syncTags(Fund $fund, $t)\n {\n if($t == null)\n {\n $fund->categories()->detach();\n } else{\n //Add any new tags\n $category = $this->processNewCategory($t);\n\n $fund->categories()->sync($category);\n }\n\n }",
"public function run()\n {\n $tags = collect(['Politics', 'Science', 'Sports', 'Economy', 'Entertainment']);\n\n $tags->each(function($tag) {\n Tag::create([\n 'name' => $tag\n ]);\n });\n }",
"public function push() {\n\t\t$this->save();\n\n\t\t// To sync all of the relationships to the database, we will simply spin through\n\t\t// the relationships, calling the \"push\" method on each of the models in that\n\t\t// given relationship, this should ensure that each model is saved.\n\t\tforeach ($this->relationships as $name => $models) {\n\t\t\tif ( ! is_array($models)) {\n\t\t\t\t$models = array($models);\n\t\t\t}\n\n\t\t\tforeach ($models as $model) {\n\t\t\t\t$model->push();\n\t\t\t}\n\t\t}\n\t}",
"public function run()\n {\n factory(App\\Tag::class, 20)->create()->each(function ($el){\n $el->save();\n });\n }",
"public function run()\n {\n \t$type = array(\n \t\t'App\\Question',\n \t\t'App\\Documentation'\n \t\t);\n for($i = 1; $i <= 100; $i++)\n {\n \tDB::table('taggables')->insert(\n\t \t[\n\t \t\t'tag_id' => rand(1,20),\n\t \t\t'taggable_id' => rand(1,10),\n\t \t\t'taggable_type' => $type[rand(0,1)],\n\t \t'created_at' => new DateTime(),\n 'updated_at' => new DateTime()\n\t \t]\n \t);\n }\n }",
"public function run()\n {\n //clean db\n DB::table('tags')->delete();\n\n //generate roles from json\n $json = File::get(\"database/data/tags.json\");\n $data = json_decode($json);\n\n foreach($data as $obj){\n Tag::create([\n 'name' => $obj->name,\n 'slug' => Str::slug($obj->name),\n 'isMature' => $obj->isMature,\n ]);\n }\n }",
"public function run()\n {\n \\App\\Models\\Tag::factory(30)->create();\n\n $tags = \\App\\Models\\Tag::all();\n\n \\App\\Models\\Post::all()->each(function ($post) use ($tags) {\n $post->tags()->sync(\n $tags->random(rand(1, 6))->pluck('id')->toArray()\n );\n });\n }",
"static function addTag($tags){\n\t\t//fetch corresponding tagids\n\t\t$length = count($tags);\n\t\t$db = (new Database)->connectToDatabase();\n\t\tfor($i=0;$i<$length;$i++){\n\t\t\t$db->query(\"SELECT * FROM tag_table WHERE tag_name='$tags[i]'\");\n\t\t\tif($db->returned_rows==0){\n\t\t\t\t//no tag found in tag table... so add it\n\t\t\t\t$db->query(\"INSERT INTO tag_table (tag_name) VALUES ('$tag[i]')\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//check if tag already there with post?\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\n\t}",
"public function run()\n {\n $tag = Tag::findOrCreate('SVG', 'courseTag');\n $tag->setTranslation('name', 'nl', 'SVG');\n $tag->save();\n\n $tag = Tag::findOrCreate('PHP', 'courseTag');\n $tag->setTranslation('name', 'nl', 'PHP');\n $tag->save();\n\n $tag = Tag::findOrCreate('CSS', 'courseTag');\n $tag->setTranslation('name', 'nl', 'CSS');\n $tag->save();\n\n $tag = Tag::findOrCreate('HTML', 'courseTag');\n $tag->setTranslation('name', 'nl', 'HTML');\n $tag->save();\n\n $tag = Tag::findOrCreate('Schrijven', 'courseTag');\n $tag->setTranslation('name', 'nl', 'Schrijven');\n $tag->save();\n }"
] | [
"0.65426326",
"0.6495874",
"0.6242632",
"0.6236097",
"0.6214575",
"0.620443",
"0.61687785",
"0.6151563",
"0.60765684",
"0.602629",
"0.6003759",
"0.5991478",
"0.5988167",
"0.5977015",
"0.59762394",
"0.59760094",
"0.59514785",
"0.59126663",
"0.5912211",
"0.58993334",
"0.58964527",
"0.58618194",
"0.5827801",
"0.5814083",
"0.5813862",
"0.5798668",
"0.5796792",
"0.5796481",
"0.57927376",
"0.57787704",
"0.5778616",
"0.5777487",
"0.5759306",
"0.57381076",
"0.5735951",
"0.5724457",
"0.57231104",
"0.5721739",
"0.5717703",
"0.5716352",
"0.57156694",
"0.571403",
"0.5710678",
"0.56760424",
"0.5666792",
"0.56630033",
"0.565182",
"0.5626901",
"0.56175435",
"0.56119263",
"0.559555",
"0.5592558",
"0.5574015",
"0.5569943",
"0.55421704",
"0.5528305",
"0.5522235",
"0.55061954",
"0.5473494",
"0.5472485",
"0.5467449",
"0.545744",
"0.5444473",
"0.5441799",
"0.5435032",
"0.5426072",
"0.5413986",
"0.5408605",
"0.540671",
"0.53995734",
"0.53987324",
"0.5393805",
"0.5381104",
"0.5380257",
"0.53758323",
"0.5373957",
"0.53667873",
"0.53621143",
"0.5357253",
"0.5350338",
"0.53482974",
"0.53435683",
"0.5335281",
"0.53325593",
"0.5325421",
"0.5317627",
"0.53170055",
"0.5316397",
"0.53154767",
"0.5313704",
"0.5311696",
"0.53096414",
"0.53062916",
"0.5297774",
"0.5281867",
"0.5280766",
"0.5278735",
"0.5275105",
"0.52683055",
"0.5259822"
] | 0.57872665 | 29 |
Save a new article. | private function createTorrent(TorrentRequest $request)
{
$collection = \Tmdb::getMoviesApi()->getMovie($request->input('tmdb_id'))['belongs_to_collection'];
if ($collection['name'] != null) {
$serie = Serie::firstOrCreate(['title' => $collection['name'], 'tmdb_id' => $collection['id']]);
} else {
$serie['id'] = 0;
}
$movie = Movie::firstOrCreate(['serie_id' => $serie['id'], 'title' => $request->input('title'), 'tmdb_id' => $request->input('tmdb_id')]);
$request->request->add(['movie_id' => $movie->id, 'serie_id' => $serie['id']]);
$torrent = Auth::user()->torrents()->create($request->all());
$this->syncTags($movie, $request->input('tag_list'));
return $torrent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $article = Articles::findFirstByid($id);\n if (!$article) {\n $this->flash->error(\"article does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $article->id = $this->request->getPost(\"id\");\n $article->title = $this->request->getPost(\"title\");\n $article->slug = $this->request->getPost(\"slug\");\n $article->content = $this->request->getPost(\"content\"); \n $article->isPublished = $this->request->getPost(\"isPublished\"); \n\n if (!$article->save()) {\n\n foreach ($article->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"edit\",\n \"params\" => array($article->id)\n ));\n }\n\n $this->flash->success(\"article was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n\n }",
"public function save()\n {\n parent::save();\n\n $soxId = $this->getEditObjectId();\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n // shopid\n $sShopID = oxRegistry::getSession()->getVariable(\"actshop\");\n $aParams['oxarticles__oxshopid'] = $sShopID;\n\n $oArticle = oxNew(\"oxarticle\");\n $oArticle->loadInLang($this->_iEditLang, $soxId);\n\n $oArticle->setLanguage(0);\n\n // checkbox handling\n if (!$oArticle->oxarticles__oxparentid->value && !isset($aParams['oxarticles__oxremindactive'])) {\n $aParams['oxarticles__oxremindactive'] = 0;\n }\n\n $oArticle->assign($aParams);\n\n //tells to article to save in different language\n $oArticle->setLanguage($this->_iEditLang);\n $oArticle = oxRegistry::get(\"oxUtilsFile\")->processFiles($oArticle);\n\n $oArticle->resetRemindStatus();\n\n $oArticle->updateVariantsRemind();\n\n $oArticle->save();\n }",
"function save()\n\t{\n\t\t// Check for request forgeries\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t// Initialize variables\n\t\t$db = & JFactory::getDBO();\n\t\t$user = & JFactory::getUser();\n\t\t$task = JRequest::getVar( 'task', null, 'default', 'cmd' );\n\n\t\t// Make sure you are logged in and have the necessary access rights\n\t\tif ( $user->get( 'gid' ) < 19 )\n\t\t{\n\t\t\tJError::raiseError( 403, JText::_( 'ALERTNOTAUTH' ) );\n\t\t\treturn;\n\t\t}\n\n\t\t// Create a user access object for the user\n\t\t$access = new stdClass();\n\t\t$access->canEdit = $user->authorize( 'com_content', 'edit', 'content', 'all' );\n\t\t$access->canEditOwn = $user->authorize( 'com_content', 'edit', 'content', 'own' );\n\t\t$access->canPublish = $user->authorize( 'com_content', 'publish', 'content', 'all' );\n\n\t\tif ( !($access->canEdit || $access->canEditOwn) )\n\t\t{\n\t\t\tJError::raiseError( 403, JText::_( \"ALERTNOTAUTH\" ) );\n\t\t}\n\n\t\t//get data from the request\n\t\t$model = $this->getModel( 'article' );\n\n\t\t//get data from request\n\t\t$post = JRequest::get( 'post' );\n\t\t$post['text'] = JRequest::getVar( 'text', '', 'post', 'string', JREQUEST_ALLOWRAW );\n\n\t\t//preform access checks\n\t\t$isNew = ((int) $post['id'] < 1);\n\n\t\tif ( $model->store( $post ) )\n\t\t{\n\t\t\t$msg = JText::_( 'Article Saved' );\n\n\t\t\tif ( $isNew )\n\t\t\t{\n\t\t\t\t$post['id'] = (int) $model->get( 'id' );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = JText::_( 'Error Saving Article' );\n\t\t\tJError::raiseError( 500, $model->getError() );\n\t\t}\n\n\t\t// manage frontpage items\n\t\t//TODO : Move this into a frontpage model\n\t\trequire_once (JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_frontpage' . DS . 'tables' . DS . 'frontpage.php');\n\t\t$fp = new TableFrontPage( $db );\n\n\t\tif ( JRequest::getVar( 'frontpage', false, '', 'boolean' ) )\n\t\t{\n\t\t\t// toggles go to first place\n\t\t\tif ( !$fp->load( $post['id'] ) )\n\t\t\t{\n\t\t\t\t// new entry\n\t\t\t\t$query = 'INSERT INTO #__content_frontpage' .\n\t\t\t\t\t\t\t\t' VALUES ( ' . (int) $post['id'] . ', 1 )';\n\t\t\t\t$db->setQuery( $query );\n\t\t\t\tif ( !$db->query() )\n\t\t\t\t{\n\t\t\t\t\tJError::raiseError( 500, $db->stderr() );\n\t\t\t\t}\n\t\t\t\t$fp->ordering = 1;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no frontpage mask\n\t\t\tif ( !$fp->delete( $post['id'] ) )\n\t\t\t{\n\t\t\t\t$msg .= $fp->stderr();\n\t\t\t}\n\t\t\t$fp->ordering = 0;\n\t\t}\n\t\t$fp->reorder();\n\n\t\t$model->checkin();\n\n\t\t// gets section name of item\n\t\t$query = 'SELECT s.title' .\n\t\t\t\t\t\t' FROM #__sections AS s' .\n\t\t\t\t\t\t' WHERE s.scope = \"content\"' .\n\t\t\t\t\t\t' AND s.id = ' . (int) $post['sectionid'];\n\t\t$db->setQuery( $query );\n\t\t// gets category name of item\n\t\t$section = $db->loadResult();\n\n\t\t$query = 'SELECT c.title' .\n\t\t\t\t\t\t' FROM #__categories AS c' .\n\t\t\t\t\t\t' WHERE c.id = ' . (int) $post['catid'];\n\t\t$db->setQuery( $query );\n\t\t$category = $db->loadResult();\n\n\t\tif ( $isNew )\n\t\t{\n\t\t\t// messaging for new items\n\t\t\trequire_once (JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_messages' . DS . 'tables' . DS . 'message.php');\n\n\t\t\t// load language for messaging\n\t\t\t$lang = & JFactory::getLanguage();\n\t\t\t$lang->load( 'com_messages' );\n\n\t\t\t$query = 'SELECT id' .\n\t\t\t\t\t\t\t' FROM #__users' .\n\t\t\t\t\t\t\t' WHERE sendEmail = 1';\n\t\t\t$db->setQuery( $query );\n\t\t\t$users = $db->loadResultArray();\n\t\t\tforeach ( $users as $user_id )\n\t\t\t{\n\t\t\t\t$msg = new TableMessage( $db );\n\t\t\t\t$msg->send( $user->get( 'id' ), $user_id, JText::_( 'New Item' ), JText::sprintf( 'ON_NEW_CONTENT', $user->get( 'username' ), $post['title'], $section, $category ) );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If the article isn't new, then we need to clean the cache so that our changes appear realtime :)\n\t\t\t$cache = &JFactory::getCache( 'com_content' );\n\t\t\t$cache->clean();\n\t\t}\n\n\t\tif ( $access->canPublish )\n\t\t{\n\t\t\t// Publishers, admins, etc just get the stock msg\n\t\t\t$msg = JText::_( 'Item successfully saved.' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = $isNew ? JText::_( 'THANK_SUB' ) : JText::_( 'Item successfully saved.' );\n\t\t}\n\n\t\t$referer = JRequest::getString( 'ret', base64_encode( JURI::base() ), 'get' );\n\t\t$referer = base64_decode( $referer );\n\t\tif ( !JURI::isInternal( $referer ) )\n\t\t{\n\t\t\t$referer = '';\n\t\t}\n\t\t$this->setRedirect( $referer, $msg );\n\n\t}",
"public function save(Article $entity)\n {\n if ($entity->getId() > 0) {\n $request = self::$pdo->prepare('UPDATE article SET title=:title, content=:content, category=:category WHERE id = :id');\n $request->bindValue(':id', $entity->getId());\n } else {\n $request = self::$pdo->prepare('INSERT INTO article (title, content, category) VALUES (:title, :content, :category)');\n }\n\n $request->bindValue(':title', $entity->getTitle());\n $request->bindValue(':content', $entity->getContent());\n $request->bindValue(':category', $entity->getCategory());\n\n if (!$request->execute()) {\n // Affiche l'erreur PDO sous forme de warning PHP\n $error = $request->errorInfo();\n trigger_error($error[2], E_USER_WARNING);\n }\n }",
"public function saveArticle(Article $article) {\n if ($article->getId() === 0 ||$article->getId() == null) {\n $request = DB::getInstance()->prepare(\"\n INSERT INTO articles(title, content, user_fk) VALUES (:title, :content, :user_fk)\n \");\n\n $request->bindValue(':title', $article->getTitle());\n $request->bindValue(':content', $article->getContent());\n $request->bindValue(':user_fk', $article->getUserFk());\n\n $request->execute();\n\n if ($request) {\n echo \"Article saved in DB\";\n }\n }\n\n // Else it's an update of the article\n else {\n $request = DB::getInstance()->prepare(\"\n UPDATE articles SET title = :title, content = :content, user_fk = :user_fk WHERE id = :id\n \");\n\n $request->bindValue(':title', $article->getTitle());\n $request->bindValue(':content', $article->getContent());\n $request->bindValue(':user_fk', $article->getUserFk());\n $request->bindValue(':id', $article->getId());\n\n $request->execute();\n\n if ($request) {\n echo \"Article updated\";\n }\n }\n\n }",
"public function saveArticle()\n {\n $article = new ArticlesList;\n $article->issue = Input::get('issue');\n $article->articleno = Input::get('articleNo');\n $article->language = Input::get('language');\n $article->articleHeading = Input::get(\"heading\");\n $article->author = Input::get(\"author\");\n\n //include the advertisement\n if (Input::hasFile('adImage')) {\n $fileName = Input::get('issue') . '-' . Input::get('articleNo') . '.' . Input::file('adImage')->getClientOriginalExtension();\n Input::file('adImage')->move(public_path() . '/Images/magazines/articles/' . Input::get('issue') . '/ads/', $fileName);\n $adImageLink = '/Images/magazines/articles/' . Input::get('issue') . '/ads/' . $fileName;\n $article->hasAd = true;\n $article->adImage = $adImageLink;\n }\n $status = $article->save();\n\n if ($status == true) {\n $article = new ArticleData;\n $article->issue = $_POST['issue'];\n $article->articleno = $_POST['articleNo'];\n\n $link = null;\n if (Input::hasFile('image')) {\n $fileName = Input::get('issue') . '-' . Input::get('articleNo') . '.' . Input::file('image')->getClientOriginalExtension();\n Input::file('image')->move(public_path() . '/Images/magazines/articles/' . Input::get('issue') . '/', $fileName);\n $link = '/Images/magazines/articles/' . Input::get('issue') . '/' . $fileName;\n Log::info($link);\n } else {\n return Redirect::back()->with('error', \"Image is required!\")->withInput();\n }\n\n $article->image = $link;\n $article->data = $_POST['data'];\n $status = $article->save();\n\n if ($status == true) {\n return Redirect::to('addarticle/' . Input::get('issue'))\n ->with('success', Input::get('articleNo') . ' added successfully!');\n } else {\n return Redirect::back()->with('error', 'Article not saved');\n }\n }\n return Redirect::back()->with('error', 'Article not saved');\n }",
"public function insert($article);",
"public function store(createArticleRequest $request)\n\t{\n\t\t$article = new Article($request->all());\n\n\t\t$name = $request->input('interest');\n\n\t\t$tag_id = DB::table('interests')\n\t\t\t->select('interests.id')\n\t\t\t->where('name','=',$name)->get();\n\n\t\t$article->interest()->attach($tag_id);\n\n\t\tAuth::user()->article()->save($article);\n\n\n\n\t\tflash()->overlay('Your article has been created', 'Thank you for posting');\n\t\t\n\t\treturn redirect('article');\n\t}",
"public function store()\n\t{\n\t\tif ($this->validateArticleForm() === true)\n\t\t{\n\t\t\t$Article = $this->saveArticleProperties();\n\t\t\tif (!is_null($Article))\t$this->saveArticleDetail($Article);\n\t\n\t\t\t// redirect\n\t\t\tSession::flash('message', 'Successfully created article!');\n\t\t\treturn Redirect::to('admin/articles');\n\t\t}else return $this->validateArticleForm();\n\t}",
"public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'title' => 'required',\n\t\t\t'text' => 'required'\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('article/create');\n\t\t} else {\n\t\t\t$article = new Article;\n\t\t\t$article->title = Input::get('title');\n\t\t\t$article->text = Input::get('text');\n\t\t\t$article->save();\n\t\t\tSession::flash('message', 'Successfully created article!');\n\t\t\treturn Redirect::to('article/'.$article->id);\n\t\t}\n\t}",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public static function store(ArticleRequest $request)\n {\n $article = New Article;\n $input=$request->all();\n $article->titre=$input['titre'];\n if (!isset($input['anonym'])){\n $article->auteur=$input['auteur'];\n } else {\n $article->auteur=\"Auteur anonyme\";\n }\n $article->contenu=$input['contenu'];\n $article->published_at=$input['published_at'];\n $article->presentation=$input['presentation'];\n $article->cat_id=$input['cat_id'];\n $article->relu=false;\n $article->save();\n\n $article->image = Article::saveFile($request,'image',\"Image_$article->id\");\n $article->fichier=Article::saveFile($request,'fichier',\"Article_$article->id\");\n $article->save();\n\n return redirect('/')->with('message','Merci d\\'avoir publié cet article ! Il sera mis en ligne au plus tôt.');\n }",
"public function save(NewsPost $NewsPost);",
"public function store(Requests\\ArticleRequest $request)\n {\n $input = $request->all();\n\n Article::create($input);\n\n return redirect('/articles');\n }",
"public function store(ArticleAdd $request)\n {\n $data = $request->except('_token');\n $data['url'] = '';\n try {\n Article::create($data);\n } catch (\\Exception $e) {\n error_info();\n }\n success_info();\n }",
"public function store() {\n\n //\n try {\n $article = new Article;\n $article->title = Input::get('title');\n $article->description = Input::get('description');\n $article->category = Input::get('category');\n $article->open_at = Input::get('open_at');\n $article->status = Input::get('status');\n $article->lang = Input::get('lang');\n $article->meta_name = Input::get('meta_name');\n $article->meta_content = Input::get('meta_content');\n $article->meta_title = Input::get('meta_title');\n $article->h1 = Input::get('h1');\n\n $article->save();\n //create a corresponding tw/cn article at same time.\n $refLang = (Input::get('lang')=='tw') ? 'cn' : 'tw';\n $refArticle = new Article;\n $refArticle->title = Input::get('title');\n $refArticle->description = Input::get('description');\n $refArticle->category = Input::get('category');\n $refArticle->status = 0;\n $refArticle->lang = $refLang;\n $article->meta_name = Input::get('meta_name');\n $article->meta_content = Input::get('meta_content');\n $article->meta_title = Input::get('meta_title');\n $article->h1 = Input::get('h1');\n\n $refArticle->save();\n\n $refArticle->langRef = $article->id;\n $article->langRef = $refArticle->id;\n $refArticle->save();\n $article->save();\n\n return Redirect::to('admin/articles?category=' . Input::get('category') . '&lang=' . Input::get('lang'));\n }\n catch(Exception $e) {\n return Redirect::back()->withInput()->withErrors('新增失敗');\n }\n }",
"public function store(ArticlesFormRequest $request)\n {\n $article = new Article;\n $article->fill($request->all());\n $article->published = $request->get('published', false);\n $article->featured = $request->get('featured', false);\n $article->authenticated = $request->get('authenticated', false);\n $article->is_page = $request->get('is_page', false);\n $article->save();\n\n $article->permissions()->sync($request->get('permissions', []));\n if ($request->tags) {\n $article->tag(explode(',', $request->tags));\n }\n\n event(new ArticleWasCreated($article));\n\n flash()->success(trans('cms::article.store.success'));\n\n return redirect()->route('administrator.articles.index');\n }",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"public function store(Requests\\ArticleRequest $request)\n {\n //Unless validation pass the code below will never be fired\n $this->createArticle($request);\n \n flash()->success('Your article has been created');\n return redirect('articles');\n }",
"public abstract function save();",
"public function store()\n {\n $article = Article::create($this->validateRequest());\n $this->storeImage($article);\n return redirect('articles');\n }",
"public function addArticle(): void\n {\n $this->title = $_POST['titleArticle'];\n $this->content = $_POST['contentArticle'];\n $this->category = $_POST['categoryArticle'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n $this->author = $_SESSION['user']['id'];\n\n $this->image = $_FILES['imageArticle'];\n $tmp_file = $this->image['tmp_name'];\n $type_file = $this->image['type'];\n\n $temp = explode(\".\", $this->image['name']);\n $name_file = round(microtime(true)) . '.' . end($temp);\n\n $destination = 'application/views/images/';\n\n if (!is_uploaded_file($tmp_file) === true) {\n exit(\"Le fichier est introuvable\");\n };\n if (!strstr($type_file, 'jpg') && !strstr($type_file, 'jpeg') && !strstr($type_file, 'bmp')) {\n exit(\"Le fichier n'est pas une image\");\n }\n if (preg_match('#[\\x00-\\x1F\\x7F-\\x9F/\\\\\\\\]#', $name_file)) {\n exit(\"Nom de fichier non valide\");\n } else if (!move_uploaded_file($tmp_file, $destination . $name_file)) {\n exit(\"Impossible de copier le fichier dans $destination\");\n } else {\n move_uploaded_file($tmp_file, $destination . $name_file);\n }\n\n $this->articleModel->addArticle($this->title, $this->content, $this->category, $name_file, $this->date, $this->author);\n\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }",
"public function store (Article $article){\n\n \t$this->validate(request(),['body' => 'required|min:2']);\n\n \tCommentMod::create([\n \t\t'body' => request('body'),\n \t\t'article_id' => $article->id,\n 'user_id' => Auth::user()->id\n \t\t]);\n\n\n \treturn back();\n\n }",
"public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$category = Category::whereName('news')->first();\n\t\t$member = Auth::user()->member;\n\n\t\t$validator = Article::validate($input);\n\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::to('/news/create/')->withInput($input)->withErrors($validator);\n\t\t}\n\n\t\t$article = new Article();\n\t\t$article->slug = $input['slug'];\n\t\t$article->subject = $input['subject'];\n\t\t$article->body = $input['body'];\n\t\t$article->member()->associate($member);\n\t\t$article->category()->associate($category);\n\t\t$article->save();\n\n\t\treturn Redirect::to('/news/');\n\t}",
"public function store(Request $request)\n {\n // dd($request->input());\n $article = new Article();\n $article->title = $request->input('title');\n $article->date = $request->input('date');\n $article->author = $request->input('author');\n $article->details = $request->input('details');\n $article->save();\n\n return redirect()->route('article.add')->with('message', 'บันทึกข้อมูลได้สำเร็จ');\n }",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"public function store(ArticleRequest $request)\n\t{\n\t\tArticle::create($request->all());\n\n\t\tflash()->success('O artigo foi criado!')->important();\n\n\t\treturn redirect('articles');\n\t}",
"public function store(ArticleCreateRequest $request)\n {\n $formInput = $this->formatRequestInput($request);\n\n // Store the New article\n $fournisseur = Article::create($formInput); // $request->input()\n\n // Sessions Message\n $request->session()->flash('msg_success',__('messages.modelSaved', ['modelname' => 'Article'] ));\n\n return redirect()->action('ArticleController@index');\n }",
"public function save()\n {\n /* @var NewsData $newsData*/\n $newsData = make(NewsData::class);\n $newsData->title = $this->title;\n $newsData->content = $this->content;\n $newsData->created_at = date('Y-m-d H:i:s');\n $newsData->user_id = $this->userId;\n if (!$newsData->save()) {\n throw new UnableToSaveException('Unable to save news');\n }\n $this->saveImages($newsData->id);\n }",
"public function save()\n {\n \tif($this->announcement_id == null)\n \t{\n \t\t$this->db->insert(\"Announcements\", array(\n \t\t\t\t\"title\" => $this->title,\n \t\t\t\t\"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t\t));\n \t\t$this->announcement_id = $this->db->insert_id();\n \t}\t\n \telse\n \t{\n \t\t$update_data = array(\n \t\t\t\"title\" => $this->title,\n\t\t\t\t \"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t);\n \t\t$this->db->where(\"announcement_id\", $this->announcement_id);\n \t\t$this->db->update(\"Announcements\", $update_data);\n \t}\n }",
"public function store(ArticleFormRequest $request)\n {\n $this->validate($request, [\n 'img' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n $image = $request->file('img');\n $newName = time().'.'.$image->getClientOriginalExtension();\n $image->move(public_path('images'), $newName);\n\n // $user_id = Auth::user()->id;\n\n $article = new Article(array(\n 'title' => $request->get('title'),\n 'content' => $request->get('content'),\n 'img' => $newName,\n 'h2' => $request->get('h2'),\n 'slug' => Str::slug($request->get('title'), '-'),\n //'user_id' => $user_id\n ));\n\n $article->save();\n\n // we can use sync() attach the selected pages to the articles\n $article->pages()->sync($request->get('pages'));\n\n return redirect('/admin/articles/create')->with('status', 'The Article has been created!');\n\n // return redirect(action('Admin\\ArticlesController@create', $article->id))->with('status', 'updat!'); \n }",
"public function store(ArticleRequest $request)\n {\n $post = new Post();\n $post->post_name = request('name');\n $post->post_title = request('title');\n $post->post_content = request('content');\n $post->post_date = now();\n $post->post_type = 'article';\n $post->user_id = auth()->user()->id;\n $post->save();\n \n return redirect()->route('article.show', $post->post_name);\n }",
"public function store(Requests\\ArticleRequest $request) {\n\n /*\n $input = Request::all();\n $input['published_at'] = Carbon::now();\n $input['users_id'] = Auth::id();\n Article::create($input);\n */\n\n $request['users_id'] = Auth::id();\n Article::create($request->all());\n\n //Session::flash('flash_message', 'Article has been created!');\n flash()->success('Article has been created!');\n \n return redirect('articles');\n }",
"public function store(CreateArticleRequest $request)\n {\n $input = $request->all();\n\n $article = $this->articleRepository->create($input);\n\n Flash::success('Article saved successfully.');\n\n return redirect(route('articles.index'));\n }",
"public function store(ArticleRequest $request)\n {\n $article = new Article;\n $article->article = $request->article;\n $article->category_id = $request->category;\n $article->content = $request->content;\n $article->status = $request->status;\n $article->user_id = $request->author;\n $article->view = \"0\";\n if ($request->hasFile('image')) {\n $filename = time().\".\".$request->file('image')->getClientOriginalExtension();\n Image::make($request->file('image'))->save(public_path('images/articles/' . $filename));\n Image::make($request->file('image'))->resize(350, 183)->save(public_path('images/thumbnails/' . $filename));\n $article->image = $filename;\n } else {\n $article->image = 'article.jpg';\n }\n $article->slug = slug_th($request->article);\n $article->save();\n $article->tags()->sync($request->tags, false);\n return back()->with([\n 'alert' => 'alert-success',\n 'message' => 'บันทึกข้อมูลเรียบร้อย!',\n ]);\n }",
"public function store(Article $article)\n {\n\n /*$article->addStep([\n 'description' => \\request('description'),\n ]);*/\n\n $article->addStep(\\request()->validate([\n 'description' => 'required|min:5'\n ]));\n\n return back();\n }",
"public final function save() {\n }",
"public function store(Request $request)\n {\n \n $this->validate($request, [\n 'title' => 'required',\n 'body' => 'required'\n \n ]);\n\n \n \n $article = $request-> isMethod('put')? Article::findOrFail($request->$article_id): new article;\n\n $article->id = $request->input('article_id');\n $article->title = $request->input('title');\n $article->body = $request->input('body');\n \n \n \n \n if ($article->save()){\n\n return new ArticleResource ($article);\n\n $article->body = $request->action('http://127.0.0.1:8000/api/article');\n\n \n \n \n\n\n \n }\n }",
"public function update($article);",
"public function save(){\n $data = array(\n \"title\" => $this->input->post('input_title'),\n \"category_id\" => $this->input->post('input_category'),\n \"content\" => $this->input->post('input_content')\n );\n \n $this->db->insert('articles', $data); // Untuk mengeksekusi perintah insert data\n }",
"public function store(CreateArticleRequest $request) {\n\t\t$article = $this->article->store($request->all());\n\t\tif($article) {\n\t\t\treturn redirect()->action('ArticlesController@show', [$article['slug']]);\n\t\t}\n\t\treturn redirect()->action('ArticlesController@create')->with($request->all());\n\t}",
"function save();",
"function save();",
"public function saveArticle($request)\n {\n $slug = $request->input('slug');\n $article = new Article();\n\n $article->title = $request->input('title');\n $article->author_id = Auth::user()->id;\n $article->article_category = $request->input('article_category');\n $article->content = $request->input('content');\n $article->description = $request->input('description');\n $article->est_time = $request->input('est_time');\n $article->slug = $slug;\n\n $tags = explode(\",\", $request->input('tags'));\n $tags = array_map(function ($tag) {\n return trim($tag);\n }, $tags);\n\n $article->tags = strtolower(json_encode($tags));\n\n $image = $request->file('main_image');\n\n if ($image) {\n $imageName = $this->uploadMainImage($image, $slug);\n if ($imageName[\"success\"]) {\n $article->main_image = $imageName[\"result\"];\n $article->save();\n\n return [\n \"result\" => $article,\n \"success\" => true,\n ];\n }\n\n return [\n \"result\" => $imageName[\"result\"],\n \"success\" => false,\n ];\n }\n\n $article->save();\n\n return [\n \"result\" => $article,\n \"success\" => true,\n ];\n }",
"public function save()\r\n {\r\n \r\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required|max:100',\n 'body' => 'required'\n ]);\n\n $article = new Article;\n $article->title = $request->title;\n $article->body = $request->body;\n $article->save();\n\n Cache::forget('article:all');\n\n return redirect(route('article.index'));\n }",
"public function store(Request $request)\n {\n\t\t$this->validate($request,[\n\t\t\t'title' => 'required|max:255|unique:article',\n 'content' => 'required|max:60000',\n 'tag' =>'required',\n ]);\n //使用Purifier防止Xss注入\n $content = Purifier::clean($request->input('content'));\n\n $article = new Article;\n $article->title = $request->input('title');\n $article->content = $content;\n $article->original_content = $request->input('content');\n $article->user_id = $request->session()->get('admin')['id'];\n if(is_array($request->input('tag'))){\n $tag_id = ','.implode(',',$request->input('tag')).',';\n }\n $article->tag_id = $tag_id;\n $article->state = 1;\n\n if($article->save()){\n $id = $article->id;\n return Redirect::to('article/show/'.$id);\n }else{\n return Redirect::back()->withInput()->withError('保存失败');\n }\n }",
"public function save()\n {\n }",
"public function save() {\n\t\t\t\n\t\t}",
"public final function save()\n {\n }",
"public function save(ArticleDAO $article): bool\n {\n if (isset($article->id)) {\n return $this->update($article);\n }\n $time = time();\n\n $stmt = $this->connection->prepare('\n INSERT INTO article \n (created_at, content, user_id, title,) \n VALUES \n (:created_at, :content, :user_id, :title)\n ');\n $stmt->bindParam(':created_at', $time);\n $stmt->bindParam(':title', $article->title);\n $stmt->bindParam(':user_id', $article->user_id);\n $stmt->bindParam(':content', $article->content);\n return $stmt->execute();\n }",
"public function save($entity);",
"public function save($entity);",
"public function save($entity);",
"public function store(Request $request){\n $this->validator($request->all())->validate();\n $articleData = $this->articleData($request);\n \n if($this->articleRepo->save($articleData, $this->auth()->id())){\n return redirect(route(\"user.profile\"))->with('success', 'Article published.');\n }else{\n return redirect()->back()->with('error', 'Failed to save this article. Please try again, if this error persists please contact us.');\n } \n }",
"public function store(Request $request)\n {\n $attributes = $request->validate([\n 'title' => 'required',\n 'content' => 'required',\n 'excerpt' => 'nullable|max:255',\n 'slug' => 'required|unique:articles,slug',\n 'password' => 'nullable',\n 'private' => 'nullable',\n ]);\n\n $article = Article::create([\n 'title' => $request->title,\n 'content' => $request->content,\n 'excerpt' => $request->excerpt,\n 'user_id' => Auth::user()->id,\n 'slug' => $request->slug,\n 'password' => $request->password,\n 'private' => $request->private,\n 'published_at' => \\Carbon\\Carbon::now(),\n ]);\n \n if($request->wantsJson()) {\n return $article;\n }\n \n return redirect(route('articles.show', $article->id)); \n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function store(ArticleRequest $request)\n {\n $data = array_merge($request->all(), [\n 'user_id' => \\Auth::id(),\n 'last_user_id' => \\Auth::id()\n ]);\n\n $data['is_draft'] = isset($data['is_draft']);\n $data['is_original'] = isset($data['is_original']);\n\n\n\n $art = $this->article->store($data);\n\n $sou_data = [\n \"pid\"=> $art->id,\n \"category_id\"=>$data[\"category_id\"],\n \"user_id\"=>$data['user_id'],\n \"slug\"=>$art->slug,\n \"title\"=>$data['title'],\n \"page_image\"=>$data['page_image'],\n \"subtitle\"=>$data['subtitle'],\n \"meta_description\"=>$data['meta_description'],\n \"content\"=>$data[\"content\"],\n \"updated_at\"=>strtotime($data[\"published_at\"]),\n ];\n Xunsearch::add($sou_data);\n\n $this->article->syncTag(json_decode($request->get('tags')));\n\n return $this->noContent();\n }",
"public function store(Request $request)\n {\n $article = new Article();\n $article->title = $request->title;\n $article->category_id = $request->category_id;\n $article->user_id = Auth::user()->id;\n $article->text = $request->text;\n if ($article->save()) {\n return redirect()->back()->with('status', 'Article add successful!');\n }\n }",
"public function editArticleSave(Request $request) //called when the user has finished editing article\n {\n $article = \\App\\Article::where('id', $request->articleID)->first();\n if ($article == null) // || Gate::denies('editArticle', $article))\n {\n $value = 'article not found';\n return '{ \"error\":\"'.$value.'\"}'; //view('authorizationError');\n }\n $article->name = $request->name;\n $article->teaser = $request->teaser;\n $article->content = $request->content;\n $article->save();\n $value = 'article saved';\n return '{ \"result\":\"'.$value.'\"}';\n }",
"public function save() {\n }",
"public function save() {\n }",
"public function store(ArticleRequest $request)\n {\n $newArticle = $this->articleHandler($request);\n\n $url = [url('article/'.($newArticle['url'] ? $newArticle['url'] : $newArticle['uuid']))];\n\n // 百度链接提交\n $api = 'http://data.zz.baidu.com/urls?site=www.devops-club.com&token=PeqHp7cf9Vc9wJEk&type=original';\n $ch = curl_init();\n $options = array(\n CURLOPT_URL => $api,\n CURLOPT_POST => true,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POSTFIELDS => implode(\"\\n\", $url),\n CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),\n );\n curl_setopt_array($ch, $options);\n $result = curl_exec($ch);\n\n if (!empty($request['success'])) {\n // 推送成功\n }\n else {\n // 推送失败\n }\n\n // 跳转至文章展示页\n return redirect('article/'.($newArticle['url'] ? $newArticle['url'] : $newArticle['uuid']));\n }",
"public function save()\n\t{\n\n\t}",
"public function save():void;",
"public function save()\r\n {\r\n //\r\n }",
"public function store(ArticleRequest $request)\n {\n $article = Article::create($request->all());\n\n return redirect()->route('articles.index')\n ->with('success', 'The Article: ' . $article->name . ' has been successfully created!');\n }",
"public function store(Requests\\AdminArticleCreate $article)\n {\n $this->dispatch(new CreateArticle(\\Auth::user(), \\Input::get('title'), \\Input::get('text')));\n\n return \\Redirect::route('admin.article.index');\n }",
"public function store(ArticleRequest $request)\n {\n $article = new Article();\n $article->title = $request->title;\n $article->body = $request->body;\n $published_at = $request->published_at_date . ' '. $request->published_at_time;\n $article->published_at = $published_at;\n $article->author_id = $request->user_id;\n $article->slug = str_slug($request->title, '-');\n $article->save();\n\n session()->flash('flash_message', 'the article has been created');\n session()->flash('flash_message_important', true);\n\n $tags = $request->tags;\n foreach ($tags as $tag) {\n if (is_numeric($tag))\n {\n $tagArr[] = $tag;\n }\n else\n {\n $newTag = Tag::create(['name'=>$tag]);\n $tagArr[] = $newTag->id;\n }\n }\n $article->tags()->sync($tagArr);\n return redirect('articles');\n }",
"public function createAction()\n {\n // Checking a for a valid csrf token\n if ($this->request->isPost()) {\n if (!$this->security->checkToken()) {\n //if the csrf token is not valid, end the algorithm here\n return;\n }\n }\n\n // Getting a request instance\n $request = new Request();\n\n // Check whether the request was made with method POST\n if ($request->isPost()) {\n\n //TODO Question: is there a way to auto map the post data to a model?\n $article = new Article();\n $article->creationDate = $date = date('Y-m-d H:i:s');\n $article->title = $this->request->getPost('title');\n $article->summary = $this->request->getPost('summary');\n $article->content = $this->request->getPost('content');\n\n //try to save the article to the database, if it fails let the user know what went wrong\n if (!$article->save()) {\n //get all the validationErrors and store them in the flashSessions and return the view\n foreach ($article->getMessages() as $message) {\n //append the validation errors to the flash session\n $this->flashSession->error($message);\n }\n return;\n }\n\n //let the user know the article was saved successfully\n $this->flashSession->message('message', 'The article has successfully been created');\n\n //return to the admin article overview so the user can see the new article in the list\n return $this->response->redirect(\"/article\");\n }\n }",
"public function store(Request $request)\n {\n $article=New Article;\n $article->Catagory_id=$request->catagory;\n $article->title=$request->title;\n $article->content=$request->content;\n $article->created_by=$request->author;\n $article->status=$request->status;\n\n $article->save();\n return redirect('/article')->with('success','berhasil tampah article');\n }",
"public function postNew()\n\t\t{\n\t\t\t\n\n\t\t\t$imagen = Input::file('img');\n\t\t\t$codigoIMG = str_random(5);\n\t\t\t$filename = date('Y-m-d-H-m-s').\"-\".$codigoIMG.\".jpg\";\n\t\t\t$article = $this->articleteRepo->newArticle($filename);\n\t\t\t$manager = new ArticleManager($article, Input::all());\n\n\n\t\t\n\t\t\tif($manager->save())\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tImage::make($imagen->getRealPath())->save(public_path().'/blog/img/'.$filename);\n\t\t\t\t\n\t\t\t\treturn Redirect::to('/adminpanel')->with('message','New article created');\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\treturn Redirect::back()->withInput()->withErrors($manager->getErrors());\n\t\t\t}\n\n\t\t}",
"public function save() {\n }",
"public function update()\n {\n update($this->id, $article);\n }",
"public function store(ArticleRequest $request)\n {\n $validated = $request->validated();\n \n $this->articleManager->build(new Article(), $request);\n \n return redirect()->route('articles.index')->with('success', \"L'article a bien été sauvegardé\");\n }",
"public function store(CreateArticleRequest $request)\n {\n $article = new Article($request->validated());\n $article->user_id = Auth::user()->id;\n// $article->title = $request->input('title');\n// $article->body = $request->input('body');\n $article->save();\n foreach($request->validated()['image'] as $img) {\n $path = $img->store('public');\n $image = new Image();\n $image->path = Storage::url($path);\n $article->images()->save($image);\n }\n foreach ($request->validated()['tags'] as $tagId) {\n $article->tags()->attach($tagId);\n }\n return response()->redirectToRoute('articles.index');\n }",
"public function associateArticle(Article $article)\n {\n return $this->model->articles()->save($article);\n }",
"function save()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$post\t= JRequest::get('post');\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\t$post['id'] = (int) $cid[0];\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_( 'Weblink Saved' );\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Weblink' );\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\t\t$link = 'index.php?option=com_weblinks';\n\t\t$this->setRedirect($link, $msg);\n\t}"
] | [
"0.7495521",
"0.7338945",
"0.73143536",
"0.7083988",
"0.704278",
"0.6945502",
"0.6897031",
"0.68532366",
"0.6772855",
"0.67460746",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6728572",
"0.6708763",
"0.66922885",
"0.6620176",
"0.6602696",
"0.6581911",
"0.65666455",
"0.65666455",
"0.65666455",
"0.65666455",
"0.65666455",
"0.65569943",
"0.6548211",
"0.6521311",
"0.65083826",
"0.647724",
"0.64770156",
"0.6467405",
"0.6461997",
"0.6461997",
"0.6461941",
"0.6444663",
"0.6434086",
"0.6398517",
"0.6378587",
"0.6363745",
"0.63527185",
"0.6345224",
"0.6342785",
"0.6325377",
"0.63229406",
"0.63113934",
"0.6308851",
"0.62955844",
"0.62885207",
"0.6282746",
"0.6281977",
"0.6281977",
"0.6281924",
"0.6278952",
"0.62665147",
"0.62491363",
"0.62453306",
"0.62339437",
"0.6233782",
"0.6228424",
"0.6227983",
"0.6227983",
"0.6227983",
"0.6205409",
"0.6202126",
"0.62014294",
"0.6181272",
"0.6176504",
"0.617153",
"0.6156328",
"0.6156328",
"0.61556506",
"0.61457837",
"0.61416537",
"0.6141061",
"0.613676",
"0.6128942",
"0.61222094",
"0.6121434",
"0.61185163",
"0.6113794",
"0.6108902",
"0.6082986",
"0.60788125",
"0.6075072",
"0.6061627",
"0.60601634"
] | 0.0 | -1 |
Find information for the upload autocomplete. | public function findAutocompleteInfo(Request $request)
{
//dd($request->all());
$name = $request->input('query');
$output = \Tmdb::getSearchApi()->searchMovies($name, array('language' => 'fr', 'search_type' => 'ngram', 'year' => $request->input('year')));
//$output = \Tmdb::getMoviesApi()->getImages($output['results'][0]['id']);
foreach ($output['results'] as $value) {
$image = \Tmdb::getMoviesApi()->getImages($value['id']);
if (isset($image['posters'][0])) {
$image = $image['posters'][0]['file_path'];
} else {
$image = '';
}
$array = array('image' => $image,'value' => $value['title'].' ('.substr($value['release_date'], 0, 4).')', 'data' => $value['id']);
$result[] = $array;
}
$result['suggestions'] = $result;
echo json_encode($result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAutocomplete() { return $this->readAutocomplete(); }",
"function suggest()\n {\n // allow parallel searchs to improve performance.\n session_write_close();\n $suggestions = $this->Item->get_manage_items_search_suggestions($this->input->get('term'), 100);\n echo json_encode($suggestions);\n }",
"public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }",
"function suggest() {\n $suggestions = $this->ticket->get_search_suggestions($this->input->get('term'), 100);\n\n echo json_encode($suggestions);\n }",
"public function autocomplete_callback();",
"function suggest() {\n $suggestions = $this->tour->get_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }",
"public function suggest() {\n\t\tif(isset($_POST['query'])) $this->query_str = $_POST['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t//check if jar exists\n\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar suggest ' . escapeshellarg($this->query_str));\n\t\telse return;\n\n\t\t$this->results = json_decode($raw);\n\t}",
"function suggest()\n\t{\n\t\tsession_write_close();\n\t\t$suggestions = $this->Item_products->get_search_suggestions($this->input->get('term'),100);\n\t\techo json_encode($suggestions);\n\t}",
"public function ajax_autocomplete() {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'visual_form_builder_autocomplete' ) {\n\t\t\t$term \t\t= esc_html( $_REQUEST['term'] );\n\t\t\t$form_id \t= absint( $_REQUEST['form'] );\n\t\t\t$field_id \t= absint( $_REQUEST['field'] );\n\n\t\t\t$fields = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->field_table_name WHERE form_id = %d AND field_id = %d ORDER BY field_sequence ASC\", $form_id, $field_id ) );\n\n\t\t\t$suggestions = array();\n\n\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t$options = unserialize( $field->field_options );\n\n\t\t\t\tforeach ( $options as $opts ){\n\t\t\t\t\t// Find a match in our list of options\n\t\t\t\t\t$pos = stripos( $opts, $term );\n\n\t\t\t\t\t// If a match was found, add it to the suggestions\n\t\t\t\t\tif ( $pos !== false )\n\t\t\t\t\t\t$suggestions[] = array( 'value' => $opts );\n\t\t\t\t}\n\n\t\t\t\t// Send a JSON-encoded array to our AJAX call\n\t\t\t\techo json_encode( $suggestions );\n\t\t\t}\n\t\t}\n\n\t\tdie(1);\n\t}",
"public function autocompleteAction() {\n $suggestions = array(\n 'Application',\n 'Big',\n 'Computer',\n 'Development',\n 'Environment',\n 'Failure',\n 'Green',\n 'Hope',\n 'Injection',\n 'Java',\n 'Kilo'\n );\n\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout()->disableLayout();\n\n echo json_encode($suggestions);\n }",
"public function suggest()\n\t{\n\t\t$suggestions = $this->Role->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}",
"protected function getCompleteFieldInformation() {}",
"function suggest()\n\t{\n\t\t$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}",
"public function fileInfo()\n {\n return R::findAll('uploaddetail');\n }",
"function suggest()\n\t{\n\t\t$suggestions = $this->Supplier->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}",
"public function getFieldAutoCompleteInmueble() {\n\t\t\n\t}",
"protected function printUploadInput()\n {\n $accepts = \"\";\n\n if (sizeof($this->filters) > 0) {\n $accepts = \" accept=\\\"\" . implode(\",\", $this->filters) . \"\\\"\";\n }\n\n ?>\n <input type=\"file\" name=\"<?= $this->getIndexedPresenterPath(); ?>\" id=\"<?= $this->getIndexedPresenterPath(); ?>\"\n presenter-name=\"<?= $this->presenterName ?>\"<?= $accepts . $this->getHtmlAttributeTags() . $this->getClassTag() ?>/>\n <?php\n }",
"public function suggests() : array;",
"public function autoSuggestList()\n {\n // TODO: Implement autoSuggestList() method.\n }",
"public function incSearch() {\n\t\t$result = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\tif ( $this->input->get( 'term' ) ) {\n\t\t\t\t/** @var \\wpdb $wpdb */\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$query = '%' . $this->input->get( 'term' ) . '%';\n\t\t\t\t$sql = <<<SQL\n\t\t\t\t\tSELECT SQL_CALC_FOUND_ROWS\n\t\t\t\t\t\tID, user_login, display_name\n\t\t\t\t\tFROM {$wpdb->users}\n\t\t\t\t\tWHERE user_login LIKE %s\n\t\t\t\t\t OR user_email LIKE %s\n\t\t\t\t\t OR display_name LIKE %s\n ORDER BY display_name ASC\n\t\t\t\t\tLIMIT 10\nSQL;\n\t\t\t\t$result = array_map( function ( $user ) {\n\t\t\t\t\t$user->avatar = get_avatar( $user->ID, '48', '', $user->display_name );\n\n\t\t\t\t\treturn $user;\n\t\t\t\t}, $wpdb->get_results( $wpdb->prepare( $sql, $query, $query, $query ) ) );\n\t\t\t}\n\t\t}\n\t\twp_send_json( $result );\n\t}",
"public function hookAdminItemsSearch()\n {\n $html = '<div class=\"field\">';\n $html .= '<div class=\"two columns alpha\">';\n $html .= get_view()->formLabel('annotated', 'Annotation Status');\n $html .= '</div>';\n $html .= '<div class=\"inputs five columns omega\">';\n $html .= '<div class=\"input-block\">';\n $html .= get_view()->formSelect('annotated', null, null, array(\n '' => 'Select Below',\n '1' => 'Only Annotated Items',\n '0' => 'Only Non-Annotated Items'\n ));\n $html .= '</div></div></div>';\n echo $html;\n }",
"public function autocompleteIndex()\n {\n foreach ($this->autocompleted as $attribute) {\n Autocomplete::index(\n $this->getKey(),\n $this->$attribute,\n get_class($this)\n );\n }\n }",
"function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}",
"public function getAutocomplete()\n {\n // get a suggester query instance\n $query = $this->client->createSuggester();\n $query->setQuery(strtolower(Input::get('term')));\n $query->setDictionary('suggest');\n $query->setOnlyMorePopular(true);\n $query->setCount(10);\n $query->setCollate(true);\n\n // this executes the query and returns the result\n $resultset = $this->client->suggester($query);\n\n $suggestions = array();\n\n foreach ($resultset as $term => $termResult) {\n foreach ($termResult as $result) {\n $suggestions[] = $result;\n }\n }\n\n return Response::json($suggestions);\n }",
"public function searchAction()\n {\n $user_id = $this->getSecurityContext()->getUser()->getId();\n $drive = $this->_driveHelper->getRepository()->getDriveByUserId($user_id);\n\n $q = $this->getScalarParam('q');\n // $hits = $this->getResource('drive.file_indexer')->searchInDrive($q, $drive->drive_id);\n $hits = $this->getResource('drive.file_indexer')->search($q);\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\n echo '<strong>', $hits->hitCount, '</strong> hits<br/>';\n foreach ($hits->hits as $hit) {\n $file = $this->_driveHelper->getRepository()->getFile($hit->document->file_id);\n if (empty($file)) {\n echo 'Invalid file ID: ', $hit->document->file_id;\n }\n if ($file && $this->_driveHelper->isFileReadable($file)) {\n echo '<div>', '<strong>', $file->name, '</strong> ', $this->view->fileSize($file->size), '</div>';\n }\n }\n exit;\n }",
"public function getAutocomplete():string {\n return $this->getAttribute('autocomplete');\n }",
"public function openSearchSuggestName(): string\n {\n return config('scout.opensearch.suggestName');\n }",
"public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }",
"protected function _injectAutocompleteSearchData()\n {\n if ($this->useProductCategoryForTermGeneration()) {\n $this->_documentAutocompleteSearch = array_merge($this->_documentAutocompleteSearch, $this->_documentCategoryNames);\n }\n \n $this->_documentAutocompleteSearch = $this->_applySynonymForSearchData($this->_documentAutocompleteSearch);\n $textAutocompleteSearch = Utility::getUniqueArrayData($this->_documentAutocompleteSearch);\n $this->_documentData['textAutocomplete'] = $textAutocompleteSearch;\n $this->_documentData['textAutocompleteAccents'] = $textAutocompleteSearch;\n }",
"public function getAutocompleteInput(\\TV\\HZ\\Ask\\Entry $data)\n {\n return array($data->getNiceTitle(),$data->getName());\n }",
"public function autoCompleteList(){\n $this->layout='ajax';\n $this->autoRender =false;\n if($this->request->is('ajax')){\n $result = $this->Technology->find('list');\n echo json_encode($result);\n }\n }",
"public function getUploadField()\n {\n return $this->component->bulkUploadField($this->gridField);\n }",
"function get_tag_names() \n\t{\t\n\t\tlog_message('debug', 'Support/get_tag_names');\n\t\techo get_option_list($this, 'tagNames', 'select', $_GET[\"copy_from_repo\"]);\n\t}",
"public function actionSuggestTags()\n {\n if (isset($_GET['q']) && ($keyword = trim($_GET['q'])) !== '') {\n $tags = Tag::model()->suggestTags($keyword);\n if ($tags !== array())\n echo implode(\"\\n\", (array)$tags);\n }\n }",
"public function autocomplete() {\n \n //Término de búsqueda con comodines\n $palabro = '%'.$this->request->query['term'].'%';\n \n //Búsqueda de coincidencias\n $resultados = $this->Funeraria->find('all', array(\n 'conditions' => array(\n 'Funeraria.nombre LIKE' => $palabro,\n ),\n 'fields' => array(\n 'Funeraria.id', 'Funeraria.cif', 'Funeraria.nombre'\n ),\n 'limit' => 20,\n ));\n \n //Procesamiento y codificación en JSON\n $items = array();\n \n if (empty($resultados)) {\n array_push($items, array(\"label\"=>\"No hay coincidencias\", \"value\"=>\"\"));\n }\n else {\n foreach($resultados as $resultado) {\n array_push($items, array(\"label\" => $resultado['Funeraria']['nombre'] . \" - \" . $resultado['Funeraria']['cif'], \"value\" => $resultado['Funeraria']['id']));\n }\n }\n \n $this->layout = 'ajax';\n $this->autoRender = false;\n \n echo json_encode($items);\n }",
"public function getSuggestData()\n {\n \tif(!$this->helper('findologic')->isAlive()){\n \t\treturn parent::getSuggestData();\n \t}\t\n \t\n if (!$this->_suggestData) {\n \t$this->_suggestData = array();\n \t\n\t\t\t$query = $this->helper('catalogsearch')->getQueryText();\n \t$result = $this->helper('findologic')->autocomplete($query);\n\n \tif(isset($result->suggestions)) {\n \t $counter = 0;\n \t $data = array();\n \t \n\t foreach ($result->suggestions as $suggestion) {\n\t \t$suggestion = explode('|', $suggestion);\n\t \t\n\t $_data = array(\n\t 'title' => $suggestion[0],\n\t 'row_class' => ++$counter % 2 ? 'odd' : 'even',\n\t 'num_of_results' => $suggestion[1]\n\t );\n\t\n\t if ($_data['title'] == $query) {\n\t array_unshift($data, $_data);\n\t }\n\t else {\n\t $data[] = $_data;\n\t }\n\t }\n\t $this->_suggestData = $data;\n \t}\n }\n\n\t\treturn $this->_suggestData;\n }",
"function browse(){\n $_POST[\"mask_\".get_type_as_string(TYPE_ARTICLE)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_INPROCEEDINGS)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_INCOLLECTION)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_INBOOK)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_BOOKLET)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_THESIS)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_TECHREPORT)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_MANUAL)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_UNPUBLISHED)] = \"on\";\n $_POST[\"mask_\".get_type_as_string(TYPE_MISC)] = \"on\";\n\n Reference::search();\n\n }",
"public function tagging_ajax_suggest_form_callback() \n {\n $data = $this->tagging_ajax_suggest_callback_helper();\n \n $form = $data['form'];\n $node = $data['form_state']['post'];\n\n // TODO: Add support for multiple tagging field on one node. At this point, the module just \n // pick data from the first one. To change that, it will be needed to know wich \"Suggest tag\" \n // button has been clicked.\n $element = reset($form['taxonomy']['tags']);\n\n // Load suggestions\n $suggestions = _tagging_get_suggestions($element['#vid'], (object) $node);\n $element['#suggestions'] = $suggestions;\n\n // Include the results of any drupal_set_message() calls that\n // may have occurred.\n $output = tagging_base::instance()->theme('status_messages', array());\n \n $output .= tagging_base::instance()->theme('tagging_widget', array('element' => $element));\n\n // Output the results and exit.\n drupal_json(array('status' => TRUE, 'data' => $output));\n exit();\n }",
"public function getName() {\n return $_GET['uploadfile'];\n }",
"function user_autocomplete() {\n\t\t$json = $this->user_model->get_users_autocomplete(str_replace('+', ' ', strtolower($_GET['term'])));\n\t\t\n\t\t$this->output->set_content_type('application/json')->set_output($json);\n\t}",
"public function hookAdminItemsSearch()\n {\n $formSelect = get_view()->formSelect(\n 'zotero_item_type', null, null,\n label_table_options(self::getZoteroItemTypes())\n );\n echo '\n <div class=\"field\">\n <div class=\"two columns alpha\">\n <label for=\"zotero_item_type\">Zotero Item Type</label>\n </div>\n <div class=\"five columns omega inputs\">';\n echo $formSelect;\n echo '\n </div>\n </div>';\n }",
"public function autocomplete(){\n $term = Input::get('term');\n $results = array();\n \n $queries = User::where('pseudo', 'LIKE', '%'.$term.'%')\n ->where(\"status\",'>=', 1)\n ->take(5)\n ->get();\n \n foreach ($queries as $query)\n $results[] = [ \n 'avatar' => asset('storage/'.$query->avatar),\n 'value' => $query->pseudo\n ];\n\n return Response::json($results);\n }",
"function print_upload($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\techo '<input class=\"option-input upload hana-upload\" name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"text\" value=\"'.$input_value.'\" />';\n\t\techo '<div id=\"'.$value['id'].'_button\" class=\"upload-button upload-logo hana-upload-btn\" ><a class=\"hana-button alignright\"><span>Upload</span></a></div><br/>';\n\t\t\n\t\t$this->close_option($value);\n\t}",
"function autoComplete()\n\t{\n\t\t\t\n\t\t$aUsers = array();\n\n\t\t$sql=\"SELECT title FROM products_table\";\n\t\t$obj = new Bin_Query();\n\t\t$obj->executeQuery($sql);\n\t\t//echo \"<pre>\";\n\t\t//print_r($obj->records);\n\t\t$count=count($obj->records);\n\t\tif($count!=0)\n\t\t{\n\t\t\tfor($i=0;$i<$count;$i++)\n\t\t\t\t$aUsers[]=$obj->records[$i]['title'];\n\t\t}\n\t\telse\n\t\t\t$aUsers[]='0 Results';\t\t\n\t\n\t\n\t\t$input = strtolower( $_GET['input'] );\n\t\t$len = strlen($input);\n\t\t$limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 0;\n\t\t\n\t\t\n\t\t$aResults = array();\n\t\t$count = 0;\n\t\t\n\t\tif ($len)\n\t\t{\n\t\t\tfor ($i=0;$i<count($aUsers);$i++)\n\t\t\t{\n\t\t\t\t// had to use utf_decode, here\n\t\t\t\t// not necessary if the results are coming from mysql\n\t\t\t\t//\n\t\t\t\tif (strtolower(substr(utf8_decode($aUsers[$i]),0,$len)) == $input)\n\t\t\t\t{\n\t\t\t\t\t$count++;\n\t\t\t\t\t$aResults[] = array( \"id\"=>($i+1) ,\"value\"=>htmlspecialchars($aUsers[$i]));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($limit && $count==$limit)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\theader (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); // Date in the past\n\t\theader (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // always modified\n\t\theader (\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1\n\t\theader (\"Pragma: no-cache\"); // HTTP/1.0\n\t\t\n\t\t\n\t\t\n\t\tif (isset($_REQUEST['json']))\n\t\t{\n\t\t\theader(\"Content-Type: application/json\");\n\t\t\n\t\t\techo \"{\\\"results\\\": [\";\n\t\t\t$arr = array();\n\t\t\tfor ($i=0;$i<count($aResults);$i++)\n\t\t\t{\n\t\t\t\t$arr[] = \"{\\\"id\\\": \\\"\".$aResults[$i]['id'].\"\\\", \\\"value\\\": \\\"\".$aResults[$i]['value'].\"\\\"}\";\n\t\t\t}\n\t\t\techo implode(\", \", $arr);\n\t\t\techo \"]}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Content-Type: text/xml\");\n\t\n\t\t\techo \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?><results>\";\n\t\t\tfor ($i=0;$i<count($aResults);$i++)\n\t\t\t{\n\t\t\t\techo \"<rs id=\\\"\".$aResults[$i]['id'].\"\\\" >\".$aResults[$i]['value'].\"</rs>\";\n\t\t\t}\n\t\t\techo \"</results>\";\n\t\t}\n\t\t\t\t\t\n\t}",
"public function accountsAutocomplete(){\r\n\r\n\t\t$user_id = $this->flexi_auth->get_user_id();\r\n\t\t//uacc_uid\r\n\t\t$user = $this->flexi_auth->get_user_by_id_query($user_id,'uacc_uid')->row();\r\n\r\n\t\t$hint = $this->input->get('q');\r\n\r\n\r\n\t\t//load id, label and name for the jQuery Autocomplete from the model fields_autocomplete\r\n\t\t$this->load->model(\"fields_autocomplete\");\r\n\t\t$companies_list = $this->fields_autocomplete->getAccountsList($hint, '');\r\n\t\techo json_encode($companies_list);\r\n\t}",
"function get_loc_file_fields() {\n\treturn array (\n\t\t\t'GUID',\n\t\t\t'Latitude',\n\t\t\t'Longitude',\n\t\t\t'Country',\n\t\t\t'State/Province',\n\t\t\t);\n}",
"function get_spec_file_fields() {\n\treturn array (\n\t\t\t'Taxonomic name (GUID)',\n\t\t\t'Location (GUID)',\n\t\t\t);\n}",
"protected function search()\n\t{\n\t\treturn Phpfox::getLib('search');\t\n\t}",
"private function determineUploadLocation(FieldItemListInterface $field): string {\n return (new FileItem($field->getItemDefinition()))->getUploadLocation();\n }",
"function getUploadUrls($mimeType) {\n\techo \"Getting upload urls. </br>\";\n\t$mimeParam = \"?mimeType=\" . $mimeType;\n\t$response = getRequestWithParam('/api/file/getpreupload', $mimeParam);\n\tprintInfo($response);\n}",
"public function autoComplete (\\stdClass $param);",
"private function search_bar()\n\t{\n\n\t\t# code...\n\t}",
"function Type()\n {\n return 'autocomplete text';\n }",
"function customer_search() {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }",
"function admin_autocomplete($term = null)\r\n {\r\n $this->layout = 'ajax';\r\n if (!$this->request->is('post'))\r\n {\r\n throw new MethodNotAllowedException();\r\n }\r\n $params = array();\r\n $params['fields'] = array('name');\r\n\r\n //Dodatkowe dane przekazywane z FebFormHelper-a\r\n //if (!empty($this->request->data['fields']['field_name'])) {\r\n // $params['conditions']['Brief.field_name'] = $_POST['fields']['field_name'];\r\n //}\r\n\r\n $this->request->data['fraz'] = preg_replace('/[ >]+/', '%', $this->request->data['fraz']);\r\n $this->Brief->recursive = -1;\r\n $params['conditions'][\"Brief.name LIKE\"] = \"%{$this->request->data['fraz']}%\";\r\n $res = $this->Brief->find('all', $params);\r\n echo json_encode($res);\r\n $this->render(false);\r\n }",
"public function list_of_fileuploads() {\n $request = $_GET;\n $result = $this->fileupload_model->load_list_of_fileuploads($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }",
"function wck_get_entry_field_upload($id){\r\n\t\tif( !empty ( $id ) && is_numeric( $id ) ){\t\t\t\t\r\n\t\t\t$file_src = wp_get_attachment_url($id);\r\n\t\t\t$thumbnail = wp_get_attachment_image( $id, array( 80, 60 ), true );\r\n\t\t\t$file_name = get_the_title( $id );\r\n\t\t\t\r\n\t\t\tif ( preg_match( '/^.*?\\.(\\w+)$/', get_attached_file( $id ), $matches ) )\r\n\t\t\t\t$file_type = esc_html( strtoupper( $matches[1] ) );\r\n\t\t\telse\r\n\t\t\t\t$file_type = strtoupper( str_replace( 'image/', '', get_post_mime_type( $id ) ) );\r\n\t\t\t\r\n\t\t\treturn $display_value = '<div class=\"upload-field-details\">'. $thumbnail .'<p><span class=\"file-name\">'. $file_name .'</span><span class=\"file-type\">'. $file_type . '</span></p></div>';\t\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}",
"public function _replyToReturnAutoCompleteRequest() {\n\n if ( ! $this->_isLoggedIn() ) { exit; }\n if ( ! isset( $_GET['q'] ) ) { exit; }\n\n $_aGet = $_GET;\n unset( $_aGet['request'], $_aGet['page'], $_aGet['tab'], $_aGet['settings-updated'] );\n\n $_aData = array();\n $_sType = isset( $_GET['type'] ) ? $_GET['type'] : '';\n switch ( $_sType ) {\n default:\n case 'post':\n $_aData = $this->_searchPosts( $_aGet );\n break;\n case 'user':\n $_aData = $this->_searchUsers( $_aGet );\n break;\n }\n \n exit( json_encode( $_aData ) );\n \n }",
"function acf_get_file_input($attrs = array())\n{\n}",
"public function getUploadField()\n {\n return $this->component->getUploadField($this->gridField);\n }",
"public function getUploadField()\n {\n return $this->component->getUploadField($this->gridField);\n }",
"public function findFortune(){\n $this->Auth->allow();\n if ($this->request->is('post')) {\n $data =\t$this->request->data;\n $result = $this->Fortunes->searchFortune($data);\n dump($result);\n\n }\n }",
"function get_desc_file_fields() {\n\treturn array (\n\t\t\t\"Taxonomic name (Name)\",\n\t\t\t\"Diagnostic Description\",\n\t\t\t\"Distribution\",\n\t\t\t\"Habitat\",\n\t\t\t\"Size\",\n\t\t\t\"Habitus image\",\n\t\t\t\"Morphological Description\",\n\t\t\t\"Habitat image\",\n\t\t\t\"Simlar Species (Name)\",\n\t\t\t\"Pronotum image\",\n\t\t\t\"Elytral microsculpture\",\n\t\t\t\"Genitalia left image\",\n\t\t\t\"General description\",\n\t\t\t\"Genetics\" \n\t);\n}",
"public function autoCompleteNoms() {\n\t\t$_cocktailsdb = new CocktailsModel();\n\n\t\t$_nomsdb\t= $_cocktailsdb->getCocktails();\n\n\t\tforeach ($_nomsdb as $value) {\n\t\t\t$_nomstab[] = $value['nomCocktail'];\n\t\t}\n\t\t$_nomsjson \t= $this->showJson($_nomstab);\n\n\t\t$this->show('data/noms', ['nomsjson' => $_nomsjson]);\n\t}",
"function hook_file_entity_search_result($file) {\n $file_usage_count = db_query('SELECT count FROM {file_usage} WHERE fid = :fid', array('fid' => $file->fid))->fetchField();\n return array(\n 'file_usage_count' => format_plural($file_usage_count, '1 use', '@count uses'),\n );\n}",
"function customer_search()\n {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'),100);\n echo json_encode($suggestions);\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/google_search.php',\n 'lang_custom/EN/google_search.ini',\n 'sources_custom/blocks/side_google_search.php',\n 'sources_custom/blocks/main_google_results.php',\n 'themes/default/templates_custom/BLOCK_SIDE_GOOGLE_SEARCH.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_GOOGLE_SEARCH_RESULTS.tpl',\n 'themes/default/css_custom/google_search.css',\n 'pages/comcode_custom/EN/_google_search.txt',\n );\n }",
"public function getsuggestedAction()\r\n {\r\n $User = $this->getUser();\r\n $data = $User->getSuggested();\r\n return $data;\r\n }",
"public function getUploadcomment() {}",
"function tags()\n {\n session_write_close();\n $suggestions = $this->Tag->get_tag_suggestions($this->input->get('term'), 25);\n echo json_encode($suggestions);\n }",
"public function getSuggestions()\n {\n return $this->suggestions;\n }",
"public function getSuggestions()\n {\n return $this->suggestions;\n }",
"public function getSuggestions()\n {\n return $this->suggestions;\n }",
"protected function getInput() {\n\t\t\n\t\t$files = $this->geoIPFolders();\n\t\t$foundcountry = $foundlitecity = $foundcity = false;\n\t\t$messages = array();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$proposed_file = JPATH_SITE.DS.$file.'GeoIP.dat';\n\t\t\t$country = is_file($proposed_file) && is_readable($proposed_file);\n\t\t\t$proposed_file = JPATH_SITE.DS.$file.'GeoLiteCity.dat';\n\t\t\t$litecity = is_file($proposed_file) && is_readable($proposed_file);\n\t\t\t$proposed_file = JPATH_SITE.DS.$file.'GeoIPCity.dat';\n\t\t\t$city = is_file($proposed_file) && is_readable($proposed_file);\n\t\t\t\n\t\t\tif ($country && !$foundcountry) {\n\t\t\t\t$age = intval((time() - filemtime(JPATH_SITE.DS.$file.'GeoIP.dat'))/(24*60*60));\n\t\t\t\tif ($age > 30) $age = \"<span style='color:red;'>\" . JText::sprintf(\"MM_GEOIP_PLEASE_UPDATE\", $age,\n\t\t\t\t\t\"<a href='http://www.maxmind.com/app/ip-location' target='_blank'>MaxMind</a>\") . \"</span>\";\n\t\t\t\telse $age = \"\";\n\t\t\t\t$messages[] = $file . JText::_(\"MM_GEOIP_COUNTRY_CHECK_FOUND\") . \" $age\";\n\t\t\t\t$foundcountry = true;\n\t\t\t}\n\t\t\tif ($litecity && !$foundlitecity) {\n\t\t\t\t$age = intval((time() - filemtime(JPATH_SITE.DS.$file.'GeoLiteCity.dat'))/(24*60*60));\n\t\t\t\tif ($age > 30) $age = \"<span style='color:red;'>\" . JText::sprintf(\"MM_GEOIP_PLEASE_UPDATE\", $age,\n\t\t\t\t\t\"<a href='http://www.maxmind.com/app/ip-location' target='_blank'>MaxMind</a>\") . \"</span>\";\n\t\t\t\telse $age = \"\";\n\t\t\t\t$messages[] = $file . JText::_(\"MM_GEOIP_LITECITY_CHECK_FOUND\") . \" $age\";\n\t\t\t\t$foundlitecity = true;\n\t\t\t}\n\t\t\tif ($city && !$foundcity) {\n\t\t\t\t$age = intval((time() - filemtime(JPATH_SITE.DS.$file.'GeoIPCity.dat'))/(24*60*60));\n\t\t\t\tif ($age > 30) $age = \"<span style='color:red;'>\" . JText::sprintf(\"MM_GEOIP_PLEASE_UPDATE\", $age,\n\t\t\t\t\t\"<a href='http://www.maxmind.com/app/ip-location' target='_blank'>MaxMind</a>\") . \"</span>\";\n\t\t\t\telse $age = \"\";\n\t\t\t\t$messages[] = $file . JText::_(\"MM_GEOIP_CITY_CHECK_FOUND\") . \" $age\";\n\t\t\t\t$foundcity = true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ($foundcountry || $foundlitecity || $foundcity) {\n\t\t\treturn \"<b>\".implode(\"<br/>\",$messages).'</b>\n\t\t\t<br />' . JText::sprintf(\"MM_GEOIP_KEEP_UPTODATE\",\n\t\t\t\t'<a href=\"http://www.maxmind.com/app/ip-location\" target=\"_blank\">MaxMind</a>');\n\t\t}\n\t\treturn JText::_('GEOIP_DOWNLOAD_HELPTEXT');\n\t}",
"function admin_autocomplete($term = null) {\n $this->layout = 'ajax';\n if (!$this->request->is('post')) {\n throw new MethodNotAllowedException();\n }\n $params = array();\n $params['fields'] = array('hash');\n\n //Dodatkowe dane przekazywane z FebFormHelper-a\n //if (!empty($this->request->data['fields']['field_name'])) {\n // $params['conditions']['Order.field_name'] = $_POST['fields']['field_name'];\n //}\n\n $this->request->data['fraz'] = preg_replace('/[ >]+/', '%', $this->request->data['fraz']);\n $this->Order->recursive = -1;\n $params['conditions'][\"Order.hash LIKE\"] = \"%{$this->request->data['fraz']}%\";\n $res = $this->Order->find('all', $params);\n echo json_encode($res);\n $this->render(false);\n }",
"function wp_ajax_autocomplete_user()\n {\n }",
"public function ajaxPagerCallback(array &$form, FormStateInterface $form_state) {\n return $form['filefield_filesources_jsonapi_form']['lister'];\n }",
"function plugin_suggest_callback() {\r\n\t\t\tglobal $wpdb, $post;\r\n\t\t\t\r\n\t\t\t$posttype = $wpdb->escape($_GET['type']);\r\n\t\t\t$in = $wpdb->escape($_GET['q']);\r\n\r\n\t\t\t$query = \"SELECT ID from $wpdb->posts where post_type = '$posttype' AND post_title like '%$in%' \";\r\n\t\t\t$mypostids = $wpdb->get_col($query);\r\n\r\n\t\t\tforeach ($mypostids as $key => $value) {\r\n\t\t\t\tprint get_the_title($value) . \" [#\" . $value . \"]\" . \"\\n\";\r\n\t\t\t}\r\n\t\t\tdie(); // this is required to return a proper result\r\n\t\t}",
"public function get_media_edit_input()\n {\n }",
"function _setUploadForm()\r\n {\r\n global $_ARRAYLANG, $_CONFIG;\r\n\r\n\r\n //data we want to remember for handling the uploaded files\r\n\t\t$data = array();\r\n if (array_key_exists($this->_mediaType, $this->mediaTypePaths)) {\r\n $data['path'] = $this->mediaTypePaths[$this->_mediaType][0].$this->_path;\r\n $data['webPath'] = $this->mediaTypePaths[$this->_mediaType][1].$this->_path;\r\n } else {\r\n $data['path'] = ASCMS_CONTENT_IMAGE_PATH.$this->_path;\r\n $data['webPath'] = ASCMS_CONTENT_IMAGE_WEB_PATH.$this->_path;\r\n }\r\n\r\n $comboUp = \\Cx\\Core_Modules\\Upload\\Controller\\UploadFactory::getInstance()->newUploader('exposedCombo');\r\n $comboUp->setFinishedCallback(array(ASCMS_CORE_MODULE_PATH.'/FileBrowser/Controller/FileBrowser.class.php','\\Cx\\Core_Modules\\FileBrowser\\Controller\\FileBrowser','uploadFinished'));\r\n $comboUp->setData($data);\r\n //set instance name to combo_uploader so we are able to catch the instance with js\r\n $comboUp->setJsInstanceName('exposed_combo_uploader');\r\n\r\n $this->_objTpl->setVariable(array(\r\n 'COMBO_UPLOADER_CODE' => $comboUp->getXHtml(true),\r\n ));\r\n //end of uploader button handling\r\n //check if a finished upload caused reloading of the page.\r\n //if yes, we know the added files and want to highlight them\r\n if (!empty($_GET['highlightUploadId'])) {\r\n $key = 'filebrowser_upload_files_'.intval($_GET['highlightUploadId']);\r\n if (isset($_SESSION[$key])) {\r\n $sessionHighlightCandidates = $_SESSION[$key]; //an array with the filenames, set in FileBrowser::uploadFinished\r\n }\r\n //clean up session; we do only highlight once\r\n unset($_SESSION[$key]);\r\n\r\n if(is_array($sessionHighlightCandidates)) //make sure we don't cause any unexpected behaviour if we lost the session data\r\n $this->highlightedFiles = $sessionHighlightCandidates;\r\n }\r\n\r\n $objFWSystem = new \\FWSystem();\r\n \r\n // cannot upload or mkdir in webpages view\r\n if ($this->_mediaType == \"webpages\") {\r\n return;\r\n }\r\n $this->_objTpl->addBlockfile('FILEBROWSER_UPLOAD', 'fileBrowser_upload', 'module_fileBrowser_upload.html');\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_UPLOAD_TYPE' => $this->_mediaType,\r\n 'FILEBROWSER_UPLOAD_PATH' => $this->_path,\r\n 'FILEBROWSER_MAX_FILE_SIZE' => $objFWSystem->getMaxUploadFileSize(),\r\n 'TXT_CREATE_DIRECTORY' => $_ARRAYLANG['TXT_FILEBROWSER_CREATE_DIRECTORY'],\r\n 'TXT_UPLOAD_FILE' => $_ARRAYLANG['TXT_FILEBROWSER_UPLOAD_FILE'],\r\n 'JAVASCRIPT' \t=> \\JS::getCode(),\r\n ));\r\n\r\n $this->_objTpl->parse('fileBrowser_upload');\r\n }",
"function autoCompleteSellingobstacles()\n {\n \t//pr($this->Sellingobstacles->find('all'));die;\n \t//$this->set('sellingobstacles', $this->Sellingobstacles->find('all'));\n\t\t\t$this->set('sellingobstacles', $this->Sellingobstacle->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t'Sellingobstacle.isactive' => 1,\n\t\t\t'Sellingobstacle.selling_obstacles LIKE' => '%'.$this->data['Sellingobstacle']['selling_obstacles'].'%'\n\t\t\t),\n\t\t\t'fields' => array('id','selling_obstacles')\n\t\t\t)));\n\t\t\t\n\t\t\t$this->layout = 'ajax';\n }",
"public function getUploadName(){\n\t\treturn $this->uploadName;\n\t}",
"function havp_fscan_before_form(&$pkg) {\n\tif (is_array($pkg['fields']['field'])) {\n\t\tforeach ($pkg['fields']['field'] as $key => $field) {\n\t\t\tif ($field['fieldname'] === F_SCANFILEPATH) {\n\t\t\t\t$pkg['fields']['field'][$key]['description'] .= havp_fscan_html();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}",
"public function get_search_fileareas() {\n $fileareas = array(\n 'intro' // Fileareas.\n );\n\n return $fileareas;\n }",
"public static function determineUploadLocation(FieldItemListInterface $field): string {\n return (new FileItem($field->getItemDefinition()))->getUploadLocation();\n }",
"function file_info()\n\t{\n\t\t$file_id = ee()->input->get('file_id');\n\n\t\t$data = $file_id ? call_user_func($this->config['file_info_callback'], $file_id) : array();\n\n\t\tif (count($data) == 0)\n\t\t{\n\t\t\techo '{}';\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo json_encode($data);\n\t\t}\n\t\texit;\n\t}",
"function item_search()\n {\n session_write_close();\n $suggestions = $this->Item->get_item_search_suggestions($this->input->get('term'), 'unit_price', 100);\n echo json_encode($suggestions);\n }",
"function get_tax_file_fields() {\n\treturn array (\n\t\t\t\"Term name\",\n\t\t\t\"GUID\",\n\t\t\t\"Parent GUID\",\n\t\t\t\"Rank\",\n\t);\n}",
"public function getUpload()\n {\n return $this->upload;\n }",
"function gtags_show_tags_chooser(){\n\t?>\n\t<span class=\"fr\">\n\t\tSuggestions : <span class=\"highlight etiquette\"><?php echo gtags_show_tags_in_add_form(); ?></span>\n\t</span>\n\t<?php \n}",
"public function getFsSelection() {}",
"public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }",
"public function collectInfoFiles()\r\n {\r\n $files_found = $this->findFiles($this->destination_dir, array('md', '1st', 'txt'));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }",
"function onUpload(&$man, $cmd, $input) {\r\n\t\treturn null;\r\n\t}",
"public function getAvatarUploadMeta()\n {\n return $this->avatarUploadMeta;\n }",
"public static function SELECT_UPLOAD_PHOTO_LIST(){\n\t $SQL_String = \"SELECT * FROM task_upload WHERE user=:user AND folder=:folder AND flag=:flag AND _upload!='' AND _process='';\";\n\t return $SQL_String;\n\t}",
"function summary_title() {\n return t('Autocomplete widgets');\n }",
"function retrieveAll ( $text_autocomplete = NULL )\n {\n\n $q = Doctrine_Query :: create ()\n ->from ( 'AssetType' )\n ->orderBy ( 'asset_type_name ASC' );\n\n if ( ! is_null ( $text_autocomplete ) )\n {\n $q->andWhere ( 'asset_type_name LIKE ?' , $text_autocomplete . '%' );\n }\n\n return $q->execute ();\n }",
"public function bansos_autocomplete()\n {\n $cari = $this->request->getVar('term');\n $bansos = $this->DataBansosModel->cari($cari);\n $w = array();\n foreach ($bansos as $b) {\n $w[] = [\n \"label\" => $b['idBansos'],\n \"namaBansos\" => $b['namaBansos'],\n \"kategori\" => $b['kategori'],\n \"pendamping\" => $b['pendamping'],\n \"nominal\" => $b['nominal']\n ];\n }\n echo json_encode($w);\n }",
"function list_input_files($experiment)\n{\n $applicationInputs = get_application_inputs($experiment->applicationId);\n\n $experimentInputs = $experiment->experimentInputs;\n\n\n\n foreach ($experimentInputs as $input)\n {\n $matchingAppInput = null;\n foreach($applicationInputs as $applicationInput)\n {\n if ($input->key == $applicationInput->name)\n {\n $matchingAppInput = $applicationInput;\n }\n }\n //var_dump($matchingAppInput);\n\n if ($matchingAppInput->type == DataType::URI)\n {\n $explode = explode('/', $input->value);\n //echo '<p><a href=\"' . $input->value . '\">' . $input->key . '</a></p>';\n echo '<p><a target=\"_blank\"\n href=\"' . EXPERIMENT_DATA_ROOT . $explode[sizeof($explode)-2] . '/' . $explode[sizeof($explode)-1] . '\">' .\n $input->key . '\n <span class=\"glyphicon glyphicon-new-window\"></span></a></p>';\n //echo $input->value . '<br>';\n //echo str_replace(EXPERIMENT_DATA_ROOT_ABSOLUTE, EXPERIMENT_DATA_ROOT, $input->value) . '<br>';\n //echo dirname($input->value) . '<br>';\n\n\n //var_dump($explode);\n //echo sizeof($explode) . '<br>';\n //echo EXPERIMENT_DATA_ROOT . $explode[sizeof($explode)-2] . '/' . $explode[sizeof($explode)-1] . '<br>';\n }\n elseif ($matchingAppInput->type == DataType::STRING)\n {\n //$valueExplode = explode('=', $input->value);\n echo '<p>' . $input->key . ': ' . $input->value . '</p>';\n }\n }\n}"
] | [
"0.58987004",
"0.58928037",
"0.5892126",
"0.58619815",
"0.5801784",
"0.57530075",
"0.5694007",
"0.5627469",
"0.5595498",
"0.5577241",
"0.54767525",
"0.5462312",
"0.54321563",
"0.54269177",
"0.5419353",
"0.5385081",
"0.5366471",
"0.5363788",
"0.53560567",
"0.5344834",
"0.53290266",
"0.53225946",
"0.53205013",
"0.532034",
"0.5319258",
"0.5252991",
"0.524578",
"0.52405006",
"0.52222586",
"0.52109665",
"0.5198079",
"0.51824963",
"0.51732343",
"0.51719964",
"0.5168881",
"0.51659197",
"0.5154531",
"0.51513207",
"0.5143611",
"0.513805",
"0.51034755",
"0.50593543",
"0.50531024",
"0.5048718",
"0.5046779",
"0.5045367",
"0.5039071",
"0.50329256",
"0.5031453",
"0.5009378",
"0.49903342",
"0.4989072",
"0.49813953",
"0.49648136",
"0.49576208",
"0.49468505",
"0.4938151",
"0.4928349",
"0.4925496",
"0.49219558",
"0.49219558",
"0.49149063",
"0.48948094",
"0.48826426",
"0.48819485",
"0.48806763",
"0.48760962",
"0.4875938",
"0.48630488",
"0.48593998",
"0.48534548",
"0.48534548",
"0.48534548",
"0.4851191",
"0.48481452",
"0.48325673",
"0.4830167",
"0.4826587",
"0.48237836",
"0.48171216",
"0.48167998",
"0.48127845",
"0.481276",
"0.4802858",
"0.48005217",
"0.47918263",
"0.47813687",
"0.4769972",
"0.4769384",
"0.4764528",
"0.47544962",
"0.47494537",
"0.47488692",
"0.47467685",
"0.47467542",
"0.4744455",
"0.47404537",
"0.47374573",
"0.4736855",
"0.4731319"
] | 0.5648393 | 7 |
Creates data provider instance with search query applied | public function search($params)
{
$query = ApoyoAcademico::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'persona_doctor' => $this->persona_doctor,
'id_persona_estudiante' => $this->id_persona_estudiante,
'fecha_entrada' => $this->fecha_entrada,
'hora_entrada' => $this->hora_entrada,
'fecha_salida' => $this->fecha_salida,
'hora_salida' => $this->hora_salida,
'incapacidad' => $this->incapacidad,
'no_dias_incapaciad' => $this->no_dias_incapaciad,
'discapacidad' => $this->discapacidad,
'id_sede' => $this->id_sede,
'id_tipo_apoyo' => $this->id_tipo_apoyo,
'estado' => $this->estado,
]);
$query->andFilterWhere(['ilike', 'registro', $this->registro])
->andFilterWhere(['ilike', 'motivo_consulta', $this->motivo_consulta])
->andFilterWhere(['ilike', 'observaciones', $this->observaciones]);
return $dataProvider;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function searchQueryDataProvider() {}",
"public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }",
"public function getQueryDataProvider() {}",
"public function search() {\n // Get CDbCriteria instance\n $dbCriteria = new CDbCriteria;\n // Search for client name\n $dbCriteria->compare('name', Yii::app()->request->getQuery('name', ''), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $dbCriteria,\n 'pagination' => array(\n 'pageSize' => 10,\n ),\n ));\n }",
"protected function getDataProviders()\n {\n $searchModel = $this->getSearchModel();\n $queryParams = Yii::$app->request->queryParams;\n $dataProvider = $searchModel->search($queryParams);\n return [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ];\n }",
"public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }",
"public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }",
"public function search() {\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $this->getSearchCriteria(),\n\t\t\t'sort' => array(\n\t\t\t\t'defaultOrder' => 't.id DESC',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'client_id' => array(\n\t\t\t\t\t\t'asc' => 'client_name asc',\n\t\t\t\t\t\t'desc' => 'client_name desc',\n\t\t\t\t\t),\n\t\t\t\t\t'*',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'pagination' => array(\n\t\t\t\t'pageSize' => Yii::app()->config->get('global.per_page'),)\n\t\t));\n\t}",
"public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('id', $this->id, true);\n $criteria->compare('level', $this->level);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('ip_create', $this->ip_create, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }",
"public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function prepareDataProvider()\n\t{\n\t $searchModel = new \\app\\models\\ClearanceSearch(); \n\t\treturn $searchModel->search(\\Yii::$app->request->queryParams);\n\n\t}",
"public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('authorname', $this->authorname, true);\n return new CActiveDataProvider($this, array('criteria' => $criteria, ));\n }",
"public function getDataProvider(array $query = []);",
"protected function prepareDataProvider()\n {\n if ($this->prepareDataProvider !== null) {\n return call_user_func($this->prepareDataProvider, $this);\n }\n\n\t\t/* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\t\t$query = $modelClass::find();\n\t\t\n\t\t$filters = ActionHelpers::getFilter();\n\t\t\n\t\tforeach($filters as $filter) {\n\t\t\t$query->andFilterWhere($filter);\n\t\t}\n\t\t\n\t\tif($with = ActionHelpers::getWith()) {\n $query->with($with);\n }\n\n return new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => ActionHelpers::getLimit()\n ],\n 'sort'=> ActionHelpers::getSort()\n // 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]]\n ]);\n }",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}",
"public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search()\n {\n $query = Hotel::find();\n // add conditions that should always apply here\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n \n // grid filtering conditions\n $query->availables($this->quantity_of_guests);\n $query->andFilterWhere([\n 'hotel_id' => $this->hotel_id,\n 'price_per_guest' => $this->price_per_guest,\n ]);\n $query->andFilterWhere(['like', 'city_name', $this->city_name]);\n return $dataProvider;\n \n }",
"public function search()\n\t{\n\t $criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('projection',$this->projection,true);\n\t\t$criteria->compare('username',Yii::app()->user->id);\n\t\t$criteria->compare('title',$this->title);\n\t\t$criteria->compare('url',$this->url);\n\t return new CActiveDataProvider(get_class($this), array(\n\t 'criteria'=> $criteria,\n\t 'sort'=>array(\n\t 'defaultOrder'=>'name ASC',\n\t ),\n\t 'pagination'=>array(\n\t 'pageSize'=>10\n\t ),\n\t ));\n\t}",
"private function _getDataProvider($query, $params){\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'user_id' => $this->user_id,\n 'profile_id' => $this->profile_id,\n 'authentication_method_id' => $this->authentication_method_id,\n 'status' => $this->status,\n 'created_at' => $this->created_at,\n 'updated_at' => $this->updated_at,\n ]);\n\n $query->andFilterWhere(['like', 'username', $this->username])\n ->andFilterWhere(['like', 'auth_key', $this->auth_key])\n ->andFilterWhere(['like', 'password_hash', $this->password_hash])\n ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])\n ->andFilterWhere(['like', 'email', $this->email]);\n\n return $dataProvider;\n }",
"public function getMetadataQueryProviderWrapper();",
"protected function prepareDataProvider()\n {\n \t$modelClass = $this->modelClass;\n\n $orderBy='id';\n if (isset($_GET['orderBy'])) $orderBy=$_GET['orderBy'];\n\n $orderByDir='DESC';\n if (isset($_GET['orderByDir'])) $orderByDir=$_GET['orderByDir'];\n\n $limit=20;\n if (isset($_GET['limit'])) $limit=$_GET['limit'];\n\n $order = \"$orderBy $orderByDir\";\n\n \t$dataProvider = new ActiveDataProvider([\n 'query' => $modelClass::find()->limit($limit)->with('supplier')->orderBy($order),\n 'pagination' => [\n 'pageSize' => $limit,\n ],\n ]);\n\n \treturn $dataProvider;\n }",
"public function makeSearch() \n {\n $this->setSelect($this->qb);\n $this->setAssociations($this->qb);\n $this->setWhere($this->qb);\n $this->setOrderBy($this->qb);\n $this->setLimit($this->qb);\n\n return $this;\n }",
"public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\t\t//TODO: update search criteria\n\t\t$criteria->compare('id', $this->id, true);\n\t\t$criteria->compare('event_id', $this->event_id, true);\n\t\t$criteria->compare('standard_intervention_exists', $this->standard_intervention_exists);\n\t\t$criteria->compare('details', $this->details);\n\t\t$criteria->compare('interventions_id', $this->interventions_id);\n\t\t$criteria->compare('description', $this->description);\n\t\t$criteria->compare('patient_factors', $this->patient_factors);\n\t\t$criteria->compare('patient_factor_details', $this->patient_factor_details);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}",
"public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('keywords',$this->keywords,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public static function new_search_record()\n\t{\n\t\treturn new user_record_search();\n\t}",
"public function search() {\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('content', $this->content, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('author', $this->author, true);\n\t\t$criteria->compare('type', $this->type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}",
"public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('uid', $this->uid);\n $criteria->compare('token', $this->token, true);\n $criteria->compare('created', $this->created, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n\n $this->entity = $this->name;\n $this->conditions = $this->_getSearchConditions();\n $this->joins = $this->_getSearchJoins();\n $this->orders = $this->_getSearchOrder();\n $this->limit = $this->_getSearchLimit();\n $this->maxLimit = $this->_getSearchMaxLimit();\n $this->offset = $this->_getSearchOffset();\n $this->fields = $this->_getSearchFields();\n $this->group = $this->_getSearchGroup();\n\n// $this->setVar('entity', $this->name);\n// $this->setVar('conditions', $this->_getSearchConditions());\n// $this->setVar('joins', $this->_getSearchJoins());\n// $this->setVar('orders', $this->_getSearchOrder());\n// $this->setVar('limit', $this->_getSearchLimit());\n// $this->setVar('maxLimit', $this->_getSearchMaxLimit());\n// $this->setVar('offset', $this->_getSearchOffset());\n// $this->setVar('fields', $this->_getSearchFields());\n// $this->setVar('group', $this->_getSearchGroup());\n//\n// $this->setVar('baseAdditionalElements', $this->additionalElements);\n $this->getFieldsForSearchFunction = '_extractSearchFields';\n\n return $this->baseSearch();\n }",
"public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('keyword_id', $this->keyword_id);\n $criteria->compare('visits', $this->visits);\n $criteria->compare('page_views', $this->page_views);\n $criteria->compare('parsing', $this->parsing);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 50),\n ));\n }",
"protected function getNewSearchModel()\n {\n $searchModelName = $this->getSearchModelName();\n return new $searchModelName;\n }",
"public function search()\n\t{\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function searchdatas(){\r\n\t\t// should not be searched.\r\n\t\t$conditions=array();\r\n\t\t$params=array();\r\n\t\t$page_params=array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$sort=new CSort();\r\n \t$sort->attributes=array();\r\n \t$sort->defaultOrder=\"t.create_time ASC\";\r\n \t$sort->params=$page_params;\r\n\t\treturn new CActiveDataProvider(get_class($this), array(\r\n\t\t\t'criteria'=>array(\r\n\t\t\t 'condition'=>'',\r\n\t\t\t 'params'=>array(),\r\n\t\t\t 'with'=>array(\"User\",\"District\"),\r\n\t\t\t),\r\n\t\t\t'pagination'=>array(\r\n 'pageSize'=>'20',\r\n 'params'=> $page_params,\r\n ),\r\n 'sort'=>$sort,\r\n\t\t));\r\n\t}",
"public function search()\n {\n\n $query = Board::find()->where(['user_id' => $this->user_id]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'created_at' => SORT_DESC,\n\n ]\n ],\n ]);\n\n return $dataProvider;\n }",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('post_id', $this->post_id);\n $criteria->compare('language_id', $this->language_id);\n $criteria->compare('header', $this->header, true);\n $criteria->compare('text', $this->text, true);\n\t\t$criteria->compare('rating',$this->rating);\n\t\t$criteria->compare('author_id',$this->author_id);\n\t\t$criteria->compare('date_add',$this->date_add,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('t.id', $this->id);\n $criteria->compare('who', $this->who);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('rate', $this->rate);\n $criteria->compare('knowledge', $this->knowledge);\n $criteria->compare('behavior', $this->behavior);\n $criteria->compare('motivation', $this->motivation);\n $criteria->compare('rate', $this->who_ip);\n $criteria->compare('is_checked', $this->is_checked);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => '50',\n ),\n 'sort' => array(\n 'defaultOrder' => array(\n 'date' => CSort::SORT_DESC,\n ),\n ),\n ));\n }",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('name', $this->name, true);\n $criteria->compare('latitude', $this->latitude);\n $criteria->compare('longitude', $this->longitude);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('vicinity', $this->vicinity, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function parametersAndQueriesDataProvider() {}",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('region_id', $this->region_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search()\n\t{\n\t\t $this->StateProcess(get_class($this).'_'.Y::app()->params['cfgName']);\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n $criteria->compare('title_adm',$this->title,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'sort'=>array('defaultOrder'=>'id DESC'),\n 'pagination'=>array('pageSize'=>Config::$data['base']->pageSize)\n\t\t));\n\t}",
"public function search($params,$query=null)\n {\n if(!$query) $query = RestClient::find();\n\n $query = $query->joinWith(['hospital']) \n ->joinWith(['hospital.sales']);\n //$query = $query->joinWith('mingrui_comments');\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n \n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n //var_dump($params);exit;\n return $dataProvider;\n }\n \n // grid filtering conditions\n $query->andFilterWhere([\n 'rest_client.id' => $this->id, \n 'age' => $this->age, \n 'hospital_id' => $this->hospital_id, \n ]);\n\n $query->andFilterWhere(['like', 'rest_client.name', $this->name])\n ->andFilterWhere(['like', 'sex', $this->sex])\n ->andFilterWhere(['like', 'birthplace', $this->birthplace])\n ->andFilterWhere(['like', 'email', $this->email])\n ->andFilterWhere(['like', 'tel', $this->tel])\n ->andFilterWhere(['like', 'school', $this->school])\n ->andFilterWhere(['like', 'education', $this->education])\n ->andFilterWhere(['like', 'experience', $this->experience])\n ->andFilterWhere(['like', 'employed', $this->employed])\n ->andFilterWhere(['like', 'department', $this->department])\n ->andFilterWhere(['like', 'worktime', $this->worktime])\n ->andFilterWhere(['like', 'position', $this->position])\n ->andFilterWhere(['like', 'speciality', $this->speciality])\n ->andFilterWhere(['like', 'hobby', $this->hobby])\n ->andFilterWhere(['like', 'notes', $this->notes])\n ->andFilterWhere(['like', 'zhuren', $this->zhuren])\n ->andFilterWhere(['like', 'pianhao', $this->pianhao]) \n ->andFilterWhere(['like', 'rest_danwei.name', $this->hospitalname])\n ->andFilterWhere(['like', 'rest_sales.name', $this->salesname])\n ;\n\n // echo $query->createCommand()->getRawSql(); exit; \n return $dataProvider;\n }",
"public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('agreement',$this->agreement);\n\t\t$criteria->compare('date',$this->date,true);\n\t\t$criteria->compare('user',$this->user);\n\t\t$criteria->compare('new_status',$this->new_status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n\n\t\t$criteria = $this->getDbCriteria();\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('subject', $this->subject, true);\n\t\t$criteria->compare('status', $this->status);\n\t\t$criteria->compare('template.name', $this->template_id, true);\n\n\t\t$sort = new CSort;\n\t\t$sort->defaultOrder = 'id DESC';\n\n\t\treturn new NActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t\t'sort' => $sort,\n\t\t\t\t\t'pagination' => array(\n\t\t\t\t\t\t'pageSize' => 20,\n\t\t\t\t\t),\n\t\t\t\t));\n\t}",
"public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id,true);\n $criteria->compare('query_id',$this->query_id,true);\n $criteria->compare('se_id',$this->se_id,true);\n $criteria->compare('se_page',$this->se_page,true);\n $criteria->compare('se_url',$this->se_url,true);\n $criteria->compare('visits',$this->visits);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 25),\n ));\n }",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('acquisition_date_id', $this->acquisition_date_id);\n $criteria->compare('acquisition_type_id', $this->acquisition_type_id);\n $criteria->compare('location_id', $this->location_id);\n $criteria->compare('number', $this->number, true);\n $criteria->compare('annotation', $this->annotation, true);\n $criteria->compare('location_coordinates_id', $this->location_coordinates_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 1);\n $this->order = 'create_time desc';\n }",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('id_client', $this->id_client);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('date_birth', $this->date_birth, true);\n $criteria->compare('gender', $this->gender);\n\n return new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('domain', $this->domain, true);\n $criteria->compare('ru_domain', $this->ru_domain, true);\n $criteria->compare('page', $this->ru_domain);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function applyDefaultSearchQuery(\\yii\\data\\ActiveDataProvider &$dataProvider);",
"protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 0);\n $this->order = 'create_time desc';\n }",
"public static function new_search_record()\n\t{\n\t\treturn new league_record_search();\n\t}",
"public function search()\n {\n $query = Story::find()\n ->owner()\n ->globalChannel()\n ->orderBy(['_id' => SORT_ASC])\n ->active();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => false\n ]);\n\n return $dataProvider;\n }",
"public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('project_id', $this->project_id);\n $criteria->compare('num', $this->num);\n $criteria->compare('team_strength', $this->team_strength);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"private function instantiate_search_page() {\n // Build the search_types_fields and search_types_label arrays out of post_types_defs\n $search_types_fields = array();\n $search_types_label = array();\n foreach ( $this->post_type_defs as $post_type ) {\n $search_types_fields[ $post_type[ 'slug' ] ] = $post_type[ 'fields' ];\n $search_types_label[ $post_type[ 'slug' ] ] = $post_type[ 'plural_name' ];\n }\n $this->search_page = new HRHS_Search( array(\n // Using the default slug and title for now\n 'search_types_fields' => $search_types_fields,\n 'search_types_label' => $search_types_label\n ) );\n }",
"public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search($query);",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('summ', $this->summ, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('nrs', $this->nrs, true);\n $criteria->compare('supplier_name', $this->supplier_name, true);\n $criteria->compare('npwp', $this->npwp, true);\n $criteria->compare('bank_name', $this->bank_name, true);\n $criteria->compare('bank_account_number', $this->bank_account_number, true);\n $criteria->compare('created_at', $this->created_at, true);\n $criteria->compare('created_by', $this->created_by);\n $criteria->compare('updated_at', $this->updated_at, true);\n $criteria->compare('updated_by', $this->updated_by);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'defaultOrder' => 'id DESC',\n ),\n ));\n }",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('did',$this->did);\n\t\t$criteria->compare('date_prod',$this->date_prod,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('len',$this->len,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}",
"public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere([\n\t 'id' => $this->id,\n\t 'ord' => $this->ord,\n\t 'type' => $this->type,\n\t ])\n\t ->andFilterWhere(['like', 'code', $this->code])\n ->andFilterWhere(['like', 'name', $this->name]);\n\n return $this->dataProvider;\n }",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n $criteria = new CDbCriteria();\n \n $criteria->compare('question_id', $this->question_id);\n $criteria->compare('student_id', $this->student_id);\n $criteria->compare('answer_id', $this->answer_id);\n $criteria->compare('answer_text', $this->answer_text, true);\n $criteria->compare('answer_number', $this->answer_number, true);\n $criteria->compare('exec_time', $this->exec_time);\n $criteria->compare('result', $this->result);\n $criteria->compare('test_result', $this->test_result);\n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria\n ));\n }",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('createDate', $this->createDate);\n $criteria->compare('lastUpdated', $this->lastUpdated);\n $criteria->compare('trackingKey', $this->trackingKey);\n $criteria->compare('email', $this->email);\n $criteria->compare('leadscore', $this->leadscore);\n\n if (!Yii::app()->user->isGuest) {\n $pageSize = Profile::getResultsPerPage();\n } else {\n $pageSize = 20;\n }\n\n return new SmartActiveDataProvider(get_class($this), array(\n 'pagination' => array(\n 'pageSize' => $pageSize,\n ),\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n// @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('options', $this->options, true);\n $criteria->compare('autoreplys', $this->autoreplys, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function googleSearch()\n {\n $search = new \\Hoor\\Search\\Google(get_search_query(), $this->getIndex());\n $this->data['search'] = $search;\n $this->data['results'] = $search->results;\n }",
"protected function addSearchConfigs()\n {\n\n $this['textQueryBuilder'] = function () {\n return new TextQueryBuilder();\n };\n\n $this['searchManager'] = function ($c) {\n return new SearchManager($c['databaseAdapter'], $c['queue'], $c['request'], array(\n $c['textQueryBuilder']\n ));\n };\n\n }",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('district_id', $this->district_id);\n\t\t$criteria->compare('active', $this->active);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}",
"public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('issue_date', $this->issue_date, true);\n\n\t\treturn new CActiveDataProvider($this, array('criteria' => $criteria,));\n\t}",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('hol_id', $this->hol_id);\n $criteria->compare('loc_id', $this->loc_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere(['id' => $this->id])\n\t ->andFilterWhere(['like', 'description', $this->description])\n ->andFilterWhere(['like', 'type', $this->type]);\n\n return $this->dataProvider;\n }",
"public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria = new CDbCriteria;\r\n\r\n\t\t$criteria->compare('doc_num', $this->doc_num, true);\r\n\t\t$criteria->compare('doc_num2', $this->doc_num2);\r\n\t\t$criteria->compare('doc_date', $this->doc_date, true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}",
"public function search()\n {\n $criteria = new CDbCriteria();\n\n $criteria->compare('productCategoryId', $this->productCategoryId, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('level', $this->level);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('wikilink', $this->wikilink, true);\n\t\t$criteria->compare('picture', $this->picture, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('modification_date', $this->modification_date, true);\n\t\t$criteria->compare('featured', $this->featured);\n\t\t$criteria->compare('users_found', $this->users_found);\n\t\t$criteria->compare('gpsdata', $this->gpsdata);\n\t\t$criteria->compare('category', $this->category);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}",
"public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }",
"public function search()\n {\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('text',$this->text,true);\n $criteria->compare('author_id',$this->author_id);\n $criteria->compare('editor_id',$this->editor_id);\n $criteria->compare('crated_at',$this->crated_at,true);\n $criteria->compare('edited_at',$this->edited_at,true);\n $criteria->compare('publish_at',$this->publich_at,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_start',$this->date_start,true);\n\t\t$criteria->compare('date_end',$this->date_end,true);\n\t\t$criteria->compare('count_attempt',$this->count_attempt);\n\t\t$criteria->compare('count_questions',$this->count_questions);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('author',$this->author,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('latitud',$this->latitud,true);\n\t\t$criteria->compare('longitud',$this->longitud,true);\n\t\t$criteria->compare('telefono',$this->telefono,true);\n\t\t$criteria->compare('direccion',$this->direccion,true);\n\t\t$criteria->compare('web',$this->web,true);\n\t\t$criteria->compare('activo',$this->activo);\n\t\t$criteria->compare('userId',$this->userId);\n\t\t$criteria->compare('ratingGeneral',$this->ratingGeneral);\n\t\t$criteria->compare('youtubeUrl',$this->youtubeUrl,true);\n\t\t$criteria->compare('esDestacado',$this->esDestacado);\n\t\t$criteria->compare('aprobado',$this->aprobado);\n $criteria->compare('regionId',$this->regionId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('id_answer',$this->id_answer);\n\t\t$criteria->compare('mark',$this->mark);\n\t\t$criteria->compare('comment',$this->comment,true);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('read_mark',$this->read_mark,true);\n\t\t$criteria->compare('marked_by',$this->marked_by,true);\n\t\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('sn',$this->sn,true);\n\t\t$criteria->compare('fn',$this->fn,true);\n\t\t$criteria->compare('region',$this->region);\n\t\t$criteria->compare('postal',$this->postal,true);\n\t\t$criteria->compare('inn',$this->inn,true);\n\t\t$criteria->compare('ogrn',$this->ogrn,true);\n\t\t$criteria->compare('okpo',$this->okpo,true);\n\t\t$criteria->compare('adress',$this->adress,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('okved',$this->okved,true);\n\t\t$criteria->compare('oid',$this->oid,true);\n\t\t$criteria->compare('hits',$this->hits);\n\t\t$criteria->compare('st',$this->st);\n\t\t$criteria->compare('alias',$this->alias,true);\n\t\t$criteria->compare('alias2',$this->alias2,true);\n\t\t$criteria->compare('alias3',$this->alias3,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('cardid', $this->cardid, true);\n $criteria->compare('subclassid', $this->subclassid, true);\n $criteria->compare('cardname', $this->cardname, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('pid', $this->pid, true);\n $criteria->compare('userName', $this->userName, true);\n $criteria->compare('userEmail', $this->userEmail, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('userId', $this->userId, true);\n $criteria->compare('visibility', $this->visibility);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('recordId', $this->recordId, true);\n $criteria->compare('info', $this->info, true);\n $criteria->compare('new', $this->new, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('user', $this->user, true);\n $criteria->compare('amount', $this->amount);\n $criteria->compare('currency', $this->currency, true);\n $criteria->compare('valid_from', $this->valid_from, true);\n $criteria->compare('valid_to', $this->valid_to, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search () {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('title', $this->title, true);\n\t\t$criteria->compare('description', $this->description, true);\n\t\t$criteria->compare('type', $this->type);\n\t\t$criteria->compare('required', $this->required);\n\t\t$criteria->compare('cId', $this->cId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}",
"private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('frequency_band',$this->frequency_band,true);\n\n\t\t$criteria->compare('date_of_issue',$this->date_of_issue,true);\n\n\t\t$criteria->compare('date_of_renewal',$this->date_of_renewal,true);\n\n\t\t$criteria->compare('emission',$this->emission,true);\n\n\t\t$criteria->compare('tolerance',$this->tolerance,true);\n\n\t\t$criteria->compare('application_vsat_id',$this->application_vsat_id,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}",
"public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('contact_number', $this->contact_number, true);\n $criteria->compare('city', $this->city, true);\n $criteria->compare('gender', $this->gender, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = 'createDate, employeeId';\n\t\t$criteria->distinct = true;\n\t\t$criteria->addCondition('employeeId=\"' . $this->employeeId . '\" AND createDate between \"' . $this->startDate . '\" AND \"' . $this->endDate . '\"');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}"
] | [
"0.7773856",
"0.674291",
"0.65721744",
"0.6503215",
"0.6472826",
"0.6389071",
"0.63745373",
"0.6287255",
"0.62671757",
"0.62457365",
"0.62425256",
"0.62123144",
"0.61969537",
"0.6172912",
"0.61250603",
"0.6123412",
"0.6116283",
"0.61031115",
"0.6101092",
"0.608637",
"0.6081774",
"0.6081262",
"0.6073599",
"0.60723656",
"0.60405684",
"0.6040201",
"0.6035497",
"0.60331875",
"0.60318124",
"0.60199106",
"0.6013893",
"0.5998194",
"0.59764904",
"0.59671843",
"0.59620416",
"0.59579474",
"0.59551156",
"0.5941564",
"0.5935285",
"0.590389",
"0.5899341",
"0.5895071",
"0.5894937",
"0.5888715",
"0.58834034",
"0.5882613",
"0.58762497",
"0.58638185",
"0.5860362",
"0.5846486",
"0.58438134",
"0.5839541",
"0.5829547",
"0.5825096",
"0.5821819",
"0.5821492",
"0.5816446",
"0.5815201",
"0.58059967",
"0.58025193",
"0.57952476",
"0.5785819",
"0.57808983",
"0.57782406",
"0.57766914",
"0.5775805",
"0.57744527",
"0.57744527",
"0.57744527",
"0.57722074",
"0.5771512",
"0.5770783",
"0.5769345",
"0.57683945",
"0.57675093",
"0.576178",
"0.57557786",
"0.5747564",
"0.5746954",
"0.5745489",
"0.5741678",
"0.57375383",
"0.57335705",
"0.57302207",
"0.57280165",
"0.5726227",
"0.57238483",
"0.57218784",
"0.5715393",
"0.57136387",
"0.5713353",
"0.5711261",
"0.5710481",
"0.571002",
"0.57075536",
"0.57075375",
"0.57060134",
"0.5704971",
"0.5703576",
"0.57000446",
"0.5696112"
] | 0.0 | -1 |
Check if an error (enum name or value) has a helpful message defined. | public static function hasMessageForError($value)
{
if (self::isValidName($value)) {
$value = self::getNameValue($value);
}
return isset(self::$messages[$value]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasErrMsg()\n {\n return $this->get(self::ERRMSG) !== null;\n }",
"private function errorMessages()\n {\n return [\n 'question_category_id.required' => 'Atleast one question-category '.\n 'is required',\n ];\n }",
"private function errorMessages()\n {\n return [\n 'name.unique' => 'A category with the same name exists',\n ];\n }",
"function is_invalid($err)\n{\n // TODO: megírni. Csak akkor printelje ki a hiba-class-t ha tényleg hibás a mező\n if (!$err == null)\n echo $err . ' is-invalid';\n}",
"public function message()\n {\n return 'The :attribute value does not exist.';\n }",
"public function is_error_exists() {\n return (!empty($this->errors));\n }",
"abstract public function getMsgError();",
"public function message()\n {\n return \"Ошибочное значение\";\n }",
"public function hasErrors();",
"public function get_error_messages();",
"public function errorMessages()\n {\n return [\n self::RULE_REQUIRED => 'This field is required',\n self::RULE_EMAIL => 'This field must be a valid email address',\n self::RULE_MIN => 'Min length of this field must be {min}',\n self::RULE_MAX => 'Max length of this field must be {max}',\n self::RULE_MATCH => 'This field must be the same as {match}',\n self::RULE_UNIQUE => 'Record with this {field} already exists'\n ];\n }",
"public function setMessage() {\n $numArgs = func_num_args();\n\n switch ($numArgs) {\n default:\n return false;\n break;\n\n // A global rule error message\n case 2:\n foreach ($this->post(null) as $key => $val) {\n $this->_errorPhraseOverrides[$key][func_get_arg(0)] = func_get_arg(1);\n }\n break;\n\n // Field specific rule error message\n case 3:\n $this->_errorPhraseOverrides[func_get_arg(1)][func_get_arg(0)] = func_get_arg(2);\n break;\n }\n\n return true;\n }",
"public function message(): string|array\n {\n return trans()->has('validation.enum_value')\n ? __('validation.enum_value')\n : __('laravelEnum::messages.enum_value');\n }",
"public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }",
"public function message()\n {\n return trans('validation.exists_all');\n }",
"public static function hasError() {\n\t\treturn self::$hasError;\n\t}",
"function errorName($p_with_code = \\false)\n {\n }",
"function error_occurred() {\n\n return ($this->error_code !== null);\n\n}",
"public function message()\n {\n return 'Invalid constant value. Possible values are: ' . $this->class::all()->implode(', ');\n }",
"public function has_errors()\n {\n }",
"public function hasError();",
"public function hasError();",
"public function hasError();",
"public function hasError();",
"public function check()\n {\n return empty($this->_vars['reason'])\n ? _(\"Missing reason in vacation.\")\n : true;\n }",
"public function isError()\n {\n return $this->getName() === 'error';\n }",
"function my_error($e = '') {\t\t\n\t\t$msg = $this->error->get_error_message($e);\t\t\n\t\tif ($msg == null) {\n\t\t\treturn __(\"Unknown error occured, please contact the administrator.\", $this->plugin_domain);\n\t\t}\n\t\treturn $msg;\n\t}",
"public function errorInfo();",
"public function errorInfo();",
"public function message()\n {\n return trans('validation.exists', ['attribute' => 'action']);\n }",
"public static function hasError() {\n return !empty(self::$error);\n }",
"function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}",
"public function has($key)\n {\n return array_key_exists($key, $this->errors);\n }",
"public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}",
"public function hasError()\n {\n $error = $this->getError();\n if ($error instanceof ErrorList) {\n return $error->has();\n }\n if ($error instanceof Exception) {\n return true;\n }\n\n return (string) $error !== '';\n }",
"public function messages()\n {\n return [\n 'required' => 'O campo :attribute é obrigatório',\n 'integer' => 'O campo :attribute deve ser um número inteiro',\n 'exists' => 'O usuário (ID :input) deve existir no banco de dados'\n ];\n }",
"public function messages()\n {\n /*\n return [\n 'bio.required' => 'Bio is required',\n 'state.required' => 'State is required',\n 'city.required' => 'City name is required',\n 'postalcode.required' => 'Postal Code is required',\n 'gender.required' => 'Gender is required',\n 'seeking_gender.requred' => 'Gender you are searching for is required',\n ];\n */\n }",
"protected function getErrorFlashMessage(): string|bool\n {\n $key = 'error' . '.' . $this->settingsUtility->getControllerKey($this) . '.'\n . str_replace('Action', '', $this->actionMethodName);\n $message = $this->translate($key);\n if ($message == null) {\n return FALSE;\n } else {\n return $message;\n }\n }",
"abstract protected function _getErrorString();",
"function getErrorReason() {\n\t\treturn __( \"You have a user account with the admin username.\", \"defender-security\" );\n\t}",
"public function renderGlobalErrorMessage()\n {\n $message = \"\";\n $nberror = count($this->getErrorSchema());\n if ($nberror > 0) {\n $tmp = $this->getErrorSchema()->getErrors();\n $message = \"<div class='alert alert-danger'>Please check your form, $nberror field(s) seem(s) not correctly filled </br>\";\n foreach ($tmp as $key => $e) {\n if ($key == 'Description'){\n $message .= \"- Problem description field is too long (4000 characters max): Please use verbose mode and reduce this field.\";\n }\n\n }\n $message .= \"</div>\";\n }\n return $message;\n }",
"public function getErrorMessage();",
"public function getErrorMessage();",
"public function messages()\n {\n return [\n 'contractor_account_id.exists' => 'Invalid data.',\n 'truck_id.exists' => 'Invalid data.',\n 'source_id.exists' => 'Invalid data.',\n 'destination_id.exists' => 'Invalid data.',\n 'driver_id.exists' => 'Invalid data.',\n 'material_id.exists' => 'Invalid data.',\n ];\n }",
"public function messages()\n {\n return [\n 'code_day.required' => 'Code day must required!',\n 'name.required' => 'Name must required!',\n ];\n }",
"public function hasError()\n {\n return count($this->errorMessages) > 0;\n }",
"function get_error_message() {\n return $this->error_msg;\n }",
"public function message()\n {\n return 'The :attribute field type requires a Label and Value';\n }",
"public function message()\n {\n return 'The validation error messagess.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function getErrorMessages() {}",
"public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}",
"public function getMessage(): string\n {\n return \"The $this->name field must be an integer.\";\n }",
"public function message()\n {\n return 'Invalid message mark up.';\n }",
"private function hasError($name = null)\n {\n return $this->local_errors->has($name);\n }",
"public function hasError()\n\t{\n\t\treturn isset($this->error);\n\t}",
"public function hasError()\n {\n return isset($this->error);\n }",
"public function message()\n {\n return ':value not allowed.';\n }",
"public function message()\n {\n return \"Route '$this->value' does not exist.'\";\n }",
"private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }",
"public function hasError ($name)\n {\n\n return isset($this->errors[$name]);\n\n }",
"public function hadError() :bool {\n\t\treturn (($this->errNum < -1) or $this->shouldThrow);\n\t}",
"public function hasError()\n\t{\n\t\treturn $this->error || $this->error_code;\n\t}",
"public function hasErrors()\n {\n return count($this->get(self::ERRORS)) !== 0;\n }",
"public function hasError($key)\n {\n return $this->getErrorMap()->hasKey($key);\n }",
"public function getMessage()\n {\n return $this->_error;\n }",
"public function hasCurrentError()\n {\n return $this->hasCurrent(self::NAMESPACE_ERROR);\n }",
"public function hasError($key) : bool;",
"public function messages()\n {\n return [\n 'location.required' => 'Location Name Is Required',\n 'location.unique:locations' => 'Location Name Is already exists'\n ];\n }",
"public function messages()\n {\n return [\n 'query.required' => \"La valeur de la recherche est obligatoire.\",\n ];\n }",
"public function get_error();",
"public function get_error();",
"protected function isThereHiddenError(): bool\n {\n // TODO when phpmd found a sintaxis error finish succefully instead of error.\n // for different versions of the tool the error output is different\n // if (is_int(strpos($this->exit[3], 'No mess detected'))) {\n // return false;\n // }\n return true;\n }",
"public function hasError(): bool\n {\n return isset($this->meta['error']) && !empty($this->meta['error']);\n }",
"public function getErrorMessage()\n {\n $errorMessages = $this->getErrorMessages();\n if (empty($errorMessages)) {\n return false;\n }\n return $errorMessages[0];\n }",
"public function hasError() {\r\n\t\treturn ($this->errorNumber ? true : false);\r\n\t}",
"public function is_error()\n {\n }",
"public function messages()\n {\n return [\n 'user_id.exists' => 'User not found.',\n ];\n }",
"public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}",
"public function existFor($valueName)\n {\n return isset($this->errors[$valueName]);\n }",
"public function hasError() {\n return $this->hasError;\n }",
"public function message()\n {\n return trans('validation.field_not_exists_in_table', [\n 'field' => $this->notFoundField,\n 'table' => $this->table\n ]);\n }",
"public function isError() {}",
"protected function messages()\n {\n return [\n 'id.required' => HttpAttributeInvalidCode::ID_REQUIRED,\n 'password.required' => HttpAttributeInvalidCode::PASSWORD_REQUIRED,\n 'password.same' => HttpAttributeInvalidCode::CONFIRM_PASSWORD_NOT_SAME,\n 'display_name.required' => HttpAttributeInvalidCode::DISPLAY_NAME_REQUIRED,\n 'role_id.required' => HttpAttributeInvalidCode::ROLE_REQUIRED,\n 'status.required' => HttpAttributeInvalidCode::STATUS_REQUIRE\n ];\n }",
"public function hasError()\r\n\t{\r\n\t\treturn $this->root->hasAttribute('liberr');\r\n\t}",
"public function errorExists( string $key, string $message, $code = 0 ) {\n\t\t$found = array_filter( $this->getErrors(), function ( $error ) use ( $key, $message, $code ) {\n\t\t\treturn $error[ 'key' ] === $key && $error[ 'message' ] === $message && $error[ 'code' ] === $code;\n\t\t} );\n\n\t\treturn count( $found ) > 0;\n\t}",
"public function messages()\n {\n return [\n 'origin.required' => 'INVALID_PARAMETERS',\n 'destination.required' => 'INVALID_PARAMETERS',\n ];\n }",
"protected function searchForError()\n\t{\n\t\t$code = $this->findNode('/response/code');\n\t\t$msg = $this->findNode('/response/message');\n\n\t\tif ($code !== NULL || $msg !== NULL)\n\t\t{\n\t\t\t$this->error = $msg;\n\t\t\t$this->error_code = $code;\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"function evel_check_error($data) {\n if ($error_message = evel_get_error($data))\n err($error_message);\n}",
"public function messages() {\n return [\n 'name.required' => 'Missing name.',\n 'description.required' => 'Missing description.',\n 'max_level.required' => 'Missing max level.',\n 'bonus_per_level.required' => 'Missing bonus per level.',\n 'effect_type.required' => 'Missing effect type.',\n 'hours_per_level.required' => 'Missing length of time per level.'\n ];\n }",
"public function hasError(): bool;",
"public function hasError(): bool;",
"public function getValidationErrorMessages() {}",
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"protected function messages()\n {\n return [\n 'id.required' => HttpAttributeInvalidCode::ID_REQUIRED\n ];\n }"
] | [
"0.6532334",
"0.6112858",
"0.60871816",
"0.5994619",
"0.588347",
"0.5871205",
"0.58507043",
"0.58352774",
"0.5829778",
"0.58265734",
"0.5783014",
"0.57745075",
"0.5774181",
"0.57488996",
"0.574561",
"0.5728158",
"0.5723214",
"0.5721792",
"0.5719723",
"0.56991595",
"0.5686096",
"0.5686096",
"0.5686096",
"0.5686096",
"0.56735456",
"0.5670075",
"0.56693864",
"0.5660738",
"0.5660738",
"0.56561434",
"0.565091",
"0.56486666",
"0.5635035",
"0.56344396",
"0.56337243",
"0.56321317",
"0.56306094",
"0.5613831",
"0.55947495",
"0.55902016",
"0.558945",
"0.5589319",
"0.5589319",
"0.5584075",
"0.55804497",
"0.5579938",
"0.55785686",
"0.5570274",
"0.5566454",
"0.5564679",
"0.5564679",
"0.5564679",
"0.5564679",
"0.5564679",
"0.5564679",
"0.5559398",
"0.5559348",
"0.5553712",
"0.5544349",
"0.55400723",
"0.55344504",
"0.5532685",
"0.5531683",
"0.55285156",
"0.55232435",
"0.5518515",
"0.5516343",
"0.5515496",
"0.5513324",
"0.5510204",
"0.55100626",
"0.5506761",
"0.54996866",
"0.548498",
"0.5481595",
"0.54740834",
"0.54740834",
"0.5472096",
"0.54690915",
"0.54632235",
"0.54620343",
"0.54610837",
"0.5453217",
"0.5452088",
"0.5449117",
"0.5441333",
"0.5433972",
"0.5433752",
"0.54333055",
"0.5432043",
"0.5431871",
"0.54288286",
"0.54269826",
"0.5422309",
"0.54222256",
"0.5418069",
"0.5418069",
"0.5416989",
"0.54153174",
"0.54142666"
] | 0.61666507 | 1 |
Get the helpful error message for a specific error if it exists. | public static function getMessageForError($value)
{
if (self::isValidName($value)) {
$value = self::getNameValue($value);
}
return isset(self::$messages[$value]) ? self::$messages[$value] : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getErrorMessage(): ?string {\n\t\t// 1. a string with an error message (e.g. `{\"error\":{\"code\":404,\"errors\":\"invalid token\"},\"success\":false}`)\n\t\t// 2. an object (e.g. `{\"error\":{\"code\":120,\"errors\":{\"name\":\"payload\",\"reason\":\"required\"}},\"success\":false}`)\n\t\t//\n\t\t// Below is an attempt to make sense of such craziness.\n\t\t$error = $this->getValue('[error][errors]');\n\t\tif ($error === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!is_array($error)) {\n\t\t\t$error = [\n\t\t\t\t'name' => 'generic',\n\t\t\t\t'reason' => $error,\n\t\t\t];\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t'name=%s, reason=%s',\n\t\t\t(array_key_exists('name', $error) ? $error['name'] : 'missing'),\n\t\t\t(array_key_exists('reason', $error) ? $error['reason'] : 'missing')\n\t\t);\n\t}",
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"public function getMessage()\n {\n return $this->_error;\n }",
"function get_error_message() {\n return $this->error_msg;\n }",
"function getMessage()\n {\n return ($this->error_message_prefix . $this->message);\n }",
"public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}",
"function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}",
"public function getMessage()\n {\n // check if any error message available.\n if (!is_null($this->_message)) {\n // return the message\n return $this->lang->line($this->_message) ? $this->lang->line($this->_message) : $this->_message;\n }\n\n // return nothing if previous condition does not apply\n return NULL;\n }",
"private static function getMessageFromError(array $error): ?string\n {\n /** @var scalar|array */\n $message = $error['message'] ?? '';\n\n if (! is_string($message)) {\n return null;\n }\n\n $detail = self::getDetailAsString($error);\n\n if ('' !== $message) {\n return '' !== $detail ? sprintf('%s: %s', $message, $detail) : $message;\n }\n\n if ('' !== $detail) {\n return $detail;\n }\n\n return null;\n }",
"public function getErrMsg() {\n $errMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()\n . '<br><b>Message: ' . $this->getMessage()\n . '</b><br>Exception Type: NoFormsFoundException';\n return $errMsg;\n }",
"public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}",
"public function message()\n {\n return $this->errorText;\n }",
"public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }",
"public final function last_error_message()\n {\n return isset($this->error) ? $this->error['message'] : '';\n }",
"protected function getErrorMessage(): string\n\t{\n\t\tif($this->input !== null)\n\t\t{\n\t\t\t$errorMessage = $this->input->getErrorMessage();\n\t\t}\n\n\t\treturn $errorMessage ?? $this->defaultErrorMessage;\n\t}",
"public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }",
"public function getMessage()\n {\n return isset($this->data->failure_msg) ? $this->data->failure_msg : '';\n }",
"public function message()\n {\n return $this->getError();\n }",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}",
"public function getErrorMessage()\n\t\t{\n\t\t\t$error = $this->statement->errorInfo();\n\t\t\t$errorText \t= '<h6>Something happened ... :(</h6>';\n\t\t\t$errorText .= 'Error code : '.$error[0].'<br>';\n\t\t\t$errorText .= 'Driver error code : '.$error[1].'<br>';\n\t\t\t$errorText .= 'Error Message : '.$error[2].'<br>';\n\t\t\treturn $errorText;\n\t\t}",
"public function message()\n {\n return $this->error_message;\n }",
"public function getMsg($error)\n\t{\n\t\tif(key_exists($error, $this->errorMsg))\n\t\t\treturn $this->errorMsg[$error];\n\t\t\n\t\treturn $this->errorMsg[1000];\n\t\t\n\t}",
"public function getMessage()\n {\n return self::getMessageForError($this->value);\n }",
"public function getErrorMessage()\n {\n $errorMessages = $this->getErrorMessages();\n if (empty($errorMessages)) {\n return false;\n }\n return $errorMessages[0];\n }",
"function getErrorString() {\n\t\tswitch ($this->getErrorType()) {\n\t\t\tcase INSTALLER_ERROR_DB:\n\t\t\t\treturn 'DB: ' . $this->getErrorMsg();\n\t\t\tdefault:\n\t\t\t\treturn __($this->getErrorMsg());\n\t\t}\n\t}",
"public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }",
"public function getErrorMessage()\n {\n return $this->error_message;\n }",
"public function getError(): ?string\n {\n return $this->debugMessage;\n }",
"function error_message(int &$code = null, bool $format = false, bool $extract = false, bool $clear = false): string|null\n{\n $error = error_get_last();\n if (!$error) {\n return null;\n }\n\n $code = $error['type'];\n $clear && error_clear($code);\n\n // Format with name.\n if ($format) {\n $error['name'] = match ($error['type']) {\n E_NOTICE, E_USER_NOTICE => 'NOTICE',\n E_WARNING, E_USER_WARNING => 'WARNING',\n E_DEPRECATED, E_USER_DEPRECATED => 'DEPRECATED',\n default => 'ERROR'\n };\n\n return vsprintf('%s(%d): %s at %s:%s', array_select(\n $error, ['name', 'type', 'message', 'file', 'line']\n ));\n }\n // Extract message only dropping caused function.\n elseif ($extract && ($pos = strpos($error['message'], '):'))) {\n return ucfirst(substr($error['message'], $pos + 3));\n }\n\n return $error['message'];\n}",
"public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }",
"public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }",
"public function getMessage(): string\n {\n return $this->requireString('message');\n }",
"abstract protected function _getErrorString();",
"public function message()\n {\n if ($this->error['type'] === 'custom') {\n return $this->error['message'];\n }\n\n $messages = null;\n\n if ($this->request) {\n $messages = $this->request->messages();\n }\n\n $message = $messages[\"{$this->error['attribute']}.check_file_{$this->error['type']}\"] ??\n trans(\"validation.check_file_{$this->error['type']}\");\n\n [$keys, $values] = Arr::divide($this->error['payload'] ?? []);\n\n $keys = \\array_map(function (string $key) {\n return \":{$key}\";\n }, $keys);\n\n return \\str_replace($keys, $values, $message);\n }",
"public function formatNotFoundError()\n {\n return 'Given resource could not be found.';\n }",
"public static function message( $error, $code = null ) {\n\t\t// -- Check if a status code was defined, if not use a 404 status code\n\t\tif( $code == null ) {\n\t\t\t$code = Error::$not_found;\n\t\t}\n\n\t\t// -- Set the HTTP status code\n\t\t$code = Error::http_code( $code );\n\n\t\t// -- Make sure a log path is defined in the configuration\n\t\tif( LOGS_PATH ) {\n\n\t\t\t// -- Check if logging is enabled\n\t\t\tif( LOGGING ) {\n\n\t\t\t\t// -- Log the error before it is thrown\n\t\t\t\tLogging::error_log( $error, $code );\n\t\t\t}\n\n\t\t}\n\n\t\t// -- Check if the application is in development mode and return the proper error\n\t\tif( Environment::is_development( Environment::type() ) ) {\n\t\t\treturn Error::trace( $error, $code );\n\t\t} else {\n\t\t\treturn Error::type( $code );\n\t\t}\n\n\t}",
"public function getErrorMsg($errorParam) {\n // Set error message to placeholder\n switch($errorParam) {\n case 1:\n // Not all params submitted\n $errorMsg = $this->commerce->adapter->lexicon('commerce_imagemeld.error.missing_params');\n break;\n case 2:\n // Invalid image\n $errorMsg = $this->commerce->adapter->lexicon('commerce_imagemeld.error.invalid_image_type');\n break;\n case 3:\n // Image too small\n $errorMsg = $this->commerce->adapter->lexicon('commerce_imagemeld.error.image_too_small');\n break;\n default:\n // Something went wrong\n $errorMsg = $this->commerce->adapter->lexicon('commerce_imagemeld.error');\n }\n return $errorMsg;\n }",
"public function getError()\n {\n\n if (!$this->getResponse()) {\n return null;\n }\n\n if ($this->isOK()) {\n return null;\n }\n\n $message = ($this->getResponse()->getStatusCode() ? $this->getResponse()->getStatusCode() . ' ' : '') .\n ($this->getResponse()->getReasonPhrase() ? $this->getResponse()->getReasonPhrase() : 'Unknown response reason phrase');\n\n try {\n\n $data = $this->getJson();\n\n if (!empty($data->message)) {\n $message = $data->message;\n }\n\n if (!empty($data->error_description)) {\n $message = $data->error_description;\n }\n\n if (!empty($data->description)) {\n $message = $data->description;\n }\n\n } catch (Exception $e) {\n }\n\n return $message;\n\n }",
"public function message()\n {\n return $this->doorman->error;\n }",
"abstract public function getMsgError();",
"public function getError(): string\n {\n foreach ($this->getBulkResponses() as $bulkResponse) {\n if ($bulkResponse->hasError()) {\n return $bulkResponse->getError();\n }\n }\n\n return '';\n }",
"public function getMessageInfo($error_code)\n {\n return 'Error ' . $error_code . ': ' . RedsysErrorInfo::getErrorInfo($error_code);\n }",
"public function getError()\r\n {\r\n return count($this->strError) == 0 ? null :\r\n (count($this->strError) == 1 ? $this->strError[0] :\r\n $this->strError);\r\n }",
"public function getMessage()\n {\n try {\n throw new WrongCommandException(\"Unknown command: '{$this->command}'.\");\n } catch (WrongCommandException $e) {\n return $e->getMessage();\n }\n }",
"public function getRuleError()\n {\n if(!isset($this->rules_objects_list[$this->table_name]))\n return '';\n\n //current table rules object\n $l_target = $this->rules_objects_list[$this->table_name];\n\n if($l_target->rules_error_flag)\n return $l_target->rules_error_message;\n\n return '';\n }",
"public static function getErrorMessage(Exception $e) {\n if(str_contains($e->getMessage(), 'Duplicate entry') == true) \n\t\t{\n\t\t\t$message = 'Duplicate entry not allowed';\n\t\t}\n\t\telseif(str_contains($e->getMessage(), 'No query results for model') == true)\n\t\t{\n\t\t\t$message = 'Id Not Found';\n\t\t}\n\t\telseif(str_contains($e->getMessage(), 'a foreign key constraint fails') == true)\n\t\t{\n\t\t\t$message = 'Cannot Delete While In Use';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = $e->getMessage();\n\t\t}\n\n return $message;\n }",
"public function getErrorMessage($input) {\n\t\treturn $input . ' is invalid.';\n\t}",
"public function getMessage()\n {\n if ($this->exception instanceof Exception) {\n return $this->exception->getMessage();\n }\n\n return null;\n }",
"final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }",
"public function getError();",
"public function getError();",
"public function getError();",
"public function message()\n {\n return trans('validation.field_not_exists_in_table', [\n 'field' => $this->notFoundField,\n 'table' => $this->table\n ]);\n }",
"public static function getError()\n {\n if (self::has(\"error\")) {\n $error = self::get(\"error\");\n self::remove(\"error\");\n\n return $error;\n }\n\n return null;\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function message(): string\n {\n return $this->errorMessage;\n }",
"public function getUserMessage(): string\n {\n return __('spid-auth::messages.anomalies.' . $this->errorCode);\n }",
"public function getErrorMessage()\n {\n return $this->applyTemplate();\n }",
"public function getMessage()\n {\n if ($this->isSuccessful()) {\n return null;\n }\n\n if (isset($this->data['response']['gatewayCode'])) {\n return self::GATEWAY_CODES[$this->data['response']['gatewayCode']];\n }\n\n if (isset($this->data['error'])) {\n return sprintf('[%s] %s', $this->data['error']['cause'], $this->data['error']['explanation']);\n }\n\n return 'Unknown Error';\n }",
"public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }",
"public function getError(): string\n {\n return $this->error;\n }",
"public function getErrorMessage();",
"public function getErrorMessage();",
"public function getFailedMessage()\n {\n if (array_key_exists(\"failedMessage\", $this->_propDict)) {\n return $this->_propDict[\"failedMessage\"];\n } else {\n return null;\n }\n }",
"public static function getCommonErrorText()\n\t{\n\t\t$text = 'I don\\'t understand what are you want for me!';\n\t\t$text .= PHP_EOL . PHP_EOL;\n\t\t$text .= 'Start our campaign by by pressing \"Start campaign\" first if you still did not ';\n\t\t$text .= 'or just follow previous instructions carefully';\n\t\t\n\t\treturn $text;\n\t}",
"function wrapper_error($link_id = null) {\n\t\t$last_msg = trim(@$this->functions['error']());\n\n\t\tif (strpos(strtolower($last_msg), '(severity') !== false) {\n\t\t\treturn $last_msg;\n\t\t}\n\n\t\treturn '';\n\t}",
"public function getLastError()\r\n\t{\r\n\t\t// TODO: we should move this to returning an Error\r\n\t\t$numErrors = count($this->errors);\r\n\t\tif ($numErrors > 0)\r\n\t\t{\r\n\t\t\treturn $this->errors[$numErrors-1]['message'];\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}",
"public function getError() {\n return $this->get(self::ERROR);\n }",
"public function getError() {\n return $this->get(self::ERROR);\n }",
"public function getErrorMessage(): string\n {\n static $errors = [\n UPLOAD_ERR_OK => 'No error found.',\n UPLOAD_ERR_INI_SIZE => 'The file \"%s\" exceeds your upload_max_filesize ini directive (limit is %d kb).',\n UPLOAD_ERR_FORM_SIZE => 'The file \"%s\" exceeds the upload limit defined in your form.',\n UPLOAD_ERR_PARTIAL => 'The file \"%s\" was only partially uploaded.',\n UPLOAD_ERR_NO_FILE => 'No file was uploaded.',\n UPLOAD_ERR_CANT_WRITE => 'The file \"%s\" could not be written on disk.',\n UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',\n UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',\n ];\n\n $errorCode = $this->error;\n $maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0;\n $message = $errors[$errorCode] ?? 'The file \"%s\" was not uploaded due to an unknown error.';\n\n return sprintf($message, $this->getOriginalName(), $maxFilesize);\n }",
"function error() {\n return $this->error_message;\n }",
"public function error($name, $template = null)\n {\n $errors = $this->session->get('errors');\n\n // Default template is bootstrap friendly.\n if (is_null($template)) {\n $template = config('form-helpers.error_template');\n }\n\n if ($errors && $errors->has($name)) {\n return str_replace(':message', e($errors->first($name)), $template);\n }\n }",
"public function get_error();",
"public function get_error();",
"public function getMsgError() {\r\n return $this->msg_error;\r\n }",
"public function message()\n {\n return $this->errorMsg;\n }",
"public function getError() {}",
"protected function getErrorFlashMessage(): string|bool\n {\n $key = 'error' . '.' . $this->settingsUtility->getControllerKey($this) . '.'\n . str_replace('Action', '', $this->actionMethodName);\n $message = $this->translate($key);\n if ($message == null) {\n return FALSE;\n } else {\n return $message;\n }\n }",
"public function getErrorDescription() {\n\t\treturn $this->error_description;\n\t}",
"public function getErrorName(){\n return $this->error_name;\n }",
"public function getErrorDescription(): string\n {\n return $this->errorDescription;\n }",
"protected function getErrorFlashMessage() {\n\t\treturn $this->translate('tx_placements.error'.'.organization.'. $this->actionMethodName);\n\t }",
"public function getErrorDesc()\n {\n return $this->errorDesc;\n }",
"public function getFirstError(bool $deepCheck = true): ?string\n {\n $errors = $this->form->getErrors($deepCheck);\n return count($errors) > 0 ? $errors->current()->getMessage() : null;\n }",
"public function getError(): string\n {\n return $this->Error;\n }",
"public function message()\n {\n switch ($this->errorType) {\n case self::ERROR_TYPE_NUMERIC:\n $msg = 'Điện thoại phải là chữ số';\n break;\n case self::ERROR_TYPE_LENGTH:\n $msg = 'Điện thoại phải có độ dài từ 10 hoặc 11 số';\n break;\n default:\n $msg = 'Số điện thoại không đúng định dạng';\n break;\n }\n return $msg;\n }",
"public function getFailedReasonMessage(){\n $failedReasonMessages = self::getFailedReasonMessages();\n if(isset($failedReasonMessages[$this->failedReason])){\n return $failedReasonMessages[$this->failedReason];\n }else {\n return $this->failedReason;\n }\n }",
"public function getErrorMessage():? string\n {\n return $this->errorMessage;\n }",
"function my_error($e = '') {\t\t\n\t\t$msg = $this->error->get_error_message($e);\t\t\n\t\tif ($msg == null) {\n\t\t\treturn __(\"Unknown error occured, please contact the administrator.\", $this->plugin_domain);\n\t\t}\n\t\treturn $msg;\n\t}",
"public function renderGlobalErrorMessage()\n {\n $message = \"\";\n $nberror = count($this->getErrorSchema());\n if ($nberror > 0) {\n $tmp = $this->getErrorSchema()->getErrors();\n $message = \"<div class='alert alert-danger'>Please check your form, $nberror field(s) seem(s) not correctly filled </br>\";\n foreach ($tmp as $key => $e) {\n if ($key == 'Description'){\n $message .= \"- Problem description field is too long (4000 characters max): Please use verbose mode and reduce this field.\";\n }\n\n }\n $message .= \"</div>\";\n }\n return $message;\n }",
"public function getErrorMessage(): string\n {\n if ($this->getSuccess()) {\n return '';\n }\n\n return (string) $this->errorMessage;\n }",
"public function getGeneralMessage()\n {\n return \"Entity Not Found\";\n }",
"public function getError($error){\n if(in_array($error,$this->errorArray)){#if error is in this array\n return \"<span class='errorMessage'>$error</span>\";\n }\n }",
"function get_error()\n\t{\n\t\tif ($this->error != \"\") {\n\t\t\treturn \"Error:\".$this->error;\n\t\t}\n\t\treturn \"\";\n\t}",
"protected function getMessage($value = null)\n\t{\n\t\treturn sprintf($this->errorMsg, (string) $value);\n\t}",
"private function getError($name = null)\n {\n return $this->local_errors->get($name);\n }",
"public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}",
"public function error($message = null)\n {\n return $message ? ['error' => $message] : 'error';\n }"
] | [
"0.7344493",
"0.7142879",
"0.7049306",
"0.70177937",
"0.689458",
"0.67980844",
"0.6797857",
"0.67960685",
"0.6774486",
"0.6773865",
"0.6746002",
"0.67257935",
"0.6717672",
"0.6712315",
"0.66933566",
"0.6687774",
"0.6680655",
"0.662988",
"0.66238904",
"0.66158855",
"0.66087085",
"0.65989524",
"0.65983516",
"0.6594175",
"0.6592374",
"0.6559142",
"0.6541374",
"0.6538412",
"0.6529304",
"0.65269655",
"0.6525283",
"0.6524703",
"0.6513522",
"0.6494683",
"0.6484609",
"0.6443833",
"0.64424175",
"0.6441073",
"0.6437368",
"0.6422486",
"0.6419807",
"0.6382908",
"0.63744134",
"0.63735527",
"0.63509244",
"0.63437855",
"0.63278353",
"0.6311377",
"0.6298405",
"0.62969124",
"0.6287376",
"0.6287376",
"0.6287376",
"0.6281124",
"0.6277549",
"0.627106",
"0.627106",
"0.6270183",
"0.6268717",
"0.62666106",
"0.6266413",
"0.626007",
"0.6258821",
"0.625861",
"0.625861",
"0.62512755",
"0.62439364",
"0.6243634",
"0.62384164",
"0.623701",
"0.623701",
"0.6236115",
"0.62314785",
"0.6209737",
"0.62074",
"0.62074",
"0.62041044",
"0.6201613",
"0.6196977",
"0.61860454",
"0.6182903",
"0.61758864",
"0.6175205",
"0.61722",
"0.6171405",
"0.6168072",
"0.61584413",
"0.61572176",
"0.61567736",
"0.61485577",
"0.61434007",
"0.6140446",
"0.61361367",
"0.6135922",
"0.6115345",
"0.61010486",
"0.60986024",
"0.609636",
"0.60930234",
"0.6083974"
] | 0.6610221 | 20 |
Get the helpful error message for this response code, if any is defined. | public function getMessage()
{
return self::getMessageForError($this->value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function responseMessage()\n {\n return isset($this->codes[$this->code]) ? $this->codes[$this->code] : '';\n }",
"public function getError()\n {\n\n if (!$this->getResponse()) {\n return null;\n }\n\n if ($this->isOK()) {\n return null;\n }\n\n $message = ($this->getResponse()->getStatusCode() ? $this->getResponse()->getStatusCode() . ' ' : '') .\n ($this->getResponse()->getReasonPhrase() ? $this->getResponse()->getReasonPhrase() : 'Unknown response reason phrase');\n\n try {\n\n $data = $this->getJson();\n\n if (!empty($data->message)) {\n $message = $data->message;\n }\n\n if (!empty($data->error_description)) {\n $message = $data->error_description;\n }\n\n if (!empty($data->description)) {\n $message = $data->description;\n }\n\n } catch (Exception $e) {\n }\n\n return $message;\n\n }",
"final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }",
"public function getMessage() {\n\n\t\t\tswitch($this->getCode()) {\n\t\t\t\tcase 100: return 'Continue';\n\t\t\t\tcase 101: return 'Switching Protocols';\n\t\t\t\tcase 102: return 'Processing';\n\t\t\t\tcase 200: return 'OK';\n\t\t\t\tcase 201: return 'Created';\n\t\t\t\tcase 202: return 'Accepted';\n\t\t\t\tcase 203: return 'Non-Authoritative Information';\n\t\t\t\tcase 204: return 'No Content';\n\t\t\t\tcase 205: return 'Reset Content';\n\t\t\t\tcase 206: return 'Partial Content';\n\t\t\t\tcase 207: return 'Multi-Status';\n\t\t\t\tcase 208: return 'Already Reported';\n\t\t\t\tcase 226: return 'IM Used';\n\t\t\t\tcase 300: return 'Multiple Choices';\n\t\t\t\tcase 301: return 'Moved Permanently';\n\t\t\t\tcase 302: return 'Found';\n\t\t\t\tcase 303: return 'See Other';\n\t\t\t\tcase 304: return 'Not Modified';\n\t\t\t\tcase 305: return 'Use Proxy';\n\t\t\t\tcase 306: return 'Switch Proxy';\n\t\t\t\tcase 307: return 'Temporary Redirect';\n\t\t\t\tcase 308: return 'Permanent Redirect';\n\t\t\t\tcase 400: return 'Bad Request';\n\t\t\t\tcase 401: return 'Unauthorized';\n\t\t\t\tcase 402: return 'Payment Required';\n\t\t\t\tcase 403: return 'Forbidden';\n\t\t\t\tcase 404: return 'Not Found';\n\t\t\t\tcase 405: return 'Method Not Allowed';\n\t\t\t\tcase 406: return 'Not Acceptable';\n\t\t\t\tcase 407: return 'Proxy Authentication Required';\n\t\t\t\tcase 408: return 'Request Timeout';\n\t\t\t\tcase 409: return 'Conflict';\n\t\t\t\tcase 410: return 'Gone';\n\t\t\t\tcase 411: return 'Length Required';\n\t\t\t\tcase 412: return 'Precondition Failed';\n\t\t\t\tcase 413: return 'Request Entity Too Large';\n\t\t\t\tcase 414: return 'Request-URI Too Long';\n\t\t\t\tcase 415: return 'Unsupported Media Type';\n\t\t\t\tcase 416: return 'Requested Range Not Satisfiable';\n\t\t\t\tcase 417: return 'Expectation Failed';\n\t\t\t\tcase 418: return 'I\\'m a teapot';\n\t\t\t\tcase 419: return 'Authentication Timeout';\n\t\t\t\tcase 420: return 'Enhance Your Calm';\n\t\t\t\tcase 420: return 'Method Failure';\n\t\t\t\tcase 422: return 'Unprocessable Entity';\n\t\t\t\tcase 423: return 'Locked';\n\t\t\t\tcase 424: return 'Failed Dependency';\n\t\t\t\tcase 424: return 'Method Failure';\n\t\t\t\tcase 425: return 'Unordered Collection';\n\t\t\t\tcase 426: return 'Upgrade Required';\n\t\t\t\tcase 428: return 'Precondition Required';\n\t\t\t\tcase 429: return 'Too Many Requests';\n\t\t\t\tcase 431: return 'Request Header Fields Too Large';\n\t\t\t\tcase 444: return 'No Response';\n\t\t\t\tcase 449: return 'Retry With';\n\t\t\t\tcase 450: return 'Blocked by Windows Parental Controls';\n\t\t\t\tcase 451: return 'Redirect';\n\t\t\t\tcase 451: return 'Unavailable For Legal Reasons';\n\t\t\t\tcase 494: return 'Request Header Too Large';\n\t\t\t\tcase 495: return 'Cert Error';\n\t\t\t\tcase 496: return 'No Cert';\n\t\t\t\tcase 497: return 'HTTP to HTTPS';\n\t\t\t\tcase 499: return 'Client Closed Request';\n\t\t\t\tcase 500: return 'Internal Server Error';\n\t\t\t\tcase 501: return 'Not Implemented';\n\t\t\t\tcase 502: return 'Bad Gateway';\n\t\t\t\tcase 503: return 'Service Unavailable';\n\t\t\t\tcase 504: return 'Gateway Timeout';\n\t\t\t\tcase 506: return 'Variant Also Negotiates';\n\t\t\t\tcase 507: return 'Insufficient Storage';\n\t\t\t\tcase 508: return 'Loop Detected';\n\t\t\t\tcase 509: return 'Bandwidth Limit Exceeded';\n\t\t\t\tcase 510: return 'Not Extended';\n\t\t\t\tcase 511: return 'Network Authentication Required';\n\t\t\t\tcase 598: return 'Network read timeout error';\n\t\t\t\tcase 599: return 'Network connect timeout error';\n\t\t\t\tdefault: return 'Unknown Response';\n\t\t\t}\n\n\t\t}",
"public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }",
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"public function errorString($code) {\n \n if(!is_numeric($code)) {\n return false;\n }\n\n $code = (int)$code;\n \n switch($code) {\n case 0: \n return \"Operation was successful\";\n case 247: \n return \"The userid provided is absent, or incorrect\";\n case 250: \n return \"The provided userid and/or Oauth credentials do not match\";\n case 286: \n return \"No such subscription was found\";\n case 293: \n return \"The callback URL is either absent or incorrect\";\n case 294: \n return \"No such subscription could be deleted\";\n case 304: \n return \"The comment is either absent or incorrect\";\n case 305: \n return \"Too many notifications are already set\";\n case 342: \n return \"The signature (using Oauth) is invalid\";\n case 343: \n return \"Wrong Notification Callback Url don't exist\";\n case 601: \n return \"Too Many Request\";\n case 2554: \n return \"Wrong action or wrong webservice\";\n case 2555: \n return \"An unknown error occurred\";\n case 2556: \n return \"Service is not defined\";\n }\n \n return false;\n }",
"public function getMessage()\n {\n return $this->_error;\n }",
"function get_error_message() {\n return $this->error_msg;\n }",
"public function getMessage()\n {\n if ($this->isSuccessful()) {\n return null;\n }\n\n if (isset($this->data['response']['gatewayCode'])) {\n return self::GATEWAY_CODES[$this->data['response']['gatewayCode']];\n }\n\n if (isset($this->data['error'])) {\n return sprintf('[%s] %s', $this->data['error']['cause'], $this->data['error']['explanation']);\n }\n\n return 'Unknown Error';\n }",
"public function getMessage($response_code = null)\n {\n if (is_null($response_code)) {\n $response_code = $this->getCode();\n }\n\n return HTTP::$statusTexts[$response_code];\n }",
"public function message(): string\n {\n return $this->errorMessage;\n }",
"public function getMessage($code)\n {\n return ResponseCode::getMessage($code);\n }",
"function http_get_response_code_error($code)\n\t{\n\t\t$errors = array(\n\t\t200 => 'Success - The request was successful',\n\t\t201 => 'Created (Success) - The request was successful. The requested object/resource was created.',\n\t\t400 => 'Invalid Request - There are many possible causes for this error, but most commonly there is a problem with the structure or content of XML your application provided. Carefully review your XML. One simple test approach is to perform a GET on a URI and use the GET response as an input to a PUT for the same resource. With minor modifications, the input can be used for a POST as well.',\n\t\t401 => 'Unauthorized - This is an authentication problem. Primary reason is that the API call has either not provided a valid API Key, Account Owner Name and Associated Password or the API call attempted to access a resource (URI) which does not match the same as the Account Owner provided in the login credientials.',\n\t\t404 => 'URL Not Found - The URI which was provided was incorrect. Compare the URI you provided with the documented URIs. Start here.',\n\t\t409 => 'Conflict - There is a problem with the action you are trying to perform. Commonly, you are trying to \"Create\" (POST) a resource which already exists such as a Contact List or Email Address that already exists. In general, if a resource already exists, an application can \"Update\" the resource with a \"PUT\" request for that resource.',\n\t\t415 => 'Unsupported Media Type - The Media Type (Content Type) of the data you are sending does not match the expected Content Type for the specific action you are performing on the specific Resource you are acting on. Often this is due to an error in the content-type you define for your HTTP invocation (GET, PUT, POST). You will also get this error message if you are invoking a method (PUT, POST, DELETE) which is not supported for the Resource (URI) you are referencing.\n\t\tTo understand which methods are supported for each resource, and which content-type is expected, see the documentation for that Resource.',\n\t\t500 => 'Server Error',\n\t\t);\n\n\t\tif(array_key_exists($code, $errors)):\n\t\t\treturn $errors[$code];\n\t\tendif;\n\n\t\treturn '';\n\t}",
"public function getErrorMessage() : ?string\n {\n if ($this->isSuccessful())\n {\n return null;\n }\n \n if ($this->httpResponse)\n {\n return $this->httpResponse->getReasonPhrase();\n }\n\n return null;\n }",
"public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }",
"public function getMessage()\n {\n return isset($this->data->failure_msg) ? $this->data->failure_msg : '';\n }",
"public function getErrorMessageByCode($code): string\n {\n switch ($code) {\n case 400:\n {\n return 'Requisição Mal Formada';\n }\n case 401:\n {\n return 'Usuário não autorizado';\n }\n case 403:\n {\n return 'Acesso não autorizado';\n }\n case 404:\n {\n return 'Recurso não Encontrado';\n }\n case 405:\n {\n return 'Operação não suportada';\n }\n case 408:\n {\n return 'Tempo esgotado para a requisição';\n }\n case 409:\n {\n return 'Recurso em conflito';\n }\n case 413:\n {\n return 'Requisição excede o tamanho máximo permitido';\n }\n case 415:\n {\n return 'Content-type inválido';\n }\n case 422:\n {\n return 'Não foi possível processar as instruções contidas na requisição';\n }\n case 429:\n {\n return 'Requisição excede a quantidade máxima de chamadas permitidas à API.';\n }\n case 500:\n {\n return 'Erro na API';\n }\n }\n }",
"public static function getErrorMessage(int $code): string\n {\n return sprintf(\n '%s - Error Code = [%d]'\n , self::$errors[$code]\n , $code\n );\n }",
"public function getError(): string\n {\n foreach ($this->getBulkResponses() as $bulkResponse) {\n if ($bulkResponse->hasError()) {\n return $bulkResponse->getError();\n }\n }\n\n return '';\n }",
"public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }",
"public function message()\n {\n return $this->error_message;\n }",
"function getMessage()\n {\n return ($this->error_message_prefix . $this->message);\n }",
"public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}",
"public function getErrorMessage()\n {\n return $this->error_message;\n }",
"public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function message()\n {\n return $this->errorText;\n }",
"function error($code) {\n\tswitch ($code) {\n\t\tcase 'EntityExists':\n\t\t\t$str = 'Cannot complete that action because the entity already exists';\n\t\t\tbreak;\n\t\tcase 'EntityDoesNotExist':\n\t\t\t$str = 'Cannot complete that action because that entity does not exist';\n\t\t\tbreak;\n\t\tcase 'InvalidPassword':\n\t\t\t$str = 'The password supplied is not valid';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$str = $code;\n\t}\n\treturn $str;\n}",
"public function message()\n {\n return $this->getError();\n }",
"public function formatErrorMessage($code, $message) {\n global $output_format;\n global $method; //Using non-object as could be used before request object is created.\n if($method == 'GET') {\n \t$formatted = constant(strtoupper($output_format->getFormat()) . \"_GET_ERROR_TEMPLATE\");\n } else { //All other formats\n $formatted = constant(strtoupper($output_format->getFormat()) . \"_ERROR_TEMPLATE\");\n $formatted = str_replace(\"{{request}}\", $method, $formatted);\n }\n $formatted = str_replace(\"{{code}}\", $code, $formatted);\n $formatted = str_replace(\"{{message}}\", $message, $formatted);\n return $formatted;\n }",
"function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}",
"public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}",
"public function getErrorMessage() : string\n {\n return $this->errorMessage;\n }",
"public function getMessageFromResponse()\n {\n $response = $this->getResponse();\n $message = [];\n\n if ($response->getCode()) {\n $message[] = $response->getCode();\n }\n\n if ($response->getErrorCode()) {\n $message[] = '(' . $response->getErrorCode() . ')';\n }\n\n if ($response->getErrorMessage()) {\n $message[] = $response->getErrorMessage();\n }\n\n return implode(' ', $message);\n }",
"protected function message(int $code): string\n {\n switch ($code) {\n case 0:\n return 'No error';\n case 1:\n return 'Multi-disk zip archives not supported';\n case 2:\n return 'Renaming temporary file failed';\n case 3:\n return 'Closing zip archive failed';\n case 4:\n return 'Seek error';\n case 5:\n return 'Read error';\n case 6:\n return 'Write error';\n case 7:\n return 'CRC error';\n case 8:\n return 'Containing zip archive was closed';\n case 9:\n return 'No such file';\n case 10:\n return 'File already exists';\n case 11:\n return 'Can\\'t open file';\n case 12:\n return 'Failure to create temporary file';\n case 13:\n return 'Zlib error';\n case 14:\n return 'Malloc failure';\n case 15:\n return 'Entry has been changed';\n case 16:\n return 'Compression method not supported';\n case 17:\n return 'Premature EOF';\n case 18:\n return 'Invalid argument';\n case 19:\n return 'Not a zip archive';\n case 20:\n return 'Internal error';\n case 21:\n return 'Zip archive inconsistent';\n case 22:\n return 'Can\\'t remove file';\n case 23:\n return 'Entry has been deleted';\n default:\n return 'An unknown error has occurred(' . intval($code) . ')';\n }\n }",
"public function getError() : string {\n\t\t\treturn match ($this->error) {\n\t\t\t\tUPLOAD_ERR_OK => \"Upload completed successfully.\",\n\t\t\t\tUPLOAD_ERR_INI_SIZE => \"Upload exceeded maximum file size on server\",\n\t\t\t\tUPLOAD_ERR_FORM_SIZE => \"Upload exceeded maximum file size in browser\",\n\t\t\t\tUPLOAD_ERR_PARTIAL => \"Upload didn't complete\",\n\t\t\t\tUPLOAD_ERR_NO_FILE => \"No file was uploaded\",\n\t\t\t\tUPLOAD_ERR_NO_TMP_DIR => \"Missing temporary folder on server\",\n\t\t\t\tUPLOAD_ERR_CANT_WRITE => \"Failed to write upload to disk\",\n\t\t\t\tUPLOAD_ERR_EXTENSION => \"A server extension stopped the upload\",\n\t\t\t\tdefault => \"Unknown error code during file upload\",\n\t\t\t};\n\t\t}",
"public function errorMessage()\n {\n $errorMsg = '<strong>' . $this->getMessage() . \"</strong><br />\\n\";\n return $errorMsg;\n }",
"public function getErrorMessage()\n {\n if (! $this->executed) {\n throw new Exception('Curl request not executed');\n }\n\n return '';\n }",
"public function getErrorMessage(): ?string {\n\t\t// 1. a string with an error message (e.g. `{\"error\":{\"code\":404,\"errors\":\"invalid token\"},\"success\":false}`)\n\t\t// 2. an object (e.g. `{\"error\":{\"code\":120,\"errors\":{\"name\":\"payload\",\"reason\":\"required\"}},\"success\":false}`)\n\t\t//\n\t\t// Below is an attempt to make sense of such craziness.\n\t\t$error = $this->getValue('[error][errors]');\n\t\tif ($error === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!is_array($error)) {\n\t\t\t$error = [\n\t\t\t\t'name' => 'generic',\n\t\t\t\t'reason' => $error,\n\t\t\t];\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t'name=%s, reason=%s',\n\t\t\t(array_key_exists('name', $error) ? $error['name'] : 'missing'),\n\t\t\t(array_key_exists('reason', $error) ? $error['reason'] : 'missing')\n\t\t);\n\t}",
"public static function getMessage($code)\n {\n if (isset(ResponseCode::$codes[$code])) {\n return ResponseCode::$codes[$code];\n } else {\n return $code;\n }\n }",
"public function getError()\r\n {\r\n if (isset($this->response['faultString'])) {\r\n return $this->response['faultString'];\r\n } elseif (isset($this->response['errmsg'])) {\r\n return $this->response['errmsg'];\r\n }\r\n return null;\r\n }",
"public function getErrorMessage() {\n return curl_error($this->curl_handle);\n }",
"public function getErrorMessage() {\n return '';\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage() {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n\t\t{\n\t\t\t$error = $this->statement->errorInfo();\n\t\t\t$errorText \t= '<h6>Something happened ... :(</h6>';\n\t\t\t$errorText .= 'Error code : '.$error[0].'<br>';\n\t\t\t$errorText .= 'Driver error code : '.$error[1].'<br>';\n\t\t\t$errorText .= 'Error Message : '.$error[2].'<br>';\n\t\t\treturn $errorText;\n\t\t}",
"function error() {\n return $this->error_message;\n }",
"public function errorMessage()\n {\n return $this->provider->errorMessage;\n }",
"public function getErrorMessage(): string\n {\n if ($this->getSuccess()) {\n return '';\n }\n\n return (string) $this->errorMessage;\n }",
"private static function getExceptionMessageForEnvironment($message = null, int $code = 200) : string\n {\n return (app()->environment() == 'local' || $code!==500)\n ? (($code === 404) ? 'Not Found Endpoint' : $message)\n : trans('exception.500error');\n }",
"public function getReasonPhrase(): string\n {\n return StatusCode::MESSAGES_MAP[$this->status];\n }",
"public function getError()\n {\n $errorMessage = null;\n \n if (!$this->isOk())\n {\n $errorMessage = $this->m_responseArray['message'];\n }\n else\n {\n throw new Exception('Calling getError when there was no error');\n }\n \n return $errorMessage;\n }",
"public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}",
"public function message()\n {\n if ($this->wasRedeemed) {\n return trans('vouchers::validation.code_redeemed');\n }\n if ($this->isExpired) {\n return trans('vouchers::validation.code_expired');\n }\n return trans('vouchers::validation.code_invalid');\n }",
"public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }",
"public function getErrorMessage();",
"public function getErrorMessage();",
"public function reason()\n {\n return $this->response->getReasonPhrase();\n }",
"public function getError(): string\n {\n return $this->error;\n }",
"public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}",
"public function message()\n {\n return 'The postcode not valid';\n }",
"public function get_decline_message( string $response_code ) {\n\t\treturn 'An error occurred while processing the card.';\n\t}",
"public static function message( $error, $code = null ) {\n\t\t// -- Check if a status code was defined, if not use a 404 status code\n\t\tif( $code == null ) {\n\t\t\t$code = Error::$not_found;\n\t\t}\n\n\t\t// -- Set the HTTP status code\n\t\t$code = Error::http_code( $code );\n\n\t\t// -- Make sure a log path is defined in the configuration\n\t\tif( LOGS_PATH ) {\n\n\t\t\t// -- Check if logging is enabled\n\t\t\tif( LOGGING ) {\n\n\t\t\t\t// -- Log the error before it is thrown\n\t\t\t\tLogging::error_log( $error, $code );\n\t\t\t}\n\n\t\t}\n\n\t\t// -- Check if the application is in development mode and return the proper error\n\t\tif( Environment::is_development( Environment::type() ) ) {\n\t\t\treturn Error::trace( $error, $code );\n\t\t} else {\n\t\t\treturn Error::type( $code );\n\t\t}\n\n\t}",
"public function getReasonPhrase() : string\n {\n return $this->reasonPhrase ?? Response::CODE_LIST[$this->getStatusCode()];\n }",
"public function getErrMsg() {\n $errMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()\n . '<br><b>Message: ' . $this->getMessage()\n . '</b><br>Exception Type: NoFormsFoundException';\n return $errMsg;\n }",
"public function errorMessage() { return $this->errorMessage; }",
"function getResponseCodeMessage($code) {\n $code = is_string($code) ? intval($code) : $code;\n switch ($code) {\n case 100: $text = 'Continue';\n break;\n case 101: $text = 'Switching Protocols';\n break;\n case 200: $text = 'OK';\n break;\n case 201: $text = 'Created';\n break;\n case 202: $text = 'Accepted';\n break;\n case 203: $text = 'Non-Authoritative Information';\n break;\n case 204: $text = 'No Content';\n break;\n case 205: $text = 'Reset Content';\n break;\n case 206: $text = 'Partial Content';\n break;\n case 300: $text = 'Multiple Choices';\n break;\n case 301: $text = 'Moved Permanently';\n break;\n case 302: $text = 'Moved Temporarily';\n break;\n case 303: $text = 'See Other';\n break;\n case 304: $text = 'Not Modified';\n break;\n case 305: $text = 'Use Proxy';\n break;\n case 400: $text = 'Bad Request';\n break;\n case 401: $text = 'Unauthorized';\n break;\n case 402: $text = 'Payment Required';\n break;\n case 403: $text = 'Forbidden';\n break;\n case 404: $text = 'Not Found';\n break;\n case 405: $text = 'Method Not Allowed';\n break;\n case 406: $text = 'Not Acceptable';\n break;\n case 407: $text = 'Proxy Authentication Required';\n break;\n case 408: $text = 'Request Time-out';\n break;\n case 409: $text = 'Conflict';\n break;\n case 410: $text = 'Gone';\n break;\n case 411: $text = 'Length Required';\n break;\n case 412: $text = 'Precondition Failed';\n break;\n case 413: $text = 'Request Entity Too Large';\n break;\n case 414: $text = 'Request-URI Too Large';\n break;\n case 415: $text = 'Unsupported Media Type';\n break;\n case 500: $text = 'Internal Server Error';\n break;\n case 501: $text = 'Not Implemented';\n break;\n case 502: $text = 'Bad Gateway';\n break;\n case 503: $text = 'Service Unavailable';\n break;\n case 504: $text = 'Gateway Time-out';\n break;\n case 505: $text = 'HTTP Version not supported';\n break;\n default:\n $text = \"Unknown http status code\";\n break;\n }\n return $text;\n}",
"public function get_reason_phrase(): string {\n if ($this->reason === '') {\n return !empty($this->statusCode) ? static::$status_codes[$this->statusCode] : '';\n }\n\n return $this->reason;\n }",
"public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}",
"public function message()\n {\n return $this->errorMsg;\n }",
"public function getErrorDescription(): string\n {\n return $this->errorDescription;\n }",
"function _getStatusMessage(){\n $status = array(\n 200 => 'Ok' ,\n 201 => 'Created' ,\n 202 => 'deleted' ,\n 204 => 'No Content' ,\n 400 => 'Bad Request',\n 404 => 'Not Found' ,\n 405 => 'Not Allowed' ,\n 406 => 'Not Acceptable',\n\n );\n return ($status[$this->CodeHTTP] ? $status[$this->CodeHTTP] : $status[500]);\n }",
"public function message()\n {\n return $this->doorman->error;\n }",
"public function getErrorCode();",
"public function get_decline_message( string $response_code ) {\n\t\tswitch ($response_code) {\n\t\t\tcase '02':\n\t\t\tcase '03':\n\t\t\tcase '04':\n\t\t\tcase '05':\n\t\t\tcase '41':\n\t\t\tcase '43':\n\t\t\tcase '44':\n\t\t\tcase '51':\n\t\t\tcase '56':\n\t\t\tcase '61':\n\t\t\tcase '62':\n\t\t\tcase '62':\n\t\t\tcase '63':\n\t\t\tcase '65':\n\t\t\tcase '78':\n\t\t\t\treturn 'The card was declined.';\n\t\t\tcase '06':\n\t\t\tcase '07':\n\t\t\tcase '12':\n\t\t\tcase '15':\n\t\t\tcase '19':\n\t\t\tcase '52':\n\t\t\tcase '53':\n\t\t\tcase '57':\n\t\t\tcase '58':\n\t\t\tcase '76':\n\t\t\tcase '77':\n\t\t\tcase '96':\n\t\t\tcase 'EC':\n\t\t\t\treturn 'An error occured while processing the card.';\n\t\t\tcase '13':\n\t\t\t\treturn 'Must be greater than or equal 0.';\n\t\t\tcase '14':\n\t\t\t\treturn 'The card number is incorrect.';\n\t\t\tcase '54':\n\t\t\t\treturn 'The card has expired.';\n\t\t\tcase '55':\n\t\t\t\treturn 'The pin is invalid.';\n\t\t\tcase '75':\n\t\t\t\treturn 'Maximum number of pin retries exceeded.';\n\t\t\tcase '80':\n\t\t\t\treturn 'Card expiration date is invalid.';\n\t\t\tcase '86':\n\t\t\t\treturn 'Can\\'t verify card pin number.';\n\t\t\tcase '91':\n\t\t\t\treturn 'The card issuer timed-out.';\n\t\t\tcase 'EB':\n\t\t\tcase 'N7':\n\t\t\t\treturn 'The card\\'s security code is incorrect.';\n\t\t\tcase 'FR':\n\t\t\t\treturn 'Possible fraud detected.';\n\t\t\tdefault:\n\t\t\t\treturn 'An error occurred while processing the card.';\n\t\t}\n\t}",
"public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}",
"public function getStatusError($code = false)\n {\n switch ($code) {\n case 204:\n return 204;\n break;\n case 400: //Bad Request\n return 400;\n break;\n case 401:\n return 401;\n break;\n case 403:\n return 403;\n break;\n case 404:\n return 404;\n break;\n case 502:\n return 502;\n break;\n case 504:\n return 504;\n break;\n default:\n return 500;\n break;\n }\n }",
"public function getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}",
"public function getError(): string\n {\n return $this->Error;\n }",
"public function getErrorCode()\n {\n return $this->getInput('error_code');\n }",
"public function getMessage($code) {\n return $this->_codes[$code];\n }",
"public function message()\n {\n return 'Invalid message mark up.';\n }",
"function getErrorText($code){\n $errorText = array(\"good\",\"account not existed\",\"insufficient fund\",\"invalid account format\",\"duplicate account record\",\"invalid tranzaction format\",\"unknown error\");\n return $errorText[$code];\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function getErrorMessage()\n {\n return $this->applyTemplate();\n }",
"public function getErrorText(){\n return $this->error;\n }"
] | [
"0.7717625",
"0.76589835",
"0.7489517",
"0.7439286",
"0.74276996",
"0.7334964",
"0.7283329",
"0.7266248",
"0.724295",
"0.7181715",
"0.71788627",
"0.71765745",
"0.7099624",
"0.7081251",
"0.7066938",
"0.70620763",
"0.70488137",
"0.70370346",
"0.7025028",
"0.7020223",
"0.70102626",
"0.69942856",
"0.6993578",
"0.6984289",
"0.6984092",
"0.6961033",
"0.69593865",
"0.6955375",
"0.6955375",
"0.6936509",
"0.69278944",
"0.69135606",
"0.6870099",
"0.68583816",
"0.6855481",
"0.6850656",
"0.6849894",
"0.68346435",
"0.6831342",
"0.6827629",
"0.680512",
"0.68036896",
"0.68000585",
"0.67787576",
"0.67682916",
"0.6758764",
"0.67560893",
"0.67560893",
"0.67560893",
"0.67560893",
"0.67560893",
"0.67560893",
"0.67560893",
"0.67552763",
"0.67420274",
"0.6735975",
"0.67359084",
"0.67331845",
"0.67145044",
"0.6712978",
"0.6709697",
"0.6706876",
"0.6696882",
"0.66921055",
"0.6686836",
"0.6686836",
"0.6684678",
"0.667458",
"0.6673648",
"0.6673517",
"0.6645591",
"0.66300493",
"0.66274834",
"0.6605252",
"0.6587166",
"0.6586516",
"0.65791446",
"0.65653634",
"0.65589815",
"0.6550442",
"0.65481436",
"0.6546963",
"0.65243137",
"0.6519813",
"0.65114546",
"0.6509923",
"0.6502959",
"0.6499811",
"0.6498336",
"0.6493736",
"0.6490252",
"0.64858526",
"0.6483018",
"0.6483018",
"0.6483018",
"0.6483018",
"0.6483018",
"0.6483018",
"0.6476149",
"0.6472997"
] | 0.67958355 | 43 |
Returns the static model of the specified AR class. | public static function model($className=__CLASS__)
{
return parent::model($className);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function model()\r\n {\r\n return static::class;\r\n }",
"public static function model() {\n return parent::model(get_called_class());\n }",
"public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }",
"public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}",
"static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }",
"public static function model($className=__CLASS__) { return parent::model($className); }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className=__CLASS__) {\n return parent::model($className);\n }",
"public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }"
] | [
"0.74850124",
"0.73803526",
"0.7154113",
"0.71401674",
"0.70629025",
"0.703232",
"0.69285315",
"0.69285315",
"0.6925706",
"0.6902751",
"0.6894916",
"0.6894916",
"0.68900806",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424"
] | 0.0 | -1 |
Retrieves a list of models based on the current search/filter conditions. | public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id);
$criteria->compare('message',$this->message,true);
$criteria->compare('subject',$this->subject,true);
$criteria->compare('created',$this->created,true);
$criteria->compare('modified',$this->modified,true);
$criteria->compare('modified_by',$this->modified_by,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModels();",
"public function getModels();",
"public function findAll($model);",
"public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }",
"public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}",
"protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }",
"public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }",
"public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }",
"public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }",
"public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }",
"public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }",
"public function searchableBy()\n {\n return [];\n }",
"public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }",
"public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}",
"function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}",
"public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }",
"public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }",
"public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }",
"public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }",
"public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}",
"public function findAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }",
"public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }",
"public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }",
"public function filters(Model $model): array\n {\n return [];\n }",
"public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }",
"protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }",
"public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }",
"private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }",
"public function findAll()\n {\n return $this->driver->findAll($this->model);\n }",
"public function getAllFilters();",
"public function GetAll()\n {\n return $this->model->all();\n }",
"public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }",
"public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function getModels()\n {\n return $this->_models;\n }",
"public function getSearchFields();",
"public function all()\n {\n return $this->model->get();\n }",
"public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }",
"protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}",
"public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }",
"public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }",
"public function getReturnModels(){\r\n return array_values($this->models);\r\n }",
"public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }",
"public function models();",
"public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}",
"public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}",
"public function all()\n {\n return $this->model->get();\n }",
"public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }",
"public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }",
"public function findBy(array $filters);",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getList()\n {\n return $this->model->getList();\n }",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }",
"abstract protected function getSearchModelName(): string;",
"public function getItemsCriteria() {}",
"public function getItemsCriteria() {}",
"public function getFilters();",
"public function getSearch();",
"public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }",
"public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }",
"public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }",
"static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }",
"public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }",
"public function getCriteria();",
"public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }",
"static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }",
"public function findByModelName($model_name);",
"abstract public function getFieldsSearchable();",
"function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}",
"public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }",
"public function getListQuery();",
"public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }",
"public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }",
"public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }",
"private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}",
"function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}",
"public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}",
"public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }",
"public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }",
"public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function queryset(){\n return $this->_get_queryset();\n }",
"public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }",
"public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);",
"public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);",
"public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);",
"public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }",
"public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }",
"private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }",
"public function findAllAction();",
"public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }",
"function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}",
"public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}"
] | [
"0.6743169",
"0.6743169",
"0.660761",
"0.6479806",
"0.63798267",
"0.63454884",
"0.6310211",
"0.630157",
"0.6253882",
"0.62494963",
"0.62494963",
"0.6111013",
"0.6077699",
"0.60734916",
"0.604629",
"0.60349816",
"0.60323626",
"0.6014135",
"0.5981404",
"0.5979577",
"0.59790176",
"0.59686154",
"0.5932365",
"0.59278476",
"0.59224707",
"0.58915573",
"0.5889474",
"0.5850065",
"0.5846599",
"0.58258194",
"0.58169955",
"0.5811794",
"0.58071834",
"0.5792253",
"0.5776716",
"0.5769704",
"0.5762866",
"0.5762595",
"0.5750857",
"0.5740329",
"0.5738501",
"0.5727578",
"0.57241714",
"0.57224226",
"0.57219917",
"0.57193714",
"0.5717115",
"0.5713116",
"0.57129574",
"0.57069343",
"0.56932455",
"0.56813276",
"0.5671539",
"0.56690705",
"0.5668895",
"0.5668895",
"0.5668895",
"0.5668847",
"0.56679785",
"0.56638783",
"0.56562364",
"0.56505203",
"0.5649221",
"0.56414455",
"0.56334",
"0.56329614",
"0.5631676",
"0.562298",
"0.56168723",
"0.5612008",
"0.5608453",
"0.55940604",
"0.5580047",
"0.5572055",
"0.55555546",
"0.55500674",
"0.5547689",
"0.5547594",
"0.55458593",
"0.55359334",
"0.553295",
"0.55324304",
"0.5530852",
"0.5525286",
"0.552028",
"0.5517957",
"0.5513443",
"0.55082744",
"0.5506695",
"0.5499769",
"0.5499749",
"0.54954296",
"0.54954296",
"0.54954296",
"0.5494633",
"0.54934925",
"0.54930055",
"0.5491269",
"0.54898334",
"0.5489441",
"0.5484841"
] | 0.0 | -1 |
Get real visitor IP behind CloudFlare network | public function getUserIP() {
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
$_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if (filter_var($client, FILTER_VALIDATE_IP)) {
$ip = $client;
} elseif (filter_var($forward, FILTER_VALIDATE_IP)) {
$ip = $forward;
} else {
$ip = $remote;
}
return $ip;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ip()\n{\n return \\SumanIon\\CloudFlare::ip();\n}",
"public static function ip()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn filter_var(request()->header('CF_CONNECTING_IP'), FILTER_VALIDATE_IP);\n\t\t}) ?: request()->ip();\n\t}",
"public static function getIP() {\n\n //Just get the headers if we can or else use the SERVER global\n if ( function_exists( 'apache_request_headers' ) ) {\n $rawheaders = apache_request_headers();\n } else {\n $rawheaders = $_SERVER;\n }\n\n // Lower case headers\n $headers = array();\n foreach($rawheaders as $key => $value) {\n $key = trim(strtolower($key));\n if ( !is_string($key) || empty($key) ) continue;\n $headers[$key] = $value;\n }\n\n // $filter_option = FILTER_FLAG_IPV4;\n // $filter_option = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;\n $filter_option = 0;\n\n $the_ip = false;\n\n // Check Cloudflare headers\n if ( $the_ip === false && array_key_exists( 'http_cf_connecting_ip', $headers ) ) {\n $pieces = explode(',',$headers['http_cf_connecting_ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'cf-connecting-ip', $headers ) ) {\n $pieces = explode(',',$headers['cf-connecting-ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Get the forwarded IP from more traditional places\n if ( $the_ip == false && array_key_exists( 'x-forwarded-for', $headers ) ) {\n $pieces = explode(',',$headers['x-forwarded-for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'http_x_forwarded_for', $headers ) ) {\n $pieces = explode(',',$headers['http_x_forwarded_for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'remote_addr', $headers ) ) {\n $the_ip = filter_var( $headers['remote_addr'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Fall through and get *something*\n if ( $the_ip === false && array_key_exists( 'REMOTE_ADDR', $_SERVER ) ) {\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false ) $the_ip = NULL;\n return $the_ip;\n }",
"function ip_visiteur() {\n\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telseif(isset($_SERVER['HTTP_CLIENT_IP']))\n\t{\n\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telse\n\t{\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}",
"public function getRemoteIp();",
"public static function getIp(){\n if (isset($_SERVER['HTTP_CDN_SRC_IP']) && $_SERVER['HTTP_CDN_SRC_IP'] && strcasecmp($_SERVER['HTTP_CDN_SRC_IP'], \"unknown\")){\n $ip = $_SERVER['HTTP_CDN_SRC_IP'];\n }elseif(getenv(\"HTTP_CLIENT_IP\") && strcasecmp(getenv(\"HTTP_CLIENT_IP\"), \"unknown\")){\n $ip = getenv(\"HTTP_CLIENT_IP\");\n }else if (getenv(\"HTTP_X_FORWARDED_FOR\") && strcasecmp(getenv(\"HTTP_X_FORWARDED_FOR\"), \"unknown\")){\n $ip = getenv(\"HTTP_X_FORWARDED_FOR\");\n }else if (getenv(\"REMOTE_ADDR\") && strcasecmp(getenv(\"REMOTE_ADDR\"), \"unknown\")){\n $ip = getenv(\"REMOTE_ADDR\");\n }else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], \"unknown\")){\n $ip = $_SERVER['REMOTE_ADDR'];\n }else{\n $ip = \"unknown\";\n }\n return($ip);\n }",
"private function _getVisitorIP() {\n $rVal = \"\";\n\n if ( isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) ) {\n $rVal = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n } else {\n if (getenv('HTTP_X_FORWARDED_FOR')) {\n $rVal = getenv('HTTP_X_FORWARDED_FOR');\n } else {\n $rVal = getenv('REMOTE_ADDR');\n }\n }\n\n // Return the IPv4 Address\n return NoNull($rVal);\n }",
"function getRealIP() {\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } else {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n }\r\n return $ip;\r\n}",
"function getVisitorIP() {\n $ip = \"0.0.0.0\";\n if( ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) && ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) ) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif( ( isset( $_SERVER['HTTP_CLIENT_IP'])) && (!empty($_SERVER['HTTP_CLIENT_IP'] ) ) ) {\n $ip = explode(\".\",$_SERVER['HTTP_CLIENT_IP']);\n $ip = $ip[3].\".\".$ip[2].\".\".$ip[1].\".\".$ip[0];\n } elseif((!isset( $_SERVER['HTTP_X_FORWARDED_FOR'])) || (empty($_SERVER['HTTP_X_FORWARDED_FOR']))) {\n if ((!isset( $_SERVER['HTTP_CLIENT_IP'])) && (empty($_SERVER['HTTP_CLIENT_IP']))) {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n }\n return $ip;\n}",
"public static function get_ip_address() {\n if(!empty($_SERVER['http-cf-connecting-ip'])){\n return $_SERVER['http-cf-connecting-ip'];\n }\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && filter_var($_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP)) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP)) {\n return $ip;\n }\n }\n } else {\n if (filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)) {\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && filter_var($_SERVER['HTTP_X_FORWARDED'], FILTER_VALIDATE_IP)) {\n return $_SERVER['HTTP_X_FORWARDED'];\n }\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && filter_var($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'], FILTER_VALIDATE_IP)) {\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n }\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && filter_var($_SERVER['HTTP_FORWARDED_FOR'], FILTER_VALIDATE_IP)) {\n return $_SERVER['HTTP_FORWARDED_FOR'];\n }\n if (!empty($_SERVER['HTTP_FORWARDED']) && filter_var($_SERVER['HTTP_FORWARDED'], FILTER_VALIDATE_IP)) {\n return $_SERVER['HTTP_FORWARDED'];\n }\n return $_SERVER['REMOTE_ADDR'];\n }",
"function get_ip_address()\n{\n//\tif( isDev() )\n//\t\treturn \"66.135.205.14\";\t// US (ebay.com)\n//\t\treturn \"46.122.252.60\"; // ljubljana\n//\t\treturn \"190.172.82.24\"; // argentinia?\n//\t\treturn \"84.154.26.132\"; // probably invalid ip from munich\n//\t\treturn \"203.208.37.104\"; // google.cn\n//\t\treturn \"62.215.83.54\";\t// kuwait\n//\t\treturn \"41.250.146.224\";\t// Morocco (rtl!)\n//\t\treturn \"66.135.205.14\";\t// US (ebay.com)\n//\t\treturn \"121.243.179.122\";\t// india\n//\t\treturn \"109.253.21.90\";\t// invalid (user says UK)\n//\t\treturn \"82.53.187.74\";\t// IT\n//\t\treturn \"190.172.82.24\";\t// AR\n//\t\treturn \"99.230.167.125\";\t// CA\n//\t\treturn \"95.220.134.145\";\t// N/A\n//\t\treturn \"194.126.108.2\";\t// Tallinn/Estonia (Skype static IP)\n\n\tstatic $DETECTED_CLIENT_IP = 'undefined';\n\n\tif( $DETECTED_CLIENT_IP !== 'undefined' )\n\t\treturn $DETECTED_CLIENT_IP;\n\n\t$proxy_headers = array(\n\t\t'HTTP_VIA',\n\t\t'HTTP_X_FORWARDED_FOR',\n\t\t'HTTP_FORWARDED_FOR',\n\t\t'HTTP_X_FORWARDED',\n\t\t'HTTP_FORWARDED',\n\t\t'HTTP_CLIENT_IP',\n\t\t'HTTP_FORWARDED_FOR_IP',\n\t\t'VIA',\n\t\t'X_FORWARDED_FOR',\n\t\t'FORWARDED_FOR',\n\t\t'X_FORWARDED',\n\t\t'FORWARDED',\n\t\t'CLIENT_IP',\n\t\t'FORWARDED_FOR_IP',\n\t\t'HTTP_PROXY_CONNECTION',\n\t\t'REMOTE_ADDR' // REMOTE_ADDR must be last -> fallback\n\t);\n\n\tforeach( $proxy_headers as $ph )\n\t{\n\t\tif( !empty($_SERVER) && isset($_SERVER[$ph]) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = $_SERVER[$ph];\n\t\t\tbreak;\n\t\t}\n\t\telseif( !empty($_ENV) && isset($_ENV[$ph]) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = $_ENV[$ph];\n\t\t\tbreak;\n\t\t}\n\t\telseif( @getenv($ph) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = getenv($ph);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif( !isset($DETECTED_CLIENT_IP) )\n\t\treturn false;\n\n\t$is_ip = preg_match('/^(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})/',$DETECTED_CLIENT_IP,$regs);\n\tif( $is_ip && (count($regs) > 0) )\n\t\t$DETECTED_CLIENT_IP = $regs[1];\n\treturn $DETECTED_CLIENT_IP;\n}",
"public function getVisitorIP(){\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t$proxy = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\n\t\tif(preg_match(\"/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/\",$proxy))\n\t\t $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\n\t\t//return '127.0.0.1';\n\t\treturn $ip;\n\t}",
"function getRealIpAddr()\n{\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n\t{\n\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n\t{\n\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telseif ($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) {\n\t\t$ip = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\telse\n\t{\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}",
"function getRealIPAddress() {\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n\t\t\t// Check ip from share internet\r\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\t\telse if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n\t\t\t// Check ip passed from proxy\r\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\treturn $ip;\r\n\t}",
"public function get_ip() \n\t{\n\t\tif ( function_exists( 'apache_request_headers' ) ) {\n\t\n\t\t\t$headers = apache_request_headers();\n\t\t} else {\n\t\n\t\t\t$headers = $_SERVER;\n\t\t}\n\t\t\n\t\tif (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n\t\t}\t\n\t\n\t\t/*\n\t\tif ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n\t\n\t\t\t$the_ip = $headers['X-Forwarded-For'];\n\t\t\techo 'X-Forwarded-For';\n\t\t} elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )\n\t\t) {\n\t\n\t\t\t$the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n\t\t\techo 'HTTP';\n\t\t} else {\n\t\t\t\n\t\t\t$the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n\t\t\techo 'REMOTE_ADDR';\n\t\t}\n\t\t */\n\t\t$the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n\t\treturn $the_ip;\n\t\n\t}",
"public static function real_ip() {\n foreach (array(\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ) as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }",
"static function getRealIpAddr()\r\n\t{\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP']) && ($_SERVER['HTTP_CLIENT_IP']!=\"unknown\")) //check ip from share internet\r\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) && ($_SERVER['HTTP_X_FORWARDED_FOR']!=\"unknown\")) //to check ip is pass from proxy\r\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\telse\r\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\r\n\t\treturn $ip;\r\n\t}",
"function get_ip() {\n\tif ( function_exists( 'apache_request_headers' ) ) {\n\t\t$headers = apache_request_headers();\n\t} else {\n\t\t$headers = $_SERVER;\n\t}\n\t$the_ip='';\n\t//Get the forwarded IP if it exists\n\tif ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n\t\t$the_ip = $headers['X-Forwarded-For'];\n\t} elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && \n\t\tfilter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )) {\n\t\t$the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n\t} else \n\t\t$the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n\tif (empty($the_ip)) $the_ip='10.0.0.1';\n\treturn $the_ip;\n\t/*$ipaddress ='';\n\tif ($_SERVER['HTTP_CLIENT_IP'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n\telse if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\telse if ($_SERVER['HTTP_X_FORWARDED'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n\telse if ($_SERVER['HTTP_FORWARDED_FOR'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n\telse if ($_SERVER['HTTP_FORWARDED'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['HTTP_FORWARDED'];\n\telse if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')\n\t$ipaddress = $_SERVER['REMOTE_ADDR'];\n\telse\n\t$ipaddress = 'UNKNOWN';\n\treturn $ipaddress;*/\n}",
"private function getIP(){\n \n if( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ){ \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n \n else{\n \n if( isset($_SERVER ['HTTP_VIA']) ){\n $ip = $_SERVER['HTTP_VIA'];\n }\n else{\n \n if( isset( $_SERVER ['REMOTE_ADDR'] )){\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n else{\n $ip = null ;\n }\n }\n \n }\n \n \n return $ip; //retorna la IP\n }",
"function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}",
"function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}",
"function getIp()\n{\n $ip = false;\n\n if(!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n {\n $ips = explode(\",\", \n $_SERVER['HTTP_X_FORWARDED_FOR']);\n for ($i = 0; $i < count($ips); $i++)\n {\n $ips = trim($ips[$i]);\n if (!eregi(\"^(10|172\\.16|192\\.168)\\.\", \n $ips[$i]))\n {\n $ip = $ips[$i];\n break;\n }\n }\n }\n elseif (!empty($_SERVER['HTTP_VIA']))\n {\n $ips = explode(\",\", \n $_SERVER['HTTP_VIA']);\n for ($i = 0; $i < count($ips); $i++)\n {\n $ips = trim($ips[$i]);\n if (!eregi(\"^(10|172\\.16|192\\.168)\\.\", \n $ips[$i]))\n {\n $ip = $ips[$i];\n break;\n }\n }\n }\n elseif (!empty($_SERVER['REMOTE_ADDR']))\n {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n\n if (($longip = ip2long($ip)) !== false)\n {\n if ($ip == long2ip($longip))\n {\n return $ip;\n }\n }\n \n return false;\n}",
"public function getRealIpAddr(){\n\t\t//check ip from share internet\n\t if (!empty($_SERVER['HTTP_CLIENT_IP'])){\n\t\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t\t\t//to check ip is pass from proxy\n\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t } else {\n\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\treturn $ip;\n\t}",
"function getRealIpAddr(){\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n //check ip from share internet\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n //check ip is pass from proxy\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }else {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"public static function getRealIpAddr()\n {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }",
"function getRealIpAddr()\n{\nif(!empty($_SERVER['HTTP_CLIENT_IP']))\n//check if from share internet\n{\n\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n}\n elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else{\n\t $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"function real_ip_ad () {\n\t\t\n\t\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"]))\n\t\t{\n\t\t# check for ip from shared internet\n\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t\t}\n\t\telseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\n\t\t{\n\t\t// Check for the Proxy User\n\t\t$ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\n\t\t// This will print user's real IP Address\n\t\t// does't matter if user using proxy or not.\n\t\treturn $ip;\n\t}",
"function getRealUserIp() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n\n return $ipaddress; \n}",
"function get_ip() {\n if ( function_exists( 'apache_request_headers' ) ) {\n $headers = apache_request_headers();\n } else {\n $headers = $_SERVER;\n }\n //Get the forwarded IP if it exists\n if ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n $the_ip = $headers['X-Forwarded-For'];\n } elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )\n ) {\n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n } else {\n\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n }\n return $the_ip;\n }",
"function get_ip_address() {\n // check for shared internet/ISP IP\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if ($this->validate_ip($ip))\n return $ip;\n }\n } else {\n if ($this->validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && $this->validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }",
"function getRealUserIp(){\n switch(true){\n case (!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\n case (!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\n default : return $_SERVER['REMOTE_ADDR'];\n }\n }",
"public function get_ip_address() {\n // Check for shared internet/ISP IP\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_CLIENT_IP']))\n return $_SERVER['HTTP_CLIENT_IP'];\n\n // Check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // Check if multiple IP addresses exist in var\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if ($this->validate_ip($ip))\n return $ip;\n }\n }\n \n if (!empty($_SERVER['HTTP_X_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && $this->validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // Return unreliable IP address since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }",
"private function getIP(){\n\t\tif( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] )) $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\telse if( isset( $_SERVER ['HTTP_VIA'] )) $ip = $_SERVER['HTTP_VIA'];\n\t\telse if( isset( $_SERVER ['REMOTE_ADDR'] )) $ip = $_SERVER['REMOTE_ADDR'];\n\t\telse $ip = null ;\n\t\treturn $ip;\n\t}",
"function getVisitorIP()\r\n {\r\n $ip_regexp = \"/^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})/\"; \r\n\r\n //Retrieve IP address from which the user is viewing the current page \r\n if (isset ($HTTP_SERVER_VARS[\"HTTP_X_FORWARDED_FOR\"]) && !empty ($HTTP_SERVER_VARS[\"HTTP_X_FORWARDED_FOR\"]))\r\n { \r\n $visitorIP = (!empty ($HTTP_SERVER_VARS[\"HTTP_X_FORWARDED_FOR\"])) ? $HTTP_SERVER_VARS[\"HTTP_X_FORWARDED_FOR\"] : ((!empty ($HTTP_ENV_VARS['HTTP_X_FORWARDED_FOR'])) ? $HTTP_ENV_VARS['HTTP_X_FORWARDED_FOR'] : @ getenv ('HTTP_X_FORWARDED_FOR')); \r\n } \r\n else\r\n { \r\n $visitorIP = (!empty ($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ((!empty ($HTTP_ENV_VARS['REMOTE_ADDR'])) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : @ getenv ('REMOTE_ADDR')); \r\n } \r\n\r\n return $visitorIP; \r\n }",
"private function getIp()\n\t {\n\t \n\t if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&( $_SERVER['HTTP_X_FORWARDED_FOR'] != '' ))\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t \n\t // los proxys van añadiendo al final de esta cabecera\n\t // las direcciones ip que van \"ocultando\". Para localizar la ip real\n\t // del usuario se comienza a mirar por el principio hasta encontrar\n\t // una dirección ip que no sea del rango privado. En caso de no\n\t // encontrarse ninguna se toma como valor el REMOTE_ADDR\n\t \n\t $entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t \n\t reset($entries);\n\t while (list(, $entry) = each($entries))\n\t {\n\t $entry = trim($entry);\n\t if ( preg_match(\"/^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/\", $entry, $ip_list) )\n\t {\n\t // http://www.faqs.org/rfcs/rfc1918.html\n\t $private_ip = array(\n\t '/^0\\./',\n\t '/^127\\.0\\.0\\.1/',\n\t '/^192\\.168\\..*/',\n\t '/^172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\..*/',\n\t '/^10\\..*/');\n\t \n\t $found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);\n\t \n\t if ($client_ip != $found_ip)\n\t {\n\t $client_ip = $found_ip;\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t else\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t }\n\t \n\t return $client_ip;\n\t \n\t}",
"function getIP() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])){\n //ip from share internet\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n //ip pass from proxy\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }else{\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip === '::1' ? '127.0.0.1' : $ip;\n}",
"function getUserIP() {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP)){\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)){\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n return $ip;\n }",
"function getRealIpAddr()\n{\nif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\n//CHECK IP FROM SHARE INTERNET\n\n{\n$ip=$_SERVER['HTTP_CLIENT_IP'];\n\n}\n\nelse if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\n// to check if ip is pass from proxy\n\n{\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n}\nelse\n{\n$ip=$_SERVER['REMOTE_ADDR'];\n}\nreturn $ip;\n}",
"function client_ip(){\r\n\tif(function_exists('apache_request_headers')){\r\n\r\n\t\t$headers = apache_request_headers();\r\n\r\n\t} else {\r\n\r\n\t\t$headers = $_SERVER;\r\n\r\n\t}\r\n\r\n\t//Get the forwarded IP if it exists\r\n\tif (array_key_exists('X-Forwarded-For', $headers ) and\r\n\t\tfilter_var($headers['X-Forwarded-For'],\r\n\t\t\tFILTER_VALIDATE_IP,\r\n\t\t\tFILTER_FLAG_IPV4)){\r\n\r\n\t\t$the_ip = $headers['X-Forwarded-For'];\r\n\r\n\t} elseif(array_key_exists('HTTP_X_FORWARDED_FOR', $headers) and\r\n\t\tfilter_var($headers['HTTP_X_FORWARDED_FOR'],\r\n\t\t\tFILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )){\r\n\r\n\t\t$the_ip = $headers['HTTP_X_FORWARDED_FOR'];\r\n\r\n\t} else {\r\n\t\t\r\n\t\t$the_ip = filter_var($_SERVER['REMOTE_ADDR'],\r\n\t\t\tFILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\r\n\r\n\t}\r\n\r\n\treturn $the_ip;\r\n}",
"public static function realIP() {\n\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\n\t\t\t// Behind proxy\n\t\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t\telseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t// Use first IP address in list\n\t\t\t$_ip=explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\treturn $_ip[0];\n\t\t}\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}",
"function getIPAddress() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])) { \n $ip = $_SERVER['HTTP_CLIENT_IP']; \n } \n //whether ip is from the proxy \n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \n } \n //whether ip is from the remote address \n else{ \n $ip = $_SERVER['REMOTE_ADDR']; \n } \n return $ip; \n }",
"function getUserIP()\r\n {\r\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"]))\r\n {\r\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n }\r\n $client = @$_SERVER['HTTP_CLIENT_IP'];\r\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n $remote = $_SERVER['REMOTE_ADDR'];\r\n\r\n if(filter_var($client, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $client;\r\n }\r\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $forward;\r\n }\r\n else\r\n {\r\n $ip = $remote;\r\n }\r\n return $ip;\r\n}",
"function getUserIp(){\n switch(true){\n case (!empty($_SERVER['HTTP_X_REAL_IP'])): \n return $_SERVER['HTTP_X_REAL_IP'];\n break;\n \n case (!empty($_SERVER['HTTP_CLIENT_IP'])): \n return $_SERVER['HTTP_CLIENT_IP'];\n break;\n \n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])): \n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n break;\n \n default : \n return $_SERVER['REMOTE_ADDR'];\n }\n }",
"function GetUserIP()\n{\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n\n return $ip;\n}",
"public function getIp(){\n if(function_exists('apache_request_headers'))\n $headers = apache_request_headers();\n else\n $headers = $_SERVER;\n if(array_key_exists('X-Forwarded-For', $headers) && filter_var($headers['X-Forwarded-For'], FILTER_VALIDATE_IP))\n $the_ip = $headers['X-Forwarded-For'];\n elseif(array_key_exists('HTTP_X_FORWARDED_FOR', $headers) && filter_var($headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP))\n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n else\n $the_ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);\n return $the_ip;\n }",
"function get_public_ip_address()\n{\n\t// TODO: Add a fallback to http://httpbin.org/ip\n\t// TODO: Add a fallback to http://169.254.169.254/latest/meta-data/public-ipv4\n\n\t$url=\"simplesniff.com/ip\";\n\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n\t$data = curl_exec($ch);\n\tcurl_close($ch);\n\n\treturn $data;\n}",
"static public function getIp() {\n if (isset($_SERVER['REMOTE_ADDR'])) return $_SERVER['REMOTE_ADDR'];\n return '127.0.0.1';\n }",
"function getUserIP()\r\n{\r\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\r\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n }\r\n $client = @$_SERVER['HTTP_CLIENT_IP'];\r\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n $remote = $_SERVER['REMOTE_ADDR'];\r\n\r\n if(filter_var($client, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $client;\r\n }\r\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $forward;\r\n }\r\n else\r\n {\r\n $ip = $remote;\r\n }\r\n\r\n return $ip;\r\n}",
"public static function getIp()\n {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = @$_SERVER['REMOTE_ADDR'];\n\n if (filter_var($client, FILTER_VALIDATE_IP)) {\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)) {\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n\n return $ip;\n }",
"function getRealIpAddr()\r\n{\r\nif (!empty($_SERVER[\"HTTP_CLIENT_IP\"]))\r\n{\r\n //check for ip from share internet\r\n $ip = $_SERVER[\"HTTP_CLIENT_IP\"];\r\n}\r\nelseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\r\n{\r\n // Check for the Proxy User\r\n $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\r\n}\r\nelse\r\n{\r\n $ip = $_SERVER[\"REMOTE_ADDR\"];\r\n}\r\n \r\n// This will print user's real IP Address\r\n// does't matter if user using proxy or not.\r\nreturn $ip;\r\n}",
"function getUserIP()\n{\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n\n return $ip;\n}",
"function getIPAddress() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])) { \n $ip = $_SERVER['HTTP_CLIENT_IP']; \n } \n //whether ip is from the proxy \n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \n } \n//whether ip is from the remote address \n else{ \n $ip = $_SERVER['REMOTE_ADDR']; \n } \n return $ip; \n}",
"public function client_ip() {\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && self::validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if (self::validate_ip($ip))\n return $ip;\n }\n } else {\n if (self::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && self::validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && self::validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && self::validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && self::validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }",
"function getClientIP() {\r\n if (isset ($_SERVER ['HTTP_X_FORWARDED_FOR'])){ $clientIP = $_SERVER ['HTTP_X_FORWARDED_FOR']; }\r\n elseif (isset ($_SERVER ['HTTP_X_REAL_IP'])){ $clientIP = $_SERVER ['HTTP_X_REAL_IP']; }\r\n else { $clientIP = $_SERVER ['REMOTE_ADDR']; }\r\n return $clientIP;\r\n}",
"function getIPAddress() {\r\nif(!empty($_SERVER['HTTP_CLIENT_IP'])) { \r\n $ip = $_SERVER['HTTP_CLIENT_IP']; \r\n} \r\n//whether ip is from the proxy \r\nelseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { \r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \r\n} \r\n//whether ip is from the remote address \r\nelse{ \r\n $ip = $_SERVER['REMOTE_ADDR']; \r\n} \r\nreturn $ip; \r\n}",
"public static function remoteIP(): string {\n $ip = $_SERVER['REMOTE_ADDR'];\n if (settings::$cloudflare_verify && isset($_SERVER['HTTP_CF_CONNECTING_IP']) && tools::isCloudFlare($ip)) {\n return $_SERVER['HTTP_CF_CONNECTING_IP'];\n }\n if (settings::$arvancloud_verify && isset($_SERVER['HTTP_AR_REAL_IP']) && tools::isArvanCloud($ip)) {\n return $_SERVER['HTTP_AR_REAL_IP'];\n }\n return $ip;\n }",
"function get_user_ip() {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n\n return $ip;\n }",
"function get_ip() {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else\n $ip = $_SERVER['REMOTE_ADDR'];\n return $ip;\n}",
"function getRealUserIp()\n{\n switch (true) {\n case (!empty($_SERVER['HTTP_X_REAL_IP'])):\n return $_SERVER['HTTP_X_REAL_IP'];\n case (!empty($_SERVER['HTTP_CLIENT_IP'])):\n return $_SERVER['HTTP_CLIENT_IP'];\n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])):\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n default:\n return $_SERVER['REMOTE_ADDR'];\n }\n}",
"public static function ip() {\n\t\tif (static::$realIp !== null) {\n\t\t\treturn static::$realIp;\n\t\t}\n\n\t\t$possibilities = array(\n\t\t\t'HTTP_CLIENT_IP',\n\t\t\t'HTTP_X_FORWARDED_FOR',\n\t\t\t'HTTP_X_FORWARDED',\n\t\t\t'HTTP_X_CLUSTER_CLIENT_IP',\n\t\t\t'HTTP_FORWARDED_FOR',\n\t\t\t'HTTP_FORWARDED',\n\t\t\t'REMOTE_ADDR'\n\t\t);\n\n\t\tforeach ($possibilities as $key) {\n\t\t\tif (array_key_exists($key, $_SERVER) === true) {\n\t\t\t\tforeach (explode(',', $_SERVER[$key]) as $ip) {\n\t\t\t\t\t$ip = trim($ip);\n\n\t\t\t\t\tif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n\t\t\t\t\t\tstatic::$realIp = $ip;\n\t\t\t\t\t\treturn $ip;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (defined('KOLDY_CLI') && KOLDY_CLI === true) {\n\t\t\tstatic::$realIp = '127.0.0.1';\n\t\t} else if (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\tstatic::$realIp = $_SERVER['REMOTE_ADDR'];\n\t\t} else {\n\t\t\tstatic::$realIp = false;\n\t\t}\n\n\t\treturn static::$realIp;\n\t}",
"public static function get_ip() {\n //Just get the headers if we can or else use the SERVER global\n if ( function_exists( 'apache_request_headers' ) ) {\n $headers = apache_request_headers();\n } else {\n $headers = $_SERVER;\n }\n //Get the forwarded IP if it exists\n if ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n $the_ip = $headers['X-Forwarded-For'];\n } elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )\n ) {\n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n } else {\n\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n }\n return $the_ip;\n }",
"function ip()\n{\n if (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n } else {\n $ip = $_SERVER[\"REMOTE_ADDR\"];\n }\n return $ip;\n}",
"private function getClientIP()\n {\n if ( isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) )\n {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\n foreach ( array ( 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' ) as $key )\n {\n if ( array_key_exists($key, $_SERVER) )\n {\n foreach ( explode(',', $_SERVER[$key]) as $ip )\n {\n $ip = trim($ip);\n\n //if ( filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false )\n if ( filter_var($ip, FILTER_VALIDATE_IP) !== false )\n {\n return $ip;\n }\n }\n }\n }\n\n return null;\n }",
"function getIPAddress()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n //whether ip is from the proxy \n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n //whether ip is from the remote address \n else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}",
"function getUserIP() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'UNKNOWN';\r\n return $ipaddress;\r\n}",
"function getRealIpUser(){\r\n \r\n switch(true){\r\n \r\n case(!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\r\n case(!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\r\n case(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n \r\n default : return $_SERVER['REMOTE_ADDR'];\r\n \r\n }\r\n \r\n}",
"private static function resolveClientIp(): string{\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}",
"function get_user_IP(){\n\t\tif (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n\t\t\t$_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n\t\t}\n\t\t$client = @$_SERVER['HTTP_CLIENT_IP'];\n\t\t$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t$remote = $_SERVER['REMOTE_ADDR'];\n\n\t\tif(filter_var($client, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $client;\n\t\t}elseif(filter_var($forward, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $forward;\n\t\t} else {\n\t\t\t$ip = $remote;\n\t\t}\n\t\treturn $ip;\n\t}",
"function bps_get_proxy_real_ip_address() {\n\t\n\tif ( is_admin() && wp_script_is( 'bps-accordion', $list = 'queue' ) && current_user_can('manage_options') ) {\n\t\tif ( isset($_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_CLIENT_IP']);\n\t\t\techo __('HTTP_CLIENT_IP IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\techo __('Proxy X-Forwarded-For IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['REMOTE_ADDR']);\n\t\t\techo __('Public Internet IP Address (ISP): ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t}\n\t}\n}",
"static function getIP()\r\n {\r\n return self::getRemoteIP();\r\n }",
"function get_client_ip() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'UNKNOWN';\r\n return $ipaddress;\r\n}",
"public static function getIP()\n {\n $ip = '0.0.0.0';\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_VIA'])) {\n $ip = $_SERVER['HTTP_VIA'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }",
"function get_client_ip_2() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'IP tidak dikenali';\r\n return $ipaddress;\r\n}",
"function get_ip() {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\n $fwd_addresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n $ip_address = $fwd_addresses[0];\n } else {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n\n return $ip_address;\n}",
"function getIP(){\r\n$ip = $_SERVER['REMOTE_ADDR'];\r\n\t//lay IP neu user truy cap qua Proxy\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\nreturn $ip;\r\n}",
"public static function get_ip_address() {\n // check for shared internet/ISP IP\n if (!empty($_SERVER['HTTP_CLIENT_IP']) && self::validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n return $_SERVER['HTTP_CLIENT_IP'];\n }\n\n // check for IPs passing through proxies\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n // check if multiple ips exist in var\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($iplist as $ip) {\n if (self::validate_ip($ip))\n return $ip;\n }\n } else {\n if (self::validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED']) && self::validate_ip($_SERVER['HTTP_X_FORWARDED']))\n return $_SERVER['HTTP_X_FORWARDED'];\n if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && self::validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && self::validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n return $_SERVER['HTTP_FORWARDED_FOR'];\n if (!empty($_SERVER['HTTP_FORWARDED']) && self::validate_ip($_SERVER['HTTP_FORWARDED']))\n return $_SERVER['HTTP_FORWARDED'];\n\n // return unreliable ip since all else failed\n return $_SERVER['REMOTE_ADDR'];\n }",
"public function getUserip()\n {\n // Find Client IP\n if (!empty($this->request->getServer('HTTP_CLIENT_IP'))) {\n $client = $this->request->getServer('HTTP_CLIENT_IP');\n }\n if (!empty($this->request->getServer('HTTP_X_FORWARDED_FOR'))) {\n $forward = $this->request->getServer('HTTP_X_FORWARDED_FOR');\n }\n if (!empty($this->request->getServer('REMOTE_ADDR'))) {\n $remote = $this->request->getServer('REMOTE_ADDR');\n }\n if (null !==$this->request->getServer(\"HTTP_CF_CONNECTING_IP\")) { //Find Cloud IP\n $remote=$this->request->getServer('REMOTE_ADDR');\n $client=$this->request->getServer('HTTP_CLIENT_IP');\n $remote = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n $client = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n }\n if (filter_var($client, FILTER_VALIDATE_IP)) {\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)) {\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n return $ip;\n }",
"function getRealIpUser(){\n\n switch(true){\n\n case(!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\n case(!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\n case(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\n\n default : return $_SERVER['REMOTE_ADDR'];\n }\n\n}",
"public static function get_unsafe_client_ip()\n {\n }",
"protected function resolveIp(): string\n {\n return Request::ip();\n }",
"public static function getIp() {\n\t\tforeach (array(\"HTTP_CLIENT_IP\", \"HTTP_X_FORWARDED_FOR\", \"HTTP_X_FORWARDED\", \"HTTP_X_CLUSTER_CLIENT_IP\", \"HTTP_FORWARDED_FOR\", \"HTTP_FORWARDED\", \"REMOTE_ADDR\") as $key) {\n\t\t\tif (!array_key_exists($key, $_SERVER)) \n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\tforeach (explode(\",\", $_SERVER[$key]) as $ip) {\n\t\t\t\t$ip = trim($ip);\n\t\t\t\t\n\t\t\t\tif (filter_var($ip, FILTER_VALIDATE_IP/*, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE*/) !== false)\n\t\t\t\t\treturn $ip;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn NULL;\n\t}",
"protected function buscarIp()\n {\n $ip = '';\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED'];\n } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_FORWARDED'])) {\n $ip = $_SERVER['HTTP_FORWARDED'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ip = $_SERVER['REMOTE_ADDR'];\n } else {\n $ip = 'DESCONHECIDO';\n }\n\n return $ip;\n }",
"function getUserIP() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}",
"public static function IP()\n {\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '::1';\n }",
"function get_ip()\n{\n\t$ip='0.0.0.0';\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n\t{\n\t $ip=$_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n\t{\n\t $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telseif (isset($_SERVER['REMOTE_ADDR']))\n\t{\n\t $ip=$_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}",
"public static function getLocalIp() {\n $localip = '127.0.0.1';\n $the_ip = '';\n if($_SERVER['REMOTE_ADDR']!='::1'){\n if ( function_exists( 'apache_request_headers' ) ) {\n $headers = apache_request_headers();\n } else {\n $headers = $_SERVER;\n }\n $check = 0;\n //Get the forwarded IP if it exists \n if ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) { \n $the_ip = $headers['X-Forwarded-For'];\n } elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )\n ) { \n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n } else { \n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n } \n } \n if($the_ip!='' OR strlen($the_ip)==0){ \n $the_ip = $localip;\n }\n return $the_ip; \n }",
"function ip_address() /* Get IP Address */\n {\n return isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];\n }",
"function getRequestIPAddress()\n{\n $ip = preg_replace('#[^0-9.]#', '', getenv('REMOTE_ADDR'));\n \n return $ip;\n \n \n}",
"function get_client_ip() {\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}",
"function ns_get_client_ip() {\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}",
"function getUserIP()\n{\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client.\"c\";\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward.\"f\";\n }\n else\n {\n $ip = $remote.\"r\";\n }\n\n return $ip;\n}",
"function get_client_ip() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}",
"function get_client_ip() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}",
"function get_client_ip() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}",
"function GetUserIp() {\r\n $client = @$_SERVER['HTTP_CLIENT_IP'];\r\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n $remote = $_SERVER['REMOTE_ADDR'];\r\n if(filter_var($client, FILTER_VALIDATE_IP)) { $ip = $client; }\r\n elseif(filter_var($forward, FILTER_VALIDATE_IP)) { $ip = $forward; } else { $ip = $remote; }\r\n return $ip;\r\n }",
"function erp_get_client_ip() {\n $ipaddress = '';\n\n if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CLIENT_IP'] ) );\n } else if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ) );\n } else if ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED'] ) );\n } else if ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_FORWARDED_FOR'] ) );\n } else if ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['HTTP_FORWARDED'] ) );\n } else if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n $ipaddress = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\n } else {\n $ipaddress = 'UNKNOWN';\n }\n\n return $ipaddress;\n}",
"public function get_ip_address() {\n\t\t// check for shared internet/ISP IP\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t\t}\n\n\t\t// check for IPs passing through proxies\n\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t// check if multiple ips exist in var\n\t\t\tif (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {\n\t\t\t\t$iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\t\tforeach ($iplist as $ip) {\n\t\t\t\t\tif ($this->validate_ip($ip))\n\t\t\t\t\t\treturn $ip;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t}\n\t\t}\n\t\tif (!empty($_SERVER['HTTP_X_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_X_FORWARDED']))\n\t\t\treturn $_SERVER['HTTP_X_FORWARDED'];\n\t\tif (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && $this->validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n\t\t\treturn $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n\t\tif (!empty($_SERVER['HTTP_FORWARDED_FOR']) && $this->validate_ip($_SERVER['HTTP_FORWARDED_FOR']))\n\t\t\treturn $_SERVER['HTTP_FORWARDED_FOR'];\n\t\tif (!empty($_SERVER['HTTP_FORWARDED']) && $this->validate_ip($_SERVER['HTTP_FORWARDED']))\n\t\t\treturn $_SERVER['HTTP_FORWARDED'];\n\n\t\t// return unreliable ip since all else failed\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}",
"function get_client_ip()\n{\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_FORWARDED'])) {\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n } else {\n $ipaddress = 'UNKNOWN';\n }\n return $ipaddress;\n}"
] | [
"0.8134372",
"0.78707206",
"0.78628796",
"0.7771929",
"0.7717964",
"0.7709309",
"0.7699518",
"0.7663612",
"0.7652659",
"0.7631865",
"0.762262",
"0.7617747",
"0.76061195",
"0.7599003",
"0.7598686",
"0.7581547",
"0.7579719",
"0.7562035",
"0.7552743",
"0.75504524",
"0.75504524",
"0.7549584",
"0.7547476",
"0.7543192",
"0.753956",
"0.7533413",
"0.7522188",
"0.75149727",
"0.7504036",
"0.7501197",
"0.74992335",
"0.7491193",
"0.7482112",
"0.7479858",
"0.74764174",
"0.7474501",
"0.7469683",
"0.7464678",
"0.7458843",
"0.74516225",
"0.74506164",
"0.74379164",
"0.7437035",
"0.74369144",
"0.7434539",
"0.74344015",
"0.7432253",
"0.7430156",
"0.74287283",
"0.7426409",
"0.7424519",
"0.741909",
"0.7418794",
"0.74168",
"0.74139583",
"0.7409887",
"0.7392819",
"0.73826367",
"0.7379968",
"0.73763514",
"0.7372485",
"0.73714334",
"0.73710936",
"0.7368137",
"0.73653394",
"0.7355299",
"0.7354327",
"0.7346496",
"0.7343501",
"0.7340322",
"0.73380315",
"0.7334734",
"0.7334694",
"0.7329473",
"0.73244506",
"0.73209184",
"0.7316784",
"0.7316264",
"0.73068947",
"0.73045015",
"0.7301",
"0.7300763",
"0.7300114",
"0.72965676",
"0.72962385",
"0.729615",
"0.72950816",
"0.72950304",
"0.7293043",
"0.7291383",
"0.7285076",
"0.72848666",
"0.7283545",
"0.726845",
"0.726845",
"0.726845",
"0.726665",
"0.7264684",
"0.72571605",
"0.725114"
] | 0.7256931 | 99 |
Registers services on the given app. This method should only be used to configure services and parameters. It should not get services. | public function register(Application $app)
{
parent::register($app);
$app['cache'] = $app->share(function ($app) {
$config = $app['config'];
if (! array_key_exists('cache.driver', $config)) {
return new ArrayCache();
}
switch ($config['cache.driver']) {
case 'array':
return new ArrayCache();
case 'redis':
$cache = new RedisCache();
if (isset($config['cache.redis'])) {
$redis = new \Redis();
$redis->connect($config['cache.redis']['host'], $config['cache.redis']['port']);
$cache->setRedis($redis);
} else {
$cache->setRedis($app['redis']);
}
return $cache;
case 'xcache':
return new XcacheCache();
default:
throw new \RuntimeException('Unknown cache driver: '.$config['cache.driver']);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function register(Container $app);",
"public function register(Application $app)\n {\n // if console register console providers\n if (php_sapi_name() === 'cli') {\n $app->register(new ConsoleProvider);\n }\n $app->register(new DoctrineOrmManagerRegistryProvider);\n }",
"public function register(Container $app)\n {\n }",
"public function register(App $app)\n {\n $app->router->get(\"/api/v1/cloudfront/get_config\", function (KSApp $app) {\n $sql = \"SELECT s.serviceId as sid, d.domain as dom \n FROM CloudFrontService AS s\n LEFT JOIN CloudFrontDomain AS d\n ON s.serviceId=d.serviceId \n ORDER BY s.serviceId, domain\";\n $ret = [\n \"services\" => []\n ];\n $app->db->query($sql)->each(function (array $row) use (&$ret) {\n if (changed($sid = $row[\"sid\"])) {\n $s = CloudFrontService::Load($sid);\n $s->domains = [];\n $ret[\"services\"][] = $s;\n }\n\n if (changed($domain = $row[\"dom\"])) {\n $s->domains[] = $domain;\n }\n\n });\n return $ret;\n });\n }",
"public function register(Application $app)\n {\n // TODO: Implement register() method.\n }",
"public function register(Application $app)\n {\n $app['rest_normalizer.version'] = '0.1.0';\n $app['rest_normalizer.builder'] = $app->protect(\n function ($object = null) use ($app) {\n $version = $app['rest_normalizer.version'];\n $request = $app['request'];\n /** @var $request \\Symfony\\Component\\HttpFoundation\\Request */\n\n $builder = ResponseBuilder::create(\n $version,\n HttpMethod::valueOf($request->getMethod()),\n $object\n );\n\n foreach ($request->request->all() as $key => $value) {\n $parameter = Parameter::create($key, $value);\n $builder->addParameter($parameter);\n }\n\n return $builder;\n }\n );\n }",
"public function registerServices()\n {\n $this->app->bind('helpers.lib', function($app) {\n return new LibHelper;\n });\n $this->app->bind('helpers.theme', function($app) {\n return ThemeHelper::instance();\n });\n $this->app->bind('helpers.acf', function($app) {\n $helper = AcfHelper::instance();\n $helper->setThemeHelper($this->app['helpers.theme']);\n $helper->setLib($this->app['helpers.lib']);\n\n return $helper;\n });\n }",
"protected function registerServices()\n {\n\n $di = new FactoryDefault();\n\n /**\n * Read services\n */\n include CORE_PATH . \"/config/services.php\";\n\n /**\n * Get config service for use in inline setup below\n */\n $config = $di->getConfig();\n\n\n include CORE_PATH . '/config/loader.php';\n\n \n\n $this->setDI($di);\n }",
"public function register(Application $app)\n {\n parent::register($app);\n\n // override this in config to allow a different user entity class to be used.\n if (isset($app['config']['user.entity'])) {\n $app['user.entity'] = $app['config']['user.entity'];\n } else {\n $app['user.entity'] = User::class;\n }\n\n // setup security for cli commands\n if (php_sapi_name() === 'cli') {\n $app['console.configure'] = $app->extend('console.configure', function ($callbacks) {\n $callbacks[] = function (Command $command) {\n if ($command instanceof BaseCommand) {\n $command->addOption('user', 'U', InputOption::VALUE_REQUIRED, 'User ID to run command as');\n }\n };\n return $callbacks;\n });\n $app['console.prerun'] = $app->extend('console.prerun', function ($callbacks) {\n $callbacks[] = function (Command $command, InputInterface $input, OutputInterface $output) {\n if ($command instanceof BaseCommand && $input->getOption('user')) {\n $app = $command->getSilexApplication();\n /** @var EntityManagerInterface $em */\n $em = $app['orm.em'];\n $app['user'] = $em->find($app['user.entity'], $input->getOption('user'));\n }\n };\n return $callbacks;\n });\n }\n\n $app['security.firewalls'] = [];\n $app['security.access_rules'] = [];\n $app->register(new SecurityServiceProvider);\n }",
"public function register(Application $app)\n {\n if (!isset($app['serializer.annotations'])) {\n throw new \\RuntimeException(\n 'The configuration service provider depends on the JmsSerializer Service Provider but the '\n . '\"serializer.annotations\" key could not be found in the container.'\n );\n }\n\n $app->extend('console',\n function (ConsoleApplication $console){\n $console->getDefinition()->addOption(\n new InputOption(\n 'config',\n 'c',\n InputOption::VALUE_OPTIONAL,\n 'Location of a custom configuration file'\n )\n );\n\n return $console;\n }\n );\n\n // Add annotations to Jms Serializer\n $annotations = $app['serializer.annotations'];\n $annotations[] = array(\n 'namespace' => 'phpDocumentor\\Configuration\\Merger\\Annotation',\n 'path' => __DIR__ . '/../../'\n );\n $app['serializer.annotations'] = $annotations;\n\n $app['config.merger'] = $app->share(\n function () {\n return new Merger(new AnnotationReader());\n }\n );\n\n $app['config.path.template'] = __DIR__ . '/Resources/phpdoc.tpl.xml';\n $app['config.path.user'] = getcwd()\n . ((file_exists(getcwd() . '/phpdoc.xml')) ? '/phpdoc.xml' : '/phpdoc.dist.xml');\n $app['config.class'] = 'phpDocumentor\\Configuration';\n\n $app['config2'] = $app->share(\n function ($app) {\n /** @var ConsoleApplication $console */\n $console = $app['console'];\n $input = new ArgvInput(null, $console->getDefinition());\n $userConfigFilePath = $input->getOption('config');\n if ($userConfigFilePath && $userConfigFilePath != 'none' && is_readable($userConfigFilePath)) {\n chdir(dirname($userConfigFilePath));\n } else {\n $userConfigFilePath = $userConfigFilePath != 'none' ? null : 'none';\n }\n\n /** @var Serializer $serializer */\n $serializer = $app['serializer'];\n\n $config = $serializer->deserialize(\n file_get_contents($app['config.path.template']),\n $app['config.class'],\n 'xml'\n );\n\n if ($userConfigFilePath != 'none') {\n $userConfigFilePath = $userConfigFilePath ?: $app['config.path.user'];\n $userConfigFile = $serializer->deserialize(\n file_get_contents($userConfigFilePath),\n $app['config.class'],\n 'xml'\n );\n\n /** @var Merger $merger */\n $merger = $app['config.merger'];\n $config = $merger->run($config, $userConfigFile);\n }\n\n return $config;\n }\n );\n\n $app['config'] = $app->share(\n function ($app) {\n $config_files = array($app['config.path.template']);\n if (is_readable($app['config.path.user'])) {\n $config_files[] = $app['config.path.user'];\n }\n\n return Factory::fromFiles($config_files, true);\n }\n );\n }",
"function register(Application $app)\n {\n //Register the DoctrineServiceProvider if it's not there\n if (!isset($app['db']) || !$app['db'] instanceof \\Doctrine\\DBAL\\Connection) {\n $app->register(new DoctrineServiceProvider(), isset($app['db.options']) ? $app['db.options'] : array());\n }\n\n $app['dbm'] = $app->share(function () use ($app) {\n $callback = isset($app['dbm.options']['callback']) ? $app['dbm.options']['callback'] : null;\n return new ManagerFactory($app['db'], $app['dbm.options']['format'], $callback);\n });\n }",
"private function registerServices() {\n // Modules\n $this->addService('modules', 'MyTravel\\Core\\Service\\Modules::setService');\n // Routing\n $this->addService('routing', 'MyTravel\\Core\\Service\\Routing::setService');\n // Event dispatcher\n $this->serviceContainer\n ->register('events', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');\n // Database\n $this->addService('db', 'MyTravel\\Core\\Service\\Db::setService');\n // Access\n $this->addService('access', 'MyTravel\\Core\\Service\\Access::setService');\n }",
"public function registerServices() {\n\t\t$services = Config::inst()->get('FakeManager', 'services');\n\t\tif($services) {\n\t\t\tforeach($services as $origName => $fakeName) {\n\t\t\t\t$fakeObj = Injector::inst()->create($fakeName);\n\t\t\t\tif($this->db && $fakeObj instanceof FakeDatabaseConsumerInterface) {\n\t\t\t\t\t$fakeObj->setDb($this->db);\n\t\t\t\t}\n\t\t\t\t$this->services[$origName] = $fakeObj;\n\t\t\t\tInjector::inst()->registerService($fakeObj, $origName);\n\t\t\t}\n\t\t}\n\t}",
"protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }",
"protected function registerServices(): void\n {\n $this->registerKernels();\n $this->registerFactories();\n $this->registerMicroServices();\n }",
"public function register(Application $app)\n {\n $this->registerCommon($app);\n $this->registerMiddlewares($app);\n $this->registerWebActions($app);\n $this->registerControllers($app);\n }",
"public function register(Application $app) {\r\n\t\tif (!isset($app['path.conf'])) {\r\n\t\t\t$app['path.conf'] = $this->path;\r\n\t\t}\r\n\r\n\t\t$path = $app['path.conf'];\r\n\t\tif (empty($path)) throw new Exception(\"Application value 'path.conf' is not defined.\");\r\n\t\tif (!is_dir($path)) throw new Exception(\"Directory '$path' specified in 'path.conf' does not exists.\");\r\n\r\n\t\t$configuration = array();\r\n\t\tif (file_exists(\"$path/config-defaults.php\")) {\r\n\t\t\t$configuration = require \"$path/config-defaults.php\";\r\n\t\t}\r\n\t\tif (file_exists(\"$path/config.php\")) {\r\n\t\t\t$configuration = mergeArrays(require \"$path/config.php\", $configuration);\r\n\t\t}\r\n\t\t// Loading configuration.\r\n\t\t$root = getValue('.', $configuration);\r\n\t\tif (is_array($root)) {\r\n\t\t\tforeach ($root as $key => $value) {\r\n\t\t\t\t$app[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$instance = Configuration::getInstance();\r\n\t\t$instance->set($configuration);\r\n\r\n\t\t$app['config'] = $app->share(function($app) use ($instance) {\r\n\t\t\treturn $instance;\r\n\t\t});\r\n\t}",
"public function register(Container $app)\n {\n $app['pheanstalk.config_default'] = [\n 'host' => '127.0.0.1',\n 'port' => PheanstalkInterface::DEFAULT_PORT,\n 'timeout' => null,\n 'persistent' => false,\n ];\n\n $app['pheanstalk.config_resolver'] = function () use ($app) {\n return array_merge($app['pheanstalk.config_default'], $app['pheanstalk.config'] ?? []);\n };\n\n $app['pheanstalk.client'] = function () use ($app) {\n return new Pheanstalk(\n $app['pheanstalk.config_resolver']['host'],\n $app['pheanstalk.config_resolver']['port'],\n $app['pheanstalk.config_resolver']['timeout'],\n $app['pheanstalk.config_resolver']['persistent']\n );\n };\n }",
"public function register(Application $app)\n {\n $this->registerAssemblers($app);\n\n $app['parser'] = $app->extend(\n 'parser',\n function ($parser) use ($app) {\n return $parser->registerBackend(new Document($app['descriptor.analyzer']));\n }\n );\n\n $app[self::TEMPLATE_FOLDER] = realpath(__DIR__ . '/data/templates/');\n $app[self::CONVERTERS] = array(\n '\\phpDocumentor\\Plugin\\Scrybe\\Converter\\RestructuredText\\ToHtml' => array(Format::RST, Format::HTML),\n );\n\n $app[self::FORMATS] = $app->share(\n function () {\n return new Converter\\Format\\Collection();\n }\n );\n $app[self::CONVERTER_DEFINITION_FACTORY] = $app->share(\n function ($container) {\n return new Factory($container[ServiceProvider::FORMATS]);\n }\n );\n $app[self::CONVERTER_FACTORY] = $app->share(\n function ($container) {\n return new Converter\\Factory(\n $container['converters'],\n $container['converter_definition_factory'],\n $container['monolog']\n );\n }\n );\n $app[self::TEMPLATE_FACTORY] = $app->share(\n function ($app) {\n return new Template\\Factory(\n array('twig' => new Template\\Twig($app[ServiceProvider::TEMPLATE_FOLDER]))\n );\n }\n );\n\n $this->addCommands($app);\n }",
"protected function registerBindings(Application $app)\n {\n $app->singleton('wit', function ($app) {\n $config = $app['config'];\n\n return new Wit(\n $config->get('wit.access_token', null),\n $config->get('wit.async_requests', false)\n );\n });\n\n $app->alias('wit', Wit::class);\n }",
"public function register( Application $app )\n {\n $app['security.apikey.authenticator'] = $app->protect(function () use ($app) {\n return new ApiKeyAuthenticator(\n $app['security.user_provider.apikey'](),\n $app['security.apikey.param'],\n $app['logger']\n );\n });\n\n $app['security.authentication_listener.factory.apikey'] = $app->protect(function ($name, $options) use ($app) {\n\n $app['security.authentication_provider.'.$name.'.apikey'] = $app->share(function () use ($app, $name) {\n return new SimpleAuthenticationProvider(\n $app['security.apikey.authenticator'](),\n $app['security.user_provider.apikey'](),\n $name\n );\n });\n\n $app['security.authentication_listener.' . $name . '.apikey'] = $app->share(function () use ($app, $name, $options) {\n return new SimplePreAuthenticationListener(\n $app['security'],\n $app['security.authentication_manager'],\n $name,\n $app['security.apikey.authenticator'](),\n $app['logger']\n );\n });\n\n return array(\n 'security.authentication_provider.'.$name.'.apikey',\n 'security.authentication_listener.'.$name.'.apikey',\n null, // entrypoint\n 'pre_auth' // position of the listener in the stack\n );\n });\n\n return true;\n }",
"protected function registerServiceProviders()\n {\n foreach ($this->providers as $provider) {\n $this->app->register($provider);\n }\n }",
"protected function registerProviders(Application $app) { $app->register(new UrlGeneratorServiceProvider());\n // Session Provider.\n $app->register(new SessionServiceProvider());\n\n // Service controllers FTW!\n $app->register(new ServiceControllerServiceProvider());\n // Load the installation-specific configuration file. This should never be in Git.\n $app->register(new ConfigServiceProvider(__DIR__ . \"/../config/settings.json\"));\n // Load environment-specific configuration.\n $app->register(new ConfigServiceProvider(__DIR__ . \"/../config/{$app['environment']}.json\"));\n\n // Doctrine Provider. Needs to come after config.\n $app->register(new DoctrineServiceProvider(), array(\n 'db.options' => $app['database'],\n ));\n }",
"protected function registerServices()\n {\n $this->app->singleton('components', function($app) {\n $path = $app['config']->get('components.paths.components');\n\n return new Repository($app, $path);\n });\n }",
"public function registerServices(Slim $app, array $serviceConfig = [])\n {\n if (isset($serviceConfig['callables'])) {\n foreach ($serviceConfig['callables'] as $serviceKey => $callable) {\n $this->registerService($app, $serviceKey, function () use ($app, $callable) {\n return call_user_func($callable, $app);\n });\n }\n }\n if (isset($serviceConfig['factories'])) {\n foreach ($serviceConfig['factories'] as $serviceKey => $className) {\n $this->registerService($app, $serviceKey, function () use ($app, $serviceKey, $className) {\n $factory = new $className();\n if ($factory instanceof ServiceFactoryInterface) {\n return $factory->getService($app);\n }\n throw new InvalidFactory(\"Failed to create $serviceKey: $className does not implement \\FzySlimCore\\Factory\\ServiceFactoryInterface\");\n });\n }\n }\n if (isset($serviceConfig['invokables'])) {\n foreach ($serviceConfig['invokables'] as $serviceKey => $className) {\n $this->registerService($app, $serviceKey, $this->createInvokable($app, $className));\n }\n }\n\n }",
"public function registerServices() {\n\t\t$services = $this->getServices();\n\t\t$services = array_map( [ $this, 'instantiateServices' ], $services );\n\t\t\n\t\tarray_walk( $services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}",
"public function register(Application $app)\n {\n if (empty($app[self::AMQP_CONNECTIONS])) {\n $app[self::AMQP_CONNECTIONS] = array(\n 'default' => array(\n 'host' => 'localhost',\n 'port' => 5672,\n 'username' => 'guest',\n 'password' => 'guest',\n 'vhost' => '/',\n ),\n );\n }\n\n $app[self::AMQP_FACTORY] = $app->protect(function (\n $host = 'localhost',\n $port = 5672,\n $username = 'guest',\n $password = 'guest',\n $vhost = '/'\n ) use ($app) {\n return $app[self::AMQP]->createConnection($host, $port, $username, $password, $vhost);\n });\n\n $app[self::AMQP] = $app->share(function () use ($app) {\n return new AmqpConnectionProvider($app[self::AMQP_CONNECTIONS]);\n });\n }",
"public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }",
"private function registerApp()\n {\n $this->app->bind('utilities', function ($app) {\n return new Utilities($app);\n });\n\n $this->app->alias('utilities', 'RentalManager\\Utilities');\n }",
"public function register(\\Silex\\Application $app)\n {\n parent::register($app);\n $this->registerFactory($app);\n }",
"public static function register_services()\n {\n foreach ( self::get_services() as $class )\n {\n $service = self::instantiate( $class );\n if( method_exists( $service, 'register' ) )\n $service->register();\n }\n }",
"public static function register_services()\n {\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if ( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }",
"public static function register_services()\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($service, 'register')) {\n $service->register();\n }\n }\n }",
"public function register(ContainerInterface $app)\n {\n $app->instance(ContainerInterface::class, $app);\n $app->singleton(KernelInterface::class, Kernel::class);\n $app->set(InputInterface::class, ConsoleInput::class);\n $app->set(OutputInterface::class, ConsoleOutput::class);\n }",
"public function register(Container $app)\n {\n // Choose our locator\n $app['command.bus.locator'] = function ($app) {\n $locator = isset($app['tactician.locator']) ? $app['tactician.locator'] : 'default';\n switch ($locator) {\n case 'silex':\n return new SilexHandlerLocator($app);\n case 'in_memory':\n default:\n return new InMemoryLocator();\n }\n\n };\n\n// Choose our method name\n// Choose our Handler naming strategy\n// Create the middleware that executes commands with Handlers\n// Create the command bus, with a list of middleware\n\n $app['command.bus'] = function ($app) {\n $inflector = new HandleInflector();\n $nameExtractor = new ClassNameExtractor();\n $commandHandlerMiddleware = new CommandHandlerMiddleware(\n $nameExtractor,\n $app['command.bus.locator'],\n $inflector\n );\n\n return new CommandBus([$commandHandlerMiddleware]);\n };\n }",
"public static function register(Container $app) : void\n {\n if (!isset($app['config']['arangodb'])) {\n throw new \\Exception(\"Connection settings for Arango database are missing\", 1);\n }\n\n $host = sprintf('tcp://%s:%d', $app['config']['arangodb']['host'], $app['config']['arangodb']['port']);\n\n $connectionOptions = array(\n ArangoConnectionOptions::OPTION_DATABASE => $app['config']['arangodb']['database'],\n ArangoConnectionOptions::OPTION_ENDPOINT => $host,\n ArangoConnectionOptions::OPTION_AUTH_TYPE => $app['config']['arangodb']['auth'],\n ArangoConnectionOptions::OPTION_AUTH_USER => $app['config']['arangodb']['user'],\n ArangoConnectionOptions::OPTION_AUTH_PASSWD => $app['config']['arangodb']['password'],\n ArangoConnectionOptions::OPTION_CONNECTION => $app['config']['arangodb']['connection'],\n ArangoConnectionOptions::OPTION_TIMEOUT => $app['config']['arangodb']['timeout'],\n ArangoConnectionOptions::OPTION_RECONNECT => $app['config']['arangodb']['reconnect'],\n ArangoConnectionOptions::OPTION_CREATE => $app['config']['arangodb']['create'],\n ArangoConnectionOptions::OPTION_UPDATE_POLICY => ArangoUpdatePolicy::LAST,\n );\n\n ArangoException::enableLogging();\n\n $app['arango'] = function () use ($connectionOptions) {\n return new ArangoConnection($connectionOptions);\n };\n\n unset($host);\n }",
"public function registerServices()\n {\n /**\n * @var $container Container\n */\n $container = $this->getContainer();\n\n $services = $container->settings['services'];\n\n if (is_array($services) && !empty($services)) {\n foreach ($services as $service) {\n /**\n * @var $instance ServiceInterface\n */\n $instance = new $service();\n\n $container[$instance->name()] = $instance->register();\n\n unset($instance);\n }\n }\n\n unset($container, $services, $service);\n }",
"private function bindServices()\n {\n // $this->app->singleton('package-blueprint-service', function ($app) {\n // return new FooService();\n // });\n }",
"public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }",
"public function register_services() {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( ! empty( $this->services ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$classes = $this->get_service_classes();\n\n\t\t$this->services = array_map(\n\t\t\t[ $this, 'instantiate_service' ],\n\t\t\t$classes\n\t\t);\n\n\t\tarray_walk( $this->services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}",
"public function withServices(ServicesContract $services): AppContract;",
"protected function registerService()\n {\n $this->app->singleton('toolsService', function ($app) {\n return new ToolsService();\n });\n $this->app->alias('hs', ToolsService::class);\n }",
"public function register(Container $app)\n {\n switch ($app['params']['storage_system']) {\n case 's3':\n $this->registerStorageSystemS3($app);\n break;\n case 'local':\n default:\n $this->registerStorageSystemLocal($app);\n break;\n }\n }",
"public function register(\\Box_App &$app)\n {\n $app->get('/autoticket', 'get_index', array(), get_class($this));\n\t\t$app->get('/autoticket/settings', 'get_settings', array(), get_class($this));\n }",
"public static function inject(Container $app)\n {\n self::$injectedApp = $app;\n }",
"public static function register_services(): void\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($class, 'register')) {\n $service->register();\n }\n }\n }",
"public function register($app)\n {\n $this->startTime = microtime(true);\n\n return $app->events->listen('*', function ($eventName, $payload) {\n $this->collect($eventName, $payload);\n });\n }",
"public function bind($app) {\n $this->apps[] = $app;\n }",
"protected function registerServices()\n {\n $this->app->singleton('adminmenu', function () {\n return new Builder();\n });\n }",
"public function register(Application $app)\n {\n $app[\"cors.allowOrigin\"] = \"*\"; // Defaults to all\n $app[\"cors.allowMethods\"] = null; // Defaults to all\n $app[\"cors.maxAge\"] = null;\n $app[\"cors.allowCredentials\"] = false;\n $app[\"cors.exposeHeaders\"] = null;\n\n $cors = new Cors();\n\n $app[\"cors\"] = $app->protect(\n function (Request $request, Response $response) use ($cors, $app) {\n $response->headers->add($cors->handle($app, $request, $response));\n }\n );\n }",
"public function register(Application $app)\n {\n $app['menu'] = $app->share(\n function ($app) {\n $builder = new MenuBuilder($app);\n\n return $builder;\n }\n );\n }",
"protected function registerServices()\n {\n $this->singleton('request', function ($app) {\n return new Request($app);\n });\n\n $this->singleton('response', function ($app) {\n return new Response($app);\n });\n\n $this->singleton('route', function ($app) {\n return new Route($app);\n });\n\n $this->singleton('view', function ($app) {\n return new View($app);\n });\n\n $this->singleton('exception', function ($app) {\n return new Exception($app, $app->exception);\n });\n\n $this->singleton('crypt', function ($app) {\n return new Crypt($app->getSecret());\n });\n\n $this->singleton('cookie', function ($app) {\n return new Cookie($app, $app->getConfig('state')['cookie']);\n });\n\n $this->singleton('session', function ($app) {\n return new Session(new SessionDatabaseHandler($app, $app->getConfig('state')['session']));\n });\n\n return $this->factory();\n }",
"public function register()\n\t{\n\t\t$this->app->bindShared('Brenelz\\Craft\\Service', function($app){\n\t\t\t\n\t\t\t$path = $app['config']->get('craft::craft.path');\n\n\t\t\trequire $path.'/app/bootstrap.php';\n\n\t\t\t// Initialize Craft\\WebApp this way so it doesn't cause a syntax error on PHP < 5.3\n\t\t\t$appClass = '\\Craft\\WebApp';\n\t\t\t$app = new $appClass($config);\n\n\t\t\treturn $app;\n\t\t});\n\t}",
"public function register()\n { \n // out(\"::registering services::\");\n $this->app->profile_repository = new ProfileRepository(); \n $this->app->page_repository = new PageRepository();\n $this->app->user_repository = new UserRepository(); \n $this->app->entity_repository = new EntityRepositoryImpl();\n $this->app->meal_task_group_member_repo = new MealTaskGroupMemberRepository();\n $this->app->web_config_service = new WebConfigService( $this->app->entity_repository);\n $this->app->entity_service = new EntityService($this->app->entity_repository, $this->app->web_config_service);\n //Repositories//\n $this->app->bind(UserRepository::class, function ($app) {\n return $app->user_repository;\n });\n $this->app->bind(ProfileRepository::class, function ($app) {\n return $app->profile_repository;\n });\n $this->app->bind(PageRepository::class, function ($app) {\n return $app->page_repository;\n });\n $this->app->bind(EntityRepository::class, function ($app) {\n return $app->entity_repository;\n });\n\n //Services//\n $this->app->bind(AccountService::class, function ($app) {\n return new AccountService($app->user_repository);\n });\n $this->app->bind(EntityService::class, function ($app) {\n return ($app->entity_service );\n });\n $this->app->bind(ComponentService::class, function ($app) {\n $service = new ComponentService($app->profile_repository, $app->page_repository, $app->web_config_service, $app->meal_task_group_member_repo);\n $service->setEntityRepoAndEntitySvc($app->entity_repository, $app->entity_service);\n return $service;\n });\n $this->app->bind(WebConfigService::class, function ($app) {\n return $app->web_config_service;\n });\n \n \n }",
"public function register()\n {\n App::singleton(UtilsServiceCatalog::CacheService, 'services\\\\utils\\\\RedisCacheService');\n\t App::singleton(UtilsServiceCatalog::TransactionService, 'services\\\\utils\\\\EloquentTransactionService');\n\n App::resolving('redis',function($redis){\n $cache_service = App::make(UtilsServiceCatalog::CacheService);\n $cache_service->boot();\n });\n\n $this->app['serverconfigurationservice'] = App::share(function ($app) {\n return new ServerConfigurationService(App::make(UtilsServiceCatalog::CacheService),App::make(UtilsServiceCatalog::TransactionService));\n });\n\n // Shortcut so developers don't need to add an Alias in app/config/app.php\n App::booting(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('ServerConfigurationService', 'services\\\\facades\\\\ServerConfigurationService');\n });\n\n App::singleton(UtilsServiceCatalog::LogService, 'services\\\\utils\\\\LogService');\n App::singleton(UtilsServiceCatalog::LockManagerService, 'services\\\\utils\\\\LockManagerService');\n App::singleton(UtilsServiceCatalog::ServerConfigurationService, 'services\\\\utils\\\\ServerConfigurationService');\n App::singleton(UtilsServiceCatalog::BannedIpService, 'services\\\\utils\\\\BannedIPService');\n\n }",
"public function register()\n {\n /**\n * Sets third party service providers that are only needed on local environments\n */\n if ($this->app->environment() == 'local') {\n /**\n * Loader for registering facades\n */\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n /**\n * Load third party local providers and facades\n */\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n\n $this->app->register(\\Laracasts\\Generators\\GeneratorsServiceProvider::class);\n }\n $this->app->bind('soaClient', function ($app,$params) {\n $cloud = SOA::getInstance($params[0]);\n if($cloud->getEnv()){\n return $cloud;\n }\n $cloud->setEncodeType(true, true);\n $config = config('soa.'.$params[0]);\n $cloud->putEnv('app', $config['app']);\n $cloud->putEnv('appKey', $config['appKey']);\n $cloud->setServers($config['hosts']);\n return $cloud;\n });\n $this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');\n }",
"protected function registerServices()\n {\n $this->app->singleton(\n 'adminmenu',\n function () {\n return new Builder();\n }\n );\n }",
"public function register()\n {\n foreach ($this->simpleBindings as $contract => $service) {\n $this->app->bind($contract, $service);\n }\n }",
"protected function registerBaseServices()\n {\n $container = $this->getContainer();\n\n $container->share('logger', function () use ($container) {\n return new Logger($container->get('config'));\n });\n\n $this->registerService(new Providers\\ConfigProvider());\n $this->registerService(new Providers\\FileSystemProvider());\n $this->registerService(new Providers\\ParserManagerProvider());\n $this->registerService(new Providers\\BackendProvider());\n }",
"public function registerServices(){\n }",
"protected function configureApplication(Application $app)\n {\n //\n }",
"public function register(Application $app)\n {\n $app['dialog'] = $this;\n $this->app = $app;\n /** @var Skylab $consoleApp */\n $consoleApp = $this->app['console'];\n $this->dialog = $consoleApp->getHelperSet()->get('question');\n }",
"public function register(Application $app)\n {\n /* \\outputImage */\n $app['glide'] = ServerFactory::create(array(\n 'source' => web_path('upload'),\n 'cache' => web_path('upload/.cache'),\n ));\n }",
"public function __construct($app)\n {\n parent::__construct($app);\n\n foreach ($this->getConfig('drivers') as $driver => $configs) {\n $this->registerDriver($driver, $configs);\n }\n }",
"protected function registerServiceProviders()\n {\n if ($this->active()->has('providers')) {\n $providers = $this->active()->get('providers');\n\n foreach ($providers as $provider) {\n App::register($provider);\n }\n }\n }",
"public function register()\n {\n $this->registerBindings($this->app);\n }",
"public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }",
"public function register()\n {\n foreach (glob(base_path('config/*.php')) as $file) {\n $this->app->configure(explode('.', basename($file))[0]);\n }\n }",
"public function register(): void {\n $this->app->bind(ItemAffixService::class, function ($app) {\n return new ItemAffixService();\n });\n\n $this->app->bind(AssignSkillService::class, function ($app) {\n return new AssignSkillService();\n });\n\n $this->app->bind(UpdateCharacterStatsService::class, function ($app) {\n return new UpdateCharacterStatsService();\n });\n\n $this->app->bind(UserService::class, function($app) {\n return new UserService();\n });\n\n $this->app->bind(ItemsService::class, function($app) {\n return new ItemsService();\n });\n\n $this->app->bind(QuestService::class, function() {\n return new QuestService();\n });\n\n $this->app->bind(InfoPageService::class, function() {\n return new InfoPageService();\n });\n\n $this->app->bind(GuideQuestService::class, function() {\n return new GuideQuestService();\n });\n\n $this->app->bind(LocationService::class, function($app) {\n return new LocationService($app->make(CoordinatesCache::class));\n });\n\n $this->commands([CreateAdminAccount::class, GiveKingdomsToNpcs::class]);\n }",
"public function register()\n {\n $this->app->bind(\n ClientServiceInterface::class,\n ClientService::class\n );\n\n $this->app->bind(\n ProjectServiceInterface::class,\n ProjectService::class\n );\n\n $this->app->bind(\n ActionServiceInterface::class,\n ActionService::class\n );\n }",
"public function register(Container $app)\n {\n $app['problem.details.exception.map'] = function () {\n return new Container(\n include __DIR__ . '/problemDetailsFromExceptionMap.php'\n );\n };\n\n $this->app = $app;\n }",
"public function register(Application $app)\n {\n $app['blade.filesystem'] = $app->share(function() {\n return new Filesystem;\n });\n\n $app['blade.compiler'] = $app->share(function() use ($app) {\n return new BladeCompiler($app['blade.filesystem'], $app['blade.settings']['cache']);\n });\n\n $app['blade.compiler_engine'] = $app->share(function() use ($app) {\n return new CompilerEngine($app['blade.compiler'], $app['blade.filesystem']);\n });\n\n $app['blade.resolver'] = $app->share(function() {\n return new EngineResolver;\n });\n\n $app['blade.resolver']->register('blade', function() use ($app) {\n return $app['blade.compiler_engine'];\n });\n\n $app['blade.finder'] = $app->share(function() use ($app) {\n return new FileViewFinder($app['blade.filesystem'], $app['blade.settings']['views']);\n });\n\n $app['blade.dispatcher'] = $app->share(function() {\n return new Dispatcher;\n });\n\n $app['blade'] = $app->share(function($app) {\n $blade = new Environment($app['blade.resolver'], $app['blade.finder'], $app['blade.dispatcher']);\n\n $blade->share('app', $app);\n\n return $blade;\n });\n }",
"protected function registerFactory(Application $app)\n {\n //opauth listener for event callbacks\n $app[self::LISTENER] = $app->share(\n function() use ($app) {\n return new OpauthListener(\n $app['security'], \n $app['security.authentication_manager'],\n $app['users'],\n $app['monolog']\n );\n }\n );\n \n $app['security.authentication_listener.factory.opauth'] = $app->protect(function ($name, $options) use ($app) {\n // define the authentication provider object\n $app['security.authentication_provider.'.$name.'.opauth'] = $app->share(function () use ($app) {\n return new PreAuthenticatedAuthenticationProvider(\n $app['users'],\n new UserChecker(),\n 'opauth'\n );\n });\n\n // define the authentication listener object\n $app['security.authentication_listener.'.$name.'.opauth'] = $app->share(function () use ($app) {\n $subscriber = $app[\\Metagist\\OpauthSecurityServiceProvider::LISTENER];\n $dispatcher = $app['dispatcher'];\n /* @var $dispatcher \\Symfony\\Component\\EventDispatcher\\EventDispatcher */\n $dispatcher->addSubscriber($subscriber);\n return $subscriber;\n });\n\n return array(\n // the authentication provider id\n 'security.authentication_provider.'.$name.'.opauth',\n // the authentication listener id\n 'security.authentication_listener.'.$name.'.opauth',\n // the entry point id\n null,\n // the position of the listener in the stack\n 'pre_auth'\n );\n });\n }",
"public function register()\n {\n foreach ($this->getBindings() as $interface => $class) {\n $this->app->bind($interface, $class);\n }\n }",
"public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }",
"public function register()\n {\n // Bind Credential Contract with Service\n $this->app->bind(Credentials::class, function ($app){\n return new CredentialsManger($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n\n // Bind Caption Contract with Service\n $this->app->bind(Configuration::class, function ($app){\n return new ConfigurationManager($app->make('filesystem.disk'));\n });\n\n // Inject dependencies into Auth Service.\n $this->app->singleton(Post::class, function ($app){\n return new PostService(new Instagram(true, true), $app->make(Credentials::class));\n });\n\n // Inject Guzzle Into Reddit Service\n $this->app->singleton(Scraper::class, function ($app){\n return new ScraperService(new Client(['base_uri' => 'http://www.reddit.com']), $app->make(Configuration::class), $app->make('filesystem.disk'));\n });\n\n $this->app->bind(Caption::class, function ($app){\n return new CaptionManager($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n }",
"public function register_services(): void {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( \\count( $this->service_container ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the injector as the very first service.\n\t\t$this->service_container->put(\n\t\t\tstatic::SERVICE_PREFIX . static::INJECTOR_ID,\n\t\t\t$this->injector\n\t\t);\n\n\t\t$services = $this->get_service_classes();\n\n\t\tif ( $this->enable_filters ) {\n\t\t\t/**\n\t\t\t * Filter the default services that make up this plugin.\n\t\t\t *\n\t\t\t * This can be used to add services to the service container for\n\t\t\t * this plugin.\n\t\t\t *\n\t\t\t * @param array<string, string> $services Associative array of identifier =>\n\t\t\t * class mappings. The provided\n\t\t\t * classes need to implement the\n\t\t\t * Service interface.\n\t\t\t */\n\t\t\t$filtered_services = apply_filters(\n\t\t\t\tstatic::HOOK_PREFIX . static::SERVICES_FILTER,\n\t\t\t\t$services\n\t\t\t);\n\n\t\t\t$services = $this->validate_services( $filtered_services );\n\t\t}\n\n\t\twhile ( null !== key( $services ) ) {\n\t\t\t$id = $this->maybe_resolve( key( $services ) );\n\n\t\t\t$class = $this->maybe_resolve( current( $services ) );\n\n\t\t\t// Delay registering the service until all requirements are met.\n\t\t\tif (\n\t\t\t\tis_a( $class, HasRequirements::class, true )\n\t\t\t) {\n\t\t\t\tif ( ! $this->requirements_are_met( $id, $class, $services ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->schedule_potential_service_registration( $id, $class );\n\n\t\t\tnext( $services );\n\t\t}\n\t}",
"public function register() : void\n {\n $environment = $this->app->environment();\n\n $providers = $this->app['config']->get('app.' . $environment . '_providers', []);\n\n foreach ($providers as $provider) {\n $this->app->register($provider);\n }\n\n $facades = $this->app['config']->get('app.' . $environment . '_aliases', []);\n\n foreach ($facades as $class => $name) {\n AliasLoader::getInstance()->alias($class, $name);\n }\n }",
"protected function registerBaseServices(): ApplicationInterface\n {\n return $this->registerLoggerService()\n ->registerExceptionHandler()\n ->registerRouter();\n }",
"public function register()\n {\n $contracts = config(\"api.contracts\");\n $bindings = config('api.bindings');\n foreach($contracts as $contract)\n {\n $this->app->bind($contract, function($app) use ($contract, $bindings)\n {\n $version = Request::segment(2);\n return $app[$bindings[$version][$contract]];\n });\n }\n }",
"public function register(): void\n {\n $this->configure();\n $this->registerServices();\n }",
"public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }",
"public function register()\n {\n // Register services\n $this->app->singleton(UserService::class, \\App\\Services\\UserService::class);\n $this->app->singleton(RemindService::class, \\App\\Services\\RemindService::class);\n $this->app->singleton(CampaignService::class, \\App\\Services\\CampaignService::class);\n $this->app->singleton(CreditCardService::class, \\App\\Services\\CreditCardService::class);\n $this->app->bind('activity', \\App\\Services\\ActivityService::class);\n\n $this->app->bind(Message::class, function ($app) {\n return new Message(\n Setting::getSetting(Setting::MODULE_CORE, Setting::SETTING_USER_ID),\n Setting::getSetting(Setting::MODULE_CORE, Setting::SETTING_API_TOKEN),\n Setting::getSetting(Setting::MODULE_CORE, Setting::SETTING_API_SECRET)\n );\n });\n\n $this->app->bind(Voice::class, function ($app) {\n return new Voice(\n Setting::getSetting(Setting::MODULE_CORE, Setting::SETTING_USER_ID),\n Setting::getSetting(Setting::MODULE_CORE, Setting::SETTING_API_TOKEN),\n Setting::getSetting(Setting::MODULE_CORE, Setting::SETTING_API_SECRET)\n );\n });\n }",
"public function bootstrap(Container $app)\n {\n foreach ($app->make('config')->get('app.services') as $key => $services) {\n foreach ((array) $services as $service) {\n $app->alias($key, $service);\n }\n }\n \n foreach ($app->make('config')->get('app.theme.services', []) as $key => $services) {\n foreach ((array) $services as $service) {\n $app->alias($key, $service);\n }\n }\n }",
"protected function registerServices()\r\n\t{\r\n\r\n\t\t$di = new FactoryDefault();\r\n\r\n\t\t$loader = new Loader();\r\n\r\n\t\t/**\r\n\t\t * We're a registering a set of directories taken from the configuration file\r\n\t\t */\r\n\t\t$loader->registerDirs(\r\n\t\t\tarray(\r\n\t\t\t\t__DIR__ . '/../apps/library/',\r\n\t\t\t\t__DIR__ . '/../apps/plugins/'\r\n\t\t\t)\r\n\t\t)->register();\r\n\r\n\r\n\r\n\t\t//Registering a router\r\n\t\t$di->set('router', function(){\r\n\r\n\t\t\t$router = new Router();\r\n\r\n\t\t\t$router->setDefaultModule(\"frontend\");\r\n\t\t\t$router->setDefaultController(\"index\");\r\n\t\t\t$router->setDefaultAction(\"index\");\r\n\r\n $router->add(\"/register/recoveryPassword\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'recoveryPassword',\r\n ));\r\n $router->add(\"/register/index\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'index',\r\n ));\r\n\r\n $router->add(\"/help/about\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'help',\r\n 'action' => 'about',\r\n ));\r\n\r\n\t\t\t\r\n\t\t\t$router->add(\"/ajax/getlast\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 'ajax',\r\n\t\t\t\t'action' => 'getlast',\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$router->add(\"/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n// $router->add(\"/admin/register\", array(\r\n// 'module' => 'backend',\r\n// 'controller' => 'register',\r\n// 'action' => 'index',\r\n// ));\r\n\r\n\t\t\t$router->add(\"/admin\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/login\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\r\n\r\n//\t\t\t$router->notFound(array(\r\n//\t\t\t\t\"controller\" => \"index\",\r\n//\t\t\t\t\"action\" => \"page404\",\r\n//\t\t\t));\r\n\r\n\t\t\treturn $router;\r\n\r\n\t\t});\r\n\r\n\t\t$this->setDI($di);\r\n\t}",
"public function boot(Application $app)\n {\n // boot\n }",
"public function register(CApplication $app)\n\t{\n\t\tparent::register($app);\n\n\t\t$app['security.user_provider.admin'] = $app->share(function() use ($app) {\n\t\t\treturn new PlatformUserProvider($app->getServiceUsers(), $app->getServiceUsersAuth());\n\t\t});\n\n\t\t$app['security.user_provider.public'] = $app->share(function() use ($app) {\n\t\t\treturn $app['security.user_provider.admin'];\n\t\t});\n\n\t\t$app['security.encoder_factory'] = $app->share(function() use ($app) {\n\t\t\treturn new EncoderFactory(array(\n\t\t\t\t'Symfony\\Component\\Security\\Core\\User\\UserInterface' => new Pbkdf2PasswordEncoder(),\n\t\t\t));\n\t\t});\n\n\t\t$app['security.authentication.success_handler.admin'] =\n\t\t\t$app->share(function() use ($app) {\n\t\t\t\treturn new UserAuthenticationSuccessHandler($app['security.http_utils'], [], $app);\n\t\t\t}\n\t\t);\n\n\t\t$app['security.authentication.failure_handler.admin'] =\n\t\t\t$app->share(function() use ($app) {\n\t\t\t\treturn new UserAuthenticationFailureHandler($app['kernel'], $app['security.http_utils'], [\n\t\t\t\t\t\t'failure_path' => '/login.html',\n\t\t\t\t], $app);\n\t\t\t}\n\t\t);\n\n\t\t/** @var callable $logoutProto */\n\t\t$logoutProto = $app['security.authentication_listener.logout._proto'];\n\t\t$app['security.authentication_listener.logout._proto'] = $app->protect(function($name, $options) use ($app, $logoutProto) {\n\t\t\treturn $app->share(function() use ($app, $name, $options, $logoutProto) {\n\t\t\t\t$prototype = $logoutProto($name, $options);\n\t\t\t\t/** @var LogoutListener $listener */\n\t\t\t\t$listener = $prototype($app);\n\t\t\t\t$listener->addHandler(new UserLogoutHandler());\n\t\t\t\treturn $listener;\n\t\t\t});\n\t\t});\n\n\t\t// Security voters.\n\t\t$app['security.voters.entity_erase'] = $app->share(function($app) {\n\t\t\treturn new EntityEraseVoter($app);\n\t\t});\n\n\t\t$app['security.voters'] = $app->extend('security.voters', function($voters) use ($app) {\n\t\t\tarray_unshift($voters, $app['security.voters.entity_erase']);\n\n\t\t\treturn $voters;\n\t\t});\n\t}",
"public function register()\n {\n foreach ($this->bindings as $abstract => $concrete) {\n $this->app->bind($abstract, $concrete);\n }\n }",
"public function register(): void\n {\n $this->app->bind(ValidatorServiceInterface::class, ValidatorService::class);\n }",
"public function register()\n\t{\n\t\tapp()->bind(UtilityServiceInterface::class, UtilityService::class);\n\t}",
"public function register()\n {\n // merge in df config, https://laravel.com/docs/5.4/packages#resources\n $configPath = __DIR__ . '/../config/config.php';\n $this->mergeConfigFrom($configPath, 'df');\n\n // Add our service types.\n $this->app->resolving('df.service', function (ServiceManager $df){\n $df->addType(\n new ServiceType([\n 'name' => 'local_file',\n 'label' => 'Local File Storage',\n 'description' => 'File service supporting the local file system.',\n 'group' => ServiceTypeGroups::FILE,\n 'config_handler' => LocalFileConfig::class,\n 'factory' => function ($config){\n return new LocalFileService($config);\n },\n ])\n );\n\n $df->addType(\n new ServiceType([\n 'name' => 'ftp_file',\n 'label' => 'FTP File Storage',\n 'description' => 'File service supporting the FTP protocol.',\n 'group' => ServiceTypeGroups::FILE,\n 'config_handler' => FTPFileConfig::class,\n 'factory' => function ($config){\n return new FTPFileService($config);\n },\n ])\n );\n\n $df->addType(\n new ServiceType([\n 'name' => 'sftp_file',\n 'label' => 'SFTP File Storage',\n 'description' => 'File service supporting the SFTP protocol.',\n 'group' => ServiceTypeGroups::FILE,\n 'config_handler' => SFTPFileConfig::class,\n 'factory' => function ($config){\n return new SFTPFileService($config);\n },\n ])\n );\n\n $df->addType(\n new ServiceType([\n 'name' => 'webdav_file',\n 'label' => 'WebDAV File Storage',\n 'description' => 'File service supporting WebDAV.',\n 'group' => ServiceTypeGroups::FILE,\n 'config_handler' => WebDAVFileConfig::class,\n 'factory' => function ($config){\n return new WebDAVFileService($config);\n },\n ])\n );\n });\n }",
"public function register()\n {\n $configPath = __DIR__ . '/../config/config.php';\n $this->mergeConfigFrom($configPath, 'shopify');\n $this->app->singleton('shopify', function($app) {\n\n if (isset($app['config']['services']['shopify'])) {\n\n $config = array_filter($app['config']['services']['shopify']);\n\n return new \\Shopify\\Client($config);\n\n } else return new \\Shopify\\Client();\n\n });\n\n $app = $this->app;\n }",
"public function register(Container $app)\n {\n $app['doctrine.dm'] = DocumentManager::create(\n $this->getConnection($app['doctrine.connection']),\n $this->getConfiguration($app['doctrine.configuration'])\n );\n }",
"public function startup($app)\n {\n $this->log = $app->logger;\n $this->db = $app->db;\n $this->guard = $app->guard_model;\n }",
"public function register(): void\n {\n // Bind eloquent models to IoC container\n $this->app->singleton('cortex.bookings.service', $serviceModel = $this->app['config']['cortex.bookings.models.service']);\n $serviceModel === Service::class || $this->app->alias('cortex.bookings.service', Service::class);\n\n $this->app->singleton('cortex.bookings.service_availability', $serviceAvailabilityModel = $this->app['config']['cortex.bookings.models.service_availability']);\n $serviceAvailabilityModel === ServiceAvailability::class || $this->app->alias('cortex.bookings.service_availability', ServiceAvailability::class);\n\n $this->app->singleton('cortex.bookings.service_booking', $serviceBookingModel = $this->app['config']['cortex.bookings.models.service_booking']);\n $serviceBookingModel === ServiceBooking::class || $this->app->alias('cortex.bookings.service_booking', ServiceBooking::class);\n\n $this->app->singleton('cortex.bookings.service_rate', $serviceRateModel = $this->app['config']['cortex.bookings.models.service_rate']);\n $serviceRateModel === ServiceRate::class || $this->app->alias('cortex.bookings.service_rate', ServiceRate::class);\n\n $this->app->singleton('cortex.bookings.event', $serviceAvailabilityModel = $this->app['config']['cortex.bookings.models.event']);\n $serviceAvailabilityModel === Event::class || $this->app->alias('cortex.bookings.event', Event::class);\n\n $this->app->singleton('cortex.bookings.event_ticket', $eventTicketModel = $this->app['config']['cortex.bookings.models.event_ticket']);\n $eventTicketModel === EventTicket::class || $this->app->alias('cortex.bookings.event_ticket', EventTicket::class);\n\n $this->app->singleton('cortex.bookings.event_booking', $eventBookingModel = $this->app['config']['cortex.bookings.models.event_booking']);\n $eventBookingModel === EventBooking::class || $this->app->alias('cortex.bookings.event_booking', EventBooking::class);\n\n // Register console commands\n $this->registerCommands($this->commands);\n\n // Bind eloquent models to IoC container\n $this->app->singleton('cortex.bookings.service', $serviceModel = $this->app['config']['cortex.bookings.models.service']);\n $serviceModel === Service::class || $this->app->alias('cortex.bookings.service', Service::class);\n\n $this->app->singleton('cortex.bookings.event', $eventModel = $this->app['config']['cortex.bookings.models.event']);\n $eventModel === Event::class || $this->app->alias('cortex.bookings.event', Event::class);\n }",
"public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/services.php', 'services');\n\n $this->app->singleton(Client::class, function ($app) {\n return new Client(\n $this->buildGuzzleClient(),\n Environment::from($app->make('config')->get('services.viva.environment')),\n merchantId: strval($app->make('config')->get('services.viva.merchant_id')),\n apiKey: strval($app->make('config')->get('services.viva.api_key')),\n clientId: strval($app->make('config')->get('services.viva.client_id')),\n clientSecret: strval($app->make('config')->get('services.viva.client_secret')),\n );\n });\n\n $this->app->bind(Services\\OAuth::class, function ($app) {\n return new Services\\OAuth(\n client: $app->make(Client::class),\n clientId: strval($app->make('config')->get('services.viva.client_id')),\n clientSecret: strval($app->make('config')->get('services.viva.client_secret')),\n );\n });\n }",
"public function register()\n {\n // register routes\n $this->registerConfigurations();\n\n // https://github.com/laravolt/indonesia\n $this->app->bind('linebot', function() {\n return new LineBotManager(\"ko\");\n });\n \n // $this->app->bind('linebot', function($app){\n \n // $config = $this->app['config']->get('services.linebot', []);\n // // dd($config);\n // $client = new Client(Arr::get($config, 'guzzle', []));\n \n // return new LineBotManager(\"Kiw\");\n // });\n }",
"public function register()\n {\n // Mrcore Module Tracking\n Module::trace(get_class(), __function__);\n\n // Register facades\n #class_alias('Mrcore\\Parser\\Facades\\Parser', 'Parser');\n\n // Register configs\n $this->registerConfigs();\n\n // Register IoC bind aliases\n #$this->app->alias(Mrcore\\Parser\\Parser::class, Mrcore\\Parser::class)\n\n // Register other service providers\n #$this->app->register(Mrcore\\Parser\\Providers\\OtherServiceProvider::class);\n\n // Register artisan commands\n $this->registerCommands();\n\n // Register testing environment\n $this->registerTestingEnvironment();\n }",
"public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/app.php', 'app'\n );\n $this->registerOtherProviders();\n }",
"public function registerServices(DiInterface $di): void\n {\n $di->getShared('config')->merge(new Config(require_once self::PATH . \"/config/config.php\"));\n\n require_once self::PATH . \"/config/services.php\";\n }"
] | [
"0.7093729",
"0.6959216",
"0.6948521",
"0.68954635",
"0.686848",
"0.679123",
"0.6783036",
"0.6747346",
"0.67230237",
"0.6703542",
"0.6648266",
"0.6615571",
"0.65958136",
"0.6593183",
"0.6561424",
"0.6540766",
"0.65216947",
"0.6500588",
"0.6488714",
"0.648653",
"0.6480464",
"0.6464549",
"0.6449012",
"0.6447616",
"0.64347595",
"0.6424169",
"0.6420295",
"0.6417999",
"0.6400597",
"0.6395997",
"0.63938206",
"0.63911396",
"0.63845646",
"0.635878",
"0.6354047",
"0.63485044",
"0.6299119",
"0.62938815",
"0.62936646",
"0.6279787",
"0.6269506",
"0.626638",
"0.62581706",
"0.62575525",
"0.6250639",
"0.62433064",
"0.62316257",
"0.6227442",
"0.6221022",
"0.62084436",
"0.61865103",
"0.61764365",
"0.6175443",
"0.61727923",
"0.61445624",
"0.614195",
"0.6136687",
"0.6132349",
"0.61322206",
"0.61225",
"0.611569",
"0.6084474",
"0.6071014",
"0.6065116",
"0.604894",
"0.60417014",
"0.60363597",
"0.6017972",
"0.59920424",
"0.5985775",
"0.5984772",
"0.5968757",
"0.5943815",
"0.59372944",
"0.5917669",
"0.59056395",
"0.58955336",
"0.58911544",
"0.5888143",
"0.58770555",
"0.58743286",
"0.58715737",
"0.5866905",
"0.58662534",
"0.5863033",
"0.5842179",
"0.5840305",
"0.58397055",
"0.583733",
"0.5833315",
"0.58277124",
"0.58231515",
"0.5819801",
"0.57960254",
"0.5792007",
"0.57910144",
"0.5785312",
"0.57785714",
"0.57716554",
"0.5764642"
] | 0.62920517 | 39 |
Bootstraps the application. This method is called after all services are registered and should be used for "dynamic" configuration (whenever a service must be requested). | public function boot(Application $app)
{
// TODO: Implement boot() method.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }",
"public function boot()\n {\n $this->setupConfig($this->app);\n }",
"public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setupConfig();\n }",
"public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }",
"public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }",
"public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }",
"public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }",
"public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }",
"public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }",
"public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }",
"public function boot()\n {\n // Boot here application\n }",
"public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }",
"public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }",
"public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }",
"public function boot()\n {\n $this->setUpConfig();\n }",
"public function boot()\n {\n $this->setUpConfig();\n }",
"public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }",
"public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }",
"public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }",
"public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }",
"public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }",
"public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }",
"public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }",
"public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }",
"public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }",
"public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }",
"public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }",
"public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }",
"public function boot()\n {\n $this->configuration();\n $this->assets();\n $this->fonts();\n $this->views();\n }",
"public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }",
"public function boot()\n {\n $this->configurePublishing();\n $this->configureRoutes();\n }",
"public function boot()\n {\n $this->setupConfigs();\n $this->setupFacades();\n $this->setupMigrations();\n $this->setupViews();\n $this->setupRoutes();\n }",
"public function boot(): void\n {\n $this->publishAndLoadPackageComponents();\n\n $this->registerAndScheduleCommands();\n\n $this->setPaginatorStyling();\n }",
"public function boot()\n {\n $srcPath = realpath(__DIR__ . '/../');\n\n // publish the config file and assets\n $this->publishes([\n $srcPath . '/config' => config_path('pcmn'),\n $srcPath . '/Assets/' => public_path('vendor/pcmn'),\n ], 'public');\n\n // load the routes\n $this->loadRoutesFrom($srcPath . '/routes.php');\n\n // load the migrations\n $this->loadMigrationsFrom($srcPath . '/Migrations');\n\n // load views\n $this->loadViewsFrom($srcPath . '/Views', 'pcmn');\n\n // load translations\n $this->loadTranslationsFrom($srcPath . '/Translations', 'pcmn');\n\n // load commands\n if ($this->app->runningInConsole()) {\n $this->commands([\n TableConfig::class,\n ]);\n }\n\n // create a table config repository instance\n $this->app->singleton(TableConfigRepository::class, function ($app) {\n return new TableConfigRepository();\n });\n }",
"public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }",
"public function boot()\n {\n $this->bootPackages();\n }",
"public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }",
"public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }",
"public function boot()\n {\n $this->handleConfig();\n }",
"public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }",
"public function boot()\n {\n $this->publishConfiguration();\n }",
"public static function boot(): void\n {\n if (defined('CONFIG_DIR') && file_exists(CONFIG_DIR . '/beanstalk.php')) {\n self::$beanstalk_config = require CONFIG_DIR . '/beanstalk.php';\n }\n }",
"public function boot()\n {\n $this->setupConfig();\n $this->setupMigrations();\n }",
"public function boot()\n {\n $this->setupConfig();\n\n // Get caching\n AbstractRepository::setCacheInstance($this->royalcms['cache']);\n }",
"public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }",
"public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }",
"public static function boot() {\n\t\tstatic::container()->boot();\n\t}",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }",
"public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }",
"public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}",
"public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }",
"public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }",
"public function boot()\r\n\t{\r\n\t\t$this->package('bkwld/croppa');\r\n\r\n\t\t// Pass along the Config data so Croppa is decoupled from Laravel\r\n\t\tCroppa::config(array_merge(Config::get('croppa::config'), array(\r\n\t\t\t'host' => Request::root(),\r\n\t\t)));\r\n\r\n\t\t// Subscribe to 404 events, these are how Croppa gets triggered\r\n\t\tApp::missing(function($e) {\r\n\r\n\t\t\t// Increase memory limit, cause some images require a lot\r\n\t\t\t// too resize\r\n\t\t\tini_set('memory_limit', '128M');\r\n\t\t\t\r\n\t\t\t// Pass Croppa the current URL\r\n\t\t\tCroppa::handle_404(Request::path());\r\n\t\t});\r\n\t\t\r\n\t\t// Make it possible to access outside of namespace\r\n\t\tclass_alias('Bkwld\\Croppa\\Croppa', 'Croppa');\r\n\t}",
"public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }",
"public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }",
"public function boot()\n {\n // Publish the Configuration File\n $this->publishConfigurationFile();\n }",
"public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }",
"public function boot()\n {\n $this->setupConfig();\n\n $this->registerCommands();\n\n $this->setupParse();\n }",
"public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }",
"public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n TabManager::register('users', UserTabs::class);\n TabManager::register('roles', RoleTabs::class);\n TabManager::register('profile', ProfileTabs::class);\n\n View::composer('*', CurrentUserComposer::class);\n View::composer('user::admin.auth.layout', AssetsComposer::class);\n\n $this->addAdminAssets('admin.(login|reset).*', ['admin.login.css', 'admin.login.js']);\n $this->addAdminAssets('admin.(users|roles).(create|edit)', ['admin.user.css', 'admin.user.js']);\n\n $this->registerSentinelGuard();\n $this->registerBladeDirectives();\n }",
"public function boot(): void\n {\n $this->loadMiddlewares();\n }",
"public function boot()\n {\n if ($this->app->runningInConsole()){\n // publish config\n $this->publishes([\n __DIR__.\"/../../config/modulity.php\" => config_path(\"modulity.php\")\n ], \"modulity-config\");\n\n // commands integration\n $this->commands([\n StructureGeneratorCommand::class,\n ServiceGeneratorCommand::class,\n RepositoryGeneratorCommand::class,\n ControllerGeneratorCommand::class,\n ProviderGeneratorCommand::class,\n ]);\n }\n }",
"public function boot()\n {\n $this->addConfig();\n $this->loadMigration();\n }",
"public function boot()\n {\n $this->loadFilters();\n $this->loadRoutes();\n $this->loadHelpers();\n $this->loadCommands();\n }",
"public function boot()\n {\n include __DIR__ . '/routes.php';\n $sourceMigration = realpath(__DIR__ . '/../migrations');\n $configPath = realpath(__DIR__ . '/Config/cloud.php');\n $this->loadMigrationsFrom($sourceMigration);\n $this->mergeConfigFrom($configPath, 'cloud');\n }",
"public static function boot()\n {\n Session::start();\n\n Env::load();\n \n require_once __DIR__ . '/../../app/Routes/routes.php';\n\n require_once __DIR__ . '/globals.php';\n\n Request::setCurrent();\n\n Router::run();\n }",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }",
"public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }",
"public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }",
"public function boot() {\n\n\t\t$this->register_cli_commands();\n\n\t\t$this->register_routes();\n\n\t\t$this->apply_sitemap_optimisations();\n\n\t}",
"public function boot()\n {\n $this->publishConfig();\n }",
"public function boot()\n {\n $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'push-notification-devices');\n $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'push-notification-devices');\n\n $this->loadMigrationsFrom(module_path('push-notification-devices', 'Database/Migrations', 'app'));\n if (!$this->app->configurationIsCached()) {\n $this->loadConfigsFrom(module_path('push-notification-devices', 'Config', 'app'));\n }\n }",
"public function boot()\n {\n\n $source = realpath(dirname(__DIR__).'/config/xunsearch.php');\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('xunsearch.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('xunsearch');\n }\n $this->mergeConfigFrom($source, 'xunsearch');\n\n }",
"public function boot()\r\n\t{\r\n\t\t$this->package('bkwld/croppa');\r\n\r\n\t\t// Pass along the Config data so Croppa is decoupled from Laravel\r\n\t\tCroppa::config(array_merge($this->app->make('config')->get('croppa::config'), array(\r\n\t\t\t'host' => $this->app->make('request')->root(),\r\n\t\t)));\r\n\r\n\t\t// Listen for Cropa style URls, these are how Croppa gets triggered\r\n\t\t$this->app->make('router')->get('{path}', function($path) {\r\n\t\t\tCroppa::generate($path);\r\n\t\t})->where('path', Croppa::PATTERN);\r\n\t\t\r\n\t\t// Make it possible to access outside of namespace\r\n\t\tclass_alias('Bkwld\\Croppa\\Croppa', 'Croppa');\r\n\t}",
"public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->app->register(AdminServiceProvider::class);\n }\n\n if (! $this->app->configurationIsCached()) {\n $this->mergeConfigFrom(\n AdminServiceProvider::getPackagePath() . 'config/config.php',\n AdminServiceProvider::getPackageAlias()\n );\n }\n\n $this->app->make(HttpKernel::class)->pushMiddleware(ServeAdmin::class);\n }",
"public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}",
"public function boot()\n {\n $this->makeRepositories();\n }",
"public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }",
"public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }",
"public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }",
"public function boot()\n {\n $this->setupMigrations();\n\n $this->setupCommands();\n\n $this->setupResources();\n }",
"public function boot()\n {\n $ds = DIRECTORY_SEPARATOR;\n // For each of the registered modules, include their routes and Views\n $modules = config(\"module.modules\");\n\n /**\n * We are moving out of explode and moving it to app path\n */\n $modulePath = $this->app->path.$ds.'Modules';\n\n foreach ($modules as $module) {\n\n // Load the routes for each of the modules\n if (file_exists($modulePath.$ds.$module.$ds.'routes.php')) {\n include $modulePath.$ds.$module.$ds.'routes.php';\n }\n\n // Load the views\n if (is_dir($modulePath.$ds.$module.$ds.'Views')) {\n $this->loadViewsFrom($modulePath.$ds.$module.$ds.'Views', $module);\n }\n }\n }",
"public function boot()\n {\n $this->loadConfig();\n\n parent::boot();\n }",
"public function boot()\n {\n $this->app->get('modulizer')->bootstrapFileLoaders();\n\n $this->loadMigrationsFrom($this->app->get(ModulizerRepository::class)->migrations);\n\n $this->loadTranslations(\n collect($this->app->get(ModulizerRepository::class)->translations)\n );\n\n $this->publishes([\n $this->getDefaultConfigFilePath('modulizer') => config_path('modulizer.php'),\n ], 'config');\n\n $this->loadCommands();\n }",
"public function boot()\n {\n // Bootstrap handles\n //$this->routeHandle();\n $this->configHandle();\n $this->langHandle();\n $this->viewHandle();\n $this->assetHandle();\n $this->migrationHandle();\n $this->pulishControllerStub();\n $this->pulishRouteStub();\n \n }",
"public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }",
"protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}",
"public function boot()\n {\n $this->publishConfig(self::BASE_CONFIG_PATH);\n }",
"public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }"
] | [
"0.75502616",
"0.75494164",
"0.73749775",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7329851",
"0.730737",
"0.7304671",
"0.72920865",
"0.7271831",
"0.72522545",
"0.72344595",
"0.72166127",
"0.7215375",
"0.72151613",
"0.7213821",
"0.7203723",
"0.71874213",
"0.71874213",
"0.7166925",
"0.7166489",
"0.7141357",
"0.71340334",
"0.712525",
"0.7124948",
"0.71247274",
"0.7121473",
"0.7117953",
"0.71170014",
"0.71018684",
"0.7100356",
"0.70953506",
"0.7090604",
"0.70865494",
"0.70856357",
"0.7084924",
"0.70812106",
"0.70809644",
"0.7076897",
"0.70699203",
"0.70571625",
"0.7050408",
"0.7043486",
"0.70324284",
"0.70322025",
"0.701809",
"0.69859093",
"0.69777215",
"0.6977223",
"0.69737697",
"0.6968757",
"0.69675046",
"0.6962649",
"0.696022",
"0.695647",
"0.69525373",
"0.6951036",
"0.6948531",
"0.69466966",
"0.69425815",
"0.6937455",
"0.6936064",
"0.6930152",
"0.69276994",
"0.69222176",
"0.69130677",
"0.6913006",
"0.6910517",
"0.6910368",
"0.69076777",
"0.6904752",
"0.6903014",
"0.6897652",
"0.68971604",
"0.6895864",
"0.6895834",
"0.6892186",
"0.6889492",
"0.6888973",
"0.68888766",
"0.6888234",
"0.6888015",
"0.6885714",
"0.6884558",
"0.688445",
"0.6883797",
"0.6871901",
"0.6870823",
"0.686944",
"0.68681914",
"0.6865377",
"0.6862359",
"0.6856654",
"0.6854413",
"0.68505394"
] | 0.0 | -1 |
Seed the application's database. | public function run()
{
$usuario1 = new User(
[
'rut_usuario' => '19105288',
'nombre_usuario' => 'SILVA ESTEFANIA',
'domicilio_usuario' => 'Calle #1234',
'fecha_nac' => '1994-10-14',
'email' => '[email protected]',
'password' => bcrypt('admin'),
'tipo_usuario' => 'admin',
'alias' => 'FANNY',
'telefono' => '123456789',
]
);
$usuario1->save();
$usuario2 = new User(
[
'rut_usuario' => '17878649',
'nombre_usuario' => 'Luis Muñoz',
'domicilio_usuario' => 'Calle #1235',
'fecha_nac' => '1994-10-14',
'email' => '[email protected]',
'password' => bcrypt('secretaria'),
'tipo_usuario' => 'secretaria',
'alias' => 'PIPE',
'telefono' => '123456787',
]
);
$usuario2->save();
$secretaria = new Perfil_Secretaria(
[
'fecha_contratacion' => '2010-05-08',
]
);
$usuario2->Perfil_Secretaria()->save($secretaria);
$usuario3 = new User(
[
'rut_usuario' => '18454642',
'nombre_usuario' => 'Andrea Molina',
'domicilio_usuario' => 'Calle #1214',
'fecha_nac' => '1994-10-14',
'email' => '[email protected]',
'password' => bcrypt('cliente'),
'tipo_usuario' => 'cliente',
'alias' => 'ANDY',
'telefono' => '123456788',
]
);
$usuario3->save();
$cliente = new Perfil_Cliente(
[
'reputacion_cliente' => 0,
'estado_cliente' => 'Activo',
'tipo_cliente' => 'basico',
]
);
$usuario3->Perfil_cliente()->save($cliente);
$debito = new MetodoPago(
[
'tipo_pago' => 'Visa Débito',
'banco' => 'Estado',
'tipo_cuenta' => 'Vista',
'cantidad_cuota' => '12',
]
);
$debito->save();
$credito = new MetodoPago(
[
'tipo_pago' => 'Visa Crédito',
'banco' => 'Estado',
'tipo_cuenta' => 'Linea de crédito',
'cantidad_cuota' => '12',
]
);
$credito->save();
$falabella = new MetodoPago(
[
'tipo_pago' => 'Tarjeta Falabella',
'banco' => 'Estado',
'tipo_cuenta' => 'Visa',
'cantidad_cuota' => '6',
]
);
$falabella->save();
$ripley = new MetodoPago(
[
'tipo_pago' => 'Tarjeta Ripley',
'banco' => 'Estado',
'tipo_cuenta' => 'Visa',
'cantidad_cuota' => '3',
]
);
$ripley->save();
$servicio = new Servicio(
[
'nombre_servicio' => 'Arriendo Juegos Inflables',
'descripcion_servicio' => 'Se arriendan juegos para fiestas de cumpleaños para niños',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-03-19',
'fecha_finalizacion_se' => '2017-04-28',
'tags_servicio' => '#cumpleaños',
'tipo_pago' => 'Tarjeta',
'precio_servicio' => 150000,
'visitas' => 150,
'creador' => 'Andrea Molina',
'ubicacion' => 'cuarta region ',
]
);
//Usuario crea serv
$usuario2->Servicios()->save($servicio);
$servicio->MetodoPago()->save($debito);
$categoria = new Categoria(
[
'nombre_categoria' => 'Infantil',
'descripcion_categoria' => 'Servicio de entrentención',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 1,
'edad_recomendada' => 5,
]
);
$categoria->save();
$categoria->Servicio()->save($servicio);
$ubicacion = new Ubicacion(
[
'calle' => '2 oriente',
'numero_casa' => '196',
]
);
//hasMany guarda a belongsToMany
$servicio->Ubicacion()->save($ubicacion);
$usuario4 = new User(
[
'rut_usuario' => '16457079',
'nombre_usuario' => 'Tamara Molina',
'domicilio_usuario' => 'Calle #1214',
'fecha_nac' => '1994-10-14',
'email' => '[email protected]',
'password' => bcrypt('cliente2'),
'tipo_usuario' => 'cliente',
'alias' => 'TAMARA',
'telefono' => '123456088',
]
);
$usuario4->save();
$cliente = new Perfil_Cliente(
[
'reputacion_cliente' => 0,
'estado_cliente' => 'Activo',
'tipo_cliente' => 'basico',
]
);
$usuario4->Perfil_cliente()->save($cliente);
//Usuario Contrata servicio
$usuario3->ServiciosContratados()->save($servicio,
['fecha_contratacion' => '2010-05-01',
'fecha_fin_contratacion' => '2010-06-05',
'descuento_tipo_cliente' => '10%',
'tipo_pago' => 'credito',
'numero_tarjeta' => 90000,
'numero_cuota' => 3,
'valor_cuota' =>2000
]
);
$educacion = new Categoria(//1
[
'nombre_categoria' => 'Educacion',
'descripcion_categoria' => 'servicios relacionados a la educacion',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 1,
'edad_recomendada' => 0
]
);
$educacion->save();
$electro = new Categoria(//2
[
'nombre_categoria' => 'Electro',
'descripcion_categoria' => 'servicios relacionados a equipos electronicos',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 1,
'edad_recomendada' => 12
]
);
$electro->save();
$salud = new Categoria(//3
[
'nombre_categoria' => 'Salud',
'descripcion_categoria' => 'servicios relacionados con el area salud',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 1,
'edad_recomendada' => 18
]
);
$salud->save();
$automoviles = new Categoria(//4
[
'nombre_categoria' => 'Automoviles',
'descripcion_categoria' => 'servicios relacionados a vehiculos motorizados',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 1,
'edad_recomendada' => 0
]
);
$automoviles->save();
$cumple = new Categoria(//5
[
'nombre_categoria' => 'Cumpleaños',
'descripcion_categoria' => 'servicios relacionados a fiestas de cumpleaños',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 1,
'edad_recomendada' => 1
]
);
$cumple->save();
$jardin = new Categoria(//6
[
'nombre_categoria' => 'Jardin',
'descripcion_categoria' => 'servicios relacionados con jardineria',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 2,
'edad_recomendada' => 14
]
);
$jardin->save();
$deporte = new Categoria(//7
[
'nombre_categoria' => 'Deporte',
'descripcion_categoria' => 'servicios relacionados con deportes o actividad fisica',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 2,
'edad_recomendada' => 8
]
);
$deporte->save();
$hogar = new Categoria(//8
[
'nombre_categoria' => 'Hogar',
'descripcion_categoria' => 'servicios relacionados a hogar',
'estado_categoria' => 'Activo',
'cantidad_publicaciones' => 1,
'edad_recomendada' => 18
]
);
$hogar->save();
$servicio = new Servicio(
[
'nombre_servicio' => 'Mecanico a domicilio',
'descripcion_servicio' => 'Se reparan automoviles y motocicletas a domicilio , rapido y facil',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-03-21',
'fecha_finalizacion_se' => '2017-04-29',
'tags_servicio' => '#automoviles',
'precio_servicio' => 21000,
'tipo_pago' => 'Visa Débito',
'visitas' => 50,
'creador' => '24',
'ubicacion' => 'septima region',
'me_gusta' => 0,
'no_me_gusta' => 0,
]
);
$usuario2->Servicios()->save($servicio);
$servicio->MetodoPago()->save($debito);
$automoviles->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Medico a domicilio',
'descripcion_servicio' => 'Medico ofrece sus servicios de consulta a domicilio dentro de talca',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-03-21',
'fecha_finalizacion_se' => '2017-12-30',
'tags_servicio' => '#salud',
'precio_servicio' => 45000,
'tipo_pago' => 'Visa Crédito',
'visitas' => 500,
'creador' => '24',
'ubicacion' => 'cuarta region',
'me_gusta' => 0,
'no_me_gusta' => 0,
]
);
$usuario2->Servicios()->save($servicio);
$servicio->MetodoPago()->save($credito);
$salud->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Reparacion de equipos electronicos',
'descripcion_servicio' => 'Se reparan celulares y computadores marca samsung',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-10-15',
'fecha_finalizacion_se' => '2017-12-21',
'tags_servicio' => '#electro',
'precio_servicio' => 15000,
'tipo_pago' => 'Tarjeta Falabella',
'visitas' => 23,
'creador' => '24',
'ubicacion' => 'octava region',
'me_gusta' => 0,
'no_me_gusta' => 0,
]
);
$usuario2->Servicios()->save($servicio);
$servicio->MetodoPago()->save($falabella);
$electro->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Profesor de matematicas',
'descripcion_servicio' => 'Servicio de tutor de matematicas de 2do a 8vo basico',
'estado' => 'inactivo',
'fecha_publicacion_se' => '2017-03-28',
'fecha_finalizacion_se' => '2017-12-28',
'tags_servicio' => '#educacion',
'precio_servicio' => 15000,
'tipo_pago' => 'Visa Crédito',
'visitas' => 75,
'creador' => '24',
'ubicacion' => 'valparaiso',
'me_gusta' => 0,
'no_me_gusta' => 0,
]
);
$usuario3->Servicios()->save($servicio);
$servicio->MetodoPago()->save($credito);
$educacion->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Entrenador de tenis',
'descripcion_servicio' => 'Entrenamientos personalizados cada semana',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-04-28',
'fecha_finalizacion_se' => '2017-12-18',
'tags_servicio' => '#deporte',
'precio_servicio' => 15500,
'tipo_pago' => 'Tarjeta Ripley',
'visitas' => 15,
'creador' => '24',
'ubicacion' => 'chile',
'me_gusta' => 0,
'no_me_gusta' => 0,
]
);
$usuario3->Servicios()->save($servicio);
$servicio->MetodoPago()->save($ripley);
$deporte->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Limpieza de piscinas',
'descripcion_servicio' => 'Servicio de Limpieza de piscinas fines de semana',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-03-27',
'fecha_finalizacion_se' => '2017-12-31',
'tags_servicio' => '#jardin',
'tipo_pago' => 'Visa Débito',
'precio_servicio' => 10000,
'visitas' => 75,
'creador' => '24',
'ubicacion' => 'punta arenas',
'me_gusta' => 6,
'no_me_gusta' => 200,
]
);
$usuario4->Servicios()->save($servicio);
$servicio->MetodoPago()->save($debito);
$jardin->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Jardineria',
'descripcion_servicio' => 'Se ofrece servicio de jardineria para fines de semana',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-01-28',
'fecha_finalizacion_se' => '2017-2-28',
'tags_servicio' => '#jardin',
'tipo_pago' => 'Tarjeta Falabella',
'precio_servicio' => 15000,
'visitas' => 5,
'creador' => '24',
'ubicacion' => 'canada',
'me_gusta' => 0,
'no_me_gusta' => 0,
]
);
$usuario4->Servicios()->save($servicio);
$servicio->MetodoPago()->save($falabella);
$jardin->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Decoracion interiores',
'descripcion_servicio' => 'Diseñardora de ambientes ofrece servicios para decorar',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-01-28',
'fecha_finalizacion_se' => '2017-02-28',
'tags_servicio' => '#hogar',
'precio_servicio' => 150000,
'tipo_pago' => 'Tarjeta Falabella',
'visitas' => 5,
'creador' => '24',
'ubicacion' => 'talca',
'me_gusta' => 30,
'no_me_gusta' => 0,
]
);
$usuario3->Servicios()->save($servicio);
$servicio->MetodoPago()->save($falabella);
$hogar->Servicio()->save($servicio);
$servicio = new Servicio(
[
'nombre_servicio' => 'Entrenador Personal',
'descripcion_servicio' => 'Se ofrece servicio de Entrenador personal miercoles y viernes',
'estado' => 'activo',
'fecha_publicacion_se' => '2017-01-28',
'fecha_finalizacion_se' => '2017-02-28',
'tags_servicio' => '#deporte',
'precio_servicio' => 120000,
'tipo_pago' => 'Visa Débito',
'visitas' => 5,
'creador' => '24',
'ubicacion' => 'linares',
'me_gusta' => 0,
'no_me_gusta' => 0,
]
);
$usuario3->Servicios()->save($servicio);
$servicio->MetodoPago()->save($debito);
$deporte->Servicio()->save($servicio);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}",
"protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }",
"protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }",
"public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }",
"public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }",
"public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }",
"protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }",
"protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }",
"public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }",
"public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }",
"public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }",
"public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}",
"public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }",
"public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }",
"public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }",
"protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }",
"public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }",
"public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}",
"public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }",
"public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }",
"public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }",
"public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }",
"public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }",
"public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }",
"public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }",
"public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }",
"public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }",
"public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }",
"public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\n });*/\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }",
"public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }",
"public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }",
"public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }",
"public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }",
"public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }",
"public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }",
"public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }",
"public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }",
"public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\n });\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }",
"public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }",
"public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }",
"public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }",
"public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }",
"public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }",
"public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }"
] | [
"0.8064933",
"0.7848158",
"0.7674873",
"0.724396",
"0.7216743",
"0.7132209",
"0.70970356",
"0.70752203",
"0.704928",
"0.699208",
"0.6987078",
"0.69839287",
"0.6966499",
"0.68990964",
"0.6868679",
"0.68468624",
"0.68307716",
"0.68206114",
"0.6803113",
"0.6803113",
"0.6801801",
"0.6789746",
"0.6788733",
"0.6788008",
"0.6786291",
"0.67765796",
"0.67742485",
"0.677106",
"0.67651874",
"0.6761959",
"0.675823",
"0.67337847",
"0.6733437",
"0.67295784",
"0.67290515",
"0.6724652",
"0.67226326",
"0.6722267",
"0.6721339",
"0.6715842",
"0.67070943",
"0.67060536",
"0.67031103",
"0.6702514",
"0.6702361",
"0.67017967",
"0.6695973",
"0.6693496",
"0.66868156",
"0.66837406",
"0.6678434",
"0.66755766",
"0.66726524",
"0.666599",
"0.664943",
"0.6640641",
"0.663921",
"0.66387916",
"0.6636016",
"0.6633116",
"0.6629787",
"0.6627134",
"0.6625862",
"0.661699",
"0.66093796",
"0.6602538",
"0.65996546",
"0.659914",
"0.6596484",
"0.6596383",
"0.65922767",
"0.65922284",
"0.65913564",
"0.65889347",
"0.65812707",
"0.65811145",
"0.6579546",
"0.6578819",
"0.6575912",
"0.65749073",
"0.6574314",
"0.657148",
"0.65696406",
"0.6568972",
"0.65624833",
"0.6560332",
"0.6559092",
"0.6557491",
"0.65555155",
"0.6554255",
"0.65509576",
"0.6548099",
"0.65479296",
"0.6545845",
"0.65443295",
"0.65434265",
"0.65432936",
"0.654295",
"0.65426385",
"0.6541781",
"0.6539325"
] | 0.0 | -1 |
Get a validator for an incoming registration request. | public function register(Request $data)
{
$client = new Client();
$client2 = new Client();
try{
$res = $client->request('POST', 'http://127.0.0.1:8000/api/register', [
'form_params' => [
'name' => $data->name,
'email' => $data->email,
'password' => $data->password,
'password_confirmation' => $data->password_confirmation,
]]);
$response = json_decode($res->getBody());
Log::info($res->getBody());
// Company assignment crashed in the last day and couldn't fix it
// $compres= $client->request('POST', 'http://127.0.0.1:8000/api/companies', [
// 'headers' => ['api_token' => 'VyQayHiGQIazlxaPPFcKgk1b2KDrVU9dVRAOETmlO9LD4euueAibqJ5LSbjY'],
// 'form_params' => [
// 'address' => $data->address,
// 'companyName' => $data->companyName,
// ]]);
// $compresponse = json_decode($compres->getBody());
// Log::info($compres->getBody());
//routes will function only after company is fixed
// $routes= $client2->request('GET', 'http://127.0.0.1:8000/api/routes', [
// 'headers' => ['api_token' => /*'6UhcQUtcEuE2HXdUM1crQtV9RQQDI6t5IvWVkWcTTFxbc7rtjXz5Od77cqba'*/ $response->api_token]]);
// Log::info($routes->getBody());
// $routesresponse = json_decode($routes->getBody());
return $this->toPersonal($response /*$routesresponse*/);
}
catch(RequestException $e){
//unsuccessfull registration message
$exception = $e->getResponse();
$exceptionBodyAsString = $exception->getBody()->getContents();
$formattedException = str_replace("\""," ",$exceptionBodyAsString);
//echo $formattedException;
return view('index', ['exceptionmsg' => $formattedException]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValidator() {}",
"public function getValidator();",
"public function getValidator();",
"public function getValidator()\n {\n return $this->validator;\n }",
"public function getValidator()\n {\n return $this->validator;\n }",
"public function getValidator()\n {\n return $this->validator;\n }",
"protected function getValidatorInstance()\n {\n return app(ValidationFactory::class);\n }",
"protected function createValidator() {\n return $this->validator;\n }",
"public static function getValidatorInstance()\n {\n if (static::$validator === null)\n {\n static::$validator = new Validator();\n }\n\n return static::$validator;\n }",
"private function getValidator()\n {\n return Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator();\n }",
"public function getValidator()\n\t{\n\t\treturn $this->validation->validator->validator;\n\t}",
"protected function get9c2345652e8ae3f87ba009d0f8fedee27bb751398014908e9ab2fb6d5bf1300f(): \\Viserio\\Component\\Validation\\Validator\n {\n return $this->services[\\Viserio\\Contract\\Validation\\Validator::class] = new \\Viserio\\Component\\Validation\\Validator();\n }",
"public function getValidator()\n\t{\n\t\tif (!is_object($this->_validator)) {\n\t\t\t$validatorClass = $this->xpdo->loadClass('validation.xPDOValidator', XPDO_CORE_PATH, true, true);\n\t\t\tif ($derivedClass = $this->getOption(xPDO::OPT_VALIDATOR_CLASS, null, '')) {\n\t\t\t\tif ($derivedClass = $this->xpdo->loadClass($derivedClass, '', false, true)) {\n\t\t\t\t\t$validatorClass = $derivedClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($profitClass = $this->getOption('mlmsystem_handler_class_profit_validator', null, '')) {\n\t\t\t\tif ($profitClass = $this->xpdo->loadClass($profitClass, $this->getOption('mlmsystem_core_path', null, MODX_CORE_PATH . 'components/mlmsystem/') . 'handlers/validations/', false, true)) {\n\t\t\t\t\t$validatorClass = $profitClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($validatorClass) {\n\t\t\t\t$this->_validator = new $validatorClass($this);\n\t\t\t}\n\t\t}\n\t\treturn $this->_validator;\n\t}",
"public function getValidator() {\n return $this->__validator;\n }",
"public function getValidator() \n {//--------------->> getValidator()\n return $this->_validator;\n }",
"protected function getValidatorInstance()\n {\n $factory = $this->container->make('Illuminate\\Validation\\Factory');\n if (method_exists($this, 'validator')) {\n return $this->container->call([$this, 'validator'], compact('factory'));\n }\n\n $rules = $this->container->call([$this, 'rules']);\n $attributes = $this->attributes();\n $messages = [];\n\n $translationsAttributesKey = $this->getTranslationsAttributesKey();\n\n foreach ($this->requiredLocales() as $localeKey => $locale) {\n $this->localeKey = $localeKey;\n foreach ($this->container->call([$this, 'translationRules']) as $attribute => $rule) {\n $key = $localeKey . '.' . $attribute;\n $rules[$key] = $rule;\n $attributes[$key] = trans($translationsAttributesKey . $attribute);\n }\n\n foreach ($this->container->call([$this, 'translationMessages']) as $attributeAndRule => $message) {\n $messages[$localeKey . '.' . $attributeAndRule] = $message;\n }\n }\n\n return $factory->make(\n $this->all(),\n $rules,\n array_merge($this->messages(), $messages),\n $attributes\n );\n }",
"public function validator()\n {\n return $this->validator;\n }",
"protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('postHashtag', json_decode($this->input()['postHashtag'], true));\n $this->request->set('activeLocales', json_decode($this->input()['activeLocales'], true));\n // clean alias from unnecessary symbols\n $this->request->set('postAlias', Helpers::cleanToOnlyLettersNumbers($this->input()['postAlias']));\n\n\n return parent::getValidatorInstance();\n }",
"public function getValidatorService();",
"private function getValidator()\n {\n $v = new Validator();\n $v->addRules([\n ['label', 'Label', 'required'],\n ['num_value', 'Number', 'exists type=number'],\n ['comment', 'Comment', 'exists'],\n ]);\n return $v;\n }",
"protected function getValidationFactory()\n {\n return app('validator');\n }",
"public function getValidator($name = 'default') {\n\t\t\t//\n\t\t\tif ($name == 'default') { return new Validator();}\n\t\t\trequire (VALIDATORS . $name . '_validator.php');\n\t\t\t$name = $name . '_Validator';\n\t\t\treturn new $name();\n\t\t}",
"protected function getValidator($request)\n {\n $rules = [\n 'page_title' => 'required',\n 'status' => 'required|integer|between:0,1'\n ];\n \n $customMessages = [\n 'page_title.required' => __('admin.pages.field_validation.title_field_required_msg'),\n 'status.required' => __('admin.pages.field_validation.status_field_required_msg')\n ];\n\n return Validator::make($request->all(), $rules, $customMessages);\n }",
"public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Atezate\\\\Validator\\Cubos')) {\n\n $this->setValidator(new \\Atezate\\Validator\\Cubos);\n }\n }\n\n return $this->_validator;\n }",
"protected function getValidatorService()\n {\n return $this->services['validator'] = $this->get('validator.builder')->getValidator();\n }",
"public function createValidator()\n {\n $validator = Validation::createValidatorBuilder()\n ->setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))\n ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app))\n ->setTranslator($this->getTranslator())\n ->setApiVersion(Validation::API_VERSION_2_5)\n ->getValidator();\n\n return $validator;\n }",
"public function getValidatorService()\n {\n return $this->validatorService;\n }",
"public function getCreateTaskValidator()\n : Validators\\ValidatorInterface\n {\n return $this->app->make(\n Validators\\CreateTaskValidator::class\n );\n }",
"protected function getValidator()\n {\n if ($form = $this->owner->getForm()) {\n \n if (($validator = $form->getValidator()) && $validator instanceof Validator) {\n return $validator;\n }\n \n }\n }",
"public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Klikasi\\\\Validator\\Newsletter')) {\n\n $this->setValidator(new \\Klikasi\\Validator\\Newsletter);\n }\n }\n\n return $this->_validator;\n }",
"public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Klikasi\\\\Validator\\Kanpaina')) {\n\n $this->setValidator(new \\Klikasi\\Validator\\Kanpaina);\n }\n }\n\n return $this->_validator;\n }",
"function getCMSValidator()\n {\n return $this->getValidator();\n }",
"function validator() {\n if ($this->validator) return $this->validator;\n $options = array();\n foreach ($this->fields_options as $field => $field_options) {\n if (!@$field_options['validation']) continue;\n $options[$field] = $field_options['validation'];\n }\n return $this->validator = new xValidatorStore($options, $_REQUEST);\n }",
"function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}",
"function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}",
"function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}",
"protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n\n $validator->sometimes('family_member_id.*', 'distinct', function($input)\n {\n return $input->family_member == 1;\n });\n\n $validator->sometimes('family_member_id.*', 'not_in:'. $this->request->get('patriarch'), function($input)\n {\n return $input->family_member == 1;\n });\n\n return $validator;\n }",
"public function getDelegatedValidator()\n {\n return $this->validator;\n }",
"public function validator()\n {\n\n return UserValidator::class;\n }",
"public function validator()\n {\n\n return UserValidator::class;\n }",
"public function validator()\n {\n\n return UserValidator::class;\n }",
"public function validator()\n {\n\n return UserValidator::class;\n }",
"public function validator()\n {\n\n return UserValidator::class;\n }",
"public function validator()\n {\n return UserValidator::class;\n }",
"public function createValidator();",
"protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n $validator->setAttributeNames(trans('mconsole::personal.form'));\n\n return $validator;\n }",
"public function getValidator($validator)\n {\n $instance = null;\n\n if (strpos($validator, 'iPhorm_Validator_') === false) {\n $validator = 'iPhorm_Validator_' . ucfirst($validator);\n }\n\n $validators = $this->getValidators();\n if (array_key_exists($validator, $validators)) {\n $instance = $validators[$validator];\n }\n\n return $instance;\n }",
"public function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n\n\n $validator->after(\n function () use ($validator) {\n $input = $this->all();\n }\n );\n\n return $validator;\n }",
"public function get($codename) {\n\t\treturn $this->validators[$codename];\n\t}",
"protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('categories_names', json_decode($this->input()['categories_names'], true));\n // clean alias from unnecessary symbols\n $this->request->set('category_alias', Helpers::cleanToOnlyLettersNumbers($this->input()['category_alias']));\n\n return parent::getValidatorInstance();\n }",
"public static function getValidator($name, array $options = []);",
"protected function validator($request)\n {\n $data = $request->all();\n $vcode = $request->session()->get('p'.$data['phone']);\n return Validator::make($data, [\n 'name' => 'required|max:255|unique:users,name',\n 'phone' => 'required|phone|max:255|unique:users,phone',\n 'email' => 'required|email|max:255|unique:users,email',\n 'phonecode' => 'required|regex:/' . $vcode['verifycode'] . '/',\n 'password' => 'required|confirmed|min:6|max:20',\n ]);\n }",
"public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Atezate\\\\Validator\\Mensajes')) {\n\n $this->setValidator(new \\Atezate\\Validator\\Mensajes);\n }\n }\n\n return $this->_validator;\n }",
"public function getValidator()\n {\n if (!isset($this->customValidator)) {\n throw new CertaintyException('Custom class not defined');\n }\n return $this->customValidator;\n }",
"public function createFooResponseValidator(): ResponseValidatorInterface\n {\n return new AcmeFooResponseValidator();\n }",
"private function createValidator()\n {\n // add custom validation rules\n \\Validator::extend('contains_caps',\n function($field, $value, $params)\n {\n return preg_match('#[A-Z]#', $value);\n }\n );\n\n \\Validator::extend('contains_digit',\n function($field, $value, $params)\n {\n return preg_match('#[0-9]#', $value);\n }\n );\n\n // set array of messages for custom rules\n $messages = array(\n 'contains_caps' => ':attribute must contain at least one capital letter.',\n 'contains_digit' => ':attribute must contain at least one numeric digit.'\n );\n\n // set array of rules to use for validation (many are Laravel's built-ins)\n $rules = array(\n 'email' => 'required|email|max:255',\n 'password' => 'required|between:8,50|contains_caps|contains_digit', // password has some \"strength\" requirements\n 'first_name' => 'required|max:50',\n 'last_name' => 'required|max:50',\n 'city' => 'required|max:100',\n 'state' => 'required|max:2',\n 'zip' => 'required|max:20',\n 'biography' => 'required',\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, $messages);\n\n return $validator;\n }",
"protected function getAjaxValidationFactory()\n {\n return app()->make('validator');\n }",
"public function withContext(mixed $context): ValidatorInterface;",
"public function getValidatorInstance() {\n $validator = parent::getValidatorInstance();\n\n $validator->after(function() use ($validator) {\n\n // Does the event exist?\n if( !$this->checkEventExists()){\n $validator->errors()->add('event.Exists', 'This event does not longer exist.');\n } else {\n\n // Does the booker is not the creator?\n if( !$this->checkEventNotBookedByCreator()){\n $validator->errors()->add('event.BookedCreator', 'You can\\'t unbook this event because since you are the owner.'); \n }\n\n // Does the event is not already finished/has begun?\n if( !$this->checkEventDateNotDue()){\n $validator->errors()->add('event.DateDue', 'You can\\'t unbook this event because it\\'s already begun or is terminated.'); \n }\n }\n\n });\n\n return $validator;\n }",
"protected function getValidator(): void\n {\n // TODO: Implement getValidator() method.\n }",
"protected function getValidationFactory()\n {\n return app('Illuminate\\Contracts\\Validation\\Factory');\n }",
"protected function makeValidator()\n {\n $rules = $this->expandUniqueRules($this->rules);\n\n $validator = static::$validator->make($this->getAttributes(), $rules);\n\n event(new ModelValidator($this, $validator));\n\n return $validator;\n }",
"public function validator()\n {\n\n return ConfigValidator::class;\n }",
"public function validator()\n {\n\n return FormInfoValidator::class;\n }",
"public function getValidator(): ?ValidatorInterface\n {\n return new CompoundValidator(\n new CzechIbanValidator($this->accountNumber, $this->bankCode),\n new GenericIbanValidator($this)\n );\n }",
"public function validator()\n {\n\n return ProvidersValidator::class;\n }",
"protected function getValidateRequestListenerService()\n {\n return $this->services['validate_request_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener();\n }",
"protected function getValidateRequestListenerService()\n {\n return $this->services['validate_request_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener();\n }",
"protected function getForm_TypeGuesser_ValidatorService()\n {\n return $this->services['form.type_guesser.validator'] = new \\Symfony\\Component\\Form\\Extension\\Validator\\ValidatorTypeGuesser($this->get('validator'));\n }",
"protected function validator(array $data)\n {\n return self::getValidator($data);\n }",
"protected static function validator() {\n\t\tif (empty(self::$validate)) {\n\t\t\tself::$validate = new MpoValidator();\n\t\t}\n\t\treturn self::$validate;\n\t}",
"public function makeValidator()\r\n {\r\n if (10 == $this->countDigits($this->string)) {\r\n return new Validator10($this->string);\r\n }\r\n\r\n if (13 == $this->countDigits($this->string)) {\r\n return new Validator13($this->string);\r\n } \r\n }",
"public function initValidator()\n {\n if (!is_null($this->_validator)) {\n return $this->_validator;\n }\n $this->_validator = new SurveyManager_Entity_Validator_Survey($this);\n \n return $this->_validator;\n }",
"public function make($validator)\n\t{\n\t\tif ($validator instanceof Closure)\n\t\t{\n\t\t\t$validator = new ClosureValidator($validator, $this->request, $this->validatorFactory, $this->router);\n\n\t\t\treturn array($validator->getInput(), $validator->getRules(), $validator->getFailedMessages());\n\t\t}\n\n\t\tif (is_string($validator) AND ! isset($this->validators[$validator]))\n\t\t{\n\t\t\t$this->validators[$validator] = $validator;\n\t\t}\n\n\t\tif (isset($this->validators[$validator]))\n\t\t{\n\t\t\tif ($this->validators[$validator] instanceof Closure)\n\t\t\t{\n\t\t\t\treturn new ClosureValidator($this->validators[$validator], $this->request, $this->validatorFactory);\n\t\t\t}\n\n\t\t\treturn new $this->validators[$validator]($this->request, $this->validatorFactory);\n\t\t}\n\n\t\tthrow new \\InvalidArgumentException('Invalid input validator.');\n\t}",
"protected function validator(Request $request)\n\t{\n\t\treturn Validator::make($request->all(), [\n\t\t\t'title' => 'required',\n\t\t\t]);\n\t}",
"protected function validator(Request $request)\n {\n return Validator::make($request, [\n 'name' => ['required', 'string', 'max:255'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n ]);\n }",
"public function getContractValidator(): ?ContractValidator {\n\n return $this->contractValidator;\n\n }",
"public function validator()\n {\n\n return DistribuidorValidator::class;\n }",
"protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n // $validator->sometimes();\n\n $validator->after(function ($validator) {\n $this->request->remove('is_post');\n $this->request->remove('is_update');\n $this->request->remove('is_editing');\n $this->request->remove('is_delete');\n });\n return $validator;\n }",
"public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Atezate\\\\Validator\\Tipos')) {\n\n $this->setValidator(new \\Atezate\\Validator\\Tipos);\n }\n }\n\n return $this->_validator;\n }",
"public function validator()\n {\n\n return BabyInfoValidator::class;\n }",
"protected function getValidator(array $options = [])\n {\n $type = '\\\\marvin255\\\\serviform\\\\validators\\\\Regexp';\n\n return FactoryValidators::initElement($type, $options);\n }",
"public function validator()\n {\n return ZhuanTiValidator::class;\n }",
"public function validator()\n {\n\n return EmpreValidator::class;\n }",
"public function validator()\n {\n\n return OccupationValidator::class;\n }",
"public function validator()\n {\n\n return GrupoServicosValidator::class;\n }",
"public function validator()\n {\n\n return ScheduleValidator::class;\n }",
"protected function validator(Request $request)\n {\n return Validator::make($request, [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'suburb' => 'required',\n 'zipcode' => 'required',\n\t\t\t\n ]);\n }",
"public function validator()\n {\n return NotificationValidator::class;\n }",
"public function validator()\n {\n $validator = $this->baseValidator([\n 'stripe_token' => 'required',\n 'vat_id' => 'nullable|max:50|vat_id',\n ]);\n\n if (Spark::collectsBillingAddress()) {\n $this->validateBillingAddress($validator);\n }\n\n return $validator;\n }",
"public function validator()\n {\n\n return ProducerValidator::class;\n }",
"protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'userid' => 'required|max:11',\n 'password' => 'required'\n ]);\n }",
"protected function validation($request)\n {\n\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required',\n 'lastname' => 'required',\n 'email' => 'required',\n 'pocketmoney' => 'required',\n 'password' => 'required',\n 'age' => 'required',\n 'city' => 'required',\n 'state' => 'required',\n 'zip' => 'required',\n 'country' => 'required',\n ]);\n\n return $validator;\n }",
"public function getValidator(?string $code) : ?Validator {\n if ($code === null || strlen($code) < 2) { // ensure we can extract the code\n return null;\n }\n\n $key = substr($code, 0, 2);\n\n return $this->validators[$key] ?? null;\n }",
"public function validator()\n {\n $validator = validator($this->all(), [\n 'name' => 'required|max:255',\n 'server_provider_id' => ['required', Rule::exists('server_providers', 'id')->where(function ($query) {\n $query->where('user_id', $this->user()->id);\n })],\n 'region' => 'required|string',\n 'source_provider_id' => ['required', Rule::exists('source_providers', 'id')->where(function ($query) {\n $query->where('user_id', $this->user()->id);\n })],\n 'repository' => [\n 'required',\n 'string',\n new ValidRepository(SourceProvider::find($this->source_provider_id))\n ],\n 'database' => 'string|alpha_dash|max:255',\n 'database_size' => 'string',\n ]);\n\n return $this->validateRegionAndSize($validator);\n }",
"public function validator()\n {\n return LeaveRequestValidator::class;\n }",
"private function validator(Request $request)\n {\n //validate the form...\n }",
"protected function createUserValidator($request) {\n \treturn Validator::make($request,[\n 'first_name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'last_name' => 'required',\n 'password' => 'required|min:6',\n 'status' => 'required'\n ]);\n \t}",
"public function validator()\n {\n\n return PescariaValidator::class;\n }",
"protected function parseRulesFromValidator()\n {\n // First we call needed method with needed container\n $factory = app()->make(ValidationFactory::class);\n $validator = app()->call([$this->getFormRequestInstance(), 'validator'], [$factory]);\n\n // After that we get initialRules property (since plain `rules` prop doesn't contain array rules)\n // and make it public so that later we can get it's value\n $property = (new ReflectionClass($validator))->getProperty('initialRules');\n $property->setAccessible(true);\n\n return $property->getValue($validator);\n }",
"protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'userid' => 'required|max:11',\n 'page' => ''\n ]);\n }"
] | [
"0.7217253",
"0.71017957",
"0.71017957",
"0.7048845",
"0.7048845",
"0.7048845",
"0.6924129",
"0.69168675",
"0.6899657",
"0.68542325",
"0.684801",
"0.68128955",
"0.68007755",
"0.6797457",
"0.67463154",
"0.66977936",
"0.6687648",
"0.6645321",
"0.6593937",
"0.6564549",
"0.6506735",
"0.6500423",
"0.64936745",
"0.6428733",
"0.640632",
"0.64031655",
"0.6393014",
"0.6366359",
"0.6347438",
"0.63437617",
"0.6282892",
"0.6252371",
"0.62332886",
"0.62275493",
"0.62275493",
"0.62275493",
"0.6213424",
"0.6203102",
"0.61237746",
"0.61237746",
"0.61237746",
"0.61237746",
"0.61237746",
"0.610553",
"0.60834324",
"0.6066394",
"0.60355836",
"0.59944713",
"0.59814906",
"0.59801394",
"0.59744567",
"0.5939118",
"0.59275067",
"0.59039265",
"0.58902186",
"0.5890007",
"0.58719885",
"0.586906",
"0.5865833",
"0.5862728",
"0.58234406",
"0.58158123",
"0.5815437",
"0.5784297",
"0.5780951",
"0.5768072",
"0.5748842",
"0.5748842",
"0.5748371",
"0.57390654",
"0.5723674",
"0.5717639",
"0.57142323",
"0.5711796",
"0.5675113",
"0.56740963",
"0.5673833",
"0.56687135",
"0.5667633",
"0.56432956",
"0.5637126",
"0.5622988",
"0.5614382",
"0.56140053",
"0.5581888",
"0.55700976",
"0.55691636",
"0.55622005",
"0.55596167",
"0.555281",
"0.55358255",
"0.55254596",
"0.55246574",
"0.5520975",
"0.5513461",
"0.5510867",
"0.5508561",
"0.5503873",
"0.55037427",
"0.54932034",
"0.54874235"
] | 0.0 | -1 |
TODO:add softdelete to media then impliment this action | public function undeleteAction(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteMedia() {\n\t\tif(isset($this->data['mdid'])) {\n\t\t\t$rs = mq(\"update \" . DB_TBL_MEDIA . \" set md_active='0' where mdid='\" . $this->data['mdid'] . \"'\");\n\t\t\t$_SESSION['_mtype'] = \"W\";\n\t\t\t$_SESSION['_msg'] = \"deletedmedia\";\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function forceDeleted(Media $media)\n {\n //\n }",
"public function pre_delete()\r\n\t{\r\n\t\tparent::pre_delete();\r\n\t\t$Change = App::make('Change');\r\n\t\t$Change::where('fmodel', 'GalleryItem')\r\n\t\t\t ->where('fid', $this->id)\r\n\t\t\t ->delete();\r\n\t\t\t \r\n\t\t// Thumbs\r\n\t\t/*if($this->file) {\r\n\t\t\t# Should really check if these are used anywhere else, but no easy way to do that in other modules yet so just leaving them for now\r\n\t\t\t\r\n\t\t\t// Name\r\n\t\t\t$name = basename(public_path().$this->file);\r\n\t\t\t\r\n\t\t\t// Thumbs\r\n\t\t\t$thumbs = Config::get('galleries::thumbs');\r\n\t\t\tforeach($thumbs as $k => $v) {\r\n\t\t\t\tif(file_exists(public_path().$v['path'].$name)) unlink(public_path().$v['path'].$name);\r\n\t\t\t}\r\n\t\t}*/\r\n\t}",
"function adrotate_manage_media() {\n\tglobal $wpdb, $adrotate_config;\n\n\t$status = $file = '';\n\tif(isset($_GET['status'])) $status = esc_attr($_GET['status']);\n\tif(isset($_GET['file'])) $file = esc_attr($_GET['file']);\n\n\tif(strlen($file) > 0 AND wp_verify_nonce($_REQUEST['_wpnonce'], 'adrotate_delete_media_'.$file)) {\n\t\tif(adrotate_unlink($file)) {\n\t\t\t$status = 206;\n\t\t} else {\n\t\t\t$status = 207;\n\t\t}\n\t}\n\t?>\n\n\t<div class=\"wrap\">\n\t\t<h1><?php _e('Media and Assets', 'adrotate-pro'); ?></h1>\n\n\t\t<?php if($status > 0) adrotate_status($status); ?>\n\n\t\t<p><?php _e('Upload images to the AdRotate Pro banners folder from here. This is useful if you have HTML5 adverts containing multiple files.', 'adrotate-pro'); ?></p>\n\n\t\t<?php\n\t\tinclude(\"dashboard/publisher/media.php\");\n\t\t?>\n\n\t\t<br class=\"clear\" />\n\n\t\t<?php echo adrotate_trademark(); ?>\n\n\t</div>\n<?php\n}",
"function wp_media_attach_action($parent_id, $action = 'attach')\n {\n }",
"public function batchAction()\n {\n \t$actions = $this->get('request')->get('actions');\n \t$em = $this->get('doctrine.orm.entity_manager');\n \t\n \tif ($this->get('request')->get('action_name') == '_delete')\n \t{\n\t foreach($actions as $value)\n\t {\n\t $media = $this->get('media_manager.manager')->findOneById($value);\n\t $em->remove($media);\n\t }\n\t $em->flush();\n }\n return new RedirectResponse($this->get('media_manager.manager')->generateUrl('media_manager_homepage', array()));\n }",
"public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}",
"protected function _preDelete() {}",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"function unPublishMediaById ( $id )\n {\n /// syndication will always return metadata for one content item\n /// if publishing a collection, we get collection item, which contains list of any sub-items also generated\n try\n {\n $result = $this->apiCall('delete',\"{$this->api['syndication_url']}/adminControls/media/delete/{$id}\", 'json', 'json');\n return $this->createResponse($result,'Delete','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"abstract function allowDeleteAction();",
"public function denyMedia(\\App\\Models\\EstablishmentMedia $media) {\n try{\n if(checkModelId($media->getIdOriginalMedia())){\n $originalMedia = $media->mediaOriginal()->first();\n if(checkModel($originalMedia)){\n $originalMedia->setIdDraftMedia(0)->save();\n }\n }\n $media->setIdEstablishment(0);\n $media->delete();\n } catch (Exception $ex) {\n // TODO Display errors\n }\n // TODO Send notification\n return redirect('/admin');\n }",
"public function preRemove(MediaInterface $media);",
"public function delete_media() {\n $id = $this->input->post('media_id');\n $valors = array();\n $resultat = $this->media_model->delete_media($id);\n if ($resultat > 0) {\n $filename = 'videos/' . $id . '.mp4';\n $filenameImg = 'img/' . $id . '.jpg';\n if (file_exists($filename)) {\n unlink($filename);\n }\n if (file_exists($filenameImg)) {\n unlink($filenameImg);\n }\n $resultat = \"Se ha borrado un registro con éxito\";\n } else {\n $resultat = \"No se ha borrado ningún registro\";\n }\n\n $this->load->view(\"admin.php\", array(\"data\" => $valors, \"error\" => $resultat));\n }",
"function delete()\n\t{\n\tglobal $db, $config_vars;\n\n// \t\t$result = new phreak_error();\n// \t$result->set_object_id($this->id);\n// \t$result->set_operation('delete');\n\n\n\t\t//check if the object is in the database\n\t\tif (isset($this->id))\n\t\t{\n\n\t\t\tif ($this->check_perm('delete')) //Authorisation is okay\n\t\t\t{\n\n\t\t\t\t//remove views for this picture\n\t\t\t\t$sql = 'DELETE FROM ' . $config_vars['table_prefix'] . \"views WHERE content_id = \" . $this->id;\n\t\t\t\tif (!$result = $db->sql_query($sql))\n\t\t\t\t{\n\t\t\t\t\t$error = new phreak_error(E_WARNING,SQL_ERROR,__LINE__,__FILE__,'delete',$this->id,0,0,$sql);\n\t\t\t\t\t$error->commit();\n//\t\t\t\t\terror_report(SQL_ERROR, 'delete' , __LINE__, __FILE__,$sql);\n\t\t\t\t}\n\n\n\n\n\t\t\t\t// remove from content table\n\t\t\t\t$sql = \"DELETE FROM \" . $config_vars['table_prefix'] . \"content WHERE id = \" . $this->id;\n\t\t\t\tif (!$result = $db->sql_query($sql))\n\t\t\t\t{\n\t\t\t\t\t$error = new phreak_error(E_WARNING,SQL_ERROR,__LINE__,__FILE__,'delete',$this->id,0,0,$sql);\n\t\t\t\t\t$error->commit();\n//\t\t\t\t\terror_report(SQL_ERROR, 'delete' , __LINE__, __FILE__,$sql);\n\t\t\t\t}\n\n\t\t\t\t$this->clear_content_in_cat();\n\n\t\t\t\tif (is_file($this->file))\n\t\t\t\t{\n\t\t\t\t\tif (!unlink($this->file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$error = new phreak_error(E_WARNING,FILE_ERROR,__LINE__,__FILE__,'delete');\n\t\t\t\t\t\t$error->commit();\n//\t\t\t\t\t\terror_report(FILE_ERROR, 'delete' , __LINE__, __FILE__);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (is_file($this->get_thumbfile()))\n\t\t\t\t{\n\t\t\t\t\tif (!unlink($this->get_thumbfile()))\n\t\t\t\t\t{\n\t\t\t\t\t\t$error = new phreak_error(E_WARNING,FILE_ERROR,__LINE__,__FILE__,'delete');\n\t\t\t\t\t\t$error->commit();\n//\t\t\t\t\t\terror_report(FILE_ERROR, 'delete' , __LINE__, __FILE__);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunset($this->id);\n\n\t\t\t\t// decrase content amount\n\t\t\t\tforeach ($this->cat_ids as $id)\n\t\t\t\t{\n\t\t\t\t\t$this->remove_from_cat = new categorie;\n\t\t\t\t\t$this->remove_from_cat->generate_from_id($id);\n\t\t\t\t\t$this->remove_from_cat->set_content_amount($this->remove_from_cat->get_content_amount()-1);\n\t\t\t\t\t$this->remove_from_cat->commit();\n\t\t\t\t}\n\n\n\t\t\t\t// remove from content_in_cat table\n\n\n\t\t\t\tunset($this->file);\n\t\t\t\tunset($this->cat_ids);\n\t\t\t\tunset($this->place_in_cat);\n\n\n\n\n\t\t\t\treturn OP_SUCCESSFUL;\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn OP_NP_MISSING_DELETE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn OP_NOT_IN_DB;\n\t\t}\n\n\t}",
"public function actionDelete()\n {\n if (Yii::$app->user->can('imagedelete')) {\n if (Yii::$app->request->isAjax) {\n $system = new Filesystem();\n $param = Yii::$app->request->post();\n $model = $this->findModel($param['id']);\n $system->remove($this->original . $model->unique_name);\n $system->remove($this->thumb_145x145 . $model->unique_name);\n $system->remove($this->thumb_original . $model->unique_name);\n $system->remove($this->thumb_191x128 . $model->unique_name);\n $model->delete();\n }\n } else {\n throw new HttpException(403, 'You are not allowed to access this page', 0);\n }\n }",
"function qw_delete_media_by_id($id){\n\t// first delete all media files\n\tqw_delete_media_files_by_id($id);\n\t\n\tqa_db_query_sub(\n\t\t'DELETE FROM ^ra_media WHERE id= #',\n\t\t$id\n\t);\n\t\n}",
"function beforeDelete(){\r\n\t\t$photo = $this->findById($this->id);\r\n\t\tunlink($this->dir . $photo['Photo']['small']);\r\n\t\tunlink($this->dir . $photo['Photo']['large']);\r\n\t\treturn true;\r\n\t}",
"public function onBeforeDelete(){\n\t\tparent::onBeforeDelete();\n\n\t\tif($this->Images() && $images = $this->Images()){\n\t\t\tforeach($images as $image){\n\t\t\t\tif($image->exists()){\n\t\t\t\t\t$image->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function execute_media_action($params) {\n\t\tglobal $updraftcentral_host_plugin;\n\n\t\t$error = $this->_validate_capabilities(array('upload_files', 'edit_posts'));\n\t\tif (!empty($error)) return $error;\n\n\t\t$result = array();\n\t\tswitch ($params['do']) {\n\t\t\tcase 'attach':\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$query_result = $wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->posts} SET `post_parent` = %d WHERE `post_type` = 'attachment' AND ID = %d\", $params['parent_id'], $params['id']));\n\n\t\t\t\tif (false === $query_result) {\n\t\t\t\t\t$result['error'] = $updraftcentral_host_plugin->retrieve_show_message('failed_to_attach_media');\n\t\t\t\t} else {\n\t\t\t\t\t$result['msg'] = $updraftcentral_host_plugin->retrieve_show_message('media_attached');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'detach':\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$query_result = $wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->posts} SET `post_parent` = 0 WHERE `post_type` = 'attachment' AND ID = %d\", $params['id']));\n\n\t\t\t\tif (false === $query_result) {\n\t\t\t\t\t$result['error'] = $updraftcentral_host_plugin->retrieve_show_message('failed_to_detach_media');\n\t\t\t\t} else {\n\t\t\t\t\t$result['msg'] = $updraftcentral_host_plugin->retrieve_show_message('media_detached');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\t$failed_items = array();\n\t\t\t\tforeach ($params['ids'] as $id) {\n\t\t\t\t\t// Delete permanently\n\t\t\t\t\tif (false === wp_delete_attachment($id, true)) {\n\t\t\t\t\t\t$failed_items[] = $id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($failed_items)) {\n\t\t\t\t\t$result['error'] = $updraftcentral_host_plugin->retrieve_show_message('failed_to_delete_media');\n\t\t\t\t\t$result['items'] = $failed_items;\n\t\t\t\t} else {\n\t\t\t\t\t$result['msg'] = $updraftcentral_host_plugin->retrieve_show_message('selected_media_deleted');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $this->_response($result);\n\t}",
"public function deletePostAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tif ($info && $info['id'] == 0) $this->failPostOutput('无法删除');\n \t$result = Admin_Service_Material::delete($id);\n \tif (!$result) $this->failPostOutput('操作失败');\n \t$attachPath = Common::getConfig('siteConfig', 'attachPath');\n \t$attachroot = Yaf_Application::app()->getConfig()->attachroot;\n \tforeach ($itemsList as $items) {\n \t\tUtil_File::del($attachPath.str_replace($attachroot, \"\", $items['image']));\n \t}\n \t$this->successPostOutput($this->actions['listUrl']);\n }",
"public function deleted(Media $media)\n {\n if ( $media->local ) {\n $type = $media->mediatype->slug;\n switch ('image') {\n case 'value':\n Storage::delete( 'public/'.$media->source );\n $arr = explode( '/', $media->source );\n $thmb = array_pop( $arr );\n Storage::delete( MediaController::$thmbdir.$thmb );\n break;\n\n default:\n // code...\n break;\n }\n }\n }",
"public function postRemove(MediaInterface $media);",
"public function actionDelete()\n\t{\n\t\t// setting the delete tag as false\n\t\t$deleteObject = Image::model()->findByPk($_GET['imageid']);\n\t\t$deleteObject->deleted = true;\n\t\t$deleteObject->save();\n\t\t\n\t\t// link to the physical image file\n\t\t$deleteMe = $deleteObject->getImageFile('full', false, Image::FULLIMAGEPATH);\n\t\t\t\n\t\t// first the existance of the file has to be evaluated in order to avoid an php error\n\t\tif( file_exists( $deleteMe ) )\n\t\t\trename( \n\t\t\t\t// source\n\t\t\t\t$deleteMe,\n\t\t\t\t// target \n\t\t\t\tImage::DELETEDIMAGEPATH . $deleteObject->imageid . '.' . $deleteObject->tiedostotyyppi\t\t\n\t\t);\n\t\t\n\t\t$deleteObject->deleteImage(array('small', 'light', 'medium', 'large'));\n\t\t\n\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\n\t}",
"public function suppression_media($user_id, $media_id, $type_media) {\n $this->load->model('photos');\n $this->load->helper('form');\n $this->load->library('form_validation');\n $datas = array();\n print $type_media;\n if ($user_id != $this->session->userdata('uid')) {\n show_404();\n }\n if ($this->input->post(\"delete\")) {\n if ($type_media == 1) {\n\n $this->photos->delete_photo($media_id);\n // add success page photo\n $this->load->view('success-concert');\n }\n\n if ($type_media == 2) {\n\n $this->photos->delete_album($media_id);\n // add success page photo\n $this->load->view('success-concert');\n }\n\n if ($type_media == 3) {\n\n $this->photos->delete_video($media_id);\n // add success page photo\n $this->load->view('success-concert');\n }\n }\n echo $this->input->post(\"no_delete\"); {\n //CLOSE POP UP\n }\n\n $this->load->view('photos/delete_photos', $datas);\n }",
"public function delete()\n {\n DB::beginTransaction();\n $res=parent::delete();\n \n if($res==true)\n {\n $relations=$this->morphMany('App\\Models\\Image', 'imageable');\n\n \n $relations->delete(); \n }\n\n DB::commit(); \n }",
"public function removeMedia(Request $request)\n {\n if (env('APP_DEMO', false)) {\n Flash::warning('This is only demo app you can\\'t change this section ');\n } else {\n if (auth()->user()->can('medias.delete')) {\n $input = $request->all();\n $user = $this->userRepository->findWithoutFail($input['id']);\n try {\n if ($user->hasMedia($input['collection'])) {\n $user->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }\n }\n }",
"public function preDelete() { }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function forceDelete(User $user, Media $media)\n {\n //\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $food = $this->foodRepository->findWithoutFail($input['id']);\n try {\n if ($food->hasMedia($input['collection'])) {\n $food->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function testRemoveMedium() {\n $id = Medium::where('slug','mediumwithdefaultslug')->firstOrFail()->id;\n $this->delete('/api/v1/medium/'.$id, ['HTTP_X-Requested-With' => 'XMLHttpRequest']);\n $this->assertDatabaseMissing('media', ['id' => $id]);\n }",
"protected function _postDelete()\n\t{\n\t}",
"public static function disable_media_library() {\n\t\tif ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {\n\t\t\tremove_menu_page( 'upload.php' );\n\t\t}\n\t}",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $marketReview = $this->marketReviewRepository->findWithoutFail($input['id']);\n try {\n if($marketReview->hasMedia($input['collection'])){\n $marketReview->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }",
"public function delete() {\n $this->remove_content();\n\n parent::delete();\n }",
"public function forceDelete()\n {\n //\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteMediaByID( $mediaID )\n\t\t{\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t$query = $this->_db->prepare( \"SELECT media_filename FROM media WHERE media_id = :mediaID\" );\n\n\t\t\t\t$query->bindParam( ':mediaID', $mediaID, PDO::PARAM_INT );\n\n\t\t\t\t$query->execute();\n\n\t\t\t\t$media = $query->fetch();\n\t\t\t\n\t\t\t\t$query = $this->_db->prepare( \"DELETE FROM media WHERE media_id = :mediaID\" );\n\n\t\t\t\t$query->bindParam( ':mediaID', $mediaID, PDO::PARAM_INT );\n\n\t\t\t\t$query->execute();\n \n\t\t\t\t//unlink from the upload foldrer\n\t\t\t\tunlink( \"../uploads/\" . $media[ \"media_filename\" ] );\n\n \n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\t\t\t\n\t\t}",
"protected function _predelete() {\n }",
"function delete() {\n global $DB;\n if($this->mayI(DELETE)) {\n $DB->metadata->delete($this->ID);\n $DB->content->delete($this->ID, false);\n $DB->spine->delete($this->ID);\n return parent::delete();\n } else return false;\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $earning = $this->earningRepository->findWithoutFail($input['id']);\n try {\n if($earning->hasMedia($input['collection'])){\n $earning->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"function media_insert($object_type, $object_name, $just_controller=0, $page_dependent=1, $additional_params = '', $property_position_top=MEDIA_PROPERTY_POSITION_TOP, $property_position_right=MEDIA_PROPERTY_POSITION_RIGHT)\r\n{\r\n\tglobal $language, $media_image_lang_bar, $i_name, $UserRole;\r\n\tglobal $media_file, $media_border, $media_height, $media_width, $media_unit_type, $media_alt, $picture_vars, $media_unit_type;\r\n\tglobal $media_show_menu, $media_quality, $media_bgcolor, $t, $ignore_admin_media, $tag_params;\r\n\tglobal $get_as_tag;\r\n\r\n\tglobal $t;\r\n\t$tmp_t = $t;\r\n\r\n\t$get_as_tag = 1;\r\n\t$s = '';\r\n\t\r\n\t$tag_params = $additional_params;\r\n\t$ignore_admin_media = 1;\r\n\t/*\r\n\t** Т.к. картинка медии не зависит от языка, третий параметр функции cms (,,language), передаем пустую строку.\r\n\t*/\r\n\t$__m_data = unserialize(cms('media_inserted_'.$object_name,($page_dependent==1)?$t:'', '', 1, 0));\r\n\r\n\t$__m_data['link']['media_title'] = cms('media_title_'.$object_name, ($page_dependent == 1 ? $t : 0), $language, 1, 0);\r\n\r\n\t$media_id = ( array_key_exists('media_id', $__m_data) ? $__m_data['media_id'] : null );\r\n\r\n\tmedia_get($object_type, $media_id, $__m_data);\r\n\r\n\r\n\t//If there is needs just control-button...\r\n\t$s = '';\r\n\tif( $just_controller == 0)\r\n\t{\r\n\t\t$s = parse_media($media_id);\r\n\t}\r\n\r\n\tif (checkAdmin() && ($UserRole==ADMINISTRATOR || $UserRole==POWERUSER) && get('admin_template')=='yes' && !check_content_access(CA_READ_ONLY))\r\n\t{\r\n\t\tif ($object_type != 'flash')\r\n\t\t{\r\n\t\t //New style position of edit image button\r\n\t\t\t$s.='<div style=\"margin: '.($media_id ? '-20px' : '0px').' 0px 0px 0px\">';\r\n\t\t\t$s.=' <a href=\"#\" onclick=\"page_dependent='.$page_dependent.'; media_insert(\\''.$object_name.'\\');return false\"><img src=\"'.EE_HTTP.'img/cms_edit_img.gif\" width=\"43\" height=\"16\" alt=\"'.ADMIN_EDIT_OBJECT.''.$object_name.'\" title=\"'.ADMIN_EDIT_OBJECT.''.$object_name.'\" border=\"0\"/></a>';\r\n\t\t\tif ($media_id != 0) $s.='<div style=\"margin: '.$property_position_top.' 0px 0px '.$property_position_right.';\"><a style=\"padding: 0px 3px 2px 0px; color:#000; background: #fff; border: 1px solid #f00;\" href=\"'.EE_HTTP.'index.php?admin_template='.get('admin_template').'&t='.$media_id.'&t_back_refer='.$t.'\"> Media properties</a></div>';\r\n\t\t\t$s.='</div>';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Old style position of edit image button\r\n\t\t\tif ($s != '')\r\n\t\t\t{\r\n\t\t\t\t// check if found media really exists in tpl_pages\r\n\t\t\t\t// if it was deleted - no link to media properties will be printed\r\n\t\t\t\t$s.= ' <a href=\"'.EE_HTTP.'index.php?admin_template='.get('admin_template').'&t='.$media_id.'&t_back_refer='.$t.'\"> Media properties</a>';\r\n\t\t\t}\r\n\t\t\t$s.= ' <a href=\"#\" onclick=\"media_insert(\\''.$object_name.'\\');return false\"><img src=\"'.EE_HTTP.'img/cms_edit_img.gif\" width=\"43\" height=\"16\" alt=\"'.ADMIN_EDIT_OBJECT.''.$object_name.'\" title=\"'.ADMIN_EDIT_OBJECT.''.$object_name.'\" border=\"0\"/></a>';\r\n\t\t}\r\n\t}\r\n\r\n\t$t = $tmp_t;\r\n\r\n\treturn $s;\r\n}",
"public function deleteUnused()\n\t{\n\t\t/*$file = Engine_Api::_()->getItem('storage_file', $this->file_id);\n\t\t if ($file) {\n\t\t $table = Engine_Api::_()->getDbtable('albumSongs', 'mp3music');\n\t\t $select = $table->select()\n\t\t ->where('file_id = ?', $file->getIdentity())\n\t\t ->limit(1);\n\t\t $count = count( $table->fetchAll($select) );\n\t\t if ($count >= 0)\n\t\t $file->delete();\n\t\t }\n\t\t $this->delete();*/\n\t\t$table = Engine_Api::_() -> getDbtable('albumSongs', 'mp3music');\n\t\t$data = array('is_delete' => 1, );\n\t\t$where = $table -> getAdapter() -> quoteInto('song_id = ?', $this -> song_id);\n\t\t$table -> update($data, $where);\n\t}",
"public function media();",
"protected function deleteAction()\n {\n }",
"public function setMedia()\n {\n }",
"public function setMedia()\n {\n }",
"public function setMedia()\n {\n }",
"public function deleteAction() {\n parent::deleteAction();\n }",
"function hapusmedia ($id_media)\n{\n\tglobal $conn;\n\tmysqli_query ($conn, \"DELETE FROM media_cetak WHERE id_media = $id_media \");\n\treturn mysqli_affected_rows ($conn);\n}",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $tax = $this->taxRepository->findWithoutFail($input['id']);\n try {\n if ($tax->hasMedia($input['collection'])) {\n $tax->getFirstMedia($input['collection'])->delete();\n }\n } catch (Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function reset()\n {\n $this->getDb()->exec('delete from media');\n //pictures and vignettes deletion\n $this->deleteMedias();\n //backup deletion\n $this->deleteBackup();\n }",
"public function destroy(Media $medium)\n {\n $medium->delete();\n\n return redirect()->route('media.index')->with('message','Media has been deleted');\n }",
"public function delete(){\n $socialMediaId = $this->input->post(\"socialMediaId\");\n $resultSocialMediaDelete = $this->Social_Model->delete($socialMediaId);\n echo json_encode($resultSocialMediaDelete);\n }",
"public function delete()\n {\n $post_id = $this->uri->rsegment('3');\n $this->_del($post_id);\n $image = $this->input->get('image');\n unlink(\"upload/post\".$image);\n // thong bao xoa thanh cong\n $this->session->set_flashdata('message', 'Xóa thành công tin tức này');\n redirect(admin_url('blog'));\n }",
"function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}",
"function preDelete()\n {\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $encargo = $this->EncargoRepository->findWithoutFail($input['id']);\n try {\n if ($encargo->hasMedia($input['collection'])) {\n $encargo->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}",
"public function deleteAction() {\n \n }",
"protected function _delete()\n\t{\n\t}",
"public function delete($id)\n {\n echo 'in soft delete';\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $marketsPayout = $this->marketsPayoutRepository->findWithoutFail($input['id']);\n try {\n if ($marketsPayout->hasMedia($input['collection'])) {\n $marketsPayout->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function forceDelete();",
"protected function MetaAfterDelete() {\n\t\t}",
"protected function beforeDelete()\n {\n }",
"function media_upload_file()\n {\n }",
"function deleteProductMediasById($id) {\r\n //On supprime physiquement les medias avant de les retirer de la base\r\n $medias = getProductMediasById($id);\r\n foreach ($medias as $media) {\r\n unlink($media->mediaSource);\r\n }\r\n\r\n $dbc = connection();\r\n $table = 'medias';\r\n $dbc->quote($table);\r\n\r\n $req = \"DELETE FROM $table \"\r\n . \"WHERE id IN (\"\r\n . \"SELECT pm.id_medias \"\r\n . \"FROM products_has_medias \"\r\n . \"AS pm \"\r\n . \"WHERE pm.id_products = $id)\";\r\n\r\n $requPrep = $dbc->prepare($req); // on prépare notre requête\r\n $requPrep->execute();\r\n $data = $requPrep->fetchAll(PDO::FETCH_OBJ);\r\n $requPrep->closeCursor();\r\n}",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $shop = $this->shopRepository->findWithoutFail($input['id']);\n try {\n if ($shop->hasMedia($input['collection'])) {\n $shop->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function test_can_delete_a_media()\n { \n $data =$this->mediaDataHelper(); \n $response = $this->postJson('v1/media', $data);\n $media = Media::first();\n \n $response = $this->json('DELETE', 'v1/media/'.$media->id); \n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]); \n }",
"public function onBeforeDelete();",
"function del()\n {\n $id = $this->uri->rsegment(3);\n $this->_del($id);\n \n $this->session->set_flashdata('message', 'Xóa thành công');\n redirect(admin_url('video'));\n }",
"function wp_idolondemand_delete_post()\n{\n}",
"public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Fj_Service_Goods::deleteGoods($id);\n\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}",
"protected function afterDelete()\r\n {\r\n }",
"public function media_upload_content()\n\t{\n\t\t$this->media_upload_picasa_upload();\t\t\n\t}",
"function deleteMediaItem (Request $req)\n {\n try {\n\n foreach($req->id as $item)\n {\n Storage::delete('public/img/studio/' . $item);\n }\n\n return response()->json([\n 'error' => false,\n 'msg' => 'Deletion Complete'\n ], 200);\n\n }catch(\\Exception $e)\n {\n return response()->json([\n 'error' => true,\n 'errors_debug' => $e->getMessage(),\n 'errors' => 'Error deleting media of an item (Err:951)'\n ], 400);\n }\n }",
"protected function delete() {\n\t}",
"private function mediaUpdate() {\n\t\t$this->s3->request = array(\n\t\t\t'access_key' => \\Crypt::encrypt($this->access_key),\n\t\t\t'secret' => \\Crypt::encrypt($this->secret),\n\t\t\t'region' => \\Aws\\Common\\Enum\\Region::US_EAST_1,\n\t\t\t'bucket' => $this->bucket,\n\t\t\t'prefix' => $this->prefix,\n\t\t);\n\t\t$this->s3->testConnection();\n\t\tif ($this->s3->response['connected'] === true) {\n\t\t\t//Show how many records we imported.\n\t\t\t$this->s3->listObjects();\n\t\t\t//Tell us how many media items we found.\n\t\t\t$this->info(sprintf('Found %d media items in this bucket', $this->s3->count));\n\t\t\t//Update images.\n\t\t\t$this->update();\n\t\t}\n\t}",
"public function actionDelete($id)\n {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n $this->findModel($id)->name;\n unlink(Yii::getAlias('@root')\n . Yii::$app->params['frontend_upload_path'] .Yii::$app->params['media']. $this->findModel($id)->name);\n if ($this->findModel($id)->delete())\n $transaction->commit();\n } catch (Exception $ex) {\n $transaction->rollBack();\n }\n return $this->redirect(['index']);\n }",
"public function afterDelete()\n {\n if ($this->image) $this->image->delete();\n if ($this->reindex) Slide::reindex();\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $category = $this->contryRepository->findWithoutFail($input['id']);\n try {\n if ($category->hasMedia($input['collection'])) {\n $category->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}",
"public function destroy(Media $media)\n {\n //\n }",
"public function destroy(Media $media)\n {\n //\n }",
"public static function Delete($oMedia){\n\t\t$sql = \"DELETE FROM cms_media\n\t\t\t\tWHERE mediaID='$oMedia->mediaID'\n\t\t\t\t\";\n\n\t\treturn parent::Execute($sql);\n\t}",
"function wp_delete_attachment($post_id, $force_delete = \\false)\n {\n }",
"public function deletemediaimage(Request $request){\n \n $text='';\n\n $getpostid=TimelinePost::where('media_id','=',$request->imgid)->get();\n $postid=0;\n foreach ($getpostid as $key => $getpostidvalue) {\n $postid=$getpostidvalue->id;\n \n $removeimage=UserComment::where('content_id','=',$postid)->delete();\n $removeimage=TimelinePostLike::where('content_id','=',$postid)->delete();\n $removeimage=TimelineSharePost::where('post_id','=',$postid)->delete();\n $removeimage=ConnectionTimelinePost::where('post_id','=',$postid)->delete();\n }\n $removeimage=TimelinePost::where('media_id','=',$request->imgid)->delete();\n $getimage=0;\n //delete image from media table\n $removeimage=UserMedia::where('id','=',$request->imgid)->get();\n if(sizeof($removeimage)>0){\n \n \n foreach ($removeimage as $key => $valueImage) {\n //check if album have last image\n $getimage=UserMedia::where('album_id','=',$valueImage->album_id)->count();\n if($getimage==1){\n //delete all post if album deleted \n \n $text=1;\n $albumId=$valueImage->album_id;\n $getpostid=TimelinePost::where('media_id','=',$albumId)->where('post_type','=',1)->get();\n $postid=0;\n foreach ($getpostid as $key => $getpostidvalue) {\n $postid=$getpostidvalue->id;\n \n $removeimage=UserComment::where('content_id','=',$postid)->delete();\n $removeimage=TimelinePostLike::where('content_id','=',$postid)->delete();\n $removeimage=TimelineSharePost::where('post_id','=',$postid)->delete();\n $removeimage=ConnectionTimelinePost::where('post_id','=',$postid)->delete();\n }\n $removeimage=TimelinePost::where('media_id','=',$albumId)->where('post_type','=',1)->delete();\n $removeimage=UserAlbum::where('id','=',$albumId)->delete();\n $getimage=UserMedia::where('album_id','=',$valueImage->album_id)->delete();\n \n\n }\n }\n $removeimage=UserMedia::where('id','=',$request->imgid)->delete();\n \n }\n \n return response()->json($text);\n \n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $currency = $this->currencyRepository->findWithoutFail($input['id']);\n try {\n if ($currency->hasMedia($input['collection'])) {\n $currency->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"function delete_media($FormID) {\r\n $conn = db_connect();\r\n\r\n $query = \"delete from MEDIALIBRARY\r\n where media='\".$FormID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"public function deletephoto()\n\t\t\t{\n\t\t\t\t$photo_details = explode(',', $this->fields_arr['checkbox']);\n\t\t\t\tif($this->fields_arr['action']=='Delete')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$photo_id = $photo_arr[0];\n\t\t\t\t\t\t\t\t$user_id = $photo_arr[1];\n\t\t\t\t\t\t\t\t$photoHandler = new photoHandler();\n\t\t\t\t\t\t\t\t$photoHandler->deletePhotos(array($photo_id), $user_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='Flag')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->CFG['db']['tbl']['flagged_contents'].' WHERE'.\n\t\t\t\t\t\t\t\t' content_type=\\'photo\\' AND content_id IN('.$photo_list.')';\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET flagged_status=\\'Yes\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='UnFlag')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->CFG['db']['tbl']['flagged_contents'].' WHERE'.\n\t\t\t\t\t\t\t\t' content_type=\\'photo\\' AND content_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET flagged_status=\\'No\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='Featured')\n\t\t\t\t\t{\n\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET featured=\\'Yes\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='UnFeatured')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET featured=\\'No\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='Move')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\tif($parent_id=$this->isParentExists($this->fields_arr['photo_categories']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET '.\n\t\t\t\t\t\t\t\t\t\t' photo_category_id= \\''.$parent_id.'\\', '.\n\t\t\t\t\t\t\t\t\t\t' photo_sub_category_id = \\''.$this->fields_arr['photo_categories'].'\\' '.\n\t\t\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET '.\n\t\t\t\t\t\t\t\t\t\t' photo_sub_category_id=0, photo_category_id='.$this->dbObj->Param('photo_categories').\n\t\t\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, array($this->fields_arr['photo_categories']));\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}",
"public function get_media()\n {\n }",
"public function deleteAction()\n {\n \n }",
"function media_upload_flash_bypass()\n {\n }",
"public function deleteMedia(Request $request)\n\t{\n\t\t$data = Produk::find($request['id']);\n\t\tif ($data->gambar1 == $request['filename']) {\n\t\t\t$tblname = 'gambar1';\n\t\t} else if ($data->gambar2 == $request['filename']) {\n\t\t\t$tblname = 'gambar2';\n\t\t} else if ($data->gambar3 == $request['filename']) {\n\t\t\t$tblname = 'gambar3';\n\t\t} else if ($data->gambar4 == $request['filename']) {\n\t\t\t$tblname = 'gambar4';\n\t\t}\n\n\t\tif (isset($tblname) && !empty($tblname)) {\n\t\t\tProduk::whereId($request['id'])->update([$tblname => null]);\n\t\t\t$path = public_path().'/assets/images/product/'.$request['filename'];\n\t\t\tif (!empty($request['filename']) && file_exists($path)) {\n\t\t\t\tunlink($path);\n\t\t\t}\n\t\t}\n\t\treturn response()->json(['message'=>'Produk deleted successfully.','notify'=>'success']);\n\t}",
"function media_cleanup() { \r\n global $media;\r\n global $avatars;\r\n global $photoalbumsmedia;\r\n \r\n $query1 = \"SELECT `media_id` , `media_userid` FROM `$media`s;\";\r\n $sqlr1 = bcsql_query( $query1 );\r\n $mediaids = bcsql_fetch_array( $sqlr1 );\r\n $num_rows1 = bcsql_num_rows( $mediaids );\r\n for( $i = 0; $i<$num_rows1; $i++ ) {\r\n $thismedia = $mediaids[ $i ];\r\n $thismediaid = $thismedia[ \"media_id\" ];\r\n $mediaclass = New media( $thismediaid );\r\n $userid = $mediaclass->userid();\r\n $userfile = $uploaddir . $userid .\"/\". $thismediaid;\r\n if( !file_exists( $userfile ) ) {\r\n $sql = \"DELETE FROM `$media` WHERE `media_id` = '$thismediaid';\"; \r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$avatars` WHERE `avatar_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$photoalbumsmedia` WHERE `pamedia_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n }\r\n }\r\n //the oposite thing remains to be done\r\n }",
"function delete() {\n\t\t$query = '\n\t\tDELETE FROM '.system::getConfig()->getDatabase('mofilm_content').'.movieAssets\n\t\tWHERE\n\t\t\tID = :ID\t\n\t\tLIMIT 1';\n\n\t\ttry {\n\t\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\t\t\t$oStmt->bindValue(':ID', $this->_ID);\n\t\t\t\t\n\t\t\tif ( $oStmt->execute() ) {\n\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t$this->reset();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tsystemLog::error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn false;\n\t}"
] | [
"0.6850172",
"0.68044263",
"0.6698258",
"0.6342084",
"0.62271947",
"0.62087977",
"0.61943966",
"0.6163046",
"0.616006",
"0.61591274",
"0.61587214",
"0.61318684",
"0.6108222",
"0.61035967",
"0.6091239",
"0.6087458",
"0.6081194",
"0.60750633",
"0.6039582",
"0.6016609",
"0.6012702",
"0.5995362",
"0.5995141",
"0.59749454",
"0.59683",
"0.5966106",
"0.59606504",
"0.5948911",
"0.5930933",
"0.58927965",
"0.5891548",
"0.5888097",
"0.5878906",
"0.5874676",
"0.58522224",
"0.5841873",
"0.58413744",
"0.58271486",
"0.5814007",
"0.5812229",
"0.57871765",
"0.57866",
"0.5784986",
"0.5781918",
"0.577898",
"0.57767606",
"0.57766384",
"0.57688886",
"0.5759402",
"0.5759402",
"0.5759402",
"0.5747752",
"0.574576",
"0.5732549",
"0.5730917",
"0.5717827",
"0.56973416",
"0.5694677",
"0.5677085",
"0.56651515",
"0.5659141",
"0.56575227",
"0.5650118",
"0.56440264",
"0.56416833",
"0.56390643",
"0.563064",
"0.5620268",
"0.5617892",
"0.5617738",
"0.5612735",
"0.56065404",
"0.56027985",
"0.5602524",
"0.559762",
"0.559753",
"0.5593665",
"0.55853456",
"0.5584681",
"0.5582613",
"0.5578601",
"0.5572281",
"0.5569354",
"0.5565824",
"0.55640227",
"0.5562201",
"0.5560625",
"0.5560625",
"0.5556997",
"0.5555278",
"0.55552197",
"0.55540764",
"0.5553032",
"0.5551992",
"0.55496436",
"0.5545246",
"0.554021",
"0.553936",
"0.5533285",
"0.55271876"
] | 0.5844161 | 35 |
Gets query for [[AuthUserRoles]]. | public function getAuthUserRoles()
{
return $this->hasMany(AuthUserRole::className(), ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }",
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"public function getUsersRoles()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ur' => 'users_roles'),\n\t\t\t\t'ur.user_id = u.user_id', array('role_id'));\n\t\treturn $db->fetchAll($select);\t\n\t}",
"public function rolesForUser();",
"public function get_roles()\n {\n $users_roles = user_role_active_record::search()->where('uid', $this->uid)->exec();\n $roles = array();\n foreach ($users_roles as $users_role) {\n $roles[] = role_active_record::search()->where('rid', $users_role->rid)->execOne();\n }\n return $roles;\n }",
"public function getRoles()\n {\n return $this->hasMany(AuthRole::className(), ['id' => 'role_id'])->viaTable('auth_user_role', ['user_id' => 'id']);\n }",
"public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('user_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }",
"public function getAllRoles(): array;",
"public function getRoles() {\n return $this->getRelation(\"roles\");\n }",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"public function getRoles()\n {\n $id = Auth::id();\n $roles = \\App\\Models\\User::find($id)->roles;\n\n return $roles;\n }",
"public static function getUserRoles()\n\t{\n\t\treturn ArrayHelper::map(UserRoles::find()->where(['is_active'=> Yii::$app->params['IS_ACTIVE']['ACTIVE']])->asArray()->all(), 'id', 'name');\n\t}",
"public function & GetRoles ();",
"public function getRoles()\n {\n $roles = Yii::$app->authManager->getRolesByUser($this->getId());\n return ArrayHelper::getColumn($roles, 'name', false);\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"public function getRoles()\n {\n return $this->getRelation('roles');\n }",
"public function getUserRoles()\n {\n return $this->userRoles;\n }",
"protected function getRoles(): array\n {\n $output = [];\n $options = [];\n $options['unlimited'] = true;\n $options['where'] = [\n 'userrole_priority' => '< 10000',\n ];\n $options['sortOrders'] = [['sort' => 'userrole_priority', 'order' => 'ASC']];\n $UserRolesDb = new \\Rdb\\Modules\\RdbAdmin\\Models\\UserRolesDb($this->Container);\n $output['listRoles'] = $UserRolesDb->listItems($options);\n\n unset($options, $UserRolesDb);\n return $output;\n }",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = ' <a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public static function getRoles ()\n {\n // Pulls column string from DB\n $enumStr = DB::select(DB::raw('SHOW COLUMNS FROM `user` WHERE FIELD = \"role\"'))[0]->Type;\n\n // Parse string\n preg_match_all(\"/'([^']+)'/\", $enumStr, $matches);\n\n // Return matches\n return isset($matches[1]) ? $matches[1] : [];\n }",
"private function get_all_roles(){\n return Role::all();\n }",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }",
"public function getCurrentUserRoles()\n {\n $this->load([\n 'roles' => function($query) {\n $query->active()\n ->whereNull('expires_at')\n ->orWhere('expires_at', '>', Carbon::now());\n },\n ]);\n\n return $this->roles;\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"public function getRoles(): array;",
"public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}",
"public function getUserRoles()\n {\n if (!ConfigHelper::cacheEnabled()) {\n return $this->getCurrentUserRoles();\n }\n\n $cacheKey = 'laravelroles_roles_' . Users::userModelCacheKey() . '_' . $this->getKey();\n\n return Cache::remember($cacheKey, ConfigHelper::cacheExpiryTime(), function () {\n return $this->getCurrentUserRoles();\n });\n }",
"public function listRoles($user) {\n return $user->roles;\n }",
"public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }",
"public function getRoles()\n {\n return $this->userRoles->toArray();\n /*$roles = array();\n foreach ($this->userRoles as $role) {\n $roles[] = $role->getRole();\n }\n\n return $roles;*/\n }",
"public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }",
"abstract protected function getRoles();",
"public function getRoles()\n\t{\n\t\t$roles = $this->role_gestion->all();\n\n\t\treturn view('back.users.roles', compact('roles'));\n\t}",
"function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}",
"function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}",
"public function getAllRoles()\n {\n return $this->repository->getAllRoles();\n }",
"public function get_roles()\n {\n $query=$this->db->get('tbl_roles');\n return $query->result();\n }",
"private function getRoles()\n\t{\n\t\tif (!isset($this->roles)) {\n\t\t\t$this->roles = $this->roles()\n\t\t\t\t->with('permissions')\n\t\t\t\t->withCount('users')\n\t\t\t\t->get();\n\t\t}\n\t\treturn $this->roles;\n\t}",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"public function findRoles() {\n\t\t\n\t}",
"public function roles()\n {\n\n return Role::all();\n }",
"public function getRoles(): array {\n\t\t$sql = 'SELECT id, name FROM roles';\n\t\treturn $this->queryRows($sql);\n\t}",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }",
"public static function obtenerRoles()\n {\n $consulta = \"SELECT * FROM usuarios_roles ORDER BY id_rol ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function getRoles(){\n\n return $this->_arrRoles;\n \n }",
"function get_roles(){\n\t\t$this->db->select('*');\n\t\t$q = $this->db->get('user_role');\n\n\t\treturn $q->result_array();\n\t}",
"public function getRoles()\r\n {\r\n return $this->roles;\r\n }",
"public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }",
"public function get_user_roles(Request $request) {\n $member_roles = User::find($request->member_id)->roles->pluck('id');\n return $member_roles;\n }",
"public function getRoles(){\n //write the query to select all roles except super admin\n $sql = \"SELECT * FROM roles WHERE role_title != 'Super Admin'\";\n\n //check if the query() runs the sql statement\n if ($result = $this->dbobj->dbcon->query($sql)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}",
"public function getRoles()\n {\n\n $rolesReturn = [];\n $roles = $this->roles()->with(['role'])->get();\n\n $rolesReturn = $roles->pluck('role.name');\n\n // Add Standard role to the user roles\n\n if($rolesReturn->contains(config('user.standardRole')) === false)\n {\n $rolesReturn->push(config('user.standardRole'));\n }\n\n return $rolesReturn;\n\n }",
"public function getExplicitRoles()\n {\n $manager = \\FelixOnline\\Core\\BaseManager::build('FelixOnline\\Core\\UserRole', 'user_roles', 'id');\n $manager->filter('user = \"%s\"', array($this->getUser()));\n\n $values = $manager->values();\n if (!$values) {\n return null;\n }\n\n $roles = array();\n foreach ($values as $value) {\n $roles[] = $value->getRole();\n }\n\n return $roles;\n }",
"public function getRoles()\n {\n $roles = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name');\n\n $now = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId());\n\n unset($roles[array_search('super_administrator', $roles)]);\n unset($roles[array_search('user', $roles)]);\n\n foreach ($roles as $key => $role) {\n $roles[$key] = Yii::t('backend', $role);\n }\n\n return $roles;\n }",
"public static function roles(){\n self::init();\n\n return array_keys(AUTH_USER_ROLES);\n }",
"public function getRoles()\n\t{\n\t\treturn $this->roles->toArray();\n\t}",
"public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }",
"public function userRoles()\n {\n return $this->hasMany('userroles');\n }",
"public function getRoles() \n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles->toArray();\n }",
"public function getRoles()\n {\n return $this->roles->toArray();\n }",
"public function getRolesData()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n 'SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Role p'\n \n );\n $result = $query->getResult();\n \n return $result;\n }",
"public function user_roles()\n {\n return $this->hasMany('App\\UserRole', 'user_id', 'user_id');\n }",
"public function cachedRoles()\n {\n $userPrimaryKey = $this->primaryKey;\n $cacheKey = 'entrust_roles_for_user_'.$this->$userPrimaryKey;\n\n return Cache::tags(Config::get('entrust.role_user_table'))->remember($cacheKey, Config::get('cache.ttl'), function () {\n return $this->roles()->get();\n });\n }",
"function getAllUsersWithRoles() {\n $statement = 'SELECT user.id, username, role, email, banned FROM user INNER JOIN \n role_lov role_lov ON user.role_id = role_lov.id ORDER BY user.id';\n $query = $this->prepare($statement);\n $query->execute();\n return $query->fetchAll();\n }",
"public static function getUserRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT *\n FROM user_role\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}",
"public static function getRoleList()\n {\n return Rights::getAuthItemSelectOptions(CAuthItem::TYPE_ROLE, array(\n 'authenticated', 'guest'\n ));\n }",
"public static function listarRoles(): array {\n $consulta = \"SELECT * FROM rol ORDER BY nombre\";\n return Conexion::getInstancia()->seleccionar($consulta);\n }",
"public function roles()\n\t{\n\t\treturn $this->belongsToMany('Regulus\\Identify\\Models\\Role', Auth::getTableName('user_roles'))\n\t\t\t->withTimestamps()\n\t\t\t->orderBy('display_order')\n\t\t\t->orderBy('name');\n\t}",
"function getRolesList(){\r\n\t\t$sql=\"select * from m_employee_roles\";\r\n\t\t$res=$this->db->query($sql);\r\n\t\tif($res->num_rows()){\r\n\t\t\treturn $res->result_array($sql);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}",
"public function roles()\n {\n return response()->json(['roles' => UserRole::getRoleList()]);\n }",
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public function getRoles()\n {\n $roles = explode(\",\", $this->roles);\n array_push($roles, 'ROLE_USER');\n return array_unique(array_filter($roles));\n }",
"public function getRoles()\n {\n $roles = $this->roles;\n // guarantees that a user always has at least one role for security\n if (empty($roles)) {\n $roles[] = 'ROLE_USER';\n }\n return array_unique($roles);\n }",
"public function getRoles() {\n return \\array_filter(Role::getMap(), [ $this, 'hasRole' ], \\ARRAY_FILTER_USE_KEY);\n }",
"public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }",
"public function getRoles(){\n\n $roles = $this->visiteur_roles->map(function($role){\n return $role->getTitle();\n })->ToArray();\n\n $roles[]= 'ROLE_USER';\n \n return $roles;\n }",
"function getRoles () {\n return array(\"user.friendRequest.edit\",\"user.friendRequest.view\");\n }",
"public function index()\n {\n return Roles::all();\n }",
"public function showRoles(Request $request) {\n\n $roles = Roles::paginate(10);\n \n return $roles;\n \n }",
"public function getRoles()\n {\n $roles = $this->roles;\n\n // guarantees that a user always has at least one role for security\n if (empty($roles)) {\n $roles[] = 'ROLE_USER';\n }\n return array_unique($roles);\n }"
] | [
"0.72904855",
"0.7241075",
"0.7217274",
"0.71789694",
"0.7175139",
"0.71642995",
"0.71013355",
"0.70474124",
"0.70197487",
"0.70162874",
"0.7009743",
"0.700763",
"0.6996395",
"0.69680065",
"0.6965587",
"0.6945544",
"0.694478",
"0.694478",
"0.689542",
"0.6867073",
"0.68490136",
"0.6823059",
"0.6821252",
"0.6819429",
"0.68173826",
"0.6816862",
"0.68121624",
"0.6805675",
"0.67744505",
"0.6773335",
"0.6744425",
"0.6742315",
"0.6741297",
"0.67370224",
"0.67315954",
"0.6726445",
"0.6694525",
"0.66842175",
"0.6678199",
"0.6672583",
"0.6663569",
"0.6662105",
"0.6652498",
"0.66490984",
"0.66485506",
"0.6636777",
"0.6620655",
"0.66072613",
"0.659755",
"0.659755",
"0.659755",
"0.6592683",
"0.65923804",
"0.65707904",
"0.65361226",
"0.6535304",
"0.65149915",
"0.65141225",
"0.650422",
"0.6494576",
"0.6494576",
"0.6494576",
"0.6494576",
"0.6494576",
"0.6494576",
"0.6481271",
"0.6467936",
"0.6456953",
"0.64509225",
"0.6445559",
"0.6438314",
"0.6437208",
"0.6433778",
"0.6432412",
"0.6420802",
"0.6420802",
"0.64166933",
"0.64135027",
"0.64016986",
"0.639879",
"0.63888675",
"0.63878137",
"0.6378808",
"0.63786155",
"0.63694376",
"0.6361631",
"0.63493586",
"0.63387996",
"0.63387996",
"0.63387996",
"0.63387996",
"0.6335178",
"0.63244647",
"0.6318704",
"0.6315695",
"0.63149047",
"0.6305344",
"0.6304078",
"0.62998635",
"0.6299522"
] | 0.7247991 | 1 |
Gets query for [[Roles]]. | public function getRoles()
{
return $this->hasMany(AuthRole::className(), ['id' => 'role_id'])->viaTable('auth_user_role', ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }",
"public function getRoles() {\n return $this->getRelation(\"roles\");\n }",
"public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = ' <a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }",
"public function & GetRoles ();",
"public function getAllRoles(): array;",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"public function getRoles()\n {\n return $this->getRelation('roles');\n }",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"private function get_all_roles(){\n return Role::all();\n }",
"public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function findRoles() {\n\t\t\n\t}",
"public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }",
"public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }",
"public function roles()\n {\n\n return Role::all();\n }",
"function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}",
"public function getRoles(): array {\n\t\t$sql = 'SELECT id, name FROM roles';\n\t\treturn $this->queryRows($sql);\n\t}",
"protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }",
"public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}",
"public function getRoles(): array;",
"public function get_roles()\n {\n $query=$this->db->get('tbl_roles');\n return $query->result();\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function rolesForUser();",
"public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"public function index()\n {\n return Roles::all();\n }",
"public function get_roles()\n {\n $users_roles = user_role_active_record::search()->where('uid', $this->uid)->exec();\n $roles = array();\n foreach ($users_roles as $users_role) {\n $roles[] = role_active_record::search()->where('rid', $users_role->rid)->execOne();\n }\n return $roles;\n }",
"public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }",
"abstract protected function getRoles();",
"function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}",
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public function getUsersRoles()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ur' => 'users_roles'),\n\t\t\t\t'ur.user_id = u.user_id', array('role_id'));\n\t\treturn $db->fetchAll($select);\t\n\t}",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"public function getRoles()\n\t{\n\t\t$roles = $this->role_gestion->all();\n\n\t\treturn view('back.users.roles', compact('roles'));\n\t}",
"public static function obtenerRoles()\n {\n $consulta = \"SELECT * FROM usuarios_roles ORDER BY id_rol ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }",
"public function getRoles()\n {\n $roles = Yii::$app->authManager->getRolesByUser($this->getId());\n return ArrayHelper::getColumn($roles, 'name', false);\n }",
"public function showRoles(Request $request) {\n\n $roles = Roles::paginate(10);\n \n return $roles;\n \n }",
"public function getAllRoles()\n {\n return $this->repository->getAllRoles();\n }",
"public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }",
"public function getRoles()\r\n {\r\n return $this->roles;\r\n }",
"public static function listarRoles(): array {\n $consulta = \"SELECT * FROM rol ORDER BY nombre\";\n return Conexion::getInstancia()->seleccionar($consulta);\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('user_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }",
"public function getRoles(){\n\n return $this->_arrRoles;\n \n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n\n \ttry {\n return $query = Role::get();\n } catch(\\Exception $err){\n Log::error('message error in getRoles on RoleRepository :'. $err->getMessage());\n return back()->with('error', $err->getMessage());\n }\n }",
"public static function getRoles ()\n {\n // Pulls column string from DB\n $enumStr = DB::select(DB::raw('SHOW COLUMNS FROM `user` WHERE FIELD = \"role\"'))[0]->Type;\n\n // Parse string\n preg_match_all(\"/'([^']+)'/\", $enumStr, $matches);\n\n // Return matches\n return isset($matches[1]) ? $matches[1] : [];\n }",
"public function getRoles() \n {\n return $this->roles;\n }",
"public function getRolesData()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n 'SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Role p'\n \n );\n $result = $query->getResult();\n \n return $result;\n }",
"public function getRoles()\n\t{\n\t\treturn $this->roles->toArray();\n\t}",
"private function getRoles()\n\t{\n\t\tif (!isset($this->roles)) {\n\t\t\t$this->roles = $this->roles()\n\t\t\t\t->with('permissions')\n\t\t\t\t->withCount('users')\n\t\t\t\t->get();\n\t\t}\n\t\treturn $this->roles;\n\t}",
"public function getRoles()\n {\n $id = Auth::id();\n $roles = \\App\\Models\\User::find($id)->roles;\n\n return $roles;\n }",
"protected function getRoles(): array\n {\n $output = [];\n $options = [];\n $options['unlimited'] = true;\n $options['where'] = [\n 'userrole_priority' => '< 10000',\n ];\n $options['sortOrders'] = [['sort' => 'userrole_priority', 'order' => 'ASC']];\n $UserRolesDb = new \\Rdb\\Modules\\RdbAdmin\\Models\\UserRolesDb($this->Container);\n $output['listRoles'] = $UserRolesDb->listItems($options);\n\n unset($options, $UserRolesDb);\n return $output;\n }",
"public function getRoles()\n {\n return $this->roles->toArray();\n }",
"public function getRoles()\n {\n return $this->roles->toArray();\n }",
"function getRolesList(){\r\n\t\t$sql=\"select * from m_employee_roles\";\r\n\t\t$res=$this->db->query($sql);\r\n\t\tif($res->num_rows()){\r\n\t\t\treturn $res->result_array($sql);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function list_roles(){\n $roles=$this->roles->pluck('name')->toArray();\n //el primer parametro es el separador, y el segundo para es el arreglo a seprar\n // es lo opuesto al explode que retorna una arreglo\n $string=implode(', ',$roles);\n return $string;\n\n }",
"function getRoles(){\n $this->db->select('*');\n $this->db->from('Roles');\n $query = $this->db->get();\n $result = $query->result();\n return $result;\n }",
"public function getRoles(){\n //write the query to select all roles except super admin\n $sql = \"SELECT * FROM roles WHERE role_title != 'Super Admin'\";\n\n //check if the query() runs the sql statement\n if ($result = $this->dbobj->dbcon->query($sql)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }",
"function getRoles()\n\t{\n $query = $this->db->query(\"select\n\t\t\t\t\t\t\t\t\t\troles.id as id,\n\t\t\t\t\t\t\t\t\t\troles.nombre as nombre,\n\t\t\t\t\t\t\t\t\t\troles.id_superior as id_superior\n\t\t\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\t\t\troles\n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\troles.estado = 0\n\t\t\t\t\t\t\t\t\torder by\n\t\t\t\t\t\t\t\t\t\troles.id asc\");\n\t\treturn $query->result();\n }",
"public function getRolesTable() {\n return $this->param['tblRoles'];\n }",
"public function getAll()\n {\n try{\n return $this->roles;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }",
"function getAll()\n\t{\n\t\t$this->db->order_by(\"roleName\",\"ASC\");\n\t\t$query = $this->db->get('roles');\n\t\treturn $query;\n\t}",
"function get_roles(){\n\t\t$this->db->select('*');\n\t\t$q = $this->db->get('user_role');\n\n\t\treturn $q->result_array();\n\t}",
"public function getRolesNames ();",
"public function index()\n {\n return Role::all();\n }",
"public function index()\n {\n return Role::all();\n }",
"public function roles()\n {\n return response()->json(['roles' => UserRole::getRoleList()]);\n }",
"public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}",
"public function getRoles()\n {\n return [$this->role];\n }",
"public function getRoles()\n {\n return [$this->role];\n }",
"public function getRoles() {\n return \\array_filter(Role::getMap(), [ $this, 'hasRole' ], \\ARRAY_FILTER_USE_KEY);\n }",
"public function getRolesInEvent(Event $event)\n {\n return RoleQuery::create()->useUserRoleQuery()->filterByUser($this)->useEventPersonQuery()->filterByEvent($event)->endUse()->endUse()->orderByName()->find();\n }",
"public function getRoles()\n {\n return $this->userRoles->toArray();\n /*$roles = array();\n foreach ($this->userRoles as $role) {\n $roles[] = $role->getRole();\n }\n\n return $roles;*/\n }",
"public function roles()\n {\n return $this->hasMany('Role');\n }",
"public function loadrolesAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }",
"public function getRoles()\n\t{\n\t\t$roles = array_map(function($value)\n\t\t{\n\t\t\treturn Html::a($value, $value->links['self']);\n\t\t}, $this->entity->roles);\n\n\t\treturn join('<br>', $roles);\n\t}",
"function get_all_roles($params = array())\n {\n $this->db->order_by('roles_id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('roles')->result_array();\n }",
"function allroles()\n\t{\n\t\t// take the last role id\n\t\t$offset = $this->input->get('offset') ? $this->input->get('offset') : 0;\n\t\t// fetch 10 role from server\n\t\t$perpage = 10;\n\t\t// take search parameters\n\t\t$query['search'] = $this->input->get('search');\n\n\t\t// response object\n\t\t$jsonData = array('success' => false, 'data' => array(), 'links' => '');\n\n\t\t// total rows in roles table according to search query\n\t\t$total_rows = $this->role_model->fetch_total_role_rows($query);\n\t\t// fetch 10 roles start from 'offset' where query\n\t\t$roles = $this->role_model->fetch_all_roles($perpage, $offset, $query);\n\t\t// config data to create pagination\n\t\t$obj = array(\n\t\t\t'base_url' => base_url().'role/allroles/',\n\t\t\t'per_page' => $perpage,\n\t\t\t'uri_segment' => 2,\n\t\t\t'total_rows' => $total_rows\n\t\t);\n\t\t/**\n\t\t * if roles is not empty\n\t\t * @response object\n\t\t * \t success => everything all right\n\t\t * data => rolelist\n\t\t * \t links => pagination links\n\t\t */\n\t\tif (count($roles) > 0) {\n\t\t\t$jsonData['success'] = true;\n\t\t\t$jsonData['data'] = $roles;\n\t\t\t$jsonData['links'] = $this->custom->paginate($obj);\n\t\t}\n\t\t// responde send\n\t\techo json_encode($jsonData);\n\t}",
"public function listarRoles(){\r\n $sql = \"SELECT * FROM roles;\";\r\n $roles = $this->conexion->getTable($sql);\r\n return $roles;\r\n}",
"public function roles()\n {\n return $this->hasMany(Role::class);\n }",
"public function getRoles(): array\n {\n return $this->roles;\n }",
"public function getRoles(): array\n {\n return $this->roles;\n }"
] | [
"0.75666773",
"0.7546121",
"0.7342624",
"0.73010975",
"0.72883534",
"0.72692055",
"0.72331977",
"0.7229644",
"0.7215152",
"0.7206947",
"0.71684676",
"0.71464187",
"0.7121172",
"0.7111802",
"0.7095937",
"0.7077436",
"0.70490164",
"0.7048976",
"0.70297486",
"0.70243764",
"0.7007287",
"0.70069027",
"0.6995818",
"0.69924766",
"0.69875216",
"0.69875216",
"0.69875216",
"0.697102",
"0.6956356",
"0.69418985",
"0.6940608",
"0.6933696",
"0.6930022",
"0.68969375",
"0.68549705",
"0.6845438",
"0.6845438",
"0.6845438",
"0.6845438",
"0.68453854",
"0.683817",
"0.68325615",
"0.68097615",
"0.680506",
"0.68049383",
"0.67976546",
"0.6790954",
"0.6789406",
"0.6786836",
"0.6770781",
"0.67624485",
"0.67624485",
"0.67621",
"0.674962",
"0.67429656",
"0.67370915",
"0.67370915",
"0.67370915",
"0.67370915",
"0.67370915",
"0.67370915",
"0.6706806",
"0.669823",
"0.6686821",
"0.6686216",
"0.667951",
"0.6671068",
"0.6666568",
"0.6649103",
"0.6647998",
"0.6647998",
"0.6640802",
"0.6639858",
"0.6635706",
"0.6625994",
"0.6616664",
"0.66136235",
"0.66045016",
"0.6595103",
"0.65939707",
"0.65710676",
"0.6554978",
"0.6541583",
"0.6541583",
"0.65350634",
"0.65331364",
"0.6518382",
"0.6518382",
"0.6507921",
"0.64971894",
"0.6486661",
"0.6482821",
"0.6482202",
"0.646768",
"0.64628017",
"0.6458462",
"0.6455949",
"0.64551103",
"0.6454603",
"0.6454603"
] | 0.6902539 | 33 |
Gets query for [[BranchUsers]]. | public function getBranchUsers()
{
return $this->hasMany(BranchUser::className(), ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllBoUsers()\n {\n $Query = \"select identifier, login from User WHERE type NOT IN ('contributor','client','chiefodigeo','superclient')\";\n if(($result = $this->getQuery($Query,true)) != NULL)\n return $result;\n else\n return \"NO\";\n }",
"public function businessUserQuery()\n {\n return $this->pushCriteria(BusinessUserCriteria::class);\n }",
"public static function getUsers(){\n $query = UserQuery::init()\n ->joinUserStatus()->selectName('status')->endUse();\n //->joinUserDetails()->selectUserId()->selectAddress()->selectZipCode()->selectLocal()->endUse()\n //->joinUserGuard()->selectUserId()->selectUsername()->selectSalt()->selectUserkey()->endUse()\n //->joinUserHasGroup()->selectUserId()->selectUserGroup()->endUse()\n //->joinUserLog()->selectId()->selectUserId()->selectUserEvent()->selectTimestamp()->endUse();\n \n return $query;\n }",
"public function retrieve_users()\n {\n $search_query = Request::post(self::PARAM_SEARCH_QUERY);\n \n // Set the conditions for the search query\n if ($search_query && $search_query != '')\n {\n $conditions[] = Utilities::query_to_condition(\n $search_query, \n array(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_USERNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)));\n }\n \n // Only include active users\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_ACTIVE), \n new StaticConditionVariable(1));\n \n // Combine the conditions\n $count = count($conditions);\n if ($count > 1)\n {\n $condition = new AndCondition($conditions);\n }\n \n if ($count == 1)\n {\n $condition = $conditions[0];\n }\n \n $this->user_count = DataManager::count(User::class_name(), $condition);\n $parameters = new DataClassRetrievesParameters(\n $condition, \n 100, \n $this->get_offset(), \n array(\n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)), \n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME))));\n \n return DataManager::retrieves(User::class_name(), $parameters);\n }",
"private function getUserBatch() {\n\t\t// Include also hidden (disabled) users to the export\n\t\t$hidden_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\n\t\t// Ignore access settings to get all users\n\t\telgg_set_ignore_access(true);\n\n\t\t$users = elgg_get_entities(array(\n\t\t\t'type' => 'user',\n\t\t\t'limit' => $this->limit,\n\t\t\t'offset' => $this->offset,\n\t\t));\n\n\t\t// Set access level to normal\n\t\telgg_set_ignore_access(false);\n\n\t\t// Set hidden status to normal\n\t\taccess_show_hidden_entities($hidden_status);\n\n\t\treturn $users;\n\t}",
"public function getUsers()\n {\n $em = $this->container->get('doctrine')->getEntityManager();\n $builder = $em->getRepository('AppWebBundle:User')->createQueryBuilder('u');\n \n return $builder->getQuery()->getResult();\n }",
"public static function getUsersLists(){\n \t$data = Doctrine_Query::create()\n \t// ->distinct('u.DeviceToken')\n \t->select(\"u.firstName, u.DeviceToken\")\n \t->from(\"User u\")\n \t->where('u.deleted=0')\n \t->andWhere(\"u.roleId=2\")\n \t->andWhere('u.DeviceToken!= \"NULL\"')\n\t->andWhere(\"u.DeviceToken!= '(null)'\")\n \t->andWhere('u.DeviceToken!=\"\"')\n \t->groupBy('u.DeviceToken')\n \t//->getSqlQuery();\n\t->fetchArray();\n \t\n return $data;\n }",
"public function getUsers();",
"public function getUsers();",
"public function getUsers();",
"public function getUsers( $condition = [] ){\n\n if( empty( $condition ) ){\n return $this->getAllUsers();\n }else{\n return User::find()->where($condition)->all();\n }\n\n }",
"public function getUsers() {\n\t\ttry {\n\t\t\treturn $this->getBounded1MInstance(\"XTUsersRecords\", $filter, $order, $limit, $whereAdd);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"private function getUsers()\n {\n $url = $this->base_uri.'user/assignable/multiProjectSearch?projectKeys='.$this->project;\n $users = $this->request($url);\n if (!$this->infos['errorBoolean']) {\n return json_decode($users);\n }\n }",
"public static function getUserComboList() { \n return Doctrine_Query::create()->select('u.id, SUBSTRING(u.username, 1, 25) as username')->from('sfGuardUser u')->orderBy('u.username');\n }",
"public function get_users()\n\t{\n\t\t$sql=\"SELECT * FROM waf_users WHERE 1=1\";\n\t\t$result=$this->db->LIST_Q($sql);\n\t\treturn $result;\n\t}",
"public function users(UserRequestParams $params) {\n $parameters = [\n 'pending' => $params->getPending(),\n 'branch_id' => $params->getBranchId(),\n 'selection_status' => $params->getSelectionStatus(),\n 'sort_attr' => $params->getSortAttr(),\n '$sort_dir' => $params->getSortDir(),\n 'page' => $params->getPage(),\n 'page_size' => $params->getPage(),\n 'search_text' => $params->getSearchText(),\n 'exclude' => $params->getExclude(),\n 'exclude_power_users_and_super_admins' => $params->getExcludePowerUsersAndSuperAdmins()\n ];\n\n return $this->docebo->get(self::PATH_LIST_USERS, $parameters);\n }",
"public function users_to_query()\n\t{\n\t\treturn array($this->get_data('from_user_id'));\n\t}",
"function getUsers()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`customers`\";\n\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $users = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $user = new UserEntity();\n $user->setIdUser($data->idUser);\n $user->setNom_societe($data->Nom_societe);\n $user->setAbreviations($data->Abreviations);\n $user->setAdresse($data->Adresse);\n $user->setTel($data->Tel);\n $user->setEmail($data->Email);\n $user->setSecteur($data->Secteur);\n $user->setCreatedAt($data->createdat);\n\n $users[] = $user;\n }\n\n if ($users) {\n return $users;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }",
"protected function queryUserAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n return $queryBuilder->select('*')\n ->from('User', 'u')\n ->innerJoin('u', 'Role','r','u.Role_ID = r.Role_ID' );\n }",
"function getAllUsersMatching($terms){\n\t\treturn $this->avalanche->getAllUsersMatching($terms);\n\t}",
"public function all()\n {\n return $this->newQuery('getUsers', ['type' => 'AllUsers']);\n }",
"public function selectAllUsers(){\r\n $userList = new UsersList();\r\n return $userList->selectAllUsers();\r\n }",
"public function getAllUsers()\n {\n $result = self::$dbInterface -> query(\"SELECT userID, userName, email FROM user\");\n return $result;\n }",
"public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }",
"public function findUsers();",
"public function findUsers();",
"public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }",
"public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }",
"public function getCompanyWithUsers();",
"public function getUsers($value = null)\n {\n $query = $this->createQueryBuilder('u')\n ->select('u.id as userid')\n ->addSelect('u.name')\n ->addSelect('u.last')\n ->addSelect('up.phone')\n ->addSelect('up.status')\n ->innerJoin('MainBundle:UserPhone', 'up', 'WITH', 'u.id = up.user');\n if($value['name']){\n $query->Where('u.name = :name')\n ->setParameter('name', $value['name']);\n }\n if($value['phone']){\n $query->andWhere('up.phone = :phone')\n ->setParameter('phone', $value['phone']);\n }\n \n return $query->getQuery()->getResult();\n }",
"public function getUsers()\n {\n return User::where('user_status', 1)->get();\n }",
"function findAllUsers() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM users;'));\r\n\r\n\t}",
"public function getUserList()\n {\n return $this->userDao->getUserList();\n }",
"public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }",
"public function getBranches()\n {\n return $this->hasMany(Branch::className(), ['id' => 'branch_id'])->viaTable('branch_user', ['user_id' => 'id']);\n }",
"public function getUsers()\n {\n $stmt = $this->DB->prepare(\"select user, hash from users\");\n $stmt->execute();\n // fetchall returns all records in the set as an array\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getAllUsers($parameters = array());",
"public function getUsersList()\n {\n }",
"public static function retrieveAllUsers() {\n return R::getAll('SELECT * FROM user');\n }",
"public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }",
"protected function _getQueryForUser() {\n\t\t$query = [\n\t\t\t'conditions' => [\n\t\t\t\t'User.id' => $this->request->params['user_id'],\n\t\t\t\t//@see https://github.com/NetCommons3/Users/blob/3.1.2/Controller/UsersController.php#L105-L111\n\t\t\t\t//@see https://github.com/NetCommons3/Users/blob/3.1.2/Model/Behavior/UserPermissionBehavior.php#L31-L33\n\t\t\t\t'User.is_deleted' => '0',\n\t\t\t],\n\t\t\t'recursive' => 0,\n\t\t\t'callbacks' => false,\n\t\t];\n\n\t\treturn $query;\n\t}",
"function _buildQueryUsers()\n\t{\n\t\t// Get the WHERE and ORDER BY clauses for the query\n\t\t$where = $this->_pending\n\t\t\t? $this->_buildContentWherePending()\n\t\t\t: $this->_buildContentWhere();\n\t\tif ($where === false)\n\t\t{\n\t\t\treturn 'SELECT 1 FROM #__users WHERE 1=0';\n\t\t}\n\n\t\t$query = 'SELECT ua.id, ua.name'\n\t\t\t. ' FROM #__flexicontent_files AS a'\n\t\t\t. ' LEFT JOIN #__users AS ua ON ua.id = a.uploaded_by'\n\t\t\t. $where\n\t\t\t. ' GROUP BY ua.id'\n\t\t\t. ' ORDER BY ua.name'\n\t\t\t;\n\t\treturn $query;\n\t}",
"public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }",
"Public Function getAllUsers()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user');\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}",
"public function fetchAllUsers()\n {\n return UserAuthorityModel::leftjoin('users', 'user_authorities.users__id', '=', 'users._id')\n ->where('user_authorities.user_roles__id', '!=', 1)\n ->select(\n __nestedKeyValues([\n 'users' => [\n '_id',\n 'status',\n ],\n 'user_authorities' => [\n 'user_roles__id',\n ]\n ])\n )\n ->get();\n }",
"function getUsers() {\n\n\tglobal $db;\n\treturn $db->getUsersByGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"public function getAllUsers(){\n\t\treturn $this->user;\n\t}",
"static function getUsers()\n\t{\n\t\t$dataBase = self::dbConnect();\n\t\t$request = $dataBase->query('SELECT login, email FROM users');\n\n\t\treturn $request;\n\t}",
"public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }",
"public function active()\n {\n return $this->newQuery('getUsers', ['type' => 'ActiveUsers']);\n }",
"public function users(Request $request)\n {\n $bandId = $request->query->getInt('bandId');\n /** @var UserBandRepository $repository */\n $repository = $this->getDoctrine()->getRepository(UserBand::class);\n\n $users = $repository->getBandUsers($bandId);\n return $this->json(\n [ 'success' => true,\n 'users' => $users,\n ]\n );\n }",
"public function recherche_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_get_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userGet ( $userdata );\n\t}",
"public function getAllUser(){\n return $this->users;\n }",
"function getUsers()\n {\n $users = User::where('users.department_info_id', '=', Auth::user()->department_info_id)\n ->where('users.user_type_id', '=', 1)\n ->where('users.status_work', '=', 1)\n ->get();\n return $users;\n }",
"public function get_app_users() {\n $this -> db -> select(\"users.Id,users.FirstName,users.LastName,CONCAT_WS( ' ', users.FirstName, users.LastName ) as FullName,users.Email,users.Mobile\");\n $this -> db -> where(\n array(\n 'users.IsActive'=>1,\n 'users.IsRemoved' => 0\n ));\n $whereCond = '( users.UserRole = 0 or users.UserRole = 4 )';\n $this -> db -> where($whereCond);\n \n $this-> db -> order_by(\"FullName\",\"ASC\");\n \n $query = $this -> db -> get('users');\n //echo $this->db->last_query();exit;\n return $query -> result_array();\n }",
"function getAll() {\r\n\t\t$cond = new Criteria();\r\n\t\t$alls = NewsletterUserPeer::doSelect($cond);\r\n\t\treturn $alls;\r\n }",
"public function getAllUsers() {\n $sql = \"SELECT `pk_users`, `name_users`, `password_users`, `mail_users`, `symbol_users`, `first_name_users`, `last_name_users` FROM `users`\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }",
"function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}",
"public function findBranchOfUser($userId){\n $this->Behaviors->load('Containable');\n $conditions = array('BoardUser.user_id'=>$userId);\n $contain = array('Board'=>['fields'=>['id']],'Board.Branch'=>array('fields'=>['id','title']));\n \n $results = $this->find('all',array(\n 'conditions'=>$conditions,\n 'recursive'=>2,\n 'contain'=>$contain\n ));\n\n \n $branch = array();\n foreach($results as $k=>$r){\n $branch['Branch'][$r['Board']['branch_id']] = $r['Board']['Branch'];\n }\n\n return $branch;\n }",
"public function getUsers() {\n \n // Call getAllUsers method in userDataService and set to variable\n $users = $this->getAllUsers();\n \n // Return array of users\n return $users;\n }",
"public function getUsersForHierarchyRanking() {\n // create hierarchy ranking query\n $hierarchy_ranking_query = Doctrine_Query::create()\n ->from('sfGuardUserProfile sgup')\n ->leftJoin('sgup.User sgu')\n ->where('sgup.accumulated_points > 0')\n ->andWhere('sgup.id=sgu.id')\n ->andWhere('sgu.is_disabled <> 1')\n ->andWhere('sgu.is_active = 1')\n ->groupBy('sgu.username')\n ->orderBy('sgup.accumulated_points DESC, sgu.username ASC');\n \n return $hierarchy_ranking_query;\n }",
"public function getUserList() {\n return $this->users;\n }",
"public function usersLogged(){\n $repository = $this->doctrine->getRepository('AppBundle:User');\n $users = $repository->getActive();\n \n return $users;\n }",
"public function getAllActiveUsers()\n {\n $connection = Db::getConnection();\n\n $userDataRecords = $connection->fetchAll(\n \"SELECT id, name, email \n FROM {$this->tableName} \n WHERE active = ?\", \n [1]\n );\n \n $userObjects = [];\n \n foreach($userDataRecords as $userData) {\n $userObjects[] = $this->initializeObject($userData);\n }\n\n return $userObjects;\n }",
"public function getUsers(){\n return self::getModel(\"users\", \"*\");\n }",
"public function getAllUsers() {\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM `tbl_users` WHERE `usr_type` = 0 ORDER BY `usr_id` ASC\");\n\t\t$stmt->execute();\n\t\t$result = getResult($stmt);\n\t\t$stmt->close();\n\t\treturn $result;\n\t}",
"public function getPartinUsersList(){\n return $this->_get(2);\n }",
"function getUsers(){\n }",
"function getUsers(){\n }",
"function getAllUsers(){\n\t\t\tglobal $db;\n\t\t\t\n\t\t\t$query = $db->query('SELECT * FROM user');\n\t\t\t$json = '{';\n\t\t\t\n\n\t\t\tif ($query->rowCount() > 0) {\n\t\t\t\t$json = $json . ' \"Users\" : [';\n\n\t\t\t\tforeach($query as $row) {\n\t\t\t\t\t$user = new user($row['Id'], null, null, 0, 0, null);\n\t\t\t\t\t\n\t\t\t\t\t$json = $json . $user->getUser() . \",\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$json = rtrim($json, ',');\n\t\t\t\t$json = $json . \" ] }\";\n\t\t\t\t\n\n\t\t\t\treturn $json;\n\t\t\t} else {\n\t\t\t return $json . ' \"Message\" : \"No users found\" }';\n\t\t\t}\n\t\t}",
"public static function getBusinessUsers()\n\t{\n\t\t$users = [];\n\t\t$option = Main\\Config\\Option::get('bitrix24', 'business_tools_unlim_users', false);\n\t\tif ($option)\n\t\t{\n\t\t\t$users = array_map('intVal', explode(\",\", $option));\n\t\t}\n\n\t\treturn $users;\n\t}",
"public function getUsers() {\n $sql = \"SELECT * from usertable\";\n foreach (parent::$this->db_connect->query($sql) as $row) {\n $dataSet[] = new user_model($row);\n }\n\n if (!empty($dataSet))\n return $dataSet;\n else\n return null;\n }",
"public function getUsers() {\n $userDAO = new UserDAO();\n return $userDAO->retrieveUsers();\n }",
"function getUsers(){\n\t\t$query = $this->db->get('usuarios');\n\t\tif($query->num_rows() > 0) return $query;\n\t\telse return NULL;\n\t}",
"public static function getUsers(){\n return self::find()->all();\n }",
"public function getUsers(){\n\t\t\t$users = $this->db->get(\"users\");\n\t\t\treturn $users;\n\t\t}",
"public function findUsers($args)\n {\n // Need read access to call this function\n if (!SecurityUtil::checkPermission(\"{$this->name}::\", '::', ACCESS_READ)) {\n return false;\n }\n\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n $dbtable = DBUtil::getTables();\n $userstable = $dbtable['users'];\n $userscolumn = $dbtable['users_column'];\n\n // Set query conditions (unless some one else sends a hardcoded one)\n $where = array();\n if (!isset($args['condition']) || !$args['condition']) {\n // Do not include anonymous user\n $where[] = \"({$userscolumn['uid']} != 1)\";\n\n foreach ($args as $arg => $value) {\n if ($value) {\n switch($arg) {\n case 'uname':\n // Fall through to next on purpose--no break\n case 'email':\n $where[] = \"({$userscolumn[$arg]} LIKE '%\".DataUtil::formatForStore($value).\"%')\";\n break;\n case 'ugroup':\n $uidList = UserUtil::getUsersForGroup($value);\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n break;\n case 'regdateafter':\n $where[] = \"({$userscolumn['user_regdate']} > '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'regdatebefore':\n $where[] = \"({$userscolumn['user_regdate']} < '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'dynadata':\n if ($useProfileMod) {\n $uidList = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata', array(\n 'dynadata' => $value\n ));\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n }\n break;\n default:\n // Skip unknown values--do nothing, and no error--might be other legitimate arguments.\n }\n }\n }\n }\n // TODO - Should this exclude pending delete too?\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . \")\";\n $where = 'WHERE ' . implode(' AND ', $where);\n\n $permFilter = array();\n $permFilter[] = array(\n 'realm' => 0,\n 'component_left' => $this->name,\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'uname',\n 'instance_middle' => '',\n 'instance_right' => 'uid',\n 'level' => ACCESS_READ,\n );\n $objArray = DBUtil::selectObjectArray('users', $where, 'uname', null, null, null, $permFilter);\n\n return $objArray;\n }",
"function getByCompanyForSelect(Company $company, User $user, $exclude_ids = null, $min_state = STATE_VISIBLE) {\n $users_table = TABLE_PREFIX . 'users';\n $project_users_table = TABLE_PREFIX . 'project_users';\n \n if($exclude_ids) {\n $conditions = DB::prepare(\"$users_table.company_id = ? AND $users_table.state >= ? AND $project_users_table.project_id = ? AND $project_users_table.user_id = $users_table.id AND $users_table.id NOT IN (?)\", $company->getId(), $min_state, $this->object->getId(), $exclude_ids);\n } else {\n $conditions = DB::prepare(\"$users_table.company_id = ? AND $users_table.state >= ? AND $project_users_table.project_id = ? AND $project_users_table.user_id = $users_table.id\", $company->getId(), $min_state, $this->object->getId());\n } // if\n \n return Users::getForSelectByConditions($conditions, $project_users_table);\n }",
"public function getAllUsers(): array\n {\n return $this->em->getRepository('AppBundle:User')->findAll();\n }",
"function &getUsers($uids)\n {\n $criteria = new CriteriaCompo();\n $criteria->add(new Criteria('uid', '(' . implode(',', $uids) . ')', 'IN'));\n $criteria->setSort('uid');\n\n $member_handler =& xoops_gethandler('member');\n $users =& $member_handler->getUsers($criteria, true);\n return $users;\n }",
"public function getUsers(){\n $sql=\"SELECT * FROM users\";\n $select=parent::connect_db()->prepare($sql);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }",
"Public Function getAllActiveUsers()\n\t{\n\t\t$Sql = \"SELECT \n\t\t\t\t\tbevomedia_user.*\n\t\t\t\tFROM \n\t\t\t\t\tbevomedia_user,\n\t\t\t\t\tbevomedia_tracker_clicks\n\t\t\t\tWHERE \n\t\t\t\t\t(deleted = 0) AND\n\t\t\t\t\t(bevomedia_tracker_clicks.user__id = bevomedia_user.id)\n\t\t\t\tGROUP BY\n\t\t\t\t\tbevomedia_tracker_clicks.user__id\n\t\t\t\t\";\n\t\t\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll($Sql);\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}",
"function get_users()\n {\n //Unimplemented\n }",
"public function get_users()\n\t{\n\t\t\n\t\t$query=$this->db->get('ag_users');\n\t\t\n\t\treturn $query->result() ;\n\t}",
"public function getUsers()\n\t{\n\t\t$insert = $this->inject();\n\t\t$injectURL = $this->url . $insert . 'user%2c password from users%23&Submit=Submit#';\n\t\treturn $injectURL;\n\t}",
"public function getUsers()\r\n {\r\n return $this->hasMany(User::className(), ['id' => 'user_id'])\r\n ->via('glu');\r\n }",
"protected function getAllUsers() {\n\t\t\t$query = \"SELECT username, f_name, l_name, phone, email FROM Stomper\";\n\t\t\treturn $this->EndpointResponse($query, true);\n\t\t}",
"public function selectAllUser(){\n return $this->connect->getData(\"SELECT * FROM `tbl_register_user`\");\n }",
"function fetchUsers()\r\n {\r\n $users = $this->DB->database_select('users', array('username', 'uid'));\r\n return $users;\r\n }",
"function getUsers ($walkId, $userId)\n {\n $getUsersQuery = $this->db->query(\"SELECT id,nickName,profilePicture, \n (select id from walkparticipants w \n WHERE w.walkId = '\".$walkId.\"' and \n w.participantId = u.id ) isInvited, \n (select status from walkparticipants w \n WHERE w.walkId = '\".$walkId.\"' and \n w.participantId = u.id ) status\n FROM user u where id != '\".$userId.\"'\");\n\n return $getUsersQuery->result();\n }",
"public function getAllUsers()\n {\n // Connect to db\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n // Get users from db\n $users = $user->findAll();\n return $users;\n }",
"public function getUsersFromLog()\n\t{\n\t\t$select = parent::select()->from($this,array('username'=>'username'))\n\t\t->distinct()->order(array(\"username asc\"));\n\t\t$results = self::fetchAll($select)->toArray();\n\t\t$res = array();\n\t\t\n\t\treturn $results;\n\t}",
"public function selectAllUser()\n {\n $req = $this->db->query('SELECT * FROM tbl_user ORDER BY LName');\n return $req;\n }",
"private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }",
"public function getAllUsers()\n {\n $sql = \"SELECT `user_id`, `user_fname`, `user_lname`, `user_password_hash`, `user_email`, `user_role` FROM users\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }",
"public function getAllUser(){\n $users = $this->bdd->query('SELECT * FROM users');\n $users->execute();\n\t\treturn $users->fetchALL(\\PDO::FETCH_ASSOC);\n }",
"public function getAllUsers()\n\t{\n\t\t$users = $this->fetchAll();\n\t\t\n\t\treturn $users;\n\t}",
"public function get_user($cabang_cross = NULL)\n {\n //Secara default memunculkan list cabang si user\n if ($cabang_cross == NULL) {\n $cabang_cross = $this->fungsi->user_login()->id_branch;\n }\n $data = $this->user_model->get_all(['users.id_branch' => $cabang_cross]);\n echo json_encode($data->result());\n }",
"function get_users()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = $db->query(\"SELECT * FROM users\");\n\t\t\n\t\treturn $db->results($query);\n\t}",
"public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}"
] | [
"0.652172",
"0.6406769",
"0.63893676",
"0.6243423",
"0.5955821",
"0.5922144",
"0.58860856",
"0.588534",
"0.588534",
"0.588534",
"0.58408",
"0.5833292",
"0.580099",
"0.57879907",
"0.5785123",
"0.5784147",
"0.5771292",
"0.5766113",
"0.5763777",
"0.5758388",
"0.5737733",
"0.5737332",
"0.57096326",
"0.5705652",
"0.57055086",
"0.57055086",
"0.57004523",
"0.56925154",
"0.56890357",
"0.5672985",
"0.56542504",
"0.5648118",
"0.5636917",
"0.56338674",
"0.56337625",
"0.56251806",
"0.56238335",
"0.5613684",
"0.5601191",
"0.55862916",
"0.5579343",
"0.5575304",
"0.5567706",
"0.556339",
"0.55604887",
"0.55477905",
"0.5545137",
"0.5536757",
"0.5518487",
"0.550371",
"0.54942626",
"0.54933596",
"0.5493026",
"0.5489627",
"0.5481909",
"0.54712313",
"0.5470099",
"0.54693806",
"0.54610395",
"0.5458666",
"0.54546726",
"0.5452243",
"0.54496384",
"0.5446401",
"0.5446376",
"0.5443922",
"0.5440557",
"0.54368705",
"0.54368705",
"0.5436224",
"0.5435524",
"0.5426905",
"0.5426341",
"0.5415783",
"0.5409697",
"0.5407742",
"0.5402694",
"0.53982663",
"0.5398215",
"0.5396993",
"0.5396455",
"0.53922474",
"0.5389272",
"0.53884786",
"0.53884447",
"0.53879046",
"0.53874254",
"0.5384444",
"0.53814244",
"0.5380602",
"0.5379053",
"0.53720784",
"0.53699726",
"0.53654164",
"0.53602123",
"0.5355115",
"0.5336959",
"0.5326483",
"0.5325901",
"0.53114647"
] | 0.7455023 | 0 |
Gets query for [[Branches]]. | public function getBranches()
{
return $this->hasMany(Branch::className(), ['id' => 'branch_id'])->viaTable('branch_user', ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBranches();",
"public function getAllBranches() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_branch AS b';\n\t\t\t$select_what\t= 'b.id, b.vc_branch AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_branch ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"public function getAllBranches()\n {\n $sql = \"SELECT * FROM branch\";\n $values=array();\n \n $branches=$this->getInfo($sql,$values);\n\n return $branches;\n }",
"public function getAllBranches() {\n\t\t\t$dbFunctions\t= new dbFunctions();\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\n\t\t\t$table\t\t\t= 'tb_branch';\n\t\t\t$select_what\t= '*';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_branch\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"public function getBranches()\n {\n $repository = Repository::find(request('repository_id'));\n\n return $this->github->getBranches($repository->owner, $repository->name);\n }",
"function get_all_branches()\r\r\n\t{\r\r\n\t\t$query = $this->db->get($this->_table_branches);\r\r\n\t\t\r\r\n\t\t// Check if Result is Greater Than Zero\r\r\n\t\tif($query->num_rows() > 0)\r\r\n\t\t{\r\r\n\t\t\treturn $query->result();\r\r\n\t\t}\r\r\n\t}",
"public function getBranches(){\r\n\r\n $sql = \"SELECT name , id FROM branch ORDER BY id\";\r\n\r\n $stmt = $this->connect()->prepare($sql);\r\n\r\n $stmt->execute();\r\n $i=0;\r\n\r\n while($row=$stmt->fetch()){\r\n $branch[$i]=$row;\r\n $i++;\r\n }\r\n \r\n return($branch);\r\n }",
"public function allBranches()\n {\n $client = new Client();\n \t$response = $client->request('GET', 'http://www.dpdparcelshop.cz/api/get-all');\n $statusCode = $response->getStatusCode();\n \t$body = $response->getBody()->getContents();\n\n $result = json_decode($body);\n if($result->code != 200){\n return 'External service error';\n }\n\n\n $branches = array();\n foreach($result->data->items as $item){\n $branch = new BranchModel($item);\n array_push($branches, $branch->getBranchData());\n }\n return $branches;\n }",
"function ngGetBranches()\n\t{\n\t\t$where = array('status_id !=' => DELETE);\n\t\t$select = '*';\n\t\t$records = 2;\n\t\t$branches = $this->base_model->getCommon($this->primaryTable, $where, $select, $records);\n\t\t$pageData['branches'] = json_encode($branches);\n\t\t$response = array('status' => true, 'message' => 'Branchs found successfully.', 'data' => $branches);\n\t\techo json_encode($response);\n\t}",
"function _versioncontrol_git_log_get_branches() {\n $logs = _versioncontrol_git_log_exec('git show-ref --heads'); // Query branches.\n $branches = _versioncontrol_git_log_parse_branches($logs); // Parse output.\n return $branches;\n}",
"public function getUlozenkaBranches(Request $request) {\n $session = $request->getSession();\n $query = $request->request->get('search'); //ziskaj query\n $branchList = array();\n $response = $this->getRequestAPI('https://www.ulozenka.cz/gmap'); //volaj getRequestApi z ApiController.php\n foreach ($response as $cell){ //prechadzaj feed po bunkach\n if((isset($query)) && ($query != \"\") && (strpos($cell[\"name\"],$query)) === false) continue; //ak bola zadana query, tak pokracuj len ak sa achadza v adrese, inak preskoc iteraciu\n $branch = new BranchModel; //alokuj a napln model\n $branch->setInternalId($cell[\"id\"]);\n $branch->setInternalName($cell[\"shortcut\"]);\n $branch->setAddress($cell[\"name\"]);\n $branch->setWeb($cell[\"odkaz\"]);\n $branch->setLocation($cell[\"lat\"],$cell[\"lng\"]);\n $branch->setBusinessHours($cell[\"openingHours\"]);\n if (empty($cell[\"announcements\"]) == false) //v zadani je BranchModel->\"string announcement\", takze vyberam text prveho oznamu, ak existuje\n {\n $branch->setAnnouncement($cell[\"announcements\"][0][\"text\"]);\n }\n $branch->setActive($cell[\"active\"]);\n $branch->setPublic($cell[\"public\"]);\n array_push($branchList,$branch); //pushni do pola BranchModelov\n }\n if (empty($query)){ //ak nebolo zadane query\n return $this->render('listing.html.twig',['branches' => $branchList]);\n }\n else{ //ak bolo zadane query\n return $this->render('listing.html.twig',['branches' => $branchList, 'query' => $query]);\n }\n }",
"public function getBranchesBranch()\n {\n return $this->hasOne(Branches::className(), ['branch_id' => 'branches_branch_id']);\n }",
"public function index() {\n return Branch::all();\n }",
"public function getBranchInfo()\n {\n $this->db->select('*');\n $this->db->where('komoku_id', KOMOKU_SHOUSHA);\n $result = $this->db->get('m_komoku');\n return $result->result_array();\n }",
"public function branches()\n {\n return $this->_refs('heads');\n }",
"public function getSearchBranch()\n {\n return $this->search_branch;\n }",
"private function _getBranches()\n\t{\n\t\t// If we don't have a configuration file for the repository PANIC!\n\t\tif (!file_exists($this->_root . '/.git/config'))\n\t\t{\n\t\t\tthrow new RuntimeException('Not a valid Git repository at ' . $this->_root);\n\t\t}\n\n\t\t// Initialize variables.\n\t\t$branches = array();\n\n\t\t// Parse the repository configuration file.\n\t\t$config = parse_ini_file($this->_root . '/.git/config', true);\n\n\t\t// Go find the remotes from the configuration file.\n\t\tforeach ($config as $section => $data)\n\t\t{\n\t\t\tif (strpos($section, 'branch ') === 0)\n\t\t\t{\n\t\t\t\t$branches[] = trim(substr($section, 7));\n\t\t\t}\n\t\t}\n\n\t\treturn $branches;\n\t}",
"private function branches()\r\n {\r\n return (isset($this->_session[$this->_branchKey]) ?\r\n $this->_session[$this->_branchKey] : []);\r\n }",
"public function getBranch()\n {\n return $this->branch;\n }",
"public function getBranch()\n {\n return $this->branch;\n }",
"public function getBranchOf()\n {\n return $this->branchOf;\n }",
"public function searchByReference($reference)\n {\n return $this->call('GET', \"/branches/search.json?reference={$reference}\");\n }",
"public function getBranch()\n {\n return $this->_options['branch'];\n }",
"public function branches(Request $request){\n $language = ($request->header(\"X-Language\")) ?? 'en';\n $store = Store::where('id',$request->store_id)->first();\n\n if( !$store ){\n return $this->errorResponse(trans('messages.store.notfound'),null,404);\n }\n\n $city = City::where('id',$request->city_id)->first();\n\n if( !$city ){\n return $this->errorResponse(trans('messages.city.notfound'),null,404);\n }\n\n $branches = Branch::where('city_id',$request->city_id)\n ->where('store_id',$request->store_id)\n ->with('region')\n ->get();\n $branches = $this->toLang( $language, $branches, false);\n\n $branches = $branches->map(function ($item) use($language) {\n \n $region = $item->region;\n $region = $this->toLang( $language, $region, true);\n return $item;\n });\n return $this->dataResponse($branches,null,200);\n\n }",
"public function get($id)\n {\n Assert::integerish($id, __METHOD__ . ' expects an $id as an integer');\n return $this->call('GET', \"/branches/{$id}.json\");\n }",
"public function branches()\n\t{\n return $this->belongsToMany('App\\Models\\Admin\\Branch');\n //->where('has_buffet_service', 1);\n }",
"public function actionIndex()\n {\n $searchModel = new BranchSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function branches(District $district)\n {\n $branch = $district->branch()->orderBy('id', 'desc')->paginate(10);\n return response()->json($branch);\n }",
"function get_all_branch_wilayah()\n {\n \t$param = array();\n\t\t$branch_code = $this->session->userdata('branch_code');\n\t\t$flag_all_branch = $this->session->userdata('flag_all_branch');\n\n $sql = \"SELECT \n \t\t\t\t branch_id\n \t\t\t\t,branch_code \n \t\t\t\t,branch_name\n \t\tFROM \n \t\t\t\t mfi_branch\n\t\t\t\tWHERE \n\t\t\t\t\t\tbranch_class=1\n\t\t\t\t\";\n\n\t\tif($flag_all_branch!='1'){ // tidak punya akses seluruh cabang\n\t\t\t$sql .= \" AND branch_code in(select branch_code from mfi_branch_member where branch_induk=?)\";\n\t\t\t$param[] = $branch_code;\n\t\t}\n\n\t\t$sql .= \" ORDER BY 2 \";\n\n\t\t$query = $this->db->query($sql,$param);\n\n\t\treturn $query->result_array();\n }",
"public function getBranch()\n {\n return $this->hasOne(CompanyBranches::className(), ['BranchID' => 'BranchID']);\n }",
"public function getBranchList($branch_id = 0)\n\t{\n\n\t\tif($branch_id > 0)\n\t\t{\n\t\t\t$this->db->where('id > ',$branch_id);\n\t\t}\n\t\t\n\t\t$query1 = $this->db->get('tbl_branch');\n\n\t\t$data = $query1->result();\n\n\t\techo $myJSON = json_encode($data);\n\t}",
"public function company_lookup_branch() {\n $this->layout = 'ajax';\n $this->loadModel('Branch');\n $branches = $this->Branch->find('all', array(\n 'conditions' => array('Branch.comp_id' => $this->Auth->user('id'))\n ));\n $this->set('branch', $branches);\n }",
"public function fetchAllBranches($degreeId){\n \t global $sessionHandler;\n \t$query =\"SELECT\n \t\t\tDISTINCT\t\n \t\t\tb.branchId,b.branchCode \n \t\tFROM\t`branch` b , `class` c\n \t\tWHERE\tc.branchId = b.branchId\n \t\tAND\tc.instituteId = '\".$sessionHandler->getSessionVariable('InstituteId').\"'\n \t\tAND\tc.degreeId = $degreeId\n \t\tORDER BY b.branchCode ASC\n \t\t\";\n \t\t\n \treturn SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }",
"function particularbranch($id)\n\t{\n\t\t$getParsubbrand=\"SELECT * from brand where brand_id = $id\";\n\t\t$subbrand_data=$this->get_results( $getParsubbrand );\n\t\treturn $subbrand_data;\n\t}",
"public function findbranch()\n\t{\n\t\t$post = $this->input->post();\n\t\t$data = $this->AjaxDB->findBranch(['course'=>$post['id']]);\n\t\t$d[] = 'Choose Branch';\n\t\tif (!empty($data)) {\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$d[$value->id] = $value->branch_name;\n\t\t\t}\n\t\t}\n\t\t$result = form_dropdown('branch',$d,'',['class'=>'form-control input-sm','id'=>'bid']);\n\t\techo $result;\n\t}",
"public function getAvailableTubeFromAllBranches_get(){\n $material_id = $_GET['material_id'];\n $Material_ID = $_GET['material_ID'];\n $Material_OD = $_GET['material_OD'];\n $material_Length = $_GET['material_Length'];\n $MaterialCategory = $_GET['MaterialCategory'];\n $response = $this->ManageEnquiry_model->getAvailableTubeFromAllBranches($material_id, $Material_ID, $Material_OD,$material_Length,$MaterialCategory);\n return $this->response($response);\n }",
"public function model()\n {\n return Branch::class;\n }",
"public function list_remote_branches() {\n\t\t\t$branchArray = explode(\"\\n\", $this->run(\"branch -r\"));\n\t\t\tforeach ($branchArray as $i => &$branch) {\n\t\t\t\t$branch = trim($branch);\n\t\t\t\tif ($branch == \"\" || strpos($branch, 'HEAD -> ') !== false) {\n\t\t\t\t\tunset($branchArray[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $branchArray;\n\t\t}",
"public function getBranch($branch_id) {\r\n\r\n $sql = \"SELECT name FROM branch WHERE id=?\";\r\n\r\n $stmt = $this->connect()->prepare($sql);\r\n\r\n $stmt->execute([$branch_id]);\r\n\r\n return ($stmt->fetch());\r\n }",
"public function run()\n {\n $branches = [\n [\n 'name' => '199 Quang Trung',\n 'phone_number' => '0987654321',\n 'address' => 'Quận Hà Đông, TP Hà Nội',\n 'city_id' => 24\n ],\n [\n 'name' => '86 Nguyễn Trãi',\n 'phone_number' => '0987654322',\n 'address' => 'Quận Thanh Xuân, TP Hà Nội',\n 'city_id' => 24\n ],\n [\n 'name' => '216 Cầu Giấy',\n 'phone_number' => '0987654323',\n 'address' => 'Quận Cầu Giấy , TP Hà Nội',\n 'city_id' => 24\n ],\n [\n 'name' => '21A Lê Lợi, P. Thạch Thang',\n 'phone_number' => '0987654324',\n 'address' => 'Quận Hải Châu, TP Đà Nẵng',\n 'city_id' => 15\n ],\n [\n 'name' => '517 Quang Trung',\n 'phone_number' => '0987654325',\n 'address' => ' Quận Thanh Khê, TP Đà Nẵng',\n 'city_id' => 15\n ],\n [\n 'name' => '539B Nguyễn Thị Thập',\n 'phone_number' => '0987654326',\n 'address' => 'Quận Vĩnh Trung, TP Đà Nẵng',\n 'city_id' => 15\n ],\n [\n 'name' => '182 Lê Lai, P. Bến Thành',\n 'phone_number' => '0987654327',\n 'address' => 'Quận 1, TP HCM',\n 'city_id' => 60\n ],\n [\n 'name' => '01 Trần Minh Quyền, P. 10',\n 'phone_number' => '0987654328',\n 'address' => 'Quận 10, TP HCM',\n 'city_id' => 60\n ],\n [\n 'name' => '202 Lê Văn Sỹ, P. 10',\n 'phone_number' => '0987654329',\n 'address' => 'Quận Phú Nhuận, TP HCM',\n 'city_id' => 60\n ]\n ];\n\n DB::table('branches')->insert($branches);\n }",
"public function show($id)\n {\n return Branch::find($id);\n \n\n }",
"public function getAllBranches($branchID = false)\n {\n $this->_message = false;\n\n $condition = ($branchID == false) ? false : \"AND id = '{$branchID}'\";\n\n $stmt = $this->db->prepare(\n \"SELECT * FROM branches WHERE clientId='{$this->clientId}' AND deleted='0' {$condition}\"\n );\n\n if ($stmt->execute()) {\n $this->_message = $stmt->fetchAll(PDO::FETCH_OBJ);\n }\n\n return $this->_message;\n }",
"protected function getBranch()\n {\n $branches = $this->terminal->run($this->git->branch());\n\n preg_match('/\\*\\s([\\w]*)/', $branches, $matches);\n \n if (!empty($matches[1])) {\n $this->branch = $matches[1];\n }\n \n $this->output->write('<info>' . $this->branch . '</info>' . PHP_EOL);\n }",
"function selectAll(){\r\n $query = \"SELECT B.branchName, S.*\r\n FROM branches AS B, userschedules AS S \r\n WHERE S.organizationId = $this->organizationId\r\n AND B.organizationId = S.organizationId\r\n AND B.branchId LIKE S.branchId\r\n AND S.locationCode LIKE '$locationCode' \r\n AND S.userName = '$this->userName'\r\n AND S.date BETWEEN '\".date('Y-m-d',strtotime($this->fromDate)).\"' AND '\".date('Y-m-d',strtotime($this->toDate)).\"'\r\n ORDER BY S.date, S.branchId, S.locationCode\";\r\n include(\"includes/dbConnection.php\");\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: SELECT query failed.\");\r\n $result = $executeQuery->fetchAll(PDO::FETCH_BOTH);\r\n return $result;\r\n }",
"function test_get_branch()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes();\r\n\t\t$branch = $this->_tree->get_branch($npl, true);\r\n\t\t$this->assertEqual($allnodes, $branch, 'Result differs from getAllNodes()');\r\n\t}",
"public function search(Request $request){\n\t\t$search = $_GET['search'];\n\t\t$branchs = Branches::where('branch_name', 'LIKE', '%'.$search.'%')\n\t\t->orWhere(\"branch_id\", \"LIKE\", '%'.$search.'%')\n\t\t->get();\n\t\techo \"<ul class='table'>\";\n\t\tforeach ($branchs as $key => $branch) {\n\t\t\techo \"<li><a href='\".url('/view/').'/'.$branch->branch_id.\"'>\";\n\t\t \techo $branch->branch_name;\n\t\t \techo \"</a></li>\";\n\t\t } // Here return all data by json formet\n\t\t echo \"</ul>\";\n\t\t// echo \"<pre>\";\n\t\t//print_r($branch);\n\t\t\n\t}",
"public function show($id) {\n return Branch::firstOrFail($id);\n }",
"public function company_showLookupBranch() {\n $this->layout = 'ajax';\n $this->loadModel('Branch');\n if (!empty($_POST)) {\n $findBranch = $this->Branch->findById($_POST['data']['Branch']['check']);\n $this->set('findBranch', $findBranch);\n }\n }",
"public function customerBranches(Request $request)\n {\n $debtor_no = $request['debtor_no'];\n $data['status_no'] = 0;\n $branchs = '';\n $result = DB::table('cust_branch')->select('customer_id', 'id', 'br_name')->where('customer_id', $debtor_no)->orderBy('br_name', 'ASC')->get();\n if (!empty($result)) {\n $data['status_no'] = 1;\n foreach ($result as $key => $value) {\n $branchs .= \"<option value='\" . $value->id . \"'>\" . $value->br_name . \"</option>\";\n }\n $data['branchs'] = $branchs;\n }\n return json_encode($data);\n }",
"public function getBranch() /*: string*/ {\n if ($this->branch === null) {\n throw new \\Exception(\"Branch is not initialized\");\n }\n return $this->branch;\n }",
"public function getAll()\n {\n $query = $this->m_building_block_status->getAll();\n\n // Return the result\n return $query;\n }",
"public function fetchCommitBranches(string $hash) : array\n {\n $branches = [];\n $output = [];\n exec($this->makeCmd(\"branch --remotes --contains $hash\"), $output);\n foreach ($output as $branch) {\n if (strpos($branch, '/HEAD') > 0) {\n continue;\n }\n $branches[] = $branch;\n }\n\n return $branches;\n }",
"public function getBranches($json = true)\n {\n $branches = array();\n\n $CSO = $this->getResource('CSO');\n $branches = array_merge($branches, $CSO->getBranches());\n\n $OpenOnderwijs = $this->getResource('OpenOnderwijs');\n $branches = array_merge($branches, $OpenOnderwijs->getBranches());\n\n // prevent duplicated\n $branches = array_unique($branches);\n $branches = array_values($branches);\n\n if($json === true)\n {\n return $this->output($branches);\n }\n else\n {\n return $branches;\n }\n }",
"public function get_branch_location() {\n $data['category_branch_location'] = $this->Category_model->get_branch_location();\n return $data['category_branch_location'];\n }",
"public function getBranchID()\n {\n return $this->BranchID;\n }",
"function getAllBands() {\n return $this->Band->getAllBands();\n }",
"public function branch() {\r\nreturn $this->db->get('branch')->result();\r\n}",
"public function getQueryBuilder();",
"public function getQueryBuilder();",
"public function getBranchId()\n {\n return $this->branch_id;\n }",
"public function importBranches()\n {\n // $Formulas->importFormulas();\n // $FormulaRows = new \\App\\SImportations\\SImportFormulaRows($this->sHost);\n // return $FormulaRows->importFormulaRows();\n $branch = new SImportBranches($this->sHost);\n return $branch->importBranches();\n }",
"public function getQuery(){\n \n return $this->query;\n \n }",
"public function branchListing() {\n $postData = Input::all();\n if (!empty($postData)) {\n $branch_code = trim(Input::get('branch_code'));\n $branch_name = trim(Input::get('branch_name'));\n $checkStatus = $this->db2->select($this->db2->raw('select count(id) as count from hr_branch where branch_code=\"' . $branch_code . '\" OR branch_name=\"' . $branch_name . '\"'));\n if ($checkStatus[0]->count == 0) {\n $postData['branch_code'] = $branch_code;\n $postData['branch_name'] = $branch_name;\n $insertStatus = $this->db2->table('hr_branch')->insert($postData);\n if ($insertStatus)\n return Redirect::to('branch/branch-list')->with('successalert', 'Branch added successfully');\n } else {\n return Redirect::to('branch/branch-list')->with('erroralert', 'Branch Code OR Branch Name already exists');\n }\n }\n $getBranch = $this->db2->table('hr_branch')->select('id', 'branch_name', 'branch_code', 'address')->get();\n return View::make('settings/branch.branch')->with(array('branch_list' => $getBranch));\n }",
"function getClientBranch($username){\n\n global $db;\n\n $stmt= $db->prepare('SELECT client_branch\n FROM client\n JOIN\n (\n SELECT client_id AS client\n FROM person\n JOIN\n client ON client_id = person_id\n WHERE username = ?\n )\n ON client_id = client');\n\n\n $stmt->execute(array($username));\n\n return $stmt->fetch();\n }",
"public function index()\n\t{\n\t\t$branches = Branches::orderBy('branch_name','asc')->paginate();\n\t\treturn View::make('branches.index')->with(array(\n\t\t\t\t\t\t'branches' => $branches\n\t\t\t\t\t));\n\t}",
"protected function _getBrowseQuery()\n {\n if (!$this->_browseQuery) {\n $query = $this->_getTable()->select();\n \n $query = $this->_appendOrderByClause($query);\n \n $this->_browseQuery = $query;\n }\n \n return $this->_browseQuery; \n }",
"public function list_branches($keep_asterisk = false) {\n\t\t\t$branchArray = explode(\"\\n\", $this->run(\"branch\"));\n\t\t\tforeach ($branchArray as $i => &$branch) {\n\t\t\t\t$branch = trim($branch);\n\t\t\t\tif (! $keep_asterisk) {\n\t\t\t\t\t$branch = str_replace(\"* \", \"\", $branch);\n\t\t\t\t}\n\t\t\t\tif ($branch == \"\") {\n\t\t\t\t\tunset($branchArray[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $branchArray;\n\t\t}",
"function getBrands()\n {\n $returned_brands = $GLOBALS['DB']->query(\"SELECT brands.* FROM stores\n JOIN stores_brands ON (stores.id = stores_brands.store_id)\n JOIN brands ON (stores_brands.brand_id = brands.id)\n WHERE stores.id = {$this->getId()};\");\n\n $brands = array();\n foreach($returned_brands as $brand) {\n $brand_name = $brand['brand_name'];\n $id = $brand['id'];\n $new_brand = new Brand($brand_name, $id);\n array_push($brands, $new_brand);\n }\n return $brands;\n }",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getBranch()\n {\n return new GitBranch($this->getProjectBase());\n }",
"public function getSource()\n {\n return 'branch';\n }",
"public function storesBranches(Request $request,$store_id){\n $language = ($request->header(\"X-Language\")) ?? 'en';\n $store = Store::where('id',$store_id)->first();\n\n if( !$store ){\n return $this->errorResponse(trans('messages.store.notfound'),null,404);\n }\n\n $cities = $store->cities()->get();\n \n $cities = $this->toLang( $language, $cities, false);\n $cities = $cities->map(function ($item) use($store_id,$language) {\n $branches = Branch::where('store_id',$store_id)\n ->where('city_id',$item->id)->get();\n $branches = $this->toLang( $language, $branches, false);\n //To get region name and translate it\n foreach ($branches as $branch) {\n $region = $branch->region;\n $region = $this->toLang( $language, $region, true);\n }\n $item['branches'] = $branches;\n return $item;\n });\n \n return $this->dataResponse($cities,null,200);\n }",
"public function index()\n {\n $branches = Branch::all();\n return View::make('branches.index', compact('branches'));\n }",
"public function getBranch(NodeInterface $node)\r\n {\r\n $params = compact('node');\r\n $event = $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this, $params);\r\n if ($event->stopped()) {\r\n return $event->last();\r\n }\r\n\r\n $result = $this->mapper->getBranch($node);\r\n\r\n $params['__RESULT__'] = $result;\r\n $this->getEventManager()->trigger(__FUNCTION__.'.post', $this, $params);\r\n\r\n return $result;\r\n }",
"public function showSelectBranch(Request $request)\n\t{\n\t\tif (!(bool) current($request->attributes)) {\n\t\t\t$oBranch = new Branch();\n\n\t\t\treturn view('admin.branch-select')->with([\n\t\t\t\t'aEnabledBranches' => $oBranch->getEnabled()\n\t\t\t]);\n\t\t} else {\n\t\t\treturn redirect('/admin/appointments');\n\t\t}\n\t}",
"public function getQuery() : QueryBuilder\n {\n return $this->query;\n }",
"public function list_cabang()\n\t{\n\t\tif($this->is_login){\n\t\t\t$branches = $this->M_branch->getAll();\n\t\t\t// Set Response\n\t\t\t$this->response_code = 200;\n\t\t\t$this->response['status'] = TRUE;\n\t\t\t$this->response['data'] = $branches;\n\t\t}\n\n\t\t// Run the Application\n\t\t$this->run(SECURED);\n\t}",
"public function branch()\n\t{\n\t\treturn $this->hasOne('App\\Models\\Branch', 'id', 'branch_id');\n\t}",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function getQuery() {\n return $this->query;\n }",
"public function get_query(){\n return $this->build_query()->query;\n }",
"public function getQuery(): Builder;",
"public function getBranchDetails_post()\n {\n\t\t$token = '1';\n\t\t//$tokens = AUTHORIZATION::validateToken($token);\n\t\t// print_r(getallheaders());\n\t\t// echo $token;die();\n\t\t//print_r($tokens);die;\n $requestedBy = $this->post('requestedBy');\n $getBranch = $this->branch_model->getBranch($requestedBy);\n if ($getBranch['branchStatus'])\n {\n // Set the response and exit\n $this->response($getBranch);\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'message' => 'No records found!',\n 'branchStatus' => false\n ]);\n }\n }",
"public function getBranchArray($id = 1){\n\n $query = \"\n SELECT\n `structure`.`id`,\n `structure_data`.`sort`,\n `structure_data`.`name`,\n `structure_data`.`path`,\n `structure_data`.`publish`\n FROM\n `structure`,\n `structure_data`\n WHERE\n `structure`.`pid` = \".$id.\" &&\n `structure`.`id` = `structure_data`.`id`\n ORDER BY\n `structure_data`.`sort` ASC\n \";\n $result = mysql_query($query);\n\n\n $array = array();\n\n while($row = mysql_fetch_assoc($result)){\n array_push($array, array(\n 'node' => $row,\n 'childrens' => $this->getBranch($row['id'])\n )\n );\n }\n\n return $array;\n }"
] | [
"0.7334657",
"0.7314451",
"0.7273982",
"0.72302026",
"0.708368",
"0.63874584",
"0.6365511",
"0.634872",
"0.62989163",
"0.6266081",
"0.6158412",
"0.60645807",
"0.60439175",
"0.5937598",
"0.5901767",
"0.58994997",
"0.57146263",
"0.567026",
"0.56433",
"0.56433",
"0.5586284",
"0.5559709",
"0.55322045",
"0.5520514",
"0.5461101",
"0.5450177",
"0.54220396",
"0.54220074",
"0.5380565",
"0.5380061",
"0.5369656",
"0.5336657",
"0.52954936",
"0.52826536",
"0.5259357",
"0.52509964",
"0.5238391",
"0.5231984",
"0.52264464",
"0.5215513",
"0.5202273",
"0.51933414",
"0.5177192",
"0.51333284",
"0.51156294",
"0.50968266",
"0.5095014",
"0.5082546",
"0.50729287",
"0.50433064",
"0.50419414",
"0.50100124",
"0.49846506",
"0.4968269",
"0.49646962",
"0.49399737",
"0.49162278",
"0.49142155",
"0.49142155",
"0.4894342",
"0.48941714",
"0.48826486",
"0.48743084",
"0.48573506",
"0.4820889",
"0.4817325",
"0.48032665",
"0.4790396",
"0.4780174",
"0.4780174",
"0.4780174",
"0.4780174",
"0.4780174",
"0.4780174",
"0.4780174",
"0.4780174",
"0.4780174",
"0.477729",
"0.47736084",
"0.47710186",
"0.4755201",
"0.47532895",
"0.47491556",
"0.47380072",
"0.47352538",
"0.47288007",
"0.47189674",
"0.47189674",
"0.47189674",
"0.47189674",
"0.47189674",
"0.47189674",
"0.47189674",
"0.47189674",
"0.47189674",
"0.4704212",
"0.46985775",
"0.4697783",
"0.46904442",
"0.4688253"
] | 0.6345976 | 8 |
Gets query for [[MenuCooks]]. | public function getMenuCooks()
{
return $this->hasMany(MenuCook::className(), ['cook_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQueryMenus();",
"public function get_book()\n {\n $sql = DB::select('select * from books');\n return $sql;\n }",
"public function getBooks()\n {\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $this->limit = isset($_GET['limit']) ? $_GET['limit'] : $this->limit;\n $offset = $this->limit * ($page - 1);\n\n\n if (USE_ONE_TABLE) {\n $this->table = 'books_authors';\n $sql = \"SELECT * FROM $this->table WHERE `deleted` is NULL LIMIT :limit OFFSET :offset\";\n } else {\n $this->table = 'relations';\n $sql = \"SELECT books.id, book_name, GROUP_CONCAT(name_author SEPARATOR ', ') as 'author' , year, num_pages, about_book, deleted, views, clicks, image\n FROM books \n JOIN relations ON book_id = books.id\n JOIN authors ON authors.id = author_id\n WHERE deleted is NULL \n GROUP BY id\n LIMIT :limit OFFSET :offset\";\n }\n\n $params = [\n [\":limit\", $this->limit, \\PDO::PARAM_INT],\n [\":offset\", $offset, \\PDO::PARAM_INT]\n ];\n return $this->bindAndQuery($sql, $params);\n }",
"public function getAllBooks(){\n $query = \"SELECT * FROM Book;\";\n return $this->getBookDetail($query);\n }",
"public function getBooks()\n {\n $sql = 'SELECT bookshop_books.id,\n bookshop_books.description,\n bookshop_books.booksName,\n bookshop_books.pubyear,\n bookshop_discounts.id AS discountsId,\n bookshop_discounts.discountsName,\n bookshop_discounts.percent,\n bookshop_books.price,\n bookshop_authors.id AS idAuthors,\n bookshop_authors.authorsName,\n bookshop_genres.id AS idGenres,\n bookshop_genres.genresName\n FROM bookshop_books_to_authors\n INNER JOIN bookshop_books\n ON bookshop_books_to_authors.id_book = bookshop_books.id\n INNER JOIN bookshop_books_to_genres\n ON bookshop_books_to_genres.id_book = bookshop_books.id\n INNER JOIN bookshop_authors\n ON bookshop_books_to_authors.id_author = bookshop_authors.id\n INNER JOIN bookshop_genres\n ON bookshop_books_to_genres.id_genre = bookshop_genres.id\n INNER JOIN bookshop_discounts\n ON bookshop_books.id_discount = bookshop_discounts.id';\n \n $result = $this->db->execute($sql);\n\n if (!$result)\n return $this->error();\n\n return $this->formingBooks($result);\n }",
"protected function _getQuery()\n {\n return Mage::helper('catalogsearch')->getQuery();\n }",
"public function query() {\n $query = parent::query();\n // Add in book parent child relationships.\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n return $query;\n }",
"public function get_book();",
"public function query() {\n $query = parent::query();\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n return $query;\n }",
"function GetMenu()\n {\n $sql = \"SELECT\n title,\n slug,\n id\n FROM\n pages\";\n $this->setSql($sql);\n return $this->getAll();\n }",
"public function getMenus()\n {\n return $this->hasMany(Menu::className(), ['id' => 'menu_id'])->viaTable('menu_cook', ['cook_id' => 'id']);\n }",
"public function getAllBooks(){\n return $this->libros;\n }",
"public function getEx11() {\n $books = \\App\\Book::orderBy('title','asc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `title` asc\n }",
"function getMenuItems () {\n return sqlSelect('SELECT * FROM menu');\n}",
"public function getCooks()\n {\n return $this->hasMany(Recipe::className(), ['id' => 'recipe_id'])\n ->viaTable('cookers', ['user_id' => 'id'])\n ->orderBy(['created_at' => SORT_DESC]);\n }",
"public function get_books()\n {\n $this->load->database();\n // print_r($this->db->get(\"books\"));\n $query = $this->db->query(\"select * from books\");\n return $query->result();\n }",
"public function getBooks(){\n $sql = \"SELECT * FROM book;\";\n $res = mysqli_query($this->link, $sql);\n $books = mysqli_fetch_all($res);\n return $books;\n }",
"public function getBooks()\n\t{\n\t\treturn $this->books;\n\t}",
"public function books()\n {\n return $this->get('/books');\n }",
"public function query() {\n\n // new, more inclusive\n $query = parent::query();\n // Add in book parent child relationships.\n $query->leftJoin('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->leftJoin('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n $query->addField('ml', 'mlid', 'mlid');\n $query->addField('ml', 'plid', 'plid');\n $query->orderBy('mlid');\n\n // dpq($query);\n return $query;\n }",
"function booksList($offset, $total_records_per_page, $order, $ascdesc)\n{\n $booksManager = new ListManager();\n\n\n\n if (isset($_GET['search']) && $_GET['search']!='') {\n $search = input(addcslashes($_GET['search'], '_'));\n $search=\"%\".$search.\"%\";\n $books = $booksManager->get_search($offset, $total_records_per_page, $order, $ascdesc, $search);\n } elseif (isset($_GET['cat']) && $_GET['cat']!='') {\n $cat = input($_GET['cat']);\n $books = $booksManager-> get_cat($offset, $total_records_per_page, $order, $ascdesc, $cat);\n } else {\n $books = $booksManager->selectAll($offset, $total_records_per_page, $order, $ascdesc); // Appel la fonction qui renvoie toutes les données sur les livres en bdd\n }\n // require('view/listView.php');\n return $books;\n echo selectAll();\n}",
"public function getMenu(){\n\n\t\treturn $this->get();\n\t}",
"public function query()\n {\n return MenuGroup::query();\n }",
"public function getBooks()\n {\n return $this->hasMany(Book::className(), ['author_id' => 'id']);\n }",
"public function allBooks ()\n {\n $books = $this->book->findAll();\n $this->show('admin/allbooks', ['books' => $books]);\n }",
"public function search()\n {\n $title = \\Request::get('title');\n $authors = \\Request::get('authors');\n $isbn = \\Request::get('isbn');\n if (empty($title) && empty($authors) && empty($isbn)) {\n $books = [];\n } else {\n $books = Book::where('title', 'like', '%' . $title . '%')\n ->where('authors', 'like', '%' . $authors . '%')\n ->where('isbn', 'like', '%' . $isbn . '%')->orderBy('title')->get();\n }\n return view('user.books', compact('books'));\n }",
"public function search() {\n\t\t\tif (!empty($this->params['form']['query'])) {\n\t\t\t\t/* Get query */\n\t\t\t\t$query = Sanitize::escape($this->params['form']['query']);\n\t\t\t\n\t\t\t\t/* Get list of menu items filtered by query */\n\t\t\t\t$this->menuList = $this->getThreadedList($query);\n\t\t\t} else {\n\t\t\t\t/* Get list of menu items */\n\t\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t}\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}",
"public function getBookList() \n {\n return array( \n \"Balagurusamy\" => new Book(\"Balagurusamy\", \"Balagurusamy\", \"C programming\"), \n \"CMM in Practice\" => new Book(\"CMM in Practice\", \"Pankaj Jalote\", \"\"), \n \"PHP for Dummies\" => new Book(\"PHP for Dummies\", \"Some Smart Guy\", \"\") \n ); \n }",
"public function getAllBooks() {\n \n $allBooks = Libro::all();\n\n return $allBooks;\n }",
"public function getRecommendMenuForType($type)\n {\n \treturn $this->bookRecommendMenu->getRecommendMenuForType($type);\n }",
"private function getBooksByCategories(array $args = []): BookCollection\n {\n// if (empty($args['categories'])) {\n return new BookCollection();\n/* }\n\n try {\n $bookModel = new BookModel($this->container);\n } catch (\\Exception $e) {\n return new BookCollection();\n }\n\n return $bookModel->findBooksByCategories($args['categories']); */\n }",
"public function getBookCategories() {\n return $this->hasMany(BookCategory::className(), ['book_id' => 'id']);\n }",
"public function query() {\n\t\treturn Documents::instance()->query();\n\t}",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function listBooks()\n {\n //list all books in database\n $sql2 = \"SELECT * from book\";\n $userBooks = mysql_fetch_array(mysql_query($sql2));\n return $userBooks; \n }",
"public function retrieve_chapter_list()\n\t{\n\t\t$CI =& get_instance();\n\t\t$operator_id = $CI->session->userdata('user_id');\n\t\t\n\t\t$this->db->select('a.*,b.course_name,c.class_name');\n\t\t$this->db->from('course_chapter_add a');\n\t\t$this->db->join('course_add b', 'b.course_id = a.course_id');\n\t\t$this->db->join('class_add c', 'c.class_id = b.class_id');\n\t\t$this->db->join('operator_permission d', 'd.course_id = b.course_id');\n\t\t$this->db->join('client_user_login e', 'e.user_id = d.operator_id');\n\t\t$this->db->where(array('b.status'=>1,'c.status'=>1,'e.status'=>1,'e.user_id'=>$operator_id,'e.user_type'=>'operator')); \n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}",
"public function getBookList()\n {\n return $this->bookDao->getBookList();\n }",
"public function getBooks($id) {\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n $menu_id = $_GET['menu_id'];\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('menu_id',$menu_id);\n\t\t$criteria->compare('image_path',$this->image_path,true);\n\t\t$criteria->compare('caption',$this->caption,true);\n\t\t$criteria->compare('caption_eng',$this->caption_eng,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('create_user',$this->create_user);\n\t\t$criteria->compare('update_date',$this->update_date,true);\n\t\t$criteria->compare('del_flg',$this->del_flg);\n\t\t$criteria->compare('public_flg',$this->public_flg);\n\t\t$criteria->compare('feature_flg',$this->feature_flg);\n\t\t$criteria->addCondition(\"del_flg = 0\");\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function listLentBooks()\n {\n if (!$this->isLogged()) {\n header('Location: index.php');\n }\n\n $idUser = $this->user['id_user'];\n\n if (isset($_GET['page']) AND !empty($_GET['page'])) {\n $currentPage = (int) $this->cleanParam($_GET['page']);\n }\n else {\n $currentPage = 1;\n }\n\n $lentBookCount = $this->bookManager->lentBookCount($idUser);\n\n $perPage = 12;\n\n $pages = ceil($lentBookCount / $perPage);\n\n $first = ($currentPage * $perPage) - $perPage;\n\n if (isset($_GET['f']) AND !empty($_GET['f'])) {\n $filter = $this->cleanParam($_GET['f']);\n if($filter === \"title\") {\n $sortKey = \"title_book\";\n } else if ($filter === \"author\") {\n $sortKey = \"author_book\";\n } else if ($filter === \"all\") {\n $sortKey = \"date_add_book\";\n } else {\n $sortKey = \"date_add_book\";\n }\n }\n else {\n $sortKey = \"date_add_book\";\n }\n\n if(isset($_POST['button_search_engine'])) {\n if(isset($_POST['content_search']) && !empty($_POST['content_search'])) {\n $wishBook = 0;\n $lendBook = 1;\n $content = $this->cleanParam($_POST['content_search']);\n\n $searchBooks = $this->bookManager->listSearchBooks($idUser, $wishBook, $lendBook, $content);\n $countedBooksSearch = count($searchBooks);\n } \n } \n\n $listLentBooks = $this->bookManager->listLentBooks($idUser, $sortKey, $first, $perPage);\n\n if ($listLentBooks === false) {\n header('Location: index.php?action=error404');\n }\n\n require('App/View/listLentBooks.php');\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('book_id',$this->book_id);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('author_or_editor',$this->author_or_editor,true);\n\t\t$criteria->compare('isbn',$this->isbn,true);\n\t\t$criteria->compare('publisher',$this->publisher,true);\n\t\t$criteria->compare('copyright_year',$this->copyright_year,true);\n\t\t$criteria->compare('categories',$this->categories,true);\n\t\t$criteria->compare('audience',$this->audience,true);\n\t\t$criteria->compare('media',$this->media,true);\n\t\t$criteria->compare('thumbnail_url',$this->thumbnail_url,true);\n\t\t$criteria->compare('info_url',$this->info_url,true);\n\t\t$criteria->compare('reference_url',$this->reference_url,true);\n\t\t$criteria->compare('reference_no',$this->reference_no,true);\n\t\t$criteria->compare('notes',$this->notes,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('borrower_id',$this->borrower_id);\n\t\t$criteria->compare('due_date',$this->due_date,true);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('modified_by',$this->modified_by,true);\n\t\t$criteria->compare('price',$this->price,true);\n\t\t$criteria->compare('total',$this->total);\n $criteria->compare('borrowtime',$this->borrowtime,true);\n\t\t$criteria->compare('leave_number',$this->leave_number);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}",
"public function getMenu();",
"public function findbooks()\n\t{\n\n\t\t// baca key dari form cari data\n\t\t$key = $_POST['key'];\n\n\t\t// ambil session fullname untuk ditampilkan ke header\n\t\t$data['fullname'] = $_SESSION['fullname'];\n\n\t\t// panggil method findBook() dari model book_model untuk menjalankan query cari data\n\t\t$data['book'] = $this->book_model->findBook($key);\n\n\t\t// tampilkan hasil pencarian di view 'dashboard/books'\n\t\t$this->load->view('dashboard/header', $data);\n\t\t$this->load->view('dashboard/sidebar');\n\t\t$this->load->view('dashboard/books', $data);\n\t\t$this->load->view('dashboard/footer');\n\t}",
"public function getMenus() {}",
"public function getBook()\n\t{\n\t\treturn $this->getKeyValue('book'); \n\n\t}",
"public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('t.book_id',$this->book_id,true);\r\n\t\tif(isset($_GET['type']) && $_GET['type'] == 'publish') {\r\n\t\t\t$criteria->compare('t.publish',1);\r\n\t\t} elseif(isset($_GET['type']) && $_GET['type'] == 'unpublish') {\r\n\t\t\t$criteria->compare('t.publish',0);\r\n\t\t} elseif(isset($_GET['type']) && $_GET['type'] == 'trash') {\r\n\t\t\t$criteria->compare('t.publish',2);\r\n\t\t} else {\r\n\t\t\t$criteria->addInCondition('t.publish',array(0,1));\r\n\t\t\t$criteria->compare('t.publish',$this->publish);\r\n\t\t}\r\n\t\tif(isset($_GET['publisher'])) {\r\n\t\t\t$criteria->compare('t.publisher_id',$_GET['publisher']);\r\n\t\t} else {\r\n\t\t\t$criteria->compare('t.publisher_id',$this->publisher_id);\r\n\t\t}\r\n\t\t$criteria->compare('t.isbn',$this->isbn,true);\r\n\t\t$criteria->compare('t.title',$this->title,true);\r\n\t\t$criteria->compare('t.description',$this->description,true);\r\n\t\t$criteria->compare('t.cover',$this->cover,true);\r\n\t\t$criteria->compare('t.edition',$this->edition,true);\r\n\t\t$criteria->compare('t.publish_city',$this->publish_city,true);\r\n\t\t$criteria->compare('t.publish_year',$this->publish_year,true);\r\n\t\t$criteria->compare('t.paging',$this->paging,true);\r\n\t\t$criteria->compare('t.sizes',$this->sizes,true);\r\n\t\tif($this->creation_date != null && !in_array($this->creation_date, array('0000-00-00 00:00:00', '0000-00-00')))\r\n\t\t\t$criteria->compare('date(t.creation_date)',date('Y-m-d', strtotime($this->creation_date)));\r\n\t\t$criteria->compare('t.creation_id',$this->creation_id,true);\r\n\t\tif($this->modified_date != null && !in_array($this->modified_date, array('0000-00-00 00:00:00', '0000-00-00')))\r\n\t\t\t$criteria->compare('date(t.modified_date)',date('Y-m-d', strtotime($this->modified_date)));\r\n\t\t$criteria->compare('t.modified_id',$this->modified_id,true);\r\n\t\t\r\n\t\t// Custom Search\r\n\t\t$criteria->with = array(\r\n\t\t\t'publisher' => array(\r\n\t\t\t\t'alias'=>'publisher',\r\n\t\t\t\t'select'=>'publisher_name'\r\n\t\t\t),\r\n\t\t\t'creation' => array(\r\n\t\t\t\t'alias'=>'creation',\r\n\t\t\t\t'select'=>'displayname'\r\n\t\t\t),\r\n\t\t\t'modified' => array(\r\n\t\t\t\t'alias'=>'modified',\r\n\t\t\t\t'select'=>'displayname'\r\n\t\t\t),\r\n\t\t);\r\n\t\t$criteria->compare('publisher.publisher_name',strtolower($this->publisher_search), true);\r\n\t\t$criteria->compare('creation.displayname',strtolower($this->creation_search), true);\r\n\t\t$criteria->compare('modified.displayname',strtolower($this->modified_search), true);\r\n\r\n\t\tif(!isset($_GET['BookMasters_sort']))\r\n\t\t\t$criteria->order = 't.book_id DESC';\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t\t'pagination'=>array(\r\n\t\t\t\t'pageSize'=>30,\r\n\t\t\t),\r\n\t\t));\r\n\t}",
"public function search()\n {\n $keyword = Input::get('q');\n $items = with(new MasterCategory())->search($keyword);\n\n return $this->renderList($items);\n }",
"public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }",
"protected function getListQuery()\r\n\t{\r\n\t\t// Create a new query object.\t\t\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$query = $db->getQuery(true);\r\n\t\t// Select some fields\r\n\t\t$query->select('#__compte.id,libelle,numero,type, #__categories.title as category');\t\t\r\n\t\t// From the compte table\r\n\t\t$query->from('#__compte');\r\n\t\t$query->leftJoin ('#__categories on #__compte.categorie=#__categories.id');\r\n\t\treturn $query;\r\n\t}",
"public function getQuery()\n {\n return $this->get(self::_QUERY);\n }",
"public function titleDetailsFilteredOpds($books);",
"public function query()\n {\n $users = Menu::query()\n ->with('extension')\n ->where('navigation_id', $this->navigation->id)\n ->select('menus.*');\n\n return $this->applyScopes($users);\n }",
"public function findAllBooks()\n {\n MyLogger::info(\"Entering OwnedBookBusinessService.findAllBooks\");\n //creates a connection\n $db = new Connection();\n $conn = $db->open();\n \n //creates an array of education\n $books = Array();\n \n //calls the data service\n $service = new OwnedBookDataService($conn);\n \n //calls the find all method in the data service\n $books = $service->findAllBooks();\n \n //closes the connection\n $conn = null;\n \n //return the array\n return $books;\n \n MyLogger::info(\"Exiting OwnedBookBusinessService.findAllBooks\");\n }",
"public function getEx3() {\n # Use the QueryBuilder to get all the books where author is like \"%Scott%\"\n $books = \\DB::table('books')->where('author', 'LIKE', '%Scott%')->get();\n # Output the results\n $this->printBooks($books);\n }",
"public function getBook($isbn);",
"public function filter(Request $request)\n {\n $fields = ['isbn', 'title', 'author', 'price', 'currency'];\n $books = Book::query();\n if ($request->has('author')) {\n $books->where('author', 'like', '%' . $request->author . '%');\n }\n if ($request->has('category')) {\n $categories = $this->resolveCategories($request);\n $books\n ->join('book_category_relations', 'books.id', '=', 'book_id')\n ->join('categories', 'categories.id', '=', 'category_id');\n // add all categories to where\n foreach($categories as $category) {\n if (is_numeric($category)) {\n $books->orWhere('categories.id', '=', $request->category);\n } else {\n $books->orWhere('categories.name', 'like', '%' . trim($request->category) . '%');\n }\n }\n }\n if ($request->has('isbn') || $request->isbn) {\n $books->where('isbn', 'like', '%' . $request->isbn . '%');\n }\n return response()->json($books->get($fields));\n }",
"public function index()\n {\n return BookResources::collection(Book::with(['user','categories','authors'])->get());\n }",
"public function getEx1() {\n # Use the QueryBuilder to get all the books\n $books = \\DB::table('books')->get();\n $this->printBooks($books);\n }",
"public function getBorrowedbooks()\n {\n return $this->hasMany(Borrowedbooks::className(), ['bookId' => 'bookId']);\n }",
"public function index(Request $request)\n {\n $bookQuery = Book::query();\n if ($request->category_id) {\n $category_id = $request->category_id;\n $category = Category::find($category_id);\n $bookQuery = $category->books();\n }\n\n \n return BookResource::collection($bookQuery->paginate(12));\n }",
"public function findByBookId($bookId);",
"public function query(BookList $model)\n {\n return $model->newQuery();\n }",
"public static function bookSearch($data = NULL) {\n $search_book = \"SELECT \"\n . \"c.category_name, \"\n . \"a.book_title, \"\n . \"a.id_book, \"\n . \"b.author_name, \"\n . \"a.book_image, \"\n . \"a.book_subject, \"\n . \"a.book_ISBN, \"\n . \"a.book_price, \"\n . \"a.book_discount \"\n . \"FROM books a \"\n . \"JOIN authors b ON a.id_author=b.id_author \"\n . \"JOIN categories c ON a.id_category=c.id_category \";\n \n if($data == 'free')\n {\n $search_book .= \"JOIN books_paid bp ON a.id_book = bp.id_book WHERE bp.id_user=99 AND bp.books_visibility=1 \";\n }\n else if($data == 'discount')\n {\n $search_book .= \"WHERE a.book_discount IS NOT NULL \";\n }\n else if($data != NULL)\n {\n extract($data);\n $search_book .= \"WHERE a.book_title LIKE '%\" . $book_search . \"%' \"\n . \"OR a.book_subject LIKE '%\" . $book_search . \"%' \"\n . \"OR a.book_ISBN LIKE '%\" . $book_search . \"%' \"\n . \"OR b.author_name LIKE '%\" . $book_search . \"%' \"\n . \"OR c.category_name LIKE '%\" . $book_search . \"%' \";\n }\n \n $search_book .= \"GROUP BY a.id_book \"\n . \"ORDER BY a.book_title;\";\n\n if ($result = DB::getInstance()->query($search_book)) {\n if ($result->num_rows > 0) {\n return $result->fetch_all(MYSQLI_ASSOC);\n }\n } else {\n return false;\n }\n }",
"public function index()\n {\n $books = Book::whereNotNull('is_approved')\n ->with('authors')\n ->with('genres')\n ->withAvg('reviews', 'rating')\n ->when(request('user_books') && Auth::check(), function ($query) {\n $query->where('user_id', auth()->user()->id)\n ->whereNotNull('is_approved')\n ->orWhere(function($query){\n $query->whereNull('is_approved')\n ->where('user_id', auth()->user()->id);\n });\n })\n ->when(request('search'), function ($query) {\n $search = request('search');\n $query->whereNotNull('is_approved')\n ->where('title', 'LIKE', '%' . $search . '%')\n ->orWhere(function($query) use ($search){\n $query->whereNotNull('is_approved')\n ->where('description', 'LIKE', '%' . $search . '%');\n })\n ->orWhereHas('genres', function ($query) use ($search) {\n $query->whereNotNull('is_approved')\n ->where('name', 'LIKE', '%' . $search . '%');\n })\n ->orWhereHas('authors', function ($query) use ($search) {\n $query->whereNotNull('is_approved')\n ->where('name', 'LIKE', '%' . $search . '%');\n });\n })\n ->latest()\n ->paginate(25);\n\n\n\n return view('book.index', compact('books'));\n }",
"public function allBooksOderedByType()\n {\n $qb = $this->createQueryBuilder('b')\n ->select('b.title, b.type, b.isbn, b.author')\n ->orderBy('b.type');\n\n $query = $qb->getquery();\n \n return $query->execute();\n }",
"public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }",
"public function getNavigation() {\n \n $search = $this->search();\n $menuObjects = $search->getRecords();\n $result = array();\n $fields = $this->definition->fields();\n $menuItemField = FieldService::instance()->getFieldByName($fields, \"menuItems\");\n \n //$search->getRelationsForObjects(\"menuItems\", $menuObjects);\n \n foreach($menuObjects as $menuObject) {\n $result[$menuObject->name] = $search->getRelations($menuItemField, $menuObject->id);\n }\n \n return $result;\n }",
"public function getBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t\n\t\t\t$book = D('Book_species');\n\t\t\t$sql = \"SELECT * FROM lib_book_species as a, \n\t\t\t (SELECT COUNT(*) as number, isbn as isbn2 FROM lib_book_unique \n\t\t\t\t\twhere book_id not in(select book_id from lib_remove) GROUP BY isbn) AS b \n\t\t\t where a.isbn = b.isbn2 and number!=0 ORDER BY species_id DESC LIMIT 0,20;\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Nothing, please add book!'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}",
"public function books()\n {\n return $this->morphedByMany('App\\Book', 'source_genre');\n }",
"protected function getMenu() {\n $lMethods = $this->allcsvfilelist();\n natcasesort($lMethods);\n \n $lInherited = get_class_methods('CCor_Cnt');\n $lMenu = new CHtm_Vmenu(lan('sys-doc.menu'));\n foreach ( $lMethods as $lMethod ) {\n if (substr($lMethod, 0, 3) != 'act')\n continue;\n /*\n * if (substr ( $lMethod, 3, 1 ) == 'S')\n * continue;\n */\n if (in_array($lMethod, $lInherited))\n continue;\n \n $lAct = substr($lMethod, 3);\n $lMenu->addItem($lMethod, 'index.php?act=sys-doc.' . strtolower($lAct), $lAct);\n }\n \n $lMenu->setKey('act' . ucfirst($this->mAct));\n return $lMenu;\n }",
"public function getallBooks()\r\n {\r\n $sql = \"SELECT id, name, publisher, year,description FROM book\";\r\n $query = $this->db->prepare($sql);\r\n $query->execute();\r\n\r\n return $query->fetchAll();\r\n }",
"public static function getKey()\n {\n return 'Books';\n }",
"function get_all_booksinn($params = array())\n {\n $this->db->select(\"booksinn.*, books.name as bookname\");\n $this->db->join('books','books.id=booksinn.books_id','inner');\n $this->db->order_by('id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('booksinn')->result_array();\n }",
"function getCategories(){\n\treturn dbSelect('categories');\n}",
"public function index(Request $request)\n {\n\n $status = $request->get('status');\n $keyword = $request->get('keyword') ? $request->get('keyword') : '';\n\n if($status){\n $books = \\App\\Models\\Book::with('categories')->where('title', \"LIKE\", \"%$keyword%\")->where('status', strtoupper($status))->paginate(10);\n } else {\n $books = \\App\\Models\\Book::with('categories')->where(\"title\", \"LIKE\", \"%$keyword%\")->paginate(10);\n }\n \n return view('books.index', ['books' => $books]);\n }",
"public function get(){\n\t\t\t\n\t\t\t$query=\"SELECT menuItem FROM menuModel\";\n\t\t\t$results=$this->db()->query($query);\n\t\t\t\n\t\t\t// echo\"<pre>\";\n\t\t\t// var_dump($results);\n\t\t\t\n\t\t\tforeach($results as $res){\n\t\t\t\t$menu_array[]=$res;\n\t\t\t}\n\t\t\t\n\t\t\treturn $menu_array;\n\t\t\t\n\t\t}",
"public function Index(){\n if(isset($_POST['isbn'])){\n $isbn = filter_var($_POST['isbn'], FILTER_SANITIZE_STRING);\n $query = \"DELETE FROM classics WHERE isbn = ?\";\n $params = array($isbn);\n $message = $this->query_get_message($query, $params); \n if($message){\n echo \"You have deleted a book with ISBN number \" . $isbn;\n }else{\n echo \"Something went wrong, your book has not been deleted.\";\n }\n }\n\n\t $query = \"SELECT * FROM classics\";\n //no query params for this search\n\t $results = $this->query_get_results($query, array()); //see model base class\n return $results;\n\t}",
"public function getQuery() {}",
"public function getQuery() {}",
"public function index(Request $request)\n {\n $keyword = $request->keyword;\n $user = auth()->user();\n $bookshelves = $user->bookshelves;\n\n if ($keyword) {\n $books = $user->books()->where('title', 'like', '%'.$keyword.'%')->with('category')->orderBy('created_at', 'desc')->paginate(12);\n } else {\n $books = $user->books()->with('category')->orderBy('created_at', 'desc')->paginate(12);\n }\n\n return view('book.index', [\n 'books' => $books,\n 'keyword' => $keyword,\n 'bookshelves' => $bookshelves\n ]);\n }",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('menu_name',$this->menu_name,true);\n $criteria->compare('controller_name',$this->controller_name,true);\n $criteria->compare('action_name',$this->action_name,true);\n\t\t$criteria->compare('menu_link',$this->menu_link,true);\n\t\t$criteria->compare('display_order',$this->display_order);\n\t\t$criteria->compare('show_in_menu',$this->show_in_menu);\n\t\t$criteria->compare('place_holder_id',$this->place_holder_id);\n\t\t$criteria->compare('application_id',$this->application_id);\n\t\t$criteria->compare('parent_id',$this->parent_id,true);\n\n $criteria->order = 'id DESC';\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'Pagination' => array (\n 'PageSize' => 50, //edit your number items per page here\n ),\n\t\t));\n\t}",
"public function getBooksByParams($params)\n {\n list($arrParams['idBooks'],\n $arrParams['idAuthors'],\n $arrParams['idGenres']\n ) = explode('/', $params['params'], 4);\n\n $sql = 'SELECT bookshop_books.id,\n bookshop_books.description,\n bookshop_books.booksName,\n bookshop_books.pubyear,\n bookshop_discounts.id AS discountsId,\n bookshop_discounts.discountsName,\n bookshop_discounts.percent,\n bookshop_books.price,\n bookshop_authors.id AS idAuthors,\n bookshop_authors.authorsName,\n bookshop_genres.id AS idGenres,\n bookshop_genres.genresName\n FROM bookshop_books_to_authors\n INNER JOIN bookshop_books\n ON bookshop_books_to_authors.id_book = bookshop_books.id\n INNER JOIN bookshop_books_to_genres\n ON bookshop_books_to_genres.id_book = bookshop_books.id\n INNER JOIN bookshop_authors\n ON bookshop_books_to_authors.id_author = bookshop_authors.id\n INNER JOIN bookshop_genres\n ON bookshop_books_to_genres.id_genre = bookshop_genres.id\n INNER JOIN bookshop_discounts\n ON bookshop_books.id_discount = bookshop_discounts.id';\n\n if ( !$condition = $this->conditionSwitch($sql, $arrParams) )\n return $this->error(404, 63);\n\n $result = $this->db->execute($condition['sql'], ['id' => $condition['id']]);\n\n if (!$result)\n return $this->error();\n\n return $this->formingBooks($result);\n }",
"public function search(Request $request)\r\n {\r\n $book = Book::where([]);\r\n $books = $this->conditions($book, $request)->paginate(SEARCH_BOOK_PAGINATION);\r\n return view('Books.web.search', compact('books'));\r\n }",
"public static function get_menu()\n\t\t{ \n\t\t\t\t\n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\t$dish_list = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.self::$table_name);\n\t\t\t\t\n\t\t\t\t$htm =\t'<div class=\"left-rows\" id=\"menu-all\">All Categories</div>';\t\n\t\t\t\t\n\t\t\t\tif(!empty($dish_list)){\n\t\t\t\t\t\n\t\t\t\t\tforeach($dish_list as $key => $val){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$htm .=\t'<div class=\"left-rows\" id=\"menu-'.$val->re_int.'\">'.$val->re_title.'</div>';\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\t\n\t\t\t\treturn $htm;\n\t\t\t\t\n\t\t}",
"function get_foods_of_category($search_key) {\n if ((!$search_key) || ($search_key == '')) {\n return false;\n }\n \n $conn = db_connect();\n $query = \"select * from food where catogery_name = '\".$search_key.\"'\";\n \n $result = @$conn->query($query);\n if (!$result) {\n return false;\n }\n \n $num_books = @$result->num_rows;\n if ($num_books == 0) {\n return false;\n } \n $result = db_result_to_array($result);\n return $result;\n}",
"public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }",
"public function all()\n {\n return HandbookCategory::where('parent_id', null)->orderBy('position', 'asc')->get();\n }",
"public function getEx8() {\n # Get all the books\n $books = \\App\\Book::all();\n $this->printBooks($books);\n # get() without any query constraints is the equivalent of all()\n $books = \\App\\Book::get();\n $this->printBooks($books);\n\t}",
"public function index()\n {\n $books= DB::table('books') \n ->where('available',true)\n ->get();\n return $books; \n }",
"static public function getMenu() {\n $query = mysql_query(\"SELECT `menu` FROM `info` WHERE `id` = '0'\");\n return mysql_result($query, 0, 'menu');\n }",
"public function getallbooks(){\n\t\t\t$this->db->select('id, name, price, author, category, language, ISBN, publish_date')\n\t\t\t\t\t ->from('tbl_books');\n\t\t\t$this->db->order_by('id', 'desc');\n\n\t\t\t$query = $this->db->get();\n\n\t\t\tif($query->num_rows() > 0){\n\t\t\t\treturn $query->result_array();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t}",
"public function searchBook(string $bookName)\n {\n }"
] | [
"0.6034852",
"0.57275033",
"0.5724402",
"0.56848574",
"0.5541098",
"0.5503939",
"0.5496269",
"0.54730177",
"0.5358738",
"0.53564066",
"0.5281198",
"0.52330416",
"0.5213908",
"0.5204147",
"0.52004284",
"0.5197803",
"0.5195157",
"0.5184411",
"0.5171213",
"0.51686865",
"0.5124715",
"0.5103929",
"0.5087534",
"0.5077145",
"0.5057061",
"0.5056206",
"0.50556695",
"0.5051163",
"0.50468355",
"0.50237715",
"0.5017023",
"0.50117195",
"0.4997251",
"0.49930423",
"0.49930423",
"0.49930423",
"0.49930423",
"0.49930423",
"0.49930423",
"0.49930423",
"0.49930423",
"0.49930423",
"0.4992084",
"0.49879563",
"0.49738845",
"0.49681896",
"0.4961048",
"0.4960004",
"0.49560335",
"0.49254206",
"0.49117088",
"0.49013627",
"0.48929867",
"0.48929858",
"0.48923242",
"0.48832366",
"0.48740196",
"0.48688927",
"0.48627037",
"0.48592415",
"0.48545605",
"0.48518416",
"0.48513442",
"0.4850631",
"0.48394012",
"0.48390788",
"0.48362112",
"0.48228964",
"0.48222005",
"0.48087686",
"0.4807443",
"0.48043478",
"0.4802305",
"0.47923362",
"0.4786895",
"0.4785482",
"0.47802195",
"0.47739005",
"0.47699916",
"0.47532505",
"0.47527808",
"0.47506353",
"0.47496235",
"0.47323364",
"0.47218943",
"0.4718516",
"0.4718516",
"0.46955335",
"0.46912247",
"0.46851683",
"0.4683831",
"0.46813792",
"0.46811104",
"0.46793038",
"0.46792305",
"0.46783477",
"0.46771553",
"0.46770176",
"0.4674962",
"0.46746123"
] | 0.67026013 | 0 |
Gets query for [[Menus]]. | public function getMenus()
{
return $this->hasMany(Menu::className(), ['id' => 'menu_id'])->viaTable('menu_cook', ['cook_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQueryMenus();",
"public function getMenus() {}",
"public static function getMenus()\n\t{\n\t\t$sql = \"SELECT * FROM mod_menu\";\n\t\t$query = \\SimplCMS::$app->getDbConnection()->query($sql);\n\t\treturn $query->fetchAll( \\PDO::FETCH_ASSOC );\t\t\n\t}",
"function GetMenu()\n {\n $sql = \"SELECT\n title,\n slug,\n id\n FROM\n pages\";\n $this->setSql($sql);\n return $this->getAll();\n }",
"public function getMenus()\n\t{\n\n\t}",
"public function getMenus()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('menus');\n\t\t$this->db->order_by('order', 'ASC');\n\t\t//$this->db->where('post_type', 'menu');\n\t\t$query = $this->db->get();\n\n\t\treturn $query->result();\n\t}",
"public static function getMenus()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select('a.*, SUM(b.home) AS home')\n\t\t\t->from('#__menu_types AS a')\n\t\t\t->join('LEFT', '#__menu AS b ON b.menutype = a.menutype AND b.home != 0')\n\t\t\t->select('b.language')\n\t\t\t->join('LEFT', '#__languages AS l ON l.lang_code = language')\n\t\t\t->select('l.image')\n\t\t\t->select('l.sef')\n\t\t\t->select('l.title_native')\n\t\t\t->where('(b.client_id = 0 OR b.client_id IS NULL)');\n\n\t\t// Sqlsrv change\n\t\t$query->group('a.id, a.menutype, a.description, a.title, b.menutype,b.language,l.image,l.sef,l.title_native');\n\n\t\t$db->setQuery($query);\n\n\t\ttry\n\t\t{\n\t\t\t$result = $db->loadObjectList();\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t$result = array();\n\t\t\tJFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getMenus()\n {\n $menus = Menu::all();\n\n return Datatables::of($menus)\n ->addColumn('actions', function ($menu) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/menus/' . $menu->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = ' <a href=\"' . url('admin/menus/' . $menu->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n return $editBtn . $deleteBtn;\n })->make(true);\n }",
"function getMenuItems () {\n return sqlSelect('SELECT * FROM menu');\n}",
"public function getMenus()\n\t{\n\t\treturn $this->menus;\n\t}",
"public function getMenus(){\n\n }",
"public function query()\n {\n return MenuGroup::query();\n }",
"public function getMenu(){\n\n\t\treturn $this->get();\n\t}",
"public function getAllMenus()\n {\n $menus = $this->find('all', array(\n 'conditions' => array(\n 'Menu.active' => true,\n ),\n 'order' => array(\n 'Menu.order' => 'asc',\n ),\n 'joins' => array(\n array(\n 'table' => 'product_categories',\n 'alias' => 'ProductCategory',\n 'type' => 'left',\n 'conditions' => array(\n 'Menu.type = \"ProductCategory\"',\n 'Menu.child = ProductCategory.id'\n )\n ),\n array(\n 'table' => 'blog_categories',\n 'alias' => 'BlogCategory',\n 'type' => 'left',\n 'conditions' => array(\n 'Menu.type = \"BlogCategory\"',\n 'Menu.child = BlogCategory.id'\n )\n ),\n array(\n 'table' => 'pages',\n 'alias' => 'Page',\n 'type' => 'left',\n 'conditions' => array(\n 'Menu.type = \"Page\"',\n 'Menu.child = Page.id'\n )\n )\n ),\n 'fields' => array(\n 'Menu.id',\n 'Menu.introduction',\n 'Menu.name',\n 'Menu.image',\n 'Menu.type',\n 'Menu.parent_id',\n 'Menu.child',\n 'ProductCategory.slug',\n 'Page.slug',\n 'BlogCategory.slug'\n )\n ));\n\n return $menus;\n }",
"public function query()\n {\n $users = Menu::query()\n ->with('extension')\n ->where('navigation_id', $this->navigation->id)\n ->select('menus.*');\n\n return $this->applyScopes($users);\n }",
"public function getMenu()\n {\n $this->db->order_by('id_menu', 'DESC');\n return $this->db->get('tabel_menu')->result();\n }",
"public function getMenus($filter = null)\n {\n return $this->contentManager->listMenus($filter);\n }",
"public function getMenusListAttribute()\n {\n return Menu::orderBy('name')->get();\n }",
"public function menus($filter = null)\n {\n return $this->contentManager->listMenus($filter);\n }",
"public function getMenu();",
"static public function getMenu() {\n $query = mysql_query(\"SELECT `menu` FROM `info` WHERE `id` = '0'\");\n return mysql_result($query, 0, 'menu');\n }",
"public function getMenuItems()\n {\n $sql = \"\n SELECT\n menu.uid,\n parent_uid,\n sort_order,\n nofollow,\n target,\n class,\n label,\n uri_uid,\n uri,\n menu.archived,\n menu.archived_datetime\n FROM menu\n LEFT JOIN uri\n ON uri.uid = menu.uri_uid\n WHERE menu.archived = '0'\n AND (uri.archived = '0' OR uri.archived IS NULL)\n \";\n\n $sql .= \"\n ORDER BY sort_order;\n \";\n\n $db = new Query($sql);\n $results = $db->fetchAllAssoc();\n\n return $results;\n }",
"function getMenus($parent_menu=false,$parent_id=null){\r\n\t\t$this->db->select(TBL_MASTER_MENUS.'.*');\r\n\t\tif($parent_menu==true){\r\n\t\t\t$this->db->where(array('menu_parent_id'=>0));\r\n\t\t}\r\n\t\tif($parent_id!=null && $parent_id!=''){\r\n\t\t\t$this->db->where(array('menu_parent_id'=>$parent_id));\r\n\t\t}\r\n\t\t$this->db->where(array('is_active'=>1));\r\n\t\t\t\r\n\t\t$this->db->from(TBL_MASTER_MENUS);\r\n\t\t$recordSets = $this->db->get();\r\n\t\t$data = $recordSets->result();\r\n\t\treturn $data;\r\n\t}",
"public function getMenuItems()\n {\n return $this->adminMenu->all();\n }",
"public function allmenus() {\n //$this->db->order_by('serialid');\n $query = $this->db->get('menu');\n return $query->result();\n }",
"public function MenuList() {\n $FormData = $this->input->get();\n if (count($FormData) > 0) {\n echo json_encode($this->m_menu->MenuList($FormData['query']));\n }\n }",
"public function getMenuItems(){\n $items = ItemMenu::getBy(array('_id' => array('$in' => $this->_menuItems)));\n return $items;\n }",
"public function getMenu() {\r\n $sql = $this->db->query(\"SELECT * FROM ms_menu WHERE menu_isactive = 1 ORDER BY menu_urut\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->result_array();\r\n }\r\n return null;\r\n }",
"public function getMenu()\n {\n if (!$this->hasMenu()) {\n $this->setMenu(false);\n\n $menu = $this->menuFactory->create()->load($this->_getData('nav_menu'));\n\n if ($menu->getId()) {\n $this->setMenu($menu);\n }\n }\n\n return $this->_getData('menu');\n }",
"public function search() {\n\t\t\tif (!empty($this->params['form']['query'])) {\n\t\t\t\t/* Get query */\n\t\t\t\t$query = Sanitize::escape($this->params['form']['query']);\n\t\t\t\n\t\t\t\t/* Get list of menu items filtered by query */\n\t\t\t\t$this->menuList = $this->getThreadedList($query);\n\t\t\t} else {\n\t\t\t\t/* Get list of menu items */\n\t\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t}\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}",
"public function get(){\n\t\t\t\n\t\t\t$query=\"SELECT menuItem FROM menuModel\";\n\t\t\t$results=$this->db()->query($query);\n\t\t\t\n\t\t\t// echo\"<pre>\";\n\t\t\t// var_dump($results);\n\t\t\t\n\t\t\tforeach($results as $res){\n\t\t\t\t$menu_array[]=$res;\n\t\t\t}\n\t\t\t\n\t\t\treturn $menu_array;\n\t\t\t\n\t\t}",
"public function getMenu($level = 1) {\n\t\treturn singleton('ContentController')->getMenu($level);\n\t}",
"public function getMenu()\n\t{\n\t\treturn $this->menu;\n\t}",
"function ListaMenus() {\n try {\n $select = \" SELECT COD_MENU,\n COD_MENU AS COD,\n DSC_MENU,\n DSC_MENU AS DSC\n FROM SE_MENU\n WHERE COD_MENU_PAI > -1 \n AND IND_VISIBLE = 'S'\n UNION\n SELECT '0' AS COD_MENU,\n '0' AS COD,\n 'Sem Pai' AS DSC_MENU,\n 'Sem Pai' AS DSC\n ORDER BY DSC_MENU\";\n $lista = $this->selectDB(\"$select\", false);\n } catch (Exception $e) {\n echo \"erro\" . $e;\n }\n return $lista;\n }",
"public function getMenu() {\n\t\treturn $this->menu;\n\t}",
"public function getMenus()\n {\n\n $menus = array();\n\n $CoreMenuObject = new CoreMenuObject();\n $CoreMenuObject->setId('adminlessvariables');\n $CoreMenuObject->setName(CoreLanguage::get('admin:system:adminlessvars:link:name'));\n $CoreMenuObject->setHref('/admin/system/lessvariables');\n $CoreMenuObject->setTitle(CoreLanguage::get('admin:system:adminlessvars:link:title'));\n $CoreMenuObject->setTemplate('adminnavsection');\n $CoreMenuObject->setZIndex(20);\n $CoreMenuObject->setParentId(AdminModule::ADMIN_NAV_ID_SYSTEM);\n $CoreMenuObject->setTarget(AdminModule::ADMIN_NAV_ID);\n array_push($menus, $CoreMenuObject);\n\n return $menus;\n\n }",
"public function getMenu($menu){\n $menus['sidebar'] = array(\n array(\n 'id' => 'inicio',\n 'label' => 'Inicio',\n 'link' => BASE_URL \n ),\n array(\n 'id' => 'login',\n 'label' => 'Cerrar Sesión',\n 'link' => BASE_URL . \"login/cerrar\"\n ),\n array(\n 'id' => 'login',\n 'label' => 'Iniciar Sesión',\n 'link' => BASE_URL . \"login\"\n ),\n array(\n 'id' => 'registro',\n 'label' => 'Registrarse',\n 'link' => BASE_URL . \"registro\"\n )\n );\n\n $menus['top'] = array(\n array(\n 'id' => 'inicio',\n 'label' => 'Inicio',\n 'link' => BASE_URL \n ),\n array(\n 'id' => 'post',\n 'label' => 'Post',\n 'link' => BASE_URL . \"post\"\n ),\n array(\n 'id' => 'configuracion',\n 'label' => 'Configuración',\n 'link' => BASE_URL . \"configuracion\"\n )\n );\n\n return $menus[$menu];\n }",
"public static function menus()\n {\n return [];\n }",
"public function menus()\n {\n return $this->hasMany('App\\Models\\Menu');\n }",
"public function index()\n {\n // get all Menus\n $Menus = Menu::all();\n\n return $Menus;\n }",
"public function index()\n {\n return $this->menu->all();\n }",
"protected function getMenu(Request $request) {\n $rarg = array();\n $menuItems = array(\n // Menu Item\n $menuitem = new MenuItemModel('menuitem', 'Menu Items', 'admin_menuitem', $rarg, 'fa fa-dashboard'),\n\n // Admin Blog\n $blog = new MenuItemModel('blog', 'Blog', '', $rarg, 'fa fa-dashboard'),\n $blog->addChild(new MenuItemModel('blog_posts', 'Posts', 'admin_blog_post', $rarg, 'fa fa-dashboard')),\n\n );\n\n return $this->activateByRoute($request->get('_route'), $menuItems);\n }",
"public static function get_menu()\n\t\t{ \n\t\t\t\t\n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\t$dish_list = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.self::$table_name);\n\t\t\t\t\n\t\t\t\t$htm =\t'<div class=\"left-rows\" id=\"menu-all\">All Categories</div>';\t\n\t\t\t\t\n\t\t\t\tif(!empty($dish_list)){\n\t\t\t\t\t\n\t\t\t\t\tforeach($dish_list as $key => $val){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$htm .=\t'<div class=\"left-rows\" id=\"menu-'.$val->re_int.'\">'.$val->re_title.'</div>';\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\t\n\t\t\t\treturn $htm;\n\t\t\t\t\n\t\t}",
"public function getMenuItems()\n\t{\n\t\treturn Settings_Vtiger_MenuItem_Model::getAll($this->getId());\n\t}",
"function select_sysmenu(){\n\t\t$username = $this->session->userdata('username');\t\n\t\t$this -> db -> select('*');\n\t\t$this -> db -> from('sys_menu');\n\t\t$query = $this -> db -> get();\t\n\t\treturn $query;\n\t}",
"function &getMenus() {\n\t\t$lines = explode(\"\\n\", $this->menus);\n\n\t\t$menus = array();\n\t\tforeach( $lines as $line ) {\n\t\t\tif ($line) {\n\t\t\t\tlist( $menutype, $ordering, $show, $showXML, $priority, $changefreq ) = explode(',', $line);\n\t\t\t\t$info = explode(',', $line);\n\t\t\t\t$menu = new stdclass;\n\t\t\t\t$menu->menutype \t= @$info[0];\n\t\t\t\t$menu->ordering \t= @$info[1];\n\t\t\t\t$menu->show \t\t= @$info[2];\n\t\t\t\t$menu->showXML \t= @$info[3];\n\t\t\t\t$menu->priority \t= (@$info[4]? $info[4] : '0.5');\n\t\t\t\t$menu->changefreq \t= (@$info[5]? $info[5] : 'weekly');\n\t\t\t\t$menu->module \t\t= (@$info[6]? $info[6] : 'mod_mainmenu');\n\t\t\t\t$menus[$menutype] \t= $menu;\n\t\t\t}\n\t\t}\n\t\treturn $menus;\n\t}",
"public static function get()\n {\n if(Session::get('sivoz_auth') !== false){\n return Menu::all();\n }else{\n return Menu::login();\n } \n }",
"public function getMenus()\n {\n $menus = array();\n\n $CoreMenuObject = new CoreMenuObject();\n $CoreMenuObject->setId('performanceutils');\n $CoreMenuObject->setName('admin.performance.utils.link.name');\n $CoreMenuObject->setTitle('admin.performance.utils.link.title');\n $CoreMenuObject->setHref('/admin/performanceutils');\n $CoreMenuObject->setParentId(AdminModule::ADMIN_NAV_ID_SYSTEM);\n $CoreMenuObject->setTarget(AdminModule::ADMIN_NAV_ID);\n array_push($menus, $CoreMenuObject);\n\n return $menus;\n }",
"function api_list_menus() {\n\t\t$menus = array();\n\t\tforeach ( get_nav_menu_locations() as $menu_slug => $menu_id ) {\n\n\t\t\t$menu = $menu_id?self::get_menu_object($menu_id):false;\n\t\t\t$menus[ $menu_slug ] = $menu;\n\t\t}\n\n\t\treturn $menus;\n\t}",
"public function index(Request $request, Menu $menu)\n {\n $search = $request->input('search');\n\n $menuModel = $menu->where(function ($query) use ($search) {\n if ($search) {\n $query->orWhere('title', 'like', '%' . $search . '%');\n $query->orWhere('name', 'like', '%' . $search . '%');\n }\n });\n $list = $menuModel->orderBy('id', 'desc')->paginate($request->input('limit'))->toArray();\n if ($list['data']) {\n $kv = $menu->kv();\n foreach ($list['data'] as $k => $item) {\n $list['data'][$k]['pName'] = isset($kv[$item['pId']]) ? $kv[$item['pId']] : '一级菜单';\n $list['data'][$k]['pIds'] = json_decode($item['pIds'], true);\n }\n }\n return $this->apiSuccess($list);\n }",
"public function getNavigation() {\n \n $search = $this->search();\n $menuObjects = $search->getRecords();\n $result = array();\n $fields = $this->definition->fields();\n $menuItemField = FieldService::instance()->getFieldByName($fields, \"menuItems\");\n \n //$search->getRelationsForObjects(\"menuItems\", $menuObjects);\n \n foreach($menuObjects as $menuObject) {\n $result[$menuObject->name] = $search->getRelations($menuItemField, $menuObject->id);\n }\n \n return $result;\n }",
"private function getMenuItems()\n {\n $menu = $this->getDoctrine()->getRepository('XvolutionsAdminBundle:Menu')->findBy([], array('position' => 'ASC'));\n $menuItems = null;\n foreach ($menu as $item) {\n $menuItems[$item->getPage()->getId()] = ['id' => $item->getPage()->getId(), 'title' => $item->getPage()->getTitle()];\n }\n\n return $menuItems;\n }",
"public function menus(){\n return $this->belongsToMany('ChecklistSilfa\\Entities\\MainMenu', 'permisos_menu', 'user_id', 'permisos_id')->where('menu.estado','=','1')->orderBy('menu.id');\n }",
"public function getMenu()\n {\n if (!isset($_SESSION['centreon'])) {\n throw new \\RestUnauthorizedException('Session does not exists.');\n }\n /**\n * Initialize the language translator\n */\n $this->dependencyInjector['translator'];\n $menu = new Menu($this->pearDB, $_SESSION['centreon']->user);\n\n return $menu->getMenu();\n }",
"protected function get_menu() {\n\t\t\n\t\tif ( ( $locations = get_nav_menu_locations() )\n\t\t\t&& isset( $locations[ $this->menu_name ] ) ){\n\t\t\t$this->menu_id = $locations[ $this->menu_name ];\n\t\t}else{\n\t\t\t$this->menu_id = null;\n\t\t}\n\n\t\t$this->menu = wp_get_nav_menu_items( $this->menu_id );\n\t}",
"public function getMenu()\n {\n return $this->hasOne(\\wdmg\\menu\\models\\Menu::class, ['id' => 'menu_id']);\n }",
"public static function getMenu()\n\t{\n\t\treturn self::$menu;\n\t}",
"public function findAll()\n {\n $menus['active_menu'] = $this->buildMenu(\n Menu::where('status', 1)\n ->orderBy('order')\n ->get()\n );\n $menus['inactive_menu'] = $this->buildMenu(\n Menu::where('status', 0)\n ->orderBy('order', 'created_at')\n ->get()\n );\n\n return $menus;\n }",
"protected function getMenu(Request $request)\n {\n $menuItems = [\n new MenuItemModel('xdcc_index', $this->translator->trans('admin.xdcc.menu_title', [], 'admin'), 'xdaysaysay_admin_xdcc_index', [], 'iconclasses fa fa-plane'),\n new MenuItemModel('irc_server_index', $this->translator->trans('admin.irc_server.menu_title', [], 'admin'), 'xdaysaysay_admin_irc_server_index', [], 'iconclasses fa fa-plane'),\n new MenuItemModel('server_index', $this->translator->trans('admin.server.menu_title', [], 'admin'), 'xdaysaysay_admin_server_index', [], 'iconclasses fa fa-server'),\n new MenuItemModel('team_index', $this->translator->trans('admin.team.menu_title', [], 'admin'), 'xdaysaysay_admin_team_index', [], 'iconclasses fa fa-plane'),\n new MenuItemModel('user_index', $this->translator->trans('admin.user.menu_title', [], 'admin'), 'xdaysaysay_admin_user_index', [], 'iconclasses fa fa-plane'),\n ];\n\n return $this->activateByRoute($request->get('_route'), $menuItems);\n }",
"public function menu()\n {\n return $this->menu;\n }",
"public function menu()\n {\n return $this->menu;\n }",
"public function getMenuArray()\n {\n $menuArray = $this->_buildMenuArray();\n if (isset($menuArray['report']) && isset($menuArray['report']['children']) && isset($menuArray['report']['children']['cleansql'])) {\n $this->_appendCleanSqlReports($menuArray['report']['children']['cleansql']);\n }\n return $menuArray;\n }",
"protected function getDBData()\n {\n $menus = StaticMenu::listDbInTheme($this->theme);\n\n $searchTerm = Str::lower($this->getSearchTerm());\n\n if (strlen($searchTerm)) {\n $words = explode(' ', $searchTerm);\n $filteredMenus = [];\n\n foreach ($menus as $menu) {\n if ($this->textMatchesSearch($words, $menu->name.' '.$menu->fileName)) {\n $filteredMenus[] = $menu;\n }\n }\n\n $menus = $filteredMenus;\n }\n\n return $menus;\n }",
"function getMenu(){\n\t\t$sql = \"SELECT tl.TenTL, tl.TenKhongDauTL, GROUP_CONCAT(gd.MaGD,':', gd.TenGD,':', gd.TenKhongDauGD) AS GiaiDoan FROM theloai tl INNER JOIN giaidoan gd ON tl.MaTL = gd.MaTL GROUP BY tl.MaTL\";\n\t\t$this->setQuery($sql);\n\t\treturn $this->loadAllRows();\n\t}",
"function select_idxmenu(){\n $query = $this->db->query(\"\n select title, file_path\n from sys_menu \n where is_parent = 0 order by id\n \");\n return $query;\n }",
"public function searchMenu()\n\t{\n\t\t// Ajax only controller\n\t\tif (!Request::ajax()) return Response::notFound();\n\n\t\t$post = Post::find(Config::get('mrcore.searchmenu'));\n\t\tif (!isset($post)) return Response::notFound();\n\n\t\t// Parse Post Now!\n\t\t$post->parse();\n\n\t\treturn $post->content;\n\t}",
"public function getAllMenuItems()\n\t{\n\t\t$out = array();\n\t\n\t\t$sql = \"SELECT\n\t\t\t\t\t`menu`.`link_id`,\n\t\t\t\t\t`menu_tree`.`parent_id`,\n\t\t\t\t\t`menu`.`redirect_url`,\n\t\t\t\t\t`menu_tree`.`sequence_no`,\n\t\t\t\t\t`menu`.`title_menu`,\n\t\t\t\t\t`menu`.`title_page`,\n\t\t\t\t\t`menu`.`template_name`,\n\t\t\t\t\t`menu`.`module_id`,\n\t\t\t\t\t`menu`.`security_level_id`,\n\t\t\t\t\t`menu`.`group_id`,\n\t\t\t\t\t`menu_tree`.`main_link`,\n\t\t\t\t\t`menu_tree`.`quick_link`,\n\t\t\t\t\t`menu_tree`.`bottom_link`,\n\t\t\t\t\t`menu`.`sitemap`,\n\t\t\t\t\t`menu`.`status`\n\t\t\t\tFROM\n\t\t\t\t\t`menu_tree`\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t`menu`\n\t\t\t\tON\n\t\t\t\t\t`menu`.`link_id` = `menu_tree`.`link_id`\n\t\t\t\tORDER BY \n\t\t\t\t\t`menu_tree`.`parent_id`,`menu_tree`.`sequence_no`\n\t\t\t\t\";\n\t\t$stmt = $this->db->prepare($sql);\n\t\t$stmt->bind_result($link_id,$parent_id,$redirect_url,$sequence_no,$title_menu,$title_page,$template_name,$module_id,$security_level_id,$group_id,$main_link,$quick_link,$bottom_link,$sitemap,$status);\n\n\t\t$stmt->execute();\n\t\twhile($stmt->fetch())\n\t\t{\n\t\t\t$out[] = array(\n\t\t\t\t'link_id' => $link_id,\n\t\t\t\t'parent_id' => $parent_id,\n\t\t\t\t'redirect_url' => $redirect_url,\n\t\t\t\t'sequence_no' => $sequence_no,\n\t\t\t\t'title_menu' => $title_menu,\n\t\t\t\t'title_page' => $title_page,\n\t\t\t\t'template_name' => $template_name,\n\t\t\t\t'module_id' => $module_id,\n\t\t\t\t'security_level_id' => $security_level_id,\n\t\t\t\t'group_id' => $group_id,\n\t\t\t\t'main_link' => $main_link,\n\t\t\t\t'quick_link' => $quick_link,\n\t\t\t\t'bottom_link' => $bottom_link,\n\t\t\t\t'sitemap' => $sitemap,\n\t\t\t\t'status' => $status\n\t\t\t);\n\t\t}\n\t\t$stmt->close();\n\t\t\n\t\treturn $out;\n\t}",
"protected function getMenuItems()\n {\n return $this->getService('config')->get()['menu']['admin'];\n }",
"public function getMenuByModelName($modelName){\n $amenu = $this->table('permission')\n ->where('showInMenu=1 and type=\"backend_menu\" and `level` like (SELECT CONCAT(p2.`level`,\",\",\"%\") as `level` FROM permission p1 LEFT JOIN permission p2 ON p1.pId=p2.id WHERE p1.`name`=\"'.$modelName.'\")')\n ->order('`level`')\n ->getField('id,pId,name,title,URL,icon,level');\n //dump($this->getlastsql());\n return $amenu;\n }",
"function getAllMenus(){\n $data = array();\n $Q = $this->db->get('adminmenu');\n if ($Q->num_rows() > 0){\n foreach ($Q->result_array() as $row){\n $data[] = $row;\n }\n }\n $Q->free_result();\n return $data;\n }",
"function getMenuEntries()\n\t{\n\t\tglobal $rbacsystem, $lng, $tree, $ilUser, $ilSetting;\n\n\t\t// no menu during online tests\n\t\tif ($_SESSION[\"adn_online_test\"])\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\t$mm_tpl = new ilTemplate(\"tpl.adn_main_menu.html\", true, true, \"Services/ADN/UI\");\n\n\t\tforeach ($this->getAllMenuItems() as $menu => $items)\n\t\t{\n\t\t\t$this->renderSubMenu($mm_tpl, $menu);\n\t\t}\n\t\treturn $mm_tpl->get();\n\n\n\n\t\t$tpl->setCurrentBlock(\"cust_menu\");\n\t\t$tpl->setVariable(\"TXT_CUSTOM\",\n\t\t\tlfCustomMenu::lookupTitle(\"it\", $menu[\"id\"], $ilUser->getLanguage(), true));\n\t\t$tpl->setVariable(\"MM_CLASS\", \"MMInactive\");\n\n\t\tif (is_file(\"./templates/default/images/mm_down_arrow.png\"))\n\t\t{\n\t\t\t$tpl->setVariable(\"ARROW_IMG\", ilUtil::getImagePath(\"mm_down_arrow.png\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tpl->setVariable(\"ARROW_IMG\", ilUtil::getImagePath(\"mm_down_arrow.gif\"));\n\t\t}\n\t\t$tpl->setVariable(\"CUSTOM_CONT_OV\", $gl->getHTML());\n\t\t$tpl->setVariable(\"MM_ID\", $menu[\"id\"]);\n\t\t$tpl->parseCurrentBlock();\n\t\t$tpl->setCurrentBlock(\"c_item\");\n\t\t$tpl->parseCurrentBlock();\n\n\t}",
"public function get_menu()\n\t{\n\t\treturn $this->get_session('admin_menu_html');\n\t}",
"public function getMenu()\n {\n return null;\n }",
"public static function getMenu()\n {\n $svalue = SessionManager::get(self::SESSION_NAME);\n return $svalue ? unserialize($svalue) : self::$menu;\n }",
"public function getmenu( ) {\n \t$parent = $this->find('all', array(\n 'conditions' => array(\n 'Page.parent_id IS NULL',\n 'Page.is_menu' => 1,\n 'Page.is_active' => 1\n ),\n 'contain'=>array(\n ),\n 'fields'=>array('Page.lft', 'Page.rght'),\n 'order'=>array('Page.lft' => 'ASC')\n ));\n\t\t\n\t\t$recs = array(); \n foreach($parent as $v){\n \t$info = $this->find('threaded', array(\n\t 'conditions' => array(\n\t 'Page.lft >=' => $v['Page']['lft'], \n\t 'Page.rght <=' => $v['Page']['rght'],\n\t 'Page.is_menu' => 1,\n\t 'Page.is_active' => 1\n\t ),\n\t 'contain'=>array()\n\t ));\n\t \n\t $recs = array_merge($recs, $info);\n\t }\n\t\t\n\t\treturn $recs;\n }",
"public function get()\n\t{\n\t\t$url = WEIXIN_GET_MENU_URL;\n\t\t$access_token = Weixin_Class_AccessToken::getInstance()->load_access_token();\n\t\t$params = array(\n\t\t\t'access_token' => !empty($access_token->access_token) ? $access_token->access_token : 'false',\n\t\t);\n\n\t\t$url .= \"?\" . http_build_query($params);\n\n\t\t$xcurl = new Lib_Curl($url);\n\t\t$ret = $xcurl->get();\n\n\t\tif (!empty($ret)) {\n\t\t\t$result = json_decode($ret);\n\t\t\tvar_dump($result);\n\t\t} else {\n\t\t\techo 'Get Menu Failed!' . PHP_EOL;\n\t\t}\n\t}",
"function getMenuItems()\n {\n }",
"public function get_all()\n {\n\n $sql = \"SELECT * FROM `menu`\";\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n return $query->fetchAll();\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 }",
"public function get_list_of_menus(){\n\n $items = array();\n\n $args = array(\n 'post_type' => 'erm_menu',\n 'orderby' => 'menu_order',\n 'order' => 'ASC',\n 'post_status' => 'publish',\n 'posts_per_page' => -1 \n );\n\n $menu_posts = get_posts($args);\n\n if ( !empty($menu_posts) ) {\n\n foreach ( $menu_posts as $menu_post ){\n $items[] = array(\n 'title' => $menu_post -> post_title,\n 'url' => $menu_post -> post_name\n );\n }\n\n }\n else{\n return new WP_Error( 'no_menus', 'No menus found', array( 'status' => 404 ) );\n }\n\n return $items;\n\n }",
"public function getAdminMenu()\n {\n return $this->menuBuilder;\n }",
"public static function getMenu($id)\n {\n $item = (array) FrontendModel::get('database')->getRecord(\n 'SELECT i.*\n FROM menu AS i\n WHERE i.id = ? AND i.language = ?',\n array((int) $id, FRONTEND_LANGUAGE)\n );\n\n // no results?\n if (empty($item)) {\n return array();\n }\n\n // create full url\n //$item['full_url'] = Navigation::getURLForBlock('Menu', 'detail') . '/' . $item['url'];\n\n return $item;\n }",
"function getMenu()\n {\n return $this->getAttribute(\"menu\");\n }",
"function sc_menu(){\n\n\tglobal $post;\n\n\t$menu_array = array();\n\n\t//Query Args\n\t$args = array(\n\t\t\t'post_type' => array('page'),\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_parent' => $post->ID,\n\t\t\t'orderby' => 'menu_order',\n\t\t\t'order' => 'ASC',\n\t\t\t'posts_per_page' => -1\n\t\t);\n\n\t//Top Level\n\tif( $post->post_parent == 0 ){\n\n\t\t$menu = new Wp_Query($args);\n\t\twp_reset_query();\n\n\t\t$menu_array[] = $post->ID;\n\t\tforeach( $menu->posts as $item ){\n\t\t\t$menu_array[] = $item->ID;\n\t\t}\n\n\t//Child Level\n\t} elseif( $post->post_parent > 0 ) {\n\n\t\t$args['post_parent'] = $post->post_parent;\n\t\t$menu = new Wp_Query($args);\n\t\twp_reset_query();\n\n\t\t$menu_array[] = $post->post_parent;\n\t\tforeach( $menu->posts as $item ){\n\t\t\t$menu_array[] = $item->ID;\n\t\t}\n\t}\n\n\treturn count($menu_array) > 1 ? $menu_array : false ;\n\n}",
"public function getMenusFromAccesslevel()\r\n {\r\n\r\n $id = $this->user()->acl;\r\n $menus = $this->model->table('menu_groups')->where('acl',$id)->get();\r\n\r\n $list = '';\r\n if(count($menus) > 1){\r\n foreach($menus as $menu){\r\n $list .= $menu->alias.',';\r\n }\r\n }\r\n elseif(count($menus) == 1){\r\n $list = $menus[0]->alias;\r\n }\r\n\r\n return $list;\r\n }",
"public static function getAllMenu()\n {\n $rows = Yii::$app->cache->get(\"BackendMenu:all\");\n if (false === is_array($rows)) {\n $rows = static::find()\n ->orderBy('parent_id ASC, sort ASC')\n ->asArray()\n ->all();\n Yii::$app->cache->set(\n \"BackendMenu:all\",\n $rows,\n 86400,\n new TagDependency([\n 'tags' => [\n ActiveRecordHelper::getCommonTag(static::className()),\n ],\n ])\n );\n }\n // rebuild rows to tree $all_menu_items\n $all_menu_items = Tree::rowsArrayToMenuTree($rows, 0, 0, false);\n\n return $all_menu_items;\n }",
"public function getMenu ()\n {\n # Monto a opção de escolha dos sistemas do Usuario\n try {\n $sess = Session::getLiveSession('sisicmbio','USER');\n SIALException::ThrowsExceptionIfParamIsNull($sess, 'Não foi encontrada a sessão para o objeto informado');\n } catch (SIALException $excp) {\n # Não foi encontrada a Sessão para Este Sistema\n header(\"Location: \" . $this->bootstrap()->config()->get('app')->get('authSystem'));\n }\n\n\n $count = 0;\n foreach ($sess->sistemas as $sistema) {\n $arrSistema[$count]['href'] = $sistema['sqSistema'];\n $arrSistema[$count]['text'] = $sistema['sgSistema'];\n $count++;\n }\n\n $Menuoptions = array('__DIVIDER_VERTICAL__',\n 'Início' => array(),\n '__DIVIDER_VERTICAL__' ,\n 'Sistemas' => $arrSistema,\n '__DIVIDER_VERTICAL__');\n\n $menuParam = new \\stdClass;\n $menuParam->options = $Menuoptions;\n $menuParam->type = 'h';\n\n $this->_SIALApplication->set('menuH',$this->getSAF()->create('menu', $menuParam));\n\n $this->_SIALApplication->set('param',array('nome' => $sess->noPessoa,\n 'perfil' => $sess->noPerfil,\n 'uorg' => $sess->noUnidadeOrg,\n 'help' => 'HTML',\n 'sysId' => $sess->sqSistema,\n 'sysAlias' => isset($sess->sistemas[$sess->sqSistema]['sgSistema']) ? $sess->sistemas[$sess->sqSistema]['sgSistema'] : '',\n 'multiProfile' => count($sess->allProfile) > 1 ? TRUE : FALSE,\n 'inPerfilExterno' => $sess->inPerfilExterno,\n )\n );\n\n # Monto os Menus\n $menu = $sess->MenuExterno;\n\n $count = 0;\n $countSon = 0;\n $arrMenu = array();\n foreach ($menu as $menuCadastro) {\n $arrMenu[$count]['text'] = $menuCadastro['MenuPai']['noMenu'];\n $arrMenu[$count]['href'] = $menuCadastro['Acao'];\n\n if (isset($menuCadastro['MenuFilho'])) {\n $arrTmpFilho = current($menuCadastro['MenuFilho']);\n if (empty($arrTmpFilho['MenuFilho']['noMenu'])) {\n // continue;\n }\n\n foreach ($menuCadastro['MenuFilho'] as $menuFilho) {\n\n if (!isset($arrMenu[$count])) {\n continue;\n }\n\n if (isset($menuFilho['Acao']) && NULL !== $menuFilho['Acao']) {\n $arrMenu[$count][$countSon]['href'] = $menuFilho['Acao'];\n }\n\n if (!empty($menuFilho['MenuFilho']['noMenu'])) {\n $arrMenu[$count][$countSon]['text'] = $menuFilho['MenuFilho']['noMenu'];\n }\n\n $countSon++;\n }\n }\n $count++;\n }\n\n $menuParam = new \\stdClass;\n $menuParam->title = 'Menu';\n $menuParam->options = $arrMenu;\n $menuParam->type = 'v';\n\n $this->_SIALApplication->set('menuV',$this->getSAF()->create('menu', $menuParam));\n }",
"public function obtenerElementosMenu();",
"public function getMenuById($id) {\r\n $sql = $this->db->query(\"SELECT * FROM ms_menu WHERE menuid = '$id'\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->row_array();\r\n }\r\n return null;\r\n }",
"public function run()\n\t{\n\t\tDB::table('menus')->truncate();\n\n\t\t$menus = [\n\n\t\t\t[\n\t\t\t\t'slug' => 'home',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 1,\n\t\t\t\t'menu_group' => 'public',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Home',\n\t\t\t\t'url' => '',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-home',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'dashboard',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Dashboard',\n\t\t\t\t'url' => 'dashboard',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-dashboard',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'reports',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Reports',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-bar-chart',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'expenses',\n\t\t\t\t'parent_slug' => 'reports',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Expenses',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-line-chart',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'membership',\n\t\t\t\t'parent_slug' => 'reports',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 2,\n\t\t\t\t'title' => 'Membership',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-line-chart',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'frequentation',\n\t\t\t\t'parent_slug' => 'reports',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 3,\n\t\t\t\t'title' => 'Frequentation',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-line-chart',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'membership',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 2,\n\t\t\t\t'title' => 'Membership',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-rocket',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'members',\n\t\t\t\t'parent_slug' => 'membership',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Members',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-mortar-board',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'mentors',\n\t\t\t\t'parent_slug' => 'membership',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Mentors',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-child',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'plans',\n\t\t\t\t'parent_slug' => 'membership',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 2,\n\t\t\t\t'title' => 'Plans',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-ticket',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'finances',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 3,\n\t\t\t\t'title' => 'Finances',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-money',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'transactions',\n\t\t\t\t'parent_slug' => 'finances',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Transactions',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-exchange',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'billing',\n\t\t\t\t'parent_slug' => 'finances',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Billing',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-dollar',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'accounts',\n\t\t\t\t'parent_slug' => 'finances',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Accounts',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-user',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'stripe',\n\t\t\t\t'parent_slug' => 'finances',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Stripe',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-cc-stripe',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'paypal',\n\t\t\t\t'parent_slug' => 'finances',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Paypal',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-paypal',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'accesscontrol',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 4,\n\t\t\t\t'title' => 'Access control',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-lock',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'keys',\n\t\t\t\t'parent_slug' => 'accesscontrol',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Keys',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-key',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'rfidcards',\n\t\t\t\t'parent_slug' => 'accesscontrol',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'RFID Cards',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-credit-card',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'alarmpins',\n\t\t\t\t'parent_slug' => 'accesscontrol',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 2,\n\t\t\t\t'title' => 'Alarm Pins',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-shield',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'haccsy',\n\t\t\t\t'parent_slug' => 'accesscontrol',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'main',\n\t\t\t\t'menu_order' => 3,\n\t\t\t\t'title' => 'HACCSY',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-server',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'settings_general',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 3,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'General',\n\t\t\t\t'url' => 'settings/general',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-gear',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'settings_emails',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 3,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Emails',\n\t\t\t\t'url' => 'settings/emails',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-envelope',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'users',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 19,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Users',\n\t\t\t\t'url' => 'settings/users',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-user',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'allusers',\n\t\t\t\t'parent_slug' => 'users',\n\t\t\t\t'permission_id' => 19,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'All Users',\n\t\t\t\t'url' => 'users',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-users',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'roles',\n\t\t\t\t'parent_slug' => 'users',\n\t\t\t\t'permission_id' => 7,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Roles',\n\t\t\t\t'url' => 'roles',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-eye',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'permissions',\n\t\t\t\t'parent_slug' => 'users',\n\t\t\t\t'permission_id' => 2,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 2,\n\t\t\t\t'title' => 'Permissions',\n\t\t\t\t'url' => 'permissions',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-exclamation-triangle',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'modules',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 3,\n\t\t\t\t'title' => 'Modules',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-plug',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'installedmodules',\n\t\t\t\t'parent_slug' => 'modules',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Installed Modules',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-inbox',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'modulesaddnew',\n\t\t\t\t'parent_slug' => 'modules',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Add new',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-plus',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'appearance',\n\t\t\t\t'parent_slug' => null,\n\t\t\t\t'permission_id' => 3,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 4,\n\t\t\t\t'title' => 'Appearance',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-paint-brush',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'menus',\n\t\t\t\t'parent_slug' => 'appearance',\n\t\t\t\t'permission_id' => 11,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 0,\n\t\t\t\t'title' => 'Menus',\n\t\t\t\t'url' => 'settings/menus',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-bars',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'slug' => 'themes',\n\t\t\t\t'parent_slug' => 'appearance',\n\t\t\t\t'permission_id' => 3,\n\t\t\t\t'menu_group' => 'settings',\n\t\t\t\t'menu_order' => 1,\n\t\t\t\t'title' => 'Themes',\n\t\t\t\t'url' => '#',\n\t\t\t\t'description' => null,\n\t\t\t\t'icon' => 'fa-television',\n\t\t\t],\n\n\t\t];\n\n\t\tforeach ($menus as $menu) {\n\t\t\tMenu::create($menu);\n\t\t}\n\t}",
"public function getMenuByUser($roleId)\n {\n return $this->db->select('user_menu.id, menu')->from('user_menu')->join('user_access_menu', 'user_menu.id = user_access_menu.menu_id')->where(\"user_access_menu.role_id= $roleId\")->order_by('user_access_menu.menu_id', 'ASC')->get()->result_array();\n }",
"function getMenuItem($type, $id_admin, $top_menu, $id_parent='-1')\n{\n\tif($type == '1') //for super admin\n\t{\n\t\t$query\t\t= \"* FROM admin_menu where id_parent='\". $id_parent .\"' and status='1' and top_menu = '\". $top_menu .\"' order by sort\";\n\t}\n\telse //for sub admins\n\t{\n\t\t$query\t\t= \"* FROM admin_menu as AM, admin_access as AC where AM.id_menu = AC.id_menu and AM.id_parent='\". $id_parent .\"' and AM.status='1' and top_menu = '\". $top_menu .\"' \";\n\t\tif($type != '1')\n\t\t\t$query\t.= \"and AC.id_admin = '\". $id_admin .\"' \";\n\t\t$query\t\t.= \"order by sort\";\t\n\t}\n\treturn getLoopData($query);\n}",
"public static function menus(): array\n {\n return [];\n }",
"public function query() {\n $query = parent::query();\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n return $query;\n }",
"public static function get(){\n $query = HtmTxtQuery::start();\n $query->joinHtmPage()->selectId()->selectHtmId()->selectLangsTld()->selectHtmLayoutId()->selectTitle()->selectSlug()->selectMenu()->selectHeading()->selectUpdatedAt()->endUse();\n\t\n \n return $query;\n }",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();"
] | [
"0.8478544",
"0.7518383",
"0.71966344",
"0.7098829",
"0.7085742",
"0.7009039",
"0.6894907",
"0.68746626",
"0.6847141",
"0.68435115",
"0.67738056",
"0.6770894",
"0.6756192",
"0.6657886",
"0.6594664",
"0.65764225",
"0.65571254",
"0.65424675",
"0.65221184",
"0.65205455",
"0.6458247",
"0.64468694",
"0.6433833",
"0.6423723",
"0.6343471",
"0.6287631",
"0.6283866",
"0.62710744",
"0.624876",
"0.62271947",
"0.6208647",
"0.6205604",
"0.61631876",
"0.616035",
"0.6151582",
"0.61414707",
"0.6106725",
"0.60994494",
"0.6096198",
"0.60951084",
"0.60934603",
"0.6089457",
"0.6085607",
"0.60732424",
"0.60495883",
"0.60397",
"0.6009791",
"0.60011774",
"0.5997988",
"0.5992475",
"0.5971262",
"0.59705234",
"0.59601134",
"0.59564334",
"0.59561896",
"0.5954314",
"0.595159",
"0.59431463",
"0.59396166",
"0.5924681",
"0.5924681",
"0.5923216",
"0.5923031",
"0.5921821",
"0.5919756",
"0.5916533",
"0.5906248",
"0.5898075",
"0.58929163",
"0.58887416",
"0.58736104",
"0.58731276",
"0.58638567",
"0.5858582",
"0.58578295",
"0.5854383",
"0.58176404",
"0.58124614",
"0.58058286",
"0.58054996",
"0.58019423",
"0.5801303",
"0.5788457",
"0.5785454",
"0.57763577",
"0.57537246",
"0.57474136",
"0.57446027",
"0.57442",
"0.573091",
"0.5725941",
"0.5717058",
"0.5715943",
"0.5710495",
"0.57060593",
"0.5702758",
"0.5702758",
"0.5702758",
"0.5702758",
"0.5702758"
] | 0.6600042 | 14 |
Gets query for [[Notifications]]. | public function getNotifications()
{
return $this->hasMany(Notification::className(), ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetNotifications () {\n\t\treturn $this->notifications;\n\t}",
"public function listNotifications()\r\n { \t \r\n \r\n \t$data = $this->call(array(), \"GET\", \"notifications.json\");\r\n \t$data = $data->{'notifications'};\r\n \t$notificationArray = new ArrayObject();\r\n \tfor($i = 0; $i<count($data);$i++){\r\n \t\t$notificationArray->append(new Notification($data[$i], $this));\r\n \t}\r\n \treturn $notificationArray;\r\n }",
"final public function get_notifications() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT notification_id, message, user_id, type, a_href, read_status, date_notified\r\n\t\t\tFROM `notifications`\r\n\t\t\tWHERE read_status = '\" . NotificationFactory::UNREAD . \"'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\t$notifications = array();\r\n\t\t\twhile ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {\r\n\t\t\t\t$notification = '<a href=\"' . $row['a_href'] . '\">' . $row['message'] . '</a>';\r\n\t\t\t\tarray_push($notifications, $notification);\r\n\t\t\t}\r\n\t\t\treturn $notifications;\r\n\t\t}\r\n\t}",
"public function getNotifications()\n {\n return $this->hasMany(Notification::className(), ['task_id' => 'id']);\n }",
"public function getNotificationById($id) {\n $sql = 'SELECT * FROM notifications WHERE idNotifications = ?';\n $sqlQuery = new SqlQuery($sql);\n $sqlQuery->set($id);\n return $this->getList($sqlQuery);\n }",
"public function getNotifications()\n {\n return $this->_notifications;\n }",
"public function notifications()\n {\n $notifications = $this->get(\"/api/v1/conversations?as_user_id=sis_user_id:mtm49\");\n return $notifications;\n }",
"public function get_notification_get(){\n $notification = $this->model->getAllwhere('notification');\n\n $resp = array(\n 'rccode' => 1,\n 'message' => 'SUCCESS',\n 'notification' => (!empty($notification) ) ? $notification: [],\n );\n $this->response($resp);\n }",
"public function getNotifications($filter = array('enabled' => 1), $paginator = false)\n {\n return $this->em->getRepository('App:Notification')\n ->findRecordsByFilter(\n $filter, \n $this->application_crud->getSortColumn('application_notification_sort'), \n $this->application_crud->getSortOrder('application_notification_sort_orderBy'),\n $paginator\n );\n }",
"public function notifications() { return $this->notifications; }",
"public function getNotifs() {\n\n // Notifications stored\n if( Storage::exists('notifications.ser') ) {\n $notifs = unserialize( Storage::get('notifications.ser') );\n\n // If the query is too old, remove the notifs\n if( Carbon::now()->timestamp - $notifs['query_date'] > 60 )\n $notifs = null;\n }\n\n // Get the information for the API\n if( !isset($notifs) ) {\n $notifs = [\n 'query_date' => Carbon::now()->timestamp,\n 'notifications' => getJSON( env('APP_URL_SERVER') . '/api/notifications' )\n ];\n\n // Store the new query\n Storage::put('notifications.ser', serialize($notifs));\n }\n\n return $notifs;\n }",
"function GetNotifications($uid=false,$last_notification=false){\n\n\t$query_=$last_notification?\" and `id`> {$last_notification}\":\"\";\n\n\t$notifications = NotificationsModel::model()->findAll(\"`to` =\".helpers::uid($uid).$query_.\" order by `time` desc limit 10\");\n\n\tif($notifications!=NULL){\n\n\t//get user controller\n\t$user_c=Helpers::get_controller(USERS);\n\n\tforeach ($notifications as $k=>$notification){\n\n\t$notifications[$k]->user = $user_c->GetUserById($notification->from);\n\n\t}\n\n\n\t}\n\n\n\treturn $notifications==null?array():$notifications;\n\n\t}",
"public function findByPendingCallNotifications() {\n\t\t$callTolerence = 10;\n\t\t$callTolerenceTime = mktime(date(\"H\"), date(\"i\")+$callTolerence, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n\t\t$query = 'SELECT n FROM AcmeTaskBundle:Notification n WHERE n.datetime <= :callTolerenceTime AND n.push = 1 AND n.pushConfirm = 0 AND n.sms = 0 AND n.voicecall = 0 ORDER BY n.datetime';\n\t\t\n\t\ttry{\n\t\t\treturn $this->getEntityManager()\n\t\t\t\t->createQuery($query)\n\t\t\t\t->setParameter('callTolerenceTime', $callTolerenceTime)\n\t\t\t\t->getResult();\n\t\t} catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n \t}\n\t}",
"public function notifications()\n {\n return $this->morphMany(DatabaseNotification::class, 'notifiable')->orderBy('created_at', 'desc');\n }",
"public function getNotifications()\n\t{\n\t\t$arrReturn = array();\n\t\t\n\t\t$arrTypes = array_keys($GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['pct_customcatalog_frontedit']);\n\t\t\n\t\t$objNotifications = \\NotificationCenter\\Model\\Notification::findBy(array('FIND_IN_SET(type,?)'),implode(',',$arrTypes));\n\t\tif($objNotifications === null)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\tforeach($objNotifications as $objModel)\n\t\t{\n\t\t\t$arrReturn[ $objModel->id ] = $objModel->title;\n\t\t}\n\t\t\n\t\treturn $arrReturn;\n\t}",
"public function getNotifications($data=array()){\n\t\t$where_filter = \"1 \";\n\t\t if(!empty($data['templatecategory_id'])){\n\t\t\t $where_filter = \"NT.templatecategory_id ='3'\";\n\t\t }\n\t\t$select = $this->_db->select()\n\t\t\t\t\t->from(array('NT'=>MAIL_NOTIFY_TYPES),array('ID'=>\"NT.notification_id\",'Name'=>'NT.notification_name','category_id'=>'NT.templatecategory_id'))\n\t\t\t\t\t ->where('NT.notification_staus =\"1\" AND '.$where_filter)\n\t\t\t\t\t->order('NT.notification_name ASC');\n\t\t\t\t\t\t//echo $select->__tostring();die;\n\t\treturn $this->getAdapter()->fetchAll($select);\n\t}",
"function get_all_notifications()\n {\n $this->db->order_by('id_notification', 'desc');\n return $this->db->get('notifications')->result_array();\n }",
"public function notifications()\n {\n return $this->hasMany(DatabaseNotification::class, 'type', 'name');\n }",
"public function findByPendingSMSNotifications() {\n\t\t$smsTolerence = 5;\n\t\t$callTolerence = 10;\n\t\t$smsTolerenceTime = mktime(date(\"H\"), date(\"i\")+$smsTolerence, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n\t\t$callTolerenceTime = mktime(date(\"H\"), date(\"i\")+$callTolerence, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n\t\t$query = 'SELECT n FROM AcmeTaskBundle:Notification n WHERE n.datetime <= :smsTolerenceTime AND n.datetime > :callTolerenceTime AND n.push = 1 AND n.pushConfirm = 0 ORDER BY n.datetime';\n\t\t\n\t\ttry{\n\t\t\treturn $this->getEntityManager()\n\t\t\t\t->createQuery($query)\n\t\t\t\t->setParameter('smsTolerenceTime', $smsTolerenceTime)\n\t\t\t\t->setParameter('callTolerenceTime', $callTolerenceTime)\n\t\t\t\t->getResult();\n\t\t} catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n \t}\n\t}",
"public function getAllNotifcations(){\n $query = new Query(); // ADDED\n\n //This function returns all the trainer records that contain the name string\n //It ignores the distinction lowercase & uppercase.\n $sql = \"SELECT n.date_created, \n t.trainer_name,\n n.notification_id\n FROM Notifications AS n\n INNER JOIN (Trainers AS t)\n ON (n.trainer_id = t.trainer_id);\";\n\n $query->setSql($sql); // ADDED\n\n $res_container = $query->handleQuery(); // ADDED\n\n return $res_container; \n }",
"function get_notifications($userID){\n\t\t\t$query = \"SELECT notifications.notifications_id, notifications.notif_type, notifications.content, notifications.sender_id, notifications.time, notifications.read_message, user.name, userphoto.original_photo FROM notifications INNER JOIN user ON notifications.sender_id = user.user_id LEFT JOIN userphoto ON notifications.sender_id = userphoto.user_id WHERE notifications.user_id = '$userID'\";\n\t\t\treturn $this->db->query($query);\n\t\t}",
"public function getFightNotifcations(){\n //It ignores the distinction lowercase & uppercase.\n $sql = \"SELECT Notifications.date_created, \n Notifications.notification_id,\n p.breedname,\n f1.fight_description,\n Trainers.trainer_name \n FROM FightEvents AS f\n INNER JOIN (Notifications)\n ON (f.notification_id = Notifications.notification_id)\n INNER JOIN (Trainers)\n ON (Trainers.trainer_id = Notifications.trainer_id)\n INNER JOIN (Pokemon AS p)\n ON (p.pokemon_id = f.pokemon_id)\n INNER JOIN (Fights AS f1)\n ON (f.fight_id = f1.fight_id);\";\n\n\n $query = new Query(); // ADDED\n\n\n $query->setSql($sql); // ADDED\n\n $res_container = $query->handleQuery(); // ADDED\n\n return $res_container; \n }",
"public function getNotifications()\n {\n $notifications = Notification::groupBy('count');\n\n return Datatables::of($notifications)\n ->editColumn('id', function ($notification) {\n return $notification->count;\n })\n ->editColumn('type', function ($notification) {\n if ($this->types->has($notification->type)) {\n return '<span class=\"label '.$this->types->get($notification->type).'\">'.$notification->type.'</span>';\n } else {\n return $notification->type;\n }\n })\n ->addColumn('actions', function ($notification) {\n $html = '<a href=\"'.url('notifications/view/'.$notification->count).'\" class=\"btn btn-sm btn-primary\" style=\"margin-right:5px\"><i class=\"fa fa-eye\"></i> View</a>'.\n '<a href=\"'.url('notifications/destroy/'.$notification->count).'\" data-button=\"delete\" class=\"btn btn-sm btn-danger\"><i class=\"fa fa-trash\"></i> Delete</a>';\n\n return $html;\n })\n ->make(true);\n }",
"public function notifications()\n {\n return $this->morphToMany(Notification::class, 'notifiable');\n }",
"public function notifications()\n {\n return $this->hasMany('App\\Notification');\n }",
"public function notifications()\n {\n return $this->hasMany('App\\Notification');\n }",
"public function getNotificationById($id);",
"public function notifications($param = 0)\n\t{\n\t\t$where = (!$param) ? $this->session->userdata('user')->ID_user : $param;\n\t\t$query = $this->db->query(\"\n\t\t\tSELECT tb_notifications.*, tb_users.* FROM tb_notifications\n\t\t\tLEFT JOIN tb_users ON tb_notifications.sender_user_id = tb_users.ID_user\n\t\t\tWHERE tb_notifications.receive_user_id = ? AND tb_notifications.read = 'false'\n\t\t\", array($where));\n\t\treturn $query->result();\n\t}",
"public function notificationlist(){\n \n $select = $this->_db->select()\n ->from(array('MNT'=>MAIL_NOTIFY_TYPES), array('MNT.notification_id','MNT.notification_name','MNT.templatecategory_id'))\n\t\t ->where(\"MNT.notification_staus='1' AND MNT.templatecategory_id=1\")\n\t\t ->order(\"MNT.notification_name ASC\");\n $result = $this->getAdapter()->fetchAll($select);\n\t return $result;\n }",
"public function getNotifications() {\n $api = new ApiNotification($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }",
"public function notifications()\n {\n return $this->morphMany(Notification::class, 'notificable');\n }",
"public function getAll()\n {\n $result = array();\n\n $query_data = $this->_getQuery();\n $url = $this->_getConfig()->getApiUrlPath().'/shops/'.$this->_getConfig()->getYapitalShopId().'/notifications';\n\n $this->getClient()->resetHttpClient();\n $response = $this->getClient()->restGet( $url, $query_data )->getBody();\n\n if ( $data = json_decode($response,1) )\n {\n\n if( isset( $data['payload'] ) && is_array( $data['payload']['notification'] ) )\n {\n foreach( $data['payload']['notification'] AS $payload ) {\n $notification = Mage::getModel('yapital/datatype_notification');\n /* @var $notification Codex_Yapital_Model_Datatype_Notification */\n\n $notification->importPayload( $payload );\n\n $result[] = $notification;\n }\n }\n\n }\n\n return $result;\n }",
"public function getNotifications(NotificationRequest $request)\n\t{\n\t\t$record_per_page = $request->item_per_page ?? PaginateType::PAGINATE_DEFAULT_PER_PAGE;\n\t\t$notification = $this->iNotificationRepository->getNotifications(Auth::user()->id, false, $record_per_page);\n\t\tif (!$notification)\n\t\t\tthrow new RecordNotFoundException(trans('api/notification.notification_not_found'));\n\n\t\t$read_notification = $notification->where('is_read', false)->pluck('id')->toArray();\n\t\t// update the status to read\n\t\t$this->iNotificationRepository->updateReadNotificationsStatus($read_notification);\n\t\treturn NotificationResource::collection($notification);\n\t}",
"public function getUserNotifications($where, array $markers = []);",
"function get_notification($id_notification)\n {\n return $this->db->get_where('notifications',array('id_notification'=>$id_notification))->row_array();\n }",
"public function getUserNotifications($id){\n $user = User::query()->findOrFail($id);\n $notifications = Notification::query()->where('to_user_id', $user->_id)->get();\n $unreadNotifications = Notification::query()->where('to_user_id', $user->_id)->where('is_read', false)->get()->count();\n return Response::raw(200, array_merge([\"notifications\" => $notifications->toArray()], [\"unread_notifications\" => $unreadNotifications]));\n }",
"public function showAllNotifications()\n {\n return view('intern.notifications.allnotifications')\n ->withUser(auth()->user())\n ->withNotifications(auth()->user()->notifications()->paginate(10));\n }",
"public function get()\n {\n $search = isset($_COOKIE['notifications']) ? json_decode($_COOKIE['notifications']) : (object)[];\n return [\n 'data' => Attachment::notificationSearch($search)->paginate(30),\n 'counts' => Attachment::notificationCounts($search),\n ];\n }",
"public static function getNotifications()\n {\n $callbacks = Notifications::_checks();\n\n $notifications = array();\n foreach ($callbacks as $check) {\n $notification = call_user_func($check);\n if (is_array($notification)) {\n $notifications = array_merge($notifications, $notification);\n } elseif (strlen(trim($notification))) {\n $notifications[] = $notification;\n }\n }\n if (count(self::$notifications)) {\n $notifications = array_merge($notifications, self::$notifications);\n }\n if (count($notifications)) {\n return $notifications;\n } else {\n return null;\n }\n }",
"public function notifynderNotifications()\n {\n $model = notifynder_config()->getNotificationModel();\n if (notifynder_config()->isPolymorphic()) {\n return $this->morphMany($model, 'to');\n }\n\n return $this->hasMany($model, 'to_id');\n }",
"public static function notifications(): array\n {\n return [];\n }",
"public function GetDeviceNotifications()\n {\n return $this->deviceNotifications;\n }",
"public function getNotifications(Request $request)\n {\n $data = json_decode($request->getContent());\n $user_id = $data->user_id;\n\n $n = Notification::where('user_id',$user_id)->where('status',true)->get();\n\n return response()->json($n);\n }",
"protected function getQuery(Notification $notification)\n {\n $query = $this->getQueryInstance();\n $query\n ->where('from_id', $notification->from_id)\n ->where('from_type', $notification->from_type)\n ->where('to_id', $notification->to_id)\n ->where('to_type', $notification->to_type)\n ->where('category_id', $notification->category_id);\n $extra = $notification->extra;\n if (! is_null($extra) && ! empty($extra)) {\n if (is_array($extra)) {\n $extra = json_encode($extra);\n }\n $query->where('extra', $extra);\n }\n\n return $query;\n }",
"public function all()\n {\n return $this->jsonData(Auth::user()->notifications);\n }",
"public function unread($notifications);",
"public function get_all_notifications($id)\n {\n $this->db->where('invitacionInvitadoPersonalId', $id);\n $this->db->where('invitacionUsuarioPersonalId != ', $id);\n $this->db->where('invitacionPersonalStatus', '1');\n $query = $this->db->count_all_results('invitacionpersonal');\n return $query;\n }",
"public function getNotifications()\n {\n $notifications = AllRequests::getNotifications();\n return view('userprofile.notifications')->with(array('notifications'=>$notifications));\n }",
"public function getNotificationRelation()\n {\n return $this->notifynderNotifications();\n }",
"public function getNotificationTypes()\n {\n return $this->notifications;\n }",
"public static function getNotification($id = false, $orderBy=false) {\n global $wpdb;\n $query = 'SELECT * FROM `wp_notification` WHERE is_deleted = 0 ';\n if($id !== false) {\n $query .= ' AND id = '. $id;\n }\n if($orderBy !== false) {\n $query .= ' ORDER BY' . $orderBy;\n }\n $results = $wpdb->get_results($query);\n return $results;\n }",
"public function getNotificationsCollection()\n {\n return Mage::getModel('kdcatalogupdates/log')->getCollection();\n }",
"public function notifications()\n {\n return $this->morphToMany(Notification::class, 'notificationable', 'notificationables');\n }",
"public function getNotificationAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $qb = $em->createQueryBuilder();\n $result = $qb->select('n.id, n.type, n.levelCode, n.levelDescription,'\n . 'n.priority, n.priorityCode, n.title, n.description,'\n . 'n.isActive, n.statusRead, n.createdAt, n.createdAtDate, n.createdAtTime')\n ->from('ESERVMAINProfileBundle:EservVUserNotification', 'n')\n ->where('n.fosUserId = :uid')\n ->setParameter('uid', $this->get('security.context')->getToken()->getUser()->getId())\n ->orderBy('n.createdAt','DESC')\n ->addOrderBy('n.priorityOrder', 'DESC') \n ->getQuery()\n ;\n \n $FormattedQuery = $this->container->get('core_function_services')->GetOutputFormat($result, 'array');\n\n return $this->render('ESERVMAINProfileBundle:UserNotification:view.html.twig', array(\n 'notifications' => $FormattedQuery, \n )); \n\n }",
"public function notifications()\n {\n return $this->hasMany('App\\Models\\Servers\\ApplicationNotification');\n }",
"function td_nm_get_notifications( $filters = array() ) {\n\t$defaults = array(\n\t\t'posts_per_page' => - 1,\n\t\t'post_type' => 'td_nm_notification',\n\t\t'orderby' => 'date',\n\t\t'order' => 'ASC',\n\t);\n\n\tif ( ! function_exists( 'is_plugin_active' ) ) {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t}\n\n\t$filters = array_merge( $defaults, $filters );\n\t$posts = get_posts( $filters );\n\t$notifications = array();\n\n\tforeach ( $posts as $post ) {\n\n\t\t$trigger = td_nm_get_trigger( $post->ID );\n\t\t$trigger_instance = TD_NM_Trigger_Factory::get_instance( $trigger );\n\n\t\tif ( $applicable = $trigger_instance->is_notification_applicable() ) {\n\t\t\t$post->trigger = $trigger;\n\t\t\t$post->actions = td_nm_get_actions( $post->ID );\n\t\t\t$notifications[] = $post;\n\t\t}\n\t}\n\n\treturn $notifications;\n}",
"protected function getAllNotificationsQuery($userId)\n {\n return (new Query())\n ->from($this->notificationsTable)\n ->where([\n 'user_id' => $userId,\n 'is_deleted' => 0,\n ])\n ->orderBy($this->notificationOrder);\n }",
"function notifications()\r\r\n\t{\r\r\n\t\t$table \t\t\t\t\t\t\t= 'notifications';\r\r\n\t\t$condition \t\t\t\t\t\t= '';\r\r\n\t\tif ($this->uri->segment(3)) {\r\r\n\t\t\t$notificationId \t\t\t= $this->uri->segment(3);\r\r\n\t\t\t$condition['nid'] \t\t\t= $notificationId;\t\t\t\r\r\n\t\t}\r\r\n\t\t$notifications \t\t\t\t\t= $this->base_model->fetch_records_from(\r\r\n\t\t$table, \r\r\n\t\t$condition, \r\r\n\t\t$select \t\t\t\t\t\t= '*', \r\r\n\t\t$order_by \t\t\t\t\t\t= ''\r\r\n\t\t);\r\r\n\t\t$this->data['notifications'] \t= $notifications;\r\r\n\t\tif ($this->uri->segment(3)) {\r\r\n\t\t\t$this->data['notificationTitle'] = $notifications[0]->title;\r\r\n\t\t}\r\r\n\t\t$this->data['content'] \t\t\t= 'general/notifications';\r\r\n\t\t$this->_render_page('temp/template', $this->data);\r\r\n\t}",
"function getUserNotification( $id ) {\n\tglobal $ftsdb;\n\t$data = [];\n\n\t$results = $ftsdb->select( DBTABLEPREFIX . \"notifications\",\n\t\t\"id = :id\",\n\t\tarray(\n\t\t\t\":id\" => $id,\n\t\t) );\n\tif ( count( $results ) == 0 ) {\n\t\t$data = $results[0];\n\t}\n\t$results = null;\n\n\treturn $data;\n}",
"public function get_notifiable_logs(){\n $this->db->where('is_completed', 0);\n $this->db->where('has_follow_up', 1);\n $this->db->where('notified', 0);\n $this->db->where('TIMESTAMPDIFF(MINUTE, CURRENT_TIMESTAMP(), follow_up_schedule) <=', '30');\n return $this->db->get(db_prefix() . 'call_logs')->result_array();\n }",
"public function get_notifications($id)\n {\n $this->db->select('*')\n ->from('notificaciones')\n ->join('notificacion', 'notificaPlanId = notificacionPlanId', 'left')\n ->where('notificaUsuarioId', $id)\n ->where('notificacionUsuarioId', $id)\n ->where('notificacionLeido', '1');\n $total = $this->db->count_all_results();\n return $total;\n }",
"function user_get_all_notifications($reciever_uid){\n\t\t$queryText = 'Select user_notifications.sender_uid, user_notifications.reciever_uid, user_notifications.message_tag, user_notifications.message, user_notifications.time,\n\t\t\tuser_accounts.first_name as sender_first_name, user_accounts.last_name as sender_last_name\n\t\t\tFROM user_notifications INNER JOIN user_accounts WHERE reciever_uid = :reciever_uid ORDER BY time DESC';\n\t\t\n\t\t$query = $this->connection->prepare($queryText);\n\t\t$query->execute(array(':reciever_uid'=>$reciever_uid));\n\t\t\n\t\treturn $query;\n\t}",
"public function getNotifications($username)\r\n\t{\r\n\t $query = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc(\"\r\n\t SELECT notifications.message,notifications.created_at FROM notifications WHERE notifications.recepient = '$username'\r\n\t ORDER BY notifications.created_at DESC LIMIT 3\r\n\t \");\r\n\t return $query;\r\n\t}",
"public function index(Request $request)\n {\n $notifications = $request->user()\n ->notifications()\n ->whereType($this->getQueryType($request))\n ->paginate(15)\n ->appends([\n 'type' => $request->query('type'),\n ]);\n\n return NotificationResource::collection($notifications);\n }",
"function GetUnreadNotifications($uid=false,$last_notification=false){\n\n\t$query_=$last_notification?\" and `id`> {$last_notification}\":\"\";\n\n\t$notifications = NotificationsModel::model()->findAll(\"`to` =\".helpers::uid($uid).$query_.\" and `seen`='0' order by `time` desc\");\n\n\tif($notifications!=NULL){\n\n\t//get user controller\n\t$user_c=Helpers::get_controller(USERS);\n\n\tforeach ($notifications as $k=>$notification){\n\n\t$notifications[$k]->user = $user_c->GetUserById($notification->from);\n\n\n\t}\n\n\n\t}\n\n\n\treturn $notifications==null?array():$notifications;\n\n\t}",
"public function getUserNotifications($user);",
"public function getNotificationsForUser($type)\n {\n $type == 'like' ? $typeNotification = NotificationEnum::LIKE_POST : ($type == 'comment' ? $typeNotification = NotificationEnum::COMMENT_POST : $typeNotification = NotificationEnum::FOLLOW_USER);\n $column = $this->model->fillable;\n $column[] = 'id as uuid';\n $notifications = $this->model->select($column)->whereNotifiableId(Auth::user()->id)->whereNotifiableType(NotificationEnum::MODEL_USER)->whereType($typeNotification);\n $updatenotifications = $notifications->update([\n 'view_at' => Carbon::now()\n ]);\n\n return $notifications->orderBy('created_at', 'DESC');\n }",
"function ExtractNotifications () {\n\t\trequire_once('xml-processing/gc_XmlParser.php');\n\t\t$GXmlParser = new gc_XmlParser($this->poll_result[1]);\n\t\t\t$data = $GXmlParser->GetData();\n\t\t\t//Get the actual notifications\n\t\t\tforeach($data['notification-data-response']['notifications'] as $notification) {\n\t\t\t\t$this->notifications[] = $notification;\n\t\t\t}\n\t\t\t//Get other useful info\n\t\t\t$this->has_more_notifications = $data['notification-data-response']['has-more-notifications']['VALUE'];\n\t\t\t$this->continue_token = $data['notification-data-response']['continue-token']['VALUE'];\n\t}",
"public function notifications(): MorphMany\n {\n return $this->morphMany(Notification::getProxiedClass(), 'notifiable')->latest();\n }",
"public function index()\n {\n $from_date_request = request('from_date');\n $from_date = \\Carbon\\Carbon::parse($from_date_request)\n ->toDateTimeString();\n\n $paginated_notifications = getAuthUser()->notifications()\n ->when($from_date_request?true:false,\n function ($query) use ($from_date) {\n return $query->where('created_at', '<=', $from_date);\n }\n )->latest()\n ->simplePaginate(config('consts.notifications_per_page'));\n\n return response()->json([\n 'notifications' => $paginated_notifications\n ]);\n }",
"public static function getNotificationsByAdmin($type) {\n return PushNotification::select(\"push_notification.*\", DB::raw(\"DATE_FORMAT(push_notification.created_at, '%m-%d-%Y %H:%i:%s') as created\"), DB::raw(\"push_notification.type % 110 as recipient_id\"))\n ->whereIn('type', $type)\n ->groupBy('title')\n ->groupBy('message')\n ->groupBy('type')\n ->orderBy('created', 'DESC')\n ->paginate(config('constants.record_per_page'))\n ->toArray();\n }",
"public function adminNotifications()\n {\n return $this->hasMany(AllNotifications::class, 'notification_id');\n }",
"public function read($notifications);",
"public function queryAll($userId){\r\n\t\t$sql = 'SELECT * FROM notifications WHERE user_id = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($userId);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"public function notifications(Request $request)\n {\n $userLogged = auth()->user();\n $notifications = $userLogged->unreadNotifications;\n return response()->json(array('data' => $notifications), 200);\n }",
"public function getUnsentNotifications() {\n return $this->hasMany(NotificationEmployer::className(), ['employer_id' => 'employer_id'])\n ->with(['job', 'student'])\n ->where(['notification_sent' => NotificationEmployer::SENT_FALSE])\n ->orderBy(\"notification_datetime DESC\");\n }",
"public function getById($id)\n {\n return $this->notification->find($id);\n }",
"protected function getForeignNotifications() {\n\t\tif ( !$this->foreignNotifications ) {\n\t\t\t$this->foreignNotifications = new EchoForeignNotifications( $this->mUser, true );\n\t\t}\n\t\treturn $this->foreignNotifications;\n\t}",
"public function ById($id)\n {\n return Notification::find($id);\n }",
"public function getNotificationNids(): array;",
"public function getnotifications(Request $request)\n {\n $unreadnotifications = Auth::user()->unreadNotifications;\n\n return response()->json(['success'=>true,'notifications'=>$unreadnotifications]);\n }",
"public function findNotifications($userId);",
"public function getNotification() {\n $uid = $this->currentUser->id();\n $roles = $this->currentUser->getRoles(TRUE);\n $notification = [\n 'notificationList' => [],\n 'id' => [],\n 'unreadCount' => '0',\n 'totalCount' => '0',\n ];\n\n // Get the nids which are not as per role.\n $nid = !empty($roles) ? $this->getNotificationNode($uid, $roles[0], $this->getContentStateByRole($roles[0])) : '';\n if (!$nid) {\n return $notification;\n }\n\n $configuration = $this->config->get('block.block.opendevxnotificationblock');\n\n $query = $this->connection->select('notifications', 'n');\n $query->fields('n', ['id', 'entity_id', 'message', 'status']);\n $query->condition('n.entity_id', $nid, 'IN');\n if ($configuration->get('block_notification_type') != NULL\n && $configuration->get('block_notification_type') == 1) {\n // Skip current user updated content notification.\n $query->condition('n.uid', $uid, '<>');\n // Include current user update content.\n if ($configuration->get('block_notification_logs_display') == 0) {\n $query->condition('n.uid', $uid);\n }\n }\n // Get notification for moderate content.\n $query->condition('n.action', 'content_moderated');\n $query->orderBy('n.id', 'DESC');\n $res = $query->execute();\n\n while ($notificationResult = $res->fetchObject()) {\n if (!empty($notificationResult->message) && !in_array($notificationResult->entity_id, $notification['id'])) {\n $notification['notificationList'][] = [\n 'id' => $notificationResult->id,\n 'message' => $notificationResult->message,\n 'status' => $notificationResult->status,\n ];\n $notification['id'][] = $notificationResult->entity_id;\n if ($notificationResult->status == 0) {\n $notification['unreadCount'] = $notification['unreadCount'] + 1;\n }\n $notification['totalCount'] = $notification['totalCount'] + 1;\n }\n }\n\n return $notification;\n }",
"public function getMoveNotifcations(){\n $query = new Query(); // ADDED\n\n //This function returns all the trainer records that contain the name string\n //It ignores the distinction lowercase & uppercase.\n $sql = \"SELECT Notifications.date_created,\n m.notification_id, \n p.breedname,\n m.old_move_name,\n m.new_move_name,\n Trainers.trainer_name \n FROM MoveEvents AS m\n INNER JOIN (Notifications) \n ON (m.notification_id = Notifications.notification_id)\n INNER JOIN (Pokemon AS p)\n ON (p.pokemon_id = m.pokemon_id)\n INNER JOIN (Trainers)\n ON (Trainers.trainer_id = Notifications.trainer_id);\";\n $query->setSql($sql); // ADDED\n $res_container = $query->handleQuery(); // ADDED\n\n return $res_container; \n }",
"public static function getNotificationById($id) {\n global $wpdb;\n $tabel = self::getTableName();\n $query = \"SELECT * FROM $tabel WHERE `id` = \" . $id;\n $results = $wpdb->get_row($query);\n return $results;\n }",
"public function filterByNotifications($notifications = null, $comparison = null)\n {\n if (null === $comparison)\n {\n if (is_array($notifications))\n {\n $comparison = Criteria::IN;\n }\n elseif (preg_match('/[\\%\\*]/', $notifications))\n {\n $notifications = str_replace('*', '%', $notifications);\n $comparison = Criteria::LIKE;\n }\n }\n return $this->addUsingAlias(CollectorProfileArchivePeer::NOTIFICATIONS, $notifications, $comparison);\n }",
"function get_notification()\n {\n $this ->db-> select('*');\n $this ->db-> from('tbl_enquiry');\n $this->db->where('enquiry_delete_status','0');\n $query = $this->db->get();\n return $query->result();\n }",
"public function notifications($organiser_id)\n {\n $organiser = Organiser::scope()->findOrFail($organiser_id);\n return $organiser->unreadNotifications()->limit(10)->get()->toArray();\n }",
"public function listNotificationInterests( );",
"public function index()\n {\n return response()->json(request()->user()->notifications);\n }",
"public static function getNotificationsReceivers($id) {\n $notification = PushNotification::where('id', $id)->first();\n if (isset($notification)) {\n $notification = $notification->toArray();\n\n $title = $notification['title'];\n $message = $notification['message'];\n $type = $notification['type'];\n\n return PushNotification::where('title', $title)\n ->where('message', $message)\n ->where('type', $type)\n ->with(['userDetails'])\n ->paginate(config('constants.record_per_page'))\n ->toArray();\n }\n }",
"public function getListNotification(Request $request)\n {\n $user = auth('api')->user();\n if (isset($request->type) && $request->type == 'system') {\n $data = NotificatonResource::collection(\n Notification::where('type_notification', '=', NotificationCode::TYPE_SYSTEM)\n ->where('user_id', $user->id)\n ->orderBy('id', 'desc')\n ->paginate(20)\n );\n } else {\n $data = NotificatonResource::collection(\n Notification::where('type_notification', '=', NotificationCode::TYPE_FOLLOW)\n ->where('user_id', $user->id)\n ->orderBy('id', 'desc')\n ->paginate(20)\n );\n }\n\n if (count($data)) {\n return response()->json([\n 'code' => ResponseStatusCode::OK,\n 'data' => $data,\n ]);\n } else {\n return response()->json([\n 'code' => ResponseStatusCode::NO_CONTENT,\n 'message' => 'NO CONTENT',\n ]);\n }\n }",
"public function viaNotificationChannels()\n {\n return UserNotificationChannel::with('notification_channel')->get()->filter(function ($item) {\n return $item->muted_at == null;\n })->pluck('notification_channel.name');\n }",
"public function notifications(Request $request)\n {\n $doctorLogged = auth()->user()->isSecretary() ? auth()->user()->assignedDoctor : auth()->user()->doctor;\n $notifications = $doctorLogged->unreadNotifications;\n return response()->json(array('data' => $notifications), 200);\n }",
"function GetAdminNotification()\n\t{\n\t\t$notifications = array(\n\t\t\t'adminnotify_email' => $this->adminnotify_email,\n\t\t\t'adminnotify_send_flag' => $this->adminnotify_send_flag,\n\t\t\t'adminnotify_send_threshold' => $this->adminnotify_send_threshold,\n\t\t\t'adminnotify_send_emailtext' => $this->adminnotify_send_emailtext,\n\t\t\t'adminnotify_import_flag' => $this->adminnotify_import_flag,\n\t\t\t'adminnotify_import_threshold' => $this->adminnotify_import_threshold,\n\t\t\t'adminnotify_import_emailtext' => $this->adminnotify_import_emailtext\n\t\t);\n\n\t\treturn $notifications;\n\t}",
"function getNotifs($lastId){\n $aItem = $this->model('Notification');\n $userId = $_SESSION['userID'];\n $myItems = $aItem->where('id', '>', $lastId)->where('user_id','=',$userId)->where('viewed','=','0')->get();\n echo json_encode($myItems);\n }",
"public function index()\n {\n return Notification::all();\n return view('notifications.index');\n }",
"function getUnsentNotifications($userId) {\n\t\treturn $this->_conn->arrayQuery(\"SELECT id, userid, objectid, type, title, body FROM notifications WHERE userid = :userid AND NOT SENT\",\n array(\n ':userid' => array($userId, PDO::PARAM_INT)\n ));\n\t}",
"protected function getEmailNotificationsFrom()\n {\n return ['address' => '[email protected]', 'name' => 'ICLogger Notification'];\n }",
"function get_notification($ID)\n {\n $this->db->where('ID', $ID);\n $this->db->from('tbl_notifications');\n $query = $this->db->get();\n return $query->row();\n }"
] | [
"0.7324579",
"0.72169805",
"0.7207508",
"0.7159329",
"0.7157475",
"0.7153732",
"0.7145465",
"0.7141083",
"0.7108115",
"0.6953154",
"0.69496465",
"0.68876755",
"0.6843784",
"0.6809255",
"0.6806639",
"0.6772309",
"0.67457473",
"0.6722028",
"0.6715384",
"0.6710293",
"0.6667241",
"0.6663283",
"0.66440815",
"0.6607608",
"0.66047937",
"0.66047937",
"0.65789133",
"0.65777177",
"0.65547055",
"0.6511822",
"0.6507887",
"0.64989555",
"0.64891785",
"0.6467204",
"0.6448464",
"0.6447919",
"0.64379543",
"0.642856",
"0.64280885",
"0.64185625",
"0.64151615",
"0.64147204",
"0.6413093",
"0.64098203",
"0.6409476",
"0.640781",
"0.6392826",
"0.63898426",
"0.63842624",
"0.6373867",
"0.63653606",
"0.6351944",
"0.6338571",
"0.6332256",
"0.6319719",
"0.6304201",
"0.6253495",
"0.62533975",
"0.6244025",
"0.62386954",
"0.62075305",
"0.61820036",
"0.6181201",
"0.6169592",
"0.6168472",
"0.6168299",
"0.61658573",
"0.61362255",
"0.61337584",
"0.6131667",
"0.6131171",
"0.6128763",
"0.6122064",
"0.6120173",
"0.61180806",
"0.6105775",
"0.60845923",
"0.608011",
"0.6065681",
"0.6056895",
"0.6054217",
"0.6052331",
"0.60446006",
"0.6044585",
"0.6037254",
"0.6035458",
"0.6006787",
"0.59923613",
"0.5980322",
"0.59741396",
"0.59635603",
"0.59606016",
"0.5930918",
"0.59242296",
"0.58892083",
"0.587412",
"0.58625436",
"0.58523",
"0.5851195",
"0.58487874"
] | 0.7192696 | 3 |
Gets query for [[OrderAssets]]. | public function getOrderAssets()
{
return $this->hasMany(OrderAsset::className(), ['cook_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_assets($queryargs = array()) {\n $query = \"/assets/\";\n return $this->get_list_data($query, $queryargs);\n }",
"public function getAssets()\n {\n return $this->hasMany(Asset::className(), ['asset_gl_acc_id' => 'account_id']);\n }",
"public function getAssetOrder();",
"public function getOrderAssets0()\n {\n return $this->hasMany(OrderAsset::className(), ['waiter_id' => 'id']);\n }",
"function Assets() {\r\n\t\t\treturn $this->QueryPublic( 'Assets' );\r\n\t\t}",
"public function getAssets3()\n {\n return $this->hasMany(Asset::className(), ['sales_gl_acc_id' => 'account_id']);\n }",
"public function getAssets1()\n {\n return $this->hasMany(Asset::className(), ['accdep_gl_acc_id' => 'account_id']);\n }",
"public function get_assets_all()\n {\n return $this->assets;\n }",
"public function getAssets();",
"public function getAssets();",
"public function getAssets(): array {\n\t\treturn $this->assets;\n\t}",
"public function getAssets0()\n {\n return $this->hasMany(Asset::className(), ['dep_gl_acc_id' => 'account_id']);\n }",
"public function getAllAssets() {\n $depts=array();\n $user = User::with('departments')->where('id', Auth::id())->first();\n foreach($user->departments as $dept) {\n $depts[] = $dept->department_id;\n\n }\n return Asset::with('loclonglat', 'catmarker')->where('deleted_at', '=', null)->whereIn('department_id', $depts)->orWhere('department_id', null)->select('id', 'cat_id', 'location_id')->get();\n }",
"public function getAssets()\n {\n return $this->assets;\n }",
"public function getAssets(array $options = null)\n\t{\n\t\treturn $this->getResourceChildCollection('assets', $options);\n\t}",
"public function getAssets2()\n {\n return $this->hasMany(Asset::className(), ['disposal_gl_acc_id' => 'account_id']);\n }",
"public function getAssets($assets)\n {\n $result = $this->newAPIRequest('GET', '/assets', ['assets' => implode(',', $assets)]);\n return $result;\n }",
"protected function getAssets() { return array(); }",
"function getAssets();",
"public function getAssets(): ?array\n {\n return $this->assets;\n }",
"public function assets()\r\n {\r\n return $this->httpRequest(\"v2/assets\");\r\n }",
"public function getAssets()\n {\n\n }",
"public function get_assets() \n {\n return $this->assets;\n }",
"protected function assets()\n\t{\n\t\tswitch($this->method)\n\t\t{\n\t\t\tcase 'GET':\n\t\t\t\t\n\t\t\t\t$ev = 'read';\n\t\t\t\t$evObj = array(\"assettype\"=>$this->verb,\"args\"=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\t\n\t\t\t\t$ev = 'update';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'PUT':\t\t\t\t\n\t\t\t\t$ev = 'create';\n\t\t\t\t$evObj = array('args'=>$this->verb);\n\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\t\n\t\t\t\t$ev = 'delete';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->fireEvent($this->endpoint,$ev,\"before\",$evObj);\n\t\t$obj = $this->$ev();\n\t\t$evObj['results']=$obj;\n\t\t$this->fireEvent($this->endpoint,$ev,\"after\",$evObj);\n\t\treturn $obj;\n\t}",
"public function getAssets()\n {\n return $this->getService('assets');\n }",
"public function GetConnectivityAssets(GetConnectivityAssets $parameters)\n {\n return $this->__soapCall('GetConnectivityAssets', array($parameters));\n }",
"public function getAssetTypes()\n {\n return $this->hasMany(AssetType::className(), ['asset_gl_acc_id' => 'account_id']);\n }",
"public function testAssetRelatedAssets()\n {\n $mockAdminApi = new MockAdminApi();\n $mockAdminApi->asset(self::$UNIQUE_TEST_ID, ['related' => true, 'related_next_cursor' => self::NEXT_CURSOR]);\n $lastRequest = $mockAdminApi->getMockHandler()->getLastRequest();\n\n self::assertRequestQueryStringSubset(\n $lastRequest,\n ['related' => '1', 'related_next_cursor' => self::NEXT_CURSOR]\n );\n }",
"public function productAssets()\n {\n $variations = ProductVariation::with('stocks')->get();\n $assets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->base_price;\n });\n\n $opAssets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->price;\n });\n\n return [\n 'assets' => $assets,\n 'op_asset' => $opAssets\n ];\n }",
"public function assets()\n {\n return $this->morphToMany('HugoKalidas\\LaravelFlexCms\\Assets\\Assets' , 'assetable');\n }",
"public function getAssetTypes3()\n {\n return $this->hasMany(AssetType::className(), ['sales_gl_acc_id' => 'account_id']);\n }",
"public function assets()\n {\n return $this->hasMany(Asset::class, 'supplier_id','id');\n }",
"public function getCartAssets()\n {\n return null;\n }",
"public function generateOrderAssets(Order $order): array\n {\n $generatedTickets = [];\n $basket = json_decode(json_encode($order->basket->products), true);\n foreach ($basket as $index => $product) {\n $generatedTickets[] = $this->ticketService->getGeneratedTickets(\n $index,\n $product,\n $order,\n $order->customer()->first()\n );\n }\n\n return $generatedTickets;\n }",
"public function assets()\n {\n return $this->morphMany(Asset::class, 'assetable');\n }",
"public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }",
"public function getAssets()\n {\n\n return collect($this->getWorkspaceApps()->toArray())->flatMap(function ($workspaceApps) {\n /** @var WorkspaceApp $workspaceApps */\n return collect($workspaceApps->getFiles()->toArray());\n })->reduce(function ($assets, $file) {\n // Merge the Assets related to each file into a single Collection of Assets for the Workspace\n /** @var File $file */\n /** @var Collection $assets */\n return $assets->merge($file->getAssets()->toArray());\n }, new Collection())\n // Filter out any suppressed or deleted Assets\n ->filter(function($asset) {\n /** @var $asset Asset */\n // Exclude deleted Assets\n return $asset->getDeleted() !== true && $asset->getSuppressed() !== true;\n });\n }",
"function assets()\n {\n return new Assets($this->accessToken, $this->spaceId, $this->cacher);\n }",
"protected function get_assets() {\n\t\treturn [\n\t\t\tnew StyleAsset(\n\t\t\t\tself::CSS_HANDLE,\n\t\t\t\tself::CSS_URI\n\t\t\t),\n\t\t];\n\t}",
"public function findAll($options = array(), $ordering = array()) {\n\t\t$matches\t= [];\n\t\t$query \t\t= $this->createQuery();\n\n\t\tif(isset($options['category']) === true) {\n\t\t\tif($options['category'] instanceof \\Qinx\\Qxgallery\\Domain\\Model\\Category) {\n\t\t\t\t$options['category'] = $options['category']->getUid();\n\t\t\t}\n\n\t\t\t$matches[] = $query->equals('category', $options['category']);\n\t\t}\n\n\t\tif(empty($matches) === false) {\n\t\t\t$query->matching($query->logicalAnd($matches));\n\t\t}\n\n\t\treturn $query->execute();\n\t}",
"function retrieveAll ( $text_autocomplete = NULL )\n {\n\n $q = Doctrine_Query :: create ()\n ->from ( 'AssetType' )\n ->orderBy ( 'asset_type_name ASC' );\n\n if ( ! is_null ( $text_autocomplete ) )\n {\n $q->andWhere ( 'asset_type_name LIKE ?' , $text_autocomplete . '%' );\n }\n\n return $q->execute ();\n }",
"public function getOrderItems()\n {\n return $this->hasMany(OrderItems::class, ['oi_order_id' => 'id']);\n }",
"public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['id' => 'asset_id']);\n }",
"public function get_assets( $query = array() ) {\n\t\t$query = wp_parse_args(\n\t\t\t$query,\n\t\t\tarray(\n\t\t\t\t'expand' => 'subjects,metadata,pages',\n\t\t\t\t'status' => '1', // Limit to published.\n\t\t\t)\n\t\t);\n\n\t\t$assets = $this->request( 'assets', $query );\n\n\t\treturn $assets;\n\t}",
"public function addAssets() {}",
"public function addAssets() {}",
"public function findAllMediaDownload($orderBy = 'ID')\n{\n \n $sql = \"SELECT ID, media_filename, media_caption, media_type, media_taget, \n media_user, media_access, media_status\n FROM tbl_media \n WHERE media_target = 'download' \n AND media_access = 'public' AND media_status = '1'\n ORDER BY :orderBy DESC\";\n \n $this->setSQL($sql);\n\n $items = $this->findAll([':orderBy' => $orderBy]);\n\n return (empty($items)) ?: $items;\n \n}",
"public function getDataAOrder(OrderRequest $request)\n {\n $order = new Order();\n return json_encode($order->viewOrder($request->input('id')));\n }",
"public function getAssetTypes()\n {\n return $this->asset_types;\n }",
"public function index()\n {\n $assets = Asset::with('location.building', 'category.parentcatrecursive', 'location.region')->where('deleted_at', '=', null)->paginate(config('globalSettings.entries-per-page'));\n return view('admin.assets.assets',\n [\n 'assets' => $assets\n ]\n );\n }",
"public function getOrderItems()\n {\n return $this->hasMany(OrderItem::className(), ['product_id' => 'id']);\n }",
"public function getOrderItems()\n {\n return $this->hasMany(OrderItem::className(), ['order_id' => 'id'])->inverseOf('order');\n }",
"public function get_order_items($order_id)\n\t{\n\t\t$this->db->select('product.product_name, product.product_thumb_name, order_item.*, vendor.vendor_store_name, vendor.vendor_id');\n\t\t$this->db->where('product.created_by = vendor.vendor_id AND product.product_id = order_item.product_id AND order_item.order_id = '.$order_id);\n\t\t$query = $this->db->get('order_item, product, vendor');\n\t\t\n\t\treturn $query;\n\t}",
"protected function getAssets(string $sType): array\n {\n if ($sType === static::ASSETS_EDITOR) {\n return $this->assets_editor;\n\n } elseif ($sType === static::ASSETS_RENDER) {\n return $this->assets_render;\n }\n\n return [];\n }",
"public function chooseAssetsAction($data) {\n try {\n $styleId = @$data['styleId'];\n $materialId = @$data['materialId'];\n $colorId = @$data['colorId'];\n $type = @$data['type'];\n if (!($styleId && $materialId && $colorId && $type)) { \n throw new \\Exception('Error. One of the parameters (styleId, materialId, colorId, type) is empty, it must be numeric values and type as string( shoes, belts)!');\n }\n \n $asset = $this->em\n ->getRepository('BallyEntityBundle:Asset')\n ->createQueryBuilder('a')\n ->leftJoin('a.product_type', 't')\n ->where('a.product_style = :style')\n ->andWhere('a.leather = :material')\n ->andWhere('a.color = :color')\n ->andWhere('t.app = :app')\n ->andWhere('t.name = :type')\n ->setParameters(array(\n 'style' => (int) $styleId,\n 'material' => (int) $materialId,\n 'color' => (int) $colorId,\n 'app' => $this->app->getId(),\n 'type' => $type\n ))\n ->setMaxResults(1)\n ->getQuery()\n ->getOneOrNullResult();\n if (!$asset) { \n throw new \\Exception('Asset with this parameters no exist!');\n }\n \n if ($this->statistics) {\n $statisticsShare = new StatisticsAssets();\n $statisticsShare\n ->setStatistics($this->statistics)\n ->setAction($this->type)\n ->setMySessionId($this->sessionId)\n ->setIp(@$_SERVER['REMOTE_ADDR'])\n ->setViews(1)\n ->setAsset($asset);\n $this->em->persist($statisticsShare);\n $this->em->flush();\n return new JsonResponse(array('success' => true, 'msg' => 'Choose assets actions successufly added'));\n } else {\n throw new \\Exception('Cant find statistics for this session id and app id!');\n }\n } catch (\\PDOException $e) {\n return new JsonResponse(array('success' => false, 'msg' => 'An error occured', 'error' => $e->getMessage()));\n }\n }",
"public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }",
"public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }",
"public function findByOrder ($orderId) {\n\n return $this->fetchAll(\n $this->select()\n ->where(\"`orderId` = ?\", $orderId)\n );\n\n }",
"public function findByOrder(Order $order): array\n {\n return $this->findBy(['order' => $order]);\n }",
"public function getByOrder($orderId) {\n\n return $this->fetchAll(\n $this->select()\n ->where(\"`orderId` = ?\", $orderId)\n );\n }",
"public function get_all_archives() {\n\t\t\t\n\t\t\t$archives = TableRegistry::get('Administrator.Archives');\n\n\t\t\t$imagesConditions = [ 'AND' => [\n\t\t\t\t\t\t\t\t\t [\n\t\t\t\t\t\t\t\t\t\t\t 'OR' => [\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/png'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/jpeg'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/jpg'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/gif'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'application/stream'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'application/pdf'],\n\t\t\t\t\t\t\t\t\t \t\t\t]\n\t\t\t\t\t\t\t\t\t \t],\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \t]\n\t\t\t\t\t\t\t\t];\n\n\n\t\t\t//$this->set('images', $archives->find('all', ['conditions' => $imagesConditions]) );\n\t\t\treturn $archives->find('all', ['conditions' => $imagesConditions, 'order' => ['id' => 'DESC'] ]);\n\n\t}",
"public function getOrders()\n {\n $result = array();\n\n if (!empty(\\XLite\\Core\\Request::getInstance()->order_ids)) {\n $orderIds = explode(',', \\XLite\\Core\\Request::getInstance()->order_ids);\n\n foreach ($orderIds as $orderId) {\n $orderId = trim($orderId);\n $order = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Order')->find(intval($orderId));\n if ($order) {\n $result[] = $order;\n }\n }\n\n } else {\n $result[] = $this->getOrder();\n }\n\n return $result;\n }",
"protected function getAssets()\n {\n if( ! $assets = $this->getHtml()->find('video, img, iframe, a'))\n {\n throw new Exception('No assets found in content!');\n }\n\n return $assets;\n }",
"function tw_asset_list() {\n\n\t$assets = tw_app_get('tw_registered_assets');\n\n\tif (!is_array($assets)) {\n\t\t$assets = [];\n\t}\n\n\treturn $assets;\n\n}",
"public function getAssetTypes0()\n {\n return $this->hasMany(AssetType::className(), ['dep_gl_acc_id' => 'account_id']);\n }",
"public function getAssetTypes1()\n {\n return $this->hasMany(AssetType::className(), ['accdep_gl_acc_id' => 'account_id']);\n }",
"public function setAssets($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Asset\\V1\\RelatedAsset::class);\n $this->assets = $arr;\n\n return $this;\n }",
"public function query() {\n\t\tif (get_current_login_user() == 'admin') {\n\t\t\treturn Order::get();\n\t\t} else if (get_current_login_user() == 'store') {\n\t\t\t$store_id = auth()->guard('store')->user()->id;\n\t\t\treturn Order::where('store_id', $store_id)->get();\n\t\t}\n\t}",
"function getAllOrders()\n {\n $dataService = new OrderDataService();\n\n return $dataService->getAllOrders();\n }",
"public function findOrder($orderId){\r\n \t$query = $this->getDbTable()->select()\r\n \t->from(array('d' => 'detailorder'),array('*'))\r\n \t->join(array('e' => 'equipment'),'d.equipmentId = e.equipmentId',array('e.equipmentId', 'e.name', 'e.image', 'e.price', 'e.priceSale'))\r\n \t->where('d.orderId = ?', $orderId)\r\n \t->setIntegrityCheck(false);\r\n \r\n \t$resultRows = $this->getDbTable()->fetchAll($query);\r\n \tif(count($resultRows) == 0){\r\n \t\treturn 0;\r\n \t}\r\n \telse{\r\n \t\treturn $resultRows;\r\n \t}\r\n }",
"public function GetAllOrders() {\n return $this->orderManager->GetAllOrders();\n }",
"public function AllOrders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOrders($per_page, $offset);\n return $this->response($result);\n }",
"protected function getVendorOrders() {\n\n\t\t$this->load->model('sale/vdi_order');\n\t\t$data = array();\n\n if (isset($this->request->request['filter_order_status'])) {\n //check input - should be list of integers\n if (1 === preg_match('/^[0-9,\\s]+$/',\n $this->request->request['filter_order_status'])) {\n $data['filter_order_status'] = $this->request->request['filter_order_status'];\n }\n }\n\n $result = array();\n $orderCount = $this->model_sale_vdi_order->getTotalOrders($data);\n $result['total_order_count'] = $orderCount;\n\n if (!isset($this->request->request['metaonly']) ||\n (\"true\" !== $this->request->request['metaonly'])) {\n $orders = $this->model_sale_vdi_order->getOrdersByOrderProductStatus($data);\n $result['orders'] = $orders;\n }\n\n\t\treturn $result;\n\t}",
"public function exportedAssets(): array\n {\n $exported = [];\n\n foreach ($this->tagsByType('ExportAssets') as $export) {\n $characterId = $export->tags->item;\n\n foreach ($export->names->item as $name) {\n $exported[(string) $name] = (int) $characterId;\n }\n }\n\n return $exported;\n }",
"public function get()\n {\n $this->_access(\"get\");\n $data = $this->Assets_model->getAdList(Assets_model::FULL_LIST);\n $this->_returnAjax(true, $data);\n }",
"public function actionGetOrders(): \\yii\\web\\Response\n {\n return $this->asJson(CommerceReports::$plugin->orders->getOrders());\n }",
"public function index(Request $request)\n\t{\n\t\t\n\t\t$archived = 0;\n\t\tif($request->archived == 1)\n\t\t\t$archived = 1;\n\n\t\t$category = DB::table('assets_category')->get();\n\t\t\t\n\t\t$search \t\t= request(\"search\",\"\");\n\t\t$paymentCycle \t= request(\"payment_cycle\",\"\");\n\t\t$assetType \t\t= request(\"asset_type\",\"\");\n\t\t$purchaseType \t= request(\"purchase_type\",\"\");\n\t\t\n\t\t$assets = new AssetsManager;\n\t\t\n\t\tif(!empty($search)) {\n\t\t\t$assets = $assets->where(function($q) use($search) {\n\t\t\t\t$q->where(\"name\",\"LIKE\",\"%\".$search.\"%\")->orWhere(\"provider_name\",\"LIKE\",\"%\".$search.\"%\");\n\t\t\t});\n\t\t}\n\n\t\tif(!empty($paymentCycle)) {\n\t\t\t$assets = $assets->where(\"payment_cycle\",$paymentCycle);\n\t\t}\n\n\t\tif(!empty($assetType)) {\n\t\t\t$assets = $assets->where(\"asset_type\",$assetType);\n\t\t}\n\n\t\tif(!empty($purchaseType)) {\n\t\t\t$assets = $assets->where(\"purchase_type\",$purchaseType);\n\t\t}\t\t\n\n\t\t$assets = $assets->paginate(10);\n\t\t\n\treturn view('assets-manager.index',compact('assets', 'category'))\n\t\t\t->with('i', ($request->input('page', 1) - 1) * 10);\n\t}",
"protected function loadAssets()\n {\n }",
"public function index()\n {\n return OrderIndexResource::collection(Order::all());\n }",
"public function assets(): Assets\n {\n return new Assets($this);\n }",
"public function getAssets()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('assets');\n }",
"public function index()\n {\n return Order::all();\n }",
"public function index()\n {\n return Order::all();\n }",
"function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}",
"public function getAssets($id, array $options = [])\n {\n $path = $this->buildPath(static::ASSETS_ENDPOINT, [$id]);\n $request = $this->performRequest('GET', $path, ['query' => $options, 'response' => 'asset']);\n #@header(\"Content-Type: image/jpeg\");\n return $request;\n }",
"public function orderQueryAction()\n {\n // https://api.weixin.qq.com/pay/orderquery?access_token=xxxxxx\n $orderId = $this->params()->fromRoute('id', '0');\n\n $order = $this->getOrderTable()->getOrder($orderId);\n if ($orderId == '0' || !$order) {\n return $this->errorViewModel(array('code' => 1, 'msg' => 'order '.$orderId.' not exist.'));\n }\n\n $postResult = $this->orderQuery($orderId);\n // echo $postResult;\n echo '<br>errcode:';\n echo $postResult->errcode;\n echo '<br>errmsg:';\n echo $postResult->errmsg;\n if ($postResult->errcode == 0) {\n echo '<br>orderinfo:';\n var_dump($postResult->order_info);\n }\n\n return $this->viewModel();\n }",
"public function show(Orders $order)\n {\n return new OrdersResources($order->load(['devices','devices.device','customs']));\n }",
"public static function assets(){\n return self::adapterURI().\"assets/\";\n }",
"public function populateAssets($assets)\n {\n $className = $this->assetModel;\n\n return $className::populateModels($assets);\n }",
"public function getRenderAssets(): array\n {\n return $this->getAssets(static::ASSETS_RENDER);\n }",
"public function query(Order $model)\n {\n return $model->newQuery()->select('id', 'product_id', 'user_id','amount', 'created_at', 'updated_at');\n }",
"function get_order() {\n $query = $this->db->get('orders');\n return $query->result_array();\n }",
"private function getQuery(string $orderId = null)\n {\n $filter = $orderId ? \"(filter:{number:{eq:\\\"$orderId\\\"}})\" : \"\";\n return <<<QUERY\n{\n customer {\n orders {$filter}{\n items {\n number\n status\n items {\n product_sku\n }\n carrier\n shipping_method\n shipments {\n id\n number\n tracking {\n title\n carrier\n number\n }\n items {\n id\n order_item {\n product_sku\n }\n product_name\n product_sku\n product_sale_price {\n value\n currency\n }\n ... on BundleShipmentItem {\n bundle_options {\n label\n values {\n product_name\n product_sku\n quantity\n price {\n value\n }\n }\n }\n }\n quantity_shipped\n }\n comments {\n timestamp\n message\n }\n }\n }\n }\n }\n}\nQUERY;\n }",
"public function loadByOrder($criteria = array (), $order = array ())\r\n {\r\n \r\n return $this->repository->findBy($criteria, $order);\r\n }",
"public function getAssets(): ?UserActivityAssets\n {\n return $this->assets;\n }",
"public function addAsset() {\n try {\n if (!($this->asset instanceof Base_Model_ObtorLib_App_Core_Asset_Entity_Asset)) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception(\" Asset Asset Entity not initialized\");\n } else {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $objAsset->asset = $this->asset;\n return $objAsset->addAsset();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($ex);\n }\n }",
"public function orders() {\n if ($this->orders != null)\n return $this->orders;\n $ids = Pdb::fetchAll('small_order', self::$table);\n return $this->orders = safe_array_map(function ($id) { return new Order($id); }, $ids); // no paging here\n }",
"protected function getAllOrders()\n {\n return Order::withTrashed()\n ->with(['address', 'user'])\n ->orderBy('id', 'DESC')\n ->get();\n }",
"public function query(Order $model)\n {\n if(auth()->user()->hasRole(['admin', 'manager', 'manager'])){\n return $model\n ->where('library_id', 1) // 1 is default admin library\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }else{\n return $model\n ->where('library_id', Auth::user()->library->id)\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }\n }",
"public function getOrders($searchTerm = \"\", $startDate = null, $endDate = null, $accountId = Account::LOGGED_IN_ACCOUNT) {\n $query = \"WHERE account_id = ?\";\n\n if ($searchTerm) {\n $query .= \" AND (buyer_name LIKE '%$searchTerm%' OR address LIKE '%$searchTerm%' OR status LIKE '%$searchTerm%' OR total LIKE '%$searchTerm%')\";\n }\n\n if ($startDate) {\n $query .= \" AND date >= '$startDate'\";\n }\n\n if ($endDate) {\n $query .= \" AND date <= '$endDate'\";\n }\n\n return Order::filter($query, $accountId);\n }"
] | [
"0.6302675",
"0.62636924",
"0.6203693",
"0.6149409",
"0.60908747",
"0.59697217",
"0.57756585",
"0.5761034",
"0.5740975",
"0.5740975",
"0.57059973",
"0.57034045",
"0.5699253",
"0.5611357",
"0.55952233",
"0.55188215",
"0.548984",
"0.5484093",
"0.54322815",
"0.54158306",
"0.5396691",
"0.53820103",
"0.535988",
"0.5284951",
"0.5218419",
"0.5214736",
"0.52113235",
"0.5203585",
"0.518387",
"0.5113655",
"0.5041529",
"0.5037064",
"0.5004362",
"0.50001806",
"0.4969659",
"0.49654657",
"0.4931545",
"0.49201447",
"0.48817563",
"0.487467",
"0.4857973",
"0.485744",
"0.48005086",
"0.47950011",
"0.4778501",
"0.4778501",
"0.47665834",
"0.47626072",
"0.47552657",
"0.47431216",
"0.47425598",
"0.473",
"0.47174588",
"0.47152936",
"0.47111064",
"0.47088748",
"0.47071475",
"0.47002083",
"0.46954396",
"0.46756506",
"0.4667032",
"0.4663745",
"0.46588004",
"0.46586478",
"0.46553352",
"0.46543735",
"0.4648438",
"0.46438205",
"0.46340957",
"0.4629626",
"0.46284652",
"0.4625299",
"0.46105963",
"0.45997",
"0.45983225",
"0.45911062",
"0.45883897",
"0.45869514",
"0.45722926",
"0.45697725",
"0.4566902",
"0.4565602",
"0.4565602",
"0.4562876",
"0.45593143",
"0.45577917",
"0.45427564",
"0.45406103",
"0.45406085",
"0.4538182",
"0.45371264",
"0.45329615",
"0.45301965",
"0.45298892",
"0.45255372",
"0.45253447",
"0.45249373",
"0.45198306",
"0.45173493",
"0.45150253"
] | 0.709236 | 0 |
Gets query for [[OrderAssets0]]. | public function getOrderAssets0()
{
return $this->hasMany(OrderAsset::className(), ['waiter_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAssets0()\n {\n return $this->hasMany(Asset::className(), ['dep_gl_acc_id' => 'account_id']);\n }",
"public function getOrderAssets()\n {\n return $this->hasMany(OrderAsset::className(), ['cook_id' => 'id']);\n }",
"public function getAssets1()\n {\n return $this->hasMany(Asset::className(), ['accdep_gl_acc_id' => 'account_id']);\n }",
"public function get_assets($queryargs = array()) {\n $query = \"/assets/\";\n return $this->get_list_data($query, $queryargs);\n }",
"public function getAssetTypes0()\n {\n return $this->hasMany(AssetType::className(), ['dep_gl_acc_id' => 'account_id']);\n }",
"public function getAssets3()\n {\n return $this->hasMany(Asset::className(), ['sales_gl_acc_id' => 'account_id']);\n }",
"function Assets() {\r\n\t\t\treturn $this->QueryPublic( 'Assets' );\r\n\t\t}",
"public function getAssetOrder();",
"public function getAssets()\n {\n return $this->hasMany(Asset::className(), ['asset_gl_acc_id' => 'account_id']);\n }",
"public function getAssets2()\n {\n return $this->hasMany(Asset::className(), ['disposal_gl_acc_id' => 'account_id']);\n }",
"public function findOrder($orderId){\r\n \t$query = $this->getDbTable()->select()\r\n \t->from(array('d' => 'detailorder'),array('*'))\r\n \t->join(array('e' => 'equipment'),'d.equipmentId = e.equipmentId',array('e.equipmentId', 'e.name', 'e.image', 'e.price', 'e.priceSale'))\r\n \t->where('d.orderId = ?', $orderId)\r\n \t->setIntegrityCheck(false);\r\n \r\n \t$resultRows = $this->getDbTable()->fetchAll($query);\r\n \tif(count($resultRows) == 0){\r\n \t\treturn 0;\r\n \t}\r\n \telse{\r\n \t\treturn $resultRows;\r\n \t}\r\n }",
"public function getAllAssets() {\n $depts=array();\n $user = User::with('departments')->where('id', Auth::id())->first();\n foreach($user->departments as $dept) {\n $depts[] = $dept->department_id;\n\n }\n return Asset::with('loclonglat', 'catmarker')->where('deleted_at', '=', null)->whereIn('department_id', $depts)->orWhere('department_id', null)->select('id', 'cat_id', 'location_id')->get();\n }",
"public function orderQueryAction()\n {\n // https://api.weixin.qq.com/pay/orderquery?access_token=xxxxxx\n $orderId = $this->params()->fromRoute('id', '0');\n\n $order = $this->getOrderTable()->getOrder($orderId);\n if ($orderId == '0' || !$order) {\n return $this->errorViewModel(array('code' => 1, 'msg' => 'order '.$orderId.' not exist.'));\n }\n\n $postResult = $this->orderQuery($orderId);\n // echo $postResult;\n echo '<br>errcode:';\n echo $postResult->errcode;\n echo '<br>errmsg:';\n echo $postResult->errmsg;\n if ($postResult->errcode == 0) {\n echo '<br>orderinfo:';\n var_dump($postResult->order_info);\n }\n\n return $this->viewModel();\n }",
"public function findAllMediaDownload($orderBy = 'ID')\n{\n \n $sql = \"SELECT ID, media_filename, media_caption, media_type, media_taget, \n media_user, media_access, media_status\n FROM tbl_media \n WHERE media_target = 'download' \n AND media_access = 'public' AND media_status = '1'\n ORDER BY :orderBy DESC\";\n \n $this->setSQL($sql);\n\n $items = $this->findAll([':orderBy' => $orderBy]);\n\n return (empty($items)) ?: $items;\n \n}",
"private function getQuery(string $orderId = null)\n {\n $filter = $orderId ? \"(filter:{number:{eq:\\\"$orderId\\\"}})\" : \"\";\n return <<<QUERY\n{\n customer {\n orders {$filter}{\n items {\n number\n status\n items {\n product_sku\n }\n carrier\n shipping_method\n shipments {\n id\n number\n tracking {\n title\n carrier\n number\n }\n items {\n id\n order_item {\n product_sku\n }\n product_name\n product_sku\n product_sale_price {\n value\n currency\n }\n ... on BundleShipmentItem {\n bundle_options {\n label\n values {\n product_name\n product_sku\n quantity\n price {\n value\n }\n }\n }\n }\n quantity_shipped\n }\n comments {\n timestamp\n message\n }\n }\n }\n }\n }\n}\nQUERY;\n }",
"public function get_assets_all()\n {\n return $this->assets;\n }",
"public function getAssets(): ?array\n {\n return $this->assets;\n }",
"public function getAssetTypes1()\n {\n return $this->hasMany(AssetType::className(), ['accdep_gl_acc_id' => 'account_id']);\n }",
"public function getAssets(array $options = null)\n\t{\n\t\treturn $this->getResourceChildCollection('assets', $options);\n\t}",
"function retrieveAll ( $text_autocomplete = NULL )\n {\n\n $q = Doctrine_Query :: create ()\n ->from ( 'AssetType' )\n ->orderBy ( 'asset_type_name ASC' );\n\n if ( ! is_null ( $text_autocomplete ) )\n {\n $q->andWhere ( 'asset_type_name LIKE ?' , $text_autocomplete . '%' );\n }\n\n return $q->execute ();\n }",
"public function getAssets($assets)\n {\n $result = $this->newAPIRequest('GET', '/assets', ['assets' => implode(',', $assets)]);\n return $result;\n }",
"public function assets()\r\n {\r\n return $this->httpRequest(\"v2/assets\");\r\n }",
"protected function assets()\n\t{\n\t\tswitch($this->method)\n\t\t{\n\t\t\tcase 'GET':\n\t\t\t\t\n\t\t\t\t$ev = 'read';\n\t\t\t\t$evObj = array(\"assettype\"=>$this->verb,\"args\"=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\t\n\t\t\t\t$ev = 'update';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'PUT':\t\t\t\t\n\t\t\t\t$ev = 'create';\n\t\t\t\t$evObj = array('args'=>$this->verb);\n\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\t\n\t\t\t\t$ev = 'delete';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->fireEvent($this->endpoint,$ev,\"before\",$evObj);\n\t\t$obj = $this->$ev();\n\t\t$evObj['results']=$obj;\n\t\t$this->fireEvent($this->endpoint,$ev,\"after\",$evObj);\n\t\treturn $obj;\n\t}",
"public function query() {\n\t\tif (get_current_login_user() == 'admin') {\n\t\t\treturn Order::get();\n\t\t} else if (get_current_login_user() == 'store') {\n\t\t\t$store_id = auth()->guard('store')->user()->id;\n\t\t\treturn Order::where('store_id', $store_id)->get();\n\t\t}\n\t}",
"public function getAssets(): array {\n\t\treturn $this->assets;\n\t}",
"public function execute() {\n $results = $this->query->execute();\n\n return empty($results[$this->asset]) ? '' : $results[$this->asset];\n }",
"public function getItems0()\n {\n return $this->hasMany(Item::className(), ['sales_disc_gl_acc_id' => 'account_id']);\n }",
"public function selectOMGOrderFromOrders($orderId)\r\n {\r\n $sql = \"SELECT orders.*, orderitems.product AS prItem,\r\n IFNULL(\r\n round(\r\n sum(\r\n (\r\n decrease_price * (1 -(decrease_discount / 100)) * decrease_quantity\r\n ) + (\r\n (\r\n decrease_price * (1 -(decrease_discount / 100)) * decrease_quantity\r\n ) * (vat_rate / 100)\r\n )\r\n ),\r\n 2\r\n ),\r\n 0\r\n ) AS documentAmount\r\n FROM orders\r\n LEFT JOIN orderitems ON orders.order_id = orderitems.order\r\n\t\t\t\tWHERE 1 AND (state = 'BA' OR state = 'SI')\r\n\t\t\t\tAND submitId = '$orderId'\r\n\t\t\t\tGROUP BY orders.order_id\r\n\t\t\t\tLIMIT 1\";\r\n\r\n $results=$this->conn->fetchAssoc($sql);\r\n return $results;\r\n }",
"public function get_assets() \n {\n return $this->assets;\n }",
"protected function getAssets() { return array(); }",
"public function getAssets()\n {\n return $this->assets;\n }",
"public function query()\n {\n $checkouts = Checkout::query()\n ->addSelect('checkouts.id')\n ->addSelect('checkouts.asset_id')\n ->addSelect('checkouts.user_id')\n ->addSelect('checkouts.dealer_id')\n ->addSelect('checkouts.project')\n ->addSelect('checkouts.expected_return_date')\n ->addSelect('checkouts.created_at')\n ->where('checkouts.returned_date', '=', null)\n ->with('user')->with('dealer')->with('dealer.dealership')->with('asset');\n\n return $this->applyScopes($checkouts);\n }",
"public function chooseAssetsAction($data) {\n try {\n $styleId = @$data['styleId'];\n $materialId = @$data['materialId'];\n $colorId = @$data['colorId'];\n $type = @$data['type'];\n if (!($styleId && $materialId && $colorId && $type)) { \n throw new \\Exception('Error. One of the parameters (styleId, materialId, colorId, type) is empty, it must be numeric values and type as string( shoes, belts)!');\n }\n \n $asset = $this->em\n ->getRepository('BallyEntityBundle:Asset')\n ->createQueryBuilder('a')\n ->leftJoin('a.product_type', 't')\n ->where('a.product_style = :style')\n ->andWhere('a.leather = :material')\n ->andWhere('a.color = :color')\n ->andWhere('t.app = :app')\n ->andWhere('t.name = :type')\n ->setParameters(array(\n 'style' => (int) $styleId,\n 'material' => (int) $materialId,\n 'color' => (int) $colorId,\n 'app' => $this->app->getId(),\n 'type' => $type\n ))\n ->setMaxResults(1)\n ->getQuery()\n ->getOneOrNullResult();\n if (!$asset) { \n throw new \\Exception('Asset with this parameters no exist!');\n }\n \n if ($this->statistics) {\n $statisticsShare = new StatisticsAssets();\n $statisticsShare\n ->setStatistics($this->statistics)\n ->setAction($this->type)\n ->setMySessionId($this->sessionId)\n ->setIp(@$_SERVER['REMOTE_ADDR'])\n ->setViews(1)\n ->setAsset($asset);\n $this->em->persist($statisticsShare);\n $this->em->flush();\n return new JsonResponse(array('success' => true, 'msg' => 'Choose assets actions successufly added'));\n } else {\n throw new \\Exception('Cant find statistics for this session id and app id!');\n }\n } catch (\\PDOException $e) {\n return new JsonResponse(array('success' => false, 'msg' => 'An error occured', 'error' => $e->getMessage()));\n }\n }",
"public function get_assets( $query = array() ) {\n\t\t$query = wp_parse_args(\n\t\t\t$query,\n\t\t\tarray(\n\t\t\t\t'expand' => 'subjects,metadata,pages',\n\t\t\t\t'status' => '1', // Limit to published.\n\t\t\t)\n\t\t);\n\n\t\t$assets = $this->request( 'assets', $query );\n\n\t\treturn $assets;\n\t}",
"public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }",
"public function getAssets();",
"public function getAssets();",
"public function index(Request $request)\n\t{\n\t\t\n\t\t$archived = 0;\n\t\tif($request->archived == 1)\n\t\t\t$archived = 1;\n\n\t\t$category = DB::table('assets_category')->get();\n\t\t\t\n\t\t$search \t\t= request(\"search\",\"\");\n\t\t$paymentCycle \t= request(\"payment_cycle\",\"\");\n\t\t$assetType \t\t= request(\"asset_type\",\"\");\n\t\t$purchaseType \t= request(\"purchase_type\",\"\");\n\t\t\n\t\t$assets = new AssetsManager;\n\t\t\n\t\tif(!empty($search)) {\n\t\t\t$assets = $assets->where(function($q) use($search) {\n\t\t\t\t$q->where(\"name\",\"LIKE\",\"%\".$search.\"%\")->orWhere(\"provider_name\",\"LIKE\",\"%\".$search.\"%\");\n\t\t\t});\n\t\t}\n\n\t\tif(!empty($paymentCycle)) {\n\t\t\t$assets = $assets->where(\"payment_cycle\",$paymentCycle);\n\t\t}\n\n\t\tif(!empty($assetType)) {\n\t\t\t$assets = $assets->where(\"asset_type\",$assetType);\n\t\t}\n\n\t\tif(!empty($purchaseType)) {\n\t\t\t$assets = $assets->where(\"purchase_type\",$purchaseType);\n\t\t}\t\t\n\n\t\t$assets = $assets->paginate(10);\n\t\t\n\treturn view('assets-manager.index',compact('assets', 'category'))\n\t\t\t->with('i', ($request->input('page', 1) - 1) * 10);\n\t}",
"public function getCartAssets()\n {\n return null;\n }",
"public function assets()\n {\n return $this->hasMany(Asset::class, 'supplier_id','id');\n }",
"function unity_query_inventory() {\r\n $lilo_mongo = new LiloMongo();\r\n $lilo_mongo->selectDB('Assets');\r\n $lilo_mongo->selectCollection('Inventory');\r\n $data = $lilo_mongo->find();\r\n $output = array();\r\n foreach ($data as $dt) {\r\n $output[] = array(\r\n 'name' => $dt['name'],\r\n 'file' => isset($dt['file']) ? $dt['file'] : \"\",\r\n );\r\n }\r\n return json_encode($output);\r\n}",
"public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['id' => 'asset_id']);\n }",
"public function index(Request $request) {\n $user = Auth::user();\n if (!$user->can('asset-read')) {\n return response()->json(['error' => 'Unauthorised'], $this->unauthorized);\n }\n\n $type = $request->query('type');\n\n $assets = Asset::where('type_id', $type)\n ->with('country')\n ->with('sector')\n ->with('trading_block')\n ->with('type')\n ->paginate(5);\n return response()->json(['success' => 'ok', 'paginator' => $assets], $this->sucessStatus);\n }",
"public static function get_asset_where($user = '') \n {\n $user = (empty($user)) ? self::get_session_user() : $user;\n \n $where = '';\n \n if (count($_SESSION['_user_vision']['asset']['host']) > 0) \n {\n $where = \"SELECT asset_id FROM alienvault.user_host_perm WHERE login = '\".$user.\"'\";\n }\n \n if (count($_SESSION['_user_vision']['asset']['net']) > 0) \n {\n if ($where != '') \n { \n $where .= ' UNION '; \n }\n \n $where .= \"SELECT asset_id FROM alienvault.user_net_perm WHERE login = '\".$user.\"'\";\n }\n }",
"public function getByOrder($orderId) {\n\n return $this->fetchAll(\n $this->select()\n ->where(\"`orderId` = ?\", $orderId)\n );\n }",
"public function getDataAOrder(OrderRequest $request)\n {\n $order = new Order();\n return json_encode($order->viewOrder($request->input('id')));\n }",
"public function getAssetTypes3()\n {\n return $this->hasMany(AssetType::className(), ['sales_gl_acc_id' => 'account_id']);\n }",
"public function getAssets()\n {\n\n }",
"protected function query() {\n $query = Database::getConnection('default', $this->sourceConnection)\n ->select('og_ancestry', 'oga');\n // only load JUST the type of nodes we need\n $query->join('node', 'n', 'oga.nid = n.nid AND n.type = :type', array(':type' => $this->sourceType));\n $query->condition('group_nid', 0, '>') // handle 0 values\n ->fields('oga', array('nid', 'group_nid'));\n return $query;\n }",
"public function findByOrder ($orderId) {\n\n return $this->fetchAll(\n $this->select()\n ->where(\"`orderId` = ?\", $orderId)\n );\n\n }",
"public function query(Order $model)\n {\n return $model->newQuery()->select('id', 'product_id', 'user_id','amount', 'created_at', 'updated_at');\n }",
"public function query(Order $model)\n {\n if(auth()->user()->hasRole(['admin', 'manager', 'manager'])){\n return $model\n ->where('library_id', 1) // 1 is default admin library\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }else{\n return $model\n ->where('library_id', Auth::user()->library->id)\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }\n }",
"public function get_order_items($order_id)\n\t{\n\t\t$this->db->select('product.product_name, product.product_thumb_name, order_item.*, vendor.vendor_store_name, vendor.vendor_id');\n\t\t$this->db->where('product.created_by = vendor.vendor_id AND product.product_id = order_item.product_id AND order_item.order_id = '.$order_id);\n\t\t$query = $this->db->get('order_item, product, vendor');\n\t\t\n\t\treturn $query;\n\t}",
"function getAssets();",
"public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }",
"public function GetConnectivityAssets(GetConnectivityAssets $parameters)\n {\n return $this->__soapCall('GetConnectivityAssets', array($parameters));\n }",
"public function index()\n {\n $assets = Asset::with('location.building', 'category.parentcatrecursive', 'location.region')->where('deleted_at', '=', null)->paginate(config('globalSettings.entries-per-page'));\n return view('admin.assets.assets',\n [\n 'assets' => $assets\n ]\n );\n }",
"public function itemQuery()\n {\n return $this->item($this->getInput('id'));\n }",
"public function getAssetTypes()\n {\n return $this->hasMany(AssetType::className(), ['asset_gl_acc_id' => 'account_id']);\n }",
"public function itemsQuery()\n {\n return $this->items(null);\n }",
"public function findAllMediaBlog($orderBy = 'ID')\n{\n \n $sql = \"SELECT ID, media_filename, media_caption, media_type, media_target\n FROM tbl_media WHERE media_target = 'blog' \n AND media_access = 'public' AND media_status = '1'\n ORDER BY :orderBy DESC\";\n\n $this->setSQL($sql);\n\n $items = $this->findAll([':orderBy' => $orderBy]);\n\n return (empty($items)) ?: $items;\n\n}",
"public function assets()\n {\n return $this->morphToMany('HugoKalidas\\LaravelFlexCms\\Assets\\Assets' , 'assetable');\n }",
"public function productAssets()\n {\n $variations = ProductVariation::with('stocks')->get();\n $assets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->base_price;\n });\n\n $opAssets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->price;\n });\n\n return [\n 'assets' => $assets,\n 'op_asset' => $opAssets\n ];\n }",
"protected function getOrderItem()\n\t{\n\t\t$search = $this->object->createSearch();\n\n\t\t$expr = [];\n\t\t$expr[] = $search->compare( '==', 'order.base.rebate', 14.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.sitecode', 'unittest' );\n\t\t$expr[] = $search->compare( '==', 'order.base.price', 53.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.editor', $this->editor );\n\t\t$search->setConditions( $search->combine( '&&', $expr ) );\n\t\t$results = $this->object->searchItems( $search );\n\n\t\tif( ( $item = reset( $results ) ) === false ) {\n\t\t\tthrow new \\RuntimeException( 'No order found' );\n\t\t}\n\n\t\treturn $item;\n\t}",
"public function getAssets()\n {\n return $this->getService('assets');\n }",
"public function AllOpen_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOpen_Orders();\n return $this->response($result);\n }",
"public function get_all_archives() {\n\t\t\t\n\t\t\t$archives = TableRegistry::get('Administrator.Archives');\n\n\t\t\t$imagesConditions = [ 'AND' => [\n\t\t\t\t\t\t\t\t\t [\n\t\t\t\t\t\t\t\t\t\t\t 'OR' => [\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/png'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/jpeg'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/jpg'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/gif'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'application/stream'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'application/pdf'],\n\t\t\t\t\t\t\t\t\t \t\t\t]\n\t\t\t\t\t\t\t\t\t \t],\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \t]\n\t\t\t\t\t\t\t\t];\n\n\n\t\t\t//$this->set('images', $archives->find('all', ['conditions' => $imagesConditions]) );\n\t\t\treturn $archives->find('all', ['conditions' => $imagesConditions, 'order' => ['id' => 'DESC'] ]);\n\n\t}",
"public function vendor_orders()\n {\n $query = $this->db->where('vendor_hash', $this->current_user->user_hash)\n ->where('progress >', '0')\n ->order_by('time desc')\n ->get('orders');\n\n if ($query->num_rows() > 0) {\n $row = $query->result_array();\n return $this->build_array($row);\n } else {\n return array();\n }\n }",
"public function getOrder($url, $orderUUID);",
"public function testAssetRelatedAssets()\n {\n $mockAdminApi = new MockAdminApi();\n $mockAdminApi->asset(self::$UNIQUE_TEST_ID, ['related' => true, 'related_next_cursor' => self::NEXT_CURSOR]);\n $lastRequest = $mockAdminApi->getMockHandler()->getLastRequest();\n\n self::assertRequestQueryStringSubset(\n $lastRequest,\n ['related' => '1', 'related_next_cursor' => self::NEXT_CURSOR]\n );\n }",
"public function index()\n {\n return OrderIndexResource::collection(Order::all());\n }",
"public function getOneOrder($orderId) {\n\n $this->load->model('account/order');\n return $this->model_account_order->getOrder($orderId);\n }",
"public function actionIndex()\n {\n $searchModel = new Searchasset();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getOrderItems()\n {\n return $this->hasMany(OrderItems::class, ['oi_order_id' => 'id']);\n }",
"public function selectOMGOrder($orderId)\r\n {\r\n $sql = \"SELECT country, post_data, ip, rf, product FROM order_submits\r\n\t\t\t\tWHERE (country = 'BA' || country = 'RS' || country = 'HR' || country = 'SI' || country = 'MK') AND id = '$orderId' and `upsellMade` != '1' LIMIT 1\";\r\n\r\n $results=$this->conn->fetchAssoc($sql);\r\n return $results;\r\n }",
"public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }",
"private function getOrder($orderoid){\n $rs = selectQuery('select * from WTSORDER where KOID=\"'.$orderoid.'\"');\n if ($rs->rowcount() == 1){\n $ors = $rs->fetch();\n foreach($ors as $k=>$v){\n\t$order->{$k} = $v;\n }\n } else {\n $order = null;\n XLogs::critical(get_class($this), 'Impossible de trouver la commande ayant pour KOID : '.$orderoid);\n }\n return $order;\n }",
"public function index(Orders $orders , Request $request)\n {\n $orders = $orders->with('customs');\n $request->user()->customer_id && $orders = $orders->where('cid',$request->user()->customer_id);\n if($request->money){\n $arr = explode('-',$request->money);\n if(count($arr) == 1){\n $orders = $orders->where('money','>',$arr[0]);\n }else if(count($arr) == 2){\n $orders = $orders->whereBetween('money',explode('-',$request->money));\n }\n }\n $request->status && $orders = $orders->where('order_status',$request->status);\n $request->name && $orders = $orders->whereHas('customs',function($query) use ($request){\n $query->where('company_name','like',\"%{$request->name}%\")->orWhere('company_addr','like','%'.$request->name.'%');\n });\n $request->time && $orders = $orders->whereDate('created_at',$request->time);\n return new OrdersResources($orders->orderBy('id','desc')->paginate($request->pageSize ?? $request->pageSize));\n }",
"public function getItems1()\n {\n return $this->hasMany(Item::className(), ['inventory_gl_acc_id' => 'account_id']);\n }",
"private function getDbTransactionsByOrderId($idOrder)\n {\n\n $query = 'SELECT * FROM ' . _DB_PREFIX_ . PayViaEpul::MODULE_NAME . '_transactions WHERE id_order = ' . pSQL($idOrder);\n $result = Db::getInstance()->executeS($query);\n\n if (!isset($result) || count($result) === 0 || !isset($result[0])) {\n return null;\n }\n\n return $result[0];\n }",
"protected function getOrder($orderId) {\n $order = Order::with('items.catalog.product')->where('id', '=', $orderId)->where('status', '=', Order::PENDING)->first();\n return $order;\n }",
"public function show(Orders $order)\n {\n return new OrdersResources($order->load(['devices','devices.device','customs']));\n }",
"public function index()\n {\n return Order::all();\n }",
"public function index()\n {\n return Order::all();\n }",
"public function getQuery(array $data): QueryInterface\n {\n return Qry::create(['id' => $data['licence'], 'bundle' => []]);\n }",
"public function getAssets()\n {\n\n return collect($this->getWorkspaceApps()->toArray())->flatMap(function ($workspaceApps) {\n /** @var WorkspaceApp $workspaceApps */\n return collect($workspaceApps->getFiles()->toArray());\n })->reduce(function ($assets, $file) {\n // Merge the Assets related to each file into a single Collection of Assets for the Workspace\n /** @var File $file */\n /** @var Collection $assets */\n return $assets->merge($file->getAssets()->toArray());\n }, new Collection())\n // Filter out any suppressed or deleted Assets\n ->filter(function($asset) {\n /** @var $asset Asset */\n // Exclude deleted Assets\n return $asset->getDeleted() !== true && $asset->getSuppressed() !== true;\n });\n }",
"private function getCustomerOrderQueryBundleProduct()\n {\n $query =\n <<<QUERY\n {\n customer {\n orders(pageSize: 20) {\n items {\n id\n order_date\n items {\n product_name\n product_sku\n ... on BundleOrderItem {\n bundle_options {\n __typename\n label\n values {\n product_name\n product_sku\n price {\n value\n currency\n }\n }\n }\n }\n }\n total {\n grand_total {\n value\n currency\n }\n }\n status\n }\n }\n }\n }\n QUERY;\n $response = $this->graphQlQuery(\n $query,\n [],\n '',\n $this->customerAuthenticationHeader->execute('[email protected]', 'password')\n );\n\n $this->assertArrayHasKey('orders', $response['customer']);\n $this->assertArrayHasKey('items', $response['customer']['orders']);\n return $response['customer']['orders']['items'];\n }",
"public function getOrderInfoById($orderId)\n {\n $ordersQuery = DB::table('orders')\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_destination'),\n 'location_destination.id',\n '=',\n 'orders.location_destination_id'\n )\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_arrival'),\n 'location_arrival.id',\n '=',\n 'orders.location_arrival_id'\n )\n ->leftJoin('vehicle', 'orders.vehicle_id', '=', 'vehicle.id')\n ->where([\n ['orders.id', '=', $orderId],\n ['orders.del_flag', '=', '0'],\n ['vehicle.del_flag', '=', '0']\n ]);\n $order = $ordersQuery->get([\n 'orders.id as order_id', 'order_code', 'orders.status as status',\n 'orders.ETD_date', 'orders.ETD_time', 'location_destination.full_address as location_destination', 'location_destination.longitude as location_destination_longitude', 'location_destination.latitude as location_destination_latitude',\n 'orders.ETA_date', 'orders.ETA_time', 'location_arrival.full_address as location_arrival', 'location_arrival.longitude as location_arrival_longitude', 'location_arrival.latitude as location_arrival_latitude',\n 'vehicle.latitude as current_latitude', 'vehicle.longitude as current_longitude', 'vehicle.current_location as current_location'\n ])->first();\n return $order;\n }",
"public function search(Request $request)\r\n {\r\n\r\n /** @var Builder $query */\r\n $query = $this->materials_rate->query();\r\n \r\n $requestSearchQuery = new RequestSearchQuery($request, $query, [\r\n 'name',\r\n 'rate',\r\n ]);\r\n\r\n if ($request->get('exportData')) {\r\n return $requestSearchQuery->export([\r\n 'name',\r\n 'rate',\r\n 'materials_rates.created_at',\r\n 'materials_rates.updated_at',\r\n ],\r\n [\r\n __('validation.materials_rates.name'),\r\n __('validation.materials_rates.rate'),\r\n __('labels.created_at'),\r\n __('labels.updated_at'),\r\n ],\r\n 'materials_rates');\r\n }\r\n\r\n return $requestSearchQuery->result([\r\n 'materials_rates.id',\r\n 'name',\r\n 'rate',\r\n 'materials_rates.created_at',\r\n 'materials_rates.updated_at',\r\n ]);\r\n }",
"public function getOrder()\n {\n echo json_encode($this->Inventory_model->getProductById($_POST['idJson']));\n }",
"protected function getLicenseQuery()\n {\n return $this->licenseQuery;\n }",
"public function query()\n {\n $query = Unit::select(['id','code','name']);\n\n return $this->applyScopes($query);\n }",
"protected function get_assets() {\n\t\treturn [\n\t\t\tnew StyleAsset(\n\t\t\t\tself::CSS_HANDLE,\n\t\t\t\tself::CSS_URI\n\t\t\t),\n\t\t];\n\t}",
"function getAssetById($assetid)\n {\n global $conn;\n $query=\"SELECT * FROM tbl_asset where id=\".$assetid;\n $response=array();\n $result=mysqli_query($conn, $query);\n $rows=mysqli_num_rows($result);\n if($rows > 0){\n while($row = mysqli_fetch_assoc($result))\n {\n $response[]=$row;\n }\n }\n else{\n array_push($response,\"No Data Found\");\n }\n\n header('Content-Type: application/json');\n echo json_encode($response);\n }",
"public static function getOrderPurchase($id)\n {\n $orders = DB::query(\"SELECT orderproducts.*, products.strName, products.strDescription, products.strFeatures, products.price, products.category_id, products.status_id, orders.totalAmount, orders.date, inventoryproducts.name AS inventoryproductsname\n FROM orderproducts\n LEFT JOIN orders ON orderproducts.orderId=orders.id\n LEFT JOIN products ON orderproducts.productId=products.id\n LEFT JOIN inventoryproducts ON products.inventoryproductsId=inventoryproducts.id\n WHERE orderproducts.orderId=\".$id);\n //if no id given\n if($orders == \"\"){\n $ordersArray =(object) array(\n \"id\" => \"0\",\n \"userId\" => \"0\",\n \"orderId\" => \"0\",\n 'productId' => '0',\n 'quantity' => \"0\",\n 'total' => \"0\",\n 'strName' => 'No patch',\n 'strDescription' => '',\n 'strFeatures' => '',\n 'price' => '',\n 'countryId' => '',\n 'category_id' => '',\n 'status_id' => '',\n 'totalAmount' => '',\n 'date' => '',\n 'inventoryproductsname'=>'',\n );\n return $ordersArray;\n }\n\n // acting as a factory\n // empty array to avoid errors when nothing was found\n $ordersArray = array();\n foreach($orders as $order)\n {\n // create an instance / object for this SPECIFIC \n $ordersArray[] = new OrdersAdmin($order); // put this object onto the array\n }\n // return the list of objects\n return $ordersArray;\n }",
"public function getQuotationItemData($order_id = null)\n\t{\n\t\t$selected_financial_year = $this->session->userdata(\"selected_financial_year\");\n\n\t\tif (!$order_id) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$sql = \"SELECT * FROM quotation_item JOIN item_master WHERE quotation_item.quotation_no = ? AND item_master.Item_ID=quotation_item.item_id AND financial_year_id=$selected_financial_year AND quotation_item.status=1\";\n\t\t$query = $this->db->query($sql, array($order_id));\n\t\treturn $query->result_array();\n\t}",
"function assets()\n {\n return new Assets($this->accessToken, $this->spaceId, $this->cacher);\n }",
"public function postIndex()\n\t{\n if(!$this->checkAuthentication())\n {\n return json_encode(array());\n }\n \n $data = Input::get();\n $national_asset = new NationalAsset;\n \n if(isset($data['sort_order']) && isset($data['order_field']) && $data['sort_order'] != '' && $data['order_field'] != ''){\n\t\t\t$national_asset = $national_asset->orderBy($data['order_field'],$data['sort_order']);\n\t\t} else {\n\t\t $national_asset = $national_asset->orderBy('updated_at','DESC');\n\t\t}\n \n if(isset($data['search_fields']['i_column']) && $data['search_fields']['i_column']!=\"\"){\n\t\t\t$national_asset = $national_asset->where('i_column', $data['search_fields']['i_column']);\n\t\t}\n \n\t if(isset($data['search_fields']['i_display_order']) && $data['search_fields']['i_display_order']!=\"\"){\n\t\t\t$national_asset = $national_asset->where('i_display_order',$data['search_fields']['i_display_order']);\n\t\t}\n \n $national_asset = $national_asset->paginate($data['rec_per_page']);\n $arrNationalAsset = $national_asset->toArray();\n $results = [\n \t 'items' => $arrNationalAsset['data'],\n '_meta' => [\n \t 'total' => $national_asset->getTotal(),\n \t 'rpp' => $national_asset->getPerPage(),\n \t 'current' => $national_asset->getCurrentPage(),\n \t 'last_page' => $national_asset->getLastPage(),\n \t 'from' => $national_asset->getFrom(),\n \t 'to' => $national_asset->getTo()\n \t ]\n \t];\n return json_encode($results);\n\t}",
"public function getAsset()\n {\n if ($this->asset === null) {\n $this->asset = AssetFacade::find($this->getAssetId());\n }\n\n return $this->asset;\n }",
"public function AllOrders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOrders($per_page, $offset);\n return $this->response($result);\n }"
] | [
"0.6548097",
"0.5910376",
"0.57933617",
"0.56649065",
"0.56123066",
"0.54299194",
"0.53276455",
"0.5269801",
"0.52359325",
"0.5197732",
"0.49858963",
"0.49842745",
"0.4944428",
"0.493879",
"0.49280986",
"0.4911635",
"0.4854161",
"0.48090672",
"0.47973374",
"0.47651446",
"0.47564572",
"0.47489434",
"0.47221032",
"0.4678244",
"0.4669342",
"0.46681923",
"0.46669033",
"0.4664035",
"0.46635437",
"0.46612868",
"0.46523127",
"0.4639913",
"0.46391755",
"0.46339488",
"0.46328193",
"0.46218827",
"0.46218827",
"0.45854735",
"0.45360747",
"0.45275256",
"0.45212173",
"0.4512063",
"0.4495884",
"0.44938654",
"0.4482184",
"0.4478861",
"0.4474454",
"0.44684517",
"0.4459779",
"0.44423753",
"0.44389346",
"0.44316906",
"0.4414166",
"0.44038752",
"0.4403242",
"0.4384466",
"0.43616685",
"0.43507457",
"0.4331967",
"0.43252444",
"0.4319196",
"0.43127435",
"0.4308812",
"0.4306272",
"0.4284164",
"0.4283413",
"0.428118",
"0.4281051",
"0.42782366",
"0.42733473",
"0.4273222",
"0.42703956",
"0.4265397",
"0.42444766",
"0.4243889",
"0.42406002",
"0.4233014",
"0.42285508",
"0.4224676",
"0.4222984",
"0.4217263",
"0.42160633",
"0.4211549",
"0.4211549",
"0.42108458",
"0.42108095",
"0.4207859",
"0.4199432",
"0.41916344",
"0.41884336",
"0.4181111",
"0.4180767",
"0.41779432",
"0.41775706",
"0.41745952",
"0.41731924",
"0.4162019",
"0.41456524",
"0.4145007",
"0.41441947"
] | 0.6768411 | 0 |
Set the Enable on Frontend flag in System Configuration for the given store. | public function setExtensionEnabledFlag($flag, $store = null) {
$flag = ($flag) ? 1 : 0;
$this->setStoreConfig(static::XML_PATH_EXTENSION_ENABLED, $flag, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function enabled($store = null);",
"public function setFrontendOptions( array $frontend ) {\n $this->_frontendOptions = $frontend;\n $this->_frontendOptions[ 'cached_entity' ] = $this->_model;\n }",
"public function enablewebsiteconfigurationAction()\n {\n $path = $this->getRequest()->getParam('path');\n $value = $this->getRequest()->getParam('value');\n $website = $this->getRequest()->getParam('website', 0);\n\n $path = constant('Dotdigitalgroup_Email_Helper_Config::' . $path);\n $scope = 'websites';\n $scopeId = $website;\n\n $config = Mage::getConfig();\n\n //use value 1 if not set\n if (isset($value))\n $config->saveConfig($path, $value, $scope, $scopeId);\n else\n $config->saveConfig($path, 1, $scope, $scopeId);\n\n //clean cache\n $config->cleanCache();\n\n $this->_redirectReferer();\n }",
"public function setStore($value) { $this->_store = self::forceBool($value); }",
"public function setStoreId($store);",
"private function setStore(Store $store) {\n $this->store = $store;\n }",
"public function uploadConfig($store)\n {\n parent::uploadConfig($store);\n\n $this->extend('updateConfig', $store);\n }",
"public function enable()\n {\n add_settings_field(\n 'enable',\n apply_filters($this->plugin_name . 'label-enable', esc_html__('Enable', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-general',\n [\n 'description' => 'Serve ' . get_site_url() . '/.well-known/security.txt on your WordPress site.',\n 'id' => 'enable',\n 'value' => isset($this->options['enable']) ? $this->options['enable'] : false,\n ]\n );\n }",
"public function enable()\n {\n try {\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_CC_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_cc'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_CCSAVED_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_ccsaved'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_DD_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_dd'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_DDSAVED_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_ddsaved'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_GIROPAY_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_giropay'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_KLARNAPAYLATER_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_klarnapaylater'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_KLARNASLICEIT_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_klarnasliceit'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_PAYPAL_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_paypal'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_PAYPALSAVED_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_paypalsaved'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_PAYDIREKT_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_paydirekt'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_KLARNAOBT_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_klarnaobt'\";\n Shopware()->Db()->query($sql);\n }\n\n $sql = \"SELECT value FROM s_core_config_values WHERE element_id = '\" .\n $this->getElementId('BACKEND_CH_EASYCREDIT_ACTIVE').\"'\";\n Shopware()->Db()->query($sql);\n $query = Shopware()->Db()->query($sql);\n $data = $query->fetchAll();\n if (!isset($data[0]['value'])) {\n $sql = \"UPDATE s_core_paymentmeans SET active = '1' WHERE name = 'vrpay_easycredit'\";\n Shopware()->Db()->query($sql);\n }\n return $result['success'] = true;\n } catch (Exception $e) {\n return $result['success'] = false;\n }\n }",
"function enableConfigurableSwatches()\n\t {\n\t \t $eavAttrTable\t\t= Mage::getSingleton('core/resource')->getTableName('eav_attribute');\n\t \t $catalogAttrTable\t= Mage::getSingleton('core/resource')->getTableName('catalog_eav_attribute');\n\t \t $read\t\t\t\t= Mage::getSingleton('core/resource')->getConnection('core_read');\n\t\t\n\t\t$sql\t\t\t\t= \"SELECT `e`.`attribute_id` FROM `\" . $eavAttrTable . \"` as `e` \n\t\t\t\t\t\t\t\tJOIN `\" . $catalogAttrTable . \"` as `c` ON `e`.`attribute_id` = `c`.`attribute_id`\n\t\t\t\t\t\t\t\tWHERE `e`.`entity_type_id` = '4' \n\t\t\t\t\t\t\t\tAND `e`.`frontend_input` = 'select' \n\t\t\t\t\t\t\t\tAND `e`.`is_user_defined` = '1' \n\t\t\t\t\t\t\t\tAND `c`.`is_configurable` = 1 \";\n\t\t$result\t\t\t\t= $read->fetchAll($sql);\n\t\tif ($result) {\n\t\t\t$arr = array();\n\t\t\tforeach ($result as $id) {\n\t\t\t\tarray_push($arr, $id['attribute_id']);\n\t\t\t}\n\t\t\t$ids = implode(',', $arr);\n\t\t\tif ($ids) {\n\t\t\t\t$configModel = new Mage_Core_Model_Config();\n\t\t\t\t$configModel->saveConfig('configswatches/general/enabled', \"1\", 'default', 0);\n\t\t\t\t$configModel->saveConfig('configswatches/general/swatch_attributes', $ids, 'default', 0);\n\t\t\t}\n\t\t}\n\t\treturn $ids;\n\t\t}",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"public function getEnableUrl(){\n $storeCode = Mage::app()->getRequest()->getParam('store');\n\n $url = Mage::app()->getStore($storeCode)->getUrl('creativestyle-dev/index/enable', array('hash'=>base64_encode(Mage::getModel('core/encryption')->encrypt(Mage::getStoreConfig('dev/csoptions/key', $storeCode)))));\n return $url;\n }",
"public function disabled($store = null);",
"public function setIsBackend($isBackend);",
"function Enable() {\n\n\t\t\t//add_action('load-categories.php', array(\"TreBiMeteo\",'SetAdminConfiguration'));\n\t\t\t//add_action('load-edit-tags.php', array(\"TreBiMeteo\",'SetAdminConfiguration'));\n\t\t\t// Aggiungiamo la pagina delle opzioni\n\t\t\tadd_action('admin_menu', array(\"TreBiMeteo\",'SetAdminConfiguration'));\n\t\t\t//add_action('widgets_init', array(\"TreBiMeteo\",'SetWidget'));\t\t\t\n\n\t\t}",
"public function setFrontend( $frontend ) {\n if( 'Class' != $frontend ) {\n throw new JKY_Model_Exception( 'Frontend type must be Class' );\n }\n $this->_frontend = $frontend;\n }",
"public function setConfig(array $config, $store = false)\n {\n $this->configuration = $config;\n\n if ($store) {\n $values = array('configuration' => serialize($config));\n $connection = \\Zend_Registry::get('doctrine')->getConnection();\n $connection->update('daemon', $values, array('name' => $this->getName()));\n }\n }",
"function enableclient()\n {\n exec('ifconfig ' . escapeshellarg($this->interface) . ' up');\n exec($this->arfilelocation['iwpriv'] . ' ' . escapeshellarg($this->interface) . ' set SiteSurvey=1');\n }",
"public function setEbayStoreFlag()\n\t{\n\t\t$this->_ebay_store_flag = 1;\n\t\treturn $this;\n\t}",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function setMagentoStores(array $magentoStores);",
"public function getTestModeEnabledFlag($store = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);\n }",
"public function isEnabled($storeId=0){\n \tif($storeId==0)\n \t\t$storeId=Mage::app()->getStore()->getId();\n \treturn Mage::getStoreConfig('ced_csmultishipping/general/activation', $storeId);\n }",
"function setSystemConfig() {\n global $_ARRLANG, $_CONFIG, $arrLanguages, $language;\n\n $userLangId = \"\";\n foreach ($arrLanguages as $langId => $arrLanguage) {\n if ($language == $arrLanguage['lang']) {\n $userLangId = $langId;\n break;\n }\n }\n\n $statusMsg = \"\";\n\n $objDb = $this->_getDbObject($statusMsg);\n if ($objDb === false) {\n return $statusMsg;\n } else {\n // deactivate all languages\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"languages`\n SET `frontend` = '0', `backend` = '0', `is_default` = 'false'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_DEACTIVATE_UNUSED_LANGUAGES'].\"<br />\";\n }\n \n // activate german and set it to default\n $query = '\n UPDATE `'.$_SESSION['installer']['config']['dbTablePrefix'].'languages`\n SET `frontend` = 1, backend = 1, `is_default` = \"true\"\n WHERE `lang` = \"de\"\n ';\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_ACTIVATE_DEFAULT_LANGUAGE'].\"<br />\";\n }\n\n // activate english\n $query = 'UPDATE `'.$_SESSION['installer']['config']['dbTablePrefix'].'languages`\n SET `frontend` = \"1\", `backend` = \"1\" WHERE `lang` = \"en\"';\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_ACTIVATE_CURRENT_LANGUAGE'].\"<br />\";\n }\n\n // set admin email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `setname` = 'coreAdminEmail'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_EMAIL'].\"<br />\";\n }\n\n // set admin name\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminName'].\"'\n WHERE `setname` = 'coreAdminName'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_NAME'].\"<br />\";\n }\n\n if (($arrTables = $objDb->MetaTables('TABLES')) === false) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_GATHER_ALL_DATABASE_TABLES'].\"<br />\";\n return $statusMsg;\n }\n\n // set access emails\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"access_settings`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `key` = 'notification_address'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_EMAIL'].\"<br />\";\n }\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"access_user_mail`\n SET `sender_mail` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_EMAIL'].\"<br />\";\n }\n\n // set newsletter emails\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].\"module_newsletter_settings\", $arrTables)) {\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_newsletter_settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `setname` = 'sender_mail' OR `setname` = 'reply_mail' OR `setname` = 'test_mail'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_NEWSLETTER_EMAILS'].\"<br />\";\n }\n\n // set newsletter name\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_newsletter_settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminName'].\"'\n WHERE `setname` = 'sender_name'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_NEWSLETTER_SENDER'].\"<br />\";\n }\n }\n\n // set contact email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['contactEmail'].\"'\n WHERE `setname` = 'contactFormEmail'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_contact_form`\n SET `mails` = '\".$_SESSION['installer']['sysConfig']['contactEmail'].\"'\n WHERE `id` = 1\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n\n // set domain url\n if (preg_match('#^https?://#', $_SESSION['installer']['sysConfig']['domainURL'])) {\n $statusMsg .= $_ARRLANG['TXT_SET_VALID_DOMAIN_URL'];\n } else {\n if (substr($_SESSION['installer']['sysConfig']['domainURL'], -1) == '/') {\n $_SESSION['installer']['sysConfig']['domainURL'] = substr($_SESSION['installer']['sysConfig']['domainURL'], 0, -1);\n }\n\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['domainURL'].\"'\n WHERE `setname` = 'domainUrl'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_DOMAIN_URL'].\"<br />\";\n }\n }\n\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_config\", $arrTables)) {\n // set shop email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_config`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `name` = 'email' OR `name` = 'confirmation_emails' OR `name` = 'paypal_account_email'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n }\n\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_mail_content\", $arrTables)) {\n // set shop email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_mail_content`\n SET `from_mail` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n }\n\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].'module_egov_products', $arrTables)) {\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_egov_products`\n SET `product_target_email` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n }\n\n $_SESSION['installer']['sysConfig']['iid'] = $this->updateCheck();\n\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['iid'].\"'\n WHERE `setname` = 'installationId'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_INSTALLATIONID'].\"<br />\";\n }\n\n $arrTimezones = timezone_identifiers_list();\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$arrTimezones[$_SESSION['installer']['config']['timezone']].\"'\n WHERE `setname` = 'timezone'\";\n if (!@$objDb->Execute($query) || (!isset($_SESSION['installer']['config']['timezone']) && !isset($arrTimezones[$_SESSION['installer']['config']['timezone']]))) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_TIMEZONE'].\"<br />\";\n }\n\n /*\n // set rss title\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_news_settings`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['rssTitle'].\"'\n WHERE `name` = 'news_feed_title'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_RSS_TITLE'].\"<br />\";\n }\n\n // set rss description\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_news_settings`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['rssDescription'].\"'\n WHERE `name` = 'news_feed_description'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_RSS_DESCRIPTION'].\"<br />\";\n }\n */\n }\n\n if (isset($_SESSION['installer']['config']['cachingByDefault']) && $_SESSION['installer']['config']['cachingByDefault']) {\n // configure caching\n $this->configureCaching();\n }\n\n if (empty($statusMsg)) {\n return $this->_createSettingsFile();\n } else {\n return $statusMsg;\n }\n }",
"public static function enable(){\n self::$enabled = true; \n self::$disabled=false;\n }",
"public function frontend_configuration()\n {\n if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') != 'Admin') {\n redirect('home/login_page', 'location');\n }\n \n $data['body'] = \"admin/config/frontend_config\";\n $data['time_zone'] = $this->_time_zone_list(); \n $data['language_info'] = $this->_language_list();\n $data['page_title'] = $this->lang->line('front-end settings');\n $this->_viewcontroller($data);\n }",
"public function setFrontendLabel($frontendLabel);",
"public function setEnableAlwaysOnConfiguration($val)\n {\n $this->_propDict[\"enableAlwaysOnConfiguration\"] = boolval($val);\n return $this;\n }",
"public function enable($enable) {\n\t\tself::$isEnable = $bool;\n\t}",
"public function enable() {\n\t\t$this->update(FALSE);\n\t}",
"public function setStoreLabel($storeLabel);",
"public function klarnaPaymentEnabled($store = null)\n {\n return Mage::getStoreConfigFlag('payment/klarna_kco/active', $store);\n }",
"public function isFrontendEnabled()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_QUOTATION_VISIBILITY,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isEnvironmentInFrontendMode() {}",
"static public function addFrontendOption($configuration,$cc_id) {\n\t\tforeach($configuration['frontend'] as $field=>$value) {\n\t\t\t$mComponentcachefrontendoption=new Maerdo_Model_Componentcachefrontendoption();\n\t\t\t$mComponentcachefrontendoption->insert(array('cc_id'=>$cc_id,'option'=>$field,'value'=>$value));\n\t\t}\t\n\t\treturn true;\n\t}",
"public static function enable() {\n\t\tself::$enabled = true;\n\t}",
"function setFrontStore($params) {\n\n\n $requestParam = explode('/', $this->params->url);\n $store_name = trim($requestParam[0]); // Name of the store which we will change later with Saas\n $sid = $this->Session->read('store_id');\n $urlParts = parse_url($store_name);\n if (!empty($urlParts['host'])) {\n $store_name = preg_replace('/^www\\./', '', $urlParts['host']);\n }\n $Storeuserid = $this->Session->read('Auth.User.id');\n if ($store_name) {\n $this->loadModel('Store');\n $store_result = $this->Store->store_info($store_name);\n if ($store_result) {\n $storeName = $store_result['Store']['store_name'];\n $store_url = $store_result['Store']['store_url'];\n $store_phone = $store_result['Store']['phone'];\n if (isset($store_result['Store']['service_fee'])) {\n $this->Session->write('service_fee', $store_result['Store']['service_fee']);\n }\n// if (isset($store_result['Store']['delivery_fee'])) {\n// $this->Session->write('delivery_fee', $store_result['Store']['delivery_fee']);\n// }\n $this->Session->write('minprice', $store_result['Store']['minimum_order_price']);\n $this->Session->write('storeName', $storeName);\n $this->Session->write('store_url', $store_url);\n $this->Session->write('store_phone', $store_phone);\n $this->Session->write('store_id', $store_result['Store']['id']);\n $this->Session->write('merchant_id', $store_result['Store']['merchant_id']);\n $this->Cookie->write('storecookiename', $store_url);\n $this->Session->write('front_time_zone_id', $store_result['Store']['time_zone_id']);\n } else {\n $this->redirect(array('controller' => 'users', 'action' => 'selectStore'));\n }\n }\n }",
"private function saveConfig(){\n\t\tif(!isset($_POST['services_ipsec_settings_enabled'])){\n\t\t\t$this->data['enable'] = 'false';\n\t\t}\n\t\telseif($_POST['services_ipsec_settings_enabled'] == 'true'){\n\t\t\t$this->data['enable'] = 'true';\n\t\t}\n\t\t\n\t\t$this->config->saveConfig();\n\t\t$this->returnConfig();\n\t}",
"public function isStockEnabledFrontend()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_STOCK_CHECK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function enable();",
"public function enable();",
"public function enable()\n {\n $this->enabled = true;\n }",
"public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }",
"public function isEnabled($store = null)\n {\n return (boolean) Mage::getStoreConfig(self::XML_PATH_ENABLED, $store);\n }",
"public function setCurrentStore($store)\n {\n throw new \\Exception('Method not implemented');\n }",
"public static function enable(): void\n {\n static::$_enabled = true;\n }",
"function admin_init() {\r\n register_setting('e_tools_options', 'e_tools');\r\n}",
"public function isFrontendTierEnabled()\n {\n return (boolean)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_TIER,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function setBackendOptions( array $backend ) {\n $this->_backendOptions = $backend;\n }",
"public function enableFlag()\n {\n $this->state->setItem(self::SAFE_ATTRIBUTE_FLAG, true);\n }",
"public function setStoreName($storeName);",
"function storeConfigForm()\r\n\t{\r\n\t\t/*\tAdd the field for the store configuration\t*/\r\n\t\tadd_settings_field('wpklikandpay_store_tpe', __('Numéro de TPE de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'storeTpe'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t\t// add_settings_field('wpklikandpay_store_rang', __('Numéro de rang de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'storeRang'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t\t// add_settings_field('wpklikandpay_store_id', __('Identifiant de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'storeIdentifier'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t\tadd_settings_field('wpklikandpay_environnement', __('Environnement de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'environnement'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t}",
"public static function set_enabled($value = null) {\n\t\tif (is_null($value)) {\n\t\t\tself::$enabled = self::$enabled ? false : true;\n\t\t}\n\t\telse {\n\t\t\tself::$enabled = make_bool($value);\n\t\t}\n\n\t\t$_SESSION['art_enabled'] = self::$enabled;\n\t}",
"private function initStoreManager($di, $config, $store_code) {\n\t\t\t$di->set('storeManager', function () use ($config, $store_code) {\n\t\t\t\n\t\t\t\t$sdm = new \\StoreManager();\n\t\t\t\t\n\t\t\t\tif($sdm->isStoreAvailable($store_code)) {\n\t\t\t\t\n\t\t\t\t\t$sdm->setCurrentStore($store_code);\n\t\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\t$sdm->setCurrentStore($sdm->getDefaultStore());\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $sdm;\n\t\t\t\t\n\t\t\t}, true);\n\t\t\t\n\t\t}",
"public function setBackend($backend) {}",
"public function actionEnable()\n\t{\n\t\t// can be requested over GET, so check for the token manually\n\t\t$this->_checkCsrfFromToken($this->_input->filterSingle('_xfToken', XenForo_Input::STRING));\n\t\n\t\t$fieldId = $this->_input->filterSingle('field_id', XenForo_Input::UINT);\n\t\treturn $this->_switchFormActiveStateAndGetResponse($fieldId, 1);\n\t}",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configuration setting to enable Product Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public static function enable(): void\n {\n self::$isEnabled = true;\n }",
"function commerce_store_post_update_4() {\n /** @var \\Drupal\\Core\\Config\\ConfigFactoryInterface $config_factory */\n $config_factory = \\Drupal::service('config.factory');\n $uuid = $config_factory->get('commerce_store.settings')->get('default_store');\n if ($uuid) {\n $store_storage = \\Drupal::entityTypeManager()->getStorage('commerce_store');\n /** @var \\Drupal\\commerce_store\\Entity\\StoreInterface[] $stores */\n $stores = $store_storage->loadByProperties(['uuid' => $uuid]);\n $store = reset($stores);\n if ($store) {\n $store->setDefault(TRUE);\n $store->save();\n }\n }\n $config_factory->getEditable('commerce_store.settings')->delete();\n}",
"public static function enable()\n {\n self::$_enabled = TRUE;\n }",
"function setBackStore() {\n $requestParam = explode('/', $this->params->url);\n $store_name = trim($requestParam[0]); // Name of the store which we will change later with Saas\n $StoreAdminid = $this->Session->read('Auth.Admin.id');\n if ($store_name && !$StoreAdminid) {\n $this->loadModel('Store');\n $store_result = $this->Store->store_info($store_name);\n if ($store_result) {\n $storeName = $store_result['Store']['store_name'];\n $this->Session->write('admin_domainname', $store_name);\n $this->Session->write('admin_storeName', $storeName);\n $this->Session->write('admin_store_id', $store_result['Store']['id']);\n $this->Session->write('admin_merchant_id', $store_result['Store']['merchant_id']);\n } else {\n $this->redirect(array('controller' => 'users', 'action' => 'selectStore'));\n }\n }\n }",
"public function setExtDirectStateProvider() {}",
"public function isEnabledOnFront($storeId = null)\n {\n if ($this->isEnabled($storeId)) {\n return $this->_scopeConfig->isSetFlag(\n self::XML_PATH_ENABLED_ON_FRONT,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }\n\n return false;\n }",
"public function setBackend( $backend ) {\n $this->_backend = $backend;\n }",
"function disableConfigurableSwatches()\n\t {\n\t \t $configModel = new Mage_Core_Model_Config();\n\t \t $configModel->saveConfig('configswatches/general/enabled', \"0\", 'default', 0);\n\t \t $configModel->saveConfig('configswatches/general/swatch_attributes', \"\", 'default', 0);\n\t }",
"function enable()\n{\n global $avahips_config, $urlpath, $staticFile;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Add IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE'])) {\n if (strpos($aps_cfg['DATABASE'], 'ipfs') === false) {\n $aps_cfg['DATABASE'] = trim($aps_cfg['DATABASE'].\" ipfs\");\n }\n $aps_cfg['DATABASE'] = trim(str_replace(\"none\", \"\", $aps_cfg['DATABASE']));\n } else {\n $aps_cfg['DATABASE'] = \"ipfs\";\n }\n\n // Save Avahi-PS configuration file\n write_conffile($avahips_config, $aps_cfg, null, null);\n\n // Check if IPFS was actually enabled and set a flash message before return\n if (isEnabled()) {\n setFlash(t('ipfs_flash_publish_enabled'), \"success\");\n } else {\n setFlash(t('ipfs_flash_publish_not_enabled'), \"error\");\n }\n\n return(array('type'=>'redirect','url'=>$staticFile.$urlpath));\n}",
"public function configure_merchant_settings() {\n\t\t$this->title = $this->get_option( 'title' );\n\t\t$this->enabled = $this->get_option( 'enabled' );\n\t\t$this->payment_action = $this->get_option( 'payment_action' );\n\t\t$this->txn_descriptor = $this->get_option( 'txn_descriptor' );\n\t\t$this->allow_card_saving = $this->get_option( 'allow_card_saving' ) === 'yes';\n\n\t\tforeach ( $this->get_gateway_form_fields() as $key => $options ) {\n\t\t\tif ( ! property_exists( $this, $key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = $this->get_option( $key );\n\n\t\t\tif ( 'checkbox' === $options['type'] ) {\n\t\t\t\t$value = 'yes' === $value;\n\t\t\t}\n\n\t\t\t$this->{$key} = $value;\n\t\t}\n\t}",
"protected function _setCompanyCode($storeId=null) {\n\t\t$config = Mage::getSingleton('avatax/config');\n\t\t$this->_request->setCompanyCode($config->getCompanyCode($storeId));\n\t}",
"public function enable() {}",
"public function setAlwaysOnConfiguration($val)\n {\n $this->_propDict[\"alwaysOnConfiguration\"] = $val;\n return $this;\n }",
"public function setEnabled(?bool $value): void {\n $this->getBackingStore()->set('enabled', $value);\n }",
"public static function enable($enable = true) : void\n {\n }",
"public function enable_powered_by() {\n\t\tupdate_option( 'algolia_powered_by_enabled', 'yes' );\n\t}",
"public function add_store($store)\n {\n }",
"public function setStoreId($storeId);",
"public function setStoreId($storeId);",
"public function setStore(Repository $store): void\n {\n $this->store = $store;\n }",
"protected function isFrontendEditActive() {}",
"protected function isFrontendEditActive() {}",
"protected function isFrontendMode() {\n\t\treturn TYPO3_MODE == 'FE';\n\t}",
"public function setIsSingleStoreModeAllowed($value)\n {\n throw new \\Exception('Method not implemented');\n }",
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function install(){\n\n\t\t$model = Advertikon::getCurrentModel();\n\n\t\ttry {\n\t\t\t$this->_checkCompatibility();\n\t\t}\n\t\tcatch( Exception\\Transport $e ) {\n\t\t\t$this->errorPage( $e->getData() , 424 , 'Failed Dependency' );\n\t\t}\n\n\t\t$this->_install();\n\n\t\t$config = Advertikon::getXmlConfig();\n\t\t$settingsModel = Advertikon::getExtendedModel( 'setting_setting' );\n\t\t$settings = $model->stripPrefix( $settingsModel->getSetting() );\n\t\t$model->merge( $settings , $config->getValues( '/' ) );\n\t\t$settingsModel->editSetting( $settings );\n\n\t\t//mark the extension as installed\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->setSettingValue( 'installed' , 1 );\n\t}",
"public function enable()\r\n {\r\n $this->enabled = true;\r\n\r\n if (!$this->booted) {\r\n $this->boot();\r\n }\r\n }",
"public function setIsServiceProvider($val)\n {\n $this->_propDict[\"isServiceProvider\"] = boolval($val);\n return $this;\n }",
"protected function isFrontendMode()\n {\n return TYPO3_MODE == 'FE';\n }",
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration setting to enable Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function updateMasterProducts($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_UPDATE_MASTER, $store));\n }",
"function instant_ide_manager_activate_pre() {\n\t\n\tif ( ! get_option( 'instant_ide_manager_access_pin' ) )\n\t\tupdate_option( 'instant_ide_manager_access_pin', '' );\n\t\t\n\tif ( ! get_option( 'instant_ide_manager_access_status' ) )\n\t\tupdate_option( 'instant_ide_manager_access_status', 'locked' );\n\t\n\tif ( file_exists( IIDEM_IIDE_DIR . '/iide-constants.php' ) ) {\n\t\t\n\t\tinclude_once( IIDEM_IIDE_DIR . '/iide-constants.php' );\n\t\t\n\t\tif ( version_compare( IIDE_VERSION, IIDE_LATEST_VERSION, '>=' ) )\n\t\t\treturn;\n\t\t\t\n\t\t\t$current_iide_dir = IIDEM_IIDE_DIR;\n\t\t\tinstant_ide_manager_backup_files();\n\t\t\tinstant_ide_manager_delete_dir( IIDEM_IIDE_DIR );\n\t\t\tinstant_ide_manager_copy_dir( IIDEM_IDE_DIR . '/instant-ide', $current_iide_dir );\n\t\t\tinstant_ide_manager_restore_files();\n\t\t\n\t}\n\t\t\n}",
"protected function configureStore()\n {\n /** @var $storeConfigurator Ess_M2ePro_Model_Magento_Quote_Store_Configurator */\n $storeConfigurator = Mage::getModel('M2ePro/Magento_Quote_Store_Configurator');\n $storeConfigurator->init($this->_quote, $this->_proxyOrder);\n\n $this->_originalStoreConfig = $storeConfigurator->getOriginalStoreConfig();\n\n $storeConfigurator->prepareStoreConfigForOrder();\n }",
"public function enableTwoFactorAuth(): void\n {\n $this->twoFactorAuth->enabled_at = now();\n\n if (config('laraguard.recovery.enabled')) {\n $this->generateRecoveryCodes();\n }\n\n $this->twoFactorAuth->save();\n\n event(new Events\\TwoFactorEnabled($this));\n }",
"public function init_settings() {\n\t\tparent::init_settings();\n\t\t$this->enabled = ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'] ? 'yes' : 'no';\n\t}",
"public function setIsServiceProvider(?bool $value): void {\n $this->getBackingStore()->set('isServiceProvider', $value);\n }",
"private function SetRequestEnableSettings() { \n if($_GET[\"enable\"] == '1') {\n $query = \"update [|PREFIX|]order_review_config set `sendrequest`= '1' where id = '1' \";\n $GLOBALS['ISC_CLASS_DB']->Query($query);\n echo \"1\";\n exit;\n }\n else {\n $query = \"update [|PREFIX|]order_review_config set `sendrequest`= '0' where id = '1' \";\n $GLOBALS['ISC_CLASS_DB']->Query($query);\n echo \"0\";\n exit;\n }\n }",
"public function setStore($store) {\r\n\t\t$this->store = $store;\r\n\t\tif ($this->store) {\r\n\t\t\t$state = $this->store->get ( 'state' );\r\n\t\t\tif (! empty ( $state )) {\r\n\t\t\t\t$this->state = $state;\r\n\t\t\t}\r\n\t\t\t$this->getSession ();\r\n\t\t\t$this->establishCSRFTokenState ();\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"protected function isFrontend() {}",
"public function setIsAdmin($value);",
"public function setAppStoreURL($aApp_store_url) {\n\n $this->app_store_url = $aApp_store_url;\n }",
"function before_edit_configuration() { }",
"protected function _afterSave(Mage_Core_Model_Store $store, $disabled)\n {\n $this->detectAskAndSetDeveloperIp($store, $disabled);\n }"
] | [
"0.68808234",
"0.6062333",
"0.5985989",
"0.57530636",
"0.5622945",
"0.5589563",
"0.5589249",
"0.5583273",
"0.55787593",
"0.5509246",
"0.5488924",
"0.54679716",
"0.54343563",
"0.54176563",
"0.53995156",
"0.53519154",
"0.53510034",
"0.5330969",
"0.5328834",
"0.52971363",
"0.52947277",
"0.5290143",
"0.52587175",
"0.5248868",
"0.5236625",
"0.52291906",
"0.52115154",
"0.519901",
"0.5193845",
"0.5159431",
"0.51548463",
"0.51484627",
"0.51411235",
"0.51280767",
"0.5126516",
"0.5122488",
"0.5109199",
"0.5108965",
"0.51089126",
"0.51024795",
"0.51024795",
"0.50889087",
"0.5073667",
"0.50715035",
"0.50669974",
"0.5063392",
"0.5060745",
"0.5052197",
"0.50513536",
"0.504661",
"0.50433713",
"0.50210136",
"0.5019033",
"0.50111115",
"0.5008967",
"0.5006563",
"0.50038326",
"0.49983793",
"0.49921903",
"0.49726573",
"0.49621853",
"0.49577078",
"0.4953874",
"0.49527752",
"0.4949854",
"0.49300596",
"0.49264678",
"0.4923753",
"0.4914465",
"0.49021986",
"0.49002203",
"0.48991802",
"0.48946822",
"0.48898074",
"0.48872307",
"0.48872307",
"0.48773593",
"0.48757744",
"0.48757744",
"0.4861146",
"0.48547772",
"0.48514044",
"0.48502138",
"0.48425627",
"0.4841063",
"0.48184302",
"0.48131537",
"0.4811244",
"0.48106518",
"0.47995213",
"0.47971317",
"0.47867706",
"0.4785314",
"0.4776166",
"0.47715685",
"0.47687247",
"0.4767941",
"0.47637865",
"0.47631323",
"0.47600323"
] | 0.51303786 | 33 |
Check if the Klevu_Search extension is enabled in the system configuration for the current store. | public function isExtensionEnabled($store_id = null) {
return Mage::getStoreConfigFlag(static::XML_PATH_EXTENSION_ENABLED, $store_id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isClerkSearchEnabled()\n {\n return $this->scopeConfig->isSetFlag(Config::XML_PATH_SEARCH_ENABLED, ScopeInterface::SCOPE_STORE);\n }",
"public function isExtentionEnable() {\n\t\treturn $this->_scopeConfig->getValue(Self::ENABLE, ScopeInterface::SCOPE_STORE);\n\t}",
"public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }",
"public function isEnabled()\n {\n return $this->config->isEnabledSDK($this->_storeManager->getStore()->getId());\n }",
"public function isEnabled()\n\t{\n\t\treturn $this->scopeConfig->getValue(\n\t\t\t$this->getConfigPath(self::SYSTEM_CONFIG_PATH_ENABLED),\n\t\t\t\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n\t\t);\n\t}",
"protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }",
"public function hasEnableSearch()\n {\n return $this->enable_search !== null;\n }",
"protected function isSearchEngineAvailable()\n {\n $settings = \\Administration::getSettings();\n return empty($settings->settings['info_fts_down']);\n }",
"public function is_search_api_key_in_config() {\n\t\treturn defined( 'ALGOLIA_SEARCH_API_KEY' );\n\t}",
"function available()\n {\n $db =& JFactory::getDBO();\n $query = 'select count(*) from #__extensions as a where a.element = ' . $db->Quote('com_community') . ' AND a.enabled=1';\n\t\t$db->setQuery($query);\n\t\t$count = (int)$db->loadResult();\n if ($count > 0)\n return true;\n\n return false;\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag('training_layred/catalog/enabled');\n }",
"public function isEnabled()\n {\n return $this->getStoreConfig(self::MODULE_ENABLED);\n }",
"function is_pm_search()\n{\n\tglobal $db;\n\n\t// Check if the search-module is active\n\t$sql = 'SELECT module_enabled FROM ' . MODULES_TABLE . '\n\t\tWHERE module_basename = \"pm\"\n\t\tAND module_mode = \"search\"';\n\t$result = $db->sql_query($sql);\n\t$pm_search_enabled = (int) $db->sql_fetchfield('module_enabled');\n\t$db->sql_freeresult($result);\n\n\treturn($pm_search_enabled);\n}",
"public function isEnabled()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ENABLED);\n }",
"public function isEnabled()\n {\n if (Mage::getStoreConfigFlag(self::XML_PATH_ENABLED)) {\n return true;\n }\n return false;\n }",
"public function isExtensionConfigured($store_id = null) {\n $js_api_key = $this->getJsApiKey($store_id);\n $rest_api_key = $this->getRestApiKey($store_id);\n\n return (\n $this->isExtensionEnabled($store_id)\n && !empty($js_api_key)\n && !empty($rest_api_key)\n );\n }",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('refersion/refersion_settings/refersion_active');\n }",
"public function _isEnable(){\n return true;\n if(!array_key_exists('enable', $this->moduleConfig)) return false;\n return $this->moduleConfig['enable'];\n }",
"public function getIsEnabled()\n\t{\n\t\treturn Mage::getStoreConfig(self::XML_PATH_ENABLE);\n\t}",
"public function isEnabled()\n {\n $storeCode = $this->storeManager->getStore()->getCode();\n return $this->scopeConfig->getValue(self::CONFIG_DATA_PATH, ScopeInterface::SCOPE_STORE, $storeCode) === '1';\n }",
"public function isEnabledInSystem()\r\n\t{\r\n\t\t// Get global vars\r\n\t\tglobal $realtime_webservice_global_enabled;\r\n\t\t// If both vars have a value, then it IS enabled\r\n\t\treturn $realtime_webservice_global_enabled;\r\n\t}",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"public function _checkConfig(){\n return true;\n if(count($this->moduleConfig) > 0) return true;\n return false;\n }",
"public function checkEnabled()\n {\n $app_id = $this->_application->id;\n return $this->app->zoocart->getConfig($app_id)->get('enable_cart');\n }",
"protected function isServiceAvailable()\n {\n return (boolean) $this->extConfig['providers'][strtolower($this->provider)]['enabled'];\n }",
"public function isLogEnable() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE);\n }",
"public function isCatalogBackendManageStockVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_MANAGE_STOCK);\n }",
"private function init_radialsearchExtension()\n {\n $key = 'radialsearch';\n\n // RETURN : extension is installed\n if ( t3lib_extMgm::isLoaded( $key ) )\n {\n return true;\n }\n // RETURN : extension is installed\n\n $header = 'FATAL ERROR!';\n $text = 'You are using a radial search filter in the current view.<br />\n But the extension Radial Search (Umkreissuche) (extension key: radialsearch) isn\\'t loaded.<br />\n Please remove the radialsearch filter or install and enable the extension radialsearch.';\n $this->pObj->drs_die( $header, $text );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function enabled()\n {\n return extension_loaded('ibm_db2');\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_ACTIVE)\n && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE);\n }",
"private function _isExtensionInstalled($name)\n {\n if ($name == '') {\n return false;\n }\n\n $allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();\n return array_key_exists($name, $allExtensions);\n }",
"function enabled() {\n\t\treturn extension_loaded('mysql');\n\t}",
"function isInstalled() {\r\n return extension_loaded('memcache');\r\n }",
"public function isConfiguredForThisStore()\n {\n return $this->getUsername() && $this->isEnabled();\n }",
"public static function isEnabled()\n {\n $app_model = new waAppSettingsModel();\n $is_enabled = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID . '-profile');\n $profile_cookie = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID_SHORT . '-profile-cookie');\n $cookie_enabled = $profile_cookie && waRequest::cookie($profile_cookie, '');\n return $is_enabled && $cookie_enabled;\n }",
"protected function isInstalledAndEnabled()\n {\n return $this->isPluginAvailable($this->identifier)\n && Settings::get('octoshop_products_enabled', true);\n }",
"function wrmp_is_installed()\n{\n\treturn wrmp_get_settingsgroup();\n}",
"public static function enabled() {\n\t\treturn extension_loaded('intl');\n\t}",
"public function is_enabled() {\n $enabled = file_exists(ABSPATH . '!sak4wp.php');\n return $enabled;\n }",
"public function is_configured($name)\n\t{\n\t\treturn isset($this->extensions[$name]['ext_active']);\n\t}",
"private function isEnabled()\n {\n if(is_file(JPATH_SITE.DS.'components'.DS.'com_magebridge'.DS.'models'.DS.'config.php')) {\n return true;\n }\n return false;\n }",
"public function has($key){\n return (array_key_exists($key,$this->settings));\n }",
"static function wpl_toolskit_ot_active() {\n\t\t//if ( is_plugin_active( 'option-tree/ot-loader.php' ) ) {\n\t\t\treturn true;\n\t\t//}\n\t}",
"public function isEnabled()\n {\n return (bool)Mage::helper('Core')->isModuleEnabled('Faonni_AccountNavigation') && \n\t\t\tMage::getStoreConfig('faonni_accountnavigation/general/active');\n }",
"public function hasConfig() {\n\t\treturn (bool)@file_exists($this->fullModulePath.'/config.ini');\n\t}",
"public function isEnabled()\n\t{\n\t\treturn Mage::helper('wordpress')->isPluginEnabled('wordpress-seo/wp-seo.php') \n\t\t\t|| Mage::helper('wordpress')->isPluginEnabled('wordpress-seo-premium/wp-seo-premium.php');\n\t}",
"public function isEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n 'orderflow_inventory_import/settings/is_enabled',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n }",
"public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }",
"protected function _isSearch()\n {\n\n return in_array($this->_getFullActionName(), self::PRODUCTSEARCHITEM_HANDLES);\n }",
"public function isNewsletterPopUpEnable() \n {\n return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE);\n }",
"public static function checkInstallToolEnableFile() {}",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_TRANSACTIONAL_API_ENABLED);\n }",
"public function getStatus(){\r\n if($this->scopeConfigInterface->getValue(self::XML_PATH_ENABLED,ScopeInterface::SCOPE_WEBSITE) ==1){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function is_available($name)\n\t{\n\t\t$md_manager = $this->create_extension_metadata_manager($name);\n\t\ttry\n\t\t{\n\t\t\treturn $md_manager->get_metadata('all') && $md_manager->validate_enable();\n\t\t}\n\t\tcatch (\\phpbb\\extension\\exception $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function checkVendorKycStatus() {\n $storeModel = new \\App\\StoreModel();\n $storeId = Auth::user()->id;\n $allowProductUpload = $storeModel->getStoreKYCStatus($storeId);\n return $allowProductUpload;\n }",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"function is_system_configured() {\n global $CFG;\n return (!empty($CFG->ombielalertsserverendpoint) && \n !empty($CFG->ombielalertsserversserverusername) && \n !empty($CFG->ombielalertsserverpassword) && \n !empty($CFG->ombielalertsorgcode) && \n !empty($CFG->ombielalertsorgpassword)\n );\n }",
"private function scan_allowed() {\n\t\treturn $this->as3cf->is_plugin_enabled();\n\t}",
"function is_active_addons($key)\r\n{\r\n $act_key = get_option($key);\r\n if ($act_key != '')\r\n {\r\n return true;\r\n }\r\n}",
"function shIsSearchEngine()\n{\n\tstatic $isSearchEngine = null;\n\n\t//return true;\n\tif (!is_null($isSearchEngine))\n\t{\n\t\treturn $isSearchEngine;\n\t}\n\telse\n\t{\n\t\t$isSearchEngine = false;\n\t\t$useragent = empty($_SERVER['HTTP_USER_AGENT']) ? '' : strtolower($_SERVER['HTTP_USER_AGENT']);\n\t\tif (!empty($useragent))\n\t\t{\n\t\t\t$remoteConfig = Sh404sefHelperUpdates::getRemoteConfig($forced = false);\n\t\t\t$remotes = empty($remoteConfig->config['searchenginesagents']) ? array() : $remoteConfig->config['searchenginesagents'];\n\t\t\t$agents = array_unique(array_merge(Sh404sefFactory::getPConfig()->searchEnginesAgents, $remotes));\n\t\t\tforeach ($agents as $agent)\n\t\t\t{\n\t\t\t\tif (strpos($useragent, strtolower($agent)) !== false)\n\t\t\t\t{\n\t\t\t\t\t$isSearchEngine = true;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $isSearchEngine;\n\t}\n}",
"protected function _isMageEnterprise()\n {\n return Mage::getConfig()->getModuleConfig('Enterprise_Enterprise')\n && Mage::getConfig()->getModuleConfig('Enterprise_Cms');\n }",
"public function isSearchable(): ?bool {\n\t\treturn Hash::get($this->_config, 'searchable');\n\t}",
"function has_altis_config() : bool {\n\tif ( ! function_exists( 'Altis\\\\get_config' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( Altis\\get_config()['hm-juicer'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function getEnabled()\n {\n return array_filter($this->storage, function($val)\n {\n return $val['status'] === ProviderInterface::STATUS_INSTALLED;\n });\n }",
"public static function isInstalled(){\n\t\treturn !empty(\\GO::config()->db_user);\n\t}",
"public function enabled()\n {\n return (bool) Mage::getStoreConfig('actions/settings/enabled');\n }",
"public function hasPermission(&$controller, &$xoopsUser)\n {\n if (1 != $this->mConfig['enable_search']) {\n $controller->executeRedirect(XOOPS_URL . '/', 3, _MD_LEGACY_ERROR_SEARCH_NOT_ENABLED);\n return false;\n }\n return true;\n }",
"public function hasConfig();",
"function isEnabled()\n{\n global $avahips_config;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Check for IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE']) && strpos($aps_cfg['DATABASE'], 'ipfs') !== false) {\n return true;\n }\n return false;\n}",
"public static function is_available () {\n\t\t$auth = op5Auth::instance();\n\t\tforeach (AuthModulePool_Model::all() as $module) {\n\t\t\t$driver = $auth->get_auth_driver($module->get_modulename());\n\t\t\tif (\n\t\t\t\t$driver->get_metadata('require_user_configuration') &&\n\t\t\t\t$driver->get_user_count() > 0\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"protected function checkIfDbalExtensionIsInstalled() {}",
"public function checkIfEssentialConfigurationExists() {}",
"public function isEnabled(): bool\n {\n return config('theme-system.enable', true) ?? true;\n }",
"function checkInstallationStatus() {\n global $configFile, $_PATHCONFIG;\n\n $result = @include_once'..'.$configFile;\n if ($result === false) {\n return false;\n } else {\n return (defined('CONTREXX_INSTALLED') && CONTREXX_INSTALLED);\n }\n }",
"protected function checkPhpExtensionEnabled($ext)\n {\n return extension_loaded($ext);\n }",
"public function isInstalled() {\n return (bool)defined('ADDONS_CATALOG_SUPPORT_TICKETS_STATUS');\n }",
"public function checkGlobalActive() {\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/active') == 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function is_installed() {\n return function_exists('solr_get_version');\n }",
"public function isBackendSearchable():bool\n {\n return true;\n }",
"public function isInstalled(){\n return true;\n }",
"function is_available() {\n global $CFG;\n\n //we need the curriculum directory\n if (!file_exists($CFG->dirroot.'/curriculum/config.php')) {\n return false;\n }\n\n //we also need the curr_admin block\n if (!record_exists('block', 'name', 'curr_admin')) {\n return false;\n }\n\n //everything needed is present\n return true;\n }",
"protected function checkExtension() {\n\t\t\n\t\t//If no extensions set, all are valid\n\t\tif(empty($this->valid_extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$extension = $this->getExtension();\n\t\t\n\t\treturn in_array($extension, $this->valid_extensions) ? true : false;\n\t\t\n\t}",
"public function isFindifyEnabled()\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_ENABLED,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function is_enabled() {\n $enabled = (bool) get_config('reportgen', 'DBdetails');\n return $enabled;\n }",
"function configEnabled() { global $db;\n global $lang;\n\n $dbtst = $db->query(\"SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '\".$lang[\"config_db_name\"].\"'\");\n if($dbtst->num_rows == 0) {\n $prepReturn = prepConfig();\n if ($prepReturn == \"Ready\"){\n return true;\n } else {\n return $prepReturn;\n }\n } else {\n return true;\n }\n }",
"public function allow_load() {\n\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! current_user_can( 'install_languages' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\n\t\treturn wp_can_install_language_pack();\n\t}",
"private function canSearch(array $config = [])\n {\n \tif (isset($config['global_search']) && isset($config['global_search']['search_objects']) === true)\n \t{\n \t\tif (is_array($config['global_search']['search_objects']) && count($config['global_search']['search_objects'] == 0))\n \t\t{\n \t\t\treturn true;\n \t\t}\n \t}\n \treturn false;\n }",
"protected function loadAvailability()\n {\n if ($this->available === null) {\n $this->available = $this->isSearchEngineAvailable();\n }\n return $this->available;\n }",
"protected function isGridelementsInstalled()\n {\n $geLoaded = t3lib_extMgm::isLoaded('gridelements');\n $this->results['isGridelementsInstalled'] = $geLoaded;\n return $geLoaded;\n }",
"public function isAvailable($storeId)\n {\n $active = $this->config->isModuleEnabled($storeId);\n if (!$active) {\n return false;\n }\n\n $apiKey = $this->getApiKey($storeId);\n if (empty($apiKey)) {\n return false;\n }\n\n return true;\n }",
"protected function checkConfiguration() {\n\t\t$pass = FALSE;\n\t\ttry {\n\t\t\tTx_CzWkhtmltopdf_Config::getBinaryPath();\n\t\t\t$pass = TRUE;\n\t\t}\n\t\tcatch(InvalidArgumentException $e) {}\n\n\t\t$this->reports[] = t3lib_div::makeInstance('tx_reports_reports_status_Status',\n\t\t\t'Configuration', // title\n\t\t\t$pass ? 'OK' : 'ERROR', // value\n\t\t\t$pass ? '' : 'Please go to the Extension Manager and hit the \"Update\" button of the configuration of '.Tx_CzWkhtmltopdf_Config::EXTKEY , //message\n\t\t\t$pass ? tx_reports_reports_status_Status::OK : tx_reports_reports_status_Status::ERROR //severity\n\t\t);\n\n\t\treturn $pass;\n\t}",
"public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }",
"public function isEnabled($store = null)\n {\n return (boolean) Mage::getStoreConfig(self::XML_PATH_ENABLED, $store);\n }",
"function baseSettings_exists($key)\n {\n return app('BaseSettings_exists')->exists($key);\n }",
"public function CheckModule()\r\n\t{\r\n\t\tif($this->settings['API_KEY'] != $this->API_Key)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}",
"public function getSearchEnabled() {}"
] | [
"0.713247",
"0.69722885",
"0.6661157",
"0.656787",
"0.6544586",
"0.652439",
"0.651889",
"0.6487892",
"0.64539975",
"0.6384332",
"0.63824433",
"0.6350602",
"0.6326563",
"0.63183343",
"0.62722486",
"0.6243879",
"0.62172866",
"0.6202335",
"0.61581254",
"0.6144671",
"0.6140843",
"0.6135654",
"0.6128492",
"0.61131185",
"0.6076636",
"0.605068",
"0.60274214",
"0.6018656",
"0.6015905",
"0.5997671",
"0.5997056",
"0.5997056",
"0.5966059",
"0.59599274",
"0.59593385",
"0.59546137",
"0.5942191",
"0.593814",
"0.5926862",
"0.5921987",
"0.5921099",
"0.5914306",
"0.5914303",
"0.59016216",
"0.59014326",
"0.5893418",
"0.5889593",
"0.5888604",
"0.58800316",
"0.586928",
"0.58657146",
"0.5849597",
"0.58390766",
"0.5838041",
"0.58339447",
"0.5826526",
"0.58166933",
"0.5806473",
"0.5795423",
"0.57895136",
"0.5784896",
"0.5777916",
"0.5770486",
"0.5770331",
"0.5768093",
"0.57668513",
"0.5766691",
"0.5766553",
"0.57561195",
"0.5755605",
"0.57538146",
"0.57355326",
"0.573048",
"0.57291234",
"0.5727617",
"0.5711558",
"0.56960666",
"0.56956184",
"0.56834894",
"0.5679381",
"0.56790406",
"0.5673861",
"0.566748",
"0.5667071",
"0.56668055",
"0.56636375",
"0.56590563",
"0.56562746",
"0.5655857",
"0.5653172",
"0.5652835",
"0.56517243",
"0.5650354",
"0.5650126",
"0.56492394",
"0.564319",
"0.5642073",
"0.5639631",
"0.56373334",
"0.56371874"
] | 0.6266351 | 15 |
Set the Test Mode flag in System Configuration for the given store. | public function setTestModeEnabledFlag($flag, $store = null) {
$flag = ($flag) ? 1 : 0;
$this->setStoreConfig(static::XML_PATH_TEST_MODE, $flag, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTestModeEnabledFlag($store = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);\n }",
"public function setTestMode()\n {\n $this->isTestMode = true;\n }",
"public function setTestMode(bool $testMode): void\n {\n $this->testMode = $testMode;\n }",
"public function setTestMode(bool $isTestMode): void\n {\n $this->isTestMode = $isTestMode;\n }",
"public function set_test($test)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $file = new File(self::SMARTD_CONFIG, TRUE);\n $existingline = $file->lookup_line('/^DEVICESCAN/i');\n\n if ($test) {\n $testargs = \"-M test\\n\";\n $newline = $existingline .' '. $testargs;\n $retval = $file->replace_one_line('/^DEVICESCAN/i', $newline);\n } else {\n $newline = preg_replace('/-M test/', '', $existingline);\n $newline = $newline . \"\\n\";\n $retval = $file->replace_one_line('/^DEVICESCAN/i', $newline);\n }\n } catch (File_No_Match_Exception $e) {\n return FALSE;\n }\n }",
"function enableTestMode()\n {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://sandbox/url/yet/to/define';\n }",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"public function saveTestMode($test_mode = true) {\n $this->test_mode = $test_mode;\n\n return $this->save();\n }",
"public function setSuite()\n {\n $this->_suite = true;\n }",
"public function isTestmode()\n {\n return $this->getConfigDataFlag('test', $this->getStoreId());\n }",
"public function isTestModeEnabled($store = null) {\n return $this->getTestModeEnabledFlag($store) || !Mage::helper(\"klevu_search\")->isProductionDomain(Mage::app()->getStore($store)->getBaseUrl());\n }",
"public function testChangeMode()\n {\n $client = new Client($this->options);\n\n $this->assertTrue($client->setMode('production'));\n\n $this->assertTrue(($client->getMode() === 'production'));\n }",
"protected function setTestingMode()\n {\n if (defined('IS_INNER_TESTING')) {\n return;\n }\n\n if (ENVIRONMENT == ENVIRONMENT_DEV\n &&\n (\n !empty($_REQUEST[self::GET_PARAM_NAME_TESTING_MODE])\n || $this->checkIfCliIsTested()\n )\n ) {\n $this->isInnerTesting = true;\n }\n /** Indicates if the current run is an inner test. */\n define('IS_INNER_TESTING', $this->isInnerTesting);\n }",
"public function setTest(bool $test) : void\n\t{\n\t\t$this->productionTest = $test;\n\t}",
"public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}",
"public function setStore($value) { $this->_store = self::forceBool($value); }",
"public function setStoreId($store);",
"public function testSetConfig(): void\n {\n $settings = [\n 'className' => 'Debug',\n 'log' => true,\n ];\n TransportFactory::drop('debug');\n TransportFactory::setConfig('debug', $settings);\n\n $result = TransportFactory::getConfig('debug');\n $this->assertEquals($settings, $result);\n }",
"public function setTestMode(bool $testMode): self\n {\n $this->testMode = $testMode;\n return $this;\n }",
"private function setStore(Store $store) {\n $this->store = $store;\n }",
"public function testGetSetSystemConfiguration()\n {\n $systemConfiguration = $this->service->getSystemConfiguration();\n $this->service->setSystemConfiguration($systemConfiguration);\n $this->assertSame($systemConfiguration, $this->service->getSystemConfiguration());\n }",
"function setMode($value) {\r\n\t\t$this->mode = $value;\r\n\t}",
"public function setMode($mode)\n {\n $this->_isLiveMode = ($mode == self::LIVE);\n }",
"function isTestMode($context) {\n\t\treturn ($this->getSetting($context->getId(), 'testMode') == 1);\n\t}",
"public function enabled($store = null);",
"function setMode($mode)\n {\n $this->_mcryptMode = $mode;\n }",
"public function setIsTestMode($isTestMode)\n {\n $this->isTestMode = $isTestMode;\n\n return $this;\n }",
"function setToolSettings() {\n /*reserved for future use*/\n }",
"public function toggleTestMode(bool $toggle = true)\n {\n $this->testMode = $toggle;\n }",
"function setServerMode($servermode = 'live'){\n\t\t$this->PAYU_BASE_URL = $servermode == 'test' ? 'https://test.payu.in/_payment' : 'https://secure.payu.in/_payment';\n\t}",
"public function setConfig(array $config, $store = false)\n {\n $this->configuration = $config;\n\n if ($store) {\n $values = array('configuration' => serialize($config));\n $connection = \\Zend_Registry::get('doctrine')->getConnection();\n $connection->update('daemon', $values, array('name' => $this->getName()));\n }\n }",
"public function setPayMode($mode = 'testing')\n {\n $this->is_sandbox = strtolower($mode) === 'production' ? false : true;\n\n return $this;\n }",
"public function setMode($mode) {\n $this->mode = $mode;\n }",
"public function testIsDebugMode()\n {\n $oControl = $this->getProxyClass(\"oxShopControl\");\n $oConfigFile = oxRegistry::get('oxConfigFile');\n\n $oConfigFile->iDebug = -1;\n $this->assertTrue($oControl->UNITisDebugMode());\n\n $oConfigFile->iDebug = 0;\n $this->assertFalse($oControl->UNITisDebugMode());\n }",
"public static function setMode($mode)\n\t{\n\t\tif($mode != self::MODE_DEVELOPMENT && $mode != self::MODE_PRODUCTION) {\n\t\t\tthrow new BakedCarrotException('Invalid setMode parameter');\n\t\t}\n\t\t\n\t\tself::$app_mode = $mode;\n\t}",
"function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}",
"function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}",
"public function setSandboxMode($val)\n\t{\n\t\t$this->_sandbox = $val;\n\t\treturn $this;\n\t}",
"private function setMode($mode)\n {\n $this->mode = $mode;\n }",
"function setLogMode($value)\n {\n $this->_props['LogMode'] = $value;\n }",
"public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }",
"protected function setUp() {\n\t\tparent::setUp();\n\t\tConfig::getInstance()->set(array(\n\t\t\t'resource.session.test.namespace' => 'test',\n\t\t\t'resource.session.test.cookieName' => 'testSession',\n\t\t\t'resource.session.test.cookieDomain' => 'testdomain',\n\t\t\t'resource.session.test.cookiePath' => '/test',\n\n\t\t\t'resource.missingNamespace.cookieName' => 'testSession',\n\t\t));\n\t}",
"public function testEnvSettingLive()\n {\n /** @var Kernel $kernel */\n $kernel = Injector::inst()->get(Kernel::class);\n $kernel->setEnvironment('live');\n\n $this->assertTrue(Director::isLive());\n\n $checker = Injector::inst()->get(EnvTypeCheck::class);\n $result = $checker->check();\n\n $this->assertSame($result[0], EnvironmentCheck::OK);\n }",
"public function startTestSuite()\n {\n if (null === $this->reader) {\n $this->reader = Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\DeploymentConfig\\Reader');\n $this->config = $this->reader->load();\n }\n }",
"function setAppMode($value)\n {\n $this->_props['AppMode'] = $value;\n // setting the URL for the API\n // recording to the AppMode selected\n switch ($value) {\n case 0:\n $this->_setProp('ApiUrl', 'https://api.ebay.com/wsapi');\n $this->_setProp('AppId', $this->_keys['prod'][0]);\n $this->_setProp('DevId', $this->_keys['prod'][1]);\n $this->_setProp('CertId', $this->_keys['prod'][2]);\n break;\n case 1:\n $this->_setProp('ApiUrl', 'https://api.sandbox.ebay.com/wsapi');\n $this->_setProp('AppId', $this->_keys['test'][0]);\n $this->_setProp('DevId', $this->_keys['test'][1]);\n $this->_setProp('CertId', $this->_keys['test'][2]);\n break;\n case 2:\n $this->_setProp('ApiUrl', 'https://api.ebay.com/wsapi');\n $this->_setProp('AppId', $this->_keys['test'][0]);\n $this->_setProp('DevId', $this->_keys['test'][1]);\n $this->_setProp('CertId', $this->_keys['test'][2]);\n break;\n }\n }",
"private function setMode() {\r\n\t\t$this->mode = substr($this->mode, -1);\r\n\t}",
"public static function mode($mode) {\n static::$mode = $mode;\n }",
"public function setMode($mode)\n {\n $this->mode = $mode;\n }",
"public function getTestMode(): bool\n {\n return $this->testMode;\n }",
"public function getStoreMode()\n {\n return $this->storeMode;\n }",
"public function setUp () {\n\t\tif (!$this->oStore->isSetUp()) {\n\t\t\t$this->oStore->setUp();\n\t\t}\n\t}",
"public function testGetIntegrationTokenTestMode()\n {\n $this->helper\n ->expects($this->exactly(2))\n ->method('getConfigData')\n ->withConsecutive(\n [$this->equalTo('test_mode_enabled'), $this->equalTo(null)],\n [$this->equalTo('test_integration_token'), $this->equalTo(null)]\n )\n ->willReturnOnConsecutiveCalls(\n true,\n 'test_key'\n );\n\n $this\n ->helper\n ->getIntegrationToken();\n }",
"public function setMode($mode = 'create')\n {\n $this->mode = $mode;\n }",
"public function setIsSystemRule($val)\n {\n $this->_propDict[\"isSystemRule\"] = boolval($val);\n return $this;\n }",
"function setMode($mode)\n {\n $this->mode = $mode;\n $this->determineRequiredPermission();\n }",
"public function setSystem($system)\n {\n $this->system = $system;\n }",
"public function action_switch_mode()\n {\n $session = Session::instance();\n $session->set('mode', ($session->get('mode') == 'daily' ? 'monthly' : 'daily'));\n }",
"private function setMockDataConfig() {\n\n }",
"public static function setInstallMode(string $newInstallMode): void\n {\n self::writeConfiguration(['installMode' => $newInstallMode]);\n }",
"public function setCurrentStore($store)\n {\n throw new \\Exception('Method not implemented');\n }",
"public function configure_merchant_settings() {\n\t\t$this->title = $this->get_option( 'title' );\n\t\t$this->enabled = $this->get_option( 'enabled' );\n\t\t$this->payment_action = $this->get_option( 'payment_action' );\n\t\t$this->txn_descriptor = $this->get_option( 'txn_descriptor' );\n\t\t$this->allow_card_saving = $this->get_option( 'allow_card_saving' ) === 'yes';\n\n\t\tforeach ( $this->get_gateway_form_fields() as $key => $options ) {\n\t\t\tif ( ! property_exists( $this, $key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = $this->get_option( $key );\n\n\t\t\tif ( 'checkbox' === $options['type'] ) {\n\t\t\t\t$value = 'yes' === $value;\n\t\t\t}\n\n\t\t\t$this->{$key} = $value;\n\t\t}\n\t}",
"public function setDevMode($set=TRUE)\r\n\t{\r\n\t\t$this->_devMode = (bool) $set;\r\n\t}",
"public function isTestMode()\n {\n return $this->isTestMode;\n }",
"public function SetMode($mode)\n\t{\n\t\t$this->mode = $mode;\n\t}",
"function setApiMode($value)\n {\n $this->_props['ApiMode'] = $value;\n }",
"public function uploadConfig($store)\n {\n parent::uploadConfig($store);\n\n $this->extend('updateConfig', $store);\n }",
"public function getIsTestMode()\n {\n return $this->isTestMode;\n }",
"public function setMode($val)\n {\n $this->_propDict[\"mode\"] = $val;\n return $this;\n }",
"public function saveMode(string $mode)\n {\n //Change config options\n $this->configWriter->saveConfig(self::XML_PATH_PRICE_DIMENSIONS_MODE, $mode);\n $this->cacheTypeList->cleanType('config');\n $this->indexer->load(\\Magento\\Catalog\\Model\\Indexer\\Product\\Price\\Processor::INDEXER_ID);\n $this->indexer->invalidate();\n }",
"public function setStore(Repository $store): void\n {\n $this->store = $store;\n }",
"public function testEnvSettingTest()\n {\n /** @var Kernel $kernel */\n $kernel = Injector::inst()->get(Kernel::class);\n $kernel->setEnvironment('test');\n\n $this->assertTrue(Director::isTest());\n\n $checker = Injector::inst()->get(EnvTypeCheck::class);\n $result = $checker->check();\n\n $this->assertSame($result[0], EnvironmentCheck::ERROR);\n }",
"public function testSetConfigMultiple(): void\n {\n $settings = [\n 'debug' => [\n 'className' => 'Debug',\n 'log' => true,\n ],\n 'test_smtp' => [\n 'className' => 'Smtp',\n 'username' => 'mark',\n 'password' => 'password',\n 'host' => 'example.com',\n ],\n ];\n TransportFactory::drop('debug');\n TransportFactory::setConfig($settings);\n $this->assertEquals($settings['debug'], TransportFactory::getConfig('debug'));\n $this->assertEquals($settings['test_smtp'], TransportFactory::getConfig('test_smtp'));\n }",
"public function setMagentoStores(array $magentoStores);",
"public function testGetSetConfig()\n {\n $this->config->set('foo', 'baz');\n $this->assertEquals($this->config->get('foo'), 'baz');\n }",
"public function setStoreId($storeId);",
"public function setStoreId($storeId);",
"public function setSandbox($value);",
"public function setSandbox($value);",
"public function setStoreName($storeName);",
"public function testAllStores()\n {\n\n }",
"public function testGlobalSettingsValue()\n {\n $this->assertEquals(1, PaymentMethodType::GLOBAL_SETTING);\n }",
"public function isTestMode(): bool;",
"public function turn_on()\n {\n $this->testing = TRUE;\n }",
"public function setMode($mode) {\n\t\t$editMode = ($mode==\"on\")?true:false;\n\t\t//SessionUtils::setMessageEditionMode($editMode);\n\t\tif ($editMode) {\n\t\t\t$_SESSION[\"FINE_MESSAGE_EDITION_MODE\"] = true;\n\t\t\t$this->isMessageEditionMode = true;\n\t\t} else {\n\t\t\tunset($_SESSION[\"FINE_MESSAGE_EDITION_MODE\"]);\n\t\t}\n\n\t\t$this->content->addFile('../utils.i18n.fine/src/views/enableDisableEdition.php', $this);\n\t\t$this->template->toHtml();\n\t}",
"public function isTestMode() :bool\n {\n $config = $this->getConfig();\n\n if ($this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {\n return true;\n }\n\n if ($config && property_exists($config, 'testMode') && $config->testMode) {\n return true;\n }\n\n return false;\n }",
"public function phpunit_remove_stores() {\n $this->configstores = array();\n }",
"protected function setConfig()\n {\n $dbconfig = atkconfig('db');\n $config = $dbconfig[$this->m_name];\n foreach ($config['nodes'] as $mode=>$nodes)\n {\n if (is_array($nodes))\n {\n foreach ($nodes as $node) $this->setNodeConfig($node, $dbconfig[$node], $mode);\n }\n else $this->setNodeConfig($nodes, $dbconfig[$nodes], $mode);\n }\n }",
"function setDisplayMode($a_mode)\n\t{\n\t\t// security\n\t\tif ($a_mode != \"view\" and $a_mode != \"setup\")\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->display_mode = $a_mode;\n\t\t$_SESSION[\"display_mode\"] = $this->display_mode;\n\n\t\treturn true;\n\t}",
"public function SetTestService($value)\n {\n $this->_TestService = $value;\n }",
"protected function setUp(): void {\n parent::setUp();\n\n $manager = $this->container->get('entity_type.manager');\n $server = $manager->getStorage('ldap_server')->create([\n 'id' => 'my_test_server_1',\n 'label' => 'My Test Server 1',\n 'timeout' => 30,\n 'encryption' => 'none',\n 'address' => 'example',\n 'port' => 963,\n 'basedn' => ['ou=people,dc=hogwarts,dc=edu'],\n 'user_attr' => 'cn',\n 'unique_persistent_attr' => 'uid',\n 'status' => TRUE,\n 'mail_attr' => 'mail',\n ]);\n $server->save();\n }",
"public function phpunit_add_session_store($name) {\n $this->configstores[$name] = array(\n 'name' => $name,\n 'plugin' => 'session',\n 'configuration' => array(),\n 'features' => 14,\n 'modes' => 2,\n 'default' => true,\n 'class' => 'cachestore_session',\n 'lock' => 'cachelock_file_default',\n );\n }",
"public function testSettings() {\n $admin_user = $this->drupalCreateUser(['administer site configuration']);\n $this->drupalLogin($admin_user);\n\n // If we're on Windows, there is no configuration form.\n if (defined('LOG_LOCAL6')) {\n $this->drupalGet('admin/config/development/logging');\n $this->submitForm(['syslog_facility' => LOG_LOCAL6], 'Save configuration');\n $this->assertSession()->pageTextContains('The configuration options have been saved.');\n\n $this->drupalGet('admin/config/development/logging');\n // Should be one field.\n $field = $this->xpath('//option[@value=:value]', [':value' => LOG_LOCAL6]);\n $this->assertSame('selected', $field[0]->getAttribute('selected'), 'Facility value saved.');\n }\n }",
"public function isTestMode()\n {\n if (strpos($this->adyenMode, Environment::TEST) !== false) {\n return true;\n } else {\n return false;\n }\n }",
"private static function config($test = false)\n {\n $files = ['Config', 'Alias'];\n $folder = static::$root.'Config'.'/';\n\n self::call($files, $folder);\n //\n $files = ['ConfigException', 'DatabaseDriverNotFoundException', 'AliasedClassNotFoundException'];\n $folder = static::$root.'Config/Exceptions'.'/';\n\n self::call($files, $folder);\n //\n Config::load();\n }",
"public function testEditStore() {\n $store = $this->createStore('Test');\n $this->drupalGet($store->toUrl('edit-form'));\n $edit = [\n 'name[0][value]' => 'Test!',\n ];\n $this->submitForm($edit, 'Save');\n $this->assertSession()->pageTextContains(\"Saved the Test! store.\");\n\n $store = $this->reloadEntity($store);\n $this->assertEquals('Test!', $store->label());\n }",
"public function setMode($isLocal){\n $this->isLocalMode = (bool)$isLocal;\n }",
"public function setDebugMode( $enable=false )\n\t{\n \t$this->obj['debug'] = intval($enable);\n \n \t//-----------------------------------------\n \t// If debug, no shutdown....\n \t//-----------------------------------------\n \t\n \tif ( $this->obj['debug'] )\n \t{\n \t\t$this->obj['use_shutdown'] = 0;\n \t}\n\t}",
"public function testSetProcessor()\n {\n }",
"abstract function setStore(string $storeKey, int $time = null);",
"public function setMode($value)\n {\n return $this->set('Mode', $value);\n }"
] | [
"0.69331837",
"0.6719498",
"0.60137445",
"0.5996708",
"0.59809285",
"0.5980124",
"0.5969511",
"0.5820247",
"0.5817319",
"0.5738897",
"0.5736035",
"0.57280105",
"0.56378835",
"0.56042486",
"0.54367965",
"0.5323449",
"0.5310368",
"0.52633345",
"0.5259129",
"0.5250934",
"0.5244509",
"0.5196485",
"0.5173495",
"0.51245916",
"0.51187855",
"0.51104116",
"0.5104445",
"0.50682825",
"0.5065133",
"0.50576067",
"0.50083214",
"0.5004037",
"0.4977924",
"0.49743205",
"0.49477267",
"0.4946725",
"0.4946725",
"0.49312624",
"0.49298102",
"0.49283552",
"0.49136275",
"0.49010548",
"0.48990533",
"0.48885122",
"0.4872375",
"0.48586804",
"0.48487645",
"0.4841911",
"0.48101002",
"0.47990385",
"0.47944632",
"0.4790093",
"0.4786538",
"0.47796988",
"0.4764465",
"0.47543365",
"0.47502822",
"0.4749043",
"0.47430262",
"0.47363934",
"0.4730103",
"0.4729096",
"0.4727677",
"0.47275418",
"0.4727197",
"0.47252652",
"0.4717142",
"0.47114548",
"0.47111893",
"0.470265",
"0.46928507",
"0.46925434",
"0.46918267",
"0.46836528",
"0.46797827",
"0.46797827",
"0.46768853",
"0.46768853",
"0.46766073",
"0.46719193",
"0.46651942",
"0.46556696",
"0.46467704",
"0.46463737",
"0.46423367",
"0.46351197",
"0.4633906",
"0.46308857",
"0.46307033",
"0.46249086",
"0.4623284",
"0.4620664",
"0.4611288",
"0.46090946",
"0.46006334",
"0.45998183",
"0.45995662",
"0.4596549",
"0.45964912",
"0.45936096"
] | 0.658754 | 2 |
Return the configuration flag for enabling test mode. | public function getTestModeEnabledFlag($store = null) {
return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIsTestMode()\n {\n return $this->isTestMode;\n }",
"public function getTestMode(): bool\n {\n return $this->testMode;\n }",
"public function isTestmode()\n {\n return $this->getConfigDataFlag('test', $this->getStoreId());\n }",
"public function isTestMode()\n {\n return $this->isTestMode;\n }",
"public function getTestMode()\n {\n return (bool) $this->data['test_ipn'];\n }",
"public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}",
"public function isTestMode(): bool;",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"function enableTestMode()\n {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://sandbox/url/yet/to/define';\n }",
"public function isTest() {\n\t\treturn $this->_options['test'];\n\t}",
"public function get_enable()\n\t{\n\t\treturn $this->enable;\n\t}",
"public function isTestMode()\n {\n if (strpos($this->adyenMode, Environment::TEST) !== false) {\n return true;\n } else {\n return false;\n }\n }",
"public function get_test_is_in_debug_mode()\n {\n }",
"public function setTestModeEnabledFlag($flag, $store = null) {\n $flag = ($flag) ? 1 : 0;\n $this->setStoreConfig(static::XML_PATH_TEST_MODE, $flag, $store);\n return $this;\n }",
"public function setTestMode()\n {\n $this->isTestMode = true;\n }",
"public function isTestMode() :bool\n {\n $config = $this->getConfig();\n\n if ($this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {\n return true;\n }\n\n if ($config && property_exists($config, 'testMode') && $config->testMode) {\n return true;\n }\n\n return false;\n }",
"public function _isEnable(){\n return true;\n if(!array_key_exists('enable', $this->moduleConfig)) return false;\n return $this->moduleConfig['enable'];\n }",
"private function isEnabled()\n {\n return $this->getConfigBool('enable', false);\n }",
"protected function getDebugMode(): bool\n {\n return (bool)getenv('STAIRTOWER_TEST_DEBUG_MODE');\n }",
"public function getEnable()\n {\n return isset($this->enable) ? $this->enable : false;\n }",
"public static function is_enable() {\n\t\treturn true;\n\t}",
"function isTestMode($context) {\n\t\treturn ($this->getSetting($context->getId(), 'testMode') == 1);\n\t}",
"public function getIsEnable()\n {\n return $this->is_enable;\n }",
"public function getSectionStatus() {\r\n\t\t$config = $this->getConfig();\r\n return $config[\"enable\"];\r\n }",
"public function getIsEnabled()\n\t{\n\t\treturn Mage::getStoreConfig(self::XML_PATH_ENABLE);\n\t}",
"public function isTest() : bool\n\t{\n\t\treturn $this->productionTest;\n\t}",
"public function getEnableAlwaysOnConfiguration()\n {\n if (array_key_exists(\"enableAlwaysOnConfiguration\", $this->_propDict)) {\n return $this->_propDict[\"enableAlwaysOnConfiguration\"];\n } else {\n return null;\n }\n }",
"public function debugMode()\n {\n return $this->settings['debug'];\n }",
"public function getDebugMode()\n {\n return $this->getSettingArray()[\"debug_mode\"];\n }",
"public function isSetup(): bool\n {\n return $this->setUp;\n }",
"public function setTestMode(bool $testMode): self\n {\n $this->testMode = $testMode;\n return $this;\n }",
"public function authorizedTest()\n {\n return $this->accepted && $this->test_mode;\n }",
"public function getIsEnabled()\n {\n return $this->helper->isEnabled();\n }",
"public function enabled()\n {\n return (bool) Mage::getStoreConfig('actions/settings/enabled');\n }",
"public final function isDebugEnabled()\n {\n return getenv('TEST') === 'true';\n }",
"protected function _isDebugMode()\n {\n if ($this->_debugMode === null) {\n $this->_debugMode = (bool) $this->_getDataHelper()->isDebugModeEnabled();\n }\n return $this->_debugMode;\n }",
"public function useSetting()\n\t{\n\t\treturn count($this->settingConfig()) ? true : false;\n\t}",
"public function getEnableMonitoring()\n {\n return $this->enableMonitoring;\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag('training_layred/catalog/enabled');\n }",
"private function get_is_configured(): bool\n\t{\n\t\treturn $this->status >= self::STATUS_CONFIGURED;\n\t}",
"public function getSetting() : bool\n {\n return $this->setting;\n }",
"public function isEnabled()\n {\n return $this->config->isEnabled();\n }",
"public function getEnvSetupConfigured(){\n\t\t/* return setup configured */\n\t\treturn $this->_intIsSetupConfigured;\n\t}",
"public function testEnabled(): void\n {\n $agentWithoutEnabling = $this->agentFromConfigArray();\n self::assertFalse($agentWithoutEnabling->enabled());\n\n // but a config that has monitor = true, it is set\n $enabledAgent = $this->agentFromConfigArray([ConfigKey::MONITORING_ENABLED => 'true']);\n self::assertTrue($enabledAgent->enabled());\n }",
"public function getIsTest()\n {\n $value = $this->get(self::ISTEST);\n return $value === null ? (boolean)$value : $value;\n }",
"public function get_enabled() \n {\n return $this->enabled;\n }",
"public function testGetIntegrationTokenTestMode()\n {\n $this->helper\n ->expects($this->exactly(2))\n ->method('getConfigData')\n ->withConsecutive(\n [$this->equalTo('test_mode_enabled'), $this->equalTo(null)],\n [$this->equalTo('test_integration_token'), $this->equalTo(null)]\n )\n ->willReturnOnConsecutiveCalls(\n true,\n 'test_key'\n );\n\n $this\n ->helper\n ->getIntegrationToken();\n }",
"public function is_enabled() {\n $enabled = (bool) get_config('reportgen', 'DBdetails');\n return $enabled;\n }",
"public function isEnabled()\n {\n return $this->_getConfig(self::XML_CONFIG_ENABLED);\n }",
"public function getEnabled(): string\n {\n return $this->enabled;\n }",
"protected function setTestingMode()\n {\n if (defined('IS_INNER_TESTING')) {\n return;\n }\n\n if (ENVIRONMENT == ENVIRONMENT_DEV\n &&\n (\n !empty($_REQUEST[self::GET_PARAM_NAME_TESTING_MODE])\n || $this->checkIfCliIsTested()\n )\n ) {\n $this->isInnerTesting = true;\n }\n /** Indicates if the current run is an inner test. */\n define('IS_INNER_TESTING', $this->isInnerTesting);\n }",
"public static function enabled() {\r\n\t\treturn self::$enabled;\r\n\t}",
"protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }",
"public function isLogEnable() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE);\n }",
"public function testIsDebugMode()\n {\n $oControl = $this->getProxyClass(\"oxShopControl\");\n $oConfigFile = oxRegistry::get('oxConfigFile');\n\n $oConfigFile->iDebug = -1;\n $this->assertTrue($oControl->UNITisDebugMode());\n\n $oConfigFile->iDebug = 0;\n $this->assertFalse($oControl->UNITisDebugMode());\n }",
"public function getEnabled() : bool\n {\n return $this->enabled;\n }",
"public function getEnabled() : bool\n {\n return $this->enabled;\n }",
"public static function getEnvMode()\n {\n return (Configuration::get('PAYLINE_LIVE_MODE') == '1' ? PaylineSDK::ENV_PROD : PaylineSDK::ENV_HOMO);\n }",
"public function getDebugMode() : bool\n {\n return $this->debugMode;\n }",
"public function maybe_add_is_in_visible_test_mode_option() {\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11', '<' ) ) {\n return;\n }\n\n if ( get_option( 'laterpay_is_in_visible_test_mode' ) === false ) {\n add_option( 'laterpay_is_in_visible_test_mode', 0 );\n }\n }",
"protected function is_being_tested()\n {\n return $this->testing;\n }",
"public function isTesting() {}",
"protected function isConfigured()\n {\n $skip = Tools::getValue('skip');\n if ($skip) {\n Configuration::updateValue('DF_ENABLE_HASH', 0);\n Configuration::updateValue('DF_ENABLED_V9', true);\n }\n $sql = 'SELECT id_configuration FROM ' . _DB_PREFIX_ . 'configuration WHERE name = \\'DF_ENABLE_HASH\\'';\n\n return Db::getInstance()->getValue($sql);\n }",
"public static function testflag($test_flag) {\n $test_flag = strtoupper($test_flag);\n $test_flags = isset($_ENV['TEST_FLAGS'])\n ? array_map(\"strtoupper\",\n array_map(\"trim\",\n explode(\",\", $_ENV['TEST_FLAGS'])))\n : array();\n \n return in_array($test_flag, $test_flags) || in_array(\"ALL\", $test_flags);\n }",
"private function _allowTestRoutes()\n {\n // [taz] See if the main config file is already loaded, so we can tell whether to remove testing routes.\n $mainConfig = Zend_Registry::getInstance()->get('CONFIG');\n \n // [taz] If $mainConfig isn't set, disallow test routes by default.\n if (!$mainConfig) {\n \treturn false;\n }\n \n // [taz] Return the setting of debug.allow_test_routes.\n return $mainConfig->debug->allow_test_routes; \n }",
"public function GetBoolMode () {\n\t\treturn $this->boolMode;\n\t}",
"public function getEnabled()\n {\n return Mage::getStoreConfig('splitprice/split_price_config/enabled');\n }",
"public function getChangeValueTest(): bool\n {\n return $this->changeTest;\n }",
"public function getEnabled()\n {\n return isset($this->enabled) ? $this->enabled : false;\n }",
"public function getEnabled()\n {\n return isset($this->enabled) ? $this->enabled : false;\n }",
"public function is_enabled() {\n\n\t\t// Check if debug is on\n\t\tif ( 'on' === $this->settings->get_option( 'debug' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function getEnableStackdriverLogging()\n {\n return $this->enable_stackdriver_logging;\n }",
"public function instance_allow_config() {\n return true;\n }",
"public static function enabled(): bool\n {\n return static::$_enabled;\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }",
"function ini_get_bool($ini_get_arg) {\n\t$temp = ini_get($ini_get_arg);\n\n\tif ($temp == '1' or strtolower($temp) == 'on') {\n\t\treturn true;\n\t}\n\treturn false;\n}",
"function configEnabled() { global $db;\n global $lang;\n\n $dbtst = $db->query(\"SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '\".$lang[\"config_db_name\"].\"'\");\n if($dbtst->num_rows == 0) {\n $prepReturn = prepConfig();\n if ($prepReturn == \"Ready\"){\n return true;\n } else {\n return $prepReturn;\n }\n } else {\n return true;\n }\n }",
"public function getAlternateDebug()\n {\n $enabled = $this->getStoreValue(self::ALTERNATE_ENABLE);\n if (!$enabled) {\n return false;\n }\n\n return $this->getStoreValue(self::ALTERNATE_DEBUG);\n }",
"public function isTestModeEnabled($store = null) {\n return $this->getTestModeEnabledFlag($store) || !Mage::helper(\"klevu_search\")->isProductionDomain(Mage::app()->getStore($store)->getBaseUrl());\n }",
"public function reportingEnabled(): bool\n {\n return $this->config['reporting']['enabled'];\n }",
"public function setEnableAlwaysOnConfiguration($val)\n {\n $this->_propDict[\"enableAlwaysOnConfiguration\"] = boolval($val);\n return $this;\n }",
"public function getEnabled()\n {\n return $this->enabled;\n }",
"public function getEnabled()\n {\n return $this->enabled;\n }",
"public function getEnabled()\n {\n return $this->enabled;\n }",
"public function is_enabled()\n {\n }",
"public function getConfigCacheEnabled()\n {\n return $this->configCacheEnabled;\n }",
"public function getEnabled()\r\n {\r\n return $this->enabled;\r\n }",
"public function has_config() {\n return false;\n }",
"public function has_config() {\n return false;\n }",
"function getEnabled() {\n\t\treturn $this->getData('enabled');\n\t}",
"function devmode($test_mode=null)\n{\n\t$ci =& get_instance();\n $servers = $ci->config->item('servers');\n\n // To make testing more accurate, get rid of the http://, etc.\n $current_server = strtolower(trim(base_url(), ' /'));\n $current_server = str_replace('http://', '', $current_server);\n $current_server = str_replace('https://', '', $current_server);\n\n\n //$current_mode = array_search($current_server, $servers);\n \n $current_mode = '';\n \n // Because the server name could contain www. or subdomains,\n // we need to search each item to see if it contains the string.\n foreach ($servers as $name => $domain)\n {\n if (!empty($domain))\n { \n if (strpos($current_server, $domain) !== FALSE) {\n $current_mode = $name;\n break;\n }\n }\n }\n \n\n // Time to figure out what to return.\n if (empty($test_mode))\n {\n // Not performing a check, so just return the current value\n return $current_mode;\n } else\n {\n return $current_mode == $test_mode;\n }\n \n}",
"function instance_allow_config() {\n return true;\n }",
"public function getIsEnabled()\n {\n if (array_key_exists(\"isEnabled\", $this->_propDict)) {\n return $this->_propDict[\"isEnabled\"];\n } else {\n return null;\n }\n }",
"public function getIsEnabled()\n {\n if (array_key_exists(\"isEnabled\", $this->_propDict)) {\n return $this->_propDict[\"isEnabled\"];\n } else {\n return null;\n }\n }",
"public function getIsEnabled()\n {\n if (array_key_exists(\"isEnabled\", $this->_propDict)) {\n return $this->_propDict[\"isEnabled\"];\n } else {\n return null;\n }\n }",
"public function enable(): bool {}",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function instance_allow_config() {\n return false;\n }",
"public function environmentIsConfigured();",
"function has_config() {\n return true;\n }"
] | [
"0.74136305",
"0.7347719",
"0.7226287",
"0.7154691",
"0.7100731",
"0.6959062",
"0.6937216",
"0.67025185",
"0.6632899",
"0.6545286",
"0.64057964",
"0.640047",
"0.6398071",
"0.63970757",
"0.63376826",
"0.6332218",
"0.62560725",
"0.62505823",
"0.624481",
"0.6183823",
"0.6104949",
"0.61017185",
"0.6098994",
"0.60768783",
"0.60756546",
"0.6050406",
"0.60252523",
"0.6023342",
"0.6020571",
"0.5978622",
"0.5969588",
"0.59328556",
"0.5930976",
"0.5926376",
"0.5921622",
"0.5907382",
"0.59030575",
"0.5896728",
"0.58932817",
"0.5887722",
"0.5868672",
"0.5866591",
"0.58564085",
"0.58532536",
"0.5827133",
"0.5818315",
"0.5811657",
"0.58110595",
"0.5793852",
"0.5788616",
"0.57630634",
"0.5735016",
"0.57256526",
"0.5718468",
"0.57066053",
"0.56558025",
"0.56558025",
"0.5645476",
"0.5616522",
"0.56120104",
"0.56074256",
"0.5605012",
"0.558787",
"0.5585924",
"0.55832756",
"0.5573792",
"0.5572686",
"0.55646414",
"0.5549566",
"0.5549566",
"0.55476594",
"0.5546537",
"0.5536532",
"0.5535393",
"0.5532699",
"0.5502902",
"0.54994786",
"0.54977953",
"0.54973745",
"0.54973114",
"0.5492849",
"0.54891586",
"0.54891586",
"0.54891586",
"0.5482003",
"0.5481857",
"0.54775167",
"0.54753524",
"0.54753524",
"0.5474383",
"0.54551923",
"0.54458994",
"0.5445151",
"0.5445151",
"0.5445151",
"0.5444151",
"0.5443201",
"0.54316115",
"0.54298085",
"0.54296196"
] | 0.7602675 | 0 |
Check if Test Mode is enabled for the given store. | public function isTestModeEnabled($store = null) {
return $this->getTestModeEnabledFlag($store) || !Mage::helper("klevu_search")->isProductionDomain(Mage::app()->getStore($store)->getBaseUrl());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTestModeEnabledFlag($store = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);\n }",
"public function isTestmode()\n {\n return $this->getConfigDataFlag('test', $this->getStoreId());\n }",
"public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"public function isTestMode()\n {\n if (strpos($this->adyenMode, Environment::TEST) !== false) {\n return true;\n } else {\n return false;\n }\n }",
"function isTestMode($context) {\n\t\treturn ($this->getSetting($context->getId(), 'testMode') == 1);\n\t}",
"public function isTestMode(): bool;",
"public function isTestMode() :bool\n {\n $config = $this->getConfig();\n\n if ($this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {\n return true;\n }\n\n if ($config && property_exists($config, 'testMode') && $config->testMode) {\n return true;\n }\n\n return false;\n }",
"public function getTestMode(): bool\n {\n return $this->testMode;\n }",
"public function isTestMode()\n {\n return $this->isTestMode;\n }",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"public function isEnabled(int $storeId = null): bool;",
"public function isEnabled($store = null)\n {\n return (boolean) Mage::getStoreConfig(self::XML_PATH_ENABLED, $store);\n }",
"public function getIsTestMode()\n {\n return $this->isTestMode;\n }",
"public function isEnabled()\n {\n $storeCode = $this->storeManager->getStore()->getCode();\n return $this->scopeConfig->getValue(self::CONFIG_DATA_PATH, ScopeInterface::SCOPE_STORE, $storeCode) === '1';\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }",
"public function enabled($store = null);",
"public function isEnabled()\n\t{\n\t\treturn $this->scopeConfig->getValue(\n\t\t\t$this->getConfigPath(self::SYSTEM_CONFIG_PATH_ENABLED),\n\t\t\t\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n\t\t);\n\t}",
"public function isAvailable($storeId)\n {\n $active = $this->config->isModuleEnabled($storeId);\n if (!$active) {\n return false;\n }\n\n $apiKey = $this->getApiKey($storeId);\n if (empty($apiKey)) {\n return false;\n }\n\n return true;\n }",
"protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }",
"public function isEnabled($storeId=0){\n \tif($storeId==0)\n \t\t$storeId=Mage::app()->getStore()->getId();\n \treturn Mage::getStoreConfig('ced_csmultishipping/general/activation', $storeId);\n }",
"public function setTestModeEnabledFlag($flag, $store = null) {\n $flag = ($flag) ? 1 : 0;\n $this->setStoreConfig(static::XML_PATH_TEST_MODE, $flag, $store);\n return $this;\n }",
"public function isEnabled()\n {\n return $this->config->isEnabledSDK($this->_storeManager->getStore()->getId());\n }",
"public function isTest() : bool\n\t{\n\t\treturn $this->productionTest;\n\t}",
"public function klarnaPaymentEnabled($store = null)\n {\n return Mage::getStoreConfigFlag('payment/klarna_kco/active', $store);\n }",
"public function isTest() {\n\t\treturn $this->_options['test'];\n\t}",
"public function getTestMode()\n {\n return (bool) $this->data['test_ipn'];\n }",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag('training_layred/catalog/enabled');\n }",
"public function isExtensionEnabled($store_id = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_EXTENSION_ENABLED, $store_id);\n }",
"public function isAllowed($store = null)\n {\n return true;\n }",
"public function runningUnitTests()\n {\n return $this->environment() == 'testing';\n }",
"public function isEnabled()\n {\n return $this->getStoreConfig(self::MODULE_ENABLED);\n }",
"public function hasStore(): bool;",
"public function isEnabled()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ENABLED);\n }",
"public function isEnabled($storeId = null)\n {\n return $this->_scopeConfig->isSetFlag(\n self::XML_PATH_ENABLED,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }",
"public function isStoreActive() {\r\n\t\treturn $this->_storeManager->getStore()->isActive();\r\n\t}",
"public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function get_test_is_in_debug_mode()\n {\n }",
"public function canStoreEnabled();",
"public function is_enabled() {\n $enabled = (bool) get_config('reportgen', 'DBdetails');\n return $enabled;\n }",
"public function isProductMassActionEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_BETA_MASS_ACTION));\n }",
"public function isServiceEnabled($type, $store = null) {\n $configHelper = Mage::helper('oklibmagento/config');\n switch ($type) {\n case self::SERVICE_TYPE_OPEN:\n return boolval($configHelper->getOkOpenValue(\"enabled\", $store));\n break;\n case self::SERVICE_TYPE_CASH:\n return boolval($configHelper->getOkCashValue(\"enabled\", $store));\n break;\n default:\n return false;\n }\n }",
"public function isExtensionConfigured($store_id = null) {\n $js_api_key = $this->getJsApiKey($store_id);\n $rest_api_key = $this->getRestApiKey($store_id);\n\n return (\n $this->isExtensionEnabled($store_id)\n && !empty($js_api_key)\n && !empty($rest_api_key)\n );\n }",
"public function authorizedTest()\n {\n return $this->accepted && $this->test_mode;\n }",
"public function enabled()\n {\n return (bool) Mage::getStoreConfig('actions/settings/enabled');\n }",
"function checkPanelMode()\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->displayStatusPanel();\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->displayProcessPanel();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static function isEnabled()\n {\n $app_model = new waAppSettingsModel();\n $is_enabled = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID . '-profile');\n $profile_cookie = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID_SHORT . '-profile-cookie');\n $cookie_enabled = $profile_cookie && waRequest::cookie($profile_cookie, '');\n return $is_enabled && $cookie_enabled;\n }",
"public function hasIsTest()\n {\n return $this->IsTest !== null;\n }",
"protected function isAdminStore()\n {\n return $this->getValue(ColumnKeys::STORE_VIEW_CODE) === null;\n }",
"public function getIsEnabled()\n\t{\n\t\treturn Mage::getStoreConfig(self::XML_PATH_ENABLE);\n\t}",
"public function isConfiguredForThisStore()\n {\n return $this->getUsername() && $this->isEnabled();\n }",
"protected function getDebugMode(): bool\n {\n return (bool)getenv('STAIRTOWER_TEST_DEBUG_MODE');\n }",
"public function hasSuites(){\n return $this->_has(1);\n }",
"public function checkEnabled()\n {\n $app_id = $this->_application->id;\n return $this->app->zoocart->getConfig($app_id)->get('enable_cart');\n }",
"public function isAutoLoginEnabled()\n {\n return $this->scopeConfig->getValue(\n self::AUTO_LOGIN_ENABLE,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"function ts_check_if_control_panel()\r\n{\r\n\t$control_panel = ot_get_option('control_panel');\r\n\t\r\n\tif ($control_panel == 'enabled_admin' && current_user_can('manage_options') || $control_panel == 'enabled_all')\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"public function isTransactionalEmailEnabled($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_TRANSACTIONAL_EMAIL_ENABLED, $store);\n }",
"public function isThreatMetrixActive()\r\n {\r\n $enabled = Mage::getStoreConfig('payment/threat_metrix/active');\r\n return $enabled;\r\n }",
"public function isDemoShop()\n {\n if ($this->_blDemoShop == null) {\n $this->_blDemoShop = $this->getConfig()->isDemoShop();\n }\n\n return $this->_blDemoShop;\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_ACTIVE)\n && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE);\n }",
"public function _isEnable(){\n return true;\n if(!array_key_exists('enable', $this->moduleConfig)) return false;\n return $this->moduleConfig['enable'];\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_TRANSACTIONAL_API_ENABLED);\n }",
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public static function hasTestNow(): bool\n {\n return static::$testNow !== null;\n }",
"public static function isEnabled() {\n global $DB;\n $iterator = $DB->request([\n 'SELECT' => ['state'],\n 'FROM' => 'glpi_crontasks',\n 'WHERE' => [\n 'name' => 'telemetry',\n 'state' => 1\n ]\n\n ]);\n return count($iterator) > 0;\n }",
"public final function isDebugEnabled()\n {\n return getenv('TEST') === 'true';\n }",
"public function getEnabled($storeId = null)\n {\n if (!$this->generalHelper->getEnabled($storeId)) {\n return false;\n }\n\n return $this->generalHelper->getStoreValue(self::XPATH_ORDER_ENABLE, $storeId);\n }",
"public function is_test_environment() {\n\n if(empty($this->production_site_url))\n return true;\n else\n return get_site_url() === $this->production_site_url ? false : true;\n }",
"public function isStoreAdmin() {\n return $this->authorise('store.admin', 'store');\n }",
"public function supportsSuite(Suite $suite);",
"public function getStoreMode()\n {\n return $this->storeMode;\n }",
"public function isEnabledOnFront($storeId = null)\n {\n if ($this->isEnabled($storeId)) {\n return $this->_scopeConfig->isSetFlag(\n self::XML_PATH_ENABLED_ON_FRONT,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }\n\n return false;\n }",
"public function isGiftWrappingAvailableForOrder($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ORDER, $store);\n }",
"protected function isSingleStoreMode()\n {\n return Mage::app()->isSingleStoreMode();\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('refersion/refersion_settings/refersion_active');\n }",
"public function setTestMode()\n {\n $this->isTestMode = true;\n }",
"public function isMode($mode);",
"public function isPhoneMandatorySupport($store = null)\n {\n return $this->getVersionConfig($store)->isPhoneMandatorySupport();\n }",
"public function can_load_tota11y() {\n\n\t\t// If already defined, get out of here.\n\t\tif ( isset( $this->can_load_tools['tota11y'] ) ) {\n\t\t\treturn $this->can_load_tools['tota11y'];\n\t\t}\n\n\t\t// Get enabled tools.\n\t\t$enabled_tools = $this->get_enabled_tools();\n\n\t\t// If tota11y isn't enabled...\n\t\tif ( empty( $enabled_tools ) || ! in_array( 'tota11y', $enabled_tools ) ) {\n\t\t\treturn $this->can_load_tools['tota11y'] = false;\n\t\t}\n\n\t\t// Get tota11y settings.\n\t\t$settings = $this->get_settings( 'tota11y' );\n\n\t\t// By default, only load tota11y if the user is logged in.\n\t\t$load_tota11y = is_user_logged_in();\n\n\t\t// If we're still passing tests, are we supposed to load tota11y in the admin?\n\t\tif ( $load_tota11y && is_admin() ) {\n\t\t\t$load_tota11y = isset( $settings['load_in_admin'] ) && $settings['load_in_admin'] > 0;\n\t\t}\n\n\t\t// If we're still passing tests, keep checking.\n\t\tif ( $load_tota11y ) {\n\n\t\t\t// If a set user role, then load tota11y.\n\t\t\tif ( ! empty( $settings['load_user_roles'] ) ) {\n\t\t\t\t$load_tota11y = $this->is_user_in_user_roles( $settings['load_user_roles'] );\n\t\t\t}\n\n\t\t\t// If user capability is set, turn off if not capable.\n\t\t\tif ( ! empty( $settings['load_user_capability'] ) ) {\n\t\t\t\t$load_tota11y = current_user_can( $settings['load_user_capability'] );\n\t\t\t}\n\t\t}\n\n\t\t// Filter whether or not to load tota11y - passes the tota11y settings.\n\t\treturn $this->can_load_tools['tota11y'] = apply_filters( 'wa11y_load_tota11y', $load_tota11y, $settings );\n\t}",
"public function testIsDebugMode()\n {\n $oControl = $this->getProxyClass(\"oxShopControl\");\n $oConfigFile = oxRegistry::get('oxConfigFile');\n\n $oConfigFile->iDebug = -1;\n $this->assertTrue($oControl->UNITisDebugMode());\n\n $oConfigFile->iDebug = 0;\n $this->assertFalse($oControl->UNITisDebugMode());\n }",
"public static function isInTestingEnvironment()\n {\n return !in_array(env('APP_ENV'),['prod','production']);\n }",
"public function isFrontendTierEnabled()\n {\n return (boolean)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_TIER,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"function enableTestMode()\n {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://sandbox/url/yet/to/define';\n }",
"public function isSingleSuite(): bool\n {\n return $this->isSingle;\n }",
"public function isLogEnable() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE);\n }",
"public static function installerEnabled()\n {\n /** @var \\Nwidart\\Modules\\Module $installer */\n $installer = Module::find('installer');\n if (!$installer) {\n return false;\n }\n\n return $installer->isEnabled();\n }",
"public function is_enabled() {\n\n\t\t// Check if debug is on\n\t\tif ( 'on' === $this->settings->get_option( 'debug' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function hasProductSyncRun($store = null) {\n $config = Mage::getConfig();\n\n if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, \"store\", $store)) {\n return false;\n }\n\n return true;\n }",
"public function check() : bool\n\t{\n\t\tif (!$this->enabled) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->driver->check();\n\t}",
"public static function is_enable() {\n\t\treturn true;\n\t}",
"public function isUnitTests(): bool\n {\n return $this->env === 'testing';\n }",
"public function isExtentionEnable() {\n\t\treturn $this->_scopeConfig->getValue(Self::ENABLE, ScopeInterface::SCOPE_STORE);\n\t}",
"private function isEnabled()\n {\n return $this->getConfigBool('enable', false);\n }",
"public function isSellerReviewEnabled() {\n return $this->scopeConfig->getValue ( static::XML_SELLER_REVIEW, ScopeInterface::SCOPE_STORE );\n }",
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration setting to enable Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function isActive($storeId = null) {\n\t\treturn (bool)$this->getValue(self::KEY_ACTIVE, $storeId);\n\t}",
"public function testEnabled(): void\n {\n $agentWithoutEnabling = $this->agentFromConfigArray();\n self::assertFalse($agentWithoutEnabling->enabled());\n\n // but a config that has monitor = true, it is set\n $enabledAgent = $this->agentFromConfigArray([ConfigKey::MONITORING_ENABLED => 'true']);\n self::assertTrue($enabledAgent->enabled());\n }"
] | [
"0.80950695",
"0.7575858",
"0.7348273",
"0.70585555",
"0.67603743",
"0.67512584",
"0.6696677",
"0.66335917",
"0.65811926",
"0.65545684",
"0.64963686",
"0.6393847",
"0.63709384",
"0.6347967",
"0.6335858",
"0.6214475",
"0.6167899",
"0.61345035",
"0.6087093",
"0.6000051",
"0.59961194",
"0.59947306",
"0.5989709",
"0.59677076",
"0.5943923",
"0.59361404",
"0.59309113",
"0.5922001",
"0.58803546",
"0.58664805",
"0.58636516",
"0.58462614",
"0.58380413",
"0.58324814",
"0.5820191",
"0.581648",
"0.5783955",
"0.57596815",
"0.5748073",
"0.5738297",
"0.57356966",
"0.57189447",
"0.57087505",
"0.56695807",
"0.56677395",
"0.5662669",
"0.5639257",
"0.5630134",
"0.56199",
"0.56198746",
"0.55842924",
"0.5584078",
"0.5549447",
"0.5536416",
"0.55129105",
"0.5495504",
"0.5488313",
"0.5488313",
"0.5481143",
"0.5474453",
"0.5469668",
"0.54607934",
"0.5445885",
"0.5416987",
"0.5414068",
"0.5410226",
"0.5409512",
"0.5398766",
"0.53943205",
"0.5393995",
"0.5390566",
"0.53883773",
"0.5387465",
"0.5386263",
"0.5380488",
"0.53800094",
"0.5374771",
"0.5370455",
"0.5367134",
"0.53257483",
"0.5312897",
"0.53118664",
"0.5304505",
"0.529267",
"0.529112",
"0.528242",
"0.5275371",
"0.5272591",
"0.52667207",
"0.52632165",
"0.52608454",
"0.52564996",
"0.5254091",
"0.52523565",
"0.5252266",
"0.5252113",
"0.52482265",
"0.52482146",
"0.5243293",
"0.5237729"
] | 0.8129329 | 0 |
Set the JS API key in System Configuration for the given store. | public function setJsApiKey($key, $store = null, $test_mode = false) {
$path = ($test_mode) ? static::XML_PATH_TEST_JS_API_KEY : static::XML_PATH_JS_API_KEY;
$this->setStoreConfig($path, $key, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getJsApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_JS_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_JS_API_KEY, $store);\n }\n }",
"public function setStoreId($store);",
"private function setMerchantKey()\n {\n $this->key = config('gladepay.key');\n }",
"public function getRestApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);\n }\n }",
"function set_api_key($api_key)\n\t{\n\t\t$this->api_key = $api_key;\n\t}",
"public function setApikey()\n {\n $this->apiKey = Config::get('leanpub.API_KEY');\n }",
"public function getAPIKey()\n {\n return (string)Mage::getStoreConfig(self::CONFIG_API_KEY);\n }",
"public function setStoreId($storeId);",
"public function setStoreId($storeId);",
"private function set_key($sApiKey) {\r\n $this->key = $sApiKey;\r\n }",
"public function getApiKey()\n {\n return Mage::getStoreConfig('magebridge/settings/api_key');\n }",
"public function setApiKey($api)\n {\n $this->api_key = $api;\n }",
"private function set_key($sApiKey) {\n $this->key = $sApiKey;\n }",
"public function setAppKey($key)\n\t{\n\t\tif (empty($key)) {\n\t\t\trequire_once 'Syx/Platform/Exception.php';\n\t\t\tthrow new Syx_Platform_Exception(\"empty for appKey\");\n\t\t}\n\t\t$this->_appKey = (string)$key;\n\t}",
"public function getApiKey($storeId)\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_APIKEY,\n ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }",
"public static function setRandomApiKey()\n {\n if (!empty(self::getSetting('API_KEY'))) {\n return;\n }\n\n $randomKey = bin2hex(openssl_random_pseudo_bytes(16));\n\n Registry::getConfig()->saveShopConfVar('str', 'AVSHOPGUARDIANS_API_KEY', $randomKey, null, 'module:AvShopguardians');\n }",
"public function setAPIKey($key){\r\n\t\t$this->apiKey = $key;\r\n\t}",
"private function getApiKey()\n\t{\n\t\treturn Mage::helper('core')->decrypt(Mage::getStoreConfig('whitePages_configuration/options/api_key'));\n\t}",
"public function save_api( $api = null ) {\n\t\tif ( isset( $api ) ) {\n\t\t\t$this->api = $api;\n\t\t}\n\t\tupdate_option( self::API_KEY, $this->api );\n\t}",
"public function set_api_key($api_key)\n {\n $this->api_key = $api_key;\n }",
"public function setRestApiKey($key, $store = null, $test_mode = false) {\n $path = ($test_mode) ? static::XML_PATH_TEST_REST_API_KEY : static::XML_PATH_REST_API_KEY;\n $this->setStoreConfig($path, $key, $store);\n return $this;\n }",
"public function setStore( $id ) {\r\n\t\t$this->_storeId = $id;\r\n\t\t\r\n\t\t$this->initializeApi( true );\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"abstract function setStore(string $storeKey, int $time = null);",
"private function setApikey($apikey) {\n\t\t$this->_apikey = (string) $apikey;\n\t}",
"protected function setKey()\n {\n $paymentGateway = \\App\\Models\\PaymentGateway::where('name', 'paystack')->first();\n $this->secretKey = $paymentGateway['information']['private_key'];\n $this->publicKey = $paymentGateway['information']['public_key'];\n }",
"function setApiKey($key){\n $this->key = $key;\n }",
"function placester_get_api_key() { return PL_Option_Helper::api_key(); }",
"function key(){\n\t\t$api_key = '42b85431eba6a84d17266021e817d2a6';\n\t\treturn $api_key;\n\t}",
"function it_gets_and_sets_the_key()\n {\n $this->getKey()->shouldReturn('apikey');\n\n // Set the api key\n $this->setKey('keyapi');\n\n // Get the current key\n $this->getKey()->shouldReturn('keyapi');\n }",
"protected function setJsApi() {\n if($this->option('jsapi')) {\n $this->parameter('enablejsapi=1');\n }\n }",
"public function setStoreId($id);",
"public function setStoreId($id)\n {\n $this->store_id = $id;\n }",
"function setFrontStore($params) {\n\n\n $requestParam = explode('/', $this->params->url);\n $store_name = trim($requestParam[0]); // Name of the store which we will change later with Saas\n $sid = $this->Session->read('store_id');\n $urlParts = parse_url($store_name);\n if (!empty($urlParts['host'])) {\n $store_name = preg_replace('/^www\\./', '', $urlParts['host']);\n }\n $Storeuserid = $this->Session->read('Auth.User.id');\n if ($store_name) {\n $this->loadModel('Store');\n $store_result = $this->Store->store_info($store_name);\n if ($store_result) {\n $storeName = $store_result['Store']['store_name'];\n $store_url = $store_result['Store']['store_url'];\n $store_phone = $store_result['Store']['phone'];\n if (isset($store_result['Store']['service_fee'])) {\n $this->Session->write('service_fee', $store_result['Store']['service_fee']);\n }\n// if (isset($store_result['Store']['delivery_fee'])) {\n// $this->Session->write('delivery_fee', $store_result['Store']['delivery_fee']);\n// }\n $this->Session->write('minprice', $store_result['Store']['minimum_order_price']);\n $this->Session->write('storeName', $storeName);\n $this->Session->write('store_url', $store_url);\n $this->Session->write('store_phone', $store_phone);\n $this->Session->write('store_id', $store_result['Store']['id']);\n $this->Session->write('merchant_id', $store_result['Store']['merchant_id']);\n $this->Cookie->write('storecookiename', $store_url);\n $this->Session->write('front_time_zone_id', $store_result['Store']['time_zone_id']);\n } else {\n $this->redirect(array('controller' => 'users', 'action' => 'selectStore'));\n }\n }\n }",
"function api_key() {\n\tif(check_value(chevereto_config('api_key'))) return chevereto_config('api_key');\n}",
"public abstract function setConfig($key, $value);",
"function get_api_key()\n{\n return get_global_value('api-key');\n}",
"public function setStoreName($storeName);",
"public function registerAPIKey()\n {\n acf_update_setting('google_api_key', $this->apiKey);\n }",
"public function install() {\n\t\t$api_key = String::generate_key();\n\t\t$get_existing_key = get_option( $this->api_key_option_name );\n\t\tif ( false == $get_existing_key ) {\n\t\t\tupdate_option( $this->api_key_option_name, $api_key );\n\t\t}\n\t}",
"public function SetKey($key = ''){\n \tself::$userKey = $key;\n }",
"public function setConfig($key, $value);",
"public function uploadConfig($store)\n {\n parent::uploadConfig($store);\n\n $this->extend('updateConfig', $store);\n }",
"private function setStore(Store $store) {\n $this->store = $store;\n }",
"public function setStoreId($storeId){\n return $this->setData(self::STORE_ID, $storeId);\n }",
"public function setKey($apiKey)\n {\n $this->key = $apiKey;\n }",
"public function setApiKey(string $api_key): void\n {\n $this->api_key = $api_key;\n }",
"function __construct($api_key)\n {\n \\Tinify\\setKey($api_key);\n }",
"public function getDeveloperKey();",
"public function setStoreId($storeId)\n {\n return $this->setData('store_id', $storeId);\n }",
"public function setSecretKey($key);",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }"
] | [
"0.68459",
"0.6038925",
"0.5920227",
"0.5899742",
"0.58098763",
"0.57767445",
"0.5717741",
"0.56669",
"0.56669",
"0.5659631",
"0.56486773",
"0.55964184",
"0.55896425",
"0.55011034",
"0.54949635",
"0.5449839",
"0.5437471",
"0.54229325",
"0.54213333",
"0.5408198",
"0.53559107",
"0.5340397",
"0.5326566",
"0.5314358",
"0.52894866",
"0.5278993",
"0.525764",
"0.5245488",
"0.523541",
"0.5234442",
"0.5195815",
"0.51863897",
"0.51832616",
"0.51778287",
"0.51741844",
"0.5170386",
"0.51692474",
"0.5165957",
"0.51540726",
"0.5148487",
"0.51237595",
"0.511501",
"0.51067793",
"0.50946665",
"0.50890166",
"0.50656235",
"0.50648785",
"0.50596267",
"0.5055824",
"0.5054265",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366",
"0.50489366"
] | 0.62714857 | 1 |
Return the JS API key configured for the specified store. | public function getJsApiKey($store = null) {
if ($this->isTestModeEnabled($store)) {
return Mage::getStoreConfig(static::XML_PATH_TEST_JS_API_KEY, $store);
} else {
return Mage::getStoreConfig(static::XML_PATH_JS_API_KEY, $store);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRestApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);\n }\n }",
"public function getAPIKey()\n {\n return (string)Mage::getStoreConfig(self::CONFIG_API_KEY);\n }",
"public function getApiKey($storeId)\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_APIKEY,\n ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }",
"public function getApiKey()\n {\n return Mage::getStoreConfig('magebridge/settings/api_key');\n }",
"function key(){\n\t\t$api_key = '42b85431eba6a84d17266021e817d2a6';\n\t\treturn $api_key;\n\t}",
"private function getApiKey()\n\t{\n\t\treturn Mage::helper('core')->decrypt(Mage::getStoreConfig('whitePages_configuration/options/api_key'));\n\t}",
"public function getAppKey(): string;",
"public function getApplicationKey(){\n\n $store = Mage::app()->getStore();\n\n $accessKey = $this->getStoreAccessKey($store->getId());\n return $accessKey;\n }",
"public function getStoreId();",
"public function getStoreId();",
"public function getStoreId();",
"public function get_api_key() {\n\t\tif ( ! $this->is_api_key_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_api_key', '' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_API_KEY, 'ALGOLIA_API_KEY' );\n\n\t\treturn ALGOLIA_API_KEY;\n\t}",
"public function getDeveloperKey();",
"function get_api_key()\n{\n return get_global_value('api-key');\n}",
"public function get_api_key()\n {\n if ( ! isset($this->api_key) ) return 'No API Key is set.';\n return $this->api_key;\n }",
"private function getClientKey()\n {\n if ($this->isTestMode()) {\n $clientKey = \\Configuration::get('ADYEN_CLIENTKEY_TEST');\n } else {\n $clientKey = \\Configuration::get('ADYEN_CLIENTKEY_LIVE');\n }\n\n return $clientKey;\n }",
"public function getAppKey();",
"public function get_api_key(){\n\t\t$apikey = array_key_exists( 'apikey', $this->bvars) ? $this->bvars['apikey'] : false;\n\t\tif (!$apikey) {\t\t\t\n\t\t\t$this->get_errors()->add( new \\gcalc\\error( 10100 ) );\n\t\t\treturn 'anonymous';\n\t\t}\n\t\treturn $apikey;\n\t}",
"function placester_get_api_key() { return PL_Option_Helper::api_key(); }",
"public function getShopKey()\n {\n return $this->getParameter('shop_key');\n }",
"public function getConfigKey(): string;",
"function api_key() {\n\tif(check_value(chevereto_config('api_key'))) return chevereto_config('api_key');\n}",
"public function getAPIKey()\n\t{\n\t\treturn $this->getGMapClient()->getAPIKey();\n\t}",
"public function getApiKey()\n {\n $cfg = $this->di->get(\"configuration\");\n $config = $cfg->load(\"apikeys.php\");\n return $config[\"config\"][\"darksky\"];\n }",
"public function getShopKey()\n {\n return $this->getParameter('shopKey');\n }",
"public function getStoreId(){\n return $this->_getData(self::STORE_ID);\n }",
"public function getOauthToken($storeId = null)\n {\n return Mage::getStoreConfig(Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_OAUTH_ACCESS_TOKEN, $storeId);\n }",
"private function getKey()\n {\n if (!empty($this->options['api-key'])) {\n return $this->options['api-key'];\n }\n if (!empty(getenv('EWWW_API_KEY'))) {\n return getenv('EWWW_API_KEY');\n }\n return false;\n }",
"public function getStoreId()\n {\n return $this->getRequest()->getParam('store_id');\n }",
"public function setJsApiKey($key, $store = null, $test_mode = false) {\n $path = ($test_mode) ? static::XML_PATH_TEST_JS_API_KEY : static::XML_PATH_JS_API_KEY;\n $this->setStoreConfig($path, $key, $store);\n return $this;\n }",
"abstract function getStore(string $storeKey);",
"public function get_search_api_key() {\n\t\tif ( ! $this->is_search_api_key_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_search_api_key', '' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_SEARCH_API_KEY, 'ALGOLIA_SEARCH_API_KEY' );\n\n\t\treturn ALGOLIA_SEARCH_API_KEY;\n\t}",
"public static function getApiKey()\n {\n if (static::$key) {\n return static::$key;\n }\n\n if ($key = getenv('FIRST_PROMOTER_KEY')) {\n return $key;\n }\n\n return config('services.first_promoter.key');\n }",
"public function getInitCode(): string\n {\n return $this->config->getSDKInitCode($this->_storeManager->getStore()->getId());\n }",
"public function get_app_key() {\n\n\t\t// Get plugin settings.\n\t\t$settings = $this->get_plugin_settings();\n\n\t\treturn rgar( $settings, 'customAppKey' ) ? rgar( $settings, 'customAppKey' ) : null;\n\n\t}",
"public function getApiKey(): string;",
"public function getApiKey()\n {\n return $this->getParameter('appid');\n }",
"public function getAPIKey()\n\t{\n\t\treturn $this->api_key;\n\t}",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getApiKey()\n {\n return $this->getGeneralSetting('ApiKey');\n }",
"private function getMerchantKey()\n\t{\n\t\t$sandbox = $this->params->get('sandbox',0);\n\t\tif($sandbox) {\n\t\t\treturn $this->params->get('sandbox_merchant_key','');\n\t\t} else {\n\t\t\treturn $this->params->get('merchant_key','');\n\t\t}\n\t}",
"public function getApiKey()\n {\n return $this->settings->get('google.maps.api_key');\n }",
"public function getKey() {\n\t\tif (!empty($this->api_key)) {\n\t\t\treturn $this->api_key;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function getSignSecretKey() : string;",
"protected function _getSecretKey()\n {\n return Mage::getStoreConfig('payment/oggetto/secret_key');\n }",
"private function _getStoreId() {\n $store_id = 1;\n return $store_id;\n }",
"public function getSharedKey(): string;",
"protected static function key()\n {\n return env('APP_KEY');\n }",
"function showspace_api_key() {\n $options = get_option('showspace_options');\n return $options['showspace_api_key'];\n}",
"public function getStoreId()\n {\n return $this->_storeId;\n }",
"public function getKey()\n\t{\n\t\tif (defined('AKEEBA_SERVERKEY'))\n\t\t{\n\t\t\treturn base64_decode(AKEEBA_SERVERKEY);\n\t\t}\n\n\t\t$filename = dirname(__FILE__) . '/../' . $this->keyFilename;\n\n\t\tif (file_exists($filename))\n\t\t{\n\t\t\tinclude_once $filename;\n\t\t}\n\n\t\tif (defined('AKEEBA_SERVERKEY'))\n\t\t{\n\t\t\treturn base64_decode(AKEEBA_SERVERKEY);\n\t\t}\n\n\t\treturn '';\n\t}",
"public static function secret_key()\n {\n if(Director::isDev()) {\n if (defined(\"STRIPE_TEST_SK\")) {\n return STRIPE_TEST_SK;\n } else {\n return self::config()->test_secret_key;\n }\n } else {\n if (defined(\"STRIPE_LIVE_SK\")) {\n return STRIPE_LIVE_SK;\n } else {\n return self::config()->live_secret_key;\n }\n }\n }",
"private function getApiKey()\n {\n if ($this->options['api-version'] == 0) {\n if (!empty($this->options['secret'])) {\n return $this->options['secret'];\n }\n } elseif ($this->options['api-version'] >= 1) {\n if (!empty($this->options['api-key'])) {\n return $this->options['api-key'];\n }\n }\n if (!empty(getenv('WPC_API_KEY'))) {\n return getenv('WPC_API_KEY');\n }\n return '';\n }",
"public function getApiKey(): string\n {\n return $this->apiKey;\n }",
"public function apiKey(): string;",
"public static function publish_key()\n {\n if(Director::isDev()) {\n if (defined(\"STRIPE_TEST_PK\")) {\n return STRIPE_TEST_PK;\n } else {\n return self::config()->test_publish_key;\n }\n } else {\n if (defined(\"STRIPE_LIVE_PK\")) {\n return STRIPE_LIVE_PK;\n } else {\n return self::config()->live_publish_key;\n }\n }\n }",
"public function getConfigKey()\n {\n return Extension::SERVICE_NAME;\n }",
"protected function getApiKey()\n {\n return $this->config['api_key'];\n }",
"protected function getAuthorizationKey()\n {\n $storeId = Mage::app()->getStore()->getId();\n return $this->getMasterpassConfig()->getAuthorizationkey($storeId);\n }",
"public function storeKey()\n {\n return $this->repository->get($this->repoOptionString($this->sessionKey));\n }",
"public function getPublicMasterKey();",
"public function getApiKey()\n {\n return $this->config['api_key'];\n }",
"public function getApiKey () {\n syslog( LOG_INFO, 'Get an api key \\n' );\n\n $url = '/api_key';\n\n return $this->runRequest($url, 'GET', null);\n }",
"function get_user_api_key() {\n $currentUser = current_user();\n if ($currentUser) {\n $db = get_db();\n $res = $db->getTable('Key')->findBy(array('user_id' => $currentUser->id));\n if (sizeof($res) > 0) {\n return $res[0]->key;\n }\n }\n}",
"public function getSecretKey()\n {\n return Mage::getStoreConfig(self::RECAPTCHA_SECRET_KEY);\n }",
"protected function getStoreID() {\n\t\treturn $this->store_id;\n\t}",
"public function getSslKey()\n {\n return $this->getParameter('sslKey');\n }",
"public function get_sendgrid_api_key() {\n\t\t$query = $this->db\n\t\t\t->select(\"variable, value\")\n\t\t\t->where('variable', 'sendgrid_api_key')\n\t\t\t->get('settings');\n\t\tif ($query->num_rows() === 1) {\n\t\t\t$res = $query->row();\n\t\t\treturn $res->value ? $res->value : $res->default_value;\n\t\t}\n\t\treturn NULL;\n\t}",
"public function getApiKey()\n {\n switch ($this->getApiMode()) {\n case Carrier::MODE_PRODUCTION:\n return $this->scopeConfig->getValue(self::XML_PATH_PRODUCTION_API_KEY, ScopeInterface::SCOPE_WEBSITES);\n default:\n return $this->scopeConfig->getValue(self::XML_PATH_TESTING_API_KEY, ScopeInterface::SCOPE_WEBSITES);\n\n }\n }",
"function get_key() {\n\t\t// get_cert() also fetches key\n\t\tif (!isset($_SESSION['user_key']))\n\t\t\t$this->get_cert();\n\t\treturn $_SESSION['user_key'];\n\t}",
"public function getStoreId()\n {\n $storeId = $this->_getData('store_id');\n if (is_null($storeId)) {\n $storeId = Mage::app()->getStore()->getId();\n }\n return $storeId;\n }",
"public function getTempstoreKey();",
"public function getSiteKey()\n {\n return Mage::getStoreConfig(self::RECAPTCHA_SITE_KEY);\n }",
"private function _getCurrentStoreId()\n {\n $storeName = Mage::app()->getRequest()->getParam('store');\n\n if (!$storeName) {\n $website = Mage::app()->getRequest()->getParam('website');\n return $this->_getHelper()->getStoreIdByWebsite($website);\n }\n return $this->_getHelper()->getStoreIdByStoreCode($storeName);\n }",
"public function getStoreId()\n\t{\n\t\treturn $this->_storeId;\n\t}",
"public function getAppKey()\n {\n return $this->_appKey;\n }",
"private function getApikey() {\n\t\treturn $this->_apikey;\n\t}",
"public function getSecretKey();",
"public function getApiKey()\n {\n return $this->getParameter('apiKey');\n }",
"public function getApiKey()\n {\n return $this->getParameter('apiKey');\n }",
"function tsuiseki_tracking_get_key() {\n $key = TSUISEKI_TRACKER_KEY;\n if (empty($key)) {\n $key = (string)trim(get_option('tsuiseki_tracking_key'));\n }\n return $key;\n}",
"public static function get_store($store_name = 'default')\n {\n }",
"public function getStoreId(): int\n {\n return (int)$this->options['store_id'];\n }",
"protected function getStoreId()\n {\n return Mage::app()->getStore(true)->getId();\n }",
"public function getStoreId() {\r\n return Mage::app()->getStore()->getId();\r\n }",
"protected function key()\n {\n return \"CLIENT_SECRET\";\n }",
"public function getStoreId()\n {\n return $this->getStore()->getId();\n }",
"public function getIdStoreName(): string\n {\n return 'Google Sheets';\n }",
"public function public_api_key()\n {\n $paypal = $this->CI->Payment_model->getPaypalGateway();\n return $paypal->pg_api_public_key;\n }",
"public function getStoreName();",
"public function getExtkey() {}",
"public function getAppKey()\n\t{\n\t\treturn $this->_appKey;\n\t}",
"private function getEncryptedAPIKey()\n {\n if ($this->isTestMode()) {\n $encryptedApiKey = \\Configuration::get('ADYEN_APIKEY_TEST');\n } else {\n $encryptedApiKey = \\Configuration::get('ADYEN_APIKEY_LIVE');\n }\n\n return $encryptedApiKey;\n }",
"public function getAuthKey()\n {}",
"private function get_key() {\n\t\t$key = get_option( 'github_oembed_key' );\n\t\tif ( ! $key ) {\n\t\t\t$key = md5( time() . rand( 0, 65535 ) );\n\t\t\tadd_option( 'github_oembed_key', $key, '', 'yes' );\n\t\t}\n\t\treturn $key;\n\t}",
"public function getStoreName(): string\n {\n return $this->storeName;\n }",
"public function getStoreId(){\n $this->getStore()->getId();\n }"
] | [
"0.7231489",
"0.69567627",
"0.6930649",
"0.65350497",
"0.6399003",
"0.6314857",
"0.62804186",
"0.6250112",
"0.61807114",
"0.61807114",
"0.61807114",
"0.61656886",
"0.6140492",
"0.61160046",
"0.6094938",
"0.6029686",
"0.6009566",
"0.60093814",
"0.59522015",
"0.59414035",
"0.59160775",
"0.5908757",
"0.59022635",
"0.58967817",
"0.58818376",
"0.5880074",
"0.58746487",
"0.5872877",
"0.58510375",
"0.5844119",
"0.58405787",
"0.58293366",
"0.57594657",
"0.5750873",
"0.574903",
"0.57467276",
"0.5723114",
"0.57227796",
"0.5721334",
"0.5721334",
"0.5721334",
"0.5721334",
"0.5697212",
"0.56909883",
"0.5684303",
"0.5681879",
"0.56732374",
"0.565747",
"0.5644201",
"0.5643404",
"0.5632334",
"0.56314695",
"0.5623166",
"0.5616174",
"0.56095177",
"0.5607531",
"0.5606733",
"0.5601973",
"0.5596202",
"0.5591901",
"0.5583582",
"0.5578171",
"0.5568847",
"0.5559081",
"0.5556032",
"0.55508804",
"0.55469555",
"0.55397946",
"0.5533182",
"0.5523472",
"0.55046594",
"0.5487201",
"0.54812324",
"0.54802084",
"0.54771775",
"0.5476317",
"0.54727525",
"0.54574525",
"0.5454567",
"0.5449052",
"0.5439174",
"0.5436538",
"0.5436538",
"0.5431221",
"0.5427761",
"0.54089504",
"0.5404132",
"0.5388326",
"0.53808796",
"0.5375863",
"0.5356153",
"0.53551376",
"0.5353363",
"0.53512466",
"0.5349229",
"0.53476274",
"0.5346825",
"0.53448254",
"0.53362477",
"0.5331284"
] | 0.85303515 | 0 |
Set the REST API key in System Configuration for the given store. | public function setRestApiKey($key, $store = null, $test_mode = false) {
$path = ($test_mode) ? static::XML_PATH_TEST_REST_API_KEY : static::XML_PATH_REST_API_KEY;
$this->setStoreConfig($path, $key, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRestApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);\n }\n }",
"public function setApikey()\n {\n $this->apiKey = Config::get('leanpub.API_KEY');\n }",
"public function setStoreId($store);",
"function set_api_key($api_key)\n\t{\n\t\t$this->api_key = $api_key;\n\t}",
"public function setApiKey($api)\n {\n $this->api_key = $api;\n }",
"public function getAPIKey()\n {\n return (string)Mage::getStoreConfig(self::CONFIG_API_KEY);\n }",
"public function setAPIKey($key){\r\n\t\t$this->apiKey = $key;\r\n\t}",
"public function getJsApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_JS_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_JS_API_KEY, $store);\n }\n }",
"private function setMerchantKey()\n {\n $this->key = config('gladepay.key');\n }",
"private function set_key($sApiKey) {\r\n $this->key = $sApiKey;\r\n }",
"public function save_api( $api = null ) {\n\t\tif ( isset( $api ) ) {\n\t\t\t$this->api = $api;\n\t\t}\n\t\tupdate_option( self::API_KEY, $this->api );\n\t}",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }",
"public function getApiKey()\n {\n return Mage::getStoreConfig('magebridge/settings/api_key');\n }",
"public abstract function setConfig($key, $value);",
"private function set_key($sApiKey) {\n $this->key = $sApiKey;\n }",
"public function set_api_key($api_key)\n {\n $this->api_key = $api_key;\n }",
"function setApiKey($key){\n $this->key = $key;\n }",
"public function setStoreId($storeId);",
"public function setStoreId($storeId);",
"private function setApikey($apikey) {\n\t\t$this->_apikey = (string) $apikey;\n\t}",
"function it_gets_and_sets_the_key()\n {\n $this->getKey()->shouldReturn('apikey');\n\n // Set the api key\n $this->setKey('keyapi');\n\n // Get the current key\n $this->getKey()->shouldReturn('keyapi');\n }",
"public function setStore( $id ) {\r\n\t\t$this->_storeId = $id;\r\n\t\t\r\n\t\t$this->initializeApi( true );\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"public function setConfig($key, $value);",
"public function getApiKey($storeId)\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_APIKEY,\n ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }",
"private function getApiKey()\n\t{\n\t\treturn Mage::helper('core')->decrypt(Mage::getStoreConfig('whitePages_configuration/options/api_key'));\n\t}",
"public function setAppKey($key)\n\t{\n\t\tif (empty($key)) {\n\t\t\trequire_once 'Syx/Platform/Exception.php';\n\t\t\tthrow new Syx_Platform_Exception(\"empty for appKey\");\n\t\t}\n\t\t$this->_appKey = (string)$key;\n\t}",
"public static function setRandomApiKey()\n {\n if (!empty(self::getSetting('API_KEY'))) {\n return;\n }\n\n $randomKey = bin2hex(openssl_random_pseudo_bytes(16));\n\n Registry::getConfig()->saveShopConfVar('str', 'AVSHOPGUARDIANS_API_KEY', $randomKey, null, 'module:AvShopguardians');\n }",
"public function setApiKey($apiKey){\n\t\t$this->apiKey = $apiKey;\n\t}",
"public function registerAPIKey()\n {\n acf_update_setting('google_api_key', $this->apiKey);\n }",
"public function setApiKey(string $api_key): void\n {\n $this->api_key = $api_key;\n }",
"public function uploadConfig($store)\n {\n parent::uploadConfig($store);\n\n $this->extend('updateConfig', $store);\n }",
"function setBackStore() {\n $requestParam = explode('/', $this->params->url);\n $store_name = trim($requestParam[0]); // Name of the store which we will change later with Saas\n $StoreAdminid = $this->Session->read('Auth.Admin.id');\n if ($store_name && !$StoreAdminid) {\n $this->loadModel('Store');\n $store_result = $this->Store->store_info($store_name);\n if ($store_result) {\n $storeName = $store_result['Store']['store_name'];\n $this->Session->write('admin_domainname', $store_name);\n $this->Session->write('admin_storeName', $storeName);\n $this->Session->write('admin_store_id', $store_result['Store']['id']);\n $this->Session->write('admin_merchant_id', $store_result['Store']['merchant_id']);\n } else {\n $this->redirect(array('controller' => 'users', 'action' => 'selectStore'));\n }\n }\n }",
"public function setJsApiKey($key, $store = null, $test_mode = false) {\n $path = ($test_mode) ? static::XML_PATH_TEST_JS_API_KEY : static::XML_PATH_JS_API_KEY;\n $this->setStoreConfig($path, $key, $store);\n return $this;\n }",
"public function setApiKey($apiKey){\n $this->apiKey=$apiKey;\n }",
"public function setApiKey(string $apiKey): void\n {\n $this->apiKey = strval($apiKey);\n }",
"function setFrontStore($params) {\n\n\n $requestParam = explode('/', $this->params->url);\n $store_name = trim($requestParam[0]); // Name of the store which we will change later with Saas\n $sid = $this->Session->read('store_id');\n $urlParts = parse_url($store_name);\n if (!empty($urlParts['host'])) {\n $store_name = preg_replace('/^www\\./', '', $urlParts['host']);\n }\n $Storeuserid = $this->Session->read('Auth.User.id');\n if ($store_name) {\n $this->loadModel('Store');\n $store_result = $this->Store->store_info($store_name);\n if ($store_result) {\n $storeName = $store_result['Store']['store_name'];\n $store_url = $store_result['Store']['store_url'];\n $store_phone = $store_result['Store']['phone'];\n if (isset($store_result['Store']['service_fee'])) {\n $this->Session->write('service_fee', $store_result['Store']['service_fee']);\n }\n// if (isset($store_result['Store']['delivery_fee'])) {\n// $this->Session->write('delivery_fee', $store_result['Store']['delivery_fee']);\n// }\n $this->Session->write('minprice', $store_result['Store']['minimum_order_price']);\n $this->Session->write('storeName', $storeName);\n $this->Session->write('store_url', $store_url);\n $this->Session->write('store_phone', $store_phone);\n $this->Session->write('store_id', $store_result['Store']['id']);\n $this->Session->write('merchant_id', $store_result['Store']['merchant_id']);\n $this->Cookie->write('storecookiename', $store_url);\n $this->Session->write('front_time_zone_id', $store_result['Store']['time_zone_id']);\n } else {\n $this->redirect(array('controller' => 'users', 'action' => 'selectStore'));\n }\n }\n }",
"public function setApiKey($apiKey);",
"public function setApiKey($apiKey);",
"private function setApiKey( $apiKey ) {\n\n $this->apiKey = $apiKey;\n }",
"public function setApiKey($api_key)\n {\n $this->api_key = $api_key;\n }",
"public function setRegistry()\n {\n $reg = controllers\\Registry::getInstance();\n foreach ($this->config as $key => $value)\n {\n $reg->setResource($key, $value, true);\n }\n\n\n }",
"abstract function setStore(string $storeKey, int $time = null);",
"public static function setApi($api)\n {\n static::$apis[static::$api] = $api;\n }",
"function api_key() {\n\tif(check_value(chevereto_config('api_key'))) return chevereto_config('api_key');\n}",
"public function setAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }",
"public function setKey($apiKey)\n {\n $this->key = $apiKey;\n }",
"public function setApiKey($apiKey) {\n\t\t$this->apiKey = $apiKey;\n\t}"
] | [
"0.65908056",
"0.58959967",
"0.58610886",
"0.5819145",
"0.56996083",
"0.56772137",
"0.56292623",
"0.5578141",
"0.55113965",
"0.5499459",
"0.5485894",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54513323",
"0.54452634",
"0.5436401",
"0.54333",
"0.5385744",
"0.5377588",
"0.5377588",
"0.53743035",
"0.53577125",
"0.53487027",
"0.5316949",
"0.5271371",
"0.5252058",
"0.52260554",
"0.5215065",
"0.5208982",
"0.5194832",
"0.5183721",
"0.51680255",
"0.51679945",
"0.51670194",
"0.51557726",
"0.5143096",
"0.51429576",
"0.51249886",
"0.51249886",
"0.512323",
"0.510738",
"0.51008046",
"0.50950307",
"0.50757587",
"0.50691575",
"0.5054546",
"0.5050884",
"0.5040069"
] | 0.6128657 | 1 |
Return the REST API key configured for the specified store. | public function getRestApiKey($store = null) {
if ($this->isTestModeEnabled($store)) {
return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);
} else {
return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getJsApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_JS_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_JS_API_KEY, $store);\n }\n }",
"public function getAPIKey()\n {\n return (string)Mage::getStoreConfig(self::CONFIG_API_KEY);\n }",
"public function getApiKey($storeId)\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_APIKEY,\n ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }",
"public function getApiKey()\n {\n return Mage::getStoreConfig('magebridge/settings/api_key');\n }",
"private function getApiKey()\n\t{\n\t\treturn Mage::helper('core')->decrypt(Mage::getStoreConfig('whitePages_configuration/options/api_key'));\n\t}",
"function key(){\n\t\t$api_key = '42b85431eba6a84d17266021e817d2a6';\n\t\treturn $api_key;\n\t}",
"public function getApplicationKey(){\n\n $store = Mage::app()->getStore();\n\n $accessKey = $this->getStoreAccessKey($store->getId());\n return $accessKey;\n }",
"function get_api_key()\n{\n return get_global_value('api-key');\n}",
"function api_key() {\n\tif(check_value(chevereto_config('api_key'))) return chevereto_config('api_key');\n}",
"public function getAPIKey()\n\t{\n\t\treturn $this->getGMapClient()->getAPIKey();\n\t}",
"public function get_api_key()\n {\n if ( ! isset($this->api_key) ) return 'No API Key is set.';\n return $this->api_key;\n }",
"public function get_api_key() {\n\t\tif ( ! $this->is_api_key_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_api_key', '' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_API_KEY, 'ALGOLIA_API_KEY' );\n\n\t\treturn ALGOLIA_API_KEY;\n\t}",
"public function getStoreId();",
"public function getStoreId();",
"public function getStoreId();",
"public function getAPIKey()\n\t{\n\t\treturn $this->api_key;\n\t}",
"public function getAppKey(): string;",
"public function get_search_api_key() {\n\t\tif ( ! $this->is_search_api_key_in_config() ) {\n\n\t\t\treturn (string) get_option( 'algolia_search_api_key', '' );\n\t\t}\n\n\t\t$this->assert_constant_is_non_empty_string( ALGOLIA_SEARCH_API_KEY, 'ALGOLIA_SEARCH_API_KEY' );\n\n\t\treturn ALGOLIA_SEARCH_API_KEY;\n\t}",
"public function getApiKey () {\n syslog( LOG_INFO, 'Get an api key \\n' );\n\n $url = '/api_key';\n\n return $this->runRequest($url, 'GET', null);\n }",
"public function getApiKey()\n {\n return $this->getParameter('appid');\n }",
"public function get_api_key(){\n\t\t$apikey = array_key_exists( 'apikey', $this->bvars) ? $this->bvars['apikey'] : false;\n\t\tif (!$apikey) {\t\t\t\n\t\t\t$this->get_errors()->add( new \\gcalc\\error( 10100 ) );\n\t\t\treturn 'anonymous';\n\t\t}\n\t\treturn $apikey;\n\t}",
"public function getApiKey()\n {\n return $this->getGeneralSetting('ApiKey');\n }",
"public function getApiKey()\n {\n $cfg = $this->di->get(\"configuration\");\n $config = $cfg->load(\"apikeys.php\");\n return $config[\"config\"][\"darksky\"];\n }",
"public function getApiKey()\n {\n switch ($this->getApiMode()) {\n case Carrier::MODE_PRODUCTION:\n return $this->scopeConfig->getValue(self::XML_PATH_PRODUCTION_API_KEY, ScopeInterface::SCOPE_WEBSITES);\n default:\n return $this->scopeConfig->getValue(self::XML_PATH_TESTING_API_KEY, ScopeInterface::SCOPE_WEBSITES);\n\n }\n }",
"private function getKey()\n {\n if (!empty($this->options['api-key'])) {\n return $this->options['api-key'];\n }\n if (!empty(getenv('EWWW_API_KEY'))) {\n return getenv('EWWW_API_KEY');\n }\n return false;\n }",
"protected function getAuthorizationKey()\n {\n $storeId = Mage::app()->getStore()->getId();\n return $this->getMasterpassConfig()->getAuthorizationkey($storeId);\n }",
"public function getApiKey(): string;",
"function get_user_api_key() {\n $currentUser = current_user();\n if ($currentUser) {\n $db = get_db();\n $res = $db->getTable('Key')->findBy(array('user_id' => $currentUser->id));\n if (sizeof($res) > 0) {\n return $res[0]->key;\n }\n }\n}",
"public function getDeveloperKey();",
"public function getOauthToken($storeId = null)\n {\n return Mage::getStoreConfig(Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_OAUTH_ACCESS_TOKEN, $storeId);\n }",
"public function getApiKey(): string\n {\n return $this->apiKey;\n }",
"public function getApiKey()\n {\n return $this->getParameter('apiKey');\n }",
"public function getApiKey()\n {\n return $this->getParameter('apiKey');\n }",
"private function getApikey() {\n\t\treturn $this->_apikey;\n\t}",
"protected function getApiKey()\n {\n return $this->config['api_key'];\n }",
"public function getKey() {\n\t\tif (!empty($this->api_key)) {\n\t\t\treturn $this->api_key;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"abstract function getStore(string $storeKey);",
"public function getShopKey()\n {\n return $this->getParameter('shop_key');\n }",
"public function getConfigKey(): string;",
"public static function getApiKey()\n {\n if (static::$key) {\n return static::$key;\n }\n\n if ($key = getenv('FIRST_PROMOTER_KEY')) {\n return $key;\n }\n\n return config('services.first_promoter.key');\n }",
"public function getAppKey();",
"public function getApiTokenKey()\n {\n return $this->apiTokenKey;\n }",
"public function getShopKey()\n {\n return $this->getParameter('shopKey');\n }",
"private function getClientKey()\n {\n if ($this->isTestMode()) {\n $clientKey = \\Configuration::get('ADYEN_CLIENTKEY_TEST');\n } else {\n $clientKey = \\Configuration::get('ADYEN_CLIENTKEY_LIVE');\n }\n\n return $clientKey;\n }",
"public function getApiKey()\n {\n return $this->config['api_key'];\n }",
"public function getStoreId()\n {\n return $this->getRequest()->getParam('store_id');\n }",
"function placester_get_api_key() { return PL_Option_Helper::api_key(); }",
"public function getApi_Key()\n\t{\n\t\treturn $this->api_key;\n\t}",
"public function getApi()\n {\n return Mage::getStoreConfig('actions/settings/api');\n }",
"public function getTempstoreKey();",
"public function apiKey(): string;",
"function showspace_api_key() {\n $options = get_option('showspace_options');\n return $options['showspace_api_key'];\n}",
"public function getServiceKey() {\n return $this->_get( 'service_key' );\n }",
"public function getAPIKey() {\n\t\tif (is_null($this->userData['APIKey']) || $this->userData['APIKey'] == \"\" || intval($this->userData['APIKey']) < 0) {\n\t\t\t$key = new APIKey($this->userData['userId'], $this->userData['teamNumber'], $this->userData['uniqId']);\n\t\t\t$this->__set(\"APIKey\", $key->getKey());\n\t\t\t$this->APIKey = $key->getKey();\n\t\t} else {\n\t\t\t$this->APIKey = $this->userData['APIKey'];\n\t\t}\n\n\t\treturn $this->APIKey;\n\t}",
"public function getConfigKey()\n {\n return Extension::SERVICE_NAME;\n }",
"private function getApiKey()\n {\n if ($this->options['api-version'] == 0) {\n if (!empty($this->options['secret'])) {\n return $this->options['secret'];\n }\n } elseif ($this->options['api-version'] >= 1) {\n if (!empty($this->options['api-key'])) {\n return $this->options['api-key'];\n }\n }\n if (!empty(getenv('WPC_API_KEY'))) {\n return getenv('WPC_API_KEY');\n }\n return '';\n }",
"public function getAuthKey()\n {\n return $this->apiKey;\n }",
"public function setRestApiKey($key, $store = null, $test_mode = false) {\n $path = ($test_mode) ? static::XML_PATH_TEST_REST_API_KEY : static::XML_PATH_REST_API_KEY;\n $this->setStoreConfig($path, $key, $store);\n return $this;\n }",
"public function getApiKey();",
"public function getAuthKey()\n {}",
"public function getStoreId(){\n return $this->_getData(self::STORE_ID);\n }",
"public function getResourceKey(): string\n {\n return 'my-resource-key';\n }",
"public function getVersionConfig($store)\n {\n $scope = ($store === null ? ScopeConfigInterface::SCOPE_TYPE_DEFAULT : ScopeInterface::SCOPE_STORES);\n $version = $this->scopeConfig->getValue('klarna/api/api_version', $scope, $store);\n if ($version === null) {\n throw new KlarnaException(__('Invalid Api Version: ' . $version));\n }\n if (!array_key_exists($version, $this->versionConfigCache)) {\n $this->versionConfigCache[$version] = $this->getCheckoutVersionDetails($version);\n }\n\n return $this->versionConfigCache[$version];\n }",
"public function getKnackRestApiKey();",
"public function getAuthenticationKey();",
"public function getUrlKey()\n {\n $params = Mage::app()->getRequest()->getParams();\n $urlKey = 'spinandwin/adminhtml_index/index';\n if (isset($params['website'])) {\n $urlKey .= '/website/' . $params['website'];\n }\n\n if (isset($params['store'])) {\n $urlKey .= '/store/' . $params['store'];\n }\n\n return $urlKey;\n }",
"public function getExtkey() {}",
"public function getApiKey()\n {\n return $this->api_key;\n }",
"public function get_sendgrid_api_key() {\n\t\t$query = $this->db\n\t\t\t->select(\"variable, value\")\n\t\t\t->where('variable', 'sendgrid_api_key')\n\t\t\t->get('settings');\n\t\tif ($query->num_rows() === 1) {\n\t\t\t$res = $query->row();\n\t\t\treturn $res->value ? $res->value : $res->default_value;\n\t\t}\n\t\treturn NULL;\n\t}",
"public function getServiceKey()\n {\n return $this->getParameter('serviceKey');\n }",
"public function uriKey(): string;",
"public function getApiKey()\n {\n return $this->settings->get('google.maps.api_key');\n }",
"function get_key() {\n\t\t// get_cert() also fetches key\n\t\tif (!isset($_SESSION['user_key']))\n\t\t\t$this->get_cert();\n\t\treturn $_SESSION['user_key'];\n\t}",
"public function storeKey()\n {\n return $this->repository->get($this->repoOptionString($this->sessionKey));\n }",
"public function getSslKey()\n {\n return $this->getParameter('sslKey');\n }",
"public function getAuthKey()\n {\n }",
"public function getAuthKey()\n {\n }",
"public function getAuthKey()\n {\n }",
"public function getAuthKey()\n {\n }",
"public function public_api_key()\n {\n $paypal = $this->CI->Payment_model->getPaypalGateway();\n return $paypal->pg_api_public_key;\n }",
"public function getServiceKey() {}",
"public function getKey()\n\t{\n\t\tif (defined('AKEEBA_SERVERKEY'))\n\t\t{\n\t\t\treturn base64_decode(AKEEBA_SERVERKEY);\n\t\t}\n\n\t\t$filename = dirname(__FILE__) . '/../' . $this->keyFilename;\n\n\t\tif (file_exists($filename))\n\t\t{\n\t\t\tinclude_once $filename;\n\t\t}\n\n\t\tif (defined('AKEEBA_SERVERKEY'))\n\t\t{\n\t\t\treturn base64_decode(AKEEBA_SERVERKEY);\n\t\t}\n\n\t\treturn '';\n\t}",
"public function get_app_key() {\n\n\t\t// Get plugin settings.\n\t\t$settings = $this->get_plugin_settings();\n\n\t\treturn rgar( $settings, 'customAppKey' ) ? rgar( $settings, 'customAppKey' ) : null;\n\n\t}",
"public function getPrefix($store = null) {\n\t\tif ($store) {\n\t\t\t$data = $store->getConfig(Self::CONF_PREFIX);\n\t\t} else {\n\t\t\t$data = $this->_scopeConfig->getValue(Self::CONF_PREFIX, ScopeInterface::SCOPE_STORE);\n\t\t}\n\t\treturn $data;\n\t}",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getExtensionKey()\n {\n return $this->request->getControllerExtensionKey();\n }",
"public function getAppKey()\n {\n return $this->_appKey;\n }",
"protected static function key()\n {\n return env('APP_KEY');\n }",
"private function _getStoreId() {\n $store_id = 1;\n return $store_id;\n }",
"public function getStoreFrontId();",
"public function getSharedKey(): string;",
"public function getKey(): string\n {\n return $this->key;\n }",
"private function getMerchantKey()\n\t{\n\t\t$sandbox = $this->params->get('sandbox',0);\n\t\tif($sandbox) {\n\t\t\treturn $this->params->get('sandbox_merchant_key','');\n\t\t} else {\n\t\t\treturn $this->params->get('merchant_key','');\n\t\t}\n\t}",
"private function getEncryptedAPIKey()\n {\n if ($this->isTestMode()) {\n $encryptedApiKey = \\Configuration::get('ADYEN_APIKEY_TEST');\n } else {\n $encryptedApiKey = \\Configuration::get('ADYEN_APIKEY_LIVE');\n }\n\n return $encryptedApiKey;\n }",
"public function getApiUser()\n {\n return Mage::getStoreConfig('magebridge/settings/api_user');\n }",
"public function getGatewayKey ();",
"public static function publish_key()\n {\n if(Director::isDev()) {\n if (defined(\"STRIPE_TEST_PK\")) {\n return STRIPE_TEST_PK;\n } else {\n return self::config()->test_publish_key;\n }\n } else {\n if (defined(\"STRIPE_LIVE_PK\")) {\n return STRIPE_LIVE_PK;\n } else {\n return self::config()->live_publish_key;\n }\n }\n }"
] | [
"0.7382552",
"0.7299957",
"0.70200706",
"0.67021656",
"0.65869385",
"0.6507865",
"0.62872064",
"0.6227851",
"0.61854136",
"0.61661553",
"0.6146089",
"0.61239886",
"0.61159295",
"0.61159295",
"0.61159295",
"0.6084403",
"0.6067366",
"0.60481924",
"0.60120046",
"0.59982896",
"0.5997564",
"0.59737504",
"0.59569657",
"0.5950124",
"0.5949654",
"0.59477633",
"0.59234047",
"0.5921976",
"0.5918078",
"0.5916308",
"0.5904327",
"0.5896963",
"0.5896963",
"0.58934265",
"0.58924043",
"0.58861804",
"0.588141",
"0.5879838",
"0.58774614",
"0.58651054",
"0.5859079",
"0.5858612",
"0.58582574",
"0.58270097",
"0.5821887",
"0.5803307",
"0.57984066",
"0.5728942",
"0.5700374",
"0.56912524",
"0.5670632",
"0.56630975",
"0.56576324",
"0.56537557",
"0.5644009",
"0.5640444",
"0.5637501",
"0.56300807",
"0.5628557",
"0.56283367",
"0.56278694",
"0.56024504",
"0.55940557",
"0.5589869",
"0.5573497",
"0.55684155",
"0.5567513",
"0.55530244",
"0.55477583",
"0.5545957",
"0.5543397",
"0.5528158",
"0.5527492",
"0.55218744",
"0.55174935",
"0.5509526",
"0.5509526",
"0.5509526",
"0.5509526",
"0.54898626",
"0.5472761",
"0.5468447",
"0.546158",
"0.5452703",
"0.54525375",
"0.54525375",
"0.54525375",
"0.54525375",
"0.54438186",
"0.54380697",
"0.5437502",
"0.54291505",
"0.5415067",
"0.5408619",
"0.540748",
"0.5404026",
"0.5403504",
"0.54019326",
"0.5397888",
"0.5382954"
] | 0.8366736 | 0 |
Check if the Klevu Search extension is configured for the given store. | public function isExtensionConfigured($store_id = null) {
$js_api_key = $this->getJsApiKey($store_id);
$rest_api_key = $this->getRestApiKey($store_id);
return (
$this->isExtensionEnabled($store_id)
&& !empty($js_api_key)
&& !empty($rest_api_key)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isClerkSearchEnabled()\n {\n return $this->scopeConfig->isSetFlag(Config::XML_PATH_SEARCH_ENABLED, ScopeInterface::SCOPE_STORE);\n }",
"public function hasStore(): bool;",
"public function isTestModeEnabled($store = null) {\n return $this->getTestModeEnabledFlag($store) || !Mage::helper(\"klevu_search\")->isProductionDomain(Mage::app()->getStore($store)->getBaseUrl());\n }",
"public function has(String $storeKey):Bool {\n\n\t\treturn array_key_exists($storeKey, $this->data);\n\n\t}",
"public function isExtensionEnabled($store_id = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_EXTENSION_ENABLED, $store_id);\n }",
"public function isGiftWrappingAvailableForOrder($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ORDER, $store);\n }",
"public function isGiftWrappingAvailableForItems($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ITEMS, $store);\n }",
"public function isExtentionEnable() {\n\t\treturn $this->_scopeConfig->getValue(Self::ENABLE, ScopeInterface::SCOPE_STORE);\n\t}",
"public function hasEnableSearch()\n {\n return $this->enable_search !== null;\n }",
"public function is_search_api_key_in_config() {\n\t\treturn defined( 'ALGOLIA_SEARCH_API_KEY' );\n\t}",
"public function isAvailable($storeId)\n {\n $active = $this->config->isModuleEnabled($storeId);\n if (!$active) {\n return false;\n }\n\n $apiKey = $this->getApiKey($storeId);\n if (empty($apiKey)) {\n return false;\n }\n\n return true;\n }",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"public function isEnabled()\n {\n return $this->config->isEnabledSDK($this->_storeManager->getStore()->getId());\n }",
"public function isConfiguredForThisStore()\n {\n return $this->getUsername() && $this->isEnabled();\n }",
"protected function isAdminStore()\n {\n return $this->getValue(ColumnKeys::STORE_VIEW_CODE) === null;\n }",
"protected function isSearchEngineAvailable()\n {\n $settings = \\Administration::getSettings();\n return empty($settings->settings['info_fts_down']);\n }",
"public function checkIfEssentialConfigurationExists() {}",
"public function isEnabled($store = null)\n {\n return (boolean) Mage::getStoreConfig(self::XML_PATH_ENABLED, $store);\n }",
"public function _checkConfig(){\n return true;\n if(count($this->moduleConfig) > 0) return true;\n return false;\n }",
"public function isAllowed($store = null)\n {\n return true;\n }",
"public function isGiftWrappingAvailableForProduct($productConfig, $store = null)\n {\n if (is_null($productConfig) || '' === $productConfig) {\n return $this->isGiftWrappingAvailableForItems($store);\n } else {\n return $productConfig;\n }\n }",
"public function hasConfig();",
"public function isEnabled()\n {\n $storeCode = $this->storeManager->getStore()->getCode();\n return $this->scopeConfig->getValue(self::CONFIG_DATA_PATH, ScopeInterface::SCOPE_STORE, $storeCode) === '1';\n }",
"public function isMerchantCheckboxSupport($store = null)\n {\n return $this->getVersionConfig($store)->isMerchantCheckboxSupport();\n }",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }",
"public static function HasHookHandler($hook){\r\n\t\treturn isset(self::$Config['extensions'][$hook]);\r\n\t}",
"public function has($key){\n return (array_key_exists($key,$this->settings));\n }",
"public function isEnabled()\n\t{\n\t\treturn $this->scopeConfig->getValue(\n\t\t\t$this->getConfigPath(self::SYSTEM_CONFIG_PATH_ENABLED),\n\t\t\t\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n\t\t);\n\t}",
"function has_altis_config() : bool {\n\tif ( ! function_exists( 'Altis\\\\get_config' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( Altis\\get_config()['hm-juicer'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function hasConfig($key);",
"public function isStoreAdmin() {\n return $this->authorise('store.admin', 'store');\n }",
"public function hasProviders(): bool;",
"function option_exists($key)\n {\n return app('option')->exists($key);\n }",
"public function isTitleMandatorySupport($store = null)\n {\n return $this->getVersionConfig($store)->isTitleMandatorySupport();\n }",
"public function canSearchProvider($provider = null): bool;",
"public function canUseMysqlLike($store = null)\n {\n return $this->isEnabled($store)\n && $this->getConfig(self::CONFIG_PATH_MYSQL_METHOD, $store) == MysqlMethod::LIKE;\n }",
"public function hasConfig(string $key): bool;",
"public function hasCacheStore(): bool;",
"public function isEnabled(int $storeId = null): bool;",
"private function canSearch(array $config = [])\n {\n \tif (isset($config['global_search']) && isset($config['global_search']['search_objects']) === true)\n \t{\n \t\tif (is_array($config['global_search']['search_objects']) && count($config['global_search']['search_objects'] == 0))\n \t\t{\n \t\t\treturn true;\n \t\t}\n \t}\n \treturn false;\n }",
"public function is_configured($name)\n\t{\n\t\treturn isset($this->extensions[$name]['ext_active']);\n\t}",
"public function supportsTopicSearch() {\n \treturn $this->manager->supportsTopicSearch();\n\t}",
"protected function _isSearch()\n {\n\n return in_array($this->_getFullActionName(), self::PRODUCTSEARCHITEM_HANDLES);\n }",
"function shIsSearchEngine()\n{\n\tstatic $isSearchEngine = null;\n\n\t//return true;\n\tif (!is_null($isSearchEngine))\n\t{\n\t\treturn $isSearchEngine;\n\t}\n\telse\n\t{\n\t\t$isSearchEngine = false;\n\t\t$useragent = empty($_SERVER['HTTP_USER_AGENT']) ? '' : strtolower($_SERVER['HTTP_USER_AGENT']);\n\t\tif (!empty($useragent))\n\t\t{\n\t\t\t$remoteConfig = Sh404sefHelperUpdates::getRemoteConfig($forced = false);\n\t\t\t$remotes = empty($remoteConfig->config['searchenginesagents']) ? array() : $remoteConfig->config['searchenginesagents'];\n\t\t\t$agents = array_unique(array_merge(Sh404sefFactory::getPConfig()->searchEnginesAgents, $remotes));\n\t\t\tforeach ($agents as $agent)\n\t\t\t{\n\t\t\t\tif (strpos($useragent, strtolower($agent)) !== false)\n\t\t\t\t{\n\t\t\t\t\t$isSearchEngine = true;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $isSearchEngine;\n\t}\n}",
"public function isSetStoreName()\n {\n return !is_null($this->_fields['StoreName']['FieldValue']);\n }",
"public function isExistingShop(): bool\n {\n $shop = ShopProfileEntity::findOne([\n 'user_id' => Yii::$app->request->post()['shop_id']]);\n if (!$shop) {\n $this->addError('user_id',\n Yii::t('app', 'Магазин не найден'));\n return false;\n } else {\n return true;\n }\n }",
"protected function _getStore()\n {\n $system_configured_store_id = $this->_getSystemConfigurationStoreId();\n if ((!is_null($system_configured_store_id)) && ($system_configured_store_id !== false))\n {\n return $system_configured_store_id;\n }\n\n return false;\n \n }",
"public function isSeller(){\n\t\t\tif ($this->config->get('module_purpletree_multivendor_status')) {\n\t\t$query = $this->db->query(\"SELECT id, store_status, multi_store_id, is_removed FROM \" . DB_PREFIX . \"purpletree_vendor_stores where seller_id='\".$this->customer_id.\"'\");\n\t\treturn $query->row;\n\t}\n\t}",
"public function isValid()\n\t{\n\t\tglobal $modSettings;\n\n\t\treturn !empty($modSettings['sphinx_searchd_server']) && !empty($modSettings['sphinxql_searchd_port']);\n\t}",
"public function supportsCourseCatalogSearch() {\n \treturn $this->manager->supportsCourseCatalogSearch();\n\t}",
"public function isProviderSearchable($provider = null): bool;",
"public function ExtensionCheck($shop_url)\n {\n $extention = ['walmart' => 'WalmartExtensionCheck', 'jet' => 'JetExtensionCheck'];\n foreach ($extention as $key => $value) {\n\n $data = self::$value($shop_url);\n if ($data) {\n return $data;\n }\n }\n return false;\n }",
"private function hasRequestedScopeAccess()\n {\n // allow specific store view scope\n $storeCode = $this->_request->getParam('store');\n if ($storeCode) {\n $store = $this->_storeManager->getStore($storeCode);\n if ($store) {\n if ($this->_role->hasStoreAccess($store->getId())) {\n return true;\n }\n }\n } elseif ($websiteCode = $this->_request->getParam('website')) {\n try {\n $website = $this->_storeManager->getWebsite($websiteCode);\n if ($website) {\n if ($this->_role->hasWebsiteAccess($website->getId(), true)) {\n return true;\n }\n }\n // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n // redirect later from non-existing website\n }\n }\n return false;\n }",
"protected function checkWebsocExtensions($extensions) \n\t{\n\t\treturn true; // Override and return false if an extension is not found that you would expect.\n\t}",
"public function enabled($store = null);",
"private function isConfigured() : bool\n {\n if (!is_readable($this->settings['sp_key_file'])) {\n return false;\n }\n if (!is_readable($this->settings['sp_cert_file'])) {\n return false;\n }\n $key = file_get_contents($this->settings['sp_key_file']);\n if (!openssl_get_privatekey($key)) {\n return false;\n }\n $cert = file_get_contents($this->settings['sp_cert_file']);\n if (!openssl_get_publickey($cert)) {\n return false;\n }\n if (!SignatureUtils::certDNEquals($cert, $this->settings)) {\n return false;\n }\n return true;\n }",
"public static function isParentStoreSelected() {\n $storeId = self::getSelectedSubStoreId();\n $subStoreModel = new \\App\\SubStoreDetails();\n $storeSubStores = $subStoreModel->getStoreSubStores($storeId, FALSE);\n if (!empty($storeSubStores)) {\n return true;\n }\n return false;\n }",
"public function hasConfig($package);",
"public function hasConfigLoader(): bool;",
"public function plugin_is_configured() {\n\t\treturn isset( $this->settings->client_id, $this->settings->base_uri ) && $this->settings->client_id && $this->settings->base_uri;\n\t}",
"public function klarnaPaymentEnabled($store = null)\n {\n return Mage::getStoreConfigFlag('payment/klarna_kco/active', $store);\n }",
"public function canUseCheckout()\n {\n $token = \\Mage::getStoreConfig('payment/cryptomarket/cryptomkt_apikey');\n\n if (false === isset($token) || true === empty($token)) {\n $this->debugData('[ERROR] In Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): There was an error retrieving the token store param from the database or this Magento store does not have a CryptoMarket token.');\n\n return false;\n }\n\n $this->debugData('[INFO] Leaving Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): token obtained from storage successfully.');\n\n return true;\n }",
"protected function checkPhpExtensionEnabled($ext)\n {\n return extension_loaded($ext);\n }",
"function store_lang_exists($key)\n {\n return isset(ee()->lang->language[$key]);\n }",
"protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }",
"protected function _isMageEnterprise()\n {\n return Mage::getConfig()->getModuleConfig('Enterprise_Enterprise')\n && Mage::getConfig()->getModuleConfig('Enterprise_Cms');\n }",
"public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }",
"public function isScopeStore()\n {\n return !$this->isScopeGlobal() && !$this->isScopeWebsite();\n }",
"public function displaySalesWrappingIncludeTaxPrice($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_SALES_WRAPPING, $store);\n return ($configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH\n || $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_INCLUDING_TAX);\n }",
"protected function checkConfiguration() {\n\t\t$pass = FALSE;\n\t\ttry {\n\t\t\tTx_CzWkhtmltopdf_Config::getBinaryPath();\n\t\t\t$pass = TRUE;\n\t\t}\n\t\tcatch(InvalidArgumentException $e) {}\n\n\t\t$this->reports[] = t3lib_div::makeInstance('tx_reports_reports_status_Status',\n\t\t\t'Configuration', // title\n\t\t\t$pass ? 'OK' : 'ERROR', // value\n\t\t\t$pass ? '' : 'Please go to the Extension Manager and hit the \"Update\" button of the configuration of '.Tx_CzWkhtmltopdf_Config::EXTKEY , //message\n\t\t\t$pass ? tx_reports_reports_status_Status::OK : tx_reports_reports_status_Status::ERROR //severity\n\t\t);\n\n\t\treturn $pass;\n\t}",
"public function hasWxverifycodere()\n {\n return $this->get(self::WXVERIFYCODERE) !== null;\n }",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}",
"public function isFindifyEnabled()\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_ENABLED,\n ScopeInterface::SCOPE_STORE\n );\n }",
"function available()\n {\n $db =& JFactory::getDBO();\n $query = 'select count(*) from #__extensions as a where a.element = ' . $db->Quote('com_community') . ' AND a.enabled=1';\n\t\t$db->setQuery($query);\n\t\t$count = (int)$db->loadResult();\n if ($count > 0)\n return true;\n\n return false;\n }",
"public function hasValueForKey($key) {\n\t\treturn array_key_exists($key, $this->store);\n\t}",
"protected function checkExtension() {\n\t\t\n\t\t//If no extensions set, all are valid\n\t\tif(empty($this->valid_extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$extension = $this->getExtension();\n\t\t\n\t\treturn in_array($extension, $this->valid_extensions) ? true : false;\n\t\t\n\t}",
"public function hasConfig() {\n\t\treturn (bool)@file_exists($this->fullModulePath.'/config.ini');\n\t}",
"public function displayCartWrappingIncludeTaxPrice($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_CART_WRAPPING, $store);\n return ($configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH\n || $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_INCLUDING_TAX);\n }",
"public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }",
"function is_system_configured() {\n global $CFG;\n return (!empty($CFG->ombielalertsserverendpoint) && \n !empty($CFG->ombielalertsserversserverusername) && \n !empty($CFG->ombielalertsserverpassword) && \n !empty($CFG->ombielalertsorgcode) && \n !empty($CFG->ombielalertsorgpassword)\n );\n }",
"public function isCatalogSearch()\n {\n $pathInfo = $this->_getRequest()->getPathInfo();\n if (stripos($pathInfo, '/catalogsearch/result') !== false) {\n return true;\n }\n return false;\n }",
"private function _isExtensionInstalled($name)\n {\n if ($name == '') {\n return false;\n }\n\n $allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();\n return array_key_exists($name, $allExtensions);\n }",
"function exists($name) {\n return isset($this->store[$name]);\n }",
"protected function checkterm_in_stw($term, $SearchType, $lang, $store) {\t\t\t\n//\t\tif ($this->getSrcDebug()) {\t\n//\t\t\tprint \"<br>STORE: <br>\";\n//\t\t\tvar_dump($store);\n//\t\t}\n\t\t\n\t\tswitch($SearchType) {\n\t\t\tcase 'X':\n\t\t\t\t$QUERY = <<<EOQ\n\t\t\t\t\tprefix skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\tselect ?d2 where { \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t?d2 skos:prefLabel '$term' .\n\t\t\t\t\t\t }\n\t\t\t\t\t\t UNION\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t?d2 skos:altLabel '$term' .\n\t\t\t\t\t\t }\n\t\t\t\t\t}\nEOQ;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XX':\n\t\t\t\t$QUERY=<<<EOQ\n\t\t\t\t\tprefix skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\tselect ?d2 where {\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t?d2 \tskos:prefLabel \t?p .\n\t\t\t\t\t\t\tFILTER regex(?p, \"$term\", \"i\") \n\t\t\t\t\t \t}\n\t\t\t\t\t}\nEOQ;\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase ('XXL'):\n\t\t\t\t$QUERY=<<<EOQ\n\t\t\t\t\tprefix skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\tselect ?d2 where {\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t?d2 \tskos:prefLabel \t?p .\n\t\t\t\t\t\t\tFILTER regex(?p, \"$term\", \"i\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tUNION\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t?d2 \tskos:altLabel \t?p .\n\t\t\t\t\t\t\tFILTER regex(?p, \"$term\", \"i\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\nEOQ;\n\t\t}\n\t\t\n\t\tif ($this->getSrcDebug()) {\n\t\t\tprint \"<br><br>checkterm_in_stw($exactSearch): $QUERY <br>\";\n\t\t}\n\t\t\n\t\t$found = false;\n\t\tif ($rows = $store->query($QUERY, 'rows')) {\n\t\t\t$found = count($rows);\n\t\t\t\n\t\t\tif ($this->getSrcDebug()) {\t\n\t\t\t\tprint \"<br>DUMP RESULTS: <br>\";\n\t\t\t\tvar_dump($rows);\n\t\t\t}\n\t\t} else {\n\t\t\tif ($this->getSrcDebug()) {\n\t\t\t\tprint \"!!! NO RESULTS OR NO QUERY LAUNCHED!!!\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->getSrcDebug()) {\n\t\t\tprint \"<br><br>checkterm_in_stw($exactSearch): returning found=$found<br>\";\n\t\t}\n\t\t\n\t\tif ($found)\t{\n\t\t\t$suggested_term = $term;\n\t\t} else {\n\t\t\t$suggested_term = '';\n\t\t}\n\t\t\n\t\treturn $suggested_term;\n\t}",
"public function isStoreActive() {\r\n\t\treturn $this->_storeManager->getStore()->isActive();\r\n\t}",
"private function init_radialsearchExtension()\n {\n $key = 'radialsearch';\n\n // RETURN : extension is installed\n if ( t3lib_extMgm::isLoaded( $key ) )\n {\n return true;\n }\n // RETURN : extension is installed\n\n $header = 'FATAL ERROR!';\n $text = 'You are using a radial search filter in the current view.<br />\n But the extension Radial Search (Umkreissuche) (extension key: radialsearch) isn\\'t loaded.<br />\n Please remove the radialsearch filter or install and enable the extension radialsearch.';\n $this->pObj->drs_die( $header, $text );\n }",
"public function hasProductSyncRun($store = null) {\n $config = Mage::getConfig();\n\n if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, \"store\", $store)) {\n return false;\n }\n\n return true;\n }",
"function isInstalled() {\r\n return extension_loaded('memcache');\r\n }",
"function has_config() {\n return true;\n }",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) &&\n\t\t\t'wc-settings' == $_GET['page'] &&\n\t\t\tisset( $_GET['tab'] ) &&\n\t\t\t'tax' == $_GET['tab'] &&\n\t\t\tisset( $_GET['section'] ) &&\n\t\t\t'avatax' == $_GET['section'];\n\t}",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"function baseSettings_exists($key)\n {\n return app('BaseSettings_exists')->exists($key);\n }",
"public function hasProviders();",
"private function isSearch() {\n\t\tif (!is_null($this->search))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"public function isOAuthShopAlreadyRegistered($shopnumber, $storeViewId)\n {\n /* has shopnumber defined in same website scope */\n if (Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter('path', Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER)\n ->addFieldToFilter('value', $shopnumber)\n ->count()\n ) {\n return true;\n }\n\n /* a shopnumber is set on store view scope with the same scope_id as the base store view for the new shopnumber */\n if (Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter('path', Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER)\n ->addFieldToFilter('scope', 'stores')\n ->addFieldToFilter('scope_id', $storeViewId)\n ->addFieldToFilter('value', array('nin' => array('', null)))\n ->count()\n ) {\n return true;\n }\n\n /* a shopnumber has a default store view set exactly like the base store view for the new shopnumber */\n $resource = Mage::getSingleton('core/resource');\n $table_config_data = $resource->getTableName('core/config_data');\n $collection = Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter(\n 'main_table.path',\n Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER\n )\n ->addFieldToFilter('main_table.scope', 'websites')\n ->addFieldToFilter('main_table.value', array('nin' => array('', null)))\n ->addFieldToFilter(\n 'dsv.path',\n Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_DEFAULT_STORE\n )\n ->getSelect()\n ->joinInner(\n array('dsv' => $table_config_data),\n 'dsv.scope = main_table.scope AND dsv.scope_id = main_table.scope_id',\n array('default_store_view' => 'value')\n )->query()\n ->fetchAll();\n\n foreach ($collection as $item) {\n if (isset($item['default_store_view'])\n && $item['default_store_view'] == $storeViewId\n ) {\n return true;\n }\n }\n\n return false;\n }",
"public static function hasSettings($prefix)\n {\n if (defined('HHVM_VERSION') && in_array($prefix, array(self::PDO_PGSQL, self::MYSQLI))) {\n return false;\n }\n\n $settings = static::retrieveSettings($prefix);\n\n return !empty($settings);\n }",
"function is_pm_search()\n{\n\tglobal $db;\n\n\t// Check if the search-module is active\n\t$sql = 'SELECT module_enabled FROM ' . MODULES_TABLE . '\n\t\tWHERE module_basename = \"pm\"\n\t\tAND module_mode = \"search\"';\n\t$result = $db->sql_query($sql);\n\t$pm_search_enabled = (int) $db->sql_fetchfield('module_enabled');\n\t$db->sql_freeresult($result);\n\n\treturn($pm_search_enabled);\n}",
"public function hasPermission(&$controller, &$xoopsUser)\n {\n if (1 != $this->mConfig['enable_search']) {\n $controller->executeRedirect(XOOPS_URL . '/', 3, _MD_LEGACY_ERROR_SEARCH_NOT_ENABLED);\n return false;\n }\n return true;\n }"
] | [
"0.6739226",
"0.64571923",
"0.6312574",
"0.6128049",
"0.60947824",
"0.6090797",
"0.60860443",
"0.5984468",
"0.5920413",
"0.5917814",
"0.5915649",
"0.590712",
"0.5892888",
"0.58743584",
"0.586364",
"0.5858254",
"0.58280176",
"0.5813628",
"0.580744",
"0.5757283",
"0.5740547",
"0.574026",
"0.5736963",
"0.5712185",
"0.57112473",
"0.5703751",
"0.56993836",
"0.5662133",
"0.5657431",
"0.56540114",
"0.565066",
"0.56291896",
"0.5622712",
"0.5575575",
"0.55595547",
"0.5541154",
"0.5540963",
"0.5535287",
"0.55304956",
"0.5523791",
"0.5513234",
"0.5502333",
"0.5494449",
"0.54936355",
"0.54876155",
"0.54861945",
"0.547613",
"0.5475657",
"0.5465365",
"0.5462612",
"0.54521656",
"0.54521537",
"0.54521286",
"0.54520416",
"0.5450236",
"0.5445777",
"0.5445674",
"0.5439108",
"0.54296637",
"0.5423958",
"0.54226035",
"0.5409491",
"0.5408607",
"0.5408434",
"0.5408098",
"0.54067254",
"0.54041445",
"0.5403845",
"0.5398086",
"0.5394224",
"0.539221",
"0.53918767",
"0.538803",
"0.5385276",
"0.5377041",
"0.53759366",
"0.5373852",
"0.53668714",
"0.53662664",
"0.53599346",
"0.53576744",
"0.5357133",
"0.5348879",
"0.5347186",
"0.5345748",
"0.5345483",
"0.53449595",
"0.5343099",
"0.534258",
"0.53307414",
"0.532329",
"0.53231984",
"0.53231984",
"0.5323148",
"0.5317623",
"0.5316937",
"0.531496",
"0.5293729",
"0.52894264",
"0.52837133"
] | 0.69049436 | 0 |
Return the system configuration setting for enabling Product Sync for the specified store. The returned value can have one of three possible meanings: Yes, No and Forced. The values mapping to these meanings are available as constants on Klevu_Search_Model_System_Config_Source_Yesnoforced. | public function getProductSyncEnabledFlag($store_id = null) {
return intval(Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_ENABLED, $store_id));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function getOrderSyncEnabledFlag($store = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_ENABLED, $store));\n }",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configuration setting to enable Product Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration setting to enable Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"private function _getSendOrderConfirmationOption()\n {\n return (boolean) Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/send_order_confirmation', Mage::app()->getStore()->getStoreId());\n }",
"protected function _getStore()\n {\n $system_configured_store_id = $this->_getSystemConfigurationStoreId();\n if ((!is_null($system_configured_store_id)) && ($system_configured_store_id !== false))\n {\n return $system_configured_store_id;\n }\n\n return false;\n \n }",
"public function updateMasterProducts($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_UPDATE_MASTER, $store));\n }",
"public function getStoreConfig(){\n return Mage::getStoreConfig('payment/vpayment/client');\n }",
"private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }",
"public function getEnableAlwaysOnConfiguration()\n {\n if (array_key_exists(\"enableAlwaysOnConfiguration\", $this->_propDict)) {\n return $this->_propDict[\"enableAlwaysOnConfiguration\"];\n } else {\n return null;\n }\n }",
"public function getSforceConfig() {\n $sforce = $this->getDataSource();\n return $sforce->config;\n }",
"public function stone_setting() {\r\n return $this->stone_setting;\r\n }",
"public function getIsEnabled()\n\t{\n\t\treturn Mage::getStoreConfig(self::XML_PATH_ENABLE);\n\t}",
"public function getAsync()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ASYNC);\n }",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"public function getSystemConfig()\n {\n return $this->systemConfig;\n }",
"public function getConfig(): string\n {\n $checkoutConfig = $this->compositeConfigProvider->getConfig();\n $storeCode = $checkoutConfig['storeCode'];\n $checkoutConfig['payment']['restUrlPrefix'] = \"/rest/$storeCode/V1/\";\n\n $transport = new \\Magento\\Framework\\DataObject([\n 'checkoutConfig' => $checkoutConfig,\n 'output' => [\n 'storeCode' => $storeCode,\n 'payment' => $checkoutConfig['payment'],\n 'language' => $this->localeResolver->getLocale(),\n 'currency' => $this->currencyProvider->getConfig(),\n 'defaultCountryId' => $checkoutConfig['defaultCountryId'],\n ]\n ]);\n\n $this->eventManager->dispatch('hyva_react_checkout_config', ['transport' => $transport]);\n\n return $this->serializer->serialize($transport->getData('output'));\n }",
"public function getCatalogrequestConfigStatus()\n {\n $path = \"catalogrequest/catalogrequest/status\";\n return Mage::getStoreConfig($path);\n }",
"public function getProductSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_FREQUENCY);\n }",
"public function getConfigSys()\n {\n return $this->__config__;\n }",
"public function enabled($store = null);",
"public function getShopStoreProperty()\n {\n return $this->hasOne(ShopStoreProperty::className(), ['id' => 'shop_store_property_id']);\n }",
"public function isGiftWrappingAvailableForProduct($productConfig, $store = null)\n {\n if (is_null($productConfig) || '' === $productConfig) {\n return $this->isGiftWrappingAvailableForItems($store);\n } else {\n return $productConfig;\n }\n }",
"public function getPlatform()\n {\n return 'magento';\n }",
"public function getCanonicalEnabled()\n {\n return $this->getStoreValue(self::ALTERNATE_CANONICAL);\n }",
"public function getSystemSettingReply()\n {\n return $this->get(self::_SYSTEM_SETTING_REPLY);\n }",
"public function retrieveSystemConfiguration()\n {\n return $this->start()->uri(\"/api/system-configuration\")\n ->get()\n ->go();\n }",
"public function allowGiftReceipt($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOW_GIFT_RECEIPT, $store);\n }",
"public function getEnableSms()\n {\n return $this->enableSms;\n }",
"public function system_setting()\n {\n return $this->hasOne('App\\SystemSetting');\n }",
"public function getSysConf()\n {\n return $this->sysconf;\n }",
"public function getSysConf()\n {\n return $this->sysconf;\n }",
"public function getEnabled()\n {\n return Mage::getStoreConfig('splitprice/split_price_config/enabled');\n }",
"public function enabled()\n {\n return (bool) Mage::getStoreConfig('actions/settings/enabled');\n }",
"private function _getCreateCreditmemoOption()\n {\n return (boolean) Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/create_creditmemo', Mage::app()->getStore()->getStoreId());\n }",
"protected function _getStoreConfig($path, $store = null)\n {\n return Mage::getStoreConfig($path, $store);\n }",
"protected function getConfig($name)\n\t{\n\t\treturn $this->app['config'][\"nova-dynamic-lang.sections.stores.{$name}\"];\n\t}",
"public function setForceMagento($forceMagento)\n {\n $this->_forceMagento = $forceMagento;\n return $this;\n }",
"public function merchantInstallmentSelection(){\n\n return Mage::getStoreConfig(self::XPATH_CONFIG_INSTALLMENT_SELECTION);\n }",
"public function updateVariantProducts($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_UPDATE_VARIANT, $store));\n }",
"public function getConfig($field)\n {\n return Mage::getStoreConfig(self::XML_PATH_CERTIFIED_SHOPS . $field);\n }",
"public function getSectionStatus() {\r\n\t\t$config = $this->getConfig();\r\n return $config[\"enable\"];\r\n }",
"public function klarnaPaymentEnabled($store = null)\n {\n return Mage::getStoreConfigFlag('payment/klarna_kco/active', $store);\n }",
"protected function getStoreName() {\n return Mage::getStoreConfig('general/store_information/name');\n }",
"public function isEnabled($storeId=0){\n \tif($storeId==0)\n \t\t$storeId=Mage::app()->getStore()->getId();\n \treturn Mage::getStoreConfig('ced_csmultishipping/general/activation', $storeId);\n }",
"public function getSenderEmail($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_TRANSACTIONAL_EMAIL_SENDER, $store);\n }",
"public function getTestModeEnabledFlag($store = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);\n }",
"public function getStoreMode()\n {\n return $this->storeMode;\n }",
"public function isGiftWrappingAvailableForOrder($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ORDER, $store);\n }",
"public function getConfig()\n {\n return Mage::helper(\"meanbee_osd/config\");\n }",
"public function hasProductSyncRun($store = null) {\n $config = Mage::getConfig();\n\n if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, \"store\", $store)) {\n return false;\n }\n\n return true;\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }",
"public function displaySalesWrappingBothPrices($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_SALES_WRAPPING, $store);\n return $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH;\n }",
"public function isEnabled($store = null)\n {\n return (boolean) Mage::getStoreConfig(self::XML_PATH_ENABLED, $store);\n }",
"public static function syncConfig()\n {\n $addon = self::addon();\n\n if (!self::isBackwardsCompatible() && !$addon->hasConfig('synchronize')) {\n $addon->setConfig('synchronize', false);\n\n if (\n $addon->getConfig('synchronize_actions') == true ||\n $addon->getConfig('synchronize_modules') == true ||\n $addon->getConfig('synchronize_templates') == true ||\n $addon->getConfig('synchronize_yformemails') == true\n ) {\n $addon->setConfig('synchronize', true);\n\n // Set developer synchronizing actions according to theme settings\n if ($addon->getConfig('synchronize_templates')) {\n rex_addon::get('developer')->setConfig('templates', true);\n }\n if ($addon->getConfig('synchronize_modules')) {\n rex_addon::get('developer')->setConfig('modules', true);\n }\n if ($addon->getConfig('synchronize_actions')) {\n rex_addon::get('developer')->setConfig('actions', true);\n }\n if ($addon->getConfig('synchronize_yformemails')) {\n rex_addon::get('developer')->setConfig('yform_email', true);\n }\n }\n\n $addon->removeConfig('synchronize_actions');\n $addon->removeConfig('synchronize_modules');\n $addon->removeConfig('synchronize_templates');\n $addon->removeConfig('synchronize_yformemails');\n }\n }",
"public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }",
"public function getApi()\n {\n return Mage::getStoreConfig('actions/settings/api');\n }",
"public function getManageStock()\n {\n return (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK);\n }",
"public static function getSecureModeValue($cartAmount = 1) {\n $configModel = new Configurations();\n $thresholdValue = $configModel->get(config('configurations.mangopay_3dsecure_key'));\n $secureMode = 'DEFAULT';\n if ($cartAmount >= $thresholdValue) {\n $secureMode = 'FORCE';\n }\n return $secureMode;\n }",
"public function getEnabled($storeId = null)\n {\n if (!$this->generalHelper->getEnabled($storeId)) {\n return false;\n }\n\n return $this->generalHelper->getStoreValue(self::XPATH_ORDER_ENABLE, $storeId);\n }",
"public function getOrderSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);\n }",
"public function isTransactionalEmailEnabled($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_TRANSACTIONAL_EMAIL_ENABLED, $store);\n }",
"public function getOnlyOnYes()\n {\n return $this->onlyOnYes;\n }",
"public function getMCMinSyncDateFlag()\r\n {\r\n return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::GENERAL_MCMINSYNCDATEFLAG);\r\n }",
"public function getSoftwareConfig()\n {\n return $this->software_config;\n }",
"public function getMasterList($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_MASTER_LIST, $store);\n }",
"public function getConfigSOQL() {\n return $this->config['SOQL'];\n }",
"public function getConfig() {\n return Mage::getSingleton('profileolabs_shoppingflux/config');\n }",
"public function getDefaultStoreForSmartCollections()\n {\n return $this->scopeConfig->getValue(self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_DEFAULT_STORE);\n }",
"protected function _getDpgConfig()\n {\n $config = Mage::getSingleton('dpg/config');\n return $config->setStore($this->getStore());\n }",
"public function displayCartWrappingBothPrices($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_CART_WRAPPING, $store);\n return $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH;\n }",
"public function getConfig ()\n {\n $config = Mage::getModel('socnet/network')\n ->getConfigByNetworkKey($this->getNetworkKey());\n return $config;\n }",
"public function getEnabled()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/enabled', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }",
"protected function getConfig()\n {\n\n return $this->app['config']['manticore'];\n }",
"protected function getStoreConfig () {\n\t\t$aConfig = array(\n\t\t\t'db_host'\t\t=> DB_HOST,\n\t\t\t'db_name'\t\t=> DB_NAME,\n\t\t\t'db_user'\t\t=> DB_USER,\n\t\t\t'db_pwd'\t\t=> DB_PASSWORD,\n\t\t\t'store_name'\t=> getWpPrefix() . 'pp_thesaurus',\n\t\t);\n\n\t\treturn $aConfig;\n\t}",
"public function getConfig()\n {\n return Mage::getModel(\"postident/config\");\n }",
"protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }",
"protected function getConfig($name)\n {\n return $this->app['config'][\"option.stores.{$name}\"];\n }",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function isEnabled()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ENABLED);\n }",
"public function getModuleConfig($path) {\n $value = Mage::getStoreConfig($path);\n $storeId = false;\n\n if ($this->isAdmin()) {\n // Are we in credit memo?\n $_creditMemo = Mage::registry('current_creditmemo');\n if ($_creditMemo) {\n $storeId = $_creditMemo->getOrder()->getData(\"store_id\");\n } else {\n $session = Mage::getSingleton('adminhtml/session_quote');\n // We will get the store ID from here\n $storeId = $session->getStoreId();\n }\n\n if(!$storeId) {\n if(Mage::registry('current_order') && Mage::registry('current_order')->getStoreId()) {\n $storeId = Mage::registry('current_order')->getStoreId();\n } else if ( Mage::registry('current_invoice') && Mage::registry('current_invoice')->getStoreId()) {\n $storeId = Mage::registry('current_invoice')->getStoreId();\n }\n }\n\n\n if($storeId) {\n $value = Mage::getStoreConfig($path, Mage::getModel('core/store')->load( $storeId ));\n }\n }\n return $value;\n }",
"public function getShopConfig()\n {\n $oReturn = new stdClass();\n $oReturn->language = $this->config->getShopLanguageConfig();\n $oReturn->currency = $this->config->getShopCurrencyConfig();\n $oReturn->condition = $this->config->getShopConditionConfig();\n\n return $oReturn;\n }",
"protected function _getConfigModel()\n {\n if (!$this->hasConfigModel()) {\n $this->setConfigModel(Mage::getConfig());\n }\n\n return $this->getConfigModel();\n }",
"public function isEnabled()\n\t{\n\t\treturn $this->scopeConfig->getValue(\n\t\t\t$this->getConfigPath(self::SYSTEM_CONFIG_PATH_ENABLED),\n\t\t\t\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n\t\t);\n\t}",
"public function isProductMassActionEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_BETA_MASS_ACTION));\n }",
"public function getStoreValue()\n {\n $value = $this->_config->get('general_defaults/store');\n\n if ($value === null) {\n $value = '0';\n }\n\n $value = explode(',', $value);\n $value = array_map('trim', $value);\n $value = array_filter($value, function($value) {\n return $value || $value === '0';\n });\n\n return $value;\n }",
"public function getGeneralSetting($config_name)\n {\n return Mage::getStoreConfig('Shoptimally/GeneralSettings/' . $config_name, Mage::app()->getStore());\n }",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"public function getAllowSendToCustomer()\n {\n return $this->allow_send_to_customer;\n }",
"public function canShow(){\n\t\tif (Mage::getStoreConfig('logicbroker_edi_section/logicbroker_edi_group1/notificationstatus') == 0) {\n\t\t\t$this->setConfigValue(array(\n\t\t\t\t'scope' => 'default',\n\t\t\t\t'scope_id' => '0',\n\t\t\t\t'path' => 'logicbroker_edi_section/logicbroker_edi_group1/notificationstatus',\n\t\t\t\t'value' => '1',\n\t\t\n\t\t\t\t));\n\t\t\treturn true;\n }else{\n \treturn false;\n }\n\t}",
"public function get_enable()\n\t{\n\t\treturn $this->enable;\n\t}",
"private function getShopgateCondition()\n {\n return [\n 'label' => __('Shopgate Mobile App'),\n 'value' => ShopgateOrder::class,\n ];\n }",
"public function getVersionConfig($store = null)\n {\n $version = Mage::getStoreConfig('payment/klarna_kco/api_version', $store);\n\n if (!isset($this->_versionConfigCache[$version])) {\n $this->_versionConfigCache[$version] = $this->getCheckoutVersionDetails($version);\n }\n\n return $this->_versionConfigCache[$version];\n }",
"public function isConfiguredForThisStore()\n {\n return $this->getUsername() && $this->isEnabled();\n }",
"private function _get_connector_config_value($config_name){\n try {\n /**\n * Get the resource model\n */\n $resource = Mage::getSingleton('core/resource');\n \n /**\n * Retrieve the write connection\n */\n $readConnection = $resource->getConnection('core_read');\n \n /**\n * Retrieve our table name\n */\n $table = $resource->getTableName('minematic_config');\n \n //Update register\n $query = \"SELECT value FROM \" . $table . \" WHERE name = '\"\n . $config_name .\"'\";\n \n //Execute the query\n $config_value = $readConnection->fetchOne($query);\n\n return $config_value ? $config_value : FALSE;\n \n } catch (Exception $e) {\n //Log Exception Message\n Mage::helper('connector')->logSyncProcess($e->getMessage(), \"DATABASE\", \"ERROR\");\n }\n\n return FALSE;\n }",
"public function getPrefix($store = null) {\n\t\tif ($store) {\n\t\t\t$data = $store->getConfig(Self::CONF_PREFIX);\n\t\t} else {\n\t\t\t$data = $this->_scopeConfig->getValue(Self::CONF_PREFIX, ScopeInterface::SCOPE_STORE);\n\t\t}\n\t\treturn $data;\n\t}",
"public function displaySalesWrappingIncludeTaxPrice($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_SALES_WRAPPING, $store);\n return ($configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH\n || $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_INCLUDING_TAX);\n }",
"public function installConfiguration()\n {\n $result = true;\n\n foreach (\\Shop::getShops(false, null, true) as $shopId) {\n /* todo: remove ignore when first configuration is added to the list */\n /* @phpstan-ignore-next-line */\n foreach (Config::CONFIGURATION_LIST as $name => $value) {\n if (false === \\Configuration::hasKey((string) $name, null, null, (int) $shopId)) {\n $result = $result && \\Configuration::updateValue(\n (string) $name,\n $value,\n false,\n null,\n (int) $shopId\n );\n }\n }\n }\n\n return $result;\n }",
"private function _getSyncConfig($uri, $wrapperName, $modelUri)\n {\n if (null === $this->_syncConfigCache) {\n $store = Erfurt_App::getInstance()->getStore();\n\n require_once 'Erfurt/Sparql/SimpleQuery.php';\n $query = new Erfurt_Sparql_SimpleQuery();\n $query->setProloguePart('SELECT ?s ?p ?o');\n $query->addFrom($this->_syncModelUri);\n $where = 'WHERE {\n ?s ?p ?o .\n ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> .\n ?s <' . $this->_properties['syncResource'] . '> <' . $uri . '> .\n ?s <' . $this->_properties['targetModel'] .'> <' . $modelUri . '> .\n ?s <' . $this->_properties['wrapperName'] . '> \"' . $wrapperName . '\" .\n }';\n $query->setWherePart($where);\n\n $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n if (count($result) === 0) {\n return false;\n }\n\n $retVal = array();\n foreach ($result as $row) {\n if (!isset($retVal[$row['s']])) {\n $retVal[$row['s']] = array(\n 'uri' => $row['s']\n );\n }\n\n switch ($row['p']) {\n case $this->_properties['targetModel']:\n $retVal[$row['s']]['targetModel'] = $row['o'];\n break;\n case $this->_properties['syncResource']:\n $retVal[$row['s']]['syncResource'] = $row['o'];\n break;\n case $this->_properties['wrapperName']:\n $retVal[$row['s']]['wrapperName'] = $row['o'];\n break;\n case $this->_properties['lastSyncPayload']:\n $retVal[$row['s']]['lastSyncPayload'] = unserialize($row['o']);\n break;\n case $this->_properties['lastSyncDateTime']:\n $retVal[$row['s']]['lastSyncDateTime'] = $row['o'];\n break;\n case $this->_properties['syncQuery']:\n $retVal[$row['s']]['syncQuery'] = $row['o'];\n break;\n case $this->_properties['checkHasChanged']:\n $retVal[$row['s']]['checkHasChanged'] = (bool)$row['o'];\n break;\n }\n }\n\n $this->_syncConfigCache = array_values($retVal);\n $this->_syncConfigCache = $this->_syncConfigCache[0]; // Only return one config!\n }\n\n return $this->_syncConfigCache;\n }",
"public function convertOnChange()\n {\n return (boolean)$this->scopeConfig->getValue(\n self::XML_PATH_CONVERT_CUSTOM_PRICE,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }"
] | [
"0.65764624",
"0.65610963",
"0.63442016",
"0.6315542",
"0.5891043",
"0.5613256",
"0.55932254",
"0.5573776",
"0.54481304",
"0.5387158",
"0.5277634",
"0.52389574",
"0.520713",
"0.5193687",
"0.51893955",
"0.51604533",
"0.51242787",
"0.5088018",
"0.5082648",
"0.50535154",
"0.50241345",
"0.50205433",
"0.50109476",
"0.50109166",
"0.49801686",
"0.4965614",
"0.49649388",
"0.49614298",
"0.49507082",
"0.4948504",
"0.49457842",
"0.49457842",
"0.49453574",
"0.49424696",
"0.4937784",
"0.4937619",
"0.4926815",
"0.49198672",
"0.49168417",
"0.4915914",
"0.4893128",
"0.48867232",
"0.48790717",
"0.48753172",
"0.48656505",
"0.4862914",
"0.48592934",
"0.48531303",
"0.4849536",
"0.48468",
"0.48213604",
"0.48183087",
"0.48179817",
"0.48040682",
"0.47991255",
"0.47991028",
"0.4795582",
"0.4791656",
"0.47898522",
"0.47857222",
"0.47820228",
"0.4781229",
"0.4777838",
"0.47733986",
"0.47703156",
"0.47678182",
"0.4766707",
"0.4766283",
"0.47565344",
"0.4750862",
"0.47422197",
"0.47404134",
"0.4736452",
"0.47191948",
"0.4718961",
"0.47169623",
"0.47162944",
"0.471271",
"0.47098172",
"0.46980378",
"0.46858916",
"0.467499",
"0.4666181",
"0.4656891",
"0.46557334",
"0.46520978",
"0.46482956",
"0.4645425",
"0.46383905",
"0.4627085",
"0.46233296",
"0.46155915",
"0.4608144",
"0.46066082",
"0.45999336",
"0.45939428",
"0.45936173",
"0.45896575",
"0.4587283",
"0.45818907"
] | 0.66452974 | 0 |
Check if Product Sync is enabled for the specified store and domain. | public function isProductSyncEnabled($store_id = null) {
$flag = $this->getProductSyncEnabledFlag($store_id);
// Require "Forced" configuration setting to enable Product Sync on non production environments
if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
return in_array($flag, array(
Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,
Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED
));
} else {
return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration setting to enable Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function isEcomSyncDataEnabled()\r\n {\r\n $apiKey = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::GENERAL_APIKEY);\r\n $moduleEnabled = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::GENERAL_ACTIVE);\r\n $ecommerceEnabled = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::ECOMMERCE_ACTIVE);\r\n $ret = !is_null($this->getMCStoreId()) && $this->getMCStoreId() != null\r\n && !is_null($apiKey) && $apiKey != \"\" && $moduleEnabled && $ecommerceEnabled;\r\n return $ret;\r\n }",
"public function hasProductSyncRun($store = null) {\n $config = Mage::getConfig();\n\n if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, \"store\", $store)) {\n return false;\n }\n\n return true;\n }",
"public function getProductSyncEnabledFlag($store_id = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_ENABLED, $store_id));\n }",
"public static function is_sync_enabled_for_product( \\WC_Product $product ) {\n\n\t\tif ( ! isset( self::$products_sync_enabled[ $product->get_id() ] ) ) {\n\n\t\t\tif ( $product->is_type( 'variable' ) ) {\n\n\t\t\t\t// assume variable products are not synced until a synced child is found\n\t\t\t\t$enabled = false;\n\n\t\t\t\tforeach ( $product->get_children() as $child_id ) {\n\n\t\t\t\t\t$child_product = wc_get_product( $child_id );\n\n\t\t\t\t\tif ( $child_product && self::is_sync_enabled_for_product( $child_product ) ) {\n\n\t\t\t\t\t\t$enabled = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t$enabled = 'no' !== $product->get_meta( self::SYNC_ENABLED_META_KEY );\n\t\t\t}\n\n\t\t\tself::$products_sync_enabled[ $product->get_id() ] = $enabled;\n\t\t}//end if\n\n\t\treturn self::$products_sync_enabled[ $product->get_id() ];\n\t}",
"public function isSyncEnabled() {\n $subsStatus = $this->getContactFlag('subscribe_setting');\n if ($this->isServiceActive() && $subsStatus) {\n return true;\n }\n return false;\n }",
"public static function checkVendorKycStatus() {\n $storeModel = new \\App\\StoreModel();\n $storeId = Auth::user()->id;\n $allowProductUpload = $storeModel->getStoreKYCStatus($storeId);\n return $allowProductUpload;\n }",
"public function isEnabled()\n\t{\n\t\treturn $this->scopeConfig->getValue(\n\t\t\t$this->getConfigPath(self::SYSTEM_CONFIG_PATH_ENABLED),\n\t\t\t\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n\t\t);\n\t}",
"public function getOrderSyncEnabledFlag($store = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_ENABLED, $store));\n }",
"public function isEnabled()\n {\n $storeCode = $this->storeManager->getStore()->getCode();\n return $this->scopeConfig->getValue(self::CONFIG_DATA_PATH, ScopeInterface::SCOPE_STORE, $storeCode) === '1';\n }",
"public function isEnabled()\n {\n return $this->config->isEnabledSDK($this->_storeManager->getStore()->getId());\n }",
"abstract protected function isSyncRequired($entity);",
"protected function isInstalledAndEnabled()\n {\n return $this->isPluginAvailable($this->identifier)\n && Settings::get('octoshop_products_enabled', true);\n }",
"public function isExtentionEnable() {\n\t\treturn $this->_scopeConfig->getValue(Self::ENABLE, ScopeInterface::SCOPE_STORE);\n\t}",
"public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }",
"public static function published_product_should_be_synced( \\WC_Product $product ) {\n\n\t\t$should_sync = self::is_sync_enabled_for_product( $product );\n\n\t\t// define the product to check terms on\n\t\tif ( $should_sync ) {\n\t\t\t$terms_product = $product->is_type( 'variation' ) ? wc_get_product( $product->get_parent_id() ) : $product;\n\t\t} else {\n\t\t\t$terms_product = null;\n\t\t}\n\n\t\t// allow simple or variable products (and their variations) with zero or empty price - exclude other product types with zero or empty price\n\t\tif ( $should_sync && ( ! $terms_product || ( ! self::get_product_price( $product ) && ! in_array( $terms_product->get_type(), array( 'simple', 'variable' ) ) ) ) ) {\n\t\t\t$should_sync = false;\n\t\t}\n\n\t\t// exclude products that are excluded from the store catalog or from search results\n\t\tif ( $should_sync && ( ! $terms_product || has_term( array( 'exclude-from-catalog', 'exclude-from-search' ), 'product_visibility', $terms_product->get_id() ) ) ) {\n\t\t\t$should_sync = false;\n\t\t}\n\n\t\t// exclude products that belong to one of the excluded terms\n\t\tif ( $should_sync && ( ! $terms_product || self::is_sync_excluded_for_product_terms( $terms_product ) ) ) {\n\t\t\t$should_sync = false;\n\t\t}\n\n\t\treturn $should_sync;\n\t}",
"protected function _isMageEnterprise()\n {\n return Mage::getConfig()->getModuleConfig('Enterprise_Enterprise')\n && Mage::getConfig()->getModuleConfig('Enterprise_Cms');\n }",
"public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_ACTIVE)\n && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE);\n }",
"public function canStoreEnabled();",
"protected function isSingleStoreMode()\n {\n return Mage::app()->isSingleStoreMode();\n }",
"public function isFromVendor(): bool;",
"public function isInstalled()\n {\n return $this->getDataVersion() && $this->getOldStores();\n }",
"protected function isTwoWaySyncEnabled($entity)\n {\n $channel = $entity->getChannel();\n return $channel && $channel->getSynchronizationSettings()->offsetGetOr('isTwoWaySyncEnabled', false)\n && $channel->isEnabled();\n }",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public static function product_should_be_synced( \\WC_Product $product ) {\n\n\t\treturn 'publish' === $product->get_status() && self::published_product_should_be_synced( $product );\n\t}",
"public function isMagentoConnect() {\n\t\treturn ($this->getModule() == RublonMagentoModule::CONNECT);\n\t}",
"private function _isValidPointDomain($domain)\n {\n //get site\n $site = $this->cart->getSite();\n \n //check from site list\n $result = Site::where('pointdomain_url', $domain)\n ->where('id', '!=', $site->id)\n ->count();\n \n if($result > 0)\n {\n return false;\n }\n \n return true; \n }",
"public function isSupportedProduct()\n {\n /** @var Oyst_OneClick_Model_Catalog $oystCatalog */\n $oystCatalog = Mage::getModel('oyst_oneclick/catalog');\n\n return $oystCatalog->isSupportedProduct($this->getProduct());\n }",
"public function hasStore(): bool;",
"public function isVconnetEnabled() {\n\t\n\t\t$installed = Mage::helper('core')->isModuleEnabled('Vconnect_Postnord');\n\t\t\n\t\tif($installed == true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\n\t}",
"public function isGiftWrappingAvailableForOrder($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ORDER, $store);\n }",
"public function isExtensionConfigured($store_id = null) {\n $js_api_key = $this->getJsApiKey($store_id);\n $rest_api_key = $this->getRestApiKey($store_id);\n\n return (\n $this->isExtensionEnabled($store_id)\n && !empty($js_api_key)\n && !empty($rest_api_key)\n );\n }",
"protected function isInstalled(){\n\t\t$dsn = Configuration::get('dsn', '');\n\t\t//echo \"dsn = \" . $dsn . \"--\";\n\t\tif ($dsn == ''){\n\t\t\t$alreadyInstalled = false;\n\t\t}\n\t\telse{\n\t\t\t$alreadyInstalled = true;\n\t\t}\n\t\treturn $alreadyInstalled;\n\t}",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_TRANSACTIONAL_API_ENABLED);\n }",
"private function isInstalled()\n {\n /** @var \\Magento\\Framework\\App\\DeploymentConfig $deploymentConfig */\n $deploymentConfig = $this->objectManager->get(\\Magento\\Framework\\App\\DeploymentConfig::class);\n return $deploymentConfig->isAvailable();\n }",
"public function isSeller(){\n\t\t\tif ($this->config->get('module_purpletree_multivendor_status')) {\n\t\t$query = $this->db->query(\"SELECT id, store_status, multi_store_id, is_removed FROM \" . DB_PREFIX . \"purpletree_vendor_stores where seller_id='\".$this->customer_id.\"'\");\n\t\treturn $query->row;\n\t}\n\t}",
"public function isGiftWrappingAvailableForProduct($productConfig, $store = null)\n {\n if (is_null($productConfig) || '' === $productConfig) {\n return $this->isGiftWrappingAvailableForItems($store);\n } else {\n return $productConfig;\n }\n }",
"public function isStockEnabledBackend()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_BACKEND_STOCK_CHECK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function enabled($store = null);",
"public function isStoreActive() {\r\n\t\treturn $this->_storeManager->getStore()->isActive();\r\n\t}",
"function _check_product_in_db($product){\n if (in_array($product, $this->db)){\n // echo 'Product already in the database.';\n return True;\n }\n // echo 'Product not in the database.';\n return False;\n }",
"public function quoteHasServiceProduct()\n {\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n if (!$quote->hasData('has_service_product')) {\n $quote->setData('has_service_product', false);\n foreach ($quote->getAllVisibleItems() as $item) {\n if ($this->isQuoteItemServiceProduct($item)) {\n $quote->setData('has_service_product', true);\n break;\n }\n }\n }\n\n return $quote->getData('has_service_product');\n }",
"public function isTestModeEnabled($store = null) {\n return $this->getTestModeEnabledFlag($store) || !Mage::helper(\"klevu_search\")->isProductionDomain(Mage::app()->getStore($store)->getBaseUrl());\n }",
"public function isPartialPaymentSupport($store = null)\n {\n return !$this->getVersionConfig($store)->isPartialPaymentDisabled();\n }",
"public function isAvailable($storeId)\n {\n $active = $this->config->isModuleEnabled($storeId);\n if (!$active) {\n return false;\n }\n\n $apiKey = $this->getApiKey($storeId);\n if (empty($apiKey)) {\n return false;\n }\n\n return true;\n }",
"public function getAsync()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ASYNC);\n }",
"public function checkEnabled()\n {\n $app_id = $this->_application->id;\n return $this->app->zoocart->getConfig($app_id)->get('enable_cart');\n }",
"public function isConfiguredForThisStore()\n {\n return $this->getUsername() && $this->isEnabled();\n }",
"public function isSingleStoreMode()\n {\n if (!Mage::app()->isSingleStoreMode()) {\n return false;\n }\n return true;\n }",
"public function isValidInstall() {\n\t\treturn $this->install !== null;\n\t}",
"public function isCatalogBackendManageStockVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_MANAGE_STOCK);\n }",
"public function checkFieldStatus()\n {\n $helper = $this->helper;\n $product = $this->coreRegistry->registry('product');\n $productType = $product->getTypeId();\n $allowedsProducts = explode(',', $helper->getAllowedProductType());\n if (in_array($productType, $allowedsProducts)) {\n return true;\n }\n return false;\n }",
"public function updateVariantProducts($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_UPDATE_VARIANT, $store));\n }",
"public function check_site_loaded( $shop_subdomain )\r\n\t {\r\n\t \tif( ENVIRONMENT != 'production')\r\n\t \t\treturn False;\r\n\t\t$data = $this->php_session->get('shop_' . $shop_subdomain ); \r\n\t\tif( is_null($data) or ! isset( $data['products'] ) )\r\n\t\t{\r\n\t\t\treturn False;\r\n\t\t}\r\n\t\t\r\n\t\t//check time expired\r\n\t\t//30 minutes expire\r\n\t\tif( time() >= ( $data['last_updated'] + ( 60 * 30) ) )\r\n\t\t\treturn False;\r\n\t\treturn True;\r\n\t }",
"public function isAutoLoginEnabled()\n {\n return $this->scopeConfig->getValue(\n self::AUTO_LOGIN_ENABLE,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isEnabled()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ENABLED);\n }",
"public static function isEnabled()\n {\n $app_model = new waAppSettingsModel();\n $is_enabled = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID . '-profile');\n $profile_cookie = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID_SHORT . '-profile-cookie');\n $cookie_enabled = $profile_cookie && waRequest::cookie($profile_cookie, '');\n return $is_enabled && $cookie_enabled;\n }",
"public function canShow(){\n\t\tif (Mage::getStoreConfig('logicbroker_edi_section/logicbroker_edi_group1/notificationstatus') == 0) {\n\t\t\t$this->setConfigValue(array(\n\t\t\t\t'scope' => 'default',\n\t\t\t\t'scope_id' => '0',\n\t\t\t\t'path' => 'logicbroker_edi_section/logicbroker_edi_group1/notificationstatus',\n\t\t\t\t'value' => '1',\n\t\t\n\t\t\t\t));\n\t\t\treturn true;\n }else{\n \treturn false;\n }\n\t}",
"public function is_calendar_sync_enabled() {\n return $this->is_connected() && $this->get_calendar_id();\n }",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"protected static function isInstallToolSession() {}",
"public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }",
"public function enabled()\n {\n return extension_loaded('ibm_db2');\n }",
"public function isStockEnabledFrontend()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_STOCK_CHECK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function getEnabled()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/enabled', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }",
"public function productExist()\n {\n if ($this->product) {\n $ret = true;\n } else {\n $ret = false;\n }\n \n return $ret;\n }",
"public function updateMasterProducts($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_UPDATE_MASTER, $store));\n }",
"public function isValid()\n {\n if (empty($this->getToken(true))) {\n return false;\n }\n\n if (Config::get('shopify-app.auth_jwt')) {\n // Check token validity\n $response = $this->shop->api()->request(\n 'GET',\n '/admin/api/shop.json',\n ['fields' => 'myshopify_domain']\n )->body;\n\n return $response instanceof \\stdClass && $response->shop->myshopify_domain === $this->shop->shopify_domain;\n\n } else {\n return $this->getDomain() !== null && $this->getDomain() === $this->shop->shopify_domain;\n }\n }",
"public function isEnabled()\n {\n return $this->getStoreConfig(self::MODULE_ENABLED);\n }",
"public function isEnabled()\n\t{\n\t\treturn $this->checkComponent('com_ssrrn_msc');\n\t}",
"public function isEnabled(int $storeId = null): bool;",
"private function isSingleCourseSync(): bool\n {\n return !empty($this->maconomyId);\n }",
"public function isEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n 'orderflow_inventory_import/settings/is_enabled',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n }",
"public function enabled()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->issetCustomExec())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->fields['USE']->getValue() == 'Y';\n\t}",
"public function hasInstall();",
"public function isEnabled()\n {\n return Mage::getStoreConfig('refersion/refersion_settings/refersion_active');\n }",
"public function isEnabledCart()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_CART);\n }",
"public function getEnabled()\n {\n return array_filter($this->storage, function($val)\n {\n return $val['status'] === ProviderInterface::STATUS_INSTALLED;\n });\n }",
"function available()\n {\n $db =& JFactory::getDBO();\n $query = 'select count(*) from #__extensions as a where a.element = ' . $db->Quote('com_community') . ' AND a.enabled=1';\n\t\t$db->setQuery($query);\n\t\t$count = (int)$db->loadResult();\n if ($count > 0)\n return true;\n\n return false;\n }",
"public function checkAvailability($domain)\n {\n $row = $this->getModuleRow();\n $api = $this->getApi($row->meta->user, $row->meta->key, $row->meta->sandbox == 'true');\n\n $all = new IspapiAll($api);\n\n $command = array(\n \"COMMAND\" => \"CheckDomain\",\n \"DOMAIN\" => $domain,\n );\n \n $response = $all->ispapiCall($command);\n // Handling api errors\n $this->processResponse($api, $response);\n $response = $response->response();\n // Code 210 is for avaialble domains\n if ($response['CODE'] != '210') {\n return false;\n }\n\n return $response['CODE'] == 210;\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public static function isProdEnvironment()\r\n {\r\n return in_array($_SERVER['HTTP_HOST'], static::getProdDomains());\r\n }",
"public function isStoreAdmin() {\n return $this->authorise('store.admin', 'store');\n }",
"public function isDataInstalled() {\n $check = Mage::getModel('inventoryplus/install')\n ->getCollection()\n ->setPageSize(1)\n ->setCurPage(1)\n ->getFirstItem();\n if ($check->getStatus() != 1) {\n $isInsertData = Mage::getModel('inventoryplus/checkupdate')\n ->getCollection()\n ->setPageSize(1)\n ->setCurPage(1)\n ->getFirstItem()\n ->getIsInsertData();\n if ($isInsertData != 1) {\n return 0;\n } else {\n $check->setStatus(1);\n try {\n $check->save();\n } catch (Exception $e) {\n throw $e;\n }\n }\n }\n return 1;\n }",
"public function isPhoneMandatorySupport($store = null)\n {\n return $this->getVersionConfig($store)->isPhoneMandatorySupport();\n }",
"public function isTrackingAllowed() {\n\t $data = Mage::getStoreConfig('rublon_allow_tracking');\n\t \t\t\n\t return !empty($data)?true:false;\n\t}",
"public function using_woocommerce() {\n if ( $this->using_ecommerce() === false )\n return false;\n\n return in_array( 'woocommerce', $this->ecommerce_providers );\n }",
"public function is_elex_dpd_enabled() {\n\t\treturn class_exists( 'Elex_dp_dynamic_pricing_plugin' );\n\t}",
"public function authorize()\n { \n $this->shop = Auth::user()->shop;\n\n if($this->method() == 'PUT' || $this->method() == 'PATCH') {\n $product = Product::findorFail($this->route('product'));\n\n return $product->shop_id == $this->shop->id;\n }\n\n return true;\n }",
"public function isLogEnable() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE);\n }",
"function wrmp_is_installed()\n{\n\treturn wrmp_get_settingsgroup();\n}",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag('training_layred/catalog/enabled');\n }",
"public static function checkForNearProducts() {\n $cartDeliveryPostcodeSessionKey = \\Config::get('appConstants.user_delivery_postcode_session_key');\n $landingPagePostcodeSessionKey = \\Config::get('appConstants.user_landing_postcode_session_key');\n $landingPostcode = session()->get($landingPagePostcodeSessionKey, '');\n $cartPostcode = session()->get($cartDeliveryPostcodeSessionKey, '');\n if (!empty($landingPostcode)\n || !empty($cartPostcode)\n ) {\n return true;\n }\n return false;\n }",
"public function canFireCheckout()\n {\n return (bool)Mage::getStoreConfig('firecheckout/general/enabled');\n }",
"public function isInstall()\n {\n try {\n $config = $this->container->get(\"config\");\n } catch (NotFoundExceptionInterface $e) {\n return false;\n } catch (ContainerExceptionInterface $e) {\n return false;\n }\n return (\n isset($config[CsvAbstractFactory::KEY_DATASTORE][BarcodeCsv::class]) &&\n file_exists($this->getStoragePath())\n );\n }",
"public function isEnabledInSystem()\r\n\t{\r\n\t\t// Get global vars\r\n\t\tglobal $realtime_webservice_global_enabled;\r\n\t\t// If both vars have a value, then it IS enabled\r\n\t\treturn $realtime_webservice_global_enabled;\r\n\t}"
] | [
"0.7941048",
"0.69490826",
"0.69406486",
"0.6827529",
"0.6777556",
"0.6437757",
"0.6380422",
"0.606974",
"0.5989923",
"0.59848136",
"0.5904683",
"0.58715326",
"0.5848788",
"0.58290184",
"0.5819734",
"0.5766202",
"0.56785417",
"0.5646732",
"0.56383455",
"0.5635939",
"0.5631859",
"0.5617402",
"0.55538166",
"0.55336624",
"0.55316216",
"0.5523413",
"0.5519608",
"0.55102575",
"0.5480729",
"0.5475141",
"0.5449324",
"0.544661",
"0.54023576",
"0.5390717",
"0.53811437",
"0.5375804",
"0.53701735",
"0.536394",
"0.53610873",
"0.53581756",
"0.5354493",
"0.53529197",
"0.53391886",
"0.5338802",
"0.532876",
"0.5312494",
"0.5310775",
"0.5309474",
"0.5306787",
"0.52985656",
"0.5293254",
"0.52928066",
"0.5287275",
"0.5284996",
"0.52785206",
"0.52775735",
"0.5271288",
"0.5263983",
"0.52611417",
"0.5256149",
"0.5255781",
"0.52441",
"0.5239763",
"0.5225939",
"0.5223558",
"0.5219353",
"0.5206706",
"0.52021885",
"0.5200018",
"0.5199873",
"0.5196511",
"0.5194167",
"0.5192472",
"0.5189801",
"0.51889837",
"0.51758784",
"0.51757187",
"0.5175271",
"0.5175214",
"0.516792",
"0.5162422",
"0.51571596",
"0.515575",
"0.51539785",
"0.51539785",
"0.5152273",
"0.5150369",
"0.51490253",
"0.51467514",
"0.5145641",
"0.5145436",
"0.51454306",
"0.51450837",
"0.51341474",
"0.5128764",
"0.5128426",
"0.5123225",
"0.51089203",
"0.5099693",
"0.50961447"
] | 0.77698475 | 1 |
Return the configured frequency expression for Product Sync. | public function getProductSyncFrequency() {
return Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_FREQUENCY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getOrderSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);\n }",
"public function getUpdateFrequency()\n {\n return Mage::getStoreConfig(self::XML_PATH_UPDATE_FREQUENCY);\n }",
"public function getClockFrequency()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_CLOCK_FREQUENCY, $payload);\n\n $payload = unpack('V1frequency', $data);\n\n return IPConnection::fixUnpackedUInt32($payload, 'frequency');\n }",
"public function getChangeFrequency() {\n if ($this->getModule() != '') {\n return 'hourly';\n }\n return 'weekly';\n }",
"public function getChangeFrequency()\n {\n return $this->changeFrequency;\n }",
"protected function frequency()\n {\n return 'monthly';\n }",
"public function getfrequency() {\n return['1' => 'Frequency 1', '2' => 'Frequency 2', '3' => 'Frequency 3', '4' => 'Frequency 4'];\n }",
"public function getFrequencyId()\n {\n return $this->frequency_id;\n }",
"public static function __calcFreq()\n {\n foreach (self::$original_freq as $key => $value) {\n self::$FREQ[$key] = log($value / self::$total);\n }\n self::$min_freq = min(self::$FREQ);\n }",
"public function getCronFrequency(): string;",
"function getFrequency() { return $this->readStep(); }",
"public function getAlertFrequency(){\n\t\treturn($this->alertFrequency);\n\t}",
"protected function getPeriodicidad() {\n\t\treturn 'mensual';\n\t}",
"public function getFrequencia() {\n return $this->sFrequencia;\n }",
"public function getSubscriptionFrequencyLabel()\n {\n $count = $this->getSubscription()->getFrequencyCount();\n $unit = $this->getSubscription()->getFrequencyUnit();\n\n if ($count > 1) {\n $unitLabel = $this->periodModel->getOptionTextPlural($unit);\n } else {\n $unitLabel = $this->periodModel->getOptionText($unit);\n }\n\n return __('%1 %2', $count, $unitLabel);\n }",
"public function getFrequency(): ?Frequency\n {\n if (is_array($this->{self::FREQUENCY}))\n $this->setFrequency(new Frequency($this->{self::FREQUENCY}));\n\n return $this->{self::FREQUENCY};\n }",
"public function getPeriodicity()\n {\n return $this->_periodicity;\n }",
"public static function getIdfFreq()\n {\n return SerializerFactory::getSerializer()->decode(\n file_get_contents(Helper::getDictBasePath(Dict::SERIALIZED) . 'idf.' . SerializerFactory::getExtension())\n );\n }",
"public static function iaf()\n {\n return self::createAudioFrequency(self::IAF);\n }",
"public function getPublicationFrequency()\n {\n return $this->getFieldArray('310', ['a', 'b']);\n }",
"function paymentFrequency($cycle)\n{\n if ($cycle == 'thirty') {\n $paymentTerm = 30;\n }\n else if ($cycle == 'sixty') {\n $paymentTerm = 60;\n }\n else if ($cycle == 'ninety') {\n $paymentTerm = 90;\n }\n else {\n $paymentTerm = 30; # Default if option is not chosen.\n }\n return $paymentTerm;\n}",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"public function tFrequencies()\n {\n return json_encode($this->frequencies);\n }",
"public function getDocumentProductDiscount()\n {\n return (string) $this->document_product_discount;\n }",
"protected static function createAudioFrequency($qualifier)\n {\n return new self($qualifier);\n }",
"public function getDocumentProductCfop()\n {\n return (string) $this->document_product_cfop;\n }",
"public function refreshFrequency($frq)\n {\n $this->frequency = $frq;\n return $this;\n }",
"function scorm_get_updatefreq_array(){\n return array(0 => get_string('never'),\n 1 => get_string('everyday','scorm'),\n 2 => get_string('everytime','scorm'));\n}",
"public function allowedFrequencies()\n\t{\n\t\treturn array( 'immediate', 'offline', 'daily', 'weekly' );\n\t}",
"public function getDocumentProductCofinsAliquota()\n {\n return (string) $this->document_product_cofins_aliquota;\n }",
"public static function frequency($_secs) {\n\t\t$_freq['hourly']=3600;\n\t\t$_freq['daily']=86400;\n\t\t$_freq['weekly']=604800;\n\t\t$_freq['monthly']=2592000;\n\t\tforeach ($_freq as $_key=>$_val)\n\t\t\tif ($_secs<=$_val)\n\t\t\t\treturn $_key;\n\t\treturn 'yearly';\n\t}",
"public function getProductWeightUnit()\n {\n return (string) $this->getConfig(\n 'packages/global_settings_default_weight_unit');\n }",
"public static function getFrequencyOptions()\n {\n $translatedOptions = array();\n foreach (self::$frequencyOptions as $key => $value) {\n $translatedOptions[$key] = Craft::t($value);\n }\n\n return $translatedOptions;\n }",
"public function setFrequency($value)\n {\n return $this->set(self::_FREQUENCY, $value);\n }",
"public function setFrequency($value)\n {\n return $this->set(self::_FREQUENCY, $value);\n }",
"public function getFrequencyAllowableValues()\n {\n return [\n self::FREQUENCY_WEEKLY,\n self::FREQUENCY_BIWEEKLY,\n self::FREQUENCY_EVERY,\n self::FREQUENCY_EVERY_10_DAYS,\n self::FREQUENCY_EVERY_24_DAYS,\n self::FREQUENCY_EVERY_28_DAYS,\n self::FREQUENCY_MONTHLY,\n self::FREQUENCY_EVERY_45_DAYS,\n self::FREQUENCY_EVERY_2_MONTHS,\n self::FREQUENCY_EVERY_3_MONTHS,\n self::FREQUENCY_EVERY_4_MONTHS,\n self::FREQUENCY_EVERY_6_MONTHS,\n self::FREQUENCY_YEARLY,\n self::FREQUENCY_EVERY_4_WEEKS,\n self::FREQUENCY_EVERY_6_WEEKS,\n self::FREQUENCY_EVERY_8_WEEKS,\n ];\n }",
"public function getStoreToOrderRate();",
"function getDiscountFor($product) {\n\t\treturn 30;\n\t}",
"public function getRateQualifier()\n {\n return $this->rateQualifier;\n }",
"public function getFrequency(ConnectionInterface $con = null)\n {\n if ($this->aFrequency === null && ($this->frequency_id !== null)) {\n $this->aFrequency = FrequencyQuery::create()->findPk($this->frequency_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aFrequency->addBiblios($this);\n */\n }\n\n return $this->aFrequency;\n }",
"public function getFullCost()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->price * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }",
"public function getSpectate(): string\n {\n return $this->spectate;\n }",
"public function getNotificationPeriod() {\n\t\treturn $this->notificationPeriod;\n\t}",
"public function calibrateDevice(): int\n {\n $total = 0;\n $this->allFrequency = [];\n $foundDuplicateFrequency = false;\n\n $runNumber = 0;\n\n while ($foundDuplicateFrequency === false) {\n\n echo \"\\r\\n-------- RUN \" . ++$runNumber . \"-------------\\r\\n\";\n\n foreach ($this->inputArray as $inputValue) {\n $total += (int)$inputValue;\n $foundDuplicateFrequency = in_array($total, $this->allFrequency, true);\n $this->allFrequency[] = $total;\n if ($foundDuplicateFrequency) {\n echo \" \\r\\nFound duplicate \\r\\n\";\n break;\n }\n }\n }\n\n return $this->allFrequency[count($this->allFrequency) - 1];\n }",
"public function getProduceSpeed()\n {\n return $this->get(self::_PRODUCE_SPEED);\n }",
"public function setChangeFrequency($changeFrequency)\n {\n $this->changeFrequency = (string) $changeFrequency;\n\n return $this;\n }",
"protected function getConfigName()\n {\n return 'realtime';\n }",
"public function getMinimalValueInstallment()\n {\n $numberOfInstallments = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALMENT_MINIMAL);\n if($numberOfInstallments <= 9){\n $numberOfInstallments = 10;\n }\n return $numberOfInstallments ;\n }",
"public function getLogDecimalFactor() {\n return number_format(Mage::getStoreConfig(self::XML_PATH_DECIMAL_FACTOR), 2, '.', '');\n }",
"public function noFreqs(): self\n {\n $this->arguments[] = 'NOFREQS';\n\n return $this;\n }",
"public function getFrequencyReadable($frequency) {\n\t\t\n\t\tif(empty($frequency)){\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$frequencyString = '';\n\t\t\n\t\t$frequencyList = DBUtil::strToArray($frequency);\n\t\t\n\t\tif(isset($frequencyList[0]) && $frequencyList[0] == '1') {\n\t\t\t$frequencyString.= 'Su ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[1]) && $frequencyList[1] == '1') {\n\t\t\t$frequencyString.= 'M ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[2]) && $frequencyList[2] == '1') {\n\t\t\t$frequencyString.= 'Tu ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[3]) && $frequencyList[3] == '1') {\n\t\t\t$frequencyString.= 'W ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[4]) && $frequencyList[4] == '1') {\n\t\t\t$frequencyString.= 'Th ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[5]) && $frequencyList[5] == '1') {\n\t\t\t$frequencyString.= 'F ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[6]) && $frequencyList[6] == '1') {\n\t\t\t$frequencyString.= 'Sa ';\n\t\t}\n\t\t\n\t\t// Trim and add commas\n\t\t$frequencyString = str_replace(' ', ',', trim($frequencyString));\n\t\t\n\t\tif($frequencyString == ''){\n\t\t\t$frequencyString = 'No Days';\n\t\t}\n\t\t\n\t\treturn $frequencyString;\n\t}",
"public function getEnergyAttribute()\n {\n $energy = 0;\n\n if (! empty($this->attributes['energy'])) {\n $energy = $this->attributes['energy'];\n }\n\n $produced = round(\n $this->production_rate / 3600 * Carbon::now()->diffInSeconds($this->last_energy_changed)\n );\n\n return $energy + $produced;\n }",
"public function getConstitutionPeriod()\n {\n return $this->constitutionPeriod;\n }",
"function getTextFrequency(){\n\t\t$freq = array(); \t\t// inisialisasi frequensi\n\t\t$this->firstBit = \"\";\t// inisialisasi bit awal\n\n\t\tfor ($i = 0; $i < strlen($this->textInside); $i++) { //melakukan perulangan untuk setiap char dalam text\n\t \n\t $letter = $this->textInside[$i]; //mengambil char ke-i dalam text\n\t $this->firstBit .= sprintf(\"%08d\",decbin(ord($letter)));\t\t//menambahkan binary char ke-i dan disimpan ke firstbit\n\t \n\t if (array_key_exists($letter, $freq)) { //mengecek apakah char ke-i sudah ada dalam array frekuensi atau tidak\n\t $freq[$letter]++;\t\t//menambahkan jumlah char \n\t } else {\n\t $freq[$letter] = 1;\t\t//menginisialisasi jumlah char\n\t }\n\t }\n\n\t return $freq;\t\t//mengembalikan nilai frekuensi dalam array\n\t}",
"public function getQuantite()\n {\n return $this->quantite;\n }",
"public function getDistribution(): string\n {\n if ($this->distribution === null) {\n $this->distribution = $this->lookupDistribution();\n }\n\n return $this->distribution;\n }",
"public function getRotateFrequency( $value, $defaultValue = 0 )\n {\n // die('value '.$value);\n $items = array(\n '0' => array( 'value' => 0, 'text' => 'never' ),\n );\n foreach (range(1, 24) as $i) {\n $items[$i] = array( 'value' => $i, 'text' => \"every $i \".($i == 1 ? 'hour' : 'hours') );\n }\n\n $inputSettings = array(\n 'value' => $value,\n 'defaultValue' => $defaultValue,\n 'name' => 'rotateFrequency',\n 'items' => $items,\n );\n\n $labelSettings = array(\n 'text' => 'Rotate Frequency',\n );\n\n $options = array(\n 'attributes' => array(\n 'class' => 'form-item'\n )\n );\n\n return $this->getSelect( $inputSettings, $labelSettings, $options );\n }",
"public function get_interface_wireless_rx_frequency($interface_obj)\r\n\t{\r\n\t}",
"public function __construct($frequency)\n {\n $this->frequency = $frequency;\n }",
"public function get_signalStrength(): int\n {\n return $this->_dbm;\n }",
"public function get_signalStrength(): int\n {\n return $this->_dbm;\n }",
"public function getFreqParenting()\n {\n return $this->freq_parenting;\n }",
"public function frequency( $pageType, $object = false, $objectType = null ) {\n\t\t$frequency = ! empty( $object->frequency ) && 'default' !== $object->frequency ? $object->frequency : parent::frequency( $pageType, $object, $objectType );\n\t\treturn $frequency;\n\t}",
"public function setFrequency($frequency)\n {\n $this->frequency = $frequency;\n }",
"public function getDiscCalc() {\n return $this->_discCalc;\n }",
"public function getFFT() {\n\t\treturn $this->w1;\n\t}",
"public static function frequency()\n {\n $args = func_get_args();\n $argc = count($args);\n if ($argc < 2 || $argc % 2 != 0) {\n throw new \\InvalidArgumentException();\n }\n $total = array_sum(FP::realize(FP::takeNth(2, $args)));\n $pairs = FP::realize(FP::partition(2, $args));\n return self::choose(1, $total)->bindGen(\n function (RoseTree $rose) use ($pairs) {\n $n = $rose->getRoot();\n foreach ($pairs as $pair) {\n list($chance, $gen) = $pair;\n if ($n <= $chance) {\n return $gen;\n }\n $n = $n - $chance;\n }\n }\n );\n }",
"public function getSamplingRate()\n {\n return $this->floatValue('sampling.rate', 1.0, 0.0, 1.0);\n }",
"public function get_powerFactor(): float\n {\n // $res is a float;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::POWERFACTOR_INVALID;\n }\n }\n $res = $this->_powerFactor;\n if ($res == self::POWERFACTOR_INVALID) {\n $res = $this->_cosPhi;\n }\n $res = round($res * 1000) / 1000;\n return $res;\n }",
"public function getStoreToBaseRate();",
"public function getDocumentProductCest()\n {\n return (string) $this->document_product_cest;\n }",
"public function getDocumentProductNcm()\n {\n return (string) $this->document_product_ncm;\n }",
"public function getMode()\n {\n $value = $this->_config->get('dataprocessing/general/mode');\n\n if ($value === null) {\n $value = 'products';\n }\n\n return $value;\n }",
"public static function get_subscription_mode($reactforum) {\n return $reactforum->forcesubscribe;\n }",
"public function getAudioSampleRate() {}",
"public function getNotifyStockQty()\n {\n return (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY);\n }",
"protected function getMetricsListType(): string\n {\n return ProductAdReportMetricsList::class;\n }",
"public function getFrequency(): int\n {\n $total = 0;\n foreach ($this->inputArray as $inputValue) {\n $total += (int)$inputValue;\n }\n return $total;\n }",
"public function getQuarter(): string\n {\n return $this->toLocalizedString('Q');\n }",
"public function getSampleRate()\n {\n return isset($this->sample_rate) ? $this->sample_rate : 0.0;\n }",
"public function spec() {\n $s= '';\n foreach ($this->conditions as $condition) {\n $s.= ','.$condition->spec();\n }\n return (string)substr($s, 1);\n }",
"public function getProductPriceType()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/base_price', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }",
"public function getExchangeRate();",
"public function getRatePeriod()\n {\n return $this->ratePeriod;\n }",
"function qualificationServ(): string\n{\n $FtPqr = getFtPqr();\n $FtPqrCalificacion = $FtPqr->getLastCalificacion();\n\n return $FtPqrCalificacion ? $FtPqrCalificacion->getFieldValue('experiencia_servicio') : '-';\n}",
"public function getUsedPower() {\r\n return $this->cached_claimed_plots_count * $this->factionsLevel->getSettings()->powerPerPlot;\r\n }",
"public function getShowInProduct()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_presentation/show_product', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }",
"private function lookupDistribution(): string\n {\n $res = self::$wmi->ExecQuery('SELECT * FROM Win32_OperatingSystem');\n\n foreach ($res as $os) {\n return $os->Caption;\n }\n\n return 'Windows NT';\n }",
"public function getDataExclusivityPeriod()\n {\n return $this->dataExclusivityPeriod;\n }",
"public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }",
"public function getFiscalNumber()\n {\n return $this->getValue('nb_icontact_prospect_fiscal_number');\n }",
"function qualificationGest(): string\n{\n $FtPqr = getFtPqr();\n $FtPqrCalificacion = $FtPqr->getLastCalificacion();\n\n return $FtPqrCalificacion ? $FtPqrCalificacion->getFieldValue('experiencia_gestion') : '-';\n}",
"public function getDocumentProductCofinsCst()\n {\n return (string) $this->document_product_cofins_cst;\n }",
"public function getComprehensionExpr()\n {\n return $this->readOneof(9);\n }",
"function model()\n {\n return 'Webkul\\CartRule\\Contracts\\CartRuleCouponUsage';\n }",
"public function setFreq($freq)\n {\n if (self::FREQ_YEARLY === $freq || self::FREQ_MONTHLY === $freq\n || self::FREQ_WEEKLY === $freq\n || self::FREQ_DAILY === $freq\n ) {\n $this->freq = $freq;\n } else {\n throw new \\InvalidArgumentException(\"The Frequency {$freq} is not supported.\");\n }\n\n return $this;\n }",
"public function getDeliveryFrequency(): ?NotificationDeliveryFrequency {\n $val = $this->getBackingStore()->get('deliveryFrequency');\n if (is_null($val) || $val instanceof NotificationDeliveryFrequency) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deliveryFrequency'\");\n }",
"public function getDocumentProductIcmsAliquota()\n {\n return (string) $this->document_product_icms_aliquota;\n }"
] | [
"0.6913802",
"0.6913802",
"0.68953407",
"0.6617102",
"0.6462655",
"0.6305728",
"0.6224425",
"0.6216743",
"0.62010956",
"0.5857624",
"0.582219",
"0.5792854",
"0.5759783",
"0.56721723",
"0.55765706",
"0.55165136",
"0.5486093",
"0.5224401",
"0.52086717",
"0.5183178",
"0.51383287",
"0.51233184",
"0.5117519",
"0.50742084",
"0.50089663",
"0.5007341",
"0.5006182",
"0.49784994",
"0.4973869",
"0.49638876",
"0.4934495",
"0.48637462",
"0.48358163",
"0.48157874",
"0.47977343",
"0.47957882",
"0.47957882",
"0.476645",
"0.4756983",
"0.47216022",
"0.47152302",
"0.47081998",
"0.46933818",
"0.46623564",
"0.4643439",
"0.4635377",
"0.46233785",
"0.46102393",
"0.46102002",
"0.46080086",
"0.45936486",
"0.45748913",
"0.45740077",
"0.45726633",
"0.4566055",
"0.4564268",
"0.45419043",
"0.4532284",
"0.45221114",
"0.45075363",
"0.45071587",
"0.4500056",
"0.4500056",
"0.44993106",
"0.44993067",
"0.44986448",
"0.4496776",
"0.44925392",
"0.44879562",
"0.44824424",
"0.44780758",
"0.4469469",
"0.4460516",
"0.44538262",
"0.44455618",
"0.4444927",
"0.4443435",
"0.44404343",
"0.44377533",
"0.44319147",
"0.44297406",
"0.4422608",
"0.44137686",
"0.44119775",
"0.44089037",
"0.44034922",
"0.44004214",
"0.439926",
"0.43964404",
"0.43934172",
"0.43913803",
"0.43872392",
"0.4385737",
"0.4381461",
"0.43788567",
"0.43776342",
"0.4374193",
"0.43736175",
"0.4364608",
"0.43642917"
] | 0.76718354 | 0 |
Set the last Product Sync run time in System Configuration for the given store. | public function setLastProductSyncRun($datetime = "now", $store = null) {
if (!$datetime instanceof DateTime) {
$datetime = new DateTime($datetime);
}
$this->setStoreConfig(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, $datetime->format(static::DATETIME_FORMAT), $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"public function hasProductSyncRun($store = null) {\n $config = Mage::getConfig();\n\n if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, \"store\", $store)) {\n return false;\n }\n\n return true;\n }",
"public function setExecUpdateOnSave()\n {\n Configuration::updateValue('DF_UPDATE_ON_SAVE_LAST_EXEC', date('Y-m-d H:i:s'));\n }",
"public function setSyncTime(): void\n {\n }",
"public function setLastUpdate()\n {\n Mage::app()->saveCache(time(), 'admin_notifications_lastcheck');\n// $config = Mage::getModel('core/config');\n// /* @var $config Mage_Core_Model_Config */\n// $config->saveConfig(self::XML_LAST_UPDATE_PATH, time());\n return $this;\n }",
"private function setLastUpdateDate( $date ) {\n Mage::getModel('core/config')->saveConfig('taxjar/config/last_update', $date);\n }",
"public function getProductSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_FREQUENCY);\n }",
"public function setSysLastChanged() {}",
"abstract function setStore(string $storeKey, int $time = null);",
"public function uploadConfig($store)\n {\n parent::uploadConfig($store);\n\n $this->extend('updateConfig', $store);\n }",
"public function setLastSyncDateTime($val)\n {\n $this->_propDict[\"lastSyncDateTime\"] = $val;\n return $this;\n }",
"public function setLastSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSyncDateTime', $value);\n }",
"public function getLastUpdate()\n {\n return Mage::app()->loadCache('admin_notifications_lastcheck');\n// return Mage::getStoreConfig(self::XML_LAST_UPDATE_PATH);\n }",
"public function setLastOrderSyncRun($datetime = \"now\") {\n if (!$datetime instanceof DateTime) {\n $datetime = new DateTime($datetime);\n }\n\n $this->setGlobalConfig(static::XML_PATH_ORDER_SYNC_LAST_RUN, $datetime->format(static::DATETIME_FORMAT));\n\n return $this;\n }",
"public function getLastManualRefreshTime()\n {\n return $this->get(self::_LAST_MANUAL_REFRESH_TIME);\n }",
"private function _set_sync($server_time) {\n\t\t$server_time = hexdec(bin2hex($server_time));\n\t\t$current_time = (int) (microtime(true) * 1000);\n\t\t$this->set_sync($server_time - $current_time);\n\t}",
"abstract public function getLastSyncTimestamp();",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = JadwalPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function set_last_fetch( $timestamp ) {\n\t\t$this->ryte_option[ self::LAST_FETCH ] = $timestamp;\n\t}",
"public function setLastLogin() {\n $this->lastLogin = new DateTime();\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = SekolahPaudPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setLastsend($lastsend);",
"protected function configureStore()\n {\n /** @var $storeConfigurator Ess_M2ePro_Model_Magento_Quote_Store_Configurator */\n $storeConfigurator = Mage::getModel('M2ePro/Magento_Quote_Store_Configurator');\n $storeConfigurator->init($this->_quote, $this->_proxyOrder);\n\n $this->_originalStoreConfig = $storeConfigurator->getOriginalStoreConfig();\n\n $storeConfigurator->prepareStoreConfigForOrder();\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = SanitasiPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}",
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function getLastUpdateTime()\n {\n $time = Mage::getStoreConfig(self::XML_GEOIP_UPDATE_DB);\n if (!$time) {\n return false;\n }\n\n return date('F d, Y / h:i', $time);\n }",
"function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}",
"public function getLastSystemChange() {\n return $this->lastSystemChange;\n }",
"public function getLastUpdateDatetime()\n {\n return $this->getValue('nb_icontact_prospect_last_update_datetime');\n }",
"public function setLastSystemChange($lastSystemChange) {\n $this->lastSystemChange = $lastSystemChange;\n return $this;\n }",
"function setSyncProdDesc()\n {\n }",
"public function setConfig(array $config, $store = false)\n {\n $this->configuration = $config;\n\n if ($store) {\n $values = array('configuration' => serialize($config));\n $connection = \\Zend_Registry::get('doctrine')->getConnection();\n $connection->update('daemon', $values, array('name' => $this->getName()));\n }\n }",
"public function getLastSyncDateTime()\n {\n if (array_key_exists(\"lastSyncDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"lastSyncDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"lastSyncDateTime\"])) {\n return $this->_propDict[\"lastSyncDateTime\"];\n } else {\n $this->_propDict[\"lastSyncDateTime\"] = new \\DateTime($this->_propDict[\"lastSyncDateTime\"]);\n return $this->_propDict[\"lastSyncDateTime\"];\n }\n }\n return null;\n }",
"public function saveSystemConfig($observer)\n {\n Mage::getSingleton('adminhtml/session')->setMessages(Mage::getModel('core/message_collection'));\n\n Mage::getModel('core/config_data')\n ->load(self::CRON_STRING_PATH, 'path')\n ->setValue($this->_getSchedule())\n ->setPath(self::CRON_STRING_PATH)\n ->save();\n\n Mage::app()->cleanCache();\n\n $this->configCheck();\n\n // If there are errors in config, do not progress further as it may be testing old data\n $currentMessages = Mage::getSingleton('adminhtml/session')->getMessages();\n foreach ($currentMessages->getItems() as $msg) {\n if ($msg->getType() != 'success') {\n return;\n }\n }\n\n $messages = array();\n\n // Close connection to avoid mysql gone away errors\n $res = Mage::getSingleton('core/resource');\n $res->getConnection('core_write')->closeConnection();\n\n // Test connection\n $storeId = Mage::app()->getStore();\n $usernameWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/username_ws');\n $passwordWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/password_ws');\n $retConn = Mage::helper('emailchef')->testConnection($usernameWs, $passwordWs, $storeId);\n $messages = array_merge($messages, $retConn);\n\n // Config tests\n $retConfig = Mage::helper('emailchef')->testConfig();\n $messages = array_merge($messages, $retConfig);\n\n // Re-open connection to avoid mysql gone away errors\n $res->getConnection('core_write')->getConnection();\n\n // Add messages from test\n if (count($messages) > 0) {\n foreach ($messages as $msg) {\n $msgObj = Mage::getSingleton('core/message')->$msg['type']($msg['message']);\n Mage::getSingleton('adminhtml/session')->addMessage($msgObj);\n }\n }\n }",
"public function setLastManualRefreshTime($value)\n {\n return $this->set(self::_LAST_MANUAL_REFRESH_TIME, $value);\n }",
"public function get_last_run() {\n\t\n\t\tif(empty($this->lastRun) && $this->is_wordpress_loaded()) {\n\t\t\t$this->lastRun = get_option('wpu-last-run');\n\t\t}\n\n\t\t return $this->lastRun;\n\t}",
"protected function getConfigName()\n {\n return 'realtime';\n }",
"public function updateSyncStamp()\n {\n throw new Horde_ActiveSync_Exception('Not supported in this state driver.');\n }",
"public function cached_timestamp()\n\t{\n\t\t$query = $this->_EE->db->get_where('dd_settings', array('key' => 'last_saved'));\n\t\treturn ($query->num_rows() > 0) ? $query->row()->value : 0 ;\n\t}",
"function wp_cache_set_sites_last_changed()\n {\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = BangunanPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function save_timestamp($timestamp = 0)\n\t{\n\t\tif ($this->_EE->db->get_where('dd_settings', array('key' => 'last_saved'))->num_rows() == 0)\n\t\t{\n\t\t\t// new row\n\t\t\t$this->_EE->db->insert('exp_dd_settings', array('key' => 'last_saved', 'value' => $timestamp)); \n\t\t} else {\n\t\t\t// update row\n\t\t\t$this->_EE->db->where('key', 'last_saved')->update('dd_settings', array('value' => $timestamp));\n\t\t}\n\t}",
"private function set_last_updated_at() {\n\n\t\tif ( ! static::get_table() instanceof TimestampedTable ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$dirty = $this->is_dirty();\n\n\t\t$this->set_attribute( static::get_table()->get_updated_at_column(), $this->fresh_timestamp() );\n\n\t\t// If the model is dirty, we don't want to commit our save since the user should already be calling save.\n\t\tif ( ! $dirty ) {\n\t\t\t$this->save();\n\t\t}\n\t}",
"public function setServerTime();",
"public function UpdateLastLogin() {\r\n\t\t\t$_SESSION[__CLASS__.$this->intId.'_LastLogin'] = $this->dttLastLogin;\r\n\t\t\t$this->dttLastLogin = new QDateTime(QDateTime::Now);\r\n\t\t}",
"public function applyDefaultValues()\n {\n $this->last_sync = '1901-01-01 00:00:00';\n }",
"public function onSync($aseco){\r\n\t\t// Read Configuration\r\n\t\tif (!$xml = $aseco->parser->xmlToArray('config/checkpoint_time_differences.xml', true, true)) {\r\n\t\t\ttrigger_error('[CpDiff] Could not read/parse config file \"config/checkpoint_time_differences.xml\"!', E_USER_ERROR);\r\n\t\t}\r\n\t\t$this->settings = $xml['SETTINGS'];\r\n\t\tunset($xml);\r\n\t\t\r\n\t}",
"public function stampLastChargingPowerRecord()\n {\n $lastRecord = $this -> latestChargingPower();\n \n if( $lastRecord && $lastRecord -> end_at === null )\n {\n $lastRecord -> end_at = now() -> timestamp;\n $lastRecord -> save();\n }\n }",
"public function setLastRun(TerminateOperationEvent $event) {\n $context = $event->getContext();\n\n // Only proceed if the context indicates that the import is managed.\n if (!isset($context['state']['manager'])) {\n return;\n }\n if ($context['state']['manager'] !== 'entity_sync') {\n return;\n }\n\n $sync_id = $event->getSync()->get('id');\n $current_run = $this->stateManager->getCurrentRun($sync_id, 'import_list');\n\n $this->stateManager->setLastRun(\n $event->getSync()->get('id'),\n $event->getOperation(),\n $this->time->getRequestTime(),\n $current_run['start_time'] ?? NULL,\n $current_run['end_time'] ?? NULL\n );\n $this->stateManager->unsetCurrentRun($sync_id, 'import_list');\n }",
"public function getOrderSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);\n }",
"public function setLastUpdate($lastUpdate)\n {\n $this->lastUpdate = $lastUpdate;\n }",
"public function setLastCommentTimeAsCurrent()\n {\n return $this->setLastCommentTime(date('Y-m-d H:i:s'));\n }",
"public function setLastStatusUpdate($value) {\n\t\t$value = date('d-M-Y', strtotime($value));\n\t\tself::$_lastStatusUpdate = $value;\n\t}",
"public function getUpdateFrequency()\n {\n return Mage::getStoreConfig(self::XML_PATH_UPDATE_FREQUENCY);\n }",
"function setWorkTime( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->WorkTime = $value;\n }",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configuration setting to enable Product Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function getLastAutoRefreshTime()\n {\n return $this->get(self::_LAST_AUTO_REFRESH_TIME);\n }",
"public function updateLastPing()\n {\n $this->last_ping = Carbon::now();\n $this->save();\n }",
"protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }",
"protected function getTimeLastSaved()\n {\n return SiteConfig::current_site_config()->VimeoFeed_LastSaved;\n }",
"public function setLastUpdatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastUpdatedDateTime', $value);\n }",
"public function storeInstallerRun(Evalent_StoreSetup_Model_Moduleinstaller_Abstractinstaller $installer) {\n $this->_dataStore[$installer->getKey()]['has_run'][$installer->getInstallerVersion()] = date(\"Ymd H:i:s\");\n\n Mage::getModel(\"core/config\")->saveConfig(self::XML_PATH_DATASTORE, json_encode($this->_dataStore), 'default', 0);\n\n return $this;\n }",
"private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}",
"protected function getDeployTime(){\n\t\tif(!$this->deployTime){\n\t\t\t$targetFile = \\Of\\Constants::GENERATION_TIME;\n\t\t\t$deployTime = include($targetFile);\n\t\t\t\n\t\t\t$this->deployTime = 'deploy'.$deployTime;\n\t\t}\n\t\t\n\t\treturn $this->deployTime;\n\t}",
"public function getLastDeploymentChangeTime()\n {\n return $this->last_deployment_change_time;\n }",
"public function setStoreId($store);",
"public function onPreUpdate()\n {\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }",
"function setSyncProdName()\n {\n }",
"public function setLastLogin(\\DateTime $last_login) {\n\n $this->last_login = $last_login->format('Y-m-d H:i:s');\n\n }",
"public function getNextSyncTimestamp() {\n\t\treturn strtotime($this->getNextSync());\n\t}",
"function syncStoreToCRM($sync_interval=0) {\n global $DB;\n\t if (self::checkConnection()) {\n\t\t //\\Helper::Log('(syncStoreToCRM) run period ' . $sync_period);\n\t\t // Get plugin object\n\t\t $plugin = false;\n\t\t if (strlen(self::$profile['PLUGIN'])) {\n\t\t\t $arProfilePlugin = Exporter::getInstance(self::$MODULE_ID)->getPluginInfo(self::$profile['PLUGIN']);\n\t\t\t if (is_array($arProfilePlugin)) {\n\t\t\t\t $strPluginClass = $arProfilePlugin['CLASS'];\n\t\t\t\t if (strlen($strPluginClass) && class_exists($strPluginClass)) {\n\t\t\t\t\t $plugin = new $strPluginClass(self::$MODULE_ID);\n\t\t\t\t\t $plugin->setProfileArray(self::$profile);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t // List of orders, changed by last period (if period is not set than get all orders)\n\t\t if ($plugin) {\n\t\t\t $filter = [];\n\t\t\t if ($sync_interval > 0) {\n\t\t\t\t $filter['change_date_from'] = time() - $sync_interval;\n\t\t\t }\n\t\t\t $orders_ids = $plugin->getOrdersIDsList($filter);\n\t\t\t foreach ($orders_ids as $order_id) {\n\t\t\t\t $order_data = $plugin->getOrder($order_id);\n\t\t\t\t try {\n\t\t\t\t\t self::syncOrderToDeal($order_data);\n\t\t\t\t } catch (\\Exception $e) {\n\t\t\t\t\t //\\Helper::Log('(syncStoreToCRM) can\\'t sync of order ' . $order_data['ID']);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t //\\Helper::Log('(syncStoreToCRM) success');\n\t }\n }",
"private function _update_last_sync_data($data_type, $sync_type, $last_sync_datetime){\n //Update last sync type and datetime for ITEMS\n if($data_type == Minematic_Connector_Model_Config::DATA_TYPE_ITEMS){\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::ITEMS_LAST_SYNC_TYPE, $sync_type);\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::ITEMS_LAST_SYNC_DATETIME, $last_sync_datetime);\n }\n\n //Update last sync type and datetime for USERS\n if($data_type == Minematic_Connector_Model_Config::DATA_TYPE_USERS){\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::USERS_LAST_SYNC_TYPE, $sync_type);\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::USERS_LAST_SYNC_DATETIME, $last_sync_datetime);\n }\n\n //Update last sync type and datetime for EVENTS\n if($data_type == Minematic_Connector_Model_Config::DATA_TYPE_EVENTS){\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::EVENTS_LAST_SYNC_TYPE, $sync_type);\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::EVENTS_LAST_SYNC_DATETIME, $last_sync_datetime);\n }\n }",
"public function setLastRefreshedDateTime($val)\n {\n $this->_propDict[\"lastRefreshedDateTime\"] = $val;\n return $this;\n }",
"public function updateLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_WRITE_MODE);\n\t\t\n\t\t// Last update dateTime\n\t\t$date = new \\Datetime();\n\t\n\t\t// write the last update datetime\n\t\t$lastUpdateDateTime = fputs($lastUpdateStorageFile, $date->format('Y-m-d H:i:s'));\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}",
"public function install() {\n\t\t\t$date = Symphony::Configuration()->get('date_format', 'region');\n\t\t\t$time = Symphony::Configuration()->get('time_format', 'region');\n\t\t\t$separator = Symphony::Configuration()->get('datetime_separator', 'region');\n\n\t\t\t// Store current date and time settings\n\t\t\tSymphony::Configuration()->set('date_format', $date, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->set('time_format', $time, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->set('datetime_separator', $separator, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->write();\n\t\t}",
"public function updateLastUsed()\n {\n if (\n $this->last_used_at === null ||\n $this->last_used_at < (new \\DateTime())->sub(new \\DateInterval('P1D'))\n ) {\n $this->last_used_at = new \\DateTime();\n $this->save();\n }\n }",
"public function setLastUpdatedDateTime($val)\n {\n $this->_propDict[\"lastUpdatedDateTime\"] = $val;\n return $this;\n }",
"public function setLastUpdatedDateTime($val)\n {\n $this->_propDict[\"lastUpdatedDateTime\"] = $val;\n return $this;\n }",
"public function setLastUpdatedDateTime($val)\n {\n $this->_propDict[\"lastUpdatedDateTime\"] = $val;\n return $this;\n }",
"private function setLastSync($from, $startType)\n {\n /** @var PairStorage $pairStorage */\n $pairStorage = $this->getServiceContainer()->get('ongr_connections.pair_storage');\n\n if ($startType == BinlogParser::START_TYPE_DATE) {\n // Sometimes, mysql, php and server timezone could differ, we need convert time seen by php\n // to the same time in the same timezone as is used in mysqlbinlog.\n // This issue is for tests only, should not affect live website.\n\n $result = $this->managerMysql->getConnection()->executeQuery('SELECT @@global.time_zone');\n $time_zone = $result->fetchAll()[0]['@@global.time_zone'];\n\n // If mysql timezone is the same as systems, string 'SYSTEM' is returned, which is not what we want.\n if ($time_zone == 'SYSTEM') {\n $result = $this->managerMysql->getConnection()->executeQuery('SELECT @@system_time_zone');\n $time_zone = $result->fetchAll()[0]['@@system_time_zone'];\n }\n\n $from->setTimezone(new \\DateTimeZone($time_zone));\n\n $pairStorage->set(BinlogDiffProvider::LAST_SYNC_DATE_PARAM, $from->format('Y-m-d H:i:s'));\n } elseif ($startType == BinlogParser::START_TYPE_POSITION) {\n $pairStorage->set(BinlogDiffProvider::LAST_SYNC_POSITION_PARAM, $from);\n }\n }",
"public function getProductSyncEnabledFlag($store_id = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_ENABLED, $store_id));\n }",
"public function setLastRefreshedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastRefreshedDateTime', $value);\n }",
"public function getLastUpdateTime()\n {\n return $this->last_update_time;\n }",
"public function setLastLogin(\\DateTime $time)\n {\n return parent::setLastLogin($time);\n }",
"function set_date_to_now()\n {\n $this->timestamp=time();\n }",
"public function getLastResetTime()\n {\n return $this->get(self::_LAST_RESET_TIME);\n }",
"public function getLastCheckedtime()\n {\n\t\treturn $this->_getSess('checktime');\n }",
"public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}",
"public function setLastActionUser(){\n\t\t// nilai authtimeout user\n\t\tYii::$app->user->authTimeout;\n\n\t\t$user = User::findOne(Yii::$app->user->id);\n\t\t$user->last_action = date('Y-m-d H:i:s');\n\t\t$user->update();\n\t}",
"private function setStore(Store $store) {\n $this->store = $store;\n }",
"function setSyncItemsPriceStandard()\n {\n }",
"public function setLastUpdated($lastUpdated);",
"public function updateSyncDate()\n {\n $result=false;\n try{\n infolog('[BulkInventory.updateSyncDate] Preparing to update sync date... '. now());\n $sQl=\"\n UPDATE\n products p,\n ebay_details ed\n SET\n ed.synced_at=NOW()\n WHERE\n p.id=ed.product_id\n AND ed.listingid IS NOT NULL\n AND (p.updated_at > ed.synced_at OR ed.synced_at IS NULL)\n ;\n \";\n DB::connection()->getpdo()->exec($sQl);\n infolog('[BulkInventory.updateSyncDate] SUCCESS at '. now());\n\n $result=true;\n }catch(\\Exception $e) {\n infolog('[BulkInventory.updateSyncDate] ERROR updating sync date ('.$e->getMessage().') at '. now());\n }\n return($result);\n }",
"public function setLastScoringUpdate(ilDateTime $a_val)\n\t{\n\t\t$this->scoring_update = $a_val;\n\t}",
"public function logLastLogin()\n\t{\n\t\t$this->last_login = $this->freshTimestamp();\n\t\t$this->save();\n\t}",
"function commerce_store_post_update_4() {\n /** @var \\Drupal\\Core\\Config\\ConfigFactoryInterface $config_factory */\n $config_factory = \\Drupal::service('config.factory');\n $uuid = $config_factory->get('commerce_store.settings')->get('default_store');\n if ($uuid) {\n $store_storage = \\Drupal::entityTypeManager()->getStorage('commerce_store');\n /** @var \\Drupal\\commerce_store\\Entity\\StoreInterface[] $stores */\n $stores = $store_storage->loadByProperties(['uuid' => $uuid]);\n $store = reset($stores);\n if ($store) {\n $store->setDefault(TRUE);\n $store->save();\n }\n }\n $config_factory->getEditable('commerce_store.settings')->delete();\n}",
"public function setLastUpdate(\\DateTime $lastUpdate)\n {\n $this->lastUpdate = $lastUpdate;\n }",
"public function install() {\n\t\t\t$date = Symphony::Configuration()->get('date_format', 'region');\n\t\t\t$time = Symphony::Configuration()->get('time_format', 'region');\n\t\t\t$separator = Symphony::Configuration()->get('datetime_separator', 'region');\n\n\t\t\t// Store current date and time settings\n\t\t\tSymphony::Configuration()->set('date_format', $date, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->set('time_format', $time, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->set('datetime_separator', $separator, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->write();\n\t\t}",
"public static function getRunType()\n {\n return 'store';\n }"
] | [
"0.62357396",
"0.582095",
"0.5662576",
"0.5626434",
"0.5599257",
"0.55595475",
"0.5424594",
"0.54020727",
"0.53499424",
"0.5284663",
"0.5263734",
"0.51984936",
"0.5182326",
"0.50813454",
"0.50588",
"0.505704",
"0.5047409",
"0.5000528",
"0.49952918",
"0.49725744",
"0.49340934",
"0.49284026",
"0.49242872",
"0.4905893",
"0.48917845",
"0.48779723",
"0.4875398",
"0.48480973",
"0.48392093",
"0.4832887",
"0.4826872",
"0.4821389",
"0.4810228",
"0.479882",
"0.47897404",
"0.4786662",
"0.4771732",
"0.475179",
"0.4744152",
"0.47433484",
"0.47261438",
"0.47255266",
"0.471812",
"0.4702579",
"0.46939662",
"0.46855927",
"0.4680819",
"0.46706143",
"0.46687183",
"0.466855",
"0.4662582",
"0.4661614",
"0.46431994",
"0.4639286",
"0.4636218",
"0.46350187",
"0.46259832",
"0.46251088",
"0.46155673",
"0.46148813",
"0.46060574",
"0.46058357",
"0.45950845",
"0.45845157",
"0.4579671",
"0.4573484",
"0.45719376",
"0.45707497",
"0.4565517",
"0.45643207",
"0.453534",
"0.45309252",
"0.45248005",
"0.45231602",
"0.4519645",
"0.4519586",
"0.4517927",
"0.45178536",
"0.45178536",
"0.45178536",
"0.4511896",
"0.45006004",
"0.4486797",
"0.4484991",
"0.44820678",
"0.44804373",
"0.4478815",
"0.44786856",
"0.4460762",
"0.44457436",
"0.44421566",
"0.4439673",
"0.44380528",
"0.4436531",
"0.44355884",
"0.44351345",
"0.44304",
"0.44286293",
"0.44277498",
"0.44258273"
] | 0.7008211 | 0 |
Check if Product Sync has ever run for the given store. | public function hasProductSyncRun($store = null) {
$config = Mage::getConfig();
if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, "store", $store)) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configuration setting to enable Product Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function hasStore(): bool;",
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration setting to enable Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function getProductSyncEnabledFlag($store_id = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_ENABLED, $store_id));\n }",
"public static function product_should_be_synced( \\WC_Product $product ) {\n\n\t\treturn 'publish' === $product->get_status() && self::published_product_should_be_synced( $product );\n\t}",
"public function should_run()\n\t{\n\t\treturn $this->config['delete_pms_last_gc'] < time() - $this->config['delete_pms_gc'];\n\t}",
"public function isDelayedPushNotification($store = null)\n {\n return $this->getVersionConfig($store)->isDelayedPushNotification();\n }",
"public static function is_sync_enabled_for_product( \\WC_Product $product ) {\n\n\t\tif ( ! isset( self::$products_sync_enabled[ $product->get_id() ] ) ) {\n\n\t\t\tif ( $product->is_type( 'variable' ) ) {\n\n\t\t\t\t// assume variable products are not synced until a synced child is found\n\t\t\t\t$enabled = false;\n\n\t\t\t\tforeach ( $product->get_children() as $child_id ) {\n\n\t\t\t\t\t$child_product = wc_get_product( $child_id );\n\n\t\t\t\t\tif ( $child_product && self::is_sync_enabled_for_product( $child_product ) ) {\n\n\t\t\t\t\t\t$enabled = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t$enabled = 'no' !== $product->get_meta( self::SYNC_ENABLED_META_KEY );\n\t\t\t}\n\n\t\t\tself::$products_sync_enabled[ $product->get_id() ] = $enabled;\n\t\t}//end if\n\n\t\treturn self::$products_sync_enabled[ $product->get_id() ];\n\t}",
"public function isInstalled()\n {\n return $this->getDataVersion() && $this->getOldStores();\n }",
"abstract function isStoreOutdated(string $storeKey): bool;",
"public static function published_product_should_be_synced( \\WC_Product $product ) {\n\n\t\t$should_sync = self::is_sync_enabled_for_product( $product );\n\n\t\t// define the product to check terms on\n\t\tif ( $should_sync ) {\n\t\t\t$terms_product = $product->is_type( 'variation' ) ? wc_get_product( $product->get_parent_id() ) : $product;\n\t\t} else {\n\t\t\t$terms_product = null;\n\t\t}\n\n\t\t// allow simple or variable products (and their variations) with zero or empty price - exclude other product types with zero or empty price\n\t\tif ( $should_sync && ( ! $terms_product || ( ! self::get_product_price( $product ) && ! in_array( $terms_product->get_type(), array( 'simple', 'variable' ) ) ) ) ) {\n\t\t\t$should_sync = false;\n\t\t}\n\n\t\t// exclude products that are excluded from the store catalog or from search results\n\t\tif ( $should_sync && ( ! $terms_product || has_term( array( 'exclude-from-catalog', 'exclude-from-search' ), 'product_visibility', $terms_product->get_id() ) ) ) {\n\t\t\t$should_sync = false;\n\t\t}\n\n\t\t// exclude products that belong to one of the excluded terms\n\t\tif ( $should_sync && ( ! $terms_product || self::is_sync_excluded_for_product_terms( $terms_product ) ) ) {\n\t\t\t$should_sync = false;\n\t\t}\n\n\t\treturn $should_sync;\n\t}",
"private function isSingleCourseSync(): bool\n {\n return !empty($this->maconomyId);\n }",
"public function isEcomSyncDataEnabled()\r\n {\r\n $apiKey = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::GENERAL_APIKEY);\r\n $moduleEnabled = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::GENERAL_ACTIVE);\r\n $ecommerceEnabled = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::ECOMMERCE_ACTIVE);\r\n $ret = !is_null($this->getMCStoreId()) && $this->getMCStoreId() != null\r\n && !is_null($apiKey) && $apiKey != \"\" && $moduleEnabled && $ecommerceEnabled;\r\n return $ret;\r\n }",
"public function hasInstall();",
"protected function shouldUseLocks($store)\n {\n return $store instanceof LockProvider && ! $store instanceof DynamoDbStore;\n }",
"public function isPartialPaymentSupport($store = null)\n {\n return !$this->getVersionConfig($store)->isPartialPaymentDisabled();\n }",
"public function isValidInstall() {\n\t\treturn $this->install !== null;\n\t}",
"public function alreadyInstalled()\n {\n return file_exists(storage_path('installed'));\n }",
"public function alreadyInstalled()\n {\n return file_exists(storage_path('installed'));\n }",
"public function updateIsAvailable()\n {\n return self::INSTALLED_VERSION != $this->version;\n }",
"abstract protected function isSyncRequired($entity);",
"public static function checkVendorKycStatus() {\n $storeModel = new \\App\\StoreModel();\n $storeId = Auth::user()->id;\n $allowProductUpload = $storeModel->getStoreKYCStatus($storeId);\n return $allowProductUpload;\n }",
"public function hasInstallerRun(Evalent_StoreSetup_Model_Moduleinstaller_Abstractinstaller $installer) {\n\n if(isset($this->_dataStore[$installer->getKey()]['has_run'][$installer->getInstallerVersion()])) return true;\n else return false;\n }",
"protected function isSingleStoreMode()\n {\n return Mage::app()->isSingleStoreMode();\n }",
"function _check_product_in_db($product){\n if (in_array($product, $this->db)){\n // echo 'Product already in the database.';\n return True;\n }\n // echo 'Product not in the database.';\n return False;\n }",
"private function isInstalled()\n {\n /** @var \\Magento\\Framework\\App\\DeploymentConfig $deploymentConfig */\n $deploymentConfig = $this->objectManager->get(\\Magento\\Framework\\App\\DeploymentConfig::class);\n return $deploymentConfig->isAvailable();\n }",
"public function isAppliedAllStores()\n {\n if ($id = $this->request->getParam('id')) {\n return $this->isAllStoresSelected($id);\n } elseif (($stores = $this->storeManager->getStores())\n && is_array($stores)\n && count($stores) < 2) {\n return true;\n }\n\n return false;\n }",
"private function getExistProductRecount() {\n return false;\n }",
"protected static function isInstallToolSession() {}",
"public function isDataInstalled() {\n $check = Mage::getModel('inventoryplus/install')\n ->getCollection()\n ->setPageSize(1)\n ->setCurPage(1)\n ->getFirstItem();\n if ($check->getStatus() != 1) {\n $isInsertData = Mage::getModel('inventoryplus/checkupdate')\n ->getCollection()\n ->setPageSize(1)\n ->setCurPage(1)\n ->getFirstItem()\n ->getIsInsertData();\n if ($isInsertData != 1) {\n return 0;\n } else {\n $check->setStatus(1);\n try {\n $check->save();\n } catch (Exception $e) {\n throw $e;\n }\n }\n }\n return 1;\n }",
"public function hasProduct()\n {\n return $this->Product !== null;\n }",
"public function hasSyncKey()\n {\n return $this->get(self::SYNC_KEY) !== null;\n }",
"public function check_sync()\n {\n }",
"public function isAlreadyInstalled()\n {\n return $this->alreadyInstalled;\n }",
"public function checkProductsList() {\n if (!is_array($this->products) || !count($this->products)) {\n $this->logger->info(\"No \".$this->type.\" found in DST.\");\n }\n $this->logger->info(\"Checking products List\");\n foreach ($this->products as $sku => $product) {\n $errors = $this->pimhelper->check_one_reference($this->type, $product->getData());\n if ($errors > 0) {\n $this->logger->info($errors.\" Fields are missing in product : \".$sku);\n die;\n }\n }\n $this->logger->info(\"Fields were created in every products\");\n return true;\n }",
"public function isScheduledForUpdate($entity)\n {\n return isset($this->entityUpdates[spl_object_hash($entity)]);\n }",
"public function hasPushedProducts() {\n return sizeof($this->pushedProducts) > 0;\n }",
"public function productExist()\n {\n if ($this->product) {\n $ret = true;\n } else {\n $ret = false;\n }\n \n return $ret;\n }",
"public function isInstallQueueEmpty() {}",
"public function isNoStore(): bool\n {\n return $this->no_store;\n }",
"function canRunSynchronization( $synk )\n {\n return SynkHelperSynchronizations::canRun( $synk );\n }",
"private function needInstallConfirmation(string $hook): bool\n {\n return $this->repository->hookExists($hook) && !$this->force;\n }",
"private function needInstallConfirmation(string $hook): bool\n {\n return $this->repository->hookExists($hook) && !$this->force;\n }",
"public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }",
"public function inStock()\n {\n return $this->stockCount() > 0;\n }",
"public function needToSync(string $slug = '_wpgb_last_sync'): bool\n {\n $lastUpdated = $this->getLastUpdated($slug);\n $dbLastUpdated = $this->getDbLastUpdated($slug);\n\n return $dbLastUpdated !== $lastUpdated;\n }",
"public function isPhoneMandatorySupport($store = null)\n {\n return $this->getVersionConfig($store)->isPhoneMandatorySupport();\n }",
"protected function hasCreatedPackSubscription(): bool\n {\n return !!$this->packSubscription;\n }",
"public static function woocommerce_check() {\n\n\t\tif (get_option( 'woocommerce_db_version' ) === FALSE && class_exists('WC_Install')){\n\t\t\tWC_Install::update_db_version();\n\t\t}\n\n\t\tif ( self::themecomplete_woocommerce_check() && ! version_compare( get_option( 'woocommerce_db_version' ), THEMECOMPLETE_EPO_WC_VERSION, '<' ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}",
"protected function isInstalled(){\n\t\t$dsn = Configuration::get('dsn', '');\n\t\t//echo \"dsn = \" . $dsn . \"--\";\n\t\tif ($dsn == ''){\n\t\t\t$alreadyInstalled = false;\n\t\t}\n\t\telse{\n\t\t\t$alreadyInstalled = true;\n\t\t}\n\t\treturn $alreadyInstalled;\n\t}",
"public function hasInstalled()\n {\n return $this->installed !== null;\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasCacheStore(): bool;",
"public function getOrderSyncEnabledFlag($store = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_ENABLED, $store));\n }",
"public function isFreshInstallation()\n {\n if (!$this->hasTable('tl_module')) {\n return true;\n }\n\n $statement = $this->connection->query('SELECT COUNT(*) AS count FROM tl_page');\n\n return $statement->fetch(\\PDO::FETCH_OBJ)->count < 1;\n }",
"public function quoteHasServiceProduct()\n {\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n if (!$quote->hasData('has_service_product')) {\n $quote->setData('has_service_product', false);\n foreach ($quote->getAllVisibleItems() as $item) {\n if ($this->isQuoteItemServiceProduct($item)) {\n $quote->setData('has_service_product', true);\n break;\n }\n }\n }\n\n return $quote->getData('has_service_product');\n }",
"public function isStoreActive() {\r\n\t\treturn $this->_storeManager->getStore()->isActive();\r\n\t}",
"public function hasSingleStore()\n {\n throw new \\Exception('Method not implemented');\n }",
"public function isGiftWrappingAvailableForOrder($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ORDER, $store);\n }",
"public function isOAuthShopAlreadyRegistered($shopnumber, $storeViewId)\n {\n /* has shopnumber defined in same website scope */\n if (Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter('path', Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER)\n ->addFieldToFilter('value', $shopnumber)\n ->count()\n ) {\n return true;\n }\n\n /* a shopnumber is set on store view scope with the same scope_id as the base store view for the new shopnumber */\n if (Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter('path', Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER)\n ->addFieldToFilter('scope', 'stores')\n ->addFieldToFilter('scope_id', $storeViewId)\n ->addFieldToFilter('value', array('nin' => array('', null)))\n ->count()\n ) {\n return true;\n }\n\n /* a shopnumber has a default store view set exactly like the base store view for the new shopnumber */\n $resource = Mage::getSingleton('core/resource');\n $table_config_data = $resource->getTableName('core/config_data');\n $collection = Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter(\n 'main_table.path',\n Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER\n )\n ->addFieldToFilter('main_table.scope', 'websites')\n ->addFieldToFilter('main_table.value', array('nin' => array('', null)))\n ->addFieldToFilter(\n 'dsv.path',\n Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_DEFAULT_STORE\n )\n ->getSelect()\n ->joinInner(\n array('dsv' => $table_config_data),\n 'dsv.scope = main_table.scope AND dsv.scope_id = main_table.scope_id',\n array('default_store_view' => 'value')\n )->query()\n ->fetchAll();\n\n foreach ($collection as $item) {\n if (isset($item['default_store_view'])\n && $item['default_store_view'] == $storeViewId\n ) {\n return true;\n }\n }\n\n return false;\n }",
"public function isTmFireCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('TM_FireCheckout');\n }",
"public function canUpdateKount()\n {\n return !Mage::registry('kount_ens_update')\n && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_merchant_id')\n && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_api_key');\n }",
"public function isNewPossible()\n {\n // Check if ProductsModels exist\n $productmodels = $this->em->getRepository('ValentinStockBundle:Material')->countRecords();\n\n return ($productmodels > 0) ? true : false;\n }",
"public function isSyncEnabled() {\n $subsStatus = $this->getContactFlag('subscribe_setting');\n if ($this->isServiceActive() && $subsStatus) {\n return true;\n }\n return false;\n }",
"public function isProductMassActionEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_BETA_MASS_ACTION));\n }",
"public function updateMasterProducts($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_UPDATE_MASTER, $store));\n }",
"public static function has_update() {\n\t\trequire_once(trailingslashit(ABSPATH) . 'wp-admin/includes/plugin.php');\n\t\trequire_once(trailingslashit(ABSPATH) . 'wp-admin/includes/plugin-install.php');\n\t\treturn (version_compare(static::get_version(), static::get_remote_version()) < 0);\n\t}",
"public function isGiftWrappingAvailableForProduct($productConfig, $store = null)\n {\n if (is_null($productConfig) || '' === $productConfig) {\n return $this->isGiftWrappingAvailableForItems($store);\n } else {\n return $productConfig;\n }\n }",
"public function isScheduledForUpdate($document)\n {\n return isset($this->documentUpdates[spl_object_hash($document)]);\n }",
"public function checkIfSetupRan()\r\n {\r\n $select = $this->table_gateway->getAdapter()\r\n ->getDriver()->getConnection()\r\n ->execute(\"SHOW TABLES LIKE 'admins'\");\r\n\r\n\r\n if ($select->count() > 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }",
"public function hasAccountSignature($store=null)\n {\n return 0 < strlen(trim($this->getAccountSignature($store)));\n }",
"public function isAvailable($storeId)\n {\n $active = $this->config->isModuleEnabled($storeId);\n if (!$active) {\n return false;\n }\n\n $apiKey = $this->getApiKey($storeId);\n if (empty($apiKey)) {\n return false;\n }\n\n return true;\n }",
"public function canUseCheckout()\n {\n $token = \\Mage::getStoreConfig('payment/cryptomarket/cryptomkt_apikey');\n\n if (false === isset($token) || true === empty($token)) {\n $this->debugData('[ERROR] In Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): There was an error retrieving the token store param from the database or this Magento store does not have a CryptoMarket token.');\n\n return false;\n }\n\n $this->debugData('[INFO] Leaving Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): token obtained from storage successfully.');\n\n return true;\n }",
"function merchantExists()\n {\n\n $this->getById();\n if ($this->auth_id != null) return true;\n else {\n return false;\n }\n }",
"private function isPushNeeded()\n {\n $this->logging->addDebug(__METHOD__ . '|1|');\n if ($this->hasPostData('add_initiated_by_magento', 1)\n && $this->hasPostData('add_service_action_from_magento', ['refund'])\n ) {\n $statusCodeSuccess = $this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_SUCCESS');\n if ($this->hasPostData('brq_statuscode', $statusCodeSuccess)\n && !empty($this->postData['brq_relatedtransaction_refund'])) {\n if ($this->receivePushCheckDuplicates(\n $this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_PENDING_APPROVAL'),\n $this->postData['brq_relatedtransaction_refund']\n )) {\n $this->logging->addDebug(__METHOD__ . '|4|');\n return true;\n }\n }\n $this->logging->addDebug(__METHOD__ . '|5|');\n return false;\n\n }\n\n $types = ['capture', 'cancelauthorize', 'cancelreservation'];\n if ($this->hasPostData('add_initiated_by_magento', 1)\n && $this->hasPostData('add_service_action_from_magento', $types)\n && empty($this->postData['brq_relatedtransaction_refund'])\n ) {\n return false;\n }\n\n if ($this->hasPostData('add_initiated_by_magento', 1)\n && $this->hasPostData('brq_transaction_method', ['klarnakp', 'KlarnaKp'])\n && $this->hasPostData('add_service_action_from_magento', 'pay')\n && isset($this->postData['brq_service_klarnakp_captureid'])\n ) {\n return false;\n }\n\n return true;\n }",
"public function clearEmptyStoreBa()\n {\n return $this->builder->has('store');\n }",
"public function testIfStockManagementHasProductId()\n {\n $this->assertNotNull($this->stock->getProductId());\n }",
"public function checkProductsAvailability()\n {\n if ($this->hasProducts()) {\n $basketProducts = $this->getBasketProductsJoinProduct();\n \n foreach ($basketProducts as $basketProduct) {\n $product = $basketProduct->getProduct();\n $optionIds = null;\n if($basketProduct->getOptionsList() != '')\n $optionIds = explode(',',$basketProduct->getOptionsList());\n if (!$product->getIsActive() || $product->getIsDeleted()) {\n $this->unavailabilityProducts['deleted'] = $product->getId();\n $basketProduct->delete();\n }\n else if($product->getProductQuantity($optionIds) < $basketProduct->getQuantity()) {\n if(!$product->getAllowOutOfStock())\n $this->unavailabilityProducts['insufficiently'] = $product->getId();\n }\n }\n }\n \n if (!empty($this->unavailabilityProducts)) {\n return false;\n }\n else {\n return true;\n }\n }",
"public function hasVerification()\r\n {\r\n // No need for CVN in creating/updating token\r\n return Mage::getModel('ewayrapid/method_notsaved')->hasVerification();\r\n }",
"public function doesProductsHaveDuplications()\n {\n $productIDs = array();\n foreach ($this->products as $product) {\n $productIDs[] = $product->product_id;\n }\n\n $uniqueProductIDs = array_unique($productIDs);\n return (count($productIDs) != count($uniqueProductIDs));\n }",
"function checkShop()\n{\n\tglobal $sitePosition, $currTime;\n\tglobal $adminID;\n\tglobal $shopID, $shopState;\n\n\t//Get the shop\n\t$path = explode('/', $_SERVER['REQUEST_URI']);\n\t$sID = intval($path[count($path) - 2]);\n\tif($sID == 0) return false;\n\t$rs = query('Select `State` from `' . $sitePosition . '.Shop` where `ID` = ' . $sID, false);\n\t$rsInfo = fetchRow($rs);\n\tfreeResult($rs);\n\tif($rsInfo === null) return false;\n\t$state = $rsInfo[0];\n\n\t//Get the master\n\t$rs = query('Select count(*) from `' . $sitePosition . '.Master` where `UserID` = ' . $adminID . ' and `ShopID` = ' . $sID, false);\n\t$rsInfo = fetchRow($rs);\n\tfreeResult($rs);\n\tif(intval($rsInfo[0]) == 0) return false;\n\t$shopID = $sID;\n\t$shopState = $state;\n\n\t//Update the shop\n\tquery('Update `' . $sitePosition . '.Shop` set `AccessTime` = ' . $currTime . ' where `ID` = ' . $shopID, false);\n\t\n\t//Return\n\treturn true;\n}",
"public function needUpdate()\n\t{\n\t\treturn ($this->getLastUpdate() == null || time() - $this->getLastUpdate()->format('U') > 1 * 60);\n\t}",
"public function isGoodsInShopcart()\n\t{\n\t\treturn !!$this->count();\n\t}",
"public function isAllowed($store = null)\n {\n return true;\n }",
"public static function check_ticker() {\n if (!isset(self::$_ticker) || (time() > self::$_ticker + 1)) {\n self::$_ticker = time();\n return true;\n }\n\n return false;\n }",
"public function isConsistent() {}",
"function alertstream_component_checkversion()\n{\n if(!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 500) {\n return false;\n }\n return true;\n}",
"private function checkProducts()\n {\n $products = Product::with('prices')->get();\n $errors = [];\n foreach ($products as $product) {\n $basePrice = $product->prices->where('currency_id', Currency::defaultCurrency()->id)->first();\n if ( ! $basePrice) {\n $errors[] = sprintf(\n 'The product \"%s (%s)\" has no price set for your default currency.',\n $product->name,\n $product->id\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }",
"public function canStoreEnabled();",
"public function isSingleStoreMode()\n {\n if (!Mage::app()->isSingleStoreMode()) {\n return false;\n }\n return true;\n }",
"protected function checkIfNoConflictingExtensionIsInstalled() {}",
"public function check_for_updates() {\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, $this->config->version, '!=' ) ) {\n $this->install();\n }\n }",
"private function shouldPurge()\n {\n // we only need to send a purge request if varnish is enabled\n if ($this->scopeConfig->getValue(\n 'system/full_page_cache/caching_application',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n ) == 2) {\n return false; // disabled for now as need to either purge by tag or update vcl @todo add config\n return true;\n }\n return false;\n }",
"public function shouldRunMigration()\n {\n return $this->canRunMigration()\n && !Mage::getStoreConfigFlag(self::MIGRATION_COMPLETE)\n && !Mage::getStoreConfig('payment/gene_braintree/merchant_id')\n && !Mage::getStoreConfig('payment/gene_braintree/sandbox_merchant_id');\n }"
] | [
"0.7449988",
"0.7029201",
"0.65083593",
"0.6306006",
"0.612225",
"0.61052454",
"0.60977775",
"0.6053355",
"0.6036305",
"0.6021347",
"0.5969194",
"0.5937525",
"0.5929147",
"0.5918213",
"0.588954",
"0.58499306",
"0.5849475",
"0.581778",
"0.58034676",
"0.58034676",
"0.57484996",
"0.5723386",
"0.56813824",
"0.56698936",
"0.5666311",
"0.5653432",
"0.564965",
"0.5645948",
"0.56383973",
"0.56315464",
"0.5621147",
"0.5620237",
"0.5620215",
"0.55945605",
"0.55823475",
"0.5568449",
"0.5564297",
"0.5559415",
"0.55558646",
"0.5553902",
"0.5552936",
"0.55372953",
"0.5532294",
"0.5532294",
"0.5519494",
"0.5505835",
"0.54820395",
"0.5474279",
"0.54736704",
"0.5472868",
"0.5450686",
"0.5447958",
"0.544534",
"0.544534",
"0.544534",
"0.544534",
"0.544534",
"0.5443888",
"0.5442572",
"0.5442274",
"0.5440566",
"0.543222",
"0.54280347",
"0.542548",
"0.5418807",
"0.5412225",
"0.539693",
"0.53912127",
"0.5388509",
"0.5385416",
"0.5382168",
"0.53766114",
"0.53685933",
"0.5367618",
"0.5366303",
"0.5363376",
"0.53612137",
"0.5355126",
"0.535482",
"0.5352732",
"0.5330979",
"0.5328827",
"0.5324245",
"0.5319851",
"0.5318429",
"0.5311266",
"0.53044254",
"0.5304306",
"0.5297018",
"0.52939326",
"0.5291583",
"0.52885973",
"0.5285587",
"0.5283388",
"0.5277363",
"0.52731735",
"0.52698517",
"0.52675176",
"0.5266824",
"0.5263973"
] | 0.8481843 | 0 |
Return the map of additional Klevu attributes to Magento attributes. | public function getAdditionalAttributesMap($store = null) {
$map = unserialize(Mage::getStoreConfig(static::XML_PATH_ATTRIBUTES_ADDITIONAL, $store));
return (is_array($map)) ? $map : array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"function getAdditionalAttributes() ;",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public static function attributeMap()\n {\n return [\n 'status' => 'status',\n 'quota' => 'quota'\n ];\n }",
"public static function attributeMap()\n {\n return [\n 'application_id' => 'application_id',\n 'is_default' => 'is_default',\n 'role' => 'role',\n 'type' => 'type',\n '_issues' => '_issues'\n ];\n }",
"protected function getAttributeMap()\n {\n if (!$this->hasData('attribute_map')) {\n $attributeMap = [];\n try {\n $store = $this->_storeModelStoreManagerInterface->getStore();\n } catch (NoSuchEntityException $e) {\n $this->_logger->error($e->getMessage(), ['class' => __CLASS__, 'method' => __METHOD__]);\n\n return $attributeMap;\n }\n $automaticAttributes = $this->getAutomaticAttributes();\n $attributeMap = $this->prepareAttributeMap($attributeMap, $automaticAttributes);\n\n // Add otherAttributeToIndex to $attribute_map.\n $otherAttributeToIndex = $this->_searchHelperConfig->getOtherAttributesToIndex($store);\n\n if (!empty($otherAttributeToIndex)) {\n $attributeMap['otherAttributeToIndex'] = $otherAttributeToIndex;\n }\n\n $reservedAttributeCodes = $this->reservedAttributeCodesProvider\n ? $this->reservedAttributeCodesProvider->execute()\n : [];\n if ($reservedAttributeCodes) {\n if (isset($attributeMap['other']) && is_array($attributeMap['other'])) {\n $attributeMap['other'] = array_diff($attributeMap['other'], $reservedAttributeCodes);\n }\n if (isset($attributeMap['otherAttributeToIndex']) && is_array($attributeMap['otherAttributeToIndex'])) {\n $attributeMap['otherAttributeToIndex'] = array_diff(\n $attributeMap['otherAttributeToIndex'],\n $reservedAttributeCodes\n );\n }\n }\n\n // Add boostingAttribute to $attribute_map.\n $boosting_value = $this->_searchHelperConfig->getBoostingAttribute($store);\n if (($boosting_value !== \"use_boosting_rule\") &&\n ($boosting_attribute = $this->_searchHelperConfig->getBoostingAttribute($store)) &&\n null !== $boosting_attribute\n ) {\n $attributeMap['boostingAttribute'][] = $boosting_attribute;\n }\n $this->setData('attribute_map', $attributeMap);\n }\n\n return $this->getData('attribute_map');\n }",
"public static function attributeMap();",
"public static function attributeMap()\n {\n return [\n 'tenant_id' => 'tenant_id',\n 'expires_in' => 'expires_in',\n 'scopes' => 'scopes'\n ];\n }",
"public function getMap() {\n return [\n 'sku' => 'itemNo',\n 'shortDescription' => 'description',\n 'longDescription' => 'description2',\n 'measurementUnit' => 'unitOfMeasure',\n 'mpn' => 'vendorItemNo',\n 'ean' => 'eanNo',\n ];\n }",
"public function attributes()\n\t{\n\t\t/*Author -ptr.nov- add related fields to searchable attributes */\n\t\treturn array_merge(parent::attributes(), ['nmkategori','tipebrg','corp.CORP_NM']);\n\t}",
"protected function prepareAttributeMap($attributeMap, $additionalAttributes)\n {\n foreach ($additionalAttributes as $mapping) {\n if (!isset($attributeMap[$mapping['klevu_attribute']])) {\n $attributeMap[$mapping['klevu_attribute']] = [];\n }\n $attributeMap[$mapping['klevu_attribute']][] = $mapping['magento_attribute'];\n }\n\n return $attributeMap;\n }",
"public static function attributeMap()\n {\n return [\n 'status' => 'status',\n 'time' => 'time'\n ];\n }",
"public function getAttributeMap()\n {\n return $this->attributeMap;\n }",
"public function getUsedMagentoAttributes()\n {\n $attributeMapValues = array_values($this->getAttributeMap());\n $flatAttributesArray = array_merge(...$attributeMapValues);\n $result = array_merge($flatAttributesArray, $this->getConfigurableAttributes());\n\n return array_unique($result);\n }",
"public function getAutomaticAttributes()\n {\n if (!$this->hasData('automatic_attributes')) {\n // Default mapped attributes\n $attributes = [];\n try {\n $store = $this->_storeModelStoreManagerInterface->getStore();\n } catch (NoSuchEntityException $e) {\n $this->_logger->error($e->getMessage(), ['class' => __CLASS__, 'method' => __METHOD__]);\n\n return $attributes;\n }\n $defaultAttributes = $this->_searchHelperConfig->getDefaultMappedAttributes();\n $iMaxDefaultAttrCnt = count($defaultAttributes['klevu_attribute']);\n for ($i = 0; $i < $iMaxDefaultAttrCnt; $i++) {\n $attributes[] = [\n 'klevu_attribute' => $defaultAttributes['klevu_attribute'][$i],\n 'magento_attribute' => $defaultAttributes['magento_attribute'][$i]\n ];\n }\n // Get all layered navigation / filterable in search attributes\n foreach ($this->getLayeredNavigationAttributes() as $layeredAttribute) {\n $attributes[] = [\n 'klevu_attribute' => 'other',\n 'magento_attribute' => $layeredAttribute\n ];\n }\n $this->setData('automatic_attributes', $attributes);\n // Update the store system config with the updated automatic attributes map.\n $this->_searchHelperConfig->setAutomaticAttributesMap($attributes, $store);\n }\n\n return $this->getData('automatic_attributes');\n }",
"public function getAttributes() {\n $attr = array();\n \n $attr[\"id\"] = $this->id_;\n $attr[\"taxonId\"] = $this->taxonId_;\n $attr[\"dbh\"] = $this->dbh_;\n $attr[\"lat\"] = $this->lat_;\n $attr[\"lng\"] = $this->lng_;\n $attr[\"layers\"] = $this->layers_;\n \n return $attr;\n }",
"public function getMapDataAttributes()\n {\n $attributes = [\n 'data-zoom' => $this->Zoom,\n 'data-map-type' => $this->MapType,\n 'data-latitude' => $this->Latitude,\n 'data-longitude' => $this->Longitude,\n 'data-markers' => $this->MarkersJSON\n ];\n \n $this->extend('updateMapDataAttributes', $attributes);\n \n return $attributes;\n }",
"protected function userInfoNormalizeUserAttributeMap() {\n return [\n 'provider' => function ($attributes) {\n return $this->defaultName();\n },\n 'fullname' => 'nickname',\n 'email' => function ($attributes) {\n return isset($attributes['nickname']) ? $attributes['nickname'] . '@qq.com' : null;\n },\n 'gender' => function ($attributes) {\n if (!isset($attributes['gender'])) return null;\n return ($attributes['gender'] == '男' ? static::GENDER_MALE : ($attributes['gender'] == '女' ? static::GENDER_FEMALE : null));\n },\n 'avatar' => 'figureurl_2', ///you can choose others\n ];\n }",
"public function attributes()\n {\n return [\n 'SKU' => 'SKU'\n ];\n }",
"public static function attributeMap() {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return self::$attributeMap;\n }"
] | [
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.6740685",
"0.66691023",
"0.66691023",
"0.66691023",
"0.66691023",
"0.6668884",
"0.6668884",
"0.66687834",
"0.66686994",
"0.65469164",
"0.63307166",
"0.6328964",
"0.628099",
"0.62447304",
"0.61884326",
"0.61883354",
"0.61489034",
"0.6118252",
"0.6090748",
"0.6085526",
"0.60575455",
"0.6008706",
"0.5999745",
"0.5991581",
"0.593644",
"0.592375",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079",
"0.5923079"
] | 0.6315512 | 25 |
Return the System Configuration setting for enabling Order Sync for the given store. The returned value can have one of three possible meanings: Yes, No and Forced. The values mapping to these meanings are available as constants on Klevu_Search_Model_System_Config_Source_Yesnoforced. | public function getOrderSyncEnabledFlag($store = null) {
return intval(Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_ENABLED, $store));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration setting to enable Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function getProductSyncEnabledFlag($store_id = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_ENABLED, $store_id));\n }",
"private function _getSendOrderConfirmationOption()\n {\n return (boolean) Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/send_order_confirmation', Mage::app()->getStore()->getStoreId());\n }",
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configuration setting to enable Product Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function getStoreConfig(){\n return Mage::getStoreConfig('payment/vpayment/client');\n }",
"private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }",
"public function getOrderSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);\n }",
"public function isGiftWrappingAvailableForOrder($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ORDER, $store);\n }",
"public function getEnableAlwaysOnConfiguration()\n {\n if (array_key_exists(\"enableAlwaysOnConfiguration\", $this->_propDict)) {\n return $this->_propDict[\"enableAlwaysOnConfiguration\"];\n } else {\n return null;\n }\n }",
"protected function _getStore()\n {\n $system_configured_store_id = $this->_getSystemConfigurationStoreId();\n if ((!is_null($system_configured_store_id)) && ($system_configured_store_id !== false))\n {\n return $system_configured_store_id;\n }\n\n return false;\n \n }",
"public function getEnabled($storeId = null)\n {\n if (!$this->generalHelper->getEnabled($storeId)) {\n return false;\n }\n\n return $this->generalHelper->getStoreValue(self::XPATH_ORDER_ENABLE, $storeId);\n }",
"public function stone_setting() {\r\n return $this->stone_setting;\r\n }",
"public function getSystemConfig()\n {\n return $this->systemConfig;\n }",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"public function getSystemSettingReply()\n {\n return $this->get(self::_SYSTEM_SETTING_REPLY);\n }",
"public function getConfig(): string\n {\n $checkoutConfig = $this->compositeConfigProvider->getConfig();\n $storeCode = $checkoutConfig['storeCode'];\n $checkoutConfig['payment']['restUrlPrefix'] = \"/rest/$storeCode/V1/\";\n\n $transport = new \\Magento\\Framework\\DataObject([\n 'checkoutConfig' => $checkoutConfig,\n 'output' => [\n 'storeCode' => $storeCode,\n 'payment' => $checkoutConfig['payment'],\n 'language' => $this->localeResolver->getLocale(),\n 'currency' => $this->currencyProvider->getConfig(),\n 'defaultCountryId' => $checkoutConfig['defaultCountryId'],\n ]\n ]);\n\n $this->eventManager->dispatch('hyva_react_checkout_config', ['transport' => $transport]);\n\n return $this->serializer->serialize($transport->getData('output'));\n }",
"public function getSenderEmail($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_TRANSACTIONAL_EMAIL_SENDER, $store);\n }",
"public function getSforceConfig() {\n $sforce = $this->getDataSource();\n return $sforce->config;\n }",
"public function getConfigSys()\n {\n return $this->__config__;\n }",
"public function isTransactionalEmailEnabled($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_TRANSACTIONAL_EMAIL_ENABLED, $store);\n }",
"private function getShopgateCondition()\n {\n return [\n 'label' => __('Shopgate Mobile App'),\n 'value' => ShopgateOrder::class,\n ];\n }",
"public function klarnaPaymentEnabled($store = null)\n {\n return Mage::getStoreConfigFlag('payment/klarna_kco/active', $store);\n }",
"public function system_setting()\n {\n return $this->hasOne('App\\SystemSetting');\n }",
"public function getCatalogrequestConfigStatus()\n {\n $path = \"catalogrequest/catalogrequest/status\";\n return Mage::getStoreConfig($path);\n }",
"public function getTestModeEnabledFlag($store = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);\n }",
"public function updateMasterProducts($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_UPDATE_MASTER, $store));\n }",
"public function getAsync()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ASYNC);\n }",
"protected function _getStoreConfig($path, $store = null)\n {\n return Mage::getStoreConfig($path, $store);\n }",
"public function getSysConf()\n {\n return $this->sysconf;\n }",
"public function getSysConf()\n {\n return $this->sysconf;\n }",
"public function enabled($store = null);",
"protected function getConfig($name)\n\t{\n\t\treturn $this->app['config'][\"nova-dynamic-lang.sections.stores.{$name}\"];\n\t}",
"public function getPrefix($store = null) {\n\t\tif ($store) {\n\t\t\t$data = $store->getConfig(Self::CONF_PREFIX);\n\t\t} else {\n\t\t\t$data = $this->_scopeConfig->getValue(Self::CONF_PREFIX, ScopeInterface::SCOPE_STORE);\n\t\t}\n\t\treturn $data;\n\t}",
"public function getIsEnabled()\n\t{\n\t\treturn Mage::getStoreConfig(self::XML_PATH_ENABLE);\n\t}",
"public function retrieveSystemConfiguration()\n {\n return $this->start()->uri(\"/api/system-configuration\")\n ->get()\n ->go();\n }",
"public function getStatusPending($storeId = 0)\n {\n return $this->config->orderStatusPending($storeId);\n }",
"public function getWrappingTaxClass($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_TAX_CLASS, $store);\n }",
"public function getSectionStatus() {\r\n\t\t$config = $this->getConfig();\r\n return $config[\"enable\"];\r\n }",
"public static function getSecureModeValue($cartAmount = 1) {\n $configModel = new Configurations();\n $thresholdValue = $configModel->get(config('configurations.mangopay_3dsecure_key'));\n $secureMode = 'DEFAULT';\n if ($cartAmount >= $thresholdValue) {\n $secureMode = 'FORCE';\n }\n return $secureMode;\n }",
"public function getStoreMode()\n {\n return $this->storeMode;\n }",
"public function enabled()\n {\n return (bool) Mage::getStoreConfig('actions/settings/enabled');\n }",
"public static function syncConfig()\n {\n $addon = self::addon();\n\n if (!self::isBackwardsCompatible() && !$addon->hasConfig('synchronize')) {\n $addon->setConfig('synchronize', false);\n\n if (\n $addon->getConfig('synchronize_actions') == true ||\n $addon->getConfig('synchronize_modules') == true ||\n $addon->getConfig('synchronize_templates') == true ||\n $addon->getConfig('synchronize_yformemails') == true\n ) {\n $addon->setConfig('synchronize', true);\n\n // Set developer synchronizing actions according to theme settings\n if ($addon->getConfig('synchronize_templates')) {\n rex_addon::get('developer')->setConfig('templates', true);\n }\n if ($addon->getConfig('synchronize_modules')) {\n rex_addon::get('developer')->setConfig('modules', true);\n }\n if ($addon->getConfig('synchronize_actions')) {\n rex_addon::get('developer')->setConfig('actions', true);\n }\n if ($addon->getConfig('synchronize_yformemails')) {\n rex_addon::get('developer')->setConfig('yform_email', true);\n }\n }\n\n $addon->removeConfig('synchronize_actions');\n $addon->removeConfig('synchronize_modules');\n $addon->removeConfig('synchronize_templates');\n $addon->removeConfig('synchronize_yformemails');\n }\n }",
"public function getEnableSms()\n {\n return $this->enableSms;\n }",
"public function getMasterList($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_MASTER_LIST, $store);\n }",
"public function getConfigSOQL() {\n return $this->config['SOQL'];\n }",
"public function getVersionConfig($store = null)\n {\n $version = Mage::getStoreConfig('payment/klarna_kco/api_version', $store);\n\n if (!isset($this->_versionConfigCache[$version])) {\n $this->_versionConfigCache[$version] = $this->getCheckoutVersionDetails($version);\n }\n\n return $this->_versionConfigCache[$version];\n }",
"public function isEnabled($storeId=0){\n \tif($storeId==0)\n \t\t$storeId=Mage::app()->getStore()->getId();\n \treturn Mage::getStoreConfig('ced_csmultishipping/general/activation', $storeId);\n }",
"public function getConfig()\n {\n return Mage::helper(\"meanbee_osd/config\");\n }",
"public function getProcessedOrderStatus($store = null)\n {\n return $this->getPaymentValue('order_status', ConfigProvider::CODE, $store);\n }",
"protected function getConfig($name)\n {\n return $this->app['config'][\"option.stores.{$name}\"];\n }",
"public function allowGiftReceipt($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOW_GIFT_RECEIPT, $store);\n }",
"private function _getCreateCreditmemoOption()\n {\n return (boolean) Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/create_creditmemo', Mage::app()->getStore()->getStoreId());\n }",
"protected function _syncGatewayConfig() {\n if ($this->_gateway && $paymentGatewayCode = $this->getCurrentPaymentGateway()) {\n $gatewayConfiguration = $this->_gateway->configuration();\n if (isset($gatewayConfiguration['minimumAmount'])) {\n $this->model_setting_setting->editSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_total', $gatewayConfiguration['minimumAmount'], $this->config->get('config_store_id'));\n }\n if (isset($gatewayConfiguration['name'])) {\n $this->model_setting_setting->editSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_title', $gatewayConfiguration['name'], $this->config->get('config_store_id'));\n }\n if (isset($gatewayConfiguration['description'])) {\n $this->model_setting_setting->editSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_description', $gatewayConfiguration['description'], $this->config->get('config_store_id'));\n }\n }\n }",
"public function getApi()\n {\n return Mage::getStoreConfig('actions/settings/api');\n }",
"public function getConfig($field)\n {\n return Mage::getStoreConfig(self::XML_PATH_CERTIFIED_SHOPS . $field);\n }",
"public function isEnabled($store = null)\n {\n return (boolean) Mage::getStoreConfig(self::XML_PATH_ENABLED, $store);\n }",
"public function getMCMinSyncDateFlag()\r\n {\r\n return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::GENERAL_MCMINSYNCDATEFLAG);\r\n }",
"protected function getStoreConfig () {\n\t\t$aConfig = array(\n\t\t\t'db_host'\t\t=> DB_HOST,\n\t\t\t'db_name'\t\t=> DB_NAME,\n\t\t\t'db_user'\t\t=> DB_USER,\n\t\t\t'db_pwd'\t\t=> DB_PASSWORD,\n\t\t\t'store_name'\t=> getWpPrefix() . 'pp_thesaurus',\n\t\t);\n\n\t\treturn $aConfig;\n\t}",
"public function setForceMagento($forceMagento)\n {\n $this->_forceMagento = $forceMagento;\n return $this;\n }",
"protected function getConfig()\n {\n\n return $this->app['config']['manticore'];\n }",
"public function getCheckoutType($store = null)\n {\n return $this->getVersionConfig($store)->getType();\n }",
"protected function getStoreName() {\n return Mage::getStoreConfig('general/store_information/name');\n }",
"public function getConfig ()\n {\n $config = Mage::getModel('socnet/network')\n ->getConfigByNetworkKey($this->getNetworkKey());\n return $config;\n }",
"private function _getSyncConfig($uri, $wrapperName, $modelUri)\n {\n if (null === $this->_syncConfigCache) {\n $store = Erfurt_App::getInstance()->getStore();\n\n require_once 'Erfurt/Sparql/SimpleQuery.php';\n $query = new Erfurt_Sparql_SimpleQuery();\n $query->setProloguePart('SELECT ?s ?p ?o');\n $query->addFrom($this->_syncModelUri);\n $where = 'WHERE {\n ?s ?p ?o .\n ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> .\n ?s <' . $this->_properties['syncResource'] . '> <' . $uri . '> .\n ?s <' . $this->_properties['targetModel'] .'> <' . $modelUri . '> .\n ?s <' . $this->_properties['wrapperName'] . '> \"' . $wrapperName . '\" .\n }';\n $query->setWherePart($where);\n\n $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n if (count($result) === 0) {\n return false;\n }\n\n $retVal = array();\n foreach ($result as $row) {\n if (!isset($retVal[$row['s']])) {\n $retVal[$row['s']] = array(\n 'uri' => $row['s']\n );\n }\n\n switch ($row['p']) {\n case $this->_properties['targetModel']:\n $retVal[$row['s']]['targetModel'] = $row['o'];\n break;\n case $this->_properties['syncResource']:\n $retVal[$row['s']]['syncResource'] = $row['o'];\n break;\n case $this->_properties['wrapperName']:\n $retVal[$row['s']]['wrapperName'] = $row['o'];\n break;\n case $this->_properties['lastSyncPayload']:\n $retVal[$row['s']]['lastSyncPayload'] = unserialize($row['o']);\n break;\n case $this->_properties['lastSyncDateTime']:\n $retVal[$row['s']]['lastSyncDateTime'] = $row['o'];\n break;\n case $this->_properties['syncQuery']:\n $retVal[$row['s']]['syncQuery'] = $row['o'];\n break;\n case $this->_properties['checkHasChanged']:\n $retVal[$row['s']]['checkHasChanged'] = (bool)$row['o'];\n break;\n }\n }\n\n $this->_syncConfigCache = array_values($retVal);\n $this->_syncConfigCache = $this->_syncConfigCache[0]; // Only return one config!\n }\n\n return $this->_syncConfigCache;\n }",
"public function getShopStoreProperty()\n {\n return $this->hasOne(ShopStoreProperty::className(), ['id' => 'shop_store_property_id']);\n }",
"public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }",
"public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ogone_orderstandard';\n\n\t\treturn $settings;\n\t}",
"public function getPlatform()\n {\n return 'magento';\n }",
"public function getCanonicalEnabled()\n {\n return $this->getStoreValue(self::ALTERNATE_CANONICAL);\n }",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function syncSettings()\n {\n $zone = $this->getZone();\n if (isset($zone['id'])) {\n $settingsConnection = $this->getSettingConnection();\n $zoneSettings = $settingsConnection->settings($zone['id']);\n\n if (!isset($zoneSettings['result']['errors'])) {\n $result = [];\n foreach ($zoneSettings['result'] as $setting) {\n if (is_array($setting['value'])) {\n $result[$setting['id']] = $this->jsonHelper->jsonEncode($setting['value']);\n } else {\n $result[$setting['id']] = $setting['value'];\n }\n }\n\n $groupForSave = $this->internScope->getThreeScope($result, 'zone_settings');\n $configData = [\n 'section' => $this->internScope->getSection(),\n 'website' => $this->internScope->getCurrentWebsite(),\n 'store' => $this->internScope->getCurrentStore(),\n 'groups' => $groupForSave,\n ];\n\n $configModel = $this->_configFactory->create(['data' => $configData]);\n $configModel->save();\n\n return true;\n }\n }\n\n return false;\n }",
"public function getShopConfig()\n {\n $oReturn = new stdClass();\n $oReturn->language = $this->config->getShopLanguageConfig();\n $oReturn->currency = $this->config->getShopCurrencyConfig();\n $oReturn->condition = $this->config->getShopConditionConfig();\n\n return $oReturn;\n }",
"public function getEnabled()\n {\n return Mage::getStoreConfig('splitprice/split_price_config/enabled');\n }",
"public function getProductSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_FREQUENCY);\n }",
"public function getManageStock()\n {\n return (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK);\n }",
"protected function getConfigName()\n {\n return 'realtime';\n }",
"public function getStoreValue()\n {\n $value = $this->_config->get('general_defaults/store');\n\n if ($value === null) {\n $value = '0';\n }\n\n $value = explode(',', $value);\n $value = array_map('trim', $value);\n $value = array_filter($value, function($value) {\n return $value || $value === '0';\n });\n\n return $value;\n }",
"public function getAllowSendToCustomer()\n {\n return $this->allow_send_to_customer;\n }",
"public function getOnlyOnYes()\n {\n return $this->onlyOnYes;\n }",
"public function getOrderMangagementClass($store = null)\n {\n return $this->getVersionConfig($store)->getOrdermanagement();\n }",
"public function displaySalesWrappingBothPrices($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_SALES_WRAPPING, $store);\n return $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH;\n }",
"public function get_setting() {\n // $this->db->where('option_name', $opname);\n \n $query = $this->db->get('t_pref');\n return $query->row();\n }",
"protected function _getStoresArray()\n {\n $config = Mage::getModel('emailchef/config');\n /* @var $config EMailChef_EMailChefSync_Model_Config */\n return $config->getStoreArray();\n }",
"public function validateSystemConfig()\n {\n if ($this->hasRequestedScopeAccess()) {\n return;\n }\n\n $redirectPath = 'adminhtml/system_config/edit';\n\n $section = $this->_request->getParam('section');\n if ($section) {\n $redirectPath .= '/section/' . $section;\n }\n\n // redirect to first allowed website or store scope\n if ($this->_role->getWebsiteIds()) {\n $this->_redirect(\n $this->_backendUrl->getUrl(\n $redirectPath,\n ['website' => $this->getAnyStoreView()->getWebsite()->getCode()]\n )\n );\n return;\n }\n\n $store = $this->getAnyAccessibleStoreView();\n if ($store instanceof \\Magento\\Store\\Api\\Data\\StoreInterface) {\n $this->_redirect(\n $this->_backendUrl->getUrl(\n $redirectPath,\n ['store' => $store->getId()]\n )\n );\n } else {\n $this->_redirect('admin/noroute');\n }\n }",
"public function displayCartWrappingBothPrices($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_CART_WRAPPING, $store);\n return $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH;\n }",
"public function getCheckoutConfig()\n {\n return $this->_get('checkoutConfig');\n }",
"public function getModuleConfig($path) {\n $value = Mage::getStoreConfig($path);\n $storeId = false;\n\n if ($this->isAdmin()) {\n // Are we in credit memo?\n $_creditMemo = Mage::registry('current_creditmemo');\n if ($_creditMemo) {\n $storeId = $_creditMemo->getOrder()->getData(\"store_id\");\n } else {\n $session = Mage::getSingleton('adminhtml/session_quote');\n // We will get the store ID from here\n $storeId = $session->getStoreId();\n }\n\n if(!$storeId) {\n if(Mage::registry('current_order') && Mage::registry('current_order')->getStoreId()) {\n $storeId = Mage::registry('current_order')->getStoreId();\n } else if ( Mage::registry('current_invoice') && Mage::registry('current_invoice')->getStoreId()) {\n $storeId = Mage::registry('current_invoice')->getStoreId();\n }\n }\n\n\n if($storeId) {\n $value = Mage::getStoreConfig($path, Mage::getModel('core/store')->load( $storeId ));\n }\n }\n return $value;\n }",
"public function getConfigPaymentAction()\n {\n return $this->getConfigData('order_status') == 'pending' ? null : parent::getConfigPaymentAction();\n }",
"public function toArray()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t\tself::CONFIG_NO => Mage::helper('adminhtml')->__('No'),\r\n\t\t\t\tself::CONFIG_YES => Mage::helper('adminhtml')->__('Yes'),\r\n\t\t);\r\n\t}",
"public function merchantInstallmentSelection(){\n\n return Mage::getStoreConfig(self::XPATH_CONFIG_INSTALLMENT_SELECTION);\n }",
"public function getSettings($name = 'general')\n {\n $code = Mage::app()->getRequest()->getParam('store');\n $code_w = Mage::app()->getRequest()->getParam('website');\n if ($code != '') {\n $store_id = Mage::getModel('core/store')->load($code)->getId();\n } else if ($code_w != '') {\n $website_id = Mage::getModel('core/website')->load($code)->getId();\n $store_id = Mage::app()->getWebsite($website_id)->getDefaultStore()->getId();\n } else {\n $store_id = 0;\n }\n\n if ($code == '' && $code_w == '')\n $settings = Mage::getStoreConfig('vss/spinandwin/' . $name, $store_id);\n else if (isset($website_id))\n $settings = Mage::app()->getWebsite($website_id)->getConfig('vss/spinandwin/' . $name);\n else if (isset($store_id))\n $settings = Mage::getStoreConfig('vss/spinandwin/' . $name, $store_id);\n else\n $settings = Mage::getStoreConfig('vss/spinandwin/' . $name);\n\n if (trim($settings) != \"\")\n $settings = unserialize($settings);\n else\n $settings = $this->getDefaultSettings($name);\n\n return $settings;\n }",
"public function getSendToMerchant()\n {\n return $this->send_to_merchant;\n }",
"public function getGeneralSetting($config_name)\n {\n return Mage::getStoreConfig('Shoptimally/GeneralSettings/' . $config_name, Mage::app()->getStore());\n }",
"public function getSyncOrders($store)\n {\n $storeId = $this->getStoreId($store);\n\n $syncOrders = Mage::getModel('shippit/sync_order')\n ->getCollection()\n ->join(\n array('order' => 'sales/order'),\n 'order.entity_id = main_table.order_id',\n array(),\n null,\n 'left'\n )\n ->addFieldToFilter('main_table.status', Shippit_Shippit_Model_Sync_Order::STATUS_PENDING)\n ->addFieldToFilter('main_table.attempt_count', array('lteq' => Shippit_Shippit_Model_Sync_Order::SYNC_MAX_ATTEMPTS))\n ->addFieldToFilter('order.state', array('eq' => Mage_Sales_Model_Order::STATE_PROCESSING))\n ->addFieldToFilter('order.store_id', array('eq' => $storeId));\n\n // Check if order status filtering is active\n if ($this->helper->isFilterOrderStatusActive()) {\n $filterStatus = $this->helper->getFilterOrderStatus();\n\n // ensure there is a filtering value present\n if (!empty($filterStatus)) {\n $syncOrders->addFieldToFilter(\n 'order.status',\n array(\n 'in' => $filterStatus\n )\n );\n }\n }\n\n return $syncOrders;\n }",
"protected function _getConfigModel()\n {\n if (!$this->hasConfigModel()) {\n $this->setConfigModel(Mage::getConfig());\n }\n\n return $this->getConfigModel();\n }",
"public function getConfig() {\n return Mage::getSingleton('profileolabs_shoppingflux/config');\n }",
"public function config($value)\n {\n return Mage::getStoreConfig(\"simple_relevance/general/$value\");\n }",
"public function getPaymentGateway()\n {\n return Mage::getStoreConfig(\"fontis_masterpass/settings/payment_gateway\");\n }",
"public function getTrackingNotificationMessage($store=null)\n {\n return (string) $this->getConfig('notification/tracking_notification_message',$store);\n }"
] | [
"0.6817371",
"0.6248821",
"0.6130598",
"0.6115169",
"0.59758514",
"0.5474048",
"0.5280187",
"0.5247429",
"0.52199924",
"0.5219286",
"0.52076316",
"0.5158877",
"0.5128161",
"0.507192",
"0.5047929",
"0.5032075",
"0.4981114",
"0.498024",
"0.4973968",
"0.49737",
"0.4944672",
"0.49423975",
"0.49313375",
"0.49228677",
"0.49163058",
"0.49142084",
"0.49109662",
"0.4902747",
"0.48952344",
"0.48821735",
"0.48821735",
"0.48745334",
"0.4856239",
"0.48203197",
"0.48148108",
"0.4813298",
"0.4797664",
"0.47944728",
"0.476628",
"0.4760711",
"0.4747816",
"0.4744984",
"0.47431847",
"0.47428823",
"0.47412977",
"0.47310323",
"0.47261566",
"0.47181687",
"0.4708946",
"0.47067314",
"0.47019544",
"0.46963784",
"0.46943083",
"0.46905482",
"0.46891573",
"0.46799535",
"0.46675205",
"0.4664382",
"0.46564442",
"0.4655826",
"0.46492907",
"0.46445635",
"0.46405134",
"0.4632092",
"0.46319398",
"0.4613518",
"0.46094593",
"0.46028185",
"0.46024823",
"0.46007022",
"0.45959908",
"0.45955053",
"0.45912087",
"0.4589534",
"0.45879728",
"0.4573686",
"0.45700333",
"0.45632643",
"0.45594054",
"0.4527839",
"0.4516858",
"0.45137087",
"0.45114252",
"0.45107725",
"0.45006102",
"0.44987208",
"0.44907182",
"0.44905356",
"0.44892567",
"0.448794",
"0.44877467",
"0.4479941",
"0.44787118",
"0.44760814",
"0.4474896",
"0.44696313",
"0.44695577",
"0.44679293",
"0.44661078",
"0.4457728"
] | 0.6966115 | 0 |
Check if Order Sync is enabled for the given store on the current domain. | public function isOrderSyncEnabled($store = null) {
$flag = $this->getOrderSyncEnabledFlag($store);
// Require "Forced" configuration setting to enable Sync on non production environments
if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
return in_array($flag, array(
Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,
Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED
));
} else {
return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configuration setting to enable Product Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n return in_array($flag, array(\n Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,\n Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED\n ));\n } else {\n return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;\n }\n }",
"public function getOrderSyncEnabledFlag($store = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_ENABLED, $store));\n }",
"public function hasProductSyncRun($store = null) {\n $config = Mage::getConfig();\n\n if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, \"store\", $store)) {\n return false;\n }\n\n return true;\n }",
"public function isGiftWrappingAvailableForOrder($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_ALLOWED_FOR_ORDER, $store);\n }",
"public function isEcomSyncDataEnabled()\r\n {\r\n $apiKey = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::GENERAL_APIKEY);\r\n $moduleEnabled = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::GENERAL_ACTIVE);\r\n $ecommerceEnabled = Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::ECOMMERCE_ACTIVE);\r\n $ret = !is_null($this->getMCStoreId()) && $this->getMCStoreId() != null\r\n && !is_null($apiKey) && $apiKey != \"\" && $moduleEnabled && $ecommerceEnabled;\r\n return $ret;\r\n }",
"public function isSyncEnabled() {\n $subsStatus = $this->getContactFlag('subscribe_setting');\n if ($this->isServiceActive() && $subsStatus) {\n return true;\n }\n return false;\n }",
"public function getProductSyncEnabledFlag($store_id = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_ENABLED, $store_id));\n }",
"public function isEnabled()\n {\n $storeCode = $this->storeManager->getStore()->getCode();\n return $this->scopeConfig->getValue(self::CONFIG_DATA_PATH, ScopeInterface::SCOPE_STORE, $storeCode) === '1';\n }",
"public function canStoreOrder();",
"public function isTransactionalEmailEnabled($store = null)\n {\n return Mage::getStoreConfig(self::XML_PATH_TRANSACTIONAL_EMAIL_ENABLED, $store);\n }",
"public function isEnabled()\n\t{\n\t\treturn $this->scopeConfig->getValue(\n\t\t\t$this->getConfigPath(self::SYSTEM_CONFIG_PATH_ENABLED),\n\t\t\t\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n\t\t);\n\t}",
"abstract protected function isSyncRequired($entity);",
"public function is_calendar_sync_enabled() {\n return $this->is_connected() && $this->get_calendar_id();\n }",
"public function getEnabled($storeId = null)\n {\n if (!$this->generalHelper->getEnabled($storeId)) {\n return false;\n }\n\n return $this->generalHelper->getStoreValue(self::XPATH_ORDER_ENABLE, $storeId);\n }",
"protected function isTwoWaySyncEnabled($entity)\n {\n $channel = $entity->getChannel();\n return $channel && $channel->getSynchronizationSettings()->offsetGetOr('isTwoWaySyncEnabled', false)\n && $channel->isEnabled();\n }",
"protected function shouldUseLocks($store)\n {\n return $store instanceof LockProvider && ! $store instanceof DynamoDbStore;\n }",
"public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function isScopeStore()\n {\n return !$this->isScopeGlobal() && !$this->isScopeWebsite();\n }",
"public function isAutoLoginEnabled()\n {\n return $this->scopeConfig->getValue(\n self::AUTO_LOGIN_ENABLE,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function hasSyncKey()\n {\n return $this->get(self::SYNC_KEY) !== null;\n }",
"public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function isExtentionEnable() {\n\t\treturn $this->_scopeConfig->getValue(Self::ENABLE, ScopeInterface::SCOPE_STORE);\n\t}",
"public function hasStore(): bool;",
"public function isTestModeEnabled($store = null) {\n return $this->getTestModeEnabledFlag($store) || !Mage::helper(\"klevu_search\")->isProductionDomain(Mage::app()->getStore($store)->getBaseUrl());\n }",
"public function canUseCheckout()\n {\n $token = \\Mage::getStoreConfig('payment/cryptomarket/cryptomkt_apikey');\n\n if (false === isset($token) || true === empty($token)) {\n $this->debugData('[ERROR] In Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): There was an error retrieving the token store param from the database or this Magento store does not have a CryptoMarket token.');\n\n return false;\n }\n\n $this->debugData('[INFO] Leaving Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): token obtained from storage successfully.');\n\n return true;\n }",
"private function isSingleCourseSync(): bool\n {\n return !empty($this->maconomyId);\n }",
"public function isStoreActive() {\r\n\t\treturn $this->_storeManager->getStore()->isActive();\r\n\t}",
"public function isAllowed($store = null)\n {\n return true;\n }",
"public function isEnabled($store = null) {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);\n }",
"public function isUnsentOrderAdjustmentEnabled()\n {\n $flag = (integer) $this->scopeConfig->getValue(\n 'orderflow_inventory_import/settings/adjust_inventory',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n\n return $flag > 0;\n }",
"public function enabled($store = null);",
"public function klarnaPaymentEnabled($store = null)\n {\n return Mage::getStoreConfigFlag('payment/klarna_kco/active', $store);\n }",
"public function is_order_voided( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\treturn ( $this->order_has_status( $order, 'voided' ) );\n\t}",
"public function isAvailable($storeId)\n {\n $active = $this->config->isModuleEnabled($storeId);\n if (!$active) {\n return false;\n }\n\n $apiKey = $this->getApiKey($storeId);\n if (empty($apiKey)) {\n return false;\n }\n\n return true;\n }",
"public function canStoreEnabled();",
"public function is_order_contains_store_credit( $order = null ) {\n\n\t\t\tif ( empty( $order ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$coupons = $order->get_items( 'coupon' );\n\n\t\t\tforeach ( $coupons as $item_id => $item ) {\n\t\t\t\t$code = trim( $item['name'] );\n\t\t\t\t$coupon = new WC_Coupon( $code );\n\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t$discount_type = $coupon->get_discount_type();\n\t\t\t\t} else {\n\t\t\t\t\t$discount_type = ( ! empty( $coupon->discount_type ) ) ? $coupon->discount_type : '';\n\t\t\t\t}\n\t\t\t\tif ( 'smart_coupon' === $discount_type ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t}",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_TRANSACTIONAL_API_ENABLED);\n }",
"public function isDelayedPushNotification($store = null)\n {\n return $this->getVersionConfig($store)->isDelayedPushNotification();\n }",
"public function hasOrder()\n {\n return $this->_has('_order');\n }",
"private function isPendingInStore($orderStatus){\r\n return $orderStatus == 'pending';\r\n }",
"public function getSyncOrders($store)\n {\n $storeId = $this->getStoreId($store);\n\n $syncOrders = Mage::getModel('shippit/sync_order')\n ->getCollection()\n ->join(\n array('order' => 'sales/order'),\n 'order.entity_id = main_table.order_id',\n array(),\n null,\n 'left'\n )\n ->addFieldToFilter('main_table.status', Shippit_Shippit_Model_Sync_Order::STATUS_PENDING)\n ->addFieldToFilter('main_table.attempt_count', array('lteq' => Shippit_Shippit_Model_Sync_Order::SYNC_MAX_ATTEMPTS))\n ->addFieldToFilter('order.state', array('eq' => Mage_Sales_Model_Order::STATE_PROCESSING))\n ->addFieldToFilter('order.store_id', array('eq' => $storeId));\n\n // Check if order status filtering is active\n if ($this->helper->isFilterOrderStatusActive()) {\n $filterStatus = $this->helper->getFilterOrderStatus();\n\n // ensure there is a filtering value present\n if (!empty($filterStatus)) {\n $syncOrders->addFieldToFilter(\n 'order.status',\n array(\n 'in' => $filterStatus\n )\n );\n }\n }\n\n return $syncOrders;\n }",
"public function isStockEnabledBackend()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_BACKEND_STOCK_CHECK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isServiceEnabled($type, $store = null) {\n $configHelper = Mage::helper('oklibmagento/config');\n switch ($type) {\n case self::SERVICE_TYPE_OPEN:\n return boolval($configHelper->getOkOpenValue(\"enabled\", $store));\n break;\n case self::SERVICE_TYPE_CASH:\n return boolval($configHelper->getOkCashValue(\"enabled\", $store));\n break;\n default:\n return false;\n }\n }",
"public function isAheadworksCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('AW_Onestepcheckout');\n }",
"public function isPartialPaymentSupport($store = null)\n {\n return !$this->getVersionConfig($store)->isPartialPaymentDisabled();\n }",
"public function isSynced(): bool\n {\n return $this->synced;\n }",
"protected function isOrderLocked(OrderEvent $event)\n {\n if (!$event->getForce() && $event->getOrder()->getLocked()) {\n $event->addMessage(new ResourceMessage('ekyna_order.event.locked', ResourceMessage::TYPE_ERROR));\n return true;\n }\n return false;\n }",
"protected function isSingleStoreMode()\n {\n return Mage::app()->isSingleStoreMode();\n }",
"public function isSplitOrderEnabled()\n {\n if ($this->isMultipleMode()) {\n return (\n (Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_SPLIT_ORDER)) && \n !($this->getWarehouseHelper()->isPayPalExpressRequest())\n ) ? true : false;\n } else {\n return false;\n }\n }",
"public function isAvailable($quote = null)\n {\n\n $storeId = 0;\n // allow multi store/site for backend orders with disabled backend payment methods in default store\n if (!is_null($quote) && !is_null($quote->getId())) {\n $storeId = $quote->getStoreId();\n }\n if (Mage_Core_Model_App::ADMIN_STORE_ID == Mage::app()->getStore()->getId()\n && false == $this->isEnabledForBackend($storeId)\n ) {\n return false;\n }\n\n return parent::isAvailable($quote);\n }",
"protected function isAdminStore()\n {\n return $this->getValue(ColumnKeys::STORE_VIEW_CODE) === null;\n }",
"public function isTmFireCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('TM_FireCheckout');\n }",
"private function allowOrdersAtAnytime()\n {\n return (bool) get_option('ALLOW_ANYTIME_FOOD_ORDERS');\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order');\n }",
"public function checkEnabled()\n {\n $app_id = $this->_application->id;\n return $this->app->zoocart->getConfig($app_id)->get('enable_cart');\n }",
"public function isEnabled($store = null)\n {\n return (boolean) Mage::getStoreConfig(self::XML_PATH_ENABLED, $store);\n }",
"public function kcoEnabled($store = null, $customer = null)\n {\n if (!$this->klarnaPaymentEnabled($store)) {\n return false;\n }\n\n if (null === $customer) {\n $customer = Mage::helper('customer')->getCustomer();\n }\n\n $customerGroupId = $customer->getId() ? $customer->getGroupId() : 0;\n $disabledCustomerGroups = Mage::helper('klarna_kco/checkout')->getPaymentConfig('disable_customer_group');\n $disabledCustomerGroups = trim($disabledCustomerGroups);\n\n if ('' == $disabledCustomerGroups) {\n return true;\n }\n\n if (!is_array($disabledCustomerGroups)) {\n $disabledCustomerGroups = explode(',', (string)$disabledCustomerGroups);\n }\n\n return !in_array($customerGroupId, $disabledCustomerGroups);\n }",
"public function isEnabled()\n {\n return $this->config->isEnabledSDK($this->_storeManager->getStore()->getId());\n }",
"public function hasOrderExportRules()\n {\n $exportOrders = $this->scopeConfig->getValue('wesupply_api/wesupply_order_export/wesupply_order_filter', ScopeInterface::SCOPE_STORE);\n if ($exportOrders === 'exclude_specific') {\n return true;\n }\n\n return false;\n }",
"public function isStoreAdmin() {\n return $this->authorise('store.admin', 'store');\n }",
"public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }",
"protected function canLog($order) {\n if ($order instanceof Mage_Sales_Model_Order\n && $this->helper()->isLogEnable()){\n return $order->getStatus() == $this->helper()->getOrderStatus();\n }\n return false;\n }",
"public function fcIsPayPalOrder() \n {\n $blReturn = false;\n if ($this->oxorder__oxpaymenttype->value == 'fcpopaypal' || $this->oxorder__oxpaymenttype->value == 'fcpopaypal_express') {\n $blReturn = true;\n }\n return $blReturn;\n }",
"public function isAllowOrder() {\n $qtyAllow = false;\n \n // check qty\n if ($this->quantity >= $this->minimum_quantity) {\n $qtyAllow = true;\n }\n else {\n if ($this->when_out_of_stock == 1) {\n $qtyAllow = true;\n }\n }\n \n // check all\n if (($qtyAllow) & ($this->active) & ($this->available_for_order)) {\n return true;\n }\n \n return false;\n }",
"public function isOrder();",
"private function checkOrderSent(OrderInterface $commerce_order): bool {\n $order = new OrderController($commerce_order);\n /** @var User $proveedor */\n $proveedor = User::load($this->account->id());\n $enviado = TRUE;\n foreach ($order->getOrderItemsProvider($proveedor) as $line) {\n if ($line->get('field_estado')->value != 'enviado') {\n $enviado = FALSE;\n break;\n }\n }\n return $enviado;\n }",
"public function isEnabled(int $storeId = null): bool;",
"public function isEnabled($storeId = null)\n {\n return $this->_scopeConfig->isSetFlag(\n self::XML_PATH_ENABLED,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }",
"function syncStoreToCRM($sync_interval=0) {\n global $DB;\n\t if (self::checkConnection()) {\n\t\t //\\Helper::Log('(syncStoreToCRM) run period ' . $sync_period);\n\t\t // Get plugin object\n\t\t $plugin = false;\n\t\t if (strlen(self::$profile['PLUGIN'])) {\n\t\t\t $arProfilePlugin = Exporter::getInstance(self::$MODULE_ID)->getPluginInfo(self::$profile['PLUGIN']);\n\t\t\t if (is_array($arProfilePlugin)) {\n\t\t\t\t $strPluginClass = $arProfilePlugin['CLASS'];\n\t\t\t\t if (strlen($strPluginClass) && class_exists($strPluginClass)) {\n\t\t\t\t\t $plugin = new $strPluginClass(self::$MODULE_ID);\n\t\t\t\t\t $plugin->setProfileArray(self::$profile);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t // List of orders, changed by last period (if period is not set than get all orders)\n\t\t if ($plugin) {\n\t\t\t $filter = [];\n\t\t\t if ($sync_interval > 0) {\n\t\t\t\t $filter['change_date_from'] = time() - $sync_interval;\n\t\t\t }\n\t\t\t $orders_ids = $plugin->getOrdersIDsList($filter);\n\t\t\t foreach ($orders_ids as $order_id) {\n\t\t\t\t $order_data = $plugin->getOrder($order_id);\n\t\t\t\t try {\n\t\t\t\t\t self::syncOrderToDeal($order_data);\n\t\t\t\t } catch (\\Exception $e) {\n\t\t\t\t\t //\\Helper::Log('(syncStoreToCRM) can\\'t sync of order ' . $order_data['ID']);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t //\\Helper::Log('(syncStoreToCRM) success');\n\t }\n }",
"public function isPayPalOrder()\n {\n $blActive = false;\n\n $oOrder = $this->getEditObject();\n if ($oOrder && $oOrder->getFieldData('oxpaymenttype') == 'oxidpaypal') {\n $blActive = true;\n }\n\n return $blActive;\n }",
"public function isPhoneMandatorySupport($store = null)\n {\n return $this->getVersionConfig($store)->isPhoneMandatorySupport();\n }",
"private function checkIsYourOrder($order)\n {\n $customerData = $this->sessionCustomer->getCustomer();\n $nameCustomerOrder = $order->getCustomerName();\n $nameCustomerSesstion = $customerData->getName();\n if ($nameCustomerOrder !== $nameCustomerSesstion) {\n return false;\n }\n return true;\n }",
"public function getAsync()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ASYNC);\n }",
"public function isActiveQuoteAdjustmentEnabled()\n {\n $flag = (integer) $this->scopeConfig->getValue(\n 'orderflow_inventory_import/settings/adjust_inventory',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n\n return $flag > 1;\n }",
"public function isSyncable() {\n return (bool) $this->_syncable;\n }",
"public function isTrackingAllowed() {\n\t $data = Mage::getStoreConfig('rublon_allow_tracking');\n\t \t\t\n\t return !empty($data)?true:false;\n\t}",
"public function isExtensionConfigured($store_id = null) {\n $js_api_key = $this->getJsApiKey($store_id);\n $rest_api_key = $this->getRestApiKey($store_id);\n\n return (\n $this->isExtensionEnabled($store_id)\n && !empty($js_api_key)\n && !empty($rest_api_key)\n );\n }",
"public function isEnabled($storeId=0){\n \tif($storeId==0)\n \t\t$storeId=Mage::app()->getStore()->getId();\n \treturn Mage::getStoreConfig('ced_csmultishipping/general/activation', $storeId);\n }",
"private function _getSendOrderConfirmationOption()\n {\n return (boolean) Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/send_order_confirmation', Mage::app()->getStore()->getStoreId());\n }",
"public function isInstalled()\n {\n return $this->getDataVersion() && $this->getOldStores();\n }",
"public function isEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n 'orderflow_inventory_import/settings/is_enabled',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n }",
"public function isMoveToCartEnabled()\n {\n return (boolean)$this->scopeConfig->getValue(\n self::XML_PATH_MOVE_TO_CART,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function enabled()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->issetCustomExec())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->fields['USE']->getValue() == 'Y';\n\t}",
"public function syncOrders(?Collection $orders = null): bool\n\t{\n\t\tif (!$this->checkSales()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$orders->join(['eh_t' => 'eshop_ehubtransaction'], 'this.uuid = eh_t.fk_order')\n\t\t\t->where('eh_t.uuid IS NULL');\n\n\t\t$check = true;\n\n\t\t/** @var \\Eshop\\DB\\Order $order */\n\t\tforeach ($orders as $order) {\n\t\t\ttry {\n\t\t\t\t$this->sendSaleByOrder($order);\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\tDebugger::log($e->getMessage(), ILogger::WARNING);\n\n\t\t\t\t$check = false;\n\t\t\t}\n\t\t}\n\n\t\treturn $check;\n\t}",
"public function isEnabledOnFront($storeId = null)\n {\n if ($this->isEnabled($storeId)) {\n return $this->_scopeConfig->isSetFlag(\n self::XML_PATH_ENABLED_ON_FRONT,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE,\n $storeId\n );\n }\n\n return false;\n }",
"function canRunSynchronization( $synk )\n {\n return SynkHelperSynchronizations::canRun( $synk );\n }",
"public function hasShoporder(){\n return $this->_has(27);\n }",
"public function isSyncable()\n {\n\n return static::$isSyncable;\n\n }",
"public function isStockEnabledFrontend()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_STOCK_CHECK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public static function is_sync_enabled_for_product( \\WC_Product $product ) {\n\n\t\tif ( ! isset( self::$products_sync_enabled[ $product->get_id() ] ) ) {\n\n\t\t\tif ( $product->is_type( 'variable' ) ) {\n\n\t\t\t\t// assume variable products are not synced until a synced child is found\n\t\t\t\t$enabled = false;\n\n\t\t\t\tforeach ( $product->get_children() as $child_id ) {\n\n\t\t\t\t\t$child_product = wc_get_product( $child_id );\n\n\t\t\t\t\tif ( $child_product && self::is_sync_enabled_for_product( $child_product ) ) {\n\n\t\t\t\t\t\t$enabled = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t$enabled = 'no' !== $product->get_meta( self::SYNC_ENABLED_META_KEY );\n\t\t\t}\n\n\t\t\tself::$products_sync_enabled[ $product->get_id() ] = $enabled;\n\t\t}//end if\n\n\t\treturn self::$products_sync_enabled[ $product->get_id() ];\n\t}",
"public function isPaidUsingMollieOrdersApi(Order $order)\n {\n $method = $order->getPayment()->getMethod();\n try {\n $methodInstance = $this->paymentHelper->getMethodInstance($method);\n } catch (\\Exception $exception) {\n return false;\n }\n\n if (!$methodInstance instanceof \\Mollie\\Payment\\Model\\Mollie) {\n return false;\n }\n\n $checkoutType = $this->getCheckoutType($order);\n if ($checkoutType != 'order') {\n return false;\n }\n\n return true;\n }",
"public function isOAuthShopAlreadyRegistered($shopnumber, $storeViewId)\n {\n /* has shopnumber defined in same website scope */\n if (Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter('path', Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER)\n ->addFieldToFilter('value', $shopnumber)\n ->count()\n ) {\n return true;\n }\n\n /* a shopnumber is set on store view scope with the same scope_id as the base store view for the new shopnumber */\n if (Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter('path', Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER)\n ->addFieldToFilter('scope', 'stores')\n ->addFieldToFilter('scope_id', $storeViewId)\n ->addFieldToFilter('value', array('nin' => array('', null)))\n ->count()\n ) {\n return true;\n }\n\n /* a shopnumber has a default store view set exactly like the base store view for the new shopnumber */\n $resource = Mage::getSingleton('core/resource');\n $table_config_data = $resource->getTableName('core/config_data');\n $collection = Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter(\n 'main_table.path',\n Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_NUMBER\n )\n ->addFieldToFilter('main_table.scope', 'websites')\n ->addFieldToFilter('main_table.value', array('nin' => array('', null)))\n ->addFieldToFilter(\n 'dsv.path',\n Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_DEFAULT_STORE\n )\n ->getSelect()\n ->joinInner(\n array('dsv' => $table_config_data),\n 'dsv.scope = main_table.scope AND dsv.scope_id = main_table.scope_id',\n array('default_store_view' => 'value')\n )->query()\n ->fetchAll();\n\n foreach ($collection as $item) {\n if (isset($item['default_store_view'])\n && $item['default_store_view'] == $storeViewId\n ) {\n return true;\n }\n }\n\n return false;\n }",
"public function can_sync(){\n\t\tif( true === $this->can_sync ){\n\t\t\treturn true;\n\t\t}\n\t\t$this->find_tags();\n\t\t$this->find_binds();\n\t\t$this->can_sync = ! empty( $this->binds );\n\t\treturn $this->can_sync;\n\t}",
"public function canFireCheckout()\n {\n return (bool)Mage::getStoreConfig('firecheckout/general/enabled');\n }",
"public function validateSalesOrderViewAction()\n {\n $id = $this->_request->getParam('order_id');\n if ($id) {\n $object = $this->_objectManager->create(\\Magento\\Sales\\Model\\Order::class)->load($id);\n if ($object && $object->getId()) {\n $store = $object->getStoreId();\n if (!$this->_role->hasStoreAccess($store)) {\n $this->_forward();\n return false;\n }\n }\n }\n return true;\n }",
"public function CanProcessOrders()\n {\n if ($this->owner->IsShopAdmin()) {\n return true;\n }\n\n return Permission::checkMember($this->owner, EcommerceConfig::get(EcommerceRole::class, 'process_orders_permission_code'));\n }",
"public function isIwdCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('IWD_Opc');\n }"
] | [
"0.7657166",
"0.7387574",
"0.72523534",
"0.6671791",
"0.6630824",
"0.6578566",
"0.65314656",
"0.6482672",
"0.60258687",
"0.60238415",
"0.6022229",
"0.5962134",
"0.5881125",
"0.584267",
"0.5810655",
"0.58047014",
"0.5753723",
"0.574169",
"0.57298493",
"0.5708213",
"0.57045346",
"0.5655529",
"0.56511366",
"0.56282914",
"0.5616169",
"0.5610649",
"0.5599124",
"0.5595961",
"0.5592834",
"0.558974",
"0.5578313",
"0.5566964",
"0.5549756",
"0.5547159",
"0.5544951",
"0.55380666",
"0.55353624",
"0.55279714",
"0.55235475",
"0.55107296",
"0.5510046",
"0.5490352",
"0.54693335",
"0.5459897",
"0.54518396",
"0.5448713",
"0.54382694",
"0.5426326",
"0.54244953",
"0.54200137",
"0.5403778",
"0.53971726",
"0.5388512",
"0.53878015",
"0.53655857",
"0.53651726",
"0.5351301",
"0.5344807",
"0.5337214",
"0.5336653",
"0.53333616",
"0.5325063",
"0.53229487",
"0.5318623",
"0.53050596",
"0.52781564",
"0.5277324",
"0.52701485",
"0.52471966",
"0.52439684",
"0.5242442",
"0.5240254",
"0.52397084",
"0.5237341",
"0.5235201",
"0.5232052",
"0.52319086",
"0.5230197",
"0.5215926",
"0.52030045",
"0.51971257",
"0.51946163",
"0.5193646",
"0.5191707",
"0.51907766",
"0.5183616",
"0.51741874",
"0.517372",
"0.5172096",
"0.5162147",
"0.515422",
"0.515422",
"0.5151771",
"0.51514995",
"0.51483715",
"0.51402164",
"0.51374924",
"0.5130463",
"0.5125061",
"0.5120518"
] | 0.82984823 | 0 |
Return the configured frequency expression for Order Sync. | public function getOrderSyncFrequency() {
return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getProductSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_FREQUENCY);\n }",
"public function getClockFrequency()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_CLOCK_FREQUENCY, $payload);\n\n $payload = unpack('V1frequency', $data);\n\n return IPConnection::fixUnpackedUInt32($payload, 'frequency');\n }",
"public function getChangeFrequency() {\n if ($this->getModule() != '') {\n return 'hourly';\n }\n return 'weekly';\n }",
"public function getChangeFrequency()\n {\n return $this->changeFrequency;\n }",
"public function getUpdateFrequency()\n {\n return Mage::getStoreConfig(self::XML_PATH_UPDATE_FREQUENCY);\n }",
"protected function frequency()\n {\n return 'monthly';\n }",
"public function getfrequency() {\n return['1' => 'Frequency 1', '2' => 'Frequency 2', '3' => 'Frequency 3', '4' => 'Frequency 4'];\n }",
"public function getCronFrequency(): string;",
"public static function __calcFreq()\n {\n foreach (self::$original_freq as $key => $value) {\n self::$FREQ[$key] = log($value / self::$total);\n }\n self::$min_freq = min(self::$FREQ);\n }",
"function getFrequency() { return $this->readStep(); }",
"protected function getPeriodicidad() {\n\t\treturn 'mensual';\n\t}",
"public function getFrequencyId()\n {\n return $this->frequency_id;\n }",
"public function getPeriodicity()\n {\n return $this->_periodicity;\n }",
"public function getAlertFrequency(){\n\t\treturn($this->alertFrequency);\n\t}",
"public function getFrequencia() {\n return $this->sFrequencia;\n }",
"public function getStoreToOrderRate();",
"function paymentFrequency($cycle)\n{\n if ($cycle == 'thirty') {\n $paymentTerm = 30;\n }\n else if ($cycle == 'sixty') {\n $paymentTerm = 60;\n }\n else if ($cycle == 'ninety') {\n $paymentTerm = 90;\n }\n else {\n $paymentTerm = 30; # Default if option is not chosen.\n }\n return $paymentTerm;\n}",
"public function getFrequency(): ?Frequency\n {\n if (is_array($this->{self::FREQUENCY}))\n $this->setFrequency(new Frequency($this->{self::FREQUENCY}));\n\n return $this->{self::FREQUENCY};\n }",
"public function getSubscriptionFrequencyLabel()\n {\n $count = $this->getSubscription()->getFrequencyCount();\n $unit = $this->getSubscription()->getFrequencyUnit();\n\n if ($count > 1) {\n $unitLabel = $this->periodModel->getOptionTextPlural($unit);\n } else {\n $unitLabel = $this->periodModel->getOptionText($unit);\n }\n\n return __('%1 %2', $count, $unitLabel);\n }",
"public function allowedFrequencies()\n\t{\n\t\treturn array( 'immediate', 'offline', 'daily', 'weekly' );\n\t}",
"public function setFrequency($value)\n {\n return $this->set(self::_FREQUENCY, $value);\n }",
"public function setFrequency($value)\n {\n return $this->set(self::_FREQUENCY, $value);\n }",
"function scorm_get_updatefreq_array(){\n return array(0 => get_string('never'),\n 1 => get_string('everyday','scorm'),\n 2 => get_string('everytime','scorm'));\n}",
"public static function getIdfFreq()\n {\n return SerializerFactory::getSerializer()->decode(\n file_get_contents(Helper::getDictBasePath(Dict::SERIALIZED) . 'idf.' . SerializerFactory::getExtension())\n );\n }",
"public function refreshFrequency($frq)\n {\n $this->frequency = $frq;\n return $this;\n }",
"public function getFrequency(ConnectionInterface $con = null)\n {\n if ($this->aFrequency === null && ($this->frequency_id !== null)) {\n $this->aFrequency = FrequencyQuery::create()->findPk($this->frequency_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aFrequency->addBiblios($this);\n */\n }\n\n return $this->aFrequency;\n }",
"public function getFrequencyAllowableValues()\n {\n return [\n self::FREQUENCY_WEEKLY,\n self::FREQUENCY_BIWEEKLY,\n self::FREQUENCY_EVERY,\n self::FREQUENCY_EVERY_10_DAYS,\n self::FREQUENCY_EVERY_24_DAYS,\n self::FREQUENCY_EVERY_28_DAYS,\n self::FREQUENCY_MONTHLY,\n self::FREQUENCY_EVERY_45_DAYS,\n self::FREQUENCY_EVERY_2_MONTHS,\n self::FREQUENCY_EVERY_3_MONTHS,\n self::FREQUENCY_EVERY_4_MONTHS,\n self::FREQUENCY_EVERY_6_MONTHS,\n self::FREQUENCY_YEARLY,\n self::FREQUENCY_EVERY_4_WEEKS,\n self::FREQUENCY_EVERY_6_WEEKS,\n self::FREQUENCY_EVERY_8_WEEKS,\n ];\n }",
"private static function ordersFrequencyQuery( $companyId ): string\n {\n return 'select count(*) as charge_count, chargers.location, chargers.code from chargers '\n .'left join charger_connector_types on charger_connector_types.charger_id = chargers.id '\n .'left join orders on orders.charger_connector_type_id = charger_connector_types.id '\n .'where chargers.company_id = ' . $companyId . ' '\n .'group by chargers.code, chargers.location order by charge_count desc limit 10';\n }",
"public static function iaf()\n {\n return self::createAudioFrequency(self::IAF);\n }",
"public function frequency( $pageType, $object = false, $objectType = null ) {\n\t\t$frequency = ! empty( $object->frequency ) && 'default' !== $object->frequency ? $object->frequency : parent::frequency( $pageType, $object, $objectType );\n\t\treturn $frequency;\n\t}",
"public static function frequency($_secs) {\n\t\t$_freq['hourly']=3600;\n\t\t$_freq['daily']=86400;\n\t\t$_freq['weekly']=604800;\n\t\t$_freq['monthly']=2592000;\n\t\tforeach ($_freq as $_key=>$_val)\n\t\t\tif ($_secs<=$_val)\n\t\t\t\treturn $_key;\n\t\treturn 'yearly';\n\t}",
"public function setChangeFrequency($changeFrequency)\n {\n $this->changeFrequency = (string) $changeFrequency;\n\n return $this;\n }",
"protected static function createAudioFrequency($qualifier)\n {\n return new self($qualifier);\n }",
"public function tFrequencies()\n {\n return json_encode($this->frequencies);\n }",
"public function setFrequency($frequency)\n {\n $this->frequency = $frequency;\n }",
"public static function getFrequencyOptions()\n {\n $translatedOptions = array();\n foreach (self::$frequencyOptions as $key => $value) {\n $translatedOptions[$key] = Craft::t($value);\n }\n\n return $translatedOptions;\n }",
"public function setClockFrequency($frequency)\n {\n $payload = '';\n $payload .= pack('V', $frequency);\n\n $this->sendRequest(self::FUNCTION_SET_CLOCK_FREQUENCY, $payload);\n }",
"public function getRotateFrequency( $value, $defaultValue = 0 )\n {\n // die('value '.$value);\n $items = array(\n '0' => array( 'value' => 0, 'text' => 'never' ),\n );\n foreach (range(1, 24) as $i) {\n $items[$i] = array( 'value' => $i, 'text' => \"every $i \".($i == 1 ? 'hour' : 'hours') );\n }\n\n $inputSettings = array(\n 'value' => $value,\n 'defaultValue' => $defaultValue,\n 'name' => 'rotateFrequency',\n 'items' => $items,\n );\n\n $labelSettings = array(\n 'text' => 'Rotate Frequency',\n );\n\n $options = array(\n 'attributes' => array(\n 'class' => 'form-item'\n )\n );\n\n return $this->getSelect( $inputSettings, $labelSettings, $options );\n }",
"public function getPublicationFrequency()\n {\n return $this->getFieldArray('310', ['a', 'b']);\n }",
"function getTextFrequency(){\n\t\t$freq = array(); \t\t// inisialisasi frequensi\n\t\t$this->firstBit = \"\";\t// inisialisasi bit awal\n\n\t\tfor ($i = 0; $i < strlen($this->textInside); $i++) { //melakukan perulangan untuk setiap char dalam text\n\t \n\t $letter = $this->textInside[$i]; //mengambil char ke-i dalam text\n\t $this->firstBit .= sprintf(\"%08d\",decbin(ord($letter)));\t\t//menambahkan binary char ke-i dan disimpan ke firstbit\n\t \n\t if (array_key_exists($letter, $freq)) { //mengecek apakah char ke-i sudah ada dalam array frekuensi atau tidak\n\t $freq[$letter]++;\t\t//menambahkan jumlah char \n\t } else {\n\t $freq[$letter] = 1;\t\t//menginisialisasi jumlah char\n\t }\n\t }\n\n\t return $freq;\t\t//mengembalikan nilai frekuensi dalam array\n\t}",
"public function __construct($frequency)\n {\n $this->frequency = $frequency;\n }",
"public function getFrequencyReadable($frequency) {\n\t\t\n\t\tif(empty($frequency)){\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$frequencyString = '';\n\t\t\n\t\t$frequencyList = DBUtil::strToArray($frequency);\n\t\t\n\t\tif(isset($frequencyList[0]) && $frequencyList[0] == '1') {\n\t\t\t$frequencyString.= 'Su ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[1]) && $frequencyList[1] == '1') {\n\t\t\t$frequencyString.= 'M ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[2]) && $frequencyList[2] == '1') {\n\t\t\t$frequencyString.= 'Tu ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[3]) && $frequencyList[3] == '1') {\n\t\t\t$frequencyString.= 'W ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[4]) && $frequencyList[4] == '1') {\n\t\t\t$frequencyString.= 'Th ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[5]) && $frequencyList[5] == '1') {\n\t\t\t$frequencyString.= 'F ';\n\t\t}\n\t\t\n\t\tif(isset($frequencyList[6]) && $frequencyList[6] == '1') {\n\t\t\t$frequencyString.= 'Sa ';\n\t\t}\n\t\t\n\t\t// Trim and add commas\n\t\t$frequencyString = str_replace(' ', ',', trim($frequencyString));\n\t\t\n\t\tif($frequencyString == ''){\n\t\t\t$frequencyString = 'No Days';\n\t\t}\n\t\t\n\t\treturn $frequencyString;\n\t}",
"public function setFrequency(Frequency $frequency): BillingCycle\n {\n $this->offsetSet(self::FREQUENCY, $frequency);\n return $this;\n }",
"public static function frequency()\n {\n $args = func_get_args();\n $argc = count($args);\n if ($argc < 2 || $argc % 2 != 0) {\n throw new \\InvalidArgumentException();\n }\n $total = array_sum(FP::realize(FP::takeNth(2, $args)));\n $pairs = FP::realize(FP::partition(2, $args));\n return self::choose(1, $total)->bindGen(\n function (RoseTree $rose) use ($pairs) {\n $n = $rose->getRoot();\n foreach ($pairs as $pair) {\n list($chance, $gen) = $pair;\n if ($n <= $chance) {\n return $gen;\n }\n $n = $n - $chance;\n }\n }\n );\n }",
"public function getOrder()\n {\n return 140;\n }",
"public function getOrder()\n {\n return 120;\n }",
"public function getOrder()\n {\n return 120;\n }",
"public function get_recorded_coupon_usage_counts( $order ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\treturn wc_string_to_bool( get_post_meta( $order_id, '_recorded_coupon_usage_counts', true ) );\n\t}",
"public function getOrder()\n {\n return 70;\n }",
"public function noFreqs(): self\n {\n $this->arguments[] = 'NOFREQS';\n\n return $this;\n }",
"public function getNotificationPeriod() {\n\t\treturn $this->notificationPeriod;\n\t}",
"public function getOrder()\n {\n return 6;\n }",
"public function getOrder()\n {\n return 6;\n }",
"public function getOrderCount()\n {\n return $this->count(self::order);\n }",
"public function getOrder()\n {\n return 110;\n }",
"public function getFrequency(): int\n {\n $total = 0;\n foreach ($this->inputArray as $inputValue) {\n $total += (int)$inputValue;\n }\n return $total;\n }",
"public function setFreq($freq)\n {\n if (self::FREQ_YEARLY === $freq || self::FREQ_MONTHLY === $freq\n || self::FREQ_WEEKLY === $freq\n || self::FREQ_DAILY === $freq\n ) {\n $this->freq = $freq;\n } else {\n throw new \\InvalidArgumentException(\"The Frequency {$freq} is not supported.\");\n }\n\n return $this;\n }",
"public function getFreqParenting()\n {\n return $this->freq_parenting;\n }",
"public function getDeliveryFrequency(): ?NotificationDeliveryFrequency {\n $val = $this->getBackingStore()->get('deliveryFrequency');\n if (is_null($val) || $val instanceof NotificationDeliveryFrequency) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deliveryFrequency'\");\n }",
"public function getOrder()\n {\n return 130;\n }",
"public function getOrder()\n {\n if (array_key_exists(\"order\", $this->_propDict)) {\n return $this->_propDict[\"order\"];\n } else {\n return null;\n }\n }",
"public function getOrder()\n {\n if (array_key_exists(\"order\", $this->_propDict)) {\n return $this->_propDict[\"order\"];\n } else {\n return null;\n }\n }",
"public function getEnableRecurring()\n {\n return 0;\n }",
"public function getFullCost()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->price * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }",
"public function getOrder()\n {\n return 40;\n }",
"public function getControleFrequencia() {\n return $this->sControleFrequencia;\n }",
"public function getExchangeRate();",
"protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }",
"public function getOrder()\n {\n return static::ORDER;\n }",
"public function getOrder()\n {\n return static::ORDER;\n }",
"public function getOrder()\n {\n return static::ORDER;\n }",
"public function getOrder()\n {\n return $this->config->getOrder();\n }",
"public function uExpires(string $frequency)\n {\n $fr = explode(\" \", $frequency);\n $fields = []; //列举多维度的有效时间数组\n for ($i = 0; $i < count($fr); $i++) {\n if ($fr[$i] == '*') {\n $fields[$i] = range(0, $this->ary[$i] - 1);\n } elseif (preg_match(\"/\\*\\/(\\d*)/\", $fr[$i], $matches)) {\n $fields[$i] = ['f' => $matches[1]];\n } elseif (preg_match(\"/(\\d*)-(\\d*)/\", $fr[$i], $matches)) {\n $fields[$i] = range($matches[1], $matches[2]);\n } else {\n $fields[$i] = explode(\",\", $fr[$i]);\n }\n }\n //print_r($fields);\n /* 查找一个最近的有效时间 */\n $incr = 0;\n $year = date(\"Y\");\n $tk = [0,0,0,0,0,0];//时间指针数组,代表查找到的每一个纬度最近时间\n for ($i = 0; $i < count($fr); $i++) {\n $d = date($this->fc[$i]);\n if (!isset($fields[$i]['f'])) {\n // 检查合适的时间位置\n for ($j = 0; $j < count($fields[$i]); $j++) {\n if (($d <= $fields[$i][$j] && $j == 0) || ($d <= $fields[$i][$j] && $d > $fields[$i][$j-1])) {\n if ($incr) {\n if ($fields[$i][$j] == $d) {\n $j++;\n }\n //有进位则把前面的指针都置为零\n foreach ($tk as $k => &$v) {\n if (isset($fields[$k]['f'])) {\n $fields[$k][0] = ($d + $fields[$k]['f']) % $this->ary[$k];\n } else {\n $v = 0;\n }\n }\n }\n break;\n }\n }\n //echo $i,' ',$incr,' '.$j.\" \";\n if (!isset($fields[$i][$j])) {\n $j = 0;\n if ($i == 4) {\n $year++;\n $incr = 0; //消除进位\n //有进位则把前面的指针都置为零\n foreach ($tk as $k => &$v) {\n if (isset($fields[$k]['f'])) {\n $fields[$k][0] = ($d + $fields[$k]['f']) % $this->ary[$k];\n } else {\n $v = 0;\n }\n }\n } else {\n $incr = 1; //产生进位\n }\n } else {\n $incr = 0; //消除进位\n }\n $tk[$i] = $j;\n } else {\n if ($incr) {\n $incr = 0;\n //有进位则把前面的指针都置为零\n foreach ($tk as $k => &$v) {\n if (isset($fields[$k]['f'])) {\n $fields[$k][0] = ($d + $fields[$k]['f']) % $this->ary[$k];\n } else {\n $v = 0;\n }\n }\n $fields[$i][0] = $d + $fields[$i]['f'] + 1;\n } else {\n $fields[$i][0] = $d + $fields[$i]['f'];\n }\n \n if ($fields[$i][0] >= $this->ary[$i]) {\n $incr = 1;\n }\n $fields[$i][0] %= $this->ary[$i];\n }\n }\n //按照指针数组合成最近执行时间\n $datetime = $year.\"-\".$fields[4][$tk[4]].\"-\".$fields[3][$tk[3]].\" \".$fields[2][$tk[2]].\":\".$fields[1][$tk[1]].\":\".$fields[0][$tk[0]];\n \n $this->printLog(__FUNCTION__.\" \".date(\"Y-m-d H:i:s\").\" \".$frequency.\" => \".$datetime);\n return (int)((strtotime($datetime) - (time() - $this->uJiffies))); //定时器到期时间\n }",
"public function getRatePeriod()\n {\n return $this->ratePeriod;\n }",
"public function get_interface_wireless_rx_frequency($interface_obj)\r\n\t{\r\n\t}",
"public function cChrono(){\n\t\treturn round(getMicrotime()-PLX_MICROTIME,3).'s';\n\t}",
"public function getOrder()\n {\n return 30;\n }",
"public function getAccelerationPeriod()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_ACCELERATION_PERIOD, $payload);\n\n $payload = unpack('V1period', $data);\n\n return IPConnection::fixUnpackedUInt32($payload['period']);\n }",
"function testFrequencyList321(){\r\n\r\n\t$c = new GenerateWordCloud();\r\n\t$words = array();\r\n\tarray_push($words, 'most');\r\n\tarray_push($words, 'most');\t\r\n\tarray_push($words, 'most');\r\n\tarray_push($words, 'average');\r\n\tarray_push($words, 'average');\r\n\tarray_push($words, 'least');\r\n\t\r\n\t$frequency_list = $c->wordFreq($words);\r\n\t$this->assertEquals(3, $frequency_list['most']);\r\n\t$this->assertEquals(2, $frequency_list['average']);\r\n\t$this->assertEquals(1, $frequency_list['least']);\r\n\t$this->assertEquals(3, count($frequency_list));\r\n\t}",
"public function getOrder()\n {\n return 15;\n }",
"public function getFrequencyDetail($frequencyDetail) {\n\t\t$frequency = '';\n\t\n\t\tif(isset($frequencyDetail['sunday']) && $frequencyDetail['sunday'] == '1') {\n\t\t\t$frequency .= '1';\n\t\t} else {\n\t\t\t$frequency .= '0';\n\t\t}\n\t\n\t\tif(isset($frequencyDetail['monday']) && $frequencyDetail['monday'] == '1') {\n\t\t\t$frequency .= '1';\n\t\t} else {\n\t\t\t$frequency .= '0';\n\t\t}\n\t\t\n\t\tif(isset($frequencyDetail['tuesday']) && $frequencyDetail['tuesday'] == '1') {\n\t\t\t$frequency .= '1';\n\t\t} else {\n\t\t\t$frequency .= '0';\n\t\t}\n\t\n\t\tif(isset($frequencyDetail['wenesday']) && $frequencyDetail['wenesday'] == '1') {\n\t\t\t$frequency .= '1';\n\t\t} else {\n\t\t\t$frequency .= '0';\n\t\t}\n\t\n\t\tif(isset($frequencyDetail['thursday']) && $frequencyDetail['thursday'] == '1') {\n\t\t\t$frequency .= '1';\n\t\t} else {\n\t\t\t$frequency .= '0';\n\t\t}\n\t\n\t\tif(isset($frequencyDetail['friday']) && $frequencyDetail['friday'] == '1') {\n\t\t\t$frequency .= '1';\n\t\t} else {\n\t\t\t$frequency .= '0';\n\t\t}\n\t\n\t\tif(isset($frequencyDetail['saturday']) && $frequencyDetail['saturday'] == '1') {\n\t\t\t$frequency .= '1';\n\t\t} else {\n\t\t\t$frequency .= '0';\n\t\t}\n\t\n\t\t$frequencyDetail['frequency'] = $frequency;\n\t\n\t\treturn $frequencyDetail;\n\t}",
"public function getQuarter(): string\n {\n return $this->toLocalizedString('Q');\n }",
"public function getFilingFrequencyAllowableValues()\n {\n return [\n self::FILING_FREQUENCY_MONTHLY,\n self::FILING_FREQUENCY_QUARTERLY,\n self::FILING_FREQUENCY_SEMI_ANNUALLY,\n self::FILING_FREQUENCY_ANNUALLY,\n self::FILING_FREQUENCY_BIMONTHLY,\n self::FILING_FREQUENCY_OCCASIONAL,\n self::FILING_FREQUENCY_INVERSE_QUARTERLY,\n self::FILING_FREQUENCY_WEEKLY,\n ];\n }",
"public function getOrder()\n {\n return $this->coreRegistry->registry('current_order');\n }",
"public function set_recorded_coupon_usage_counts( $order, $set ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\tupdate_post_meta( $order_id, '_recorded_coupon_usage_counts', wc_bool_to_string( $set ) );\n\t}",
"public function getFrireqCount()\n {\n return $this->count(self::FRIREQ);\n }",
"public function calibrateDevice(): int\n {\n $total = 0;\n $this->allFrequency = [];\n $foundDuplicateFrequency = false;\n\n $runNumber = 0;\n\n while ($foundDuplicateFrequency === false) {\n\n echo \"\\r\\n-------- RUN \" . ++$runNumber . \"-------------\\r\\n\";\n\n foreach ($this->inputArray as $inputValue) {\n $total += (int)$inputValue;\n $foundDuplicateFrequency = in_array($total, $this->allFrequency, true);\n $this->allFrequency[] = $total;\n if ($foundDuplicateFrequency) {\n echo \" \\r\\nFound duplicate \\r\\n\";\n break;\n }\n }\n }\n\n return $this->allFrequency[count($this->allFrequency) - 1];\n }",
"public function getOrder()\n {\n return 10;\n }",
"public function getOrder()\n {\n return 10;\n }",
"public function getOrder()\n {\n return 10;\n }",
"public function getOrder()\n {\n return 10;\n }",
"public function getOrder()\n {\n return 10;\n }",
"public function getOrderTrackingCount()\n {\n return $this->count(self::order_tracking);\n }",
"public function getEnableRecurring()\n\t{\n\t\treturn 0;\n\t}",
"public function getOrder()\n {\n return 100;\n }",
"public function getOrder()\n {\n return 100;\n }",
"public function get_recurring_period_type(){\n\t\treturn $this->payment['recurring_period_type'];\n\t}",
"public function getOrder()\n\t{\n\t\treturn 10;\n\t}"
] | [
"0.68094397",
"0.68094397",
"0.6721141",
"0.6530065",
"0.62518746",
"0.6245237",
"0.61661255",
"0.6114785",
"0.608413",
"0.5987414",
"0.57449675",
"0.57098186",
"0.5666298",
"0.55795556",
"0.55288947",
"0.54507154",
"0.53974515",
"0.53645444",
"0.5347514",
"0.522793",
"0.52014536",
"0.51041085",
"0.50218046",
"0.50218046",
"0.4978823",
"0.4956907",
"0.49294302",
"0.48839864",
"0.4883666",
"0.48826683",
"0.48816755",
"0.48509166",
"0.48402777",
"0.47749913",
"0.4773107",
"0.473642",
"0.4736322",
"0.4723984",
"0.47209865",
"0.47067368",
"0.47060022",
"0.46983612",
"0.46946442",
"0.46756354",
"0.46335536",
"0.4630559",
"0.4616718",
"0.4610963",
"0.4610963",
"0.4584618",
"0.4584521",
"0.4543633",
"0.45422706",
"0.4506289",
"0.4506289",
"0.44982025",
"0.44845825",
"0.4481832",
"0.44767216",
"0.44695145",
"0.44686538",
"0.44664487",
"0.44533333",
"0.44533333",
"0.4453026",
"0.44379285",
"0.44355237",
"0.44347122",
"0.44314617",
"0.4423327",
"0.44135976",
"0.44135976",
"0.44135976",
"0.441164",
"0.4383184",
"0.43786108",
"0.4376494",
"0.4374643",
"0.4371928",
"0.4369649",
"0.4368283",
"0.43589884",
"0.43553928",
"0.4353205",
"0.43465066",
"0.43371946",
"0.43309012",
"0.43267816",
"0.4323614",
"0.43220714",
"0.43220714",
"0.43220714",
"0.43220714",
"0.43220714",
"0.43186855",
"0.43117282",
"0.43087628",
"0.43087628",
"0.43056062",
"0.43014967"
] | 0.7555554 | 0 |
Set the last Order Sync run time in System Configuration. | public function setLastOrderSyncRun($datetime = "now") {
if (!$datetime instanceof DateTime) {
$datetime = new DateTime($datetime);
}
$this->setGlobalConfig(static::XML_PATH_ORDER_SYNC_LAST_RUN, $datetime->format(static::DATETIME_FORMAT));
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"public function setSyncTime(): void\n {\n }",
"public function setLastSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSyncDateTime', $value);\n }",
"public function setSysLastChanged() {}",
"public function setLastSyncDateTime($val)\n {\n $this->_propDict[\"lastSyncDateTime\"] = $val;\n return $this;\n }",
"public function setLastUpdate()\n {\n Mage::app()->saveCache(time(), 'admin_notifications_lastcheck');\n// $config = Mage::getModel('core/config');\n// /* @var $config Mage_Core_Model_Config */\n// $config->saveConfig(self::XML_LAST_UPDATE_PATH, time());\n return $this;\n }",
"public function applyDefaultValues()\n {\n $this->last_sync = '1901-01-01 00:00:00';\n }",
"public function setExecUpdateOnSave()\n {\n Configuration::updateValue('DF_UPDATE_ON_SAVE_LAST_EXEC', date('Y-m-d H:i:s'));\n }",
"abstract public function getLastSyncTimestamp();",
"private function setLastUpdateDate( $date ) {\n Mage::getModel('core/config')->saveConfig('taxjar/config/last_update', $date);\n }",
"public function getLastSyncDateTime()\n {\n if (array_key_exists(\"lastSyncDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"lastSyncDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"lastSyncDateTime\"])) {\n return $this->_propDict[\"lastSyncDateTime\"];\n } else {\n $this->_propDict[\"lastSyncDateTime\"] = new \\DateTime($this->_propDict[\"lastSyncDateTime\"]);\n return $this->_propDict[\"lastSyncDateTime\"];\n }\n }\n return null;\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = JadwalPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setLastLogin() {\n $this->lastLogin = new DateTime();\n }",
"private function _set_sync($server_time) {\n\t\t$server_time = hexdec(bin2hex($server_time));\n\t\t$current_time = (int) (microtime(true) * 1000);\n\t\t$this->set_sync($server_time - $current_time);\n\t}",
"public function setLastProductSyncRun($datetime = \"now\", $store = null) {\n if (!$datetime instanceof DateTime) {\n $datetime = new DateTime($datetime);\n }\n\n $this->setStoreConfig(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, $datetime->format(static::DATETIME_FORMAT), $store);\n\n return $this;\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = BangunanPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"private function _settings()\n\t{\n\t\tif(Utils::config('timestamps') or Utils::config('t'))\n\t\t\t$this->_timestamps = \"\\tpublic static \\$timestamps = true;\\n\\n\";\n\t}",
"protected function _syncModDate() {}",
"public function getLastManualRefreshTime()\n {\n return $this->get(self::_LAST_MANUAL_REFRESH_TIME);\n }",
"public function getOrderSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = SanitasiPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = SekolahPaudPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setLastCommentTimeAsCurrent()\n {\n return $this->setLastCommentTime(date('Y-m-d H:i:s'));\n }",
"function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}",
"function setWorkTime( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->WorkTime = $value;\n }",
"public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}",
"public function syncsTime()\n {\n return $this->_timeSync;\n }",
"public function setLastManualRefreshTime($value)\n {\n return $this->set(self::_LAST_MANUAL_REFRESH_TIME, $value);\n }",
"public function setLastStatusUpdate($value) {\n\t\t$value = date('d-M-Y', strtotime($value));\n\t\tself::$_lastStatusUpdate = $value;\n\t}",
"public function setLastsend($lastsend);",
"public function updateSyncStamp()\n {\n throw new Horde_ActiveSync_Exception('Not supported in this state driver.');\n }",
"public function onPreUpdate()\n {\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }",
"public function getNextSyncTimestamp() {\n\t\treturn strtotime($this->getNextSync());\n\t}",
"public function getLastResetTime()\n {\n return $this->get(self::_LAST_RESET_TIME);\n }",
"public function onSync($aseco){\r\n\t\t// Read Configuration\r\n\t\tif (!$xml = $aseco->parser->xmlToArray('config/checkpoint_time_differences.xml', true, true)) {\r\n\t\t\ttrigger_error('[CpDiff] Could not read/parse config file \"config/checkpoint_time_differences.xml\"!', E_USER_ERROR);\r\n\t\t}\r\n\t\t$this->settings = $xml['SETTINGS'];\r\n\t\tunset($xml);\r\n\t\t\r\n\t}",
"public function set_sync($sync) {\n\t\t$this->sync = $sync;\n\t}",
"function onBeforeInit() {\n\n\t\t$orderID = Session::get('Cart.OrderID');\n\t\tif ($orderID && $order = DataObject::get_by_id('Order', $orderID)) {\n\t\t\t$order->LastActive = SS_Datetime::now()->getValue();\n\t\t\t$order->write();\n\t\t}\n\t}",
"public function getLastResetWorldChatTime()\n {\n return $this->get(self::_LAST_RESET_WORLD_CHAT_TIME);\n }",
"public function getLastAutoRefreshTime()\n {\n return $this->get(self::_LAST_AUTO_REFRESH_TIME);\n }",
"public function setLastUpdatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastUpdatedDateTime', $value);\n }",
"protected function updateLastTrace() {\n $this->last_trace = time();\n }",
"public function getMCMinSyncDateFlag()\r\n {\r\n return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::GENERAL_MCMINSYNCDATEFLAG);\r\n }",
"public function setLastRefreshedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastRefreshedDateTime', $value);\n }",
"private function _setTimeZone()\n {\n /** @var WebApplication|ConsoleApplication $this */\n $timezone = $this->getConfig()->getGeneral()->timezone;\n\n if (!$timezone) {\n $timezone = $this->getProjectConfig()->get('system.timeZone');\n }\n\n if ($timezone) {\n $this->setTimeZone($timezone);\n }\n }",
"public function setLastSystemChange($lastSystemChange) {\n $this->lastSystemChange = $lastSystemChange;\n return $this;\n }",
"private function set_last_updated_at() {\n\n\t\tif ( ! static::get_table() instanceof TimestampedTable ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$dirty = $this->is_dirty();\n\n\t\t$this->set_attribute( static::get_table()->get_updated_at_column(), $this->fresh_timestamp() );\n\n\t\t// If the model is dirty, we don't want to commit our save since the user should already be calling save.\n\t\tif ( ! $dirty ) {\n\t\t\t$this->save();\n\t\t}\n\t}",
"function set_date_to_now()\n {\n $this->timestamp=time();\n }",
"protected function getDeployTime(){\n\t\tif(!$this->deployTime){\n\t\t\t$targetFile = \\Of\\Constants::GENERATION_TIME;\n\t\t\t$deployTime = include($targetFile);\n\t\t\t\n\t\t\t$this->deployTime = 'deploy'.$deployTime;\n\t\t}\n\t\t\n\t\treturn $this->deployTime;\n\t}",
"public function getLastSystemChange() {\n return $this->lastSystemChange;\n }",
"public function setServerTime();",
"function setSyncProdDesc()\n {\n }",
"function setSyncIdDev()\n {\n }",
"public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }",
"public function updateLastPing()\n {\n $this->last_ping = Carbon::now();\n $this->save();\n }",
"public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }",
"public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }",
"public function setLastAutoRefreshTime($value)\n {\n return $this->set(self::_LAST_AUTO_REFRESH_TIME, $value);\n }",
"protected function getLeadTime(): int\n\t{\n\t\treturn ! is_null($this->option('lead-time')) ? $this->option('lead-time') : config('tulerie.shipment_lead_time');\n\t}",
"protected function getConfigName()\n {\n return 'realtime';\n }",
"public function UpdateLastLogin() {\r\n\t\t\t$_SESSION[__CLASS__.$this->intId.'_LastLogin'] = $this->dttLastLogin;\r\n\t\t\t$this->dttLastLogin = new QDateTime(QDateTime::Now);\r\n\t\t}",
"public function getLastUpdateDatetime()\n {\n return $this->getValue('nb_icontact_prospect_last_update_datetime');\n }",
"private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}",
"function wp_cache_set_sites_last_changed()\n {\n }",
"private function _update_last_sync_data($data_type, $sync_type, $last_sync_datetime){\n //Update last sync type and datetime for ITEMS\n if($data_type == Minematic_Connector_Model_Config::DATA_TYPE_ITEMS){\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::ITEMS_LAST_SYNC_TYPE, $sync_type);\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::ITEMS_LAST_SYNC_DATETIME, $last_sync_datetime);\n }\n\n //Update last sync type and datetime for USERS\n if($data_type == Minematic_Connector_Model_Config::DATA_TYPE_USERS){\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::USERS_LAST_SYNC_TYPE, $sync_type);\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::USERS_LAST_SYNC_DATETIME, $last_sync_datetime);\n }\n\n //Update last sync type and datetime for EVENTS\n if($data_type == Minematic_Connector_Model_Config::DATA_TYPE_EVENTS){\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::EVENTS_LAST_SYNC_TYPE, $sync_type);\n $this->_update_connector_config_value(Minematic_Connector_Model_Config::EVENTS_LAST_SYNC_DATETIME, $last_sync_datetime);\n }\n }",
"public function set_last_fetch( $timestamp ) {\n\t\t$this->ryte_option[ self::LAST_FETCH ] = $timestamp;\n\t}",
"public function onPreUpdate()\n {\n $this->fechaUltimaModificacion = new \\DateTime(\"now\");\n }",
"public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }",
"public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }",
"public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }",
"function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}",
"function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}",
"public function setLastUpdate($lastUpdate)\n {\n $this->lastUpdate = $lastUpdate;\n }",
"public function setLastUpdate(\\DateTime $lastUpdate)\n {\n $this->lastUpdate = $lastUpdate;\n }",
"public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }",
"public function setLastUpdated($lastUpdated);",
"public function testSetTime() {\n $time = new \\DateTime();\n $this->order->setTime($time);\n $this->assertEquals($time, $this->order->getTime());\n }",
"public static function setSendTime ($str) {\n self::$dateTime = $str;\n }",
"private function setLastSync($from, $startType)\n {\n /** @var PairStorage $pairStorage */\n $pairStorage = $this->getServiceContainer()->get('ongr_connections.pair_storage');\n\n if ($startType == BinlogParser::START_TYPE_DATE) {\n // Sometimes, mysql, php and server timezone could differ, we need convert time seen by php\n // to the same time in the same timezone as is used in mysqlbinlog.\n // This issue is for tests only, should not affect live website.\n\n $result = $this->managerMysql->getConnection()->executeQuery('SELECT @@global.time_zone');\n $time_zone = $result->fetchAll()[0]['@@global.time_zone'];\n\n // If mysql timezone is the same as systems, string 'SYSTEM' is returned, which is not what we want.\n if ($time_zone == 'SYSTEM') {\n $result = $this->managerMysql->getConnection()->executeQuery('SELECT @@system_time_zone');\n $time_zone = $result->fetchAll()[0]['@@system_time_zone'];\n }\n\n $from->setTimezone(new \\DateTimeZone($time_zone));\n\n $pairStorage->set(BinlogDiffProvider::LAST_SYNC_DATE_PARAM, $from->format('Y-m-d H:i:s'));\n } elseif ($startType == BinlogParser::START_TYPE_POSITION) {\n $pairStorage->set(BinlogDiffProvider::LAST_SYNC_POSITION_PARAM, $from);\n }\n }",
"public function markLastUpdate()\n {\n if (!$this->updatedAtOveridden) {\n $this->updatedAt = new \\DateTime();\n }\n }",
"public function updateLastUsed()\n {\n if (\n $this->last_used_at === null ||\n $this->last_used_at < (new \\DateTime())->sub(new \\DateInterval('P1D'))\n ) {\n $this->last_used_at = new \\DateTime();\n $this->save();\n }\n }",
"function set_timemodified() {\n $this->timemodified = time();\n return true;\n }",
"public function setLastResetWorldChatTime($value)\n {\n return $this->set(self::_LAST_RESET_WORLD_CHAT_TIME, $value);\n }",
"public function setLastSeenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSeenDateTime', $value);\n }",
"public function setLastSeenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSeenDateTime', $value);\n }",
"public function getLastUpdateTime()\n {\n return $this->last_update_time;\n }",
"public function get_last_run() {\n\t\n\t\tif(empty($this->lastRun) && $this->is_wordpress_loaded()) {\n\t\t\t$this->lastRun = get_option('wpu-last-run');\n\t\t}\n\n\t\t return $this->lastRun;\n\t}",
"public function getLastDeploymentChangeTime()\n {\n return $this->last_deployment_change_time;\n }",
"public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }",
"public function getLastUpdate()\n {\n return Mage::app()->loadCache('admin_notifications_lastcheck');\n// return Mage::getStoreConfig(self::XML_LAST_UPDATE_PATH);\n }",
"public static function setup_sync_cronjob() {\n\t\tself::$timezone_string = get_option( 'timezone_string' );\n\t\tif ( ! wp_next_scheduled( self::SYNC_CRONJOB_NAME ) ) {\n\t\t\twp_schedule_event( Carbon::parse( '4am', self::$timezone_string )->getTimestamp(), 'daily', self::SYNC_CRONJOB_NAME );\n\t\t}\n\t}",
"public function setLastRefreshedDateTime($val)\n {\n $this->_propDict[\"lastRefreshedDateTime\"] = $val;\n return $this;\n }",
"public function beforeUpdate()\n {\n\t\t// Asignar fecha y hora de ultima actualizacion\n// $this->updatedon = time();\n }",
"public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}",
"protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }",
"function preUpdate(){\n $this->alteradoEm = new \\DateTime('now');\n $this->alteradoEm->setTimezone(new \\DateTimeZone('America/Sao_Paulo'));\n }",
"public function setLastResetTime($value)\n {\n return $this->set(self::_LAST_RESET_TIME, $value);\n }",
"public function onPreUpdate()\n {\n $this->modified_at = new \\DateTime(\"now\");\n }",
"public function beforeUpdate()\n {\n $this->update_at=time();\n }",
"public function getLastStatusUpdateTime()\n {\n return $this->lastStatusUpdateTime;\n }",
"function getLastVisitOn() {\n if($this->last_visit_on === false) {\n \t$last_visit = parent::getLastVisitOn();\n \t$this->last_visit_on = instance_of($last_visit, 'DateTimeValue') ? $last_visit : new DateTimeValue(filectime(ENVIRONMENT_PATH . '/config/config.php'));\n } // if\n return $this->last_visit_on;\n }"
] | [
"0.7032765",
"0.69917005",
"0.6173254",
"0.6064555",
"0.5968182",
"0.5798335",
"0.5797511",
"0.5789471",
"0.5743275",
"0.56709117",
"0.5652032",
"0.56423736",
"0.5641824",
"0.5636575",
"0.5615925",
"0.55867004",
"0.55734766",
"0.5553155",
"0.5553145",
"0.55401874",
"0.5535839",
"0.5532814",
"0.5528109",
"0.5477048",
"0.5470502",
"0.54114074",
"0.53929937",
"0.5391871",
"0.5389427",
"0.5370703",
"0.5352858",
"0.53484726",
"0.52942175",
"0.5240087",
"0.5239658",
"0.5226857",
"0.5225646",
"0.5216983",
"0.52112573",
"0.5209189",
"0.52038336",
"0.5182215",
"0.5181555",
"0.5169425",
"0.51676136",
"0.51620716",
"0.51451194",
"0.51442236",
"0.51388156",
"0.51153195",
"0.5112694",
"0.5106545",
"0.5101638",
"0.50958276",
"0.50901514",
"0.50901514",
"0.50802517",
"0.5079469",
"0.50745606",
"0.5070565",
"0.507036",
"0.5064427",
"0.5063018",
"0.5062346",
"0.50569975",
"0.5055929",
"0.50513256",
"0.504899",
"0.504899",
"0.50437385",
"0.50437385",
"0.5040176",
"0.5032002",
"0.503156",
"0.50201654",
"0.50123274",
"0.49949935",
"0.49949023",
"0.49922395",
"0.49895072",
"0.49730712",
"0.49670595",
"0.49631768",
"0.49631768",
"0.49627194",
"0.4956403",
"0.49539956",
"0.4953818",
"0.49525297",
"0.4947121",
"0.49417174",
"0.4940898",
"0.49345666",
"0.4933204",
"0.49224657",
"0.49121812",
"0.49121514",
"0.49092296",
"0.49047413",
"0.49012566"
] | 0.6348002 | 2 |
Check if default Magento log settings should be overridden to force logging for this module. | public function isLoggingForced() {
return Mage::getStoreConfigFlag(static::XML_PATH_FORCE_LOG);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function uses_standard_settings() : bool {\n $classname = self::get_logger_classname();\n if (!class_exists($classname)) {\n return false;\n }\n\n if (is_a($classname, database_logger::class, true)) {\n return true;\n }\n\n return false;\n }",
"public function isLogEnable() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE);\n }",
"protected static function should_log() : bool {\n global $CFG;\n\n // Respect the config setting.\n if (isset($CFG->task_logmode) && empty($CFG->task_logmode)) {\n return false;\n }\n\n $loggerclass = self::get_logger_classname();\n if (empty($loggerclass)) {\n return false;\n }\n\n return $loggerclass::is_configured();\n }",
"public function shouldLogEvent()\n {\n return config('ldap.logging', false);\n }",
"protected function isLogging()\n {\n return ! $this->option('no-log');\n }",
"public function logging_enabled() {\n\n\t\t$this->logging_enabled = ( 'yes' === get_option( 'wc_avatax_debug' ) );\n\n\t\t/**\n\t\t * Filter whether debug logging is enabled.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param bool $logging_enabled Whether debug logging is enabled.\n\t\t */\n\t\treturn apply_filters( 'wc_avatax_logging_enabled', $this->logging_enabled );\n\t}",
"public function setLog($value = false) {\n $this->config[\"log\"] = $value;\n return true;\n }",
"private function set_log_type () {\n\t\t# check settings\n\t\t$this->log_type = $this->settings->log;\n\t}",
"public function isLoggingEnabled()\n {\n return (bool) $this->getSetting( 'LoggingEnabled' );\n }",
"public function isLoggingEnabled()\n {\n return $this->getConfigValue(self::XML_PATH . 'logging/enable') ? true : false;\n }",
"public function isLogEnabled(){\n\n\t\treturn $this->_log_enabled;\n\t}",
"public function enableLogging() {\n $this->debug = true;\n }",
"protected function getDefaultLogFileName() {}",
"protected function configure() : self\n\t{\n\t\tif (isset($this->config['log_threshold'])) {\n\t\t\t$log_threshold = $this->config['log_threshold'];\n\n\t\t\t/* if they sent in a string split it into a array */\n\t\t\tif (is_string($log_threshold)) {\n\t\t\t\t$log_threshold = explode(',', $log_threshold);\n\t\t\t}\n\n\t\t\t/* is the array empty? */\n\t\t\tif (is_array($log_threshold)) {\n\t\t\t\tif (count($log_threshold) == 0) {\n\t\t\t\t\t$log_threshold = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Is all in the array (uppercase or lowercase?) */\n\t\t\tif (is_array($log_threshold)) {\n\t\t\t\tif (array_search('all', $log_threshold) !== false) {\n\t\t\t\t\t$log_threshold = 255;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* build the bitwise integer */\n\t\t\tif (is_array($log_threshold)) {\n\t\t\t\t$int = 0;\n\n\t\t\t\tforeach ($log_threshold as $t) {\n\t\t\t\t\t$t = strtoupper($t);\n\n\t\t\t\t\tif (isset($this->psr_levels[$t])) {\n\t\t\t\t\t\t$int += $this->psr_levels[$t];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$log_threshold = $int;\n\t\t\t}\n\n\t\t\t$this->_threshold = (int)$log_threshold;\n\n\t\t\t$this->_enabled = ($this->_threshold > 0);\n\t\t}\n\n\t\tisset(self::$func_overload) || self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));\n\n\t\tif (isset($this->config['log_file_extension'])) {\n\t\t\t$this->_file_ext = (!empty($this->config['log_file_extension'])) \t? ltrim($this->config['log_file_extension'], '.') : 'php';\n\t\t}\n\n\t\tif (isset($this->config['log_path'])) {\n\t\t\t$this->_log_path = ($this->config['log_path'] !== '') ? $this->config['log_path'] : APPPATH.'logs/';\n\n\t\t\tfile_exists($this->_log_path) || mkdir($this->_log_path, 0755, true);\n\n\t\t\tif (!is_dir($this->_log_path) || !is_really_writable($this->_log_path)) {\n\t\t\t\t/* can't write */\n\t\t\t\t$this->_enabled = false;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($this->config['log_date_format'])) {\n\t\t\t$this->_date_fmt = $this->config['log_date_format'];\n\t\t}\n\n\t\tif (!empty($this->config['log_file_permissions']) && is_int($this->config['log_file_permissions'])) {\n\t\t\t$this->_file_permissions = $this->config['log_file_permissions'];\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function disableLogging() {\n $this->debug = false;\n }",
"function initLogging() {\n\tif (DEVELOPMENT_ENVIRONMENT == true) {\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', 'On');\n\t} else {\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', 'Off');\n\t\tini_set('log_errors', 'On');\n\t\t/*ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . com_create_guid() . '.log');*/\n\t}\n}",
"function getLogMode()\n {\n return $this->_props['LogMode'];\n }",
"public function getEnableStackdriverLogging()\n {\n return $this->enable_stackdriver_logging;\n }",
"protected function AutoLog(){\r\n \r\n //DEPRECATED for test\r\n \r\n }",
"protected function setLoggers(): void\n {\n if (config('core-middleware.loggers')) {\n $this->ray = config('core-middleware.loggers.ray');\n $this->log = config('core-middleware.loggers.log');\n }\n }",
"function __construct() {\n $this->logging_enabled = false;\n }",
"public function setlog($d = true){\n\t\t$this->log = $d;\n\t}",
"private function setPagSeguroConfig()\n {\n $activeLog = $this->getConfigData('log');\n $charset = $this->getConfigData('charset');\n\n //Module version\n PagSeguroLibrary::setModuleVersion('magento' . ':' . Mage::helper('pagseguro')->getVersion());\n\n //CMS version\n PagSeguroLibrary::setCMSVersion('magento' . ':' . Mage::getVersion());\n\n //Setup Charset\n if ($charset != null and !empty($charset)) {\n PagSeguroConfig::setApplicationCharset($charset);\n }\n\n //Setup Log\n if ($activeLog == 1) {\n $logFile = $this->getConfigData('log_file');\n\n if (self::checkFile(Mage::getBaseDir() . '/' . $logFile)) {\n PagSeguroConfig::activeLog(Mage::getBaseDir() . '/' . $logFile);\n } else {\n PagSeguroConfig::activeLog(); //Default Log\n }\n }\n }",
"protected function _debug()\n {\n $file = self::DEFAULT_LOG_FILE;\n Mage::getModel('core/log_adapter', $file)->log($this->_debugData);\n }",
"public function fileLogActive() {\n\t\treturn isset($this->loggers['file']);\n\t}",
"public function testSelectiveLoggingByLevel() {\n\t\tif (file_exists(LOGS . 'spam.log')) {\n\t\t\tunlink(LOGS . 'spam.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'eggs.log')) {\n\t\t\tunlink(LOGS . 'eggs.log');\n\t\t}\n\t\tCakeLog::config('spam', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => 'debug',\n\t\t\t'file' => 'spam',\n\t\t));\n\t\tCakeLog::config('eggs', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => array('eggs', 'debug', 'error', 'warning'),\n\t\t\t'file' => 'eggs',\n\t\t));\n\n\t\t$testMessage = 'selective logging';\n\t\tCakeLog::write(LOG_WARNING, $testMessage);\n\n\t\t$this->assertTrue(file_exists(LOGS . 'eggs.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'spam.log'));\n\n\t\tCakeLog::write(LOG_DEBUG, $testMessage);\n\t\t$this->assertTrue(file_exists(LOGS . 'spam.log'));\n\n\t\t$contents = file_get_contents(LOGS . 'spam.log');\n\t\t$this->assertContains('Debug: ' . $testMessage, $contents);\n\t\t$contents = file_get_contents(LOGS . 'eggs.log');\n\t\t$this->assertContains('Debug: ' . $testMessage, $contents);\n\n\t\tif (file_exists(LOGS . 'spam.log')) {\n\t\t\tunlink(LOGS . 'spam.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'eggs.log')) {\n\t\t\tunlink(LOGS . 'eggs.log');\n\t\t}\n\t}",
"public function get_default_log_limit()\n {\n return $this->_log_limit;\n }",
"public static function hasMonologConfigurator(){\n return \\Illuminate\\Foundation\\Application::hasMonologConfigurator();\n }",
"public function enableRequestLog()\n {\n $this->loggingRequests = true;\n }",
"private function readLogConfig(){\n\n\t\t$_config = ConfigUtil::getInstance();\n\n\t\t$this->_log_enabled = $_config->isLogEnabled();\n\t\t$this->_log_level = $_config->getLogLevel();\n\t\t$this->_log_file_path = $_config->getLogFilePath();\n\t\n\t}",
"public function webLogActive() {\n\t\treturn isset($this->loggers['web']);\n\t}",
"function checkForDefaultSettings(){\n\n if(!isset($this->settings[\"reportTitle\"]))\n $this->settings[\"reportTitle\"] = \"Packing List\";\n\n parent::checkForDefaultSettings();\n\n }",
"public function getLogMode() {\n return $this->logMode;\n }",
"protected function getMinimumLogLevel() {}",
"protected function logLevel()\n {\n if ($this->app->bound('config')) {\n return $this->app->make('config')->get('app.log_level', 'debug');\n }\n\n return 'debug';\n }",
"function getRawLogMode()\n {\n return $this->_props['RawLogMode'];\n }",
"private function loadLogger()\n {\n // inizializza logger\n Logger::setOptions(array('filter_level' => Config::get('LOG/level'),\n 'log_dir' => Config::get('LOG/dir', Config::get('application.dir') . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . $this->application),\n 'late_write' => Config::get('LOG/late_write', true)\n ));\n }",
"public function enableLogging()\n {\n global $log;\n if (! $this->logger)\n {\n // create a log channel\n $this->logger = new \\Monolog\\Logger('SQL');\n $this->logger->pushHandler($log);\n }\n }",
"public function get_settings() {\r\n\t\t\t$my_option = get_option( '_wpeo_log_settings', array() );\r\n\t\t\t$this->wpeologs_settings = array_merge( $this->wpeologs_settings, (array)$my_option );\r\n\t\t}",
"public static function shouldInheritOnUndefined()\n {\n return static::$inheritOnUndefinedLogger;\n }",
"public function settingsLog(){\n\t\tpermittedArea();\n\n\t\t$data['settingsLog'] = $this->settings_model->adminSettingsLog();\n\n\t\ttheme('settingsLog', $data);\n\t}",
"public function getLogLevel() {\n $log_level = Mage::getStoreConfig(static::XML_PATH_LOG_LEVEL);\n\n return ($log_level !== null) ? intval($log_level) : Zend_Log::INFO;\n }",
"function __isLogRequired($action){\n return (Configure::read('App.logs.models.rules.'.$action) > 0);\n }",
"protected function configureDailyHandler(Logger $log){\n $can_write_log = false;\n foreach($log->getLogLevels() as $log_level){ // getLogLevels() comes from App\\Helpers\\LogWriter\n if($can_write_log || $log_level == $this->logLevel()){\n $can_write_log = true;\n }\n\n if($can_write_log){\n $log->useDailyFiles($this->getLogFilePath($log_level), $this->maxFiles(), $log_level);\n }\n }\n }",
"function setLogMode($value)\n {\n $this->_props['LogMode'] = $value;\n }",
"public final function withLog ()\n {\n\n $this->withLog = true;\n\n }",
"public function init()\n\t{\n\t\tif (null === $this->logFile) {\n\t\t\t$this->logFile = ROOT_DIRECTORY . '/cache/logs/system.log';\n\t\t} else {\n\t\t\t$this->logFile = Yii::getAlias($this->logFile);\n\t\t}\n\t\tif ($this->maxLogFiles < 1) {\n\t\t\t$this->maxLogFiles = 1;\n\t\t}\n\t\tif ($this->maxFileSize < 1) {\n\t\t\t$this->maxFileSize = 1;\n\t\t}\n\t}",
"public static function log_debug_is_enabled() {\n\t\treturn defined( 'SIMPLE_HISTORY_LOG_DEBUG' ) && \\SIMPLE_HISTORY_LOG_DEBUG;\n\t}",
"protected function _initLog()\n {\n }",
"function setReporting() {\r\n if (DEVELOPMENT_ENVIRONMENT == true) {\r\n error_reporting(E_ALL);\r\n ini_set('display_errors', 'On');\r\n } else {\r\n error_reporting(E_ALL);\r\n ini_set('display_errors', 'Off');\r\n ini_set('log_errors', 'On');\r\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'error.log');\r\n }\r\n}",
"public function setEnableLogging($isLoggingEnabled) {\n\t\t$this->setEnableSysLogging($isLoggingEnabled);\n\t}",
"function setReporting()\n{\n if (DEVELOPMENT_ENVIRONMENT == true)\n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'On');\n } else\n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'Off');\n ini_set('log_errors', 'On');\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'error.log');\n }\n}",
"public function logLevel()\n {\n return $this->logLevel ?: self::LOG_LEVEL_INFO;\n }",
"public function setForceLogging($force = true){\n\t\t$this->forceLogging = $force;\n\t\treturn $this;\n\t}",
"public function testScopedLoggingExclusive() {\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::config('shops', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => array('info', 'notice', 'warning'),\n\t\t\t'scopes' => array('transactions', 'orders'),\n\t\t\t'file' => 'shops.log',\n\t\t));\n\t\tCakeLog::config('eggs', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => array('info', 'notice', 'warning'),\n\t\t\t'scopes' => array('eggs'),\n\t\t\t'file' => 'eggs.log',\n\t\t));\n\n\t\tCakeLog::write('info', 'transactions message', 'transactions');\n\t\t$this->assertFalse(file_exists(LOGS . 'eggs.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'shops.log'));\n\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::write('info', 'eggs message', 'eggs');\n\t\t$this->assertTrue(file_exists(LOGS . 'eggs.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'shops.log'));\n\t}",
"public function testNoStreamListenting() {\n\t\tif (file_exists(LOGS . 'error.log')) {\n\t\t\tunlink(LOGS . 'error.log');\n\t\t}\n\t\t$res = CakeLog::write(LOG_WARNING, 'Test warning');\n\t\t$this->assertFalse($res);\n\t\t$this->assertFalse(file_exists(LOGS . 'error.log'));\n\n\t\t$result = CakeLog::configured();\n\t\t$this->assertEquals(array(), $result);\n\t}",
"function setReporting() \n{ \n if (DEVELOPMENT_ENVIRONMENT == true) \n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'On');\n } \n else \n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'Off');\n ini_set('log_errors', 'On');\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'error.log');\n }\n}",
"public function testImportingLoggerFailure() {\n\t\tCakeLog::config('fail', array());\n\t}",
"public static function setDefaults() {\r\n\t\t\t// Write default config\r\n\t\t\tConfigure::write('Debug', false);\r\n\t\t\tConfigure::write('Error.Handler', array('\\Faid\\Debug\\Debug', 'errorHandler'));\r\n\t\t\tConfigure::write('Error.Level', E_ALL | E_WARNING | E_STRICT);\r\n\t\t\tConfigure::write('Exception.Handler', array('\\Faid\\Debug\\Debug', 'exceptionHandler'));\r\n\t\t\tConfigure::write('Exception.Renderer', '\\Faid\\Debug\\ExceptionRenderer');\r\n\t\t\tConfigure::write('Error.Renderer', '\\Faid\\Debug\\ErrorRenderer');\r\n\t\t\tConfigure::write('FatalError.Handler',null);\r\n\t\t\t// Link exception and error event handlers\r\n\t\t\tself::linkErrorHandlers();\r\n\t\t\t// register handler for fatal errors\r\n\t\t\tself::registerShutdown();\r\n\t\t\t// setup event listener for changing events\r\n\t\t\tself::setEventListeners();\r\n\t\t}",
"private function configure()\n {\n if ($this->config->get('speed_analyzer.enabled') === null) {\n $this->config->save('speed_analyzer.enabled', true);\n $this->config->save('speed_analyzer.reports.log_sql_queries', true);\n }\n }",
"public function testCustomLevelWrites() {\n\t\t$this->_deleteLogs();\n\t\t$this->_resetLogConfig();\n\n\t\tCakeLog::levels(array('spam', 'eggs'));\n\n\t\t$testMessage = 'error message';\n\t\tCakeLog::write('error', $testMessage);\n\t\tCakeLog::defaultLevels();\n\t\t$this->assertTrue(file_exists(LOGS . 'error.log'));\n\t\t$contents = file_get_contents(LOGS . 'error.log');\n\t\t$this->assertContains('Error: ' . $testMessage, $contents);\n\n\t\tCakeLog::config('spam', array(\n\t\t\t'engine' => 'File',\n\t\t\t'file' => 'spam.log',\n\t\t\t'types' => 'spam',\n\t\t\t));\n\t\tCakeLog::config('eggs', array(\n\t\t\t'engine' => 'File',\n\t\t\t'file' => 'eggs.log',\n\t\t\t'types' => array('spam', 'eggs'),\n\t\t\t));\n\n\t\t$testMessage = 'spam message';\n\t\tCakeLog::write('spam', $testMessage);\n\t\tCakeLog::defaultLevels();\n\t\t$this->assertTrue(file_exists(LOGS . 'spam.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'eggs.log'));\n\t\t$contents = file_get_contents(LOGS . 'spam.log');\n\t\t$this->assertContains('Spam: ' . $testMessage, $contents);\n\n\t\t$testMessage = 'egg message';\n\t\tCakeLog::write('eggs', $testMessage);\n\t\tCakeLog::defaultLevels();\n\t\t$contents = file_get_contents(LOGS . 'spam.log');\n\t\t$this->assertNotContains('Eggs: ' . $testMessage, $contents);\n\t\t$contents = file_get_contents(LOGS . 'eggs.log');\n\t\t$this->assertContains('Eggs: ' . $testMessage, $contents);\n\n\t\tCakeLog::drop('spam');\n\t\tCakeLog::drop('eggs');\n\n\t\t$this->_deleteLogs();\n\t}",
"public function isActive()\n\t{\n\t global $conf;\n\t\treturn empty($conf->global->SYSLOG_DISABLE_LOGHANDLER_FILE)?1:0; // Set SYSLOG_DISABLE_LOGHANDLER_FILE to 1 to disable this loghandler\n\t}",
"public function setReporting() {\n if (DEVELOPMENT_ENVIRONMENT == true) {\n // Display all errors\n error_reporting(E_ALL);\n ini_set('display_errors','On');\n } else {\n error_reporting(E_ALL);\n // Dont display errors, log in tmp/logs/error.log\n ini_set('display_errors','Off');\n ini_set('log_errors', 'On');\n ini_set('error_log', ROOT.DS.'tmp'.DS.'logs'.DS.'error.log');\n }\n }",
"public function logger(Varien_Event_Observer $observer)\n {\n $controller = $observer->getEvent()->getControllerAction();\n $request = $controller->getRequest();\n\n //Watchdog if off => RETURN;\n //We don't log this extension actions => RETURN;\n if ((Mage::helper('foggyline_watchdog')->isModuleEnabled() == false)\n || ($request->getControllerModule() == 'Foggyline_Watchdog_Adminhtml')\n ) {\n return;\n }\n\n //We are in admin area, but admin logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'adminhtml')\n && (Mage::helper('foggyline_watchdog')->isLogBackendActions() == false)\n ) {\n return;\n }\n\n //We are in frontend area, but frontend logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'frontend')\n && (Mage::helper('foggyline_watchdog')->isLogFrontendActions() == false)\n ) {\n return;\n }\n\n //If user login detected\n $user = Mage::getSingleton('admin/session')->getUser();\n\n //If customer login detected\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n $log = Mage::getModel('foggyline_watchdog/action');\n\n $log->setWebsiteId(Mage::app()->getWebsite()->getId());\n $log->setStoreId(Mage::app()->getStore()->getId());\n\n $log->setTriggeredAt(Mage::getModel('core/date')->timestamp(time()));\n\n if ($user && $user->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_USER);\n $log->setTriggeredById($user->getId());\n } elseif ($customer && $customer->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_CUSTOMER);\n $log->setTriggeredById($customer->getId());\n } else {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_GUEST);\n $log->setTriggeredById(null);\n }\n\n $log->setControllerModule($request->getControllerModule());\n $log->setFullActionName($request->getControllerModule());\n $log->setClientIp($request->getClientIp());\n $log->setControllerName($request->getControllerName());\n $log->setActionName($request->getActionName());\n $log->setControllerModule($request->getControllerModule());\n $log->setRequestMethod($request->getMethod());\n\n //We are in 'adminhtml' area and \"lbparams\" is ON\n if (Mage::getDesign()->getArea() == 'adminhtml'\n && Mage::helper('foggyline_watchdog')->isLogBackendActions()\n && Mage::helper('foggyline_watchdog')->isLogBackendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //We are in 'frontend' area and \"lfparams\" is ON\n if (Mage::getDesign()->getArea() == 'frontend'\n && Mage::helper('foggyline_watchdog')->isLogFrontendActions()\n && Mage::helper('foggyline_watchdog')->isLogFrontendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //In case of other areas, we don't log request params\n\n try {\n $log->save();\n } catch (Exception $e) {\n //If you cant save, die silently, not a big deal\n Mage::logException($e);\n }\n }",
"function beforeFilter() {\n Configure::write('debug', 0);\n}",
"function emDebug() {\n if ($this->getSystemSetting('enable-system-debug-logging') || ( !empty($_GET['pid']) && $this->getProjectSetting('enable-project-debug-logging'))) {\n $emLogger = \\ExternalModules\\ExternalModules::getModuleInstance('em_logger');\n $emLogger->emLog($this->PREFIX, func_get_args(), \"DEBUG\");\n }\n }",
"public function useProductWeightAsDefault()\n {\n return (1 == $this->getConfig('packages/global_settings_default_weight'));\n }",
"function override_theme() {\n\t\tif ( ! $this->is_troubleshooting() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function initDefaultLoggers()\n {\n\n // we dont need any processors\n $processors = array();\n\n // initialize the params for the system logger handler\n $handlerParams = array();\n $logLevelParam = new ParamNode('logLevel', 'string', new NodeValue(LogLevel::INFO));\n $logFileParam = new ParamNode('logFile', 'string', new NodeValue('var/log/appserver-errors.log'));\n $handlerParams[$logFileParam->getPrimaryKey()] = $logFileParam;\n $handlerParams[$logLevelParam->getPrimaryKey()] = $logLevelParam;\n\n // initialize the handler\n $handlers = array();\n $handler = new HandlerNode('\\AppserverIo\\Logger\\Handlers\\CustomFileHandler', null, $handlerParams);\n $handlers[$handler->getPrimaryKey()] = $handler;\n\n // initialize the system logger with the processor and the handlers\n $systemLogger = new LoggerNode(LoggerUtils::SYSTEM, '\\AppserverIo\\Logger\\Logger', 'system', $processors, $handlers);\n\n // we dont need any processors\n $processors = array();\n\n // initialize the params for the access logger formatter\n $formatterParams = array();\n $messageFormatParam = new ParamNode('format', 'string', new NodeValue('%4$s'));\n $formatterParams[$messageFormatParam->getPrimaryKey()] = $messageFormatParam;\n\n // initialize the formatter for the access logger\n $formatter = new FormatterNode('\\AppserverIo\\Logger\\Formatters\\StandardFormatter', $formatterParams);\n\n // initialize the params for the system logger handler\n $handlerParams = array();\n $logLevelParam = new ParamNode('logLevel', 'string', new NodeValue(LogLevel::DEBUG));\n $logFileParam = new ParamNode('logFile', 'string', new NodeValue('var/log/appserver-access.log'));\n $handlerParams[$logFileParam->getPrimaryKey()] = $logFileParam;\n $handlerParams[$logLevelParam->getPrimaryKey()] = $logLevelParam;\n\n // initialize the handler\n $handlers = array();\n $handler = new HandlerNode('\\AppserverIo\\Logger\\Handlers\\CustomFileHandler', $formatter, $handlerParams);\n $handlers[$handler->getPrimaryKey()] = $handler;\n\n // initialize the system logger with the processor and the handlers\n $accessLogger = new LoggerNode(LoggerUtils::ACCESS, '\\AppserverIo\\Logger\\Logger', 'access', $processors, $handlers);\n\n // add the loggers to the default logger configuration\n $this->loggers[$systemLogger->getPrimaryKey()] = $systemLogger;\n $this->loggers[$accessLogger->getPrimaryKey()] = $accessLogger;\n }",
"public function disableRequestLog()\n {\n $this->loggingRequests = false;\n }",
"public function getLogging()\n {\n return isset($this->logging) ? $this->logging : null;\n }",
"protected function configureSingleHandler(Logger $log){\n $can_write_log = false;\n foreach($log->getLogLevels() as $log_level){ // getLogLevels() comes from App\\Helpers\\LogWriter\n if($can_write_log || $log_level == $this->logLevel()){\n $can_write_log = true;\n }\n\n if($can_write_log){\n $log->useFiles($this->getLogFilePath($log_level), $log_level);\n }\n }\n }",
"public function get_logger_option_name() {\n\t\treturn 'updraft_ring_log';\n\t}",
"function phpLog($phpLogMessage)\r\n{\r\n if (!get_cfg_var('error_log')) {\r\n } else {\r\n error_log($errstr = $phpLogMessage);\r\n }\r\n}",
"public function isNeedLog($flag) {\n $this->isNeedLog = $flag;\n }",
"private function _setUpLogger(&$logger = null)\n\t{\n\t\tstatic $_names = array();\n\n\t\tif (!$logger)\n\t\t{\n\t\t\t$logger = (object) array(\n\t\t\t\t'namespace' => 'com_flexicontent.filemanager.uploader',\n\t\t\t\t'filename' => 'mediadata_log.php',\n\t\t\t\t'detailed_log' => false,\n\t\t\t);\n\t\t}\n\n\t\tif (!isset($_names[$logger->namespace]))\n\t\t{\n\t\t\t$_names[$logger->namespace] = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tjimport('joomla.log.log');\n\t\tJLog::addLogger(\n\t\t\tarray(\n\t\t\t\t'text_file' => $logger->filename, // Sets the target log file\n\t\t\t\t'text_entry_format' => '{DATE} {TIME} {PRIORITY} {MESSAGE}' // Sets the format of each line\n\t\t\t),\n\t\t\tJLog::ALL, // Sets messages of all log levels to be sent to the file\n\t\t\tarray($logger->namespace) // category of logged messages\n\t\t);\n\t}",
"private function _set_reporting() {\n //if set to true in config report and dispaly all errors else log erros in errors.log file\n if(DEBUG) {\n error_reporting(E_ALL);\n ini_set('display_errors', 1);\n } else {\n error_reporting(0);\n ini_set('display_errors', 0) ;\n ini_set('log_errors', 1);\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'errors.log');\n }\n }",
"public function testConvenienceScopedLogging() {\n\t\tif (file_exists(LOGS . 'shops.log')) {\n\t\t\tunlink(LOGS . 'shops.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'error.log')) {\n\t\t\tunlink(LOGS . 'error.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'debug.log')) {\n\t\t\tunlink(LOGS . 'debug.log');\n\t\t}\n\n\t\t$this->_resetLogConfig();\n\t\tCakeLog::config('shops', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => array('info', 'debug', 'notice', 'warning'),\n\t\t\t'scopes' => array('transactions', 'orders'),\n\t\t\t'file' => 'shops',\n\t\t));\n\n\t\tCakeLog::info('info message', 'transactions');\n\t\t$this->assertFalse(file_exists(LOGS . 'error.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'shops.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'debug.log'));\n\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::error('error message', 'orders');\n\t\t$this->assertTrue(file_exists(LOGS . 'error.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'debug.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'shops.log'));\n\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::warning('warning message', 'orders');\n\t\t$this->assertTrue(file_exists(LOGS . 'error.log'));\n\t\t$this->assertTrue(file_exists(LOGS . 'shops.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'debug.log'));\n\n\t\t$this->_deleteLogs();\n\n\t\tCakeLog::drop('shops');\n\t}",
"public function testSetLogger() {\n $file_name = getLogFileName();\n $message = 'The sky is the daily bread of the eyes.';\n setOutputDestination($file_name);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertFalse(strpos($output, $message) !== false);\n Terminus::setLogger(['debug' => true, 'format' => 'json']);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertTrue(strpos($output, $message) !== false);\n resetOutputDestination($file_name);\n }",
"public function setLogMode($logMode) {\n $this->logMode = $logMode;\n }",
"public static function initSysLog() {}",
"public function can_log() {\n\t\treturn apply_filters( 'redirection_log_404', $this->can_log );\n\t}",
"function __isLogDetailsRequired($action){\n return (Configure::read('App.logs.models.rules.'.$action) > 1);\n }",
"private static function default_settings() {\n\t\treturn array(\n\t\t\t'module_ga' => true,\n\t\t\t'module_ip' => true,\n\t\t\t'module_log' => true,\n\t\t\t'sent_data' => false,\n\t\t\t'api_key' => '',\n\t\t\t'mark_as_approved' => true,\n\t\t);\n\t}",
"protected function setupLogging()\n\t{\n\t\t// Here we will configure the error logger setup for the application which\n\t\t// is built on top of the wonderful Monolog library. By default we will\n\t\t// build a basic log file setup which creates a single file for logs.\n\n\t\tLog::useFiles(storage_path().'/logs/laravel.log');\n\t}",
"function get_current_log() {\n\t\tif ( isset( $this->log ) ) {\n\t\t\treturn $this->log;\n\t\t}\n\t\treturn false;\n\t}",
"protected function define_my_settings() {\n // No particular settings for this activity\n }",
"protected function assertNoLogEntries() {}",
"private function setupLog()\n {\n $path = JFactory::getConfig()->get('log_path');\n\n $fileName = 'ecr_log.php';\n $entry = '';\n\n if('preserve' == JFactory::getApplication()->input->get('logMode')\n && JFile::exists($path.'/'.$fileName)\n )\n {\n $entry = '----------------------------------------------';\n }\n else if(JFile::exists($path.'/'.$fileName))\n {\n JFile::delete($path.'/'.$fileName);\n }\n\n JLog::addLogger(\n array(\n 'text_file' => $fileName\n , 'text_entry_format' => '{DATETIME}\t{PRIORITY}\t{MESSAGE}'\n , 'text_file_no_php' => true\n )\n , JLog::INFO | JLog::ERROR\n );\n\n if('' != $entry)\n JLog::add($entry);\n\n return $this;\n }",
"protected function _loggerSanity()\n {\n if (!isset($this->_directives['logging']) || !$this->_directives['logging']) {\n return;\n }\n\n if (isset($this->_directives['logger'])) {\n if ($this->_directives['logger'] instanceof Zend_Log) {\n return;\n }\n Zend_Cache::throwException('Logger object is not an instance of Zend_Log class.');\n }\n\n // Create a default logger to the standard output stream\n require_once 'Zend/Log.php';\n require_once 'Zend/Log/Writer/Stream.php';\n require_once 'Zend/Log/Filter/Priority.php';\n $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output'));\n $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<='));\n $this->_directives['logger'] = $logger;\n }",
"protected function log() {\n }",
"function setRawLogMode($value)\n {\n $this->_props['RawLogMode'] = $value;\n }",
"function handle_logging() {\n\t\tif ( ! $this->is_user_parrot() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['pp-allow-plugins'] ) && wp_verify_nonce( $_POST['nonce'], 'pp-allow' ) ) {\n\t\t\tset_transient( 'ti_log_allowed', isset( $_POST['allow_plugin'] ) ? $_POST['allow_plugin'] : array() );\n\t\t}\n\n\t\t$logs = null;\n\t\tif ( isset( $_POST['pp_plugin_name'] ) && wp_verify_nonce( $_POST['nonce'], 'pp-view' ) ) {\n\t\t\t$logs = get_transient( 'ti_log' . $_POST['pp_plugin_name'] );\n\t\t} else {\n\t\t\t// show the first one by default\n\t\t\t$allowed = get_transient( 'ti_log_allowed' );\n\t\t\tif ( $allowed && count( $allowed ) > 0 ) {\n\t\t\t\t$logs = get_transient( 'ti_log' . $allowed[0] );\n\t\t\t}\n\t\t}\n\n\t\t$registered = get_transient( 'ti_log_registered' );\n\t\t$allowed = get_transient( 'ti_log_allowed' );\n\t\tif ( $registered ) {\n\t\t\tinclude_once trailingslashit( plugin_dir_path( __FILE__ ) ) . 'inc/logging.php';\n\t\t}\n\t}",
"function errorlog_enable() {\r\n \r\n // error-checking\r\n if (error_reporting() !== -1) { die(__FUNCTION__ . \": error_reporting() must be set to -1, not \" .error_reporting(). \"!\"); }\r\n \r\n // setup handlers\r\n set_error_handler('_errorlog_catchRuntimeErrors'); \r\n set_exception_handler('_errorlog_catchUncaughtExceptions');\r\n register_shutdown_function('_errorlog_catchFatalErrors');\r\n}",
"public function testStreamEnabledInvalid() {\n\t\tCakeLog::enabled('bogus_stream');\n\t}",
"protected function registerLogLevel(){\n require_once __DIR__ . '/../../config/constant.php';\n $monolog = Log::getMonolog();\n foreach($monolog->getHandlers() as $handler) {\n $handler->setLevel(Config::get('app.log-level'));\n }\n }",
"public function checkDefaultValues() {\n return is_file($this->STR_PROJECT_CONFIG_FILE);\n }",
"function example_module_noop_sysconfig()\n{\n return true;\n}",
"protected function initLogger(): void\n {\n $customPath = $this->context->getConfigurationService()->getLogPath();\n $severity = $this->context->getConfigurationService()->getLogSeverity();\n\n Logger::resetErrors();\n $this->logger = Logger::getInstance(__CLASS__, $customPath, $severity);\n }",
"function setReporting() {\nif (DEVELOPMENT_ENVIRONMENT == true) {\n error_reporting(E_ALL);\n ini_set('display_errors','On');\n} else {\n error_reporting(E_ALL);\n ini_set('display_errors','Off');\n ini_set('log_errors', 'On');\n ini_set('error_log', ROOT.DS.'tmp'.DS.'logs'.DS.'error.log');\n}\n}"
] | [
"0.7341589",
"0.6904965",
"0.67774576",
"0.6524594",
"0.64568865",
"0.6418857",
"0.6328534",
"0.62996745",
"0.61947334",
"0.619206",
"0.61699796",
"0.5865257",
"0.5831409",
"0.5798236",
"0.5785972",
"0.5772453",
"0.5764625",
"0.5640854",
"0.56261206",
"0.56179804",
"0.5535306",
"0.5534541",
"0.5527514",
"0.55229855",
"0.55074316",
"0.54955935",
"0.5493589",
"0.5481603",
"0.5474965",
"0.5462927",
"0.5461532",
"0.5456972",
"0.5437167",
"0.54185414",
"0.54126066",
"0.53494626",
"0.5346425",
"0.53455824",
"0.5337866",
"0.53182125",
"0.53118414",
"0.5281201",
"0.5279645",
"0.5267317",
"0.52609956",
"0.52539617",
"0.52495015",
"0.52461946",
"0.52337974",
"0.5231897",
"0.52308905",
"0.5204774",
"0.5193816",
"0.5191974",
"0.51849073",
"0.51810265",
"0.5179773",
"0.5178216",
"0.51757884",
"0.51752186",
"0.5165754",
"0.51639485",
"0.51615167",
"0.51561797",
"0.5154321",
"0.51510686",
"0.51423216",
"0.51333123",
"0.512779",
"0.51264364",
"0.5121339",
"0.51194125",
"0.511937",
"0.5110277",
"0.50989455",
"0.50932413",
"0.50900453",
"0.5089328",
"0.5086354",
"0.5063838",
"0.5061459",
"0.50606465",
"0.50570375",
"0.5056606",
"0.5056094",
"0.50467265",
"0.5037287",
"0.50360364",
"0.5034813",
"0.50260884",
"0.5024847",
"0.5018192",
"0.50152844",
"0.501199",
"0.5001702",
"0.49954337",
"0.49856627",
"0.49825308",
"0.4974629",
"0.4974213"
] | 0.79847676 | 0 |
Return the minimum log level configured. Default to Zend_Log::WARN. | public function getLogLevel() {
$log_level = Mage::getStoreConfig(static::XML_PATH_LOG_LEVEL);
return ($log_level !== null) ? intval($log_level) : Zend_Log::INFO;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getMinimumLogLevel() {}",
"public static function getLevelWarn()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::WARN])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::WARN] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::WARN, 'WARN', LOG_WARNING);\n }\n return self::$levelMap[Payone_Log4php_LoggerLevel::WARN];\n }",
"private static function getLevel() {\n if (empty(static::$level)) {\n static::$level = Conf::getIniVal(Conf::LOG_LEVEL, 3);\n }\n return static::$level;\n }",
"public function getLevel() {\n return Logger::$LOG_LEVELS[$this->logLevel];\n }",
"public function logLevel()\n {\n return $this->logLevel ?: self::LOG_LEVEL_INFO;\n }",
"public function getLogLevel(){\n\n\t\treturn $this->_log_level;\n\t}",
"protected function logLevel()\n {\n if ($this->app->bound('config')) {\n return $this->app->make('config')->get('app.log_level', 'debug');\n }\n\n return 'debug';\n }",
"public function getLogLevel()\n {\n return $this->_logLevel;\n }",
"abstract public function getMinimumLevel()\n\t{\n\t\treturn 0.5;\n\t}",
"function getLogLevel()\n {\n return $this->_props['LogLevel'];\n }",
"protected function getMinimumPatchLevel()\r\n {\r\n static $level;\r\n\r\n if (! $level) {\r\n $level = intval($this->db->fetchOne(\"SELECT COALESCE(MIN(gpl_level), 1) FROM gems__patch_levels\"));\r\n }\r\n\r\n return $level;\r\n }",
"public function getLogLevel()\r\n {\r\n return $this->level;\r\n }",
"protected function getLogLevel()\n {\n return $this->_loglevel;\n }",
"public function getLogLevel()\n {\n return $this->level;\n }",
"public static function getLevelFatal()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::FATAL])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::FATAL] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::FATAL, 'FATAL', LOG_ALERT);\n }\n return self::$levelMap[Payone_Log4php_LoggerLevel::FATAL];\n }",
"public function getDefaultFatalErrorLevel () {\n\t\treturn $this->defaultFatalErrors;\n\t}",
"public function getMessageLevel() {\r\n\t\treturn($this->level);\r\n\t}",
"public function get_default_log_limit()\n {\n return $this->_log_limit;\n }",
"public function level() {\n\n\t\t$this->count_attempts( 300 );\n\n\t\tswitch ( TRUE ) {\n\t\t\tcase ( $this->attempts > 2 && $this->attempts <= 100 ) :\n\t\t\t\treturn Logger::NOTICE;\n\t\t\tcase ( $this->attempts > 100 && $this->attempts <= 590 ) :\n\t\t\t\treturn Logger::WARNING;\n\t\t\tcase ( $this->attempts > 590 && $this->attempts <= 990 ) :\n\t\t\t\treturn Logger::ERROR;\n\t\t\tcase ( $this->attempts > 990 ) :\n\t\t\t\treturn Logger::CRITICAL;\n\t\t}\n\n\t\treturn 0;\n\t}",
"public static function getLevelDebug()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::DEBUG])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::DEBUG] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::DEBUG, 'DEBUG', LOG_DEBUG);\n }\n return self::$levelMap[Payone_Log4php_LoggerLevel::DEBUG];\n }",
"function getLevel()\n {\n return $this->errorLevel;\n }",
"public function setMinimalLogLevel($minLevel)\n {\n $this->logger->setMinLevel($minLevel);\n }",
"public function getDefaultLevel()\n {\n return 5; # level binh thuong\n }",
"public function getLevel()\n {\n return PMA_Message::$level[$this->getNumber()];\n }",
"public function get_logger_limit() {\n\t\treturn $this->get_option('ring_logger_limit', 20);\n\t}",
"public function getKnackLogLevel();",
"public function getDefaultLevel()\n {\n\n return 2.2;\n }",
"public function getLevel() {\n\t\treturn isset($this->level) ? (int) $this->level : 1;\n\t}",
"public function getLevel()\n {\n return isset($this->level) ? $this->level : null;\n }",
"public function getTraceLevel(): int\n\t{\n\t\treturn Prado::getLogger()->getTraceLevel();\n\t}",
"function getLevelTruck()\r\n {\r\n static $level;\r\n if (!isset($level)) $level = new CustomLoggerLevel(LOG4PHP_LEVEL_TRUCK_INT, 'TRUCK', 0);\r\n return $level;\r\n }",
"public function getDefaultLevelAdmin()\n {\n return 3;\n }",
"public function getDebugLevel()\n {\n }",
"public static function getLevelOff()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::OFF])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::OFF] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::OFF, 'OFF', LOG_ALERT);\n }\n return self::$levelMap[Payone_Log4php_LoggerLevel::OFF];\n }",
"public function getDebugLevel()\n {\n return $this->do_debug;\n }",
"public static function getLevelAll()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::ALL])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::ALL] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::ALL, 'ALL', LOG_DEBUG);\n }\n return self::$levelMap[Payone_Log4php_LoggerLevel::ALL];\n }",
"public function getLevel() {\n return intval($this->level);\n }",
"public function getExceptionLevel(): string\n {\n return $this->levels;\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getMinimumFeedbackScore()\n {\n return $this->minimumFeedbackScore;\n }",
"public function getLevel()\n {\n $value = $this->get(self::LEVEL);\n return $value === null ? (integer)$value : $value;\n }",
"public function getMessageLogger()\n {\n if (null === self::$_messageLogger) {\n self::$_messageLogger = Mage::getSingleton('tmcore/module_messageLogger');\n }\n return self::$_messageLogger;\n }",
"protected function getThreshold()\n {\n return isset($this->threshold) ? $this->threshold : 1;\n }",
"public function getLevel() : int\n\t{\n\t\treturn $this->level;\n\t}",
"public function getLogLevel()\n {\n return 'info';\n }",
"public function getLevel() {\n return $this->level;\n }",
"function getLevel() {\n\t\treturn $this->_level;\n\t}",
"public function getMinMessage()\n {\n return $this->getOption('min_message', 'Please add at least %min% number '\n .'of objects.');\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getReadableLevel()\n {\n // we need to keep LEVEL array in this inverted format because of Symfony form elements\n return array_search($this->level, self::LEVELS);\n }",
"protected function getEmailNotificationsLevel()\n {\n return Logger::NOTICE;\n }",
"public static function getLogLevel( $time ) {\r\n\t\tif( $time >= 5000) {\r\n\t\t\treturn \"warning\";\r\n\t\t}\r\n\t\tif( $time >= 1000) {\r\n\t\t\treturn \"info\";\r\n\t\t}\r\n\t\treturn \"trace\";\r\n\t}",
"public static function getLevelTrace()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::TRACE])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::TRACE] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::TRACE, 'TRACE', LOG_DEBUG);\n }\n return self::$levelMap[Payone_Log4php_LoggerLevel::TRACE];\n }",
"public function getLevel()\n {\n return$this->level;\n }",
"public function GetLevel()\n {\n return $this->level;\n }",
"public static function getLevelInfo()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::INFO])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::INFO] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::INFO, 'INFO', LOG_INFO);\n }\n return self::$levelMap[Payone_Log4php_LoggerLevel::INFO];\n }",
"public function getAdminLevel()\n {\n $userId = Auth::user()->id;\n // admin or not\n $level = 99;\n $user = DB::table('admins')->where('uid', $userId)->first();\n if ($user !== null) {\n $level = $user->level;\n }\n\n return $level;\n }",
"public function getLevel() {\n\t\tif (empty($this->_level) && $this->_hasCategory) {\n\t\t\t$this->_level = $this->_getCategory()->getLevel();\n\t\t}\n\t\t//Remove 1 level, Home is considered L1.\n\t\treturn $this->_level -1;\n\t}",
"public function getLevel(): int\n {\n return $this->level;\n }",
"public function getLevel(): int\n {\n return $this->level;\n }",
"protected function get_log_level($slim_log_level)\n {\n\n return isset($this->log_level[$slim_log_level]) ?\n $this->log_level[$slim_log_level] :\n $slim_log_level;\n }",
"function wlog($msg,$typ='INF',$level=1)\n{\n global $log;\n\n if ($level==0)\n {\n return; //no logging\n }\n else {\n $log->log($msg,$typ );\n }\n\n}",
"public static function get()\n {\n if (self::$logger === null) {\n self::$logger = self::getBoolIni(\"datadog.trace.debug\")\n ? new ErrorLogLogger(LogLevel::DEBUG)\n : new NullLogger(LogLevel::EMERGENCY);\n }\n return self::$logger;\n }",
"function getLogMode()\n {\n return $this->_props['LogMode'];\n }",
"public function getLogMode() {\n return $this->logMode;\n }",
"protected function get_level()\n {\n return $this->m_voxy_connect->_get_list_voxy_level();\n }",
"public function getCustomLogLevel(\\Exception $exception)\n {\n foreach ($this->logLevels as $fqcn => $level) {\n if ($exception instanceof $fqcn) {\n return $level;\n }\n }\n\n return null;\n }",
"public static function getLogLevel($errno)\n {\n switch ($errno) {\n case E_STRICT:\n\n case E_USER_DEPRECATED:\n case E_DEPRECATED:\n\n case E_USER_WARNING:\n case E_WARNING:\n case E_COMPILE_WARNING:\n return LogLevel::WARNING;\n\n case E_USER_NOTICE:\n case E_NOTICE:\n return LogLevel::NOTICE;\n\n default:\n return LogLevel::ERROR;\n }\n }",
"public function getLevel(): int {\n return $this->level;\n\n }",
"public function getDefaultAllLevel()\n {\n return 100; # dung chon loc thong tin\n }",
"protected function get_logging_levels() {\n\t\t$levels = array();\n\t\t$available_levels = $this->log_manager()->get_logging_levels();\n\n\t\tforeach ( $available_levels as $logging_level ) {\n\t\t\t$levels[ $logging_level[0] ] = $logging_level[1];\n\t\t}\n\n\t\treturn $levels;\n\t}",
"public static function getUserLevel(){\n if (self::isSuper()){\n return \"super\";\n }\n if (self::isAdmin()){\n return \"admin\";\n }\n if (self::isUser()){\n return \"user\";\n }\n return null;\n }",
"public function getLevel()\n\t{\n\t\treturn $this->token->level;\n\t}",
"public function getSupportLevel()\n {\n return $this->supportLevel;\n }",
"public function trxLevel() {\n\t\treturn $this->mTrxLevel;\n\t}",
"public function getPreferLevel()\n {\n return $this->preferLevel;\n }",
"public function getPsr3LogLevel(): string\n {\n $psrLevels = [\n Logger::LEVEL_ERROR => LogLevel::ERROR,\n Logger::LEVEL_WARNING => LogLevel::WARNING,\n Logger::LEVEL_INFO => LogLevel::INFO,\n Logger::LEVEL_TRACE => LogLevel::DEBUG,\n Logger::LEVEL_PROFILE => LogLevel::DEBUG,\n Logger::LEVEL_PROFILE_BEGIN => LogLevel::DEBUG,\n Logger::LEVEL_PROFILE_END => LogLevel::DEBUG,\n ];\n\n return $psrLevels[$this->yiiLogLevel];\n }",
"public function getLevel() : Level {\r\n\r\n return $this->level;\r\n\r\n }",
"private function _getFirstCategoryLevel()\n\t{\n\t\tif (!$this->_firstCategoryLevel) {\n\t\t\t$this->_firstCategoryLevel = intval($this->getVar('category_first_level', 1));\n\t\t}\n\t\treturn $this->_firstCategoryLevel;\n\t}",
"public function getAdminCodeLevel( )\n {\n if ( $this->adminCode1 && $this->adminCode2 && $this->adminCode3 ) {\n return 3;\n }\n if ( $this->adminCode1 && $this->adminCode2 ) {\n return 2;\n }\n if ( $this->adminCode1 ) {\n return 1;\n }\n return 0;\n }",
"public function getLogsLevel()\n {\n $levels = $this->createQueryBuilder()\n ->select('l.level, l.level_name, COUNT(l.id) AS count')\n ->from($this->tableName, 'l')\n ->groupBy('l.level, l.level_name')\n ->orderBy('l.level', 'DESC')\n ->execute()\n ->fetchAll();\n\n $normalizedLevels = array();\n foreach ($levels as $level) {\n $normalizedLevels[$level['level']] = sprintf('%s (%s)', $level['level_name'], $level['count']);\n }\n\n return $normalizedLevels;\n }",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-W01');\n\t}",
"function get_version_min() {\n return $this->version_min;\n }",
"public function getLevelString() {\n\n switch ($this->getLevel()) {\n\n case self::LEVEL_REGISTERED:\n return 'Registered';\n case self::LEVEL_USER:\n return 'User';\n case self::LEVEL_ADMINISTRATOR:\n return 'Administrator';\n default:\n return 'Unknown';\n }\n\n }",
"public static function getLowestQuality(): int\n {\n return static::$lowestQuality;\n }",
"public function getMinLikelihood()\n {\n return $this->min_likelihood;\n }",
"public function getMinLikelihood()\n {\n return $this->min_likelihood;\n }",
"function getLastlevel() {\n return $this->lastlevel;\n }",
"public function getMinimum() {\r\n return $this->minimumvalue;\r\n }"
] | [
"0.7804657",
"0.6993126",
"0.69348603",
"0.67378664",
"0.66611683",
"0.645335",
"0.64270025",
"0.63970125",
"0.6376658",
"0.63304716",
"0.63052595",
"0.6285079",
"0.621341",
"0.61800015",
"0.6127694",
"0.60697174",
"0.6000227",
"0.59257954",
"0.59135664",
"0.59117126",
"0.58935416",
"0.5874464",
"0.5756523",
"0.5725595",
"0.5713886",
"0.56469977",
"0.56436515",
"0.56224716",
"0.55649525",
"0.5562236",
"0.5491573",
"0.5478037",
"0.54738265",
"0.5430387",
"0.5426355",
"0.54109055",
"0.53841275",
"0.53760403",
"0.5365907",
"0.5365907",
"0.5365907",
"0.5365907",
"0.5365907",
"0.5365907",
"0.5303799",
"0.5294265",
"0.5282676",
"0.5277504",
"0.5239791",
"0.52304876",
"0.5223561",
"0.5214429",
"0.5209936",
"0.52077955",
"0.52077955",
"0.52077955",
"0.52077955",
"0.52077955",
"0.52077955",
"0.52077955",
"0.5206973",
"0.51980764",
"0.5197238",
"0.5142531",
"0.5132181",
"0.5131254",
"0.5114757",
"0.5097301",
"0.50756323",
"0.50591296",
"0.50591296",
"0.505738",
"0.5053016",
"0.50235605",
"0.5022474",
"0.49999076",
"0.4997022",
"0.49903205",
"0.49898157",
"0.49653634",
"0.49439797",
"0.4934475",
"0.4928034",
"0.49187896",
"0.4917681",
"0.49143365",
"0.49066824",
"0.48916185",
"0.4880042",
"0.4879682",
"0.48744354",
"0.48682687",
"0.4860206",
"0.4857245",
"0.48428935",
"0.4815355",
"0.47877854",
"0.47877854",
"0.4782643",
"0.4771985"
] | 0.6940264 | 2 |
Set the global scope System Configuration value for the given key. | protected function setGlobalConfig($key, $value) {
Mage::getConfig()
->saveConfig($key, $value, "default")
->reinit();
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function set_global($key, $value = NULL) {\r\n if ( is_array($key) ) {\r\n foreach ($key as $key2=>$value) {\r\n View::$_global_data[$key2] = $value;\r\n if ( self::$_smarty_is_loaded ) {\r\n Smarty_View::smarty_prototype()->assignGlobal($key2, $value);\r\n }\r\n }\r\n } else {\r\n View::$_global_data[$key] = $value;\r\n if ( self::$_smarty_is_loaded ) {\r\n Smarty_View::smarty_prototype()->assignGlobal($key, $value);\r\n }\r\n }\r\n}",
"function setGlobal($key, $newvalue) {\n\t\t$this->set($key, $newvalue);\n\t\t// TODO - This needs to be cleaned up once core apis are made independent of REQUEST variable.\n\t\t// This is added just for backward compatibility\n\t\t$_REQUEST[$key] = $newvalue;\n\t}",
"protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->is_loaded = FALSE;\n\n $file = new File(self::APP_CONFIG);\n\n if (! $file->exists())\n $file->create(\"root\", \"root\", \"0644\");\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n }",
"public function setConfig($key, $value);",
"public function setAppValue($key, $value) {\n\t\t$this->config->setAppValue($this->appName, $key, $value);\n\t}",
"protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_CONFIG);\n\n if (! $file->exists())\n $file->create('root', 'root', '0644');\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n\n $this->is_loaded = FALSE;\n }",
"public abstract function setConfig($key, $value);",
"function setSessValue($k, $v){\n $k = _APPNAME .'#'.$k;\n $_SESSION[$k] = $v;\n }",
"public function set($sKey, $xValue)\n {\n session([$sKey => $xValue]);\n }",
"function setSiteOption($key, $val) {\n\t\t$this->_siteOptions[$key] = $val;\n\t}",
"public function addGlobal(string $key, $value): void\r\n {\r\n $this->twig->addGlobal($key, $value);\r\n }",
"public function set($key, $value) {\n\t\tSettings::set($this->getName(), $key, $value);\n\t}",
"public function addGlobal(string $key, $value): void\n {\n $this->twig->addGlobal($key, $value);\n }",
"public function __set($key, $value)\n\t{\n\t\t$this->config(array($key => $value));\n\t}",
"public function override($key, $value)\n {\n $this->container->get(parent::getSettingKey())[$key] = $value;\n }",
"public static function set_global($name, $value = null)\n\t{\n\t\tif (isset($name) && is_array($name))\n\t\t{\n\t\t\tforeach ($name as $n => $v)\n\t\t\t{\n\t\t\t\tself::$global[$n] = $v;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::$global[$name] = $value;\n\t\t}\n\t}",
"public function __set($key, $value)\n\t{\n\t\t$this->app[$key] = $value;\n\t}",
"public static function setGlobalConfig($key = null, $value = null)\n {\n if (null == $key) {\n return false;\n }\n $db = Base_Database::getConnection();\n try {\n $sql = \"SELECT value FROM config WHERE key = ? LIMIT 0, 1\";\n $query = $db->prepare($sql);\n $query->execute(array($key));\n $finder = $query->fetchAll(PDO::FETCH_ASSOC);\n if ($finder == false) {\n $sql = \"INSERT INTO config (key, value) VALUES (?, ?)\";\n $query = $db->prepare($sql);\n $query->execute(array($key, $value));\n } else {\n if (null == $value) {\n $sql = \"DELETE FROM config WHERE key = ?\";\n $query = $db->prepare($sql);\n $query->execute(array($key));\n } else {\n $sql = \"UPDATE config SET value = ? WHERE key = ?\";\n $query = $db->prepare($sql);\n $query->execute(array($value, $key));\n }\n }\n } catch(Exception $e) {\n error_log($e);\n return false;\n }\n return true;\n }",
"function set_external_config($key, $value)\n {\n $this->_external_config[$key] = $value;\n }",
"public static function assign($key,$value) {\r\n\t\tself::$_smarty->assignGlobal($key,$value);\r\n\t}",
"function set($key, $val)\n {\n $config[$key] = $val;\n \n }",
"public function set( $key, $value ) {\n\n $this->_getConfigVars();\n $this->_conf[$key] = $value;\n $this->_updateConfigFile();\n }",
"public static function set(string $key, mixed $value)\n {\n static::$config[$key] = $value;\n }",
"public function set($key, $value)\n {\n if ($config = $this->getConfigFor($key)) {\n if ($type = Arr::get($config, 'type')) {\n @settype($value, $type);\n }\n $this->setting->set($key, $value);\n }\n }",
"public function set($key, $value)\n\t{\n\t\t$this->componentConfig->set($key, $value);\n\t}",
"protected function set($key, $value = null)\n {\n if (is_array($key)) {\n foreach ($key as $k => $v) {\n $this->set($k, $v);\n }\n } else {\n View::addGlobal($key, $value);\n }\n }",
"private static function set($key, $value)\n {\n shm_put_var(self::getShmem(), $key, $value);\n }",
"public static function set_key($s_key,$s_value)\n\t{\n\t\tif (NULL === $s_value && isset( $_SESSION['Session_Master'][self::$s_name_space][$s_key]) )\n\t\t{\n\t\t\tunset($_SESSION['Session_Master'][self::$s_name_space][$s_key]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['Session_Master'][self::$s_name_space][$s_key] = $s_value;\n\t\t}\n\t}",
"function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }",
"public function set(\n string $key,\n $value,\n ): void {\n $this->boot();\n $this->configuration->eventDispatcher()->dispatch(new Set($this, $key, $value));\n }",
"public function setSettings($key, $val){\r\n $this->setting[$key] = $val;\r\n }",
"public function setConfig($key, $value)\n {\n Config::set($key, $value);\n }",
"public function set($key, $value, $scope='local')\r\n\t{\r\n\t\tif ($scope == 'global')\r\n\t\t\t$this->globals->{$key} = $value;\r\n\t\telse\r\n\t\t\t$this->locals->{$key} = $value;\r\n\r\n\t\treturn $this;\r\n\t}",
"public static function setGlobal($name, $value){\n\t\t$GLOBALS[$name] = self::fillTokens($value);\n\t\tif(self::getVar('debug')){\n\t\t\techo \"setGlobal: {$name}=> <pre>\";\n\t\t\tvar_dump($GLOBALS[$name]);\n\t\t\techo \"</pre><br />\\n\";\n\t\t}\n\t}",
"public function setenv( $key, $value ) {\n\t\t$this->envopts[$key] = $value;\n\t}",
"function register_setting($key, $value)\n{\n csSettings::set($key, $value);\n}",
"public static function set($s_key, $o_val, $s_file = self::_DEFAULT){\n\t\tself::$a_config[$s_file]->$s_key = $o_val;\n\t}",
"public function setValue($key, $value) {\n\t\t$this->config->setValue($key, $value);\n\t}",
"public function setEnvKey(string $key, $value = null)\n {\n $this->env[strtoupper($key)] = $value;\n }",
"public static function set($key, $value)\r\n {\r\n self::$settings[$key] = $value;\r\n }",
"public function setenv($key, $value) {\n\t\t\t$this->envopts[$key] = $value;\n\t\t}",
"public static function set(string $key, $value)\n {\n if (!self::$configLoaded) {\n self::loadConfig();\n }\n\n self::$config[$key] = $value;\n }",
"public function set($key, $value) {\n \n $this->start();\n $_SESSION[$key] = $value;\n \n }",
"function assign_global($key, $value = null)\n\t{\n\t\t\tforeach ($this->data as $k => $v)\t // iterate through data\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (get_class($v) == 'Template') // if data is template object\n\t\t\t\t{\n\t\t\t\t\t$v->assign($key, $value);\t // assign to it\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->assign($key, $value);\t\t // assign to this template also\n\t}",
"public function setApplicationData($key, $value);",
"protected function set_session($sKey,$sValue){$_SESSION[$sKey]=$sValue;}",
"public static function set($key, $value) {\n\t\t\t$_SESSION[base64_encode(BASE_PATH).'_'.$key] = $value;\n\t\t}",
"public function set($key, $value) {\n $this->store->setConfigValue($key, $value);\n }",
"public function SetKey($key = ''){\n \tself::$userKey = $key;\n }",
"public static function setGlobal($name, $value)\n\t{\n\t\tself::$globals[$name] = $value;\n\t}",
"function setGeneralSession($sKey, $sValue)\n\t{\n\t\tif(isset($sKey) && !is_null($sValue))\n\t\t{\n\t\t\t$session_info = $this->dm->session->userdata;\n\t\t\t$session_info[$sKey] = $sValue;\n\t\t\t$this->dm->session->set_userdata($session_info);\t\t\t\n\t\t}\n\t}",
"public static function set($key, $value){\n self::setRequestVar($key, $value);\n \n }",
"public function __set($key, $value)\n {\n $this->service[$key] = $value;\n }",
"private function setSystemVar($variableName, $value)\n {\n $variableApi = $this->get('zikula_extensions_module.api.variable');\n $variableApi->set(VariableApi::CONFIG, $variableName, $value);\n }",
"public static function set($key, $value)\n {\n Arr::set(static::$config, $key, $value);\n }",
"public function __set($key, $value)\r\n {\r\n $this->shared_data->set($key, $value);\r\n }",
"public function set ($k, $v) {\n $_SESSION[$k] = $v;\n }",
"public function set_value ($key, $value) {\n\t\t\n\t\tif (is_array($value)) $value = implode($value, \"\\n\");\n\t\t\n\t\tfor ($i=0; $i < count($this->xml->pref); $i++) { \n\t\t\tif ($this->xml->pref[$i]->key == $key) {\n\t\t\t\t$this->xml->pref[$i]->value = $value;\n\t\t\t}\n\t\t}\n\t}",
"public function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }",
"function setValue($key, $val)\r\n {\r\n $this->container[$key] = $val;\r\n }",
"public function setSettings($key, $value) {\n $this->settings[$key] = $value;\n }",
"public function __set($key, $value) {\n $this->_vars[$key] = $value;\n }",
"public function val(string $sKey, $xValue)\n {\n $this->offsetSet($sKey, $xValue);\n }",
"public static function set($key, $value)\r\n {\r\n $_SESSION[$key] = $value;\r\n }",
"public static function set($key, $value)\n {\n $config = static::load();\n\n Arr::set($config, self::buildKey($key), is_array($value) ? $value : trim($value));\n\n file_put_contents(static::path(), json_encode($config, JSON_PRETTY_PRINT));\n }",
"protected function setPersistentData($key, $value)\n {\n $this->_sessionNamespace->{$key} = $value;\n }",
"public static function set($key, $value){\n\t\t$_SESSION[$key] = $value;\n\t}",
"public static function setValue($key, $value) {\n $_SESSION[self::$appSessionName][$key] = $value;\n }",
"public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function getGlobalSetting($key=null)\n {\n return $this->getSetting($key,true);\n }",
"public static function set($key, $value): void\n {\n $_SESSION[$key] = $value;\n }",
"public function setVar($key, $value);",
"public static function set(?string $key, $value): void\n {\n if (isset($key))\n self::$defined[$key] = $value;\n }",
"public function set( $key , $value ) {\n\t\teval( '$this->items' . $this->nodelize( $key ) . ' = $value;' );\n\t}",
"public function set(string $key, $value): void\n {\n $this->startIfNotStarted();\n if (strpos($key, '.') === false) {\n $_SESSION[$key] = $value;\n } else {\n /** @psalm-suppress NullReference */\n ArrayManipulations::setToArrayByKey($key, $value, $_SESSION);\n }\n }",
"public static function set($key, $value) {\n $_SESSION[$key] = $value;\n }",
"public static function set ($key, $val){\r\n\t\t\t\t$_SESSION[$key]=$val;\r\n\t\t\t}",
"public function set ($key, $value) {\n\t\t$_SESSION[$key] = $value;\n\t}",
"public function __set($key, $value)\n\t{\n\t\t$this->container[$key] = $value;\n\t}",
"abstract public function setPolicyKey($devId, $key);",
"public function set_config($key, $value) {\n $this->config[$key] = $value;\n }",
"public function setConfigKey($key, $value = null, $merge = true)\n {\n $this->setConfig($key, $value);\n }",
"public function setGlobalEnvironment($global = false)\n\t{\n\t\t$this->globalEnvironment = $global;\n\t}",
"function set_key($key)\n\t{\n\t\tif(empty($key) || !isset($GLOBALS['ACCESS_KEYS'][$key])) return;\n\t\tif(ACCESS_MODEL === \"roles\") {\n\t\t\tforeach($GLOBALS['ACCESS_KEYS'][$key] as $k) {\n\t\t\t\tif(substr($k, 0, 1) == '@') {\n\t\t\t\t\t// This key references another role - pull in all keys from that role\n\t\t\t\t\t$this->set_key(substr($k, 1));\n\t\t\t\t} else {\n\t\t\t\t\t$this->access_keys[] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(ACCESS_MODEL === \"discrete\") {\n\t\t\t$this->access_keys[] = $key;\n\t\t}\n\n\t\t$_SESSION['_ACCESS']['keys'] = $this->access_keys;\n\t}",
"public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function set(string $configPath, ?string $value, string $scope = null): self;",
"public function add_environment($key, $value) {\n\t\t$this->template->add_environment($key, $value);\n\t}",
"public static function set(string $key, $value): void\n {\n static::start();\n $_SESSION[$key] = $value;\n }",
"public function setAppKey($key)\n\t{\n\t\tif (empty($key)) {\n\t\t\trequire_once 'Syx/Platform/Exception.php';\n\t\t\tthrow new Syx_Platform_Exception(\"empty for appKey\");\n\t\t}\n\t\t$this->_appKey = (string)$key;\n\t}",
"public function put( $key, $value = null )\n {\n $this->loadSettingsIfNotLoaded();\n $this->unsaved = true;\n\n if ( is_array( $key ) ) {\n foreach ( $key as $k => $v ) {\n array_set( $this->settings, $k, $v );\n }\n } else {\n array_set( $this->settings, $key, $value );\n }\n }",
"public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function set(string $a_key, string $a_val) : void\n {\n $ilDB = $this->db;\n\n $ilDB->replace(\n \"crn_sts_mtr_settings\",\n array(\n \"keyword\" => array(\"text\", $a_key)),\n array(\n \"value\" => array(\"clob\", $a_val))\n );\n\n $this->setting[$a_key] = $a_val;\n }",
"public function setConfig($key, $value, $bolPass = false)\r\n\t{\r\n\t\t$this->arrConfig[Parser::strtoupper( $key )] = $value;\r\n\t\t\r\n\t\tif ( $bolPass == true )\r\n\t\t{\r\n\t\t\t$this->arrPass[Parser::strtolower( $key )] = $value;\r\n\t\t}\r\n\t}",
"public function set(/*string*/ $key, /*string*/ $val) /*void*/\n {\n $_SESSION[self::KEY][$key] = $val;\n }",
"public function set($key, $value)\n {\n $this->variables[$key] = $value;\n }",
"public function set(string $key, $value) : void\n {\n if (isJson($this->configuration)) {\n $configuration = json_decode($this->configuration, true);\n $configuration[$key] = $value;\n $this->configuration = json_encode($configuration);\n } else {\n $this->configuration = json_encode([\n $key => $value\n ]);\n }\n\n $this->saveOrFail();\n }",
"public function set(string $key, $value): void\n {\n $this->ensureStarted();\n $_SESSION[$key] = $value;\n }",
"protected function setIniValue($key, $value)\n {\n ini_set($key, $value);\n }",
"public function setValue($key, $value);"
] | [
"0.6638664",
"0.6475853",
"0.6137864",
"0.61229724",
"0.60142416",
"0.5986156",
"0.59665126",
"0.59483516",
"0.591921",
"0.5887739",
"0.58624434",
"0.58555096",
"0.5796277",
"0.5795588",
"0.5782393",
"0.57684785",
"0.5759131",
"0.5743672",
"0.57220745",
"0.5705849",
"0.57025295",
"0.56968355",
"0.5688192",
"0.5687201",
"0.5673888",
"0.5601219",
"0.5598049",
"0.5596667",
"0.5590158",
"0.5588399",
"0.55874825",
"0.5573386",
"0.5573238",
"0.5571273",
"0.5566649",
"0.5560405",
"0.5556229",
"0.5554469",
"0.5537393",
"0.5536158",
"0.5525059",
"0.5506031",
"0.5474463",
"0.546281",
"0.54613394",
"0.54573226",
"0.54456794",
"0.54431665",
"0.5440699",
"0.54369503",
"0.543141",
"0.5426553",
"0.54261845",
"0.54240495",
"0.5418701",
"0.541867",
"0.5395946",
"0.5382426",
"0.5376459",
"0.5376305",
"0.5368071",
"0.53493285",
"0.5348459",
"0.5345844",
"0.53188777",
"0.53136826",
"0.53081656",
"0.5306469",
"0.5300307",
"0.53001994",
"0.52959305",
"0.5295565",
"0.5295385",
"0.5292496",
"0.5290823",
"0.5290131",
"0.5289634",
"0.5285456",
"0.52823424",
"0.5277415",
"0.5276101",
"0.527333",
"0.52679425",
"0.5262328",
"0.52584994",
"0.52554995",
"0.5254178",
"0.52499723",
"0.5242204",
"0.5239478",
"0.52351856",
"0.52351856",
"0.5233137",
"0.5226264",
"0.5225762",
"0.5224251",
"0.5223998",
"0.52205616",
"0.52205336",
"0.52153105"
] | 0.595707 | 7 |
Set the store scope System Configuration value for the given key. | protected function setStoreConfig($key, $value, $store = null) {
$config = Mage::getConfig();
$store_code = Mage::app()->getStore($store)->getCode();
$scope_id = $config->getNode(sprintf(static::XML_PATH_STORE_ID, $store_code));
if ($scope_id !== null) {
$scope_id = (int) $scope_id;
$config->saveConfig($key, $value, "stores", $scope_id);
$config->reinit();
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set($sKey, $xValue)\n {\n session([$sKey => $xValue]);\n }",
"public function set($key, $value) {\n $this->store->setConfigValue($key, $value);\n }",
"public function setConfig($key, $value);",
"public abstract function setConfig($key, $value);",
"function setSiteOption($key, $val) {\n\t\t$this->_siteOptions[$key] = $val;\n\t}",
"public function set($key, $value) {\n\t\tSettings::set($this->getName(), $key, $value);\n\t}",
"public function setScope()\n {\n $this->setData('scope_id', $this->getWebsiteId() . ':' . $this->getStoreId());\n }",
"protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->is_loaded = FALSE;\n\n $file = new File(self::APP_CONFIG);\n\n if (! $file->exists())\n $file->create(\"root\", \"root\", \"0644\");\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n }",
"private static function set($key, $value)\n {\n shm_put_var(self::getShmem(), $key, $value);\n }",
"public function set ( $key, &$value ) { \t$this->storage[$key] = $value; }",
"protected function setPersistentData($key, $value)\n {\n $this->_sessionNamespace->{$key} = $value;\n }",
"protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_CONFIG);\n\n if (! $file->exists())\n $file->create('root', 'root', '0644');\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n\n $this->is_loaded = FALSE;\n }",
"function setSessValue($k, $v){\n $k = _APPNAME .'#'.$k;\n $_SESSION[$k] = $v;\n }",
"public static function set_key($s_key,$s_value)\n\t{\n\t\tif (NULL === $s_value && isset( $_SESSION['Session_Master'][self::$s_name_space][$s_key]) )\n\t\t{\n\t\t\tunset($_SESSION['Session_Master'][self::$s_name_space][$s_key]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['Session_Master'][self::$s_name_space][$s_key] = $s_value;\n\t\t}\n\t}",
"public function set($key, $value)\n\t{\n\t\t$this->componentConfig->set($key, $value);\n\t}",
"public function set($key,$value) {\n\t\t$this->getFrontendUser()->setKey('ses', self::SESSIONNAMESPACE.$key, $value);\n\t\t$this->getFrontendUser()->storeSessionData();\n return true;\n\t}",
"public function set($key, $value)\n {\n if ($config = $this->getConfigFor($key)) {\n if ($type = Arr::get($config, 'type')) {\n @settype($value, $type);\n }\n $this->setting->set($key, $value);\n }\n }",
"public function set( $key , $value ) {\n\t\teval( '$this->items' . $this->nodelize( $key ) . ' = $value;' );\n\t}",
"public function __set ($key, $value)\n {\n if (!$this->storage->isAvailable()) {\n $this->storage->init();\n }\n $this->storage->put($key, $value);\n }",
"abstract function setStore(string $storeKey, int $time = null);",
"public function set( $key, $value ) {\n\n $this->_getConfigVars();\n $this->_conf[$key] = $value;\n $this->_updateConfigFile();\n }",
"public function set($key, $val) {\n $_SESSION[static::$storageKey][$key] = $val;\n }",
"public function __set($key, $value)\n {\n if (strpos($key, '_') === 0) {\n return;\n }\n if ($this->_overwrite === true) {\n $this->_store[$key]=$value;\n if (isset($this->_engine)) {\n $this->_engine->save($this->_store);\n }\n } else {\n if (isset($this->$key) === true) {\n return;\n } else {\n $this->_store[$key]=$value;\n if (isset($this->_engine)) {\n $this->_engine->save($this->_store);\n }\n }\n }\n return;\n }",
"public function set($key, $value) {\n \n $this->start();\n $_SESSION[$key] = $value;\n \n }",
"public function setValue($key, $value);",
"public function setValue($key, $value);",
"public function set(\n string $key,\n $value,\n ): void {\n $this->boot();\n $this->configuration->eventDispatcher()->dispatch(new Set($this, $key, $value));\n }",
"abstract public function setPolicyKey($devId, $key);",
"public function set($strKey, $varValue);",
"public function setApplicationData($key, $value);",
"function set($key, $val)\n {\n $config[$key] = $val;\n \n }",
"public function __set($key, $value)\n {\n $this->service[$key] = $value;\n }",
"public static function set($key, $value) {\n\t\t\t$_SESSION[base64_encode(BASE_PATH).'_'.$key] = $value;\n\t\t}",
"public static function set($s_key, $o_val, $s_file = self::_DEFAULT){\n\t\tself::$a_config[$s_file]->$s_key = $o_val;\n\t}",
"function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }",
"public function __set($key, $value) {\n $_SESSION[$key] = serialize($value);\n }",
"protected function set_session($sKey,$sValue){$_SESSION[$sKey]=$sValue;}",
"public function __set($key, $value)\n\t{\n\t\t$this->config(array($key => $value));\n\t}",
"public function setAppValue($key, $value) {\n\t\t$this->config->setAppValue($this->appName, $key, $value);\n\t}",
"public function __set($key, $value)\r\n {\r\n $this->shared_data->set($key, $value);\r\n }",
"function set($key, $val)\n {\n $this->keyvalList[$key] = $val;\n // save to DB, or _SESSION[__JC_SESSION] or something\n $_SESSION[$key] = $val;\n }",
"public function set(string $key, $value) : void\n {\n if (isJson($this->configuration)) {\n $configuration = json_decode($this->configuration, true);\n $configuration[$key] = $value;\n $this->configuration = json_encode($configuration);\n } else {\n $this->configuration = json_encode([\n $key => $value\n ]);\n }\n\n $this->saveOrFail();\n }",
"public function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }",
"function setValue($key, $val)\r\n {\r\n $this->container[$key] = $val;\r\n }",
"function set_external_config($key, $value)\n {\n $this->_external_config[$key] = $value;\n }",
"public static function set ($key, $val){\r\n\t\t\t\t$_SESSION[$key]=$val;\r\n\t\t\t}",
"public function set($key, $value) {\n\n }",
"public function set($key, $value, $scope='local')\r\n\t{\r\n\t\tif ($scope == 'global')\r\n\t\t\t$this->globals->{$key} = $value;\r\n\t\telse\r\n\t\t\t$this->locals->{$key} = $value;\r\n\r\n\t\treturn $this;\r\n\t}",
"public function set($key, $value)\n {\n $this->session->set($key,$value);\n }",
"public function storeSetting($setting,$key)\n\t{\n\t\t$this->settings[$key]=$setting;\n\t}",
"public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function __set($key, $value)\n\t{\n\t\t$this->app[$key] = $value;\n\t}",
"public function set_value ($key, $value) {\n\t\t\n\t\tif (is_array($value)) $value = implode($value, \"\\n\");\n\t\t\n\t\tfor ($i=0; $i < count($this->xml->pref); $i++) { \n\t\t\tif ($this->xml->pref[$i]->key == $key) {\n\t\t\t\t$this->xml->pref[$i]->value = $value;\n\t\t\t}\n\t\t}\n\t}",
"public function override($key, $value)\n {\n $this->container->get(parent::getSettingKey())[$key] = $value;\n }",
"protected function setPersistentData($key, $value)\r\n {\r\n }",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public static function set($key, $value)\r\n {\r\n $_SESSION[$key] = $value;\r\n }",
"public function set ($key, $value);",
"public function set ($k, $v) {\n $_SESSION[$k] = $v;\n }",
"function setValue($app, $key, $value)\n {\n if ( is_array($value) ) $value = serialize($value);\n $name = $app . \"-\" . $key;\n $this->fDebug->add(get_class($this) . \"::setValue(): Setting values for $name\", 4);\n if ( !$this->isEntitySet($name) ) $this->ValidEntity($name);\n $this->$name = $value;\n }",
"public function __set($key, $value);",
"public function setSettings($key, $val){\r\n $this->setting[$key] = $val;\r\n }",
"public static function set($key, $value){\n\t\t$_SESSION[$key] = $value;\n\t}",
"public function set ($key, $value) {\n\t\t$_SESSION[$key] = $value;\n\t}",
"public function SetKey($key = ''){\n \tself::$userKey = $key;\n }",
"public static function set($key, $value){\n self::setRequestVar($key, $value);\n \n }",
"public function storeSetting( $data, $key )\r\n\t{\r\n\t\tself::$settings[ $key ] = $data;\r\n\t}",
"public function setConfig($key, $value)\n {\n Config::set($key, $value);\n }",
"protected function setPersistentData($key, $value)\n {\n if (!in_array($key, self::$kSupportedKeys)) {\n self::errorLog('Unsupported key passed to setPersistentData.');\n\n return;\n }\n\n $sSessionVarName = $this->constructSessionVariableName($key);\n oxRegistry::getSession()->setVariable($sSessionVarName, $value);\n }",
"public function __set($key, $val) {\n $this->storage[$key] = $val;\n }",
"public static function set(string $key, mixed $value)\n {\n static::$config[$key] = $value;\n }",
"private function setSystemVar($variableName, $value)\n {\n $variableApi = $this->get('zikula_extensions_module.api.variable');\n $variableApi->set(VariableApi::CONFIG, $variableName, $value);\n }",
"public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function set($key,$value) {\n $this->_data[$key]=$value;\n }",
"public function val(string $sKey, $xValue)\n {\n $this->offsetSet($sKey, $xValue);\n }",
"public static function set($key, $value) {\n $_SESSION[$key] = $value;\n }",
"public function set(string $configPath, ?string $value, string $scope = null): self;",
"public function set($key, $value)\n\t{\n\t\t$this->values[$this->block][$key] = $value;\n\t}",
"public function setValue($key, $value) {\n\t\t$this->config->setValue($key, $value);\n\t}",
"function set_key($key)\n\t{\n\t\tif(empty($key) || !isset($GLOBALS['ACCESS_KEYS'][$key])) return;\n\t\tif(ACCESS_MODEL === \"roles\") {\n\t\t\tforeach($GLOBALS['ACCESS_KEYS'][$key] as $k) {\n\t\t\t\tif(substr($k, 0, 1) == '@') {\n\t\t\t\t\t// This key references another role - pull in all keys from that role\n\t\t\t\t\t$this->set_key(substr($k, 1));\n\t\t\t\t} else {\n\t\t\t\t\t$this->access_keys[] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(ACCESS_MODEL === \"discrete\") {\n\t\t\t$this->access_keys[] = $key;\n\t\t}\n\n\t\t$_SESSION['_ACCESS']['keys'] = $this->access_keys;\n\t}",
"public function set($key, $val)\n\t\t{\n\t\t\t$this->storage[$key] = $val;\n//\t\t\tif (!is_string($key)){\n// return false;\n// }\n// self::getInstance()->$key = $val;\n\t\t}",
"public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }",
"public function set(string $key, $value);"
] | [
"0.61056936",
"0.60803246",
"0.60697687",
"0.6042345",
"0.5740328",
"0.5733689",
"0.5721374",
"0.5690854",
"0.5674718",
"0.5662158",
"0.56218874",
"0.561473",
"0.55953103",
"0.55627865",
"0.55465555",
"0.55409545",
"0.55112875",
"0.55097675",
"0.55062664",
"0.55020326",
"0.54995507",
"0.5479718",
"0.54768634",
"0.54735404",
"0.54648256",
"0.54648256",
"0.54645574",
"0.54588395",
"0.5455745",
"0.54508734",
"0.5443858",
"0.54415643",
"0.54321367",
"0.54203916",
"0.5409748",
"0.5406813",
"0.5399104",
"0.5387167",
"0.5385092",
"0.537188",
"0.53673023",
"0.5366285",
"0.536127",
"0.5358624",
"0.53410715",
"0.53399795",
"0.533841",
"0.5327509",
"0.53253835",
"0.53209007",
"0.53209",
"0.53209",
"0.5308854",
"0.5306108",
"0.53014946",
"0.5294005",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.5292363",
"0.52878046",
"0.52864724",
"0.5285693",
"0.5285093",
"0.52849036",
"0.52823323",
"0.5282139",
"0.5280029",
"0.5271198",
"0.52653605",
"0.525863",
"0.5257586",
"0.52571416",
"0.5256321",
"0.525607",
"0.525405",
"0.5246714",
"0.5238473",
"0.5230678",
"0.522825",
"0.5224444",
"0.5223011",
"0.5221548",
"0.5221505",
"0.5221432",
"0.5218992",
"0.5214814"
] | 0.576643 | 4 |
Creates a new BrandApplication model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new BrandApplication();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return json_encode([
'code' => 0,
'msg' => '提交成功',
]);
} else {
return json_encode([
'code' => 1,
'msg' => $model->getFirstError(array_keys($model->errors)[0]),
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new Brand();\n\n if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validate($model);\n }\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($model->productBrandId) {\n $brandModel = ProductBrand::findOne(['id' => $model->productBrandId]);\n if ($brandModel) {\n $brandModel->setScenario(ProductBrand::SCENARIO_SET_BRAND);\n $brandModel->brandId = $model->id;\n $brandModel->save();\n }\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create(){\n config(['global.icon_content_title' => 'icon-bookmark']);\n config(['global.text_content_title' => 'Add new brand']);\n\n //set submit route\n config(['global.submit_link' => 'store.vehicle_brand']);\n //set index route\n config(['global.index_link' => '/vehicle-brands']);\n\n return view('vehicle.brand.create');\n }",
"public function actionCreate($page)\n {\n if (\\Yii::$app->user->can('createBrand')) {\n\n $model = new Brand();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n // 2018-10-30 : Records the brand create operation.\n Yii::info('[The user has created the brand record with ID='.$model->id.']', 'cttwapp_user');\n Yii::$app->session->setFlash('success', Yii::t('app', 'El registro se ha creado exitosamente').'.');\n return $this->redirect(['view', 'id' => $model->id, 'page' => $page]);\n }\n // 2018-05-07 : An error occurred in the data capture process. A flash message is issued.\n Yii::$app->session->setFlash('warning', Yii::t('app', 'Por favor atienda las siguientes consideraciones antes de proceder a registrar la información').'.');\n return $this->render('create_brand', ['model' => $model, 'page' => $page]);\n }\n\n Yii::info('[The user gets access to create a new brand record]', 'cttwapp_user');\n return $this->render('create_brand', ['model' => $model, 'page' => $page]);\n }\n else {\n // 2018-07-27 : If the user is a guest, then sends an error message to him. Otherwise it sends a warning message.\n if (Yii::$app->user->getIsGuest()) {\n Yii::$app->session->setFlash('error', Yii::t('app', 'Usted esta tratando de ingresar al sistema de forma no autorizada. Por favor, primero autentifique su acceso').'.');\n Yii::error('[Access denied to create a brand record]', 'cttwapp_user');\n return $this->redirect(['site/index', 'hash' => '0']);\n }\n Yii::$app->session->setFlash('warning', Yii::t('app', 'Su perfil de acceso no le autoriza a utilizar esta acción. Por favor contacte al administrador del sistema para mayores detalles').'.');\n Yii::warning('[Unauthorized access profile to create a brand record]', 'cttwapp_user');\n return $this->redirect(['brand/index', 'page' => $page, 'hash' => '0']);\n }\n }",
"public function create()\n {\n $listBrand=Brand::all();\n return view('admin.brand.add',compact('listBrand'));\n }",
"public function actionAddbrand() {\n\t\t\\Yii::$app->view->title = 'ACA Reporting Service | Add Brand';\n\t\t$this->layout = 'main';\n\t\t$session = \\Yii::$app->session;\n\t\t$admin_permissions = $session ['admin_permissions'];\n\t\tif (\\Yii::$app->SessionCheck->isLogged () == true && in_array(\"6\", $admin_permissions)) \t\t// checking logged session\n\t\t{\n\t\t\t\n\t\t\t$logged_user_id = $session ['admin_user_id']; // collecting variables from session\n\t\t\t$model_acabrands = new TblAcaBrands ();\n\t\t\t$model_acabrands->scenario = 'save'; // model scenario for validating\n\t\t\t\n\t\t\t$transaction = \\Yii::$app->db->beginTransaction (); // begining the transaction\n\t\t\ttry {\n\t\t\t\tif ($model_acabrands->load ( \\Yii::$app->request->post () )) {\n\t\t\t\t\t\n\t\t\t\t\t$brand_details = \\Yii::$app->request->post ();\n\t\t\t\t\t$name = $brand_details ['TblAcaBrands'] ['brand_name'];\n\t\t\t\t\t\n\t\t\t\t\t$checkmodel = TblAcaBrands::Checkbrandname ( $name ); // checking for particular brand name\n\t\t\t\t\t\n\t\t\t\t\tif (empty ( $checkmodel )) {\n\t\t\t\t\t\t$model_acabrands->attributes = $brand_details ['TblAcaBrands'];\n\t\t\t\t\t\t$model_acabrands->created_date = date ( 'Y-m-d H:i:s' );\n\t\t\t\t\t\t$model_acabrands->modified_date = date ( 'Y-m-d H:i:s' );\n\t\t\t\t\t\t$model_acabrands->created_by = $logged_user_id;\n\t\t\t\t\t\t$model_acabrands->is_deleted = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$image = UploadedFile::getInstance ( $model_acabrands, 'brand_logo' ); // getting instance of a uploaded file\n\t\t\t\t\t\t$rnd = rand ( 0, 99999 );\n\t\t\t\t\t\tif ($image) {\n\t\t\t\t\t\t\t$ext = explode ( \".\", $image->name );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$model_acabrands->brand_logo = $ext [0] . '_1_' . $rnd . '.' . $ext [1];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$path = \\Yii::$app->basePath . '/Images/profile_image/brand_logo/' . $model_acabrands->brand_logo;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($model_acabrands->save () && $model_acabrands->validate ()) { // model validated(server side validation)\n\t\t\t\t\t\t\tif ($image) {\n\t\t\t\t\t\t\t\t$image->saveAs ( $path );\n\t\t\t\t\t\t\t\tchmod ( $path, 0755 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$transaction->commit (); // commit the transaction\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'Brand added successfully' );\n\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t'/admin/masterdata' // redirecting to grid if brand is added\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn $this->render ( 'addbrand', [ // render the array to addbrand view file\n\t\t\t\t\t\t\t\t\t'model' => $model_acabrands \n\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$model_acabrands->addError ( 'brand_name', 'Brand name address is already exist.' ); // model adding error\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch ( Exception $e ) { // any exceptions catch throws error msg\n\t\t\t\t\n\t\t\t\t$msg = $e->getMessage ();\n\t\t\t\t\\Yii::$app->session->setFlash ( 'error', $msg );\n\t\t\t\t\n\t\t\t\t$transaction->rollback (); //if exception occurs transaction rollbacks\n\t\t\t}\n\t\t\treturn $this->render ( 'addbrand', [ // render the array to addbrand view file\n\t\t\t\t\t'model' => $model_acabrands \n\t\t\t] );\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->adminlogout (); // Redirecting to login page if session destroyed\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}",
"public function create()\n {\n $brands = CarBrand::all();\n\n\n return view('brand.create',compact('brands'));\n }",
"public function create()\n {\n return view('admin.brand.add_brand');\n }",
"public function create()\n {\n return view('back.Brand.create');\n }",
"public function create()\n {\n return view('data_brand.addBrand');\n }",
"public function create()\n {\n return view('brand.create');\n }",
"public function create()\n {\n return view('brand.create');\n }",
"public function create()\n {\n return view('brand.create');\n }",
"public function create()\n {\n return view('brand.create');\n }",
"public function create()\n {\n return view('admin.brand.create');\n }",
"public function actionCreate()\n {\n $model = new VehicleApply();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createAction()\n {\n $entity = $this->get('mqm_brand.brand_manager')->createBrand();\n $form = $this->createForm(new BrandType(), $entity);\n $request = $this->getRequest();\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $this->get('mqm_brand.brand_manager')->saveBrand($entity);\n\n return $this->redirect($this->generateUrl('TKShopBackendBrandsShowAll'));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function create()\n {\n return view('backend.pages.brand.create');\n }",
"public function create()\n {\n // $categories = Category::all();\n // return view('admin.brands.add_brand',compact('categories'));\n return view('admin.brands.add_brand');\n }",
"public function create()\n {\n $max_position = Brand::max('position');\n return view('backend.brand.create',\n ['max_position'=>$max_position]);\n }",
"public function create()\n {\n Auth::user()->can('create-model') ?: abort(403);\n\n $brands = Brand::where('branch_id', session('selected_branch_id'))->get();\n\n return view('product_model.form', compact('brands'));\n }",
"public function create()\n {\n $item = new Brand();\n // $brandsList = Brand::all();\n\n return view('shop.admin.brands.edit', compact(\n 'item'\n ));\n\n }",
"public function create()\n {\n $this->data['brand'] = null;\n\n\t\treturn view('admin.brands.form', $this->data);\n }",
"public function create()\n\t{\n\t\t//\n\t\treturn view('applications.create');\n\t}",
"public function create()\n {\n\n $max_position = Brand::max('position');\n\n return view('backend.brand.create',[\n 'max_position' => $max_position\n ]);\n }",
"public function actionCreate()\n {\n $model = new ApplicationPhoto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n $brands=Brand::all();\n return view('backEnd.admin.product.create', ['brands'=> $brands]);\n }",
"public function actionCreate()\n {\n $model = new Crm();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Barangmasuk;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Barangmasuk']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Barangmasuk'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function create()\n {\n return view(\"admin.brands.create\");\n }",
"public function store(CreateBrandRequest $request)\n {\n $brand = new Brand($request->all());\n\t\t$brand->save();\n\n Session::flash('message', 'La marca \"'.$brand->nombre.'\" fue creada');\n\n\t\treturn redirect()->route('marcas.index');\n }",
"public function actionCreate()\n {\n $model = new BranchOfCompany();\n $company = ParentCompany::getList();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n// print_r($model);die;\n $this->redirect(Yii::$app->request->referrer);\n // return $this->redirect(['index']);\n// return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'company' => $company,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Bilancio();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function store(CreateBrandRequest $request)\n {\n $brand = new Brand;\n $brand->brand = $request->brand;\n $brand->save();\n\n return redirect('brands')->with('status', 'Create succesfully');\n }",
"public function actionCreate() {\n $model = new Barang();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->stok = 0;\n\n if ($model->save()) {\n if (Url::previous('b-create')) {\n $var = Url::previous('b-create');\n Yii::$app->session->remove('b-create');\n Yii::$app->getSession()->setFlash(\n 'success', 'Berhasil menambahkan barang : <b>' . $model->nama\n );\n return $this->redirect($var);\n } else {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function store(CreateBrandsRequest $request)\n {\n $data = $request->all();\n if($request->slug == ''){\n $slug = $data['name'];\n $clean_slug = str_replace(\"&\", \"and\", strtolower($slug));\n $data['slug'] = Str::slug($clean_slug);\n }\n $brand = Brand::create($data);\n\n return redirect()->route('gjadmin.brands.index');\n }",
"public function store(CreateBrandRequest $request)\n {\n $input = $request->all();\n\n $brand = $this->brandService->create($input);\n\n Flash::success('Brand saved successfully.');\n\n return redirect(route('admin.showcase.brand.index'));\n }",
"public function create()\n {\n return view('index\\brand\\create');\n }",
"public function create()\n {\n $brand=Adminmodel_brand::all();\n $kategori=kategori_model::all();\n\n return view('Dashboard.kontentambah', compact('brand','kategori'));\n }",
"public function create()\n { \n $brands = Brand::all()\n ->where('brand_status','=', 'A')\n ->pluck('brand_full_name', 'id')->toArray();\n\n return view('basics.brandmodel.create', [\n 'allBrand' => $brands\n ]);\n }",
"public function create()\n {\n return view('applications.create');\n }",
"public function actionCreate()\n {\n $model = new CompanyForm();\n\n if ($model->load(Yii::$app->request->post()) && ($company = $model->create())) {\n return $this->redirect(['view', 'id' => $company->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}",
"public function actionCreate()\n\t{\n\t\t$model=new Apply;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Apply']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Apply'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new ArsBooking();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Programador();\n //Yii::$app->request->post() wrapper de Yii para obtener datos seguros enviados por POST\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n if (! Gate::allows('tire_brand_create')) {\n return abort(401);\n }\n return view('tire_brands.create');\n }",
"public function create()\n {\n //\n\t\t\n $brand = Role::pluck('name','name')->all();\n return view('brand.create', compact('brand'));\n\t\t\n }",
"public function create()\n {\n return view('backend.showcase.brands.create');\n }",
"public function create()\n {\n return view('brands.new');\n }",
"public function create()\n {\n \n return view('admin.brands.create');\n\n }",
"public function actionCreate()\n\t{\n $this->layout='admin';\n \n\t\t$model=new Bet;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Bet']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Bet'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function store(BrandCreateRequest $request)\n {\n $data = $request->input();\n\n $item = (new Brand())->create($data);\n\n if($item) {\n return redirect()->route('shop.admin.brands.index')\n ->with(['success' => \"Бренд {$item->name} успешно сохранен\"])\n ->withInput();\n } else {\n return back()\n ->withErrors(['msg' => 'Ошибка сохранения бренда'])\n ->withInput();\n }\n }",
"public function newAction()\n {\n $entity = $this->get('mqm_brand.brand_manager')->createBrand();\n $form = $this->createForm(new BrandType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function create()\n {\n $brands=Brand::all();\n $models=CarMode::all();\n $ccs=Cc::all();\n $prodates=Date::all();\n return view('admin/addcar/create',compact('brands','models','ccs','prodates'));\n\n }",
"public function create()\n {\n if(Session::get('cus_id')==1){\n return view('frontend.admin.brand.create');\n }\n return redirect('login')->with('error','This page is for administrators! You need to log in to continue');\n }",
"public function create()\n\t{\n\n\t\tif(!in_array('createBrand', $this->permission)) {\n\t\t\tredirect('dashboard', 'refresh');\n\t\t}\n\n\t\t$response = array();\n\n\t\t$this->form_validation->set_rules('customer_name', 'Customer name', 'trim|required');\n\t\t$this->form_validation->set_rules('active', 'Active', 'trim|required');\n\n\t\t$this->form_validation->set_error_delimiters('<p class=\"text-danger\">','</p>');\n\n if ($this->form_validation->run() == TRUE) {\n \t$data = array(\n \t\t'customer_name' => $this->input->post('customer_name'),\n \t\t'customer_email' => $this->input->post('customer_email'),\n \t\t'customer_phone' => $this->input->post('customer_phone'),\n \t\t'customer_address' => $this->input->post('customer_address'),\n \t\t'active' => $this->input->post('active'),\t\n \t);\n\n \t$create = $this->model_customers->create($data);\n \tif($create == true) {\n \t\t$response['success'] = true;\n \t\t$response['messages'] = 'Succesfully created';\n \t}\n \telse {\n \t\t$response['success'] = false;\n \t\t$response['messages'] = 'Error in the database while creating the customer information';\t\t\t\n \t}\n }\n else {\n \t$response['success'] = false;\n \tforeach ($_POST as $key => $value) {\n \t\t$response['messages'][$key] = form_error($key);\n \t}\n }\n\n echo json_encode($response);\n\n\t}",
"public function create()\n {\n return view('backend.brands.create');\n }",
"public function create()\n {\n return view('backend.brands.create');\n }",
"public function store(BrandRequest $request)\n {\n $brand = Productbrand::create($request->all());\n if ($brand) {\n return redirect('admin/brands');\n }\n return redirect()->route('brand.create');\n }",
"public function create()\n {\n return view('admin.application.create');\n }",
"public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function createbrandcategory()\n\t\t{\n\t\t\t$logger = Logger::getLogger(__CLASS__);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$taskCode = \"brandcategories\";\n\t\t\t\t$this->LogAccess($taskCode);\n\t\t\t\t$authResult = $this->Authorize($taskCode);\n\t\t\t\tif ($authResult == \"LOGIN\")\n\t\t\t\t{\n\t\t\t\t\treturn $this->view->outputJson(Constants::$LOGIN, \"\", \"\");\n\t\t\t\t}\n\t\t\t\t$brandCategory = new BrandCategory();\n\t\t\t\t$this->model = $brandCategory;\n\t\t\t\tob_start();\n\t\t\t\tinclude('views/brandcategory/_brandcategoriesedit.php');\n\t\t\t\t$output = ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t\treturn $this->view->outputJson(Constants::$OK, $output, \"\");\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$logger->error($ex->getMessage());\n\t\t\t}\n\t\t}",
"public function actionCreate()\n\t{\n\n\t\t$model=new Knowledgecatalogue;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Knowledgecatalogue']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Knowledgecatalogue'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->fCatalogueNo));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function create()\n {\n try {\n return view('backend.brands.create');\n } catch (\\Exception $e) {\n return redirect()->back()->with('error', 'Error Try Again !!');\n }\n }",
"public function actionCreate()\n {\n $model = new Products();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t$model = $this->loadModel();\n\n\t\tif(isset($_POST[get_class($model)]))\n\t\t{\n $model = $this->_prepareModel($model);\n if (Yii::app()->getRequest()->isAjaxRequest) {\n if($model->save())\n echo json_encode($model);\n else\n echo json_encode(array('modelName' => get_class($model),'errors' => $model->getErrors()));\n\n Yii::app()->end();\n }\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new MintaData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n return view('brands.create');\n }",
"public function create()\n {\n return view('brands.create');\n }",
"public function create()\n {\n return view('brands.create');\n }",
"public function create()\n {\n return view('brands.create');\n }",
"public function create()\n {\n return view('brands.create');\n }",
"public function create()\n {\n $categories = Category::all();\n $brands=Brand::all();\n return view($this->viewprefix.'create',compact('categories','brands'));\n }",
"public function actionCreate()\n {\n $model = new Kareer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n $data['branding_details'] = $this->getMeBrandingDetails();\n return view('whitelebal.create', $data);\n }",
"public function actionCreate()\r\n {\r\n $model = new Apresentacao();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function store(Request $request)\n {\n //validate date\n $this->validate($request, [\n 'brandId' => 'required',\n 'brandModelName' => 'required|unique:brand_models,brand_model_name',\n ]);\n\n //Add new data\n $addBrandModel = new BrandModel;\n $addBrandModel->brand_id = $request->input('brandId');\n $addBrandModel->brand_model_name = $request->input('brandModelName');\n $addBrandModel->brand_model_status = 'A';\n $addBrandModel->created_by = auth()->user()->name;\n $addBrandModel->save();\n\n //return index view\n return redirect('/basics/brandmodel');\n }",
"public function create()\n {\n return view('admin.brands.create');\n }",
"public function create()\n {\n return view('admin.brands.create');\n }",
"public function actionCreate()\n {\n $model = new Banners();\n if(!empty(Yii::$app->request->post())) {\n $postData = Yii::$app->request->post();\n if(!empty($_FILES['Banners']['name']['image'])) {\n $postData['Banners']['image'] = $this->uploadFiles($_FILES)['file_path'];\n } else {\n Yii::$app->session->setFlash('error', \"Image should be mandatory\");\n return $this->redirect(['create']);\n }\n if ($model->load($postData) && $model->save()) {\n return $this->redirect(['index']);\n } \n }\n \n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n\t\t$model = new Building();\n\n\t\tif ( $model->load( Yii::$app->request->post() ) && $model->save() ) {\n\t\t\treturn $this->redirect( [ 'index', 'id' => $model->id ] );\n\t\t} else {\n\t\t\treturn $this->render( 'create', [\n\t\t\t\t'model' => $model,\n\t\t\t] );\n\t\t}\n\t}",
"public function create()\n {\n return view('equipment_brands.create');\n }",
"public function create()\n\n { \n $brands = Brand::all();\n $categories = Category::all();\n return view('admin.products.add_product',compact('categories','brands'));\n }",
"public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }",
"public function actionCreate()\n {\n $model = new Beacons();\n if($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n else\n {\n return $this->render('beacon-form', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Carriage();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function store(CreateEquipmentBrandRequest $request)\n {\n $input = $request->all();\n\n $equipmentBrand = $this->equipmentBrandRepository->create($input);\n\n Flash::success('Equipment Brand saved successfully.');\n\n return redirect(route('equipmentBrands.index'));\n }",
"public function actionCreate()\n {\n $model = new ApplyCampaign();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'campaign_id' => $model->campaign_id, 'channel_id' => $model->channel_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $this->layout = 'base';\n $model = new DoctorSignup();\n $brands = Brand::find()->all();\n $treatments = Treatment::find()->all();\n if (Yii::$app->request->isAjax) {\n $model->load(Yii::$app->request->post());\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validate($model);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('alert', [\n 'options' => ['class' => 'alert-success'],\n 'body' => Yii::t('app', 'Account has been successfully created')\n ]);\n return $this->redirect(['doctor/update', 'id' => Yii::$app->user->identity->doctor->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'brands' => $brands,\n 'treatments' => $treatments,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new IhubAbsence();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'idOpr' => $model->idOpr, 'tglabsence' => $model->tglabsence, 'ibadah' => $model->ibadah]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n $categories = Category::all();\n\n return view('brands/create', compact('categories'));\n }",
"public function actionCreate() {\n $model = new EbayPriceMonitor;\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if (isset($_POST['EbayPriceMonitor'])) {\n $model->attributes = $_POST['EbayPriceMonitor'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Medicine();\n\n if ($model->load(Yii::$app->request->post())) {\n\n\n if(Yii::$app->request->post()['Medicine']['BrandId']!='')\n {\n $BrandId=Yii::$app->request->post()['Medicine']['BrandId']; \n }\n else\n {\n $BrandName=$this->Sanitize(Yii::$app->request->post()['BrandName']);\n $checkBrand=Brand::find()->where(['Name'=>$BrandName])->one();\n\n if(count($checkBrand)>0)\n {\n $BrandId=$checkBrand->BrandId;\n }\n else\n {\n $BrandModel=new Brand();\n $BrandModel->Name=$BrandName;\n $BrandModel->save();\n $BrandId=$BrandModel->BrandId;\n }\n }\n\n $model->Name=$this->Sanitize(Yii::$app->request->post()['Medicine']['Name']);\n $model->BrandId=$BrandId;\n $model->MediceneImage=Yii::$app->request->post()['Medicine']['MediceneImage'];\n\n if($model->save())\n {\n foreach(explode(\",\",$model->MedicineCategoryId) as $categoryMap){\n\n $CategoryMaping=new MedicineCategoryMaping();\n $CategoryMaping->MedicineId=$model->MedicineId;\n $CategoryMaping->MedicineCategoryId=$categoryMap;\n $CategoryMaping->save();\n }\n\n Yii::$app->session->setFlash('success', \"Created Succssfully.\");\n return $this->redirect(['index']);\n }\n else\n {\n Yii::$app->session->setFlash('error', \"Please Try again.\");\n return $this->redirect(['create']);\n }\n\n\n } else {\n $Brands=Brand::find()->select(['Name as value', 'Name as label','BrandId as id'])->where(['IsDelete'=>0])->asArray()->all();\n return $this->render('create', [\n 'model' => $model,\n 'Brands'=>$Brands,\n ]);\n }\n}",
"public function actionCreate()\n {\n $models = $this->loadModelsByPid();\n\n $this->performAjaxValidationTabular($models);\n\n $success = $this->doAction($models);\n $newPid = current($models)->pid;\n\n if($success)\n {\n if(isset($_POST['apply']))\n {\n $this->redirectAction($newPid);\n }\n $this->redirectAction();\n }\n\n if($success !== null && $newPid)\n {\n $this->redirectAction($newPid);\n }\n\n $this->render($this->view['create'], array(\n 'models' => $models,\n 'model' => reset($models),\n 'languages' => Language::getList(),\n ));\n }",
"public function create()\n {\n $categories = Category::get();\n $brands = Brand::get();\n return view('admin.product.add',compact('categories','brands'));\n }",
"function add_brand_act(){\n $data['brand'] = $this->m_rental->get_data('car_brand')->result();\n \n $brand_id = $this->input->post('brand_id');\n $brand_desc = $this->input->post('brand_desc');\n $brand_status = $this->input->post('brand_status');\n\n $this->form_validation->set_rules('brand_desc','Brand','required');\n $this->form_validation->set_rules('brand_status','Status','required');\n \n if($this->form_validation->run() != false){\n $data = array(\n 'brand_id' => $brand_id ,\n 'brand_desc' => $brand_desc ,\n 'brand_status ' => $brand_status\n );\n\n $this->m_rental->insert_data($data, 'car_brand');\n redirect(base_url().'home/add_car_act');\n } else { \n $this->load->view('header');\n $this->load->view('admin/add_brand',$data);\n $this->load->view('footer');\n } \n }",
"public function store(Request $request)\n {\n Brand::create([\n 'brand'=>$request->get('name'),\n \n ]);\n return redirect()->back()->with('status','Successfully Created Category');\n }"
] | [
"0.78058046",
"0.7219564",
"0.70903903",
"0.6964024",
"0.693161",
"0.69162846",
"0.6851973",
"0.6844626",
"0.6826405",
"0.6818147",
"0.6818147",
"0.6818147",
"0.6818147",
"0.6814663",
"0.67826456",
"0.67570436",
"0.67037696",
"0.6665711",
"0.66594183",
"0.66473997",
"0.66165173",
"0.6615479",
"0.6591332",
"0.65495515",
"0.6491841",
"0.64885235",
"0.64259416",
"0.64036715",
"0.63973844",
"0.6395547",
"0.63886654",
"0.6351832",
"0.63486415",
"0.6342695",
"0.63420826",
"0.6333054",
"0.6316893",
"0.6316745",
"0.631302",
"0.6311673",
"0.63102716",
"0.628495",
"0.62814146",
"0.6276018",
"0.6270362",
"0.62686026",
"0.6268165",
"0.626653",
"0.62643296",
"0.6252734",
"0.6245985",
"0.62428087",
"0.6233215",
"0.6229006",
"0.6219293",
"0.6214464",
"0.6200729",
"0.6200729",
"0.6199128",
"0.6196612",
"0.6192731",
"0.61883247",
"0.61844915",
"0.6179485",
"0.6172044",
"0.6159039",
"0.6158857",
"0.61526155",
"0.61526155",
"0.61526155",
"0.61526155",
"0.61526155",
"0.6152061",
"0.6131431",
"0.6129345",
"0.6128203",
"0.6127027",
"0.61206824",
"0.61206824",
"0.61203396",
"0.61162823",
"0.6113488",
"0.610563",
"0.6104734",
"0.61011153",
"0.6100843",
"0.6098823",
"0.60917884",
"0.6085042",
"0.6084729",
"0.6077261",
"0.60772306",
"0.60718954",
"0.6064405",
"0.6054839",
"0.60537666",
"0.6049486",
"0.6043938",
"0.6043337",
"0.6030039"
] | 0.8114974 | 0 |
Finds the BrandApplication model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = BrandApplication::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function findModel($id)\n {\n if (($model = Brand::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Brand::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'La página solicitada no existe').'.');\n }",
"public abstract function find($primary_key, $model);",
"private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = BrandSpecGoods::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function findApplicationModel($appId) {\n\t\t$applicationModelFinder = CActiveRecord::model($this->getApplicationModelClassName());\n\n\t\treturn $applicationModelFinder->findByPk($appId, $this->getApplicationFindCondition());\n\t}",
"private function exist($id)\n {\n try {\n $brand = $this->brandService->findOrFail($id);\n } catch(ModelNotFoundException $e) {\n Flash::error('Brand not found');\n\n return redirect(route('admin.showcase.brand.index'));\n }\n\n return $brand;\n }",
"public function getBrandById($id);",
"public function model()\n {\n return BrandModel::class;\n }",
"public function getBrand()\n\t{\n\t\t$Brand = new Product_Brand();\n\t\treturn $Brand->findItem( array( 'Id = '.$this->Brand ) );\n\t}",
"protected function findModel($code)\n {\n if (($model = Offer::findOne(['code' => $code])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = Apple::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"function getBrand($brandId){\r\n\r\n $this->app->log->info(__CLASS__ . '::' . __METHOD__);\r\n $dao = new \\PNORD\\Model\\BrandDAO($this->app); \r\n return $dao->getBrand($brandId); \r\n\r\n }",
"public function findByKey(string $applicationKey) : ?App {\n return $this->instantiate(\n $this->apps->firstWhere('key', $applicationKey)\n );\n }",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Vendor::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function getBrand_id()\n {\n return $this->brand_id;\n }",
"public function getBrand_id()\n {\n return $this->brand_id;\n }",
"public function getBrandById($id)\n {\n return Brand::find($id);\n }",
"protected function findModel($id)\n {\n if(($model = Beacons::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=KqxsBac::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Apply::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public static function getApplication($id)\n\t{\n\t\treturn self::model()->findByPk($id); \n\t}",
"public function findById($id) {\n $sql = \"SELECT * FROM \" . applicationTable::TABLE_NAME .\n \" WHERE \" . applicationTable::COLUMN_ID . \" = :id\";\n\n // the value for the id named placeholder in the SQL DELETE statement\n $params = array('id' => $id);\n\n // prepare the statement for execution and execute it\n $stmt = $this->mConnection->prepare($sql);\n $status = $stmt->execute($params);\n\n // if an error occurred while executing the query then throw an exception\n if ($status != true) {\n $errorInfo = $stmt->errorInfo();\n throw new Exception(\"Could not retrieve book: \" . $errorInfo[2]);\n }\n\n // if exactly one row was returned by the query then retrieve the seekers details\n // and store them in a Seeker object\n $application = null;\n if ($stmt->rowCount() == 1) {\n $row = $stmt->fetch();\n $id = $row[applicationTable::COLUMN_ID];\n $seekerId = $row[applicationTable::COLUMN_SEEKERID];\n $empId = $row[applicationTable::COLUMN_EMPID];\n $jobId = $row[applicationTable::COLUMN_JOBID];\n $status = $row[applicationTable::COLUMN_STATUS];\n\n $application = new Application($id, $seekerId, $empId, $jobId, $status);\n }\n\n // return the Application object if a Application with the specified id was found otherwise return null\n return $application;\n }",
"protected function findModel($id)\n {\n if (($model = BranchOfCompany::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function getBrandId()\n {\n return $this->brandId;\n }",
"public function loadModel($id) \r\n\t{\r\n\t\t$model = SmsGroupPhonebook::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=LicenceApplication::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel($id) {\n $model = Package::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Banner::find()->where(['slug' => $id])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested banner does not exist.');\n }\n }",
"public function loadModel($id) {\n $model = Carrer::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n {\n $model = Booking::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=eBayTargetAndTrack::model()->findByPk($id, \"company_id=:company_id\" ,array(':company_id' => Yii::app()->session['user']->company_id));\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function brand()\n {\n return $this->hasOne(Brands::class, 'id','brand_id');\n }",
"public function getBrandID()\n\t{\n\t\treturn $this->brandID;\n\t}",
"public function test_getRecord_INQUIRY_BRANDS_存在するid_01() {\n $inquiry_brand = $this->inquiry_brand_service->getRecord(InquiryBrandService::MODEL_TYPE_INQUIRY_BRAND, array('id' => $this->t['inquiry_brand']->id));\n\n $this->assertThat($inquiry_brand->brand_id, $this->equalTo($this->t['brand']->id));\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Bet::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\r\n $model = ProductStockEntries::model()->findByPk($id);\r\n if ($model === null)\r\n throw new CHttpException(404, 'The requested page does not exist.');\r\n return $model;\r\n }",
"public function findById($applicationID): ?App {\n return $this->instantiate(\n $this->apps->firstWhere('id', $applicationID)\n );\n }",
"protected function findModel($id) {\n if (($model = Vendor::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function loadModel($id) {\n $model = Item::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Business::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"public function show($id)\n {\n $category = BrandCategoryModel::findOrFail($id);\n }",
"protected function findModel($id)\n {\n if (($model = Banners::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function findById(string $modelId): ?Model;",
"public function findModel($clz, $key);",
"public function getBrandById($id)\n {\n $res = false;\n $id = clsCommon::isInt($id);\n if ($id > 0) {\n $res = $this->em->getRepository('entities\\Brand')->find($id);\n }\n return $res;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Companyorganisation::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `id`, `type`, `name`, `domain`, `api_url`, `api_auth_http_user`, `api_auth_http_password`, `api_auth_type`, `api_auth_user`, `api_auth_password`, `api_auth_token`, `api_auth_url_user_key`, `api_auth_url_pw_key`, `cron`, `customer_id`, `activated`, `notes`, `last_run`, `includeLog`, `public_key`, `website_hash`, `notification_recipient`, `notification_sender`, `notification_change`, `notification_error` FROM `remote_app` WHERE `id` = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new RemoteApp();\n $obj->hydrate($row);\n RemoteAppPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }",
"public function loadModel($id) {\n $model = EbayPriceMonitor::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = UtilitiesBook::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public static function byBrandId(){\n static::addGlobalScope('brand_id', function(Builder $buidler){\n $brand_id = Setting::brandId();\n $buidler->where('brand_id', $brand_id);\n });\n }",
"public function loadModel($id)\n\t{\n\t\t$model=RequestFuel::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('rdt','The requested page does not exist.'));\n\t\treturn $model;\n\t}",
"protected function findModel($id) {\n if (($model = Seller::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Productaccount::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n {\n $model = $this->getModel()->findByPk($id);\n if($model === null)\n throw new CHttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Company::findOne($id)) !== null) {\n\t\t\t\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id) {\n $model = Itemstock::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\r\n {\r\n if (($model = Apresentacao::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }",
"protected function findModel($id)\n\t{\n if (($model = CoreSettings::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"protected function findModel($id)\n {\n if (($model = ProgramHasSumberDana::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n {\n $model=Product::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($code, $user_id)\n {\n if (($model = StockLocation::findOne(['code' => $code, 'user_id' => $user_id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=ApplyLeaves::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}",
"protected function findModel($id)\n {\n if (($model = Product::findOne(['launch_id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=Programa::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"protected function findModel($id)\n {\n if (($model = Branch::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model = Whitelist::model ()->findByPk ( $id );\n\t\tif ($model === null)\n\t\t\tthrow new CHttpException ( 404, 'The requested page does not exist.' );\n\t\treturn $model;\n\t}",
"public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }",
"public function loadModel($id) {\n $model = Blog::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected\n\tfunction findModel(\n\t\t$id\n\t) {\n\t\tif ( ( $model = Building::findOne( $id ) ) !== null ) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException( 'The requested page does not exist.' );\n\t\t}\n\t}",
"public function loadModel($id) {\n $model = BillCashier::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\n\t{\n $model = LinkTree::find()\n ->alias('t')\n ->select(['t.*'])\n ->joinWith(['category category'])\n ->andWhere(['t.banner_id' => $id])\n ->andWhere(['t.is_banner' => 0])\n ->andWhere(['category.type' => 'linktree'])\n ->one();\n\n if ($model !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Bills::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n {\n $model = InfoSpares::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n if (($model = Cars::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n if (($model = RealEstateMaster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Appraisal::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Banner::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Banner::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=Klient::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"public function loadModel($id) {\n $model = Blog::model()->findByPk($id);\n if ($model === null) {\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = AdvertiserApi::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = ArsBooking::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id) {\n $model = Customers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id) {\n $model = Product::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Bgt::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id, $modelClass = __CLASS__)\n {\n $model = Ahorro::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Buku::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function brand()\n {\n return $this->hasOne('App\\Models\\Brand','id','brandmodeleable_id');\n }",
"public function loadModel($id)\n {\n\n //$model = Company::model()->with('user', 'site_categories', 'countries', 'languages', 'browsers', 'times', 'windowsVersions')->findByPk($id);\n $model = Company::model()->with(array('user'))->findByPk($id);\n\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Kamar::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = VehicleApply::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }"
] | [
"0.6482144",
"0.63159597",
"0.6145415",
"0.61148816",
"0.59933525",
"0.5915281",
"0.59019506",
"0.58878577",
"0.5876495",
"0.58350796",
"0.5823614",
"0.5811899",
"0.58065116",
"0.5804942",
"0.57786924",
"0.5764684",
"0.57392085",
"0.57196075",
"0.5712225",
"0.5712225",
"0.56908184",
"0.5686399",
"0.5670189",
"0.566892",
"0.5663051",
"0.5658835",
"0.56477296",
"0.5640386",
"0.5634077",
"0.5627319",
"0.56141275",
"0.5612025",
"0.56100875",
"0.5598644",
"0.55970955",
"0.5593325",
"0.55925584",
"0.5587107",
"0.5571948",
"0.5567808",
"0.55655456",
"0.55648106",
"0.5561316",
"0.5551567",
"0.5542227",
"0.55406153",
"0.55403614",
"0.5534468",
"0.5533712",
"0.552832",
"0.552175",
"0.55174327",
"0.5517365",
"0.55146813",
"0.55119103",
"0.55053884",
"0.550452",
"0.5490014",
"0.54864526",
"0.54814464",
"0.5475009",
"0.5467588",
"0.54673535",
"0.5466414",
"0.54636335",
"0.5455953",
"0.54542977",
"0.545346",
"0.545208",
"0.5446381",
"0.544582",
"0.54440314",
"0.543851",
"0.5435766",
"0.5433989",
"0.5431377",
"0.5430943",
"0.5427791",
"0.5426083",
"0.542526",
"0.5419404",
"0.5418088",
"0.5407966",
"0.54051536",
"0.54051536",
"0.54035574",
"0.5403329",
"0.54031813",
"0.5400288",
"0.5400077",
"0.5399572",
"0.5397551",
"0.5397105",
"0.5396547",
"0.53950536",
"0.5392135",
"0.5390174",
"0.53862214",
"0.5384473",
"0.53826535"
] | 0.7144929 | 0 |
Create a new event instance. | public function __construct(JobApplication $jobApplication, $job_application_status_company_id)
{
$this->jobApplication = $jobApplication;
$this->job_application_status_company_id = $job_application_status_company_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createEvent()\n {\n return new Event();\n }",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"public static function createEvent(array $data)\n {\n $event = new \\echolibre\\google_wave\\Model\\Event;\n \n $event->type = $data['type'];\n $event->timestamp = $data['timestamp'];\n $event->modifiedBy = $data['modifiedBy'];\n $event->properties = new \\stdClass();\n \n if (isset($data['properties'])) {\n $event->properties = $data['properties'];\n }\n \n return $event;\n }",
"public function newEvent()\n\t{\n $this->to = $this->domain;\n $this->email = $this->info_mail;\n $this->subject = 'Neue Messe gemeldet';\n $this->view = 'emails.user.new_event';\n\t\t\n\t\t$this->data = [\n\t\t\t'contact'\t\t=> \\Input::get('contact'),\n\t\t\t'email'\t\t\t=> \\Input::get('email'),\n\t\t\t'name'\t\t\t=> \\Input::get('name'),\n\t\t\t'location'\t\t=> \\Input::get('location'),\n\t\t\t'start_date'\t=> \\Input::get('start_date'),\n\t\t\t'end_date'\t\t=> \\Input::has('end_date') ? \\Input::get('end_date') : \\Input::get('start_date'),\n\t\t\t'region'\t\t=> \\Input::get('region'),\n\t\t\t'organizer'\t\t=> \\Input::get('organizer')\n\t\t];\n\n\t\treturn $this;\n\t}",
"private function createinstallevent()\n {\n $cat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar/Events');\n\n $eventArray = array(\n 'title' => $this->__('PostCalendar Installed'),\n 'hometext' => ':text:' . $this->__('On this date, the PostCalendar module was installed. Thank you for trying PostCalendar! This event can be safely deleted if you wish.'),\n 'alldayevent' => true,\n 'eventstatus' => PostCalendar_Entity_CalendarEvent::APPROVED,\n 'sharing' => PostCalendar_Entity_CalendarEvent::SHARING_GLOBAL,\n 'website' => 'https://github.com/craigh/PostCalendar/wiki',\n 'categories' => array(\n 'Main' => $cat['id']));\n\n try {\n $event = new PostCalendar_Entity_CalendarEvent();\n $event->setFromArray($eventArray);\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n } catch (Exception $e) {\n return LogUtil::registerError($e->getMessage());\n }\n\n return true;\n }",
"private function event(): Event\n {\n if (!$this->event) {\n $this->event = new Event($this->eventMutex(), '');\n }\n\n return $this->event;\n }",
"public function createEvent(string $name): Event\n {\n if (!$this->isEventIDValid($name)) {\n throw new RuntimeException('invalid event name: ' . $name);\n }\n\n $class = $this->validEventIDs[$name];\n /** @var \\CaptainHook\\App\\Event $event */\n $event = new $class($this->io, $this->config, $this->repository);\n return $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"protected function _Build_Event($context) {\r\n $form_instance = $this->form_instance;\r\n // Retrieve the event class item\r\n $class = $context['class'];\r\n // Generate a new event class\r\n $event_instance = new $class();\r\n // Populate with the form instance\r\n $event_instance->form_instance = $form_instance;\r\n // Populate with the form instance\r\n $event_instance->type = $context['type'];\r\n // Populate with the form instance\r\n $event_instance->title = $context['title'];\r\n // Populate with the event context\r\n $event_instance->context = $context;\r\n // If the field has a sanitize method\r\n if (method_exists($event_instance,'On_Create')) { $event_instance->On_Create(); }\r\n // Fire any on create action\r\n $event_instance->Do_Action('create');\r\n // Do a wordpress hook\r\n do_action('vcff_event_create',$event_instance);\r\n // Fire any on create action\r\n $event_instance->Do_Action('after_create');\r\n // Do a wordpress hook\r\n do_action('vcff_trigger_after_create',$event_instance);\r\n // Return the event instance\r\n return $event_instance;\r\n }",
"protected function __construct()\n {\n parent::__construct(\n 'Event',\n array(\n TextField::create(\n 'title',\n array(\n 'mandatory' => true,\n )\n ),\n TextareaField::create(\n 'description',\n array(\n 'use_markdown' => true,\n )\n ),\n TextField::create(\n 'date',\n array()\n ),\n ReferenceField::create(\n 'guest_lists',\n array(\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\Guestlist\\\\GuestlistModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'title',\n ),\n ),\n )\n ),\n ReferenceField::create(\n 'assignee',\n array(\n 'max' => 1,\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\User\\\\UserModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'username',\n ),\n ),\n )\n ),\n KeyValueField::create(\n 'meta',\n array(\n 'constraints' => array(\n 'value_type' => 'dynamic',\n ),\n )\n ),\n AggregateField::create(\n 'workflowTicket',\n array(\n 'modules' => array(\n '\\\\Honeybee\\\\Domain\\\\Event\\\\WorkflowTicketModule',\n ),\n )\n ),\n ),\n array(\n 'prefix' => 'event',\n 'identifier_field' => 'identifier',\n 'slugPattern' => 'event-{shortId}',\n )\n );\n }",
"public function create()\n {\n return view ('event.create');\n }",
"public function create()\n {\n return view(\"Event::create\");\n }",
"public function create_event( $eventname )\n\t{\n\t\tCmsEvents::create_event($this->get_name(), $eventname);\n\t}",
"public function createNewEvent($copyLastEvent = true, $data = array())\n\t{\n\t\t$event = new App_Model_Event();\n\n\t\t// pokud $copyLastEvent == true, vezmu data z minule udalosti a nastavim\n\t\t// je teto\n\t\tif ($copyLastEvent) {\n\t\t\t// TODO: vzit nastaveni posledni udalosti u teto akce\n\t\t}\n\n\t\t// pokud byla zaslana nejaka inicializacni data, nastavim je\n\t\tif (is_array($data) && count($data)) {\n\t\t\t$event->setPropsFromArray($data);\n\t\t}\n\n\t\t$event->setActionId($this->_actionId);\n\t\t$event->setEventNo(count($this->getAllEvents()) + 1);\n\n\t\t$event->insert();\n\n\t\t// vytvorim take prvni navrh terminu, pokud byl zaslan\n\t\tif (isset($data['dates']) && $data['dates'] != '') {\n\t\t\t$event->createNewProposal($data['dates']);\n\t\t}\n\n\t\treturn $event;\n\t}",
"public function __construct($event)\n {\n $this->event = $event;\n }",
"public function __construct($event)\n {\n $this->event = $event;\n }",
"public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n if ($this->isDirty('status') and $this->status === User::STATUS_ACTIVE) {\n $this->event_type = 'verify';\n }\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : self::URUID, // unregistered user id\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public function create()\n {\n return view('events::create_event');\n }",
"protected function create(array $data)\n {\n $user = Auth::user();\n $article = new Article($data);\n $article->userID = $user->userID;\n $article->ctgID = $data['category'];\n $article->updated_at = Carbon::now();\n $article->save();\n\n if (array_key_exists('image', $data)) {\n $path = $data['image']->store('articles/'.$article->artID, 'images');\n $article->image = $path;\n $article->save();\n }\n \n $event = new Event($data);\n if ($data['place'] !== 'none') {\n $event->placeID = $data['place'];\n }\n $event->artID = $article->artID;\n $event->save();\n \n return $event;\n }",
"public function create()\n {\n return view('events.createevent');\n }",
"public static function get_instance() \n {\n if ( ! isset(self::$instance)) \n {\n self::$instance = new Event();\n }\n\n return self::$instance;\n }",
"public function __construct(NewMessageEvent $event)\n {\n $this->event = $event;\n }",
"public function createEvent(Event $event)\n {\n $this->setCalendarId($event->calendar_id);\n\n /*\n * Create new google event object\n */\n $googleEvent = new \\Google_Service_Calendar_Event();\n\n /*\n * Set Details\n */\n $googleEvent->setSummary($event->title);\n $googleEvent->setDescription($event->description);\n $googleEvent->setLocation($event->location);\n\n /*\n * Set Start Date\n */\n $start = $this->createDateTime($event->start, $event->timeZone, $event->all_day);\n $googleEvent->setStart($start);\n\n /*\n * Set End Date\n */\n $end = $this->createDateTime($event->end, $event->timeZone, $event->all_day);\n $googleEvent->setEnd($end);\n\n /*\n * Set Recurrence Rule, make sure it's not empty\n */\n if ($event->rrule) {\n $googleEvent->setRecurrence([$event->rrule]);\n }\n\n /*\n * Create the event\n */\n $newGoogleEvent = $this->service->events->insert($this->calendarId, $googleEvent);\n\n return $this->createEventObject($newGoogleEvent);\n }",
"public function construct(CakeEvent $event) {\n\t\t$this->__startTime = time();\n\t}",
"public function create()\n {\n return view('admin.adminevent.create_event');\n }",
"protected function createEvent(DateTime $dateStart, DateTime $dateEnd)\n {\n $event = new Event();\n $event->setTitle($this->title);\n $event->setDescription($this->description);\n $event->setDateStart($dateStart);\n $event->setDateEnd($dateEnd);\n\n return $event;\n }",
"public function __construct(array $event = array())\n {\n $this\n ->setEvent($event);\n }",
"public function create(Request $request)\n {\n $data = $request->all();\n $event = Event::make($data);\n $event->user_id = Auth::user()->id;\n $event->save();\n }",
"public function create()\n {\n\n $event = new Event;\n return view('events.create',compact('event'));\n }",
"public function create()\n {\n return view('event');\n }",
"public function create()\n {\n return view('event.create');\n }",
"public function create()\n {\n return view('event.create');\n }",
"public function create()\n {\n return view('event.create');\n }",
"public function create()\n {\n return view('event.create');\n }",
"protected function getRandomInstance()\n {\n $eventLine = new EventTag();\n $this->fillThing($eventLine);\n\n return $eventLine;\n }",
"function create_event( $options=array() ){\n\t\t\t//length = 255, present\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'title_unique' => 1\n\t\t\t), $options\n\t\t);\n\t\t\n\t\tif( empty( $options['title'] ) or empty( $options['description'] ) or empty( $options['date'] ) ){\n\t\t\t$error = Core::error($this->errors, 1);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\t$values['title'] = $this->validate_title( array('title' => $options['title']) );\n\t\tif(Core::has_error( $values['title'] )){\n\t\t\treturn $values['title'] ;\n\t\t}\n\t\t\n\t\t$values['description'] = $this->validate_description( array('description' => $options['description']) );\n\t\tif(Core::has_error( $values['description'] )){\n\t\t\treturn $values['description'];\n\t\t}\n\t\t\n\t\t$values['date_time'] = $this->validate_event_date( array('date' => $options['date']) );\n\t\tif(Core::has_error( $values['date_time'] )){\n\t\t\treturn $values['date_time'];\n\t\t}\n\t\t\n\t\tif($options['title_unique']){\n\t\t\t//TODO:Check if the title unique\n\t\t\tif( Core::db_count( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => array(\n\t\t\t\t\t'title' => $values['title']\n\t\t\t\t)\n\t\t\t))){\n\t\t\t\t$error = Core::error($this->errors, 7);\n\t\t\t\t$error['error_msg'] .= 'Event title must be unique. ';\n\t\t\t\t$error['error_msg'] .= $error_append;\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$result = Core::db_insert( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => $values\n\t\t));\n\t\t\n\t\tif( Core::has_error($result) or empty($result) ){\n\t\t\t$result['error_msg'] .= $error_append;\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\t\n\t}",
"private function create()\n {\n $events = [\n Webhook::EVENT_CONVERSATION_CREATED,\n Webhook::EVENT_CONVERSATION_UPDATED,\n Webhook::EVENT_MESSAGE_CREATED,\n Webhook::EVENT_MESSAGE_UPDATED,\n ];\n\n $chosenEvents = $this->choice(\n 'What kind of event you want to create',\n $events,\n $defaultIndex = null,\n $maxAttempts = null,\n $allowMultipleSelections = true\n );\n\n $webhookUrl = $this->ask('Please enter the webhook URL'); \n\n $webhook = new Webhook();\n $webhook->events = $chosenEvents;\n $webhook->channelId = $this->whatsAppChannelId;\n $webhook->url = $webhookUrl;\n\n try {\n $response = $this->messageBirdClient->conversationWebhooks->create($webhook);\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }",
"public function createEvent(Actions $emailAction){\n $event = new Events();\n $event->type = self::$typeMap[$emailAction->type];\n $event->subtype = 'email';\n $event->associationId = $emailAction->associationId;\n $event->associationType = X2Model::getModelName($emailAction->associationType);\n $event->timestamp = time();\n $event->lastUpdated = $event->timestamp;\n $event->user = $emailAction->assignedTo;\n if($event->save())\n $this->log(Yii::t('app','Created activity feed event for the email.'));\n return $event;\n }",
"function __construct($event) {\n $this->init($event);\n }",
"public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n\t{\n\t\treturn view('events.create');\n\t}",
"protected function initEvent()\n {\n $locales = $this->container->getParameter('event.locales');\n $event = $this->getRepository('EventEventBundle:Event')->getEvent();\n $now = new \\DateTime();\n\n if (!$event) {\n $event = new Event();\n $event\n ->setTitle('My Event')\n ->setDescription('My another awesome event!')\n ->setStartDate($now)\n ->setEndDate($now->modify('+1 day'))\n ->setVenue('Burj Khalifa Tower')\n ->setEmail('[email protected]')\n ;\n\n $speaker = new Speaker();\n $speaker\n ->setFirstName('Phill')\n ->setLastName('Pilow')\n ->setCompany('Reseach Supplier')\n ;\n\n if ($locales) {\n foreach ($locales as $locale => $title) {\n $eventTranslation = new EventTranslation();\n $eventTranslation->setEvent($event);\n $eventTranslation->setlocale($locale);\n\n $this->getManager()->persist($eventTranslation);\n\n $speakerTranslation = new SpeakerTranslation();\n $speakerTranslation->setSpeaker($speaker);\n $speakerTranslation->setlocale($locale);\n\n $this->getManager()->persist($speakerTranslation);\n }\n }\n\n $this->getManager()->persist($event);\n $this->getManager()->persist($speaker);\n $this->getManager()->flush();\n }\n }",
"public function __construct($data)\n {\n $this->event = $data;\n }",
"public function create()\n {\n return view('admin.event.create');\n }",
"public function create()\n {\n return view('admin.event.create');\n }",
"public function create()\n {\n return view('event::create');\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Event;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Event']))\n\t\t{\t\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\t\n\t\t\t$model->created_on = new CDbExpression('NOW()');\n\t\t\t$model->created_by=Yii::app()->user->id;\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('view', 'id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public static function create() {}",
"public static function create() {}",
"public static function create() {}",
"public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n\t ->getStateMachine()\n ->getTransition()\n ->abortTransition()\n ->isTransitionAborted()\n // EventInterface\n ->getName()\n ->setName()\n ->getTarget()\n ->setTarget()\n ->getParams()\n ->setParams()\n ->getParam()\n ->setParam()\n ->stopPropagation()\n ->isPropagationStopped();\n\n return $mock->new();\n }",
"protected function newEventLogger()\n {\n return new EventLogger(static::getLogger());\n }",
"public function create()\n\t{\n\t\treturn View::make('events.create');\n\t}",
"public function __construct(?EventConfig $cfg = null) {}",
"public function create()\n {\n $programEvent = new ProgramEvent();\n return view('program-event.create', compact('programEvent'));\n }",
"public function create()\n {\n return view(\"admin.event_create\")->with([\n\n ]);\n }",
"public function createEvent(Request $request)\n {\n $this->validator($request->all())->validate();\n\n $event = $this->create($request->all());\n \n return redirect('/cms/events');\n }",
"public function __construct($name, $event)\n {\n $this->name = $name;\n $this->event = $event;\n }",
"final private static function makeEvent(Sincronizacao $sincronizacao)\n {\n $endpoint = self::getEventEndpoint($sincronizacao->sym_table, $sincronizacao->sym_action);\n\n $dependencies = self::getDependencies($sincronizacao);\n $eventClass = self::getEventClass($endpoint);\n\n return new $eventClass($dependencies['entry'], $dependencies['extra']);\n }",
"public static function create(Client $client, $data) {\n if ($data == null || is_array($data)) {\n $d = new Event($data == null ? array() : $data);\n $data = $d->jsonSerialize();\n }\n $req = $client->newRequest(\"POST\", \"/{accountname}/events\");\n $req->setBody($data, \"json\");\n\n $result = $req->run(\"json\");\n return Event::fromJson($result);\n }",
"public function __construct()\n {\n parent::__construct('BaseEvent');\n }",
"public function actionCreate()\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n\n\t\t$model=new Event;\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\n\t\t$attr = array(); \n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Event']))\n\t\t{\n\t\t if(isset($_POST['Event']['attributes']))\n\t\t {\n\t\t $attr = $_POST['Event']['attributes'];\n\t\t }\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save()) {\n\t\t\t\t$this->addAttributes($attr, $model);\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('create',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t\t));\n\t\t}\n\t}",
"public function create()\n {\n // $crud = new Events();\n // $crud->photo ='anniv.png';\n // $crud->title = 'Sogod Founding Anniversary Concert';\n // $crud->descriptions = 'secret';\n // $crud->venue = 'Sogod Covered Court';\n // $crud->date = date('04/02/2018');\n // $crud->time = time('h:i:s');\n\n // $crud->save(); \n }",
"public function create(){}",
"function event(): EventEmitter\n{\n return EventEmitter::getInstance();\n}",
"public function create() {}",
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"public function create()\n {}",
"public function user_can_create_event()\n {\n $user = User::factory()->create();\n $event = Event::factory()->make()->toArray();\n $response = $this->actingAs($user)->post('/events', $event);\n $response->assertStatus(302);\n $this->assertNotNull(Event::where('name', $event['name'])->first());\n }",
"private function __construct() {\n\t\t$action = isset($_GET['action']) ? sanitize_key($_GET['action']) : '';\n\t\t$copy = isset($_GET['copy']) ? intval($_GET['copy']) : 0;\n\t\tif(!empty($copy)) {\n\t\t\t$this->copy_event = new EL_Event($copy);\n\t\t\tadd_filter('get_object_terms', array(&$this, 'set_copied_categories'));\n\t\t}\n\n\t\t$this->options = &EL_Options::get_instance();\n\t\t$this->is_new = 'edit' !== $action;\n\n\t\tadd_action('add_meta_boxes', array(&$this, 'add_eventdata_metabox'));\n\t\tadd_action('edit_form_top', array(&$this, 'form_top_content'));\n\t\tadd_action('edit_form_after_title', array(&$this, 'form_after_title_content'));\n\t\tadd_action('admin_print_scripts', array(&$this, 'embed_scripts'));\n\t\tadd_action('save_post_el_events', array(&$this, 'save_eventdata'), 10, 3);\n\t\tadd_filter('enter_title_here', array(&$this, 'change_default_title'));\n\t\tadd_filter('post_updated_messages', array(&$this, 'updated_messages'));\n\t}",
"public static function create() {\n\t\t$entry = new GuestbookEntry();\n\t\t$entry->Date = SS_DateTime::now()->getValue();\n\t\t$entry->IpAddress = $_SERVER['REMOTE_ADDR'];\n\t\t$entry->Host = gethostbyaddr($entry->IpAddress);\n\t\treturn $entry;\n\t}",
"public function create()\n {\n //\n return view('events.create');\n }",
"public function create()\n\t{ \n\t\t# Return if just the countoff is needed\n\t\tif ($this->countoff<2) return;\n\t\t\n\t\t# Add a note on and note off for each beat in the click track\n\t\tfor($i=0; $i<$this->beatsTotal; $i++) { \n\t\t\t$vol = (($i%$this->timeSig)==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t}",
"public function create()\n {\n return view('adm.events.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('administrator.events.create')->with('page_title','Create New Event');\n\t\t\n\t}",
"public function run()\n {\n factory(TechnoEvent::class,10)->create();\n }",
"protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }",
"public function create(Event $event)\n {\n if ($this->shouldUseLocks($this->cache->store($this->store)->getStore())) {\n return $this->cache->store($this->store)->getStore()\n ->lock($event->mutexName(), $event->expiresAt * 60)\n ->acquire();\n }\n\n return $this->cache->store($this->store)->add(\n $event->mutexName(), true, $event->expiresAt * 60\n );\n }",
"public function createEvents()\n {\n //\n\n return 'something';\n }",
"public function create() {\n\t \n }",
"public function actionCreate()\n\t{\n\t\t$model=new Events;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->event_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function create()\n {\n return view('events.create');\n }",
"public function create()\n {\n return view('events.create');\n }",
"public function create()\n {\n return view('events.create');\n }",
"public function create()\n {\n return view('events.create');\n }",
"public function create()\n {\n return view('events.create');\n }",
"public function create()\n {\n return view('events.create');\n }",
"function add_new_event($eventName, $eventColor){\n\t\tif( isset($_POST[$eventName]) ){\n\t\t\tglobal $base;\n\t\t\t\n\t\t\t$title \t= $_POST[$eventName];\n\t\t\t$color \t= $_POST[$eventColor];\n\n\t\t\t$full_calendar_notifications = new full_calendar_notification();\n\n\t\t\t$full_calendar_notifications->user_id = $base->clear_string($_SESSION['user_id']);\n\t\t\t$full_calendar_notifications->notification_title = $title;\n\t\t\t$full_calendar_notifications->notification_color = $color;\n\n\t\t\t$full_calendar_notifications->create();\n\t\t}\n\t}",
"public function initialize()\n {\n // attributes\n $this->setName('event');\n $this->setPhpName('Event');\n $this->setClassname('ArtRequestORM\\\\Event');\n $this->setPackage('ArtRequest');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('EVENT_ID', 'EventId', 'INTEGER', true, null, null);\n $this->addColumn('EVENT_TITLE', 'EventTitle', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_DESCRIPTION', 'EventDescription', 'LONGVARCHAR', true, null, null);\n $this->addColumn('EVENT_LOCATION', 'EventLocation', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_SPONSOR_NAME', 'EventSponsorName', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_START_TIME', 'EventStartTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_END_TIME', 'EventEndTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_START_DATE', 'EventStartDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_END_DATE', 'EventEndDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_PRICING_MEMBER', 'EventPricingMember', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STAFF', 'EventPricingStaff', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STUDENT', 'EventPricingStudent', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_PUBLIC', 'EventPricingPublic', 'DECIMAL', true, null, null);\n // validators\n }",
"public static function create_event($pid, $event) \n\t\t{\t\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t\n\t\t\t// insert event\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('INSERT INTO event (title, owner, gowner, start_time, end_time, location, logo, description, category, size, tag, price) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);');\n\t\t\t$stmt->bind_param('siisssssiisd', $event['title'], $pid, $gid, $event['start_time'], $event['end_time'], $event['location'], $event['logo'], $event['description'], $event['category'], $event['size'], $event['tag'], $event['price']);\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t// get auto generated id\n\t\t\t$eid = $mysqli->insert_id;\n\t\t\t\n\t\t\t$stmt->close();\n\t\t\t\n\t\t\t// grant user host role\n\t\t\tPeopleDAO::set_event_role_pid($pid, $eid, Role::Owner);\n\t\t\treturn $eid;\n\t\t}",
"public static function create_event( $module_name, $event_name )\n\t{\n\t\t$event = cms_orm('CmsDatabaseEvent')->find_by_module_name_and_event_name($module_name, $event_name);\n\t\tif ($event == null)\n\t\t{\n\t\t\t$event = new CmsDatabaseEvent();\n\t\t\t$event->module_name = $module_name;\n\t\t\t$event->event_name = $event_name;\n\t\t\treturn $event->save();\n\t\t}\n\t}",
"public function create()\n {\n return view('admin.events.create');\n }",
"public function create()\n {\n return view('admin.events.create');\n }",
"public function create()\n {\n return view('admin.events.create');\n }",
"public function create()\n {\n return view('admin.events.create');\n }"
] | [
"0.8178475",
"0.73455495",
"0.67515916",
"0.6665345",
"0.66544545",
"0.66479546",
"0.6640835",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6543442",
"0.64682955",
"0.645909",
"0.64520663",
"0.6441302",
"0.6438299",
"0.63917476",
"0.6371641",
"0.6371641",
"0.63478637",
"0.63475716",
"0.63285524",
"0.6319918",
"0.63108855",
"0.6275116",
"0.6206908",
"0.6195245",
"0.6193101",
"0.61870754",
"0.61810726",
"0.61807376",
"0.612506",
"0.612064",
"0.61166775",
"0.6116489",
"0.6116489",
"0.6116489",
"0.6116489",
"0.6111236",
"0.6099429",
"0.6076598",
"0.6072973",
"0.6068453",
"0.60566765",
"0.6056391",
"0.6041123",
"0.6033919",
"0.60277027",
"0.60277027",
"0.60181046",
"0.6014412",
"0.6007521",
"0.6007521",
"0.6007521",
"0.5998441",
"0.59855086",
"0.5971869",
"0.5971259",
"0.59670085",
"0.5959153",
"0.59413785",
"0.59338146",
"0.5930427",
"0.5917219",
"0.5907522",
"0.59049624",
"0.58941996",
"0.58838826",
"0.5868322",
"0.58614963",
"0.58599705",
"0.5856868",
"0.58510625",
"0.5838314",
"0.58332664",
"0.5826795",
"0.58255696",
"0.58250695",
"0.5822382",
"0.58223313",
"0.58191884",
"0.58166337",
"0.5807514",
"0.5798503",
"0.57970744",
"0.5794831",
"0.5794831",
"0.5794831",
"0.5794831",
"0.5794831",
"0.5794831",
"0.579301",
"0.5784509",
"0.5783719",
"0.5780148",
"0.57786983",
"0.57786983",
"0.57786983",
"0.57786983"
] | 0.0 | -1 |
Get the channels the event should be broadcast on. | public function broadcastOn()
{
return [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChannels()\n {\n return $this->channels;\n }",
"public function getChannels();",
"public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }",
"public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }",
"public function get_channels()\n {\n }",
"public function broadcastOn()\n {\n return ['my-channel'];\n }",
"public function getChannels()\n {\n return $this->Channels;\n }",
"public function broadcastOn()\n {\n return ['channel-status'];\n }",
"public function channels()\n {\n return $this->send('channels');\n }",
"public function all(): array\n {\n return $this->channels;\n }",
"public function getAllChannels()\n {\n return $this->_channel;\n }",
"public function channels(){\n return $this->channelCollection->map(function ($item, $key) {\n return ['channel' => $item['channel']];\n });\n }",
"public function broadcastOn()\n {\n return ['whatcanido-channel'];\n }",
"public function onChannels(): ?array\n {\n return null;\n }",
"public function broadcastOn()\n {\n return [\n new Channel('sanityDeployment.' . $this->sanityDeployment->id),\n new Channel('sanityMainRepo.' . $this->sanityDeployment->sanityMainRepo->id),\n ];\n }",
"public function getNotificationChannels()\n {\n if (array_key_exists(\"notificationChannels\", $this->_propDict)) {\n return $this->_propDict[\"notificationChannels\"];\n } else {\n return null;\n }\n }",
"public function broadcastOn() {\n return [\n new Channel('messages.' . $this->userReceiver->id . '.' . $this->currentUser->email),\n new Channel('messages.' . $this->currentUser->id . '.' . $this->userReceiver->email),\n ];\n }",
"public function broadcastOn()\n {\n return [new Channel('abinachess_move.' . $this->uid)];\n }",
"public function getSupplyChannels();",
"public function getDistributionChannels();",
"public function getChannels()\n\t{\n\t\t$channels = App::make('ChannelRepository')->getChannels();\n\t\t\n\t\treturn App::make('Apiv1\\Transformers\\ChannelTransformer')->transformCollection($channels, $this->user);\n\t}",
"public function getAllChannels()\n {\n return Channel::all();\n }",
"public function broadcastOn()\n {\n return ['laravue-channel'];\n }",
"public static function getChannels($aspect)\n {\n return self::getMetaProperty($aspect, 'channel');\n }",
"public function broadcastOn()\n {\n\n return [];\n }",
"public function getDistributionChannels()\n {\n return $this->distributionChannels;\n }",
"public function getIncludeChannels()\n {\n return $this->include_channels;\n }",
"public function broadcastOn()\n {\n return [\n new PrivateChannel('private-chat-channel.' . $this->message->receiver),\n new PrivateChannel('private-chat-channel.' . $this->message->sender)\n ];\n }",
"public function getChannels()\n {\n $size = $this->getImageSize();\n\n return $size['channels'];\n }",
"public function broadcastOn()\n {\n return [config('messenger.redis_channel', 'notification')];\n }",
"public function channels()\n {\n $payloads = [\n 'code' => $this->channelCode,\n ];\n\n return $this->request('get', 'merchant/payment-channel', $payloads);\n }",
"public function getOrderChannels()\n\t{\n\t\t$request = $this->request('order_channels');\n\n\t\tif (!$request) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$decoded = $request->asArray();\n\t\treturn $decoded['data'];\n\t}",
"public function getWallChannels()\n {\n return $this->wallChannels;\n }",
"public function broadcastOn()\n {\n\n return new Channel('channels-broadcasts');\n\n //return new PrivateChannel('channel-name');\n }",
"public function getAllChannels()\n {\n return Channel::with('subChannel.display')->active()->alive()->get()->toArray();\n }",
"public function viaNotificationChannels()\n {\n return UserNotificationChannel::with('notification_channel')->get()->filter(function ($item) {\n return $item->muted_at == null;\n })->pluck('notification_channel.name');\n }",
"public function broadcastOn()\n {\n return ['channel-name-'.$this->inputBy, 'channel-name-'.$this->kodeOrganisasi, 'channel-name-main-admin'];\n }",
"function getActiveChannels() {\n global $debug, $logdir, $logfile, $app;\n\n $channels = null;\n $model = $app->bootstrap->getModel('channels');\n\n $now = date(\"Y-m-d H:i:s\");\n $query = \"SELECT\"\n .\" ch.id,\"\n .\" ch.starttimestamp,\"\n .\" ch.endtimestamp,\"\n .\" ch.title,\"\n .\" ch.isliveevent,\"\n .\" lf.id AS locationid,\"\n .\" lf.name AS locationname,\"\n .\" lf.issecurestreamingforced,\"\n .\" lf.indexphotofilename,\"\n .\" lfs.id AS livefeedstreamid,\"\n .\" lfs.qualitytag AS streamname,\"\n .\" lfs.keycode AS streamid,\"\n .\" lfs.contentkeycode AS contentstreamid\"\n .\" FROM\"\n .\" channels AS ch,\"\n .\" livefeeds AS lf,\"\n .\" livefeed_streams AS lfs\"\n .\" WHERE\"\n .\" ch.starttimestamp <= '\" . $now . \"' AND\"\n .\" ch.endtimestamp >= '\" . $now . \"' AND\"\n .\" ch.id = lf.channelid AND\"\n .\" lf.id = lfs.livefeedid AND\"\n .\" lf.issecurestreamingforced = 0\"\n .\" ORDER BY\"\n .\" ch.id\";\n\n try {\n $rs_channels = $model->safeExecute($query);\n $channels = $rs_channels->GetArray();\n } catch (Exception $err) {\n $debug->log($logdir, $logfile, \"[ERROR] SQL query failed (\". $err->getTraceAsString() .\")\\nSQL QUERY:\\n'\". trim($query) .\"'\", false);\n return false;\n }\n\n // Check if any record returned\n if (count($channels) < 1) { return false; }\n\n return $channels;\n}",
"public function broadcastOn()\n {\n // Have no idea about this\n // return new PrivateChannel('channel-name');\n }",
"public function broadcastOn()\n {\n// return new PrivateChannel('news-action');\n// return ['news-action'];\n return new Channel('news-action.');\n }",
"public function broadcastOn()\n {\n return new Channel('chess');\n }",
"public function getSupplyChannels()\n {\n return $this->supplyChannels;\n }",
"public function broadcastOn() {\n// return new PrivateChannel('channel-name');\n }",
"public function broadcastOn()\n {\n// return new PrivateChannel('channel-name');\n }",
"public function broadcastOn()\n {\n// return new PrivateChannel('channel-name');\n }",
"public function getAudioChannels() {}",
"public function broadcastOn()\n {\n return new Channel('countries');\n }",
"public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }",
"public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }",
"public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }",
"public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }",
"public function broadcastOn()\n {\n return ['CFSite'];\n }",
"public function channels()\n {\n $this->send(['command' => 'channels', 'seq'=>$this->getSequence()]);\n }",
"public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'rocket_buffer' => [\r\n\t\t\t\t[ 'extract_ie_conditionals', 1 ],\r\n\t\t\t\t[ 'inject_ie_conditionals', 34 ],\r\n\t\t\t],\r\n\t\t];\r\n\t}",
"public function getChannels(){\n\t\t//TODO: Change query\n\t\t$query = sprintf(\"SELECT idChannel FROM Channels limit 1\");\n\n\t\t$this->dbObj->Query($query);\n\n\t\tif ($this->dbObj->numErr) {\n\t\t\t$this->parent->SetError(5);\n\t\t}\n\n\t\t$out = NULL;\n\t\twhile (!$this->dbObj->EOF) {\n\t \t\t$out[] = $this->dbObj->GetValue(\"idChannel\");\n\t\t\t$this->dbObj->Next();\n\t\t}\n\n\t \treturn $out;\n\t}",
"public function via($notifiable)\n {\n $channels = [];\n if ($notifiable->setting->is_bid_cancelled_notification_enabled) {\n $channels = ['database']; // note: no Messenger yet like the other one's. App is still not approved, and there's the business registration requirement so..\n \n if ($notifiable->fcm_token) {\n $channels[] = FcmChannel::class;\n }\n }\n return $channels;\n }",
"public function broadcastOn() {\n return ['convertVideoAction'];\n }",
"private function getChannels()\r\n {\r\n static $channels;\r\n\r\n if (empty($channels)) {\r\n // Store the cache forever.\r\n $cache_key = 'categoryFirst';\r\n $channels = \\SCache::sear($cache_key, function () {\r\n $categories = $this->all();\r\n $channels = [];\r\n foreach ($categories as $category) {\r\n if ($category['bclassid'] == 0) {\r\n $channels[] = $category;\r\n }\r\n }\r\n return $channels;\r\n });\r\n }\r\n\r\n return $channels;\r\n }",
"public static function getChannels() {\n\t\t$channels = [];\n\t\ttry {\n\t\t\t$mapper = new ObjectMapper();\n\t\t\t$response = self::getResponse();\n\t\t\t$data = json_decode( $response, true );\n\t\t\tif ( count( $data['Channels'] ) > 0 ) {\n\t\t\t\tforeach ( $data['Channels'] as $dataProject ) {\n $channels[] = $mapper->mapJson( json_encode( $dataProject ), Channel::class );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\treturn $channels;\n\t}",
"public function broadcastOn()\n {\n return [$this->reciever_id];\n }",
"public static function get_subscribed_events() {\r\n\t\t$current_theme = wp_get_theme();\r\n\r\n\t\tif ( 'Bridge' !== $current_theme->get( 'Name' ) ) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn [\r\n\t\t\t'rocket_lazyload_background_images' => 'disable_lazyload_background_images',\r\n\t\t\t'update_option_qode_options_proya' => [ 'maybe_clear_cache', 10, 2 ],\r\n\t\t];\r\n\t}",
"public function broadcastOn()\n {\n // return new PrivateChannel('channel-name');\n return new Channel('messages');\n }",
"public function list_channels($exclude_archived=true) {\n\n $method=\"channels.list\";\n $payload['exclude_archived'] = $exclude_archived;\n\n $result = $this->apicall($method, $payload);\n if (isset($result['channels'])) {\n return $result['channels'];\n } else {\n return false;\n }\n }"
] | [
"0.7449813",
"0.7367057",
"0.7359504",
"0.7359504",
"0.72011125",
"0.7173089",
"0.7115883",
"0.7101729",
"0.706744",
"0.70430064",
"0.7023131",
"0.69550014",
"0.69529486",
"0.69211733",
"0.68433154",
"0.6804953",
"0.6757097",
"0.6730202",
"0.6713746",
"0.6648456",
"0.6570507",
"0.65700614",
"0.6558977",
"0.65228224",
"0.6442259",
"0.64401245",
"0.64250326",
"0.6352445",
"0.6338366",
"0.6333816",
"0.6305866",
"0.627142",
"0.62373805",
"0.62352455",
"0.6219516",
"0.6174791",
"0.61673695",
"0.6164551",
"0.61515486",
"0.61087865",
"0.6089762",
"0.6078134",
"0.60759175",
"0.606651",
"0.606651",
"0.60567176",
"0.6055516",
"0.6042447",
"0.6042447",
"0.6042447",
"0.6042447",
"0.6037436",
"0.6017018",
"0.60164857",
"0.6002094",
"0.5989761",
"0.597125",
"0.5964332",
"0.5948799",
"0.5940253",
"0.5936624",
"0.59203994",
"0.591012"
] | 0.6462908 | 61 |
Make call to application... | public function testDatabase()
{
$user = factory(App\User::class)->create();
$user = factory(App\User::class)->create([
'name' => 'Abigail',
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function call();",
"public function call();",
"public function launch() {\n\t\t$controller = ucfirst($this->getController());\n\t\t$method = $this->getMethod();\n\t\t\n\t\tif (file_exists(APPPATH . 'modules/' . $controller . '.php') === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\tinclude_once(APPPATH . 'modules/' . $controller . '.php');\n\t\t\n\t\tif (class_exists($controller) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\n\t\t$app = new $controller();\n\t\t\n\t\tif (method_exists($app, $method) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\t\n\t\t$app->$method();\n\t}",
"function call()\n{\n\t// Get all the arguments passed\n\t$args = func_get_args();\n\t\n\t// Get the first argument, it's expected to be class::method\n\t$call = array_shift($args);\n\n\t// Pass the class and method to these variables\n\tlist($class, $method) = explode('::', $call);\n\t\n\ttry\n\t{\n\t\t// Get the prefix oc the current application\n\t\t$requestclass = Request::current()->extension_prefix.$class;\n\n\t\t// Call the the method based on the current application\n\t\treturn call_user_func_array(array($requestclass, $method), $args);\n\t}\n\tcatch(Exception $e1)\n\t{\n\t\t// Try again, but this time, let's call it without the application prefix. This Will look for the class in the module paths.\n\t\ttry\n\t\t{\n\t\t\t// Call the the method based on the current application\n\t\t\treturn call_user_func_array(array($class, $method), $args);\n\t\t}\n\t\tcatch(Exception $e1)\n\t\t{\n\t\t\t// Return Null if the call fails. TODO: Throw a better exception\n\t\t\treturn NULL;\n\t\t}\n\t}\n}",
"function execute()\n\t{\t\n\t\t// Check for requested action\n\t\t$app_action = isset($_REQUEST['ax']) ? $_REQUEST['ax'] : 'startup_view';\n\t\t\n\t\tif(method_exists($this,$app_action))\n\t\t{\n\t\t\t// Call requested action\n\t\t\t$this->$app_action();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->default_action($app_action);\n\t\t}\n\t}",
"public function invoke();",
"public function run()\n\t{\n\n\t\t//excute request routing\n\t\t$this->request = new Request($this);\n\n\t\t$module = $this->load_module();\n\n\t\tif ($module !== false) {\n\n\t\t\t$className = $this->load_controller($module);\n\n\t\t\tif ($className !== false) {\n\n\t\t\t\t$controller = new $className();\n\t\t\t\t$response = $this->call_function($controller);\n\t\t\t\tif (is_array($response)) {\n\t\t\t\t\tResponse::show($response);\n\t\t\t\t} else {\n\t\t\t\t\tResponse::show(array(\n\t\t\t\t\t\t\t$response\n\t\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tResponse::show(array(\n\t\t\t\t\t\t'status'\t=> false,\n\t\t\t\t\t\t'message'\t=> 'Application controller required.'\n\t\t\t\t\t), 404);\n\t\t\t}\n\n\t\t} else {\n\t\t\tResponse::show(array(\n\t\t\t\t\t'status'\t=> false,\n\t\t\t\t\t'message'\t=> 'Application module required.'\n\t\t\t\t), 404);\n\t\t}\n\n\t}",
"function run() {\n global $url;\n session_start();\n\n if (class_exists('AppHelper')) {\n $url = AppHelper::validate_and_authorize($url);\n } else {\n error_log ('this app has no AppHandler defined, hence no secutiy ');\n }\n\n # Parse our 3 part URL\n # Format: controller[/action[.type][/query_string]] \n # Example: login/get/3\n # Example: login/listall.json\n list($controller, $action, $content_type, $query_string) = parse_rest_url($url);\n\n $controller = ucwords($controller).'Controller';\n $dispatch = new $controller($action, $content_type);\n\n if ((int)method_exists($controller, $action)) {\n call_user_func_array(array($dispatch,$action),array($query_string));\n } else {\n AppHelper::not_found($dispatch, $url); \n }\n}",
"protected function callFromConsole()\n {\n array_shift($_SERVER['argv']);\n\n $this->application->run(new ArgvInput($_SERVER['argv']), new ConsoleOutput());\n }",
"function application();",
"protected function callService ()\n\t{\n\t\t$this->protocol->callService( $this->data ) ;\n\t}",
"public function launchApp()\n {\n if ($this->findAppPort()) {\n return;\n }\n\n exec('open ' . self::APP_LAUNCH_URL);\n\n while (!$this->findAppPort()) {\n sleep(2);\n }\n }",
"public function call()\n {\n // TODO: Implement call() method.\n }",
"public function run()\n {\n // $this->call\n }",
"public function call()\n {\n $env = $this->application->environment();\n if (isset($env['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n // Header commonly used by Backbone.js and others\n $env['light.method_override.original_method'] = $env['REQUEST_METHOD'];\n $env['REQUEST_METHOD'] = strtoupper($env['HTTP_X_HTTP_METHOD_OVERRIDE']);\n } elseif (isset($env['REQUEST_METHOD']) && $env['REQUEST_METHOD'] === 'POST') {\n // HTML Form Override\n $req = new \\Light\\Http\\Request($env);\n $method = $req->post($this->configs['key']);\n if ($method) {\n $env['light.method_override.original_method'] = $env['REQUEST_METHOD'];\n $env['REQUEST_METHOD'] = strtoupper($method);\n }\n }\n $this->next->call();\n }",
"public function launch()\n {\n global $interface;\n global $configArray;\n\n if (isset($_POST['submit'])) {\n $process = $this->_processSubmit();\n }\n\n // Display Page\n if (isset($_GET['lightbox'])) {\n return $this->_processLightbox();\n } else {\n $this->_processNonLightbox();\n }\n }",
"function api_call(){\n\n\t\t$p = App::$cmd;\n\t\t$type = null;\n\n\t\tif(strrpos($p,'.')) {\n\t\t\t$type = substr($p,strrpos($p,'.')+1);\n\t\t\tif(strpos($type,'/') === false) {\n\t\t\t\t$p = substr($p,0,strrpos($p,'.'));\n\t\t\t\t// recalculate App argc,argv since we just extracted the type from it\n\t\t\t\tApp::$argv = explode('/',$p);\n\t\t\t\tApp::$argc = count(App::$argv);\n\t\t\t}\n\t\t}\n\n\t\tif((! $type) || (! in_array($type, [ 'json', 'xml', 'rss', 'as', 'atom' ])))\n\t\t\t$type = 'json';\n\n\t\t$info = \\Zotlabs\\Lib\\Api_router::find($p);\n\n\t\tif(in_array($type, [ 'rss', 'atom', 'as' ])) {\n\t\t\t// These types no longer supported.\n\t\t\t$info = false;\n\t\t}\n\n\t\tlogger('API info: ' . $p . ' type: ' . $type . ' ' . print_r($info,true), LOGGER_DEBUG,LOG_INFO);\n\n\t\tif($info) {\n\n\t\t\tif ($info['auth'] === true && api_user() === false) {\n\t\t\t\t\tapi_login($a);\n\t\t\t}\n\n\t\t\tload_contact_links(api_user());\n\n\t\t\t$channel = App::get_channel();\n\n\t\t\tlogger('API call for ' . $channel['channel_name'] . ': ' . App::$query_string);\n\t\t\tlogger('API parameters: ' . print_r($_REQUEST,true));\n\n\t\t\t$r = call_user_func($info['func'],$type);\n\n\t\t\tif($r === false) \n\t\t\t\treturn;\n\n\t\t\tswitch($type) {\n\t\t\t\tcase 'xml':\n\t\t\t\t\theader ('Content-Type: text/xml');\n\t\t\t\t\treturn $r; \n\t\t\t\t\tbreak;\n\t\t\t\tcase 'json':\n\t\t\t\t\theader ('Content-Type: application/json');\n\t\t\t\t\t// Lookup JSONP to understand these lines. They provide cross-domain AJAX ability.\n\t\t\t\t\tif ($_GET['callback'])\n\t\t\t\t\t\t$r = $_GET['callback'] . '(' . $r . ')' ;\n\t\t\t\t\treturn $r; \n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\n\t\t$x = [ 'path' => App::$query_string ];\t\n\t\tcall_hooks('api_not_found',$x);\n\n\t\theader('HTTP/1.1 404 Not Found');\n\t\tlogger('API call not implemented: ' . App::$query_string . ' - ' . print_r($_REQUEST,true));\n\t\t$r = '<status><error>not implemented</error></status>';\n\t\tswitch($type){\n\t\t\tcase 'xml':\n\t\t\t\theader ('Content-Type: text/xml');\n\t\t\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" . $r;\n\t\t\t\tbreak;\n\t\t\tcase \"json\":\n\t\t\t\theader ('Content-Type: application/json');\n\t\t\t return json_encode(array('error' => 'not implemented'));\n\t\t\t\tbreak;\n\t\t\tcase \"rss\":\n\t\t\t\theader ('Content-Type: application/rss+xml');\n\t\t\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" . $r;\n\t\t\t\tbreak;\n\t\t\tcase \"atom\":\n\t\t\t\theader ('Content-Type: application/atom+xml');\n\t\t\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" . $r;\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private function launcher() {\n \n $controller = $this->controller;\n $task = $this->task;\n \n if (!isset($controller)) {\n $controller = 'IndexController';\n }\n else {\n $controller = ucfirst($controller).'Controller';\n }\n \n if (!isset($task)) {\n $task = 'index';\n }\n \n $c = new $controller();\n \n call_user_func(array($c, $task));\n \n Quantum\\Output::setMainView($this->controller, $task);\n \n\n }",
"public function run()\r\n\t{\r\n\t\t// function http_build_query ($query_data, $numeric_prefix = null, $arg_separator = null, $enc_type = PHP_QUERY_RFC1738);\r\n\t\t/**\r\n\t\t * @link http://php.net/manual/en/function.http-build-query.php\r\n\t\t */\r\n\t\t$url = '/' . ((isset($_GET['param'])) ? $_GET['param'] : '');\r\n\t\t$params = array();\r\n\r\n\t\tif (!empty($url) && $url != '/') {\r\n\r\n\t\t\t$url = explode('/', $url);\r\n\t\t\tarray_shift($url);\r\n\r\n\t\t\t$currentController = $url[0] . 'Controller';\r\n\t\t\tarray_shift($url);\r\n\r\n\t\t\tif (isset($url[0])) {\r\n\t\t\t\t$currentAction = $url[0];\r\n\t\t\t\tarray_shift($url);\r\n\t\t\t} else {\r\n\t\t\t\t$currentAction = 'index';\r\n\t\t\t}\r\n\r\n\t\t\tif (count($url) > 0) {\r\n\t\t\t\t$params = $url;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif (empty($url) || $url == '/') {\r\n\t\t\t$currentController = 'homeController';\r\n\t\t\t$currentAction = 'index';\r\n\t\t}\r\n\r\n\t\trequire_once __DIR__ . 'core/Controller.php';\r\n\r\n\t\t$instanceController = new $currentController();\r\n\r\n\t\t$arrayControllerAndAction = array($instanceController, $currentAction);\r\n\r\n\t\tcall_user_func_array($arrayControllerAndAction, $params);\r\n\t}",
"public function run() \n\t{\n\t\tcall_user_func_array(array(new $this->controller, $this->action), $this->params);\t\t\n\t}",
"function main()\n{\n runGetFeature();\n runListFeatures();\n runRecordRoute();\n runRouteChat();\n}",
"static function start($app_directory = NULL, $arg = NULL) {\n \n matrix::get_status();\n avr::status();\n \n self::$script_command = $app_directory . '/third_party/kb/builds/rtl443/build/src/rtl_433 -a -D 2>&1';\n self::$process = proc_open(self::$script_command, self::$descriptorspec, self::$pipes);\n\n if (is_resource(self::$process)) {\n while (!self::$do_quit && !feof(self::$pipes[1])) {\n $in = fgets(self::$pipes[1]);\n $trimmed = trim($in);\n self::process_input($trimmed);\n }\n } else {\n itach::l('NOT RESOURCE....');\n }\n }",
"function start_application() {\n\t// The SAPI type is cgi-fcgi when accessed from the browser.\n\tif (PHP_SAPI === 'cgi-fcgi') {\n\t\t// Force secure site.\n\t\tif (FORCE_SECURE) {\n\t\t\tredirect_to_https();\n\t\t}\n\t}\n\n\trequire ABSPATH . 'vendor/autoload.php';\n\n\t// Make sure OpenOffice is running.\n\t// start_openoffice();\n\n\t// Include base classes.\n\tinclude_classes();\n\n\t// Include controllers.\n\tinclude_controllers();\n\n\t// Activate query string parameters.\n\tinclude_query_string();\n}",
"abstract public function doAction($argv);",
"public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }",
"function DoAppCommand($cmd,$val,&$app_command_obj)\n {\n return false;\n }",
"public static function call(){\n\t\t\t$request = self::get_request();\n\t\t\t$method = self::get_method();\n\t\t\t\n\t\t\t$callback_information = self::route($method, $request);\n\t\t\t$callback = $callback_information[0];\n\t\t\t$params = $callback_information[1];\n\n\t\t\t// Start an output buffer, execute the callback function for our route, and store all the captured output in $body:\n\t\t\tob_start();\n\n\t\t\t\tif(count($params) == 0)\n\t\t\t\t\tcall_user_func($callback);\n\t\t\t\telse\n\t\t\t\t\tcall_user_func($callback, $params);\n\t\t\t\t\n\t\t\t\tif (self::$body == '')\n\t\t\t\t\tself::$body = ob_get_contents();\n\t\t\t\t\n\t\t\tob_end_clean();\n\t\t}",
"public function invoke()\r\n\t{\r\n\t\tif(isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$pageName = $_GET['page'];\r\n\t\t\t$this->loadPage($pageName);\r\n\t\t}\r\n\t\telseif(!isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$this->loadPage('home');\r\n\t\t}\r\n\t}",
"protected function callActionMethod() {}",
"public function call()\n {\n $controllerClass = self::toClass( $this->controller );\n $actionMethod = self::toMethod( $this->action );\n \n $controllerClass::$actionMethod( $this, $this->params );\n }",
"public function run(){\n $this->session->start();\n $this->request->prepareUrl();\n $this->file->require('App/index.php');\n list($controller,$method,$arguments) = $this->route->getProperRoute();\n }",
"function run($app) {\n //check routing\n\n $list=$this->segment->get_list();\n $path=\"\";\n //remove first array because it's router\n for($route=1;$route<count($list);$route++)\n {\n $path.=\"/\".$list[$route];\n }\n\n if(count($_GET)>1) {\n $path=strstr($path,\"?\",true);\n }\n \n $path=$this->remove_end_slash($path);\n\n //init for home\n if($path==\"\") $path=\"/\";\n\n //init the route\n $route=array();\n\n //check method\n if($this->io->method==\"GET\")\n {\n $route=$this->getRoute;\n }\n else if($this->io->method==\"POST\")\n {\n $route=$this->postRoute;\n }\n else if($this->io->method==\"PUT\")\n {\n $route=$this->putRoute;\n }\n else if($this->io->method==\"DELETE\")\n {\n $route=$this->deleteRoute;\n }\n\n if(isset($route[$path]))\n {\n \n //without param / , /username\n $function=$route[$path];\n //check it's array or not\n if (is_array($function))\n {\n foreach ($function as $fun) {\n $this->callFunction($app,$fun);\n }\n }\n else {\n $functions = explode(\",\", $function);\n foreach ($functions as $fun) {\n $this->callFunction($app,$fun);\n } \n }\n \n }\n else {\n //with param /:id , /:username\n if (count($route)) {\n $this->callFunctionWithParam($app,$route,$path);\n }\n else {\n $this->load->notfound_err(\"Need to config path in config/config.php. or Path \");\n }\n }\n \n }",
"public abstract function exec();",
"function callMethod() {\n $params = array();\n return $this->callServer(\"callMethod\", $params);\n }",
"public function launch() {\r\n\t\t// Check if the requested class exists\r\n\t\tif(class_exists($this->class)) {\r\n\t\t\t// It is, create a new instance\r\n\t\t\t$this->action_instance = new $this->class($this);\r\n\t\t\t\r\n\t\t\t// Check for action authentication\r\n\t\t\tif( !$this->action_instance->checkAuth() ) {\r\n\t\t\t // Authentication failed! Terminate the script\r\n\t\t\t error('no_auth');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if the requested method exists\r\n\t\t\tif( is_callable(array($this->action_instance, $this->method))) {\r\n\t\t\t\t// It is, launch it\r\n\t\t\t\t$this->action_instance->{$this->method}();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// The requested method does not exist, display an error\r\n\t\t\t\treturn error('The requested method does not exist!', false);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// The requested class does not exist, display an error\r\n\t\t\treturn error('The requested controller does not exist!', false);\r\n\t\t}\r\n\t}",
"public function run()\n {\n call_user_func_array(array(new $this->controller, $this->action), $this->params);\n }",
"public function call()\n {\n // Get the reference to the application\n $app = $this->app;\n\n // Get the application request without trailing slashes \n $requesturi = ltrim($app->request->getPathInfo(), '/');\n\n if($requesturi != 'unauthorized') {\n // Check if the user is authorized to execute this request\n if(!Security::isUserAuthorized($requesturi)) {\n $app->redirect('/unauthorized');\n }\n }\n\n // Run the inner middleware and application\n $this->next->call();\n }",
"public function callPageRunCmd()\n {\n $script = $this->rootDir . '/excmd/asrorz.php';\n $params = 'cores/page/run --app=' . $this->newName;\n $phpcmd = 'php ' . $script . ' ' . $params;\n Az::debug($phpcmd, 'command to launch: ');\n $r = shell_exec($phpcmd);\n Az::debug($phpcmd, 'command executed: ');\n Az::debug($r, 'command result: ');\n }",
"static public function run() {\n\n $session = Application::getInstance(\"session\");\n\n /**\n * Check if this is an API Call\n */\n $request = explode('/', trim(array_key_exists(\"PATH_INFO\",$_SERVER) ? $_SERVER[\"PATH_INFO\"] : \"\",'/'));\n $isAPICall = ($request[0] == \"api\");\n $basicAuth = false;\n\n if ($isAPICall) {\n\n if ($session->isAuth || isset($_SERVER['PHP_AUTH_USER'])) {\n\n if (isset($_SERVER['PHP_AUTH_USER'])) {\n\n $basicAuth = true;\n\n $email = $_SERVER['PHP_AUTH_USER'];\n $password = $_SERVER['PHP_AUTH_PW'];\n\n if (!$session->auth($email, $password)) {\n http_response_code(401);\n return;\n }\n\n }\n\n $api = Application::getInstance(__NAMESPACE__ . \"\\\\API\");\n $api->call();\n\n if ($basicAuth) {\n $session->closeMySession();\n }\n } else {\n http_response_code(403);\n return;\n }\n\n } else {\n $page = Application::getInstance(\"page\");\n\n $page->init();\n $page->work();\n $page->render();\n\n }\n\n\n }",
"public function requestRun()\n {\n }",
"function startApplication(){\n\n\t// name space all the stuff for the application\n\t$_SESSION[ SESSION_NAME_SPACE ] = array();\n\t$_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ] = getcwd();\n\t$_SESSION[ SESSION_NAME_SPACE ][ 'factory' ] = new Factory();\n\n\t// lets output a message that the application has been reloaded.\n\t$initViewState = getFactory()->getBean( 'ViewState' );\n\t$initViewState->setResponse('Application Started at: ' . date( 'l jS \\of F Y h:i:s A' ), 'warning');\n\tsetViewState( $initViewState );\n}",
"public function proxyAction()\n {\n $action = $this->getParam('call');\n $this->forward($action);\n }",
"public final function run()\n\t{\n\t\t$controllerClass = ucfirst(App::request()->getControllerName());\n\t\t$actionName = App::request()->getActionName().Request::ACTION_SUFFIX;\n\n\t\t$this->_execute($controllerClass, $actionName);\n\t}",
"public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }",
"public function invoke() {\r\n $this->action = Util::getAction($this->action);\r\n \r\n switch ($this->action) {\r\n case 'customer_login':\r\n $this->processCustomerLogin();\r\n break;\r\n case 'get_customer':\r\n $this->processGetCustomer();\r\n break;\r\n case 'show_registration':\r\n $this->processShowRegistration();\r\n break;\r\n case 'register_product':\r\n $this->processRegisterProduct();\r\n break;\r\n case 'logout':\r\n $this->processLogout();\r\n break;\r\n default:\r\n $this->processCustomerLogin();\r\n break;\r\n }\r\n }",
"public function execute() {\n\n $this->parseRequestHeaders();\n\n $uri = $this->loadUrl(); // Loads the called URL\n String::arrayTrimNumericIndexed($uri); // Trim the URL array indexes\n\n /**\n * When server is running as a RESTful server\n */\n if (RESTFUL == '1') {\n RestServer::runRestMethod($uri);\n $this->terminate();\n }\n\n /**\n * When the request is not running over ajax,\n * then call the home for full page rendering\n * before calling the requested method\n */\n if (!$this->isAjax()) {\n\n $this->controller = $this->requireHome();\n $this->controller->itStarts($uri);\n $this->terminate();\n }\n\n /**\n * Normal Ajax Request, call the method only\n */\n $this->runMethod($uri);\n $this->terminate();\n }",
"public function callRequest()\n {\n Artisan::call('lucy:request', $this->builder->getAttribute('request'));\n }",
"public function run()\n {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }",
"function getApplication();",
"public function perform()\n\t{\n\t\tprint_r($_SERVER);\n\n\t\texit();\n\t\treturn $this->show();\n\t}",
"abstract public function launch(Request $request, Response $response);",
"function main() {\n\t\tif (!$this->_registerPid()) {\n\t\t\t$this->out('Unable to register Pid');\n\t\t\t$this->_stop();\n\t\t}\n\t\tif (file_exists($this->params['working'] . DS . '.autotest')) {\n\t\t\tinclude($this->params['working'] . DS . '.autotest');\n\t\t}\n\t\tif (!empty($this->params['notify'])) {\n\t\t\t$this->settings['notify'] = $this->params['notify'];\n\t\t}\n\t\tif (!empty($this->params['mode'])) {\n\t\t\t$this->settings['mode'] = $this->params['mode'];\n\t\t}\n\t\t$suffix = '';\n\t\tif (!empty($this->settings['mode'])) {\n\t\t\t$suffix = ' (' . $this->settings['mode'] . ' mode)';\n\t\t}\n\n\t\tNotify::$method = $this->settings['notify'];\n\t\t$this->addHooks();\n\t\tNotify::message('Autopilot Starting', 'in ' . APP_DIR . $suffix, 0, false);\n\t\t$this->buildPaths();\n\t\t$this->run();\n\t}",
"public function go();",
"function do_action( $name ) {\n\n\t\t$args = func_get_args();\n\t\tarray_unshift( $args, 'action' );\n\n\t\tcall_user_func_array( array( $this, 'api'), $args );\n\n\t}",
"public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}",
"public function AppActivate ( $app )\n\t {\n\t\t$this -> ShellInstance -> AppActivate ( $app ) ;\n\t }",
"protected function callCommandMethod() {}",
"public function start_call()\n {\n if (post_data('tokbox_session_key') == NULL || post_data('tokbox_token') == NULL)\n {\n exit(json_encode(array('status' => '0')));\n }\n\n $this->session->set_userdata('tokbox_data', post_data());\n exit(json_encode(array('status' => '1')));\n }",
"public function run()\n { \n $output = (string) $this->get('router')->dispatch();\n $response = $this->get('response');\n $response->setBody($output);\n $response->send();\n\n }",
"function go() {\r\n $this->basic_handler();\r\n }",
"public static function run() {\n if(self::$_init) {\n $route = static::requestRoute();\n if($route && $controller = static::createController($route['controller'])) {\n /** session started */\n App::sessionStart();\n /** running application */\n try {\n /* @var Controller $controller */\n $controller->run($route['action']);\n } catch (\\Exception $e) {\n static::error500('', \"Exception: [{$e->getMessage()}] in {$e->getFile()} at #{$e->getLine()}.\");\n }\n /** on success */\n static::end();\n } else {\n static::error404('Requested invalid resource.');\n }\n } else {\n static::error500('Application was not set up.');\n }\n }",
"public function callRoute()\n {\n Artisan::call('lucy:route', $this->builder->getAttribute('route'));\n }",
"public function call() {\n\n $args = func_get_args();\n\n $method = array_shift($args);\n\n try {\n\n switch ($this->version) {\n\n case 1:\n\n self::note(\"Calling $method()...\");\n\n $result = call_user_func_array(\n array($this->client, \"call\"),\n array_merge(\n array($this->session, $method),\n $args\n )\n );\n break;\n case 2:\n\n $words = explode(\" \", str_replace(array(\"_\", \".\"), \" \", $method));\n $method = '';\n\n foreach ($words as $key => $word) {\n\n if ($key > 0) $method .= ucfirst($word);\n else $method .= $word;\n }\n\n self::note(\"Calling $method()...\");\n\n $result = call_user_func_array(\n array($this->client, $method),\n array_merge(\n array($this->session),\n $args\n )\n );\n break;\n default:\n\n self::note(\"Call failed. No handler for Soap API Version \" . $this->version);\n return false;\n }\n\n self::note(\"Call was completed successfully.\");\n return $result;\n }\n catch (SoapFault $e) {\n\n self::note(\"Call failed, caught SoapFault (\" . $e->faultcode . \"): \" . $e->getMessage());\n }\n catch (Exception $e) {\n\n self::note(\"Call failed: \" . $e->getMessage());\n }\n }",
"public static function run()\n {\n static::$app->run();\n }",
"public function run()\n \t{\n \t\t$controller = $this->factoryController();\n\n \t\t$action = $this->_currentAction;\n\n \t\t$controller->$action();\n \t}",
"public function run()\n {\n $this->start = time();\n\n if (isset($_SERVER['REQUEST_METHOD'])) {\n $session = '[' . $_SERVER['REQUEST_METHOD'] . ']';\n if (isset($_SERVER['REMOTE_ADDR'])) {\n $session .= ' ' . $_SERVER['REMOTE_ADDR'];\n if (isset($_SERVER['SERVER_PORT'])) {\n $session .= ':' . $_SERVER['SERVER_PORT'];\n }\n if (isset($_SERVER['HTTP_USER_AGENT'])) {\n $session .= ' ' . $_SERVER['HTTP_USER_AGENT'];\n }\n }\n } else {\n $session = '[CLI]';\n }\n\n $this->log($session, time());\n\n // Populate necessary variables\n $route = $this->routes[strtolower($this->request->getMethod())];\n $uri = $this->getUriMatch($this->request->getRequestUri(), $route);\n $params = array();\n\n // Trigger any pre-route events\n if (null !== $this->events->get('route.pre')) {\n $this->log('[Event] Pre-Route', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('route.pre', array('project' => $this));\n\n // If still alive after 'route.pre'\n if ($this->events->alive()) {\n $this->log('Route Start', time());\n\n // Get params for the route\n if (isset($route[$uri])) {\n $params = $this->getRequestParams($uri, $route[$uri]);\n }\n\n // If the request and parameters are valid, call the assigned action\n if ($this->isValidRequest($uri) &&\n $this->isValidParams($uri, $route[$uri]['params'], $params) &&\n (count($params) == count($route[$uri]['params']))) {\n $params = $this->getRequestParams($uri, $route[$uri], $route[$uri]['asArray']);\n $method = (substr($uri, -1) == '/') ? 'index' : substr($uri, strrpos($uri, '/'));\n if (substr($method, 0, 1) == '/') {\n $method = substr($method, 1);\n }\n $this->result = call_user_func_array($this->getCallable($route[$uri]['action'], $method), $params);\n // Else, trigger the error action\n } else {\n $method = 'error';\n $error = $this->getErrorMatch($this->request->getRequestUri());\n if (isset($this->routes['error'][$error])) {\n if (!headers_sent()) {\n $this->response->setCode(404);\n $this->response->sendHeaders();\n }\n $this->result = call_user_func_array($this->getCallable($this->routes['error'][$error], 'error'), array());\n } else {\n throw new \\Pop\\Exception('Error: No error action has been defined to handle errors.');\n }\n }\n\n // Trigger any post-route events\n if (null !== $this->events->get('route.post')) {\n $this->log('[Event] Post-Route', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('route.post', array('project' => $this));\n\n // If still alive after 'route.post'\n if ($this->events->alive()) {\n // If the result is an array of data, send it to the view object and send response\n if ((null !== $this->result) && is_array($this->result)) {\n if ($this->response->getCode() == 200) {\n $viewFile = (substr($uri, -1) == '/') ? $uri . 'index.phtml' : $uri . '.phtml';\n } else {\n $viewFile = '/error.phtml';\n }\n\n // Create the view object\n $this->view = \\Pop\\Mvc\\View::factory($this->viewPath . $viewFile, $this->result);\n\n // Trigger any pre-dispatch events\n if (null !== $this->events->get('dispatch.pre')) {\n $this->log('[Event] Pre-Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch.pre', array('project' => $this));\n\n // If still alive after 'dispatch.pre'\n if ($this->events->alive()) {\n if (null !== $this->logger) {\n $this->log(\"Dispatch ['\" . ((null !== $this->controllerClass) ? $this->controllerClass : 'Callable') . \"']->\" . $method . \"\\t\" . $this->request->getRequestUri() . \"\\t\" . $this->request->getFullUri(), time());\n $this->log(\"Response [\" . $this->response->getCode() . \"]\", time());\n }\n // Set the response body and send the response\n $this->response->setBody($this->view->render(true));\n if (null !== $this->events->get('dispatch')) {\n $this->log('[Event] Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch', array('project' => $this));\n\n if (null !== $this->events->get('dispatch.send')) {\n $this->log('[Event] Dispatch Send', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->response->send();\n\n\n // Trigger any post-dispatch events\n if (null !== $this->events->get('dispatch.post')) {\n $this->log('[Event] Post-Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch.post', array('project' => $this));\n }\n } else {\n $this->log(\"Response [\" . $this->response->getCode() . \"]\", time());\n }\n }\n }\n\n $this->log('Route End', time());\n }",
"function go() {\r\n $this->basic_handler();\r\n\r\n }",
"public function run()\n\t{\n\t\t$_controller = $this->getController();\n\t\t\n\t\tif ( ! ( $_controller instanceof IXLRest ) )\n\t\t{\n\t\t\t$_controller->missingAction( $this->getId() );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tCall the controllers dispatch method...\n\t\t$_controller->dispatchRequest( $this );\n\t}",
"public function run_service()\n\t{\n\t\t// Check the request is allowed\n\t\tif ($this->_is_api_request_allowed())\n\t\t{\n\t\t\t// Route the API task\n\t\t\t$this->_route_api_task();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Set the response to \"ACCESS DENIED\"\n\t\t\t$this->set_response($this->get_error_msg(006));\n\n\t\t\t// Terminate execution\n\t\t\treturn;\n\t\t}\n\t}",
"function callHome( $how ) {\n\t$endline = '<br>';\n\t$endl = \"\\n\";\n\t#echo \"et\".$endline;\n\t#print \"check POST\\n\";\n\tif ( isset( $_POST ) ) {\n\t\t#print \"good POST\\n\";\n\t\t$fieldString = collectUsage();\n\n\t\t$phonedResult = null;\n\t\tif ( strcmp( $how , 'mail' ) == 0 ) {\n\t\t\t$phonedResult = mailHome( $fieldString );\n\t\t} else {\n\t\t\t$phonedResult = curlHome( $fieldString );\n\t\t}\n\t}\n\t#echo \"end transmission\".$endline;\n\treturn $phonedResult;\n}",
"public static function call($actionName=null, $arguments=null){ }",
"public function invoke($action);",
"function calls() {\n global $options;\n\n $response = action('Command', array('Command' => \"Core Show calls\"));\n if ($response['response'][0]['Response'] == 'Error') {\n showResult(WARNING, 'Get calls counter failed: ' . $response['response'][0]['Message'] . ', may be need \"command\" write privilege for user ' . $options['u']\n . ' in file manager.conf (write=command)');\n }\n foreach ($response['response'][0]['Output'] as $key) {\n $resp = explode(' ', $key);\n if (count($resp) == 3) {\n $response[$resp[1]] = $resp[0];\n }\n }\n return $response;\n}",
"public function job_app_process()\n\t{\n\t\t// Because the loads a page we dont need to return anything\n\t\t$this->EE->job_applications->job_app_process();\n\t}",
"public function start() {\n\t\t$this->invoke(\"start\");\n\t}",
"public function __call($name, $arguments){\r\n call_user_func_array(array($this, 'main'), $arguments);\r\n }",
"function callMethod($action) {\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\t\t$protocol = \"http\";\n\t\tif (isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '') {\n\t\t\t$protocol = \"https\";\n\t\t}\n\t\t//if ($this->config->getValue('FW', 'https') == true) {\n\t\t//\t$protocol = \"https\";\n\t\t//}\n\t\theader(\"Location: $protocol://$host$uri/$action\");\n\t\texit;\n\t}",
"public function call(): void\n {\n $this->isCalled = true;\n }",
"public function run()\n {\n $this->call(baihat_casi::class);\n $this->call(baihatduyet::class);\n $this->call(users::class);\n $this->call(theloai::class);\n $this->call(casi::class);\n $this->call(baihatmoi::class);\n $this->call(baihathot::class);\n $this->call(baihathot_casi::class);\n }",
"public static function bridge_sendApplication($params){\n\t\t//rea_dev_dump($params);\n\t\tglobal $config;\n\t\t//$params[0]->pre($config);\n\n\t\t$page = $params[0];\n\n\t\t$client = \\exc\\client::instance();\n\t\t$js = \"<script type='text/javascript'>\\n//EXC 1.0, APP BOOTLOADER\\n\";\n\n\t\t$js.= 'exc.controller.on(\"module_loaded_' . \\exc\\client::$state['moduleName'] . '\", function(msg){console.log(\"[EXC][REASG][VIEWS][MODULE LOADED][' . \\exc\\client::$state['moduleName'] . ']\"); exc.views.install(\"' . \\exc\\client::$state['moduleName'] . \"\\\");});\\n\";\n\n\t\t$js.= \"exc.app.state.load = true;\\n\";\n\t\t$js.= $client->getState();\n\n\t\t//$js.= 'if(!exc.views.find(\"' . \\exc\\client::$state['moduleName'] . \"\\\")){\\n\";\n\t\t//$js.= \"}\\n\";\n\n\t\t//$js.= \"exc.views.install('\" . \\exc\\client::$state['moduleName'] . \"');\\n\";\n\n\t\t$js.= \"</script>\";\n\t\t$page->view->tpl_contents['exc-view-name'] = \\exc\\client::$state['moduleName'];\n\t\t$page->view->js_payload->write($js);\n\n\t}",
"public function call($data, $action)\n {\n }",
"function init_call() {\n\tdomain_check();\n\tsession_check();\n\n\t$db = connect_database(); // Connect... to the... database...\n\n\tcreate_structure(); // Ensure the data tables exist\n\tprocess_action(); // Work how to respond\n\n\tsend_message('error', array('reason' => 'none', 'message' => 'Something went wrong'));\n}",
"function call($controller, $action)\n{\n $tmp_controller = \"\";\n $tmp_action = \"\";\n\n if (isset($controller)) {\n if (file_exists('app/controllers/' . $controller . '_controller.php')) {\n\n $tmp_controller = $controller;\n\n //REQUIRE THE CONTROLLER\n require_once('controllers/' . $controller . '_controller.php');\n\n }else{\n $tmp_controller = $controller = 'main';\n\n //REQUIRE THE CONTROLLER\n require_once('controllers/' . $controller . '_controller.php');\n }\n }else {\n //If Controller is not set\n $tmp_controller = 'main';\n }\n\n //Create an object with the controller\n $controller_obj = ucfirst($controller) . 'Controller';\n\n $controller = new $controller_obj;\n\n //CHECK IF METHOD EXISTS IN THE CONTROLLER\n if(isset($action))\n {\n if(method_exists($controller, $action))\n {\n $tmp_action = $action;\n }else{\n $tmp_action = 'home';\n }\n }\n\n $controller->{ $tmp_action }();\n}",
"public function actionCall()\n {\n $req = Yii::$app->request;\n \n $phoneTo = (int)$req->get('phoneTo');\n if (!is_numeric($phoneTo)) return 'Phone must be a number';\n\n $phoneFrom = self::PHONE_ADMIN;\n $sid = $req->get('sid');\n $token = $req->get('token');\n \n $twiloiSet = (isset($sid) && isset($token));\n if (!$twiloiSet) return \"Twilio API call. From: $phoneFrom To: $phoneTo\";\n\n $client = new Client($sid, $token);\n\n $call = $client->calls->create(\n $phoneTo,\n $phoneFrom,\n [\"url\" => \"http://demo.twilio.com/docs/voice.xml\"]\n );\n echo $call->sid;\n }",
"public function run()\n {\n $this->call(dktour::class);\n }",
"public function main()\n {\n $di = $this->getDI();\n\n if (self::$isCli) {\n global $argv;\n\n $arguments = array();\n foreach ($argv as $k => $arg) {\n if ($k == 1) {\n $arguments['task'] = $arg;\n } elseif ($k == 2) {\n $arguments['action'] = $arg;\n } elseif ($k >= 3) {\n $arguments['params'][] = $arg;\n }\n }\n\n // define global constants for the current task and action\n define('CURRENT_TASK', (isset($argv[1]) ? $argv[1] : null));\n define('CURRENT_ACTION', (isset($argv[2]) ? $argv[2] : null));\n\n $this->console->handle($arguments);\n\n } else {\n // Get the 'router' service\n $this->router->handle();\n\n\n // Pass the processed router parameters to the dispatcher\n $this->dispatcher->setNamespaceName($this->router->getNamespaceName());\n $this->dispatcher->setControllerName($this->router->getControllerName());\n $this->dispatcher->setActionName($this->router->getActionName());\n $this->dispatcher->setParams($this->router->getParams());\n\n // Dispatch the request\n $controller = $this->dispatcher->dispatch();\n\n // Find the name space added directory\n $namespaceExtension = explode('Controllers\\\\', $this->router->getNamespaceName());\n $namespaceDirectory = strtolower($namespaceExtension[count($namespaceExtension)-1]);\n\n if ($namespaceDirectory != '') {\n $namespaceDirectory .= '/';\n }\n\n // Start the view\n $view = $controller->view;\n $view->start();\n\n // Render the related views\n $view->render(\n $namespaceDirectory.$this->dispatcher->getControllerName(),\n $this->dispatcher->getActionName(),\n $this->dispatcher->getParams()\n );\n\n // Finish the view\n $view->finish();\n\n $response = $controller->response;\n\n // Pass the output of the view to the response\n $response->setContent($view->getContent());\n\n // Send the request headers\n $response->sendHeaders();\n\n // Print the response\n echo $response->getContent();\n\n }\n\n exit;\n\n\n }",
"public function call($method, $params = array());",
"public function run()\n {\n $this->run_configuration();\n\n $this->request->plugins = $this->pluggins;\n\n $app = $this;\n\n $this->router->start($app);\n }",
"public function startApp($appname){\r\n if (!isset($this->apps[$appname])) throw new error(\"Application dosen't exists, cannot start\");\r\n $this->app = $this->apps[$appname];\r\n return $this->app->start();\r\n }",
"public function exec()\n {\n try {\n $http_response = $this->front_controller->exec();\n return $this->http_transport->sendResponse($http_response);\n } catch (Exception $e) {\n $this->echoException($e);\n exit(1);\n }\n }",
"public function callController()\n {\n Artisan::call('lucy:controller', $this->builder->getAttribute('controller'));\n }",
"function startApp($classApplication) {\n new $classApplication();\n}",
"public function call($args = [])\n {\n // TODO\n }",
"public function call($args = [])\n {\n // TODO\n }",
"public function callAction($method, $parameters);",
"public function exec () {\r\n\t\t$a = isset($_GET['action']) ? $_GET['action'] : 'capa';\r\n\t\tswitch ($a) {\r\n\t\t\tcase 'capa':\r\n\t\t\t\t$this->capa();\r\n\t\t\tbreak;\r\n\t\t\tcase 'adicionar':\r\n\t\t\t\t$this->adicionar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'alterar':\r\n\t\t\t\t$this->alterar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'detalhar':\r\n\t\t\t\t$this->detalhar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'excluir':\r\n\t\t\t\t$this->excluir();\r\n\t\t\tbreak;\r\n\t\t\tcase 'sair':\r\n\t\t\t\t$this->sair();\r\n\t\t\tbreak;\r\n\t\t} \r\n\t}",
"function start()\n {\n\t\t$GLOBALS['appshore_data']['api']['op'] = $_SESSION['customization']['applications']['tab_id']?$this->selectOp($_SESSION['customization']['applications']['tab_id']):'administration.customization_fields.edit'; \n\t\treturn execMethod($GLOBALS['appshore_data']['api']['op']);\t\t\n }",
"public function run();",
"public function run();",
"public function run();",
"public function run();"
] | [
"0.6813632",
"0.6813632",
"0.64578557",
"0.6387159",
"0.6305149",
"0.62660027",
"0.6265228",
"0.6257039",
"0.6209303",
"0.6147062",
"0.61173457",
"0.61149544",
"0.61082935",
"0.60137224",
"0.5942163",
"0.59321725",
"0.5919044",
"0.5895917",
"0.5887004",
"0.5874423",
"0.5844188",
"0.58385384",
"0.58382285",
"0.58332956",
"0.5819578",
"0.5815136",
"0.5813505",
"0.579983",
"0.5784106",
"0.5778323",
"0.57658786",
"0.5757941",
"0.574602",
"0.574129",
"0.57361126",
"0.57357365",
"0.573232",
"0.57163876",
"0.57161134",
"0.5714172",
"0.57091606",
"0.5707323",
"0.56971985",
"0.5677803",
"0.56588393",
"0.5658827",
"0.5645841",
"0.56366026",
"0.5627736",
"0.56176305",
"0.5614735",
"0.5583821",
"0.5582261",
"0.5578497",
"0.5572466",
"0.55707026",
"0.557033",
"0.5566164",
"0.55571616",
"0.5532671",
"0.5531525",
"0.5524675",
"0.55155945",
"0.5506119",
"0.5502347",
"0.5498757",
"0.5496475",
"0.54962265",
"0.5493216",
"0.5491887",
"0.54817986",
"0.5473149",
"0.54696083",
"0.54672134",
"0.5464778",
"0.54550546",
"0.5454486",
"0.54456186",
"0.54364824",
"0.54335093",
"0.54289436",
"0.54280347",
"0.54237187",
"0.54184246",
"0.5412452",
"0.5404829",
"0.53941494",
"0.5379162",
"0.537677",
"0.5374292",
"0.5366449",
"0.5355295",
"0.5354434",
"0.5354434",
"0.5353649",
"0.5347428",
"0.53467077",
"0.53450984",
"0.53450984",
"0.53450984",
"0.53450984"
] | 0.0 | -1 |
This function will delete the record based on the id | public function remove($id) {
$this->db->where('id_user', $id);
$this->db->delete('user');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteRecord ($id);",
"public function deleteRecord($id){\n\t}",
"public function destroy($id)\n {\n //delete specific record\n }",
"function delete($id){\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete($this->table);\n }",
"function delete($id);",
"function deleteRecord($id)\n\t{\n\t\t$this->form->deleteRecord($this->tablename, $id);\n\t}",
"public function delete( $id );",
"public function delete($id) \r\n {\r\n $this->load(array('id=?',$id));\r\n $this->erase();\r\n }",
"function delete( $id )\n\t{\n\t\t// where clause\n\t\t$this->db->where( $this->primary_key, $id );\n\n\t\t// delete the record\n\t\treturn $this->db->delete( $this->table_name );\n\t\t// print_r($this->db->last_query());die;\n \t}",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"function delete($id) {\r\n $this->db->where('id', $id);\r\n $this->db->delete($this->tbl);\r\n }",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"abstract public function deleteById($id);",
"public function delete($id){\n\t\t$sql = \"DELETE FROM {$this->table} WHERE {$this->primaryKey} = $id\";\n\t\t$this->db->query($sql);\n\t}",
"abstract public function delete($id);",
"abstract public function delete($id);",
"abstract public function delete($id);",
"public function delete_record($id){\n\t\t$this->db->where('award_id', $id);\n\t\t$this->db->delete('awards');\n\t\t\n\t}",
"function delete($id) {\n $this->db->where('id', $id);\n $this->db->delete('rit');\n }",
"public function delete($id) {\r\n\r\n }",
"public function delete($id){\n\t\t$this->db->delete($this->_table_name, array('id'=>$id));\n }",
"public abstract function delete($id);",
"public function del($id)\n {\n }",
"public function delete($id){\r\n }",
"function deleteRecord($id){\n $category=Category::find($id);\n $category->delete();\n }",
"public function delete($id = null){\n\t\t\n\t}",
"public function delete($id)\n\t {\n\t //\n\t }",
"function deleteRecord($id){\n global $db;\n\n $sql = \"DELETE FROM products WHERE id = $id\";\n Basic::EventLog(\"Products->deleteRecord: \".$sql);\n //Basic::EventLogDB(\"Usuario eliminado - UID:\".$f['uid'].\", Modulo: \".$f['module'].\", Permiso: \".$f['perm']);\n $res =& $db->query($sql);\n return $res;\n }",
"public function delete($id)\n {\n $query=\"DELETE FROM recording WHERE id=\".$id;\n\n $this->executeQuery($query);\n }",
"public function delete(int $id);",
"public function delete($id) {\n\t\treturn $this->model->findFirst(\"id = '$id'\")->delete();\n\t}",
"public function delete( $id ){\n \n\n }",
"public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }",
"public function delete_record($id){\n\t\t$this->db->where('training_id', $id);\n\t\t$this->db->delete('training');\n\t\t\n\t}",
"public function delete($id)\n\t{\n\t}",
"public function delete($id)\n\t{\n\t}",
"public function delete($id)\r\n {\r\n }",
"public function delete($id)\n {\n //\n }",
"public function delete($id)\n {\n //\n }",
"function delete_record () { //deletes a record\n\t\t\n\t\t//deletes record\n\t\t$pdo = Database::connect();\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$sql = \"DELETE FROM customers WHERE id = ?\";\n\t\t$q = $pdo->prepare($sql);\n\t\t$q->execute(array($_GET['id']));\n\t\tDatabase::disconnect();\n\t\theader(\"Location: customer.php\");\n\t\t\t\n\t}",
"public function delete($id)\n {\n }",
"function delete($id) {\n return $this->db->deleteParameters(self::TABLA, array('id' => $id));\n }",
"public function delete($id)\n {\n // ..\n }",
"function delete($id){\n $this->db->where('id', $id);\n $this->db->delete($this->$tbl_Employeeinfo);\n }",
"function delete($id)\n\t{\n\t\t$this->db->where($this->id, $id);\n\t\treturn $this->db->delete($this->table);\n\t}",
"public function delete($id) {\r\n \r\n }",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }",
"public function delete($id)\n {\n }"
] | [
"0.884148",
"0.87813485",
"0.83410996",
"0.81578004",
"0.8116337",
"0.81083494",
"0.80948323",
"0.8082271",
"0.8020353",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.80086046",
"0.7993466",
"0.7993466",
"0.7993466",
"0.7993466",
"0.7993466",
"0.7993466",
"0.7949038",
"0.79432124",
"0.7940614",
"0.7940614",
"0.7940614",
"0.7938321",
"0.78711635",
"0.7858525",
"0.78574526",
"0.7851157",
"0.7842614",
"0.78411335",
"0.7840516",
"0.78387475",
"0.7834866",
"0.7825815",
"0.78142595",
"0.7810303",
"0.7807566",
"0.7801663",
"0.78009003",
"0.77907914",
"0.7784716",
"0.7784716",
"0.77706844",
"0.77619845",
"0.77619845",
"0.77507126",
"0.7746746",
"0.774337",
"0.77396697",
"0.7729837",
"0.77219474",
"0.7710364",
"0.77072746",
"0.76919407",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455",
"0.76810455"
] | 0.0 | -1 |
This function will take the post data passed from the controller If id is present, then it will do an update else an insert. One function doing both add and edit. | public function add($data) {
if (isset($data['id_user'])) {
$this->db->where('id_user', $data['id_user']);
$this->db->update('user', $data);
} else {
$this->db->insert('user', $data);
return $this->db->insert_id();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit($id) \r\n {\r\n $this->load(array('id=?',$id));\r\n $this->copyFrom('POST');\r\n $this->update();\r\n }",
"public function _addOrEdit() {\n\t\tif($this->getRequest()->getParam('id')) { return true; } else { return false; }\n\t}",
"public function edit($id){\n $data = array();\n\t\t\n\t\t//get post data\n\t\t$postData = $this->post->getRows($id);\n\t\t\n\t\t//if update request is submitted\n if($this->input->post('postSubmit')){\n\t\t\t//form field validation rules\n\t\t\t$this->form_validation->set_rules('title', 'post title', 'required');\n $this->form_validation->set_rules('content', 'post content', 'required');\n\t\t\t\n\t\t\t//prepare cms page data\n\t\t\t$postData = array(\n 'title' => $this->input->post('title'),\n 'content' => $this->input->post('content')\n );\n\t\t\t\n\t\t\t//validate submitted form data\n if($this->form_validation->run() == true){\n\t\t\t\t//update post data\n $update = $this->post->update($postData, $id);\n\n if($update){\n $this->session->set_userdata('success_msg', 'Post has been updated successfully.');\n redirect('/posts');\n }else{\n $data['error_msg'] = 'Some problems occured, please try again.';\n }\n }\n }\n\n\t\t\n $data['post'] = $postData;\n\t\t$data['title'] = 'Update Post';\n\t\t$data['action'] = 'Edit';\n\t\t\n\t\t//load the edit page view\n $this->load->view('templates/header', $data);\n $this->load->view('posts/add-edit', $data);\n $this->load->view('templates/footer');\n }",
"public function edit($id) //修改\n {\n\t\t//\n }",
"public function edit($id, array $data);",
"public function editAction()\n {\n\n $id = $this->getRouteParams(\"id\");\n\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n $id = $_POST['id'];\n $title = $_POST['title'];\n $content = $_POST['content'];\n\n\n try {\n\n $post = PostService::update($id, $title, $content);\n\n View::renderTemplate('Posts/editPost.html', [\n 'post' => $post\n ]);\n return;\n\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n\n } else {\n $post = PostService::readOne($id);\n View::renderTemplate('Posts/editPost.html', [\n 'post' => $post\n ]);\n }\n\n }",
"public function editPost() {\n\n if ($this->request->is('post')) {\n\n $this->Post->create();\n\n $id = $this->request->data['Post']['id'];\n\n if (!$id) {\n throw new NotFoundException(__('Invalid post'));\n }\n\n $post = $this->Post->findById($id);\n\n if (!$post) {\n throw new NotFoundException(__('Invalid post'));\n }\n\n if ($this->request->is('post') || $this->request->is('put')) {\n $this->Post->id = $id;\n $data = $this->getPreparedPostData($this->request);\n if ($this->Post->save($data)) {\n $this->Session->setFlash('Your post has been updated.');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash('Unable to update your post.');\n }\n }\n\n if (!$this->request->data) {\n $this->request->data = $post;\n }\n }\n }",
"public function edit($id)\n {\n \n \n\n }",
"function postEdit($request){\r\n global $context;\r\n $data=new $this->model;\r\n try\r\n {\r\n foreach($data->fields as $key=>$field){\r\n if($field['type']!='One2many' && $field['type']!='Many2many')\r\n $data->data[$key]=$request->post[$key];\r\n }\r\n\r\n //print_r($data);\r\n if(!$data->update()){\r\n\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n\r\n }\r\n\r\n\r\n if($request->isAjax()) return json_success(\"Save Success !!\");\r\n\r\n\r\n redirectTo($context->controller_path.\"/all\");\r\n }\r\n catch (\\Exception $ex)\r\n {\r\n if($request->isAjax()) return json_error($ex->getMessage().$obj->error);\r\n return $this->view(\"Error/index\",['ErrorNumber'=>0,'ErrorMessage'=>$ex->getMessage().$obj->error]);\r\n }\r\n }",
"public function edit($id)\n { \n //\n }",
"public function edit($id)\n { \n \n }",
"public function edit($id)\n { \n \n }",
"function admin_edit($id)\n {\n $this->lordModel('Post');\n $condition = array('id' => $id);\n $d['post'] = $this->Post->find(array(\n 'condition' => $condition\n ));\n $this->setvars($d);\n }",
"abstract protected function createEdit($dataToBind, $id = 0);",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($data) \n \t\t{\n \t\t#update data\n \t\t$this->db->update('table_post', $data, array('post_id' => $data['post_id']));\n \t\t}",
"public function edit($id){\n\t\t//\n\t}",
"public function edit($id){\n\t\t//\n\t}",
"public function edit($id)\n {\n\t\t\n \n }",
"public function edit($id) {\n \n }",
"public function edit($id) {\n \n }",
"public function edit($id)\n {\n //\n \n\n }",
"public function edit($id)\n {\n // \n }",
"public function edit($id)\n {\n //\n \n }",
"public function edit($id)\n {\n \n\n }",
"public function edit($id)\n {\n \n\n }",
"public function edit($id)\n {\n \n\n\n }",
"public function edit($id) {\r\n //\r\n }",
"public function edit()\n {\n $id = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $post = $this->post->getPost($id); // je récupère le post\n\n // j'arrive en post car des données sont saisies dans le formulaire\n if($this->request->parameterExist('title') && $this->request->parameterExist('content')) {\n\n $this->post->updatePost(\n $this->request->getParameter('title'),\n $this->request->getParameter('content'),\n $id\n );\n\n $this->redirect(\"admin\", \"post/\" . $post['id']); // une fois le post créé, je redirige vers la vue Admin/post/iddupost\n }\n\n // j'arrive sur la vue en Get\n $this->buildView(array('post'=>$post));\n }",
"public function edit($id){\n //\n }",
"public function edit($id){\n //\n }",
"public function edit($id){\n //\n }",
"public function edit($id){\n //\n }",
"public function edit($id)\n\t{\t\t\n\n\t}",
"public function updaterecord_post() {\n $data = $this->input->post();\n if( $data['id'] == null || $data['name'] == null || $data['email'] == null) {\n $this->set_response(array('response_code'=>400, 'response_message'=>'Parameter missing', 'response_data'=>array()), REST_Controller::HTTP_OK);\n return;\n }\n $result = $this->Api_model->updateData('info', array('name'=>$data['name'], 'email'=>$data['email']), array('id'=>$data['id']));\n if($result != 1) {\n $this->set_response(array('response_code'=>400,'response_message'=>'Error occurs while process','response_data'=>array()), REST_Controller::HTTP_OK); \n return; \n }\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK);\n return;\n }",
"public function edit($id)\n {\n //\n }",
"public function edit($id)\n {\n //\n }",
"public function edit($id)\n {\n //\n }",
"public function edit($id)\n {\n //\n }",
"public function edit($id)\n {\n //\n }",
"public function edit($id) {\n\t\t\n\t}",
"public function edit($id = null) \n\t\t{\n\t\t\t$this->Blog->id = $id;//post id\n\t\t\t\n\t\t\t$usrid = $this->Auth->user('id');//user id\n\t\t\tif($usrid >0)\n\t\t\t{ \n\t\t\t\t$ids = $usrid;\n\t\t\t\t\n\t\t\t\t$this->loadModel('User');//loads the model users\n\t\t\t\t\n\t\t\t\t$name=$this->User->find('first',array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'fields'=>'name',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=> array('User.id' => $ids)));\t\n\t\t\t\t$this->set('name', $name);//name of the logged user\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ids = 0;\n\t\t\t}\n\t\t\t$this->set('id',$id);\n\t\t\t\n\t\t\tif ($this->request->is('get')) \n\t\t\t{\n\t\t\t\t$this->request->data = $this->Blog->read();\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t$update['id']=$this->Blog->id;\n\t\t\t\t$update['title']=htmlentities($this->data['Blog']['title']);\n\t\t\t\t$update['comments']=htmlentities($this->data['Blog']['comments']);\t\n\t\t\t\t\n\t\t\t\tif($this->Blog->save($update)) \n\t\t\t\t{\n\t\t\t\t\t$this->Session->setFlash('Your post has been updated.');\n\t\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$this->Session->setFlash('Unable to update your post.');\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function edit($id)\n {\n //\n }",
"public function post_edit( $id )\n {\n // Fetch the product record\n $product = Product::find( $id ); \n \n // Record Exists\n if( isSet($product->exists) )\n {\n // Loop through all of the submitted data\n foreach( Input::all() as $key => $value){\n \n // Determine if input was empty\n $val = (bool) trim($value);\n \n // If empty value..replace with N/A\n if(!$val) Input::replace(array($key => 'N/A'));\n }\n \n // Update db fields with escaped data.\n $product->product_detail->fill( Input::all() )->save_escape();\n \n // Redirect the user\n return Redirect::to_route('admin-products');\n }\n \n // Otherwise throw 404 error\n else return Response::error(404);\n }",
"public function edit($id)\n {\n \n \n }",
"public function edit($id)\n {\n \n \n }",
"public function edit($id)\r\n {\r\n \r\n \r\n\r\n }",
"public function edit($id) {\n //\n }",
"public function edit($id)\n {\n \n\n }",
"public function edit($id){\t\n\t\tif($this->input->post('step')=='1'){\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'name'=> $this->input->post('name'),\t\t\t\n\t\t\t\t'owner'=> $this->input->post('owner'),\t\t\n\t\t\t\t'address_line'=>$this->input->post('address_line'),\n\t\t\t\t'zip' =>$this->input->post('zip'),\n\t\t\t\t'fax'=>$this->input->post('fax'),\n\t\t\t\t'website'=>$this->input->post('website'),\n\t\t\t\t'working_start'=>$this->input->post('working_start'),\n\t\t\t\t'working_end'=>$this->input->post('working_end'),\n\t\t\t\t'since'=>$this->input->post('since'),\n\t\t\t\t'no_of_employees'=>$this->input->post('no_of_employees'),\n\t\t\t\t'email'=>$this->input->post('email')\n\t\t );\n\t\t}\n\t\tif($this->input->post('step')=='2'){\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'description'=> $this->input->post('description'),\t\t\t\n\t\t );\n\t\t}\n\t\tif($this->input->post('step')=='3'){\n\t\t\t$other_info=array('facebook_url'=>$this->input->post('facebook_url'),'googleplus_url'=>$this->input->post('googleplus_url'),'twitter_url'=>$this->input->post('twitter_url'),'linkedin_url'=>$this->input->post('linkedin_url'),'youtube_url'=>$this->input->post('youtube_url'),'whatsup_contact_number'=>$this->input->post('whatsup_contact_number'));\n\t\t\t$other_info=serialize($other_info);\n\t\t\t$data = array(\t\n\t\t\t\t'other_info'=>$other_info\n\t\t\t);\n\t\t}\n\t\tif($this->input->post('step')=='4'){\n\t\t\t$city_id='0';\n\t\t\t$area_id='0';\n\t\t\tif($this->input->post('city')){\t\n\t\t\t\t$city_id=$this->cities_model->cityFindOrSave($this->input->post('city'));\n\t\t\t}\t\n\t\t\tif($this->input->post('area')){\n\t\t\t\t$area_id=$this->areas_model->areaFindOrSave($this->input->post('area'),$city_id);\n\t\t\t}\n\t\t\t$data = array(\n\t\t\t\t'city_name'=> $this->input->post('city_name'),\n\t\t\t\t'area_name'=> $this->input->post('area_name'),\n\t\t\t\t'city_id'=> $city_id,\t\t\t\t\n\t\t\t\t'area_id'=> $area_id,\n 'latitude'=> $this->input->post('latitude'),\n\t\t\t\t'longitude'=> $this->input->post('longitude')\t\n\t\t );\n\t\t}\n\t\tif($this->input->post('step')=='5'){\n\t\t\t$data = array(\n\t\t\t\t'description'=> $this->input->post('description'),\t\t\t\n\t\t );\n\t\t}\n\t\t$this->db->where('id', $id);\n\t\t$this->db->update('advertisements', $data);\n\t}",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n//\n }",
"public function edit($id)\n {\n //\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }",
"public function edit($id) {\n //\n }"
] | [
"0.71723413",
"0.6954864",
"0.6939089",
"0.6931946",
"0.6907699",
"0.6859462",
"0.68556136",
"0.6751269",
"0.6740402",
"0.6726097",
"0.6723098",
"0.6723098",
"0.6711481",
"0.6709175",
"0.67050683",
"0.67050683",
"0.6702781",
"0.66959846",
"0.66959846",
"0.6692991",
"0.6690463",
"0.6690463",
"0.66768306",
"0.66728234",
"0.6665242",
"0.66605455",
"0.66605455",
"0.6660308",
"0.6659401",
"0.66565084",
"0.66563016",
"0.66563016",
"0.66563016",
"0.66563016",
"0.6652481",
"0.6651146",
"0.665091",
"0.665091",
"0.665091",
"0.665091",
"0.665091",
"0.6647644",
"0.6641573",
"0.6640173",
"0.66373765",
"0.6636482",
"0.6636482",
"0.6631392",
"0.6631148",
"0.6629134",
"0.66273355",
"0.6625978",
"0.6625978",
"0.66259414",
"0.6624743",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6622162",
"0.6616574",
"0.6615999",
"0.6615999",
"0.6615999",
"0.6615999",
"0.6615999",
"0.6615999",
"0.6615999",
"0.6615999",
"0.6615999",
"0.6615999"
] | 0.0 | -1 |
the file property can be empty if the field is not required | public function upload()
{
if (null === $this->getFile()) {
return;
}
// use the original file name here but you should
// sanitize it at least to avoid any security issues
$path = ($this->isPublic()) ? 'public' : 'sections' . '/' . strtolower($this->getSection()->getCode());
if (!is_dir($this->getUploadRootDir(). '/' .$path)){
if (!mkdir($this->getUploadRootDir(). '/' .$path)){
throw new \Exception('Create dir exception');
}
}
$filename = sha1(uniqid(mt_rand(), true)).'.'.$this->getFile()->guessExtension();
// move takes the target directory and then the
// target filename to move to
$this->getFile()->move(
$this->getUploadRootDir(). '/' .$path,
$filename
);
// set the path property to the filename where you've saved the file
$this->path = $path . '/' . $filename;
// clean up the file property as you won't need it anymore
$this->file = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function configureFileField() {}",
"public function file_required(): static\r\n {\r\n if (empty($this->is_file['name'])) $this->message(\"is required\");\r\n return $this;\r\n }",
"function zen_draw_file_field($name, $required = false) {\n $field = zen_draw_input_field($name, '', ' size=\"50\" ', 'file');\n\n return $field;\n }",
"static function checkForEmptyFileField($fieldname) {\n if (!isset($_FILES[$fieldname]['name'])) {\n new SystemMessage(\"File field cannot be left empty\")\n\n ;\n forward();\n }\n }",
"private function fileFields()\n {\n $disk = 'public';\n\n if ($this->jsonData['disk']) {\n $disk = $this->jsonData['disk'];\n }\n\n $newData = [\n 'type' => $this->jsonData['type'],\n 'component' => 'file-field',\n 'vue' => $this->getCorrectVueComponent('form-file-field'),\n 'deletable' => true,\n 'downloadable' => false,\n 'deletable' => false,\n 'previewUrl' => null,\n 'thumbnailUrl' => null,\n 'disk' => $disk,\n 'textAlign' => 'center',\n ];\n\n $this->data = array_merge($this->data, $newData);\n }",
"function validate_filename($object = null, $value)\n\t{\n\t\tif (isset($value) == false || empty($value) ) {\n\t\t\treturn Localized::ModelValidation(\n\t\t\t\t$this->tableName(),\n\t\t\t\tMedia::filename,\n\t\t\t\t\"FIELD_EMPTY\"\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function rules()\n {\n return [\n 'file' => 'required|file'\n ];\n }",
"public function getFields()\n {\n return [\n 'value' => 'name:Obrázok|type:file|image|required',\n ];\n }",
"public function rules()\n {\n return [\n 'file' => 'required|image|max:20000', //REQUIRED MONO AN TO DEFAULT EINAI EMPTY ETSI OSTE NA MI SKAEI ERROR STO PEOPLE\n 'filename' => '',\n ];\n }",
"protected static function isEmptyFileUpload($value) {\n return (\n isset($value['name']) && '' === $value['name'] &&\n isset($value['type']) && '' === $value['type'] &&\n isset($value['tmp_name']) && '' === $value['tmp_name'] &&\n isset($value['error']) && UPLOAD_ERR_NO_FILE === $value['error'] &&\n isset($value['size']) && 0 === $value['size']\n );\n }",
"public function rules()\n {\n return [\n\n\n\n\n\n 'name' => 'required|string|max:100',\n 'fileable_id' => 'required',\n 'fileable_type' => 'required',\n 'description' => 'max:1000',\n 'file'=>'required|file|max:100000'\n\n\n\n ];\n }",
"public function rules()\n {\n return [\n 'file' => 'nullable|required|image|max:2048'\n ];\n }",
"function _field_file($val) \n {\n $res = \"\";\n $size = $this->_get_field_size();\n $size -= 12; // compensate for Browse.. button\n\n if (isset($this->attribs['ws_path'])) {\n $path = $this->attribs['ws_path'];\n }\n\n\n $res .= sprintf(\"<input type=\\\"file\\\" name=\\\"%s\\\" id=\\\"%s\\\" size=\\\"%d\\\" maxlength=\\\"%d\\\" class=\\\"%s\\\" %s/>\\n\",\n $this->fname,\n $this->fname,\n $size,\n $this->attribs['maxlength'],\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n\n if (isset($this->attribs['show_current']) and !empty($val)) {\n $res .= sprintf('<br /><span style=\"font-size: 9px\">current file: <a href=\"%s/%s\" target=\"flashWin\">%s</a></span>', $path, $val, $val);\n }\n\n return $res;\n }",
"function acf_file_input($attrs = array())\n{\n}",
"private function build_file_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true, $_is_pricing_rule = \"no\") {\r\n /*\r\n * Show as value option not available for FILE field\r\n * since file field not supported for Admin Field */\r\n \r\n $_index .= (isset($_meta[\"multi_file\"]) && $_meta[\"multi_file\"] == \"yes\") ? \"[]\" : \"\";\r\n $accept = (isset($_meta[\"filetypes\"]) && ! empty($_meta[\"filetypes\"])) ? ('accept=\"' . esc_attr(trim($_meta[\"filetypes\"])) . '\"') : '';\r\n $multifile = (isset($_meta[\"multi_file\"]) && $_meta[\"multi_file\"] == \"yes\") ? 'multiple=\"multiple\"' : '';\r\n $maxsize = (isset($_meta[\"max_file_size\"]) && ! empty($_meta[\"max_file_size\"])) ? ('max-size=\"' . esc_attr(trim($_meta[\"max_file_size\"])) . '\"') : '';\r\n $preview = (isset($_meta[\"img_is_prev\"]) && $_meta[\"img_is_prev\"] == \"yes\") ? \"yes\" : \"no\";\r\n $preview_width = (isset($_meta[\"img_is_prev_width\"]) && $_meta[\"img_is_prev_width\"] != \"\") ? $_meta[\"img_is_prev_width\"] : \"65px\";\r\n $has_field_rules = isset( $_meta[\"field_rules\"] ) && is_array( $_meta[\"field_rules\"] ) && count( $_meta[\"field_rules\"] ) != 0 ? \"yes\" : \"no\";\r\n /* Construct the field */\r\n $html = '<input type=\"file\" data-has_field_rules=\"'.$has_field_rules.'\" data-has_pricing_rules=\"'.$_is_pricing_rule.'\" ' . $maxsize . ' data-fkey=\"'. $_meta[\"key\"] .'\" class=\"' . $_ptype . '-field ' . $_class . '\" name=\"' . esc_attr($_meta[\"key\"] . $_index) . '\" ' . $accept . ' ' . $multifile . ' data-field-type=\"'. $_meta[\"type\"] .'\" ' . $_ptype . '-pattern=\"mandatory\" ' . $_ptype . '-mandatory=\"' . $_meta[\"required\"] . '\" ' . $_cloneable . ' ' . $_readonly . ' data-preview=\"'. $preview .'\" data-preview-width=\"'. $preview_width .'\" />';\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }",
"public function rules()\n {\n return [\n 'certificado' => 'required|file|filled',\n ];\n }",
"public function rules()\n {\n return array(\n array('file', 'file'),\n //array('file', 'file', 'types' => 'jpg, png, gif, jpeg', 'on'=>'create'),\n //array('file', 'file', 'allowEmpty' => true, 'types' => 'jpg, png, gif, jpeg', 'on' => 'update'),\n );\n }",
"function validateUploadData(&$model, $fieldData, $fieldName, $allowEmpty = true) {\n if ($allowEmpty == false || !empty($fieldData[$fieldName]['tmp_name'])) {\n \n # validate against provided values\n if (!empty($fieldData[$fieldName]['error']) && $fieldData[$fieldName]['error'] != 0) return false;\n if (empty($fieldData[$fieldName]['size']) || $fieldData[$fieldName]['size'] == 0) return false;\n \n # validate the temporary uploaded file using PHPs built-in method\n if (!is_uploaded_file($fieldData[$fieldName]['tmp_name'])) return false;\n }\n \n return true;\n }",
"public function requires_file_upload_message() {\n\n\t\t// Generate form editor URL.\n\t\t$url = add_query_arg( array( 'view' => null, 'subview' => null ) );\n\n\t\treturn sprintf(\n\t\t\tesc_html__( \"You must add a File Upload field to your form before creating a feed. Let's go %sadd one%s!\", 'gravityformsdropbox' ),\n\t\t\t'<a href=\"' . esc_url( $url ) . '\">', '</a>'\n\t\t);\n\n\t}",
"protected function checkProperty(/**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$value, /**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$validators, /**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$propertyName) {}",
"public function testFileValue() : void {\n\t\t$this->assertEquals('kc_file', PostType::File->value);\n\t}",
"public function rules()\n {\n return [\n [['file_id'], 'required'],\n [['file_id','ukuran'],'integer'],\n [['tgl_upload', 'tgl_proses'], 'safe'],\n [['namafile'], 'file','skipOnEmpty' => false, 'extensions' => 'xlsx', 'on' => 'create'],\n [['file_id'], 'unique'],\n ];\n }",
"protected function getFileFieldSettings() { ?>\n\t\t<div class=\"form-group\" v-if=\"['job_logo', 'job_cover', 'job_gallery'].indexOf(field.slug) <= -1\">\n\t\t\t<label>Allowed file types</label>\n\t\t\t<select multiple=\"multiple\" v-model=\"field.allowed_mime_types_arr\" @change=\"editFieldMimeTypes($event, field)\">\n\t\t\t\t<?php foreach ( (array) get_allowed_mime_types() as $extension => $mime ): ?>\n\t\t\t\t\t<option value=\"<?php echo \"{$extension} => {$mime}\" ?>\"><?php echo $mime ?></option>\n\t\t\t\t<?php endforeach ?>\n\t\t\t</select>\n\t\t\t<br><br>\n\t\t\t<label><input type=\"checkbox\" v-model=\"field.multiple\" class=\"form-checkbox\"> Allow multiple files?</label>\n\t\t</div>\n\t\t<div class=\"form-group\" v-show=\"field.multiple\">\n\t\t\t<label>Maximum number of uploads allowed</label>\n\t\t\t<input type=\"number\" v-model=\"field.file_limit\" style=\"width: 100px; margin: 0;\">\n\t\t</div>\n\t<?php }",
"public function isUploadedFile() {}",
"public function testFilesEmpty()\n {\n $this->assertArrayEmpty($this->get_reflection_property_value('files'));\n }",
"function userfile_check()\n\t\t{\n\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('userfile_check', 'The {field} file is required');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"public function rules()\n {\n return [\n 'logo' => ['required', 'file'],\n ];\n }",
"public function set_file($file){\n //error checking\n if(empty($file) || !$file || !is_array($file)){\n $this->errors[] =\"There was no file uploaded here\";\n return false; \n // Check if the file is uploaded \n }elseif($file['error'] !==0){\n \n $this->error[] = $this->upload_errors_array[$file['error']];\n return false;\n \n }else {\n //Submit data \n $this->user_image = basename($file['name']); //basename is function\n $this->tmp_path = $file['tmp_name'];\n $this->type = $file ['type'];\n $this->size = $file ['size'];\n }\n }",
"public function checkInlineFileTypeAccessForFieldForFieldNoFiletypesReturnsTrue() {}",
"public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('file', 'required'),\n\t\t\tarray('file','file','types'=>'jpg png'),\n\t\t);\n\t}",
"protected function checkFileUploadEnabled() {}",
"public function canSetFileable();",
"function FileFormField ($name, $description, $optional=false, $options=NULL) {\n $defaultoptions = array(\n 'type' => 'file'\n ,'title' => 'file'\n ,'placeholder' => 'file.ext'\n // Limit how crazy the file name can be\n ,'pattern' => \"/^(\\\\w| |[-_\\\\.]){1,64}$/\"\n ,'directory' => 'files'\n ,'maxsize' => 8388608\n );\n $options = $options ? array_merge($defaultoptions, $options) : $defaultoptions;\n parent::PatternFormField($name, $description, $optional, $options);\n $this->directory = $options['directory'];\n $this->maxsize = $options['maxsize'];\n }",
"function acf_get_file_input($attrs = array())\n{\n}",
"public function isMandatorySave()\n\t{\n\t\treturn $_FILES ? true : false;\n\t}",
"public function isMandatorySave()\n\t{\n\t\treturn $_FILES ? true : false;\n\t}",
"public function getWholeFile()\n {\n \treturn isset($_FILES) ? $_FILES : null;\n }",
"public function file() { return $this->input_file; }",
"public function rules()\n {\n return [\n 'archivo'=>'required|file|between:1,14800|mimes:pdf',\n 'f_estudiante'=>'required_if:bandera,1',\n ];\n }",
"public function rules()\n\t{\n\t\treturn [\n\t\t\t//\n\t\t\t'nama' => 'required',\n\t\t\t'file' => 'required|mimes:pdf,doc,docx|max:5120',\n\t\t];\n\t}",
"public function renderField()\n\t{\n\t\tif ($this->hasModel()) {\n\t\t\techo \\CHtml::activeFileField($this->model, $this->attribute, $this->options);\n\n\t\t} else {\n\t\t\techo \\CHtml::fileField($this->options['name'], $this->value, $this->options);\n\t\t}\n\t}",
"public function setFile($file=null){\r\n if(is_array($file)){\r\n $this->file=$file;\r\n }else{\r\n $this->file = null;\r\n }\r\n }",
"public function rules()\n {\n return [\n 'name_file' => 'required|file|max:10000,mimes:csv'\n ];\n }",
"abstract protected function validateFile() : object;",
"function file_field($object, $field, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_input_field_tag(\"file\", $options);\n}",
"function FileVar($name, $default_value = false) {\r\n if (!isset($_FILES))\r\n return false;\r\n if (isset($_FILES[$name]['name'])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_FILES[$name]['name']);\r\n return $_FILES[$name]['name'];\r\n }\r\n return $default_value;\r\n}",
"function validateUploadField(&$model, $fieldData, $fieldName) {\n if (empty($fieldData[$fieldName]) || !is_array($fieldData[$fieldName])) return false;\n return true;\n }",
"public function rules()\n\t{\n\t\treturn [\n\t\t\t'company_name' => 'required',\n\t\t\t'company_logo_small' => 'file|image|mimes:jpeg,jpg,png,gif|max:200',\n\t\t];\n\t}",
"private function _file()\n {\n return Html::getAttributeValue($this->model, $this->attribute);\n }",
"public function hasFile()\n {\n \treturn empty($_FILES) ? false : true;\n }",
"public function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t// username and password are required\r\n\t\t\tarray('file', 'required'),\r\n\t\t\t// rememberMe needs to be a boolean\t\r\n\t\t\tarray('file', 'file',\r\n 'types'=>'jpg,csv',\r\n 'maxSize'=>1024 * 1024 * 1, // 1MB\r\n 'tooLarge'=>'The file was larger than 1MB. Please upload a smaller file.',\r\n ),\t\r\n array('file', 'safe'),\t\r\n\t\t);\r\n\t}",
"public function file ( \\r8\\Form\\File $field )\n {\n $this->addField( \"file\", $field );\n }",
"public function rules()\n {\n return [\n 'importedFile' => 'required',\n ];\n }",
"public function fileData($key)\n {\n \treturn isset($_FILES[$key]) ? $_FILES[$key] : null;\n }",
"public function rules()\n {\n return [\n 'photo_id'=>'required|mimes:jpeg,png,jpg,svg|max:10240'\n ];\n }",
"public function rules()\n {\n return [\n 'file' => 'required|mimes:pdf|max:10240',\n 'description' => 'required|max:255',\n ];\n }",
"public function rules()\n {\n return [\n\t\t\t'name' => 'required',\n 'file' => 'required|image|mimes:jpeg,png,jpg|max:2048' \n ];\n }",
"public function hasFile()\n {\n foreach ($this->fields() as $field) {\n if ($field instanceof Field\\File) {\n return true;\n }\n }\n\n return false;\n }",
"public function getValue(){\r\n\t\tif(\r\n\t\t\tisset($_FILES[$this->name]['tmp_name'])\r\n\t\t\t&& (strlen($_FILES[$this->name]['tmp_name']) > 0)\r\n\t\t\t&& ($_FILES[$this->name]['size'] > 0)\r\n\t\t\t&& ($_FILES[$filedataName]['error'] == UPLOAD_ERR_OK)\r\n\t\t){\r\n\t\t\treturn $_FILES[$this->name]['name'];\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}",
"function tf_file_upload_option_customizer_get_value() {\r\n\r\n if ( ! empty( $_POST['nonce'] ) && ! empty( $_POST['id'] ) ) {\r\n\r\n $nonce = sanitize_text_field( $_POST['nonce'] );\r\n $attachmentID = sanitize_text_field( $_POST['id'] );\r\n // $size = sanitize_text_field( $_POST['size'] );\r\n\r\n if ( wp_verify_nonce( $nonce, 'tf_file_upload_option_nonce' ) ) {\r\n $attachment = $attachmentID;\r\n if ( ! empty( $attachment ) ) {\r\n wp_send_json_success( $attachment );\r\n }\r\n }\r\n }\r\n\r\n // Instead of doing a wp_send_json_error, send a blank value instead so.\r\n // Javascript adjustments still get executed.\r\n wp_send_json_success( '' );\r\n }",
"function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }",
"public function getUploadedFilePath()\n {\n return !empty($this->filepath) ? $this->filepath : \n (!empty($this->filename) ? (Yii::$app->params['uploadPath'] . $this->filename) : null);\n }",
"public function validateCanUpload()\n {\n //do not allow upload for active session\n if (StreamSession::activeExists($this->shop->getId())) {\n $this->addError('file', Yii::t('app', 'You cannot upload products while Live Stream is active'));\n }\n }",
"private function isFormFile(array $value)\n\t{\n\t\tif ($value['size'] !== 0 && $value['type'] !== '' && $value['tmp_name'] !== '') {\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function rules()\n {\n return [\n 'file' => 'required|mimes:jpg,jpeg,png,bmp'\n ];\n }",
"public function verifyFile(){\n if (isset($_POST[\"submitbutton\"])){//if submit button is pressed\n if ($_FILES[\"fileSelectField\"][\"type\"] != \"application/pdf\"){//checks file type\n return \"File must be a pdf file\";\n }\n else if ($_FILES[\"fileSelectField\"][\"size\"] > 100000){//checks file size\n return \"File is too big\";\n }\n else {//runs function to add file if no problems\n return $this->addFile();\n }\n }\n }",
"function validate() {\r\n\t\t$post_ok = isset($this->params['form']['Filedata']);\r\n\t\t$upload_error = $this->params['form']['Filedata']['error'];\r\n\t\t$got_data = (is_uploaded_file($this->params['form']['Filedata']['tmp_name']));\r\n\t\t\r\n\t\tif (!$post_ok){\r\n\t\t\t$this->setError(2000, 'Validation failed.', 'Expected file upload field to be named \"Filedata.\"');\r\n\t\t}\r\n\t\tif ($upload_error){\r\n\t\t\t$this->setError(2500, 'Validation failed.', $this->getUploadErrorMessage($upload_error));\r\n\t\t}\r\n\t\treturn !$upload_error && $post_ok && $got_data;\r\n\t}",
"public function rules()\n {\n return [\n 'file_description' => 'string',\n 'file_title' => 'string',\n 'file_orig_name' => 'required|string',\n 'cat_id' => 'required|numeric'\n ];\n }",
"protected function isFile() {}",
"public function get_file_params()\n {\n }",
"public function set_file($file){\n\t\tif(empty($file) || !$file || !is_array($file)){\n\t\t$this->errors[] = \"There Was No File Uploaded\";\n\t\treturn false;\t\n\t\t}elseif($file['error']!=0){\n\t\t\t$this->errors[]\t= $this->upload_errors_array[$file['error']];\n\t\t}else{\n\t\t\t$this->user_image = basename($file['name']);\n\t\t\t$this->tmp_path = $file['tmp_name'];\n\t\t\t$this->type = $file['type'];\n\t\t\t$this->size = $file['size'];\n\t\t}\n\t}",
"public function it_shows_file_input_on_type_of_file()\n {\n // configure\n $inputs = [\n [\n 'type' => 'file',\n 'name' => 'tc',\n 'label' => 'Upload Terms and Conditions'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"file\"', false);\n }",
"protected function validateRequired($value){\n\t\tif (is_null($value)){\n\t\t\treturn false;\n\t\t}elseif (is_string($value) && trim($value) === ''){\n\t\t\treturn false;\n\t\t}elseif ((is_array($value) || $value instanceof \\Countable) && count($value) < 1){\n\t\t\treturn false;\n\t\t}elseif ($value instanceof File){\n\t\t\treturn (string) $value->getPath() != '';\n\t\t}\n\t\treturn true;\n\t}",
"public function getFile() {}",
"public function getFile() {}",
"public function rules()\n {\n return [\n 'image'=>'required|mimes:jpeg,jpg,png,gif|image|max:6000'\n ];\n }",
"public function getFilename()\n {\n return null;\n }",
"function validateUploadPath(&$model, $fieldData) {\n $path = WWW_ROOT . 'files' .DS;\n \n if (!is_writable($path)) return false;\n \n return true;\n }",
"function oa_export_blueprint_import_form_validate($form, &$form_state) {\n if (!$_FILES['files']['name']['file']) {\n drupal_set_message(t('Please upload a file to import.'), 'error');\n form_set_error('', NULL);\n }\n}",
"public function createInput()\n {\n $file = new File();\n $this->assertEquals('file', $file->getAttribute('type'));\n }",
"public function getImageFile():?File\n {\n return $this->imageFile;\n }",
"public function getFileSpecification() {}",
"public function getFileSpecification() {}",
"public function getFileSpecification() {}",
"public function getFileSpecification() {}",
"public function getFileSpecification() {}",
"public function store(Request $request)\n{\n //\n $rules =[\n 'testFile'=>'required'\n ];\n\n $msg=[\n 'testFile.required'=>'Java File must not empty'\n ];\n\n $validator=Validator::make($request->all(),$rules,$msg);\n\n //jika data ada yang kosong\n if ($validator->fails()) {\n\n //refresh halaman\n return Redirect::to('admin/testfiles/create/'.$request->get('topic'))\n ->withErrors($validator);\n\n }else{\n $file = $request->file('testFile');\n $filename = $file->getClientOriginalName();\n $strpath = 'TestFiles/'.$request->get('topic');\n $testFile=$file->store('testfiles','public');\n\n $entity=new \\App\\TestFiles;\n\n $entity->taskid=$request->get('taskid');\n $entity->fileName=$filename;\n $entity->topic=$request->get('topic');\n $entity->content=$testFile;\n $entity->save();\n\n Session::flash('message','A New Test File Stored');\n\n //return \"Add new topic is success\";\n return Redirect::to('admin/testfiles?topicList='.$request->get('topic'));\n }\n}",
"function validateFileExtension(&$model, $fieldData, $fieldName, $allowedExts = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $extension = strtolower(pathinfo($fieldData[$fieldName]['name'], PATHINFO_EXTENSION));\n \n if (!is_array($allowedExts) || (!in_array('*', $allowedExts) && !in_array($extension, $allowedExts))) return false;\n \n return true;\n }",
"public function rules()\n {\n return [\n 'file' => 'required|mimes:xslx'\n ];\n }",
"public function rules()\n {\n return array(\n array('cameraImage','image','file',\n 'types'=>'jpg, gif, png, jpeg',\n 'maxSize'=>1024 * 1024 * 2,\n 'tooLarge'=>'File has to be smaller than 50MB'\n )\n\n );\n\n\n }",
"public function rules()\n {\n return [\n 'name' => 'required|max:255',\n 'alias' => 'required|max:255',\n 'description' => 'max:255',\n 'file' => 'mimes:doc,docx,dot,pdf,xlsx,xls,xlm,xla,xlc,xlt,xlw,xlam,xlsb,xlsm,xltm,csv|max:20480',\n 'link' => 'required_if:file,' . null . '|nullable|max:255|url',\n ];\n }",
"function form_file($name = '') {\n\n\tif ($name == 'attachment') {\n\t\tunset($name);\n\t\t$name = \"\";\n\t}\n\n\t$value = html_form_escape($value, $override);\n\n\t$name = 'attachment' . $name;\n\treturn \"<input type=\\\"file\\\" name=\\\"$name\\\" />\";\n\n}",
"public function getCleanFile()\n {\n return $this->_getCleanProperty('file');\n }",
"protected function prepareEnvForEmptyFile()\n {\n $file = 'magento_empty.jpg';\n\n /** @var \\Magento\\Framework\\Filesystem $filesystem */\n $filesystem = $this->objectManager->get(\\Magento\\Framework\\Filesystem::class);\n $tmpDirectory = $filesystem->getDirectoryWrite(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::SYS_TMP);\n $filePath = $tmpDirectory->getAbsolutePath($file);\n\n $_FILES['options_1_file'] = [\n 'name' => 'test.jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => $filePath,\n ];\n }",
"public function isFileOperationAllowed() {}",
"public function rules()\n {\n return [\n 'private' => 'boolean',\n 'name' => 'string|max:150|required',\n 'cover' => 'file|max:10240|nullable|mimes:jpeg,jpg,png',\n 'file' => 'file|max:204800|required|mimes:mp3'\n ];\n }",
"function _webform_submission_display_file($data, $component, $enabled = FALSE) {\r\n $filedata = unserialize($data['value'][0]);\r\n $form_item = _webform_render_file($component);\r\n if (!$enabled) {\r\n $form_item['#type'] = 'textfield';\r\n $form_item['#tree'] = TRUE;\r\n $form_item['#attributes']['readonly'] = 'readonly';\r\n $form_item['#default_value'] = empty($filedata['filepath']) ? $filedata['error'] : $filedata['filepath'];\r\n }\r\n if (!empty($filedata['filename'])) {\r\n $form_item['#suffix'] = ' <a href=\"'. webform_file_url($filedata['filepath']) .'\">Download '. webform_file_name($filedata['filepath']) .'</a>'. $form_item['#suffix'];\r\n if ($enabled) {\r\n $form_item['#description'] = t('Uploading a new file will replace the current file.');\r\n $form_item['existing'] = array(\r\n '#type' => 'value',\r\n '#value' => $filedata,\r\n );\r\n }\r\n }\r\n return $form_item;\r\n}",
"public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('pdf_file', 'file', 'types'=>'pdf'),\n\t\t);\n\t}",
"function haveFileUploadField()\n\t{\n\t\t$haveUploadField = false;\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\tif ($element->type == 'uploadfile') {\n\t\t\t\t$haveUploadField = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $haveUploadField;\n\t}",
"public function rules() {\n return array(\n array('file', 'file'),\n );\n }",
"public function setFileSingle($field, $value)\n {\n\n if (Session::has('upload.' . $this->config . '.' . $field)) {\n $value = Request::session()->pull('upload.' . $this->config . '.' . $field);\n $value = end($value);\n Request::session()->save();\n } elseif (!empty($value)) {\n $value = $value;\n } elseif (Request::has($field)) {\n $value = Request::get($field);\n } else {\n return;\n }\n\n if (empty($value)) {\n $value = [];\n }\n\n $this->setAttribute($field, $value);\n }"
] | [
"0.6987462",
"0.6811598",
"0.6588868",
"0.65699726",
"0.65216774",
"0.6491254",
"0.63153064",
"0.6295755",
"0.6212579",
"0.61824673",
"0.6164055",
"0.6144368",
"0.6141305",
"0.60929865",
"0.6085833",
"0.60772556",
"0.60756683",
"0.60717565",
"0.6047275",
"0.6042965",
"0.6032395",
"0.60298973",
"0.6029436",
"0.60192996",
"0.5963955",
"0.5954131",
"0.5936431",
"0.5922908",
"0.59091735",
"0.59089476",
"0.5876061",
"0.5854493",
"0.5846315",
"0.58368677",
"0.5830337",
"0.5830337",
"0.5806008",
"0.5780851",
"0.57799345",
"0.5758897",
"0.5756643",
"0.57361376",
"0.57290864",
"0.5727749",
"0.5711464",
"0.5705188",
"0.56911093",
"0.5678024",
"0.5670142",
"0.5654699",
"0.56452715",
"0.5641451",
"0.56352973",
"0.56237507",
"0.5619481",
"0.56181633",
"0.561768",
"0.56077594",
"0.56001323",
"0.55953956",
"0.5585123",
"0.5574006",
"0.557118",
"0.5568814",
"0.5563423",
"0.55563295",
"0.5551212",
"0.55477643",
"0.5539651",
"0.5528664",
"0.55259705",
"0.55212855",
"0.55177987",
"0.551702",
"0.551601",
"0.54977924",
"0.54957205",
"0.5491059",
"0.548404",
"0.5481827",
"0.54787034",
"0.5474855",
"0.5474385",
"0.5474385",
"0.5474385",
"0.54737306",
"0.54723674",
"0.54713595",
"0.5470402",
"0.54692876",
"0.5466335",
"0.5462855",
"0.5462702",
"0.5461201",
"0.5458531",
"0.5453732",
"0.54446936",
"0.54445595",
"0.5442589",
"0.544169",
"0.5438738"
] | 0.0 | -1 |
the absolute directory path where uploaded | protected function getUploadRootDir()
{
// documents should be saved
return __DIR__.'/../../../web/'.$this->getUploadDir();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getUploadDir()\n {\n return 'uploads';\n }",
"protected function getUploadDir() {\n return '/uploads';\n }",
"public function getRelativeUploadPath(): string;",
"protected function getUploadRootDir()\r\n {\r\n // the absolute directory path where uploaded documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }",
"protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/';\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }",
"protected function getUploadRootDir()\n {\n// documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadDir() {\r\n return 'uploads/documents';\r\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"private function getUploadRootDir(){\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadDir()\n {\n return 'upload/files';\n }",
"public function getUploadRootDir(){\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadDir()\n\t{\n\t\t// get rid of the __DIR__ so it doesn't screw when displaying uploaded doc/image\n\t\t// in the view.\n\t\treturn 'uploads/mybudget';\n\t}",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/';\n }",
"public function getUploadDir(){\n return dirname(_FILE_). \"/img/\";\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/ads/images';\n }",
"protected function getUploadDir()\r\n {\r\n // when displaying uploaded doc/image in the view.\r\n return 'uploads/images';\r\n }",
"protected function getUploadDir()\r\n\t{\r\n\t\treturn 'uploads/documents';\r\n\t}",
"protected function getUploadDir()\n {\n \t// when displaying uploaded doc/image in the view.\n \treturn 'uploads/imagen';\n }",
"public function getUploadDir()\n {\n // image profile should be saved\n return __DIR__.'/../../../../web/uploads/evento/'.$this->id;\n }",
"public function getUploadRootDir() {\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}",
"public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }",
"public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }",
"public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'web/images';\n }",
"protected function getUploadRootDir()\r\n {\r\n // documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}",
"protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/contact/contactlist/images';\n }",
"protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }",
"protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/labels';\n }",
"protected function getUploadRootDir()\r\n\t{\r\n\t\treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n\t}",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/images/profile';\n }",
"protected function getUploadRootDir()\n {\n //$racine = sudo chmod ;\n return __DIR__.'/../../../web/ressources/uploads/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n \t// documents should be saved\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadDir()\n {\n return __DIR__ . '/../../../../web' . $this->getFilesPath();\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user';\n }",
"public function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../'.$this->getUploadDir();\n }",
"public function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"public function uploadPath();",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user/images';\n }",
"public static function uploadPath(): string {\n\t\treturn config('filesystems.upload_folder_name') . DIRECTORY_SEPARATOR . self::UPLOAD_FOLDER_NAME;\n\t}",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/products';\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__ . '/../../../../web/' . self::UPLOAD_ROOT;\n }",
"public function getUploadPath()\n {\n return Yii::$app->params['upload_dir'] . DIRECTORY_SEPARATOR . $this->path;\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/articles';\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../public/'.$this->getUploadDir();\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/tracks';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/guide';\n }",
"protected function getUploadRootDir() {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"public function getUploadedPath()\n {\n return $this->getUploadsFolder() . '/' . $this->getRootUploadedPath();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getUploadDir()\n {\n return 'uploads/serie';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/photos';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/users';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/lots';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/images/agancy';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/subtitles';\n }"
] | [
"0.8005355",
"0.7987917",
"0.7977486",
"0.7972477",
"0.7971831",
"0.79548585",
"0.79398304",
"0.79366845",
"0.79297465",
"0.79209554",
"0.79197216",
"0.7911412",
"0.79051995",
"0.7900123",
"0.78990775",
"0.78984356",
"0.7878848",
"0.7877958",
"0.7873649",
"0.7871114",
"0.78659314",
"0.7860999",
"0.78587663",
"0.784893",
"0.784893",
"0.784228",
"0.783905",
"0.78387475",
"0.78387475",
"0.78387475",
"0.78387475",
"0.78387475",
"0.78387475",
"0.78387475",
"0.78387475",
"0.78337854",
"0.78283346",
"0.78276676",
"0.78252786",
"0.77940327",
"0.7790331",
"0.77822876",
"0.77822226",
"0.778128",
"0.7772334",
"0.7765161",
"0.7764409",
"0.7764109",
"0.7762933",
"0.776068",
"0.7760562",
"0.77553666",
"0.77527744",
"0.7751979",
"0.7751979",
"0.7751144",
"0.7750238",
"0.7746246",
"0.77439815",
"0.7736735",
"0.7734539",
"0.7733748",
"0.77334726",
"0.7732609",
"0.7732609",
"0.7732609",
"0.7732609",
"0.7732609",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7732573",
"0.7729239",
"0.7728543",
"0.77217096",
"0.7720741",
"0.7715466",
"0.77076936"
] | 0.77277666 | 96 |
get rid of the __DIR__ so it doesn't screw up | public function getUploadDir()
{
// when displaying uploaded doc/image in the view.
return 'uploads';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _clearPaths() {\n\t\tApp::build(array('Vendor' => array('junk')), App::RESET);\n\t\tini_set('include_path', 'junk');\n\t}",
"function dirPath() {return (\"../../../../\"); }",
"function appDir($dir)\n{\n return __DIR__.\"/../\".$dir;\n}",
"function clean_path($path){ return str_replace(MMRPG_CONFIG_ROOTDIR, '/', $path); }",
"public function dir_rewinddir() {}",
"function dirPath () { return (\"../../\"); }",
"function fn_get_rel_dir($dir)\n{\n return str_replace(\n rtrim(Registry::get('config.dir.root'), '\\\\/') . '/',\n '',\n $dir\n );\n}",
"function dirPath() { return (\"../\"); }",
"public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}",
"protected static function packagePath(): string\n {\n return dirname(dirname(__DIR__));\n }",
"public function getRootDir()\n {\n return __DIR__;\n }",
"function base_path()\n {\n return dirname(__DIR__);\n }",
"function _get_plugin_directory() {\n return __DIR__;\n}",
"protected function action_getUserMainDir() {}",
"abstract public function getRelativeDataDir();",
"private function getPathToRootDir()\n {\n return '%kernel.project_dir%';\n }",
"private function getBoilerplatePath(): string\n {\n return __DIR__ . '/../boilerplate';\n }",
"public static function _getAppDir($noSlashes){\n return ($noSlashes) ? ltrim(self::APP_BASE_DIR,'/') : self::APP_BASE_DIR;\n }",
"private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }",
"public function iAmInThePhpdocumentorRootDirectory()\n {\n chdir(__DIR__.'/../..');\n }",
"protected function getUploadRootDir()\n {\n return __DIR__ . '/../../../../web/' . self::UPLOAD_ROOT;\n }",
"public function getBasePath()\n {\n return __DIR__ . '/..';\n }",
"public function getRootDir()\n {\n return __DIR__ . '/Fixtures';\n }",
"public function getDeploymentPackageDirectory()\n {\n return __DIR__;\n }",
"protected function defineOriginalRootPath() {}",
"private static function resolveBaseProjectDir(): string\n {\n $temp = explode(DIRECTORY_SEPARATOR, __DIR__);\n array_pop($temp);\n array_pop($temp);\n array_pop($temp);\n return implode(DIRECTORY_SEPARATOR, $temp) . DIRECTORY_SEPARATOR;\n }",
"protected function getAppPath()\n {\n return __DIR__. '/../../../../app/';\n }",
"function getAppPath() {\r\n\r\n $root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\r\n if (substr($root, -1) === '/') { // remove any trailing / which should not be there\r\n $root = substr($root, 0, -1);\r\n }\r\n $dir = str_replace('\\\\', '/', dirname(__FILE__));\r\n\r\n $path = str_replace($root, '', $dir) . '/';\r\n\r\n return $path;\r\n\r\n }",
"private function getAppRootDir()\n {\n return $this->container->get('app.parameter_bag')->get('kernel.project_dir');\n }",
"private function getUploadRootDir(){\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"public function dotEnvPath()\n {\n return __DIR__;\n }",
"public function getRootDir()\n {\n return sys_get_temp_dir() . '/base-kernel/' . 'kernel-' . substr(\n hash(\n 'md5',\n json_encode([\n $this->bundlesToLoad,\n $this->configuration,\n $this->routes,\n ])\n ),\n 0,\n 10\n );\n }",
"public function getBaseDir();",
"protected function removeTestFilePath()\n {\n $path = $this->getTestFilePath();\n FileHelper::removeDirectory($path);\n }",
"protected function cleanup()\n {\n $cleanupDirNames = ['Repository', 'Voter', 'Entity', 'Form', '../templates'];\n foreach ($cleanupDirNames as $cleanupDirName) {\n if (is_dir($dir = __DIR__ . '/App/src/' . $cleanupDirName)) {\n $this->rrmdir($dir);\n }\n }\n // Entity-dir must exist or locators for entity will fail (doctrine functionality; cannot be changed)\n mkdir(__DIR__.'/App/src/Entity');\n }",
"function serendipity_getRealDir($file) {\n $dir = str_replace( \"\\\\\", \"/\", dirname($file));\n $base = preg_replace('@/include$@', '', $dir) . '/';\n return $base;\n}",
"protected function get_templates_dir() {\n\t\treturn untrailingslashit( wct_get_templates_dir() );\n\t}",
"public function removeAppDirectory() {\n $dir = app_path() . '/EasyApi';\n\n $it = new \\RecursiveDirectoryIterator($dir, \\RecursiveDirectoryIterator::SKIP_DOTS);\n $files = new \\RecursiveIteratorIterator($it,\n \\RecursiveIteratorIterator::CHILD_FIRST);\n foreach($files as $file) {\n if ($file->isDir()){\n rmdir($file->getRealPath());\n } else {\n unlink($file->getRealPath());\n }\n }\n rmdir($dir);\n }",
"public function getProjectDir(): string\n {\n return dirname(__DIR__);\n }",
"protected function getPackageRootPath(): string\n {\n return getcwd() . '/';\n }",
"function package_dir()\n {\n $reflector = new ReflectionClass(Service::class);\n\n return dirname($reflector->getFileName());\n }",
"protected function createRealTestdir() {}",
"public function getMockDirPath(): string\n {\n return dirname(__DIR__) . '/mock';\n }",
"protected function getTargetDirectory()\n {\n return '';\n }",
"public function getPackageDir()\n\t{\n\t\treturn __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..';\n\t}",
"protected function cleanDirectories()\n {\n $filesystem = new Filesystem();\n\n $filesystem->cleanDirectory($this->getSeedFilePath());\n\n $filesystem->cleanDirectory(database_path('factories'));\n }",
"function base_path($path)\n{\n return __DIR__.'/../'.$path;\n}",
"static public function get_dir() {\n\t\treturn apply_filters( 'themeisle_site_import_uri', trailingslashit( get_template_directory_uri() ) . self::OBOARDING_PATH );\n\t}",
"function serendipity_httpCoreDir() {\n if (!empty($_SERVER['SCRIPT_FILENAME']) && substr(php_sapi_name(), 0, 3) != 'cgi') {\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/';\n }\n\n if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {\n return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';\n }\n\n return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';\n}",
"function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}",
"public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}",
"public function getModuleDir()\n {\n return dirname(Mage::getModuleDir('etc', 'Ts_Phpids')) . DS;\n }",
"public function clearCompileDir();",
"protected function get_dir() {\r\n return dirname( ( new \\ReflectionClass( static::class ) )->getFileName());\r\n }",
"public function getRelativeDataDir()\n\t{\n\t\treturn 'ash';\n\t}",
"public static function getModulePath()\n {\n return dirname(__DIR__);\n }",
"protected function _getSchemaDir()\n\t{\n\t\treturn __DIR__ . DS . '../Xsd/File/';\n\t}",
"public function getRootDir();",
"private function projectPath()\n { }",
"protected function emptyOutputdir($dir_p){\n $output_dir = realpath($dir_p);\n if($output_dir === false){\n throw new Exception(\"Wrong output directory given: $dir_p\");\n }\n\n\n\t\t$g = $output_dir . '/generated-helpers';\n\t\tif(!file_exists($g)){\n\t\t\tmkdir($g);\n return;\n\t\t}\n\t\t$arr = scandir($g);\n\t\t\n\t\tforeach($arr as $f){\n\t\t\tif(is_file($g.'/'.$f)){\n\t\t\t\tunlink($g.'/'.$f);\n\t\t\t}\n\t\t}\n\t}",
"public function GetAppDir ();",
"private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }",
"public function removeTempFiles()\n {\n parent::removeTempFiles();\n $this->removeDir($this->cacheDir(\"upgrades/driver/\"));\n }",
"function package_resources_dir()\n {\n return\n package_dir().\n DIRECTORY_SEPARATOR.\n 'config'.\n DIRECTORY_SEPARATOR.\n 'resources';\n }",
"public function emptyCompileDir()\n {\n $this->console(\"Deleting compiled assets\");\n $dir = $this->compilePath() . $this->prefix();\n if (is_dir($dir)) {\n Rails\\Toolbox\\FileTools::emptyDir($dir);\n }\n }",
"public function projectRoot() {\n return realpath(__DIR__) . '/../../../../../../../composer/Plugin/Scaffold';\n }",
"public function base_dir(){\n return $this->plugin_dir() . 'base/';\n }",
"protected function getTestsRootPath()\n {\n return dirname(__FILE__);\n }",
"private function getUploadRootDir()\n {\n return __DIR__ . \"/../../../../web\" . $this->getUploadDir();\n }",
"public function getDir();",
"protected function createSrcFolderInApplication(){\n \n $srcDirPath = DIR_APPLICATION . DIRECTORY_SEPARATOR . DIRNAME_CLASSES;\n $filesystem = new \\Illuminate\\Filesystem\\Filesystem();\n if(!$filesystem->exists($srcDirPath)) {\n $filesystem->makeDirectory($srcDirPath);\n }\n }",
"protected function getUploadDir()\n\t{\n\t\t// get rid of the __DIR__ so it doesn't screw when displaying uploaded doc/image\n\t\t// in the view.\n\t\treturn 'uploads/mybudget';\n\t}",
"public function getLogDir(): string\n {\n return __DIR__ . '/../../../../../../var/logs';\n }",
"public function testBasedir()\n {\n $this->buildContainer(\n $this->resolveOptions([\n ])\n );\n }",
"protected function destinationDir(): string\n {\n return $this->container->get('config')->get('app', 'app_dir') . '/app/' . $this->namespacePath();\n }",
"public function getRootDirectory()\n {\n return __DIR__.'/../..';\n }",
"protected static function getTestsRuntimePath()\n {\n return __DIR__ . '/runtime';\n }",
"private function checkBaseDir() { \n $path = __DIR__; \n return self::checkDirRecursive($path);\n }",
"protected function getTmpUploadRootDirLogo() {\n\t\treturn __DIR__ . '/../../../../web/uploads/hebergement/logos/logo';\n\t}",
"public function plugin_dir(){\n return trailingslashit(plugin_dir_path( __FILE__ ));\n }",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"public function getDir(): string;",
"public function getUploadRootDir(){\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }",
"static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }",
"function base_path($path = '')\n {\n return str_replace('//' ,'/',str_ireplace('/' . SYSTEMPATHS['core'], '/', __DIR__) . '/' . $path);\n }",
"public function getLibDir()\n {\n return Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'hycube' . DS . 'geoip';\n }",
"public function getProjectDirectory(): string\n {\n return realpath(__DIR__ . '/../../project/sylius');\n }",
"public function getFileBaseDir()\n {\n return Mage::getBaseDir('media').DS.'invitationstatus'.DS.'file';\n }",
"abstract public function directoryLocation();",
"protected function getUploadRootDir() {\r\n return __DIR__ . '/../../../../web/' . $this->getUploadDir()\r\n\r\n ;\r\n }",
"function _get_plugin_directory() {\n return wp_normalize_path( trailingslashit(dirname( __FILE__ )));\n}",
"private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}",
"protected static function publicFilesDirectoryFallback() {\n return PathResolver::siteDirectory() . '/files';\n }",
"public function getUploadRootDir() {\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }",
"protected function getTmpUploadRootDirPhotoPayante() {\n\t\treturn __DIR__ . '/../../../../web/uploads/hebergement/photo_payante/photo_payante';\n\t}",
"protected function getBaseDir()\n {\n $ref = new \\ReflectionObject($this);\n\n return realpath(dirname(dirname($ref->getFileName())));\n }",
"public function setUp(): void\n {\n parent::setUp();\n\n Settings::resetStaticProps();\n\n $dir = self::resolveBaseProjectDir();\n chdir($dir);\n Settings::setProjectRootDir($dir);\n }",
"public function tearDownWorkingDir()\n {\n $this->montserrat->tearDown();\n }",
"protected function getAppConfigDir()\n {\n return $this->rootDir . 'src/' . $this->appName . '/conf/';\n }",
"function __getTestFilesPath($isApp = true) {\n\t\t$manager = CodeCoverageManager::getInstance();\n\t\t$path = ROOT . DS;\n\n\t\tif ($isApp) {\n\t\t\t$path .= APP_DIR . DS;\n\t\t} elseif (!!$manager->pluginTest) {\n\t\t\t$pluginPath = APP . 'plugins' . DS . $manager->pluginTest . DS;\n\n\t\t\t$pluginPaths = App::path('plugins');\n\t\t\tforeach ($pluginPaths as $tmpPath) {\n\t\t\t\t$tmpPath = $tmpPath . $manager->pluginTest . DS;\n\t\t\t\tif (file_exists($tmpPath)) {\n\t\t\t\t\t$pluginPath = $tmpPath;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$path = $pluginPath;\n\t\t} else {\n\t\t\t$path = TEST_CAKE_CORE_INCLUDE_PATH;\n\t\t}\n\n\t\treturn $path;\n\t}"
] | [
"0.6684865",
"0.64995277",
"0.6411538",
"0.63900113",
"0.63626224",
"0.6359468",
"0.6357689",
"0.6331285",
"0.6302421",
"0.6276588",
"0.6257401",
"0.6169059",
"0.61551183",
"0.6075298",
"0.60708284",
"0.6053722",
"0.6036839",
"0.60255325",
"0.60246104",
"0.59848154",
"0.59682554",
"0.5942305",
"0.593263",
"0.592083",
"0.5918344",
"0.59144336",
"0.5899181",
"0.5896468",
"0.5885297",
"0.5883759",
"0.58834547",
"0.5875729",
"0.58723855",
"0.58654314",
"0.5852417",
"0.58415806",
"0.58398646",
"0.583738",
"0.5817327",
"0.5816202",
"0.5804465",
"0.580328",
"0.5801309",
"0.579181",
"0.5788062",
"0.5783353",
"0.577662",
"0.57761043",
"0.57760763",
"0.57704353",
"0.57307565",
"0.57251745",
"0.5723829",
"0.5723487",
"0.5718061",
"0.5716185",
"0.5713604",
"0.57089525",
"0.5707099",
"0.5705834",
"0.57022077",
"0.5701699",
"0.5699521",
"0.56994313",
"0.56948763",
"0.5693984",
"0.56929815",
"0.5690978",
"0.5690518",
"0.5688099",
"0.56838685",
"0.56837845",
"0.56826496",
"0.56819695",
"0.5678279",
"0.56633896",
"0.5658513",
"0.5657554",
"0.56484574",
"0.5643612",
"0.5638556",
"0.5638556",
"0.5628813",
"0.56273556",
"0.5620842",
"0.5618603",
"0.56185865",
"0.5618157",
"0.56170326",
"0.56136537",
"0.56105024",
"0.56033343",
"0.5597599",
"0.5596558",
"0.5593873",
"0.55934834",
"0.5592327",
"0.55884475",
"0.558799",
"0.55762833",
"0.55729336"
] | 0.0 | -1 |
/ Initialize action controller here | public function init()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init()\n {\n /* Initialize action controller here */\n }",
"public function init()\n {\n /* Initialize action controller here */\n }",
"protected function initializeController() {}",
"protected function initializeAction() {}",
"protected function initializeAction() {}",
"protected function initializeAction() {}",
"protected function initAction()\n {\n }",
"protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {\n\n\t}",
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}",
"public function __construct($controller,$action) {\n\t\tparent::__construct($controller, $action);\n\t\t\n\t}",
"public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }",
"public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }",
"protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }",
"public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }",
"public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }",
"public static function init() {\n\t\tself::setup_actions();\n\t}",
"protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}",
"public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }",
"public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }",
"protected function initializeAction()\n {\n $this->extKey = GeneralUtility::camelCaseToLowerCaseUnderscored('BwrkOnepage');\n /** @var LanguageAspect $languageAspect */\n $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');\n $this->languageUid = $languageAspect->getId();\n }",
"protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }",
"public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }",
"public function init() {\n\t\t$this->load_actions();\n\t}",
"public function init()\r\n {\r\n\r\n /* Initialize action controller here */\r\n\r\n //=====================================must add in all Controller class constructor ===================================//\r\n if(defined('SITEURL')) $this->site_url = SITEURL;\r\n if(defined('SITEASSET')) $this->site_asset = SITEASSET;\r\n $this->view->site_url = $this->site_url;\r\n $this->view->site_asset = $this->site_asset;\r\n Zend_Loader::loadClass('Signup');\r\n Zend_Loader::loadClass('User');\r\n Zend_Loader::loadClass('Request');\r\n //Zend_Loader::loadClass('mailerphp');\r\n\t\t//Zend_Loader::loadClass('Permission');\r\n\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n Zend_Loader::loadClass('LoginAuth');\r\n $this->view->ob_LoginAuth = $this->sessionAuth = new LoginAuth();\r\n\r\n $this->sessionAuth->login_user_check();\r\n\r\n $this->sessionAuth->cookie_check();\r\n $this->view->server_msg = $this->sessionAuth->msg_centre();\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n unset($_SESSION['tranzgo_session']['export_list']);\r\n $this->view->ControllerName = $this->_request->getControllerName();\r\n $this->view->page_id = ($_SESSION['tranzgo_session']['role_id']==1)?'5':'7';\r\n //______________________________________must add in all Controller class constructor _____________________________________//\r\n\r\n\r\n }",
"public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}",
"public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}",
"function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->_actionModel = new Action_Model();//khoi tao class\n\t\t}",
"protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}",
"protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}",
"public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }",
"protected function _initControllers()\n\t{\n\t\treturn;\n\t}",
"public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }",
"public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }",
"protected function initializeActionEntries() {}",
"protected function initializeAction() {\n\t\t$this->feusers = $this->feusersRepository->findByUid( $GLOBALS['TSFE']->fe_user->user['uid'] ) ;\n\t\t$this->schule = $this->feusers->getSchule();\n\t\n\t\t$this->extKey = $this->request->getControllerExtensionKey();\n\t\t$this->extPath = t3lib_extMgm::extPath($this->extKey);\n\t\n\t\t$this->importClassFile = $this->extPath.'Classes/tmp/class.importtext.php';\n\t\t$this->importClass = 'ImportText';\n\t \n\t\tif ( $this->settings[pidAjaxContainerKlassenuebersicht] > 0) $this->pidAjaxContainerKlassenuebersicht = (int) $this->settings[pidAjaxContainerKlassenuebersicht];\n\t\n\t}",
"public function init(){\r\n\t$this->_helper->_acl->allow('public',NULL);\r\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\r\n\t$this->_contexts = array('xml','json');\r\n\t$this->_helper->contextSwitch()\r\n\t\t->setAutoDisableLayout(true)\r\n\t\t->addActionContext('oneto50k',$this->_contexts)\r\n\t\t->addActionContext('index',$this->_contexts)\r\n\t\t->initContext();\r\n\t}",
"private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}",
"public function initBaseController();",
"public function init() {\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t$this->_helper->acl->allow('public',null);\n\t\t$this->_helper->contextSwitch()\n\t\t\t ->setAutoDisableLayout(true)\n\t\t\t ->addActionContext('index', array('xml','json'))\n ->initContext();\n\t}",
"public function __construct()\n {\n // Call the CI_Controller constructor\n parent::__construct();\n }",
"public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function initAction() : object\n {\n /**\n * Show all movies.\n */\n $response = $this->app->response;\n return $response->redirect(\"cms/posts\");\n }",
"protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}",
"public function contentControllerInit()\n\t{\n\t}",
"protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }",
"public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }",
"public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}",
"public function init()\r\n { \r\n //date_default_timezone_set('America/Phoenix');\r\n $ajaxContext = $this->_helper->getHelper('AjaxContext');\r\n\t$ajaxContext->addActionContext('list', 'html')\r\n ->addActionContext('edit', 'html')\r\n ->addActionContext('dashboard', 'html')\r\n ->addActionContext('handler', 'html')\r\n ->initContext();\r\n $auth = Zend_Auth::getInstance();\r\n $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\r\n $type = $this->getRequest()->getParam('type');\r\n if (!$auth->hasIdentity() && $action!='handler') {\r\n //echo \"THIS IS AN ERROR: \".$action;\r\n $this->_redirect('login', array('UseBaseUrl' => true));\r\n }\r\n }",
"public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }",
"public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }",
"public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"function __construct()\n {\n parent::Controller();\n }",
"public function controller()\n\t{\n\t\n\t}",
"public function init() {\n\t\t\t\t\t\t$this->view->controller = $this->_request->getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->action = $this->_request->getParam ( 'action' );\n\t\t\t\t\t\t$this->getLibBaseUrl = new Zend_View_Helper_BaseUrl ();\n\t\t\t\t\t\t$this->GetModelOrganize = new Application_Model_ModOrganizeDb ();\n\t\t\t\t\t\t$this->_helper->ajaxContext->addActionContext('deleteOrganisme1','json')->initContext();\n\t\t\t\t\t\t// call function for dynamic sidebar\n\t\t\t\t\t\t$this->_Categories = new Application_Model_ModCatTerm ();\n\t\t\t\t\t\t$parent_id = $this->_getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->secondSideBar = $this->_Categories->showCateParent ( $parent_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}",
"public function init() {\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t$this->_helper->acl->allow('public',null);\n\t$this->_helper->contextSwitch()\n\t\t->setAutoDisableLayout(true)\n\t\t->addActionContext('index', array('xml','json'))\n\t\t->addActionContext('mint', array('xml','json'))\n\t\t->initContext();\n }",
"public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }",
"public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }",
"public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }",
"public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }",
"public function getControllerAction() {}",
"public function __construct($action = '') {\n\t\t$this->app = Application::app();\n\t\t$this->setAction($action);\n\t}",
"function initialize(Controller $controller) {\n $this->controller=&$controller;\n \t}",
"public function __construct($controller, $action) {\n parent::__construct($controller, $action);\n $this->loadModel('Baskets');\n $this->loadModel('Orders');\n $this->loadModel('Messages');\n $this->loadModel('Products');\n\n if(Session::exists(BUYER_SESSION_NAME)) {\n $this->view->totalProductInBasket = $this->BasketsModel->countProductInBasket();\n $this->view->totalOrders = $this->OrdersModel->countSentOrder();\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n } elseif(Session::exists(STORE_SESSION_NAME)) {\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n $this->view->newOrders = $this->OrdersModel->newOrders(Session::get(STORE_SESSION_NAME));\n }\n\n $this->view->setLayout('details');\n }",
"function initialize(Controller $controller) {\n $this->controller = $controller;\n }",
"public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }",
"public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}",
"public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }",
"public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }",
"function __construct($controller, $action)\n {\n global $inflect;\n\n $this->renderPage = true;\n $this->renderHeader = true;\n \t\n\t\t$this->requireUser = false;\n\t\t \n $this->_controller = ucfirst($controller);\n $this->_action = $action;\n \n $model = ucfirst($inflect->singularize($controller));\n $this->$model = new $model;\n\n $this->_template = new Template($controller, $action);\n }",
"public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }",
"public function setup_actions() {}",
"public function init(){\r\n\t\t$this->_data = $this->_request->getParams();\r\n $controller = $this->_data['controller']; //Get controller\r\n $action = $this->_data['action']; //Get action\r\n \r\n $loadfunction = new Default_Model_Common();\r\n foreach($loadfunction->loadFunction($controller) as $value){\r\n if($action == $value['action']){\r\n $load = new $value['model_load']();\r\n $this->view->$value['varname'] = $load->$value['function_load']();\r\n }\r\n }\r\n\r\n $this->view->lang = Zend_Registry::get(\"lang\"); //load language\r\n \r\n //List menu\r\n $listmenu = Zend_Registry::get(\"listmenu\");\r\n $this->view->listmenu = $listmenu;\r\n \r\n $this->view->selectaccount = ' class=\"selected\"';\r\n }",
"function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t// skip the timestamp check for this app\n\t\tSession::check(true);\n\t\t$this->data[\"showActions\"] = true;\n\t\t$this->data[\"csrfToken\"] = CSRF::generateToken();\n\t\t\n\t}",
"abstract public function getControllerAction();",
"public function _construct($controller,$view){\r\n $this->controller = $controller;\r\n }",
"public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }",
"protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}",
"public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }",
"public function init()\n {\n $this->projectController->init();\n }",
"function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}",
"public function __construct() {\n // Call Module constructur\n parent::__construct();\n\n // Add additional route\n $this->_actions['GET']['/people/:id'] = 'people';\n }",
"public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }",
"function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}",
"function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}",
"function __construct($module,$controller,$action) {\n\t\t$this->action = $action;\n\t\t$this->controller = preg_replace('%Controller$%','',$controller);\n\t\t$this->module = $module;\n\n\t\t$jadeCacheDir = J::path(\"App/Cache/Jade/$this->module/$this->controller\");\n\t\t(is_dir($jadeCacheDir)) || mkdir($jadeCacheDir,0777,true);\n\t\t$this->cacheFile = J::path(\"$jadeCacheDir/$this->action.php\");\n\t\t$this->viewFile = J::path(\"App/Modules/$this->module/Views/$this->controller/$this->action.jade\");\n\t}",
"public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }",
"public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}",
"public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }",
"public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }"
] | [
"0.89566046",
"0.89566046",
"0.82057846",
"0.80040884",
"0.80040884",
"0.8004028",
"0.7928566",
"0.7802862",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7741994",
"0.76497424",
"0.7542271",
"0.7541656",
"0.7458589",
"0.7430627",
"0.7382884",
"0.73493266",
"0.73307425",
"0.7321889",
"0.73055863",
"0.7295852",
"0.7274981",
"0.72531754",
"0.7246773",
"0.7212456",
"0.72057885",
"0.71661454",
"0.71535975",
"0.7130195",
"0.7116122",
"0.70873964",
"0.7080964",
"0.7078719",
"0.70654655",
"0.7053619",
"0.7048942",
"0.7036025",
"0.7028192",
"0.6996098",
"0.69914645",
"0.6983108",
"0.69822043",
"0.6978827",
"0.69710267",
"0.69653803",
"0.6934731",
"0.69341296",
"0.6926329",
"0.692468",
"0.69113386",
"0.6909758",
"0.6896174",
"0.68904704",
"0.6874338",
"0.68700373",
"0.68700373",
"0.6862786",
"0.6847179",
"0.6844484",
"0.68443036",
"0.68056643",
"0.6804595",
"0.68018633",
"0.67917275",
"0.6769771",
"0.676602",
"0.6765842",
"0.67582476",
"0.67257833",
"0.6721477",
"0.6721169",
"0.67196625",
"0.67082113",
"0.6707143",
"0.6706214",
"0.67023355",
"0.6700337",
"0.669937",
"0.6695276",
"0.66930395",
"0.6692887",
"0.6688026",
"0.66866106",
"0.66839683",
"0.6674853",
"0.6667438",
"0.6658782",
"0.66509074",
"0.6642763",
"0.66400504",
"0.6634305",
"0.6610988",
"0.6610453",
"0.66071516",
"0.66062886",
"0.6600459",
"0.6599095"
] | 0.0 | -1 |
saca listas de actividades realizadas por un curso | public function resultadoscursoAction()
{
// action body
// requiere layout activado en aplication ini
//$this->_helper->layout->disableLayout();
//echo "voy bien 1";
//configuraci�n inicial
$config = Zend_Registry::get('config');
//echo "voy bien 2";
//CONEXION
$DB = Zend_Db_Table::getDefaultAdapter();
//echo "voy bien 3";
//PARAMETROS
$S_CODCOL=$this->_request->getParam('codigoColegio');
$S_CODLISTA = $this->_request->getParam('codigoLista');
$S_TIPOUSUARIO = $this->_request->getParam('tipoUsuario');
if(trim($S_CODCOL)!="" && trim($S_CODLISTA)!="" )
{
$sql = "select count(rut) as inscritos from olimpiadas.tblacceso where institucion = $S_CODCOL and lista = '$S_CODLISTA';";
$rowset = $DB->fetchAll($sql);
//print_r($rowset);
if (count($rowset) > 0)
{
$equipos = $rowset[0]['inscritos'];
}else{
$equipos = 0;
}
$sql = "Select a.nombre,a.curso, date_format(r.termino,'%H:%i') as hora, r.puntaje, d.*
from tblregistro r, tblacceso a, tbldetallecursos d
where a.rut = r.rut and r.modulo = d.modulo and a.institucion = $S_CODCOL and a.lista = '$S_CODLISTA' and (r.termino <> '' and r.termino is not null)";
//echo($sql);
try{
$rowset = $DB->fetchAll($sql);
//print_r($rowset);
if (count($rowset) > 0)
{
$puntos_acumulados = 0;
$multiplier = 0;
$vector_datos = array();
foreach($rowset as $key => $val){
switch ($val['curso']){
case '3 BASICO' : $multiplier = 500 + ($val['tercero'] * 500); break;
case '4 BASICO' : $multiplier = 500 + ($val['cuarto'] * 500); break;
case '5 BASICO' : $multiplier = 500 + ($val['quinto'] * 500); break;
case '6 BASICO' : $multiplier = 500 + ($val['sexto'] * 500); break;
case '7 BASICO' : $multiplier = 500 + ($val['septimo'] * 500); break;
case '8 BASICO' : $multiplier = 500 + ($val['octavo'] * 500); break;
case 'I MEDIO' : $multiplier = 500 + ($val['primero_medio'] * 500); break;
case 'II MEDIO' : $multiplier = 500 + ($val['segundo_medio'] * 500); break;
case 'III MEDIO' : $multiplier = 500 + ($val['tercero_medio'] * 500); break;
case 'IV MEDIO' : $multiplier = 500 + ($val['cuarto_medio'] * 500); break;
}
$puntos = ($val['puntaje'] * $multiplier) / 100;
$puntos_acumulados+= $puntos;
$vector_datos[] = array(
"nombre" => $val['nombre'],
"descripcion" => $val['descripcion'],
"hora" => $val['hora'],
"puntaje" => round($val['puntaje'],1),
"puntos" => $puntos,
);
}
Zend_Layout::getMvcInstance()->assign('actcol',$vector_datos);
Zend_Layout::getMvcInstance()->assign('puntaje',round($puntos_acumulados / $equipos,1));
Zend_Layout::getMvcInstance()->assign('equipos',$equipos);
Zend_Layout::getMvcInstance()->assign('usuario',$S_TIPOUSUARIO);
}
}
catch (Zend_Exception $e)
{
echo $e->getMessage();
}
}
else
{
$this->_helper->layout->disableLayout();
echo "-1";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listarActivos(){\n $sql = \"SELECT c.idcompra, c.nrofactura, date(c.fecha) as fecha, p.razonsocial AS proveedor, concat(per.nombre, ' ', per.apellido) AS personal, c.monto, c.estado \n FROM compras c JOIN proveedores p ON c.idproveedor = p.idproveedor JOIN personales per ON c.idpersonal = per.idpersonal WHERE c.estado = '1'\n ORDER BY c.idcompra DESC\";\n return ejecutarConsulta($sql);\n }",
"public function listarActivos(){\n\t\t$sql = \"SELECT * FROM producto\n\t\t\t\tWHERE prod_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}",
"public function getAllActive() {}",
"public function listarUsuariosActivos()\r\n\t{\r\n\t\t$eventos=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador WHERE admin_status LIKE 'Activo'\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_pregunta_secreta']=$row['ADMIN_FK_ID_PRE'];\r\n\t\t\t$fila['admin_respuesta_secreta']=$row['ADMIN_RESP_SECRETA'];\r\n\t\t\t$fila['admin_contrasena']=$row['ADMIN_CONTRASENA'];\r\n\t\t\t$eventos[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $eventos;\t\t\r\n\t}",
"public function getActivos()\n {\n $this->plasma = $this->load->database('plasma', TRUE);\n $this->plasma->where('estado',1);\n $this->plasma->order_by('nombre', 'asc');\n $query = $this->plasma->get('institucion');\n return $query->result_array();\n }",
"protected function obtenerNivelesActivos(){\n $fechahoy=new \\DateTime('now',new \\DateTimeZone('America/El_Salvador'));\n //Para jalar el modulo activo\n $modulo=$this->getDoctrine()->getRepository('AppBundle:Modulo')->verificarModulo($fechahoy);\n return $modulo;\n\n }",
"public function usuariosActivos(){\n\t\t\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT idUsuario, identificacion, nombre, apellido FROM tb_usuarios WHERE estado = 'A' AND agenda = 'Si'\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n \tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado[] = $filas;\n } \n \n }//fin if\n\t\t\n return $resultado;\t\t\t\n\t\t\n\t}",
"function list_actividades_componente($com_id){\n $sql = 'select p.prod_id,p.com_id,p.prod_producto,p.prod_ppto,p.indi_id,p.prod_indicador,p.prod_linea_base, p.prod_meta,p.prod_fuente_verificacion,p.prod_unidades,p.prod_ponderacion,p.estado,p.prod_mod,\n p.prod_resultado,p.acc_id,p.prod_cod, p.prod_observacion,p.mt_id,p.or_id,i.indi_descripcion,\n ore.or_id,ore.or_codigo,og.og_id,og.og_codigo, ae.acc_id,ae.acc_codigo,oe.obj_codigo,a.*\n from _productos p\n Inner Join indicador as i On i.indi_id=p.indi_id\n \n Inner Join objetivos_regionales as ore On ore.or_id=p.or_id\n\n Inner Join objetivo_programado_mensual as opm On ore.pog_id=opm.pog_id\n Inner Join objetivo_gestion as og On og.og_id=opm.og_id\n Inner Join _acciones_estrategicas as ae On ae.acc_id=og.acc_id\n Inner Join _objetivos_estrategicos as oe On oe.obj_id=ae.obj_id\n\n Inner Join _actividades as a On a.prod_id=p.prod_id\n \n where p.com_id='.$com_id.' and p.estado!=\\'3\\'\n order by p.prod_cod, oe.obj_codigo, ae.ae asc'; \n $query = $this->db->query($sql);\n return $query->result_array();\n }",
"public function findAllActive() {}",
"public function listAction(){\n\n $session = $this->getRequest()->getSession();\n\n if($session->has('user')){\n\n $options['user'] = $session->get('user');\n \n $em = $this->getDoctrine()->getManager();\n $qb = $em->createQueryBuilder();\n $actividades = $em->getRepository('TesisAdminBundle:Actividad')->findAll();\n $options['actividades'] = $actividades; \n\n return $this->render('TesisAdminBundle:Actividad:list-activities.html.twig',$options);\n }\n\n return $this->render('TesisSCBundle:Main:denegado.html.twig');\n }",
"public function listarComentariosAceitos(){\n $this->validaAutenticacao();\n $comentario = Container::getModel('Comentarios');\n $comentario->__set('idVitima', $_POST['idVitima']);\n\n echo (json_encode($comentario->getComentariosAprovadosDashboard()));\n }",
"public function mostrar1(){\n\t\t\t$db=DB::conectar();\n\t\t\t$listarComentarios=[];\n\t\t\t$select=$db->query('SELECT * FROM comentarios WHERE activo=0');\n\n\t\t\tforeach ($select->fetchAll() as $comentario) {\n\t\t\t\t$myComentario = new Comentario();\n\t\t\t\t$myComentario->setIdproducto($comentario['idproducto']);\t\t\t\t\n\t\t\t\t$myComentario->setIp($comentario['ip']);\n\t\t\t\t$myComentario->setFecha($comentario['fecha']);\n\t\t\t\t$myComentario->setComentario($comentario['comentario']);\n\t\t\t\t$myComentario->setEstrellas($comentario['estrellas']);\n\t\t\t\t$myComentario->setActivo($comentario['activo']);\n\t\t\t\t$myComentario->setEmail($comentario['email']);\n\t\t\t\t$listarComentarios[]=$myComentario;\n\t\t\t\t# code...\n\t\t\t}\n\t\t\treturn $listarComentarios;\n\t\t}",
"private function listado_obras(){\n \treturn Sesion::where(\"inicio\",\">\",Carbon::now())->distinct()->get(['nombre_obra']);\n }",
"public function noticiasActivas(){\r\n\t$objDatos = new clsDatos();\r\n\t$sql=\"select * from noticias where activo='1' order by fecha DESC\";\r\n\t$res = $objDatos->filtroListado($sql);\r\n\treturn $res;\r\n}",
"public function ListarCreditos()\n{\n\tself::SetNames();\n\t$sql =\"SELECT \n\tventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.fechaabono, SUM(abonoscreditos.montoabono) as abonototal, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.emailcliente, cajas.nrocaja\n\tFROM\n\t(ventas LEFT JOIN abonoscreditos ON ventas.codventa=abonoscreditos.codventa) LEFT JOIN clientes ON \n\tclientes.codcliente=ventas.codcliente LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.tipopagove ='CREDITO' GROUP BY ventas.codventa\";\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"public function consulta_usuarios_activos(){\n\t \n\t session_start();\n\t $id_rol=$_SESSION[\"id_rol\"];\n\t \n\t $usuarios = new UsuariosModel();\n\t $catalogo = null; $catalogo = new CatalogoModel();\n\t $where_to=\"\";\n\t $columnas = \" usuarios.id_usuarios,\n\t\t\t\t\t usuarios.cedula_usuarios,\n\t\t\t\t\t usuarios.nombre_usuarios,\n usuarios.apellidos_usuarios,\n\t\t\t\t\t claves.clave_claves,\n\t\t\t\t\t claves.clave_n_claves,\n\t\t\t\t\t usuarios.telefono_usuarios,\n\t\t\t\t\t usuarios.celular_usuarios,\n\t\t\t\t\t usuarios.correo_usuarios,\n\t\t\t\t\t rol.id_rol,\n\t\t\t\t\t rol.nombre_rol,\n\t\t\t\t\t usuarios.estado_usuarios,\n\t\t\t\t\t usuarios.fotografia_usuarios,\n\t\t\t\t\t usuarios.creado\";\n\t \n\t $tablas = \"public.usuarios INNER JOIN public.claves ON claves.id_usuarios = usuarios.id_usuarios\n INNER JOIN public.privilegios ON privilegios.id_usuarios=usuarios.id_usuarios\n INNER JOIN public.rol ON rol.id_rol=privilegios.id_rol\n INNER JOIN public.catalogo ON privilegios.tipo_rol_privilegios = catalogo.valor_catalogo\n AND catalogo.nombre_catalogo='PRINCIPAL' AND catalogo.tabla_catalogo ='privilegios' AND catalogo.columna_catalogo = 'tipo_rol_privilegios'\n INNER JOIN public.catalogo c1 ON c1.tabla_catalogo='usuarios' AND c1.columna_catalogo='estado_usuarios' \n AND c1.nombre_catalogo='ACTIVO' AND c1.valor_catalogo=usuarios.estado_usuarios\";\n\t \n\t \n\t $where = \" 1=1\";\n\t \n\t $id = \"usuarios.id_usuarios\";\n\t \n\t \n\t $action = (isset($_REQUEST['action'])&& $_REQUEST['action'] !=NULL)?$_REQUEST['action']:'';\n\t $search = (isset($_REQUEST['search'])&& $_REQUEST['search'] !=NULL)?$_REQUEST['search']:'';\n\t \n\t \n\t if($action == 'ajax')\n\t {\n\t //estado_usuario\n\t $wherecatalogo = \"tabla_catalogo='usuarios' AND columna_catalogo='estado_usuarios'\";\n\t $resultCatalogo = $catalogo->getCondiciones('valor_catalogo,nombre_catalogo' ,'public.catalogo' , $wherecatalogo , 'tabla_catalogo');\n\t \n\t \n\t \n\t if(!empty($search)){\n\t \n\t \n\t $where1=\" AND (usuarios.cedula_usuarios LIKE '\".$search.\"%' OR usuarios.nombre_usuarios LIKE '\".$search.\"%' OR usuarios.correo_usuarios LIKE '\".$search.\"%' OR rol.nombre_rol LIKE '\".$search.\"%' )\";\n\t \n\t $where_to=$where.$where1;\n\t }else{\n\t \n\t $where_to=$where;\n\t \n\t }\n\t \n\t $html=\"\";\n\t $resultSet=$usuarios->getCantidad(\"*\", $tablas, $where_to);\n\t $cantidadResult=(int)$resultSet[0]->total;\n\t \n\t $page = (isset($_REQUEST['page']) && !empty($_REQUEST['page']))?$_REQUEST['page']:1;\n\t \n\t $per_page = 10; //la cantidad de registros que desea mostrar\n\t $adjacents = 9; //brecha entre páginas después de varios adyacentes\n\t $offset = ($page - 1) * $per_page;\n\t \n\t $limit = \" LIMIT '$per_page' OFFSET '$offset'\";\n\t \n\t $resultSet=$usuarios->getCondicionesPag($columnas, $tablas, $where_to, $id, $limit);\n\t $count_query = $cantidadResult;\n\t $total_pages = ceil($cantidadResult/$per_page);\n\t \n\t \n\t \n\t \n\t \n\t if($cantidadResult>0)\n\t {\n\t \n\t $html.='<div class=\"pull-left\" style=\"margin-left:15px;\">';\n\t $html.='<span class=\"form-control\"><strong>Registros: </strong>'.$cantidadResult.'</span>';\n\t $html.='<input type=\"hidden\" value=\"'.$cantidadResult.'\" id=\"total_query\" name=\"total_query\"/>' ;\n\t $html.='</div>';\n\t $html.='<div class=\"col-lg-12 col-md-12 col-xs-12\">';\n\t $html.='<section style=\"height:425px; overflow-y:scroll;\">';\n\t $html.= \"<table id='tabla_usuarios' class='tablesorter table table-striped table-bordered dt-responsive nowrap dataTables-example'>\";\n\t $html.= \"<thead>\";\n\t $html.= \"<tr>\";\n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Cedula</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Nombre</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Teléfono</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Celular</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Correo</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Rol</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Estado</th>';\n\t \n\t if($id_rol==1){\n\t \n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t \n\t }\n\t \n\t $html.='</tr>';\n\t $html.='</thead>';\n\t $html.='<tbody>';\n\t \n\t \n\t $i=0;\n\t \n\t foreach ($resultSet as $res)\n\t {\n\t $i++;\n\t $html.='<tr>';\n\t $html.='<td style=\"font-size: 11px;\"><img src=\"view/DevuelveImagenView.php?id_valor='.$res->id_usuarios.'&id_nombre=id_usuarios&tabla=usuarios&campo=fotografia_usuarios\" width=\"80\" height=\"60\"></td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$i.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->cedula_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->nombre_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->telefono_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->celular_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->correo_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->nombre_rol.'</td>';\n\t \n\t if(!empty($resultCatalogo)){\n\t foreach ($resultCatalogo as $r_estado){\n\t if($r_estado->valor_catalogo == $res->estado_usuarios ){\n\t $html.='<td style=\"font-size: 11px;\">'.$r_estado->nombre_catalogo.'</td>';\n\t }\n\t }\n\t }\n\t \n\t \n\t if($id_rol==1){\n\t \n\t $html.='<td style=\"font-size: 18px;\"><span class=\"pull-right\"><a href=\"index.php?controller=Usuarios&action=index&id_usuarios='.$res->id_usuarios.'\" class=\"btn btn-success\" style=\"font-size:65%;\"><i class=\"glyphicon glyphicon-edit\"></i></a></span></td>';\n\t $html.='<td style=\"font-size: 18px;\"><span class=\"pull-right\"><a href=\"index.php?controller=Usuarios&action=borrarId&id_usuarios='.$res->id_usuarios.'\" class=\"btn btn-danger\" style=\"font-size:65%;\"><i class=\"glyphicon glyphicon-trash\"></i></a></span></td>';\n\t \n\t }\n\t \n\t $html.='</tr>';\n\t }\n\t \n\t \n\t \n\t $html.='</tbody>';\n\t $html.='</table>';\n\t $html.='</section></div>';\n\t $html.='<div class=\"table-pagination pull-right\">';\n\t $html.=''. $this->paginate_usuarios(\"index.php\", $page, $total_pages, $adjacents,\"load_usuarios\").'';\n\t $html.='</div>';\n\t \n\t \n\t \n\t }else{\n\t $html.='<div class=\"col-lg-6 col-md-6 col-xs-12\">';\n\t $html.='<div class=\"alert alert-warning alert-dismissable\" style=\"margin-top:40px;\">';\n\t $html.='<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>';\n\t $html.='<h4>Aviso!!!</h4> <b>Actualmente no hay usuarios registrados...</b>';\n\t $html.='</div>';\n\t $html.='</div>';\n\t }\n\t \n\t \n\t echo $html;\n\t die();\n\t \n\t }\n\t \n\t}",
"public function EnumerateActive()\n\t{\n\t\t//\t\t\t\tWHERE course.active = 'si' AND courseId IN (0)\n\n\t\t$this->Util()->DB()->setQuery(\"\n\t\t\t\tSELECT *, major.name AS majorName, subject.name AS name, subject.rvoe FROM course\n\t\t\t\tLEFT JOIN subject ON course.subjectId = subject.subjectId \n\t\t\t\tLEFT JOIN major ON major.majorId = subject.tipo\n\t\t\t\tWHERE course.active = 'si' AND listar = 'si'\n\t\t\t\tORDER BY subject.tipo, subject.name, course.group\");\n\t\t//echo $this->Util()->DB()->query;\n\t\t$result = $this->Util()->DB()->GetResult();\n\n\t\tforeach ($result as $key => $res) {\n\t\t\t$result[$key][\"initialDateStamp\"] = strtotime($result[$key][\"initialDate\"]);\n\t\t\t$result[$key][\"finalDateStamp\"] = strtotime($result[$key][\"finalDate\"]);\n\n\t\t\t$toFinishSeconds = $result[$key][\"daysToFinish\"] * 3600 * 24;\n\n\t\t\t$result[$key][\"daysToFinishStamp\"] = strtotime($result[$key][\"initialDate\"]) + $toFinishSeconds;\n\t\t}\n\t\treturn $result;\n\t}",
"public function getConcursosActivos() {\n //error_log('DEBUG: en getConcursosActivos Secundaria');\n $concursosActivos = DBConcursosSecundaria::obtieneConcursosActivos();\n return $concursosActivos;\n }",
"public function actividadesPorSegmento()\n {\n //\n }",
"private function cargarActas() {\n $this->aActas = array();\n $res = Funciones::gEjecutarSQL(\"SELECT FECHA,DATE_FORMAT(FECHA,'%d-%m-%Y') AS FECHAISO,COUNT(*) AS PUNTOS FROM ACTAS_PUNTOS GROUP BY FECHA ORDER BY FECHA DESC\");\n while($aRow = $res->fetch(PDO::FETCH_ASSOC)) {\n $this->aActas[$aRow['FECHA']] = array($aRow['FECHAISO'], $aRow['PUNTOS']);\n }\n $res->closeCursor(); \n }",
"public function getActividades(){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT id, nombre FROM actividades\");\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetch();\n\n\t\t$stmt->close();\n\t}",
"public function activeAction()\n {\n $this->initialize();\n\n $all = $this->users->query()\n ->where('active IS NOT NULL')\n ->andWhere('deleted is NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are active\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are active\",\n ]);\n }",
"function listarCotizacion(){\n\t\t$this->procedimiento='adq.f_cotizacion_sel';\n\t\t$this->transaccion='ADQ_COT_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t\n\t\t$this->setParametro('id_funcionario_usu','id_funcionario_usu','int4');\n $this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\n $this->setParametro('historico','historico','varchar');\n \n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cotizacion','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('estado','varchar');\n\t\t$this->captura('lugar_entrega','varchar');\n\t\t$this->captura('tipo_entrega','varchar');\n\t\t$this->captura('fecha_coti','date');\n\t\t$this->captura('numero_oc','varchar');\n\t\t$this->captura('id_proveedor','int4');\n\t\t$this->captura('desc_proveedor','varchar');\n\t\t\n\t\t$this->captura('fecha_entrega','date');\n\t\t$this->captura('id_moneda','int4');\n\t\t$this->captura('moneda','varchar');\n\t\t$this->captura('id_proceso_compra','int4');\n\t\t$this->captura('fecha_venc','date');\n\t\t$this->captura('obs','text');\n\t\t$this->captura('fecha_adju','date');\n\t\t$this->captura('nro_contrato','varchar');\n\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_estado_wf','integer');\n\t\t$this->captura('id_proceso_wf','integer');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t$this->captura('tipo_cambio_conv','numeric');\n\t\t$this->captura('email','varchar');\n\t\t$this->captura('numero','varchar');\n\t\t$this->captura('num_tramite','varchar');\n\t\t$this->captura('id_obligacion_pago','int4');\n\t\t$this->captura('tiempo_entrega','varchar');\n\t\t$this->captura('funcionario_contacto','varchar');\n\t\t$this->captura('telefono_contacto','varchar');\n\t\t$this->captura('correo_contacto','varchar');\n\t\t$this->captura('prellenar_oferta','varchar');\n\t\t$this->captura('forma_pago','varchar');\n\t\t$this->captura('requiere_contrato','varchar');\n\t\t$this->captura('total_adjudicado','numeric');\n\t\t$this->captura('total_cotizado','numeric');\n\t\t$this->captura('total_adjudicado_mb','numeric');\n\t\t$this->captura('tiene_form500','varchar');\n\t\t$this->captura('correo_oc','varchar');\n\n\t\t$this->captura('id_gestion','int4');\n\n\t\t$this->captura('cuce','varchar');\n\t\t$this->captura('fecha_conclusion','date');\n\t\t$this->captura('id_solicitud','int4');\n\t\t$this->captura('justificacion','text');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function ListaCuentasxpagarInactivas() {\n\n\t$sql = \"SELECT a.id, a.descripcion, a.fecha, a.total, b.descripcion AS nombre_proveedor\n\t\t\tFROM cuentaxpagar a\n\t\t\tINNER JOIN proveedor b ON a.proveedor_id = b.id\n\t\t\tWHERE a.estado = 'PAGADO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Ok\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de cuentas por pagar!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}",
"public function activeAction()\n {\n $all = $this->users->query()\n ->where('active IS NOT NULL')\n ->andWhere('deleted is NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are active\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are active\",\n ]);\n }",
"public function traerDocentesActivos(){\n $docentes = DB::select('SELECT docente.idDocente, CONCAT(docente.apPaterno, \" \",docente.apMaterno,\" \", docente.nombres) as nombre_completo from docente where not exists (select docente_grupo.idDocente from docente_grupo where docente_grupo.idDocente = docente.idDocente) AND docente.estatus = 1 AND docente.tipo <> 1 AND docente.tipo <>4 AND docente.tipo <>5 ORDER BY nombre_completo ASC');\n \n\n return $docentes;\n }",
"function listarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_sel';\n\t\t$this->transaccion='TES_CTABAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha_baja','date');\n\t\t$this->captura('nro_cuenta','varchar');\n\t\t$this->captura('fecha_alta','date');\n\t\t$this->captura('id_institucion','int4');\n\t\t$this->captura('nombre_institucion','varchar');\n\t\t$this->captura('doc_id','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_moneda','integer');\n\t\t$this->captura('codigo_moneda','varchar');\n\t\t$this->captura('denominacion','varchar');\n\t\t$this->captura('centro','varchar');\n\t\t\n\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function findActividades($id_proceso=null,$id_actividad=null)\n {\n if(!is_null($id_proceso)){\n $list_actividades = \\common\\models\\cda\\PsActividad::find()\n ->select(['id_actividad', 'nom_actividad','subpantalla'])\n ->where(['=', 'id_proceso', $id_proceso])\n ->orderBy(['orden'=>SORT_ASC])\n ->asArray()->all();\n }else if(!is_null($id_actividad)){\n $list_actividades = \\common\\models\\cda\\PsActividad::find()\n ->select(['id_actividad', 'nom_actividad','subpantalla','rol_a_asignar','id_clasif_actividad'])\n ->where(['=', 'id_actividad', $id_actividad])\n ->asArray()->one();\n }\n \n return $list_actividades;\n }",
"public function listaComprasActivas(){\n\n $respuesta = Datos::mdlListaComprasActivas(\"entradas\");\n\n foreach ($respuesta as $row => $item){\n\n\n\n echo '<tr>\n <td>'.$item[\"noOperacion\"].'</td>\n <td>'.$item[\"proveedor\"].'</td>\n <td>'.$item[\"productor\"].'</td>\n <td>'.$item[\"codProducto\"].'</td>\n <td>'.$item[\"kg\"].'</td>\n <td>'.$item[\"precio\"].'</td>\n <td>'.$item[\"costoTotal\"].'</td>\n <td>'.$item[\"total\"].'</td>\n <td>'.$item[\"fecha\"].'</td>\n <td>\n <a href=\"updtCompraNuez.php?idEditar='.$item[\"cons\"].'\"><button class=\"btn btn-warning\"><i class=\"fa fa-fw fa-edit\"></i></button></a>\n <a href=\"listaComprasNuez.php?idBorrar='.$item[\"cons\"].'\" ><button class=\"btn btn-danger\"><i class=\"fa fa-fw fa-trash-o\"></i></button></a>\n <a href=\"listaComprasNuez.php?idCerrar='.$item[\"cons\"].'\" ><button class=\"btn btn-primary\"><i class=\"fa fa-fw fa-lock\"></i></button></a>\n </td>\n </tr>';\n //<td><a href=\"updtCompra.php?idEditar='.$item[\"cons\"].'\"><button class=\"btn btn-warning\">Editar</button></a></td>\n }\n\n }",
"function listarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_sel';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('id_cuenta_bancaria_boa','int4');\n\t\t$this->captura('banco','int4');\n\t\t$this->captura('cuenta','varchar');\n\t\t$this->captura('desc_cuenta','varchar');\n\t\t$this->captura('moneda','int4');\n\t\t$this->captura('tipo_cuenta','bpchar');\n\t\t$this->captura('estado_cuenta','bpchar');\n\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('desc_cuenta_banco','varchar');\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function index()\n {\n $actividades = ActividadesSp::all();\n $url = 'spactividades';\n $modulo = '';\n $nombre = 'Actividades sin Planificación';\n\n $actividades = DB::table('sp_actividad')\n ->select('ta.descripcion as tipoactividad', 'ah.descripcion as descripcionhorario', 'sp_actividad.nombre', 'u.name as usuario', 'sp_actividad.duracion',\n 'sp_actividad.fechainicio', 'sp_actividad.id', 'pt.valor', 'sp_actividad.fechafin','ah.id as idhorario','sp_actividad.descripcion as descripcionsp')\n ->join('users as u', 'u.id', '=', 'sp_actividad.id_responsable')\n ->leftJoin('param_referenciales as pt', 'pt.id', '=', 'sp_actividad.id_refertiempo')\n ->leftJoin('tipo_actividades as ta', 'ta.id', '=', 'sp_actividad.id_tipoactividad')\n ->leftJoin('actividades_horario as ah', 'ah.id', '=', 'sp_actividad.id_actividad_horario')\n ->whereNull('sp_actividad.deleted_at')\n ->where('sp_actividad.id_responsable', Auth::id())\n ->where('sp_actividad.estado', '1')\n ->orderBy('sp_actividad.fechainicio', 'asc')\n ->get();\n\n return view('sp_actividades.index', compact('actividades', 'actividades', 'url', 'modulo', 'nombre'));\n }",
"function get_servicios_activos($id)\n {\n $id = $this->session->id;\n $this->db->select('*');\n $this->db->from('servicio');\n $this->db->where('estado', 1);\n $this->db->where('id_trabajador', $id);\n $this->db->order_by('fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }",
"function get_periodos_activos (){\n \n $fecha=date('Y-m-d');\n $anio_lectivo=date('Y');\n \n $sql_1=\"SELECT t_p.id_periodo,\n t_c.numero || ' ' || 'CUATRIMESTRE' as descripcion \n FROM periodo t_p \n JOIN cuatrimestre t_c ON (t_p.id_periodo=t_c.id_periodo AND t_p.anio_lectivo=$anio_lectivo\n AND (('$fecha' <= t_p.fecha_inicio) OR ('$fecha' BETWEEN t_p.fecha_inicio AND t_p.fecha_fin)))\";\n $cuatrimestre=toba::db('gestion_aulas')->consultar($sql_1);\n \n $sql_2=\"SELECT t_p.id_periodo,\n 'TURNO DE EXAMEN' || ' ' || t_ef.turno || ' ' || t_ef.numero || ' ' || 'LLAMADO' as descripcion\n FROM periodo t_p \n JOIN examen_final t_ef ON (t_p.id_periodo=t_ef.id_periodo AND t_p.anio_lectivo=$anio_lectivo\n AND (('$fecha' <= t_p.fecha_inicio) OR ('$fecha' BETWEEN t_p.fecha_inicio AND t_p.fecha_fin)))\";\n $examen_final=toba::db('gestion_aulas')->consultar($sql_2);\n \n $sql_3=\"SELECT t_p.id_periodo,\n 'CURSO DE INGRESO' || ' ' || t_ci.facultad || ' ' || t_ci.nombre as descripcion\n FROM periodo t_p \n JOIN curso_ingreso t_ci ON (t_p.id_periodo=t_ci.id_periodo AND t_p.anio_lectivo=$anio_lectivo\n AND (('$fecha' <= t_p.fecha_inicio) OR ('$fecha' BETWEEN t_p.fecha_inicio AND t_p.fecha_fin)) )\";\n $curso_ingreso=toba::db('gestion_aulas')->consultar($sql_3);\n \n $this->unificar_periodos(&$cuatrimestre, $examen_final);\n \n $this->unificar_periodos(&$cuatrimestre, $curso_ingreso);\n \n return $cuatrimestre; \n \n }",
"public function actividadABM(){\n $info = Actividad::all();\n Log::info('Retrieved activitis: '.$info );\n return View::make('admin.abmActividades', array('actividades'=>$info));\n }",
"function lista_dosificacion_activa($tipo)\n {\n $sql=\"select * from dosificacion_factura df \n WHERE df.estado='Activo' and df.tipo_dosificacion='$tipo' Order by df.actividad \";\n $consulta = $this->db->query($sql);\n return($consulta);\n }",
"function listar_acciones_procesos($objeto){\n\n\t\t$sql = \"SELECT\n\t\t\t\t\t\t\tid, nombre, tiempo_hrs\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tprd_acciones\n\t\t\t\t\t\tORDER BY id\";\n\n\t\t// return $sql;\n\t\t$result = $this->queryArray($sql);\n\n\t\treturn $result;\n\t}",
"public function getAutorizados(){\n return $this->ref_comercial->toArray();\n }",
"public static function getAsListActive(){\n return ArrayHelper::map(\n self::find()->andFilterWhere(['active'=>1])->andFilterWhere(['is_parent'=>1])->all()\n , 'id','name'\n );\n }",
"public function getAllActive()\n {\n\n $qb = $this->createQueryBuilder('u')->select('u')\n ->andWhere('u.isDeleted =:is_deleted')\n ->andWhere('u.status =:status')\n ->setParameters(array(\n 'is_deleted' => false,\n 'status' => $this->sm->active()\n ));\n $qb->orderBy('u.company', 'DESC');\n return $qb->getQuery()->getResult();\n }",
"public function activar()\n {\n $id = $this->input->post('activar');\n $this->load->model('Usuario_model');\n $this->Usuario_model->activar_cuenta($id);\n $this->listar_usuarios();\n }",
"public function listServiceActv()\n {\n $actvServicio = ActividadServicio::orderBy('fechaFinalizacion', 'asc')\n ->get();\n return response()->json($actvServicio, 200);\n }",
"function cargaActivos($usuario, $bd){\n $daoUsuarios = new Usuarios($bd);\n return $daoUsuarios->getUsuariosActivos($usuario);\n}",
"public function verActividades() {\n $eventos = Evento::all()->sortByDesc('fecha_desde');\n $this->render('costa/portal/actividades.twig', [\n 'actividades' => $eventos\n ]);\n }",
"public function select($actividades_fuera);",
"public function getActivo()\n {\n return $this->activo;\n }",
"public function getActiveTickets() {\n try {\n $select = $this->select()\n ->from($this);\n// ->where('status =?',1);\n $result = $this->getAdapter()->fetchAll($select);\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n if ($result) :\n return $result;\n endif;\n }",
"function listarSolicitudModalidades()\r\n {\r\n $this->procedimiento = 'adq.f_solicitud_modalidades_sel';\r\n $this->transaccion = 'ADQ_SOLMODAL_SEL';\r\n $this->tipo_procedimiento = 'SEL';//tipo de transaccion\r\n\r\n\r\n $this->setParametro('id_funcionario_usu', 'id_funcionario_usu', 'int4');\r\n $this->setParametro('tipo_interfaz', 'tipo_interfaz', 'varchar');\r\n $this->setParametro('historico', 'historico', 'varchar');\r\n\r\n\r\n //Definicion de la lista del resultado del query\r\n $this->captura('id_solicitud', 'int4');\r\n $this->captura('estado_reg', 'varchar');\r\n $this->captura('id_solicitud_ext', 'int4');\r\n $this->captura('presu_revertido', 'varchar');\r\n $this->captura('fecha_apro', 'date');\r\n $this->captura('estado', 'varchar');\r\n $this->captura('id_funcionario_aprobador', 'int4');\r\n $this->captura('id_moneda', 'int4');\r\n $this->captura('id_gestion', 'int4');\r\n $this->captura('tipo', 'varchar');\r\n $this->captura('num_tramite', 'varchar');\r\n $this->captura('justificacion', 'text');\r\n $this->captura('id_depto', 'int4');\r\n $this->captura('lugar_entrega', 'varchar');\r\n $this->captura('extendida', 'varchar');\r\n\r\n $this->captura('posibles_proveedores', 'text');\r\n $this->captura('id_proceso_wf', 'int4');\r\n $this->captura('comite_calificacion', 'text');\r\n $this->captura('id_categoria_compra', 'int4');\r\n $this->captura('id_funcionario', 'int4');\r\n $this->captura('id_estado_wf', 'int4');\r\n $this->captura('fecha_soli', 'date');\r\n $this->captura('fecha_reg', 'timestamp');\r\n $this->captura('id_usuario_reg', 'int4');\r\n $this->captura('fecha_mod', 'timestamp');\r\n $this->captura('id_usuario_mod', 'int4');\r\n $this->captura('usr_reg', 'varchar');\r\n $this->captura('usr_mod', 'varchar');\r\n\r\n $this->captura('id_uo', 'integer');\r\n\r\n $this->captura('desc_funcionario', 'text');\r\n $this->captura('desc_funcionario_apro', 'text');\r\n $this->captura('desc_uo', 'text');\r\n $this->captura('desc_gestion', 'integer');\r\n $this->captura('desc_moneda', 'varchar');\r\n $this->captura('desc_depto', 'varchar');\r\n $this->captura('desc_proceso_macro', 'varchar');\r\n $this->captura('desc_categoria_compra', 'varchar');\r\n $this->captura('id_proceso_macro', 'integer');\r\n $this->captura('numero', 'varchar');\r\n $this->captura('desc_funcionario_rpc', 'text');\r\n $this->captura('obs', 'text');\r\n $this->captura('instruc_rpc', 'varchar');\r\n $this->captura('desc_proveedor', 'varchar');\r\n $this->captura('id_proveedor', 'integer');\r\n $this->captura('id_funcionario_supervisor', 'integer');\r\n $this->captura('desc_funcionario_supervisor', 'text');\r\n $this->captura('ai_habilitado', 'varchar');\r\n $this->captura('id_cargo_rpc', 'integer');\r\n $this->captura('id_cargo_rpc_ai', 'integer');\r\n $this->captura('tipo_concepto', 'varchar');\r\n $this->captura('revisado_asistente', 'varchar');\r\n $this->captura('fecha_inicio', 'date');\r\n $this->captura('dias_plazo_entrega', 'integer');\r\n $this->captura('obs_presupuestos', 'varchar');\r\n $this->captura('precontrato', 'varchar');\r\n $this->captura('update_enable', 'varchar');\r\n $this->captura('codigo_poa', 'varchar');\r\n $this->captura('obs_poa', 'varchar');\r\n $this->captura('contador_estados', 'bigint');\r\n\r\n $this->captura('nro_po', 'varchar');\r\n $this->captura('fecha_po', 'date');\r\n\r\n $this->captura('importe_total', 'numeric');\r\n $this->captura('prioridad', 'varchar');\r\n $this->captura('id_prioridad', 'integer');\r\n $this->captura('list_proceso', 'integer[]');\r\n\r\n $this->captura('cuce', 'varchar');\r\n $this->captura('fecha_conclusion', 'date');\r\n $this->captura('presupuesto_aprobado', 'varchar');\r\n\r\n $this->captura('tipo_modalidad', 'varchar');\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n //echo($this->consulta);exit;\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }",
"function leerCreditos(){\n \n try{\n $stmt = $this->dbh->prepare(\"SELECT c.idcredito, t.NombreCte,c.tipoContrato, c.montoTotal, c.plazo,c.mensualidad, c.interes,\"\n . \" c.metodoPago, c.observaciones, c.status FROM tarjetas_clientes t join credito c on t.idClienteTg=c.cteId where c.status=1 or c.status=3\");\n // Especificamos el fetch mode antes de llamar a fetch()\n $stmt->execute();\n $clientes = $stmt->fetchAll(PDO::FETCH_NUM);\n } catch (PDOException $e){\n $clientes=array(\"status\"=>\"0\",\"mensaje\"=>$e->getMessage());\n }\n \n return $clientes;\n }",
"function rec_empresa_list(){\n\t\t}",
"function getActividades(){\n\n\t$this->conexionBD();\n\t$mysqli=$this->conexionBD();\n\n\t$form=array();\n\t$query=\"SELECT * FROM Actividad\";\t\t\n\t$resultado=$mysqli->query($query);\n\twhile($fila = $resultado->fetch_array())\n\t{\n\t\t$filas[] = $fila;\n\t}\n\tforeach($filas as $fila)\n\t{\n\t\t$id=$fila['id_Actividad'];\n\t\t$nombre=$fila['Nombre'];\n\n\t\t$fila_array=array(\"id_Actividad\"=>$id,\"Nombre\"=>$nombre);\n\t\tarray_push($form,$fila_array);\n\t}\n\t$resultado->free();\n\t$mysqli->close();\n\treturn $form;\n}",
"public function listar($inicio = 0, $cantidad = 0, $excepcion = NULL, $condicion = NULL, $idCurso = NULL) {\n global $sql, $configuracion;\n\n /* * * Validar la fila inicial de la consulta ** */\n if (!is_int($inicio) || $inicio < 0) {\n $inicio = 0;\n }\n\n /* * * Validar la cantidad de registros requeridos en la consulta ** */\n if (!is_int($cantidad) || $cantidad <= 0) {\n $cantidad = 0;\n }\n\n /* * * Validar que la condición sea una cadena de texto ** */\n if (!is_string($condicion)) {\n $condicion = '';\n }\n\n /* * * Validar que la excepción sea un arreglo y contenga elementos ** */\n if (isset($excepcion) && is_array($excepcion) && count($excepcion)) {\n $excepcion = implode(',', $excepcion);\n $condicion .= 'ac.id NOT IN (' . $excepcion . ') AND ';\n }\n\n /* * * Definir el orden de presentación de los datos ** */\n if ($this->listaAscendente) {\n $orden = 'ac.fecha_publicacion ASC';\n } else {\n $orden = 'ac.fecha_publicacion DESC';\n }\n\n $tablas = array(\n 'ac' => 'actividades_curso'\n );\n\n $columnas = array(\n 'id' => 'ac.id',\n 'idCurso' => 'ac.id_curso',\n 'idUsuario' => 'ac.id_usuario',\n 'titulo' => 'ac.titulo',\n 'descripcion' => 'ac.descripcion',\n 'fechaPublicacion' => 'UNIX_TIMESTAMP(ac.fecha_publicacion)',\n 'fechaLimite' => 'UNIX_TIMESTAMP(ac.fecha_limite)',\n 'diasRestantes' => 'DATEDIFF(ac.fecha_limite, NOW())'\n );\n\n $condicion .= 'ac.id_curso = \"'.$idCurso.'\"';\n\n if (is_null($this->registros)) {\n $sql->seleccionar($tablas, $columnas, $condicion);\n $this->registros = $sql->filasDevueltas;\n }\n\n $consulta = $sql->seleccionar($tablas, $columnas, $condicion, '', $orden, $inicio, $cantidad);\n\n $lista = array();\n if ($sql->filasDevueltas) {\n\n while ($actividad = $sql->filaEnObjeto($consulta)) {\n $actividad->icono = $configuracion['SERVIDOR']['media'] . $configuracion['RUTAS']['imagenesEstilos'] . 'activity.png';\n $lista[] = $actividad;\n }\n }\n\n return $lista;\n }",
"public function activelistAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findByCompleted(false);\n \n return $this->render('todo/active-index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function get_active_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`, initials\n FROM time_user\n WHERE active = 1\n ORDER BY firstname, surname\";\n return $this->db->query( $sql )->result_array();\n }",
"public function activeOrders()\n {\n }",
"public function use_obtener_otros_sucursales(){\n $cuenta = $this->ci->session->userdata('usuario'); \n $suc = $this->ci->session->userdata('sucursal');\n $sucursales = $this->ci->arixkernel->select_all_content_where('sucursal_id serial, numero, nombre','config.v_cuenta_sucursal', array('cuenta_id' => $cuenta, 'sucursal_id !=' => $suc, 'estado' => true));\n return $sucursales;\n }",
"public function index_actividades()\n {\n\n //\n $actividades = DB::SELECT(\"SELECT a.`id_actividad` AS id ,a.`nombre`, f.`foto`,substring(a.descripcion,1,100) as descripcion\n FROM foto_actividades AS f\n INNER JOIN actividades AS a ON a.`id_actividad` = f.`id_actividad`\n WHERE f.tipo_foto = 2\n AND f.extendida=2\n AND a.secciones = 6\n AND a.activo=1\n ORDER BY a.nombre DESC\");\n\n\n return view('pagina.actividades.actividades')->with('actividades', $actividades);\n }",
"public function listar(){\n\n $sql = \"SELECT * FROM buro_credito\";\n\n return $this->mysql->getRows($sql);\n\n }",
"function getActive(){\n\t\t$con = connect();\n\t\t$sql= \"SELECT ID,active FROM t_active\" ;\n \t$stmt = $con->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll();\n\t \tforeach($result as $row){\n\t\t\t echo \"<option value=\" .$row['ID'].\">\" . $row['active'] . \"</option>\";\n\t\t\t}\n\t}",
"function listarSolicitudObligacionPago()\r\n {\r\n $this->procedimiento = 'tes.ft_solicitud_obligacion_pago_sel';\r\n $this->transaccion = 'TES_SOOBPG_SEL';\r\n $this->tipo_procedimiento = 'SEL';//tipo de transaccion\r\n\r\n\r\n $this->setParametro('id_funcionario_usu', 'id_funcionario_usu', 'int4');\r\n $this->setParametro('tipo_interfaz', 'tipo_interfaz', 'varchar');\r\n $this->setParametro('historico', 'historico', 'varchar');\r\n\r\n //Definicion de la lista del resultado del query\r\n $this->captura('id_obligacion_pago', 'int4');\r\n $this->captura('id_proveedor', 'int4');\r\n $this->captura('desc_proveedor', 'varchar');\r\n $this->captura('estado', 'varchar');\r\n $this->captura('tipo_obligacion', 'varchar');\r\n $this->captura('id_moneda', 'int4');\r\n $this->captura('moneda', 'varchar');\r\n $this->captura('obs', 'varchar');\r\n $this->captura('porc_retgar', 'numeric');\r\n $this->captura('id_subsistema', 'int4');\r\n $this->captura('nombre_subsistema', 'varchar');\r\n $this->captura('id_funcionario', 'int4');\r\n $this->captura('desc_funcionario1', 'text');\r\n $this->captura('estado_reg', 'varchar');\r\n $this->captura('porc_anticipo', 'numeric');\r\n $this->captura('id_estado_wf', 'int4');\r\n $this->captura('id_depto', 'int4');\r\n $this->captura('nombre_depto', 'varchar');\r\n $this->captura('num_tramite', 'varchar');\r\n $this->captura('id_proceso_wf', 'int4');\r\n $this->captura('fecha_reg', 'timestamp');\r\n $this->captura('id_usuario_reg', 'int4');\r\n $this->captura('fecha_mod', 'timestamp');\r\n $this->captura('id_usuario_mod', 'int4');\r\n $this->captura('usr_reg', 'varchar');\r\n $this->captura('usr_mod', 'varchar');\r\n $this->captura('fecha', 'date');\r\n $this->captura('numero', 'varchar');\r\n $this->captura('tipo_cambio_conv', 'numeric');\r\n $this->captura('id_gestion', 'integer');\r\n $this->captura('comprometido', 'varchar');\r\n $this->captura('nro_cuota_vigente', 'numeric');\r\n $this->captura('tipo_moneda', 'varchar');\r\n $this->captura('total_pago', 'numeric');\r\n $this->captura('pago_variable', 'varchar');\r\n $this->captura('id_depto_conta', 'integer');\r\n $this->captura('total_nro_cuota', 'integer');\r\n $this->captura('fecha_pp_ini', 'date');\r\n $this->captura('rotacion', 'integer');\r\n $this->captura('id_plantilla', 'integer');\r\n $this->captura('desc_plantilla', 'varchar');\r\n $this->captura('ultima_cuota_pp', 'numeric');\r\n $this->captura('ultimo_estado_pp', 'varchar');\r\n $this->captura('tipo_anticipo', 'varchar');\r\n $this->captura('ajuste_anticipo', 'numeric');\r\n $this->captura('ajuste_aplicado', 'numeric');\r\n $this->captura('monto_estimado_sg', 'numeric');\r\n $this->captura('id_obligacion_pago_extendida', 'integer');\r\n $this->captura('desc_contrato', 'text');\r\n $this->captura('id_contrato', 'integer');\r\n $this->captura('obs_presupuestos', 'varchar');\r\n $this->captura('codigo_poa', 'varchar');\r\n $this->captura('obs_poa', 'varchar');\r\n $this->captura('uo_ex', 'varchar');\r\n //Funcionario responsable de el plan de pagos\r\n $this->captura('id_funcionario_responsable', 'integer');\r\n $this->captura('desc_fun_responsable', 'text');\r\n\r\n $this->captura('id_conformidad', 'int4');\r\n $this->captura('conformidad_final', 'text');\r\n $this->captura('fecha_conformidad_final', 'date');\r\n $this->captura('fecha_inicio', 'date');\r\n $this->captura('fecha_fin', 'date');\r\n $this->captura('observaciones', 'varchar');\r\n $this->captura('fecha_certificacion_pres', 'date');\r\n\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }",
"public function get_client_actif()\n {\n $this->db->where('isActiv', 1);\n $query = $this->db->get('client');\n return $query->result_array();\n }",
"function ListaProveedoresInactivos() {\n\n\t//obtiene el id del usuario\n\t$sql = \"SELECT * FROM proveedor WHERE estado = 'INACTIVO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Ok\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de proveedores!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}",
"public function getAllActivities(){\n $this->db->query('SELECT * FROM activity WHERE disabled = 0 ORDER BY name ASC');\n\n //assign result set\n $results = $this->db->resultSet();\n\n return $results;\n }",
"public function listApuracaoCompleta()\n\t{\n\t\t$sql = new Conexao;\n\n\t\treturn $sql->select(\"\n\t\t\tSELECT \n\t\t\ta.idCriarApuracao, a.idUsuario, a.tipoApuracao, a.descricao, a.status, a.dataCriacao, a.dataRegistro,\n\t\t\tb.idVitimasCriarApuracao, b.idVitimasApuracao,\n\t\t\tc.idPessoa,\n\t\t\td.qualFamilia,\n\t\t\te.idResponsavelVitimas,\n\t\t\tf.idPessoa idPessoaResponsavel,\n\t\t\tg.nome nomeVitima, g.sexo sexoVitima, g.cpf cpfVitima,\n\t\t\th.nome nomeResponsavel, h.cpf cpfResponsavel,\n\t\t\ti.celular celularVitima,\n\t\t\tj.celular celularResponsavel,\n\t\t\tk.cep cepVitima, k.rua ruaVitima, k.numero numeroVitima, k.bairro bairroVitima, \n\t\t\tk.cidade cidadeVitima, k.estado estadoVitima, k.complemento complementoVitima,\n\t\t\tl.cep cepResponsavel, l.rua ruaResponsavel, l.numero numeroResponsavel, l.bairro bairroResponsavel, \n\t\t\tl.cidade cidadeResponsavel, l.estado estadoResponsavel, l.complemento complementoResponsavel\n\t\t\tFROM tb_criarapuracao a\n\t\t\tINNER JOIN tb_vitimascriarapuracao b ON a.idCriarApuracao = b.idCriarApuracao\n\t\t\tINNER JOIN tb_vitimasapuracao c ON b.idVitimasApuracao = c.idVitimasApuracao\n\t\t\tINNER JOIN tb_familiaapuracao d ON c.idVitimasApuracao = d.idVitimasApuracao\n\t\t\tINNER JOIN tb_responsavelVitimas e ON c.idVitimasApuracao = e.idVitimasApuracao\n\t\t\tINNER JOIN tb_responsavelapuracao f ON e.idResponsavelApuracao = f.idResponsavelApuracao\n\t\t\tINNER JOIN tb_pessoa g ON c.idPessoa = g.idPessoa\n\t\t\tINNER JOIN tb_pessoa h ON f.idPessoa = h.idPessoa\n\t\t\tINNER JOIN tb_contato i ON g.idContato = i.idContato\n\t\t\tINNER JOIN tb_contato j ON h.idContato = j.idContato\n\t\t\tINNER JOIN tb_endereco k ON g.idEndereco = k.idEndereco\n\t\t\tINNER JOIN tb_endereco l ON h.idEndereco = l.idEndereco\n\t\t\tORDER BY a.idCriarApuracao DESC\n\t\t\");\n\t}",
"function get_listado($anio_lectivo)\n\t{\n\t\t$sql_1 = \"(SELECT t_p.id_periodo,\n t_p.fecha_inicio,\n t_p.fecha_fin,\n\t\t\t t_p.anio_lectivo,\n t_c.numero,\n '----' as turno,\n 'Cuatrimestre' as tipo_periodo\n FROM periodo as t_p\n JOIN cuatrimestre t_c ON (t_p.id_periodo=t_c.id_periodo AND t_p.anio_lectivo=$anio_lectivo))\n \n \";\n \n $cuatrimestre=toba::db('gestion_aulas')->consultar($sql_1);\n \n $sql_2=\" \n (SELECT t_p.id_periodo,\n t_p.fecha_inicio,\n t_p.fecha_fin,\n t_p.anio_lectivo,\n t_ef.turno,\n t_ef.numero,\n 'Examen Final' as tipo_periodo\n FROM periodo t_p \n JOIN examen_final t_ef ON (t_p.id_periodo=t_ef.id_periodo AND t_p.anio_lectivo=$anio_lectivo))\";\n \n $examen_final=toba::db('gestion_aulas')->consultar($sql_2);\n \n $sql_3=\"(SELECT t_p.id_periodo,\n t_p.fecha_inicio,\n t_p.fecha_fin,\n t_p.anio_lectivo,\n 'Curso de Ingreso' as tipo_periodo,\n '----' as numero,\n t_ci.facultad as turno\n FROM periodo t_p \n JOIN curso_ingreso t_ci ON (t_p.id_periodo=t_ci.id_periodo AND t_p.anio_lectivo=$anio_lectivo)\n )\";\n \n $curso_ingreso=toba::db('gestion_aulas')->consultar($sql_3);\n \n $this->unificar_periodos(&$cuatrimestre, $examen_final);\n \n $this->unificar_periodos(&$cuatrimestre, $curso_ingreso);\n \n return $cuatrimestre;\n \n }",
"function getActiveUsuarios()\r\n\t{\r\n\t\treturn $this->Usuario->find('all',array('conditions' => array('Usuario.active' => 1)));\r\n\t}",
"function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function listadoProyectos(){\n $class=\"\";\n $this->arrayEstatusVisibles = array();\n if($this->session['rol'] == 1)\n $this->arrayEstatusVisibles = array(0,1,2,3,4,5,6,7,8,9,10);\n if ($this->session ['rol'] == 2)\n $this->arrayEstatusVisibles = array (0,1,2,3,4,5,6,7,8,9,10);\n \n if($this->session['rol'] == 3)\n $this->arrayEstatusVisibles = array(5,6,7,8,9,10);\n if($this->session['rol'] == 4)\n $this->arrayEstatusVisibles = array(1,2,3,4,5,6,7,8,9,10);\n \n $no_registros = $this->consultaNoProyectosAvances();\n $this->arrayNotificaciones = $this->notificaciones();\n $arrayDisabled = $this->recuperaPermisos(0,0);\n $trimestreId = $this->obtenTrimestre($arrayDisabled);\n $noTri = $trimestreId;\n if($trimestreId == 1)\n $noTri =\"\";\n \n if($no_registros){\n $this->pages = new Paginador();\n $this->pages->items_total = $no_registros;\n $this->pages->mid_range = 25;\n $this->pages->paginate();\n $resultados = $this->consultaProyectosAvances();\n $this->bufferExcel = $this->generaProyectosExcel();\n }\n $col=6;\n $this->buffer=\"\n <input type='hidden' name='trimestreId' id='trimestreId' value='\".$trimestreId.\"'>\n <div class='panel panel-danger spancing'>\n <div class='panel-heading'><span class='titulosBlanco'>\".str_replace(\"#\",$trimestreId,REPORTETRIMESTRAL).\"</span></div>\n <div class='panel-body'><center><span id='res'></span></center>\".$this->divFiltrosProyectos(1,0,\"\",\"\").\"\n <center>\".$this->regresaLetras().\"</center><br>\";\n if(count($resultados) > 0){\n $arrayAreas = $this->catalogoAreas();\n $arrayOpera = $this->catalogoUnidadesOperativas();\n $this->buffer.=\"\n <table width='95%' class='table tablesorter table-condensed' align='center' id='MyTableActividades'>\n <thead><tr>\n <td class='tdcenter fondotable' width='2%' >\".NO.\"</td>\n <td class='tdcenter fondotable' width='10%' >\".AREA.\"</td>\n <td class='tdcenter fondotable' width='36%' >\".PROYECTOS.\"</td>\n <td class='tdcenter fondotable' width='10%' >\".METASREPORTE.\"</td> \n <td class='tdcenter fondotable' width='10%' >\".FECHAALTA.\"</td>\n <td class='tdcenter fondotable' width='12%' >\".ESTATUSVALIDACION.\" Trimestre \".$trimestreId.\"</td> \n <td clasS='tdcenter fondotable' width='12%' >\".ENVIARCOORDINADOR.\"</td>\";\n if($this->session['rol']>=3 ){\n $this->buffer.=\"<td clasS='tdcenter fondotable' width='10%'>\".MARCAVALIDAR.\"</td>\";\n $col++;\n }\n $this->buffer.=\"</tr></thead><tbody>\";\n $contador=1;\n $varTemporal=\"\";\n if($this->session['page']<=1)\n $contadorRen= 1;\n else\n $contadorRen=$this->session['page']+1; \n \n foreach($resultados as $id => $resul){\n $rand = rand(1,99999999999999);\n $class=\"\";\n if($contador % 2 == 0)\n $class=\"active\";\n $campo = \"estatus_avance_entrega\".$noTri;\n $idEstatus=$resul[$campo]; \n $varTemporal = $resul['id'];\n if($idEstatus == 0){\n $this->arrayNotificaciones[0]['act'] = 1;\n }\n $this->buffer.=\"\n <tr class=' $class alturaComponentesA'> \n <td class='tdcenter'>\".$contador.\"</td>\n <td class='tdcenter'>\n <a class='negro' href='#'\n data-toggle='tooltip' data-placement='bottom'\n title='\".$arrayAreas[$resul['unidadResponsable_id']].\". - Unidad Operativa: \".$arrayOpera[$resul['unidadOperativaId']].\"'>\n \" . $resul['unidadResponsable_id']. \"</a>\n </td> \n <td class='tdleft'>\".$resul['proyecto'].\"</td>\n <td class='tdcenter'>\";\n if($resul['noAcciones'] > 0)\n {\n $this->buffer.=\"\n <a class='negro' href='\".$this->path.\"aplicacion.php?aplicacion=\".$this->session ['aplicacion'].\"&apli_com=\".$this->session ['apli_com'].\"&opc=9&folio=\".$varTemporal.\"'\n data-toggle='tooltip' data-placement='bottom' title='\".TOOLTIPMETAREP.\"' id='\".$varTemporal.\"'>\".$resul['noAcciones'].\"</a>\";\n }\n $this->buffer.=\"</td> \n <td class='tdcenter'>\".substr($resul['fecha_alta'],0,10).\"</td>\n <td class='tdcenter' style='background-color:\".$this->arrayNotificaciones[$idEstatus]['color'].\";color:#000000;'>\";\n if($idEstatus > 2){\n $this->buffer.=\"<a class='negro visualizaComentarios' href='#' onclick='return false;' id='\".$varTemporal.\"'\n data-toggle='tooltip' data-placement='bottom' title='\".TOOLTIPMUESTRACOMENTARIOS.\"'>\n \".$this->arrayNotificaciones[$idEstatus]['nom'].\"\n </a>\";\n }\n else{\n $this->buffer.=$this->arrayNotificaciones[$idEstatus]['nom'];\n }\n $this->buffer.=\"</td><td class='tdcenter'>\";\n //mostramos el checkbox rol 1\n if(($this->session['rol'] == 1 || $this->session['rol'] == 2) && $idEstatus>0 && $idEstatus < 4){\n //if( ($this->arrayNotificaciones[$idEstatus]['act'] == 1) && ($resul['userId'] == $this->session['userId']) ){\n if( ($this->arrayNotificaciones[$idEstatus]['act'] == 1) ){\n if($resul['noAcciones']>0)\n $this->buffer.=\"<input data-toggle='tooltip' data-placement='bottom' title='\".DESMARCAVALIDAR.\"' type='checkbox' name='enviaId' id='\".$varTemporal.\"' class='enviaIdAvance' value='\".$resul['id'].\"'>\";\n }\n }\n //mostramos el checkbox rol 2\n if($this->session['rol'] == 2 && $idEstatus >= 4 && $idEstatus < 7 && $idEstatus != 5){\n if($resul['noAcciones']>0)\n $this->buffer.=\"<input data-toggle='tooltip' data-placement='bottom' title='\".DESMARCAVALIDAR.\"' type='checkbox' name='enviaId' id='\".$varTemporal.\"' class='enviaIdAvance' value='\".$resul['id'].\"'>\";\n }\n //mostramos el checkbox rol 3\n if($this->session['rol'] == 3 && $idEstatus >= 5 && $idEstatus < 10 && $idEstatus != 6 && $idEstatus != 8){\n if($resul['noAcciones']>0)\n if($idEstatus == 5)\n $this->buffer.=$this->pintaComentarioAvance($idEstatus,$resul['id'],$trimestreId);\n else\n $this->buffer.=\"<input data-toggle='tooltip' data-placement='bottom' title='\".DESMARCAVALIDAR.\"' type='checkbox' name='enviaId' id='\".$varTemporal.\"' class='enviaIdAvance' value='\".$resul['id'].\"'>\";\n }\n //mostramos el checkbox rol 4\n if($this->session['rol'] == 4 && $idEstatus >= 6 && $idEstatus <= 10 && $idEstatus != 7){\n if($resul['noAcciones']>0)\n if($idEstatus == 8)\n $this->buffer.=$this->pintaComentarioAvance($idEstatus,$resul['id'],$trimestreId);\n }\n $this->buffer.=\"</td>\";\n \n if ($this->session['rol'] == 3){\n $this->buffer.=\"<td class='tdcenter'>\";\n if($idEstatus == 6 ){\n $this->buffer.=\"<a class='negro enviaEnlacePlaneacion' id='c-\".$varTemporal.\"-0' href='#' data-toggle='tooltip' data-placement='bottom' title='\".TOOLTIPREGRESAPROYECTOPLANEACION.\"'><span class='glyphicon glyphicon-thumbs-down'></span> </a>\";\n }\n $this->buffer.=\"</td>\";\n }\n if ($this->session['rol'] >= 4){\n $this->buffer.=\"<td class='tdcenter'>\";\n if($idEstatus == 9 ){\n $this->buffer.=\"<a class='negro enviaCoordinador' id='p-\".$varTemporal.\"-0' href='#' data-toggle='tooltip' data-placement='bottom' title='\".TOOLTIPREGRESAPROYECTOCOORDINADOR.\"'><span class='glyphicon glyphicon-thumbs-down'></span> </a>\";\n }else{\n if($idEstatus <10 )\n $this->buffer .= \"<input data-toggle='tooltip' data-placement='bottom' title='\" . DESMARCAVALIDAR . \"' type='checkbox' name='enviaId' id='\" . $varTemporal . \"' class='enviaIdAvance' value='\" . $resul ['id'] . \"'>\";\n }\n $this->buffer.=\"</td>\";\n }\n \n $this->buffer.=\"</tr>\";\n $contador++;\n } \n $this->buffer.=\"<tbody><thead><tr>\n <td colspan='\".($col-1).\"' class='tdcenter'> </td>\n <td colspan='2' class='tdcenter'>\".$this->Genera_Archivo($this->bufferExcel,$this->path_sis).\"</td>\n </tr></thead></table>\n <table width='100%'><tr><td class='tdcenter'>\".$this->pages->display_jump_menu().\" \".$this->pages->display_items_per_page($this->session ['regs']).\"</td></tr></table>\"; \n }\n else{\n $this->buffer.=\"<table class='table table-condensed'><tr><td class='tdcenter'>\".SINREGISTROS.\"</td></tr></table>\";\n }\n $this->buffer.=\"</div></div>\";\n }",
"private function countActiveUsers(): void\n {\n $userIds = [];\n for($i=0; $i <= 11; $i++)\n {\n $userIds[$i] = [];\n }\n\n Order :: where( 'charging_status', OrderStatusEnum :: FINISHED ) -> get()\n -> filter(function($order) {\n return $order -> created_at && $order -> created_at -> year == $this -> year;\n })\n -> each(function($order) use( &$userIds ) {\n array_push($userIds[ $order -> created_at -> month - 1], $order -> user_id); \n });\n\n\n for($i = 0; $i <= 11; $i++)\n {\n $this -> data[ self :: ACTIVE ][$i] = count(array_unique($userIds[$i]));\n }\n }",
"public function CtrConsultarTipoactividadAll()\n {\n $consulta1 = mainModel::ejecutar_consulta_simple(\"SELECT DISTINCT * FROM tipoactividad ORDER BY id_tipoActividad\");\n\n $respuesta = $consulta1->fetchAll();\n return $respuesta;\n }",
"public function indexAction()\n {\n $active = $this->params('active', null);\n $page = $this->params('p', 1);\n $limit = 50;\n $offset = (int) ($page - 1) * $limit;\n\n $roles = $this->getRoles();\n\n $model = Pi::model('user');\n $where = array();\n if (null !== $active) {\n $where['active'] = (int) $active;\n }\n $select = $model->select()->where($where)->order('id')->offset($offset)->limit($limit);\n $rowset = $model->selectWith($select);\n $users = array();\n foreach ($rowset as $row) {\n $users[$row->id] = array(\n 'id' => $row->id,\n 'identity' => $row->identity,\n 'name' => $row->name,\n 'email' => $row->email,\n 'active' => $row->active,\n );\n }\n $select = $model->select()->columns(array('count' => new Expression('count(*)')))->where($where);\n $count = $model->selectWith($select)->current()->count;\n\n $roleList = array();\n $model = Pi::model('user_role');\n $rowset = $model->select(array('user' => array_keys($users)));\n foreach ($rowset as $row) {\n $users[$row->user]['role'] = $row->role;\n $roleList[$row->role] = '';\n }\n\n $model = Pi::model('user_staff');\n $rowset = $model->select(array('user' => array_keys($users)));\n foreach ($rowset as $row) {\n $users[$row->user]['role_staff'] = $row->role;\n $roleList[$row->role] = '';\n }\n\n foreach (array_keys($roleList) as $name) {\n $roleList[$name] = $roles[$name];\n }\n /*\n $model = Pi::model('acl_role');\n $rowset = $model->select(array('name' => array_keys($roleList)));\n foreach ($rowset as $row) {\n $roleList[$row->name] = __($row->title);\n }\n */\n foreach ($users as $id => &$user) {\n $user['role'] = $roleList[$user['role']];\n $user['role_staff'] = $roleList[$user['role_staff']];\n }\n\n $paginator = Paginator::factory(intval($count));\n $paginator->setItemCountPerPage($limit);\n $paginator->setCurrentPageNumber($page);\n $paginator->setUrlOptions(array(\n // Use router to build URL for each page\n 'pageParam' => 'p',\n 'totalParam' => 't',\n 'router' => $this->getEvent()->getRouter(),\n 'route' => $this->getEvent()->getRouteMatch()->getMatchedRouteName(),\n 'params' => array(\n 'module' => $this->getModule(),\n 'controller' => 'member',\n 'action' => 'index',\n //'role' => $role,\n ),\n ));\n $this->view()->assign('paginator', $paginator);\n\n $title = __('Member list');\n $this->view()->assign('title', $title);\n $this->view()->assign('users', $users);\n $this->view()->assign('role', $role);\n $this->view()->assign('roles', $roles);\n }",
"function get_servicios_join_activos($id)\n {\n $id = $this->session->id;\n $this->db->select('u.id as id_trabajador, u.nombre, u.apellido_paterno, s.id, s.titulo, s.detalles, s.fecha, s.total');\n $this->db->from('usuario as u');\n $this->db->join('servicio as s', 's.id_trabajador = u.id', 'inner');\n $this->db->where('estado', 1);\n $this->db->where('id_cliente', $id);\n $this->db->order_by('s.fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }",
"function get_listado_votos($acta)\r\n\t{\r\n\t\t\r\n\t\t$sql = \"SELECT\r\n t_v.id_acta,\r\n t_v.id_lista as id_nro_lista,\r\n\t\t\tt_l.nombre,\r\n\t\t\tt_v.cant_votos as votos\r\n\t\t\t\r\n\t\tFROM\r\n\t\t\tvoto_lista_csuperior as t_v, \r\n lista_csuperior as t_l\t\r\n WHERE t_l.id_nro_lista=t_v.id_lista and t_v.id_acta=\".$acta\r\n .\" ORDER BY t_v.id_lista\";\r\n\t\t\r\n\t\treturn toba::db('gu_kena')->consultar($sql);\r\n\t}",
"public function executeList()\n {\n if ($this->getRequestParameter('proyecto')) {\n $c = new Criteria();\n $c->add(ActividadProyectoPeer::PROYECTO_ID, $this->getRequestParameter('proyecto'));\n $this->actividad_proyectos = ActividadProyectoPeer::doSelect($c);\n\n // listar proyectos\n } else {\n $this->proyectos = ProyectoPeer::doSelect(new Criteria());\n $this->setTemplate('listProyectos');\n }\n }",
"public function getPunto_venta_almacen()\r\n {\r\n $criteria= new CDbCriteria();\r\n $criteria->condition='activo=0 and t.id not in (SELECT punto_venta_id FROM tbl_almacen WHERE 1 )';\r\n \r\n $lista= $this->model()->findAll($criteria); \r\n $resultados = array();\r\n foreach ($lista as $list){\r\n $resultados[] = array(\r\n 'id'=>$list->id,\r\n 'text'=> $list->punto_venta .' ('.$this->_tipo[$list->tipo].')' \r\n ); \r\n \r\n }\r\n return $resultados;\r\n }",
"public static function getListado(){\n return Dispositivo::model()->findAll();\n }",
"public function actionActivetasks(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $message = new Message(['scenario'=>'nonadmin']);\n $tasks = AcceptedOrders::find()->joinWith('posts')->joinWith('order')->where('(post_services.owner_id = ' . $user_id . ' OR post_order.user_id = ' . $user_id . ') AND accepted_orders.payment = \"paid\" AND post_order.type != \"Completed\"')->all();\n return $this->render('activeTasks', ['tasks'=>$tasks, 'user'=>$user, 'message'=>$message]);\n }",
"function listarCuentaBancariaUsuario(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_sel';\n\t\t$this->transaccion='TES_USRCTABAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('permiso','permiso','varchar');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha_baja','date');\n\t\t$this->captura('nro_cuenta','varchar');\n\t\t$this->captura('fecha_alta','date');\n\t\t$this->captura('id_institucion','int4');\n\t\t$this->captura('nombre_institucion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_moneda','integer');\n\t\t$this->captura('codigo_moneda','varchar');\n\t\t$this->captura('denominacion','varchar');\n\t\t$this->captura('centro','varchar');\n\t\t$this->captura('id_finalidads','varchar');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"private function listarTodosParticipante(){\n print_r($this->participantePDO->findAll());\n }",
"public function listAction(){\n\n $listAdverts = $this\n ->getDoctrine()\n ->getManager()\n ->getRepository('OCPlatformBundle:Advert')\n ->getAdvertWithApplications()\n ;\n\n foreach ($listAdverts as $advert) {\n // Ne déclenche pas de requête : les candidatures sont déjà chargées !\n // Vous pourriez faire une boucle dessus pour les afficher toutes\n $advert->getApplications();\n }\n }",
"function listarBoletaGarantiaDevuelta(){\r\n\t\t$this->procedimiento='leg.ft_boleta_garantia_dev_sel';\r\n\t\t$this->transaccion='LG_POBODEV_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\t\t\t\t\r\n\t\t$this->captura('id_anexo','int4');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('agencia','varchar');\r\n\t\t$this->captura('nro_documento','varchar'); \r\n\t\t$this->captura('fecha_desde','date');\r\n\t\t$this->captura('fecha_fin_uso','date');\r\n\t\t$this->captura('moneda','varchar');\r\n\t\t$this->captura('asegurado','numeric');\r\n\t\t$this->captura('estado','varchar');\r\n\t\t$this->captura('codigo_noiata','varchar');\r\n\t\t$this->captura('codigo','varchar');\r\n\t\t$this->captura('fecha_hasta','date');\r\n\t\t$this->captura('fecha_corte','date');\r\n\t\t$this->captura('codigo_int','varchar');\r\n\t\t$this->captura('fecha_notif','date');\r\n\t\t$this->captura('tipo','varchar');\r\n\t\t$this->captura('numero','varchar');\r\n\t\t$this->captura('tipo_agencia','varchar');\r\n\t\t$this->captura('banco','varchar');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('observaciones','text');\r\n\t\t$this->captura('id_agencia','int4');\r\n\t\t$this->captura('estado_contrato','varchar');\r\n\t\t$this->captura('id_proceso_wf','integer');\r\n\t\t$this->captura('id_estado_wf','integer');\r\n\t\t$this->captura('nro_hoja_ruta','integer');\r\n\t\t$this->captura('id_contrato','integer');\r\n\t\t$this->captura('id_gestion','integer');\r\n\t\t$this->captura('gestion','integer');\r\n\t\t$this->captura('id_proveedor','integer');\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\t\t\r\n\t\t//echo($this->consulta);exit;\r\n\t\t$this->ejecutarConsulta();\r\n\t\t\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}",
"public function actividades()\n {\n $imgp = DB::SELECT('SELECT a.`id_actividad` AS id ,a.`nombre`, f.`foto`\n FROM foto_actividades AS f\n INNER JOIN actividades AS a ON a.`id_actividad` = f.`id_actividad`\n WHERE f.tipo_foto = 1\n AND a.`secciones` = 1\n ORDER BY f.foto DESC\n LIMIT 1');\n $imgs = DB::SELECT(\"SELECT a.`id_actividad` AS id ,a.`nombre`, f.`foto`,substring(a.descripcion,1,100) as detalle\n FROM foto_actividades AS f\n INNER JOIN actividades AS a ON a.`id_actividad` = f.`id_actividad`\n WHERE f.tipo_foto = 2\n AND f.extendida=2\n AND a.secciones = 1\n AND a.activo=1\n ORDER BY a.nombre DESC\");\n \n \n /* DB::table('actividades as a')\n ->join('foto_actividades as f', 'f.id_actividad', '=' , 'a.id_actividad')\n ->select(\n 'a.id_actividad', 'a.nombre',\n 'f.foto',\n DB::row('substring(a.descripcion,1,100)')\n )\n ->where('a.secciones', '=', 1)\n ->where('f.tipo_foto', '=', 2)\n ->groupBy('a.id_actividad')\n ->get(); */\n \n \n\n\n return view('pagina.quehacer.nivel2', compact('imgp', 'imgs'));\n }",
"function listarPeriodoVenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_PERVEN_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n //Definicion de la lista del resultado del query\n $this->captura('id_periodo_venta','int4');\n $this->captura('id_gestion','int4');\n $this->captura('mes','varchar');\n $this->captura('estado','varchar');\n $this->captura('nro_periodo_mes','int4');\n $this->captura('fecha_fin','date');\n $this->captura('fecha_ini','date');\n $this->captura('tipo_periodo','varchar');\n $this->captura('medio_pago','varchar');\n $this->captura('tipo_cc','varchar');\n $this->captura('estado_reg','varchar');\n $this->captura('id_usuario_ai','int4');\n $this->captura('id_usuario_reg','int4');\n $this->captura('usuario_ai','varchar');\n $this->captura('fecha_reg','timestamp');\n $this->captura('fecha_mod','timestamp');\n $this->captura('id_usuario_mod','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n $this->captura('desc_periodo','text');\n $this->captura('fecha_pago','date');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"function listarCotizacionRPC(){\n $this->procedimiento='adq.f_cotizacion_sel';\n $this->transaccion='ADQ_COTRPC_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n \n \n $this->setParametro('id_funcionario_usu','id_funcionario_usu','int4');\n $this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\n $this->setParametro('id_funcionario_rpc','id_funcionario_rpc','int4');\n $this->setParametro('historico','historico','varchar');\n \n //Definicion de la lista del resultado del query\n $this->captura('id_cotizacion','int4');\n $this->captura('estado_reg','varchar');\n $this->captura('estado','varchar');\n $this->captura('lugar_entrega','varchar');\n $this->captura('tipo_entrega','varchar');\n $this->captura('fecha_coti','date');\n $this->captura('numero_oc','varchar');\n $this->captura('id_proveedor','int4');\n $this->captura('desc_proveedor','varchar');\n $this->captura('fecha_entrega','date');\n $this->captura('id_moneda','int4');\n $this->captura('moneda','varchar');\n $this->captura('id_proceso_compra','int4');\n $this->captura('fecha_venc','date');\n $this->captura('obs','text');\n $this->captura('fecha_adju','date');\n $this->captura('nro_contrato','varchar');\n $this->captura('fecha_reg','timestamp');\n $this->captura('id_usuario_reg','int4');\n $this->captura('fecha_mod','timestamp');\n $this->captura('id_usuario_mod','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n $this->captura('id_estado_wf','integer');\n $this->captura('id_proceso_wf','integer');\n $this->captura('desc_moneda','varchar');\n $this->captura('tipo_cambio_conv','numeric');\n $this->captura('id_solicitud','integer');\n\t\t$this->captura('id_categoria_compra','integer');\n\t\t$this->captura('numero','varchar');\n $this->captura('num_tramite','varchar');\n $this->captura('tiempo_entrega','varchar');\n\t\t$this->captura('requiere_contrato','varchar');\n\t\t$this->captura('total_adjudicado','numeric');\n\t\t$this->captura('total_cotizado','numeric');\n\t\t$this->captura('total_adjudicado_mb','numeric');\n\n\t\t$this->captura('id_gestion','int4');\n\n \n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n \n //Devuelve la respuesta\n return $this->respuesta;\n }",
"public function actionlistallfuturesinitiatedByMember(){\n \n $member_id = Yii::app()->user->id;\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='futures_initiated_by=:id';\n $criteria->params = array(':id'=>$member_id);\n $future= Futures::model()->findAll($criteria);\n \n if($future===null) {\n http_response_code(404);\n $data['error'] ='No record found';\n echo CJSON::encode($data);\n } else {\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"futures\" => $future)\n );\n \n }\n }",
"function listarServicios()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}",
"public static function list(){\r\n\t\t$app = Aplicacion::getSingleton();\r\n\t\t$conn = $app->conexionBd();\r\n\t\t\r\n\t\t$query= sprintf(\"SELECT * FROM abono\");\r\n\t\t$resultado = $conn->query($query);\r\n\t\twhile($fila = mysqli_fetch_assoc($resultado)){\r\n\t\t\t$abono = new TOAbono();\r\n\t\t\t$abono->setTipoAbono($fila['tipo']);\r\n\t\t \t$abono->setCoste($fila['coste']);\r\n\t\t\t$abono->setDuracion($fila['duracion']);\r\n\t\t\t$abonos[] = $abono;\r\n\t\t}\r\n\t\treturn $abonos;\r\n\t}",
"function listarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_sel';\r\n\t\t$this->transaccion='tgv_SERVIC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n\t\t$this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_servicio','int4');\r\n\t\t$this->captura('estado','varchar');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('id_lugar_destino','int4');\r\n\t\t$this->captura('id_ep','int4');\r\n\t\t$this->captura('fecha_asig_fin','date');\r\n\t\t$this->captura('fecha_sol_ini','date');\r\n\t\t$this->captura('descripcion','varchar');\r\n\t\t$this->captura('id_lugar_origen','int4');\r\n\t\t$this->captura('cant_personas','int4');\r\n\t\t$this->captura('fecha_sol_fin','date');\r\n\t\t$this->captura('id_funcionario','int4');\r\n\t\t$this->captura('fecha_asig_ini','date');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('fecha_reg','timestamp');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('fecha_mod','timestamp');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('desc_funcionario','text');\r\n\t\t$this->captura('desc_lugar_ini','varchar');\r\n\t\t$this->captura('desc_lugar_des','varchar');\r\n\t\t$this->captura('id_funcionario_autoriz','int4');\r\n\t\t$this->captura('observaciones','varchar');\r\n\t\t$this->captura('desc_funcionario_autoriz','text');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t//echo '--->'.$this->getConsulta(); exit;\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}",
"public function getAutoposList(){\n return $this->_get(2);\n }",
"public function listtabelCSAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('CURRENT SYSTEM');\n }",
"function listarTramitesAjustables(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_sel';\n\t\t$this->transaccion='PRE_LISTRAPE_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('fecha_ajuste','fecha_ajuste','date');\n\t\t$this->captura('id_gestion','int4');\n $this->captura('nro_tramite','varchar');\n $this->captura('codigo','varchar');\n\t\t$this->captura('id_moneda','int4');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function getUserAgendasAction()\n {\n $agenda = new Workapp_Agenda();\n $this->_helper->json($agenda->getAgendaList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }",
"static function getAll($active=null) {\n if ($active){\n $result = EmailmarketingCampaign::where('active', 1)->get()->toArray();\n } else{\n $result = array();\n }\n if (count($result) > 0) return $result;\n return array();\n }",
"public static function listaITV($idUsuario, $idTipo = null, $status = 5, $idFaculdade = 1, $idCategoria = null, $idEstrutura = null) {\n\n $cursos = Curso::distinct()->select(\n 'cursos.id',\n 'cursos.titulo as nome_curso',\n 'cursos.idioma',\n 'cursos.slug_curso',\n 'cursos.imagem',\n 'cursos_valor.valor',\n 'cursos_valor.valor_de',\n 'professor.nome as nome_professor',\n 'professor.sobrenome as sobrenome_professor',\n 'fk_cursos_tipo as tipo',\n 'estrutura_curricular_conteudo.data_inicio',\n 'estrutura_curricular_conteudo.ordem',\n 'estrutura_curricular.tipo_liberacao',\n DB::raw('IFNULL(cursos_concluidos.fk_curso, 0) as curso_concluido')\n )\n ->leftJoin('cursos_valor', 'cursos_valor.fk_curso', '=', 'cursos.id')\n ->join('professor', 'professor.id', '=', 'cursos.fk_professor')\n ->join('cursos_faculdades', 'cursos_faculdades.fk_curso', '=', 'cursos.id')\n ->join('cursos_categoria_curso', 'cursos_categoria_curso.fk_curso', '=', 'cursos.id')\n ->join('estrutura_curricular_conteudo', function ($join) {\n\n $join->on('estrutura_curricular_conteudo.fk_conteudo', '=', 'cursos.id');\n $join->on('estrutura_curricular_conteudo.fk_categoria', '=', 'cursos_categoria_curso.fk_curso_categoria');\n\n })\n ->join('estrutura_curricular', 'estrutura_curricular.id', '=', 'estrutura_curricular_conteudo.fk_estrutura')\n ->join('estrutura_curricular_usuario', 'estrutura_curricular_usuario.fk_estrutura', '=', 'estrutura_curricular.id')\n ->leftjoin('cursos_concluidos', function ($join) {\n $join->on('cursos_concluidos.fk_faculdade', '=', 'cursos_faculdades.fk_faculdade');\n $join->on('cursos_concluidos.fk_usuario', '=', 'estrutura_curricular_usuario.fk_usuario');\n $join->on('cursos_concluidos.fk_curso', '=', 'cursos.id');\n //\n })\n ->where('cursos.status', $status)\n ->where('cursos_faculdades.fk_faculdade', $idFaculdade)\n ->where('estrutura_curricular_usuario.fk_usuario', $idUsuario);\n\n if (!empty($idCategoria)) {\n $cursos->where('cursos_categoria_curso.fk_curso_categoria', $idCategoria);\n }\n\n if (!empty($idTipo)) {\n $cursos->where('cursos.fk_cursos_tipo', $idTipo);\n }\n\n if (!empty($idEstrutura)) {\n $cursos->where('estrutura_curricular.id', $idEstrutura);\n }\n\n $cursos->orderBy(DB::raw('TIMEDIFF(`estrutura_curricular_conteudo`.`data_inicio`, now()) >= 0'));\n $cursos->orderBy('estrutura_curricular_conteudo.ordem', 'asc');\n\n $cursos = $cursos->get()->toArray();\n\n return collect($cursos)->unique()->toArray();\n }",
"public function listarSocios() {\r\n $sql = \"select j.nombre,j.apellido,j.cedula,j.fechanac, j.porcentaje, m.nombre from juntadirectiva as j, municipio as m \"\r\n\t\t .\" where j.ciudadnac = m.id\";\t\t\r\n $respuesta = $this->object->ejecutar($sql);\r\n $this->construirListadoSocio($respuesta);\r\n }",
"public function getActivos(){\n // Hace la consulta y lo guarda en una variable\n $acti= Activos::where('id_empresa', \\Auth::user()->id_empresa)->get();\n\n // Se inicia la variable para guardar el contenido html por mostrar\n $tabla = '';\n $boton = '<a href=\"#modalAddActivo\" class=\"modal-effect btn btn-oblong btn-success\" data-toggle=\"modal\" data-effect=\"effect-slide-in-bottom\">Agregar</a>';\n $total=0; //$activos[0]->circulante+$activos[0]->fijo+$activos[0]->diferido;\n $n=0;\n $datosReturn=array('total_activos'=>0);\n // Revisa si la variable tiene contenido\n foreach($acti as $activos){\n $total = $activos->circulante + $activos->fijo + $activos->diferido;\n $tabla .= '\n <div class=\"col-md\">\n <p class=\"invoice-info-row\">\n <span>Activo Circulante</span>\n <span>$ '.number_format($activos->circulante,2).'</span>\n </p>\n <p class=\"invoice-info-row\">\n <span>Activo Fijo</span>\n <span>$ '.number_format($activos->fijo,2).'</span>\n </p>\n <p class=\"invoice-info-row\">\n <span>Activo Diferido</span>\n <span>$ '.number_format($activos->diferido,2).'</span>\n </p>\n <p class=\"invoice-info-row\">\n <span class=\"tx-bold\">Total</span>\n <span class=\"tx-bold\">$ '.number_format($total,2).'</span>\n </p>\n </div>';\n\n $boton = '<a href=\"#modalAddActivo\" class=\"modal-effect btn btn-oblong btn-warning\" data-toggle=\"modal\" data-effect=\"effect-slide-in-bottom\">Editar</a>';\n $n++;\n $datosReturn['total_activos']=$total;\n }\n \n if($n==0){\n $tabla .= '\n <div class=\"col-md\">\n <p class=\"invoice-info-row\">\n <span>Activo Circulante</span>\n <span>N/A</span>\n </p>\n <p class=\"invoice-info-row\">\n <span>Activo Fijo</span>\n <span>N/A</span>\n </p>\n <p class=\"invoice-info-row\">\n <span>Activo Diferido</span>\n <span>N/A</span>\n </p>\n <p class=\"invoice-info-row\">\n <span class=\"tx-bold\">Total</span>\n <span class=\"tx-bold\">N/A</span>\n </p>\n </div>';\n }\n \n // Retorna la tabla\n return response()->json(['tabla' => $tabla, 'boton' => $boton, 'datos' => $datosReturn]);\n \n }",
"public function listarcurso()\n {\n return $this->db->get(\"curso\")->result_array();\n }",
"public function listar()\n {\n $sql = \"SELECT CO.idconsulta, US.nombre, US.area, US.email, CO.problema, CO.tipo_problema,CO.estado, CO.tipo_estado,date(CO.fecha_hora) as fecha \n FROM usuarios US JOIN consulta CO\n ON US.idusuarios = CO.idusuario\n WHERE CO.tipo_estado IN ('Pendiente','En Proceso') AND CO.condicion=''\";\n return ejecutarConsulta($sql);\n\n }",
"function EstadoCuenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_SALAT_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('id_agencia','id_agencia','int4');\n //Definicion de la lista del resultado del query\n $this->captura('id_agencia','int4');\n $this->captura('id_periodo_venta','int4');\n $this->captura('nombre','varchar');\n $this->captura('mes','varchar');\n $this->captura('fecha_ini','date');\n $this->captura('fecha_fin','date');\n $this->captura('credito','varchar');\n $this->captura('total_credito','numeric');\n $this->captura('debito','varchar');\n $this->captura('total_debito','numeric');\n $this->captura('saldo','numeric');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n // var_dump($this->respuesta);exit;\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"function getAccountsListCtrl() {\n $accounts = getAccountsList();\n if ($_SESSION['malvoyant'] == \"1\") {\n $malvoyant = \"id ='lien-malvoyant'\";\n }else{\n $malvoyant = \"id ='lien'\";\n } \n if ($_SESSION['malvoyant'] == \"1\") {\n $malvoyant2 = \"class='btn btnInactifMal'\";\n }else{\n $malvoyant2 = \"class='btn btnInactif'\";\n } \n if ($_SESSION['malvoyant'] == \"1\") {\n $malvoyant3 = \"class='btn btnActifMal'\";\n }else{\n $malvoyant3 = \"class='btn btnActif'\";\n } \n echo \"<table class='table table-striped table-hover' style='background-color: white'>\";\n echo \"<thead>\";\n echo \"<tr>\";\n if ($_SESSION['langues'] == \"Français\") {\n echo \"<th>Nom</th>\";\n echo \"<th>Prénom</th>\";\n echo \"<th>Compte actif</th>\";\n } else {\n echo \"<th>Last name</th>\";\n echo \"<th>First name</th>\";\n echo \"<th>Account activated</th>\";\n }\n echo \"</tr>\";\n echo \"</thead>\";\n echo \"<tbody>\";\n foreach ($accounts as $a) {\n echo \"<tr>\";\n echo \"<td><a \".$malvoyant.\" href='../vue/utilisateur.php?id_compte=\".$a['id_compte'].\"'>\".$a['nom'].'</a></td>';\n echo \"<td><a \".$malvoyant.\" href='../vue/utilisateur.php?id_compte=\".$a['id_compte'].\"'>\".$a['prenom'].'</a></td>';\n if ($a['actif'] === 1) {\n if ($_SESSION['langues'] == \"Français\") {\n echo \"<td><a href='../controle/accountDeactivation.php?id_compte=\".$a['id_compte'].\"' \".$malvoyant3.\" title='Désactiver le profil'></a></td>\";\n } else {\n echo \"<td><a href='../controle/accountDeactivation.php?id_compte=\".$a['id_compte'].\"' \".$malvoyant3.\" title='Deactivate the profile'></a></td>\";\n }\n } else {\n if ($_SESSION['langues'] == \"Français\") {\n echo \"<td><a href='../controle/accountActivation.php?id_compte=\".$a['id_compte'].\"' \".$malvoyant2.\" title='Activer le profil'></a></td>\";\n } else {\n echo \"<td><a href='../controle/accountActivation.php?id_compte=\".$a['id_compte'].\"' \".$malvoyant2.\" title='Activate the profile'></a></td>\";\n }\n }\n echo \"<td><a \".$malvoyant.\" href='../vue/modifUtilisateur.php?id_compte=\".$a['id_compte'].\"' class='btnLien'>\";\n if ($_SESSION['langues'] == 'Français') {\n echo \"Modifier\";\n } elseif ($_SESSION['langues'] == 'English') {\n echo \"Modify\";\n }\n echo \"</a></td>\";\n }\n echo \"</tbody>\";\n echo \"</table>\";\n}",
"public function listarc()\n\t{\n\t\t$sql=\"SELECT * FROM persona WHERE tipo_persona = 'Cliente';\";\n\t\treturn ejecutarConsulta($sql);\n\t}",
"public function getActivo()\n {\n return $this->activo;\n }"
] | [
"0.74924237",
"0.697998",
"0.6657896",
"0.64976966",
"0.6428243",
"0.640448",
"0.63940513",
"0.63639206",
"0.6346448",
"0.6322791",
"0.62215436",
"0.6194469",
"0.619091",
"0.61513",
"0.6148813",
"0.6121606",
"0.6099972",
"0.60812265",
"0.607087",
"0.6067152",
"0.6029399",
"0.6028928",
"0.6006555",
"0.59919703",
"0.5976477",
"0.59738904",
"0.595128",
"0.59250414",
"0.5919204",
"0.5899415",
"0.58949596",
"0.5874621",
"0.5865681",
"0.58581007",
"0.5857493",
"0.5855492",
"0.5838857",
"0.5819327",
"0.58145463",
"0.5789576",
"0.57853484",
"0.5781994",
"0.57771486",
"0.57731634",
"0.5771469",
"0.5768808",
"0.5759963",
"0.57443166",
"0.5743207",
"0.5735148",
"0.5727151",
"0.57186663",
"0.5714082",
"0.5700044",
"0.56996506",
"0.56908417",
"0.567714",
"0.5670989",
"0.5670846",
"0.56633365",
"0.56596416",
"0.56486785",
"0.56443745",
"0.5639062",
"0.56276137",
"0.56267756",
"0.56238836",
"0.5620058",
"0.56179094",
"0.56166816",
"0.5607924",
"0.5603061",
"0.5599879",
"0.55875295",
"0.55862546",
"0.55753624",
"0.5570247",
"0.5569455",
"0.5566956",
"0.55572814",
"0.5554382",
"0.55504966",
"0.5548042",
"0.5527353",
"0.5520253",
"0.55178696",
"0.5514823",
"0.5503232",
"0.549255",
"0.5492247",
"0.5487568",
"0.54822844",
"0.54816616",
"0.5480546",
"0.54801005",
"0.54749703",
"0.54741263",
"0.5471126",
"0.5466418",
"0.5464733",
"0.5464437"
] | 0.0 | -1 |
Generates a link to PFS | function cot_build_pfs($id, $c1, $c2, $title, $parser = '')
{
global $L, $cfg, $usr, $cot_groups;
if ($id == 0)
{
$res = "<a href=\"javascript:pfs('0','" . $c1 . "','" . $c2 . "','" . $parser . "')\">" . $title . "</a>";
}
elseif (/*$cot_groups[$usr['maingrp']]['pfs_maxtotal'] > 0 && $cot_groups[$usr['maingrp']]['pfs_maxfile'] > 0 && */cot_auth('pfs', 'a', 'R'))
{
$res = "<a href=\"javascript:pfs('" . $id . "','" . $c1 . "','" . $c2 . "','" . $parser . "')\">" . $title . "</a>";
}
else
{
$res = '';
}
return($res);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function CreatePublicSymLink()\n {\n $filemanager = $this->getFileManager();\n\n $fullPath = PATH_OUTBOX.'/public/'.$this->sqlData['cms_document_tree_id'].'/';\n if (!is_dir($fullPath)) {\n $filemanager->mkdir($fullPath, 0777, true);\n }\n $targetFile = $this->GetRealPath();\n\n $sSEOTargetFileName = $this->GetTargetFileName();\n if (!$this->localFileExists()) {\n // trigger error only in live mode because sometimes files are missing in the development environment\n trigger_error('Error: Download source ['.$targetFile.'] does not exist, or is not readable!', E_USER_NOTICE);\n } else {\n $filemanager->unlink($fullPath.'/'.$sSEOTargetFileName);\n if (!file_exists($fullPath.'/'.$sSEOTargetFileName)) {\n if ($filemanager->symlink($targetFile, $fullPath.'/'.$sSEOTargetFileName)) {\n $this->fileURL = URL_OUTBOX.'/public/'.$this->sqlData['cms_document_tree_id'].'/'.$sSEOTargetFileName;\n } else {\n trigger_error('Error: Unable to create SymLink ['.$targetFile.'] -> ['.$fullPath.'/'.$sSEOTargetFileName.']', E_USER_WARNING);\n }\n }\n }\n }",
"public function makelink()\n {\n /*\n * If link set directly that forces using it rather than build\n */\n if ($this->link) {\n return $this->link;\n }\n\n $pageid = static::makeParameterId($this->for);\n $parameters = $this->app['request']->query->all();\n if (array_key_exists($pageid, $parameters)) {\n unset($parameters[$pageid]);\n } else {\n unset($parameters['page']);\n }\n\n $parameters[$pageid] = '';\n $link = '?' . http_build_query($parameters);\n\n return $link;\n }",
"public function generateLink($params)\n {\n }",
"private function getJoinLink(): string\n {\n return Config::get('SERVER_URI') . 'join/' . $this->folder->ownerId . '/' . $this->folder->id . '/' . $this->token;\n }",
"private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }",
"public function generate_url()\n {\n }",
"public function link();",
"function genLink () {\n\t\t\t$db_host=\"127.0.0.1\";\n\t\t\t$db_nombre=\"gallery\";\n\t\t\t$db_user=\"gallery\";\n\t\t\t$db_pass=\"gallery\";\n\t\t\t$link=mysql_connect($db_host, $db_user, $db_pass) or die (\"Error conectando a la base de datos.\");\n\t\t\tmysql_select_db($db_nombre ,$link) or die(\"Error seleccionando la base de datos.\");\n\t\t\t$this->link = $link;\n\t\t}",
"public function link() { return site_url().'/'.$this->post->post_name; }",
"function getLink(): string;",
"private static function generateShareLink()\n {\n $strong = true;\n $appearance = 'sha256';\n return hash($appearance, openssl_random_pseudo_bytes(128, $strong), false);\n }",
"public function getHTTPLink()\n\t{\n\t\treturn 'http://open.spotify.com/track/' . toSpotifyId($this->id);\n\t}",
"public function genMapsLink()\n {\n $city = str_replace(' ', '+', $this->getCity()->getCityName());\n $street = str_replace(' ', '+', $this->getStreet());\n $hno = str_replace(' ', '+', $this->getHouseNo());\n\n $url = \"https://maps.google.com?q=\" . $city . '+' . $street . '+' . $hno;\n\n return $url;\n }",
"public function getPrepareLink()\n {\n $baseUrl = Mage::app()->getStore($this->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\n \n return $baseUrl . $this->getData('path') . $this->getFilename();\n }",
"public function registration_link():string{\n\t\treturn 'finspot:FingerspotReg;'.base64_encode(REGISTRATION_PATH.$this->id);\n\t}",
"public function getLink();",
"public function getLink();",
"public function link()\r\n\t{\r\n\t\t$language_segment = (Config::get('core::languages')) ? $this->language->uri . '/' : '';\r\n\r\n\t\treturn url($language_segment . 'galleries/' . $this->gallery->slug . '/' . $this->id);\r\n\t}",
"public function link(){\n\t\tif( $this->link ) {\n\t\t\treturn $this->link;\n\t\t}//end if\n\n\t\t$this->link = @file_get_contents( $this->base_dir.'/'.$this->dir . $this->filename . '.link');\n\t\treturn $this->link;\n\t}",
"public function getLink() {}",
"function writeUrl() {\n\n }",
"function generateFTPLink(string $file_name, int $dataset): string\n{\n\t$handle = fopen(\"/var/access/$dataset/download_token.txt\", \"r\");\n\t$line = fgets($handle) ;\n\tif (true == $line) {\n\t\t$download_token = chop($line);\n\t}\n\tfclose($handle);\n\n\t$appconfig = parse_ini_file(\"/var/appconfig.ini\");\n\t$ftpd_endpoint = $appconfig[\"ftpd_endpoint\"] ?? \"localhost\";\n\t$ftp_link = \"ftp://d-$dataset:$download_token@$ftpd_endpoint:9021/$file_name\";\n\treturn $ftp_link;\n}",
"function forum_make_link($discussion_id, $post_id) {\n global $CFG;\n \n return $CFG->wwwroot.'/mod/forum/discuss.php?d='.$discussion_id.'#'.$post_id;\n}",
"protected function _executeGenerateSimulatedUrl() {\n // Init\n $ret = '';\n\n $pid = (int)$this->_postVar['pid'];\n\n if (!empty($pid)) {\n $page = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', $pid);\n\n if (!empty($page)) {\n\n if (\\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::isLoaded('realurl')) {\n // Disable caching for url\n $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['enableUrlDecodeCache'] = 0;\n $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['enableUrlEncodeCache'] = 0;\n $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['disablePathCache'] = 1;\n }\n\n $this->_initTsfe($page, NULL, $page, NULL);\n\n $ret = $GLOBALS['TSFE']->cObj->typolink_URL(array('parameter' => $page['uid']));\n\n if (!empty($ret)) {\n $ret = \\TQ\\TqSeo\\Utility\\GeneralUtility::fullUrl($ret);\n }\n }\n }\n\n if (!empty($ret)) {\n $ret = array(\n 'url' => $ret,\n );\n } else {\n $ret = array(\n 'error' => $GLOBALS['LANG']->getLL('error.url_generation_failed'),\n );\n }\n\n return $ret;\n }",
"public function getLink()\n {\n return $this->getMonstring()->getLink()\n . 'program/?hendelse='\n . $this->getId();\n }",
"protected function generateDownloadLink()\n\t{\n\t\t$params = array(\n\t\t\t'PROCESS_TOKEN' => $this->processToken,\n\t\t\t'EXPORT_TYPE' => $this->exportType,\n\t\t\t'COMPONENT_NAME' => $this->componentName,\n\t\t);\n\n\t\treturn $this->getActionUri(self::ACTION_DOWNLOAD, $params);\n\t}",
"public function getLink(): string;",
"public function getLink(): string;",
"function build_href( $p_path ) {\n\tglobal $t_depth;\n\n\t$t_split = explode( DIRECTORY_SEPARATOR, $p_path );\n\t$t_slice = array_slice( $t_split, $t_depth );\n\n\treturn '/' . implode( '/', array_map( 'urlencode', $t_slice ) );\n}",
"protected function generateLinks()\n {\n if ( ! is_null($this->links) ) {\n foreach ( $this->links as $link ) {\n $this->addLine('<url>');\n $this->addLine('<loc>');\n $this->addLine($this->helpers->url(\n $link->link,\n $this->protocol,\n $this->host\n ));\n $this->addLine('</loc>');\n $this->addLine('<lastmod>' . date_format($link->updated_at, 'Y-m-d') . '</lastmod>');\n $this->addLine('</url>');\n }\n }\n }",
"public function rgveda_link($gra1,$gra2) { \n $dbg=false;\n dbgprint($dbg,\"rgveda_link: gra1=$gra1, gra2=$gra2\\n\");\n list($mandala,$hymn) = explode(\".\",$gra1);\n $imandala = (int)$mandala;\n $ihymn = (int)$hymn;\n $hymnfilepfx = sprintf(\"rv%02d.%03d\",$imandala,$ihymn);\n $hymnfile = \"$hymnfilepfx.html\";\n $iverse = (int)$gra2;\n $versesfx = sprintf(\"%02d\",$iverse);\n $anchor = \"$hymnfilepfx.$versesfx\";\n dbgprint($dbg,\"rgveda_link: hymnfile=$hymnfile, anchor=$anchor\\n\");\n return array($hymnfile,$anchor);\n}",
"protected function generateCloudLink()\n\t{\n\t\t$this->instanceBucket();\n\n\t\tif ($this->checkCloudErrors())\n\t\t{\n\t\t\treturn $this->bucket->GetFileSRC($this->uploadPath);\n\t\t}\n\n\t\treturn '';\n\t}",
"public function getLink() {\n\t\t$link = str_replace('\\\\', \"/\", $this->address);\n\t\treturn str_replace(GProject::$ADDRESS, \"\", $link);\n\t}",
"function df_store_url_link($s = null) {return df_store_url($s, S::URL_TYPE_LINK);}",
"public function getViewLink() {\n return getConfig(\"public_url\").\"?\".$this->shareID;\n }",
"function sfgov_utilities_deploy_12_dept_go_to_url() {\n try {\n $deptNodes = Utility::getNodes('department');\n foreach($deptNodes as $dept) {\n $currentSite = $dept->field_url->uri;\n $goToSite = $dept->field_go_to_current_url->value;\n echo $dept->getTitle() . \" (\" . $dept->id() . \") \\n\" . \n \"\\tcurrent site url: $currentSite\\n\" .\n \"\\tgo to site: $goToSite\" .\n \"\\n\";\n \n if ($goToSite == true) {\n $dept->set('field_direct_external_url', [\n 'uri' => $currentSite\n ]);\n $dept->save();\n echo \"saved \" . $dept->getTitle() . \" <---\\n\";\n }\n }\n } catch(\\Exception $e) {\n error_log($e->getMessage(), \"\\n\");\n }\n}",
"function pmpro_link()\n{\n?>\nMemberships powered by Paid Memberships Pro v<?php echo PMPRO_VERSION?>.\n<?php\n}",
"function buildLink( $action ){\n\n\treturn getBaseURI() . 'index.php?action=' . $action;\n}",
"public function getLink()\n {\n $link = $this->getFunctionPath();\n $parameterCount = count($this->servers);\n\n if($parameterCount > 0)\n $link .= \"?\";\n\n $link .= $this->buildParameterArray('servers', $this->servers);\n\n return $link;\n }",
"public function url($name)\n {\n //Create the link\n return $this->router->generate('TyHandDocDownloaderBundle_getFile', array('name' => $name));\n }",
"public function url($p)\n {\n if (!is_array($p))\n $p = array('_action' => @func_get_arg(0));\n\n $task = $p['_task'] ? $p['_task'] : ($p['task'] ? $p['task'] : $this->task);\n $p['_task'] = $task;\n unset($p['task']);\n\n $url = './';\n $delm = '?';\n foreach (array_reverse($p) as $key => $val) {\n if ($val !== '' && $val !== null) {\n $par = $key[0] == '_' ? $key : '_'.$key;\n $url .= $delm.urlencode($par).'='.urlencode($val);\n $delm = '&';\n }\n }\n return $url;\n }",
"public function __toString()\n {\n return '/creativestofollow';\n }",
"public function getLink() {\n\t\t\t// This is currently identical to drawLink()\n\t\t\t// but that's designed to return HTML, and may in the future contain formatting etc\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_row(\"SELECT parent,name FROM pages WHERE guid = '{$this->guid}'\");\n\t\t\t$location = array();\n\t\t\t$html = '';\n\t\t\twhile ($data->parent != 0) {\n\t\t\t\t$html = '/'.$data->name.$html;\n\t\t\t\t$data = $db->get_row(\"SELECT parent,name FROM pages WHERE guid = '{$data->parent}'\");\n\t\t\t}\n\t\t\treturn $html . '/'; // .html removed and replaced by a /\n\t\t}",
"public function generateUrl ($filename)\n {\n return $this->context->getController()->genUrl('@uapvHelpShowPage?file=').$filename;\n }",
"public function link()\n\t{\n\t\treturn route('balldeep.posts.show', [$this->type->slug, $this->slug]);\n\t}",
"public function getLink()\n {\n $link = $this->getFunctionPath();\n $link .= \"?issueId=\".$this->issueId;\n $link .= \"&\".$this->eventGroupIdParameter.\"=\".$this->eventsGroupId;\n\n return $link;\n }",
"function rsd_link()\n {\n }",
"public function createSoftLink()\n {\n if (stripos(__DIR__, 'vendor/adamasantares/migra-php') !== false) {\n shell_exec('ln -s ' . __FILE__ . ' ' . __DIR__ . '/../../../migra');\n shell_exec('chmod +x ' . __DIR__ . '/../../../migra');\n if (is_file(__DIR__ . '/../../../migra')) {\n ech(\" Soft link ./migra created\\n\", 'cyan');\n ech(\" Now you can use './migra' command from project's root folder\\n\", 'cyan');\n } else {\n ech(\" Some problem on soft link creation.\\n\", 'red');\n }\n } else {\n ech(\" No need to create soft link, you don't use Composer installation.\\n\", 'cyan');\n }\n }",
"public function getLink():string;",
"public function drawLink() {\n\t\t\treturn $this->drawLinkByGUID($this->guid);\n\t\t\t\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_row(\"SELECT parent,name FROM pages WHERE guid = '{$this->guid}'\");\n\t\t\t$location = array();\n\t\t\t$html = '';\n\t\t\tif ($data->parent == 0) {\n\t\t\t\t//$html .= '/'.$data->name.$html;\n\t\t\t\t$html = '';\n\t\t\t}\n\t\t\telse {\n\t\t\t\twhile ($data->parent != 0) {\n\t\t\t\t\t$html = '/'.$data->name.$html;\n\t\t\t\t\t$data = $db->get_row(\"SELECT parent,name FROM pages WHERE guid = '{$data->parent}'\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $html . '/'; // .html removed and replaced by a /\n\t\t}",
"function locallink($hash, $name = null, $returnonly = false) {\n global $ID;\n $name = $this->_getLinkTitle($name, $hash, $isImage);\n $hash = $this->_headerToLink($hash);\n $title = $ID.' ↵';\n\n $doc = '<a href=\"#'.$hash.'\" title=\"'.$title.'\" class=\"wikilink1\">';\n $doc .= $name;\n $doc .= '</a>';\n\n if($returnonly) {\n return $doc;\n } else {\n $this->doc .= $doc;\n }\n }",
"function generate_follow_link() {\n\t\treturn str_replace( 'swfw_username', $this->username, $this->url);\n\t}",
"public function viewLink()\n {\n return \\Html::link($this->entity->path(), $this->entity->getTitle(), ['target' => '_blank']);\n }",
"function permalink_link()\n {\n }",
"public function link($file_id, $action) {\n /*\n if($action == \"ipa\") {\n $path = dirname($_SERVER[\"SCRIPT_NAME\"]);\n if($path == \"/\")\n\t$path = \"\";\n $file = urlencode($file_id);\n return base_url() . \"$path/\" . IPAPATH . \"/$file\";\n } \n */\n\n return base_url() .\n \"{$_SERVER[\"SCRIPT_NAME\"]}\" . \n \"?file=\" . urlencode($file_id) .\n \"&action=\" . urlencode($action);\n }",
"function renderFilterCreationLink() {\n\t\t$content = tslib_CObj::getSubpart($this->fileContent, '###NEWFILTER_LINK###');\n\n\t\tif (!isset($this->conf['newfilter_link.']['form_url.']['parameter'])) {\n\t\t\t$this->conf['newfilter_link.']['form_url.']['parameter'] = $GLOBALS['TSFE']->id;\n\t\t}\n\t\t$this->conf['newfilter_link.']['form_url.']['returnLast'] = 'url';\n\t\t$content = tslib_cObj::substituteMarker($content, '###FORM_URL###', $this->cObj->typolink('', $this->conf['newfilter_link.']['form_url.']));\n\n\t\treturn $content;\n\t}",
"public function createReferralLink() : string\n {\n $url = $this->storeManager->getStore()->getBaseUrl(UrlInterface::URL_TYPE_WEB);\n $encrypt = urlencode($this->encryptor->encrypt($this->customerSession->getCustomerId()));\n $link = $url . \"?ref=\" . $encrypt;\n return $link;\n }",
"function href() {\n\t\t$usemodrewrite = polarbear_setting('usemodrewrite');\n\t\tif ($usemodrewrite) {\n\t\t\treturn $this->fullpath();\n\t\t} else {\n\t\t\treturn $this->templateToUse() . '?polarbear-page=' . $this->getId();\n\t\t}\n\t}",
"protected abstract function createUrl($file);",
"public function Link($action = null)\n {\n return Controller::join_links(Director::baseURL(), 'vision6', $action);\n }",
"public function __construct(){\n\t\t\t$this->genLink();\n\t\t}",
"public function makeLinkButton() {}",
"public function link(): string\n {\n return $this->link;\n }",
"function path_PMS() {\n global $nome_cartella;\n $path = $nome_cartella;\n if(!empty($path)) $path = $nome_cartella .\"/\";\n return \"http://\" . $_SERVER['SERVER_NAME'] . \"/\".$path;\n}",
"function PDF_add_weblink($pdfdoc, $lowerleftx, $lowerlefty, $upperrightx, $upperrighty, $url)\n{\n}",
"function build_link($text, $page){\n\t$format = '<a href=\"%2$s\">%1$s</a>';\n\n\tprintf($format, $text, link_to($page, false));\n}",
"public function makeLinks() {\r\n $this->url = new Url(sprintf(\"/f-p%d.htm#%d\", $this->id, $this->id));\r\n $this->url->single = sprintf(\"/forums?mode=post.single&id=%d\", $this->id);\r\n $this->url->report = sprintf(\"/f-report-%d.htm\", $this->id);\r\n $this->url->reply = sprintf(\"/f-po-quote-%d.htm\", $this->id);\r\n $this->url->delete = sprintf(\"/f-po-delete-%d.htm\", $this->id);\r\n $this->url->edit = sprintf(\"/f-po-editpost-%d.htm\", $this->id);\r\n $this->url->replypm = sprintf(\"/messages/new/from/%d/\", $this->id);\r\n $this->url->iplookup = sprintf(\"/moderators?mode=ip.lookup&ip=%s\", $this->ip);\r\n $this->url->herring = sprintf(\"/f-herring-p-%d.htm\", $this->id);\r\n \r\n if ($this->thread->forum->id == 71) {\r\n $this->url->developers = sprintf(\"/%s/d/%s/%s\", \"developers\", $this->thread->url_slug, $this->url_slug);\r\n }\r\n \r\n return $this;\r\n }",
"protected function generateURLListFile() {\n\t\t$content = '';\n\t\t$allowedURLs = $this->indexer->getAllowedURLs();\n\t\t$recordSet = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,tx_mnogosearch_url',\n\t\t\t'tx_mnogosearch_urllog', '');\n\t\t$GLOBALS['TYPO3_DB']->sql_query('START TRANSACTION');\n\t\twhile (false !== ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($recordSet))) {\n\t\t\t$addUrl = false;\n\t\t\tforeach ($allowedURLs as $allowedURL) {\n\t\t\t\tif (substr($allowedURL, 0, 6) == 'htdb:/') {\n\t\t\t\t\t$addUrl = ($allowedURL == dirname($row['tx_mnogosearch_url']));\n\t\t\t\t}\n\t\t\t\telseif (substr($row['tx_mnogosearch_url'], 0, 6) != 'htdb:/') {\n\t\t\t\t\tif ($allowedURL{0} == '/') {\n\t\t\t\t\t\t// regexp\n\t\t\t\t\t\t$addUrl = preg_match($allowedURL, $row['tx_mnogosearch_url']);\n\t\t\t\t\t}\n\t\t\t\t\telseif (strpos($allowedURL, '*')) {\n\t\t\t\t\t\t// wildcard\n\t\t\t\t\t\t$regexp = str_replace('/', '\\/', str_replace('*', '.*', $allowedURL));\n\t\t\t\t\t\t$addUrl = preg_match('/' . $regexp . '/', $row['tx_mnogosearch_url']);\n\t\t\t\t\t}\n\t\t\t\t\telseif (strpos($row['tx_mnogosearch_url'], $allowedURL) === 0) {\n\t\t\t\t\t\t// normal string\n\t\t\t\t\t\t$addUrl = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($addUrl) {\n\t\t\t\t\t$content .= $row['tx_mnogosearch_url'] . chr(10);\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_mnogosearch_urllog', 'uid=' . $row['uid']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($recordSet);\n\t\t$name = '';\n\t\tif ($content) {\n\t\t\t$name = tempnam(sys_get_temp_dir(), 'mnogo-');\n\t\t\tif (!@file_put_contents($name, $content)) {\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_query('ROLLBACK');\n\t\t\t\tthrow new Exception(sprintf('Unable to create URL list file \"%s\"', $name));\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_query('COMMIT');\n\n\t\treturn $name;\n\t}",
"function MilestoneLink(){\n\t\techo '<a href=\"',plugin_page('main'),'\">Milestone</a> | ';\n\t}",
"public function toUrl()\n {\n\n return '<a href=\"'.static::$toUrl.'&objid='.$this->id.'\" >'.$this->text().'</a>';\n\n }",
"public function toUrl()\n {\n $queryParams = '';\n\n $index = 0;\n\n foreach ($this->args as $key => $param) {\n $separator = '?';\n\n if ($index) {\n $separator = '&';\n }\n\n $queryParams .= \"{$separator}{$key}={$param}\";\n\n $index++;\n }\n\n return \"https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}\";\n }",
"protected function getLink($filename) {\n return 'http://' . $_SERVER['HTTP_HOST'] . '/' . $filename;\n }",
"function cat_create_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/create\");\n}",
"function rdf_permalink( $my_post ) {\n $permalink = site_url( ) . \"?ps_articles=\" . $my_post->post_name;\n return( $permalink );\n}",
"function get_generic_link() {\n\t\treturn $this->url;\n\t}",
"public function linkPass()\n {\n }",
"public function href();",
"protected function createLink($output)\n {\n $link = new Process(sprintf('ln -f %s %s', $this->toFile, $this->link));\n $link->run();\n if ($link->isSuccessful()) {\n $output->writeln(sprintf('<info>Link %s created succesfully</info>', $this->link));\n return true;\n }\n $this->failingProcess = $link;\n return false;\n }",
"public function get_link()\r\n\t{\r\n\t\t$url = api_get_path(WEB_PATH)\r\n\t\t\t.'main/gradebook/exercise_jump.php?cid='.$this->get_course_code();\r\n\t\tif (!api_is_allowed_to_create_course()\r\n\t\t\t&& $this->calc_score(api_get_user_id()) == null)\r\n\t\t$url .= '&doexercise='.$this->get_ref_id();\r\n\t\t\r\n\t\treturn $url;\r\n\t}",
"function linkgml($gkz, $gml, $typ) {\n\t$kurzid=substr($gml, 12); // ID in Anzeige kuerzen (4 Zeichen), der Anfang ist immer gleich\n\techo \"\\n\\t\\t<a target='_blank' title='ID \".$typ.\"' class='gmlid noprint' \";\n\techo \"href='alkisrelationen.php?gkz=\".$gkz.\"&gmlid=\".$gml.\"&otyp=\".$typ.\"'>\";\n\techo \"<img src='ico/Beziehung_link.ico' width='16' height='16' alt=''>\".$kurzid.\"</a>\";\n\treturn 0;\n}",
"public function uploadlink() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n }",
"public function buildFrontendUri() {}",
"function generateInviteLink(){\n\t\treturn \"https://app.healthlynked.com/#!/group_join_invite/\".$this->secret.\"?return_url=access_control\";\n\t}",
"function get_createlink() {\n\treturn BASE . 'discussion' . DS . 'create';\n}",
"public function getDirectUrl(): string\n {\n return $this->directUrlBase . $this->templateId . '.png?' . http_build_query($this->buildQuery());\n }",
"function generate_external_link($id, $ext)\n {\n global $data_sub;\n $data_sub1 = \"\";\n if($data_sub !== \"\")\n $data_sub1 = \"${data_sub}.\";\n \n $append_ext = \"\";\n if($ext == \"gif\" || $ext == \"webm\")\n $append_ext = \".$ext\";\n\n global $server_name;\n return format_public_uri($data_sub1.$server_name, true).\"/\".$id.$append_ext;\n }",
"public function viewLink()\n {\n return $this->html->link($this->object->path(), $this->object->getTitle(), ['target' => '_blank']);\n }",
"function makeLink($title,$open_text,$save_text,$base_path,$prefix=\"\") {\n\t\tglobal $modx;\n\t\t$placeholders = array(\n\t\t\t\"[+open_url+]\" => $this->buildURL(\"debug=open\",$modx->documentIdentifier,$prefix),\n\t\t\t\"[+curl+]\" => $_SERVER[\"REQUEST_URI\"],\n\t\t\t\"[+dbg_title+]\" => $title,\n\t\t\t\"[+dbg_icon_url+]\" => $base_path.'bug.png',\n\t\t\t\"[+save_url+]\" => $this->buildURL(\"debug=save\",$modx->documentIdentifier,$prefix),\n\t\t\t\"[+open_dbg_console+]\" => $open_text,\n\t\t\t\"[+save_dbg_console+]\" => $save_text,\n\t\t);\n\t\treturn str_replace( array_keys( $placeholders ), array_values( $placeholders ), $this->templates[\"links\"]);\n\t}",
"function get_personal_message_creation_url()\r\n {\r\n return $this->get_url(array(self :: PARAM_ACTION => self :: ACTION_CREATE_PUBLICATION));\r\n }",
"function devshop_project_drush_aliases_page($node) {\n $project = $node->project;\n $filename = $project->name . '.aliases.drushrc.php';\n header(\"Content-Disposition: attachment; filename='$filename'\");\n print devshop_project_aliases($project);\n}",
"function make_link($params = null) {\n $params = func_get_args();\n $name = array_shift($params);\n $url = call_user_func_array('url_for', $params);\n \n return sprintf('<a href=\"%s\">%s</a>', $url, $name);\n}",
"function createDocmanLink($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $obsolescence_date, $content, $permissions, $metadata, $owner, $create_date, $update_date) {\n $extraParams['item']['link_url'] = $content;\n return _createDocmanDocument($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $obsolescence_date, PLUGIN_DOCMAN_ITEM_TYPE_LINK, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams);\n}",
"function makePMLink()\n{\n\tif(LOGGED)\n\t{\n\t\tglobal $db;\n\n\t\t$ret = $db->query('select count(*) as count from pm where pm_to=' . ID . ' and pm_read=0');\n\n\t\tif($ret[0]['count'])\n\t\t return makeLink($ret[0]['count'] . ' new PMs', 'a=viewpms', SECTION_USER);\n\t}\n\n\treturn '';\n}",
"function getSoftwareLink();",
"function stick_link($title) {\n\treturn BASE . 'discussion' . DS . discussion::encode_title($title) . DS . 'stick';\n}",
"public function links()\n\t{\n\t\techo view('sketchpad::help/output/links');\n\t}",
"function druplex_field__field_portfolio_link($variables) {\n\n $output = '';\n \n $link = $variables['items'];\n\n if (!empty($link)) {\n $output .= '<a href=\"' . drupal_render($link) . '\">' . t('View project') . '</a>';\n }\n \n return $output;\n}",
"function getGameURL()\n{\n\tif(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') \n\t\t$link = \"https\"; \n\telse\n\t\t$link = \"http\"; \n\n\t$link .= \"://\"; \n\n\t// Append the host to URL\n\t$link .= $_SERVER['HTTP_HOST']; \n\t\n\t// Append the folder structure to URL\n\t$link .= $_SERVER['REQUEST_URI']; \n\t\t\n\t// Remove \"host\" subfolder\n\t$folder_name = \"host\";\n\t$link = substr_replace($link ,\"\", (strlen($folder_name) + 1) * -1);\n\treturn $link; \n}",
"function getLink() {return $this->_link;}",
"function getLink() {return $this->_link;}"
] | [
"0.62729466",
"0.6113219",
"0.5976677",
"0.590912",
"0.5881928",
"0.5848959",
"0.5792101",
"0.57365143",
"0.57140017",
"0.56712306",
"0.56440204",
"0.56202257",
"0.5615459",
"0.5615393",
"0.55871993",
"0.5564749",
"0.5564749",
"0.55646354",
"0.5540782",
"0.5535262",
"0.55043036",
"0.5495683",
"0.5468453",
"0.54460025",
"0.54370373",
"0.54303175",
"0.54274297",
"0.54274297",
"0.54238176",
"0.54194504",
"0.5395429",
"0.5390878",
"0.5382743",
"0.53820866",
"0.536597",
"0.5327739",
"0.5312037",
"0.53082854",
"0.5300638",
"0.5295124",
"0.5290037",
"0.5284172",
"0.5281215",
"0.5278944",
"0.52770954",
"0.5276872",
"0.52739036",
"0.5263465",
"0.5251024",
"0.5236219",
"0.5228602",
"0.52268976",
"0.5222311",
"0.52104795",
"0.5210088",
"0.5201318",
"0.518969",
"0.5188509",
"0.5174241",
"0.5171903",
"0.5169698",
"0.516299",
"0.51607114",
"0.51515895",
"0.5149095",
"0.51467305",
"0.5145698",
"0.51378495",
"0.51312274",
"0.51274806",
"0.51102793",
"0.51076657",
"0.510377",
"0.51019704",
"0.51006585",
"0.509906",
"0.50927764",
"0.5089318",
"0.5089051",
"0.5086984",
"0.5078121",
"0.5075254",
"0.50705653",
"0.5070127",
"0.5064666",
"0.50589365",
"0.5058512",
"0.5057854",
"0.50577706",
"0.5054368",
"0.5054341",
"0.5053525",
"0.50505257",
"0.504893",
"0.50461566",
"0.5042993",
"0.5038481",
"0.50370216",
"0.50367427",
"0.50367427"
] | 0.5326838 | 36 |
Create a new PFS folder, return new folder ID | function cot_pfs_createfolder($ownerid, $title='', $desc='', $parentid='', $ispublic='', $isgallery='')
{
global $db, $db_pfs_folders, $cfg, $sys, $L, $err_msg;
if ($title==='') $title = cot_import('ntitle','P','TXT');
if ($desc==='') $desc = cot_import('ndesc','P','TXT');
if ($parentid==='') $parentid = cot_import('nparentid','P','INT');
if ($ispublic==='') $ispublic = cot_import('nispublic','P','BOL');
if ($isgallery==='') $isgallery = cot_import('nisgallery','P','BOL');
if(empty($title))
{
$err_msg[] = $L['pfs_foldertitlemissing'];
return 0;
}
$newpath = cot_translit_encode(mb_strtolower($title));
if ($parentid > 0)
{
$newpath = cot_pfs_folderpath($parentid, TRUE).$newpath;
$sql = $db->query("SELECT pff_id FROM $db_pfs_folders WHERE pff_userid=".(int)$ownerid." AND pff_id=".(int)$parentid);
$sql->rowCount()>0 or cot_die();
}
if ($cfg['pfs']['pfsuserfolder'])
{
cot_pfs_mkdir($pfs_dir_user.$newpath) or cot_redirect(cot_url('message', 'msg=500&redirect='.base64_encode('pfs.php'), '', true));
cot_pfs_mkdir($thumbs_dir_user.$newpath) or cot_redirect(cot_url('message', 'msg=500&redirect='.base64_encode('pfs.php'), '', true));
}
$db->insert($db_pfs_folders, array(
'pff_parentid' => (int)$parentid,
'pff_userid' => (int)$ownerid,
'pff_title' => $title,
'pff_date' => (int)$sys['now'],
'pff_updated' => (int)$sys['now'],
'pff_desc' => $desc,
'pff_path' => $newpath,
'pff_ispublic' => (int)$ispublic,
'pff_isgallery' => (int)$isgallery,
'pff_count' => 0
));
return $db->lastInsertId();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createFolder(string $foldername);",
"function create_new_folder($parent_id, $folder_name) {\n\n\t\t// Ensure that folder name is valid\n\t\t{\n\t\t\t$test = preg_match('/^[a-zA-Z0-9_\\.\\s-]{'\n\t\t\t\t.FilesDatabase::NAME_MIN_LENGTH.','.FilesDatabase::NAME_MAX_LENGTH\n\t\t\t\t.'}$/u',\n\t\t\t\t$folder_name\n\t\t\t);\n\n\t\t\tif ($test === 0) {\n\t\t\t\treturn FilesDatabase::NEW_ITEM_INVALID_NAME;\n\t\t\t}\n\t\t\telse if ($test === false) {\n\t\t\t\treturn FilesDatabase::NEW_ITEM_INTERNAL_ERROR;\n\t\t\t}\n\t\t}\n\n\t\t// Variable containing SQL statement\t\t\n\t\t$con = $this->connection->get_pdo_connection();\n\t\t$sql = \"INSERT INTO folders (parent,name,date_added) VALUES (:parent_id, :name, now())\";\n\t\t\n\t\t// Create PDO Prepared Statement\n\t\t$stmt = $con->prepare($sql);\n\t\t\n\t\t// Bind variables to statement\n\t\t$stmt->bindValue(\"parent_id\", $parent_id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(\"name\", $folder_name, PDO::PARAM_STR);\n\t\t\n\t\ttry {\n\t\t\t// Execute statement\n\t\t\t$stmt->execute();\n\t\t\t$this->last_inserted = $con->lastInsertId();\n\n\t\t} catch (PDOException $e) {\n\t\t\t$this->last_exception = $e;\n\t\t\treturn FilesDatabase::NEW_ITEM_INTERNAL_ERROR;\n\t\t}\n\n\t\treturn FilesDatabase::NEW_ITEM_OKAY;\n\t}",
"public function new_folder()\n {\n $input = JFactory::getApplication()->input;\n\n $ecr_project = $input->get('ecr_project');\n\n if($input->get('do_action') == 'new_folder')\n {\n $act_path = $input->getPath('act_path');\n $act_name = $input->getPath('act_name');\n $act_path = str_replace('/', DS, $act_path);\n $path = JPATH_ROOT.DS.$act_path;\n\n if( ! JFolder::exists($path))\n {\n EcrHtml::message(array(jgettext('Wrong base folder'), $path), 'error');\n\n return;\n }\n\n $path .= DS.$act_name;\n\n if(JFolder::exists($path))\n {\n EcrHtml::message(array(jgettext('The folder already exists'), $path), 'error');\n\n return;\n }\n\n if( ! JFolder::create($path))\n {\n EcrHtml::message(array(jgettext('Unable to create folder'), $path), 'error');\n\n return;\n }\n\n //-- Clean the cache\n JFactory::getCache('EasyCreator_'.$ecr_project)->clean();\n\n echo '*OK*';\n\n return;\n }\n\n $this->actForm(jgettext('New folder'), 'add', jgettext('Create'));\n $this->processForm('new_folder', $ecr_project, 'folder', 'new', true, true);\n }",
"function createFolder($folder_name, $parent_id){\n $url = $this->url.\"files\";\n $post['data'] = array(\n 'attributes' => array( \n \"name\" => $folder_name,\n \"parent_id\" => $parent_id,\n ),\n \"type\" => \"files\" \n );\n $post = json_encode($post);\n $result = $this->post_to_zoho($url, $post);\n return $result;\n }",
"public function taskSaveNewFolder(): void\n {\n $directory = $this->getDirectory();\n if (!$directory) {\n throw new RuntimeException('Not Found', 404);\n }\n\n $collection = $directory->getIndex();\n if (!($collection instanceof PageCollection || $collection instanceof PageIndex)) {\n throw new RuntimeException('Task saveNewFolder works only for pages', 400);\n }\n\n $data = $this->data;\n $route = trim($data['route'] ?? '', '/');\n\n // TODO: Folder name needs to be validated! However we test against /=\"' as they are dangerous characters.\n $folder = mb_strtolower($data['folder'] ?? '');\n if ($folder === '' || preg_match('![=\"\\']!u', $folder) !== 0) {\n throw new RuntimeException('Creating folder failed, bad folder name', 400);\n }\n\n $parent = $route ? $directory->getObject($route) : $collection->getRoot();\n if (!$parent instanceof PageObject) {\n throw new RuntimeException('Creating folder failed, bad parent route', 400);\n }\n\n if (!$parent->isAuthorized('create', 'admin', $this->user)) {\n throw new RuntimeException($this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') . ' create.', 403);\n }\n\n $path = $parent->getFlexDirectory()->getStorageFolder($parent->getStorageKey());\n if (!$path) {\n throw new RuntimeException('Creating folder failed, bad parent storage path', 400);\n }\n\n // Ordering\n $orders = $parent->children()->visible()->getProperty('order');\n $maxOrder = 0;\n foreach ($orders as $order) {\n $maxOrder = max($maxOrder, (int)$order);\n }\n\n $orderOfNewFolder = $maxOrder ? sprintf('%02d.', $maxOrder+1) : '';\n $new_path = $path . '/' . $orderOfNewFolder . $folder;\n\n /** @var UniformResourceLocator $locator */\n $locator = $this->grav['locator'];\n if ($locator->isStream($new_path)) {\n $new_path = $locator->findResource($new_path, true, true);\n } else {\n $new_path = GRAV_ROOT . '/' . $new_path;\n }\n\n Folder::create($new_path);\n Cache::clearCache('invalidate');\n $directory->getCache('index')->clear();\n\n $this->grav->fireEvent('onAdminAfterSaveAs', new Event(['path' => $new_path]));\n\n $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_NEW_FOLDER_SUCCESS'));\n\n $this->setRedirect($this->referrerRoute->toString(true));\n }",
"private function _do_create_folder() {\n\t\tif (g($_POST, 'folder')) {\n\t\t\tif (g($this->conf, 'disable.add')) die('Forbidden');\n\t\t\n\t\t\t$folder = strtolower(str_replace(' ', '-', g($_POST, 'folder')));\n\t\t\t$folder = preg_replace(\"/[^a-z0-9_-]+/i\", \"\", $folder);\n\t\t\t\n\t\t\t$path = $this->_path(g($this->conf, 'path') . '/' . $folder);\n\t\t\t\n\t\t\tif (file_exists($path)) {\n\t\t\t\t$this->_msg('Cannot create folder ['.htmlspecialchars($folder).'] : folder/file exists', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\n\t\t\tif (@mkdir($path, 0775)) {\n\t\t\t\t$this->_msg('Success create folder ['.htmlspecialchars($folder).']');\n\t\t\t\theader('location:'.$this->_url(array('path' => $this->_sanitize(g($this->conf, 'path') . '/' . $folder))));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed create folder ['.htmlspecialchars($folder).'] : please call your administrator', 'error');\n\t\t\t}\n\t\t}\n\t}",
"public function createFolder(string $folderName, int $parentFolderId, bool $adult, ?string $password): ApiInterface;",
"public function create() {\n\t\t\n\t\t// get all posted form data\n\t\t$attributes = \\Input::all();\n $oauthToken = OauthToken::find(\\Input::get('access_token'));\n\t\t$user = $oauthToken->user()->first();\n $society_id = $oauthToken->society_id;\n \n $attributes['society_id'] = $society_id;\n \n $sql = 'select count(*) as total from admin_folder where society_id = :society_id and name = :folder_name and deleted_at IS NULL ';\n $result = \\DB::selectOne($sql,['society_id'=>$society_id,'folder_name'=>$attributes['name']]);\n if($result->total){\n return ['success'=>false,'msg'=>'This folder already exists'];\n }\n \n $adminFolder = new AdminFolder();\n $adminFolder->user()->associate($user);\n\t\t$adminFolder->fill($attributes);\n\t\t$adminFolder->save();\n\t\t\n return ['msg'=>'Folder created successfully','success'=>true];\n \n\t}",
"function create_folder($folderid, $foldername, $description=\"\") {\n\n\t\tif ($folderid===null) {\n\n\t\t\t$r2s = skydrive_base_url.\"me/skydrive\";\n\n\t\t} else {\n\n\t\t\t$r2s = skydrive_base_url.$folderid;\n\n\t\t}\n\n\t\t$arraytosend = array('name' => $foldername, 'description' => $description);\t\n\n\t\t$response = $this->curl_post($r2s, $arraytosend, $this->access_token);\n\n\t\tif (@array_key_exists('error', $response)) {\n\n\t\t\t\tthrow new Exception($response['error'].\" - \".$response['description']);\n\n\t\t\t\texit;\n\n\t\t\t} else {\t\t\n\n\t\t\t\t$arraytoreturn = Array();\n\n\t\t\t\tarray_push($arraytoreturn, Array('name' => $response['name'], 'id' => $response['id']));\t\t\t\t\t\n\n\t\t\t\treturn $arraytoreturn;\n\n\t\t\t}\n\n\t}",
"public function createFolder(){\n $name = $_SESSION['token'];\n if(file_exists('PageStorage/'.$name)){\n while(file_exists('PageStorage/'.$name)){\n $name= random_int(1, 1999).$name;\n }\n }\n mkdir('PageStorage/'.$name, 0777, true);\n return $name;\n }",
"public function createFolder()\r\n\t{\r\n //Check if we have all variables that we need\r\n $public_key = $this->input->post('parent_public_key');\r\n $folder_name = $this->input->post('folder_name');\r\n\t\t$user_id = $this->authentication->uid;\r\n\r\n //TODO !!!!! Validate the path here !!!!!\r\n if($folder_name == '' || $public_key == ''){\r\n\t\t\t$this->errorMessage('Please enter a folder name');\r\n redirect('/dashboard');\r\n }\r\n\r\n\t\t//Variable to check if the folder exists\r\n\t\t$folder_exists = false;\r\n\r\n\t\t//Make sure that the parent exists\r\n\t\tif($public_key == '0'){\r\n\t\t\t//We're in the main directory\r\n\t\t\t$parent_id = 0;\r\n\t\t\t$folder_exists = true;\r\n\t\t}\r\n\r\n\t\tif($this->DataModel->folderExists(array('public_key' => $public_key), $this->authentication->uid)){\r\n\t\t\t//We found the parent folder\r\n\t\t\t$folder_exists = true;\r\n\t\t\t$parent_id = $this->DataModel->getFolderInfo(array('public_key' => $public_key), $this->authentication->uid)['id'];\r\n\t\t}\r\n\r\n\t\t//Check if the folder is shared with the user\r\n\t\tif($this->DataModel->folderExists(array('public_key' => $public_key))){\r\n\t\t\t$folder = $this->DataModel->getFolderInfo(array('public_key' => $public_key));\r\n\t\t\tif($this->DataModel->hasSharedAccessFolder($public_key, $this->authentication->uid)){\r\n\t\t\t\tif($this->DataModel->sharedPermission == 1){\r\n\t\t\t\t\t$folder_exists = true;\r\n\t\t\t\t\t//Set the user id of the user who owns the shared folder\r\n\t\t\t\t\t$user_id = $folder['user_id'];\r\n\t\t\t\t\t$parent_id = $folder['id'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Final check if the folder exists\r\n\t\tif($folder_exists == false){\r\n\t\t\tredirect(\"/dashboard\");\r\n\t\t}\r\n\r\n\t\t//Check if the user is allowed to create new folders (limit)\r\n\t\t$stats = $this->usagestatistics->getUser($user_id);\r\n\t\tif($stats['usage']['foldercount'] < $stats['max']['foldercount'] || $stats['max']['foldercount'] == 0){\r\n\t\t\t//Create the folder\r\n\t $this->DataModel->createFolder($parent_id, $folder_name, $user_id);\r\n\t\t\t$this->successMessage($this->lang->line('success_folder_created'));\r\n\t\t}else{\r\n\t\t\t//The folder could not be created.\r\n\t\t\t$this->errorMessage($this->lang->line('error_folder_usageLimit'));\r\n\t\t}\r\n\r\n\t\t//Redirect the user to the dasbhoard if the parent folder was the \"main\" folder\r\n\t\tif($parent_id == 0){\r\n\t\t\tredirect('/dashboard');\r\n\t\t}\r\n\r\n\t\t//If the owner of the folder is the current user\r\n\t\tif($this->authentication->uid == $user_id){\r\n\t\t\tredirect('folders/'.$public_key);\r\n\t\t}else{\r\n\t\t\t//If it's a shared folder\r\n\t\t\tredirect('sharedFolder/'.$public_key);\r\n\t\t}\r\n\r\n\t}",
"function createNewFolder($folder)\n {\n $fullPath = $this->rightPath . $folder;\n if (!file_exists($fullPath)) {\n mkdir($fullPath, 0777, true);\n }\n }",
"function create_folder($name)\n{\n $location = Path::get_repository_path() . 'lib/content_object/';\n Filesystem::create_dir($location . $name);\n}",
"public function createFolder($folder, $type = null)\n {\n }",
"public function createFolder($folder, $type = null)\n {\n }",
"public function createFolder($folder, $type = null)\n {\n }",
"public function cloud_gdrive_create_folder($name, $parent)\r\n {\r\n if ($this->gdrive == false) {\r\n $this->gdrive = $this->get_gdrive_client();\r\n }\r\n\r\n $file = new Google_Service_Drive_DriveFile();\r\n $file->setName($name);\r\n $file->setMimeType(\"application/vnd.google-apps.folder\");\r\n\r\n if ($parent !== false) {\r\n if (is_a($parent, 'Google_Service_Drive_DriveFile')) {\r\n $parent_id = $parent->id;\r\n } else {\r\n $parent_id = $parent;\r\n }\r\n $file->setParents(array($parent_id));\r\n }\r\n\r\n $result = $this->gdrive->files->create($file);\r\n\r\n return $result;\r\n }",
"function createDirectory($training_id){\n\t\t$main_folder = \"./../training_documents\";\n\t\tif(is_dir($main_folder)===false){\n\t\t\tmkdir($main_folder);\t\t\n\t\t}\n\t\tif(is_dir($main_folder.\"/\".$training_id)===false){\n\t\t\tmkdir($main_folder.\"/\".$training_id);\t\n\t\t}\n\t\treturn $training_id;\n\t}",
"public function createFolder($parentFolder,$foldername)\r\n\t{\r\n $current_path=\"../img/product/\".$this->ezpk($parentFolder).'/'.$this->ezpk($foldername);\r\n if(!file_exists($current_path)){\r\n mkdir($current_path,0777,true);\r\n }\r\n\t}",
"public function create() {\n $form = new Form(array(\n 'id' => 'hbox-create-folder-form',\n 'model' => 'BoxElement',\n 'reference' => array(\n 'id' => 0\n ),\n 'attributes' => array(\n 'e-with' => 'dialogs.newFolder'\n ),\n 'fieldsets' => array(\n 'form' => array(\n new TextInput(array(\n 'name' => 'name',\n 'required' => true,\n 'label' => Lang::get($this->_plugin . '.create-folder-name-label')\n ))\n ),\n\n 'submits' => array (\n new SubmitInput(array(\n 'name' => 'valid',\n 'value' => Lang::get('main.valid-button')\n )),\n\n new ButtonInput(array(\n 'name' => 'cancel',\n 'value' => Lang::get('main.cancel-button'),\n 'attributes' => array(\n 'e-click' => 'open = null'\n )\n ))\n )\n )\n ));\n\n if(!$form->submitted()) {\n return array(\n 'title' => Lang::get($this->_plugin . '.create-folder-title'),\n 'icon' => 'folder-open-o',\n 'page' => $form\n );\n }\n elseif($form->check()) {\n $parentFolder = BoxElement::getById($this->folderId);\n\n if(!$parentFolder->isWritable()) {\n // No file can be created in this folder by the user\n throw new ForbiddenException(Lang::get($this->_plugin . '.write-folder-forbidden-message'));\n }\n\n // Check if another folder exists with the same name in this folder\n $folderWithSameName = BoxElement::getByExample(new DBExample(array(\n 'type' => 'folder',\n 'parentId' => $this->folderId,\n 'name' => $form->getData('name')\n )));\n\n if($folderWithSameName) {\n return $form->response(Form::STATUS_CHECK_ERROR, Lang::get($this->_plugin . '.create-folder-name-exists-error'));\n }\n\n try {\n $folder = new BoxElement(array(\n 'type' => BoxElement::ELEMENT_FOLDER,\n 'name' => $form->getData('name'),\n 'parentId' => $this->folderId,\n 'ownerId' => App::session()->getUser()->id,\n 'ctime' => time(),\n 'mtime' => time(),\n 'modifiedBy' => App::session()->getUser()->id\n ));\n\n $folder->save();\n\n // Update the mtime of the parent folder\n if($parentFolder->id) {\n $parentFolder->save();\n }\n\n $form->addReturn(array(\n 'created' => $folder->formatForJavaScript(),\n 'parentFolder' => $parentFolder->formatForJavaScript()\n ));\n\n return $form->response(Form::STATUS_SUCCESS);\n }\n catch(\\Exception $e) {\n return $form->response(Form::STATUS_ERROR, DEBUG_MODE ? $e->getMessage() : '');\n }\n }\n }",
"public function createFolder($data, $parent = \"\") {\r\n\t\tif($this->accessToken === null) {\r\n\t\t\tthrow new SkydriveException_InvalidToken();\r\n\t\t}\r\n\t\tif(!is_array($data)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif($parent != \"\") {\r\n\t\t\t$result = $this->checkFolderExists($parent);\r\n\t\t\tif($result === false) {\r\n\t\t\t\tthrow new SkydriveException_FolderError(\"Invalid parent folder\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$folderId = $this->checkFolderExists($data[\"name\"], $parent);\r\n\t\tif($folderId !== false) {\r\n\t\t\t// If the folder already exists then return it's ID\r\n\t\t\treturn $folderId;\r\n\t\t}\r\n\r\n\t\t$headers = array(\"Content-Type: application/json\", \"Authorization: Bearer \" . $this->accessToken);\r\n\t\t$postData = json_encode($data);\r\n\t\t$url = self::baseUrl . \"me/skydrive/\" . $parent;\r\n\r\n\t\t$curlOptions = array(\"type\"=>\"POST\", \"postdata\"=>$postData, \"headers\"=>$headers);\r\n\t\t$result = $this->fetch($url, $curlOptions);\r\n\t\t$result = json_decode($result);\r\n\r\n\t\tif(is_array($result) && array_key_exists(\"data\", $result) && is_array($result[\"data\"]) && array_key_exists(\"id\", $result[\"data\"])) {\r\n\t\t\t$return = $result[\"data\"][\"id\"];\r\n\t\t\treturn $return;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function create_folder_name(){\n // create folder name\n return $this->config['prefix'].$this->user['code'];\n }",
"function email_newfolder($folder, $parentfolder) {\n\n\t// Add actual time\n\t$folder->timecreated = time();\n\n\t// Make sure course field is not null\t\t\tThanks Ann.\n\tif ( ! isset( $folder->course) ) {\n\t\t$folder->course = 0;\n\t}\n\n\t// Insert record\n\tif (! $folder->id = insert_record('email_folder', $folder)) {\n\t\treturn false;\n\t}\n\n\t// Prepare subfolder\n\t$subfolder = new stdClass();\n\t$subfolder->folderparentid = $parentfolder;\n\t$subfolder->folderchildid = $folder->id;\n\n\t// Insert record reference\n\tif (! insert_record('email_subfolder', $subfolder)) {\n\t\treturn false;\n\t}\n\n\tadd_to_log($folder->userid, \"email\", \"add subfolder\", \"$folder->name\");\n\n\treturn true;\n}",
"function newFolder() {\n return Form::quick(false, __('Create'),\n new Formsection(__('New folder'),\n new Input(__('Folder name'), 'fname')\n )\n );\n }",
"function createBookmarkFolder()\n\t{\n\t\tif (!$this->tree->isInTree($this->id))\n\t\t{\n\t\t\t$this->ctrl->setParameter($this, 'bmf_id', '');\n\t\t\t$this->ctrl->redirect($this);\n\t\t}\n\n\t\t// check title\n\t\tif (empty($_POST[\"title\"]))\n\t\t{\n\t\t\tilUtil::sendFailure($this->lng->txt(\"please_enter_title\"));\n\t\t\t$this->newFormBookmarkFolder();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// create bookmark folder\n\t\t\t$bmf = new ilBookmarkFolder();\n\t\t\t$bmf->setTitle(ilUtil::stripSlashes($_POST[\"title\"]));\n\t\t\t$bmf->setParent($this->id);\n\t\t\t$bmf->create();\n\n\t\t\tglobal $ilCtrl;\n\t\t\t$ilCtrl->saveParameter($this, 'bmf_id');\n\t\t\t$ilCtrl->redirect($this, 'view');\n\t\t}\n\t}",
"public function newFolder($name, $parent = null) {\n if(is_null($name) || strlen($name) <= 0) {\n throw new FSException(\"The name of the folder can not be null or an empty string\");\n }\n $uri = \"folder\";\n $requestOptions = [\"name\" => $name];\n if(!is_null($parent)) {\n $requestOptions[\"parent\"] = $parent;\n }\n $response = $this->client->post($uri, [\"json\" => $requestOptions]);\n return json_decode($response->getBody(), true);\n\n }",
"public function createFolders() {\n $this->output('Current directory: ' . getcwd());\n\n // user folder.\n try {\n \\File::read_dir($this->repo_home . '/' . $this->user_id);\n $this->output('User directory already exist.');\n } catch (Exception $e) {\n $p = new Process('mkdir ' . $this->repo_home . '/' . $this->user_id);\n $p->run();\n $this->output('Created user Directory: ' . $this->user_dir);\n }\n $this->user_dir = $this->repo_home . '/' . $this->user_id;\n\n // repo folder.\n try {\n \\File::read_dir($this->user_dir . '/' . $this->deploy_id);\n $this->output('Repository directory already exist.');\n } catch (Exception $ex) {\n $p = new Process('mkdir ' . $this->user_dir . '/' . $this->deploy_id);\n $p->run();\n $this->output('Created repository directory: ' . $this->repo_dir);\n }\n $this->repo_dir = $this->user_dir . '/' . $this->deploy_id;\n }",
"public function createFolder(\n $repositoryId,\n PropertiesInterface $properties,\n $folderId,\n array $policies = [],\n AclInterface $addAces = null,\n AclInterface $removeAces = null,\n ExtensionDataInterface $extension = null\n ) {\n $url = $this->getObjectUrl($repositoryId, $folderId);\n $queryArray = $this->createQueryArray(\n Constants::CMISACTION_CREATE_FOLDER,\n $properties,\n $policies,\n $addAces,\n $removeAces,\n $extension\n );\n\n $newObject = $this->getJsonConverter()->convertObject((array) $this->postJson($url, $queryArray));\n\n return ($newObject === null) ? null : $newObject->getId();\n }",
"public function createParentFolder($parentFolder)\r\n\t{\r\n $current_path=\"../img/product/\".$this->ezpk($parentFolder);\r\n if(!file_exists($current_path)){\r\n mkdir($current_path,0777,true);\r\n }\r\n return $current_path;\r\n\t}",
"static function makeFolder($folder) {\n\t\tif(!file_exists($base = dirname($folder))) self::makeFolder($base);\n\t\tif(!file_exists($folder)) mkdir($folder, Filesystem::$folder_create_mask);\n\t}",
"function createDocmanFolder($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $permissions, $metadata, $owner, $create_date, $update_date) {\n return _createDocmanItem($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, PLUGIN_DOCMAN_ITEM_TYPE_FOLDER, $permissions, $metadata, $owner, $create_date, $update_date);\n}",
"public function makeFolder()\n\t{\n\t\t$dir = new Folder($this->fileDir);\n\t\tif($dir->pwd() == null){\n\t\t\treturn new Folder($this->fileDir,true,0755);\n\t\t}\n\t}",
"public function createFolder($folder, $type = null)\n {\n if ($this->_isInitialized()) {\n $folders = $this->listFolders();\n $types = $this->listFolderTypes();\n $folders[] = $folder;\n if (!empty($type)) {\n $types[$folder] = $type;\n }\n $this->_list_cache->store($folders, $types);\n }\n $result = $this->_list->createFolder($folder, $type);\n $this->_list_cache->save();\n return $result;\n }",
"public function createFolder($folder_name)\n {\n return $this->makeFolder($folder_name);\n }",
"public function store(Request $request)\n{\n $this->validate($request,[\n 'name' => 'required'\n ]);\n Folder::create([\n 'name' => request('name'),\n 'user_id' => auth()->id(),\n 'parent_folder_id' => request('parent_folder_id')\n ]);\n return back()->with('flash',\"New-Folder-Added\");\n\n}",
"public function createStorageFolder($pid, $attrs = [])\n {\n return $this->create($pid, array_merge($attrs, [\n 'doktype' => 254\n ]));\n }",
"function saveNewFolder(){\r\n\r\n\t\t// get ajax data\r\n\t\t$phpData = file_get_contents('php://input');\r\n\r\n\t\tif(!is_dir('../code/' . $phpData)) {\r\n\t\t mkdir('../code/' . $phpData, 0777, true);\r\n\r\n\t\t $ex = explode(\"/\", $phpData);\t\r\n\t\t echo $ex[count($ex) -1];\t\t \r\n\t\t}\r\n\t\telse{\r\n\t\t\t$newFolderName = $phpData . '_' . (string) rand();\r\n\t\t\tmkdir('../code/' . $newFolderName , 0777, true);\r\n\r\n\t\t\t$ex1 = explode(\"/\", $newFolderName);\t\r\n\t\t echo $ex1[count($ex1) -1];\r\n\t\t}\r\n\r\n\t}",
"public function CreateFolder($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }",
"protected function createFolderRequest(Requests\\CreateFolderRequest $request)\n {\n\n $resourcePath = '/slides/storage/folder/{path}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->storageName !== null) {\n $queryParams['storageName'] = ObjectSerializer::toQueryValue($request->storageName);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"path\", $request->path);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'PUT');\n }",
"function create_folder($path, $name, $cryp)\r\n{\r\n\tglobal $lang;\r\n\t\r\n\t$folder_name = ( $cryp ) ? uniqid($name) : $name;\r\n\t$folder_path = $path . $folder_name;\t\t\r\n\t\r\n\tmkdir(\"$folder_path\", 0755);\r\n\t\r\n\t$file\t= 'index.htm';\r\n\t$code\t= $lang['EMPTY_PAGE'];\r\n\t$create\t= fopen(\"$folder_path/$file\", \"w\");\r\n\t\r\n\tfwrite($create, $code);\r\n\tfclose($create);\r\n\t\r\n\treturn $folder_name;\r\n}",
"public function testCreateFolder()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new CreateFolderRequest();\n $request->setPath( \"OutResul/NewFolder\");\n $request->setStorageName( \"\");\n $this->instance->createFolder($request);\n }",
"public function createFolder($name)\r\n {\r\n $name = DmsTools::safeFilename($name);\r\n\r\n try\r\n {\r\n $this->getStorage()->mkdir($name);\r\n }\r\n catch (DmsFolderExistsException $exception)\r\n {\r\n // do nothing, folder exists.\r\n }\r\n\r\n $folder = new DmsNode();\r\n $folder->setName($name);\r\n $folder->setDiskName($name);\r\n $folder->setStoreId($this->getId());\r\n $folder->setParentId(null);\r\n $folder->setIsFolder(true);\r\n $folder->save();\r\n\r\n return $folder;\r\n }",
"public function createAction()\n {\n $this->requireAdminPrivileges();\n if ($this->_request->isPost()) {\n $this->disableLayout();\n $this->disableView();\n\n $formParams = $this->getRequest()->getPost();\n $name = $formParams['name'];\n $description = $formParams['description'];\n $communityId = $formParams['community'];\n $uploader = $formParams['uploader'];\n\n $communityModel = MidasLoader::loadModel('Community');\n $community = $communityModel->load($communityId);\n $folderModel = MidasLoader::loadModel('Folder');\n if ($folderModel->getFolderExists($name, $community->getFolder())) {\n echo JsonComponent::encode(\n array(false, $this->t('A Folder with that name already exists in the selected Community'))\n );\n\n return;\n }\n\n // create a top level folder in the community\n $curatedFolder = $folderModel->createFolder($name, $description, $community->getFolder());\n\n // track the folder for curation\n $curatedfolderModel = MidasLoader::loadModel('Curatedfolder', 'curate');\n $curatedfolderModel->enableFolderCuration($curatedFolder);\n\n // give the uploader user ADMIN access to the folder\n $userModel = MidasLoader::loadModel('user');\n $user = $userModel->load($uploader);\n $folderpolicyuserModel = MidasLoader::loadModel('Folderpolicyuser');\n $folderpolicyuserModel->createPolicy($user, $curatedFolder, MIDAS_POLICY_WRITE);\n\n // notify the uploader user that the curated folder has been created\n $utilityComponent = MidasLoader::loadComponent('Utility');\n // TODO NOTIFY\n // TODO update message\n // probably set host and origin\n $body = 'Dear '.$user->getFirstname().' '.$user->getLastname(\n ).\",\\nA curated folder has been created for you to upload a dataset into at qidw.rsna.org. The curated folder \".$curatedFolder->getName(\n ).' can be found at http://qidw.rsna.org/folder/'.$curatedFolder->getFolderId(\n ).\" . You will need to log in to view it.\\n\\nThanks,\\nqidw.rsna.org admin\\n\";\n $logger = Zend_Registry::get('logger');\n $subject = 'Curated Folder Created';\n $logger->info('Sending an email to '.$user->getEmail().' with subject ['.$subject.'] and body ['.$body.']');\n $utilityComponent->sendEmail($user->getEmail(), $subect, $body);\n\n echo JsonComponent::encode(array(true, $this->t('Folder successfully created')));\n\n return;\n } else {\n $communityModel = MidasLoader::loadModel('Community');\n $communities = $communityModel->getAll();\n $displayCommunities = array();\n foreach ($communities as $community) {\n $displayCommunities[$community->getCommunityId()] = $community->getName();\n }\n\n $userModel = MidasLoader::loadModel('User');\n $users = $userModel->getAll();\n $displayUsers = array();\n $userOrgs = array();\n foreach ($users as $user) {\n $displayUsers[$user->getUserId()] = $user->getFirstname().' '.$user->getLastname();\n $userOrgs[$user->getUserId()] = $user->getCompany();\n }\n // TODO how to put userOrgs in json and get it out on the page\n $form = $this->createCuratedFolderForm($displayCommunities, $displayUsers);\n $this->disableLayout();\n $this->view->form = $this->getFormAsArray($form);\n $this->view->json['userOrgs'] = $userOrgs;\n }\n }",
"public function create($folder_id = 'root')\n {\n $this->prepareLeftMenu($folder_id);\n return view('editor::scaffold.create');\n }",
"public function createFolder($path) {\n $this->_command->setCommand(\"mkdir -p {$path}\");\n $this->_command->run();\n\n $this->_log->log(LogLevel::info, \"'{$path}' folder created\\n\");\n }",
"public function createFolder(Request $request)\n {\n $requested_data = $request->all();\n\n $vault_created = Folder::create([\n 'user_id' => $requested_data[\"data\"][\"id\"],\n 'name' => $requested_data[\"name\"],\n 'type' => 3,\n 'parent_id' => $requested_data[\"parent_id\"],\n 'status' => 1,\n 'created_at' => time(),\n ]);\n if ($vault_created) {\n $data['data'] = [];\n $data['status'] = 200;\n $data['message'] = 'Folder created successfully';\n } else {\n $data['data'] = [];\n $data['status'] = 400;\n $data['message'] = 'Error while creating folder';\n }\n return Response::json($data);\n }",
"public function createFolder($path, $root = NULL) {\n\n if (is_null($root)) $root = $this->root;\n\n // Making sure the path starts with a /\n $path = '/' . ltrim($path,'/');\n\n $response = $this->http_oauthed($this->api_url . 'fileops/create_folder', array('path' => $path, 'root' => $root),'POST');\n return json_decode($response,true);\n\n }",
"public function createFolder(string $fullPath) : bool;",
"function generate_directory($id){\n $filename = \"intranet/usuarios/\" . $id . \"/uploads/\";\n if (!file_exists($filename)) {\n mkdir($filename, 0777, true);\n }\n }",
"public function createFolder(string $path): MetaFolder\n {\n\t\treturn self::createMetaFolder($this->filesystemFolder->createFolder($path));\n\t}",
"public function createDirectory($folder){\n $folder = $this->cleanPath($folder);\n\n if($this->disk->exists($folder)){\n return \"Directory '$folder' already exists.\";\n }\n\n return $this->disk->makeDirectory($folder);\n //you can create a directory with subdirectoty like '/dd/cc' in one call\n }",
"public static function generate_random_folder( $folder ) {\n // Random folder must be 13 characters long\n // Since 32 bit system only allow a maximum of 2147483647 as int value\n // we will generate 2 random numbers separately and combine them as one\n $folderName = rand(1000000, 9999999) . rand(100000, 999999);\n $folderPath = trailingslashit($folder) . $folderName;\n if( file_exists( $folderPath ) ) {\n self::generate_random_folder( $folder );\n }else{\n if(!mkdir($folderPath, 0755, true) ) {\n $error = error_get_last();\n SUPER_Common::output_message( array(\n 'msg' => '<strong>' . esc_html__( 'Upload failed', 'super-forms' ) . ':</strong> ' . $error['message']\n ));\n }\n return array(\n 'folderPath' => $folderPath,\n 'folderName' => $folderName\n );\n }\n }",
"public function postNewFolder(Request $request)\n {\n \t$data = $request->all();\n \t$data['created_by'] = Auth::user()->id;\n \t// var_dump($data);\n \tif($data['folder_induk']===''){\n \t\t$data['folder_induk'] = null;\n \t}\n \t$insert = Folder::create($data);\n\n \treturn redirect()->back();\n }",
"private function createNewTempdir(){\n $tempdirname = '';\n do{\n $tempdirname = uniqid('temp_',true);\n }while(file_exists(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname));\n\n if(@mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname)){\n mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname.DIRECTORY_SEPARATOR.'gallery');\n }else{\n die(json_encode(array('state'=>'error','data'=> $this->text('e28').': '.FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.'!')));\n }\n return $tempdirname;\n }",
"protected function createDirectory() {}",
"public function makeFolder($folder_name = null)\n {\n if (!$folder_name) {\n return false;\n }\n\n if ($this->doesFolderExist($folder_name)) {\n return false;\n }\n\n return imap_createmailbox($this->stream(), imap_utf7_encode($this->hostname . $folder_name));\n }",
"public function add_folder( $params ) {\n\t\t$new_post\t = array(\n\t\t\t'post_type'\t\t => $params['type'],\n\t\t\t'post_title'\t => $params['title'],\n\t\t\t'post_content'\t => '',\n\t\t\t'post_status'\t => 'publish',\n\t\t\t'post_author'\t => get_current_user_id(),\n\t\t);\n\t\t$id\t\t\t = wp_insert_post( $new_post, true );\n\t\t$success\t = is_wp_error( $id ) ? false : true;\n\t\tif ( $success && ! empty( $params['parent'] ) ) {\n\t\t\t$this( 'folder' )->set_folder_content( array(\n\t\t\t\t'id'\t => $params['parent'],\n\t\t\t\t'value'\t => $id,\n\t\t\t\t'action' => 'add_to_folder',\n\t\t\t) );\n\t\t}\n\t\t$return['id']\t\t = $id;\n\t\t$return['folder']\t = $this( 'media' )->get_content( $id );\n\t\treturn $this->get_arr( $return, $success );\n\t}",
"public function folderNew($dir)\n {\n \t$application = JFactory::getApplication();\n \t$params = MyMuseHelper::getParams();\n \tif($params->get('my_use_s3')){\n\n \t\t// first section is bucket name\n \t\t$parts = explode(DS,$dir);\n \t\t$bucket = array_shift($parts);\n \t\t$bucket = trim($bucket, DS);\n \t\t$uri = implode(DS, $parts);\n \t\t$uri = trim($uri,DS).DS;\n\n \t\ttry{\n \t\t\t$result = $this->_s3->putObject([\n \t\t\t\t\t'Bucket' => $bucket,\n \t\t\t\t\t'Key' => $uri,\n \t\t\t\t\t'Body' => '',\n \t\t\t]);\n \t\t} catch (S3Exception $e) {\n \t\t\t//echo $e->getMessage() . \"\\n\";\n \t\t\t$this->setError( 'S3 Error: '.$e->getMessage() );\n \t\t\t$application->enqueueMessage('S3 Error: '.$e->getMessage() , 'error');\n \t\t\treturn false;\n \t\t}\n \t\t\n\n \t}else{\n \t\t$status = JFolder::create($dir);\n \t\tif(!$status){\n \t\t\t$this->setError( \"Could not create $dir\");\n \t\t\t$application->enqueueMessage(\"Could not create $dir\" , 'error');\n \t\t\treturn false;\n \t\t}\n \t\tif(!JFile::copy(JPATH_ROOT.DS.\"administrator\".DS.\"components\".DS.\"com_mymuse\".DS.\"assets\".DS.\"index.html\",\n \t\t\t\t$dir.DS.\"index.html\")){\n \t\t\t$this->setError(JText::_(\"MYMUSE_COULD_NOT_COPY_INDEX\").\": \".$artistdir);\n \t\t\t$application->enqueueMessage(JText::_(\"MYMUSE_COULD_NOT_COPY_INDEX\").\": \".$artistdir, 'error');\n \t\t\treturn false;\n \t\t}\n \t}\n \t \n \treturn true;\n }",
"private function mustCreateFolder(){\n }",
"public function createFolder(string $token, string $path)\n {\n // Perform query\n $response = Elvis::query($token, 'createFolder', ['path' => $path]);\n\n return $response;\n }",
"public function create(Folder $postBody, $optParams = [])\n {\n $params = ['postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('create', [$params], Operation::class);\n }",
"public static function createParentFolders($model, $folder, $newFolder){\n\t\t\n\t\tif($newFolder && is_a($model, \"GO\\Projects2\\Model\\Project\")){\n\t\t\tif($project = $model->parent()){\n\t\t\t\tGO::debug(\"Checking folder: \".$project->path);\n\t\t\t\t\n\t\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\t\t\t\t\n\t\t\t\t$folderController->checkModelFolder($project, true, true);\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function getFolderOrCreate($path)\n {\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n return $path;\n }",
"public function store()\n\t{\n\t\t$container = AssetService::getContainer($this->request->get('container'), 'local', 'Assets');\n\t\t$parent = $container->folder($this->request->get('parent'));\n\t\t$basename = $this->request->get('basename');\n\n\t\t// correct data\n\t\t// next -->\n\t\t$folder = $parent->createFolder($basename);\n\n\n\t\tif($folder){\n\t\t\treturn [\n\t\t\t\t'success' \t=> true,\n\t\t\t\t'message'\t=> 'Folder Created',\n\t\t\t\t'folder'\t=> $folder->toArray()\n\t\t\t];\n\t\t}\n\n\t\treturn [\n\t\t\t'success' => false,\n\t\t\t'message'\t=> 'Folder is not created',\n\t\t\t'folder'\t=> []\n\t\t];\n\t}",
"function add_folder($parent_id, $name, $user_id) {\n\t\tif (empty($name))\n\t\t\treturn false;\n\t\t$query = \"INSERT INTO `\".BIT_DB_PREFIX.\"tidbits_bookmarks_folders`(`name`,`parent_id`,`user_id`) VALUES(?,?,?)\";\n\t\t$result = $this->mDb->query($query,array($name,$parent_id,$user_id));\n\t}",
"public function createFolderPath()\n {\n return \"uploads/\".date('Y').\"/\".date('m').\"/\";\n }",
"public function findOrCreateByPath($folderPath)\n {\n $folderPath = trim($folderPath);\n\n $folders = explode('/', $folderPath);\n $folders = array_filter($folders);\n\n $folderName = $folders[count($folders) - 1];\n $parentFolder = null;\n\n if (count($folders) > 1) {\n $parentName = $folders[count($folders) - 2];\n\n $parentFolder = $this->_em\n ->getRepository('RZ\\Roadiz\\Core\\Entities\\Folder')\n ->findOneByName($parentName);\n }\n\n $folder = $this->_em\n ->getRepository('RZ\\Roadiz\\Core\\Entities\\Folder')\n ->findOneByName($folderName);\n\n\n if (null === $folder) {\n /*\n * Creation of a new folder\n * before linking it to the node\n */\n $folder = new Folder();\n $folder->setName($folderName);\n\n if (null !== $parentFolder) {\n $folder->setParent($parentFolder);\n }\n\n $this->_em->persist($folder);\n $this->_em->flush();\n }\n\n return $folder;\n }",
"public function CreateFolderPath($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }",
"function create_folder($json_path,$name){\n\tif (!file_exists($json_path)){\n\t\tmkdir($json_path, 0777);\n\t}\n\tif(!file_exists($json_path.'_info.json')){\n\t\t$fp = fopen($json_path.'_info.json','w');\n\t\tfwrite($fp,'[]');\n\t\tfclose($fp);\n\t}\n\tif (file_exists($json_path.$name)){\n\t\treturn 'folder exist';\n\t} else {\n\t\tmkdir($json_path.$name, 0777);\n\t\t$fp = fopen($json_path.$name.'/_info.json','w');\n\t\tfwrite($fp,'[]');\n\t\tfclose($fp);\n\t\tif($name != ''){\n\t\t\twrite_info_file($json_path,$name);\n\t\t}\n\t\treturn 'created';\n\t}\n}",
"function email_get_folder($folderid) {\n\n\t$folder = new object();\n\n\tif ( $folder = get_record('email_folder', 'id', $folderid) ) {\n\n\t\tif ( isset($folder->isparenttype) ) {\n\t\t\t// Only change in parent folders\n\t\t\tif ( ! is_null($folder->isparenttype) ) {\n\t\t\t\t// If is parent ... return language name\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_INBOX) ) ) {\n\t\t\t\t\t$folder->name = get_string('inbox', 'block_email_list');\n\t\t\t\t}\n\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_SENDBOX) ) ) {\n\t\t\t\t\t$folder->name = get_string('sendbox', 'block_email_list');\n\t\t\t\t}\n\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_TRASH) ) ) {\n\t\t\t\t\t$folder->name = get_string('trash', 'block_email_list');\n\t\t\t\t}\n\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_DRAFT) ) ) {\n\t\t\t\t\t$folder->name = get_string('draft', 'block_email_list');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $folder;\n}",
"function add_folder()\n\t{\n\t\t$data = array ('name' => $this->input->post('folder_name'), 'id_user' => $this->input->post('id_user'));\n\t\t$this->db->insert('user_folders', $data);\n\t}",
"public function getFolderId()\n {\n return $this->folderId;\n }",
"private function Make_UniqueDIR( )\n\t{\n\t\t$this -> DIR = self :: $Request -> server -> get( 'DOCUMENT_ROOT' ) . $this -> FULL_PATH . self :: FOLDER_BASE_NAME . $this -> ID;\n\t\tif ( !file_exists( $this -> DIR ) )\n\t\t\tmkdir( $this -> DIR , 0777 , true ) ;\n\t}",
"public static function createFolder(Request $request, Response $response, $exp_id)\n {\n self::checkAccess($request, $exp_id);\n $path = '../file_system/experiments/exp_'.$exp_id;\n if (!file_exists($path)) {\n FileSystemManager::mkdir('../file_system/experiments', 'exp_'.$exp_id);\n chdir('../../app');\n }\n\n return self::formatOk($response, ['path' => $path]);\n\n }",
"public function store(Request $request)\n {\n return Folder::create($request->all());\n }",
"public function create($folder)\n {\n Horde_Kolab_Storage_Exception_Pear::catchError(\n $this->getBackend()->createMailbox($this->encodePath($folder))\n );\n }",
"public function store(Request $request)\n\t{\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'folder_id' => 'integer|min:1'\n ]);\n\n //check if user already has folder with this name\n if (Auth::user()->folders()->where('name', Input::get('name'))->first()) {\n return response()->json(trans('app.folderAlreadyExists'), 422);\n }\n\n //update parent folders children column with this folder\n $parent = Input::get('parent');\n $name = Input::get('name');\n $path = isset($parent['path']) ? $parent['path'].'/'.$name : 'root/'.$name;\n //create the new folder\n\n return Auth::user()->folders()->create([\n 'name' => $name,\n 'path' => $path,\n 'share_id' => Str::random(15),\n 'folder_id' => $parent['name'] !== 'root' ? $parent['id'] : null,\n 'user_id' => Auth::user()->id\n ]);\n\t}",
"public function ajaxCreateFolder(Request $request) {\n //Get the post data\n $data = $request->all();\n\n $folder = new LMSFolder;\n $folder->name = $data['name'];\n $folder->fk_parent = $data['path'];\n $folder->fk_user = \\Auth::user()->id;\n $folder->fk_company = \\Auth::user()->fk_company;\n //Fixed params for now\n $folder->can_see_others = 1;\n $folder->can_view_others = 1;\n $folder->can_write_others = 1;\n\n if ($folder->save())\n print_r('ok');\n else\n print_r('ko');\n }",
"public function createFolder($parent = 0, $name = 'Untitled Folder', $location = 'local', $remote_container = '', $hidden = 0)\n {\n $original_slug = $this->createSlug($name);\n $original_name = $name;\n\n $slug = $original_slug;\n\n $i = 0;\n while (Folder::findBySlug($slug)->count()) {\n ++$i;\n $slug = $original_slug.'-'.$i;\n // $name = $original_name.'-'.$i;\n }\n\n $folder = Folder::create(array(\n 'parent_id' => $parent,\n 'slug' => $slug,\n 'name' => $name,\n 'location' => $location,\n 'remote_container' => $remote_container,\n 'sort' => time(),\n 'hidden' => $hidden,\n ));\n\n $insert['id'] = $folder->id;\n $insert['file_count'] = 0;\n $insert['name'] = $folder->name;\n\n return $this->result(true, trans('files.item_created'), $insert['name'], $folder->toArray());\n }",
"private function createFolder()\n {\n if (!file_exists($this->cacheDir)) {//if folder doesn't exist\n mkdir($this->cacheDir, 0755);//create folder\n }\n if (!file_exists($this->cacheFile)) {//if cache doesnt exist\n $file = fopen($this->cacheFile, 'w');\n fclose($file);\n } else {\n return true;\n } //return true if folder exists\n }",
"function createFolders(&$drive_service, &$client, &$configObj, &$UsersAFSObj) \n{\n // Recreate the user's AFS directory structure inside Box\n \n $afsFilesFolder = createFolder($drive_service, \"AFS Migration Files\", \"Home for migrated files\", \"root\", $configObj);\n $UsersAFSObj->folderList[$UsersAFSObj->afsPath] = $afsFilesFolder->getID();\n ++$UsersAFSObj->numFoldersUploaded;\n $logline = date('Y-m-d H:i:s') . \" User's AFS Path: \" . $UsersAFSObj->afsPath . \"\\n\"; \n $logline = date('Y-m-d H:i:s') . \" Our root folder ID: \" . $UsersAFSObj->folderList[$UsersAFSObj->afsPath] . \"\\n\"; \n fwrite($configObj->logFile, $logline);\n \n foreach ($UsersAFSObj->folderList as $key => $value) \n {\n\n // Avoid creating a folder for the root directory \n if (strcmp($key, $UsersAFSObj->afsPath) == 0) \n { \n continue; \n } \n\n // Make sure the folder still exists in AFS \n if (!file_exists($key)) \n { \n continue; \n } \n\n $parentFolderID = $UsersAFSObj->folderList[getParentFolder($key)];\n $logline = date('Y-m-d H:i:s') . \" Parent folder name: \" . getParentFolder($key) . \"\\n\"; \n $logline = $logline . date('Y-m-d H:i:s') . \" Parent folder ID: \" . $parentFolderID . \"\\n\"; \n fwrite($configObj->logFile, $logline);\n\n // See if the access token is about to expire\n if ($client->isAccessTokenExpired())\n {\n //Trade access token for refresh token\n if ($client->refreshToken($configObj->refreshToken) == null)\n {\n $logline = date('Y-m-d H:i:s') . \": Using refresh token, access token granted. \\n\"; \n fwrite($configObj->logFile, $logline);\n }\n else\n {\n $logline = date('Y-m-d H:i:s') . \": Unable to obtain access token. \\n\"; \n fwrite($configObj->logFile, $logline);\n }\n }\n\n //Create folder \n $logline = date('Y-m-d H:i:s') . \" The folder name: \" . getFileName($key) . \"\\n\"; \n $folder = createFolder($drive_service, getFileName($key), \"\", $parentFolderID, $configObj);\n\n if ($folder)\n {\n //If creation worked, store folder ID for the file uploads\n ++$UsersAFSObj->numFoldersUploaded;\n $UsersAFSObj->folderList[$key] = $folder->getID();\n $logline = $logline . date('Y-m-d H:i:s') . \" Success! The ID of this new folder is: \" . $folder->getID() . \"\\n\"; \n fwrite($configObj->logFile, $logline); \n }\n else\n {\n $logline = $logline . date('Y-m-d H:i:s') . \" The following folder could not be created: \" . $folder->getID() . \"\\n\"; \n fwrite($configObj->logFile, $logline); \n }\n }\n}",
"public function createFolder($name, $parentFolder = null)\n {\n if ($parentFolder instanceof Zend_Mail_Storage_Folder) {\n $folder = $parentFolder->getGlobalName() . $this->_delim . $name;\n } else if ($parentFolder != null) {\n $folder = rtrim($parentFolder, $this->_delim) . $this->_delim . $name;\n } else {\n $folder = $name;\n }\n\n $folder = trim($folder, $this->_delim);\n\n // first we check if we try to create a folder that does exist\n $exists = null;\n try {\n $exists = $this->getFolders($folder);\n } catch (Zend_Mail_Exception $e) {\n // ok\n }\n if ($exists) {\n /**\n * @see Zend_Mail_Storage_Exception\n */\n require_once 'Zend/Mail/Storage/Exception.php';\n throw new Zend_Mail_Storage_Exception('folder already exists');\n }\n\n if (strpos($folder, $this->_delim . $this->_delim) !== false) {\n /**\n * @see Zend_Mail_Storage_Exception\n */\n require_once 'Zend/Mail/Storage/Exception.php';\n throw new Zend_Mail_Storage_Exception('invalid name - folder parts may not be empty');\n }\n\n if (strpos($folder, 'INBOX' . $this->_delim) === 0) {\n $folder = substr($folder, 6);\n }\n\n $fulldir = $this->_rootdir . '.' . $folder;\n\n // check if we got tricked and would create a dir outside of the rootdir or not as direct child\n if (strpos($folder, DIRECTORY_SEPARATOR) !== false || strpos($folder, '/') !== false\n || dirname($fulldir) . DIRECTORY_SEPARATOR != $this->_rootdir) {\n /**\n * @see Zend_Mail_Storage_Exception\n */\n require_once 'Zend/Mail/Storage/Exception.php';\n throw new Zend_Mail_Storage_Exception('invalid name - no directory seprator allowed in folder name');\n }\n\n // has a parent folder?\n $parent = null;\n if (strpos($folder, $this->_delim)) {\n // let's see if the parent folder exists\n $parent = substr($folder, 0, strrpos($folder, $this->_delim));\n try {\n $this->getFolders($parent);\n } catch (Zend_Mail_Exception $e) {\n // does not - create parent folder\n $this->createFolder($parent);\n }\n }\n\n if (!@mkdir($fulldir) || !@mkdir($fulldir . DIRECTORY_SEPARATOR . 'cur')) {\n /**\n * @see Zend_Mail_Storage_Exception\n */\n require_once 'Zend/Mail/Storage/Exception.php';\n throw new Zend_Mail_Storage_Exception('error while creating new folder, may be created incompletly');\n }\n\n mkdir($fulldir . DIRECTORY_SEPARATOR . 'new');\n mkdir($fulldir . DIRECTORY_SEPARATOR . 'tmp');\n\n $localName = $parent ? substr($folder, strlen($parent) + 1) : $folder;\n $this->getFolders($parent)->$localName = new Zend_Mail_Storage_Folder($localName, $folder, true);\n\n return $fulldir;\n }",
"function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}",
"protected function getFolderId()\n\t{\n\t\tif(!$this->folderId)\n\t\t{\n\t\t\t$id = basename(Route::current()->uri());\n\t\t\t\n\t\t\tif(!$id || !in_array($id, $this->folders))\n\t\t\t{\n\t\t\t\t$this->folderId = 'sent';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->folderId = $id;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->folderId;\n\t}",
"public function create_dir() {\n\t\t$permission = 0777;\n\t\t$directory_path = ! defined( 'CODE_SNIPPET_DIR' )\n\t\t? ABSPATH . 'wp-code-snippet'\n\t\t: CODE_SNIPPET_DIR;\n\t\n\t\tif ( ! file_exists( $directory_path ) ) {\n\t\t\tmkdir( $directory_path );\n\t\t\t// @chmod( $directory_path, $permission );\n\t\t}\n\n\t\treturn $directory_path;\n\t}",
"public function createFolder(Request $request, User $user, Folder $folder) {\n $name = $request->get('name');\n \n if( !$user->account->canStore(4096)) {\n return response()->json([\n 'success' => false,\n 'message' => 'No se puede crear la carpeta porque la cuenta no tiene suficiente espacio disponible',\n ]);\n }\n\n try {\n $newFolder = $this->fileService->createFolder($name, $folder);\n }\n catch(FileServiceException $ex) {\n return response()->json([\n 'success' => false,\n 'message' => $ex->getMessage(),\n ], 409);\n }\n \n $newFolder->account()->associate($user->account);\n $newFolder->save();\n\n $this->dispatchFileCreatedEvent($newFolder);\n $this->sendFileNotification($newFolder, 'creation');\n\n return response()->json([\n 'success' => true,\n 'message' => 'Carpeta creada correctamente',\n 'folder' => $newFolder,\n ]);\n }",
"protected function _create_folder($path = null)\n {\n if (is_dir(APPPATH . $path)) {\n $this->_message(\"This \" . $this->_command . \": \" . $this->_name . \" folder \" . $path . \" already exists.\");\n return false;\n } else {\n $mkdir = mkdir(APPPATH . $path, 0755, TRUE);\n // If unable to write folder in path\n if (!$mkdir) {\n $this->_message(\"Unable to write the folder \" . $path . \" \" . $this->_command . \": \" . $this->_name . \".\");\n return false;\n } else\n return true;\n }\n }",
"public function createFolder($path) : bool\n {\n $path = $this->normalizePath($path);\n\n // Check if the path contains folders we dont want to create\n if (in_array($path, $this->folderPathExcludeList)) {\n return true;\n }\n\n $this->folderPath = '/Shared%20Documents';\n\n $action = 'folders';\n\n $this->requestHeaders['Content-Type'] = 'application/json;odata=verbose';\n\n $folderAttributes = [\n '__metadata' => [\n 'type' => 'SP.Folder',\n ],\n 'ServerRelativeUrl' => $this->folderPath.$path,\n ];\n\n $options = [\n 'headers' => $this->requestHeaders,\n 'body' => json_encode($folderAttributes)\n ];\n\n $response = $this->send('POST', $action, $options);\n\n return $response->getStatusCode() === 200 ? true : false;\n }",
"public function create_folder($folder, $subscribe = false) {\n\n if (strlen($folder) == 0) {\n // empty folder name!\n return FALSE;\n }\n\n // get parent folder (if any) to perform ACLs checks\n $exploded = explode($this->delimiter, $folder);\n if (is_array($exploded) && count($exploded) > 1) {\n\n // folder is not whithin root level, check parent grants\n $parentFolder = implode($this->delimiter, array_slice($exploded, 0, -1));\n\n // ACLs check ('create' grant required )\n $ACLs = $this->_get_acl($parentFolder);\n if (!is_array($ACLs) || !in_array(self::ACL_CREATE_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n }\n\n // start transaction\n if (!$this->dbmail->startTransaction()) {\n return FALSE;\n }\n\n // prepare query\n $mailboxSQL = \" INSERT INTO dbmail_mailboxes \"\n . \" (\"\n . \" owner_idnr, \"\n . \" name, \"\n . \" seen_flag, \"\n . \" answered_flag, \"\n . \" deleted_flag, \"\n . \" flagged_flag, \"\n . \" recent_flag, \"\n . \" draft_flag, \"\n . \" no_inferiors, \"\n . \" no_select, \"\n . \" permission, \"\n . \" seq\"\n . \" ) \"\n . \" VALUES \"\n . \" (\"\n . \" {$this->user_idnr}, \"\n . \" '{$this->dbmail->escape($folder)}', \"\n . \" 0, \"\n . \" 0, \"\n . \" 0, \"\n . \" 0, \"\n . \" 0, \"\n . \" 0, \"\n . \" 0, \"\n . \" 0, \"\n . \" 2, \"\n . \" 0 \"\n . \" ) \";\n\n // insert new folder record\n if (!$this->dbmail->query($mailboxSQL)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // retreive last insert id\n $mailbox_idnr = $this->dbmail->insert_id('dbmail_mailboxes');\n\n // subscription management (if needed)\n if ($subscribe) {\n\n /*\n * Insert / Update dbmail_subscription entry\n */\n $subscriptionSQL = \"INSERT INTO dbmail_subscription \"\n . \"(user_id, mailbox_id) \"\n . \"VALUES \"\n . \"('{$this->dbmail->escape($this->user_idnr)}', '{$this->dbmail->escape($mailbox_idnr)}' ) \"\n . \"ON DUPLICATE KEY UPDATE \"\n . \"user_id = '{$this->dbmail->escape($this->user_idnr)}', \"\n . \"mailbox_id = '{$this->dbmail->escape($mailbox_idnr)}' \";\n\n if (!$this->dbmail->query($subscriptionSQL)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n }\n\n // return status\n return ($this->dbmail->endTransaction() ? TRUE : FALSE);\n }",
"function addFolder($dbHandler, $param){\n if(valid($_SESSION[\"documentsURL\"])){\n\n // voordat hij wordt aangemaakt, de slashes verwijderen!\n $stripped = str_replace('\\\\', '', str_replace('/', '', $param));\n\n if(!file_exists($_SESSION[\"documentsURL\"].$stripped)){\n mkdir($_SESSION[\"documentsURL\"].$stripped, 0700);\n } else {\n return \"exists\";\n }\n\n\n // log\n $sql = \"INSERT INTO logs (logs_content) VALUES (:message);\";\n $dbHandler->handleQuery($sql, array(\n \":message\" => \"Nieuwe map \\\"\".$stripped. \"\\\" aangemaakt.\"\n ));\n }\n }",
"function get_folder_by_id($folder_id) {\n\t\t// Obtain a connection\n\t\t$con = $this->connection->get_pdo_connection();\n\n\t\t// Prepare insert statement\n\t\t$sql = \"SELECT * FROM folders WHERE folder_id=:folder_id\";\n\t\t$statement = $con->prepare($sql);\n\n\t\t// Bind folder id\n\t\t$statement->bindValue(\"folder_id\", $folder_id, PDO::PARAM_INT);\n\n\t\t// Execute the statement\n\t\t$statement->execute();\n\n\t\t$results = array();\n\n\t\t// Check if row exists\n\t\tif ( $row = $statement->fetch(PDO::FETCH_ASSOC) ) {\n\t \t\t// Create folder object\n\t \t\t$folder = new Folder($row);\n\t \t\treturn $folder;\n\t \t}\n\n\t \treturn false;\n\t}",
"public function service_createFolder($request, $response)\n {\n\n // prüfen ob irgendwelche steuerflags übergeben wurde\n $params = $this->getFlags($request);\n\n $model = $this->loadModel('WebfrapDms');\n $model->loadTableAccess($params);\n\n if (!$model->access->listing) {\n throw new InvalidRequest_Exception(\n Response::FORBIDDEN_MSG,\n Response::FORBIDDEN\n );\n }\n\n // load the view object\n $view = $response->loadView(\n 'form-messages-new',\n 'WebfrapDms_New',\n 'displayNew'\n );\n\n // request bearbeiten\n /* @var $model WebfrapDms_Model */\n $model = $this->loadModel('WebfrapDms');\n $view->setModel($model);\n\n $view->displayNew($params);\n\n }",
"public function CreateManagedFolder($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }",
"function mkdir() {\n\t\t$this->checkOnce();\n\t\t$nr = $this->getMain()->nr();\n\n\t\t$remoteCmd = 'cd '.$this->deployPath.' && mkdir v'.$nr;\n\t\t$this->ssh_exec($remoteCmd);\n\t}",
"function create_dir($dir_path){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }",
"private static function createCurrentFolder() : bool {\n return is_dir(self::getCurrentFolder()) || mkdir(self::getCurrentFolder(), 0777, true);\n }",
"public function create_campaign_folder( $name ) {\n $args = [\n 'name' => $name,\n ];\n $endpoint = '/campaign-folders';\n return $this->post_request( $endpoint, $args );\n }",
"public function create()\n {\n return renderToJson($this->folder . \"create\");\n }",
"public function createFolder($folderName, $dir)\n {\n // TODO: Implement createFolder() method.\n }",
"function crateFolder($path,$mode)\n\t{\n\t\tif(!is_dir($path))\n\t\t\t{\n\t\t\t\tif(!mkdir($path,$mode))\n\t\t\t\t\t{return false;}else{return true;}\n\t\t\t}\n\t\telse{return \"Found\";}\n\t}"
] | [
"0.72312224",
"0.71322167",
"0.71091",
"0.7015157",
"0.6886734",
"0.683119",
"0.6817487",
"0.6661311",
"0.6656184",
"0.65089184",
"0.649598",
"0.6470891",
"0.64591753",
"0.64077854",
"0.64077854",
"0.64077854",
"0.63980865",
"0.63879627",
"0.63312995",
"0.6302738",
"0.6292748",
"0.62854415",
"0.6231931",
"0.6216849",
"0.6215678",
"0.6168614",
"0.6145974",
"0.6129912",
"0.6126971",
"0.60780025",
"0.6053576",
"0.6012476",
"0.59955287",
"0.59695405",
"0.5963357",
"0.5961091",
"0.59351397",
"0.5931262",
"0.5915509",
"0.5912843",
"0.5905212",
"0.5897224",
"0.5881923",
"0.5863681",
"0.5858919",
"0.58557576",
"0.5851359",
"0.5825306",
"0.58126986",
"0.5765311",
"0.5756733",
"0.57553875",
"0.5740147",
"0.5725499",
"0.5717411",
"0.5700757",
"0.5699441",
"0.56959087",
"0.5672066",
"0.5663425",
"0.5653981",
"0.56399465",
"0.56393313",
"0.56355923",
"0.5628485",
"0.56183285",
"0.56160766",
"0.5614341",
"0.56073934",
"0.5596847",
"0.5592748",
"0.55832726",
"0.5581044",
"0.5576365",
"0.5554324",
"0.5547806",
"0.55393916",
"0.5531863",
"0.55316406",
"0.55260956",
"0.5515051",
"0.55127406",
"0.54969186",
"0.5489516",
"0.5447103",
"0.5437598",
"0.5437131",
"0.541847",
"0.5418461",
"0.53984517",
"0.53925914",
"0.53738415",
"0.5373337",
"0.5365101",
"0.53525573",
"0.53504497",
"0.53497803",
"0.5333494",
"0.533267",
"0.5332358"
] | 0.6852539 | 5 |
Delete a PFS file | function cot_pfs_deletefile($userid, $id)
{
global $db, $db_pfs, $cfg;
$sql = $db->query("SELECT pfs_id FROM $db_pfs WHERE pfs_userid=".(int)$userid." AND pfs_id=".(int)$id." LIMIT 1");
if ($sql->rowCount()>0)
{
$fpath = cot_pfs_filepath($id);
if (file_exists($thumbs_dir_user.$fpath))
{
@unlink($thumbs_dir_user.$fpath);
}
if (file_exists($pfs_dir_user.$fpath))
{
@unlink($pfs_dir_user.$fpath);
}
else
{
return FALSE;
}
$sql = $db->delete($db_pfs, "pfs_id='".(int)$id."'");
return TRUE;
}
else
{
return FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($filepath);",
"public function delete($filename);",
"public function file_delete($filename);",
"public function delete($file) {\n\t}",
"function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}",
"abstract function delete_file($filepath);",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"static public function deleteFile($file = false) {\n\n if ($file)\n unlink($file);\n else\n unlink($this->filePath);\n }",
"protected function deleteProtocolFile() {}",
"public function delete_local_file()\n\t{\n\t\tif(file_exists($this->local_file)) {\n\t\t\t$this->upload_local_file();\n\t\t\tunlink($this->local_file);\n\t\t}\n\t\t$this->local_file = null;\n\t}",
"private function delete_file($file){\n\t\t$fileLink = fopen($file,'w');\n\t\tfclose($fileLink);\n\t\tunlink($file);\n\t}",
"function delete($path);",
"function delete_s2sfu_file( $post_id ) {\n\n\t$filename = get_post_meta( $post_id, '_wp_attached_file', true );\n\t@unlink( ABSPATH . 'wp-content/plugins/s2member-files/' . $filename );\n\t\n}",
"public function unlink($file);",
"public function delete($path);",
"public function delete($path);",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($filename){\n\t\t$file = $this->$dirname.'/'.$filename;\n\t\tif (file_exists($file)){\n\t\t\tunlink($file);\t\t\t\n\t\t}\n\t}",
"function deleteFile($hash);",
"public function DeleteFile()\r\n\t{\r\n\t\t$queryDeleteFile = \"UPDATE files SET status=\\\"DELETED\\\" WHERE file_id=\".$this->fileId;\r\n\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\tunlink(UPLOAD_PATH. DIRECTORY_SEPARATOR .$this->fileId);\r\n\t}",
"function fileDelete(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tmysql_query(deleteObject($GLOBALS['objectId']));\n\t\t\tmysql_query(deleteFile($GLOBALS['fileId']));\n\t\t\tdie();\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"filesURL\")));\n\t}",
"public function deleted(File $file)\n {\n //\n }",
"function delFile($path)\n {\n unlink($this->dir . DIRECTORY_SEPARATOR . $path);\n }",
"public function delete($file)\n {\n $file = $this->getFilePath($file);\n\n if (file_exists($file)) {\n unlink($file);\n }\n }",
"public function deleteFile($path) {\n \n if($path != null) {\n unlink($path);\n }\n }",
"private function _deleteFile($file)\n {\n $this->_files[basename($file)]->delete();\n unset($this->_files[basename($file)]);\n $this->_prune();\n }",
"public static function deleteFile ($path) {\n\t\t\\unlink($path);\n\t}",
"public static function deleteFile($file){\n\t\t\t//@-> PARA N MOSTRAR ALGUM TIPO DE AVISO\n\t\t\t@unlink('uploads/'.$file);\n\t\t}",
"function _webform_delete_file($data, $component) {\r\n // Delete an individual submission file.\r\n $filedata = unserialize($data['value']['0']);\r\n if (isset($filedata['filepath']) && is_file($filedata['filepath'])) {\r\n unlink($filedata['filepath']);\r\n db_query(\"DELETE FROM {files} WHERE filepath = '%s'\", $filedata['filepath']);\r\n }\r\n}",
"public function delete($file){\n\t\t\n\t\t//If the users file exists try to delete it\n\t\tif(file_exists($file))\n\t\t{\n\t\t\tunlink($file) or die($this->openFile(\"core/fragments/errors/error34.phtml\"));\n\t\t}\n\t}",
"function file_delete($route) {\n\tif (file_exists($route)) {\n\t\tunlink($route);\n\t}\n}",
"function delete_file($file) {\n\treturn @unlink($file);\n}",
"public function testDeleteFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"public function silo_delete($path)\n\t{\n\t}",
"function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}",
"function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}",
"public function deleteDownloadFile()\r\n\t{\r\n\t\t@unlink($this->reference);\r\n\t}",
"public function silo_delete($path)\r\n\t{\r\n\t}",
"protected function delete($path) \n\t{\n\t $path = $this->absolutePath($path);\n\t \n\t if (file_exists($path))\n\t {\n\t unlink($path);\n\t $this->log(\"File $path deleted.\");\n\t }\n\t else\n\t {\n\t $this->log(\"File $path not found.\");\n\t }\n\t}",
"public static function deleteFile($file)\n {\n @unlink('uploads/'.$file);\n }",
"public function deleteFileFromServer($p_fileToRemove)\n {\n unlink($p_fileToRemove);\n }",
"public function deleteFile($filename) {\r\n global $db;\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n\r\n $basePath = FILEPATH . $userId. '/' . $trackingId;\r\n $filePath = $basePath . '/' . $filename;\r\n\r\n\r\n if(!isset($userId) || !isset($trackingId)) {\r\n throw new Exception(\"Unable to delete file \" . $filePath . \". Missing tracking form information.\");\r\n }\r\n\r\n\r\n $basePath = FILEPATH . $userId. '/' . $trackingId;\r\n $filePath = $basePath . '/' . $filename;\r\n\r\n $filePath = realpath($filePath);\r\n if(is_readable($filePath)){\r\n unlink($filePath);\r\n $sql = \"DELETE FROM `forms_tracking_files` WHERE `name` = '\" . $filename . \"' AND `trackingId` = \" . $trackingId;\r\n $db->Execute($sql);\r\n }\r\n\r\n $this->loadFilesFromDir($basePath); // refresh what files are associated with this trackingform\r\n }",
"public function doDelete($path);",
"public function deleteFile($file)\n {\n if (!$this->filesystem->has($file)) {\n return;\n }\n\n $this->filesystem->delete($file);\n $this->cacheManager->remove($file);\n }",
"public function delete(): void\n {\n unlink($this->path);\n }",
"public function delete($path)\n {\n }",
"public function deleteAsset($path_to_file)\n\t{\n\t\t$path_to_file = rawurlencode(urldecode($path_to_file));\n\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=filemgr&filemgraction=delete&filename=\".$path_to_file;\n\t\t$result = json_decode($this->curlObj->fetch_url($url),true);\n \n\t\treturn $result[\"MSG\"];\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"abstract public function deleteFile(FileData $fileData);",
"private function deleteFileRecord($fileName) {\n /** @var URLRequest $record */\n $record = URLRequest::where('fileName', $fileName)->first();\n shell_exec('cd /Stream && sudo rm ' . $record->fileName);//Remove the file from the /Stream directory.\n $record->delete(); //Delete $record from the database.\n }",
"public function deleteFile($file)\n {\n $this->getParent(explode('/', dirname($file)))->_deleteFile($file);\n }",
"function delete_file($file) {\n return @unlink($file);\n}",
"public function delete($id)\n\t{\n\n\t\t $document = Efile::where('id',$id)->first();\n //delete the file from the server\n\n // Storage::delete($document->path);\n $storagePath = Storage::disk('public')->getDriver()->getAdapter()->getPathPrefix();\n\t\tif(file_exists($storagePath.$document->path)){\n\t\t unlink($storagePath.$document->path);\n\t\t}\n\t\t\n $document->delete($id);\n\n\t}",
"private function _deleteFile($fileResource)\n {\n $store = $this->_owApp->erfurt->getStore();\n\n // remove file from file system (silently)\n $pathHashed = $this->getFullPath($fileResource);\n if (is_readable($pathHashed)) {\n unlink($pathHashed);\n }\n\n // remove all statements from sysconfig\n $store->deleteMatchingStatements(\n (string)$this->_getConfigModelUri(),\n $fileResource,\n null,\n null\n );\n }",
"protected function deleteFile($file) {\n if (file_exists($file)) {\n unlink($file);\n $this->log(\"Deleted the file \".$file);\n } else {\n $this->log(\"Could not delete file \".$file.\". File not found.\");\n }\n }",
"public static function deleteFileFromElasticSearch($file)\n {\n $index = 'refs';\n $type = 'ref';\n $id = $file->id;\n $Es_model = new Elasticsearch();\n $Es_model->deleteId($index, $type, $id);\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function delete() {\n $result = $this->getFileSystem()->delete($this->getLocalPath());\n if (!$result) {\n // Inform the user if the file could not be deleted\n //File xxx could not be deleted.\n }\n\n return $result;\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function deleteFile($task_id, $file_id)\n {\n $fileDB = \\App\\File::find($file_id);\n Storage::delete($fileDB->path);\n\n $fileDB->delete();\n\n return redirect('/tasks/'. $task_id . '/edit');\n }",
"public function deleteFile(FileInterface $file): bool;",
"function deleteFile($service, $fileId) {\n try {\n $service->files->delete($fileId);\n } catch (Exception $e) {\n print \"An error occurred: \" . $e->getMessage();\n }\n }",
"public function deleteFile(){\n\t\t$db = $this->db;\n\t\t$id = $_GET[\"id\"];\n\t\t\n\t\t$file = $db->fetchRow($db->select()->from(array(\"tbf\"=>\"tb_applicant_files\"))->where(\"id = ?\", $id));\n\t\tif ($file){\n\t\t\tif ($file[\"userid\"]!=$_SESSION[\"userid\"]){\n\t\t\t\treturn array(\"success\"=>false);\n\t\t\t}\n\t\t\t//$db->delete(\"tb_applicant_files\", $db->quoteInto(\"id = ?\", $id));\n\t\t\t$db->update(\"tb_applicant_files\", array(\"is_deleted\" => 1), $db->quoteInto(\"id = ?\", $id));\n $db->delete(\"solr_candidates\", $db -> quoteInto(\"userid=?\",$_SESSION[\"userid\"]));\n\t\t\t\n\t\t\tglobal $base_api_url;\n\t\t\t\n\t\t\tfile_get_contents($base_api_url . \"/solr-index/sync-candidates/\");\n\t\t\t\n\t\t\tif (file_exists(getcwd().\"/../applicants_files/\".$file[\"name\"])){\n\t\t\t\tunlink(getcwd().\"/../applicants_files/\".$file[\"name\"]);\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tfile_get_contents($base_api_url . \"/mongo-index/sync-candidates-files/?userid=\" . $_SESSION[\"userid\"]);\n\t\t\t\n\t\t\t\n\t\t\treturn array(\"success\"=>true);\n\t\t}else{\n\t\t\treturn array(\"success\"=>false);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}",
"public function removeFile($path)\n { $path = $this->_bucket . '/' . $path;\n $this->_internalService->removeObject($path);\n }",
"public function deleteAction() {\n $fileID = (int) $this->params()->fromRoute('id', 0);\n $request = $this->getRequest();\n\n if ($fileID and $request->isXmlHttpRequest()) {\n try {\n\n $file = $this->getFileTable()->getFile($fileID);\n $filePath = $this->getOptions()->getUploadFolderPath() . '/' . $file->url;\n\n if (file_exists($filePath)) {\n if (!unlink($filePath)) {\n throw new \\Exception('Could not delete file');\n }\n }\n\n $this->getFileTable()->deleteFile($fileID);\n\n echo json_encode(array('state' => true));\n exit();\n } catch (\\Exception $e) {\n echo json_encode(array('state' => false));\n exit();\n }\n }\n }",
"function languagelesson_delete_submitted_file($filerecord) {\n $fs = get_file_storage();\n $file = $fs->get_file_instance($filerecord);\n \n if ($file->delete()) {\n return true;\n } else {\n print_error('Cannot delete previously submitted file');\n }\n\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"function fileRemove($fileId){\n\tinclude '../../database.php';\n\n\t$stmt = $conn->prepare(\"SELECT * FROM file WHERE file_id=?\");\n\t$stmt->execute(array($fileId));\n\t$filelocation = $stmt->fetch(PDO::FETCH_ASSOC);\n\t$filelocation = $_SERVER[\"DOCUMENT_ROOT\"] . $filelocation;\n\n\tunlink($filelocation);\n\n\t$stmt = $conn->prepare(\"DELETE FROM file WHERE file_id=?\");\n\t$stmt->execute(array($fileId));\n}",
"public function delete($path, $data = null);",
"function cemhub_delete_file($file_name) {\n $successfully_deleted = FALSE;\n\n $file_details = cemhub_retrieve_file_details($file_name);\n if (!empty($file_details)) {\n $successfully_deleted = file_delete($file_details, TRUE);\n }\n else {\n $repository_path = cemhub_get_files_repository_path(TRUE);\n $successfully_deleted = file_unmanaged_delete($repository_path . '/' . $file_name);\n }\n\n if ($successfully_deleted) {\n watchdog('cemhub', 'The file \"' . $file_name . '\" was deleted successfully.');\n }\n else {\n watchdog('cemhub', 'It was not possible to delete file \"' . $file_name . '\", checks the Drupal file log to view more details.');\n }\n\n return $successfully_deleted;\n}",
"public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }",
"public function deleteFile( Request $request ){\n return FileItem::destroy((int)$request->get('id'));\n }",
"function delete () {\n $this->clearCache ();\n commentaire::deletePhoto ($this->dir, $this->file);\n return files::deleteFile (luxbum::getFsPath ($this->dir) . $this->file);\n }",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function deleted(File $file)\n {\n media()->delete($file->filename);\n }",
"public function destroy(File $file)\n {\n //\n }",
"public function destroy(File $file)\n {\n //\n }",
"public function destroy(File $file)\n {\n //\n }",
"public function delete(Message $message)\n {\n if (!Config::getInstance()->get('CDASH_REMOTE_PROCESSOR')) {\n // A more descriptively named copy of this file should now\n // exist on the server if it is configured to save backups.\n if (file_exists($message->file)) {\n unlink($message->file);\n }\n return;\n }\n\n // When remotely executing we tell the server to delete the file\n // after it has been parsed.\n $query_args = ['filename' => basename($message->file)];\n if ($this->backupFileName) {\n // If the handler provided us with a descriptive backup filename\n // we pass this on to the server in case it is configured to rename\n // (rather than delete) processed submission files.\n $query_args['dest'] = basename($this->backupFileName);\n }\n $url = config('app.url') . '/api/v1/deleteSubmissionFile.php';\n $this->getHttpClient()->request('DELETE', $url,\n ['query' => $query_args]);\n }",
"public function delete_file($key)\n {\n }",
"public function delete($path, $force = false)\n {\n \n }",
"protected function svnDelete($path) \n {\n $fullPath = sfConfig::get('sf_root_dir') . '/' . $path;\n \n if (file_exists($fullPath))\n {\n $command = 'svn --force delete ' . $fullPath;\n try \n {\n $this->log($this->getFilesystem()->execute($command));\n }\n catch (Exception $e)\n {\n $this->log('Cannot svn delete - try file system delete');\n $command = 'rm ' . $fullPath;\n $this->log($this->getFilesystem()->execute($command));\n }\n \n }\n else\n {\n $this->logBlock('File not found: ' . $fullPath, 'INFO');\n }\n }",
"public function delete_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function delete(Message $message)\n {\n if (!Config::getInstance()->get('CDASH_REMOTE_PROCESSOR')) {\n // A more descriptively named copy of this file should now\n // exist on the server if it is configured to save backups.\n if (file_exists($message->file)) {\n unlink($message->file);\n }\n return;\n }\n\n // When remotely executing we tell the server to delete the file\n // after it has been parsed.\n $query_args = ['filename' => basename($message->file)];\n if ($this->backupFileName) {\n // If the handler provided us with a descriptive backup filename\n // we pass this on to the server in case it is configured to rename\n // (rather than delete) processed submission files.\n $query_args['dest'] = basename($this->backupFileName);\n }\n $url = Config::getInstance()->get('CDASH_BASE_URL') .\n '/api/v1/deleteSubmissionFile.php';\n $this->getHttpClient()->request('DELETE', $url,\n ['query' => $query_args]);\n }",
"public function deleteFilePerm(){\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\t\t//Make sure that that file is already trashed\r\n\t\tif($file['trash'] == 1){\r\n\t\t\t//Permanently delete the file\r\n\t\t\t$files = array ();\r\n\t\t\t$files[] = $file;\r\n\t\t\t$this->deleteFilesPermanently($files);\r\n\r\n\t\t}\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}",
"public function delete( $fileID )\n {//--------------->> delete()\n $this->_DAO->delete( $fileID );\n }",
"protected function deleteFile($file)\n {\n $oldFile = trim($file, config('app.url'));\n Storage::delete('public/' . $oldFile);\n }",
"function deleteFile($fileID){\r\n\t\tglobal $file_upload_folder;\r\n\t\t\r\n\t\t// IMPORTANT: Permission checking is currently not done here. It is done by the web gui. \r\n\t\t// Links to delete files only show up when userCanDeleteFile() returns true.\r\n\t\t// This is something to keep in mind for future pansophy versions.\r\n\t\t\r\n\t\t// delete file from server\r\n\t\tif(file_exists($file_upload_folder.$fileID)){\r\n\t\t\tif(unlink($file_upload_folder.$fileID)){\t\r\n\t\t\t\t// delete references of file from database\r\n\t\t\t\t$query = \"DELETE FROM `attachments` WHERE ID='\".$fileID.\"'\";\r\n\t\t\t\treturn mysql_query( $query );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function deleteFile($db, $strDetailID = \"\")\n{\n global $words;\n $bolNewData = true;\n if ($strDetailID != \"\") {\n $strSQL = \"SELECT * FROM hrd_training_request \";\n $strSQL .= \"WHERE id = '$strDetailID' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n $strFile = $rowDb['doc'];\n if ($strFile != \"\") {\n if (file_exists(\"trainingdoc/\" . $strFile)) {\n unlink(\"trainingdoc/\" . $strFile);\n }\n $strSQL = \"UPDATE hrd_training_request SET doc = '' WHERE id = '$strDetailID' \";\n $resExec = $db->execute($strSQL);\n //writeLog(ACTIVITY_DELETE, MODULE_PAYROLL,\"file $strDetailID\",0);\n }\n }\n }\n return true;\n}",
"public function destroy(File $file)\n {\n $url=str_replace('storage','public',$file->url);\n Storage::delete($url);\n\n $file->delete();\n return redirect()->route('admin.files.index');\n }",
"public function deleteIndexedFile(File $file)\n {\n $query = $this->pdo->prepare(\"DELETE FROM rt_files WHERE id = :id_bind\");\n $query->bindValue(\":id_bind\", $file->getId(), \\PDO::PARAM_INT);\n $query->execute();\n }",
"function FTPdelete($file,$path,$parent=''){\n}",
"public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }",
"public function deleteFile(){\r\n\t\t//Get the storage name\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\r\n\t\t//Mark the file as deleted in the database so they get displayed in the trashcan\r\n\t\t$this->DataModel->fileIntoTrash($file['id']);\r\n\t\t$this->successMessage($this->lang->line('success_file_deleted'));\r\n\r\n\t\t//Check if the file was deleted by the original owner or by a user who has access\r\n\t\tif($this->authentication->uid == $file['user_id']){\r\n\t\t\tif($file['parent'] == 0 ){\r\n\t\t\t\tredirect('/dashboard');\r\n\t\t\t}else{\r\n\t\t\t\t//Get parent information\r\n\t\t\t\t$parent = $this->DataModel->getFolderInfo(array('id' => $file['parent']), $this->authentication->uid);\r\n\t\t\t\tredirect('folders/'.$parent['public_key']);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$parent = $this->DataModel->getFolderInfo(array('id' => $file['parent']));\r\n\t\t\tredirect('sharedFolder/'.$parent['public_key']);\r\n\t\t}\r\n\t}",
"public function destroy($id)\n {\n $getFile = Files::find($id);\n\n\n // find if there is any node connected\n $getPost = Posts::where(['image'=>$getFile->file]);\n if ($getPost->count() > 0) {\n $getPost = Posts::where(['image'=>$getFile->file])->update([\n 'image' => 'img/blogImage.png'\n ]);\n }\n\n\n $remove = File::delete($getFile->file);\n $del = Files::destroy($id);\n\n Session::flash('Success', 'File removed succesfully.');\n return redirect()->back();\n }",
"private function removeUploadedFile()\n {\n if(!isset($_REQUEST['file']))\n {\n exit; \n }\n \n list($file, $src, $size) = explode(':', $_REQUEST['file']);\n \n if(file_exists($src))\n {\n @unlink($src);\n }\n exit;\n }"
] | [
"0.74030894",
"0.7365989",
"0.7200488",
"0.71284854",
"0.7017305",
"0.6897608",
"0.68961114",
"0.68452597",
"0.67141354",
"0.6706241",
"0.67054486",
"0.6696619",
"0.6694998",
"0.6694124",
"0.6679157",
"0.6679157",
"0.66555864",
"0.6652714",
"0.6648252",
"0.66409475",
"0.662534",
"0.66159",
"0.65806097",
"0.65778124",
"0.6555534",
"0.65476745",
"0.6539416",
"0.6537327",
"0.6520333",
"0.6518372",
"0.65103775",
"0.65077007",
"0.64945155",
"0.6463452",
"0.64519376",
"0.6445481",
"0.6445481",
"0.6434387",
"0.64290166",
"0.6423722",
"0.6416799",
"0.63963354",
"0.6389417",
"0.6383789",
"0.6375711",
"0.63638014",
"0.63444024",
"0.6334485",
"0.63097274",
"0.6306433",
"0.6302353",
"0.6299748",
"0.6292379",
"0.628898",
"0.6282152",
"0.62770927",
"0.6274988",
"0.6258599",
"0.62585115",
"0.62584317",
"0.62526697",
"0.62480533",
"0.6241215",
"0.6240163",
"0.62386996",
"0.6231474",
"0.62295574",
"0.62262625",
"0.622579",
"0.6223619",
"0.6220439",
"0.6209468",
"0.62093294",
"0.62018675",
"0.62009674",
"0.6191617",
"0.6188835",
"0.6188835",
"0.6188835",
"0.61844164",
"0.6183654",
"0.61824363",
"0.61765844",
"0.6175206",
"0.61684865",
"0.6167785",
"0.61674017",
"0.61640257",
"0.6146206",
"0.6138356",
"0.6135716",
"0.6135496",
"0.6133998",
"0.6132288",
"0.6128006",
"0.6115925",
"0.6115371",
"0.611096",
"0.61107993",
"0.6108621"
] | 0.6664602 | 16 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.