query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
The facet count must be a number.
public function testInvalidFacetCountError() { set_option('solr_search_facet_limit', '25'); // Invalid facet limit. $this->request->setMethod('POST')->setPost(array( 'solr_search_facet_limit' => 'invalid' )); $this->dispatch('solr-search/results'); // Should not set option. $this->assertEquals('25', get_option('solr_search_facet_limit')); // Should flash error. $this->_assertFormError('solr_search_facet_limit'); }
[ "public function testNoFacetCountError()\n {\n\n set_option('solr_search_facet_limit', '25');\n\n // Missing facet length.\n $this->request->setMethod('POST')->setPost(array(\n 'solr_search_facet_limit' => ''\n ));\n\n $this->dispatch('solr-search/results');\n\n // Should not set option.\n $this->assertEquals('25', get_option('solr_search_facet_limit'));\n\n // Should flash error.\n $this->_assertFormError('solr_search_facet_limit');\n\n }", "public function getNumFacets() {\n return $this->numFacets;\n }", "public function facet( $facet );", "public function count() {\n\t\treturn count($this->_facets) ;\n\t}", "public function getFacetCounts()\n {\n return $this->facetCounts;\n }", "public function processFacets(){\n $facets = $this->getFacets();\n if($facets){\n $facetData = array();\n foreach($facets as $k){\n $facetData[$k] = array();\n $facet = $this->_resultset->getFacetSet()->getFacet($k);\n if($facet){\n foreach($facet as $value => $count) {\n $facetData[$k][ $value ] = $count;\n }\n }\n }\n return $facetData;\n } else {\n return false;\n }\n \n }", "function addFacetField($fieldname, $mincount=1)\n\t{\n\t\t$this->facetFields[$fieldname] = $mincount;\n\t}", "function addFacetField($fieldname, $mincount=1)\r\n\t{\r\n\t\t$this->queryLoaded = false;\r\n\r\n\t\t$this->facetFields[$fieldname] = $mincount;\r\n\t}", "public function getfacetCount() {\n \n $solrVars = array(\n 'indent' => $this->indent,\n 'version' => $this->version,\n 'fq' => $this->fq,\n 'start' => $this->start,\n 'rows' => 0,//$this->rows,\n 'fl' => $this->fl,\n //'qt' => $this->qt,\n 'wt' => $this->wt,\n 'explainOther'=> $this->explainOther,\n 'hl.fl' => $this->hl_fl,\n 'facet'\t\t=> 'true',\n 'facet.field' => 'keyword',\n 'facet.sort' => 'true',\n 'facet.offset' => 0,\n 'facet.limit' => -1,\n 'facet.mincount' => $this->facetCount,\n 'q' => trim($this->queryString,'+')\n );\n\n $solrVarsStr = '';\n foreach($solrVars as $key => $val) {\n $solrVarsStr .= $key.'='.trim($val).'&';\n }\n\n //this is final query\n $finalUrl = rtrim($this->solrUrl.'select?'.$solrVarsStr,'&'); \n\n //$data = file_get_contents($finalUrl);\n try {\n $obj = new Utility_SolrQueryAnalyzer($finalUrl,__FILE__.' at line '.__LINE__);\n $data = $obj->init();\n } catch (Exception $e) {\n trigger_error($e->getMessage());\n }\n \n \n if(!empty($data)) {\n $xmlData = simplexml_load_string($data);\n $search = array();\n $counter = 0;\n $dataArray = $xmlData->lst[1]->lst[1]->lst->int;\n return count($dataArray);\n } \n }", "function parse_facet() {\n // TODO: We should probably do some validation here\n // Handle normal faceting. This comes in the form of http://...&facet=langauge\n if (!empty($this->http_request->params['facet'][0])) {\n $facets = array();\n foreach ($this->http_request->params['facet'] as $facet) {\n $this->solr_data_store_request->params['f.' . $facet . '.facet.mincount'] = 1;\n\n if (!empty($this->http_request->params['facet_limit_' . $facet][0])) {\n $this->solr_data_store_request->params['f.' . $facet . '.facet.limit'] = $this->http_request->params['facet_limit_' . $facet][0];\n }\n }\n $this->solr_data_store_request->params['facet.field'] = $this->http_request->params['facet'];\n $this->solr_data_store_request->params['facet'] = 'true';\n }\n\n // Handle facet query faceting. This comes in the form of http://...&facet_query=circ_fac_score:[2 TO *]\n if (!empty($this->http_request->params['facet_query'][0])) { \n $this->solr_data_store_request->params['facet.query'] = $this->http_request->params['facet_query'];\n $this->solr_data_store_request->params['facet'] = 'true';\n }\n }", "public function getFacetOptionsCount() {\n\t\t$facetCounts = $this->search->getFacetCounts();\n\t\t$facetField = $this->facetConfiguration['field'];\n\n\t\treturn count((array) $facetCounts->facet_fields->$facetField);\n\t}", "public function facet()\n {\n return $this->add('group.facet', 'true');\n }", "function the_facets() {\n\t\treturn $this->facet_counts;\n\t}", "public function getFacet(){}", "public function getFacetLimit($field_override){}", "public function prepareFacetFields() {\n $results = $this->results;\n $facet_field = $this->facet_field;\n $facet_results = array();\n module_load_include('inc', 'islandora_solr', 'includes/utilities');\n foreach ($results as $bucket => $count) {\n $facet_results[] = array(\n 'count' => $count,\n 'filter' => islandora_solr_lesser_escape($facet_field) . ':\"' .\n islandora_solr_facet_escape($bucket) . '\"',\n 'bucket' => $bucket,\n );\n }\n return $facet_results;\n }", "public function getGroupFacet() {}", "public function getFacetLimit(string $field_override = NULL): int {}", "public function testFacets() {\r\n\t\t$dataProvider = new ASolrDataProvider(\"ASolrDocument\");\r\n\t\t$criteria = $dataProvider->getCriteria();\r\n\t\t$criteria->setQuery(\"name:test\");\r\n\t\t$criteria->facet = true;\r\n\t\t$criteria->addFacetField(\"name\");\r\n\t\t$criteria->addFacetQuery(\"popularity:[* TO 10]\");\r\n\t\t$criteria->addFacetQuery(\"popularity:[10 TO 20]\");\r\n\t\t$criteria->addFacetQuery(\"popularity:[20 TO *]\");\r\n\t\t$this->assertGreaterThan(54, $dataProvider->getTotalItemCount());\r\n\t\t$fieldFacets = $dataProvider->getFieldFacets();\r\n\t\t$this->assertTrue(isset($fieldFacets->name));\r\n\t\t$this->assertTrue($fieldFacets->name instanceof ASolrFacet);\r\n\t\t$this->assertTrue(isset($fieldFacets->name['test']));\r\n\t\t$this->assertGreaterThan(54, $fieldFacets->name['test']);\r\n\r\n\t\t$queryFacets = $dataProvider->getQueryFacets();\r\n\t\t$this->assertTrue(isset($queryFacets[\"popularity:[* TO 10]\"]));\r\n\t\t$this->assertGreaterThan(10, $queryFacets[\"popularity:[* TO 10]\"]['value']);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrap any object with a route match, and return that.
private function createRouteMatchForObject(\stdClass $object) { $route_match = $this->prophesize(RouteMatchInterface::class); $route_match->getRawParameters()->willReturn(new ParameterBag(['entity_type' => 'node', 'var_name' => 1])); $route_match->getParameters()->willReturn(new ParameterBag(['entity_type' => 'node', 'var_name' => $object])); return $route_match->reveal(); }
[ "public function objectRouteClass();", "function route($patern, $location, $options =array() )\n{\n return new Route($patern, $location, $options);\n}", "public function getMatchRouteStrategy(): RouteMatcherInterface;", "public function getRouteObject()\n {\n return new Route($this->url, $this->port);\n }", "public function getMatchedRoute();", "public function getMatchedRoute() {}", "public function matchRoute();", "public function createRouteObject();", "public function route(): RouteInterface;", "public function getMatchedRoute(){ }", "public function setHandler($handler): RouteInterface;", "public function newRouteHelper()\n {\n return new Helper\\Route($this->getGenerator());\n }", "public function __invoke(): RouterAdapterInterface;", "protected function routeFactory()\n {\n return new Route();\n }", "public function match(string $path): RouteMatch;", "public function renderRoute()\n {\n $requestedRoute = get_query_var($this->queryVar);\n if (!$requestedRoute || empty($requestedRoute)) {\n return;\n }\n\n $requestedRoute = trailingslashit($requestedRoute);\n $routeHandler = $this->getRouteHandler($requestedRoute);\n\n // Route hasn't been found, send 404 header and render 404 template\n if (!$routeHandler) {\n static::set404();\n }\n\n global $post;\n $post = null;\n\n if (strpos($routeHandler, \"@\") === false && is_callable($routeHandler)) {\n return $this->callRouteHandler($routeHandler, $requestedRoute);\n }\n $routeCallback = explode(\"@\", $routeHandler);\n $class = $routeCallback[0];\n $method = empty($routeCallback[1]) ? null : $routeCallback[1];\n\n if (!class_exists($class) || empty($method)) {\n return;\n }\n\n $reflectionClass = new \\ReflectionClass($class);\n if (!$reflectionClass->hasMethod($method)) {\n return;\n }\n\n $methodChecker = new \\ReflectionMethod($class, $method);\n if ($methodChecker->isStatic()) {\n return $this->callRouteHandler([$class, $method], $requestedRoute);\n } else {\n $instance = new $class;\n return $this->callRouteHandler([$instance, $method], $requestedRoute);\n }\n }", "public function getRouteMatch() : RouteMatch\n {\n return $this->routeMatch;\n }", "public function getRouteHandler()\n {\n if ($this->routing_table->storeNeedsRebuilding()) {\n $routes = $this->route_parser->buildRouteTable();\n $this->routing_table->saveRoutingTable($routes);\n }\n\n $route = $this->routing_table->findMatchingRoute($this->request);\n\n $route_handler_class_name = $route->getClassName();\n $call_parameters = $route->extractParametersFromRequest($this->request);\n\n $route_handler_service_container = $route_handler_class_name::getDefaultServiceContainer();\n $route_handler = new $route_handler_class_name();\n $route_handler->processServiceContainer($route_handler_service_container);\n $route_handler->setCallParameters($call_parameters);\n\n return $route_handler;\n }", "public function findRoute(){\n $result = null;\n\n if(!empty($this->map)){\n foreach ($this->map as $name => $routeData){\n $path = $routeData['path'];\n $pattern = $this->transformToRegexp($path);\n if(preg_match($pattern, $this->request->getUri(), $matches)){\n $method = $this->request->getMethod();\n if(($method != 'OPTIONS') && (!empty($routeData['method']) && $method != strtoupper($routeData['method']))) {\n continue;\n }\n\n $result = $routeData;\n $result['params'] = $this->parseParams($path);\n $result = new Route($result);\n\n break;\n }\n }\n }\n\n return $result;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the user's shop_id and model's shop_id is same
private function merchantAuth() { return isset($this->model->shop_id) && $this->model->shop_id == $this->user->merchantId(); }
[ "public function checkSellerExists($shop_id, $user_id) {\n $this->__createLog('Entering into class [UserManager\\Sonata\\UserBundle\\Services\\SellerUser] and function [checkSellerExists]', array());\n $em = $this->em;\n $seller_user = $em->getRepository('UserManagerSonataUserBundle:SellerUser')\n ->findOneBy(array('shopId'=>$shop_id, 'sellerId'=>$user_id));\n if (!$seller_user) { //if seller does not exists\n $this->__createLog('Exiting from class [UserManager\\Sonata\\UserBundle\\Services\\SellerUser] and function [checkSellerExists]', array());\n return false; \n }\n $this->__createLog('Exiting from class [UserManager\\Sonata\\UserBundle\\Services\\SellerUser] and function [checkSellerExists]', array());\n return true;\n }", "public function testIsOrderBelongToShop(): void\n {\n $this->assertTrue(Order::isOrderBelongToShop(1, 1));\n $this->assertFalse(Order::isOrderBelongToShop(1, 2));\n }", "private function checkUserForMissingShopId($oxUserId)\n {\n if (marm_shopgate::getOxConfig()->getConfigParam('blMallUsers')) {\n // This flag means that users can access all subshops and hence have no shopId.\n return;\n }\n $shopId = marm_shopgate::dbGetOne(\"SELECT oxshopid FROM oxuser WHERE oxid = '$oxUserId'\");\n if (!empty($shopId)) {\n // User already has a shopId\n return;\n }\n $shopIds = marm_shopgate::dbGetAll(\"SELECT oxid FROM oxshops;\");\n if (count($shopIds) > 1) {\n // Multiple shopIds exist --> We can't be 100% sure which one to set.\n // (Affects only Oxid EE shops with blMallUsers == false)\n return;\n }\n\n $shopId = marm_shopgate::getOxConfig()->getShopId();\n marm_shopgate::dbExecute(\"UPDATE oxuser SET oxshopid = '$shopId' WHERE oxid = '$oxUserId'\");\n }", "public function check(Model $model)\n {\n return $model->id == $this->id;\n }", "public function userLikeShop(User $user, Shop $shop)\n {\n if ($user->preferredShops()->where('shop_id', $shop->id)->exists()) {\n return false;\n }\n\n $user->preferredShops()->attach($shop->id, ['created_at' => now()]);\n\n return true;\n }", "function update($shopInfo, $shopId)\n {\n $this->db->where('id', $shopId);\n $this->db->update('shop', $shopInfo);\n $authItems = $this->auth_model->getAuthsByShopId($shopId);\n if (count($authItems) > 0) {\n foreach ($authItems as $item) {\n $newItem = $item;\n $newItem->status = $shopInfo['status'];\n $this->db->where('id', $newItem->id);\n $this->db->update('tbl_authcode', $newItem);\n }\n }\n $qrItems = $this->getQRByShopId($shopId);\n if (count($qrItems) > 0) {\n foreach ($qrItems as $item) {\n $newItem = $item;\n $newItem->status = $shopInfo['status'];\n $this->db->where('id', $newItem->id);\n $this->db->update('qrcode', $newItem);\n }\n }\n return TRUE;\n }", "public static function isShopOwner($user_id = null)\n\t{\n\t\tif(is_null($user_id))\n\t\t{\n\t\t\t$user = \\Config::get('webshoppack::logged_user_id');\n\t\t\t$logged_user_id = $user();\n\t\t}\n\t\telse\n\t\t\t$logged_user_id = $user_id;\n\n\t\tif($logged_user_id > 0)\n\t\t{\n\t\t\t$details = \\Agriya\\Webshoppack\\ShopDetails::where('user_id', $logged_user_id)->count();\n\t\t\tif($details)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function getShopOwner($shop_id) {\n //get entity manager object\n $em = $this->container->get('doctrine')->getManager();\n $shop_owner = 0;\n $store_obj = $em->getRepository('StoreManagerStoreBundle:UserToStore')\n ->findOneBy(array('storeId' => $shop_id, 'role' => 15));\n\n if($store_obj){\n $shop_owner = $store_obj->getUserId();\n }\n return $shop_owner;\n }", "public function store(User $user, Checkout $checkout)\n {\n $store = $user->store->id ?? null;\n \n return $store == $checkout->product->store_id;\n }", "public function tag($shopId)\n{\n $exist = $this->is_taging($shopId);\n // confirming that it is not you\n $its_me = $this->id == $shopId;\n\n if ($exist || $its_me) {\n // do nothing if already taging\n return false;\n } else {\n // tag if not taging\n $this->tagings()->attach($shopId);\n return true;\n }\n}", "public function update(User $user, ShoppingItem $shoppingItem): bool\n {\n return $user->id === $shoppingItem->shoppingList->user_id;\n }", "protected function isRateOwner() {\n $jkhproduct = Jkhproduct::find()\n ->innerJoin('rate rt', 'rt.id = '.Yii::$app->request->get('id').' AND rt.product_id = jkh_product.id')\n ->where(['user_id' => UserCustom::getUserId()]);\n return $jkhproduct->one()->user_id == Yii::$app->user->id;\n }", "public function isSameAddressUserPayPalUser($oDetails)\n {\n }", "public function userDislikeShop(User $user, Shop $shop)\n {\n if ($user->dislikedShops()->where('shop_id', $shop->id)->exists()) {\n return false;\n }\n\n $user->dislikedShops()->attach($shop->id, ['created_at' => now()]);\n\n return true;\n }", "private function checkInitShop()\n {\n if (Auth::user()->is('supplier')) {\n return true;\n }\n\n return false;\n }", "public function buy_product(User $user, Product $product)\n {\n $store = $user->store->id ?? null;\n \n return $store != $product->store_id;\n }", "public function getShopId()\n {\n return $this->shop_id;\n }", "private function check_id(){\r\n\t\treturn ($this->id === $_SESSION['id']);\r\n\t}", "protected function validateShop(Request $request)\n {\n\n $shopDomain = $request->header('x-shopify-shop-domain');\n\n // Get the shop based on domain\n $shopModel = Config::get('shopify-app.shop_model');\n $shop = $shopModel::where(['shopify_domain' => $shopDomain])->first();\n\n if (!$shop) {\n return false;\n }\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the getPage and getArchives call to display listings of posts on the container.
public function setPostListingCall(){ $where = array('class_key' => 'MyArticle'); //@TODO : This will be the settings for myjournal later $settings = array(); $articlesPlaceholder = $this->xpdo->getOption('articles_placeholder', $settings, 'articles'); //@TODO allow user and/or template to override/add options with runSnippet $options = array( 'elementClass' => 'modSnippet', 'element' => 'getArchives', 'makeArchive' => 0, 'cache' => 0, 'parents' => $this->get('id'), 'where' => $this->xpdo->toJSON($where), 'showHidden' => 1, 'includeContent' => 1, 'includeTVsList' => $this->xpdo->getOption('include_tvs_list', $settings, ''), 'processTVs' => $this->xpdo->getOption('process_tvs', $settings, 0), 'processTVsList' => $this->xpdo->getOption('process_tvs_list', $settings, ''), 'tagKey' => $this->xpdo->getOption('tag_tv_name', $settings, 'tags'), 'tagSearchType' => $this->xpdo->getOption('tag_tv_search_mode', $settings, 'contains'), 'sortby' => $this->xpdo->getOption('sortby', $settings, 'publishedon'), 'sortdir' => $this->xpdo->getOption('sortdir', $settings, 'DESC'), 'limit' => $this->xpdo->getOption('post_per_page', $settings, 10), 'pageLimit' => $this->xpdo->getOption('page_limit', $settings, 5), 'pageVarKey' => $this->xpdo->getOption('page_var_key', $settings, 'page'), 'pageNavVar' => $this->xpdo->getOption('page_nav_var', $settings, 'page.nav'), 'totalVar' => $this->xpdo->getOption('page_total_var', $settings, 'total'), 'offset' => $this->xpdo->getOption('page_offset', $settings, 0), 'tpl' => $this->xpdo->getOption('articles_tpl', $settings, 'myjournal/articles.tpl'), ); if($this->xpdo->getOption('set_page_nav_placeholder', $settings, true)){ $this->xpdo->setPlaceholder('paging','[[!+page.nav:notempty=` <div class="paging"> <ul class="pageList"> [[!+page.nav]] </ul> </div> `]]'); } $this->setTagCall('getPage', $articlesPlaceholder, false, $options); }
[ "public function postsList()\n\t{\n\t\t$postManager = new PostManager();\n\t\t$pagesCount = $postManager->countPages($this->postsPerPage);\n\n\t\tif ($this->pageNumber > $pagesCount) {\n\t\t\t$this->pageNumber = $pagesCount;\n\t\t}\n\n\t\t$firstIndex = ($this->pageNumber - 1) * $this->postsPerPage;\n\n\t\t$resp;\n\n\t\tif (isset($_GET[\"category\"])) {\n\t\t\t$categoryManager = new CategoryManager();\n\t\t\t$categoryList = $categoryManager->getCategoryList();\n\n\t\t\tforeach ($categoryList as $value) {\n\t\t\t\t\n\t\t\t\tif ($_GET[\"category\"] == strtolower($value->getName())) {\n\t\t\t\t\t$resp = $postManager->getPostsPerCat($firstIndex, $this->postsPerPage, $_GET[\"category\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$resp = $postManager->getPublishedPosts($firstIndex, $this->postsPerPage);\n\t\t}\t\n\n\t\tforeach ($resp as $value) {\n\t\t\t$date = $value->getPublication();\n\t\t\t$newDate = new FrenchDate($date);\n\t\t\t$frenchDate = $newDate->getFrenchDate();\n\t\t\t$value->setPublication($frenchDate);\n\t\t}\n\n\t\treturn $resp;\n\t}", "public function archives()\n {\n $year = $this->param('year');\n $month = $this->param('month');\n $page = $this->param('page');\n\n $month_name = '';\n\n $options = array(\n 'total_items' => $this->provider->getArchives($year, $month, 0, 0, true),\n 'items_per_page' => Setting::get('blog_per_page'),\n );\n\n $pagination = Pagination::create($options);\n\n $blogs = $this->provider->getArchives($year, $month, Pagination::limit(), \n Pagination::offset());\n\n\n if ($month) {\n \n $month_name = date(\"F\", mktime(0, 0, 0, $month, 10));\n\n }\n\n if (self::checkPartial('archives')) {\n $this->template->setPartial('archives');\n } else {\n $this->template->setPartial('index');\n }\n\n $this->template->title('Blog')\n ->set('list_type', 'archives')\n ->set('blogs', $blogs)\n ->set('pagination', $pagination)\n ->breadcrumb('Blog', rbUrl('blog'))\n ->breadcrumb($year, rbUrl('blog/archives/'.$year));\n\n if ($month_name) {\n $this->template->breadcrumb($month_name);\n }\n }", "public function getPostListingCall($placeholderPrefix = '') {\n $settings = $this->getContainerSettings();\n $where = array('class_key' => 'Article');\n if (!empty($_REQUEST['arc_user'])) {\n $userPk = $this->xpdo->sanitizeString($_REQUEST['arc_user']);\n if (intval($userPk) == 0) {\n /** @var modUser $user */\n $user = $this->xpdo->getObject('modUser',array('username' => $userPk));\n if ($user) {\n $userPk = $user->get('id');\n } else { $userPk = false; }\n }\n if ($userPk !== false) {\n $where['createdby:='] = $userPk;\n $this->set('cacheable',false);\n }\n }\n\n $output = '[[!getPage?\n &elementClass=`modSnippet`\n &element=`getArchives`\n &makeArchive=`0`\n &cache=`1`\n &parents=`'.$this->get('id').'`\n &where=`'.$this->xpdo->toJSON($where).'`\n &showHidden=`1`\n &includeContent=`1`\n &includeTVs=`'.$this->xpdo->getOption('archivesIncludeTVs',$settings,0).'`\n &includeTVsList=`'.$this->xpdo->getOption('includeTVsList',$settings,'').'`\n &processTVs=`'.$this->xpdo->getOption('archivesProcessTVs',$settings,0).'`\n &processTVsList=`'.$this->xpdo->getOption('processTVsList',$settings,'').'`\n &tagKey=`articlestags`\n &tagSearchType=`contains`\n &sortby=`'.$this->xpdo->getOption('sortBy',$settings,'publishedon').'`\n &sortdir=`'.$this->xpdo->getOption('sortDir',$settings,'DESC').'`\n &tpl=`'.$this->xpdo->getOption('tplArticleRow',$settings,'sample.ArticleRowTpl').'`\n\n &limit=`'.$this->xpdo->getOption('articlesPerPage',$settings,10).'`\n &pageLimit=`'.$this->xpdo->getOption('pageLimit',$settings,5).'`\n &pageVarKey=`'.$this->xpdo->getOption('pageVarKey',$settings,'page').'`\n &pageNavVar=`'.$this->xpdo->getOption('pageNavVar',$settings,'page.nav').'`\n &totalVar=`'.$this->xpdo->getOption('pageTotalVar',$settings,'total').'`\n &offset=`'.$this->xpdo->getOption('pageOffset',$settings,0).'`\n\n &pageNavTpl=`'.$this->xpdo->getOption('pageNavTpl',$settings,'<li[[+classes]]><a[[+classes]][[+title]] href=\"[[+href]]\">[[+pageNo]]</a></li>').'`\n &pageActiveTpl=`'.$this->xpdo->getOption('pageActiveTpl',$settings,'<li[[+activeClasses]]><a[[+activeClasses:default=` class=\"active\"`]][[+title]] href=\"[[+href]]\">[[+pageNo]]</a></li>').'`\n &pageFirstTpl=`'.$this->xpdo->getOption('pageFirstTpl',$settings,'<li class=\"control\"><a[[+classes]][[+title]] href=\"[[+href]]\">First</a></li>').'`\n &pageLastTpl=`'.$this->xpdo->getOption('pageLastTpl',$settings,'<li class=\"control\"><a[[+classes]][[+title]] href=\"[[+href]]\">Last</a></li>').'`\n &pagePrevTpl=`'.$this->xpdo->getOption('pagePrevTpl',$settings,'<li class=\"control\"><a[[+classes]][[+title]] href=\"[[+href]]\">&lt;&lt;</a></li>').'`\n &pageNextTpl=`'.$this->xpdo->getOption('pageNextTpl',$settings,'<li class=\"control\"><a[[+classes]][[+title]] href=\"[[+href]]\">&gt;&gt;</a></li>').'`\n\n '.$this->xpdo->getOption('otherGetArchives',$settings,'').'\n ]]';\n $this->xpdo->setPlaceholder($placeholderPrefix.'articles',$output);\n\n $this->xpdo->setPlaceholder($placeholderPrefix.'paging','[[!+page.nav:notempty=`\n<div class=\"paging\">\n<ul class=\"pageList\">\n [[!+page.nav]]\n</ul>\n</div>\n`]]');\n return $output;\n }", "private static function _getPosts ()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $_baseURI, $_title, $_api;\r\n\t\t\t\r\n\t\t\t// Declarations\r\n\t\t\t$title = 'Blog - '.$_title;\r\n\t\t\t$retVal = new stdClass();\r\n\t\t\t$minDate = null;\r\n\t\t\t$maxDate = null;\r\n\t\t\t$tag = '';\r\n\t\t\t$page = '';\r\n\t\t\t\r\n\t\t\t// Get the page\r\n\t\t\t$page = Lib\\Url::GetInt('p', 1);\r\n\t\t\t\r\n\t\t\t// Figure up tags\r\n\t\t\tif (isset($_GET['tag']) && $_GET['tag']) {\r\n\t\t\t\t$tag = urldecode($_GET['tag']);\r\n\t\t\t\t$title = 'Blog - Posts tagged with ' . $tag . ' - ' . $_title;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check the dates\r\n\t\t\t$year = Lib\\Url::GetInt('year');\r\n\t\t\t$month = Lib\\Url::GetInt('month');\r\n\t\t\tif ($month && $year) {\r\n\t\t\t\t$minDate = mktime (0, 0, 0, $month, 1, $year);\r\n\t\t\t\t$maxDate = mktime (0, 0, 0, $month + 1, 1, $year);\r\n\t\t\t\t$title = 'Blog - Posts from ' . date('F Y', $minDate) . ' - ' . $_title;\r\n\t\t\t} else if ($year) {\r\n\t\t\t\t$minDate = mktime (0, 0, 0, 1, 1, $year);\r\n\t\t\t\t$maxDate = mktime (0, 0, 0, 12, 31, $year);\r\n\t\t\t\t$title = 'Blog - Posts from ' . $year . ' - ' . $_title;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If we're not on the home page, use the blog template\r\n\t\t\t$homePage = true;\r\n\t\t\tif ($page > 1 || $tag || $minDate || $maxDate) {\r\n\t\t\t\tLib\\Display::setTemplate('content_plain');\r\n\t\t\t\t$homePage = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$type = Lib\\Url::Get('type', 'blog,art,comic');\r\n\t\t\t\r\n\t\t\t// Generate the cache key\r\n\t\t\t$cacheKey = 'BlogHome_' . $page . '_' . $minDate . '_' . $maxDate . '_' . $tag . '_' . $type;\r\n\t\t\t\r\n\t\t\t$retVal = Lib\\Cache::Get($cacheKey);\r\n\t\t\tif (!$retVal) {\r\n\t\t\t\r\n\t\t\t\t// Grab the fifteen latest posts\r\n\t\t\t\t$retVal = new stdClass();\r\n\t\t\t\t$obj = Api\\Content::getContent(array( 'offset'=>($page - 1) * ENTRIES_PER_PAGE, 'tag'=>$tag, 'mindate'=>$minDate, 'maxdate'=>$maxDate, 'max'=>ENTRIES_PER_PAGE, 'parent'=>0, 'contentType'=>$type ));\r\n\t\t\t\tif (isset($obj->content)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Format each entry\r\n\t\t\t\t\t$arr = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ($obj->content as $post) {\r\n\t\t\t\t\t\t$arr[] = self::_formatPost ($post, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t// Figure up the paging buttons\r\n\t\t\t\t\t$numPages = $obj->count / ENTRIES_PER_PAGE;\r\n\t\t\t\t\t$localDir = str_replace ('index.php', '', $_SERVER['SCRIPT_NAME']);\r\n\t\t\t\t\t$rawPage = preg_replace ('@/page/(\\d+)/@', '/', str_replace ($localDir, '/', $_SERVER['REQUEST_URI']));\r\n\r\n\t\t\t\t\t$t = new stdClass;\r\n\t\t\t\t\t$t->contentType = $type ? '/' . $type . '/' : '/';\r\n\t\t\t\t\tif ($numPages > $page) {\r\n\t\t\t\t\t\t$t->prev = $_baseURI . '?p='.($page + 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($page > 1) {\r\n\t\t\t\t\t\t$t->next = $_baseURI . '?p='.($page - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t$t->articles = $arr;\r\n\t\t\t\t\t$retVal = Lib\\Display::compile($t, 'content_articles', $cacheKey);\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tLib\\Display::showError('Content returned empty or malformed', 'There was an error siplaying that page!');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tLib\\Display::setVariable('title', $_title);\r\n\t\t\tLib\\Display::setVariable('content', $retVal);\r\n\t\t\t\r\n\t\t}", "protected function retrieve_posts()\n {\n }", "public function get_posts() {\n\n\t\t// Check if post type is set\n\t\tif ( ! isset( $_GET['post_type'] ) ) {\n\t\t\tDabba_Web_Service::get()->throw_error( 'No post type set.' );\n\t\t}\n\n\t\t// Set post type\n\t\t$post_type = esc_sql( $_GET['post_type'] );\n\n\t\t// Global options\n\t\t$options = Dabba_Web_Service::get()->get_options();\n\n\t\t// Get 'get_posts' options\n\t\t$gp_options = array();\n\t\tif ( isset( $options['get_posts'] ) ) {\n\t\t\t$gp_options = $options['get_posts'];\n\t\t}\n\n\t\t// Fix scenario where there are no settings for given post type\n\t\tif ( ! isset( $gp_options[$post_type] ) ) {\n\t\t\t$gp_options[$post_type] = array();\n\t\t}\n\n\t\t// Setup options\n\t\t$pt_options = wp_parse_args( $gp_options[$post_type], $this->get_default_settings() );\n\n\t\t// Check if post type is enabled\n\t\tif ( 'false' == $pt_options['enabled'] ) {\n\t\t\tDabba_Web_Service::get()->throw_error( 'Post Type not supported.' );\n\t\t}\n\n\t\t// Setup default query vars\n\t\t$default_query_arguments = array(\n\t\t\t'posts_per_page' => - 1,\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'title',\n\t\t);\n\n\t\t// Get query vars\n\t\t$query_vars = array();\n\t\tif ( isset( $_GET['qv'] ) ) {\n\t\t\t$query_vars = $_GET['qv'];\n\t\t}\n\n\t\t// Merge query vars\n\t\t$query_vars = wp_parse_args( $query_vars, $default_query_arguments );\n\n\t\t// Set post type\n\t\t$query_vars['post_type'] = $post_type;\n\n\t\t// Get posts\n\t\t$posts = get_posts( $query_vars );\n\n\t\t// Post data to show - this will be manageble at some point\n\t\t$show_post_data_fields = array( 'ID', 'post_title', 'post_content', 'post_date' );\n\n\t\t// Post meta data to show - this will be manageble at some point\n\t\t$show_post_meta_data_fields = array( 'ssm_supermarkt', 'ssm_adres' );\n\n\t\t// Data array\n\t\t$return_data = array();\n\n\t\t// Loop through posts\n\t\tforeach ( $posts as $post ) {\n\n\t\t\t$post_custom = get_post_custom( $post->ID );\n\n\t\t\t$data = array();\n\n\t\t\t// Add regular post fields data array\n\t\t\tforeach ( $pt_options['fields'] as $show_post_data_field ) {\n\n\t\t\t\t$post_field_value = $post->$show_post_data_field;\n\n\t\t\t\t// Fetch thumbnail\n\t\t\t\tif ( 'thumbnail' == $show_post_data_field ) {\n\t\t\t\t\t$post_field_value = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );\n\t\t\t\t}\n\n\t\t\t\t// Set post field value\n\t\t\t\t$data[ $show_post_data_field ] = $post_field_value;\n\t\t\t}\n\n\t\t\t// Add post meta fields to data array\n\t\t\tforeach ( $pt_options['custom'] as $show_post_meta_data_field ) {\n\n\t\t\t\t$meta_field_value = get_post_meta( $post->ID, $show_post_meta_data_field, true );\n\n\t\t\t\tif ( $meta_field_value != '' ) {\n\t\t\t\t\t$data[ $show_post_meta_data_field ] = $meta_field_value;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$return_data[] = $data;\n\n\t\t}\n\n\t\tDABBA_API_Output::get()->output( $return_data );\n\t}", "public function getPosts()\n {\n }", "static function content_listing(){\n\n\t\tif(Indira::get('modules.sections.active') && Indira::get('modules.posts.active') || Indira::get('modules.blog.active')){\n\n\n\t\t\tif(Indira::get('modules.sections.active') && Indira::get('modules.posts.active')){\n\t\t\t\t\n\t\t\t\t$data[\"sections\"] \t= \tSections::where('lang', '=', Session::get('lang'))\n\t\t\t\t\t\t\t\t\t\t->order_by('order')\n\t\t\t\t\t\t\t\t\t\t->add('id', 'count', 'qty')\n\t\t\t\t\t\t\t\t\t\t->get();\n\n\t\t\t\t$data[\"posts\"] \t\t= \tPosts::where('lang', '=', Session::get('lang'))\n\t\t\t\t\t\t\t\t\t\t->and_where('published', '=', 'true')\n\t\t\t\t\t\t\t\t\t\t->and_where('access', '<=', Session::get('user.access'))\n\t\t\t\t\t\t\t\t\t\t->group('section', array('order', 'ASC'))\n\t\t\t\t\t\t\t\t\t\t->get();\n\t\t\t}\n\n\t\t\tif(Indira::get('modules.blog.active')){\n\n\t\t\t\t$data[\"blogs\"] \t\t= \tBlog::where('lang', '=', Session::get('lang'))\n\t\t\t\t\t\t\t\t\t\t->and_where('published', '=', 'true')\n\t\t\t\t\t\t\t\t\t\t->and_where('access', '<=', Session::get('user.access'))\n\t\t\t\t\t\t\t\t\t\t->order_by('order')\n\t\t\t\t\t\t\t\t\t\t->limit(0, 10)\n\t\t\t\t\t\t\t\t\t\t->get();\n\t\t\t}\n\n\t\t\tif(isset($data[\"sections\"]) && isset($data[\"posts\"]) && $data[\"sections\"] && $data[\"posts\"]){\n\n\t\t\t\t\n\t\t\t\t$data[\"posts_link\"] \t= \tIndira::get('modules.posts.link');\n\t\t\t\t$data[\"sections_link\"] \t= \tIndira::get('modules.sections.link');\n\t\t\t\t$data[\"page\"] \t\t\t= \t'templates::content_listing';\n\n\t\t\t}elseif(isset($data[\"blog\"]) && $data[\"blog\"]){\n\n\t\t\t\t$data[\"blog_link\"] \t\t= \tIndira::get('modules.blog.link');\n\t\t\t\t$data[\"page\"] \t\t\t= \t'templates::content_listing';\n\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$data[\"page\"] = 'templates::assets.no_content';\n\t\t\t}\n\n\t\t\t$data[\"images\"] = Media::get(array('id', 'formats'));\n\n\t\t\treturn (Request::ajax()) ? View::make($data[\"page\"], $data) : View::make('templates::main', $data);\n\n\t\t}else{\n\n\t\t\treturn void;\n\t\t}\n\t}", "function ct_get_posts ($params) {\n\n //Set default parameter values if null or invalid input\n if(!array_key_exists('count', $params) || !is_int($params['count'])) {\n $params['count'] = 3;\n }\n if(!array_key_exists('indent', $params) || !is_string($params['indent'])) {\n $params['indent'] = ' ';\n }\n if(!array_key_exists('author_can', $params) || !is_string($params['author_can'])) {\n $params['author_can'] = 'administrator';\n }\n if(!array_key_exists('current_user_can', $params) || !is_string($params['current_user_can'])) {\n $params['current_user_can'] = '';\n }\n if(!array_key_exists('show_admin_posts', $params) || !is_bool($params['show_admin_posts'])) {\n $params['show_admin_posts'] = true;\n }\n if(!array_key_exists('meta', $params) || !is_array($params['meta'])) {\n $params['meta'] = array(\n 'date' => true,\n 'comments' => true\n );\n } else {\n if(!array_key_exists('date', $params['meta']) || !is_bool($params['meta']['date'])) {\n $params['meta']['date'] = true;\n }\n if(!array_key_exists('comments', $params['meta']) || !is_bool($params['meta']['comments'])) {\n $params['meta']['comments'] = true;\n }\n }\n\n query_posts('post_type=post'); // Allows \"The Loop\" to work\n echo $params['indent'].\"<!--Posts-->\\n\".$params['indent'].\"<div class='posts'>\\n\";\n $counter = 0;\n if (have_posts()) {\n while ((have_posts()) && $counter < $params['count']) {\n the_post();\n if(\n (author_can(get_post(), $params['author_can']) || $params['author_can'] == \"\")\n &&\n (current_user_can($params['current_user_can']) || $params['current_user_can'] == \"\")\n &&\n ($params['show_admin_posts'] == true || author_can(get_post(), \"administrator\") == false)\n ) {\n echo $params['indent'].\" <div \";\n post_class();\n echo \" >\\n\";\n echo $params['indent'].\" <h1 class='posttitle'><a href='\".get_the_permalink().\"'>\".get_the_title().\"</a></h1>\\n\";\n echo $params['indent'].\" <div class='meta'>\\n\";\n if($params['meta']['date'] == true) {\n echo $params['indent'].\" <p class='date'>\".get_the_time('F jS, Y').\"</p>\\n\";\n }\n\tif($params['meta']['comments'] == true && author_can(get_post(), \"administrator\") == false) {\n echo $params['indent'].\" <p class='comments'>\".get_comments_number().\" Comments</p>\\n\";\n if(get_comments_number() > 0) {\n $lastCommentDate = get_comment_date(\"F jS, Y\", get_comments(get_post())[0]->comment_ID);\n $today = date_i18n(\"F jS, Y\");\n if($today == $lastCommentDate) {\n $lastCommentDate = \"at \".get_comment_date(\"h:i a\", get_comments(get_post())[0]->comment_ID);\n } else {\n $lastCommentDate = \"on \".$lastCommentDate;\n }\n echo $params['indent'].\" <p class='lastcomment'>Last comment posted \".$lastCommentDate.\"</p>\";\n }\n }\n echo $params['indent'].\" </div>\\n\".$params['indent'].\" \";\n the_content('');\n echo $params['indent'].\" </div>\\n\";\n $counter++;\n }\n }\n }\n echo $params['indent'].\"</div><!--end posts-->\";\n}", "public function listAction()\n {\n $limit = isset($_GET['limit']) ? (int)$_GET['limit'] : PostDB::LIMIT;\n $offset = isset($_GET['offset']) ? (int)$_GET['offset'] : 0;\n\n return $this->render([\n 'posts' => $this->model->fetchList($limit, $offset),\n 'limit' => $limit,\n 'offset' => $offset,\n 'totalPosts' => $this->model->count(),\n 'alert' => $this->getAlerts(['post_created', 'post_deleted', 'post_updated'])\n ]);\n }", "public function listPosts()\n {\n $postManager = new PostManager(); // create a new object\n $posts = $postManager->getPosts(); // function call o this object\n return $this->render('post/listPosts.html.twig', array(\n 'posts' => $posts,\n ));\n\n }", "public function archive()\n\t{\n\t\tif(\\Module::isDisabled('Blog')) {\n\t\t\treturn null;\n\t\t}\n\n\t\t\\Module::load('Blog');\n\t\t$title = $this->get('title', 'Archives');\n\t\t$limit = $this->get('limit', 5);\n\t\t$data = array();\n\n\t\t$data['title'] = $this->get('title', 'Blog Archives');\n\t\t$data['list'] = array();\n\n\t\treturn $this->show($data, 'archive');\n\t}", "public function getPostList();", "public function get_all_pages() {\r\n\t\tMainWP_Child_Posts::get_instance()->get_all_pages();\r\n\t}", "public function archives()\n {\n if(Auth::check())\n {\n $articles = Article::where('article_uid', Auth::id())->orderBy('updated_at', 'desc')->paginate(15);\n return $this->base($articles);\n }\n }", "public function displayPostsWithPaginationHome($data, $elPerPage, $categoryFilter)\n {\n if (isset($categoryFilter) && $categoryFilter != \"\") {\n $data = categoryFilter($data, $categoryFilter);\n }\n \n if (!isset($_GET[\"page\"])) {\n $_GET[\"page\"] = 1;\n }\n \n $numarElemente = count($data);\n $_SESSION[\"totalNumberOfPosts\"] = $numarElemente;\n $pagini = 0;\n $elementPerPage = $elPerPage;\n $currentPage = $_GET[\"page\"]; //pag 1\n $nextPage = 0;\n \n $pagini = numaraPagini($numarElemente, $elementPerPage);\n \n if (isset($_GET[\"page\"])) {\n $nextPage = $_GET[\"page\"] + 1;\n }\n \n if (isset($_GET[\"page\"])) {\n $previousPage = $_GET[\"page\"] - 1;\n }\n \n for ($p = 1; $p <= $pagini; $p++) {\n if ($currentPage == $p) {\n $startAfisare = ($p-1) * $elementPerPage;\n $endAfisare =$startAfisare + $elementPerPage;\n \n while ($startAfisare < $endAfisare) {\n if (isset($data[$startAfisare])) {\n $post = $data[$startAfisare];\n $postDateTime = $post[\"data\"];\n \n echo \"<div class=\\\"postDisplay\\\">\";\n echo \"<h3>\".\"&emsp;<a class=\\\"titlePost\\\" href=\\\"post.php?viewPost=\".$post[\"id\"].\"\\\">\".$post[\"title\"].\"</a></h3>\";\n echo \"<hr>\";\n \n echo '<p class=\"showContent\">'.$post['content'].'</p>';\n echo \"<hr>\";\n echo \"Posted \".displayWithoutZeroDates(getHowMuchTimePassed($postDateTime)).\" ago</br>\";\n // echo \"</br>\";\n echo \"<hr>\";\n \n echo \"<div>Post by \".getUserData($post[\"id_user\"], \"username\").\"</div>\";\n echo \"<div>Category: \".$post[\"category\"].\"</div>\";\n \n echo \"</div>\";\n }\n \n $startAfisare += 1;\n }\n }\n }\n echo \"</br>\"; ?>\n <div style=\"width: 100%; text-align: center;\"><?php echo $currentPage.\" / \".$pagini ?></div>\n <?php\n echo \"</br>\";\n echo \"<div class=\\\"paginationNavBar\\\">\";\n $firstPage = 1;\n \n if ($currentPage == $pagini && $elementPerPage < $numarElemente) {\n echo \"<a href=\\\"home_place.php?filter=\".$categoryFilter.\"&page=\".$firstPage.\"\\\">first-Page</a> | \";\n }\n \n if ($currentPage > 1) {\n echo \"<a href=\\\"home_place.php?filter=\".$categoryFilter.\"&page=\".$previousPage.\"\\\">previous-Page</a>\";\n echo \" | \";\n }\n \n if ($currentPage < $pagini) {\n echo \"<a href=\\\"home_place.php?filter=\".$categoryFilter.\"&page=\".$nextPage.\"\\\">next-Page</a>\";\n }\n \n if ($currentPage != $pagini) {\n echo \" | <a href=\\\"home_place.php?filter=\".$categoryFilter.\"&page=\".$pagini.\"\\\">last-page</a>\";\n }\n echo \"</div>\";\n }", "public function composer_display_all_posts() {\n \n // Get page's input\n $page = $this->CI->input->get('page', TRUE);\n \n // Get search's key input\n $search = $this->CI->input->get('key', TRUE); \n \n $limit = 10;\n \n $page--;\n \n // Get total posts\n $total = $this->CI->posts_model->get_posts($this->CI->user_id, '', '', $search);\n \n // Get posts by page\n $get_posts = $this->CI->posts_model->get_posts($this->CI->user_id, ($page * $limit), $limit, $search);\n \n // Verify if posts exists\n if ( $get_posts ) {\n \n $data = array(\n 'success' => TRUE,\n 'total' => $total,\n 'date' => time(),\n 'page' => ($page + 1),\n 'posts' => $get_posts,\n 'details' => $this->CI->lang->line('details')\n );\n\n echo json_encode($data);\n \n } else {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('no_posts_found')\n );\n\n echo json_encode($data); \n \n }\n \n }", "public function fetchPublishedPages()\n {\n $results = $this->fetchAllAsArray(\n array(\n 'where' => array(\n 'status = ? AND content_type = ?' => array(1, 2)\n ),\n 'order' => array (\n 'id DESC'\n ),\n 'paging' => $this->posts_per_page,\n 'page' => 1,\n 'eager' => array(\n 'comments' => array(\n 'eager' => array(\n 'commentinfo'\n )\n ),\n 'tags',\n 'postinfo',\n 'users',\n ),\n )\n );\n Foresmo::dateFilter($results);\n Foresmo::sanitize($results);\n return $results;\n }", "function _hs_print_archives( $args = [] )\n{\n\t$defaults = [\n\t\t'type' => 'monthly',\n\t\t'limit' => 6, // last six months\n\t\t'format' => 'html', \n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'show_post_count' => false,\n\t\t'echo' => 1,\n\t\t'order' => 'DESC',\n\t\t'classlist' => 'archives'\n\t];\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t?><ul class=\"<?= $args[classlist] ?>\"><?php\n\twp_get_archives( $args );\n\t?></ul><?php\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns album manager service
private function getAlbumManager() { return $this->getModuleService('albumManager'); }
[ "public static function buildAlbumService() {\n\t\t$albumService = new AlbumService(self::$apiKey, self::$secretKey);\n\t\treturn $albumService;\n\n\t}", "public function getApiAlbum()\n {\n $factory = new ApiNodeFactory($this);\n\n return $factory->makeApiAlbum();\n }", "private function getAlbumDao() {\n \n if ($this->_albumDao == null) {\n $this->_albumDao = $this->_serviceLocator->get('\\Album\\Dao\\AlbumDao');\n }\n \n return $this->_albumDao;\n }", "public static function getService() {\r\n Embpicamoto_include_library();\r\n require_once 'Zend/Loader.php';\r\n \r\n Zend_Loader::loadClass('Zend_Gdata_ClientLogin');\r\n Zend_Loader::loadClass('Zend_Gdata_Photos');\r\n \r\n $gauth = Embpicamoto_Oauth_Google_Manager::singleton();\r\n\r\n $client = null; #Should cause an interesting exception if neither works\r\n if ($gauth->has_access_token()) { \r\n $client = $gauth->getAccessToken()->getHttpClient($gauth->getConfig());\r\n } else {\r\n \r\n $login_val = Embpicamoto_Settings_Helper::getLogin();\r\n $pass_val = Embpicamoto_Settings_Helper::getPassword();\r\n $client = Zend_Gdata_ClientLogin::getHttpClient($login_val, $pass_val, Zend_Gdata_Photos::AUTH_SERVICE_NAME);\r\n }\r\n\r\n $service = new Zend_Gdata_Photos($client);\r\n\r\n return $service;\r\n }", "public function getAlbum() {\r\n\treturn $this->album;\r\n }", "public function getAlbum()\n {\n return $this->album;\n }", "protected function getSonata_Media_Manager_GalleryService()\n {\n return $this->services['sonata.media.manager.gallery'] = new \\Sonata\\MediaBundle\\Entity\\GalleryManager('Application\\\\Sonata\\\\MediaBundle\\\\Entity\\\\Gallery', $this->get('doctrine'));\n }", "public function getAlbum()\n {\n return $this->_album;\n }", "public function getAlbum() {\n return $this->album;\n }", "protected function getSonata_Media_Manager_GalleryService()\n {\n return $this->services['sonata.media.manager.gallery'] = new \\Sonata\\MediaBundle\\Entity\\GalleryManager('AppBundle\\\\Entity\\\\Media\\\\Gallery', ${($_ = isset($this->services['doctrine']) ? $this->services['doctrine'] : $this->get('doctrine')) && false ?: '_'});\n }", "public function getAlbums();", "public function getAlbum()\n {\n return $this->album;\n }", "public function getAlbum() {\n return db_select('cfas_albums', 'cfas')\n ->fields('cfas', array('album_url', 'created', 'images'))\n ->condition('album_url', $this->album_url)\n ->condition('created', time() - $this->time_limit, '>')\n ->execute()\n ->fetchAssoc();\n }", "public function album()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" album ?\");\n\t}", "public function getGalleryService()\n {\n if (null === $this->galleryService)\n $this->galleryService = $this->getService('gallery');\n return $this->galleryService;\n }", "function album(){\n\n\trequire('config_freamwork.php');\n\t\n\t$json = '{\"jsonrpc\": \"2.0\", \"method\": \"AudioLibrary.GetAlbums\", \"params\": { \"limits\": { \"start\": 0 }, \"fields\": [\"description\", \"theme\", \"mood\", \"style\", \"type\", \"label\", \"artist\", \"genre\", \"rating\", \"title\", \"year\", \"thumbnail\" , \"fanart\"], \"sort\": { \"method\": \"artist\" } }, \"id\": 1}';\n\t\n\t$chiamata = curl_init();\n\tcurl_setopt($chiamata, CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($chiamata, CURLOPT_POST ,1);\n\tcurl_setopt($chiamata, CURLOPT_URL ,$hostjsonrpc);\n\tcurl_setopt($chiamata, CURLOPT_USERPWD ,\"$username:$password\");\n\tcurl_setopt($chiamata, CURLOPT_POSTFIELDS ,$json);\n\t$json = curl_exec($chiamata);\n\tcurl_close($chiamata);\t\n\treturn $json;\n\t\n\t// id = albums\n\t\n}", "private function getManager()\n {\n return self::getDocker();\n }", "protected function getAvatar_ManagerService()\n {\n return $this->services['avatar.manager'] = new \\phpbb\\avatar\\manager($this->get('config'), $this->get('dispatcher'), $this->get('avatar.driver_collection'));\n }", "public function getAlbum() {\n $this->analyze();\n $artist = $this->getMainArtist();\n\n $albumName = $this->fileInfo[\"tags\"][\"id3v1\"][\"album\"];\n if (is_array($albumName)) {\n $albumName = $albumName[0];\n }\n if ($albumName === \"\" || $albumName === null) {\n return null;\n }\n return AlbumManager::getAlbumByNameAndArtist($albumName, $artist);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tokenize string and return getted parameters
public function tokenize() { $parameters = array(); $parameterName = ''; while($this->next()) { if($this->isWhiteSpace()) { continue; } else if($this->char()!='=') { $parameterName .= $this->char(); } else { $parameters[$parameterName] = $this->getValue(); $parameterName = ''; } } return $parameters; }
[ "private function tokenize($string)\n {\n $params = array();\n\n // tokenize the first set\n $param = strtok($string, '-');\n\n // loopedyloop\n while ($param !== false) {\n if (strlen($param) > 1) {\n // The name of each parameter should be the first\n // character of the parameter string and the value of\n // each parameter should be the remaining characters\n // of the parameter string\n $params[$param[0]] = substr($param, 1);\n }\n\n $param = strtok('-');\n }\n\n return $params;\n }", "public function tokenize($string);", "public function getArgumentsTokens();", "function splitGetParametersString($getString){\n\t$VARS=array();\n\t$pr = explode(\"&\",$getString);\n\tforeach ($pr as &$kv){## Get key-value pairs (get_parameter=value)\n\t\t$kvp = explode(\"=\",$kv);\n\t\tif(count($kvp)==2)## Check if no error occured while parsing - expecting 2 entries.\n\t\t\t$VARS[$kvp[0]]=$kvp[1];\n\t}\n\treturn $VARS;\n}", "public function tokenize($str);", "public function extractParameterDefinitions($string);", "public function tokenize($value);", "public function tokenize(string $string);", "function matchmysound_split_custom_parameters($customstr) {\n $lines = preg_split(\"/[\\n;]/\", $customstr);\n $retval = array();\n foreach ($lines as $line) {\n $pos = strpos($line, \"=\");\n if ( $pos === false || $pos < 1 ) {\n continue;\n }\n $key = trim(core_text::substr($line, 0, $pos));\n $val = trim(core_text::substr($line, $pos+1, strlen($line)));\n $key = matchmysound_map_keyname($key);\n $retval['custom_'.$key] = $val;\n }\n return $retval;\n}", "public static function getParameters($str) {\n\t\tif($str) {\n\t\t # result array\n\t\t $arr = array();\n\n\t\t # split on outer delimiter\n\t\t $pairs = explode(';', $str);\n\n\t\t # loop through each pair\n\t\t foreach ($pairs as $i) {\n\t\t # split into name and value\n\t\t list($name,$value) = explode('=', $i, 2);\n\n\t\t # if name already exists\n\t\t if( isset($arr[$name]) ) {\n\t\t # stick multiple values into an array\n\t\t if( is_array($arr[$name]) ) {\n\t\t $arr[$name][] = $value;\n\t\t }\n\t\t else {\n\t\t $arr[$name] = array($arr[$name], $value);\n\t\t }\n\t\t }\n\t\t # otherwise, simply stick it in a scalar\n\t\t else {\n\t\t $arr[$name] = $value;\n\t\t }\n\t\t }\n\n\t\t # return result array\n\t\t return $arr;\n\t\t}\n\t\treturn [];\n\t}", "function parsePermitString($permit_str){\n $permits = explode('&', $permit_str);\n $permit_arr = array();\n foreach ($permits as $permit){\n $permit_obj = array();\n // Extract permit parameters\n $permit_param_str = array();\n preg_match('/(.*?)\\((.*?)\\)/', $permit, $permit_param_str);\n if ($permit_param_str[1]){\n $permit_obj['name'] = $permit_param_str[1];\n // Add parameters\n if ($permit_param_str[2] && $permit_params = explode(',', $permit_param_str[2])){\n $permit_obj['parameters'] = $permit_params;\n } else {\n $permit_obj['parameters'] = array();\n }\n $permit_arr[] = $permit_obj;\n } \n }\n return $permit_arr;\n}", "public function extractParameters(string $text): array {\n if(!str_starts_with($text, \"/\") || !str_contains($text, \" \")) {\n return [];\n }\n $params = explode(\" \", $text);\n unset($params[0]);\n return $params;\n }", "function parse($str) {\n\t\tpreg_match_all('/(\\w+)\\h*=\\h*(.+?)(?=,|$)/',\n\t\t\t$str,$pairs,PREG_SET_ORDER);\n\t\tforeach ($pairs as $pair)\n\t\t\t$this->hive['PARAMS'][$pair[1]]=trim($pair[2]);\n\t}", "private function extractTagParams($paramString)\n\t{\n\t\t$paramList = explode('|', $paramString);\n\t\t$params = array();\n\t\t\n\t\t$i = 0;\n\t\tforeach ($paramList as $paramElement)\n\t\t{\n\t\t\t$param = preg_split('/!?=/', $paramElement);\n\t\t\tswitch (count($param))\n\t\t\t{\n\t\t\t\tcase 1:\n $params[trim($param[0])] = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$params[trim($param[0])] = $param[1];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\treturn $params;\n\t}", "function _parseParameterString($paramString) {\n $elements = preg_split(\"/&/\",$paramString);\n\t\t\t$result=[];\n\n\t\t\tforeach($elements as $element)\n {\n $keyToken=preg_split(\"/=/\",$element);\n $value='';\n if ($keyToken[1]) {\n $value=urldecode ($keyToken[1]);\n\t\t\t\t}\n if($result[$keyToken[0]]){\n if (!is_array($result[$keyToken[0]]))\n {\n $result[$keyToken[0]] = array( $result[$keyToken[0]], $value);\n }\n else\n {\n array_push( $result[$keyToken[0]], $value);\n }\n }\n else\n {\n $result[$keyToken[0]]= $value;\n }\n }\n return $result;\n }", "function parse_string_to_array($str)\n{\n\tpreg_match_all('#(\\w+)=([\\'\"])(.*)\\\\2#U', $str, $matches);\n\t$params = array();\n\tforeach($matches[1] as $key => $val)\n\t{\n\t\tif (!empty($matches[3]))\n\t\t{\n\t\t\t$params[$val] = $matches[3][$key];\n\t\t}\n\t}\n\treturn $params;\n\t\n}", "private static function splitParams($paramStr)\n {\n $depth = 0;\n $startPos = 0;\n $chars = \\str_split($paramStr);\n $params = array();\n foreach ($chars as $pos => $char) {\n switch ($char) {\n case ',':\n if ($depth === 0) {\n $params[] = \\trim(\\substr($paramStr, $startPos, $pos-$startPos));\n $startPos = $pos + 1;\n }\n break;\n case '[':\n case '(':\n $depth ++;\n break;\n case ']':\n case ')':\n $depth --;\n break;\n }\n }\n $params[] = \\trim(\\substr($paramStr, $startPos, $pos+1-$startPos));\n return $params;\n }", "protected function extractParametersFromParsedStr($params)\n\t{\n\t\t$params = ltrim($params);\n\n\t\t$params = str_replace('data-devise-<?php echo devise_tag_cid(', '', $params);\n\n\t\t$params = substr($params, 1);\n\n\t\t$params = substr($params, 0, -4);\n\n\t\t$params = str_getcsv($params);\n\n\t\tarray_walk($params, function(&$value) { $value = ltrim(rtrim($value)); });\n\n\t\t$this->id = $this->stripquotes($params[0]);\n\n\t\t$this->bindingType = $this->stripquotes($params[1]);\n\n\t\t$this->collection = $this->stripquotes($params[2]);\n\n\t\t$this->key = $this->stripquotes($params[3]);\n\n\t\t$this->type = $this->stripquotes($params[4]);\n\n\t\t$this->humanName = $this->stripquotes($params[5]);\n\n\t\t$this->collectionName = $this->stripquotes($params[6]);\n\n\t\t$this->group = $this->stripquotes($params[7]);\n\n\t\t$this->category = $this->stripquotes($params[8]);\n\n\t\t$this->alternateTarget = $this->stripquotes($params[9]);\n\n\t\t$this->defaults = $this->stripquotes($params[10]);\n\t}", "function Tokenise($string)\r\n{\r\n\t$array = array();\r\n\t$element = strtok($string,',');\r\n\twhile($element)\r\n\t{\r\n\t\tarray_push($array,$element);\r\n\t\t$element = strtok(',');\r\n\t}\r\n\t\r\n\treturn $array;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funtion to load entity
public function load($id) { $this->entity = $this->entity->find($id); }
[ "public function postLoad($entity);", "public function load(IKL_Domain_Abstract $entity)\n {\n \n }", "protected function loadRelated($entity)\n {\n }", "public function getRawEntityLoader();", "protected function onSingleEntityLoad($entity)\n {\n }", "public function getEntityById($id);", "public function load() : Persistable;", "function load($id='')\n\t{\n\t\tglobal $bdd,$path,$path_w,$base_url;\n\t\tif($id!='')\n\t\t{\n\t\t\t$req='select * from '.$this->table.' where '.$this->id_field.'=\"'.$id.'\"';//\n\t\t\t$res=$bdd->query2($req);\n\t\t\tif($res!=false)\n\t\t\t{\n\t\t\t\t$res=$res->fetch();\n\t\t\t\tif($res!=false)\n\t\t\t\t{\n\t\t\t\t\tforeach($res as $k=>$r)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($this->mapped[$k]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->mapped[$k]=$r;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(trace_mod()==true)\n\t\t\t\t\t{\n\t\t\t\t\t\tadd_trace('entity load;'.$id.';'.time());\n\t\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\treport_erreur2('1001',__FILE__,__LINE__,'entity_load, no matching id in '.$this->table.' for '.$id);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treport_erreur2('1002',__FILE__,__LINE__,'entity_load, failed request '.$this->table.' '.$this->get($this->id_field));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treport_erreur2('3001',__FILE__,__LINE__,'entity_load No id provided');\n\t\t\treturn false;\n\t\t}\n\t}", "function release_load($id) {\n return entity_load_single('release', $id);\n}", "public function fetchEntityById($id);", "abstract public function getEntity();", "public function load($id) {\n\t\t$this->logger->debug('[EntityManager]Loading Entity with id '.$id);\n\t\treturn $this->getRepository()\n\t\t->find($id);\n\t}", "function remote_entity_load($entity_type, $id) {\n $query = $this->getRemoteEntityQuery('select');\n $query->base($entity_type);\n $query->entityCondition('entity_id', $id);\n $result = $query->execute();\n //dsm($result, 'remote_entity_load $result');\n\n // There's only one. Same pattern as entity_load_single().\n return reset($result);\n }", "abstract protected function loadEntityMetadata($entityName);", "abstract public function loadFromDb();", "public function loadById(array $identifier, $entity = null);", "public function getEntity($name);", "public function loadEntity($entityName, array $row)\n {\n // Following is a rewriting of a paragraph from Martin Fowler's book\n // [PoEAA, p. 172]:\n // \"The Identity Map is checked twice, once in the Persister#retrieve\n // function, and once here. There is a reason for this madness. I need\n // to check the map in the finder because, if the object is already\n // there, I can save myself a trip to database. But I also need to check\n // here because I may have queries that I cant't be sure or resolving in\n // the Identity Map.\"\n $gateway = $this->getTableGateway($entityName);\n $pk = $gateway->extractPrimaryKey($row);\n $entity = $this->loaded($entityName, $pk);\n if ($entity) {\n return $entity;\n }\n\n $entity = $gateway->newInstance();\n // We put the domain object into the map very early (it is still empty\n // at this stage) to avoid infinite loop with cyclic references.\n $this->loadedMap->put($entity, $pk);\n $gateway->loadEntity($entity, $row);\n // For this reason, the original state of this object is also empty.\n // Therefore, we need to commit changes that occured in loadEntity.\n $this->loadedMap->commit($entity);\n\n return $entity;\n }", "abstract protected function loadFIeldMetadata($entityName);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setblockcount for node status Timed task
public function SetBlockCount() { header("Access-Control-Allow-Origin:*"); header("Access-Control-Allow-Methods:GET,POST"); $curlOperate = new CurlOperate(); $redis = new RedisOperate(); $response = $curlOperate->GetBlockCount(); $blockCount = json_decode($response,1); if(array_key_exists('msg',$blockCount)){ return json_encode(array('error'=>1,'msg'=>$blockCount['msg'])); } //blockheight $blockInt = $blockCount['result']; $blockHash = $curlOperate->GetBlockHash($blockInt); $blockHashArray = json_decode($blockHash, 1); if (array_key_exists('msg', $blockHashArray)) { return json_encode(array('error' => 1, 'msg' => $blockHashArray['msg'])); } $blcokHash = $blockHashArray['result']; $blockInfo = $curlOperate->GetBlock($blcokHash); $blockInfoArray = json_decode($blockInfo, 1); if (array_key_exists('msg', $blockInfoArray)) { return json_encode(array('error' => 1, 'msg' => $blockInfoArray['msg'])); } $blockInfo = $blockInfoArray['result']; $tx = $blockInfo['tx'][0]; $txs = $curlOperate->GetTransactionNew($tx); $txArray = json_decode($txs, 1); if (array_key_exists('msg', $txArray)) { return json_encode(array('error' => 1, 'msg' => $txArray['msg'])); } $nodeDelegates = $txArray['result']['vout'][1]; if(array_key_exists('type', $nodeDelegates) && $nodeDelegates['type'] == 'CoinbaseDelegateInfo'){ $redis->RedisSet('blockcount2',$blockInt); $redis->RedisDel('nodedelegetsnew'); } }
[ "public function setTasksCount()\n {\n $this->tasksCount = $this->sourceTables->count() + $this->import->countImportTasks();\n $this->bar = $this->output->createProgressBar($this->tasksCount);\n }", "public function setTasksCount($count)\n {\n $this->_tasksCount = (int) $count;\n }", "public function setRemainingBlockCount(?int $value): void {\n $this->getBackingStore()->set('remainingBlockCount', $value);\n }", "public function getNewTasksCount() : int;", "function hook_hosting_task_guarded_nodes_alter(&$nids) {}", "public function test_set_etl_task_blocked() {\n global $DB;\n\n $now = time();\n\n $etlobj = new etl_user_activity;\n\n $etlobj->set_etl_task_blocked($now);\n $blocked = $DB->get_field('elis_scheduled_tasks', 'blocked', array('plugin' => 'eliscoreplugins_user_activity'));\n $this->assertEquals($blocked, $now);\n\n $etlobj->set_etl_task_blocked(0);\n $blocked = $DB->get_field('elis_scheduled_tasks', 'blocked', array('plugin' => 'eliscoreplugins_user_activity'));\n $this->assertEquals($blocked, 0);\n }", "private function _set_state() {\r\n if ($this->_parsed_task->done === true) {\r\n $state = MAX_ACTION + 1;\r\n } elseif ($this->_parsed_task->action <= MAX_ACTION) {\r\n $state = $this->_parsed_task->action;\r\n } else {\r\n $state = 0;\r\n }\r\n // update cache directly\r\n $this->_content->task_state[$this->_key] = $state;\r\n }", "public function setTotalUnprocessedTasksCount(?int $value): void {\n $this->getBackingStore()->set('totalUnprocessedTasksCount', $value);\n }", "public function resetBlockCounter()\n {\n $blockCounter = $this->getBlockCounter();\n if ($blockCounter > 0) {\n \\Yii::$app->getCache()->delete($this->getBlockCounterKey());\n }\n }", "public function setTasksAssignedCount($count)\n {\n $this->_tasksAssignedCount = (int) $count;\n }", "function setSyncItemsAvailabilityCount()\n {\n }", "public function createBlockStatus(Block $block, int $newStatus): Block;", "abstract protected function _blockStart();", "public function getBlockCount();", "private function setThreadData() {\n\t\t$this->maxThreadNoType = $this->maxThread - array_sum ( $this->maxThreadType );\n\t\tif ($this->maxThreadNoType < 0) {\n\t\t\t$this->maxThreadNoType = 0;\n\t\t}\n\t\t// unset none exitst type num\n\t\tforeach ( $this->info ['all'] ['taskRunningNumType'] as $k => $v ) {\n\t\t\tif ($v == 0 && ! array_key_exists ( $k, $this->maxThreadType )) {\n\t\t\t\tprint_r ( $this->maxThreadType );\n\t\t\t\texit ();\n\t\t\t\tunset ( $this->info ['all'] ['taskRunningNumType'] [$k] );\n\t\t\t}\n\t\t}\n\t\t// init type num\n\t\tforeach ( $this->maxThreadType as $k => $v ) {\n\t\t\tif ($v == 0) {\n\t\t\t\tuser_error ( 'maxThreadType[' . $k . '] is 0, task of this type will never be added!', E_USER_WARNING );\n\t\t\t}\n\t\t\tif (! array_key_exists ( $k, $this->info ['all'] ['taskRunningNumType'] )) {\n\t\t\t\t$this->info ['all'] ['taskRunningNumType'] [$k] = 0;\n\t\t\t}\n\t\t}\n\t}", "public function setPinPreviousBlockCount(?int $value): void {\n $this->getBackingStore()->set('pinPreviousBlockCount', $value);\n }", "public function setPreviousPinBlockCount(?int $value): void {\n $this->getBackingStore()->set('previousPinBlockCount', $value);\n }", "protected function incrementTasksCount()\n {\n return Octane::table('octane_exporter_tasks')->incr('tasks', 'total_count');\n }", "function add_to_waiting_queue($nodeId)\n{\n\n\treturn 1;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the user_id from a given email.
function user_id_from_email($email) { $email = sanitize($email); return mysqli_fetch_array(mysqli_query(connection(), "select User_Id from users where email = '$email'")); }
[ "function getUserIDFromEmail($email){\n $user = getUserFromEmail($email);\n return $user['userID'];\n }", "function authSupportGetUserIdFromEmail($email)\n {\n }", "private function getUserId($email) {\n\t\t\n\t\t\t// Get a reference to the database\n\t\t\t$db = JFactory::getDbo();\n\t\t\t\n\t\t\t// Query the database\n\t\t\t$query = $db->getQuery(true); \n\t\t\t$query->select('id')\n\t\t\t\t->from('#__users ')\n\t\t\t\t->where('email = ' . \"'\". $email . \"'\" ); \n\t\t\t$db->setQuery($query); \n\t\t\t\n\t\t\t// If the query was not successful\n\t\t\tif (!$db->query()) {\n\t\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\t\treturn -1;\n\t\t\t} \n\t\t\t\n\t\t\t// Get the result and return the userId\n\t\t\t$rows = $db->loadObjectList(); \n\t\t\t$userId = $rows[0]->id;\n\t\t\t\n\t\t\treturn $userId;\n\t\t}", "function getUserId($email) {\n $stmt = $this->conn->prepare(\"select id from users where agentId=3134 and email like :email and type = 1\");\n $stmt->bindValue('email', $email);\n $stmt->execute();\n\n $row = $stmt->fetch(\\PDO::FETCH_ASSOC);\n if (isset($row['id'])) {\n return intval($row['id']);\n }\n\n return 0;\n }", "function get_user_id( $email )\n{\n $db = new Database_handler();\n $command = 'SELECT id FROM t_users WHERE email = \"'.$email.'\"';\n $results = $db->query_table( $command );\n\n return $results[0]['id'];\n}", "public function getIdEmailByEmail($email){\n $row = $this->db->run(\"SELECT id, username, email FROM users WHERE email=? LIMIT 1\", [$email])->fetch();\n return $row;\n }", "protected function userIDEmail ($email)\n {\n \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('email'=>$email),\n )\n ));\n if(!empty($user))\n {\n $id=0;\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n }\n return $id; \n } \n }", "public function findId($email_address) {\n\t\t$id = $this->find ( 'first', array (\n\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t'email' => $email_address \n\t\t\t\t),\n\t\t\t\t'fields' => array (\n\t\t\t\t\t\t'id' \n\t\t\t\t) \n\t\t) );\n\t\tif (isset ( $id ['InvitedUser'] )) {\n\t\t\treturn $id ['InvitedUser'] ['id'];\n\t\t}\n\t}", "function get_user_id_from_string($email_or_login)\n {\n }", "public function identityIdByEmail(\n string $email\n );", "function find_user_id($email){\n\t\t$pdo = PDO2::getInstance();\n\t\t\n\t\t$query = $pdo->prepare(\"SELECT user_id FROM tbl_user WHERE user_mail = :email_addr \");\n\t\t\n\t\t$query->bindValue(':email_addr',$email);\n\t\t\n\t\t$query->execute();\n\t\t\n\t\tif ($result = $query->fetch(PDO::FETCH_ASSOC)) {\n\t\t\n\t\t\t$query->closeCursor();\n\t\t\treturn $result['user_id'];\n\t\t}\n\t\t\treturn false;\n\t}", "function get_user_id($email){\n\t$data = fetch_single('user','id','email',$email);\n\tif($data){\n\t\treturn $data;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "public static function getIdByEmail($email)\n\t{\n\t\treturn (int) FrontendModel::getDB()->getVar('SELECT p.id FROM profiles AS p WHERE p.email = ?', (string) $email);\n\t}", "public function getUID(string $email):int;", "protected function selectOnIdUser_m($email){\n $sql = \"SELECT `id` FROM `tbl_user` WHERE `email`=:email\";\n $result = $this->pdo->prepare($sql);\n $result->bindParam(\":email\", $email);\n $result->execute();\n return $result->fetch(PDO::FETCH_ASSOC);\n }", "public function findUserByEmailId($email);", "function get_id_from_email($email) {\r\n // a partir do email\r\n global $xoopsDB;\r\n $sql='select * from '.$xoopsDB->prefix('xmail_newsletter'). \" where user_email='$email'\";\r\n $result=$xoopsDB->queryf($sql);\r\n\r\n if($result) {\r\n $cat_data = $xoopsDB->fetcharray($result);\r\n return $cat_data['user_id'] ;\r\n }\r\n else {\r\n echo 'erro na query ',$sql;\r\n return 0;\r\n }\r\n }", "function email_to_id($user)\n\t{\n\t\treturn select(self::$table)->where('user_email = \"'.$user.'\"')->limit(1)->result('user_id');\t\t\n\t}", "public function getEmpIdByEmail($email){\n\t\t\t$stmt = $this->con->prepare(\"SELECT id FROM employees WHERE email = ?\");\n\t\t\t$stmt->bind_param(\"s\", $email);\n\t\t\t$stmt->execute();\n\t\t\treturn $stmt->get_result()->fetch_assoc();\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests whether the essential `leave_review` service is returned correctly.
public function testLeaveReviewService() { $container = wprss_wp_container(); $subject = $container->get(sprintf('%1$sleave_review', \WPRSS_SERVICE_ID_PREFIX)); $this->assertTrue($subject instanceof \Aventura\Wprss\Core\Plugin\ComponentInterface, 'Not a valid component'); $this->assertTrue($subject instanceof \Aventura\Wprss\Core\Component\LeaveReviewNotification, 'Not the right component'); }
[ "public static function is_leave(){\n $userid = \\Fuel\\Core\\Session::get(\"username\");\n // the date today\n // to be check against the leave db\n // if user is on leave\n $today = strftime(\"%Y-%m-%d\", time());\n\n // get last number of the string\n $str = explode(\"-\", $today);\n\n $last_no = $str[count($str) - 1];\n $last_no++;\n\n $end_of_the_day = $str[0] . \"-\" . $str[1] . \"-\" . $last_no;\n\n // find out if user is still on leave\n $result = self::find('all', array(\n \"where\" => array(\n array(\"userid\", \"=\", $userid),\n array('start_leave', '>=', $today.\" 00:00:00\"),\n array('end_leave', \"<\", $end_of_the_day),\n array('status', '=', 'approved')\n )\n )\n );\n\n // return result\n return count($result) > 0 ? $result : false;\n }", "public function testReadLeave() {\n\n //\n // Unavailable leave id\n //\n Doctrine_Query::create()\n\t\t->delete('*')\n\t\t->from('Leave l')\n\t\t->where('id = 999');\n\n $leave = $this->leaveRequestDao->readLeave(999);\n\n $this->assertFalse($leave, 'should return false for unavailable leave id');\n\n //\n // Available leave id\n //\n $leaveFixture = $this->fixture['Leave'][1];\n\n $savedLeave = $this->leaveRequestDao->readLeave($leaveFixture['id']);\n\n // Compare leave id\n $this->assertEquals($savedLeave->id, $leaveFixture['id'], 'leave id should match');\n \n // Compare other properties\n foreach ($leaveFixture as $property => $value) {\n $this->assertEquals($savedLeave->$property, $value, $property . ' should match ');\n }\n }", "public function leaveReviewAction(string $token) : string\n {\n $bookingService = $this->getModuleService('bookingService');\n $booking = $bookingService->findByToken($token);\n\n if ($booking) {\n $hotelId = $booking['hotel_id'];\n $allowed = boolval($booking['can_leave_review']); // Whether posted review before?\n\n $reviewService = $this->getModuleService('reviewService');\n\n // Add \n if ($this->request->isPost()) {\n $input = $this->request->getPost();\n\n // Append the review\n $reviewService->add($this->getCurrentLangId(), $hotelId, $input);\n\n // Update NULL with just added review ID\n $bookingService->updateReviewId($booking['id'], $reviewService->getLastId());\n\n // Notify about new feedback\n $email = $this->getModuleService('hotelService')->findEmailById($hotelId);\n $this->feedbackNewNotify($email);\n\n $this->flashBag->set('success', 'Your review has been added successfully');\n $this->response->refresh();\n }\n\n $hotel = $this->getModuleService('hotelService')->fetchById($hotelId, $this->getCurrentLangId());\n $rates = $reviewService->fetchAverages($hotelId, $this->getCurrentLangId());\n $reviews= $reviewService->fetchAll($hotelId);\n $items = $this->createMapper('\\Site\\Storage\\MySQL\\ReviewTypeMapper')->fetchAll($this->getCurrentLangId());\n\n return $this->view->render('feedback', [\n 'reviewTypes' => $items,\n 'rates' => $rates,\n 'hotel' => $hotel,\n 'reviews' => $reviews,\n 'form' => true,\n 'allowed' => $allowed\n ]);\n\n } else {\n // Invalid token provided\n return false;\n }\n }", "public function testCanEndReview()\n {\n $this->datasetSubmission->setDataset($this->mockDataset);\n\n $testStartDateTime = new \\DateTime('now');\n\n $datasetSubmissionReview = new DatasetSubmissionReview(\n $this->mockPerson,\n $testStartDateTime\n );\n\n $this->datasetSubmission->setDatasetSubmissionReview($datasetSubmissionReview);\n\n // End Review for the dataset submission.\n $this->datasetSubmission->reviewEvent($this->mockPerson, DatasetSubmission::DATASET_END_REVIEW);\n\n $this->assertEquals(DatasetSubmission::STATUS_IN_REVIEW, $this->datasetSubmission->getStatus());\n }", "public function test_get_review_unused()\n {\n try {\n $output = $this->request('GET', 'api/requests/reviews/'.$this->unused_id_int.'/');\n } catch (CIPHPUnitTestExitException $e) {\n $output = ob_get_clean();\n }\n\n $this->assertContains($this->json_rest_status_false,$output);\n $this->assertResponseCode(404); //http not found\n }", "public function testFetchLeaveRequest() {\n\n $leaveRequest = $this->leaveRequestDao->fetchLeaveRequest(1);\n\n $this->assertTrue($leaveRequest instanceof LeaveRequest);\n\n $this->assertEquals(1, $leaveRequest->getLeaveTypeId());\n $this->assertEquals('Casual', $leaveRequest->getLeaveTypeName());\n $this->assertEquals('2010-08-30', $leaveRequest->getDateApplied());\n $this->assertEquals(1, $leaveRequest->getEmpNumber());\n\n }", "public function test_get_products_unused_reviews()\n {\n try {\n $output = $this->request('GET', 'api/requests/products/'.$this->unused_id_int.'/reviews/');\n } catch (CIPHPUnitTestExitException $e) {\n $output = ob_get_clean();\n }\n\n $this->assertContains($this->json_rest_status_false,$output);\n $this->assertResponseCode(404); //http not found\n }", "public function leave()\n {\n if ($this->tooCloseToStart()) {\n return 3;\n }\n\n self::$db->query(\n \"DELETE FROM schedule.demo_attendee\n WHERE demo_id = $1 AND memberid = $2\",\n [$this->demo_id, $_SESSION['memberid']]\n );\n\n $attendee = MyRadio_User::getInstance();\n MyRadioEmail::sendEmailToUser(\n $this->getDemoer(),\n 'Training Attendee Left',\n $attendee->getName() . ' has left your session at ' . $this->getDemoTime() . '.'\n );\n MyRadioEmail::sendEmailToUser(\n $attendee,\n 'Training Cancellation',\n 'Hi ' . $attendee->getFName() . \",\\r\\n\\r\\n\"\n . \"Just to confirm that you have left the training session at \" . $this->getDemoTime()\n . \". If this was accidental, simply rejoin. \"\n . \"Meanwhile, you can join the waiting list, and we'll let you know if a session becomes available. \"\n . URLUtils::makeURL(\"Training\", \"listWaitingLists\")\n . \"\\r\\n\\r\\nThanks!\\r\\n\"\n . Config::$long_name\n . ' Training'\n );\n\n\n return 0;\n }", "public function test_create_product_review_invalid_fields() {\n\t\t$product = ProductHelper::create_simple_product();\n\n\t\t// missing review\n\t\t$request = new \\WP_REST_Request( 'POST', '/wc/v4/products/reviews' );\n\t\t$request->set_body_params(\n\t\t\tarray(\n\t\t\t\t'reviewer' => 'Admin',\n\t\t\t\t'reviewer_email' => 'woo@woo.local',\n\t\t\t)\n\t\t);\n\t\t$response = $this->server->dispatch( $request );\n\t\t$data = $response->get_data();\n\n\t\t$this->assertEquals( 400, $response->get_status() );\n\n\t\t// Missing reviewer.\n\t\t$request = new \\WP_REST_Request( 'POST', '/wc/v4/products/reviews' );\n\t\t$request->set_body_params(\n\t\t\tarray(\n\t\t\t\t'review' => 'Hello world.',\n\t\t\t\t'reviewer_email' => 'woo@woo.local',\n\t\t\t)\n\t\t);\n\t\t$response = $this->server->dispatch( $request );\n\t\t$data = $response->get_data();\n\n\t\t$this->assertEquals( 400, $response->get_status() );\n\n\t\t// missing reviewer_email\n\t\t$request = new \\WP_REST_Request( 'POST', '/wc/v4/products/reviews' );\n\t\t$request->set_body_params(\n\t\t\tarray(\n\t\t\t\t'review' => 'Hello world.',\n\t\t\t\t'reviewer' => 'Admin',\n\t\t\t)\n\t\t);\n\t\t$response = $this->server->dispatch( $request );\n\t\t$data = $response->get_data();\n\n\t\t$this->assertEquals( 400, $response->get_status() );\n\t}", "public function testGetInvalidReviewByRecAreaId(): void {\n\t\t// grab a profile id that exceeds the maximum allowable profile id\n\t\t$review = Review::getReviewByReviewRecAreaId($this->getPDO(), generateUuidV4());\n\t\t$this->assertCount(0, $review);\n\t}", "public function testGetInvalidReviewByReviewRecAreaId(): void {\n\t\t// grab a rec area id that exceeds the maximum allowable rec area id\n\t\t$review = Review::getReviewByReviewRecAreaId($this->getPDO(), generateUuidV4());\n\t\t$this->assertEmpty($review);\n\t}", "public function xtestSaveLeaveRequest() { \n\n $leaveRequestList = TestDataService::loadObjectList('LeaveRequest', $this->fixture, 'set1');\n $leaveList = TestDataService::loadObjectList('Leave', $this->fixture, 'set2');\n\n $leaveRequestDao = $this->getMock('LeaveRequestDao', array('saveLeaveRequest'));\n $leaveRequestDao->expects($this->once())\n ->method('saveLeaveRequest')\n ->with($leaveRequestList[0], $leaveList)\n ->will($this->returnValue(true));\n\n $this->leaveRequestService->setLeaveRequestDao($leaveRequestDao);\n\n $entitlements = array();\n $this->assertTrue($this->leaveRequestService->saveLeaveRequest($leaveRequestList[0], $leaveList, $entitlements));\n\n }", "public function xtestFetchLeaveRequest() {\n\n $leaveRequestList = TestDataService::loadObjectList('LeaveRequest', $this->fixture, 'set1');\n\n $leaveRequestDao = $this->getMock('LeaveRequestDao', array('fetchLeaveRequest'));\n $leaveRequestDao->expects($this->once())\n ->method('fetchLeaveRequest')\n ->with(1)\n ->will($this->returnValue($leaveRequestList[0]));\n\n $this->leaveRequestService->setLeaveRequestDao($leaveRequestDao);\n\n $returnedLeaveRequest = $this->leaveRequestService->fetchLeaveRequest(1);\n\n $this->assertTrue($returnedLeaveRequest instanceof LeaveRequest);\n $this->assertEquals('LTY001', $leaveRequestList[0]->getLeaveTypeId());\n $this->assertEquals('Casual', $leaveRequestList[0]->getLeaveTypeName());\n $this->assertEquals('2010-08-30', $leaveRequestList[0]->getDateApplied());\n $this->assertEquals(1, $leaveRequestList[0]->getEmpNumber());\n\n }", "public function testWithoutReview()\n {\n list($contributor, $reviewer, $authModel, $project, $commit) = $this->prepareFixtures();\n\n /* @var $contributor User */\n /* @var $reviewer User */\n /* @var $authModel Auth */\n /* @var $project Project */\n /* @var $commit BaseCommit */\n\n $result = CommitPanel::widget([\n 'project' => $project,\n 'commit' => $commit,\n 'contributor' => $contributor,\n 'authUser' => $authModel,\n 'reviewModel' => null,\n ]);\n\n // not contains review model and finish review button\n $this->assertNotContains($reviewer->name, $result);\n $this->assertNotContains('did not complete a review', $result);\n\n $expectedString = '/projects/' . $project->id . '/' . $commit->getId() . '/finish-review';\n $this->assertNotContains($expectedString, $result);\n $this->assertNotContains('Finish review', $result);\n\n // contains to be a reviewer button\n $this->assertContains('(has no review)', $result);\n\n // has to be review button\n $expectedString = '/projects/' . $project->id . '/' . $commit->getId() . '/create-self-review';\n $this->assertContains($expectedString, $result);\n $this->assertContains('To be a reviewer', $result);\n }", "public function testListcustomersreviewsStoreIdMiss() {\n $baseUrl = $this->getContainer()->getParameter('symfony_base_url');\n $acess_token = $this->getContainer()->getParameter('access_token');\n $serviceUrl = $baseUrl . 'api/liststoreposts?access_token='.$acess_token;\n $data = '{\"reqObj\":{\"user_id\":1,\"limit_start\":0,\"limit_size\":10}}';\n $client = new CurlRequestService();\n $response = $client->send('POST', $serviceUrl, array(), $data)\n ->getResponse();\n $response = json_decode($response);\n $this->assertEquals(100, $response->code);\n }", "public function sickLeaveTakenSuccessfully();", "private function shouldRunTests($data, $review)\n {\n $config = $this->services->get('config');\n $logger = $this->services->get('logger');\n $newState = $review->get('state');\n $configValue = ConfigManager::getValue(\n $config,\n ConfigManager::REVIEWS_DISABLE_TESTS_ON_APPROVE_COMMIT,\n false\n );\n $logger->trace(\n 'Review/Listener: updateFromChange is [' . $data['updateFromChange'] .\n '], new state is [' . $newState .\n '], ' . ConfigManager::REVIEWS_DISABLE_TESTS_ON_APPROVE_COMMIT .\n ' is [' . ($configValue === false ? 'false' : 'true') . ']'\n );\n $runTests = false;\n if ($data['updateFromChange']) {\n $runTests = true;\n if ($newState === ReviewModel::STATE_APPROVED) {\n $runTests = $configValue === false;\n }\n }\n $logger->notice('Review/Listener: Tests ' . ($runTests ? 'will ' : 'will not ') . 'run.');\n return $runTests;\n }", "public function testGetLeaveById() {\n\n $leave = $this->leaveRequestDao->getLeaveById(1);\n\n $this->assertTrue($leave instanceof Leave);\n\n $this->assertEquals(1, $leave->getId());\n $this->assertEquals(8, $leave->getLengthHours());\n $this->assertEquals(1, $leave->getLengthDays());\n $this->assertEquals(1, $leave->getLeaveRequestId());\n $this->assertEquals(1, $leave->getLeaveTypeId());\n $this->assertEquals(1, $leave->getEmpNumber());\n $this->assertEquals('2010-09-01', $leave->getDate());\n $this->assertEquals(1, $leave->getStatus());\n\n }", "public function testHasReviewed()\n\t{\n\t\t/** @var ItemRentalReview $answer */\n\t\t$review = factory(ItemRentalReview::class)->create();\n\t\t/** @var User $user */\n\t\t$user = $review->user;\n\n\t\t$this->assertTrue($user->hasReviewed($review->item_rental));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end get_basic_query Loop through query and echo music items
protected function the_music( $query ){ $results = array(); if ( $query->have_posts() ){ while ( $query->have_posts() ){ $query->the_post(); if ( ! array_key_exists( $query->post->ID , $results ) ) { $music = new WOVAX_MM_Music(); $music->set_settings( $query->post->ID ); $music->set_post( $query->post ); ob_start(); include plugin_dir_path( __FILE__ ) . 'inc/music-item.php'; $results[ $query->post->ID ] = ob_get_clean(); } // end if } // end while } // end if wp_reset_postdata(); $this->the_result_count( count( $results ) ); echo implode( '' , $results ); }
[ "function getOGMusicMusicians();", "public function get() {\n\n\t\t/* Get the Current Playlist */\n\t\t$list = $this->_httpq->get_tracks();\n\n\t\t$songs = explode(\"::\",$list);\n\n\t\tforeach ($songs as $key=>$entry) {\n\t\t\t$data = array();\n\n\t\t\t/* Required Elements */\n\t\t\t$data['id'] \t= $key;\n\t\t\t$data['raw']\t= $entry;\n\n\t\t\t/* Parse out the song ID and then create the song object */\n\t\t\tpreg_match(\"/song=(\\d+)\\&/\",$entry,$matches);\n\n\t\t\t/* Attempt to build the new song */\n\t\t\t$song = new Song($matches['1']);\n\n\t\t\t/* If we don't know it, look up by filename */\n\t\t\tif (!$song->title) {\n\t\t\t\t$filename = sql_escape($entry);\n\t\t\t\t$sql = \"SELECT id FROM song WHERE file LIKE '%$filename'\";\n\t\t\t\t$db_results = mysql_query($sql, dbh());\n\t\t\t\tif ($r = mysql_fetch_assoc($db_results)) {\n\t\t\t\t\t$song = new Song($r['id']);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$song->title = _('Unknown');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Make the name pretty */\n\t\t\t$song->format_song();\n\t\t\t$data['name']\t= $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;\n\n\t\t\t/* Optional Elements */\n\t\t\t$data['link'] = '';\n\t\t\t$data['track']\t= $key+1;\n\n\t\t\t$results[] = $data;\n\n\t\t} // foreach playlist items\n\n\t\treturn $results;\n\n\t}", "public function showSongs()\n {\n $songs = new songs();\n $this->vars['songs'] = $songs->fetch();\n }", "public function list_music() {\n //Construct the MySQL select statement.\n $sql = \"SELECT * FROM \" . $this->db->getSongsTable();\n\n //execute the query\n $query = $this->dbConnection->query($sql);\n \n //handle the result\n if ($query && $query->num_rows > 0) {\n //create an array to store all returned information\n $songs = array();\n\n //loop through all rows in the returned recordsets\n while ($query_row = $query->fetch_assoc()) {\n\n// //create a Music object\n// $song = new Music($query_row['song_name'],\n// $query_row['album'],\n// $query_row['artist'],\n// $query_row['release_date'],\n// $query_row['genre'],\n// $query_row['image'],\n// $query_row['description'],\n// $query_row['audio']);\n// \n//\n// //set the id for the song\n// $song->setId($query_row[\"id\"]);\n //add the movie into the array\n// $songs[] = $song;\n }\n return $songs;\n }\n\n return false;\n }", "function parseaudio($itemID)\n{\n\n $rootdirectory = \"audio\";\n $rooturl = \"http://wrecked-distro.com\";\n $username = $_SESSION[\"username\"];\n\n dbConnect();\n\n $sql = \"SELECT * FROM items WHERE itemID = $itemID\";\n $result = mysql_query($sql);\n\n if ($myrow=mysql_fetch_array($result))\n {\n // create directory path\n\n $audiodirectory = strtolower($rootdirectory.\"/\".$myrow[\"folder\"]);\n\n if (is_dir($audiodirectory))\n {\n\t// open directory\n\n $d = dir($audiodirectory);\n\n\t// read through directory\n\twhile ($entry=$d->read())\n\t{\n\t // break filename into folder name and remainder\n \n\t list($folder,$remainder) = explode(\"-\",$entry);\n\n\t // break remainder of filename into the track title and the file extension\n\n\t list($trackname,$extension) = explode(\".\",$remainder); \n\n\t if ($extension == \"mp3\")\n\t {\n//\t\t$list = $list.\"<content:encoded><![CDATA[\".$myrow[\"description\"].\"<a href=\\\"$rooturl/$audiodirectory/$entry\\\">$trackname</a>]]></content:encoded>\\n\"; \n//\t\t$list = $list.\"<enclosure url='$rooturl/$audiodirectory/$entry' type='audio/mpeg'/ length='3000000'>\\n\";\n\t };\n\n };\n\techo $list;\n \t$d->close(); };\n };\n}", "function play_song($array){\n\tglobal $searchquery;\n\tglobal $song_returned_id, $number_of_moods;\n\tif ($array != NULL) {\n\t$randomnumber = rand(0, count($array)-1);\n\t//echo $randomnumber;\n\t//echo count($array);\n\tforeach ($array as $key => & $sub_array) {\n\t\tif ($key == $randomnumber) {\n\t\t\techo \"you are listening to {$sub_array[\"name\"]} by {$sub_array[\"artist\"]} tagged \" . $GLOBALS['searchquery'] .\"<br />\";\n\t\t\techo \"<audio controls id=\\\"player\\\" src=\" . $sub_array[\"path\"] .\">\n\t\t\tYour browser does not support the audio element.\n\t\t\t</audio>\"; \n\t\t\t$song_returned_id = $sub_array[\"songid\"];\n\t\t\t//echo \"song\".$song_returned_id;\n\t\t}\n\t}\n\t\techo \"tags: \";\n\t\t// echo the tags for the song\n\tforeach ($array as $key => & $sub_array) {\n\t\tif ($sub_array['songid'] == $song_returned_id) {\n\t\t\techo $sub_array['mood'] . \" \";\n\t\t}\n\n\t}\n\t} else { \n\t\tif ($searchquery != \"random\"){\n\t\t\techo \"Sorry we don't have \" . $searchquery . \" in our database. \";\n\t\t\techo \"To see all the tagged moods, please check out <a href=\\\"sensation2.php\\\"> All the moods </a><br />\";\n\t\t}\n\t\t// free mysqli result\n\t\tmysqli_free_result($GLOBALS['dbresult']);\n\t\t// make a new query to get all the songs in the database, and then to play a random one from that selection\n\t\t$sqlquery = \"SELECT * FROM moods\";\n\t\t$sqlquery .= \" INNER JOIN map\";\n \t$sqlquery .= \" ON moods.tagid = map.tagid\";\n \t$sqlquery .= \" INNER JOIN songs\";\n \t$sqlquery .= \" ON songs.songid = map.songid\";\n\n\t\t$dbresult = mysqli_query($GLOBALS['connection'], $sqlquery);\n\t// test if query succeeded./ if there was a query error\n\tif (!$dbresult){\n\t\tdie(\"Database query failed.\");\n\t}\n\n\t\t// get the first row from that result set and asign it to row, store all of those rows in an array of arrays called $dbarray, which can be used to compare to the original one\n\t$db_rand_song = array();\n\twhile($row = mysqli_fetch_assoc($dbresult)){\n \t\t$db_rand_song[] = $row;\n\t\t}\n\n\t\t// play a random song from the database\n\t\tif ($db_rand_song != NULL) {\n\t$randomnumber = rand(0, count($db_rand_song)-1);\n\t//echo $randomnumber;\n\t//echo count($array);\n\t//print_r($db_rand_song);\n\tforeach ($db_rand_song as $key => & $sub_array) {\n\t\tif ($key == $randomnumber) {\n\n\t\t\techo \"Now playing a random mood from our database: {$sub_array['name']} by {$sub_array['artist']} <audio controls id=\\\"player\\\" src=\" . $sub_array[\"path\"] .\">\n\t\t\tYour browser does not support the audio element.\n\t\t\t</audio>\";\n\t\t\t$song_returned_id = $sub_array[\"songid\"];\n\t}}}}\n\t//mysqli_free_result($dbresult);\n}", "public function getAllSongs() {\n $sql = \"SELECT artist.name, song.title, song.duration \n FROM artist \n JOIN song ON (artist.id = song.artist_id) \n ORDER BY artist.name, song.title ASC\" ;\n \n $result = mysqli_query($this->connection, $sql);\n return $result;\n }", "function getMusic($music , $id , $band_id )\n\t{\n\t\t\t\n\t\t\t\t\n\t\t\t$authVars = array(\n\t\t\t\t'apiKey' => '13846fb92c539b877ff2abc79ede2718',\n\t\t\t\t'secret' => 'ce4450255eb766372b130f0784c15087',\n\t\t\t\t'username' => 'hilkeros',\n\t\t\t\t'sessionKey' => '671bbefd4f15d3ed2fdf524dea62212b',\n\t\t\t\t'subscriber' => 0\n\t\t\t);\n\t\t\t$auth = new lastfmApiAuth('setsession', $authVars);\n\t\n\t\t\t$apiClass = new lastfmApi();\n\t\t\t$artistClass = $apiClass->getPackage($auth, 'artist');\n\t\t\t$trackClass = $apiClass->getPackage($auth, 'track');\n\t\t\t$albumClass = $apiClass->getPackage($auth, 'album');\n\t\n\t\t\tif($music)\n\t\t\t{\n\t\n\t\t\t\t$methodVars = array(\n\t\t\t\t\t'artist' => $music\n\t\t\t\t);\n\t\n\t\t\t\t$this->etime = time();\n\t\t\t\tif ( $artist = $artistClass->getInfo($methodVars) )\n\t\t\t\t{\n\t\n\t\t\t\t\t$stat['Lfm']['url'] = $artist['url'];\n\t\t\t\t\t$stat['Lfm']['lfm_m_id']=$id;\n\t\t\t\t\t$stat['Lfm']['executetime'] = $this->etime;\n\t\t\t\t\t$stat['Lfm']['band_id'] = $band_id;\n\n\t\t\t\t\t$this->Lfm->save($stat);\n\t\t\t\t\t$stat = NULL;\n\t\t\t\t\t$stat['Lfmlistener']['lfm_m_id']=$id;\n\t\t\t\t\t$stat['Lfmlistener']['listeners']=$artist['stats']['listeners'];\n\t\t\t\t\t$stat['Lfmlistener']['etime'] = $this->etime;\n\t\t\t\t\n\t\t\t\t\t$this->Lfmlistener->create();\n\t\t\t\t\t$this->Lfmlistener->save($stat);\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( $albums = $artistClass->getTopAlbums($methodVars) ) {\n\t\n\t\t\t\t\tforeach($albums as $key => $val)\n\t\t\t\t\t{\n\t\n\t\t\t\t\t\t$methodAlbumVars = array(\n\t\t\t\t\t\t\t\t\t'artist' => $music ,\n\t\t\t\t\t\t\t\t\t'album' => $val['name'],\n\t\t\t\t\t\t\t\t\t'mbid' => $val['mbid']\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($topAlbum = $albumClass->getinfo($methodAlbumVars))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$alb['Lfmalbum']['rank']=$val['rank'];\n\t\t\t\t\t\t\t$alb['Lfmalbum']['name']=$val['name'];\n\t\t\t\t\t\t\t$alb['Lfmalbum']['playcount']=$topAlbum['playcount'];\n\t\t\t\t\t\t\t$alb['Lfmalbum']['lfm_m_id']= $id;\n\t\t\t\t\t\t\t$alb['Lfmalbum']['etime']= $this->etime;\n\t\t\t\t\t\t\t$this->Lfmalbum->create();\n\t\t\t\t\t\t\t$this->Lfmalbum->save($alb);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*\t\t\t\t\t$qry = \"insert into lfm_top_album(stat_id , rank , name , playcount) values ($stat_id,$rank,'$name',$playcount)\";\n\t\t\t\t\t\t $result = mysql_query($qry);\n\t\t\t\t\t\t */\n\t\t\t\t\t\t// $TopAlbumCount ++ ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tif ( $tracks = $artistClass->getTopTracks($methodVars) ) {\n\t\t\t\t\t\t\n\t\t\t\t\tforeach($tracks as $key => $val)\n\t\t\t\t\t{\n\t\t\t\t\t\t$methodTrackVars = array(\n\t\t\t\t\t\t\t\t\t'artist' => $music ,\n\t\t\t\t\t\t\t\t\t'track' => $val['name']\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($toptrack = $trackClass->getinfo($methodTrackVars))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$trk['Lfmtrack']['lfm_m_id']= $id;\n\t\t\t\t\t\t\t\t$trk['Lfmtrack']['rank']=$val['rank'];\n\t\t\t\t\t\t\t\t$trk['Lfmtrack']['name']=$val['name'];\n\t\t\t\t\t\t\t\t$trk['Lfmtrack']['playcount']=$toptrack['playcount'];\n\t\t\t\t\t\t\t\t$trk['Lfmtrack']['etime']=$this->etime;\n\t\t\t\t\t\t\t\t$this->Lfmtrack->create();\n\t\t\t\t\t\t\t\t$this->Lfmtrack->save($trk);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t $qry = \"insert into lfm_top_tracks(stat_id , rank , name , playcount) values ($stat_id,$rank,'$name',$playcount)\";\n\t\t\t\t\t\t $result = mysql_query($qry);\n\t\t\t\t\t\t */\n\t\n\t\t\t\t\t} // foreach($tracks as $key => $val)\n\t\t\t\t}\n\t\t\treturn true;\n\t\n\t\t\t} // if($music)\n\t\n\t\t\n\t}", "public static function search_songs($input) {\n $array['type'] = 'song';\n $array['rule_1'] = 'anywhere';\n $array['rule_1_input'] = $input['filter'];\n $array['rule_1_operator'] = 0;\n\n ob_end_clean();\n\n XML_Data::set_offset($input['offset']);\n XML_Data::set_limit($input['limit']);\n\n $results = Search::run($array);\n\n echo XML_Data::songs($results);\n\n }", "public function get_item($basename, $shortcode=NULL, $captions=FALSE) {\n $sql =<<<SQL\n SELECT p.title AS pod_title, p.*, pi.*, pim.media_type,pim.filename AS pim_filename FROM podcast_items AS pi\n JOIN podcasts AS p ON p.id=pi.podcast_id\n JOIN podcast_item_media AS pim ON pim.podcast_item=pi.id\n WHERE p.custom_id LIKE '%l314-spanish'\n AND (pi.shortcode='fe481a4d1d' OR pi.filename='l314audio1.mp3');\nSQL;\n // This doesn't work!\n $where_podcast_items = 'podcast_items.shortcode';\n if (FALSE !== strpos($shortcode, '.')) {\n $where_podcast_items = 'podcast_items.filename';\n }\n $sql_cc =<<<SQL\n SELECT\n podcasts.title AS pod_title,podcasts.summary AS pod_summary,podcasts.*,podcast_items.*,pim.media_type AS pim_type,pim.filename AS pim_filename\n\tFROM podcast_items\n\tJOIN podcasts ON podcasts.id=podcast_items.podcast_id\n\tLEFT JOIN podcast_item_media AS pim ON pim.podcast_item=podcast_items.id\n WHERE(\n\tpim.media_type='cc-dfxp' -- IS NOT NULL\n\tAND podcasts.custom_id = '$basename'\n\tAND $where_podcast_items='$shortcode' )\n OR( podcasts.custom_id = '$basename'\n\tAND $where_podcast_items='$shortcode' )\nSQL;\n\n // This works!\n $select = 'podcasts.title AS pod_title, podcasts.summary AS pod_summary, podcasts.*,podcast_items.*';\n if ($captions) {\n $select .= ', podcast_item_media.filename AS pim_filename, podcast_item_media.media_type AS pim_type';\n }\n $this->db_pod->select($select);\n $this->db_pod->join('podcasts', 'podcasts.id=podcast_items.podcast_id');\n if ($captions) {\n // Important: a LEFT JOIN.\n $this->db_pod->join('podcast_item_media', 'podcast_item_media.podcast_item=podcast_items.id', 'left');\n $this->db_pod->order_by('pim_type', 'desc');\n }\n $this->db_pod->where('podcasts.custom_id', $basename); #'l314-spanish');\n if (FALSE !== strpos($shortcode, '.')) { #(FALSE !== strpos($basename, '.m') && !$shortcode) {\n $this->db_pod->where('podcast_items.filename', $shortcode); #'l314audio1.mp3');\n } else {\n $this->db_pod->where('podcast_items.shortcode', $shortcode);#'fe481a4d1d');\n }\n $query = $this->db_pod->get('podcast_items'); #AS pi');\n\n //$query = $this->db_pod->query($sql_cc);\n\n #$this->firephp->fb($this->db_pod->last_query(), 'Podcast model', 'LOG');\n\n $result = $query->result();\n\n # Captions - multiple results! - Post-process\n if ($result && $captions) {\n foreach ($result as $res) {\n if ('cc-dfxp'==$res->pim_type) {\n return $res;\n }\n }\n }\n if ($result) {\n return $result[0];\n }\n return FALSE;\n }", "public function getAllSongs()\n\t{\n\n $iUserId = $this->_oApi->getUserId();\n $sType = $this->_oApi->get('type');\n $iGenreId = $this->_oApi->get('genre');\n $iPage = $this->_oApi->get('page');\n $sList = $this->_oApi->get('list');\n list($iCount, $aReturn) = Phpfox::getService('accountapi.music')->getAllSongs($iUserId, $sType, $iGenreId, $sList, $iPage);\n Phpfox::getService('api')->setTotal($iCount);\n return $aReturn;\n\t}", "function barmusicstat()\n\t{\n\t\t$this->set('results',$this->Session->read('musicstat'));\n\n\t}", "function shortcode_grandmusic( $atts ) {\n\t\textract(shortcode_atts(array(\n\t\t\t'playlist'\t=> ''\t\t\t\n\t\t), $atts ));\n\t\t\n\t\t$out = '';\n\t\t\n\t\tif($playlist) {\n\t\t\t$flag_options = get_option('flag_options');\n\t\t\t$playlist_path = false;\n\t\t\t\n\t\t\tif (!$flag_options) {\n\t\t\t\treturn $out;\n\t\t\t}\n\t\t\t\n\t\t\t$playlist_path = $flag_options['galleryPath'].'playlists/'.$playlist.'.xml';\n\t\t\t\n\t\t\tif (!file_exists($flag_options['galleryPath'].'playlists/'.$playlist.'.xml')) {\n\t\t\t\treturn $out;\n\t\t\t}\n\t\t\t\n\t\t\t$playlist_content = file_get_contents($playlist_path);\n\t\t\t\n\t\t\tpreg_match_all( '/.?<item id=\".*?\">(.*?)<\\/item>/si', $playlist_content, $items );\n\t\t\tif (!isset($items[1]) || !is_array($items[1])) {\n\t\t\t\treturn $out;\n\t\t\t}\n\t\t\tforeach($items[1] as $playlist_item) {\n\t\t\t\tpreg_match( '/.?<track>(.*?)<\\/track>/i', $playlist_item, $track);\n\t\t\t\tif (count($track) > 1) {\n\t\t\t\t\t$url = $track[1];\n\t\t\t\t}\n\t\t\t\t$audio_record = array(\n\t\t\t\t\t\t'id' => '',\n\t\t\t\t\t\t'src' => $url,\n\t\t\t\t\t\t'type' => 'audio',\n\t\t\t\t\t\t'duration' => ''\n\t\t \t\t\t);\n\t\t \t\t\t\n\t\t\t\t$this->attachments['audio'] []= $audio_record;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn $out;\n\t}", "public function search($query) {\n\t\tcurl_setopt($this->ch, CURLOPT_URL, 'https://play.google.com/store/search?c=music&q=' . urlencode($query));\n\n\t\t$html = curl_exec($this->ch);\n\t\tif(strpos($html, 'We couldn\\'t find anything for your search') !== false) {\n\t\t\treturn array();\n\t\t}\n\n\t\tif(preg_match('/aria-label=\"Check out more content from Songs\".+href=\"(.+?)\"/', $html, $matches)) {\n\t\t\tif($_html = $this->getAllSongs($matches[1])) {\n\t\t\t\t$html = $_html;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->parseElements($html);\n\t}", "function All_videos_by_one_Album()\n{\n\tglobal $connect;\n\t$get_name = $_GET['Watch'];\n\t\n\t$select_Video_get = \"select * from videos where title='$get_name'\";\n\t$Video_get_run = mysqli_query($connect,$select_Video_get);\n\t$fetch_get_video = mysqli_fetch_array($Video_get_run);\n\t$get_album = $fetch_get_video['3'];\n\t\n\t$select = \"select * from album where id='$get_album'\";\n\t$select_run = mysqli_query($connect,$select);\n\t$album_fetch = mysqli_fetch_array($select_run);\n\t$fk_album = $album_fetch['0'];\n\t$album_name_single = $album_fetch['1'];\n\t$album_image = $album_fetch['5'];\n\t$artist_id = $album_fetch['3'];\n\t\n\t$selectt = \"select * from artist where id='$artist_id'\";\n\t$run = mysqli_query($connect,$selectt);\n\t$f = mysqli_fetch_array($run);\n\t$artist_name_single = $f['1'];\n\t\n\t$select_Video = \"select * from videos where fk_album='$fk_album'\";\n\t$Video_run = mysqli_query($connect,$select_Video);\n\t\n\t\t\t\t\n\t\n\t while($Video_fetch = mysqli_fetch_array($Video_run))\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\t\t \n\t\n\t\n\t$id = $Video_fetch['0'];\n\t$title = $Video_fetch['1'];\n\t$artist = $Video_fetch['2'];\n\t$album = $Video_fetch['3'];\n\t$language = $Video_fetch['4'];\n\t$year = $Video_fetch['5'];\n\t$ganre = $Video_fetch['6'];\n\t$lyrics = $Video_fetch['7'];\n\t$composer = $Video_fetch['8'];\n\t$descrip = $Video_fetch['9'];\n\t$image = $Video_fetch['10'];\n\t$video = $Video_fetch['11'];\n\t\n\t\n\t#for artist name\n\t$select_Artist = \"select * from artist where id='$artist'\";\n\t$artist_run = mysqli_query($connect,$select_Artist);\n\t$artist_fetch = mysqli_fetch_array($artist_run);\n\t$artist_name = $artist_fetch['1'];\n\t\n\t#for language name\n\t$select_language = \"select * from languages where id='$language'\";\n\t$language_run = mysqli_query($connect,$select_language);\n\t$language_fetch = mysqli_fetch_array($language_run);\n\t$language_name = $language_fetch['1'];\n\t\n\t#for Year name\n\t$select_year = \"select * from years where id='$year'\";\n\t$year_run = mysqli_query($connect,$select_year);\n\t$year_fetch = mysqli_fetch_array($year_run);\n\t$year_name = $year_fetch['1'];\n\t\n\t#for lyrics name\n\t$select_lyrics = \"select * from lyrics where id='$lyrics'\";\n\t$lyrics_run = mysqli_query($connect,$select_lyrics);\n\t$lyrics_fetch = mysqli_fetch_array($lyrics_run);\n\t$lyrics_name = $lyrics_fetch['1'];\n\t\n\t#for Album name\n\t$select_Album = \"select * from album where id='$album'\";\n\t$Album_run = mysqli_query($connect,$select_Album);\n\t$Album_fetch = mysqli_fetch_array($Album_run);\n\t$album_name = $Album_fetch['1'];\n\t\t\t\t\t\t\t\t\t\t \n\t\n $getID3 = new getID3;\t\t\t \n $filename = \"dash-board/Artist/$artist_name/$album_name/$title/$video\";\n $ThisFileInfo = $getID3->analyze($filename);\n $getID3->CopyTagsToComments($ThisFileInfo);\n \n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \n echo \" <div class='d-flex align-items-center mb-4 ''>\n <div class='col-5'>\n\t\t\t\t\t\t\t\t\t <a href='Video.php?Watch=$title'>\n <img src='dash-board/Artist/$artist_name/$album_name/$title/$image' alt='Card image' style='height: 65px; width: 100%;'>\n\t\t\t\t\t\t\t\t\t\t</a>\n </div>\n <div class='ml-3'>\n <a href='Video.php?Watch=$title'>\n <h6>$title | $artist_name </h6>\n </a>\n <small class='mt-1'>$album_name</small>\n </div>\n </div>\";\n\t\t\t\t\t\t\t\t\t }\n \n \n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n}", "function get_songs($array=array()) { \n\n\t\t$results = array();\n\n\t\t/* If we've passed in some songs */\n\t\tif (count($array)) { \n\t\t\n\t\t\tforeach ($array as $data) { \n\t\t\t\t\n\t\t\t\t$sql = \"SELECT song,dyn_song FROM playlist_data WHERE id='\" . sql_escape($data) . \"' ORDER BY track\";\n\t\t\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t\t\t$r = mysql_fetch_assoc($db_results);\n\t\t\t\tif ($r['dyn_song']) { \n\t\t\t\t\t$array = $this->get_dyn_songs($r['dyn_song']);\n\t\t\t\t\t$results = array_merge($array,$results);\n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\t$results[] = $r['song'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} // end foreach songs\n\t\t\t\n\t\t\treturn $results;\n\n\t\t} // end if we were passed some data\n\n\t\t$sql = \"SELECT * FROM playlist_data WHERE playlist='\" . sql_escape($this->id) . \"' ORDER BY track\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\twhile ($r = mysql_fetch_assoc($db_results)) { \n\t\t\tif ($r['dyn_song']) { \n\t\t\t\t$array = $this->get_dyn_songs($r['dyn_song']);\n\t\t\t\t$results = array_merge($array,$results);\n\t\t\t}\n\t\t\telse { \n\t\t\t\t$results[] = $r['song'];\n\t\t\t} \n\n\t\t} // end while\n\n\t\treturn $results;\n\n\t}", "protected function showAllSongs()\n {\n $alldata = $this->getAllSongs();\n $headerhtml = './templates/header.html';\n $header = file_get_contents($headerhtml);\n $values = array('[+title+]', '[+heading+]', '[+2+]');\n $replacements = array($this->phrases['songs_title'], $this->phrases['songs_heading'], 'current');\n $content = '';\n $content .= printTemplate($values, $replacements, $header);\n\n $content .= $this->getSongArtistCount();\n $file = './templates/songlist.html';\n $tpl = file_get_contents($file);\n $values = ['[+title+]', '[+name+]', '[+duration+]'];\n\n $newData = changeTime($alldata);\n $content .= printTemplateArray($values, $newData, $tpl);\n $footer = './templates/footer.html';\n $content .= file_get_contents($footer);\n return $content;\n }", "function mg_library_audio($page = 1, $per_page = 15) {\r\n\t$query_audio_args = array(\r\n\t\t'post_type' => 'attachment', 'post_mime_type' =>'audio', 'post_status' => 'inherit', 'posts_per_page' => $per_page, 'paged' => $page\r\n\t);\r\n\t\r\n\t$query_audio = new WP_Query( $query_audio_args );\r\n\t$tracks = array();\r\n\t\r\n\tforeach ( $query_audio->posts as $audio) { \r\n\t\t$tracks[] = array(\r\n\t\t\t'id'\t=> $audio->ID,\r\n\t\t\t'url' \t=> $audio->guid, \r\n\t\t\t'title' => $audio->post_title\r\n\t\t);\r\n\t}\r\n\t\r\n\t// global images number\r\n\t$track_num = $query_audio->found_posts;\r\n\t\r\n\t// calculate the total\r\n\t$tot_pag = ceil($track_num / $per_page);\r\n\t\r\n\t// can show more?\r\n\t$shown = $per_page * $page;\r\n\t($shown >= $track_num) ? $more = false : $more = true; \r\n\t\r\n\treturn array('tracks' => $tracks, 'pag' => $page, 'tot_pag' =>$tot_pag ,'more' => $more, 'tot' => $track_num);\r\n}", "function getSongs() {\n\t$sql = q(\"SELECT * FROM lib_songs\");\n\treturn getSqlArray($sql);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Category/term Archive Link
function get_cat_link($term_field = '') { global $post; $post_type = get_post_type_object(get_post_type()); $post_type_name = $post_type->name; if ($term_field) { $archive_link = get_term_link($term_field->slug, 'category'); } else { $archive_link = jumpoff_get_page_url('news'); } return $archive_link; }
[ "function get_archive_link( $format = 'absolute' ) {\n\n\treturn utils\\get_taxonomy_archive_link( 'actor', $format );\n}", "public function category_archive() {\n\n\t\t\t// Get queried object.\n\t\t\t$term = get_queried_object();\n\n\t\t\t// Queried term description.\n\t\t\tif ( ! empty( $term->description ) ) {\n\t\t\t\techo wp_kses_post(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'%s<div class=\"hb-separator extra-space\"><div class=\"hb-fw-separator\"></div></div>',\n\t\t\t\t\t\t$term->description\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$orientation = hb_options( 'hb_portfolio_taxonomy_orientation' );\n\t\t\t$ratio = hb_options( 'hb_portfolio_taxonomy_ratio' );\n\t\t\t$dimensions = highend_get_image_dimensions( $orientation, $ratio, 1000 );\n\n\t\t\thighend_portfolio_simple_page_template(\n\t\t\t\tapply_filters(\n\t\t\t\t\t'highend_portfolio_category_archive_args',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'filter' => hb_options( 'hb_portfolio_taxonomy_filter', false ),\n\t\t\t\t\t\t'sorter' => hb_options( 'hb_portfolio_taxonomy_sorter', false ),\n\t\t\t\t\t\t'columns' => hb_options( 'hb_portfolio_taxonomy_columns', 3 ),\n\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t'width' => $dimensions['width'],\n\t\t\t\t\t\t\t'height' => $dimensions['height'],\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function get_category_link($category) {\n\n return BLOG_URL.'category/'.urlencode(trim(strtolower($category)));\n\n}", "public function get_archive_link(){\n\t\t/*We want a single object returned - with template always as news_archive*/\n\t\t$page = parent::get_by(array('template' => 'news_archive'), TRUE);\n\t\treturn isset($page->slug) ? $page->slug : '';\n\n\t}", "function less_post_category(){\n\t$category = get_the_category(); \n\tprintf('<a href=\"'.get_category_link($category[0]->term_id ).'\">'.$category[0]->cat_name.'</a>');\n}", "protected function taxonomy_archive_links() {\n\t\tglobal $wp_query;\n\n\t\t// bail early if no taxonomy\n\t\tif ( empty( $wp_query->queried_object->term_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// hold link output\n\t\t$output = '';\n\n\t\t// get ancestors for term\n\t\t$ancestors = get_ancestors( $wp_query->queried_object->term_id, $wp_query->queried_object->taxonomy );\n\n\t\t// fill ancestors if available\n\t\tif ( ! empty( $ancestors ) ) {\n\t\t\t// make sure they're in order\n\t\t\t$ancestors = array_reverse( $ancestors );\n\n\t\t\t// add terms to breadcrumbs\n\t\t\tforeach ( (array) $ancestors as $ancestor ) {\n\t\t\t\t$term = get_term_by( \n\t\t\t\t\t'id', \n\t\t\t\t\t$ancestor, \n\t\t\t\t\t$wp_query->queried_object->taxonomy\n\t\t\t\t);\n\n\t\t\t\t// skip if no term\n\t\t\t\tif ( empty( $term ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// add term breadcrumb \n\t\t\t\t$output .= $this->build_list_item_data(\n\t\t\t\t\t$term->name,\n\t\t\t\t\tget_term_link( $term->term_id )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// add term breadcrumb \n\t\t$output .= $this->build_list_item_data( single_term_title( '', false ) );\n\n\t\treturn $output;\n\t}", "function get_archive_link( $format = 'absolute' ) {\n\n\treturn utils\\get_taxonomy_archive_link( 'genre', $format );\n}", "function primary_category_link() {\n\n\tglobal $post_id;\n\t$term = get_the_terms( $post_id, 'primary-category' );\n\tif ( ! $term ) {\n\t\treturn;\n\t} else {\n\t\techo get_home_url() . '/' . $term[0]->taxonomy . '/' . $term[0]->slug;\n\t}\n\n}", "public function archive_url( $atts ){\n\t\t// extract the shortcode attributes\n\t\textract( shortcode_atts( $this->idocs_archive_url_defaults( 'values' ) , $atts ) );\n\t\t\n\t\tif( !$term_id || empty( $term_id ) ){\n\t\t\tif( current_user_can('manage_options') ){\n\t\t\t\treturn __('iDocs error: no term specified ( field term_id is empty ).', 'idocs');\n\t\t\t}\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( is_numeric( $term_id ) ){\n\t\t\t$field = 'id';\n\t\t}else if( is_string( $term_id ) ){\n\t\t\t$field = 'slug';\n\t\t}\n\t\t\n\t\t$term = get_term_by( $field, $term_id, idocs_taxonomy() );\n\t\tif( is_wp_error( $term ) || !$term ){\n\t\t\tif( current_user_can('manage_options') ){\n\t\t\t\treturn sprintf( __('iDocs error: term not found ( %s ).', 'idocs'), $term_id);\n\t\t\t}\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$term_link = get_term_link( $term->term_id, idocs_taxonomy() );\n\t\t\n\t\t$rel = $rel ? ' rel=\"'.$rel.'\"' : '';\n\t\tif( !$text ){\n\t\t\t$text = apply_filters('the_title', $term->name);\n\t\t}\n\t\t$title = __('Online documentation: ').esc_attr( $term->name );\n\t\t\n\t\t$desc = '';\n\t\t$rm = '';\n\t\tif( $include_desc ){\n\t\t\t$rm = sprintf('&nbsp;<a href=\"%s\" title=\"%s\" target=\"%s\"%s>%s</a>',\n\t\t\t\t$term_link,\n\t\t\t\t$title,\n\t\t\t\t$target,\n\t\t\t\t$rel,\n\t\t\t\t$read_more\n\t\t\t);\n\t\t\tif( !empty( $term->description ) ){\n\t\t\t\t$desc = '<p>'.$term->description.$rm.'</p>';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sprintf('%s<a href=\"%s\" class=\"idocs docs-archive-page-url %s\" title=\"%s\" target=\"%s\"%s>%s</a>%s%s',\n\t\t\t$before,\n\t\t\t$term_link,\n\t\t\t$class,\n\t\t\t$title,\n\t\t\t$target,\n\t\t\t$rel,\n\t\t\t$text,\n\t\t\t$after,\n\t\t\t$desc\n\t\t);\t\t\n\t}", "function get_term_feed_link($term, $taxonomy = '', $feed = '')\n {\n }", "function et_get_job_category_link ($job_cat) {\n\t if ( !is_object($job_cat) ) {\n if ( is_int($job_cat) ) {\n $job_cat = &get_term($job_cat, 'job_category');\n } else {\n $job_cat = &get_term_by('slug', $job_cat, 'job_category');\n }\n }\n return get_term_link( $job_cat, 'job_category' );\n}", "function RDP_get_category_links() {\n $categories = get_the_category();\n $separator = ', ';\n $output = '';\n if ( ! empty( $categories ) ) {\n foreach( $categories as $category ) {\n $output .= '<a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\">' . esc_html( $category->name ) . '</a>' . $separator;\n }\n $output = trim( $output, $separator );\n }\n return $output;\n}", "function ForBlogs_category() {\n\t$categories = get_the_category();\n\n\tforeach ( $categories as $category ) {\n\t\techo '<a class=\"btn btn-xs btn-green\" href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\"><i class=\"fas fa-star\"></i>' . esc_html( $category->cat_name ) . '</a>';\n\t}\n}", "function fast_get_term_link($term, $taxonomy) {\n $term_path = get_term_path($term, $taxonomy);\n return home_url(user_trailingslashit($term_path, 'category'));\n}", "public function Link() {\n $Action = 'category/' . $this->ID;\n return $Action; \n }", "function get_archives_link($url, $text, $format = 'html', $before = '', $after = '', $selected = \\false)\n {\n }", "function vicuna_archives_link($limit = '') {\n\tglobal $wp_locale, $wpdb;\n\n\tif ( '' != $limit ) {\n\t\t$limit = (int) $limit;\n\t\t$limit = ' LIMIT '.$limit;\n\t}\n\n\t$arcresults = $wpdb->get_results(\"SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC\" . $limit);\n\tif ( $arcresults ) {\n\t\tforeach ( $arcresults as $arcresult ) {\n\t\t\t$url = get_month_link($arcresult->year, $arcresult->month);\n\t\t\t$text\t= sprintf(\"%04d-%02d\", $arcresult->year, $arcresult->month);\n\t\t\techo \"\\t<li><a href=\\\"$url\\\" title=\\\"$arcresult->posts\\\" rel=\\\"nofollow\\\">$text</a></li>\\n\";\n\t\t}\n\t}\n}", "public function link()\n\t{\n\t\treturn 'index.php?module=categories&page=categories_list&category_id='.$this->id;\n\t}", "function wp_get_linksbyname($category, $args = '')\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to set the value of field Follow_result
public function setFollowResult($Follow_result) { $this->follow_result = $Follow_result; return $this; }
[ "public function getFollowResult()\n {\n return $this->follow_result;\n }", "public function set_result($result){\n $this->result = $result;\n }", "public function set_result($result) {\n\t\t$this->_result = \"$result\";\n\t}", "public function setResult($result)\n\t{\n\t\t// Allow only a set of results\n\t\tif (!in_array($result, [1, 0, -1], true))\n\t\t{\n\t\t\t$result = -1;\n\t\t}\n\n\t\t$this->result = $result;\n\t}", "public function setResult($result)\n\t{\n\t\t// Allow only a set of results\n\t\tif ( !in_array($result, array(1, 0, -1)))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->result = $result;\n\t}", "public function setResult($result)\n {\n if ($result instanceof P4_Result) {\n $this->_result = $result;\n }\n }", "public function set_result($result) {\n $this->acceptedresult = $result;\n }", "public function setResult()\n {\n }", "protected function setResultUid(array &$result)\n {\n // If we're operating with the default uidKey there's nothing to do.\n if ($this->uidKey === \"uid\")\n {\n return;\n }\n\n if (isset($result[$this->uidKey]))\n {\n // The AccessToken expects a \"uid\" to have the key \"uid\".\n $result['uid'] = $result[$this->uidKey];\n }\n }", "protected function setResult( ResourceResult $result ) {\n\t\t$this->result = $result;\n\t}", "public function setFollow()\n\t{\n\t\t$tag_id=$_SESSION['tag_id'];\n\t\t$data=$_SESSION['user_data'];\n\t\t$u_id=$data['u_id'];\n\t\t$insert_data=array(\n\t\t\t'u_id'=>$u_id,\n\t\t\t'tag_id'=>$tag_id\n\t\t\t);\n\t\t$this->load->model(\"Tag_model\");\n\t\t$tmodel = new Tag_model;\n\t\t$flag=$tmodel->setFollowDB($insert_data);\n\t\tif($flag)\n\t\t{\n\t\t\t$response=array('result'=>1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response=array('result'=>1);\n\n\t\t}\n\n\t\techo json_encode($response);\n\n\t}", "public function setMatcherResult($result)\n {\n $this->_matcherResult = $result;\n }", "public function SetResult ($result = \\MvcCore\\Ext\\IForm::RESULT_SUCCESS);", "public function FollowLocation($follow)\r\n\t{\r\n\t\t$this->follow = $follow;\r\n\t}", "public function setFollowing($following):\n {\n $this->following = following;\n }", "public function setResult($results)\n {\n $this->results = $results;\n }", "function set_following($user_id = 0, $follow = false)\n {\n if( ! $this->is_login) $this->log(PLURK_NOT_LOGIN);\n\n $array = array(\n 'api_key' => $this->api_key,\n 'user_id' => $user_id,\n 'follow' => $follow\n );\n\n $result = $this->plurk(PLURK_SET_FOLLOWING, $array);\n\n return ($this->http_status == '200') ? TRUE : FALSE;\n }", "function follow() {\n\t\t\t$response = $this->API->call(\"users/follow.json\",array(\"target\" => $this->ID),\"POST\");\n\t\t\tif ($response !== false) {\n\t\t\t\t$this->API->cacheBust(\"user\".$this->ID);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function det_follow_alert($det_button_result) {\n\t\tif ($det_button_result === 'Follow') {\n\t\t\treturn 'follow_alert';\n\t\t} else if ($det_button_result === 'Unfollow') {\n\t\t\treturn 'unfollow_alert';\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens a FileStream on the specified path with write access
public function openWrite() { return new FileStream($this->filePath, FileStream::WRITE); }
[ "public static function fileStream_open ($path = '', $mode = 'write', $ensurePathExistence = true)\r\n\t\t{\r\n\t\t\t$mode = XXX_Default::toOption($mode, array('read', 'write', 'writeAppend'), 'write');\r\n\t\t\t\r\n\t\t\tif (($mode == 'write' || $mode == 'writeAppend') && $ensurePathExistence)\r\n\t\t\t{\r\n\t\t\t\tself::ensurePathExistenceByDestination($path);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$fileStream = fopen($path, $mode == 'read' ? 'rb' : ($mode == 'write' ? 'wb' : 'ab'));\r\n\t\t\t\r\n\t\t\treturn $fileStream;\r\n\t\t}", "public function openWrite() {\r\n return new FileStream($this->fullName());\r\n }", "public function open() {\n if(!($this->pointer = @fopen($this->getStream(), \"w\"))) {\n throw new StreamWriteException(\n \"Unable to open stream \" . $this->getStream() . \" for write operations\",\n 0 \n );\n }\n }", "public function stream_open($path, $mode, $options, &$opened_path);", "function openStream( &$stream, string $path ) {\n\t$stream = fopen( $path, 'rb' );\n\tif ( false === $stream ) {\n\t\treturn;\n\t}\n\t\\stream_set_blocking( $stream, false );\n}", "public function writeStream($path, $stream, $offset = null, $maxlen = null);", "public function testWriteStream(): void\n {\n $flysystem = new Filesystem(new MemoryAdapter());\n $data = 'abcdefghijklmnopqrstuiwxyz';\n /** @var resource $stream */\n $stream = \\fopen('php://memory', 'rb+');\n \\fwrite($stream, $data);\n $wrapper = $this->getInstance($flysystem);\n\n /** @var resource $stream */\n $response = $wrapper->writeStream('st.txt', $stream);\n\n self::assertTrue($response);\n self::assertSame('abcdefghijklmnopqrstuiwxyz', $flysystem->read('st.txt'));\n }", "public function writeStream($path, $resource, Config $config){}", "public function appendStream($path);", "private function openStream()\n {\n return fopen($this->fileLocation, self::STREAM_MODE_READ);\n }", "public function open() {\n\t\t$this->handler = @fopen( $this->stream->getName(), $this->mode );\n\t\tif ( $this->handler === false ) {\n\t\t\t$err = error_get_last();\n\t\t\tthrow new Exception( sprintf( 'Could not open file \"%s\" for writing (mode: \"%s\"). Error (%d): %s', $this->stream->getName(), $this->mode, $err['type'], $err['message'] ) );\n\t\t}\n\t}", "public static function write() {\r\n return new FileAccess(\"WRITE\", 2);\r\n }", "public function writeStream($path, $resource, Config $config)\n {\n\n }", "public function setCanonicalPath(?string $path) : StreamInterface;", "public function open( $path ) {\n\n\t\tif( ! file_exists( $path ) || ! is_readable( $path ) ) {\n\t\t\t$this->path = false;\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->path = $path;\n\t\treturn $this->path;\n\t}", "private function _openStream()\n {\n try {\n # Generates the complete filePath\n $fileName = $this->_logPath . DIRECTORY_SEPARATOR . $this->_logFile;\n $this->_fileObject = new \\SplFileObject($fileName, 'a+');\n } catch (\\RuntimeException $ex) {\n # File/stream could not be opened\n trigger_error('Logger scribe ' . __CLASS__ . ' could not open its stream.', E_USER_WARNING);\n }\n }", "public function readStream($path);", "public function openWrite()\n\t\t{\n\t\t\tif (isset($this->logFile)) {\n\t\t\t\t$this->filePointer = fopen($this->logFile, 'a') or exit ('Can not open log file.');\n\t\t\t}\n\t\t}", "public function setWriteTo($path)\r\n {\r\n $this->writeTo = $path;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor method for FindMeetingTimesSearchConstraints
public function __construct(\Ews\ArrayType\EwsArrayOfTimeSlot $searchWindows = null, $meetingDurationInMinutes = null, $activityDomain = null) { $this ->setSearchWindows($searchWindows) ->setMeetingDurationInMinutes($meetingDurationInMinutes) ->setActivityDomain($activityDomain); }
[ "public function __construct(?\\ArrayType\\EwsArrayOfTimeSlot $searchWindows = null, ?int $meetingDurationInMinutes = null, ?string $activityDomain = null)\n {\n $this\n ->setSearchWindows($searchWindows)\n ->setMeetingDurationInMinutes($meetingDurationInMinutes)\n ->setActivityDomain($activityDomain);\n }", "public function testSearchEntityAppointments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "protected function setTimeSearching($timeSearching) {\n\t\t$this->timeSearching = $timeSearching;\n\t\treturn $this;\n\t}", "public function __construct(\\Models\\Meeting $meeting, $documents = array()) {\n $this->meeting = $meeting;\n $this->documents = $documents;\n }", "public function __construct($committee_Meeting_ID = null, \\WorkdayWsdl\\\\StructType\\CommitteeObjectType $committee_Reference = null, \\WorkdayWsdl\\\\StructType\\Committee_Meeting_StatusObjectType $committee_Meeting_Status_Reference = null, $committee_Meeting_Host = null, \\WorkdayWsdl\\\\StructType\\Committee_Meeting_TypeObjectType $committee_Meeting_Type_Reference = null, $committee_Meeting_Subject = null, $committee_Meeting_Abstract = null, $committee_Meeting_Date = null, $committee_Meeting_Time = null, \\WorkdayWsdl\\\\StructType\\Time_ZoneObjectType $committee_Meeting_Time_Zone_Reference = null, $duration_in_Hours = null, $committee_Meeting_Location = null, $committee_Meeting_Invite_All_Members = null, array $committee_Member_Reference = array(), array $committee_Meeting_Attendee_Reference = array(), \\WorkdayWsdl\\\\StructType\\Committee_Meeting_Minutes_SubDataType $committee_Meeting_Minutes_Data = null, \\WorkdayWsdl\\\\StructType\\Committee_Meeting_AttachmentsType $attachments = null, array $committee_Meeting_Action_Item_Data = array(), array $committee_Meeting_Agenda_Item_Data = array())\n {\n $this\n ->setCommittee_Meeting_ID($committee_Meeting_ID)\n ->setCommittee_Reference($committee_Reference)\n ->setCommittee_Meeting_Status_Reference($committee_Meeting_Status_Reference)\n ->setCommittee_Meeting_Host($committee_Meeting_Host)\n ->setCommittee_Meeting_Type_Reference($committee_Meeting_Type_Reference)\n ->setCommittee_Meeting_Subject($committee_Meeting_Subject)\n ->setCommittee_Meeting_Abstract($committee_Meeting_Abstract)\n ->setCommittee_Meeting_Date($committee_Meeting_Date)\n ->setCommittee_Meeting_Time($committee_Meeting_Time)\n ->setCommittee_Meeting_Time_Zone_Reference($committee_Meeting_Time_Zone_Reference)\n ->setDuration_in_Hours($duration_in_Hours)\n ->setCommittee_Meeting_Location($committee_Meeting_Location)\n ->setCommittee_Meeting_Invite_All_Members($committee_Meeting_Invite_All_Members)\n ->setCommittee_Member_Reference($committee_Member_Reference)\n ->setCommittee_Meeting_Attendee_Reference($committee_Meeting_Attendee_Reference)\n ->setCommittee_Meeting_Minutes_Data($committee_Meeting_Minutes_Data)\n ->setAttachments($attachments)\n ->setCommittee_Meeting_Action_Item_Data($committee_Meeting_Action_Item_Data)\n ->setCommittee_Meeting_Agenda_Item_Data($committee_Meeting_Agenda_Item_Data);\n }", "public function search()\n {\n $day = $_POST['search_day'];\n $slot = $_POST['search_slot'];\n $timesResultArray = array();\n $daysResultArray = array();\n $coursesResultArray = array();\n $searchResultsArray = array();\n if (!empty($day) && !empty($slot))\n {\n $bookingFromTimesFacet = $this->timetable->findBookingsUsingTimesFacet($day, $slot);\n $bookingFromDaysFacet = $this->timetable->findBookingsUsingDaysFacet($day, $slot);\n $bookingFromCoursesFacet = $this->timetable-> findBookingsUsingCoursesFacet($day, $slot);\n \n if ($bookingFromTimesFacet != NULL && $bookingFromDaysFacet != NULL && $bookingFromCoursesFacet != NULL)\n {\n if ($bookingFromTimesFacet->time == $bookingFromDaysFacet->time && $bookingFromTimesFacet->time == $bookingFromCoursesFacet->time &&\n $bookingFromTimesFacet->day == $bookingFromDaysFacet->day && $bookingFromTimesFacet->day == $bookingFromCoursesFacet->day &&\n $bookingFromTimesFacet->course == $bookingFromDaysFacet->course && $bookingFromTimesFacet->course == $bookingFromCoursesFacet->course &&\n $bookingFromTimesFacet->room == $bookingFromDaysFacet->room && $bookingFromTimesFacet->room == $bookingFromCoursesFacet->room &&\n $bookingFromTimesFacet->instructor == $bookingFromDaysFacet->instructor && $bookingFromTimesFacet->instructor == $bookingFromCoursesFacet->instructor &&\n $bookingFromTimesFacet->type == $bookingFromDaysFacet->type && $bookingFromTimesFacet->type == $bookingFromCoursesFacet->type)\n {\n $bookingFromTimesFacet->facet = \"all\";\n $searchResultsArray[] = $bookingFromTimesFacet; \n $this->data['message'] = \"BINGO\";\n }\n else\n {\n $bookingFromTimesFacet->facet = \"times\";\n $searchResultsArray[] = $bookingFromTimesFacet;\n $bookingFromDaysFacet->facet = \"days\";\n $searchResultsArray[] = $bookingFromDaysFacet;\n $bookingFromCoursesFacet->facet = \"courses\";\n $searchResultsArray[] = $bookingFromCoursesFacet;\n $this->data['message'] = \"Inconsistent data found\";\n }\n }\n else if ($bookingFromTimesFacet == NULL && $bookingFromDaysFacet == NULL && $bookingFromCoursesFacet == NULL)\n {\n $this->data['message'] = \"No booking found\";\n }\n else \n {\n if ($bookingFromTimesFacet != NULL)\n {\n $bookingFromTimesFacet->facet = \"times\";\n $searchResultsArray[] = $bookingFromTimesFacet;\n }\n if ($bookingFromDaysFacet != NULL)\n {\n $bookingFromDaysFacet->facet = \"days\";\n $searchResultsArray[] = $bookingFromDaysFacet;\n }\n if ($bookingFromCoursesFacet != NULL)\n {\n $bookingFromCoursesFacet->facet = \"courses\";\n $searchResultsArray[] = $bookingFromCoursesFacet;\n }\n $this->data['message'] = \"Inconsistent data found\";\n }\n }\n else\n {\n $this->data['message'] = \"You must select both a day and a slot!\"; \n }\n $this->data['search_results'] = $searchResultsArray;\n $this->index(); \n }", "function __construct($election_id, $title, $num_positions, $created, $start_time, $end_time) {\n $this->election_id = $election_id;\n $this->title = $title;\n $this->num_positions = $num_positions;\n $this->created = $created;\n $this->start_time = $start_time;\n $this->end_time = $end_time;\n $this->candidates = array();\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.exactMatchLookupJob');\n }", "public function makeTimeTableSearch() {\n\n $timeTableDefaultSearch = \"\n <table width='10%' border='0' cellspacing='0px' cellpadding='0px' align='left'>\n <tr>\n <td class='contenttab_internal_rows' ><nobr><strong>&nbsp;From Date</strong></nobr></td>\n <td class='contenttab_internal_rows' align='left' ><nobr><b>&nbsp;:&nbsp;</b></nobr></td>\n <td class='contenttab_internal_rows' align='left'><nobr>\".$this->datePicker2('fromDate',date('Y-m-d')).\"</nobr></td>\n <td class='contenttab_internal_rows' align='left'><nobr><strong>&nbsp;&nbsp;To Date</strong></nobr></td>\n <td class='contenttab_internal_rows' align='left' ><nobr><b>&nbsp;:&nbsp;</b></nobr></td>\n <td class='contenttab_internal_rows' align='left'><nobr>\".$this->datePicker2('toDate',date('Y-m-d')).\"</nobr></td>\n </tr></table>\";\n\n return $timeTableDefaultSearch;\n }", "public function __construct(array $appointment_Specialty = array())\n {\n $this\n ->setAppointment_Specialty($appointment_Specialty);\n }", "public function __construct()\n {\n $this->matchCriterias = new GenericCollection(\n 'TiBeN\\\\Framework\\\\Entity\\\\MatchCriteria'\n );\n $this->criteriaSets = new GenericCollection(\n 'TiBeN\\\\Framework\\\\Entity\\\\CriteriaSet'\n );\n $this->orderCriterias = new GenericCollection(\n 'TiBeN\\\\Framework\\\\Entity\\\\OrderCriteria'\n ); \n // End of user code\n }", "public function findByStartingTrainings($time_missing){\n \t$now = new DateTime();\n\t\t$endTime = clone $now;\n\t\t$endTime->add(new \\DateInterval('PT'.$time_missing.'M'));\n $this->query_builder->andWhere('t.start < :ref_datetime')->setParameter('ref_datetime', $endTime->format('Y-m-d H:i:s'));\n\t\treturn $this;\n }", "public function __construct(array $getRepairtimeSubnodesTextSearchReturn = array())\n {\n $this\n ->setGetRepairtimeSubnodesTextSearchReturn($getRepairtimeSubnodesTextSearchReturn);\n }", "function cbs_service_meeting(){\n\t\t\n\t\t$meetings = array(\n\n\t\t\t// Date column\n\t\t\t'date' => array(\n\t\t\t\t'2015-02-09','2015-02-16','2015-02-23','2015-03-02'\n\t\t\t),\n\n\t\t\t// Start Prayer\n\t\t\t'start_prayer' => array(\n\t\t\t\t'Marcelo Paolino','Ricardo Rodríguez','Leonel Navarro','Iván Rivero'\n\t\t\t), \n\n\t\t\t// End Prayer\n\t\t\t'end_prayer' => array(\n\t\t\t\t'Michel Fuentes','Leonardo Guevara','Luis Sandes','Rubens Rivero'\n\t\t\t),\n\t\t\t\n\t\t\t// CBS Speaker\n\t\t\t'cbs_speaker' => array(\n\t\t\t\t'Luis Sandes','Rubens Rivero','Iván Rivero','Leonardo Guevara'\n\t\t\t),\n\t\t\t\n\t\t\t// CBS Lector\n\t\t\t'cbs_lector' => array(\n\t\t\t\t'Michel Fuentes','Diego Téliz','Marcelo Paolino','Humberto Cardozo'\n\t\t\t),\n\t\t\t\n\t\t\t// CBS Info\n\t\t\t'cbs_info' => array(\n\t\t\t\t'cl cap. 20 párrs. 1-7','cl cap. 20 párrs. 8-15','cl cap. 20 párrs. 16-21 y recuadro de la pág. 207','cl cap. 21 párrs.1-8'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Min 1\n\t\t\t'sm_min_1' => array(\n\t\t\t\t'15','15','10','10'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Speaker 1\n\t\t\t'sm_speaker_1' => array(\n\t\t\t\t'Germán Demarco','Leonardo Guevara','Luis Sandes','Ricardo Rodríguez'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Info 1\n\t\t\t'sm_info_1' => array(\n\t\t\t\t'“¿Por qué un cristiano debe ser ‘celoso de obras excelentes’?”','Preparémonos para proclamar las buenas nuevas con celo.','Necesidades de la congregación.','Ideas para ofrecer las revistas en marzo.'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Min 2\n\t\t\t'sm_min_2' => array(\n\t\t\t\t'15','15','10','10'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Speaker 2\n\t\t\t'sm_speaker_2' => array(\n\t\t\t\t'Iván Rivero','Carlos Cabrera','Rubens Rivero','Carlos Cabrera'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Info 2\n\t\t\t'sm_info_2' => array(\n\t\t\t\t'“Mejore sus habilidades en el ministerio: predique eficazmente a través del interfono.”','“¿Imitará usted el celo de Jehová y Jesús durante la época de la Conmemoración?”','Imite el celo por la adoración verdadera de Jesús.','“Motivémonos unos a otros con celo a las obras excelentes.”'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Min 3\n\t\t\t'sm_min_3' => array(\n\t\t\t\t'','','10','10'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Speaker 3\n\t\t\t'sm_speaker_3' => array(\n\t\t\t\t'','','Leonel Navarro','Leonel Navarro'\n\t\t\t),\n\t\t\t\n\t\t\t// SM Info 3\n\t\t\t'sm_info_3' => array(\n\t\t\t\t'','','“Proclamemos con celo la verdad sobre Jesús.”','¿Cómo nos fue?'\n\t\t\t)\n\t\t\t\n\t\t);\n\n\t\treturn $meetings;\n\t}", "public static function init(): self\n {\n return new self(new SearchShiftsRequest());\n }", "public function _load_schedule() {\n\t\t$this->data['schedule'] = array();\n\n\t\t$sql = \"SELECT ssrmeet_begin_time,\n\t\t\t\t\t\t\t\t\t ssrmeet_end_time,\n\t\t\t\t\t\t\t\t\t ssrmeet_bldg_code building_code,\n\t\t\t\t\t\t\t\t\t stvbldg_desc building,\n\t\t\t\t\t\t\t\t\t ssrmeet_room_code room_number,\n\t\t\t\t\t\t\t\t\t ssrmeet_start_date,\n\t\t\t\t\t\t\t\t\t ssrmeet_end_date,\n\t\t\t\t\t\t\t\t\t ssrmeet_catagory ssrmeet_category,\n\t\t\t\t\t\t\t\t\t ssrmeet_sun_day sunday,\n\t\t\t\t\t\t\t\t\t ssrmeet_mon_day monday,\n\t\t\t\t\t\t\t\t\t ssrmeet_tue_day tuesday,\n\t\t\t\t\t\t\t\t\t ssrmeet_wed_day wednesday,\n\t\t\t\t\t\t\t\t\t ssrmeet_thu_day thursday,\n\t\t\t\t\t\t\t\t\t ssrmeet_fri_day friday,\n\t\t\t\t\t\t\t\t\t ssrmeet_sat_day saturday,\n\t\t\t\t\t\t\t\t\t ssrmeet_schd_code schedule_type_code,\n\t\t\t\t\t\t\t\t\t stvschd_desc schedule_type,\n\t\t\t\t\t\t\t\t\t ssrmeet_credit_hr_sess session_credit_hours,\n\t\t\t\t\t\t\t\t\t ssrmeet_meet_no num_meeting_times,\n\t\t\t\t\t\t\t\t\t ssrmeet_hrs_week hours_per_week\n\t\t\t\t\t\t\tFROM ssrmeet,\n stvbldg,\n stvschd\n\t\t\t\t\t WHERE ssrmeet_crn = :crn \n\t\t\t\t\t\t\t AND ssrmeet_term_code = :term_code\n AND stvbldg_code = ssrmeet_bldg_code\n\t\t\t\t\t\t\t AND stvschd_code = ssrmeet_schd_code\n ORDER BY ssrmeet_start_date, ssrmeet_end_date, ssrmeet_begin_time\";\t\t\n\n\t\t$args = array(\n\t\t\t'crn' => $this->crn,\n\t\t\t'term_code' => $this->term_code\n\t\t);\n\n\t\tif($results = \\PSU::db('banner')->Execute($sql, $args)) {\n\t\t\tforeach($results as $row) {\n\t\t\t\t$row = \\PSU::cleanKeys('ssrmeet_', '', $row);\n\t\t\t\t$row['begin_time'] = preg_replace('/([0-9]{2})([0-9]{2})/', '\\1:\\2', $row['begin_time']);\n\t\t\t\t$row['end_time'] = preg_replace('/([0-9]{2})([0-9]{2})/', '\\1:\\2', $row['end_time']);\n\t\t\t\t$row['start_date'] = strtotime($row['start_date']);\n\t\t\t\t$row['end_date'] = strtotime($row['end_date']);\n\t\t\t\t$row['days'] = $row['sunday'].$row['monday'].$row['tuesday'].$row['wednesday'].$row['thursday'].$row['friday'].$row['saturday'];\n\t\t\t\t$this->data['schedule'][] = $row;\n\t\t\t}//end foreach\n\t\t}//end if\n\t\t$this->meeting_times = $this->meeting_locations = $this->schedule;\n\t}", "private function checkAppointmentScheduleConflicts($data) {\n $startDate = $data->getData('properties')['startDate'];\n $endDate = $data->getData('properties')['endDate'];\n $startTime = $data->getData('properties')['startTime'];\n $endTime = $data->getData('properties')['endTime'];\n $searchKey = [];\n $searchKey[0]['type'] = 'appointmentSchedule';\n $skipId = (!empty($data->getData('properties')['parentId'])) ? $data->getData('properties')['parentId'] : '';\n /* Check for overlapping conflicts for provider and patient */\n if (empty($data->getData('properties')['provider'])) {\n $searchKey[0]['conditions'][] = array('patientId' => array('IN' => $data->getData('properties')['patientId']));\n } else {\n $searchKey[0]['conditions'][] = array(\n array('provider' => array('IN' => $data->getData('properties')['provider'])),\n 'OR',\n array('patientId' => array('IN' => $data->getData('properties')['patientId']))\n );\n }\n //Exclude the id of self.\n if (!empty($data->getData('properties')['id'])) {\n $searchKey[0]['conditions'][] = array('id' => array('ne' => $data->getData('properties')['id']));\n }\n //Exclude the id of self.\n if (!empty($skipId)) {\n $searchKey[0]['conditions'][] = array('id' => array('ne' => $skipId));\n } else {\n if (!empty($data->getData('properties')['id'])) {\n $searchKey[0]['conditions'][] = array('parentId' => array('ne' => $data->getData('properties')['id']));\n }\n }\n if ($startDate == $endDate) {\n /* If passed startDate and endDate are same, conflicts are checked across for records already existing for same or different startDates and endDates, but lying between the passed intervals. */\n $searchKey[0]['conditions'][] = array(\n array(\n array('startDate' => array('ne' => $startDate)),\n 'AND',\n array('endDate' => $startDate),\n 'AND',\n array(\n array('endTime' => array('ge' => $startTime)),\n 'OR',\n array('endTime' => array('ge' => $endTime))\n )\n ),\n 'OR',\n array(\n array('endDate' => array('ne' => $startDate)),\n 'AND',\n array('startDate' => $startDate),\n 'AND',\n array(\n array('startTime' => array('le' => $startTime)),\n 'OR',\n array('startTime' => array('le' => $endTime))\n )\n ),\n 'OR',\n array(\n array('startDate' => $startDate),\n 'AND',\n array('endDate' => $startDate),\n 'AND',\n array(\n array(\n array(\n array('startTime' => array('ge' => $startTime)),\n 'AND',\n array('startTime' => array('le' => $endTime))\n ),\n 'OR',\n array(\n array('endTime' => array('ge' => $startTime)),\n 'AND',\n array('endTime' => array('le' => $endTime))\n )\n ),\n 'OR',\n array(\n array(\n array('startTime' => array('le' => $startTime)),\n 'AND',\n array('endTime' => array('ge' => $startTime))\n ),\n 'OR',\n array(\n array('startTime' => array('le' => $endTime)),\n 'AND',\n array('endTime' => array('ge' => $endTime))\n )\n )\n )\n )\n );\n } else {\n /* If passed startDate and endDate are not same, conflicts are checked with the requested time/date frames. */\n $searchKey[0]['conditions'][] = array(\n array(\n array('startDate' => $startDate),\n 'AND',\n array('startDate' => array('ne' => $endDate)),\n 'AND',\n array(\n array('startTime' => array('ge' => $startTime)),\n 'OR',\n array('endTime' => array('ge' => $startTime))\n )\n ),\n 'OR',\n array(\n array('endDate' => $endDate),\n 'AND',\n array('startDate' => array('ne' => $startDate)),\n 'AND',\n array(\n array('startTime' => array('le' => $endTime)),\n 'OR',\n array('endTime' => array('le' => $endTime))\n )\n ),\n 'OR',\n array(\n array('startDate' => $startDate),\n 'AND',\n array('endDate' => $endDate)\n )\n );\n }\n $searchKey[0]['outKey'] = 'response'; \n $searchKey[0]['conditions'][] = array('appointmentStatus' => array('NOTIN' => array(self::STATUS_CANCELLED, self::STATUS_CANCELLED_24, self::STATUS_CANCELLED_PROVIDER, self::STATUS_RESCHEDULED)));\n $checkAppointmentConflicts = $this->serviceQue->executeQue(\"ws_oml_read\", $searchKey);\n if (!empty($checkAppointmentConflicts['data']['response'])) {\n $conflictingAppointments = 'A conflicting appointment exists with start date: ' . $checkAppointmentConflicts['data']['response'][0]['startDate'] . ' and end date: ' . $checkAppointmentConflicts['data']['response'][0]['endDate'] . ' at start time ' . $checkAppointmentConflicts['data']['response'][0]['startTime'] . ' and endtime ' . $checkAppointmentConflicts['data']['response'][0]['endTime'] . ' with this provider/patient';\n throw new SynapExceptions(SynapExceptionConstants::CONFLICTING_APPOINTMENTS,400, array('conflictingAppointments' => $conflictingAppointments));\n }\n }", "public function InstantiateTimesPrep()\n {\n\n $model = new Office();\n $model_office_timetable = new Officetimetable();\n \n $office_id = Yii::$app->db->getLastInsertID();\n $user_id = Yii::$app->user->identity->id;\n\n foreach ($model->times as $key => $value) {\n // the array values below should be arranged as folllows:\n // ['day_and_time', 'user_id', 'status', 'office_id']\n $data[] = [$value,$user_id,'0',$office_id];\n }\n \n // Insert the prepared data array into the table\n // by passing it to the batchInsertTimes() method\n $model_office_timetable->batchInsertTimes($data);\n }", "public function __construct()\n {\n parent::__construct();\n $this->rulesBirth = array(1, 3, 5, 7);\n $this->rulesStayAlive = array(1, 3, 5, 7);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Route notifications for the Slack channel.
public function routeNotificationForSlack($notification) { return env('WEBHOOK_URL'); }
[ "public function routeNotificationForSlack() {\n return 'https://hooks.slack.com/services/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';\n }", "public function routeNotificationForSlack()\n {\n return \"https://hooks.slack.com/services/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\";\n }", "public function routeNotificationForSlack()\n {\n return FantasyFootball::getSlackChannelWebhook();\n }", "public function routeNotificationForSlack()\n {\n if ($this->send_slack_messages) {\n return $this->slack_webhook_url;\n }\n }", "private function routeNotificationForSlack()\n {\n return config('services.slack.webhook_url');\n }", "public function routeNotificationForSlack()\n {\n return config('slack.incoming-webhook');\n }", "public function routeNotificationForSlack()\n {\n return $this->slack_webhook_url;\n }", "public function routeNotificationForSlack()\n {\n $slack = SlackSetting::first();\n return $slack->slack_webhook;\n }", "public function routeNotificationForDiscord(): string\n {\n return 'https://discordapp.com/api/webhooks/12345/super-secret';\n }", "public function routeNotificationForDiscord(): string\n {\n return $this->discordWebhookUrl;\n }", "public function routeNotificationForMail():string;", "public function routeNotificationFor($driver);", "public static function sendSlackNotification() {\n $response = array(\n 'status' => false,\n 'message' => trans('messages.common_error'),\n 'data' => array()\n );\n try {\n $enableSlack = env('SLACK_ENABLE', \"0\");\n $slackBaseUrl = env('PUBLIC_URL', \"\");\n if ($enableSlack == '1') {\n $message = \"@channel\\n\\nA new order just came through!\\n\\nFROM ALCHEMY WINGS\\n\\nLog on to <\".$slackBaseUrl.\"> process the order\";\n Slack::send($message);\n }\n $response['status'] = true;\n } catch (Exception $ex) {\n CommonHelper::event($ex->getMessage() . \"|\" . $ex->getFile(). \"|\" . $ex->getLine(), CommonHelper::EMAIL_FAILURE_LOG_FILE, CommonHelper::DAILY);\n }\n return $response;\n }", "function _slack_notification($slack_url, $channel, $username, $text, $attachment, $alwaysShowText = false)\n{\n $attachment['fallback'] = $text;\n $post = array(\n 'username' => $username,\n 'channel' => $channel,\n 'icon_emoji' => ':pantheon:',\n 'attachments' => array($attachment)\n );\n if ($alwaysShowText) {\n $post['text'] = $text;\n }\n $payload = json_encode($post);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $slack_url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n // Watch for messages with `terminus workflows watch --site=SITENAME`\n print(\"\\n==== Posting to Slack ====\\n\");\n $result = curl_exec($ch);\n print(\"RESULT: $result\");\n // $payload_pretty = json_encode($post,JSON_PRETTY_PRINT); // Uncomment to debug JSON\n // print(\"JSON: $payload_pretty\"); // Uncomment to Debug JSON\n print(\"\\n===== Post Complete! =====\\n\");\n curl_close($ch);\n}", "public function notifications()\n {\n $user = Auth::user();\n $channels = $user->newChannels()->paginate(10);\n \n $user->setHasViewNew();\n\n return view('dashboard.pages.view_channels', compact('channels'));\n }", "public function routeNotificationForTelegram()\n {\n return $this->userChannels()->where('name', 'telegram_id')->first()->value;\n }", "public function routeNotificationForMail()\n {\n return config('update.notifications.mail.to');\n }", "function sb_slack_listener($response) {\n if (isset($response['event'])) {\n $response = $response['event'];\n $subtype = isset($response['subtype']) ? $response['subtype'] : '';\n $GLOBALS['SB_FORCE_ADMIN'] = true;\n\n // Message: Check if the json response is a valid message\n if (isset($response['type']) && $response['type'] == 'message' && $subtype != 'channel_join' && ($subtype == '' || $subtype == 'file_share') && ($response['text'] != '' || (is_array($response['files']) && count($response['files']) > 0))) {\n\n // Get the user id of the slack message\n $user_id = sb_slack_api_user_id($response['channel']);\n\n // Elaborate the Slack message\n if ($user_id != -1) {\n $last_message = sb_slack_last_user_message($user_id);\n $message = $response['text'];\n $user = sb_get_user($user_id);\n\n // Emoji\n $emoji = explode(':', $message);\n if (count($emoji)) {\n $emoji_slack = json_decode(file_get_contents(SB_PATH . '/resources/json/emoji-slack.json'), true);\n for ($i = 0; $i < count($emoji); $i++) {\n if ($emoji[$i] != '') {\n $emoji_code = ':' . $emoji[$i] . ':';\n if (isset($emoji_slack[$emoji_code])) {\n $message = str_replace($emoji_code, $emoji_slack[$emoji_code], $message);\n }\n }\n }\n }\n\n // Message\n $message = sb_slack_response_message_text($message);\n\n // Attachments\n $attachments = $subtype == 'file_share' ? sb_slack_response_message_attachments($response['files']) : [];\n\n // Set the user login\n global $SB_LOGIN;\n $SB_LOGIN = ['id' => $user_id, 'user_type' => 'user'];\n\n // Get the agent id\n $agent_id = sb_db_escape(sb_slack_api_agent_id($response['user']));\n\n // Send the message\n $send_response = sb_send_message($agent_id, $last_message['conversation_id'], $message, $attachments, 1, $response);\n\n // Notifications\n if (!sb_is_error($send_response) && isset($send_response['message-id']) && !sb_is_user_online($user_id)) {\n if (sb_get_setting('notify-user-email') && $user['email']) {\n $agent = sb_db_get('SELECT first_name, last_name, profile_image FROM sb_users WHERE id = ' . $agent_id);\n sb_email_create($user_id, sb_get_user_name($agent), $agent['profile_image'], $message, $attachments);\n }\n if (sb_get_setting('sms-active-users')) {\n $phone = sb_get_user_extra($user_id, 'phone');\n if ($phone) {\n sb_send_sms($message, $phone, true, $last_message['conversation_id']);\n }\n }\n }\n\n // Pusher online status\n if (sb_pusher_active()) {\n sb_pusher_trigger('private-user-' . $user_id, 'add-user-presence', [ 'agent_id' => $agent_id]);\n }\n\n }\n }\n\n // Event: message deleted\n if ($subtype == 'message_deleted') {\n $user_id = sb_db_escape(sb_slack_api_user_id($response['channel']));\n $agent_id = sb_slack_api_agent_id($response['previous_message']['user']);\n $last_message = sb_slack_last_user_message($user_id);\n $online = sb_update_users_last_activity(-1, $user_id) === 'online';\n $previous_message = sb_db_escape($response['previous_message']['text']);\n sb_db_query(($online ? 'UPDATE sb_messages SET message = \"\", attachments = \"\", payload = \"{ \\\"event\\\": \\\"delete-message\\\" }\", creation_time = \"' . gmdate('Y-m-d H:i:s') . '\"' : 'DELETE FROM sb_messages') . ' WHERE (user_id = ' . $agent_id . ' OR user_id = ' . $user_id . ') AND conversation_id = \"' . $last_message['conversation_id'] . '\" AND ' . ($previous_message == '' ? 'attachments LIKE \"%' . sb_db_escape($response['previous_message']['attachments'][0]['title']) . '%\"' : 'message = \"' . $previous_message . '\"') .' LIMIT 1');\n }\n\n // Event: message changed\n if ($subtype == 'message_changed') {\n $agent_id = sb_db_escape(sb_slack_api_agent_id($response['previous_message']['user']));\n sb_db_query('UPDATE sb_messages SET message = \"' . sb_db_escape(sb_slack_response_message_text($response['message']['text'])) . '\", creation_time = \"' . gmdate('Y-m-d H:i:s') . '\" WHERE user_id = ' . $agent_id . ' AND payload LIKE \"%' . sb_db_escape($response['message']['ts']) . '%\" LIMIT 1');\n }\n $GLOBALS['SB_FORCE_ADMIN'] = false;\n }\n}", "public function sendNotifications()\n {\n $token = $this->getConfigValue('token');\n $client = new Client($token);\n\n foreach ($this->notifications as $notification) {\n $options = [\n 'as_user' => true,\n 'channel' => $notification['channel'],\n 'text' => $notification['message'],\n ];\n\n $client->postMessage($options);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
global scope variable can only be accessed outside of a function
function myTest() { // this function does not have access to global scope variables echo isset($gx) ? "gx is set" : "gx is not set"; }
[ "function access(){\n global $x;\n echo $x;\n }", "function test() {\n\tglobal $foo;\n\treturn $foo;\n}", "function getNum3() {\n echo $GLOBALS['globalna3']; // drugi sposob\n}", "function globalExample()\n {\n global $globalVar;\n echo \"This is a $globalVar\";\n }", "public function getGlobals()\n {\n }", "function globalsTest(){\r\n \r\n $stick = 'bauer';//local scope\r\n echo '$stick is of the type: '.$GLOBALS[\"stick\"].'<br>';//displays the global scope\r\n echo '$stick is of the brand: '.$stick.' internally<br><br>';//displays the local scope\r\n }", "function test(){\n // global : inclut une variable du scope global dans la fonction.\n global $nom;\n var_dump($nom);\n }", "function variablesGlobales() {\n $local = \"Soy la variable local\";\n echo $GLOBALS[\"global\"];\n echo $local;\n }", "public function getGlobals();", "function readGlobal()\r\n{\r\n\tglobal $data;\r\n\tvar_dump($data);\r\n\techo \"<br>\";\r\n\t//with global we can modify imported element\r\n\t$data['letters']='def';\r\n\tvar_dump($data);\r\n}", "private function globalVariable($value) {\r\n if ($value != null) {\r\n $this->_except(\"Directive \\\"\" . $this->key . \"\\\" does not accept an argument\");\r\n }\r\n\r\n $globval = $this->caller->_globals()->get($this->caller->identifier());\r\n if ($globval != null) { # invoke GET behavior\r\n echo \"USING GET BEHAVIOR IN \" . $this->caller->identifier() . \"<br>\\n\";\r\n $this->caller->replace($globval); #FIXME: this should replace the caller with the global reference, not just use the global value\r\n }\r\n else { # invoke SET behavior\r\n echo \"USING SET BEHAVIOR IN \" . $this->caller->identifier() . \"<br>\\n\";\r\n $this->caller->_globals()->add(new Resource($this->caller->identifier(), $this->caller));\r\n }\r\n }", "function myFunction(){\n\n\t\t\tglobal $a;\n\n\t\t\tprint \"<p>Inside the function, <br/>\n\t\t\t\\$a is '$a', and <br/>\n\t\t\t\\$b is '$b'</p>\";\t\n\n\t\t}", "function getGlobal($key) {\n \t\treturn $GLOBALS[$key];\n \t}", "protected static function initializeGlobalVariables() {}", "function Obj(){\n return $GLOBALS['NP'];\n}", "function tampilX(){\n global $x; // mencari variabel X diluar function\n // $x = 20;\n echo $x; // variabel yang dibuat dalam function hanya berlaku didalam function itu saja\n}", "function afficher($a){\n global $b;\n\n $b=$a+5;\n\n echo $b. '<br>';\n}", "protected function _applyGlobalVars() \n {\n $this->view->getEnvironment()->share('g', $this->output->cfg('globals'));\n }", "static function test(){\n echo self::$maVar;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test post workout throws exception when JSON response error field is not null.
public function testPostWorkoutThrowsExceptionWhenJSONResponseErrorFieldIsNotNull() { $strava = $this->getStravaAPIMock(array(__DIR__ . '/Fixtures/testPostWorkoutThrowsExceptionWhenJSONResponseErrorFieldIsNotNull.txt')); $workout = new Workout(); $this->setExpectedException('RuntimeException', 'Strava returned error message: There was an error. Status: Some status message.'); $strava->postWorkout($workout); }
[ "public function testPostWithError()\n {\n $response = $this->handlePostData(\n [\n 'description' => 'some description',\n 'license' => 'MIT'\n ]\n );\n\n $result = json_decode($response->getContent(), true);\n\n $this->assertEmpty($result['warnings']);\n $this->assertNotEmpty($result['errors']);\n $this->assertEquals('ERROR', $result['status']);\n }", "public function test_if_no_input_fails_validation()\n {\n $response = $this->postJson(self::API_PATH, []);\n $response->assertStatus(422); \n\n $response = $this->postJson(self::API_PATH);\n $response->assertStatus(422); \n }", "public function test_ShouldThrowException_IfThereIsNoParamsSended()\n {\n $this->tempJson = [];\n $response = $this->storeWarehouse();\n $response->assertStatus(422);\n }", "public function test_ShouldThrowException_IfNoParamIssended()\n {\n $this->tempJson = [];\n $response = $this->storeItem();\n $this->assertError($response, 422);\n }", "public function testPostError()\n {\n $this->setGuzzleMockHandler(self::POST_ERROR_FIX);\n\n $response = $this->client->post('domains/123/nameservers/records',[\n 'name' => '@',\n 'value' => '172.0.0.1',\n 'ttl' => 180,\n 'priority' => 0,\n 'type' => 'A',\n ]);\n\n $this->assertEquals(500, $response['code']);\n $this->assertEquals('Nameserver update failed', $response['message']);\n $this->assertEmpty($response['body']);\n $this->assertEmpty($response['location']);\n }", "public function testCreateWithoutDataError()\n {\n $this->dispatch('/test/rest/', [], RequestMethod::POST);\n self::assertResponseCode(StatusCode::BAD_REQUEST);\n }", "public function testEndpointTravelOrHPYieldsErrorIfInvalidQueryGiven()\n {\n $response = $this->json('GET', '/api/xp/travel?base=j');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/hp?base=-18');\n $response->assertStatus(422);\n $response = $this->json('GET', '/api/xp/hp?mod=1.5');\n $response->assertStatus(422);\n }", "public function testPostTaskInvalidParameter()\n {\n $todo = factory(\\App\\Todo::class)->make(['done' => 'test']);\n\n $this->post('/api/todo', $todo->toArray())->seeStatusCode('422');\n }", "public function testJsonPostGameFailRandomJsonAction()\n {\n $response = $this->jsonPostGameRequest('{\"jambon\": \"beurre\"}'); // content is not valid\n\n $this->assertJsonResponse($response, 422);\n }", "public function testSubmitResultHostBadJsonProperties()\n {\n $submitResultController = new SubmitResultController($this->submitResultService);\n $submitResultController->setContainer($this->container);\n\n $this->request->expects($this->any())\n ->method('getContent')\n ->willReturn($this->wrongJsonSubmitResult);\n $this->expectException(\\InvalidArgumentException::class);\n //$this->expectExceptionMessage('[status] The property status is required');\n $submitResultController->submitResultHost($this->request, $this->hostResource->getId());\n }", "public function testOneFieldlessErrorJSON() {\n $vld = $this->createErrors('', 1);\n $json = $vld->jsonSerialize();\n $this->assertEquals(['message' => '!Validation failed.', 'code' => 400, 'errors' => [\n '' => [['error' => 'error 1', 'message' => '!error 1']]\n ]], $json);\n }", "public function testPostItemBadJson()\n {\n $this->di->get(\"request\")->setBody(\"{ bad json }\");\n $res = $this->controller->postItem(\"users\");\n\n $json = $res[0];\n $status = $res[1];\n $this->assertContains(\"valid JSON\", $json[\"message\"]);\n $this->assertEquals(500, $status);\n }", "public function test_department_can_not_save_with_empty_input_field()\n {\n\n $response = $this->json('POST', '/department', ['department_name' => '']);\n\n $response\n ->assertStatus(422); \n }", "public function test_a_user_cannot_create_a_location_without_name()\n {\n $tripData = [\n \"state_id\" => 1,\n ];\n $this->json('POST', 'api/location', $tripData, ['Accept' => 'application/json'])\n ->assertStatus(422);\n \n }", "public function testPostPerson422UnprocessableEntity(): void\n {\n $p_data = [\n // 'name' => self::$faker->words(3, true),\n 'birthDate' => self::$faker->date(),\n 'deathDate' => self::$faker->date(),\n 'imageUrl' => self::$faker->imageUrl(),\n 'wikiUrl' => self::$faker->url\n ];\n $response = $this->runApp(\n 'POST',\n self::RUTA_API,\n $p_data,\n self::$writer['authHeader']\n );\n $this->internalTestError($response, StatusCode::STATUS_UNPROCESSABLE_ENTITY);\n }", "public function testSubmitInvalidToken()\n {\n $this->instantiates();\n $this->json('post','/api/v1/transactions/submit',[\n ])->seeJson(['status'=>ResponseStatus::ERROR,'code'=>ResponseCode::CUSTOMER_INVALID_TOKEN]);\n }", "public function testPostCreationFailsValidation()\n {\n $this->actingAs( $this->user )\n ->json( 'POST', '/post/create', [\n ] )\n ->assertResponseStatus( 422 );\n }", "public function testPostInvalidJobReturnsBadRequest()\n {\n $this->defaultJob['title'] = '';\n\n $this->client->request(\n 'POST',\n '/job',\n [],\n [],\n ['CONTENT_TYPE' => 'application/json'],\n json_encode($this->defaultJob)\n );\n\n $this->assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode());\n }", "public function testPostRequestWithBrokenUrl()\n {\n $response = $this->post('/api/upload',[\n 'imageFile' => [\n self::TEST_IMG_BROKEN_URL,\n ],\n ]);\n\n $response\n ->assertStatus(415)\n ->assertJsonStructure([\n 'code',\n 'message'\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to get local_id to Acronym.
public function getLocalIDToAcronym($acronym) { $local = $this->db->selectObj('SELECT local_id FROM local ' . 'WHERE acronym = :acronym', array(':acronym' => $acronym), "Local"); return $local; }
[ "public function GetAcronym() {\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['akronym'];\n\t}", "public function getAcronymCode()\n {\n return $this->acronymCode;\n }", "public function getAcronym() {\n $this->loadDataFromDegree();\n return $this->data->acronym;\n }", "public function GetAcronym() \r\n {\r\n return isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;\r\n }", "public function getAcronym()\n {\n return $this->acronym;\n }", "public function getHumanIdentifier();", "public function GetAcronym() \n {\n return $this->acronym;\n }", "public function getExternalId();", "public function getPrimaryIdentifier();", "public function getAbbreviation() : string\n {\n return $this->abbreviationPerson;\n }", "private function getPrimaryName() {\n return 'id_' . $this->table;\n }", "public function getJournalAbbreviation();", "function getLocalizedPrimarySponsorText(){\r\n\t\treturn $this->articleDAO->getAgency($this->getLocalizedPrimarySponsor());\r\n\t}", "public function getTwoLetterAbbreviation();", "function getLocalizedAbbrev() {\n\t\treturn $this->getLocalizedData('abbrev');\n\t}", "public static function obtainIdentifierFieldName();", "public function getNameId();", "function getKeyImplInstitutionAcronym() {\n $institutionDao =& DAORegistry::getDAO('InstitutionDAO');\n $institution = $institutionDao->getInstitutionById($this->getKeyImplInstitution());\n\t\treturn $institution->getInstitutionAcronym();\n }", "public function getAbbreviation(): string\n {\n return $this->abbreviation;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ You'll note that I used php's array pointer functions in the _postProcess function. In fact it looks like I made a foreach overly complicated in the 'open' case of the switch statement. However this is not the case. By using the array pointer functions, each time you go another call deeper (or shallower) in the recursion it doesn't loose its place in the structure array.
function _postProcess() { $item = current($this->_struct); $ret = array('_name'=>$item['tag'], '_attributes'=>array(), '_value'=>null); if (isset($item['attributes']) && count($item['attributes'])>0) { foreach ($item['attributes'] as $key => $data) { if (!is_null($data)) { $item['attributes'][$key] = str_replace($this->_replaceWith, $this->_replace, $item['attributes'][$key]); } } $ret['_attributes'] = $item['attributes']; if ($this->attributesDirectlyUnderParent) $ret = array_merge($ret, $item['attributes']); } if (isset($item['value']) && $item['value'] != null) $item['value'] = str_replace($this->_replaceWith, $this->_replace, $item['value']); switch ($item['type']) { case 'open': $children = array(); while (($child = next($this->_struct)) !== FALSE ) { if ($child['level'] <= $item['level']) break; $subItem = $this->_postProcess(); if (isset($subItem['_name'])) { if (!isset($children[$subItem['_name']])) $children[$subItem['_name']] = array(); $children[$subItem['_name']][] = $subItem; } else { foreach ($subItem as $key=>$value) { if (isset($children[$key])) { if (is_array($children[$key])) $children[$key][] = $value; else $children[$key] = array($children[$key], $value); } else { $children[$key] = $value; } } } } if ($this->childTagsDirectlyUnderParent) $ret = array_merge($ret, $this->_condenseArray($children)); else $ret['_value'] = $this->_condenseArray($children); break; case 'close': break; case 'complete': if (count($ret['_attributes']) > 0) { if (isset($item['value'])) $ret['_value'] = $item['value']; } else { if (isset($item['value'])) { $ret = array($item['tag']=> $item['value']); } else { $ret = array($item['tag']=> ""); } } break; } //added by Dan Coulter /* foreach ($ret as $key => $data) { if (!is_null($data) && !is_array($data)) { $ret[$key] = str_replace($this->_replaceWith, $this->_replace, $ret[$key]); } } */ return $ret; }
[ "function traverse(&$response, &$level, &$values, &$line, &$used, $uncheck, &$lastkey, &$aggregate) {\n static $reverseSource, $reverseValues = array();\n\n\n foreach($level as $source => $attributes) {\n\n if (is_array($attributes)) {\n $attr = $attributes[0];\n $children = $attributes[1];\n } else {\n $attr = new stdClass();\n $children = $attributes;\n }\n\n if ($attr->constant) {\n $v = $source;\n } else if ($attr->accessor) {\n $v = $source($line);\n\n if ($v === false) {\n continue;\n }\n } else {\n $v = $line[$source];\n\n if ($v == '') {\n continue;\n }\n }\n\n if ($attr->filter) {\n if ($attr->filter->$v) {\n continue;\n }\n }\n\n if (!isset($reverseSource[$source])) {\n $sourceKey = nextSourceKey();\n $reverseSource[$source] = $sourceKey;\n $reverseValues[$sourceKey] = array();\n $response['sources'][$sourceKey] = $source;\n } else {\n $sourceKey = $reverseSource[$source];\n }\n\n //TODO this is fragile\n $reverseKey = $v.':'.$lastkey;\n\n if (!isset($reverseValues[$sourceKey][$reverseKey])) {\n $key = nextValKey();\n $reverseValues[$sourceKey][$reverseKey] = $key;\n $response['nodes'][$key] = $v;\n\n $values[$key] = array(\n 'ch' => array(),\n );\n\n\n if ($attr->special && is_string($attr->special)) {\n $values[$key]['id'] = $attr->special;\n } else if ($attr->special && $attr->special->$v) {\n $values[$key]['id'] = $attr->special->$v;\n }\n\n if ($attr->fixed && is_string($attr->fixed)) {\n $values[$key]['fixed'] = 1;\n } else if ($attr->fixed && is_int($attr->fixed)) {\n $values[$key]['fixed'] = 1;\n } else if ($attr->fixed && $attr->fixed->$v) {\n $values[$key]['fixed'] = 1;\n }\n\n if ($attr->nocheckbox) {\n $values[$key]['nocheckbox'] = 1;\n }\n if ($attr->noaggregate) {\n $values[$key]['noaggregate'] = 1;\n }\n if ($attr->noexpand) {\n $values[$key]['noexpand'] = 1;\n }\n if ($attr->hidden) {\n $values[$key]['hidden'] = 1;\n }\n\n if ($attr->order) {\n $index = array_search($v, $attr->order);\n if ($index !== false) {\n $values[$key]['order'] = $index + 1;\n }\n }\n\n $response['nodeSource'][$key] = $sourceKey;\n } else {\n $key = $reverseValues[$sourceKey][$reverseKey];\n }\n\n if ($uncheck || $attr->uncheck) {\n $uncheck = $values[$key]['uncheck'] = 1;\n }\n\n $use = true;\n $resetagg = false;\n if ($attr->aggregate) {\n $resetagg = true;\n $oldaggregate = $aggregate;\n $aggregate = $attr->aggregate;\n }\n if (isset($aggregate)) {\n if (!isset($line[$aggregate])) {\n $use = false;\n }\n }\n\n\n traverse(&$response, $children, $values[$key]['ch'], $line, &$used, $uncheck, $key, $aggregate);\n\n if (!count($values[$key]['ch'])) {\n unset($values[$key]['ch']);\n //This is a leaf node\n if (!$values[$key]['nocheckbox'] && !$values[$key]['noaggregate'] && $use)\n $used[] = $key;\n }\n if ($resetagg)\n $aggregate = $oldaggregate;\n }\n }", "function buildTreeLanguageVariantNow($objPages, $intLevel = 0)\n{\n global $objModelFolders, $core;\n\n foreach ($objPages as $objPage) {\n\n for ($i = 0; $i < ($intLevel * 2); $i++) {\n echo \"-\";\n }\n echo $objPage->id . ' :: ' . $objPage->elementType . ' :: ' . $objPage->title . '|' . $objPage->guiTitle . ' :: ' . $objPage->genericFormId . ' :: ' . $objPage->templateId . \"\\n\";\n\n switch ($objPage->elementType) {\n case 'folder':\n $objNewPage = $objModelFolders->loadChildNavigation($objPage->id);\n buildFolderLanguageVariant($objPage);\n buildTreeLanguageVariantNow($objNewPage, ($intLevel + 1));\n break;\n case 'page':\n buildPageLanguageVariant($objPage);\n break;\n }\n }\n}", "abstract protected function getStructure(): array;", "function parse_incoming_recursively( &$data, $input=array(), $iteration = 0 )\r\n\t{\r\n\t\t// Crafty hacker could send something like &foo[][][][][][]....to kill Apache process\r\n\t\t// We should never have an input array deeper than 10..\r\n\t\t\r\n\t\tif( $iteration >= 10 )\r\n\t\t{\r\n\t\t\treturn $input;\r\n\t\t}\r\n\t\t\r\n\t\tif( count( $data ) )\r\n\t\t{\r\n\t\t\tforeach( $data as $k => $v )\r\n\t\t\t{\r\n\t\t\t\tif ( is_array( $v ) )\r\n\t\t\t\t{\r\n\t\t\t\t\t//$input = $this->parse_incoming_recursively( $data[ $k ], $input );\r\n\t\t\t\t\t$input[ $k ] = $this->parse_incoming_recursively( $data[ $k ], array(), $iteration+1 );\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\t\r\n\t\t\t\t\t$k = $this->parse_clean_key( $k );\r\n\t\t\t\t\t$v = $this->parse_clean_value( $v );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$input[ $k ] = $v;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $data = $input;\r\n\t}", "static private function _assembleTagTree() {\n\t\t$tagsData = self::_retrieveTagData();\n\n\t\t// reformat the array to name => data\n\t\tforeach ($tagsData as $index => $tagData) {\n\t\t\t$tagsData[$tagData['name']] = $tagData;\n\t\t\tunset($tagsData[$index]);\n\t\t}\n\t\tforeach ($tagsData as $name => $tagData) {\n\t\t\tself::$_upTree[$name] = self::_findRootPath($name, $tagsData);\n\t\t}\n\t}", "function acf_update_nested_array(&$array, $ancestors, $value)\n{\n}", "function traverseArray($iterator, $level = 0) {\t\n\n\t\t// Define some variables here\n\t\t$indentPrint = str_repeat(\" \", $level);\n\t\t\n\t\t// Loop through the iterator until the valid method no longer returns true\n\t\twhile ($iterator->valid()) {\n\t\t\t\n\t\t\t// Check to see if the value provided is an array\n\t\t\tif ($iterator->hasChildren()) {\n\t\t\t\t// This key has an array in it, so we need to make this a heading\n\t\t\t\techo $indentPrint . $iterator->key() . PHP_EOL;\n\t\t\t\t// Now re-call the function with an incremented level\n\t\t\t\ttraverseArray($iterator->getChildren(), ++$level);\n\t\t\t} else {\n\t\t\t\t//This has does not have an array in it, so just echo out the information\n\t\t\t\techo $indentPrint . $iterator->key() . ' = ' . $iterator->current() . PHP_EOL;\n\t\t\t}\n\t\t\t// Go to next item in the array iterator\n\t\t\t$iterator->next();\n\t\t}\n\t}", "function acf_update_nested_array( & $array, $ancestors, $value) {}", "function acf_update_nested_array( &$array, $ancestors, $value ) {\n}", "function nesting_depth_fix0() {\n $arr = [0, 1, 2, 3, 4];\n\n foreach ($arr as $i => $val) {\n increment_array_if_index_not_zero($i, $arr);\n }\n\n foreach ($arr as $val) {\n echo $val . ' ';\n }\n}", "function array_walk_recursive(&$array, callable $callback, $arg = null): void\n{\n error_clear_last();\n if ($arg !== null) {\n $safeResult = \\array_walk_recursive($array, $callback, $arg);\n } else {\n $safeResult = \\array_walk_recursive($array, $callback);\n }\n if ($safeResult === false) {\n throw ArrayException::createFromPhpError();\n }\n}", "public function startArray() : void\n\t{\n\t\t// If the document starts with an array, ignore it\n\t\tif ($this->depth === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->depth++;\n\n\t\t// Asterisks indicate that the current position is within an array\n\t\tif (!empty($this->target)) {\n\t\t\t$this->breadcrumbs[] = '*';\n\t\t}\n\n\t\t// If the target is an array, extract its JSON objects but ignore the wrapping array\n\t\tif ($this->shouldBeExtracted() && !$this->isTarget()) {\n\t\t\t$this->stack[] = [];\n\t\t}\n\t}", "function array_walk_recursive (array &$input, callable $funcname, $userdata = null) {}", "function openedObjectsTree($openedObjects) {\n $html = '<ul class=\"dropdown-menu\" aria-expanded=\"true\">';\n //FIRST LEVEL\n foreach ($openedObjects as $objectType => $data) {\n $html.=' <li class=\"menu-item dropdown dropdown-submenu\">';\n $html.='<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">' . $objectType . '</a>';\n //SECOND LEVEL\n $html.=' <ul class=\"dropdown-menu\">';\n foreach ($data as $objectName => $openedObjects) {\n $html.=' <li class=\"menu-item dropdown dropdown-submenu\">';\n $html.='<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">' . $objectName . '</a>';\n //THIRD LEVEL\n $html.=' <ul class=\"dropdown-menu\">';\n foreach ($openedObjects as $internal_number => $objectData) {\n if ($objectData['new'] == 1) {\n $html.='<li class=\"menu-item \"><a href=\"' . $objectData['url'] . '\"><span class=\"glyphicon glyphicon-folder-open\"></span>' . $internal_number . ', Opened:' . $objectData['created_at'] . '</a></li>';\n } else {\n $html.='<li class=\"menu-item \"><a href=\"' . $objectData['url'] . '\"><span class=\"glyphicon glyphicon-edit\"></span>' . $internal_number . ', Opened:' . $objectData['created_at'] . '</a></li>';\n }\n }\n $html.='</ul>';\n $html.='</li>';\n }\n $html.='</ul>';\n $html.='</li>';\n }\n\n $html.='<li role=\"separator\" class=\"divider\"></li>\n <li><a href=\"#\" id=\"closeAllForms\">\n <span class=\"glyphicon glyphicon-remove-circle\"></span>' . Translation::get('labels_close-all') . '</a></li>';\n\n $html.='</ul>';\n return $html;\n}", "function ext_tree($parent_id, $con, $lev, $info) {\n\n // rows selection from TBSM tables\n $sel = \"SELECT SERVICEINSTANCEID, SERVICEINSTANCENAME, DISPLAYNAME, SERVICESLANAME, TIMEWINDOWNAME\n\t\t\t\tFROM TBSMBASE.SERVICEINSTANCE, TBSMBASE.SERVICEINSTANCERELATIONSHIP\n\t\t\t\tWHERE PARENTINSTANCEKEY = '$parent_id' AND SERVICEINSTANCEID = CHILDINSTANCEKEY\";\n $stmt = db2_prepare($con, $sel);\n $result = db2_execute($stmt);\n\n $values = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n $values++;\n $info[$lev] = array (\n 'level' => $lev,\n 'endpoint' => false,\n 'id' => $row['SERVICEINSTANCEID'],\n 'service' => $row['SERVICEINSTANCENAME'],\n 'display' => $row['DISPLAYNAME'],\n 'template' => $row['SERVICESLANAME'],\n 'maintenance' => $row['TIMEWINDOWNAME'],\n );\n // unique value\n if (!in_array($row['SERVICEINSTANCEID'], array_column($GLOBALS['results'], 'id')))\n $GLOBALS['results'][] = $info[count($info)-1];\n\n // recursive function call\n ext_tree($row['SERVICEINSTANCEID'], $con, $lev+1, $info);\n }\n\n return ($values > 0);\n}", "protected function onArrayOpen()\n {\n $this->typeCheck->onArrayOpen(func_get_args());\n\n if (0 === $this->depth++) {\n $this->emit('document-open');\n }\n\n $this->emit('array-open');\n }", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "protected function buildStructure()\n\t{\n\t\t//\n\t\t// Init local storage.\n\t\t//\n\t\t$this->mStruct = Array();\n\t\t$list = $this->mList;\n\t\t\n\t\t//\n\t\t// Set root worksheet.\n\t\t//\n\t\tforeach( $list as $key => $value )\n\t\t{\n\t\t\t//\n\t\t\t// Only root has no parent.\n\t\t\t//\n\t\t\tif( ! array_key_exists( 'P', $value ) )\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Set root element.\n\t\t\t\t//\n\t\t\t\t$this->mStruct[ 'N' ] = $key;\n\t\t\t\tunset( $list[ $key ] );\n\t\t\t\t\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// =>\n\t\t\t\n\t\t\t} // Has no parent.\n\t\t\n\t\t} // Looking for root.\n\t\t\n\t\t//\n\t\t// Hanlde root children.\n\t\t//\n\t\tif( count( $list ) )\n\t\t{\n\t\t\t//\n\t\t\t// Load children.\n\t\t\t//\n\t\t\t$this->mStruct[ 'C' ] = Array();\n\t\t\t$this->setStructure( $this->mStruct[ 'C' ], $list, $key );\n\t\t\n\t\t} // Root has children.\n\t\n\t}", "function addTags($rawData, $tag)\n{\n switch($rawData['genericType'])\n {\n case \"Diagram\":\n $rawData['id'] = addTag($rawData['id'], $tag);\n foreach ($rawData['nodeList'] as &$node)\n {\n $node['id'] = addTag($node['id'], $tag);\n }\n\n foreach ($rawData['linkList'] as &$link)\n {\n $link['id'] = addTag($link['id'], $tag);\n $link['originNode'] = addTag($link['originNode'], $tag);\n $link['destinationNode'] = addTag($link['destinationNode'], $tag);\n }\n\n foreach ($rawData['DiaNodeList'] as &$diaNode)\n {\n $diaNode['id'] = addTag($diaNode['id'], $tag);\n }\n\n for ($i = 0; $i < count($rawData['ancestry']); $i++)\n {\n $rawData['ancestry'][$i] = addTag($rawData['ancestry'][$i], $tag);\n }\n\n $rawData['diaNode'] = addTag($rawData['diaNode'], $tag);\n break;\n \n case \"diaNode\":\n // Intentionally let it fall through to Node so that we only\n // have to write linkList code here once\n case \"Node\":\n $rawData['id'] = addTag($rawData['id'], $tag);\n $rawData['diagramId'] = addTag($rawData['diagramId'], $tag);\n foreach ($rawData['linkList'] as &$link)\n {\n $link['id'] = addTag($link['id'], $tag);\n $link['originNode'] = addTag($link['originNode'], $tag);\n $link['destinationNode'] = addTag($link['destinationNode'], $tag);\n }\n break;\n \n case \"Link\":\n $rawData['id'] = addTag($rawData['id'], $tag);\n $rawData['diagramId'] = addTag($rawData['diagramId'], $tag);\n $rawData['originNode']['id'] = addTag($rawData['originNode']['id'], $tag);\n $rawData['destinationNode']['id'] = addTag($rawData['destinationNode']['id'], $tag);\n break;\n \n case \"List\":\n for ($i = 0; $i < count($rawData['list']); $i++)\n {\n $rawData['list'][$i]['id'] = addTag($rawData['list'][$i]['id'], $tag);\n }\n break;\n \n default:\n // Probably should update to a specialized exception\n throw new BadFunctionCallException(\"Not a valid genericType\");\n break;\n \n }\n \n return $rawData;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isActiveByTitle Test if an active page exist return null if no pages
public function setIsActiveByTitle($title) { $object = $this->findOneByTitle($title); $state = is_object($object) ? ($object->getIsActive() ? true : false) : null; return $state; }
[ "function _get_active($page_name, $id = 0) {\n if(_page($id) == $page_name) {\n return 'active';\n }\n \n return '';\n}", "protected function isPageActive()\n {\n if($this->url->getTarget()->id == Page::id()) return true;\n return false;\n }", "function culturefeed_pages_has_active_page() {\n return isset($_SESSION['culturefeed']['page']);\n}", "function wv_check_page_exists($pageTitle) {\n\n $output = 0;\n if (get_page_by_title($pageTitle)) {\n $output = 1;\n }\n\n return $output;\n }", "static private function _getPageByTitle($title, $pageArr) {\n\t\tforeach($pageArr as $p) {\n\t\t\tif($p->title == $title)\n\t\t\t\treturn $p;\n\t\t}\n\t\treturn false;\n\t}", "function addActiveClass($pageUrl){\n\t if(stripos($_SERVER['REQUEST_URI'], $pageUrl)){\n\t\t echo 'active'; \n\t\t}\n\t}", "function pageExists( $title )\n {\n // reconnect if needed\n if ( ! $this->con->isConnected() )\n {\n $this->con->connect();\n }\n \n $sql = \"SELECT `id` \"\n . \"FROM `\".$this->config['tbl_wiki_pages'].\"` \"\n . \"WHERE BINARY `title` = '\". addslashes( $title ).\"' \"\n . \"AND `wiki_id` = \" . $this->getWikiId();\n ;\n\n return $this->con->queryReturnsResult( $sql );\n }", "public function hasPage();", "public function active()\n {\n return LandingPage::where('active', true)->first();\n }", "public function testIsActiveReturnsTrueOnIdenticalIncludingPageParams()\n {\n $page = new Zym_Navigation_Page_Mvc(array(\n 'label' => 'foo',\n 'action' => 'view',\n 'controller' => 'post',\n 'module' => 'blog',\n 'params' => array(\n 'id' => '1337'\n )\n ));\n \n $this->_front->getRequest()->setParams(array(\n 'module' => 'blog',\n 'controller' => 'post',\n 'action' => 'view',\n 'id' => '1337'\n ));\n \n $this->assertEquals(true, $page->isActive()); \n }", "function checkPage($slug) {\n\n $sqlChk = \"SELECT title FROM \" . $this->tbl . \" WHERE title = '\" . $slug . \"'\";\n\n $query = $this->db->query($sqlChk);\n\n if ($query->num_rows >= 1) {\n\n return 1;\n\n } else {\n\n return 0;\n\n }\n\n }", "function is_simplepage($url)\n{\n if (!$url) {\n $url = current_url();\n }\n $spinfo = [];\n $pages = get_db()\n ->getTable(\"SimplePagesPage\")\n ->findAll();\n foreach ($pages as $page) {\n $spinfo[$page->id] = \"/\" . $page->slug;\n }\n return array_search($url, $spinfo);\n}", "static public function showActivePage($upage){\n \n $page = substr(OR_tools::showPageName(), 0, -4); \n if (strtoupper($page) == strtoupper($upage)){\n $activePage = \" class='activePage'\";\n }\n else{\n $activePage = NULL;\n }\n \n return $activePage;\n}", "public function is_active( $slug = null ) {\n\t\tif ( ! Tribe__Events__Aggregator__Page::instance()->is_screen() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$slug = $this->get_requested_slug( $slug );\n\n\t\t// Fetch the Active Tab\n\t\t$tab = $this->get_active();\n\n\t\t// Compare\n\t\treturn $slug === $tab->get_slug();\n\t}", "function active($currect_page){\n // get url of page user is on\n $url_array = explode('&', $_SERVER['REQUEST_URI']);\n // get which admin tab user is on\n $url = $url_array[1];\n // if the page is in the url\n if($currect_page == $url){\n // echo active class\n echo 'active';\n }\n}", "public function hasPageTitle() {\n return !empty($this->_page_title);\n }", "function MenuDinamico($pagina){\n if (strpos($_SERVER['PHP_SELF'], $pagina)) {\n echo 'active';\n }\n }", "public static function isPageActive($page)\n\t{\n\t\t$segments = self::getCurrentPathSegments();\n\t\treturn $page->get('alias') == array_pop($segments);\n\t}", "private function check_for_active_state() {\n\t\tif (\n\t\t\t( empty( $this->tab ) && ! isset( $_GET['tab'] ) ) ||\n\t\t\t( 'default' === $this->tab && ! isset( $_GET['tab'] ) ) ||\n\t\t\t( isset( $_GET['tab'] ) && $this->tab === $_GET['tab'] )\n\t\t) {\n\t\t\t$this->classes[] = 'searchwp-settings-nav-tab-active postbox';\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the form for creating new Process.
public function create() { if (!Gate::allows('process_create')) { return abort(401); } return view('admin.processes.create'); }
[ "public function create()\n {\n return view('processes.create');\n }", "public function newAction()\n {\n $entity = new SelectionProcess();\n \n $em = $this->getDoctrine()->getManager();\n \n $definitionTestList = $em->getRepository('DefinitionTestBundle:DefinitionTest')->findAll();\n \n foreach ($definitionTestList as $definitionTest){\n \n $entitySelectionProcessTest = new SelectionProcessTest();\n \n $entitySelectionProcessTest->setDefinitionTest($definitionTest);\n \n $entity->getSelectionProcessTests()->add($entitySelectionProcessTest);\n }\n \n \n $form = $this->createForm(new SeleccionProcessType(), $entity);\n\t\t\n\t\t$entityAtributo = new PmaSPAtributo();\t\n\t\t$formAtributo = $this->createForm(new PmaSPAtributoType(), $entityAtributo);\t\n\t\t\n\t\t\t\n return $this->render('SeleccionProcesBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'entityAtributo' => $entityAtributo,\n 'formAtributo' => $formAtributo->createView()\n ));\n }", "public function create()\n {\n return view('job_workflow_processes.create');\n }", "public function create()\n {\n return view('process_types.create');\n }", "protected function drawFormNew()\n {\n global $wgOut;\n $wgOut->setPageTitle(wfMsg('title-new-survey'));\n\n $output = '';\n foreach($this->formpages as $fpage)\n {\n $output .= $this->form->AddPage($fpage['title'], $fpage['items']);\n }\n $output .= '<input type=\"hidden\" name=\"vpAction\" value=\"createnew\" />';\n $this->formButton = wfMsg('create-survey');\n\n $wgOut->addHTML($output);\n }", "function creatTaskForm(){\r\n $this->view (\"createtask-view\" , []);\r\n\r\n }", "public function newprocess(){\n\t\t\tif (!isset($_POST['save'])) {\n\t\t\t\tFlash::set('error', __('Could not save this course!'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data = $_POST['process'];\n\t\t\t\t$process = new Process();\n\t\t\t\t$process->title = $data['title'];\n\t\t\t\t$process->filter_id = $data['filter_id'];\n\t\t\t\t$process->created_on = date('Y-m-d');\n\t\t\t\t$process->start_date = $data['start_date'];\n\t\t\t\t$process->end_date = $data['end_date'];\n\t\t\t\t$process->save();\n\t\t\t\tFlash::set('success', __('All went well.'));\n\t\t\t\tredirect(get_url('plugin/training/taskprocess'));\n\t\t}\n\t}", "public function newAction()\n {\n $user = $this->getUser();\n $entity = new Program();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SifoAdminBundle:new:layout.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'user' => $user,\n ));\n }", "public function showForm() {\n\t\t$form = $this->getTaskForm();\n\t\t$form->setValues($this->taskModel);\n\t\t$content = $this->newView('task/form.html')->assign(array(\n\t\t\t'form' => $form,\n\t\t\t'mode' => 'create'\n\t\t\t\t));\n\t\treturn $this->newResponse($content);\n\t}", "public function actionCreate() {\n\t\t$model = new ProvisionTypeForm();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->getModel()->id]);\n\t\t}\n\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function create()\n {\n return view('NewPrograms.create');\n }", "public function showCreateThreadForm()\n {\n return view( 'share.create_thread' );\n }", "public function create()\n {\n return view('parceiros.create');\n }", "public function create()\n {\n return view('totem::tasks.form', [\n 'task' => new Task,\n 'commands' => Totem::getCommands(),\n 'timezones' => timezone_identifiers_list(),\n 'frequencies' => Totem::frequencies(),\n ]);\n }", "public function actionCreate() {\n $model = new Form();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->form_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\n\t \n\t return view('admin.ps.create');\n\t}", "public function createAction()\n {\n $entity = new Processus();\n\n $request = $this->getRequest();\n $form = $this->createForm(new ProcessusType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n \n// $repository = $this->getDoctrine()\n// ->getEntityManager()\n// ->getRepository('cnctfacpBundle:Utilisateur');\n \n \n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('processus_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('cnctfacpBundle:Processus:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return view('problem_view_forms.create');\n }", "public function newAction() {\n $entity = new Command();\n $form = $this->createCreateForm($entity);\n\n return $this->render('FklFranklinBundle:Command:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the first word of a phrase
function firstWord($phrase) { $words = explode(' ', trim($phrase)); return strtolower($words[0]); }
[ "function get_first_word($sentence)\n {\n $wordArr = explode(' ', $sentence);\n $first_word = trim($wordArr[0]);\n runDebug(__FILE__, __FUNCTION__, __LINE__, \"Sentence: $sentence. First word:$first_word\", 4);\n return $first_word;\n }", "function get_first_word($sentance){\n\t$wordArr = explode(' ', $sentance);\n\t$first_word = trim($wordArr[0]);\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"Sentance: $sentance. First word:$first_word\",4);\n\treturn $first_word;\n}", "public function getFirstWord(){ $word = null; if( !($word = $this->getPrimaryWord()) ){ if( count($this->words) ){ $word = $this->words[0]; } } return $word; }", "public static function getFirstWord($title){\n $words = self::getWordsArray($title);\n return $words[0];\n }", "function getFirstWord($value) {\n\t$firstWord = \"\";\n\t$firstCharacter = explode(\" \", $value);\n\tfor ($i=0; $i < count($firstCharacter); $i++) { \n\t\t$temp = substr($firstCharacter[$i], 0, 1);\n\t\t$firstWord .= ucfirst($temp);\n\t}\n\treturn $firstWord;\n}", "function getFirstWord($subject){\n $matches = array();\n $pattern = \"/^[a-z A-Z 0-9 *_+-.,!@#$%^&();|<>\\\"']\\w\\S+/\"; \n preg_match($pattern, $subject, $matches);\n \n return $matches[0]; \n}", "function firstWords($string, $count)\n{\n $string = strip_tags($string);\n return implode(' ', array_slice(explode(' ',$string), 0, $count));\n}", "public static function getFirstWord($string) {\n $words = static::getWords($string);\n return $words[0];\n }", "function the_first_sentence($content) {\n\techo get_first_sentence( $content );\n}", "function jumpoff_title_firstword(){\n $title = current(explode(' ', get_the_title()));\n return $title;\n}", "public function singular(string $word): string;", "function get_first_sentence_from_post_content( $post_id ) {\n\n\t// Stolen from wp_trim_excerpt()\n\t$post = get_post( $post_id );\n\t$text = strip_shortcodes( $post->post_content );\n\t$text = strip_tags( $text );\n\n\t$sentences = preg_split( '#(?<=[.?!](\\s|\"))[\\n\\r\\t\\s]{0,}(?=[A-Z\\b\"])#',$text);\n\n\tif ( is_array( $sentences ) ) {\n\t\treturn trim( decode_html_entities( wptexturize( $sentences[0] ) ) );\n\t}\n\n\treturn '';\n}", "public function getFirstSentence(): string\n {\n return $this->firstSentence;\n }", "public function singular($word) {\n\t\t\t//\"-es\" is used for words that end in \"-x\", \"-s\", \"-z\", \"-sh\", \"-ch\" in which case you add\n\t\t\tif (substr($word, -2) == \"es\") {\n\t\t\t\tif (substr($word, -4) == \"sses\") { // eg. 'addresses' to 'address'\n\t\t\t\t\treturn substr($word,0,-2);\n\t\t\t\t}\n\t\t\t\telseif (substr($word, -3) == \"ses\") { // eg. 'databases' to 'database' (necessary!)\n\t\t\t\t\treturn substr($word,0,-1);\n\t\t\t\t}\n\t\t\t\telseif (substr($word, -3) == \"ies\") { // eg. 'countries' to 'country'\n\t\t\t\t\treturn substr($word,0,-3).\"y\";\n\t\t\t\t}\n\t\t\t\telseif (substr($word, -3, 1) == \"x\") {\n\t\t\t\t\treturn substr($word,0,-2);\n\t\t\t\t}\n\t\t\t\telseif (substr($word, -3, 1) == \"s\") {\n\t\t\t\t\treturn substr($word,0,-2);\n\t\t\t\t}\n\t\t\t\telseif (substr($word, -3, 1) == \"z\") {\n\t\t\t\t\treturn substr($word,0,-2);\n\t\t\t\t}\n\t\t\t\telseif (substr($word, -4, 2) == \"sh\") {\n\t\t\t\t\treturn substr($word,0,-2);\n\t\t\t\t}\n\t\t\t\telseif (substr($word, -4, 2) == \"ch\") {\n\t\t\t\t\treturn substr($word,0,-2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn rtrim($word, \"s\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn rtrim($word, \"s\");\n\t\t\t}\n\t\t}", "public function catch_phrase()\n\t{\n\t\t$buzzwords = static::translate('faker.company.buzzwords');\n\t\t$words = array();\n\n\t\tforeach ($buzzwords as $group)\n\t\t{\n\t\t\t$words[] = $group[array_rand($group)];\n\t\t}\n\n\t\treturn implode(' ', $words);\n\t}", "public function lowerFirst();", "protected function get_stem( $word ) : string {\n\t\t\tglobal $wpdb;\n\n\t\t\t$statement = $wpdb->prepare( \"SELECT `stem` FROM `{$wpdb->prefix}swp_terms` where `term` = %s\", $word );\n\t\t\t$result = $wpdb->get_col( $statement );\n\t\t\treturn $result[0] ?? '';\n\t\t}", "protected function words($text) \n {\n $matches = array();\n // preg_match_all(\"/[a-z]+/\", strtolower($text), $matches);\n preg_match_all(\"/[a-z']+/i\", $text, $matches);\n return $matches[0];\n }", "public function singular(string $word): string\n {\n if (preg_match($this->singularUninfleted, $word)) {\n return $word;\n }\n\n if (isset($this->cacheSingular[$word])) {\n return $this->cacheSingular[$word];\n } else {\n return $this->singularizeWord($word);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method: get_string_from_phpexec() Executes the included php (or html) file and returns the output as a string. Parameters: $file (string, required) name of the file
function get_string_from_phpexec($file) { if (file_exists($file)) { ob_start(); include($file); $content = ob_get_contents(); ob_end_clean(); return $content; } }
[ "private function eval_get_file($file) {\n ob_clean();\n ob_start(); // start buffering\n is_readable($file) && include($file);\n $str = ob_get_contents();\n ob_end_clean();\n\n return $str;\n }", "function execute_and_output_template($file,$dir=null) {\n if ($dir == null) {\n $dir = $this->parent->plugin_path;\n }\n print $this->get_string_from_phpexec($dir.'templates/'.$file);\n }", "function includeContents($file)\n\t{\n\t\tif (!(self::exists($file)&&is_file($file))) return '';\n\t\tob_start();\n\t\tinclude $file;\n\t\t$contents = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $contents;\n\t}", "function execute_and_output_plustemplate($file) {\n $file = SLPLUS_PLUGINDIR.'/plustemplates/'.$file;\n print get_string_from_phpexec($file);\n}", "function AddPHP($file){\n ob_start();\n include($file);\n $returned = ob_get_contents(); \n ob_end_clean(); \n $this->body_doc = $this->body_doc .BK. $returned;\n }", "static function return_output($file){\n ob_start();\n include $file;\n return ob_get_clean();\n }", "public function ProcessFile($file)\n\t\t{\n\t\t\t$tpl = @file_get_contents($file);\n\n\t\t\tif(!$tpl)\n\t\t\t{\n\t\t\t\tthrow new \\Exception('The file location passed to ProcessFile() is invalid or inaccessible.');\n\t\t\t}\n\t\t\t\n\t\t\t/* For those curious, file comes in as multi-line string. JS does not like that, fix this */\n\t\t\treturn $this->ProcessString(str_replace(\"\\n\", '', $tpl)); \n\t\t}", "function split_file_to_php_html( $file ) {\n\t$source = @file_get_contents( $file );\n\tif ( $source === false ) {\n\t\t$source = '';\n\t}\n\treturn split_to_php_html( $source );\n}", "private function inject($file){\r\n\t\tob_start();\r\n\t\tinclude($file);\r\n\t\t$buffer = ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\treturn($buffer);\r\n\t}", "static function file_include_content( $file_path ) {\n\t\t\t$content = NULL;\n\n\t\t\tif ( file_exists( $file_path ) ) {\n\t\t\t\tob_start();\n\t\t\t\tinclude_once $file_path;\n\t\t\t\t$content = ob_get_clean();\n\t\t\t}\n\n\t\t\treturn $content;\n\t\t}", "protected function compileFile($file)\n {\n // Get the content of the file\n $rawContent = file_get_contents($file);\n\n // Run all the pre-compilers before doing anything\n foreach ($this->preCompilers as $preCompiler) {\n\n $rawContent = $preCompiler->compile($rawContent);\n }\n\n // Now let the actual compiler do its work\n $rawContent = $this->compiler->text($rawContent);\n\n // Let's also run all the post-compilers here\n foreach ($this->postCompilers as $postCompiler) {\n\n $rawContent = $postCompiler->compile($rawContent);\n }\n\n // Return what we got\n return $rawContent;\n }", "public static function phpTemplate($__file__, $__vars__, $html_escape=false) {\r\n if($html_escape) {\r\n array_walk_recursive($__vars__, function (&$v) {\r\n $v = nl2br(htmlspecialchars($v));\r\n });\r\n }\r\n unset($html_escape);\r\n extract($__vars__, EXTR_SKIP);\r\n unset($__vars__);\r\n ob_start();\r\n include $__file__;\r\n return ob_get_clean();\r\n }", "protected function fileGetContents ($file)\n {\n $path = realpath(dirname(__FILE__) . '/_templates/' . $file);\n return file_get_contents($path);\n }", "public function renderPhpFile($_file_, $_params_ = [])\n {\n $_obInitialLevel_ = ob_get_level();\n ob_start();\n ob_implicit_flush(false);\n extract($_params_, EXTR_OVERWRITE);\n try {\n require $_file_;\n return ob_get_clean();\n } catch (\\Exception $e) {\n while (ob_get_level() > $_obInitialLevel_) {\n if (!@ob_end_clean()) {\n ob_clean();\n }\n }\n throw $e;\n } catch (\\Throwable $e) {\n while (ob_get_level() > $_obInitialLevel_) {\n if (!@ob_end_clean()) {\n ob_clean();\n }\n }\n throw $e;\n }\n }", "protected function pageContent(SplFileInfo $file): string\n {\n return file_get_contents($file->getPathname());\n }", "public function run($file)\n {\n $code = file_get_contents($file);\n return $this->runCode($code);\n }", "private function getSampleFileContents(string $file): string\n {\n return \\file_get_contents(\\realpath(__DIR__) . '/data/' . $file) ?: '';\n }", "public function getHtml($file) {\r\n if (!is_file($file))\r\n throw new Error('File not found: ' . $file, 404);\r\n return file_get_contents($file);\r\n }", "public function getCode($file)\n {\n $stmts = $this->parse($file);\n $stmts = $this->traverse($stmts);\n $content = $this->prettyPrint($stmts);\n\n return $content;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write the code for an Inputfield Param: $component The $component that calls the visitor $tab The tabulation offset
public function VisitInput( ART_Input &$component, $tab = "" ) { // Create a label if it's defined $id = $component->GetId(); if( $component->GetLabel() <> "" ) { echo $tab . "<label class=\"ART_Label\""; if ( $id <> "" ) echo " for=\"" . $id; echo "\">" . $component->GetLabel() . "</label>\n"; } // Create the inputfield echo $tab . "<input class=\"ART_Input\" type=\"text\""; if ( $id <> "" ) echo " id=\"" . $id . "\" name=\"" . $id . "\""; echo " maxlength=\"64\" ></input><br/>\n"; }
[ "function tabparamfields($edit, $options, $data, $paramgroup)\n{\n global $dispfields;\n \n //\n // calculate pagebreak rows if needed\n //\n // Note: pagebreak rows may not be the same and $cnt because used==FALSE rows shouldn't be counted\n //\n if ( isset ($options[\"pagebreak\"]))\t\t// if set\n {\n\t// set flag\n\t$pagebreakrow=1;\n \tif ($options[\"pagebreak\"])\t\t\t// if non-zero\n\t{\n\t // loop through to get total\n\t $cnt=0;\n\t $rowtot=0;\n\t while ( isset($dispfields[$paramgroup][$cnt]) && ( $cnt < 50 ) )\n\t {\n\t\tif ($dispfields[$paramgroup][$cnt][\"used\"]===TRUE)\n\t\t\t$rowtot = ++$rowtot;\n\t\t$cnt = ++$cnt;\n\t }\n\t \n\t // calculate pagebreak row\n\t $pagebreakrow = ceil ($rowtot / $options[\"pagebreak\"]);\n\t}\n }\n else $pagebreakrow=0;\n\t\n // loop while var is set. Don't go over 50 as a safety check\n $cnt=0;\n $rowcnt=1;\n while ( isset($dispfields[$paramgroup][$cnt]) && ( $cnt < 50 ) )\n {\n \t// if param is used place in group\n \tif ($dispfields[$paramgroup][$cnt][\"used\"]===TRUE)\n \t{\n\t\t$ret = $ret . \"\\n\" . tabtextfield ( $edit, $options, $data, $paramgroup . \"Field_\" . $cnt, \n\t\t\t$dispfields[$paramgroup][$cnt][\"display\"],\n\t\t\t$dispfields[$paramgroup][$cnt][\"inputlen\"], $dispfields[$paramgroup][$cnt][\"maxlen\"],\n\t\t\t$dispfields[$paramgroup][$cnt][\"defaultvalue\"]);\n\t\t\n\t\t // pagebreak if needed\n\t\t if ($pagebreakrow)\t\t\t\t// if pagebreaking\n\t\t if (! ($rowcnt++ % $pagebreakrow ))\t\t\t// if zero\n\t\t\t $ret = $ret . $options[\"pagebreakstring\"];\n\t}\n\t$cnt = ++$cnt;\n\n\n }\n \n return($ret);\n \n}", "function input_head($field = null)\n {\n\n }", "function start_edit_field($field) {\n //fetch all stored items and pass them to the view\n $items = $this->get_all_items($field);\n $view = $this->view(\"edit\");\n $view->set(\"field\", $field);\n $view->set(\"items\", $items);\n //return JSON\n //with which this component is also initiated for editing\n echo str_replace(\"\\\\n\", \"\", json_encode(Array(\n \"dom\" => Array(\n \"fill\" => Array(\"#wi3_editdiv_content\" => $view->render())\n ),\n \"scriptsafter\" => Array(\"wi3_editdiv_show();\", \"wi3.pagefiller.components.\" . $field->type . \".initedit();\")\n )));\n }", "function print_input_fields()\n{\n\t$fields = func_get_args();\n\tforeach ($fields as $field)\n\t{\n\t\t$value = array_key_value($_POST,$field,'');\n\t\t$label = ucwords(str_replace('_',' ',$field));\n\t\tprint <<<EOQ\n <tr>\n <td valign=top align=right>\n <b>$label:</b>\n </td>\n <td valign=top align=left>\n <input type=\"text\" name=\"$field\" size=\"40\" value=\"$value\">\n </td>\n </tr>\nEOQ;\n\t}\n}", "public function setField(HTMLInput $component){\n\t\t$this->setAttribute(\"for\", $component->getElementId());\n\t}", "public function getPagerInput();", "function projax_autocomplete( $p_entrypoint, $p_field_name, $p_attributes_array = null ) {\n\t\techo '<input id=\"'.$p_field_name.'\" name=\"'.$p_field_name.'\"'. $t_tabindex . $t_maxlength . ' size=\"'.(isset($p_attributes_array['size'])?$p_attributes_array['size']:30).'\" type=\"text\" value=\"'.(isset($p_attributes_array['value'])?$p_attributes_array['value']:'').'\" '.(isset($p_attributes_array['class'])?'class = \"'.$p_attributes_array['class'].'\" ':'').'/>';\n}", "public function walkInputParameter($inputParam);", "function display_input_tag(page $page, mode $mode, driver_record $parent) {//field\n //\n //Display the input value of the current element. Typically this is an\n //input box wth the value, a checkbox with correct check, etc.\n //\n //The display is going to be driven by $this->element with the following \n //arguments: $this, $mode, $parent\n //\n $fname = $this->name;\n //\n echo \"<input\";\n //\n //Set the input type\n echo \" type='{$this->get_type()}' \";\n //\n echo \" name='$fname'\";\n //\n //Retrieve the (input) value of this field from the parent record's \n //property that matches the field name\n $value = isset($parent->values->$fname) ? $parent->values->$fname : \"\";\n //\n //Display the input value\n echo \" value='$value'\";\n //\n //Echo the hidden status\n echo $mode->hidden(mode::input);\n //\n //Close the input\n echo \" />\";\n }", "function output_Tab($label, $editorUrl, $counter, $active, $has_predecessors) {\n\tglobal $gSession;\n\t\n\t## init return value\n\t$return_value = \"\";\n\t\n\t## here we define the start\n\tif($counter == $active) {\n\t\t$image_base = 'high';\n\t} else {\n\t\t$image_base = 'norm';\n\t}\n\t\n\tif(!$has_predecessors) {\n\t\t$image_right = '_end';\n\t} else {\n\t\tif($counter+1 == $active) {\n\t\t\t## the next one his active\n\t\t\t$image_right = '_high';\n\t\t} else {\n\t\t\t$image_right = '_norm';\n\t\t}\n\t}\n\t\n\t## prepare the url to ourselves\n\t$self = $gSession->url($_SERVER['PHP_SELF']);\n\t$self .= '&tab='.$counter;\n\n\t## get the template\n\t$template = new Template(ENGINE.\"modules/interface/\");\n\t$template -> set_templatefile(array(\"begin\" => \"tab.tpl\",\"middle\" => \"tab.tpl\",\"modulebegin\" => \"tab.tpl\"));\n\t\n\t## now start setting the vars\n\t$template->set_var('LABEL', $label);\n\t$template->set_var('RIGHT', $image_right);\n\t$template->set_var('BASE', $image_base);\n\t$template->set_var('EDITOR', $editorUrl);\n\t$template->set_var('SELF', $self);\n\t\n\t## finally we need to set the order-\n\t## if the tab should be highlightes we need to\n\t## handle this in here too\n\tif ($counter == 0) {\n\t\t$return_value = $template->fill_block('begin');\n\t} else if($counter == 3) {\n\t\t$return_value = $template->fill_block('modulebegin');\n\t} else {\n\t\t$return_value = $template->fill_block('middle');\n\t}\t\t\t\t\n\n\treturn $return_value;\t\n}", "function afterField($pFld){\n }", "public function getFieldBindingPHP(Field $field, $identifier, $fieldValueAccessor, $tab = \" \");", "public function getDataInputField();", "function __construct($field = array(), $value ='', $parent){\r\n\t\t\r\n\t\tparent::__construct($parent->sections, $parent->args, $parent->extra_tabs);\r\n\t\t$this->field = $field;\r\n\t\t$this->value = $value;\r\n\t\t//$this->render();\r\n\t\t\r\n\t}", "function render_field($field)\n {\n }", "function _field_input($field){\n\t\t\t\n\t\t\tif ( isset( $field['type'] ) && $this->prepare_field( $field['type'] ) ){\n\t\t\t\t$field_class = 'ZR_Options_'.$field['type'];\n\t\t\t\t\n\t\t\t\t$value = $this->get( $field['id'] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\tif ( !isset( $field['sub_option'] ) ) echo '<table class=\"field-table\"><tr>';\n\t\t\t\t\t\n\t\t\t\tif ( isset( $field['sub_option'] ) ) echo '<td class=\"customize_allow\">';\n\t\t\t\telse echo '<td>';\n\t\t\t\t\t\n\t\t\t\t$render = '';\n\t\t\t\t$render = new $field_class( $field, $value, $this );\n\t\t\t\t$render->render();\n\t\t\t\t!isset( $field['sub_option'] ) && do_action( 'zr-opts-rights', $field, $this );\n\t\t\t\techo '</td>';\n\t\t\t\t\t\n\t\t\t\tif ( !isset( $field['sub_option'] ) ) echo '</tr></table>';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t} // if $field['type']\n\t\t}", "function __construct($field = array(), $value ='', $parent){\n\t\t\n\t\tparent::__construct($parent->sections, $parent->args, $parent->extra_tabs);\n\t\t$this->field = $field;\n\t\t$this->value = $value;\n\t\t//$this->render();\n\t\t\n\t}", "function build_field_html($field) {\r\n include PODS_DIR . '/ui/input_fields.php';\r\n }", "function smarty_function_iInput($params, &$smarty)\r\n{\r\n\tif (!empty($params['_params'])) {\r\n\t\t$_params = $params['_params'];\r\n\t\tunset($params['_params']);\r\n\t\t$params = array_merge($_params, $params);\r\n\t} else if (isset($params['_params'])) unset($params['_params']);\r\n\t\r\n\tif (empty($params['type'])) return;\r\n\t\r\n\t$prefix = '';\r\n\t$output = '';\r\n\t$class = '';\r\n\t$addId = true;\r\n\t\r\n\tswitch ($params['type']) {\r\n\tcase 'text':\r\n\tcase 'password':\r\n\tcase 'submit':\r\n\tcase 'checkbox':\r\n\tcase 'select':\r\n\tcase 'file':\r\n\tcase 'textarea':\r\n\tcase 'hidden':\r\n\tcase 'button':\r\n\tcase 'image':\r\n\tcase 'reset':\r\n\tcase 'radio':\r\n\t\t$class = $prefix . $params['type'];\r\n\t\tif (!empty($params['class'])) {\r\n\t\t\t$class .= ' ' . $params['class'];\r\n\t\t\tunset($params['class']);\r\n\t\t}\r\n\t\t$addId = false;\r\n\t\tbreak;\r\n\t\t\r\n\tdefault:\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tif (!empty($params['label']) && !empty($params['name'])) {\r\n\t\t$output .= '<label for=\"' . $params['name'] . '\">' . $params['label'] . \"</label>\";\r\n\t\tunset($params['label']);\r\n\t}\r\n\tif ($params['type'] === 'select') $output .= '<select class=\"' . $class . '\"';\r\n\telse if ($params['type'] === 'textarea') $output .= '<textarea class=\"' . $class . '\" rows=\"1\" cols=\"1\"';\r\n\telse if ($params['type'] === 'button') $output .= '<button class=\"' . $class . '\" type=\"' . $params['type'] . '\"';\r\n\telse $output .= '<input class=\"' . $class . '\" type=\"' . $params['type'] . '\"';\r\n\t$type = $params['type'];\r\n\tunset($params['type']);\r\n\tforeach ($params as $key => $value) {\r\n\t\t$output .= ' ' . $key . '=\"' . $value . '\"';\r\n\t}\r\n\tif (empty($params['id']) && !empty($params['name']) && $addId) $output .= ' id=\"' . $params['name'] . '\"';\r\n\tif ($type === 'select' || $type === 'textarea' || $type === 'button') $output .= '>';\r\n\telse $output .= '/>';\r\n\t\r\n\treturn $output;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test if the correct mapping is created with without specifying a delimiter (the delimiter should be ). And with a different delimiter (!).
function testDefaultDelimiter1() { $config = 'etc/mapsicle.default.delimiter.xml'; $sqlmap =& MapsicleFactory::buildMapsicle($config); if (PEAR::isError($sqlmap)) { $this->fail($sqlmap->getMessage()); } $mapping =& $sqlmap->mappings['Customer.findById#']; $this->assertEquals($mapping->delimiter, '#'); $mapping =& $sqlmap->mappings['Customer.findById!']; $this->assertEquals($mapping->delimiter, '!'); }
[ "private function hasCustomDelimiter(): bool {\n return $this->getStringToProcess()[0] == \"/\" && $this->getStringToProcess()[1] == \"/\";\n }", "public function testGetDelimiter()\n {\n $this->assertNotEmpty($this->codegenerator->getDelimiter());\n }", "public function testGetSetRulesSeparator()\n {\n $this->ruleParse->setRulesDelimiter('||');\n $this->assertEquals('||', $this->ruleParse->getRulesDelimiter());\n }", "public function testTemporaryDelimiter()\n {\n $this->assertEquals('nín-hǎo', Pinyin::trans('您好', array('delimiter' => '-')));\n Pinyin::set('delimiter', '*');\n $this->assertEquals('nín*hǎo', Pinyin::trans('您好'));\n Pinyin::set('delimiter', ' ');\n $this->assertEquals('nín hǎo', Pinyin::trans('您好'));\n }", "public function testLongLegthMultipleDelimiters(){\n $this->assertEquals(6, $this->object->Add(\"//[*;@][%;@]\\n1*;@2%;@3\"));\n }", "protected abstract function parseMappings(): void;", "public function test_corrected_to_compared_absent_separator() {\r\n $bestmatchpair = $this->make_pair('hyper bowl is', 'is hyperbowl');\r\n $this->question->lexicalerrorthreshold = 0.99;\r\n $this->question->lexicalerrorweight = 0.1;\r\n $analyzer = new qtype_correctwriting_lexical_analyzer($this->question, $bestmatchpair, $this->lang, false);\r\n $result = $analyzer->result_pairs();\r\n\r\n $this->assertTrue(count($result) == 1);\r\n /** @var qtype_correctwriting_string_pair $pair */\r\n $pair = $result[0];\r\n $string = $this->corrected_to_string($pair);\r\n $this->assertTrue($string == 'is hyper bowl', $string);\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(0);\r\n $this->assertTrue($index == array( 0 ), implode(' ', $index));\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(1);\r\n $this->assertTrue($index == array( 1 ), implode(' ', $index));\r\n\r\n $index = $pair->map_from_corrected_string_to_compared_string(2);\r\n $this->assertTrue($index == array( 1 ), implode(' ', $index));\r\n }", "public function hasMapping();", "public function testExplodeWithStrictAndEmptyString() {\n $plugin = new Explode(['delimiter' => '|'], 'map', []);\n $processed = $plugin->transform('', $this->migrateExecutable, $this->row, 'destination_property');\n $this->assertSame([''], $processed);\n }", "function isSeparator() {}", "public function testRenderLeftDelimiter()\n {\n {\n $leftDelim = ':';\n $rightDelim = '';\n $escapeChar = '';\n $key = 'name';\n $value = 'Johnny';\n $templateString = \"Good night, :$key!\";\n $subject = $this->createInstance($templateString, $leftDelim, $rightDelim, $escapeChar);\n }\n\n {\n $result = $subject->render([$key => $value]);\n $this->assertEquals(\"Good night, $value!\", $result);\n }\n }", "public function testInvalidDelimiter()\n {\n // Set the file to be parsed\n $file = __DIR__ . '/files/users.csv';\n\n // Parse the File\n $users = new Parser($file, '$');\n }", "protected function ensureMappingsLoaded()\n {\n if ($this->mappingsLoaded === false) {\n\n $filename = $this->getMappingsFilename();\n\n $file = new \\SplFileObject($filename);\n $file->setFlags(\\SplFileObject::READ_CSV | \\SplFileObject::SKIP_EMPTY | \\SplFileObject::DROP_NEW_LINE);\n\n foreach ($file as $rule) {\n list($from, $to, $status) = $rule;\n $fromChar = $this->codepointsToCharacters($from);\n $toChar = $this->codepointsToCharacters($to);\n\n switch ($status) {\n case 'C':\n // Avoiding setting another value instead of a previously set one for a given key!\n if (!array_key_exists($fromChar, $this->commonMappingsToLower)) {\n $this->commonMappingsToLower[$fromChar] = $toChar;\n }\n if (!array_key_exists($toChar, $this->commonMappingsToUpper)) {\n $this->commonMappingsToUpper[$toChar] = $fromChar;\n }\n break;\n case 'F':\n $this->fullMapingsToLower[$fromChar] = $toChar;\n $this->fullMapingsToUpper[$toChar] = $fromChar;\n break;\n case 'S':\n $this->simpleMappingsToLower[$fromChar] = $toChar;\n $this->simpleMappingsToUpper[$toChar] = $fromChar;\n break;\n case 'T':\n $this->turkicMappingsToLower[$fromChar] = $toChar;\n $this->turkicMappingsToUpper[$toChar] = $fromChar;\n break;\n }\n }\n $this->mappingsLoaded = true;\n }\n }", "public function testPathDelimiterHasADefault(): void\n {\n $this->assertNotEmpty($this->getMailbox()->getPathDelimiter());\n }", "public function testNotFoundInAnyMap()\n {\n $m1 = new Mapper();\n $m1->setMap('browser', $this->confContainer->getMappings()->getBrowser());\n $m1->setMap('browser_family', $this->confContainer->getMappings()->getBrowserFamily());\n $m1->getTo('XXXX');\n }", "function is_word_separator($chr) {\r\n\treturn ($chr > -1 && $chr < 48) || ($chr > 57 && $chr < 64) || ($chr > 90 && $chr < 97) || ($chr > 122 && $chr < 128);\r\n}", "public function testgetmappingreturnsfalseforinvalidentitytype() {\n // Obtain data.\n $fields = rlipimport_version1elis_get_mapping('bogus');\n\n // Data validation.\n $this->assertEquals($fields, false);\n }", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "public function testDelimitersAreAdded()\n {\n $host = new HostRegex(\".*\");\n $this->assertEquals(\"#.*#\", $host->getValue());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Initialisation of the _latest list depending on the reversed list of dependencies Deprecated, latest mad it usless
private function ini_latest(){ for($i = 0; $i < $this->_nb_keys; ++$i){ if(empty($this->_rev_dep[$i])){ $this->_latest[$i] = $this->_sprint_time; } } }
[ "public function getDeprecatedReleases()\n\t{\n\t\t$releases = (array) $this->getReleases();\n\t\t$maxReleases = $this->app['config']->get('rocketeer::remote.keep_releases');\n\n\t\treturn array_slice($releases, $maxReleases);\n\t}", "private function classifyDependencies()\n {\n $required = $this->getState()->getPackages();\n $installed = $this->installedPackages->getInstalled();\n\n $this->installs = [];\n $this->updates = [];\n $this->removals = $this->installedPackages->getAmbiguous();\n\n // Check for each dependency whether if it's new, requires\n // updates or is up to date and don't require any action.\n foreach ($required->getPackagesNames() as $package) {\n $requiredVersion = $required->get($package)->getVersion();\n if ($installed->has($package)) {\n $installedVersion = $installed->get($package)->getVersion();\n if ($requiredVersion !== $installedVersion) {\n $this->updates[] = new OutdatedDependencyObject(\n $package, $installedVersion, $requiredVersion,\n $required->get($package)->getRemote()\n );\n }\n } else {\n $this->installs[] = new MissingDependencyObject(\n $package, $requiredVersion,\n $required->get($package)->getRemote()\n );\n }\n }\n\n // Sort packages before installation process.\n usort($this->installs, function (MissingDependencyObject $left, MissingDependencyObject $right) {\n return strcmp($left->getName(), $right->getName());\n });\n\n usort($this->updates, function (OutdatedDependencyObject $left, OutdatedDependencyObject $right) {\n return strcmp($left->getName(), $right->getName());\n });\n\n sort($this->removals);\n }", "public function getDependencies() {\n $lst = array();\n $lst['info'] = array(\n array(\n 'name' => 'kiske',\n 'version' => '1.0',\n 'category' => 'core',\n 'state' => true,\n 'url' => 'var/www/ksike/core/ksike1/',\n 'icon' => 'icon',\n 'description' => 'Ksike-Larva or Ksike version 1.0, represents the statesments of the Ksike Platform, it implements the base structure and logic of the framework.'\n ),\n array(\n 'name' => 'kiske',\n 'version' => '1.1',\n 'category' => 'core',\n 'state' => true,\n 'url' => 'var/www/ksike/core/ksike1-01/',\n 'icon' => 'icon',\n 'description' => 'Ksike-Elephant or Ksike version 1.1, brings completely support to PHP server-side.'\n ),\n array(\n 'name' => 'kiske',\n 'version' => '1.2',\n 'category' => 'core',\n 'state' => true,\n 'url' => 'var/www/ksike/core/ksike1-02/',\n 'icon' => 'icon',\n 'description' => 'Ksike-Rynho or Ksike version 1.2, brings completely support to PHP server-side and allow to develop over JavaScript server-side blah blah.'\n ),\n array(\n 'name' => 'kiske',\n 'version' => '1.4',\n 'category' => 'core',\n 'state' => true,\n 'url' => 'var/www/ksike/core/ksike1-04/',\n 'icon' => 'icon',\n 'description' => 'Ksike-Snake or Ksike version 1.4, is the latest version of the Ksike Platform. Inserts the desktop criterion enteraly, it is because althought its inherits the support to PHP and JavaScript of previus versions, in this one insert the Python languaje for server-side in web tecnologies and for both sides in the desktop building of applications. '\n ),\n array(\n 'name' => 'ExtJS',\n 'version' => '3.0',\n 'category' => 'lib',\n 'state' => true,\n 'url' => 'var/www/ksike/lib/',\n 'icon' => 'icon',\n 'description' => 'Get more info at <a href=\"www.sencha.com\">here</a>'\n ),\n array(\n 'name' => 'ExtJS',\n 'version' => '4.0',\n 'category' => 'lib',\n 'state' => true,\n 'url' => 'var/www/ksike/lib/',\n 'icon' => 'icon',\n 'description' => 'Get more info at <a href=\"www.sencha.com\">here</a>'\n ),\n array(\n 'name' => 'ACDC',\n 'version' => '4.0',\n 'category' => 'lib',\n 'state' => true,\n 'url' => 'var/www/ksike/lib/',\n 'icon' => 'icon',\n 'description' => 'Get more info at <a href=\"www.sencha.com\">here</a>'\n )\n );\n return $lst;\n }", "private function generateDeprecated()\n\t{\n\t\t$template = $this->templateFactory->create();\n\t\t$template = $this->addBaseVariablesToTemplate($template);\n\t\t$this->prepareTemplate('deprecated');\n\n\t\t$deprecatedFilter = function ($element) {\n\t\t\t/** @var ReflectionElement $element */\n\t\t\treturn $element->isDeprecated();\n\t\t};\n\n\t\t$template->deprecatedMethods = array();\n\t\t$template->deprecatedConstants = array();\n\t\t$template->deprecatedProperties = array();\n\t\tforeach (array_reverse($this->getElementTypes()) as $type) {\n\t\t\t$template->{'deprecated' . ucfirst($type)} = array_filter(array_filter($this->$type, $this->getMainFilter()), $deprecatedFilter);\n\n\t\t\tif ($type === 'constants' || $type === 'functions') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($this->$type as $class) {\n\t\t\t\t/** @var ReflectionClass $class */\n\t\t\t\tif ( ! $class->isMain()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($class->isDeprecated()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$template->deprecatedMethods = array_merge($template->deprecatedMethods, array_values(array_filter($class->getOwnMethods(), $deprecatedFilter)));\n\t\t\t\t$template->deprecatedConstants = array_merge($template->deprecatedConstants, array_values(array_filter($class->getOwnConstants(), $deprecatedFilter)));\n\t\t\t\t$template->deprecatedProperties = array_merge($template->deprecatedProperties, array_values(array_filter($class->getOwnProperties(), $deprecatedFilter)));\n\t\t\t}\n\t\t}\n\t\tusort($template->deprecatedMethods, array($this, 'sortMethods'));\n\t\tusort($template->deprecatedConstants, array($this, 'sortConstants'));\n\t\tusort($template->deprecatedFunctions, array($this, 'sortFunctions'));\n\t\tusort($template->deprecatedProperties, array($this, 'sortProperties'));\n\n\t\t$template->setFile($this->getTemplatePath('deprecated'))\n\t\t\t->save($this->getTemplateFileName('deprecated'));\n\n\t\tforeach ($this->getElementTypes() as $type) {\n\t\t\tunset($template->{'deprecated' . ucfirst($type)});\n\t\t}\n\t\tunset($template->deprecatedMethods);\n\t\tunset($template->deprecatedProperties);\n\n\t\t$this->onGenerateProgress(1);\n\t}", "private function _doWeHaveLatestVersion() {\r\n $errorInPlugins = array();\r\n $pluginsArray = array(\r\n 'seaocore' => 'seaddons-core',\r\n 'siteapi' => 'siteapi',\r\n 'siteiosapp' => 'sitemobileiosapp',\r\n 'siteandroidapp' => 'sitemobileandroidapp',\r\n 'advancedactivity' => 'advancedactivity',\r\n 'sitetagcheckin' => 'sitetagcheckin'\r\n );\r\n\r\n if ($_COOKIE['getMobileDependentModulesList']) {\r\n $tempValues = unserialize($_COOKIE['getMobileDependentModulesList']);\r\n } else {\r\n $rss = Zend_Feed::import('http://www.socialengineaddons.com/plugins/feed');\r\n $channel = array(\r\n 'title' => $rss->title(),\r\n 'link' => $rss->link(),\r\n 'description' => $rss->description(),\r\n 'items' => array()\r\n );\r\n $tempValues = $flagArray = array();\r\n foreach ($rss as $item) {\r\n if (in_array($item->ptype(), $pluginsArray)) {\r\n $flagArray['productType'] = $item->ptype();\r\n $flagArray['availableVersion'] = $item->version();\r\n $flagArray['title'] = $item->title();\r\n $tempValues[] = $flagArray;\r\n }\r\n }\r\n\r\n $cookieData = @serialize($tempValues);\r\n setcookie(\"getMobileDependentModulesList\", $cookieData, time() + 86400);\r\n }\r\n foreach ($tempValues as $values) {\r\n if (in_array($values['productType'], $pluginsArray)) {\r\n $flipedArray = array_flip($pluginsArray);\r\n if (!Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled($flipedArray[$values['productType']]))\r\n continue;\r\n\r\n $getModVersion = Engine_Api::_()->getDbtable('modules', 'core')->getModule($flipedArray[$values['productType']]);\r\n $isModSupport = $this->_checkVersion($getModVersion->version, $values['availableVersion']);\r\n if (!empty($isModSupport)) {\r\n $errorInPlugins[] = $values['title'];\r\n }\r\n }\r\n }\r\n\r\n return $errorInPlugins;\r\n }", "protected function get_latest_release()\n {\n }", "public function getDependencyList();", "function update_retrieve_dependencies() {\n $return = array();\n // Get a list of installed modules, arranged so that we invoke their hooks in\n // the same order that module_invoke_all() does.\n $modules = db_query(\"SELECT name FROM {system} WHERE type = 'module' AND schema_version <> :schema ORDER BY weight ASC, name ASC\", array(':schema' => SCHEMA_UNINSTALLED))->fetchCol();\n foreach ($modules as $module) {\n $function = $module . '_update_dependencies';\n if (function_exists($function)) {\n $result = $function();\n // Each implementation of hook_update_dependencies() returns a\n // multidimensional, associative array containing some keys that\n // represent module names (which are strings) and other keys that\n // represent update function numbers (which are integers). We cannot use\n // array_merge_recursive() to properly merge these results, since it\n // treats strings and integers differently. Therefore, we have to\n // explicitly loop through the expected array structure here and perform\n // the merge manually.\n if (isset($result) && is_array($result)) {\n foreach ($result as $module => $module_data) {\n foreach ($module_data as $update => $update_data) {\n foreach ($update_data as $module_dependency => $update_dependency) {\n // If there are redundant dependencies declared for the same\n // update function (so that it is declared to depend on more than\n // one update from a particular module), record the dependency on\n // the highest numbered update here, since that automatically\n // implies the previous ones. For example, if one module's\n // implementation of hook_update_dependencies() required this\n // ordering:\n //\n // system_update_7001 ---> user_update_7000\n //\n // but another module's implementation of the hook required this\n // one:\n //\n // system_update_7002 ---> user_update_7000\n //\n // we record the second one, since system_update_7001() is always\n // guaranteed to run before system_update_7002() anyway (within\n // an individual module, updates are always run in numerical\n // order).\n if (!isset($return[$module][$update][$module_dependency]) || $update_dependency > $return[$module][$update][$module_dependency]) {\n $return[$module][$update][$module_dependency] = $update_dependency;\n }\n }\n }\n }\n }\n }\n }\n\n return $return;\n}", "public function forceLatest()\n {\n $this->option('force-latest');\n return $this;\n }", "function load_latest_release() {\n\t\tif ( file_exists( \"{$this->releases_dir}{$this->plugin_stub}.zip\" ) ) {\n\t\t\t$this->parse_readme( \"{$this->releases_dir}{$this->plugin_stub}.zip\" );\n\t\t} else {\n\t\t\t// Loop over files looking for a version number\n\t\t\tforeach ( glob( \"{$this->releases_dir}{$this->plugin_stub}*.zip\" ) as $filename ) {\n\t\t\t\tpreg_match( \"/^{$this->plugin_stub}\\-([0-9\\.]+)\\.zip$/\", basename( $filename ), $matches );\n\t\t\t\tif ( isset( $matches[1] ) ) {\n\t\t\t\t\t$this_version = $matches[1];\n\t\t\t\t\tif ( version_compare( $this_version, $this->latest_version ) == 1 ) {\n\t\t\t\t\t\t$this->latest_version = $this_version;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $this->latest_version != '0.0.0' ) {\n\t\t\t\t$this->parse_readme( \"{$this->releases_dir}{$this->plugin_stub}-{$this->latest_version}.zip\" );\n\t\t\t} else {\n\t\t\t\t$this->abort();\n\t\t\t}\n\t\t}\n\t}", "public function init() {\n\n\t\tif ( empty( $this->version ) ) {\n\t\t\t$this->version = '1.0.6'; // last version that didn't have the version option set\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.1', '<' ) ) {\n\t\t\t$this->v11_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.2.1', '<' ) ) {\n\t\t\t$this->v121_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.3', '<' ) ) {\n\t\t\t$this->v13_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.6', '<' ) ) {\n\t\t\t$this->v16_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.7', '<' ) ) {\n\t\t\t$this->v17_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.7.3', '<' ) ) {\n\t\t\t$this->v173_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.7.11', '<' ) ) {\n\t\t\t$this->v1711_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.7.14', '<' ) ) {\n\t\t\t$this->v1714_upgrades();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.9', '<' ) ) {\n\t\t\t$this->v19_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '1.9.5', '<' ) ) {\n\t\t\t$this->v195_upgrade();\n\t\t}\n\n\t\tif ( true === version_compare( AFFILIATEWP_VERSION, '2.0', '<' ) ) {\n\t\t\t$this->v20_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.0.2', '<' ) ) {\n\t\t\t$this->v202_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.0.10', '<' ) ) {\n\t\t\t$this->v210_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.1', '<' ) ) {\n\t\t\t$this->v21_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.1.3.1', '<' ) ) {\n\t\t\t$this->v2131_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.2', '<' ) ) {\n\t\t\t$this->v22_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.2.2', '<' ) ) {\n\t\t\t$this->v222_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.2.8', '<' ) ) {\n\t\t\t$this->v228_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.2.9', '<' ) ) {\n\t\t\t$this->v229_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.3', '<' ) ) {\n\t\t\t$this->v23_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.4', '<' ) ) {\n\t\t\t$this->v24_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.4.2', '<' ) ) {\n\t\t\t$this->v242_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.5', '<' ) ) {\n\t\t\t$this->v25_upgrade();\n\t\t}\n\n\t\tif ( version_compare( $this->version, '2.6', '<' ) ) {\n\t\t\t$this->v26_upgrade();\n\t\t}\n\n\t\t// Inconsistency between current and saved version.\n\t\tif ( version_compare( $this->version, AFFILIATEWP_VERSION, '<>' ) ) {\n\t\t\t$this->upgraded = true;\n\t\t}\n\n\t\t// If upgrades have occurred\n\t\tif ( $this->upgraded ) {\n\t\t\tupdate_option( 'affwp_version_upgraded_from', $this->version );\n\t\t\tupdate_option( 'affwp_version', AFFILIATEWP_VERSION );\n\t\t}\n\n\t}", "function filter_bambusa_deps(array $dependencies, array $dependency)\n{\n if (!isset($dependency['version']) || !isset($dependency['latest']) || !isset($dependency['name'])) {\n return $dependencies;\n }\n\n if (is_supported_module($dependency['name'])) {\n return $dependencies;\n }\n\n if (is_ignored_module($dependency['name'])) {\n return $dependencies;\n }\n\n if (stripos($dependency['version'], 'dev') !== false) {\n return $dependencies;\n }\n\n if (stripos($dependency['latest'], 'dev') !== false) {\n return $dependencies;\n }\n\n $currentMajor = substr($dependency['version'], 0, strpos($dependency['version'], '.'));\n $latestMajor = substr($dependency['latest'], 0, strpos($dependency['latest'], '.'));\n\n if ($currentMajor === $latestMajor) {\n return $dependencies;\n }\n\n $dependencies[] = $dependency;\n return $dependencies;\n}", "protected function get_deprecated_hooks() {\n\n\t\treturn array(\n\t\t\t// TODO remove by January 2020 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_sort_order_items' => array(\n\t\t\t\t'version' => '3.3.5',\n\t\t\t\t'replacement' => 'wc_pip_sort_order_item_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => false,\n\t\t\t),\n\t\t\t// TODO remove by December 2019 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_pick_list_document_table_row_cells' => array(\n\t\t\t\t'version' => '3.6.2',\n\t\t\t\t'replacement' => 'wc_pip_pick_list_grouped_by_category_table_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t);\n\t}", "private function missingDependencies() {\n $dependencies = array();\n \n if (!(class_exists('TheMatrix') && TheMatrix::VERSION >= self::MATRIX_VER)) {\n $dependencies[] = array('name' => 'The Matrix ('.self::MATRIX_VER.'+)', 'url' => 'https://github.com/n00dles/DM_matrix/');\n }\n \n return $dependencies;\n }", "function bluesbb_new_version() \n{\n\t$ver = array();\n\n\t$ver[1]['version'] = '0.23';\n\t$ver[1]['file'] = 'bluesbb_023_data.inc.php';\n\t$ver[1]['description'] = 'bluesbb v0.23';\n\n\t$ver[2]['version'] = '1.00';\n\t$ver[2]['file'] = 'bluesbb_100_data.inc.php';\n\t$ver[2]['description'] = 'bluesbb v1.00';\n\n\t$ver[3]['version'] = '1.04';\n\t$ver[3]['file'] = 'bluesbb_104_data.inc.php';\n\t$ver[3]['description'] = 'bluesbb v1.04';\n\n\treturn $ver;\n}", "protected function construct_list() {\n $names = $this->project->packages();\n $manifests = $this->project->property('manifests', array());\n $dependencies = $this->project->property('depends_on', array());\n $uninstallers = $this->project->property('uninstallers', array());\n \n foreach ($names as $packageName=>$version) {\n $properties = array();\n \n if (isset($manifests[$packageName]))\n $properties['manifest'] = $manifests[$packageName];\n \n $properties['dependencies'] = array();\n if (isset($dependencies[$packageName])) {\n foreach (explode(',', $dependencies[$packageName]) as $pair) {\n list($n,$v) = explode('=', $pair);\n $properties['dependencies'][$n] = $v;\n }\n }\n \n $properties['uninstallers'] = array();\n if (isset($uninstallers[$packageName])) {\n foreach(explode(',', $uninstallers[$packageName]) as $klass) {\n $properties['uninstallers'][] = $klass;\n }\n }\n \n $this->packages[$packageName] = new CriticalI_Project_Package($packageName, $version, $properties);\n }\n }", "public function getLastChangedVersions()\n {\n return $this->lastChangedVersions;\n }", "public function getDependencies() {}", "private function buildMissingDependencies()\n {\n if (!$this->httpClient instanceof ClientInterface) {\n $this->httpClient = GuzzleAdapterFactory::build($this->getGuzzleOptions());\n }\n\n if (!$this->uuidGenerator instanceof UuidGeneratorInterface) {\n $this->uuidGenerator = new RamseyUuidGenerator();\n }\n\n if (!$this->logger instanceof LoggerInterface) {\n $this->logger = new NullLogger();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pass the link for which you want the ItemId.
function getitemid($link) { $itemid = 0; global $mainframe; $mainframe = JFactory::getApplication(); if($mainframe->isAdmin()){ $db=JFactory::getDBO(); $query = "SELECT id FROM #__menu WHERE link LIKE '%".$link."%' AND published = 1 LIMIT 1"; $db->setQuery($query); $itemid = $db->loadResult(); } else{ // getting MENU Itemid $menu = $mainframe->getMenu(); $items= $menu->getItems('link',$link); if(isset($items[0])){ $itemid = $items[0]->id; } //IF NO MENU FOR LINK THEN FETCH FROM db if(empty($itemid)) { $db=JFactory::getDBO(); $query = "SELECT id FROM #__menu WHERE link LIKE '%".$link."%' AND published = 1 LIMIT 1"; $db->setQuery($query); $itemid = $db->loadResult(); } } // if Itemid is empty then get from request and return it if(!$itemid) { $jinput=JFactory::getApplication()->input; $itemid = $jinput->get('Itemid'); } return $itemid; }
[ "function getitemid($link)\n\t{\n\t\t$itemid = 0;\n\t\t\n\t\tglobal $mainframe;\n\t\t$mainframe = JFactory::getApplication();\n\t\tif($mainframe->isAdmin()){\n\t\t\t$db=JFactory::getDBO();\n\t\t\t$query = \"SELECT id FROM #__menu WHERE link LIKE '%\".$link.\"%' AND published = 1 LIMIT 1\";\n\t\t\t$db->setQuery($query);\n\t\t\t$itemid = $db->loadResult();\n\t\t}\n\t\telse{\n\t\t\t// getting MENU Itemid\n\t\t\t$menu = $mainframe->getMenu();\n\t\t\t$items= $menu->getItems('link',$link); \n\t\t\tif(isset($items[0])){\n\t\t\t\t$itemid = $items[0]->id;\n\t\t\t}\n\t\t\t\n\t\t\t//IF NO MENU FOR LINK THEN FETCH FROM db\n\t\t\tif(empty($itemid))\n\t\t\t{\n\t\t\t\t$db=JFactory::getDBO();\n\t\t\t\t$query = \"SELECT id FROM #__menu WHERE link LIKE '%\".$link.\"%' AND published = 1 LIMIT 1\";\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$itemid = $db->loadResult();\n\t\t\t}\n\t\t}\n\t\t// if Itemid is empty then get from request and return it\n\t\tif(!$itemid)\n\t\t\t{\n\t\t\t\t$jinput=JFactory::getApplication()->input;\n\t\t\t\t$itemid = $jinput->get('Itemid');\t\n\t\t\t}\n\t\treturn $itemid;\n\t}", "function link_id()\r\n\t{\r\n\t\treturn $this->link_id;\r\n\t}", "public function getIdByLink($link);", "public function getLinkIdentifier();", "public abstract function getItemId( $url, \\DOMElement $item ): string;", "private function getItemIdParameter()\n {\n // Reference: https://stackoverflow.com/questions/6768793/get-the-full-url-in-php\n $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n // Reference: https://www.geeksforgeeks.org/how-to-get-parameters-from-a-url-string-in-php/\n $url_components = parse_url($url);\n // string passed via URL \n parse_str($url_components['query'], $params);\n return $params['item'];\n }", "public function getLinkId()\n {\n return $this->link_id;\n }", "function getItemid() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$user = & JFactory::getUser() ;\r\n\t\t$sql = \"SELECT id FROM #__menu WHERE link LIKE '%index.php?option=com_osmembership%' AND published=1 AND `access` IN (\".implode(',', $user->getAuthorisedViewLevels()).\") ORDER BY `access`\";\t\t\t\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$itemId = $db->loadResult();\t\t\r\n\t\tif (!$itemId) {\r\n\t\t\t$Itemid = JRequest::getInt('Itemid');\r\n\t\t\tif ($Itemid == 1)\r\n\t\t\t\t$itemId = 999999 ;\r\n\t\t\telse \r\n\t\t\t\t$itemId = $Itemid ;\t\r\n\t\t}\t\t\t\r\n\t\treturn $itemId ;\t\r\n\t}", "private function getId() {\n\n $id = isset($this->url_elements[1]) && is_numeric($this->url_elements[1])\n ?intval($this->url_elements[1])\n :false;\n $additional_id = isset($this->url_elements[3]) && is_numeric($this->url_elements[3])\n ?intval($this->url_elements[3])\n :false;\n\n if ($additional_id || isset($this->parameters['parent_itemtype'])) {\n $this->parameters['parent_id'] = $id;\n $id = $additional_id;\n }\n\n return $id;\n }", "function linklist_getItem($vLinkListID,$vItemID) {\n\tglobal $Auth;\n\t\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\t\n\n\t$db_connection = new DB_Sql(); \n\t\t\n\t$query = \"SELECT structure_text, link_list_item_id,link_list_item_target FROM \".LINKLISTITEM.\" INNER JOIN \".STRUCTURE.\" ON \".STRUCTURE.\".page_id=\".LINKLISTITEM.\".link_list_item_target WHERE link_list_id='$vLinkListID' AND link_list_item_id='$vItemID' AND \".LINKLISTITEM.\".client_id='$client_id' ORDER BY link_list_item_id\";\n\t$result_pointer = $db_connection->query($query);\n\t$db_connection->next_record();\n\t\n\t$target = $db_connection->Record[\"link_list_item_target\"];\n\t\n\treturn $db_connection->Record; \n}", "public function getId_item()\n {\n return $this->id_item;\n }", "public function getItemid()\n {\n return $this->get(self::ITEMID);\n }", "public function getItemId()\n {\n return $this->itemId;\n }", "protected function getLinkItemIdString($itemId = 'inherit')\n\t{\n\t\treturn ($itemId !== 'inherit') ? '&Itemid=' . (int) $itemId : null;\n\t}", "public function getItemID()\n {\n return $this->itemID;\n }", "protected function external_link_id( $params )\n{\n\treturn @$params['id'] ;\n}", "function getJoinOnLinkID() \n {\n return $this->getJoinOnFieldX( 'navbarlink_id' );\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "public function getLink() {\n if($this->items!==false && $this->valid())\n return @current($this->items)->get_link();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GetOwner Gets the project's owner
public function GetOwner() { if (empty($this->owner) && !$this->readOwner) { $exe = new GitPHP_GitExe($this); $args = array(); //$args[] = 'gitweb.owner'; $args[] = 'user.name'; $this->owner = $exe->Execute(GIT_CONFIG, $args); unset($exe); if (empty($this->owner) && function_exists('posix_getpwuid')) { $uid = fileowner($this->GetPath()); if ($uid !== false) { $data = posix_getpwuid($uid); if (isset($data['gecos']) && !empty($data['gecos'])) { $this->owner = $data['gecos']; } elseif (isset($data['name']) && !empty($data['name'])) { $this->owner = $data['name']; } } } $this->readOwner = true; } return $this->owner; }
[ "public function getOwner()\r\n {\r\n return $this->owner;\r\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function get_owner()\n {\n return $this->_owner;\n }", "public function getOwner()\n {\n return isset($this->Owner) ? $this->Owner : null;\n }", "public function owner()\n {\n return $this->ownedBy();\n }", "public function getOwner(): Owner {\n return $this->_owner;\n }", "public function getOwner(){\n return User::getUserById($this->getOwnerId());\n }", "public function getOwner()\n {\n return $this->app_owner;\n }", "function getOwner() {\r\n if(isset($this->accessToken->owner)) {\r\n return $this->getUser($this->accessToken->owner);\r\n }\r\n else {\r\n return $this->getSessionedUser();\r\n }\r\n }", "public function getOwner()\n {\n return $this->_folder->getOwner();\n }", "function getOwner() {\n if(isset($this->accessToken->owner)) {\n return $this->getUser($this->accessToken->owner);\n }\n else {\n return $this->getSessionedUser();\n }\n }", "public function getOwnerProj()\n {\n return $this->ownerProj;\n }", "public function getOwner()\n {\n return $this->_resource->getOwner();\n }", "public function getOwnerLogin()\n {\n return $this->ownerLogin;\n }", "public function getOwnerName(){\n\t\treturn $this->ownerName;\n\t}", "protected function activityOwner()\n {\n\n// $project = $this->project ?? $this;\n// return $project->owner;\n\n// if (class_basename($this) === 'Project') {\n// return $this->owner;\n// } else {\n// return $this->project->owner;\n// }\n }", "public function getOwnerUsername();", "public function get_owner_user_name() {\n return $this->owner_user_name;\n }", "public function GetOwner()\n {\n if (!$this->Id) {\n add_log('ClientJobSchedule::GetOwner()', 'Id not set');\n return;\n }\n $sys = pdo_query('SELECT userid FROM client_jobschedule WHERE id=' . qnum($this->Id));\n $row = pdo_fetch_array($sys);\n return $row[0];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the callOptions Contains the optional features for the call.
public function setCallOptions($val) { $this->_propDict["callOptions"] = $val; return $this; }
[ "public function setSoapHeaderCallOptions(ChargentCallOptions $callOptions, $nameSpace = 'http://soap.sforce.com/schemas/class/ChargentSFA/T', $mustUnderstand = false, $actor = null)\n {\n return $this->setSoapHeader($nameSpace, 'CallOptions', $callOptions, $mustUnderstand, $actor);\n }", "public function getCallOptions()\n {\n if (array_key_exists(\"callOptions\", $this->_propDict)) {\n if (is_a($this->_propDict[\"callOptions\"], \"\\Beta\\Microsoft\\Graph\\Model\\CallOptions\") || is_null($this->_propDict[\"callOptions\"])) {\n return $this->_propDict[\"callOptions\"];\n } else {\n $this->_propDict[\"callOptions\"] = new CallOptions($this->_propDict[\"callOptions\"]);\n return $this->_propDict[\"callOptions\"];\n }\n }\n return null;\n }", "public function setOptions()\n {\n // TODO: Implement setOptions() method.\n }", "protected function setAdditionalOptions($options)\n {\n // Left blank intentionally so integrations can override this method,\n // in order to save combination to some persisted array which HttpClient can use it later while creating request\n }", "private function applyOptions()\n {\n foreach ($this->options as $o => $v) {\n curl_setopt($this->ch, $o, $v);\n }\n }", "private function setCurlOptions(): void\n {\n $options = [\n CURLOPT_URL => $this->getRequestUri(),\n CURLOPT_HTTPHEADER => [\n 'Ocp-Apim-Subscription-Key: ' . $this->_apiKey,\n ],\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_HEADER => true,\n CURLOPT_ENCODING => 'gzip',\n ];\n\n curl_setopt_array($this->_curl, $options);\n }", "public function setCurlOptions($options)\n {\n $this->curl_options = array_merge($this->curl_options, $options);\n }", "public function setCallCredentials($call_credentials)\n {\n $this->call->setCredentials($call_credentials);\n }", "protected function initOptions()\n {\n if (!empty($this->requestParams)) {\n if (isset($this->options[CURLOPT_HTTPGET])) {\n $this->prepareGetParams();\n } else {\n $this->addOption(CURLOPT_POSTFIELDS, http_build_query($this->requestParams));\n }\n }\n\n if (!empty($this->headers)) {\n $this->addOption(CURLOPT_HTTPHEADER, $this->prepareHeaders());\n }\n\n if (!empty($this->cookieFile)) {\n $this->addOption(CURLOPT_COOKIEFILE, $this->cookieFile);\n $this->addOption(CURLOPT_COOKIEJAR, $this->cookieFile);\n }\n\n if (!empty($this->cookies)) {\n $this->addOption(CURLOPT_COOKIE, $this->prepareCookies());\n }\n\n if (!curl_setopt_array($this->ch, $this->options)) {\n throw new CurlWrapperCurlException($this->ch);\n }\n }", "public function set_curl_options() {\n $this->curl_options = $this->default_curl_options;\n }", "private function setOptions(): void\n {\n if ($this->secure === null) {\n $this->secure = config('short-url.enforce_https');\n }\n\n if ($this->secure) {\n $this->destinationUrl = str_replace('http://', 'https://', $this->destinationUrl);\n }\n\n if ($this->forwardQueryParams === null) {\n $this->forwardQueryParams = config('short-url.forward_query_params') ?? false;\n }\n\n if (! $this->urlKey) {\n $this->urlKey = $this->keyGenerator->generateKeyUsing($this->generateKeyUsing);\n }\n\n if (! $this->activateAt) {\n $this->activateAt = now();\n }\n\n $this->setTrackingOptions();\n }", "function setOptions() {\n\t\t$enabled_options = '';\n\t\tif ($this->gamestate['enable_blurries']) $enabled_options .= 'blurries_enabled ';\n\t\tif ($this->gamestate['enable_wobblies']) $enabled_options .= 'wobblies_enabled ';\n\t\t$this->set(compact('enabled_options'));\n\t}", "public function setOptions($options);", "public function setCustomCurlOptions(array $options = array())\r\n {\r\n $this->customCurlOptions = $options;\r\n }", "protected abstract function _setupOptions();", "public function setCurlOptions()\n {\n if($this->_adapter->getEnv()) {\n $this->_curlClient->setOption(CURLOPT_SSL_VERIFYPEER, false);\n $this->_curlClient->setOption(CURLOPT_SSL_VERIFYHOST, false);\n } else {\n $this->_curlClient->setOption(CURLOPT_SSL_VERIFYPEER, true);\n }\n\n }", "public function setCallType($call_type)\n\t{\n\t\t$this->call_type = $call_type;\n\t\t$this->_detectTransport();\n\t}", "public function wpptn_set_options(){\n $opt = get_option( $this->prefix.'option');\n if(isset($opt)){\n $this->webhook_url = $opt['webhook_url'];\n }else{\n $this->webhook_url = null;\n }\n }", "public function setup_options() {\n\t\t$this->options = DiscourseUtilities::get_options();\n\t\t$this->webhook_url = ! empty( $this->options['url'] ) ? $this->options['url'] . '/admin/api/web_hooks' : null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Total Day In Month
function setTotalDayInMonth($value) { $this->totalDayInMonth = $value; }
[ "function setTotalDayInMonth($value) {\n $this->totalDayInMonth = $value;\n return $this;\n }", "function getTotalDayInMonth() {\n return $this->totalDayInMonth;\n }", "private function _setMonthDay()\n {\n if ($this->isMonthDay()) {\n $monthDays = explode(',', $this->rruleProperties['BYMONTHDAY']);\n $this->monthDay = $monthDays;\n } else {\n $this->monthDay = array();\n }\n return $this->monthDay;\n }", "public static function dayOfMonth() : int {\n return self::get()->timestamp['month-day'];\n }", "public function daysInMonth(): int;", "public function dayMonth() : int;", "public function prepareDaysPerMonth()\n {\n // Reset and copy\n $days_per_month = $this->days_per_month;\n $this->days_per_month = array();\n $index = 0;\n\n // Head\n foreach ($this->days_labels as $num_day => $label) {\n if ($num_day == 0) continue 1;\n $this->days_per_month['head'][] = $num_day;\n }\n\n // Get the day number of the first day\n $timestamp = $days_per_month[0];\n $first_day_number = date('w', $timestamp);\n $first_day_number = ($first_day_number == 0 ? 7 : $first_day_number);\n\n // Add possible days of previous month\n for ($added_day = $first_day_number; $added_day > 1; $added_day --) {\n $this->days_per_month['body'][$index][] = strtotime('-' . ($added_day - 1) . ' days', $timestamp);\n }\n\n // Add days of month\n foreach ($days_per_month as $timestamp) {\n $this->days_per_month['body'][$index][] = $timestamp;\n\n if (date('w', $timestamp) == 0) {\n $index += 1;\n }\n }\n\n // Add possible days of next month\n $added_day_number = 7 - count($this->days_per_month['body'][$index]);\n for ($added_day = 1; $added_day <= $added_day_number; $added_day ++) {\n $this->days_per_month['body'][$index][] = strtotime('+' . $added_day . ' days', $timestamp);\n }\n\n return $this;\n }", "private function _set_day($day) {\n\t\t$date = getdate($this->epoc);\n\t\t$month = $this->_get_month_number($date['mon']);\n\t\t$monthLength = $this->_get_month_length($date['year'],$month);\n\t\t$day = (($day < 0)?($monthLength+$day):$day);\n\t\treturn $this->_set_part($day,'mday');\n\t}", "public static function totalMonth()\n {\n return Pedido::monthly()->sum(\"total\");\n }", "public function setDayofMonth($val)\n {\n $this->_propDict[\"dayofMonth\"] = $val;\n return $this;\n }", "public function daysInMonth() : int\n {\n return $this->format('t');\n }", "public function addDDMM() {\n return $this->day + $this->month;\n }", "public function setDaysOfMonth\n\t(\n\t\t// (args of int) - allowed days of the month.\n\t)\t\t\t\t\t// RETURNS <this>\n\t\n\t// $schedule->setDaysOfMonth($day, $day, $day, ...)\n\t{\n\t\t$args = func_get_args();\n\t\t\n\t\t$dayList = array();\n\t\t\n\t\tforeach($args as $day)\n\t\t{\n\t\t\t// Prevent illegal days of the month\n\t\t\tif($day < 1 or $day > 31) { continue; }\n\t\t\t\n\t\t\t$dayList[] = $day + 0;\n\t\t}\n\t\t\n\t\t$this->triggers['days_of_month'] = $dayList;\n\t\t\n\t\treturn $this;\n\t}", "private function perDay ()\n {\n //Php 575.08 = (Php 15,000 X 12) / 313 if working Mondays to Saturdays\n //Php 689.66 = (Php 15,000 X 12) / 261 if working Mondays to Fridays\n $this->per_day = ($this->salary * 12) / $this->total_days;\n }", "public function withDayOfMonth($day) {\n\t\t$day = \\Bronto\\Util\\Preconditions::requireInt($day, '$day');\n\t\tstatic::validateDayOfMonth($this->getYear(), $this->getMonthOfYear(), $day);\n\n\t\t$thisDayOfMonth = $this->getDayOfMonth();\n\t\tif ($day == $thisDayOfMonth) {\n\t\t\treturn $this;\n\t\t}\n\n\t\t$delta = $day - $thisDayOfMonth;\n\t\treturn $this->plusDays($delta);\n\t}", "private function actualMonthCalcuation() {\n\t\t$daysInMonth = $this->getDaysInMonth(); // uses actual days in month\n\t\t$dailyRentAmount = $this->getDailyRentAmountMonthBased( $daysInMonth );\n\t\treturn $this->calculateAmount( $daysInMonth, $dailyRentAmount );\n\t}", "public function buildDaysPerMonth()\n {\n // Reset\n $this->days_per_month = array();\n\n // Setting the first and last day of the month\n $timestamp_first_day_of_month = mktime(0, 0, 0, $this->current_month, 1, $this->current_year);\n $timestamp_last_day_of_month = mktime(0, 0, 0, $this->current_month, date('t', $timestamp_first_day_of_month), $this->current_year);\n\n // Loop on $timestamps\n for ($timestamp = $timestamp_first_day_of_month; $timestamp <= $timestamp_last_day_of_month; $timestamp = strtotime('+1 day', $timestamp)) {\n $this->days_per_month[] = $timestamp;\n }\n\n return $this;\n }", "public function getMonthDay()\n {\n return $this->monthDay;\n }", "function pmpro_events_tribe_events_get_current_month_day($day) {\r\n\tif($day['total_events'] > 0 && !empty($day['events']->posts)) {\r\n\t\t$day['total_events'] = count($day['events']->posts);\r\n\t}\t\r\n\t\r\n\treturn $day;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return an instance with the specified status code and, optionally, reason phrase.
public function withStatus(int $code, string $reasonPhrase = ''): self { $new = clone $this; $new->code = $code; $new->reason = $reasonPhrase; return $new; }
[ "public function withStatus($code, $reasonPhrase = \"\"): Response\n {\n $newInstance = clone $this;\n\n $newInstance->processCode($code, $reasonPhrase);\n\n return $newInstance;\n }", "public function withStatus(int $code, string $reason_phrase = ''): ResponseInterface\n {\n return new self($code, $reason_phrase, $this->protocol_version, $this->headers, $this->body);\n }", "public function withStatus($code, $reasonPhrase = '')\n {\n if (!key_exists($code, self::$_statusCode)){\n throw new \\InvalidArgumentException('Invalid status code arguments.');\n }\n\n if ($this->statusCode === $code && $this->statusCode === $reasonPhrase){\n return $this;\n }\n\n $new = clone $this;\n $new->statusCode = (int)$code;\n $new->reasonPhrase = empty($reasonPhrase)? self::$_statusCode[$code]: $reasonPhrase;\n return $new;\n }", "public function withStatus($code, $reasonPhrase = '')\n {\n $code = $this->filterStatus($code);\n\n if (!is_string($reasonPhrase) && !method_exists($reasonPhrase, '__toString')) {\n throw new InvalidArgumentException('ReasonPhrase deve ser uma string');\n }\n\n $clone = clone $this;\n $clone->status = $code;\n if ($reasonPhrase === '' && isset(static::$messages[$code])) {\n $reasonPhrase = static::$messages[$code];\n }\n\n if ($reasonPhrase === '') {\n throw new InvalidArgumentException('ReasonPhrase deve ser fornecido para este código');\n }\n\n $clone->reasonPhrase = $reasonPhrase;\n\n return $clone;\n }", "public function withStatus($code, $reasonPhrase = '')\n {\n if (!$this->isValidStatusCode($code)) {\n throw new InvalidArgumentException('Invalid HTTP status code');\n }\n if (!$this->isValidReasonPhrase($reasonPhrase)) {\n throw new InvalidArgumentException('ReasonPhrase must be a string');\n }\n $clone = clone $this;\n $clone->status = $code;\n if ($reasonPhrase === '' && isset(static::$messages[$code])) {\n $reasonPhrase = static::$messages[$code];\n }\n\n if ($reasonPhrase === '') {\n throw new InvalidArgumentException('ReasonPhrase must be supplied for this code');\n }\n\n $clone->reasonPhrase = $reasonPhrase;\n\n return $clone;\n }", "public function withStatus($code, $reasonPhrase = '')\n {\n if (!array_key_exists($code, Constants::REASON_PHRASES)) {\n throw new InvalidArgumentException('Invalid HTTP status code: ' . $code);\n }\n $ret = clone($this);\n $ret->httpStatusCode = $code;\n if ($reasonPhrase) {\n $ret->httpReasonPhrase = $reasonPhrase;\n } else {\n $ret->httpReasonPhrase = Constants::REASON_PHRASES[$code];\n }\n return $ret;\n }", "public function createExitResponse(int $code = 200, string $reasonPhrase = '');", "static public function from($status): self\n\t{\n\t\tif ($status instanceof self)\n\t\t{\n\t\t\treturn $status;\n\t\t}\n\n\t\t$message = null;\n\n\t\tif (\\is_array($status))\n\t\t{\n\t\t\tlist($code, $message) = $status;\n\t\t}\n\t\telseif (\\is_numeric($status))\n\t\t{\n\t\t\t$code = (int) $status;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!\\preg_match('/^(\\d{3})\\s+(.+)$/', $status, $matches))\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(\"Invalid status: $status.\");\n\t\t\t}\n\n\t\t\tlist(, $code, $message) = $matches;\n\t\t}\n\n\t\treturn new static($code, $message);\n\t}", "public final static function factory($status) {\n\t$classNameEnd = preg_replace('/[^a-z]/i', '', $status);\n\tif (is_readable(realpath(dirname(__FILE__) . \"/StatusResponse/{$classNameEnd}.php\"))) {\n\t $className = \"Agel_Email_Treehouse_StatusResponse_{$classNameEnd}\";\n\t return new $className();\n\t}\n\n\treturn new Agel_Email_Treehouse_StatusResponse_Default();\n }", "protected function resObj($message,$status){\n\t\n\t\treturn Response::make($message,$status);\n\t}", "public function setStatus($code, $reasonPhrase = '');", "public function getStatusReasonPhrase();", "public function httpMessageResponseWithStatusOtherReason(UnitTester $I)\n {\n $I->wantToTest('Http\\Message\\Response - withStatus() - other reason');\n\n $code = 420;\n $reason = 'Phalcon Response';\n $response = new Response();\n $newInstance = $response->withStatus($code, $reason);\n $I->assertNotEquals($response, $newInstance);\n $I->assertEquals($code, $newInstance->getStatusCode());\n $I->assertEquals($reason, $newInstance->getReasonPhrase());\n }", "public static function withStatus($status) {\r\n $reply = new Reply();\r\n $reply->status = $status;\r\n return $reply;\r\n }", "function response(\n $status = 200,\n array $headers = [],\n $body = null,\n $version = '1.1',\n $reason = null\n ) {\n return new Response($status, $headers, $body, $version, $reason);\n }", "public function httpResponseConstructWithContentCodeStatus(UnitTester $I)\n {\n $I->wantToTest('Http\\Response - __construct(content = null, code = null, status = null)');\n\n $aData = [\n 'user' => 'jeremy',\n ];\n\n $nCodeSuccess = 200;\n\n $oResponse = new Response($aData, $nCodeSuccess, 'Success');\n\n $I->assertSame(\n $aData,\n $oResponse->getContent()\n );\n\n $I->assertSame(\n $nCodeSuccess,\n $oResponse->getStatusCode()\n );\n\n //Check Status message\n $I->assertSame(\n '200 Success',\n $oResponse->getHeaders()->get('Status')\n );\n }", "private static function errorFromStatus($status) {\n switch ($status) {\n\t\t\tcase '200': \n\t\t\t\treturn null;\n\t\t\tcase '400':\n\t\t\t\treturn new Samurai_BadRequestError();\n\t\t\tcase '401': \n\t\t\t\treturn new Samurai_AuthenticationRequiredError();\n\t\t\tcase '403': \n\t\t\t\treturn new Samurai_AuthorizationError();\n\t\t\tcase '404': \n\t\t\t\treturn new Samurai_NotFoundError();\n\t\t\tcase '406': \n\t\t\t\treturn new Samurai_NotAcceptableError();\n\t\t\tcase '500': \n\t\t\t\treturn new Samurai_InternalServerError();\n\t\t\tcase '503': \n\t\t\t\treturn new Samurai_DownForMaintenanceError();\n\t\t\tdefault: \n\t\t\t\treturn new Samurai_UnexpectedError('Unexpected HTTP response: ' . $status);\n\t\t}\n\t}", "protected function getHTTPResponceTextByCode($code) {\n $text = '';\n switch ($code) {\n case 100: $text = 'Continue'; break;\n case 101: $text = 'Switching Protocols'; break;\n case 200: $text = 'OK'; break;\n case 201: $text = 'Created'; break;\n case 202: $text = 'Accepted'; break;\n case 203: $text = 'Non-Authoritative Information'; break;\n case 204: $text = 'No Content'; break;\n case 205: $text = 'Reset Content'; break;\n case 206: $text = 'Partial Content'; break;\n case 300: $text = 'Multiple Choices'; break;\n case 301: $text = 'Moved Permanently'; break;\n case 302: $text = 'Moved Temporarily'; break;\n case 303: $text = 'See Other'; break;\n case 304: $text = 'Not Modified'; break;\n case 305: $text = 'Use Proxy'; break;\n case 400: $text = 'Bad Request'; break;\n case 401: $text = 'Unauthorized'; break;\n case 402: $text = 'Payment Required'; break;\n case 403: $text = 'Forbidden'; break;\n case 404: $text = 'Not Found'; break;\n case 405: $text = 'Method Not Allowed'; break;\n case 406: $text = 'Not Acceptable'; break;\n case 407: $text = 'Proxy Authentication Required'; break;\n case 408: $text = 'Request Time-out'; break;\n case 409: $text = 'Conflict'; break;\n case 410: $text = 'Gone'; break;\n case 411: $text = 'Length Required'; break;\n case 412: $text = 'Precondition Failed'; break;\n case 413: $text = 'Request Entity Too Large'; break;\n case 414: $text = 'Request-URI Too Large'; break;\n case 415: $text = 'Unsupported Media Type'; break;\n case 500: $text = 'Internal Server Error'; break;\n case 501: $text = 'Not Implemented'; break;\n case 502: $text = 'Bad Gateway'; break;\n case 503: $text = 'Service Unavailable'; break;\n case 504: $text = 'Gateway Time-out'; break;\n case 505: $text = 'HTTP Version not supported'; break;\n default: break;\n }\n return $text;\n }", "public static function interpret($status)\n {\n // Status from integer or numeric string\n if (is_numeric($status)) {\n if (isset(self::$statusCodes[$status])) {\n return \"$status \" . self::$statusCodes[$status];\n \n } else {\n $msg = \"Unknown status code: $status\";\n throw new InvalidArgumentException($msg);\n }\n\n // Status from string\n } else if (is_string($status)){\n // Build a string-to-integer lookup for converting a symbol (like\n // 'created' or 'notImplemented') into its corresponding HTTP status\n // code (like 200 or 501). \n static $symbolToStatusCode = array();\n if (empty($symbolToStatusCode)) {\n foreach (self::$statusCodes as $code => $message) {\n $symbol = Mad_Support_Inflector::camelize($message, \n $first='lower');\n $symbolToStatusCode[$symbol] = $code;\n }\n } \n \n // Convert status symbol to integer code, return header\n if (isset($symbolToStatusCode[$status])) {\n return self::interpret($symbolToStatusCode[$status]);\n } \n\n // Error: Status symbol could not be converted to an integer code\n // Try to help if the developer mixed up underscore/camel\n $msg = \"Unknown status: '$status'\";\n if (strpos($status, '_')) {\n $status = Mad_Support_Inflector::camelize($status, \n $first='lower');\n if (isset($symbolToStatusCode[$status])) {\n $msg .= \" (underscore), did you mean '$status' (camel)?\";\n }\n }\n throw new InvalidArgumentException($msg);\n\n // Status is an unknown type\n } else {\n $msg = '$status must be numeric or string, got '\n . gettype($status);\n throw new InvalidArgumentException($msg);\n }\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The android version of function that gets the friend request of the user
function androidGetFriendRequest() { $userId = Slim::getInstance()->request()->post('id'); $sql = "SELECT UserId, FriendId FROM FriendRequest WHERE FriendId = :userId"; try { $db = getConnection(); $stmt = $db->prepare($sql); $stmt->bindParam("userId", $userId); $stmt->execute(); $friendRequest = $stmt->fetchAll(PDO::FETCH_OBJ); $db = null; echo '{"FriendRequest": ' . json_encode($friendRequest) . '}'; } catch(PDOException $e) { echo '{"error":{"text":'. $e->getMessage() .'}}'; } }
[ "function vibe_friends_get_friendId_request_ids_for_user($request){\n\n \t\t$args = json_decode($request->get_body(),true);\n\n \t $initiator_friendship_ids=$this->vibe_friends_get_friendship_ids_for_user($this->user->id,$args['page'],$args['requester'],$args['sort']);\n \t $user_details = array();\n \t if(!empty($initiator_friendship_ids)){\n\t \t\tforeach ($initiator_friendship_ids as $initiator_friendship_id) {\n\n\t \t\t\t$uid = (int)$initiator_friendship_id->initiator_user_id;\n\t \t\t\tif(!empty($args['requester'])){\n\t \t\t\t\t$uid = (int)$initiator_friendship_id->friend_user_id;\n\t \t\t\t}\n\t \t\t\t$user = bp_core_get_core_userdata($uid);\n\t \t\t\t$user->avatar = bp_core_fetch_avatar(array(\n\t 'item_id' \t=> $user->ID,\n\t 'object' \t=> 'user',\n\t 'type'\t\t=>'thumb',\n\t 'html' \t=> false\n\t ));\n\t \t\t\t $user_details[]=array(\n\t \t\t\t \t'friendship_id'=>(int)$initiator_friendship_id->id,\n\t \t\t\t \t'user'=>$user\n\t \t\t\t );\n\t \t\t}\n\t \t}\n \t\t$data=apply_filters( 'vibe_friends_get_friendId_request_ids_for_user', array('status'=>1,'data'=>$user_details),$request );\n\t\t\treturn new WP_REST_Response( $data, 200 ); \n\n \t}", "private function GetFriends(){\n\n if($this->get_request_method() != \"POST\"){\n $this->response('',406);\n }\n $r = json_decode(file_get_contents(\"php://input\"),true);\n //$r = $r['name'];\n $response = array();\n $db = new DbHandler();\n $session = $db->getSession();\n\n if(isset($r['uid']) && $r['uid']=='session_id'){\n $uid = $session['uid'];\n }else{\n $uid = $r['uid'];\n }\n\n $sql = \"SELECT u.uid,u.name,u.email,u.phone,u.password,u.username,u.gender,u.dobDate,u.dobMonth,u.dobYear,u.zipcode,u.city,f.fri_id,f.friend_one,f.friend_two,f.accept as accept,\n if(f.friend_one = $uid,1,0) as you,\nCASE\n \tWHEN accept IS NULL THEN 'Add as Friend'\n\tWHEN accept = 0 THEN if(f.friend_two = $uid,'Friend Request Came','Friend Request Sent')\n \tWHEN accept = 1 THEN 'Friends'\n \tWHEN accept = 2 THEN 'Friend Request Declined'\nEND as friend_accept,\nif(u.profilePic='',if(u.gender=1,'male.png','female.png'),u.profilePic) as profilePic,\n(SELECT 1 FROM user_intrests WHERE uid = $uid and intrest_uid = u.uid and type = 1) as loved\nFROM\nusers u, friends f\nWHERE u.uid = f.friend_two AND f.friend_one = $uid OR u.uid = f.friend_one AND f.friend_two = $uid\"; // WHERE username LIKE '%\".$r.\"%'\n $response = $db->getRecords($sql);\n\n if ($response != NULL) {\n $this->response($this->json($response), 200); // send user details\n }\n\n }", "function requestIncomingFriendRequests() {\n $username = $_GET['username'];\n\n $response = retrieveIncomingFriendRequests($username);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function userGetFriends()\n {\n $service = \"/{$this->get('version')}/user/{$this->get('user')}/friends.xml\";\n return $this->_getInfo($service);\n }", "protected function userFriends(){\r\n if ($this->method == 'GET'){\r\n //userID will be the first argument of the endpoint URI.\r\n $userID = $this->args[0];\r\n //userToken will be the second argument of the endpoint URI.\r\n $userToken = $this->args[1];\r\n //Create an instance of the UserToken class.\r\n $this->UserToken = new UserToken();\r\n\r\n $userIDFromJWT = $this->UserToken->verifyUserToken($userToken);\r\n\r\n $data = array(); //an array to hold the data returned to the client\r\n\r\n if($userIDFromJWT !== NULL){\r\n //the $userIDFromJWT is not null, therefore the userToken is valid.\r\n //Create an instance of the User class and get all friends data related to the userID we received as a parameter.\r\n $this->User = new User();\r\n $data['friends'] = $this->User->getUserFriends($userID);\r\n $data['responseStatus'] = \"success\"; //add the responseStatus key to the array that we send back.\r\n return $data;\r\n }else{\r\n //Log this error\r\n $this->ErrorHandler->createLogEntry(\"userFriends\", \"User Token is not valid.\");\r\n throw new Exception(\"User token is not valid.\");\r\n }\r\n }else{\r\n throw new Exception(\"Only accepts GET requests\");\r\n }\r\n }", "function friendReq($friend_id){\n \n if(!is_numeric($friend_id)){\n $this->err=TRUE;\n $this->errMessage=\"Probable injection attack.\";\n return;\n }\n //Check whether the they are already friends\n $stmt= $this->link->prepare(\"SELECT status FROM friends\n WHERE (friend1=? AND friend2=?) OR (friend1=? AND friend2=?)\");\n $stmt->bind_param(\"dddd\", $this->userid,$friend_id,$friend_id, $this->userid);\n $stmt->execute();\n $result=$stmt->get_result();\n \n if($result->num_rows>0){\n $this->err=TRUE;\n $row=$result->fetch_assoc();\n if($row['status'] == 1){\n $this->errMessage=\"You are already friend.\";\n return;\n }\n else{\n $this->errMessage=\"Awaiting confirmation.\";\n return;\n }\n \n }\n $stmt->close();\n \n //If the users are not friends, then send a request\n $stmt_insert= $this->link->prepare(\"INSERT INTO friends (friend1,friend2) VALUES('$this->userid',?)\");\n $stmt_insert->bind_param(\"d\",$friend_id);\n if(!$stmt_insert->execute()){\n $this->err=TRUE;\n $this->errMessage=\"Database error, please try again.\";\n return;\n }\n $stmt_insert->close();\n }", "public function getFriends();", "public function GetFriendRequests()\n {\n $result = $this->_db->ExecuteStmt(Statements::SELECT_USER_FRIEND_REQUEST, $this->_db->BuildStmtArray(\"i\", $this->GetId()));\n if ($result === false)\n return false;\n if ($result->num_rows === 0)\n return USER_HAS_NO_FRIEND_REQUESTS;\n $friendRequests = array();\n while ($row = $result->fetch_assoc())\n {\n $friendRequests[] = array(\n \"id\" => $row['requester_id'],\n \"username\" => $row['username'],\n \"isOnline\" => $row['is_online'],\n \"message\" => $row['message'],\n \"avatarPath\" => $row['avatar_path'],\n );\n }\n return $friendRequests;\n }", "function androidAddFriendRequest()\n{\n $userId = Slim::getInstance()->request()->post('id');\n $friendId = Slim::getInstance()->request()->post('friendId');\n \n try {\n $db = getConnection();\n\n\t $sql = \"SELECT FriendRequestId FROM FriendRequest WHERE UserId=:friendId AND FriendId=:userId\";\n\t $stmt = $db->prepare($sql);\n $stmt->bindParam(\"userId\",$userId);\n $stmt->bindParam(\"friendId\",$friendId);\n $stmt->execute();\n\t $requestId = $stmt->fetchObject();\n\t if($requestId) {\n\t\t$insertFriend1 = \"INSERT INTO FriendsList(UserId, FriendId) VALUE(:friendId, :userId)\";\n\t\t$insertFriend2 = \"INSERT INTO FriendsList(UserId, FriendId) VALUE(:userId, :friendId)\";\n\t\t$deleteRequest = \"DELETE FROM FriendRequest WHERE FriendRequestId=:requestId\";\n\n\t\t$stmt = $db->prepare($insertFriend1);\n\t\t$stmt->bindParam(\"friendId\", $friendId);\n\t\t$stmt->bindParam(\"userId\", $userId);\n\t\t$stmt->execute();\n\n\t\t$stmt = $db->prepare($insertFriend2);\n\t\t$stmt->bindParam(\"userId\", $userId);\n\t\t$stmt->bindParam(\"friendId\", $friendId);\n\t\t$stmt->execute();\n\n\t\t$stmt = $db->prepare($deleteRequest);\n\t\t$stmt->bindParam('requestId', $requestId);\n\t\t$stmt->execute();\n\t } else {\n\t\t$sql = \"INSERT INTO FriendRequest(userId, friendId) VALUE(:userId, :friendId)\";\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bindParam(\"userId\",$userId);\n\t\t$stmt->bindParam(\"friendId\",$friendId);\n\t\t$stmt->execute();\n\t }\n $db = null;\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n }\n}", "function is_friend()\n{\n global $mysqli;\n $potential_friend = $_GET['id'];\n $isauser = get_user_info($potential_friend, 'uid');\n\n if ($isauser['id'])\n {\n $user_id = $_SESSION['id'];\n if (intval($potential_friend) == intval($user_id))\n $num_rows = 1;\n else if (intval($potential_friend) != intval($user_id) && !is_friend_request())\n {\n\n\n $are_they_my_friend_query = 'SELECT * FROM friends WHERE (user1_id = ' . $user_id . ' or user1_id = ' . $potential_friend . ') \n and (user2_id = ' . $user_id . ' or user2_id = ' . $potential_friend . ')';\n if ($result = $mysqli->query($are_they_my_friend_query))\n $num_rows = $result->num_rows;\n } else\n $num_rows = 0;\n } else\n $num_rows = 0;\n\n return $num_rows;\n}", "function homeFriendsRequest($userId)\n\t{\n\t\t$friendRequestUrl\t= base_url().'index.php/friends/request';\n\t\t$mainContent= '';\n\t\t$sql=mysql_query(\"SELECT user_id FROM `friends_list` WHERE `friend_id` =$userId and approved_status='no'\"); //fetching the list request friend\n\t\tif ($sql)\n\t\t{\n\t\t\twhile($rs=mysql_fetch_object($sql))\n\t\t\t{\n\t\t\t\t$sqlrec\t=mysql_query(\"select user_id,blocked_user_id from block_users where user_id=\".$userId.\" and blocked_user_id=\".$rs->user_id); //checking if the requested friend is blocked user or not\n\t\t\t\t$cnt\t= mysql_num_rows($sqlrec);\n\t\t\t\tif($sqlrec)\n\t\t\t\t{\n\t\t\t\t\twhile($res=mysql_fetch_object($sqlrec))\n\t\t\t\t\t{\n\t\t\t\t\t\t$qry=mysql_query(\"delete from friends_list where user_id=\".$res->blocked_user_id.\" and friend_id=\".$res->user_id); // deleting the requested friend if the requested friend is blocked person \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$tot\t\t=getTotRec(\"user_id\",\"friends_list\",\"friend_id='$userId' AND approved_status='no'\");\n\t\t\t\t$totRequest\t= $tot-$cnt;\n\t\t\t\t\n\t\t\t\tif($totRequest>0)\n\t\t\t\t{\n\t\t\t\t\t$title\t\t= \t'<tr>\n\t\t\t\t\t\t\t\t\t<td bgcolor=\"#e9e9e9\">&nbsp;&nbsp;<span class=\"blktxt\"><strong>Requests</strong></span></td>\n\t\t\t\t\t\t\t\t\t</tr>';\n\t\t\t\t\t$content\t= \t'<tr><td><div><a href=\"'.$friendRequestUrl.'\" class=\"BlueLink\"><img src=\"'.base_url().'application/images/friend.gif\" border=\"0\"> '.$totRequest.' friend request(s)</a></div></td></tr>';\n\t\t\t\t\t$mainContent= \t'<table width=\"100%\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\">'.$title.$content.'</table>';\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\t\t\t\n\t\treturn $mainContent;\n\t}", "public function myfriends(){\n\t\t$url = 'http://local.kizzangchef.com/api/playerinvite/myfriends/10/0';\n\t\t$token = null;\t\t\n\t\t$method = 'get';\n\t\t$api_key = $this->getKey();\n\t\t$params = array();\n\t\t$response = $this->doCurl($url, $params, $api_key, $token, $method);\n\t\tvar_dump($response);\n\t\texit;\n\t}", "public function accept_friend_request(Request $request){\n\n $response = User::accept_friend_request($request);\n\n return $response;\n }", "function gigya_get_friends_info($gigya_uid, $params = array()) {\n if (empty($gigya_uid)) {\n return FALSE;\n }\n\n $params += array(\n 'uid' => $gigya_uid,\n );\n\n return _gigya_api('getFriendsInfo', $params);\n}", "public function getfbUserFriends(){\n\n\n $get = Facebook::get(\"https://graph.facebook.com/v2.7/me/friends\", Auth::user()->access_token);\n //dd($get->getGraphObject());\n dd($get->getGraphUser());\n }", "public function getfriendsInformation() {\r\n $req = \"select f.id_user_f as publictoken, u.pseudo , u.firstname as firstName, u.lastname as lastName, u.age, u.city, u.imagelink, u.number, g.log as lon, g.lat,g.time\r\n from friends f, user u, usergeo g \r\n where f.id_user='$this->token' \r\n and f.id_user_f=u.publictoken \r\n and g.token_user = (select u1.token from user u1 where publictoken = f.id_user_f)\r\n and g.visible = '1'\";\r\n\r\n $res = Connection::getDbMapper()->execStatement($req);\r\n $ret = array();\r\n while (($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) != NULL) {\r\n $ret[] = $row;\r\n }\r\n mysqli_free_result($res);\r\n return $ret;\r\n }", "public function followFriend(Request $request);", "function getFriendDetails($userId,$visitedProfile){\n\n\t\t$query\t\t\t=\t\"SELECT * FROM `tblfriends_request` WHERE `user_id`=$userId AND `friends_id`=$visitedProfile OR `user_id`=$visitedProfile AND `friends_id`=$userId \";\n\t\t$rec\t\t\t=\t$this->getdbcontents_sql($query,0);\n\t\treturn $rec;\n\t}", "protected function Friend() {\n require \"./app/core/http/endpoints/friend.endpoint.php\";\n $friendsHandler = new Endpoints\\Friend($this);\n return $friendsHandler->_handleRequest();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes the restarted command then deletes the tmp ini.
private function restart($command) { $exitCode = 1; passthru($command, $exitCode); if (!empty($this->tmpIni)) { @unlink($this->tmpIni); } exit($exitCode); }
[ "function restart()\n {\n $this->cli->quietly('launchctl unload '.$this->daemonPath);\n\n $this->cli->quietly('launchctl load '.$this->daemonPath);\n }", "public static function tearDownAfterClass()\n {\n unlink('/tmp/sample.ini');\t\n }", "public function __destruct()\n {\n if (is_string($this->tmpIni)) {\n @unlink($this->tmpIni);\n }\n }", "private function cleanTmpConfigFile()\n {\n /* clean config.json into tmp dir */\n $tmpConfigFile = sys_get_temp_dir().\\DIRECTORY_SEPARATOR.'config.json';\n\n if (file_exists($tmpConfigFile)) {\n unlink($tmpConfigFile);\n }\n }", "public function resetSettingsState()\n {\n clearstatcache();\n if (@file_exists($this->settings_path) && $this->settings_state == null) {\n @unlink($this->settings_path);\n return;\n }\n @file_put_contents($this->settings_path, $this->settings_state);\n }", "private function deleteConfig(): void\n {\n $configFile = $this->getDataFolder() . \"config.yml\";\n if (file_exists($configFile)) {\n unlink($configFile);\n }\n }", "public function delete() {\n global $ab_path;\n system(\"rm -R \".escapeshellarg($ab_path.\"update\"));\n }", "public function tearDown(): void {\n\t\tunlink(self::$filePath);\n\t\tConfigReader::reset(TestContainer::getContainer());\n\t}", "private function cleanUp() {\n if ($this->clean_up === true && is_dir($this->temp_dir)) {\n $this->log('Cleaning up temporary files ...' . self::NL);\n $this->command(sprintf('rm -rf %s',\n $this->temp_dir));\n }\n }", "public function restartWizard()\n {\n gdpr('options')->delete('installer_step');\n gdpr('options')->delete('is_installed');\n\n wp_safe_redirect(self_admin_url());\n exit;\n }", "protected function clearTemp()\n {\n $this->log('Clearing temporary directory.');\n \n $this->execute('rm -rf ../init/*');\n }", "public static function reinstall() {\n\t\tdelete_option('updraft_task_manager_dbversion');\n\t\tself::install();\n\t}", "protected function clearTemp()\n {\n $this->log(\"Clearing temporary directory.\");\n\n $this->execute('rm -rf ../init/*');\n }", "private function delete_config_files() {\n\t\t$this->delete( $this->config_path );\n\t}", "function cleanTrash () {\n if (file_exists(ABSPATH . \"demo.sql\")) { unlink (ABSPATH . \"demo.sql\"); }\n }", "function deletePidFile() {\n if (file_exists(PAPAYA_PATH_CACHE.'/papaya_cron.pid')) {\n unlink(PAPAYA_PATH_CACHE.'/papaya_cron.pid');\n }\n }", "function install_done() {\n\tsave_file('data/settings/install.dat', '');\n}", "private function deleteTmpDir()\n {\n $dir = $this->getTempDir();\n $this->exec(\"rm -rfv {$dir}\");\n }", "private function deleteTempFile() {\n\t\tif (strlen($this->tempFileName) > 0 && file_exists($this->tempFileName) && is_writable($this->tempFileName)){\n\t\t\tunlink($this->tempFileName);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function which will specify whether the mass edit option is disabled.
public function isMassEditOptionDisabled() { if (0 == $this->get('masseditable') || 1 != $this->get('displaytype') || 3 == $this->get('masseditable')) { return true; } return false; }
[ "public function disableEditing(){\n \t$this->_editable = false;\n }", "public function isEditOnlyMode();", "public function disableEditRecord() {\n $this->allow_edit_record = false;\n }", "public function isDisabled () {}", "public function setDisabled(): self;", "public function isDisabled();", "public function setDisabled($value);", "public function setDisabled() {\n\t\t$this->addAttribute('disabled', 'disabled');\n\t}", "public function disable()\n {\n $this->data['enabled'] = false;\n }", "protected function toggleDisableAction() {}", "public static function can_be_disabled() {\n return true;\n }", "function confpropertiesButtonDisabling(){\n\t\tglobal $BE_USER;\n\t\t$this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.web_txtemplavoilaM1');\n\t\t$typesForDisableEditViewEditingButtons = t3lib_div::trimExplode(',',strtolower($this->modTSconfig['properties']['disableEditViewEditingButtons']),1);\n\t\tif(isset($typesForDisableEditViewEditingButtons) && is_array($typesForDisableEditViewEditingButtons))\n\t\t \t$this->disableEditViewEditingButtons = array_flip($typesForDisableEditViewEditingButtons);\n\t\tif(array_key_exists('editIconModeTemplaVoila',$BE_USER->uc) && $BE_USER->uc['editIconModeTemplaVoila']!='' && !$this->modTSconfig['properties']['disableUserSetup'])\n\t\t\t$this->modTSconfig['properties']['editIconModeTemplaVoila'] = $BE_USER->uc['editIconModeTemplaVoila'];\n\t }", "public function disable();", "function allowEdit()\n\t{\n\t\t$this->_allowEdit = true;\n\t}", "function tinymce_content_edit_disable( $args ) \n\t\t{\n\t\t\tglobal $post;\n\t\t\tif ( $this->is_page_locked_for_current_user() && $this->is_page_content_locked($post->ID) ) {\n \t\t$args['readonly'] = 1;\n \t}\n \treturn $args;\n\t\t}", "function DisableCellEditControl(){}", "public function disable()\n {\n $this->server_item->setDisabled(true);\n $this->course_item->setDisabled(true);\n $this->clearCommandButtons();\n }", "public function getIsDisabled(){\n return Mage::getStoreConfigFlag('easylife_gridenhancer/disable/'.$this->getGridIdentifier());\n }", "function ea_disable_gutenberg( $can_edit, $post_type ) {\n\n\tif( ! ( is_admin() && !empty( $_GET['post'] ) ) )\n\t\treturn $can_edit;\n\n\tif( ea_disable_editor( $_GET['post'] ) )\n $can_edit = false;\n\n if ($post_type === 'projects')\n return false;\n\n\treturn $can_edit;\n\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cookie duration can be set(in hours) by administrator. It converts it from hours to seconds and add it to current time.
public function getCookieEndTime() { return time()+(3600*((int)$this->getCookieDuration())); }
[ "public function set_expiration_variant_time() {\n\n\t\treturn ( ! empty( $this->exp_option ) ? ( intval( $this->exp_option ) - 3600 ) : 30 * 60 * 23 );\n\t}", "function cookie_duration( $duration, $user_id, $remember ) {\n\t\t$dur = $this->getService()->getDuration( true );\n\t\tif ( $dur < 2 ) {\n\t\t\t//duration set smaller than 2 days, use the custom for both remember & non remeber\n\t\t\treturn $dur;\n\t\t} elseif ( $remember ) {\n\t\t\t//this case only\n\t\t\treturn $dur;\n\t\t}\n\n\t\t//return default\n\t\treturn $duration;\n\t}", "function sessionDuration($timeType = self::TIME_TYPE_HOURS){\n //return strtotime(\"$this->session_duration hours\",$this->currentTimestamp());\n settype($this->session_duration,\"int\");\n switch ($timeType){\n case self::TIME_TYPE_SEC: return (int)$this->session_duration;\n case self::TIME_TYPE_MINUTES: return (int)$this->session_duration * 60;\n case self::TIME_TYPE_DAYS: return (int)$this->session_duration * 60 * 60 * 24;\n case self::TIME_TYPE_MONTHS:return (int)$this->session_duration *60* 60 * 24 * 30;\n default:\n return (int)$this->session_duration * 3600;\n }\n }", "public function set_expiration_variant_time( $exp ) {\r\n\t\treturn ( 23 * 60 );\r\n\t}", "function set_cache_duration($seconds = 3600)\n{\n$this->cache_duration = (int) $seconds;\n}", "public function getCookieExpiration(){\r\n return $this->_cookieExpiration;\r\n }", "public function getSessionDuration(): int;", "public function getCookieLifetime()\n {\n return Mage::getModel('core/cookie')->getLifetime() * 1000;\n }", "public function get_cookie_life() {\n\n\t\t\t$life = get_option( 'wc_sc_coupon_cookie_life', 180 );\n\n\t\t\treturn apply_filters( 'wc_sc_coupon_cookie_life', time() + ( 60 * 60 * 24 * $life ) );\n\n\t\t}", "public function setSessionDuration($duration) {\n\t\tassert('is_int($duration)');\n\t\tassert('isset($this->authData[$this->authority])');\n\n\t\tSimpleSAML_Logger::debug('Library - Session: Set session duration ' . $duration);\n\t\t$this->dirty = true;\n\n\t\t$this->authData[$this->authority]['Expire'] = time() + $duration;\n\t}", "public function getAffiliationCookieDuration()\n {\n return $this->affiliationCookieDuration;\n }", "public function getDuration(){\n\t\treturn $this->rememberMe ? UserModule::get()->rememberMeDuration : 0;\n\t}", "public function get_expiration() {\n\t\t$days = get_theme_mod( 'wfc_cookie_duration', 30 );\n\t\t$days = absint( $days );\n\t\t$expiration = time() + 86400 * $days;\n\n\t\treturn $expiration;\n\t}", "private function updatePermanentCookieExpiration(): void\n {\n $this->cookie->setCookie(\n $this->permanentCookieName,\n $this->cookie->getCookie($this->permanentCookieName),\n (int)($_SERVER['REQUEST_TIME'] + ($this->permanentLoginDuration * 24 * 60 * 60))\n );\n }", "public function getCookieLifetime()\n {\n return static::COOKIE_LIFETIME;\n }", "public function getCookieExpireTime()\n {\n return $this->cookie_expire_time;\n }", "public function createExpirationTime(){\n return time() + (int)$this->_expirationTime;\n }", "private function expireTime()\n {\n return time() + Config::get('jwt.expiry'); // in seconds\n }", "public function getLifetime() : string {\n if ($this->expires == 0) {\n return '';\n }\n\n return date(DATE_COOKIE, $this->expires);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return list of action types
public function getActionTypes() { return self::$actionTypes; }
[ "public function getActionTypes() {\n return array_map('ucfirst', array_combine(array_keys($this->actions), array_keys($this->actions)));\n }", "public function getActionTypes(): array;", "public function actionsTypes()\n {\n }", "public function getGenericActions();", "public function getActions();", "public function actionTypes()\n {\n $this->checkInputParams(function () {\n return [\n 'token' => ['hash' => Token::find()->random()->one()->hash],\n ];\n });\n\n $types = BeverageType::find()->orderBy('name')->all();\n\n return [\n 'types' => ActiveUtils::toArray($types, [], function ($type) {\n return [\n 'icon_url' => Url::to(sprintf('@web/images/%s', $type->image_filename), true)\n ];\n })\n ];\n }", "function getActions() {\n return array();\n }", "public static function getActions() {\r\n\t\t$registrars = Registrars::getList(false);\r\n\t\t$actions = array();\r\n\t\tforeach ($registrars as $id => $name){\r\n\t\t $registrar = Registrars::find ( $id, null, true );\r\n\t\t\tif (! empty ( $registrar [0] ['class'] ) && class_exists ( $registrar [0] ['class'] )) {\r\n\t\t\t\t$class = $registrar [0] ['class'];\r\n\t\t\t\t$reg = new $class ();\r\n\t\t\t\t$actions[$name] = $reg->getActions();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $actions;\r\n\t}", "public function getActionType();", "public function getActionList()\n {\n return $this->actionList;\n }", "public function actions() {\n if (empty($this->info)) {\n $this->refreshInfo();\n }\n return !empty($this->info['actions']) ? $this->info['actions'] : array();\n }", "protected static function getActions()\n {\n return [\n CrudController::ACTION_ADD => 'created',\n CrudController::ACTION_DELETE => 'removed',\n CrudController::ACTION_DETAILS => 'displayed',\n CrudController::ACTION_EDIT => 'updated',\n CrudController::ACTION_HIDE => 'hidden',\n CrudController::ACTION_VIEW => 'displayed',\n CrudController::ACTION_UNHIDE => 'made visible',\n CrudController::ACTION_ENABLE => 'enabled',\n CrudController::ACTION_DISABLE => 'disabled',\n ];\n }", "public function availableActions()\n {\n return $this->_actions;\n }", "function getAllActions()\n {\n return array(\n 'updated',\n 'closed',\n 'emails',\n 'files'\n );\n }", "protected function GetActions()\n {\n $this->GetCaps(); //actions are assigne in caps list\n $result = $this->actions;\n return $result;\n }", "private function generateActionRoutes()\n\t{\n\t\t$actions = array();\n\t\t$methods = get_class_methods(get_called_class());\n\n\t\tforeach($methods as $method)\n\t\t{\n\t\t\tif(substr($method, -6) == 'Action')\n\t\t\t{\n\t\t\t\t$actions[] = substr($method, 0, -6);\n\t\t\t}\n\t\t}\n\n\t\treturn $actions;\n\t}", "public function getClientActionClassesList()\n {\n return array(\n 'state' => 'Flying\\Bundle\\ClientActionBundle\\ClientAction\\StateClientAction',\n 'event' => 'Flying\\Bundle\\ClientActionBundle\\ClientAction\\EventClientAction',\n 'load' => 'Flying\\Bundle\\ClientActionBundle\\ClientAction\\LoadClientAction',\n );\n }", "public static function getActionsList()\n\t{\n\t\t$accountsPriority = ['CreatedEmail', 'CreatedHelpDesk', 'BindAccounts', 'BindContacts', 'BindLeads', 'BindHelpDesk', 'BindSSalesProcesses'];\n\t\t$moduleModel = Vtiger_Module_Model::getInstance('OSSMailScanner');\n\t\t$iterator = new DirectoryIterator($moduleModel->actionsDir);\n\t\t$actions = [];\n\t\tforeach ($iterator as $i => $fileInfo) {\n\t\t\tif (!$fileInfo->isDot()) {\n\t\t\t\t$action = $fileInfo->getFilename();\n\t\t\t\t$action = rtrim($action, '.php');\n\t\t\t\t$key = array_search($action, $accountsPriority);\n\t\t\t\tif (false === $key) {\n\t\t\t\t\t$key = $i + 100;\n\t\t\t\t}\n\t\t\t\t$actions[$key] = $action;\n\t\t\t}\n\t\t}\n\t\tksort($actions);\n\n\t\treturn $actions;\n\t}", "public function actionNodeTypes() {\n return array_keys($this->info);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch campaign fundraisers from API
public function campaignFundraisers($campaignId, $count = 5) { $cacheKey = ClassyOrg::CACHE_KEY_PREFIX . '_CAMPAIGN_FUNDRAISERS_' . $campaignId; $result = get_transient($cacheKey); if ($result === false) { $params = array( 'aggregates' => 'true', 'sort' => 'total_raised:desc', 'per_page' => $count, 'filter' => 'status=active' ); $fundraisers = $this->apiClient->request( '/campaigns/' . $campaignId . '/fundraising-pages', 'GET', $params ); $result = json_decode($fundraisers, true); // Pluck off relevant bits $result = $result['data']; set_transient($cacheKey, $result, $this->getExpiration()); } return $result; }
[ "private function fetchCampaigns() {\n $hash = $this->uri->segment(2);\n\n if( !$hash ) {\n show_error('Unknown campaign id');\n return;\n }\n\n $campaign = $this->Campaign_model\n ->where('campaigns.campaign_token', $hash)\n ->find();\n\n $opportunity = false;\n\n if( !count($campaign) || $campaign[0]->campaign_id ) {\n $opportunity = $this->Opportunity_model\n ->where('campaigns.campaign_token', $hash)\n ->find();\n }\n\n if( $opportunity && count($opportunity) ) {\n $opportunity = $opportunity[0];\n $campaign = $opportunity->campaign;\n } else {\n $campaign = $campaign[0];\n $opportunity = false;\n }\n\n return array(\n 'campaign' => $campaign,\n 'opportunity' => $opportunity\n );\n }", "public function getDebtFunds() \n\n {\n $allFund = Fund::all();\n $allFund = DB::select('SELECT fund_house.fund_name,fund_house.launch_date,funds.fund_scheme,fund_category.category_name\n FROM funds\n JOIN fund_house ON funds.fund_id = fund_house.id\n JOIN fund_category ON fund_category.category_id = funds.id WHERE category_name = \"debt\"') ;\n if(empty($allFund))\n {\n $result = array(\"status\"=>0);\n }\n else\n {\n $result = array(\"status\"=>1,\"data\"=>$allFund);\n }\n return $result;\n }", "public function fetch_campaign_details($campaign_id) {\r\n\t\treturn $this->get_data(\"campaigns/{$campaign_id}?include=benefits,creator,goals,tiers\");\r\n\t}", "public function fetch_campaigns()\n {\n return $this->get_data(\"campaigns\");\n }", "public function fetch_campaigns() {\r\n\t\treturn $this->get_data(\"campaigns\");\r\n\t}", "public function listCampaigns()\n\t{\n\t\t$url = $this->config['Config']['US']['BETA_API_URL'] . 'campaigns';\n\n\t\t$header = array(\n\t\t\t'Authorization: Bearer ' . $this->config['Config']['BETA_API_KEY']\n\t\t);\n\n\t\t$request = json_decode($this->cURLGet($url, $header));\n\t\treturn $request;\n\t}", "public function getBudget()\n {\n $ch = new Curl;\n\n return $ch->get(OVOID::BASE_ENDPOINT . 'v1.0/budget/detail', null, $this->_aditionalHeader())->getResponse();\n }", "public function fetchData()\n {\n\n //Get query vars\n $query = (isset($_GET['search']) && !empty($_GET['search'])) ? $_GET['search'] : '';\n $id = (isset($_GET['id']) && !empty($_GET['id'])) ? $_GET['id'] : '';\n $category = (isset($_GET['category']) && !empty($_GET['category'])) ? urldecode($_GET['category']) : '';\n $hostUrl = get_option('group_5be98c9780f80_mod_agreement_archive_api_host');\n\n //Create API url\n $apiUrl = $hostUrl;\n $apiUrl .= ($query) ? \"/?q=\" . urldecode (sanitize_text_field($query)) : '';\n $apiUrl .= ($id) ? \"/\" . $id : '';\n\n //Get from resource\n if ($cachedCall = wp_cache_get('ModularityAgreementsArchive', 'getCall' . md5($apiUrl))) {\n $apiCallReturn = $cachedCall;\n } else {\n $apiCallReturn = wp_remote_get(\n $apiUrl,\n array(\n 'timeout' => 20,\n 'headers' => array(\n 'apiKey' => get_option('group_5be98c9780f80_mod_agreement_archive_api_key')\n )\n )\n );\n wp_cache_add('ModularityAgreementsArchive', $apiCallReturn, 'getCall' . md5($apiUrl), 60 * 60);\n }\n\n //Validate response, return\n if (isset($apiCallReturn['body']) && !empty($apiCallReturn['body']) && $decodedJson = json_decode($apiCallReturn['body'])) {\n\n if ($category) {\n $i=0;\n\n foreach($decodedJson as $element) {\n if($category !== $element->Buyer->Name){\n unset($decodedJson[$i]);\n }\n $i++;\n }\n }\n //error_log(print_r($decodedJson, true));\n wp_send_json(\n $this->cleanData(array_values($decodedJson)),\n 200\n );\n }\n\n //Not valid response above, send error\n return wp_send_json(\n array(\n 'state' => 'error',\n 'message' => __(\"A unknown error with the response occured.\", 'modularity-agreements-archive')\n )\n );\n }", "function get_campaign_budget($advertiser=0,$camp_id=0)\n {\n if($advertiser!=0)\n {\n $this->db->where('oxm_budget.clientid',$advertiser);\n }\n if($camp_id!=0)\n {\n $this->db->where('oxm_budget.campaignid',$camp_id);\n }\n\n $this->db->select('oxm_budget.dailybudget');\n\n $query = $this->db->get('oxm_budget');\n\n $result = $query->result();\n //echo $this->db->last_query();exit;\n\n if(count($result)>0)\n {\n return $result[0]->dailybudget;\n }\n else\n {\n return 0;\n }\n }", "public function getCampaignBackers($id) {\r\n if (! is_numeric($id) ) {\r\n return FALSE;\r\n }\r\n\r\n $this->method = 'GET';\r\n $module = '/campaign/' . $id . '/backers';\r\n $response = $this->sendToServer($module);\r\n \t\t//echo ('<br /> bli: ' . var_dump($response));\r\n\r\n return $response;\r\n }", "public function actionAllcampaigns()\n {\n $params = \\Yii::$app->request->getQueryParams();\n $defaultParams = array(\n 'status' => Campaign::STATUS_ACTIVE,\n 'offset' => 0,\n 'limit' => 0,\n 'sort' => '-id'\n );\n $user = $this->getUser();\n $params = array_merge($defaultParams, $params);\n /**\n * check params\n */\n // check status\n if (in_array($params['status'], array(Campaign::STATUS_ACTIVE, Campaign::STATUS_PENDING, Campaign::STATUS_DELETED)) == false) {\n $this->throwError(\"407\", \"status param is wrong\");\n }\n //check sort\n if (substr($params['sort'], 0, 1) == '-') {\n $params['sort'] = substr($params['sort'], 1);\n $orderAttr = 'DESC';\n } else {\n $orderAttr = 'ASC';\n }\n if (in_array($params['sort'], array('id', 'name', 'amountRaised', 'goalAmount')) == false) {\n $this->throwError(\"407\", \"sort prama is wrong\");\n }\n\n $sql = $user->getCampaigns($params['status'], false)->orderBy(sprintf('%s %s', $params['sort'], $orderAttr));\n if ($params['limit'] != 0) {\n $sql->offset($params['offset'])->limit($params['limit']);\n }\n $data = array();\n if ($sql->count() > 0) {\n foreach ($sql->all() as $capaign) {\n $data[] = array(\n 'id' => $capaign['id'],\n 'name' => $capaign['name'],\n 'description' => $capaign['description'],\n 'alias' => $capaign['alias'],\n 'amountRaised' => $capaign['amountRaised'],\n 'goalAmount' => $capaign['goalAmount'],\n 'type' => $capaign['type'],\n 'startDate' => $capaign['startDate'],\n 'endDate' => $capaign['endDate'],\n 'status' => $capaign['status'],\n 'numberOfDonations' => $capaign['numberOfDonations'],\n 'numberOfUniqueDonors' => $capaign['numberOfUniqueDonors'],\n 'date' => $capaign['date']\n );\n }\n }\n return $data;\n }", "public static function fetch_campaign($params)\n {\n list($campaign_id, $params) = self::unwrapParam($params, 'campaign_id');\n\n return self::make_request(self::$account_id . \"/campaigns/$campaign_id\", $params);\n }", "public function getCampaigns(Request $request){\n// $data = ['data' => $campaigns];\n $campaigns = Partner::arrangeUser()->with('campaign')->has('campaign')->orderBy('created_at', 'desc')->paginate(10);\n $campaigns->appends($request->all())->render();\n $status = collect(['status' => 200]);\n $result = $status->merge($campaigns);\n\n return response($result);\n }", "function getAllCampaign()\n\t{\t\t\n\t\t$params = array(\n\t\t\t\t\t'Target' => 'AdManager'\t,\t\t\t\t\n\t\t\t\t\t'Method' => 'findAllCampaigns'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t);\n\t\t$result = $this->makeRequest($params);\n\t\t$result = $this->object_to_array($result);\t\t\t\t \t\t\n\t\treturn $result;\t\n\t}", "function getBudgetForCampaigns($data){\n //if ($data['report_type']=='campaign'){\n $clickCost = 0;\n $impressionCost = 0;\n $totalBudget = 0;\n $budgetTtl = 0;\n $sql = \"SELECT campaign_id,budget FROM md_campaigns \";\n if(isset($data['reporting_campaign']) && $data['reporting_campaign'] > \"0\"){\n $sql .= \"WHERE campaign_id = {$data['reporting_campaign']}\";\n }\n $campaignBudgetArr = array();\n $reult = mysql_query($sql);\n while($budgetArr = mysql_fetch_array($reult)){\n $budgetTtl += $budgetArr[\"budget\"];\n //print_r($budgetArr);\n $campaignBudgetArr[$budgetArr[\"campaign_id\"]] = $budgetArr[\"budget\"];\n }\n // now we have campaings and their budget.\n \n $sql2 = \"SELECT * FROM md_campaign_view \";\n if($data['reporting_campaign'] > 0){\n $sql2 .= \"WHERE campaign_id = {$data['reporting_campaign']}\";\n }\n $result = mysql_query($sql2);\n \n $uniqueCamp = array();\n $countOfTotalClickOrImpression = 0;\n while($view = mysql_fetch_array($result)){\n $countOfTotalClickOrImpression++;\n if(!in_array($view[\"campaign_id\"], $uniqueCamp)){\n $totalBudget += $campaignBudgetArr[$view[\"campaign_id\"]];\n $uniqueCamp[] = $view[\"campaign_id\"];\n }\n //means its an impression\n if($view[\"is_impression\"] == 1){\n $impressionCost += ($view[\"debit\"]/1000);\n }else if($view[\"is_impression\"] == 2){\n //means its a click.\n $clickCost += $view[\"debit\"];\n }\n }\n // when there is no click or impression then on ad\n // total balance will be calculated like this.\n if($countOfTotalClickOrImpression==0){\n $totalBudget = $budgetTtl;\n }\n $remain = (float) $totalBudget-($impressionCost+$clickCost);\n return $remain;\n //}\n}", "function get_campaigns( $args = array() ) {\n\t\t$campaigns = false;\n\t\tif ( $response = $this->get_response( 'campaign', $args ) ) {\n\t\t\t$campaigns = array();\n if ( $response->result->total_results >= 200 ) {\n $limit = 200;\n } else {\n $limit = $response->result->total_results;\n\n }\n\n for( $i = 0; $i < $limit; $i++ ) {\n $campaign = (object)$response->result->campaign[$i];\n if ( isset($campaign->id) ) {\n $campaigns[(int)$campaign->id] = $this->SimpleXMLElement_to_stdClass( $campaign );\n }\n }\n\n if ( $limit >= 200 ) {\n\t $numpag = round($response->result->total_results/200)+1;\n\t for( $j = 2; $j <= ($numpag); $j++ ) {\n\t if ( $response = $this->get_response( 'campaign', $args, 'result', $j ) ) {\n\t for( $i = 0; $i < ($response->result->total_results-200); $i++ ) {\n\t $campaign = (object)$response->result->campaign[$i];\n\t if ( isset($campaign->id) ) {\n\t $campaigns[(int)$campaign->id] = $this->SimpleXMLElement_to_stdClass( $campaign );\n\t }\n\t }\n\t }\n\t }\n }\n\n\t\t}\n\t\treturn $campaigns;\n\t}", "function getData($date=false, $country=false, $getcountries=false){\n $curl = curl_init();\n if ($date && $country){\n $url = \"https://covid-193.p.rapidapi.com/history?day=$date&country=$country\";\n }\n else if ($getcountries){\n $url = \"https://covid-193.p.rapidapi.com/countries\";\n }\n else {\n $url = \"https://covid-193.p.rapidapi.com/statistics?\";\n }\n curl_setopt_array($curl, array(\n\tCURLOPT_URL => $url,\n\tCURLOPT_RETURNTRANSFER => true,\n\tCURLOPT_FOLLOWLOCATION => true,\n\tCURLOPT_ENCODING => \"\",\n\tCURLOPT_MAXREDIRS => 10,\n\tCURLOPT_TIMEOUT => 30,\n\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\tCURLOPT_HTTPHEADER => array(\n\t\t\"x-rapidapi-host: covid-193.p.rapidapi.com\",\n\t\t\"x-rapidapi-key: 0983bcff25msh9df47a985b40bb5p12da9ejsn71aa761e7f77\"\n\t),\n));\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n $result = false;\n if ($err) {\n return \"cURL Error #:\" . $err;\n } else {\n $response = json_decode($response, true);\n return $response['response'];\n }\n\n}", "public function fund_account_credits ()\r\n\t{\r\n\t\t$url = \"userdata/\".$this->accountId.\"/credits/fund\";\r\n\t\t$request = \"\";\r\n\t\t$return = $this->submit_api_request ($request, $url);\r\n\t\t$response = json_decode ($return, true);\r\n\t}", "public function getCampaigns( $account_id )\r\n {\r\n // get campaigns\r\n $campaigns = Campaign::where( 'account_id', $account_id )->get();\r\n if ( $campaigns->count() > 0 ) {\r\n return response()->json( $campaigns );\r\n } else {\r\n return response( 'Failed API: Campaigns Data Not Found', 500 );\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all SettingsShperndarjaPunimitTokes entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $settingsShperndarjaPunimitTokes = $em->getRepository('AiadBundle:SettingsShperndarjaPunimitTokes')->findAll(); return $this->render('settingsshperndarjapunimittokes/index.html.twig', array( 'settingsShperndarjaPunimitTokes' => $settingsShperndarjaPunimitTokes, )); }
[ "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsModeliPleherimits = $em->getRepository('AiadBundle:SettingsModeliPleherimit')->findAll();\n\n return $this->render('settingsmodelipleherimit/index.html.twig', array(\n 'settingsModeliPleherimits' => $settingsModeliPleherimits,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsUjitjes = $em->getRepository('AiadBundle:SettingsUjitje')->findAll();\n\n return $this->render('settingsujitje/index.html.twig', array(\n 'settingsUjitjes' => $settingsUjitjes,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CMSBundle:SiteSetting')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsKembePemes = $em->getRepository('AiadBundle:SettingsKembePeme')->findAll();\n\n return $this->render('settingskembepeme/index.html.twig', array(\n 'settingsKembePemes' => $settingsKembePemes,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsArsyeUjitjes = $em->getRepository('AiadBundle:SettingsArsyeUjitje')->findAll();\n\n return $this->render('settingsarsyeujitje/index.html.twig', array(\n 'settingsArsyeUjitjes' => $settingsArsyeUjitjes,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsVjeljaDestinacionis = $em->getRepository('AiadBundle:SettingsVjeljaDestinacioni')->findAll();\n\n return $this->render('settingsvjeljadestinacioni/index.html.twig', array(\n 'settingsVjeljaDestinacionis' => $settingsVjeljaDestinacionis,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsDistancas = $em->getRepository('AiadBundle:SettingsDistanca')->findAll();\n\n return $this->render('settingsdistanca/index.html.twig', array(\n 'settingsDistancas' => $settingsDistancas,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsGrackaObjektivis = $em->getRepository('AiadBundle:SettingsGrackaObjektivi')->findAll();\n\n return $this->render('settingsgrackaobjektivi/index.html.twig', array(\n 'settingsGrackaObjektivis' => $settingsGrackaObjektivis,\n ));\n }", "public function actionIndex()\n {\n $searchModel = new SettingsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('FabsteiMeteoritBundle:Strukturtyp')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function list_settings()\n {\n $return = array();\n if (!$this->is_loggedin) return $return;\n $return = array();\n $json = json_encode(array());\n $content = $this->exec_curl($this->baseurl . \"/api/s/\" . $this->site . \"/get/setting\", \"json=\" . $json);\n $content_decoded = json_decode($content);\n if (isset($content_decoded->meta->rc)) {\n if ($content_decoded->meta->rc == \"ok\") {\n if (is_array($content_decoded->data)) {\n foreach ($content_decoded->data as $setting) {\n $return[] = $setting;\n }\n }\n }\n }\n return $return;\n }", "public function actionIndex()\n {\n $searchModel = new HabitanteHasMascotaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getAllSettings()\n {\n return $this->settingsByLocale;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('casamunozempresaBundle:Sucursal')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function settings_list(){\n\n return $this->Settings;\n }", "public function actionIndex()\n {\n $searchModel = new PelajarSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$id_kelas = $searchModel->id_kelas > 0 ? $searchModel->id_kelas : '' ;\n\t\t\n\t\tif($id_kelas > 0 ){\n\t\t\t$dataProvider->query->andWhere(\"id IN (select id_pelajar from pelajar_kelas where id_kelas = '$id_kelas') \");\n\t\t}elseif(\\Yii::$app->user->can('Guru')){\n\t\t\t$sql = Yii::$app->getDb()->createCommand(\"SELECT ifnull(GROUP_CONCAT(id_kelas SEPARATOR ', '),0) kelas FROM `kelas_mp` WHERE id_sesi = (select id from sesi where tahun = YEAR(curdate())) AND id_guru = (select id from guru where id_guru = '\". Yii::$app->user->id .\"') and id_matapelajaran != '';\")->queryOne();\n\t\t\t$dataProvider->query->andWhere(\"id IN (select id_pelajar from pelajar_kelas where id_kelas IN (\".$sql['kelas'].\")) \");\n\t\t}\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsLendaAktives = $em->getRepository('AiadBundle:SettingsLendaAktive')->findAll();\n\n return $this->render('settingslendaaktive/index.html.twig', array(\n 'settingsLendaAktives' => $settingsLendaAktives,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('JariffMemberBundle:MemberSetting')->findOneByMember($this->getUser());\n\n $form = $this->createForm(new MemberSettingType(), $entity);\n\n return array(\n 'entities' => $entity,\n 'edit_form' => $form->createView()\n );\n }", "public function actionIndex()\n {\n $searchModel = new SuratMasukSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks that entered SSN is properly formated 000000000
function isSSN($str){ $SSN=trim($str); if(ereg("^[0-9]{3}-[0-9]{2}-[0-9]{4}$", $SSN)) //looks for formated SSN string return TRUE; //good SSN else return FALSE; //bad SSN }
[ "public function testSsn() {\n $this->assertTrue(Validate::ssn('666-10-1337'));\n $this->assertTrue(Validate::ssn('384-29-3481'));\n\n $this->assertFalse(Validate::ssn('66-10-1337'));\n $this->assertFalse(Validate::ssn('384-29-341'));\n $this->assertFalse(Validate::ssn('666.10.1337'));\n $this->assertFalse(Validate::ssn('AHE-29-34P1'));\n }", "function formatSSN($str){\n\t\t$SSN = $str;\n\t\n\t\t$SSN = eregi_replace(\"([ ])+\", \"\", $SSN); //deletes any white spaces\n\t\t$SSN = str_replace(\"-\", \"\", $SSN);\t\t //deletes any - from string\n\t\t\n\t\t//Checks that length is valid\n\t\tif(strlen($SSN) == 9){\n\t\t\n\t\t\t//Creates new SSN string\n\t\t\t$one = substr($SSN,0,3);\n\t\t\t$two = substr($SSN, -6, -4); \n\t\t\t$three = substr($SSN, 5, 9); \n\t\t\t\n\t\t\t$SSN = $one.\"-\".$two.\"-\".$three;\n\t\t\treturn $SSN;\n\t\t\t\n\t\t}//End if \n\t\telse {\n\t\t\treturn FALSE;\n\t\t}//End else\n\t\n\t}", "public function testSsn() {\n $this->assertEquals('998-29-3841', Format::ssn('998293841'));\n }", "function ssn($ssn, $expiryDate = null)\n {\n // remove any dashes, spaces, returns, tabs or slashes\n $ssn = str_replace(array('-','/',' ',\"\\t\"), '', trim($ssn));\n\n // Basic checking\n if (($len = strlen($ssn)) != 9\n || strspn($ssn, '0123456789') != $len\n || ($ssn{0} == '9' && $expiryDate <= time())\n || $ssn{0} == '0' || $ssn{0} == '3' || $ssn{0} == '8') {\n return false;\n }\n\n return Validate_CA::_luhn($ssn);\n }", "public function testSsn()\n {\n $this->assertTrue(NoValidation::personId('12345678901'));\n $this->assertTrue(NoValidation::personId('123456 78901'));\n $this->assertFalse(NoValidation::personId('1234567890'));\n $this->assertFalse(NoValidation::personId('123456 7890'));\n }", "function ssn($ssn)\n {\n return (ereg(\"^[0-9]{9}$\", $ssn));\n }", "public function testSsn() {\n\t\t$ssn = '998293841';\n\n\t\t// uses en locale\n\t\t$this->assertEquals('998-29-3841', Format::ssn($ssn));\n\n\t\t// now try with no locale, will use fallback\n\t\tTiton::g11n()->set('no');\n\t\t$this->assertEquals('998.29.3841', Format::ssn($ssn, '###.##.####'));\n\t}", "public function hasFakeSSN()\n {\n return substr($this->really_plain_ssn, 0, 3) == '999';\n }", "public static function validateBsn($bsn) {\n \t$bsn = trim(strip_tags($bsn));\n \t/*\n \t * if bsn is empty, return false\n \t*/\n \tif (empty($bsn)) {\n \t\treturn false;\n \t}\n \t/*\n \t * if bsn contains non-numeric digits, return false\n \t*/\n \tif (!is_numeric($bsn)) {\n \t\treturn false;\n \t}\n \t/*\n \t * if bsn has 8 digits, put '0' in front\n \t*/\n \tif (strlen($bsn) == 8) {\n \t\t$bsn = \"0\".$bsn;\n \t}\n \t/*\n \t * if length bsn is not 9 now, return false\n \t*/\n \tif (strlen($bsn) != 9) {\n \t\treturn false;\n \t}\n\n \t$digits = array(\"\");\n \t/*\n \t * put each digit in array\n \t*/\n \t$i = 0;\n \twhile ($i < 9) {\n \t\t$digits[$i] = substr($bsn,$i,1);\n \t\t$i++;\n \t}\n \t/*\n \t * compute total for 11 check\n \t*/\n \t$check = 0;\n \t$number1 = $digits[0] * 9;\n \t$number2 = $digits[1] * 8;\n \t$number3 = $digits[2] * 7;\n \t$number4 = $digits[3] * 6;\n \t$number5 = $digits[4] * 5;\n \t$number6 = $digits[5] * 4;\n \t$number7 = $digits[6] * 3;\n \t$number8 = $digits[7] * 2;\n \t$number9 = $digits[8] * -1;\n \t$check = $number1 + $number2 + $number3 + $number4 + $number5 + $number6 +\n \t$number7 + $number8 + $number9;\n \t/*\n \t * divide check by 11 and use remainder\n \t*/\n \t$remain = $check % 11;\n \tif ($remain == 0) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "function testIsValidInput_SSN_invalid_03()\n {\n $instance = ESAPI::getValidator();\n $this->assertFalse($instance->isValidInput('test', '(555) 555-5555', 'SSN', 100, false));\n }", "function ssn($ssn)\n {\n $str = strtolower(preg_replace('/[^0-9a-zA-Z]/','',$ssn));\n\n $regexp = \"/^([12])(\\d\\d)(\\d\\d)(\\d\\d|2a|2b)(\\d\\d\\d)(\\d\\d\\d)(\\d\\d)$/\";\n\n if (!preg_match($regexp,$str,$parts)) {\n return false;\n }\n\n // special case for Corsica and DOM not 100% sure, but cannot test from a db :)\n if ($parts[4] == '2a' || $parts[4] == '2b' || $parts[4] == '9a' ||\n $parts[4] == '9b' || $parts[4] == '9c' || $parts[4] == '9d') {\n if (strlen($str) == 15) {\n return true;\n } else {\n return false;\n }\n }\n\n if ($parts[2] < 1 || $parts[2] > 99) {\n return false;\n }\n if ($parts[3] < 1 || $parts[3] > 12) {\n return false;\n }\n if ($parts[4] < 1 || $parts[4] > 99) {\n return false;\n }\n\n // Person born outside France (region code==99), have to check insee country code\n // To do\n /*\n if($parts[4]==99){\n include 'FR_insee_country_codes.php';\n if ( !isset( $insee_country[$parts[5]] ) ){\n return false;\n }\n }\n */\n $num = $parts[1].$parts[2].$parts[3].$parts[4].$parts[5].$parts[6];\n $key = VALIDATE_FR_SSN_MODULUS - Validate::_modf($num,VALIDATE_FR_SSN_MODULUS);\n\n return ($key == $parts[7]) ? true : false;\n }", "function luhn_check($s) {\n\tsettype($s, 'string');\n\t$n = luhn_calc(substr($s, 0, -1));\n\tif ($n === false) return false;\n\treturn $n == substr($s, -1);\n}", "function validateSSN($ssn){\n $statePrefixes = $this->statePrefixes;\n $highgroup = $this->highgroup;\n $possibleGroups = $this->possibleGroups;\n\n // Split up the SSN\n // If not 9 or 11 long, then return false\n $length = strlen($ssn);\n if($length == 9){\n $areaNumber = substr($ssn,0,3);\n $groupNumber = substr($ssn,3,2);\n $lastFour = substr($ssn,5);\n }elseif($length == 11){\n $areaNumber = substr($ssn,0,3);\n $groupNumber = substr($ssn,4,2);\n $lastFour = substr($ssn,7);\n }else{\n return false;\n }\n\n // Strip leading zeros\n $areaNumber = ltrim($areaNumber, 0);\n $groupNumber = ltrim($groupNumber, 0);\n \n // Check if parts are numeric\n if(!is_numeric($areaNumber) || !is_numeric($groupNumber) || !is_numeric($lastFour)){\n return false;\n }\n \n foreach($statePrefixes as $state => $numbers){\n // Search for the area number in the state list\n if(in_array($areaNumber, $numbers)){\n // Make sure the group number is valid\n if(array_search($highgroup[$areaNumber],$possibleGroups) >= array_search($groupNumber,$possibleGroups)){\n return $state;\n }else{\n return false;\n }\n break;\n }\n }\n return false;\n }", "function format_ssn($ssn) {\n\t$ssn_clean = str_replace(\"-\", \"\", $ssn);\t\t\t\t\t// remove any hash marks\n\t$one = substr($ssn_clean, 0, 3);\t\t\t\t\t\t\t// get first 3 numbers\n\t$two = substr($ssn_clean, 3, 2);\t\t\t\t\t\t\t// get next 2 numbers\n\t$three = substr($ssn_clean, 5, 4);\t\t\t\t\t\t\t// get last 4 numbers\t\n\t\n\treturn base64_encode($one . \"-\" . $two . \"-\" . $three);\t\t// return encoded SSN number\n}", "public function testSsn()\n {\n // Testing CPF\n $this->assertFalse(BrValidation::cpf('22692173811'));\n $this->assertFalse(BrValidation::cpf('50549727322'));\n $this->assertFalse(BrValidation::cpf('869.283.422-11'));\n $this->assertFalse(BrValidation::cpf('843.701.734-22'));\n $this->assertFalse(BrValidation::cpf('999.999.999-99'));\n\n $this->assertTrue(BrValidation::cpf('22692173813'));\n $this->assertTrue(BrValidation::cpf('50549727302'));\n $this->assertTrue(BrValidation::cpf('869.283.422-00'));\n $this->assertTrue(BrValidation::cpf('843.701.734-34'));\n\n // Testing CNPJ\n $this->assertFalse(BrValidation::cnpj('04295165000133'));\n $this->assertFalse(BrValidation::cnpj('33530485000129'));\n $this->assertFalse(BrValidation::cnpj('04295166000101'));\n $this->assertFalse(BrValidation::cnpj('33530486000130'));\n $this->assertFalse(BrValidation::cnpj('04.295.165/0001-33'));\n $this->assertFalse(BrValidation::cnpj('33.530.485/0001-29'));\n $this->assertFalse(BrValidation::cnpj('04.295.166/0001-01'));\n $this->assertFalse(BrValidation::cnpj('33.530.486/0001-30'));\n $this->assertFalse(BrValidation::cnpj('33.530.48.6/0001-30'));\n $this->assertFalse(BrValidation::cnpj('\t33.530.48.6/0001-30 '));\n $this->assertFalse(BrValidation::cnpj('33.530.48.6/000-130'));\n\n $this->assertTrue(BrValidation::cnpj('04295166000133'));\n $this->assertTrue(BrValidation::cnpj('33530486000129'));\n $this->assertTrue(BrValidation::personId('04.295.166/0001-33'));\n $this->assertTrue(BrValidation::personId('33.530.486/0001-29'));\n\n // Testing ssn\n $this->assertFalse(BrValidation::personId('04295165000133'));\n $this->assertFalse(BrValidation::personId('33530485000129'));\n $this->assertFalse(BrValidation::personId('04295166000101'));\n $this->assertFalse(BrValidation::personId('33530486000130'));\n $this->assertFalse(BrValidation::personId('04.295.165/0001-33'));\n $this->assertFalse(BrValidation::personId('33.530.485/0001-29'));\n $this->assertFalse(BrValidation::personId('04.295.166/0001-01'));\n $this->assertFalse(BrValidation::personId('33.530.486/0001-30'));\n $this->assertTrue(BrValidation::personId('04295166000133'));\n $this->assertTrue(BrValidation::personId('33530486000129'));\n $this->assertTrue(BrValidation::personId('04.295.166/0001-33'));\n $this->assertTrue(BrValidation::personId('33.530.486/0001-29'));\n\n // Testing invalid input\n $this->assertFalse(BrValidation::personId('3712093712890371289073901287390812'));\n $this->assertFalse(BrValidation::personId('33aaaa86000129'));\n $this->assertFalse(BrValidation::personId('22692173813xxx'));\n $this->assertFalse(BrValidation::personId('226921xxx73813'));\n $this->assertFalse(BrValidation::personId('11111111111'));\n $this->assertFalse(BrValidation::cpf('abcdefghi'));\n\n //testing 15 digits\n $this->assertFalse(BrValidation::cnpj('123456789123456'));\n $this->assertFalse(BrValidation::cnpj('062476224000121'));\n $this->assertFalse(BrValidation::cnpj('062476224000121'));\n $this->assertFalse(BrValidation::cnpj('062.476.224/0001-21'));\n $this->assertTrue(BrValidation::cnpj('62.476.224/0001-21'));\n $this->assertTrue(BrValidation::cnpj('62476224000121'));\n $this->assertTrue(BrValidation::cnpj('62476224000121'));\n }", "function validate_pin(string $pin): bool\n{\n return !!(in_array(strlen($pin), [4, 6]) && preg_match('/^[\\d]+$/', $pin));\n}", "function isValidStreet($value) {\n\t$value = trim($value);\n\t// #REQ019\n\tif (strlen($value) < 5) {\n\t\treturn 0;\n\t}\n\t// At least two parts, #REQ050\n\tif (strpos($value, \" \") <= 0) {\n\t\treturn 0;\n\t}\n\t$parts = explode(\" \", $value);\n\t$foundnumber = 0;\n\n\tfor ($c = 0; $c < count($parts); $c++) {\n\t\t$number = preg_replace(\"/[^0-9]/\", '', $parts[$c]);\n\t\tif (strlen($number) > 0) {\n\t\t\t$foundnumber = 1;\n\t\t}\n\t}\n\t// #REQ050\n\tif (!$foundnumber) {\n\t\t// not a digit house number\n\t\treturn 0;\n\t}\n\treturn 1;\n}", "function smart_is_lsuid2($s) {\n return preg_match('/^89\\d{7}$/', $s);\n}", "function testAssertValidInput_SSN_valid_02()\n {\n \t$this->markTestIncomplete(); \n $instance = ESAPI::getValidator();\n try {\n $instance->assertValidInput('test', '078 05 1120', 'SSN', 100, false);\n } catch (Exception $e) {\n $this->fail();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the method to refresh.
public function setRefreshMethod() { return $this->setCalendar('method', Calendar::METHOD_REFRESH); }
[ "public function request_refresh();", "public function refresh( $abstract, $target, $method );", "public function setMethod( $method );", "public function refresh()\n\t{\n\t\t//use retrieve to implement it.\n\t\t\t\n\t}", "public function reload() {\n\t\t$this->invoke(\"reload\");\n\t}", "public function setMethod()\n {\n $this->method = strtolower($this->method) . \"Method\";\n\n if (!method_exists($this->controller, $this->method)) {\n $this->method = self::DEFAULT_METHOD;\n }\n }", "abstract protected function setMethod();", "public function setMethod()\n {\n if (isset($this->url[1])) {\n if (method_exists($this->controller, $this->url[1])) {\n $this->method = $this->url[1];\n }\n unset($this->url[1]);\n }\n }", "public function setMethodToGet()\n {\n $this->method = 'get';\n }", "public function setMethod($method=\"GET\") {\n \t$this->method = $method;\n }", "public function setRefreshFlow($refreshFlow = true);", "public function setPatchMethod()\n {\n $this->method = self::METHOD_PATCH;\n }", "public function setGetMethod()\n {\n $this->method = self::METHOD_GET;\n }", "function setMethod($method)\n {\n if($method != 'get' and\n\t $method != 'put')\n\t{\n\t exit(\"FormBase::setMethod error: \" . \"unknown method $method, must be put or get\");\n\t}\n $this->method = $method;\n }", "public function refresh() {\r\n\t\tif ($this->id)\r\n\t\t\t$this->load($this->id);\r\n\t}", "private function refreshShippingMethods()\n {\n $shipping_cart = Cart::instance('shipping');\n $shipping_items = $shipping_cart->content();\n\n if (auth()->check() && $shipping_cart->content()->count()) {\n $shipping_method_id = current(current($shipping_items))->id;\n\n $this->setShippingMethod($shipping_method_id);\n }\n }", "public function setMethodGet()\n\t{\n\t\t$this->_method = 'GET';\n\t}", "public function setMethod($name)\n {\n $this->method = $name;\n }", "public function reload() {\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create ACF fields for press posts
public function create_press_acf_fields() { if( function_exists('acf_add_local_field_group') ): acf_add_local_field_group(array ( 'key' => 'press', 'title' => 'Press', 'fields' => array ( array ( 'key' => 'source', 'label' => 'Source', 'name' => 'source', 'type' => 'text' ), array ( 'key' => 'link', 'label' => 'Link', 'name' => 'link', 'type' => 'url' ) ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'press', ), ), ), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label' )); endif; }
[ "function today_add_post_custom_fields() {\n\tif ( function_exists( 'acf_add_local_field_group' ) ) {\n\n\t\t// Create the array to add the fields to\n\t\t$fields = array();\n\n\t\t// Adds Header Content tab\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813914b0cd8',\n\t\t\t'label' => 'Header Content',\n\t\t\t'type' => 'tab',\n\t\t);\n\n\t\t// Adds Original Publish Date read only field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813a34c81af',\n\t\t\t'label' => 'Original Publish Date',\n\t\t\t'name' => 'post_header_publish_date',\n\t\t\t'type' => 'read_only',\n\t\t\t'instructions' => 'The date the post was originally published. Changing the <a href=\"#submitdiv\">\\'Published on\\' date</a> above will update the dates listed in the story’s header and bump this story to the top of lists where it\\'s referenced.',\n\t\t\t'display_type' => 'text',\n\t\t);\n\n\t\t// Adds Deck field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813eaac81b1',\n\t\t\t'label' => 'Deck',\n\t\t\t'name' => 'post_header_deck',\n\t\t\t'type' => 'wysiwyg',\n\t\t\t'instructions' => 'Appears below the title on a single post.\tIs also used as excerpt text within lists of posts.',\n\t\t\t'toolbar' => 'inline_text',\n\t\t\t'media_upload' => 0,\n\t\t);\n\n\t\t// Adds Header Media tab\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c81401dc81ba',\n\t\t\t'label' => 'Header Media',\n\t\t\t'type' => 'tab',\n\t\t);\n\n\t\t// Adds Header Media Type field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813fb7c81b9',\n\t\t\t'label' => 'Header Media Type',\n\t\t\t'name' => 'header_media_type',\n\t\t\t'type' => 'radio',\n\t\t\t'instructions' => 'Select the type of header for this story.',\n\t\t\t'choices' => array(\n\t\t\t\t'image' => 'Image',\n\t\t\t\t'video' => 'Video',\n\t\t\t),\n\t\t\t'default_value' => 'image',\n\t\t);\n\n\t\t// Adds Header Video field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c814048c81bb',\n\t\t\t'label' => 'Header Video',\n\t\t\t'name' => 'post_header_video_url',\n\t\t\t'type' => 'oembed',\n\t\t\t'instructions' => 'Paste in a video URL from YouTube, Vimeo, etc. to display in place of a header image.',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field' => 'field_5c813fb7c81b9',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'video',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Adds Header/Thumbnail Image field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813f8ac81b8',\n\t\t\t'label' => 'Header/Thumbnail Image',\n\t\t\t'name' => 'post_header_image',\n\t\t\t'type' => 'image',\n\t\t\t'instructions' => 'Select or upload an image with dimensions of 1200x800 for this story. The image file size must be less than 800KB.<br><br>When the \"Header Media Type\" value is set to \"Image\", this image will be used as the header image on the story, as well as the thumbnail image when this story is displayed in lists of stories.<br><br>When the \"Header Media Type\" value is set to \"Video\", if an image is provided, the image will be used as the thumbnail when this story is displayed in lists of stories.\tIf no image is provided, WordPress will attempt to fetch and use a poster image dynamically based on the \"Header Video\" URL provided.',\n\t\t\t'max_width' => 1200,\n\t\t\t'max_height' => 800,\n\t\t\t'mime_types' => 'jpg, jpeg',\n\t\t);\n\n\t\t// Adds Author tab\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813f04c81b3',\n\t\t\t'label' => 'Author',\n\t\t\t'type' => 'tab',\n\t\t);\n\n\t\t// Adds Author Type field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_60351738e9e93',\n\t\t\t'label' => 'Author Type',\n\t\t\t'name' => 'post_author_type',\n\t\t\t'type' => 'select',\n\t\t\t'instructions' => 'Choose whether to reference an existing Author\\'s information, or define one-off custom information for this post.',\n\t\t\t'choices' => array(\n\t\t\t\t'custom' => 'Custom',\n\t\t\t\t'term' => 'Existing Author',\n\t\t\t),\n\t\t\t'default_value' => false,\n\t\t);\n\n\t\t// Adds Author Byline field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813f0fc81b4',\n\t\t\t'label' => 'Author Byline',\n\t\t\t'name' => 'post_author_byline',\n\t\t\t'type' => 'text',\n\t\t\t'instructions' => 'Appears in place of post author\\'s name.',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field' => 'field_60351738e9e93',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Adds Author Title field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813ebec81b2',\n\t\t\t'label' => 'Author Title',\n\t\t\t'name' => 'post_author_title',\n\t\t\t'type' => 'text',\n\t\t\t'instructions' => 'Appears under the author\\'s name/byline below the story\\'s content, <b>only if the Author Bio is set</b>.',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field' => 'field_60351738e9e93',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Adds Author Photo field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_602fef6061511',\n\t\t\t'label' => 'Author Photo',\n\t\t\t'name' => 'post_author_photo',\n\t\t\t'type' => 'image',\n\t\t\t'instructions' => 'Appears below the story\\'s content.',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field' => 'field_60351738e9e93',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => '35',\n\t\t\t),\n\t\t);\n\n\t\t// Adds Author Bio field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813f22c81b5',\n\t\t\t'label' => 'Author Bio',\n\t\t\t'name' => 'post_author_bio',\n\t\t\t'type' => 'wysiwyg',\n\t\t\t'instructions' => 'Appears below the story\\'s content.<br><br>This field must be set in order to display any author information (Author Name, Title, Bio, Photo) below the story\\'s content.',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field' => 'field_60351738e9e93',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => '65',\n\t\t\t),\n\t\t\t'tabs' => 'text',\n\t\t\t'media_upload' => 0,\n\t\t);\n\n\t\t// Adds Existing Author field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_6035185de9e94',\n\t\t\t'label' => 'Existing Author',\n\t\t\t'name' => 'post_author_term',\n\t\t\t'type' => 'taxonomy',\n\t\t\t'instructions' => 'Choose an existing Author to assign to this post.\tName, title, photo and bio information will be referenced from the Author that\\'s selected.',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field' => 'field_60351738e9e93',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'term',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'taxonomy' => 'tu_author',\n\t\t\t'field_type' => 'select',\n\t\t\t'save_terms' => 1,\n\t\t\t'load_terms' => 1,\n\t\t);\n\n\t\t// Adds Primary Tag tab\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c814082c81bc',\n\t\t\t'label' => 'Primary Tag',\n\t\t\t'type' => 'tab',\n\t\t);\n\n\t\t// Adds Primary Tag field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c8140a1c81bd',\n\t\t\t'label' => 'Primary Tag',\n\t\t\t'name' => 'post_primary_tag',\n\t\t\t'type' => 'taxonomy',\n\t\t\t'instructions' => 'Select the primary tag that will be used to populate the Related Stories section.',\n\t\t\t'taxonomy' => 'post_tag',\n\t\t\t'field_type' => 'select',\n\t\t\t'add_term' => 0,\n\t\t\t'allow_null' => 1,\n\t\t\t'return_format' => 'object',\n\t\t);\n\n\t\t// Adds Source tab\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c8140dec81be',\n\t\t\t'label' => 'Source',\n\t\t\t'type' => 'tab',\n\t\t);\n\n\t\t// Adds Source field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c8140e7c81bf',\n\t\t\t'label' => 'Source',\n\t\t\t'name' => 'post_source',\n\t\t\t'type' => 'textarea',\n\t\t\t'instructions' => 'Appears below the story content (and below the Author Bio if set).',\n\t\t);\n\n\t\t// Adds Tag Cloud tab\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c98fd5aeb16b',\n\t\t\t'label' => 'Tag Cloud',\n\t\t\t'type' => 'tab',\n\t\t);\n\n\t\t// Adds Display Tag Cloud field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c98fd68eb16c',\n\t\t\t'label' => 'Display Tag Cloud',\n\t\t\t'name' => 'post_display_tag_cloud',\n\t\t\t'type' => 'true_false',\n\t\t\t'instructions' => 'Display a tag cloud under the post\\'s content or source. Defaults to true.',\n\t\t\t'default_value' => 1,\n\t\t\t'ui' => 1,\n\t\t);\n\n\t\t// Adds Tag Cloud Count field\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c98fdc5eb16d',\n\t\t\t'label' => 'Tag Cloud Count',\n\t\t\t'name' => 'post_tag_cloud_count',\n\t\t\t'type' => 'number',\n\t\t\t'instructions' => 'The number of tags to show in the tag cloud. Defaults to 5.',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field' => 'field_5c98fd68eb16c',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => '1',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'default_value' => 5,\n\t\t\t'min' => 1,\n\t\t\t'step' => 1,\n\t\t);\n\n\t\t// Defines Post Custom Fields field group\n\t\t$field_group = array(\n\t\t\t'key' => 'group_5c813326f2f21',\n\t\t\t'title' => 'Post Custom Fields',\n\t\t\t'fields' => $fields,\n\t\t\t'location' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'param' => 'post_type',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'post',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tacf_add_local_field_group( $field_group );\n\t}\n}", "function register_post_field($args) {\r\n\t\t$this->postmeta[ $args['post_type'] ][ $args['section'] ][ $args['id'] ] = $args;\r\n\t}", "function wp_preview_post_fields($fields)\n {\n }", "function pilau_register_custom_fields() {\n\tif ( class_exists( 'Codepress_Admin_Columns' ) )\n\t\tadd_filter( 'cpac_use_hidden_custom_fields', '__return_true' );\n\n\t/*\n\tslt_cf_register_box( array(\n\t\t'type'\t\t=> 'post',\n\t\t'title'\t\t=> 'Sample custom field',\n\t\t'id'\t\t=> 'sample',\n\t\t'context'\t=> 'advanced',\n\t\t'fields'\t=> array(\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t=> 'sample',\n\t\t\t\t'label'\t\t\t=> 'Sample',\n\t\t\t\t'description'\t=> 'Some hints for the user.',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t\t'scope'\t\t\t=>\tarray( 'post', 'page' ),\n\t\t\t\t'capabilities'\t=> array( 'edit_posts', 'edit_pages' )\n\t\t\t)\n\t\t)\n\t));\n\t*/\n\n}", "private function generate_conditional_fields_posts () {\n\t\tglobal $wooslider;\n\n\t\t$images_url = $wooslider->plugin_url . '/assets/images/';\n\t\t$fields = array();\n\n\t\t// Categories.\n\t\t$terms = get_categories();\n\t\t$terms_options = array();\n\t\tif ( ! is_wp_error( $terms ) ) {\n\t\t\tforeach ( $terms as $k => $v ) {\n\t\t\t\t$terms_options[$v->slug] = $v->name;\n\t\t\t}\n\t\t}\n\n\t\t$categories_args = array( 'key' => 'category', 'data' => array( 'options' => $terms_options ) );\n\n\t\t// Tags.\n\t\t$terms = get_tags();\n\t\t$terms_options = array();\n\t\tif ( ! is_wp_error( $terms ) ) {\n\t\t\tforeach ( $terms as $k => $v ) {\n\t\t\t\t$terms_options[$v->slug] = $v->name;\n\t\t\t}\n\t\t}\n\n\t\t$tags_args = array( 'key' => 'tag', 'data' => array( 'options' => $terms_options ) );\n\n\t\t$layout_types = WooSlider_Utils::get_posts_layout_types();\n\t\t$layout_options = array();\n\n\t\tforeach ( (array)$layout_types as $k => $v ) {\n\t\t\t$layout_options[$k] = $v['name'];\n\t\t}\n\n\t\t$layout_images = array(\n\t\t\t\t\t\t\t\t'text-left' => esc_url( $images_url . 'text-left.png' ), \n\t\t\t\t\t\t\t\t'text-right' => esc_url( $images_url . 'text-right.png' ), \n\t\t\t\t\t\t\t\t'text-top' => esc_url( $images_url . 'text-top.png' ), \n\t\t\t\t\t\t\t\t'text-bottom' => esc_url( $images_url . 'text-bottom.png' )\n\t\t\t\t\t\t\t);\n\t\t$layouts_args = array( 'key' => 'layout', 'data' => array( 'options' => $layout_options, 'images' => $layout_images ) );\n\n\t\t$overlay_images = array(\n\t\t\t\t\t\t\t\t'none' => esc_url( $images_url . 'default.png' ), \n\t\t\t\t\t\t\t\t'full' => esc_url( $images_url . 'text-bottom.png' ), \n\t\t\t\t\t\t\t\t'natural' => esc_url( $images_url . 'overlay-natural.png' )\n\t\t\t\t\t\t\t);\n\n\t\t$overlay_options = array( 'none' => __( 'None', 'wooslider' ), 'full' => __( 'Full', 'wooslider' ), 'natural' => __( 'Natural', 'wooslider' ) );\n\n\t\t$overlay_args = array( 'key' => 'overlay', 'data' => array( 'options' => $overlay_options, 'images' => $overlay_images ) );\n\n\t\t$limit_options = array();\n\t\tfor ( $i = 1; $i <= 20; $i++ ) {\n\t\t\t$limit_options[$i] = $i;\n\t\t}\n\t\t$limit_args = array( 'key' => 'limit', 'data' => array( 'options' => $limit_options, 'default' => 5 ) );\n\t\t$thumbnails_args = array( 'key' => 'thumbnails', 'data' => array() );\n\t\t$link_title_args = array( 'key' => 'link_title', 'data' => array() );\n\t\t$display_excerpt_args = array( 'key' => 'display_excerpt', 'data' => array('default' => '1') );\n\n\t\t// Create final array.\n\t\t$fields['limit'] = array( 'name' => __( 'Number of Posts', 'wooslider' ), 'type' => 'select', 'args' => $limit_args, 'description' => __( 'The maximum number of posts to display', 'wooslider' ) );\n\t\t$fields['thumbnails'] = array( 'name' => __( 'Use thumbnails for Pagination', 'wooslider' ), 'type' => 'checkbox', 'args' => $thumbnails_args, 'description' => __( 'Use thumbnails for pagination, instead of \"dot\" indicators (uses featured image)', 'wooslider' ) );\n\t\t$fields['link_title'] = array( 'name' => __( 'Link the post title to it\\'s post', 'wooslider' ), 'type' => 'checkbox', 'args' => $link_title_args, 'description' => __( 'Link the post title to it\\'s single post screen', 'wooslider' ) );\n\t\t$fields['display_excerpt'] = array( 'name' => __( 'Display the post\\'s excerpt', 'wooslider' ), 'type' => 'checkbox', 'args' => $display_excerpt_args, 'description' => __( 'Display the post\\'s excerpt on each slide', 'wooslider' ) );\n\t\t$fields['layout'] = array( 'name' => __( 'Layout', 'wooslider' ), 'type' => 'images', 'args' => $layouts_args, 'description' => __( 'The layout to use when displaying posts', 'wooslider' ) );\n\t\t$fields['overlay'] = array( 'name' => __( 'Overlay', 'wooslider' ), 'type' => 'images', 'args' => $overlay_args, 'description' => __( 'The type of overlay to use when displaying the post text', 'wooslider' ) );\n\t\t$fields['category'] = array( 'name' => __( 'Categories', 'wooslider' ), 'type' => 'multicheck', 'args' => $categories_args, 'description' => __( 'The categories from which to display posts', 'wooslider' ) );\n\t\t$fields['tag'] = array( 'name' => __( 'Tags', 'wooslider' ), 'type' => 'multicheck', 'args' => $tags_args, 'description' => __( 'The tags from which to display posts', 'wooslider' ) );\n\n\t\treturn $fields;\n\t}", "function tevolution_details_field_collection()\r\n{\r\n\tglobal $wpdb,$post,$single_htmlvar_name;\r\n\tif(is_single()){\r\n\t\r\n\t\t$cus_post_type = get_post_type();\r\n\t\t$args = \r\n\t\tarray( 'post_type' => 'custom_fields',\r\n\t\t'posts_per_page' => -1\t,\r\n\t\t'post_status' => array('publish'),\r\n\t\t'meta_query' => array(\r\n\t\t 'relation' => 'AND',\r\n\t\t\tarray(\r\n\t\t\t\t'key' => 'post_type_'.$cus_post_type.'',\r\n\t\t\t\t'value' => $cus_post_type,\r\n\t\t\t\t'compare' => '=',\r\n\t\t\t\t'type'=> 'text'\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t'key' => 'show_on_page',\r\n\t\t\t\t'value' => array('user_side','both_side'),\r\n\t\t\t\t'compare' => 'IN'\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t'key' => 'is_active',\r\n\t\t\t\t'value' => '1',\r\n\t\t\t\t'compare' => '='\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t'key' => 'show_on_detail',\r\n\t\t\t\t'value' => '1',\r\n\t\t\t\t'compare' => '='\r\n\t\t\t)\r\n\t\t),\r\n\t\t\t'meta_key' => 'sort_order',\r\n\t\t\t'orderby' => 'meta_value_num',\r\n\t\t\t'meta_value_num'=>'sort_order',\r\n\t\t\t'order' => 'ASC'\r\n\t\t);\r\n\t\tremove_all_actions('posts_where');\r\n\t\t$post_meta_info = null;\r\n\t\tadd_filter('posts_join', 'custom_field_posts_where_filter');\r\n\t\t$post_meta_info = new WP_Query($args);\r\n\t\tremove_filter('posts_join', 'custom_field_posts_where_filter');\r\n\t\t\t\t\r\n\t\t$single_htmlvar_name='';\r\n\t\tif($post_meta_info->have_posts())\r\n\t\t{\r\n\t\t\twhile ($post_meta_info->have_posts()) : $post_meta_info->the_post();\r\n\t\t\t\t$ctype = get_post_meta($post->ID,'ctype',true);\r\n\t\t\t\t$post_name = get_post_meta($post->ID,'htmlvar_name',true);\r\n\t\t\t\t$single_htmlvar_name[$post_name] = $ctype;\r\n\t\t\t\t$single_pos_title[] = $post->post_title;\r\n\t\t\tendwhile;\r\n\t\t\twp_reset_query();\r\n\t\t}\r\n\t}\t\r\n}", "function get_posts_with_fields( array $args = [] )\n{\n\n // Get Posts\n if ( !$the_posts = get_posts($args) )\n return false;\n\n // Add fields\n foreach ( $the_posts as $key => $p ) {\n $p = get_full_post($p->ID);\n $p->fields = get_fields($p->ID);\n\n $the_posts[$key] = $p;\n }\n\n // Done!\n return $the_posts;\n}", "function acf_preview_value($value, $post_id, $field)\n{\n}", "function add_custom_field($args) {\n register_rest_field( array(\"post\", \"page\"), 'wpnext', \n array(\n 'get_callback' => array( &$this, 'custom_field_get' ),\n 'update_callback' => array( &$this, 'custom_field_update' ),\n 'schema' => array(\n 'description' => \"Components and listed values.\",\n 'type' => 'object',\n 'context' => array('view', 'edit')\n )\n )\n );\n }", "function createCustomFields() {\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'jvfrm-post-custom-fields', 'Additional information', array( &$this, 'displayCustomFields' ), $postType, 'normal', 'high' );\n }\n }\n }", "function serialize_custom_acf_content($post_data){\n // check to make sure we have ACF installed\n if (!function_exists('get_fields')){\n return $post_data;\n }\n // get ACF fields attached to target post\n $acf_fields = get_fields($post_data['id']);\n\n // prep to save serialized fields\n $post_data['acf'] = array();\n if( !empty($acf_fields) ){\n // serialize ACF fields\n foreach( $acf_fields as $name => $value ){\n $post_data['acf'][$name] = $value;\n }\n }\n return $post_data;\n }", "function acf_prepare_field( $field ) {\n}", "private function add_fields_main() {\n\n add_settings_field(\n $this->get_field_id(PTB_Custom_Post_Type::SINGULAR_LABEL), __('Singular Label', 'ptb'), array($this, 'post_type_singular_label_cb'), $this->slug_admin_cpt, $this->settings_section_cpt, array('label_for' => $this->get_field_id(PTB_Custom_Post_Type::SINGULAR_LABEL))\n );\n\n add_settings_field(\n $this->get_field_id(PTB_Custom_Post_Type::PLURAL_LABEL), __('Plural Label', 'ptb'), array($this, 'post_type_plural_label_cb'), $this->slug_admin_cpt, $this->settings_section_cpt, array('label_for' => $this->get_field_id(PTB_Custom_Post_Type::PLURAL_LABEL))\n );\n\n add_settings_field(\n $this->get_field_id(PTB_Custom_Post_Type::SLUG), __('Post Type Slug', 'ptb'), array($this, 'post_type_slug_cb'), $this->slug_admin_cpt, $this->settings_section_cpt, array('label_for' => $this->get_field_id(PTB_Custom_Post_Type::SLUG))\n );\n \n add_settings_field(\n $this->get_field_id(PTB_Custom_Post_Type::DESCRIPTION), __('Description', 'ptb'), array($this, 'post_type_description_cb'), $this->slug_admin_cpt, $this->settings_section_cpt, array('label_for' => $this->get_field_id(PTB_Custom_Post_Type::DESCRIPTION))\n );\n\n add_settings_field(\n $this->get_field_id(PTB_Custom_Post_Type::METABOX_SECTION_NAME), __('Metabox Section Name', 'ptb'), array($this, 'post_type_metabox_section_cb'), $this->slug_admin_cpt, $this->settings_section_cpt, array('label_for' => $this->get_field_id(PTB_Custom_Post_Type::METABOX_SECTION_NAME))\n );\n\n add_settings_field(\n $this->get_field_id(PTB_Custom_Post_Type::SUPPORTS), __('Enable', 'ptb'), array($this, 'post_type_supports_cb'), $this->slug_admin_cpt, $this->settings_section_cpt, array('label_for' => $this->get_field_id(PTB_Custom_Post_Type::SUPPORTS))\n );\n\n add_settings_field(\n $this->get_field_id(PTB_Custom_Post_Type::TAXONOMIES), __('Taxonomies', 'ptb'), array($this, 'post_type_tax_cb'), $this->slug_admin_cpt, $this->settings_section_cpt, array('label_for' => $this->get_field_id(PTB_Custom_Post_Type::TAXONOMIES))\n );\n }", "function acf_prepare_field($field)\n{\n}", "private function aic_custom_settings_fields($field_args, $settings)\n {\n $output = '\n <div class=\"aic_fields_wrapper\">\n <div class=\"aic_ad_list\">';\n if (isset($settings['aic_ad_title'])) {\n foreach ($settings['aic_ad_title'] as $key => $value) {\n $output .= '\n <div class=\"aic_field\">\n <div class=\"aic_field_title\"><h3>' . $value . '</h3></div>\n <div class=\"aic_field_body\">\n <div class=\"aic_field_body_title\">\n <span>' . __('Ad Title', 'ads-in-content') . '</span>\n <input type=\"text\" name=\"' . $this->option_name . '[aic_ad_title][' . $key . ']\" value=\"' . $value . '\" required>\n </div>\n <div class=\"aic_field_body_code\">\n <span>' . __('Ad Code', 'ads-in-content') . '</span>\n <textarea id=\"\" name=\"' . $this->option_name . '[aic_ad_code][' . $key . ']\" rows=\"10\" required>' . $settings['aic_ad_code'][$key] . '</textarea>\n </div>\n <a href=\"javascript:void(0)\" class=\"button delete_ad\">' . __('Delete', 'ads-in-content') . '</a>\n </div>\n </div>\n ';\n }\n }\n\n $output .= '\n </div> \n <script id=\"aic_field_template\" type=\"text/template\">\n <div class=\"aic_field\">\n <div class=\"aic_field_title\"><h3>' . __('New Ad', 'ads-in-content') . '</h3></div>\n <div class=\"aic_field_body\">\n <div class=\"aic_field_body_title\">\n <span>' . __('Ad Title', 'ads-in-content') . '</span>\n <input type=\"text\" name=\"' . $this->option_name . '[aic_ad_title][%id%]\" required>\n </div>\n <div class=\"aic_field_body_code\">\n <span>' . __('Ad Code', 'ads-in-content') . '</span>\n <textarea id=\"\" name=\"' . $this->option_name . '[aic_ad_code][%id%]\" rows=\"10\" required></textarea>\n </div>\n </div>\n </div>\n </script>\n \n <a href=\"javascript:void(0)\" class=\"aic_new_add\">' . __('Add New Ad', 'ads-in-content') . '</a>\n </div>\n ';\n\n return $output;\n }", "function get_slider_custom_fields() {\n \n $slider_custom_fields = array(\n \"feature_link\" => array(\n \"name\" => 'slider_link',\n \"std\" => '',\n \"title\" => __('Post or page to link the feature slider item to:', 'language_domain')\n ),\n \"image\" => array(\n \"name\" => 'slider_image',\n \"std\" => '',\n \"title\" => __('Link to feature image:', 'language_domain');\n ),\n ); \n \n return $slider_custom_fields;\n}", "private function post_fields( $post ) { ?>\n\n\t\t<strong class=\"title\"><?php echo $post->post_title ?></strong>\n\n\t\t<?php foreach ( $this->custom_fields as $field ) :\n\n\t\t\t$value = get_post_meta( $post->ID, $field, true );\n\n\t\t\tif ( is_array( $value ) || is_object( $value ) ) continue; ?>\n\n\t\t\t<label for=\"<?php echo $field; ?>\">\n\t\t\t\t<strong><?php echo str_replace( '_', ' ', $field ); ?>:</strong>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $field; ?>\" value=\"<?php echo $value; ?>\">\n\t\t\t</label>\n\n\t\t<?php endforeach;\n\n\t}", "function json_single_custom_fields($_post)\n\t{\t\t\n\t\t//ADD CUSTOM FIELDS\n\t\t\n\t\t//featured image url\n\t\t$image_url = null;\n\t\tif (has_post_thumbnail( $_post['ID'] ) )\n\t\t{\n\t\t\t$image = wp_get_attachment_image_src( get_post_thumbnail_id( $_post['ID'] ), 'single-post-thumbnail' );\n\t\t\t$image_url = $image[0];\n\t\t}\n\t\t\n\t\t//area code\n\t\t$area = get_post_meta($_post['ID'], 'wpcf-area', true);\n\t\t//if area isn't overridden, get it from user meta.\n\t\tif ($area == '0')\n\t\t{\n\t\t\t$area = get_user_meta($_post['author']['ID'], 'wpcf-user-area', true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$area = $area.'*';\n\t\t}\n\t\t\n\t\t//create the array for the fields\n\t\t$custom_fields = array();\n\t\t//add the fields to the array\n\t\t$custom_fields['featured_image_url'] = $image_url;\n\t\t$custom_fields['area'] = $area;\n\t\t\n\t\t//add the new fields to the end of the post structure for return in JSON\n\t\t$_post = array_merge( $_post, $custom_fields );\n\t\t\n\t\t//REMOVE UN-NEEDED FIELDS\n\t\t\n\t\tunset($_post['featured_image']);\n\t\tunset($_post['parent']);\n\t\tunset($_post['slug']);\n\t\tunset($_post['status']);\n\t\tunset($_post['guid']);\n\t\tunset($_post['menu_order']);\n\t\tunset($_post['comment_status']);\n\t\tunset($_post['format']);\n\t\tunset($_post['excerpt']);\n\t\tunset($_post['ping_status']);\n\t\tunset($_post['sticky']);\n\t\tunset($_post['date_tz']);\n\t\tunset($_post['date_gmt']);\n\t\tunset($_post['modified_tz']);\n\t\tunset($_post['modified_gmt']);\n\t\tunset($_post['meta']);\n\t\t\n\t\t\n\t\t//remove fields from categories\n\t\t$count = 0;\n\t\tforeach($_post['terms']['category'] as $category)\n\t\t{\n\t\t\tunset($category['description']);\n\t\t\tunset($category['slug']);\n\t\t\tunset($category['taxonomy']);\n\t\t\tunset($category['parent']);\n\t\t\tunset($category['count']);\n\t\t\tunset($category['link']);\n\t\t\tunset($category['meta']);\n\t\t\t\n\t\t\t$_post['terms']['category'][$count] = $category;\n\t\t\t$count += 1;\n\t\t}\n\t\t\n\t\t//remove fields from tags\n\t\t$count = 0;\n\t\tforeach($_post['terms']['post_tag'] as $post_tag)\n\t\t{\n\t\t\tunset($post_tag['description']);\n\t\t\tunset($post_tag['slug']);\n\t\t\tunset($post_tag['taxonomy']);\n\t\t\tunset($post_tag['parent']);\n\t\t\tunset($post_tag['count']);\n\t\t\tunset($post_tag['link']);\n\t\t\tunset($post_tag['meta']);\n\t\t\t\n\t\t\t$_post['terms']['post_tag'][$count] = $post_tag;\n\t\t\t$count += 1;\n\t\t}\n\t\t\n\t\t//remove fields from the author\n\t\tunset($_post['author']['username']);\n\t\tunset($_post['author']['name']);\n\t\tunset($_post['author']['first_name']);\n\t\tunset($_post['author']['last_name']);\n\t\tunset($_post['author']['nickname']);\n\t\tunset($_post['author']['slug']);\n\t\tunset($_post['author']['URL']);\n\t\tunset($_post['author']['avatar']);\n\t\tunset($_post['author']['description']);\n\t\tunset($_post['author']['registered']);\n\t\tunset($_post['author']['meta']);\n\t\t\n\t\treturn $_post;\n\t}", "function my_add_custom_features_text_callback($meta_fields) {\n\t$custom_field = array(\n\t\t'id'\t\t=>\t'epl_property_listing_custom_data_id',\n\t\t'label'\t\t=>\t__('Custom Features', 'epl'), // Box header\n\t\t'post_type'\t=>\tarray('property', 'rural', 'rental', 'land', 'commercial', 'commercial_land', 'business'), // Which listing types these will be attached to\n\t\t'context'\t=>\t'normal',\n\t\t'priority'\t=>\t'default',\n\t\t'groups'\t=>\tarray(\n\t\t\tarray(\n\t\t\t\t'id'\t\t=>\t'property_custom_feature_section',\n\t\t\t\t'columns'\t=>\t'2', // One or two columns\n\t\t\t\t'label'\t\t=>\t'Custom features',\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'\t\t=>\t'property_custom_feature_1',\n\t\t\t\t\t\t'label'\t\t=>\t__('Custom feature 1', 'epl'),\n\t\t\t\t\t\t'type'\t\t=>\t'text',\n\n\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'\t\t=>\t'property_custom_feature_2',\n\t\t\t\t\t\t'label'\t\t=>\t__('Custom feature 2', 'epl'),\n\t\t\t\t\t\t'type'\t\t=>\t'text',\n\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id'\t\t=>\t'property_custom_feature_section_2',\n\t\t\t\t'columns'\t=>\t'2', // One or two columns\n\t\t\t\t'label'\t\t=>\t'Custom features 2',\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'\t\t=>\t'property_custom_feature_3',\n\t\t\t\t\t\t'label'\t\t=>\t__('Custom feature 3', 'epl'),\n\t\t\t\t\t\t'type'\t\t=>\t'text',\n\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'\t\t=>\t'property_custom_feature_4',\n\t\t\t\t\t\t'label'\t\t=>\t__('Custom feature 4', 'epl'),\n\t\t\t\t\t\t'type'\t\t=>\t'text',\n\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n\t$meta_fields[] = $custom_field;\n\treturn $meta_fields;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: normalizer should not throw an error better return value as is. Returns closure for normalizing property
public function getNormalizer(Schema $propertySchema, string $propertyName, bool $isRequired): \Closure;
[ "public function normalize() {\n }", "public static function normalizeProperty($property)\n {\n //Remove an underscore, so you can do get_date()\n if(substr($property,0,1) == '_')\n {\n $property = substr($property, 1);\n }\n\n $property = lcfirst($property);\n\n// //Deal with famil-'ies', make it 'family'\n// if ('ies' == substr($property, -3)) {\n// $property = substr($property, 0, -3) . 'y';\n// }\n//\n// //Deal with 'friends', make it 'friend'\n// if (preg_match('/[^s]s$/', $property))\n// {\n// $property = substr($property, 0, -1);\n// }\n\n return $property;\n }", "public function sanitize() {\n foreach ( $this->_sanitizers as $property => $type ) {\n $this->$property = Data::sanitize($this->$property, $type);\n }\n return $this;\n }", "public function valueConverter() : ?\\Closure\n {\n return $this->value_converter;\n }", "function property($property) {\n return function ($object) use ($property) {\n return $object->$property;\n };\n}", "private function getModifierConverter(): Closure\n {\n return function (Token $token) {\n $name = strtoupper($token->getValue());\n\n return constant(\"ReflectionMethod::IS_{$name}\");\n };\n }", "public function normalize($value);", "public function normalize($value) {\n return $value;\n }", "function dbNormalize(&$row,$normalizationFields)\n{\n foreach($normalizationFields as $field => $normFn) {\n\t if(array_key_exists($field,$row)) {\n\t $row[$field] = $normFn($row[$field]);\n\t }\n }\n}", "#[Pure]\nfunction normalizer_normalize(string $string, int $form = Normalizer::FORM_C): string|false {}", "public function normalize($normalizer)\n {\n if (is_string($normalizer) && isset($this->normalizers[$normalizer])) {\n\n $this->normalizer = $this->normalizers[$normalizer];\n\n } else if ($normalizer instanceof NormalizerInterface) {\n\n $this->normalizer = $normalizer;\n\n }\n\n return $this;\n }", "public static function propertyNameFilter(): callable\n {\n return self::camelCaseFilter();\n }", "function normalizer_normalize($input, $form = Normalizer::FORM_C) {}", "private function normalizeProperty($property)\n {\n if (!$this->usePrettyPropertyName) return $property;\n $tmp = explode('_', $property);\n if (count($tmp) == 1) return strtoupper($property) == $property ? lcfirst(strtolower($property)) : lcfirst($property);\n foreach ($tmp as $k => $v) \n {\n if (trim($v)) $tmp[$k] = ucfirst(strtolower(trim($v)));\n else unset($tmp[$k]);\n }\n return lcfirst(implode('', $tmp));\n }", "protected function normalize()\r\n\t{\r\n\t\tif ($this->isFetched())\r\n\t\t{\r\n\t\t\tif ($this->validationInfo)\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->validationInfo->normalize($this->taintValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->taintValue;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "public function setNormalizationClosures(array $closures)\n {\n $this->normalizationClosures = $closures;\n }", "function normalize($name = null, $value = null) {\n if ($name === null) {\n $names = array_unique( array_merge(array_keys($this->columns), $this->names) );\n array_map(array($this, 'normalize'), $names);\n return $this;\n } else {\n func_num_args() == 1 and $value = &$this->columns[$name];\n\n $func = 'normalize_'.strtolower($name);\n method_exists($this, $func) and $value = $this->$func($value);\n\n return $value;\n }\n }", "protected static function columnToSetterFunc()\n {\n return function ($tableName, $columnName) {\n $words = explode('_', $columnName);\n\n if (count($words) <= 1) { // no table prefix\n $name = 'set' . ucfirst($columnName);\n } else {\n $tablePrefix = array_shift($words);\n $name = 'set' . implode('', array_map('ucfirst', $words));\n }\n\n return $name;\n };\n }", "public function getNormalizer()\n {\n return $this->normalizer;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retorna la id_categoria a la que pertenece la pregunta
static public function get_id_nueva_categ_ganada($id_pregunta) { $query = "SELECT cat.id_categoria AS 'id_categoria' FROM categoria AS cat, pregunta AS pre WHERE cat.id_categoria = pre.id_categoria AND pre.id_pregunta = ".self::$conexion->safeText(utf8_encode($id_pregunta))." LIMIT 1"; $result = self::$conexion->query_db($query); if(isset($result[0])) return $result[0]['id_categoria']; else return false; }
[ "public function getIdcategoria()\n {\n return $this->idcategoria;\n }", "public function getId_categoria()\n {\n return $this->id_categoria;\n }", "public function getIdCategoria()\r\n {\r\n return $this->id_categoria;\r\n }", "public function getCategoriaId()\r\n {\r\n return $this->categoria_id;\r\n }", "public function getIdCategoria()\n {\n return $this->idCategoria;\n }", "public function getCategoria_id()\n {\n return $this->categoria_id;\n }", "public function getCategoria_idcategoria(){\n return $this->categoria_idcategoria;\n }", "public function getIdcategorie()\n {\n return $this->idcategorie;\n }", "public function getId_categorie()\n {\n return $this->id_categorie;\n }", "function getIdCategoriaProducto()\r\n\t {\r\n\t\t return $this->id_categoria_producto;\r\n\t }", "public function ConsultarIdCategoria($cod_cat){\r\n $resultado = $this->bd->query(\"SELECT * FROM categoria WHERE codigoCategoria = '$cod_cat'\");\r\n return $resultado;\r\n }", "public function getCategorieId()\n {\n return $this->categorieId;\n }", "function obtenerCategorias(){\n\n \t\treturn $this->cuestionario['cuestionario']['categorias']['catego'];\n \t}", "function traerCategoria() {\r\n\t$sql\t\t=\t\t\"select idcategoria, categoria, activo from s_categorias order by categoria\";\r\n\t$res\t\t=\t\t$this->query($sql,0);\r\n\tif ($res == false) {\r\n\t\treturn 'Error al consultar datos';\r\n\t} else {\r\n\t\treturn $res;\r\n\t}\r\n}", "public function getIdCategorie()\r\n {\r\n return $this->idCategorie;\r\n }", "public function listarTiposCategoria($categoria){\n $tipos= Tipo::select(\"id\",\"tipo\")->where(\"categoria\",$categoria)->get();\n $arrayCategorias = array();\n foreach ($tipos as $tipo){\n $arrayCategorias[$tipo->id]= $tipo->tipo;\n }\n return $arrayCategorias;\n }", "function get_categoria_producto($categoria_id)\n {\n $categoria_producto = $this->db->query(\"\n SELECT\n *\n\n FROM\n `categoria_producto`\n\n WHERE\n `categoria_id` = ?\n \",array($categoria_id))->row_array();\n\n return $categoria_producto;\n }", "public function getId_categoria_ticket()\n {\n return $this->id_categoria_ticket;\n }", "public function categoria_producto($id_categoria){\n $stmt=$this->conexion->conectar()->prepare(\"SELECT nombre_categoria as resultado FROM productos INNER JOIN categorias ON productos.categoria = categorias.id_categoria WHERE categoria=:id_categoria LIMIT 1\");\n $stmt->bindParam(\":id_categoria\",$id_categoria,PDO::PARAM_STR);\n $stmt->execute();\n return $stmt->fetchAll();\n $stmt->closeCursor();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loadBalancers Pointer to the \LoadBalancers class
public function loadBalancers(): LoadBalancers { $lb = new LoadBalancers($this); return $lb; }
[ "public function listLoadBalancers()\n {\n return $this->api->makeAPICall('GET', $this->api::LOAD_BALANCERS_URL);\n }", "public function loadBalancerList() {\n\t\t$url = \"/loadbalancers\";\n\n\t\t$response = $this->makeLbApiCall($url);\n\t\tif (isset($response['loadBalancers'])) {\n\t\t\treturn $response['loadBalancers'];\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function balancers()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/load-balancers');\n }", "public function getLoadbalancers()\n {\n return [\n 'method' => 'GET',\n 'path' => 'loadbalancers',\n 'params' => [],\n ];\n }", "abstract public function describeLoadBalancer();", "protected function createLoadBalancerManager()\n {\n // TODO: Implement createLoadBalancerManager() method.\n }", "public function convertToLoadBalancer($loadBalancer);", "public function get($load_balancer);", "public function create_load_balancer($load_balancer_name, $listeners, $availability_zones, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['LoadBalancerName'] = $load_balancer_name;\n\n\t\t// Required parameter\n\t\t$opt = array_merge($opt, CFComplexType::map(array(\n\t\t\t'Listeners.member' => (is_array($listeners) ? $listeners : array($listeners))\n\t\t)));\n\n\t\t// Required parameter\n\t\t$opt = array_merge($opt, CFComplexType::map(array(\n\t\t\t'AvailabilityZones.member' => (is_array($availability_zones) ? $availability_zones : array($availability_zones))\n\t\t)));\n\n\t\treturn $this->authenticate('CreateLoadBalancer', $opt, $this->hostname);\n\t}", "public function addDroplets($load_balancer, array $droplets = []);", "function listLoadBalancer($ip){\n\t\tif($ip)\t\t\n\t\t\t$url = $this->loadbalancer_url.'?nodeaddress='.$ip;\n\t\telse\n\t\t\t$url = $this->loadbalancer_url;\t\t\n\t\treturn $this->execute($url,\"GET\");\n\t}", "public function LoadBalancer($id = null) \n {\n return new LoadBalancer($this, $id);\n }", "public function get($load_balancer)\n {\n $resource = $this->connection->get(\"/load_balancers/{$load_balancer}\");\n return $this->load(['load_balancer' => $resource], 'LoadBalancer', 'load_balancer');\n }", "public function loadBalancerDetails($lbId) {\n\t\t$url = \"/loadbalancers/$lbId\";\n\n\t\t$response = $this->makeLbApiCall($url);\n\t\tif ($this->getLastResponseStatus() == 200) {\n\t\t\treturn $response;\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function getHttpLoadBalancing()\n {\n return isset($this->http_load_balancing) ? $this->http_load_balancing : null;\n }", "public function LoadBalancerList($detail = true, $filter = array()) \n {\n return $this->Collection('\\OpenCloud\\LoadBalancer\\LoadBalancer');\n }", "public function register_instances_with_load_balancer($load_balancer_name, $instances, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['LoadBalancerName'] = $load_balancer_name;\n\t\t\n\t\t// Required list + map\n\t\t$opt = array_merge($opt, CFComplexType::map(array(\n\t\t\t'Instances' => (is_array($instances) ? $instances : array($instances))\n\t\t), 'member'));\n\n\t\treturn $this->authenticate('RegisterInstancesWithLoadBalancer', $opt);\n\t}", "public function getLoadLoans()\n {\n return $this->LoadLoans;\n }", "protected function loadServiceBricks() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Identifies the missing information in the property lease data entry flow.
public function getMissingInformation($enquiryId) { $referenceManager = new Manager_Referencing_Reference(); $enquiry = $referenceManager->getReference($enquiryId); $propertyLease = $enquiry->propertyLease; $missingInfo = array(); //Check the address details. if(empty($propertyLease->address->flatNumber)) { if(empty($propertyLease->address->houseName)) { if(empty($propertyLease->address->houseNumber)) { if(empty($propertyLease->address->addressLine1)) { $missingInfo[] = 'Property address: 1st line'; } } } } if(empty($propertyLease->address->town)) { $missingInfo[] = 'Property address: town'; } if(empty($propertyLease->address->postCode)) { $missingInfo[] = 'Property address: postcode'; } //Check the remaining details. if(empty($propertyLease->rentPerMonth)) { $missingInfo[] = 'Rental amount'; } if(empty($propertyLease->tenancyTerm)) { $missingInfo[] = 'Tenancy term'; } if(empty($propertyLease->noOfTenants)) { $missingInfo[] = 'Number of tenants'; } if(empty($propertyLease->tenancyStartDate)) { $missingInfo[] = 'Tenancy start date'; } //Finalize if(empty($missingInfo)) { $returnVal = null; } else { $returnVal = $missingInfo; } return $returnVal; }
[ "public function getMissingInformation($enquiryId) {\n \n\t\t$referenceManager = new Manager_Referencing_Reference();\n\t\t$enquiry = $referenceManager->getReference($enquiryId);\n $prospectiveLandlord = $enquiry->propertyLease->prospectiveLandlord;\n \n $missingInfo = array();\n \n \n if(empty($prospectiveLandlord)) {\n \n //Prospective landlord details are optional except on rentguarantee\n //products.\n $product = $enquiry->productSelection->product;\n if($product->isRentGuarantee) {\n \n $missingInfo[] = 'No prospective landlord details';\n }\n }\n else {\n \n //Check the name.\n if(empty($prospectiveLandlord->name->firstName)) {\n \n if(empty($prospectiveLandlord->name->lastName)) {\n \n $missingInfo[] = 'Prospective landlord: name';\n }\n }\n \n \n //Contact details are optional.\n \n \n //Check the address\n $address = $prospectiveLandlord->address;\n if(empty($address->flatNumber)) {\n \n if(empty($address->houseName)) {\n \n if(empty($address->houseNumber)) {\n \n if(empty($address->addressLine1)) {\n \n $missingInfo[] = 'Prospective landlord address: 1st line';\n }\n }\n }\n }\n \n if(empty($address->town)) {\n \n $missingInfo[] = 'Prospective landlord address: town';\n }\n \n if(empty($address->postCode)) {\n \n $missingInfo[] = 'Prospective landlord address: postcode';\n }\n }\n \n \n //Finalize\n if(empty($missingInfo)) {\n \n $returnVal = null;\n }\n else {\n \n $returnVal = $missingInfo;\n }\n \n return $returnVal;\n }", "public function listInvalidProperties();", "protected function assertNoData(): void\n {\n if (\\array_key_exists(self::DATA, $this->result)) {\n throw new \\InvalidArgumentException('A primary data already exist.');\n }\n }", "public function getMissingInformation($chronology, $enquiryId) {\n \n\t\t$referenceManager = new Manager_Referencing_Reference();\n\t\t$enquiry = $referenceManager->getReference($enquiryId);\n $residenceArray = $enquiry->referenceSubject->residences;\n\t\t\n\t\t\n $missingInfo = array();\n \n \n //Prepare the label used in the missing information message.\n switch($chronology) {\n \n case Model_Referencing_ResidenceChronology::CURRENT: $label = 'Current'; break;\n case Model_Referencing_ResidenceChronology::FIRST_PREVIOUS: $label = 'Previous'; break;\n case Model_Referencing_ResidenceChronology::SECOND_PREVIOUS: $label = 'Second previous'; break;\n }\n \n \n if(empty($residenceArray)) {\n \n $missingInfo[] = \"$label residence details missing\";\n }\n else {\n \n foreach($residenceArray as $residence) {\n \n //Look for the appropriate residence.\n if($residence->chronology != $chronology) {\n \n continue;\n }\n \n //Current residence found. Check the data provided.\n if(empty($residence->duration)) {\n \n $missingInfo[] = \"$label residence: duration\";\n }\n \n if(empty($residence->address->isOverseasAddress)) {\n \n if($residence->address->isOverseasAddress !== false) {\n \n $missingInfo[] = \"$label residence: is overseas confirmation\";\n }\n }\n \n //Check the address\n $address = $residence->address;\n if(empty($address->flatNumber)) {\n \n if(empty($address->houseName)) {\n \n if(empty($address->houseNumber)) {\n \n if(empty($address->addressLine1)) {\n \n $missingInfo[] = \"$label residence: 1st line\";\n }\n }\n }\n }\n \n if(empty($address->town)) {\n \n $missingInfo[] = \"$label residence: town\";\n }\n \n if(empty($address->postCode)) {\n \n $missingInfo[] = \"$label residence: postcode\";\n }\n \n \n //Processing complete.\n break;\n }\n }\n \n \n //Finalize\n if(empty($missingInfo)) {\n \n $returnVal = null;\n }\n else {\n \n $returnVal = $missingInfo;\n }\n \n return $returnVal;\n }", "public function getUnknownProperties()\n {\n return $this->unknownProperties;\n }", "public function testMissingKey() {\n $this->assertRefLookup('#/not', null);\n }", "function get404Properties() {\n\n if ($this->itemsLeft === 0) {\n return [];\n }\n $result = [];\n foreach ($this->result as $propertyName => $stuff) {\n if ($stuff[0] === 404) {\n $result[] = $propertyName;\n }\n }\n return $result;\n\n }", "public function testValidationCaseForAccessingNonExistentProperty()\n {\n $structure = new ExchangeInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\OutOfBoundsException::class);\n\n $tmp = $structure->test;\n } else {\n $hasThrown = null;\n\n try {\n $tmp = $structure->test;\n } catch (\\OutOfBoundsException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function getNoPropertiesFoundText()\n {\n return $this->noPropertiesFoundText;\n }", "public function skippedPropertiesDataProvider()\n {\n return [\n ['types', 'types', '9,4', 'Tx_T3eventsReservation_Participant'],\n ['periodType', 'periodType', 'foo', null]\n ];\n }", "public function getHealthStatusMismatchInfo()\n {\n if (array_key_exists(\"healthStatusMismatchInfo\", $this->_propDict)) {\n return $this->_propDict[\"healthStatusMismatchInfo\"];\n } else {\n return null;\n }\n }", "public function missing($key);", "protected function addMissingRequired()\n {\n $required = [\n '1:Revision' => '',\n '2:ImageParameters' => '',\n '2:PermitNumber' => '',\n '4:PermitIssuingPOZip5' => '',\n '14:POZipCode' => '',\n '34:FacilityType' => 'DDU',\n '35:MailClassEnclosed' => 'Other',\n '36:MailClassOther' => 'Free Samples',\n '37:WeightInPounds' => '22',\n '38:WeightInOunces' => '10',\n '39:ImageType' => 'PDF',\n '40:SeparateReceiptPage' => 'false',\n '41:AllowNonCleansedFacilityAddr' => 'false',\n '42:HoldForManifest' => 'N',\n '43:CommercialPrice' => 'N',\n ];\n\n foreach ($required as $item => $value) {\n $explode = explode(':', $item);\n if (!isset($this->fields[$item])) {\n $this->setField($explode[0], $explode[1], $value);\n }\n }\n }", "private function check_for_additional_properties()\r\n {\r\n if (isset($this->additionalProperties))\r\n {\r\n return;\r\n }\r\n $dm = RepositoryDataManager :: get_instance();\r\n $this->additionalProperties = $dm->retrieve_additional_content_object_properties($this);\r\n }", "function get404Properties() {\n\n $result = [];\n foreach ($this->result as $propertyName => $stuff) {\n if ($stuff[0] === 404) {\n $result[] = $propertyName;\n }\n }\n // If there's nothing in this list, we're adding one fictional item.\n if (!$result) {\n $result[] = '{http://sabredav.org/ns}idk';\n }\n return $result;\n\n }", "public function testGetUnknownPropertyWhenFieldsDefinedThrowsException()\n {\n TestActiveRecord1::setManager($this->manager);\n $ar = new TestActiveRecord1();\n $value = $ar->thisPropertyShouldNeverExist;\n }", "public function shouldSkipUnknownProperties();", "abstract public function checkProperties();", "public function determineMissingFields()\n {\n $missing = array();\n\n foreach ($this->_requiredParams AS $param)\n {\n if (!isset($this->_queryParameters[$param]) || strlen($this->_queryParameters[$param]) === 0)\n {\n $missing[] = $param;\n }\n }\n\n if (empty($this->_username)) {\n $missing[] = 'USER';\n }\n\n if (empty($this->_password)) {\n $missing[] = 'PWD';\n }\n\n if (empty($this->_signature)) {\n $missing[] = 'SIGNATURE1';\n }\n\n return $missing;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate an memcached ID for the object given an object ID
public static function _getMemcachedID ($id) { return get_called_class () . '-' . $id; }
[ "function generate_object_id(bool $counted = true): string\n{\n return Generator::generateObjectId($counted);\n}", "public function getMemcacheId() {\n $lInvoker = $this->getInvoker();\n\n return strtolower(get_class($lInvoker)) . \"-\" . $lInvoker->getId();\n }", "public function unique_id ($obj)\n {\n return $obj->id;\n }", "abstract protected function generateId();", "function make_id(){\r\n\t\t// creer un hash\r\n\t\t$hash = $this->champ . $this->table . $this->sql;\r\n\t\t$this->_id = substr(md5($hash),0,6);\r\n\t}", "public function get_cached_id()\n {\n }", "public function getIdentifierByObject($object);", "public function id($object);", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->get_id() . '_' . $this->module() . '_' . $this->unique() );\n\t}", "function getCacheId() {\n //echo \\end(explode('\\\\', \\get_class($this))).\"-\".$this->qu1.\"<br/>\";\n $id = \\end(explode('\\\\', \\get_class($this))).\"-\".md5($this->qu1);\n\n return $id;\n }", "public function getCacheId();", "public function getUniversalId($object);", "private function createId(): string\n {\n return '_' . time() . '_' . explode(' ', microtime())[0];\n }", "public function get_cache_id() {\n\t\treturn wponion_hash_string( \"{$this->get_id()}_{$this->metabox_id()}_{$this->unique()}_{$this->module()}\" );\n\t}", "public function makeId($object, $functionName, $args = array(), $addtionalIdPrefix = '')\n {\n return md5($addtionalIdPrefix . get_class($object) . $functionName . serialize($args));\n }", "protected function getCacheId($id) {\n return self::CACHE_PREFIX . \"{$id}\";\n }", "public function generateCacheId()\n {\n $view = $this->getCurrentView();\n $initialLocale = $view->getCurrentLocale();\n $nameChain = $view->getReference()->getName();\n while ($view = $view->getParent()) {\n $view->setCurrentLocale($initialLocale); //Force locale to current locale\n $nameChain .= '/'.$view->getReference()->getName();\n }\n\n return sprintf('%s-%s-%s-%s',\n $this->getId(),\n $this->getUpdatedAt()->getTimestamp(),\n md5($nameChain),\n $this->getCurrentView()->getReference()->getId()\n );\n }", "final protected function genId(){\n\t\t$this->id = 'bele' . self::$ID_INDEX++;\n\t}", "function spl_object_id(object $obj): int {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns list of properties which can be edited
public static function getEditableProperties() { return ['title_ua', 'title_ru', 'title_en','for_whom_ua', 'what_you_learn_ua','what_you_get_ua','for_whom_ru', 'what_you_learn_ru','what_you_get_ru','for_whom_en', 'what_you_learn_en','what_you_get_en','level']; }
[ "public function editableProperties();", "public function editableProperties()\n\t{\n\t\treturn array(\"category\",\"name\");\n\t}", "public function getVisibleProperties();", "public function getAllProperties();", "public function getAllowedProperties()\n {\n return $this->allowedProperties;\n }", "public function getProperties();", "public function property_priv_write($properties) {\n $allow = $this->is_admin();\n $retval = array();\n foreach ($properties as $prop) $retval[$prop] = $allow;\n return $retval;\n }", "public function getUpdatableProperties(): UpdatablePropertyCollection;", "public function get_properties()\n {\n return $this->properties;\n }", "function getPropertyList() {\n\tif (!is_array($this->_properties)) { return false; }\n\t$ar = array();\n\tforeach($this->_properties as $alias => $props) {\n\t\tforeach($props as $prop) {\n\t\t\t$ar[] = array($alias,$prop);\n\t\t\t}\n\t\t}\n\treturn $ar;\n\t}", "public function getProperties()\n {\n return array_filter($this->context->getProperties());\n }", "protected function _getReadonlyProperties()\n {\n return array();\n }", "public static function getProperties()\n {\n return [\n 'ID' => [true, self::PROPERTY_TYPE_INT, null, false, false],\n 'Name' => [true, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Date' => [false, self::PROPERTY_TYPE_DATE, '\\\\DateTimeInterface', false, false],\n 'Number' => [false, self::PROPERTY_TYPE_INT, null, false, false],\n 'Decimal' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'Boolean' => [false, self::PROPERTY_TYPE_BOOLEAN, null, false, false],\n 'Text' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n ];\n }", "public function listInvalidProperties();", "public function getUpdatedProperties() {}", "public function getProperties(): PropertyCollection;", "public function visibleProperties()\n {\n return array_keys($this->_properties);\n }", "public function getEditableInProfileList()\n {\n return $this->getAttributeKeyRepository()->getEditableInProfileList();\n }", "public function getProperties(): array;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensures the path of the specified key exists, and creates all required parents if necessary. It does NOT create the key itself.
protected function ensurePath($key) { $parent=self::getParentName($key); if (in_array($key, self::$known_paths)) return true; if (self::$zk_h->exists($parent)) return true; if (!$this->ensurePath($parent)) return false; // We should never execute this if (self::$zk_h->create($parent, 1, $this->default_acl)) return true; // One last chance: maybe another thread created it, // let's check one more time before complaining. // Thanks bradjorgensen @ GitHub for noticing this! if (self::$zk_h->exists($parent)) return true; throw new RuntimeException("Failed creating path [".$parent."]"); }
[ "protected function createNewKey($key, $must_exist = false)\n {\n if ($must_exist === true) {\n return false;\n }\n\n $results = $this->getKeyNamespace($key);\n\n if ($results === false) {\n return $key;\n }\n\n $key = $results;\n\n return $key;\n }", "public function isKeyCreatableNestedRelation(string $key, ?string $parentModel = null): bool;", "public function createCachePath($key = 'fastrouter')\n\t{\n\t\t$cacheKey = $this->config['cache_key'].$key;\n\t\t$cacheOptions = array(xPDO::OPT_CACHE_KEY => $cacheKey);\n\t\t$empty = $this->modx->getCacheManager()->get($key, $cacheOptions);\n\t\t//\n\t\tif(empty($empty)) {\n\t\t\t$empty['empty'] = 1;\n\t\t\t$this->modx->cacheManager->set($key, $empty, 0, $cacheOptions);\n\t\t}\n\t}", "protected function ensurePathExists()\n {\n foreach ($this->requiredPaths as $path) {\n if (!is_dir(storage_path($path))) {\n mkdir(storage_path($path), 0777, true);\n }\n }\n }", "public function keyExists($key)\n {\n }", "public function ensureParentDirectories($path) {}", "public function createPackageThrowsExceptionForExistingPackageKey()\n {\n $this->expectException(PackageKeyAlreadyExistsException::class);\n $this->packageManager->createPackage('Acme.YetAnotherTestPackage', [], 'vfs://Test/Packages/Application');\n $this->packageManager->createPackage('Acme.YetAnotherTestPackage', [], 'vfs://Test/Packages/Application');\n }", "private function generateNewKey() {\n $keyExists = true;\n while ($keyExists) {\n $key = $this->generate();\n $keyExists = self::exists($key);\n }\n \n return $key;\n }", "public function checkPath()\n \t{\n \t\tif (!file_exists(\"cache/\".$this->table)) {\n \t\t\tmkdir(\"cache/\".$this->table);\n \t\t}\n \t}", "function generateMissingKey() {\n if( !file_exists($this->publicKeyFile) || !file_exists($this->privateKeyFile) ) {\n \n $this->logger->notice(\"Generating rsa keys...\");\n mkdir('/root/.ssh', 0700);\n $cmd=\"/usr/bin/ssh-keygen -t rsa -N '' -f \".$this->privateKeyFile;\n $output = [];\n $return = null;\n exec($cmd, $output, $return);\n if (!$return) {\n $this->logger->notice(\"Created rsa key pair in /root/.ssh\");\n }\n else {\n throw new \\Exception(\"Error generating rsa key pair.\".join(\"\\n\", $output));\n }\n }\n }", "public function isKeyCreatableNestedRelation(string $key, ?string $parentModel = null): bool\n {\n if (! $this->isKeyUpdatableNestedRelation($key, $parentModel)) {\n return false;\n }\n\n $config = $this->getNestedRelationConfigByKey($key, $parentModel);\n\n if ($config === true) {\n return true;\n }\n\n if (! is_array($config)) {\n return false;\n }\n\n return ! Arr::get($config, 'update-only', false);\n }", "final function create_parent(): void {\r\n\t\t$space_dir = sprintf('%s/%s', JKN_CACHE_DIR_INT, $this->space_id);\r\n\r\n\t\t$old = umask(0);\r\n\t\tif (!is_dir(JKN_CACHE_ROOT_INT)) mkdir(JKN_CACHE_ROOT_INT, 0755);\r\n\t\tif (!is_dir(JKN_CACHE_DIR_INT)) mkdir(JKN_CACHE_DIR_INT, 0755);\r\n\t\tif (!is_dir($space_dir)) mkdir($space_dir, 0755);\r\n\t\tumask($old);\r\n\t}", "public function ensureParentDirectories($path)\n {\n $object = $this->cache[$path];\n\n while ($object['dirname'] !== '' && ! isset($this->cache[$object['dirname']])) {\n $object = Util::pathinfo($object['dirname']);\n $object['type'] = 'dir';\n $this->cache[$object['path']] = $object;\n }\n }", "public function testGenerateEmptyPath(): void\n {\n $this->expectException(Exception::class);\n $this->expectExceptionMessage('Key path is empty.');\n (new Key())->generate('');\n }", "protected function makePath($key = null)\n\t{\n\t\tif(!isset($this->cachePath))\n\t\t\tthrow new StashFileSystemError('Unable to load system without a base path.');\n\n\t\t$basePath = $this->cachePath;\n\n\t\tif(!isset($key) || count($key) == 0)\n\t\t\treturn $basePath;\n\n\t\t// When I profiled this compared to the \"implode\" function, this was much faster. This is probably due to the\n\t\t// small size of the arrays and the overhead from function calls. This may seem like a ridiculous\n\t\t// micro-optimization, but I only did it after profiling the code with xdebug and noticing a legitimate\n\t\t// difference, most likely due to the number of times this function can get called in a scripts.\n\t\t// Please don't look at me like that.\n\t\t$memkey = '';\n\t\tforeach($key as $group)\n\t\t\t$memkey .= $group . '/' ;\n\n\t\tif(isset($this->memStore['keys'][$memkey]))\n\t\t{\n\t\t\treturn $this->memStore['keys'][$memkey];\n\t\t}else{\n\t\t\t$pathPieces = array();\n\t\t\t$path = $basePath;\n\t\t\t$len = floor(32 / $this->directorySplit);\n\t\t\t$key = StashUtilities::normalizeKeys($key);\n\n\t\t\tforeach($key as $index => $value)\n\t\t\t{\n\t\t\t\tif(strpos($value, '@') === 0)\n\t\t\t\t{\n\t\t\t\t\t$path .= substr($value, 1) . '/';\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$sLen = strlen($value);\n\t\t\t\t$len = floor($sLen / $this->directorySplit);\n\t\t\t\tfor($i=0; $i < $this->directorySplit; $i++)\n\t\t\t\t{\n\t\t\t\t\t$start = $len * $i;\n\t\t\t\t\tif($i == $this->directorySplit)\n\t\t\t\t\t\t$len = $sLen - $start;\n\t\t\t\t\t$path .= substr($value, $start, $len) . '/';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$path = rtrim($path, '/') . '.php';\n\t\t\t$this->memStore['keys'][$memkey] = $path;\n\n\t\t\t// in most cases the key will be used almost immediately or not at all, so it doesn't need to grow too large\n\t\t\tif(count($this->memStore['keys']) > $this->memStoreLimit)\n\t\t\t\tforeach(array_rand($this->memStore['keys'], ceil($this->memStoreLimit / 2) + 1) as $empty)\n\t\t\t\t\tunset($this->memStore['keys'][$empty]);\n\n\t\t\treturn $path;\n\t\t}\n\t}", "public function testKeyExistsOrFail()\n {\n $array = ['a' => 'alfa', 'beta', 'gamma'];\n key_exists_or_fail('a', $array);\n key_exists_or_fail(['a', 1], $array);\n\n foreach ([\n 'b',\n ['a', 'b'],\n ['b', 'c'],\n ] as $key) {\n $this->assertException(KeyNotExistsException::class, function () use ($array, $key) {\n key_exists_or_fail($key, $array);\n }, 'Key `b` does not exist');\n }\n }", "function create_key_file_folder( ) {\n\t\tif ( defined( 'AUTH_KEY' ) ) {\n\t\t\t$kff = $this->uploads_dir . md5( 'AUTH_KEY' ) . '/' ;\n\t\t\tif ( is_dir( $kff ) )\n\t\t\t\treturn;\n\t\t\telse\n\t\t\t\t@mkdir( $kff );\n\n\t\t\tif ( is_dir( $kff ) )\n\t\t\t\treturn;\n\t\t}\n\t\tif ( !is_dir( $this->uploads_dir . '__app/' ) )\n\t\t\t@mkdir( $this->uploads_dir . '__app/' );\n\t}", "public function buildKey($key);", "public function ensure()\n {\n try {\n if (!$this->exists()) {\n $this->create();\n }\n } catch (DBIDuplicateException $e) {\n Logger::info(\"... fk already there!\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executed when an order is marked as processing (from the cart), allowing order shipment types to process actions. IMPORTANT: this method may be executed during a visitor request. Don't execute slow processes synchronously in this method, considering scheduling those asynchronously.
public function onOrderStateProcessing() { $data = $this->getShipmentData(); // Add "from" address to shipment $this->setProperty('packlink', $data); // Add services admin link $this->setProperty('services_link', $this->adapter->makeAdminUrl('deliveryOptions/deliveries', ['id' => $this->get('id'), 'order' => $this->get('order')])); $this->save(); return true; }
[ "public function onProcess(OrderEntity $order){}", "public function processOrders()\r\n {\r\n $orderCollection = Mage::getResourceModel('sales/order_collection');\r\n\r\n $orderCollection\r\n ->addFieldToFilter('status', Touch_TouchPayment_Model_Sales_Order::STATUS_TOUCH_PENDING)\r\n ->addFieldToFilter('state', 'new')\r\n ->addFieldToFilter('created_at', array(\r\n 'lt' => new Zend_Db_Expr(\"DATE_ADD('\".now().\"', INTERVAL - 1 HOUR)\")));\r\n\r\n $payment = new Touch_TouchPayment_Model_Payment();\r\n foreach ($orderCollection->getItems() as $order) {\r\n\r\n $orderModel = Mage::getModel('sales/order');\r\n $orderModel->load($order['entity_id']);\r\n\r\n $orderStatus = $payment->getConfigData('order_status');\r\n $orderModel->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $orderStatus)->save();\r\n }\r\n }", "public function markAsProcessed() {\n\t\t$this->setData('processed', 1);\n\t\t$this->save();\n\t}", "public function processOrder()\n {\n $this->quantityLeft -= 1;\n }", "public function isProcessing() : bool\n {\n return $this->getOrderStatus() == self::STATUS_PENDING;\n }", "public function cartProcess()\n {\n geoOrderItem::callUpdate('geoCart_cartProcess');\n\n if (defined('IN_ADMIN')) {\n //pre-approvals on items that require admin approval\n $skipApprovals = (array)$_POST['needAdminApproval_skip'];\n $items = $this->order->getItem('parent');\n\n foreach ($items as $item) {\n if (!$item || !$item->getId()) {\n //something wrong with this one...\n continue;\n }\n $itemId = (int)$item->getId();\n if ($item->get('needAdminApproval', null) !== null || isset($skipApprovals[$itemId])) {\n //either need admin approval override is already set, or check-box\n //for pre-approving is checked, either way needAdminApproval needs to be\n //updated for the item.\n\n //if skip approval, set needAdminApproval to 0.. if not skip, set needAdminApproval to false,\n //which will actually un-set it with the way things work.\n $needApproval = (isset($skipApprovals[$itemId]) && $skipApprovals[$itemId]) ? 0 : false;\n $item->set('needAdminApproval', $needApproval);\n $item->save();\n }\n }\n }\n\n if ($this->errors > 0) {\n //don't \"short circuit\" payment page if something threw an error...\n return;\n }\n if ($this->getCartTotal() == 0 && !$this->get('no_free_cart')) {\n //there will be no payment details page, need to do things at this step.\n $this->set('free_cart', 1);\n $this->payment_choicesProcess(true);\n } else {\n if ($this->get('free_cart')) {\n $this->set('free_cart', false);\n }\n }\n }", "public function isProcessing(): bool\n {\n return $this->getOrderStatus() == self::STATUS_UNPAID;\n }", "protected function _processOrder()\r\n {\r\n $this->_orders = null;\r\n $this->_getOrders();\r\n\t\t\r\n $this->_info = Mage::getSingleton('paypal/info');\r\n try {\r\n // Handle payment_status\r\n $transactionType = isset($this->_request['txn_type']) ? $this->_request['txn_type'] : null;\r\n switch ($transactionType) {\r\n // handle new case created\r\n case Mage_Paypal_Model_Info::TXN_TYPE_NEW_CASE:\r\n $this->_registerDispute();\r\n break;\r\n\r\n // handle new adjustment is created\r\n case Mage_Paypal_Model_Info::TXN_TYPE_ADJUSTMENT:\r\n $this->_registerAdjustment();\r\n break;\r\n\r\n //handle new transaction created\r\n default:\r\n $this->_registerTransaction();\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n $comment = $this->_createIpnComment(Mage::helper('paypal')->__('Note: %s', $e->getMessage()), true);\r\n $comment->save();\r\n throw $e;\r\n }\r\n }", "public function process()\n {\n foreach ($this->jobs as $id => $job) {\n // get the job name\n $name = ucfirst($job['type']);\n // process the job\n $this->{\"process{$name}\"}($job);\n // remove it from the processing queue\n unset($this->jobs[$id]);\n }\n }", "public function reprocessOrders()\n {\n if (\n !$this->configuration->getEnableDeclineReprocessing() ||\n CrmPayload::get('meta.isSplitOrder') === true ||\n Request::attributes()->get('action') === 'prospect' ||\n ($this->configuration->getForceCampaignToUpsell() && $this->configuration->getStep() !== \"1\")\n ) {\n return;\n }\n \n $response = CrmResponse::all();\n \n if(!empty($response['success'])) {\n return;\n }\n \n if(\n \tpreg_match(\"/Prepaid.+Not Accepted/i\", $response['errors']['crmError']) &&\n \t!empty($response['errors']['crmError'])\n \t) {\n \treturn;\n \t}\n \n if (!$this->checkDeclinedReasons($response))\n {\n return;\n }\n \n CrmPayload::set('meta.isReprocessedOrder', true);\n\n $this->overrideReprocessCampaign();\n \n $crmInfo = $this->configuration->getCrm();\n $crmType = $crmInfo['crm_type'];\n $crmClass = sprintf(\n '\\Application\\Model\\%s', $crmType\n );\n\n $crmInstance = new $crmClass($this->configuration->getCrmId());\n call_user_func_array(array($crmInstance, CrmPayload::get('meta.crmMethod')), array());\n \n $enablePixelFire = $this->configuration->getEnablePixelFire();\n $reorderResponse = CrmResponse::all();\n \n if ($reorderResponse['success'])\n {\n\n Session::set('is_reprocessed_order.'.$this->configuration->getStep(), true);\n \n if (!$enablePixelFire) {\n Session::set('steps.meta.skipPixelFire', true);\n }\n if($this->configuration->getForceCampaignToUpsell())\n {\n Session::set('reprocessed_force_campaign_to_upsell', true);\n }\n }\n }", "function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }", "public function handledFyndiqOrdersAction()\n {\n $this->orderHandling(true);\n }", "protected function _processOrder()\n {\n $this->_order = null;\n $this->_getOrder();\n\n $this->_info = Mage::getSingleton('paypal/info');\n try {\n // Handle payment_status\n $transactionType = isset($this->_request['txn_type']) ? $this->_request['txn_type'] : null;\n switch ($transactionType) {\n // handle new case created\n case Mage_Paypal_Model_Info::TXN_TYPE_NEW_CASE:\n $this->_registerDispute();\n break;\n\n // handle new adjustment is created\n case Mage_Paypal_Model_Info::TXN_TYPE_ADJUSTMENT:\n $this->_registerAdjustment();\n break;\n\n //handle new transaction created\n default:\n $this->_registerTransaction();\n }\n } catch (Mage_Core_Exception $e) {\n $comment = $this->_createIpnComment(Mage::helper('paypal')->__('Note: %s', $e->getMessage()), true);\n $comment->save();\n throw $e;\n }\n }", "public function notification_processing() {\n\t\tglobal $ninja_forms_processing;\n\n\t\t$form_id = $ninja_forms_processing->get_form_ID();\n\t\t$notifications = nf_get_notifications_by_form_id( $form_id, false );\n\t\tif ( is_array( $notifications ) ) {\n\t\t\tforeach ( $notifications as $id ) {\n\t\t\t\tdo_action( 'nf_notification_before_process', $id );\n\t\t\t\tif ( Ninja_Forms()->notification( $id )->active ) {\n\t\t\t\t\tNinja_Forms()->notification( $id )->process();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function doPreActionProcessings () { }", "public function processMerchantOrder()\n {\n try {\n if ($this->merchantOrder->canInvoice()) {\n $invoice = $this->merchantOrder->prepareInvoice();\n if ($invoice->getGrandTotal() > 0) {\n $invoice\n ->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE)\n ->register();\n $this->merchantOrder->addRelatedObject($invoice);\n $payment = $this->merchantOrder->getPayment();\n $payment->setCreatedInvoice($invoice);\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n }\n }\n $this->merchantOrder->setState(\n Mage_Sales_Model_Order::STATE_PROCESSING,\n Mage_Sales_Model_Order::STATE_PROCESSING,\n 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' .\n 'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .\n 'via: '. $this->origin,\n true\n );\n $this->merchantOrder->save();\n\n try {\n $this->merchantOrder->sendNewOrderEmail();\n } catch (Exception $exception) {\n // Do nothing\n }\n } catch (Exception $exception) {\n throw new UnknownException($exception->getMessage());\n }\n }", "protected function addCurrentOrderToProcessed() {\n\t\tparent::addCurrentOrderToProcessed();\n\t\t/* {Hook} \"GeteBayOrders_PostOrderImport\": Is called after the eBay order in <code>$order</code> is imported.\n\t\t\tVariables that can be used: Same as for GeteBayOrders_PreOrderImport.\n\t\t*/\n\t\tif (($hp = magnaContribVerify('GeteBayOrders_PostOrderImport', 1)) !== false) {\n\t\t\t// ensure it works like in old get_ebay_orders\n\t\t\t$order = $this->o;\n\t\t\t$mpID = $this->mpID;\n\t\t\t$MagnaDB = $this->db;\n\t\t\trequire($hp);\n\t\t\t$this->o = $order; // can be modified by a contrib\n\t\t}\n\t}", "protected function PostProcessHookOnOrderCreateSuccess()\n {\n TdbShopOrderStep::MarkOrderProcessAsCompleted();\n }", "function processOrder()\n\t{\n\t\t// validate the request\n\t\t$cardID = @$_SESSION['cart_cardID'];\n\t\tif (!$cardID) { headerLocation('/cart.php'); }\n\t\tif (!$_SESSION['cart_qty']) { headerLocation('/cart.php'); }\n\t\t$total = $_SESSION['cart_total'];\n\n\t\t// process the payment\n\t\t// charge the selected credit card\n\t\t$cc = new credit_card($pg);\n\t\t$cc->setCards($cardID);\n\t\t$card_info = $cc->getCards($cardID);\n\n\t\t$payment_data = array(\n\t\t\t'first_name' => $card_info['crc_fname'],\n\t\t\t'last_name' => $card_info['crc_lname'],\n\t\t\t'company' => $card_info['crc_companyname'],\n\t\t\t'address' => $card_info['crc_address'],\n\t\t\t'city' => $card_info['crc_city'],\n\t\t\t'state' => $card_info['crc_state'],\n\t\t\t'zip' => $card_info['crc_zip'],\n\t\t\t'phone' => $card_info['crc_phone'],\n\t\t\t'card_number' => $card_info['crc_number'],\n\t\t\t'card_expiration_date' => str_pad($card_info['crc_expmonth'],2,'0',STR_PAD_LEFT) . '-' . $card_info['crc_expyear'],\n\t\t\t'customerID' => $_SESSION['store_customerID'],\n\t\t\t'customer_ip' => $_SERVER['REMOTE_ADDR'],\n\t\t\t'customer_email' => $_SESSION['userinfo']['cus_email'],\n\t\t\t'store_email' => 'scott@payforstay.com',\n\t\t\t'description' => 'Online Payment - FunUnlimitedOnline.com Order',\n\t\t\t'amount' => $_SESSION['cart_total'],\n\t\t\t'cardID' => $cardID\n\t\t);\n\n\t\t$pay = new payment($pg);\n\t\t$pay->setData($payment_data);\n\t\t$pay->submitPayment();\n\n\t\tif ($pay->paymentSuccess())\n\t\t{\n\t\t\t// get the items\n\t\t\t$this->setCartItems();\n\t\t\t$items = $this->getCartItems();\n\n\t\t\t/*\n\t\t\t?><div align=\"left\"><pre><?php print_r($items); ?></pre></div><?php\n\t\t\tdie();\n\t\t\t*/\n\n\t\t\treturn YES;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlist($code,$text) = $pay->getError();\n\t\t\t$text = str_replace('. ','.<br />',$text) . \" ($code)\";\n\t\t\t$_SESSION['payment_error'] = $text;\n\n\t\t\treturn NO;\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the help action word.
function GetHelpAction() { return "Help"; }
[ "function bm_help($action) {\r\n if (array_key_exists('bookmarklet', $action) && array_key_exists('help', $action['bookmarklet']))\r\n return $action['bookmarklet']['help'];\r\n return ucfirst(str_replace('$NAME', 'someone', $action['help'])).'.';\r\n}", "protected function getAction(): string\n\t{\n\t\treturn $this->getActionInput() ?: $this->getDefaultAction($this->getNameInput());\n\t}", "public static function getAction()\n {\n return static::$actionTemplate;\n }", "public function getActionName() {\n\n\t\treturn $this->_action;\n\t}", "public function getHelpButton() {\n return $this->_helpbutton;\n }", "public function getAction_name()\n {\n return $this->action_name;\n }", "public function getAction()\n\t{\n\t\treturn $this->action == '' ? $this->defaultAction : $this->action;\n\t}", "public function getActionName()\r\n {\r\n return $this->action;\r\n }", "public function getHelpString(): string;", "public function getActionName()\n {\n return $this->__get(\"action_name\");\n }", "function get_help_text() {\r\n\t\treturn $this->help_text;\r\n\t}", "function get_action()\n {\n return $this->get_parameter(self :: PARAM_ACTION);\n }", "private static function getActionName()\n\t{\n\t\t$action = Route::currentRouteAction();\n\n\t\treturn substr($action, strpos($action, '@') +1);\n\t}", "public function getHelp(){ return $this->_HELP;}", "function getHelpButton(){\n return $this->_helpbutton;\n }", "public static function &GetHelpCommand()\n {\n return self::$help_command;\n }", "static public function getHelp() {\n $all_actions = array();\n drush_print('Commands');\n drush_print('--------');\n foreach (static::$actionMapping as $name => $actions) {\n drush_print(wordwrap(dt('@name runs the actions: @actions', array(\n '@name' => $name,\n '@actions' => implode(', ', $actions),\n ))));\n drush_print();\n\n $all_actions = array_merge($all_actions, $actions);\n }\n $all_actions = array_unique($all_actions);\n sort($all_actions);\n\n drush_print('Actions');\n drush_print('-------');\n foreach ($all_actions as $class_name) {\n drush_print($class_name . ':');\n $class_name = '\\\\Deployotron\\\\Actions\\\\' . $class_name;\n $action = new $class_name('@self');\n drush_print($action->getHelp());\n drush_print();\n\n // Print options.\n $options = $action->getOptions();\n if ($options) {\n drush_print_table(drush_format_help_section($options, 'options'));\n drush_print();\n }\n drush_print();\n }\n\n }", "public function getHelpText() {\n\t\treturn $this->helpText;\n\t}", "public function getActionname()\r\n {\r\n return $this->actionname;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the annotation for relation
protected function getAnnotation() { if (null == $this->annotation) { $this->annotation = new \Slick\Orm\Annotations\HasAndBelongsToMany( 'HasAndBelongsToMany', [ Tag::class => true, ] ); } return $this->annotation; }
[ "public function get_annotation()\n {\n return $this->annotation;\n }", "public function getAnnotationLink()\n {\n return $this->getLink(self::ANNOTATION_LINK_REL);\n }", "public function getAnnotationField();", "function getAnnotation($annotation, $attribute = NULL);", "public function getAnnotation($name);", "public function getAnnotationId()\n {\n return $this->annotationId;\n }", "public function getAnnotationSource()\n {\n return $this->annotation_source;\n }", "abstract public function getAnnotationAdapter();", "public function getRelation()\n {\n return $this->attributes[0]->getRelation();\n }", "private function getAnnotation() {\n\n\t\t$valid = $this->stream->moveTo(AnnotationLexer::T_IDENTIFIER);\n\t\tif (!$valid) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$name = $this->getName();\n\t\tif ($this->stream->isNext(AnnotationLexer::T_OPEN_PARENTHESIS)) {\n\t\t\t$params = $this->getParams();\n\t\t} else {\n\t\t\t$params = array();\n\t\t}\n\n\t\treturn $this->getAnnotationInstance($name, $params);\n\t}", "public function getRelationship();", "public function getAnnotationName()\n {\n return $this->annotationName;\n }", "public function getRelation()\n {\n return $this->relation;\n }", "public function annotationViewed() {\n \treturn $this->belongsToMany('oval\\Annotation', 'annotation_viewed_by');\n }", "public function getRelationship()\n {\n return $this->relationship;\n }", "public function getMapping()\n {\n return $this->association;\n }", "public function getAnnotations() {\n return $this->properties['annotations'];\n }", "public function getAnnotationText(): string\n {\n return $this->annotationText;\n }", "public function getAnnotations();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the cosine of the specified angle.
public function cos($angle) { return ( (float) cos($angle) ); }
[ "public function cos($angle)\n {\n return $this->expressionEngine->cos($angle);\n }", "public function cos($angle)\n {\n return $this->runExpressionFunction('cos', $angle);\n }", "public function cos($angle)\n\t{\n\t\treturn ( (float) $this->executionEngine->cos($angle) );\n\t}", "function cos($angle)\n{\n\treturn 0.0;\n}", "function My_cos($Angle1){\n\treturn cos(deg2rad($Angle1));}", "public static function ArcCos($arg)\n {\n return Predict::pio2 - self::ArcSin($arg);\n }", "public function cos();", "public static function funcCsc($angle)\n {\n try {\n $angle = Helpers::validateNumericNullBool($angle);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n return Helpers::verySmallDenominator(1.0, sin($angle));\n }", "public static function funcCot($angle)\n {\n try {\n $angle = Helpers::validateNumericNullBool($angle);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n return Helpers::verySmallDenominator(cos($angle), sin($angle));\n }", "public static function COTH($angle)\n {\n return MathTrig\\Trig\\Cotangent::coth($angle);\n }", "private function ArcCos($arg) {\r\n\r\n\t\treturn (Globals::pio2 - $this -> ArcSin($arg));\r\n\t}", "public function cos()\n {\n $e = new Complex(M_E, 0);\n $i = new Complex(0, 1);\n $negativeI = new Complex(0, -1);\n $numerator = $e->complexPow($i->multiply($this))->add($e->complexPow($negativeI->multiply($this)));\n return $numerator->divide(new Complex(2, 0));\n }", "public static function CSC($angle)\n {\n return MathTrig\\Trig\\Cosecant::csc($angle);\n }", "function cos($number) {}", "public static function csch($angle)\n {\n try {\n $angle = Helpers::validateNumericNullBool($angle);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n return Helpers::verySmallDenominator(1.0, sinh($angle));\n }", "public static function CSCH($angle)\n {\n return MathTrig\\Trig\\Cosecant::csch($angle);\n }", "public function cos() : self\n {\n return $this->map('cos');\n }", "public function cos()\n\t{\n\t\tif ($this->_imaginaryPart == 0.0) {\n\t\t\treturn new Complex(\n\t\t\t\tcos($this->_realPart),\n\t\t\t\t0.0,\n\t\t\t\t$this->_suffix\n\t\t\t);\n\t\t} else {\n\t\t\t$complex = new Complex(\n\t\t\t\tcos($this->_realPart) * cosh($this->_imaginaryPart),\n\t\t\t\tsin($this->_realPart) * sinh($this->_imaginaryPart),\n\t\t\t\t$this->_suffix\n\t\t\t);\n\t\t\treturn $complex->conjugate();\n\t\t}\n\t}", "function cos ($arg) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Serialize a message as a string.
public static function serializeMessage($message) { return json_encode($message); }
[ "public function serialize(Message $message);", "public function toString() : string\n {\n return $this->message->toString();\n }", "public function __toString() {\n return $this->message;\n }", "public function testMessageStringRepresentation()\n {\n $conn = new Connection();\n\n $msg = new Message('subject', 'body', 'sid', $conn);\n\n $this->assertEquals('body', $msg->__toString());\n }", "function print_message(Message $message)\n{\n return json_encode(\n json_decode($message->serializeToJsonString(), true),\n JSON_PRETTY_PRINT\n );\n}", "public static function pack(Message $message): string\n {\n $flags = $message->getFlags();\n $payload = '';\n if ($message->getPayload()) {\n $payload = json_encode($message->getPayload());\n }\n $size = strlen($payload);\n $body = pack('CPJ', $flags, $size, $size);\n\n if (!($flags & Message::PAYLOAD_NONE)) {\n $body .= $payload;\n }\n return $body;\n }", "public function toMessage()\n {\n return new Message($this->toJsonString());\n }", "public function getMessageJson(): string {\n return json_encode([\n 'type' => $this->getType(),\n $this->getKey() => $this->getId(),\n ]);\n }", "public function getMessageParamsAsJson() : String\n\t\t{\n\t\t\treturn json_encode($this->messageParams);\n\t\t}", "public function serialize ()\n {\n return serialize (array\n (\n $this -> m_sCommand,\n $this -> m_mCode,\n $this -> m_sPermission,\n $this -> m_aNetworks,\n $this -> m_aChannels,\n $this -> m_aStatistics\n ));\n }", "public function serialize($data): string;", "public function serialize() {}", "public function serialize();", "public function serialize ()\n\t{ return \\serialize($this->_payload); }", "public function testShouldEncodeMessageToJSON()\n {\n $headers = ['header-key' => 'header-value'];\n $payload = ['payload-key' => 'payload-value'];\n\n $msg = new Message(\n Message::JSON,\n \"channel\",\n $headers,\n $payload\n );\n\n $expectedEncoding = \"json channel\\nheader-key: header-value\\n\\n{\\\"payload-key\\\":\\\"payload-value\\\"}\";\n\n $this->assertEquals($expectedEncoding, $msg->encode());\n }", "static public function encode(Protobuf\\Message $message)\n {\n $codec = self::getCodec();\n return $codec->encode($message);\n }", "public function serializeJob(QueueJob $job): string;", "public function __toString()\n {\n $string = self::SIG_NAME . ': ' . $this->_name . PHP_EOL;\n $string .= self::SIG_REMOTE . ': ' . $this->_remote . PHP_EOL;\n $string .= self::SIG_PHPID . ': '. $this->_phpId . PHP_EOL;\n $string .= self::SIG_PARAMS . ': ' . PHP_EOL;\n foreach ( new RecursiveIteratorIterator( new RecursiveArrayIterator( $this->_params ) ) as $key => $value ) {\n $string .= \"\\t\" . $key . ': ' . $value . PHP_EOL;\n }\n return $string;\n }", "public function testEncodeMessage(): void\n {\n $serializer = new CommerceToolsSerializer();\n\n $order = new OrderCreatedMessage();\n $order->setId('FOOBAR');\n\n $envelope = new Envelope($order);\n $encodedEnvelope = $serializer->encode($envelope);\n\n static::assertEquals([\n 'X-CommerceTools-Message' => OrderCreatedMessage::class\n ], $encodedEnvelope['headers']);\n static::assertEquals(json_encode($order), $encodedEnvelope['body']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attach the given page(s) to the model.
public function setPagesAttribute($pages): void { static::saved(function (self $model) use ($pages) { $model->syncPages($pages); }); }
[ "public function addPages($pages);", "abstract public function addPage(Page $page);", "private function savePages()\n\t{\n\t\tif ( $this->validates() ){\n\t\t\t$this->data['new_pages'] = $this->factory->createChildPosts($this->data);\n\t\t\t$this->setResponse();\n\t\t\treturn;\n\t\t}\n\t\t$this->sendErrorResponse();\n\t}", "public static function attachWpPagesToScraperPages($pages) {\n foreach ($pages as $page) {\n if (isset($page->wpPostId) && isset($page->wpPost)) {\n continue;\n }\n\n $foundPost = Page::getByMeta([\n 'reddot_import' => 1,\n 'reddot_url' => $page->relativeUrl,\n ]);\n\n if ($foundPost) {\n $page->setWpPost($foundPost);\n }\n }\n }", "public function add($page) {\n\n if(is_a($page, 'Collection')) {\n foreach($page as $object) $this->add($object);\n } else if(is_string($page) and $object = page($page)) {\n $this->data[$object->id()] = $object;\n } else if(is_a($page, 'Page')) {\n $this->data[$page->id()] = $page;\n }\n\n return $this;\n\n }", "public function saving(Pages $Pages)\n {\n //code...\n }", "private function update_pages() {\n // loop through loaded data\n if ( is_array( $this->data ) ) {\n foreach ( $this->data as $guid => $items ) {\n $polyLangs = array();\n foreach ( $items as $item ) {\n $args = array();\n\n // Langversion found, add existing page specific args\n if (isset($this->queried[$guid][$item['lang']])) {\n $page = $this->queried[$guid][$item['lang']];\n\n $args['ID'] = $page->ID;\n $args['menu_order'] = $page->menu_order;\n $args['post_name'] = wp_unique_post_slug( sanitize_title( $item['title'] ), $page->ID, 'publish', 'page', $parent_id );\n\n } else {\n $args['post_name'] = wp_unique_post_slug( sanitize_title( $item['title'] ), $post_id, 'publish', 'page', $parent_id );\n }\n\n // has a parent\n if ( isset( $item['parent'] ) ) {\n $parent_guid = $item['parent'];\n $parent_id = $this->queried[$parent_guid][$item['lang']]->ID;\n } else {\n $parent_id = 0;\n }\n\n // Default values for page creation/updation\n $args['post_status'] = 'publish';\n $args['post_type'] = 'page';\n $args['post_title'] = $item['title'];\n $args['post_parent'] = $parent_id;\n $args['post_content'] = isset($item['content']) ? $item['content'] : '';\n $args['page_template'] = 'models/page-' . $item['type'] . '.php';\n\n // Create the post\n $post_id = wp_insert_post( $args );\n\n $this->update_page_meta( $post_id, $guid, $item );\n if (in_array(strtolower($item['lang']), $this->site_languages)) {\n if (function_exists('pll_set_post_language')) {\n pll_set_post_language($post_id, strtolower($item['lang']));\n }\n $polyLangs[strtolower($item['lang'])] = $post_id;\n }\n\n isset($args['ID']) ? $this->updated++ : $this->created++;\n }\n }\n // Link program page different languages for polylang\n if (!empty($polyLangs)) {\n if (function_exists('pll_save_post_translations')) {\n pll_save_post_translations($polyLangs);\n }\n }\n }\n }", "public function afterSavePagesModelsPages($event)\r\n {\r\n $model = $event->getArgument('model');\r\n \r\n if ($model->{'shop.products'})\r\n {\r\n \\Shop\\Models\\Products::collection()->update(array(\r\n '_id' => array(\r\n '$nin' => $model->{'shop.products'}\r\n ),\r\n 'pages.related' => new \\MongoId((string) $model->id)\r\n ), array(\r\n '$pull' => array(\r\n 'pages.related' => new \\MongoId((string) $model->id)\r\n )\r\n ), array(\r\n 'multiple' => true\r\n ));\r\n \r\n \\Shop\\Models\\Products::collection()->update(array(\r\n '_id' => array(\r\n '$in' => $model->{'shop.products'}\r\n )\r\n ), array(\r\n '$addToSet' => array(\r\n 'pages.related' => new \\MongoId((string) $model->id)\r\n )\r\n ), array(\r\n 'multiple' => true\r\n ));\r\n }\r\n \r\n $event->setArgument('model', $model);\r\n }", "function insertPage($page){}", "public function save_pages ( $pages ) {\n\t\tforeach ( $pages as $page ) {\n\t\t\tif ( isset($page[\"id\"]) && $this->exists(\"statistic_pages\", array(\n\t\t\t\t\"id\" => $page[\"id\"]\n\t\t\t)) ) {\n\t\t\t\t$this->db->where(array(\n\t\t\t\t\t\"id\" => $page[\"id\"]\n\t\t\t\t));\n\t\t\t\t$this->db->update(\"statistic_pages\",array(\n\t\t\t\t\t\"name\" => ( isset($page[\"name\"]) ) ? $page[\"name\"] : \"\",\n\t\t\t\t\t\"login\" => ( isset($page[\"login\"]) ) ? $page[\"login\"] : \"\",\n\t\t\t\t\t\"embed\" => ( isset($page[\"embed\"]) ) ? $page[\"embed\"] : \"\",\n\t\t\t\t\t\"exact_match\" => ( isset($page[\"exact_match\"]) ) ? $page[\"exact_match\"] : false,\n\t\t\t\t));\n\t\t\t\t$this->save_strings($page[\"strings\"], $page[\"id\"]);\n\t\t\t\t$this->save_urls($page[\"urls\"], $page[\"id\"]);\n\t\t\t} else {\n\t\t\t\t$id = $this->insert(\"statistic_pages\",array(\n\t\t\t\t\t\"name\" => ( isset($page[\"name\"]) ) ? $page[\"name\"] : \"\",\n\t\t\t\t\t\"login\" => ( isset($page[\"login\"]) ) ? $page[\"login\"] : \"\",\n\t\t\t\t\t\"embed\" => ( isset($page[\"embed\"]) ) ? $page[\"embed\"] : \"\",\n\t\t\t\t\t\"exact_match\" => ( isset($page[\"exact_match\"]) ) ? $page[\"exact_match\"] : false,\n\t\t\t\t));\n\t\t\t\t$this->save_strings($page[\"strings\"], $id);\n\t\t\t\t$this->save_urls($page[\"urls\"], $id);\n\t\t\t}\n\t\t}\n\t}", "public function savePage(Page $page);", "public function addPage() {\n $this->_documentXMLFINAL .= $this->_documentXML;\n $this->_documentXML = $this->_documentXMLSEQ;\n }", "public function setPages(iterable $pages): void;", "private function syncCreatedPagesWithPageAlgoliaObjectIDHolders($pages) {\n foreach($pages as $key => $page) {\n $pageAlgoliaObjectHolder = PageAlgoliaObjectIDHolder::create();\n $pageAlgoliaObjectHolder->AlgoliaObjectID = $page->ID;\n $pageAlgoliaObjectHolder->write();\n }\n }", "public function setPageUuids($uuids)\n {\n $this->uuids['pages'] = $uuids;\n }", "final public function setPages(iterable $pages): void\n {\n $this->removePages();\n $this->addPages($pages);\n }", "function addPage(){}", "public function addPage(Page $page)\n {\n return $this->pages()->save($page);\n }", "public function savePages()\n\t\t{\n\t\t\t$page_slug = thb_input_get( 'page' );\n\n\t\t\tif( $_SERVER['REQUEST_METHOD'] !== 'POST' || $page_slug === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$page = $this->getPage( $page_slug );\n\n\t\t\tif( $page ) {\n\t\t\t\t$page->save();\n\t\t\t\t$this->redirectToThemePage( $page_slug );\n\t\t\t}\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$process = new Process(['node C:/xampp/htdocs/fms/printtopdf.js
public function test() { $process = Process::fromShellCommandline('node print-to-pdf.js'); $process->setTimeout(30); $process->setOptions(['create_new_console' => true]); $process->setWorkingDirectory('C:/xampp/htdocs/fms'); try { $process->mustRun(); echo $process->getOutput(); } catch (ProcessFailedException $exception) { echo $exception->getMessage(); } }
[ "function createPDF()\n{\n $pdf= 'Schedule.pdf';\n $pdfPath = '/srv/http/StateFair/Export/pdf/' . $pdf;\n // $output = shell_exec('/srv/http/StateFair/Export/pdf/./wkhtmltopdf /srv/http/StateFair/Export/pdf/Schedule.html ' . $pdfPath);\n $output = shell_exec('wkhtmltopdf /srv/http/StateFair/Export/pdf/Schedule.html ' . $pdfPath);\n return $pdf;\n}", "function pdf(){\n $mpdf = new \\Mpdf\\Mpdf();\n $mpdf->WriteHTML('<h1>Hello world!</h1>');\n // $mpdf->Output();\n $mpdf->Output('files/filename.pdf', \\Mpdf\\Output\\Destination::FILE);\n //$mpdf->Output('filename.pdf', \\Mpdf\\Output\\Destination::DOWNLOAD);\n }", "public function phantom()\n {\n $this->taskExec(' /usr/local/bin/phantomjs --webdriver=8643')\n ->run();\n }", "public static function startPhantomJS()\n {\n static::$phantomProcess = new Process('phantomjs --webdriver=127.0.0.1:9515');\n static::$phantomProcess->start();\n sleep(2);\n static::afterClass(function () {\n static::stopPhantomJS();\n });\n }", "public function actGeneratepdf(){\n $lTemplate = $this -> getVal(\"template\");\n\t\n $lChili = new CApi_Chili_Client($this -> mJobId);\n $lRet = $lChili -> generatePdf($lTemplate);\n \n echo Zend_Json::encode($lRet);\n }", "protected function generate_pdf()\n\t{\n\t\t$resource = ObjectPool_Model::pool('hosts')->all()->mayi_resource();\n\t\t$this->_clear_print_notification();\n\t\t$this->_verify_access($resource.':read.report.'.$this->type.'.pdf');\n\t\t$this->template->base_href = 'https://localhost'.url::base();\n\n\t\t# not using exec, so STDERR (used for status info) will be loggable\n\t\t$pipe_desc = array(\n\t\t\t0 => array('pipe', 'r'),\n\t\t\t1 => array('pipe', 'w'),\n\t\t\t2 => array('pipe', 'w'));\n\t\t$pipes = false;\n\n\t\t$command = Kohana::config('reports.pdf_command');\n\t\t$brand = brand::get('http://localhost', false);\n\t\t$command .= ' --replace brand \"' . $brand . '\"';\n\t\t$command .= ' - -';\n\n\t\t$this->log->log('debug', \"Running pdf generation command '$command'\");\n\t\t$process = proc_open($command, $pipe_desc, $pipes, DOCROOT);\n\n\t\tif (is_resource($process)) {\n\t\t\t// Render and store output\n\t\t\t$content = $this->template->render();\n\t\t\t$this->log->log('debug', \"HTML: $content\");\n\t\t\t$this->auto_render = false;\n\n\t\t\t$filename = $this->type;\n\t\t\tif ($this->options['schedule_id']) {\n\t\t\t\t$schedule_info = Scheduled_reports_Model::get_scheduled_data($this->options['schedule_id']);\n\t\t\t\tif ($schedule_info)\n\t\t\t\t\t$filename = $schedule_info['filename'];\n\t\t\t}\n\t\t\t$months = date::abbr_month_names();\n\t\t\t$month = $months[date('m')-1]; // January is [0]\n\t\t\t$filename = preg_replace(\"~\\.pdf$~\", null, $filename).\"_\".date(\"Y_\").$month.date(\"_d\").'.pdf';\n\n\t\t\tfwrite($pipes[0], $content);\n\t\t\tfclose($pipes[0]);\n\n\t\t\t$out = stream_get_contents($pipes[1]);\n\t\t\t$err = stream_get_contents($pipes[2]);\n\t\t\tif (trim($out)) {\n\t\t\t\theader(\"Content-disposition: attachment; filename=$filename\");\n\t\t\t\theader('Content-Type: application/pdf');\n\t\t\t\theader(\"Pragma: public\");\n\t\t\t\theader(\"Expires: 0\");\n\t\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\t\theader(\"Cache-Control: private\", false);\n\t\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\t\techo $out;\n\t\t\t} else {\n\t\t\t\t$this->log->log('error', \"Pdf command \" . $command . \"resulted in no output. stderr:\");\n\t\t\t\t$this->log->log('error', $err);\n\t\t\t}\n\t\t\tfclose($pipes[1]);\n\t\t\tfclose($pipes[2]);\n\t\t\t$return_value = proc_close($process);\n\t\t\tif ($return_value != 0) {\n\t\t\t\t$this->log->log('debug', \"Pdf command \" . $command . \" returned $return_value:\");\n\t\t\t\t$this->log->log('debug', \"stderr: $err\");\n\t\t\t}\n\t\t} else {\n\t\t\t$this->log->log('error', \"Tried running the following command but was unsuccessful:\");\n\t\t\t$this->log->log('error', $command);\n\t\t}\n\t}", "public function GenerateHTML2PDF(){\n\n echo 'GenerateHTML2PDF';\n\n }", "function print_pdf(string $view, array $data)\n{\n $mpdf = make_pdf($view, $data);\n $mpdf->Output();\n}", "public function startPdf($response);", "public function pdf($pdf);", "function generate_pdf($url, $options = [])\n{\n die('generate_pdf() doesnt work in preview or edit mode');\n}", "protected function formatPdf($response)\n\t{\n\n\t\t// #TODO: Implement BeforeRender Functionality\n\n\t\t$tmpfile_name = uniqid();\n\t\tif($this->build_path == \"\"){\n\t\t\t$this->build_path = getcwd().\"/\";\n\t\t}\n\n\t\t$tmpfile_path = $this->build_path.$tmpfile_name;\n\t\t$logfile_path = $this->build_path.$tmpfile_name.\".log\";\n\t\t$auxfile_path = $this->build_path.$tmpfile_name.\".aux\";\n\t\t$pdffile_path = $this->build_path.$tmpfile_name.\".pdf\";\n\n\t\t// Write temp file\n\t\t$fp = fopen($tmpfile_path, 'w+');\n\t\tfwrite($fp, $response->data);\n\t\tfclose($fp);\n\n\t\t// Start Process\n\t\t$process = new Process(\n\t\t\t[\n\t\t\t\t$this->latexbin,\n\t\t\t\t'-interaction=nonstopmode',\n\t\t\t\t$tmpfile_path,\n\t\t\t\t'-output-directory=$build_path'\n\t\t\t]\n\t\t);\n\n\t\t$process->setTimeout($this->timeout);\n\t\t$process->setIdleTimeout($this->idletimeout);\n\t\t$process->run();\n\n\t\tif (!$process->isSuccessful()) {\n\t\t\tunlink($logfile_path);\n\t\t\tunlink($auxfile_path);\n\t\t\tunlink($tmpfile_path);\n \tthrow new ProcessFailedException($process);\n\t\t}else{\n\t\t\tunlink($logfile_path);\n\t\t\tunlink($auxfile_path);\n\t\t\tunlink($tmpfile_path);\n\t\t\tif(file_exists($pdffile_path)){\n\t\t\t\t$pdf = file_get_contents($pdffile_path);\n\t\t\t\tunlink($pdffile_path);\n\t\t\t\treturn $pdf;\n\t\t\t}\n\t\t}\n\t}", "public function testRunProcess()\n {\n }", "public function generateReportTes()\n {\n\n // Compile a JRXML to Jasper\n JasperPHP::compile(base_path('/vendor/cossou/jasperphp/examples/inspection.jrxml'))->execute();\n$output = base_path('/report/Test');\n // Process a Jasper file to PDF and RTF (you can use directly the .jrxml)\n JasperPHP::process(base_path('/vendor/cossou/jasperphp/examples/inspection.jasper'),\n 'C:\\Users\\suresh\\Desktop',\n array(\"pdf\", \"rtf\"),\n array(\"propid\" => \"7.1\") )->execute();\n\n\n // return view('welcome');\n\n }", "public function downloadPDF()\n {\n $html_content='<h1>Hello</h1>';\n PDF::SetTitle('Sample PDF');\n PDF::AddPage();\n PDF::writeHTML($html_content,true,false,true,false,'');\n PDF::Output(public_path(uniqid().'_SamplePDF.pdf'),'D');\n }", "function pdf_create($bhtml, $filename)\r\n {\r\n \r\n $bhtml = utf8_decode($bhtml);\r\n \r\n $page = $filename;\r\n\r\n $html = $bhtml;\r\n\r\n $mytemp = dirname(FCPATH) . \"/tmp/f\" .time(). \"-\" . mt_rand(111,999) . \".html\";\r\n \r\n $article_f = fopen($mytemp,'w+');\r\n fwrite($article_f,$html);\r\n fclose($article_f);\r\n putenv(\"HTMLDOC_NOCGI=1\");\r\n \r\n # Write the content type to the client...\r\n header(\"Content-Type: application/pdf\");\r\n header(sprintf('Content-Disposition: attachment; filename=\"%s.pdf\"', $page));\r\n flush();\r\n\r\n # if the page is on a HTTPS server and contains images that are on the HTTPS server AND also reachable with HTTP\r\n # uncomment the next line\r\n \r\n #system(\"perl -pi -e 's/img src=\\\"https:\\/\\//img src=\\\"http:\\/\\//g' '$mytemp'\");\r\n\r\n # Run HTMLDOC to provide the PDF file to the user...\r\n passthru(\"htmldoc -t pdf14 --charset iso-8859-1 --color --quiet --jpeg --webpage '$mytemp'\");\r\n \r\n //unlink ($mytemp);\r\n\r\n/*sample\r\nfunction outputpdf()\r\n{\r\n $this->load->plugin('to_htmldoc'); //or autoload\r\n $html = $this->load->view('viewfile', $data, true);\r\n $filename = 'pdf_output';\r\n pdf_create($html, $filename);\r\n}\r\n\r\n*/\r\n}", "public function Reporte()\n {\n $jasper = new JasperPHP;\n \n $jasper->process(\n // Ruta y nombre de archivo de entrada del reporte\n $output = base_path() . '/vendor/cossou/jasperphp/examples/hello_world', \n false, // Ruta y nombre de archivo de salida del reporte (sin extensión)\n array('pdf', 'rtf'), // Formatos de salida del reporte\n array('php_version' => phpversion()), // Parámetros del reporte\n array(\n 'driver' => 'mysql',\n 'username' => 'root',\n 'password' => '',\n 'host' => '127.0.0.1',\n 'database' => 'dbcreditos',\n 'port' => '3306',\n 'jdbc_dir' => base_path(). '/vendor/geekcom/phpjasper/bin/jasperstarter/jdbc'\n )\n )->execute(); \n $file = $output . '.pdf';\n $path = $file;\n Log::info('directorio pdf'. public_path());\n // caso o arquivo não tenha sido gerado retorno um erro 404\n if (!file_exists($file)) {\n abort(404);\n } //caso tenha sido gerado pego o conteudo\n\n $file = file_get_contents($file); //deleto o arquivo gerado, pois iremos mandar o conteudo para o navegador\n unlink($path); // retornamos o conteudo para o navegador que íra abrir o PDF\n return response($file, 200)\n ->header('Content-Type', 'application/pdf')\n ->header('Content-Disposition', 'inline; filename=\"Archivo.pdf\"');\n\n\n }", "private function startWebServerProcess() {\n $descriptors = array();\n $pipes = array();\n\n // bypass_shell is true, so that process can be terminated, and is not \"embedded\" in cmd.exe process\n $this->process = proc_open(\n $this->pathToPhpExecutable.' -S 127.0.0.1:'.$this->port.' -t \"'.$this->documentRoot.'\" '.$this->routerScript,\n $descriptors,\n $pipes,\n null,\n null,\n array('bypass_shell' => true)\n );\n }", "public function prueba()\n {\n $process = new Process(['python3','/resources/views/PythonScript/test.py']);\n $process->run();\n\n if (!$process->isSuccessful()) {\n throw new ProcessFailedException($process);\n }\n\n $data = $process->getOutput();\n\n dd($data);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disallow username as a part of the password. Generated from protobuf field .google.protobuf.BoolValue disallow_username_substring = 4;
public function setDisallowUsernameSubstring($var) { GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); $this->disallow_username_substring = $var; return $this; }
[ "public function getDisallowUsernameSubstring()\n {\n return $this->disallow_username_substring;\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "function passwordDisallowed($password) {\n $platitude = true;\n for ($i = 1; $i < strlen($password); ++$i) {\n if ($password[$i] !== $password[0])\n $platitude = false;\n }\n if ($platitude)\n return true;\n\n // disallow certain patterns\n $disallowList = array(\n \"123456\", \"password\", \"qwerty\"\n );\n foreach ($disallowList as $test)\n if ($test === $password)\n return true;\n\n return false;\n}", "function has_valid_username_characters($value) {\n if(preg_match('/[^A-Za-z0-9_]/', $value) === 1) {\n return false;\n }\n else {\n return true;\n }\n }", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "function validate_username($username){\n if(strpos($username, \" \")!== false ){ return \"username/password format error.<br>\"; }\n else if(strlen($username) < 6){ return \"username/password format error.<br>\"; }\n else if(preg_match (\"/[^a-zA-Z0-9_-]/\", $username)){ return \"username/password format error.<br>\";}\n return \"\";\n }", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "function validateUsername($mUsername){\n if(strlen($mUsername) < 4){\n return false;\n }\n else{\n return true;\n }\n }", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "function is_valid_username($username) \n{\n return !((preg_match('/[^a-zA-Z0-9_]/', $username)) || (preg_match('/_{2}/', $username)));\n}", "function VerifyUsername($username_to_verify, $minimal_username_length){\n if(preg_match('/^[a-zA-Z0-9_-]+/', $username_to_verify) && strlen($username_to_verify) > $minimal_username_length){\n return TRUE;\n }\n else{\n return FALSE;\n }\n }", "public function hasValidUsername(){\n return ((strlen($this->getUsername()) > 3) && (strlen($this->getUsername()) < 21));\n }", "public function getMinUsernameLength();", "public function isValidUsername()\n {\n }", "function validPassword($password) {\r\n $uppercase = preg_match('@[A-Z]@', $password);\r\n $lowercase = preg_match('@[a-z]@', $password);\r\n $number = preg_match('@[0-9]@', $password);\r\n $specialChars = preg_match('@[^\\w]@', $password);\r\n\r\n if(!$specialChars || !$uppercase || !$lowercase || !$number || strlen($password) < 5) {\r\n return false;\r\n }\r\n return true;\r\n}", "public function is_user_name($value){\r\n if(!preg_match('/^[a-zA-Z\\d_.]{2,20}$/', $value) && $value != ''){\r\n $this->add_message('User names can only contain letters, numbers, underscores, and periods as well as being between 2-20 characters in length.');\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "public function authenticationWithValidAlphaCharClassPasswordAndFixedHash() {}", "function validUsername($username){\r\n if (!ctype_alnum($username) or strlen($username) < 5){\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function testPass($password): bool\n{\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || strlen($password) < 8) {\n return false;\n }\n else return true;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the form for creating a new DetailStockOut.
public function create() { return view('detail_stock_outs.create'); }
[ "public function create()\n {\n return view('detail_stock_ins.create');\n }", "public function actionCreate()\n {\n $model = new ProductStockClosing();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'UNIX_BULAN_ID' => $model->UNIX_BULAN_ID, 'YEAR_AT' => $model->YEAR_AT, 'MONTH_AT' => $model->MONTH_AT]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function newstock()\n\t{\n\t\t$data = array();\n\t\t$data['title'] \t\t\t= $this->title;\n\t\t$data['activemenu'] \t= $this->activemenu;\n\t\t$data['stock_number']\t= $this->generate_stock_number();\n\t\t$data['suppliers'] \t\t= $this->common_model->get_select_option('ci_suppliers', 'supplier_id', 'supplier_name');\n\t\t$data['pagecontent'] \t= 'stocks/newstock';\n\t\t$this->load->view('common/holder', $data);\n\t}", "public function actionCreate(){\n $model = new StockForm([\n 'stock' => new StockModel()\n ]);\n\n if($model->loadData(Yii::$app->request->post()) && $model->save()){\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Stock();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_stock]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('stocks.create');\n }", "public function addStockOUT()\n {\n $data = collect(DB::select(\"\n SELECT s.*,a.designation,a.code,a.ref,a.alias,a.couleur,a.sexe,a.image,\n c.libelle as libelle_c, m.libelle as libelle_m, f.libelle as libelle_f\n FROM Stocks s LEFT JOIN articles a on s.id_article=a.id_article\n LEFT JOIN categories c on a.id_categorie=c.id_categorie\n LEFT JOIN fournisseurs f on a.id_fournisseur=f.id_fournisseur\n LEFT JOIN marques m on a.id_marque=m.id_marque\n WHERE s.id_magasin=1 order by a.id_article;\"));\n\n if ($data->isEmpty())\n return redirect()->back()->withAlertWarning(\"Le stock du magasin est vide, veuillez commencer par l'alimenter.\");\n\n $magasin = Magasin::find(1);\n return view('Espace_Magas.add-stockOUT-form')->withData($data)->withMagasin($magasin);\n }", "public function newAction()\n {\n $entity = new Stock();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view('inventory::finance.create');\n }", "public function create()\n {\n return view('stock_products.create');\n }", "public function create()\n {\n return view('stocktypes.create');\n }", "public function fakeDetailStockOut($detailStockOutFields = [])\n {\n return new DetailStockOut($this->fakeDetailStockOutData($detailStockOutFields));\n }", "public function showPurchaseForm() : View\n {\n return view('stock_shares_form');\n \n }", "public function actionCreate()\n {\n $model = new StockLogs();\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 newAction()\n {\n $entity = new Sale();\n $form = $this->createCreateForm($entity);\n\n return $this->render('ZeteqMarketBundle:Sale:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function dashio_add_stock()\r\n {\r\n \t\t$data['title']=$this->Dashio_Store_Model->get_basic_detail();\r\n \t\t$this->load->view('common/header',$data);\r\n \t\tif($handset_result=$this->Dashio_Store_Model->get_handset()) \r\n { \r\n $this->load->view('pages/add_stock',['hr'=>$handset_result]);\r\n\r\n }\r\n else\r\n {\r\n $this->load->view('pages/add_stock');\r\n } \r\n \t\t$this->load->view('common/footer');\r\n \t\t\r\n }", "public function create()\n {\n return view('sales.sales__qoutation_details.create');\n }", "public function actionCreate()\n {\n $model = new CHECKINOUT();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Badgenumber' => $model->Badgenumber, 'CHECKTIME' => $model->CHECKTIME]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function newAction()\n {\n $entity = new Besoin();\n $form = $this->createForm(new BesoinType(), $entity);\n\n return $this->render('EmpruntBundle:Besoin:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get's the current location node of the logged in user.
public static function getCurrentLocationNodeObjectOfUser() { $nid = self::getCurrentLocationObjectOfUser(); $locationModel = \Models\Location::load($nid->nid); return $locationModel->object; }
[ "public function getUserLocation()\n {\n return $this->user_location;\n }", "public function getCurrentLocation();", "public function getCurrentNode()\n {\n $node_name = gethostname();\n return $this->getNode($node_name);\n }", "public function getCurrentLocation() {\n return $this->hasOne(Location::className(), ['id' => 'current_location']);\n }", "public function getUsrLocation ()\n {\n return $this->usr_location;\n }", "public function currentLocation() {\n return $this->currentLocation;\n }", "public function getCurrentSiteNode() {\n\t\tif ($this->currentSite !== NULL && $this->currentSiteNode === NULL) {\n\t\t\t$siteNodePath = '/sites/' . $this->currentSite->getNodeName();\n\t\t\t$this->currentSiteNode = $this->getNode($siteNodePath);\n\t\t\tif (!($this->currentSiteNode instanceof NodeInterface)) {\n\t\t\t\t$this->systemLogger->log(sprintf('Warning: %s::getCurrentSiteNode() couldn\\'t load the site node for path \"%s\" in workspace \"%s\". This is probably due to a missing baseworkspace for the workspace of the current user.', __CLASS__, $siteNodePath, $this->workspaceName), LOG_WARNING);\n\t\t\t}\n\t\t}\n\t\treturn $this->currentSiteNode;\n\t}", "protected function getCurrentNode() {\n if (!isset($this->currentNode)) {\n $this->currentNode = \\Drupal::routeMatch()->getParameter('node');\n }\n return $this->currentNode;\n }", "public static function getCurrentLocation() {\n return Request::session()->get('Location');\n }", "public function getLocation()\n {\n $storage = $this->getStorage();\n\n if ($storage->isEmpty()) {\n return;\n }\n\n return $storage->read();\n }", "public function getUserProfileLocation()\n {\n return $this->user_profile_location;\n }", "public function getLocation() {\n return 'user-manager';\n }", "public function getLocation() {\n\t\treturn $this->getFactory()->Location();\n\t}", "public function getLocation() {\n $sql = \"SELECT tl.logentry, tl.action, le.userid, le.geocacheid \"\n . \"FROM trackablelog tl, logentry le \"\n . \"WHERE tl.trackable = ? \"\n . \"AND (tl.action = 'grab' OR tl.action = 'create' OR tl.action = 'drop') \"\n . \"AND tl.logentry = le.id \"\n . \"ORDER BY le.timestamp desc LIMIT 1;\";\n $logQuery = getDbConnection()->prepare($sql);\n $logQuery->execute(array($this->getId()));\n $logResult = $logQuery->fetchObject();\n //if it's a grab or create log, a user has the trackable\n if ($logResult->action == 'grab' OR $logResult->action == 'create') {\n return User::getUserById($logResult->userid);\n //otherwise it's in a geocache\n } else if ($logResult->action == 'drop') {\n return Geocache::getGeocacheById($logResult->geocacheid);\n }\n }", "public function getCurrentLocationId()\n {\n return $this->current_location_id;\n }", "public function getCurrentUser(){\n global $current_user;\n get_currentuserinfo();\n return $current_user->user_login;\n }", "public function getCurrentUser()\n {\n return $this->currentUser;\n }", "function get_current_or_network_user() {\n return ( $this->_user instanceof FS_User ) ?\n $this->_user :\n $this->get_network_user();\n }", "protected function getUserNode()\n {\n $dn = $this->getUserDn();\n if ($dn !== '') {\n return $this->getLdap()->getNode($dn);\n }\n\n return null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation gETReturnIdAttachments Retrieve the attachments associated to the return
public function gETReturnIdAttachments($return_id) { $this->gETReturnIdAttachmentsWithHttpInfo($return_id); }
[ "public function testGETReturnIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function gETReturnIdAttachmentsAsync($return_id)\n {\n return $this->gETReturnIdAttachmentsAsyncWithHttpInfo($return_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function testGETGiftCardRecipientIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function gETReturnIdAttachmentsAsyncWithHttpInfo($return_id)\n {\n $returnType = '';\n $request = $this->gETReturnIdAttachmentsRequest($return_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function getAttachments()\n {\n return (new CatchZohoCRM($this->token, 'Attachments'))\n ->getRelatedRecords($this->recordType, $this->checkId())->getRecordDetails();\n }", "function get_attachments($id)\n\t{\n\t\t$id = (int)$id;\n\n\t\t$this->db->from('attachments')->where('article_id', $id);\n\n\t\t$query = $this->db->get();\n\n\t\tif ($query->num_rows() == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$data = $query->result_array();\n\n\t\t$i = 0;\n\t\tforeach ($data as $item)\n\t\t{\n\t\t\t$data[$i]['download_path'] = 'uploads/'.$id.'/'.$item['attach_file'];\n\t\t\t$i++;\n\t\t}\n\t\t$query->free_result();\n\n\t\treturn $data;\n\t}", "public function testGETInventoryModelIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testGETShipmentIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getAttachments()\n {\n return isset($this->data['attachments']) ? $this->data['attachments'] : [];\n }", "public function getAttachments()\n {\n return $this->getMedia(\"attachment\");\n }", "public function getAttachmentsList($id)\n {\n $request = RequestEloquent::findOrFail($id);\n\n if ($request) {\n return response()->json(['success' => true, 'data' => ['attachments' => $this->repository->getAttachmentslist($id)]], 200);\n }\n }", "public function get_attachments($attachments)\n {\n for ($i = 0, $count = count($attachments); $i < $count; $i++) \n { \n $attachments[$i]['role'] = $this->role_model->get_role_by_id($attachments[$i]['role_id']); \n }\n return $attachments;\n }", "public function testGETGiftCardIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "protected function _shortcode_get_attachments( $atts ) {\n\t\t$attachments = array();\n\n\t\tif ( ! empty( $atts['include'] ) ) :\n\t\t\t$_attachments = get_posts( array(\n\t\t\t\t'include' => $atts['include'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\t\tforeach ( $_attachments as $key => $val )\n\t\t\t\t$attachments[$val->ID] = $_attachments[$key];\n\n\t\telseif ( ! empty( $atts['exclude'] ) ) :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'exclude' => $atts['exclude'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\telse :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\t\tendif;\n\n\t\treturn $attachments;\n\t}", "public function getAttachments()\n {\n return $this->attachment_list;\n }", "public function testGETMarketIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function mc_project_get_attachments($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t\"(string)(string)(integer)\",\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall(\"mc_project_get_attachments\", $args);\n\t}", "public function getAttachments()\n {\n return (isset($this->_metadata['_attachments']) ? $this->_metadata['_attachments'] : array());\n }", "public function get_attachments($attachments, $get_by_id = FALSE, $attach_details = TRUE)\n {\n if(!$get_by_id)\n {\n for ($i = 0, $count = count($attachments); $i < $count; $i++) \n { \n if($attachments[$i]['entity'] == 'political_party')\n {\n $attachments[$i]['entity_name'] = $this->political_party_model->get_political_party_by_id($attachments[$i]['entity_id'], FALSE, TRUE);\n }\n if($attachments[$i]['entity'] == 'politician')\n {\n $attachments[$i]['entity_name'] = $this->politician_model->get_politician_by_id($attachments[$i]['entity_id'], FALSE,array() , TRUE);\n }\n\n // TRUE is passed\n $attachments[$i]['user_details'] = $this->user_model->get_user_by_id($attachments[$i]['posted_by'], FALSE, array('full_name')); \n }\n }\n else\n {\n $attachments = call_user_func_array('array_merge', $attachments);\n $attachments['user_details'] = $this->user_model->get_user_by_id($attachments['posted_by'], FALSE, array('full_name')); \n // $attachments['posted_time_24hrs'] = $this->format_columned_time();\n }\n return $attachments;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set view storage path.
public function setViewStoragePath($path) { $this->app['view']->setStoragePath($path); return $this; }
[ "public function setStoragePath($path);", "public static function setStoragePath($path)\n\t{\n\t\t$path = rtrim($path, '/\\\\');\n\t\tself::$_storage_path= $path.'/';\n\t}", "public function setViewPath($path)\n {\n $len = strlen($path) - 1;\n if ($path[$len] == '/') {\n $path = substr($path, 0, -1);\n }\n $realpath = realpath($path);;\n $this->_path = $realpath === false ? $path : $realpath;\n }", "public function set_storage( Storage $storage );", "private static final function setStorage () {\n // Check\n if (STORAGE_AS_DOCUMENT_ROOT == TRUE) {\n // Set\n self::$objDocumentStorage =\n Architecture::pathTo\n (self::$objDocumentRoot);\n } else {\n // Set\n self::$objDocumentStorage =\n new S (STORAGE);\n }\n }", "public function setPath($path);", "public static function setStorageRootPath($path)\n\t{\n\t\t$path = rtrim($path, '/\\\\');\n\t\tself::$storage_root_path = $path.'/';\n\t}", "public function setStorage($storage) {\n $this->storage = $storage;\n }", "public function setFullStoragePath()\n {\n return $this->fullStoragePath = $this->getFullStoragePath();\n }", "public function settings_change_storage_location() {\n \n // Send location\n (new MidrubBaseAdminComponentsCollectionSettingsHelpers\\Storage)->settings_change_storage_location();\n \n }", "function setViewCacheFolderPath(string $path): void\n {\n View::setCacheFolderPath($path);\n }", "public function setStorage(QStorage $storage);", "public function setPath($path)\n {\n }", "private function _set_cache_path()\n\t{\n\t\t$path = $this->CI->config->item('cache_path','laravel_views');\n\t\tif (empty($path))\n\t\t{\n\t\t\t$path = $this->CI->config->item('cache_path');\n\n\t\t\tif (empty($path))\n\t\t\t{\n\t\t\t\t$path = APPPATH.'cache';\n\t\t\t}\n\t\t}\n\n\t\t$this->cache_path = $path;\n\t}", "public function setPathToSetting($path);", "public function setStorage($storage)\n {\n $this->storage = $storage;\n }", "public function setStorageLocation($val)\n {\n $this->_propDict[\"storageLocation\"] = $val;\n return $this;\n }", "public function setStorageLocation(?string $value): void {\n $this->getBackingStore()->set('storageLocation', $value);\n }", "public function storagePath()\n {\n return $this->get('path.storage');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tracking Urls for Auth.User
protected function trackingUrls() { if(!auth_check_session()) { return; } $f = date('Y.W', time()); File::append(config('veer.history.path') . '/urls.' . $f . '.txt', \Illuminate\Support\Facades\Auth::id(). '|' . app('url')->current() . '|' . \Illuminate\Support\Facades\Route::currentRouteName() . "\r\n" ); }
[ "public function getUserUrl()\n {\n return $this->user_url;\n }", "public function getUserInfoUrl();", "protected function getUserInfoUrl()\n {\n return $this->baseUrl;\n }", "public function url(\\App\\Models\\User $user)\n {\n return $this->verificationUrl($user);\n }", "public function getAuthUrl();", "public function getUserUrl()\n {\n return get_the_author_meta('user_url', $this->ID);\n }", "public function authUrlProvider() {\n yield ['/subscribed/hot'];\n yield ['/subscribed/new'];\n yield ['/subscribed/hot/1'];\n yield ['/subscribed/new/1'];\n yield ['/moderated/hot'];\n yield ['/moderated/new'];\n yield ['/moderated/hot/1'];\n yield ['/moderated/new/1'];\n yield ['/create_forum'];\n yield ['/f/news/edit'];\n yield ['/f/news/appearance'];\n yield ['/f/news/add_moderator'];\n yield ['/f/news/delete'];\n yield ['/inbox'];\n yield ['/submit'];\n yield ['/submit/news'];\n yield ['/block_list'];\n }", "public function getProfileUrl();", "public function getTrackingURL(): string\n {\n return route('leads.show', [$this]) ?? config('app.url') . \"/leads/{$this->tracking_id}/\";\n }", "public function index()\n {\n if (! Auth::check()) {\n abort(403);\n }\n $user_id = Auth::user()->id;\n\n return Url::where('user_id', $user_id)\n ->select(['created_at', 'updated_at', 'long_url', 'short_url', 'private', 'hide_stats'])\n ->paginate(25);\n }", "public function urlUserDetails()\n {\n return self::API_URL . \"json/user/profile\";\n }", "public function getURL() {\n return getSiteURL() . \"profile/\" . $this->guid;\n }", "public function getUserWebsiteUrl()\r\n {\r\n return $this->user_website_url;\r\n }", "protected function getUserProfileUrl()\n {\n return $this->buildUrl('/user/get_user_info');\n }", "public function getUrlBaseUser()\n {\n return $this->url_base_user;\n }", "public function track_url()\n\t{\n\t\t// Generate the full URL.\n\t\t$full_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $this->_CI->input->server('HTTP_HOST') . $this->_CI->input->server('REQUEST_URI');\n\t\t\n\t\t$this->_CI->session->set_flashdata(self::last_url, $full_url);\n\t\t\n\t\tlog_message('debug', 'URL Tracked: ' . $full_url);\n\t}", "public function getUrlWithUserCredentials()\n\t{\n\t\treturn $this->_data['request']->getUrlWithUserCredentials();\n\t}", "public function provideUrls()\n {\n return array(\n array('/'),\n //UserBundle\n array('/User/test'),\n array('/User/signup'),\n array('/User/login'),\n //member\n array('/member/'),\n array('/member/settings'),\n );\n }", "public function emailTracking() {\n \t// the url to redirect to\n $targetUrl = 'http://my.application.com/page/';\n\n $impression = [\n 'content_list' => ['tweet:34349698', 'tweet:34349699', 'tweet:34349697'],\n 'feed_id' => 'flat:tommaso',\n 'location' => 'profile_page',\n 'user_data' => ['id' => 'bubbles'],\n 'label' => 'impression',\n ];\n\n $engagement = [\n 'content' => 'tweet:34349698',\n 'feed_id' => 'flat:tommaso',\n 'location' => 'profile_page',\n 'user_data' => ['id' => 'frank'],\n 'label' => 'click',\n ];\n\n $events = [$impression, $engagement];\n $trackingUrl = $this->client->createRedirectUrl($targetUrl, $events);\n\n // when the user opens the tracking url in their browser gets redirected to the target url\n // the events are added to our analytics platform\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a view variable.
public function getViewVar($key = null) { return Hash::get($this->_View->viewVars, $key); }
[ "public function viewVariable($name) {\n\t\tif (empty($this->controller->viewVars)) {\n\t\t\t$this->fail('There are no view variables, perhaps you need to run a request?');\n\t\t}\n\t\tif (isset($this->controller->viewVars[$name])) {\n\t\t\treturn $this->controller->viewVars[$name];\n\t\t}\n\t\treturn null;\n\t}", "public static function get($name){\n\t\treturn self::$viewVars[$name];\n\t}", "public function __get($key) {\n return $this->view_variables[$key];\n }", "public function getViewVarValue($key) {\n\t\treturn $this->_View->getVar($key);\t\n\t}", "public function viewVariable($name)\n {\n if (empty($this->_controller->viewVars)) {\n $this->fail('There are no view variables, perhaps you need to run a request?');\n }\n if (isset($this->_controller->viewVars[$name])) {\n return $this->_controller->viewVars[$name];\n }\n\n return null;\n }", "public function &getVar($key)\n\t{\n\t\tif (array_key_exists($key, $this->viewVars)) {\n\t\t\treturn $this->viewVars[$key];\n\t\t}\n\t\t$default = null;\n\t\treturn $default;\n\t}", "public function getViewVariableName()\n\t{\n\t\treturn $this->viewVariableName;\n\t}", "public function getVariableKey() {\n\t\t// custom provided variable name\n\t\tif ($this->_viewVar !== null) {\n\t\t\treturn $this->_viewVar;\n\t\t}\n\n\t\treturn self::buildVariableKey($this->_field);\n\t}", "public function getViewVariables();", "private function get_view_variables()\n {\n }", "function get_variable()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_VARIABLE);\r\n }", "public function __get($fieldName) {\n\t\treturn isset($this->view->$fieldName) ? $this->view->$fieldName : null;\n\t}", "public function route_var($key){\n return $this->route_variables[$key];\n }", "function getVariable($variable = null)\n {\n // and sets variables thing on the current record.\n // so shouldn't need to adjust the $this-> set\n // of variables and can refactor that out.\n\n // All variables should be callable by\n // $this->variables_thing.\n\n // The only Thing variable of use is $this->from\n // which is used to set the identity for\n // self-tallies. (Thing and Agent are the\n // only two role descriptions.)\n\n if ($variable == null) {\n $variable = \"variable\";\n }\n\n $this->variables_thing->db->setFrom($this->identity);\n\n $this->variables_thing->$variable = $this->variables_thing->Read(\n [$this->variables_agent, $variable]\n );\n\n // And then load it into the thing\n // $this->$variable = $this->variables_thing->$variable;\n // $this->variables_thing->flagGreen();\n\n return $this->variables_thing->$variable;\n }", "public function getTemplateVariable($key) {\n\t\tif ($this->templateVariableContainer->exists($key)) {\n\t\t\treturn $this->templateVariableContainer->get($key);\n\t\t}\n\t\treturn NULL;\n\t}", "function get_variable($variable,$getvalue=FALSE)\n {\n $res=$this->evaluate(\"GET VARIABLE $variable\");\n \n if($getvalue==FALSE)\n return($res);\n \n return($res['data']);\n }", "public function __set(string $variable, $value): View;", "public function __get($var)\n\t{\n\t\treturn $this->pageVars[$var];\t\t\t\n\t}", "public function get_template_var($name = null)\n {\n if (isset($name)) {\n return $this->Vars[$name];\n }\n return $this->Vars;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Answers the singleton instance of Installer.
public static function inst() { if (!self::$instance) { self::$instance = new Installer(); } return self::$instance; }
[ "public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t// Setup the setup\n\t\t\tself::$instance = new Mai_Engine_Installer;\n\t\t\t// Methods\n\t\t\tself::$instance->setup_constants();\n\t\t\tself::$instance->includes();\n\t\t\tself::$instance->hooks();\n\t\t}\n\t\treturn self::$instance;\n\t}", "function &getInstance()\n\t{\n\t\tstatic $instance;\n\n\t\tif (!isset ($instance)) {\n\t\t\t$instance = new JInstaller();\n\t\t}\n\t\treturn $instance;\n\t}", "public function getInstaller() {\n\t\t\tif (!isset($this->installer)) {\n\t\t\t\t$this->installer = new Installer();\n\t\t\t}\n\t\t\treturn $this->installer;\n\t\t}", "protected function getInstaller()\n {\n if ($this->installer === null) {\n $this->installer = $this->app->make(Installer::class);\n }\n\n return $this->installer;\n }", "public function getInstaller()\n\t{\n\t\tif (is_null($this->installer))\n\t\t{\n\t\t\t$this->installer = new JInstaller;\n\t\t}\n\n\t\treturn $this->installer;\n\t}", "public function getInstaller()\n {\n return $this->installer;\n }", "function Mai_Engine_Installer() {\n\tif ( ! is_admin() ) {\n\t\treturn;\n\t}\n\treturn Mai_Engine_Installer::instance();\n}", "public static function get_instance() {\n\t\tif ( ! isset( self::$instance ) && ! ( self::$instance instanceof Uninstall ) ) {\n\t\t\tself::$instance = new Uninstall;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "protected function getInstaller($update = false)\n {\n $install = Installer::create($this->io, $this->composer);\n $install->setUpdate($update);\n\n return $install;\n }", "protected function getClaroline_Plugin_InstallerService()\n {\n return $this->services['claroline.plugin.installer'] = new \\Claroline\\CoreBundle\\Library\\Installation\\Plugin\\Installer($this->get('claroline.plugin.validator'), $this->get('claroline.plugin.recorder'), $this->get('claroline.installation.manager'));\n }", "public function getInstallerManager()\n {\n if (!$this->installerManager) {\n $this->installerManager = new PackageFileInstallerManager(\n $this->getPuli()->getRootPackageFileManager(),\n $this->getPuli()->getPackageManager()->getPackages()\n );\n }\n\n return $this->installerManager;\n }", "public static function instance() {\r\n\r\n\t\t// Store the instance locally to avoid private static replication\r\n\t\tstatic $instance = null;\r\n\r\n\t\t// Only run these methods if they haven't been ran previously\r\n\t\tif ( null === $instance ) {\r\n\t\t\t$instance = new Acme_Demo_Setup;\r\n\t\t}\r\n\r\n\t\t// Always return the instance\r\n\t\treturn $instance;\r\n\t}", "function analogue()\n {\n return Manager::getInstance();\n }", "public static function instance() : self\r\n {\r\n\r\n return app('tweaky');\r\n\r\n }", "function tm_wizard_installer() {\n\treturn TM_Wizard_Installer::get_instance();\n}", "private function getInstance()\n {\n if (!self::$savantInstance) {\n if (!is_dir(self::$savantDirectory)) {\n throw new \\RuntimeException('Cannot set the Savant lib directory : ' . self::$savantDirectory . '. Directory does not exist.');\n }\n require_once self::$savantDirectory . '/Savant3.php';\n self::$savantInstance = new \\Savant3(self::$savantOptions);\n }\n\n return self::$savantInstance;\n }", "public static function instance()\n {\n\n if (!isset(self::$instance) && !(self::$instance instanceof Alex_Addons)) {\n\n self::$instance = new Alex_Addons;\n\n self::$instance->setup_constants();\n\n self::$instance->alex_includes();\n\n }\n return self::$instance;\n }", "function wpml_get_setup_instance() {\n\tglobal $wpml_installation, $wpdb, $sitepress;\n\n\tif ( ! isset( $wpml_installation ) ) {\n\t\t$wpml_installation = new WPML_Installation( $wpdb, $sitepress );\n\t}\n\n\treturn $wpml_installation;\n}", "public function getInstaller($type)\n {\n $type = strtolower($type);\n\n if (isset($this->cache[$type])) {\n return $this->cache[$type];\n }\n\n foreach ($this->installers as $installer) {\n if ($installer->supports($type)) {\n return $this->cache[$type] = $installer;\n }\n }\n\n throw new \\InvalidArgumentException('Unknown installer type: '.$type);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the fail attempts count from the data file
public function getAttemptsCount() { // file doesn't exist, so zero if (!file_exists($this->dataFilePath)) { return 0; } // retrieve data from file $lines = file($this->dataFilePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $attemptsInfos = explode(':', $lines[0]); // check the date of last failed attempts if ($attemptsInfos[0] !== date('Y-m-d')) { // different dates, so no fail today // (and let's delete this obsolete file) $fs = new sfFilesystem(); $fs->remove($this->dataFilePath); return 0; } return $attemptsInfos[1]; }
[ "public function get_failed_count();", "public function get_failure_count() {\n return isset($this->_failures) ? count($this->_failures) : -1;\n }", "public function getFailedAttempts(): int;", "public function numFailed() : int\n {\n return $this->numFailed;\n }", "public static function getFailedCount(){\n return TaskClient::getFailedCount();\n }", "public function getFailureCount()\n {\n return $this->failureCount;\n }", "public function getFailures(): int\n {\n return $this->failures;\n }", "public function getFailureCount()\n {\n return $this->failures;\n }", "public function failedLoginAttempts() : int\n {\n return (isset($this->data['failed_login_attempts'])) ? (int)$this->data['failed_login_attempts'] : 0;\n }", "protected function getNumFailures(): int\n {\n return $this->getNumFromStatus(self::STATUS_FAILURE);\n }", "public function getSuccessfulAttempts(): int;", "public function count()\n {\n return $this->backend->lLen('failed');\n }", "public function getNumFailures()\n {\n return $this->num_failures;\n }", "public function getCurrentFailAttemptCount()\n {\n if (!$this->sessionBag->has(self::PARAM_ATTEMPT_NS)) {\n $this->reset();\n }\n\n return $this->sessionBag->get(self::PARAM_ATTEMPT_NS);\n }", "public function getAttempts(): int;", "public function getFailureCount()\n {\n return max((int) $this->scopeConfig->getValue(self::XML_PATH_GENERAL_FAILURE_COUNT), 1);\n }", "public function attempts(): int\n {\n // set default job attempts to 1 so that jobs can run without retry\n return $this->message->getProperty(self::ATTEMPT_COUNT_HEADERS_KEY, 1);\n }", "public function getFailedTasks(): int;", "public function getFailedTestsCount(): int;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initial sqlite3 with table "logs" in $this>pdo logs = id INTEGER PRIMARY KEY AUTOINCREMENT level VARCHAR(10) NOT NULL message TEXT NOT NULL
public function __construct() { $this->pdo = new \PDO('sqlite:syslog.sqlite3'); $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->pdo->exec("CREATE TABLE IF NOT EXISTS logs (id INTEGER PRIMARY KEY AUTOINCREMENT, level VARCHAR(10) NOT NULL, message TEXT NOT NULL)"); }
[ "private function createLogsTable()\n {\n $this->db->raw(\"\n CREATE TABLE IF NOT EXISTS logs (\n id INTEGER PRIMARY KEY,\n task_id VARCHAR(20) NOT NULL,\n group_id INTEGER NULL,\n description VARCHAR(255) NULL,\n started_at TIMESTAMP CURRENT_TIMESTAMP NOT NULL,\n ended_at TIMESTAMP NULL,\n log VARCHAR(10) NULL,\n synced TINYINT DEFAULT 0\n );\n \");\n }", "public function createLogsTable() {\n $sqlQuery = \"create table if not exists Logs\n (\n logID int auto_increment\n primary key,\n logEditorID int not null,\n logActionType varchar(45) not null,\n logAffectedUser varchar(128) null,\n logAffectedTeam varchar(64) null,\n logDate datetime not null,\n logAffectedSchedule int null,\n constraint FKlogUserID\n foreign key (logEditorID) references Users (userID)\n );\n\n create index FKlogUserID_idx\n on Logs (logEditorID)\";\n\n $statement = $this->_dbHandle->prepare($sqlQuery);\n\n $statement->execute();\n\n $this->_dbInstance->destruct();\n\n echo \"<h1>[INFO]: CREATED Logs TABLE</h1>\";\n\n }", "public static function init()\n {\n $db = OneGoUtils::getRegistry()->get('db');\n $sql = \"CREATE TABLE IF NOT EXISTS `\".DB_PREFIX.\"onego_transactions_log` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `order_id` int(11) NOT NULL COMMENT 'Opencart order ID',\n `transaction_id` varchar(100) NOT NULL COMMENT 'OneGo transaction ID',\n `operation` enum('CONFIRM','CANCEL','DELAY') NOT NULL COMMENT 'OneGo operation',\n `success` tinyint(1) NOT NULL COMMENT 'Is operation successful',\n `error_message` text COMMENT 'Error message (optional)',\n `inserted_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP,\n `expires_in` int(11) DEFAULT NULL COMMENT 'Delayed transaction TTL',\n PRIMARY KEY (`id`),\n KEY `order_id` (`order_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='OneGo transactions for orders'\";\n $db->query($sql);\n }", "private function logToDB()\n {\n\n //insert the info into the database, don't allow logging of any error\n $this->DB->insert(\"logger.logs\",$this->logData,null,1);\n \n }", "protected function createDbTable()\n\t{\n\t\t$db = $this->getDbConnection();\n\t\t$driver = $db->getDriverName();\n\t\t$autoidAttributes = '';\n\t\tif ($driver === 'mysql') {\n\t\t\t$autoidAttributes = 'AUTO_INCREMENT';\n\t\t}\n\t\tif ($driver === 'pgsql') {\n\t\t\t$param = 'SERIAL';\n\t\t} else {\n\t\t\t$param = 'INTEGER NOT NULL';\n\t\t}\n\n\t\t$sql = 'CREATE TABLE ' . $this->_logTable . ' (\n\t\t\tlog_id ' . $param . ' PRIMARY KEY ' . $autoidAttributes . ',\n\t\t\tlevel INTEGER,\n\t\t\tcategory VARCHAR(128),\n\t\t\tprefix VARCHAR(128),\n\t\t\tlogtime VARCHAR(20),\n\t\t\tmessage VARCHAR(255))';\n\t\t$db->createCommand($sql)->execute();\n\t}", "function fcm_data_init_table_logs(){\n global $wpdb;\n $logs_table = $wpdb->prefix.'fcm_logs';\n $charset_collate = $wpdb->get_charset_collate();\n $sql =\n \"CREATE TABLE IF NOT EXISTS \" . $logs_table . \" (\n\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t`title` text,\n\t\t`content` text,\n\t\t`target` text,\n\t\t`event` text,\n\t\t`success` int(11),\n\t\t`failure` int(11),\n\t\t`status` text,\n\t\t`created_at` bigint(30),\n\t\tPRIMARY KEY (`id`)\n\t\t) $charset_collate;\";\n\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n}", "private function initialize()\n {\n $this->db->debug = $this->debug;\n\n if ($this->db->table($this->table)->exists() == false) {\n $this->db->table($this->table)\n ->column('Id', 'INTEGER', 'PRIMARY KEY AUTOINCREMENT')\n ->column('Channel', 'STRING')\n ->column('Level', 'STRING')\n ->column('Message', 'TEXT')\n ->column('Context', 'TEXT')\n ->column('Time', 'DATETIME')\n ->create();\n }\n\n $this->initialized = true;\n }", "private function mysqlAddLogTable(){\r\n $tableExists = $this->tableExists($this->logTable);\r\n if ($tableExists == false){\r\n $sql = \r\n 'CREATE TABLE `databaseLog` (\r\n `id` int(10) unsigned NOT NULL default \\'0\\',\r\n `action` varchar(31) NOT NULL default \\'\\',\r\n `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,\r\n `sql` longtext NOT NULL,\r\n PRIMARY KEY (`id`),\r\n KEY `action` (`action`,`timestamp`)\r\n ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=\\'All database queries should be logged within this table\\'';\r\n $this->createTable($sql);\r\n }\r\n }", "static function dbcheck(){\n\t\t// open OR create a flat file database if one does not exist\n\t\t$db = new SQLite3('../db/litechat');\n\t\t// make sure that the log table is active, if not create one\n\t\t$db->exec(\"CREATE TABLE IF NOT EXISTS 'log' (\n\t\t'cID' INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t'username' VARCHAR(255) ,\n\t\t'comment' VARCHAR(255) ,\n\t\t'date' DATETIME \n\t\t)\");\n\t\t// return the active database\n\t\treturn $db;\n\t}", "public function logToSQL() {\n\n }", "public function testLogsRecordIsCreatedForNewMigration()\n {\n $this->logger->log('my_migration_123');\n\n $logs = $this->connectToDatabase()->prepare(\"\n SELECT * FROM {$this->testLogsTable}\n \");\n\n $logs->execute();\n $this->assertNotEmpty($logs->fetch());\n }", "function NSLogf() {\n\t\tglobal $db;\n\t\t$args = func_get_args();\n\t\t$db->Execute(sprintf(\"INSERT INTO `nslog_messages` (`message`, `timestamp`) VALUES('%s', NOW())\", $db->prepare_input(array_pop(sNSLog($args)))));\n\t}", "public function getLogInsertMessage();", "function db_log($table, $message) {\n\tglobal $wpdb;\n\t$wpdb->insert(\n\t\t\t$wpdb->prefix . $table . '_log',\n\t\t\tarray(\n\t\t\t\t\t'message' => $message,\n\t\t\t\t\t'ip' => $_SERVER[\"REMOTE_ADDR\"],\n\t\t\t\t\t'user_id' => is_user_logged_in() ? wp_get_current_user()->ID : 0\n\t\t\t),\n\t\t\tarray('%s','%s','%d')\n\t);\n}", "function progress_log($con,$log,$line,$sitemap_id = NULL,$url = NULL)\n{\n\t$sql = \"INSERT INTO log (log,url,sitemap_id,line)\n\tVALUES ('$log','$url','$sitemap_id','$line');\";\n\t$query = sqlite_exec($con, $sql);\n\treturn 0;\n}", "public static function auditLog($id, $table)\n {\n $qry = \"insert into log_\" . $table . \" (select * from \" . $table . \" where id ='$id')\";\n DB::insert($qry);\n }", "private static function createRequestLogTable(){\n\t\t$db = self::connect();\n\t\t$table = self::$table->log;\n\t\t$stmt = $db->prepare(\"\n\t\t\tCREATE TABLE $table (\n\t\t\t\tid int PRIMARY KEY,\n\t\t\t\trequest_data varchar(255),\n\t\t\t\tlast_update timestamp\n\t\t\t)\n\t\t\");\n\t\tif( $stmt ){\n\t\t\t$stmt->execute();\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "public static function pdoLog($message = \"\") {\n if(empty($message)){\n throw new \\Exception(\" مقدار ورودی این تابع نمی تواند خالی باشد \");\n }\n //@header('Content-type: text/html; charset=utf-8');\n mb_internal_encoding('UTF-8');\n $logfile = jsConfig::get('APP_DATABASE_PATH') . jsConfig::get('DB_DATABASE') . '_pdo_' . date('Y_m_d') . '.txt';\n if(!file_exists($logfile)){\n if(!file_exists(jsConfig::get('APP_DATABASE_PATH'))){\n mkdir(jsConfig::get('APP_DATABASE_PATH'), 0777);\n }\n }\n $new = file_exists($logfile) ? false : true;\n if($handle = fopen($logfile, 'a')) {\n\n $log_headers = getallheaders();\n $log_requestUri = (isset($_SERVER['HTTPS']) ? \"https\" : \"http\") . htmlentities(\"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\");\n $log_method = $_SERVER['REQUEST_METHOD'];\n\n $content = \"[\".date('Y-m-d H:i:s').\"] [Client Ip: \".jsFunction::getClientIP().\"]\\n\";\n $content .= \"Headers : \\n\";\n foreach ($log_headers as $key => $val){\n if(is_array($val)){\n $content .= '# ' . $key . ' : ' . json_encode($val) . \"\\n\";\n }else{\n $content .= '# ' . $key . ' : ' . $val . \"\\n\";\n }\n }\n $content .= \"Request Uri : \" . $log_requestUri . \"\\n\";\n $content .= \"Method : \" . $log_method . \"\\n\";\n if(isset($_GET)){\n $content .= \"GET : \\n\";\n foreach ($_GET as $key => $val){\n if(is_array($val)){\n $content .= '# ' . $key . ' : ' . json_encode($val) . \"\\n\";\n }else{\n $content .= '# ' . $key . ' : ' . $val . \"\\n\";\n }\n }\n }\n if(isset($_POST)){\n $content .= \"POST : \\n\";\n foreach ($_POST as $key => $val){\n if(is_array($val)){\n $content .= '# ' . $key . ' : ' . json_encode($val) . \"\\n\";\n }else{\n $content .= '# ' . $key . ' : ' . $val . \"\\n\";\n }\n }\n }\n\n $_message = \"\";\n if(is_array($message) and !empty($message)){\n $_message .= \"Message : \\n\";\n foreach ($message as $key => $val){\n $_message .= '# ' . $key . ' : ' . json_encode($val) . \"\\n\";\n }\n }\n\n $content .= \" ********************************* Log ********************************* \\n\";\n $content .= \"User: \" . jsEncryption::decrypt(jsSession::get('username')) . \"'\\n\";\n $content .= $_message;\n $content .= \"-------------------------------------------------------------------------------------------------------------------------------------\\n\";\n fwrite($handle, pack(\"CCC\",0xef,0xbb,0xbf));\n fwrite($handle, $content);\n fclose($handle);\n if($new) { chmod($logfile, 0755); }\n }\n else {\n throw new \\Exception(\"در باز کردن فایل لاگ خطا مشکلی بوجود آمده .\");\n }\n }", "public function insertToDB($logtable = \"log\", $msg) {\n\t\t$sql = \"INSERT INTO \".$logtable.\" (log_descr) VALUES ('\".$msg.\"')\";\n\t\tif (!$this->conn->query($sql) === TRUE) {\n die(\"Error: \" . $sql . \"<br>\" . $this->conn->error);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
args['map'] args['path'] args['streets'] args['altnames'] args['houses']
function __construct($args) { if (!empty($args['map'])) { $this->map = $args['map']; } $this->path = $args['path']; $this->toolkit = mtoToolkit :: instance(); $this->db = $this->toolkit->getDbConnection(); }
[ "function __construct($args)\n {\n if (!empty($args['map']))\n {\n $this->map = $args['map'];\n } \n \n $this->path = $args['path'];\n \n $this->has_kladr = file_exists($this->path . \"/KLADR.DBF\");\n if ($args['streets'])\n { \n $this->has_streets = file_exists($this->path . \"/STREET.DBF\");\n } \n $this->has_annotation = file_exists($this->path . \"/SOCRBASE.DBF\");\n if ($args['altnames'])\n { \n $this->has_altnames = file_exists($this->path . \"/ALTNAMES.DBF\");\n } \n if ($args['houses'])\n { \n $this->has_houses = file_exists($this->path . \"/DOMA.DBF\");\n } \n $this->has_flat = file_exists($this->path . \"/FLAT.DBF\");\n \n $this->toolkit = mtoToolkit :: instance();\n $this->db = $this->toolkit->getDbConnection();\n\n $this->config = mtoConf :: instance()->loadConfig(\"mtokit_geoip.ini\")->getSection(\"geoip\");\n \n }", "function ocworld_map_script()\n{\n\trequire_code('ocworld');\n\n\t$realm=get_param_integer('realm',NULL);\n\tdownload_map_wrap(get_member(),$realm);\n}", "function em_locations( $args = array() ){ echo em_get_locations($args); }", "public function find_shops_lat_long($args, $assoc_args) {\n\n\t\t$shops = get_posts(array('post_type' => 'shop', 'posts_per_page' => -1));\n\n\t\tforeach ($shops as $shop) {\n\t\t\t$address = get_post_meta($shop->ID, 'address', true);\n\n\t\t\tif (!$address) {\n\t\t\t\tWP_CLI::line( 'No address found for ' . $shop->ID . ' ' . $shop->post_title);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$latitude = get_post_meta($shop->ID, 'latitude', true);\n\t\t\t$longitude = get_post_meta($shop->ID, 'longitude', true);\n\n\t\t\tif ($latitude && $longitude && !$assoc_args['all']) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$result_string = file_get_contents('http://restapi.amap.com/v3/geocode/geo?key=' . constant('AMAP_KEY') . '&address=' . urlencode($address));\n\t\t\t$result = json_decode($result_string);\n\n\t\t\tif (count($result->geocodes) > 1) {\n\t\t\t\tWP_CLI::line( 'Multiple results found for ' . $shop->ID . ' ' . $shop->post_title);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (count($result->geocodes) === 0) {\n\t\t\t\tWP_CLI::line( 'No results found for ' . $shop->ID . ' ' . $shop->post_title);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$location = $result->geocodes[0]->location;\n\n\t\t\t$latitude = explode(',', $location)[1];\n\t\t\t$longitude = explode(',', $location)[0];\n\n\t\t\t$wgs84_result = gcj02_to_wgs84($longitude, $latitude);\n\t\t\t$longitude = $wgs84_result[0];\n\t\t\t$latitude = $wgs84_result[1];\n\n\t\t\tupdate_post_meta($shop->ID, 'latitude', $latitude);\n\t\t\tupdate_post_meta($shop->ID, 'longitude', $longitude);\n\n\t\t\tWP_CLI::line( 'Location saved ' . $latitude . ',' . $longitude . ' ' . $shop->ID . ' ' . $shop->post_title . '.');\n\t\t}\n\t}", "function em_get_locations( $args = array() ){\r\n\tif (strpos ( $args, \"=\" )) {\r\n\t\t// allows the use of arguments without breaking the legacy code\r\n\t\t$defaults = EM_Locations::get_default_search();\t\t\r\n\t\t$args = wp_parse_args ( $args, $defaults );\r\n\t}\r\n\treturn EM_Locations::output( $args );\r\n}", "function home_mini_map( $atts ){\n\n\t$a = shortcode_atts( array(\n\t\t'location' => '',\n\t), $atts );\n \n\tob_start();\n\tinclude(get_stylesheet_directory().\"/location_variables.php\");\n\t$address1 = $main_street.', '.$main_city.' '.$main_state.' '.$main_zip;\n\t$address2 = ($display_2_location == 1) ? $second_street.', '.$second_city.' '.$second_state.' '.$second_zip : NULL;\n\t$address3 = ($display_3_location == 1) ? $third_street.', '.$third_city.' '.$third_state.' '.$third_zip : NULL;\n\t$address4 = ($display_4_location == 1) ? $fourth_street.', '.$fourth_city.' '.$fourth_state.' '.$fourth_zip : NULL;\n\n\t$lat1 = get_option( 'lat1' );\n\t$lon1 = get_option( 'lon1' );\n\n\t$lat2 = get_option( 'lat2' );\n\t$lon2 = get_option( 'lon2' );\n\t\n\n\t$lat3 = get_option( 'lat3' );\n\t$lon3 = get_option( 'lon3' );\n\t\n\t$lat4ck = get_option( 'lat4' );\n\t$lon4ck = get_option( 'lon4' );\n\n\t$lat4 = (isset($lat4ck) && $lat4ck != '' ? $lat4ck : NULL);\n\t$lon4 = (isset($lon4ck) && $lon4ck != '' ? $lon4ck : NULL);\n\n\t\n\t$bubble1 = '[\\'<h4>'.$company_name.'</h4><a href=\\\"https://www.google.com/maps/dir/Current+Location/'.$lon1.','.$lat1.'\\\"><span style=\\\"font-weight:bold;\\\">'.$main_street.'</span><br />'.$main_city.', '.$main_state.' '.$main_zip.'</a>\\','.json_encode($lon1).', '.json_encode($lat1).']';\n\t$bubble2 = '[\\'<h4>'.$company_name.'</h4><a href=\\\"https://www.google.com/maps/dir/Current+Location/'.$lon2.','.$lat2.'\\\"><span style=\\\"font-weight:bold;\\\">'.$second_street.'</span><br />'.$second_city.', '.$second_state.' '.$second_zip.'</a>\\','.json_encode($lon2).', '.json_encode($lat2).']';\n\t$bubble3 = '[\\'<h4>'.$company_name.'</h4><a href=\\\"https://www.google.com/maps/dir/Current+Location/'.$lon3.','.$lat3.'\\\"><span style=\\\"font-weight:bold;\\\">'.$third_street.'</span><br />'.$third_city.', '.$third_state.' '.$third_zip.'</a>\\','.json_encode($lon3).', '.json_encode($lat3).']';\n\t$bubble4 = '[\\'<h4>'.$company_name.'</h4><a href=\\\"https://www.google.com/maps/dir/Current+Location/'.$lon4.','.$lat4.'\\\"><span style=\\\"font-weight:bold;\\\">'.$fourth_street.'</span><br />'.$fourth_city.', '.$fourth_state.' '.$fourth_zip.'</a>\\','.json_encode($lon4).', '.json_encode($lat4).']';\n\t\n\tswitch ($a['location']) {\n\t case \"1\":\n\t $lat = get_option( 'lat1' );\n\t\t$lon = get_option( 'lon1' );\n\t\t$location_select = $bubble1;\n\t break;\n\t case \"2\":\n\t\t$lat = get_option( 'lat2' );\n\t\t$lon = get_option( 'lon2' );\n\t $location_select = $bubble2;\n\t break;\n\t case \"3\":\n\t\t$lat = get_option( 'lat3' );\n\t\t$lon = get_option( 'lon3' );\n\t\t$location_select = $bubble3;\n\t break;\n\t case \"4\":\n\t\t$lat = get_option( 'lat4' );\n\t\t$lon = get_option( 'lon4' );\n\t\t$location_select = $bubble4;\n\t break;\n\t default:\n\t $location_select = $bubble1;\n\t if($display_2_location == 1){ $location_select .= ', '.$bubble2; }\n\t if($display_3_location == 1){ $location_select .= ', '.$bubble3; }\n\t if($display_4_location == 1){ $location_select .= ', '.$bubble4; }\n\t \n\t $map_bounds = \"show\";\n\n\t}\n\t\n\t\n\tinclude(get_stylesheet_directory().\"/home_mini_map-geo.php\"); \n\t$result = ob_get_contents();\n\tob_end_clean(); \t \n\treturn $result;\n}", "function mapit_get_location($postcode, $partial = null) {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.get_location', $params);\n return $result;\n}", "abstract public function DisplayMap($pois = array(), $routes = array());", "function map($map) {\n return \"map $argNum $map\";\n }", "public static function map($auth, $args, $tabalias, $options, $path) {\n global $base_root;\n //Setup the path to the site information sheets.\n //Include the parameter on the end of the path, but leave off the parameter values\n //as these will change for each path used.\n iform_load_helpers(array('map_helper','report_helper'));\n $informationSheetLinkParts = explode('|',$options['informationSheetLink']);\n $path = $base_root.base_path().\n //handle whether the drupal installation has clean urls setup.\n (variable_get('clean_url', 0) ? '' : '?q=').$informationSheetLinkParts[0].\n (variable_get('clean_url', 0) ? '?' : '&').$informationSheetLinkParts[1].'=';\n map_helper::$javascript .= \"indiciaData.informationSheetLink='\".$path.\"';\\n\";\n if (empty($options['layerLocationTypes']))\n return '<p>Please provide a @layerLocationTypes option for the [site_hierarchy_navigator.map] map control on the edit tab</p>';\n $msg=self::check_format($options, 'layerLocationTypes', 'location_type_id (from the termlists term table)', '/^([0-9]*,\\s*)*[0-9]*\\s*$/');\n if ($msg!==true) return $msg;\n //This option is optional, so don't need to check if it isn't present\n $msg=self::check_format($options, 'showCountUnitsForLayers', 'location_type_id (from the termlists term table)', '/^([0-9]*,\\s*)*[0-9]*\\s*$/');\n if ($msg!==true) return $msg;\n drupal_add_js(iform_client_helpers_path().'prebuilt_forms/extensions/site_hierarchy_navigator.js');\n //The location types are supplied by the user in a comma seperated list.\n //The first number is used as the initial location type to display.\n //The second number is used after the user clicks the first time on a feature and so on\n $layerLocationTypes = explode(',', $options['layerLocationTypes']);\n //Comma seperated list of location types which signify which layers should also display the Count Unit location type.\n //This should be a subset of $layerLocationTypes.\n $showCountUnitsForLayers = explode(',', $options['showCountUnitsForLayers']);\n $locationTypesWithSymbols = explode(',', $options['locationTypesWithSymbols']);\n //Annotation location types as defined on edit tab\n $annotationTypeIds = explode(',', $options['annotationTypeIds']);\n $mapOptions = iform_map_get_map_options($args, $auth);\n $olOptions = iform_map_get_ol_options($args);\n $mapOptions['readAuth'] = $mapOptions['readAuth']['read'];\n $mapOptions['clickForSpatialRef'] = false;\n //When user clicks on map, run specified Javascript function\n $mapOptions['clickableLayersOutputMode'] = 'customFunction';\n $mapOptions['customClickFn']='move_to_new_layer';\n $mapOptions['clickableLayersOutputDiv'] = '';\n //Tell the system which layers we to be clickable.\n $mapOptions['clickableLayers']=array('indiciaData.reportlayer');\n $r .= map_helper::map_panel(\n $mapOptions,\n $olOptions\n );\n map_helper::$javascript .= \"indiciaData.layerLocationTypes=\".json_encode($layerLocationTypes).\";\\n\";\n $reportOptions = array(\n 'dataSource' => 'reports_for_prebuilt_forms/CUDI/get_layer_list_names',\n 'readAuth'=>$auth['read'],\n 'mode' => 'report',\n 'extraParams' => array('layer_ids'=>$options['layerLocationTypes'])\n );\n //Return a list of location type names for the location type id layers list\n //provided by the user in the form structure.\n $locationTypeNamesDirty = report_helper::get_report_data($reportOptions);\n //The data returned by the database is not a simple array of names, so convert the data and put into correct order\n foreach ($layerLocationTypes as $originalLayerIndex=>$layerLocationTypeFromOriginalList) {\n foreach ($locationTypeNamesDirty as $locationTypeNamesData) {\n if ($locationTypeNamesData['id']===$layerLocationTypeFromOriginalList)\n $locationTypeNamesClean[$originalLayerIndex] = $locationTypeNamesData['name'];\n }\n }\n //Send the array of names to javascript\n map_helper::$javascript .= \"indiciaData.layerLocationTypesNames=\".json_encode($locationTypeNamesClean).\";\\n\";\n //Send the user supplied options for layers to display count units to Javascript\n map_helper::$javascript .= \"indiciaData.showCountUnitsForLayers=\".json_encode($showCountUnitsForLayers).\";\\n\";\n map_helper::$javascript .= \"indiciaData.countUnitBoundaryTypeId=\".$options['countUnitBoundaryTypeId'].\";\\n\";\n map_helper::$javascript .= \"indiciaData.annotationTypeIds=\".json_encode($annotationTypeIds).\";\\n\";\n map_helper::$javascript .= \"indiciaData.deactivateSiteAttributeId=\".$options['deactivateSiteAttributeId'].\";\\n\";\n //Get translatable label for top-level breadcrub item.\n map_helper::$javascript .= \"indiciaData.allSitesLabel='\".lang::get('All Sites').\"';\\n\";\n $reportOptions = array(\n 'linkOnly' => 'true',\n 'dataSource' => 'reports_for_prebuilt_forms/cudi/get_boundaries_and_locations_for_cudi_map',\n 'readAuth'=>$auth['read']\n );\n //Get the report options such as the Preset Parameters on the Edit Tab\n $reportOptions = array_merge(\n iform_report_get_report_options($args, $readAuth),\n $reportOptions);\n //Run the report that shows the locations (features) to the user when the map loads the first time.\n map_helper::$javascript .= \"indiciaData.layerReportRequest='\".\n report_helper::get_report_data($reportOptions).\"';\\n\";\n //Options for the report that is used to draw the map breadcrumb\n $reportOptions = array(\n 'linkOnly' => 'true',\n 'dataSource' => 'reports_for_prebuilt_forms/CUDI/get_map_hierarchy_for_current_position',\n 'readAuth'=>$auth['read']\n );\n //Get the report options such as the Preset Parameters on the Edit Tab\n $reportOptions = array_merge(\n iform_report_get_report_options($args, $readAuth),\n $reportOptions);\n //Run the report that builds the map breadcrumb.\n map_helper::$javascript .= \"indiciaData.breadcrumbReportRequest='\".\n report_helper::get_report_data($reportOptions).\"';\\n\";\n return $r;\n }", "function cd_map_link( $address, $city, $state, $zip ) {\n\n\n $address = (string)$address;\n $city = (string)$city;\n $state = (string)$state;\n $zip = (string)$zip;\n\n $address = preg_replace('/\\s+/', '+', $address);\n $city = preg_replace('/\\s+/', '+', $city);\n $state = preg_replace('/\\s+/', '+', $state);\n $zip = preg_replace('/\\s+/', '+', $zip);\n\n $href = $address . '+' . $city . '+' . $state . '+' . $zip;\n return $href;\n}", "public function getMapDestinations();", "function iform_map_get_map_options($args, $readAuth) {\n // read out the activated preset layers\n $presetLayers = [];\n if (!empty($args['preset_layers'])) {\n foreach($args['preset_layers'] as $key => $value) {\n if (is_int($key)) {\n // normally a checkbox group would just output an array\n $presetLayers[] = $value;\n } elseif ($value!==0) {\n // but the Drupal version of the the parameters form (deprecated) leaves a strange array structure in the parameter value.\n $presetLayers[] = $key;\n }\n }\n }\n\n $options = array(\n 'readAuth' => $readAuth,\n 'presetLayers' => $presetLayers,\n 'editLayer' => true,\n 'layers' => [],\n 'initial_lat'=>$args['map_centroid_lat'],\n 'initial_long'=>$args['map_centroid_long'],\n 'initial_zoom'=>(int) $args['map_zoom'],\n 'width'=>$args['map_width'],\n 'height'=>$args['map_height'],\n 'standardControls'=>array('layerSwitcher','panZoomBar'),\n 'rememberPos'=>isset($args['remember_pos']) ? ($args['remember_pos']==true) : false\n );\n // If they have defined a custom base layer, add it\n if (!empty($args['wms_base_title']) && !empty($args['wms_base_url']) && !empty($args['wms_base_layer'])) {\n data_entry_helper::$onload_javascript .= \"var baseLayer = new OpenLayers.Layer.WMS(\n '\".$args['wms_base_title'].\"',\n '\".$args['wms_base_url'].\"',\n {layers: '\".$args['wms_base_layer'].\"', sphericalMercator: true}, {singleTile: true}\n );\\n\";\n $options['layers'][] = 'baseLayer';\n }\n // Also add any custom base layers they have defined\n if (!empty($args['tile_cache_layers'])) {\n $options['tilecacheLayers'] = json_decode($args['tile_cache_layers'], true);\n }\n if (!empty($args['other_base_layer_config'])) {\n $options['otherBaseLayerConfig'] = json_decode($args['other_base_layer_config'], true);\n }\n // And any indicia Wms layers from the GeoServer\n if (!empty($args['indicia_wms_layers'])) {\n $wmsLayers = explode(\"\\n\", $args['indicia_wms_layers']);\n // Each layer may either just be a feature name or, optionally, may be\n // prefixed by a title in the form title = feature.\n foreach ($wmsLayers as $layer) {\n $separatorPos = strpos($layer, '=');\n if ($separatorPos !== FALSE) {\n // A title is present.\n $title = trim(substr($layer, 0, $separatorPos));\n $feature = trim(substr($layer, $separatorPos + 1));\n $options['indiciaWMSLayers'][$title] = $feature;\n }\n else {\n $options['indiciaWMSLayers'][] = $layer;\n }\n }\n }\n // set up standard control list if supplied\n if (array_key_exists('standard_controls', $args) && $args['standard_controls']) {\n $args['standard_controls'] = str_replace(\"\\r\\n\", \"\\n\", $args['standard_controls']);\n $options['standardControls']=explode(\"\\n\", $args['standard_controls']);\n // If drawing controls are enabled, then allow polygon recording.\n if (count(array_intersect(['drawPolygon', 'drawLine', 'drawPoint'], $options['standardControls'])) > 0)\n $options['allowPolygonRecording']=true;\n }\n // And pass through any translation strings, only if they exist\n $msgGeorefSelectPlace = lang::get('LANG_Georef_SelectPlace');\n if ($msgGeorefSelectPlace!='LANG_Georef_SelectPlace') $options['msgGeorefSelectPlace'] = $msgGeorefSelectPlace;\n $msgGeorefNothingFound = lang::get('LANG_Georef_NothingFound');\n if ($msgGeorefNothingFound!='LANG_Georef_NothingFound') $options['msgGeorefNothingFound'] = $msgGeorefNothingFound;\n // if in Drupal, and IForm proxy is installed, then use this path as OpenLayers proxy\n if (function_exists('hostsite_module_exists') && hostsite_module_exists('iform_proxy')) {\n $options['proxy'] = data_entry_helper::getRootFolder(true) . hostsite_get_config_value('iform', 'proxy_path', 'proxy') . '&url=';\n }\n // And a single location boundary if defined\n if (!empty($args['location_boundary_id']))\n $location = $args['location_boundary_id'];\n elseif (isset($args['display_user_profile_location']) && $args['display_user_profile_location']) {\n $location = hostsite_get_user_field('location');\n }\n if (!empty($location)) {\n iform_map_zoom_to_location($location, $readAuth);\n }\n return $options;\n}", "public function get( $args, $assoc_args ) {\n\n\t\t$map = ITSEC_Lib_Static_Map_API::get_map( $assoc_args );\n\n\t\tif ( is_wp_error( $map ) ) {\n\t\t\tWP_CLI::error( $map );\n\t\t}\n\n\t\tWP_CLI::success( 'Retrieved Map: ' . $map );\n\t}", "function iform_map_get_ol_options(array $args) {\n if (!empty($args['openlayers_options'])) {\n $options = json_decode($args['openlayers_options'], TRUE);\n }\n return (!isset($options) || $options === NULL) ? [] : $options;\n}", "function job_archive_map_wrappper( $args ) {\n $is_mapbox_token = get_theme_mod('capstone_mapbox_access_token');\n $maps_enabled = get_theme_mod( 'capstone_jobs_enable_map', false ) || get_query_var('map_enabled');\n $is_job_master_page = ( get_option('job_manager_jobs_page_id') && is_page(get_option('job_manager_jobs_page_id')) ) || is_post_type_archive('job_listing');\n \n if ($maps_enabled && $is_mapbox_token) {\n if ( $is_job_master_page ) {\n echo '<div id=\"map-wrapper\"></div>';\n }\n }\n }", "function bb_locatie($arguments = array()) {\n\t\t$address = $this->parseArray(array('[/locatie]'), array());\n\t\t$url = 'https://maps.google.nl/maps?q=' . urlencode($address);\n\t\tif ($this->light_mode) {\n\t\t\treturn $this->lightLinkInline('locatie', $url, $address);\n\t\t}\n\t\t$map = $this->maps(htmlspecialchars($address), $arguments);\n\t\treturn '<span class=\"hoverIntent\"><a href=\"' . $url . '\">' . $address . Icon::getTag('map', null, 'Kaart', 'text') . '</a><div class=\"hoverIntentContent\">' . $map . '</div></span>';\n\t}", "public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples_and_options) {}", "public function map()\n\t{\n\t\t$map = 'http://maps.googleapis.com/maps/api/staticmap?zoom=12&format=png&maptype=roadmap&style=element:geometry|color:0xf5f5f5&style=element:labels.icon|visibility:off&style=element:labels.text.fill|color:0x616161&style=element:labels.text.stroke|color:0xf5f5f5&style=feature:administrative.land_parcel|element:labels.text.fill|color:0xbdbdbd&style=feature:poi|element:geometry|color:0xeeeeee&style=feature:poi|element:labels.text.fill|color:0x757575&style=feature:poi.business|visibility:off&style=feature:poi.park|element:geometry|color:0xe5e5e5&style=feature:poi.park|element:labels.text|visibility:off&style=feature:poi.park|element:labels.text.fill|color:0x9e9e9e&style=feature:road|element:geometry|color:0xffffff&style=feature:road.arterial|element:labels|visibility:off&style=feature:road.arterial|element:labels.text.fill|color:0x757575&style=feature:road.highway|element:geometry|color:0xdadada&style=feature:road.highway|element:labels|visibility:off&style=feature:road.highway|element:labels.text.fill|color:0x616161&style=feature:road.local|visibility:off&style=feature:road.local|element:labels.text.fill|color:0x9e9e9e&style=feature:transit.line|element:geometry|color:0xe5e5e5&style=feature:transit.station|element:geometry|color:0xeeeeee&style=feature:water|element:geometry|color:0xc9c9c9&style=feature:water|element:labels.text.fill|color:0x9e9e9e&size=640x250&scale=4&center='.urlencode(trim(preg_replace('/\\s\\s+/', ' ', $this->cfg->address)));\n\t\t$con = curl_init($map);\n\t\tcurl_setopt($con, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($con, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($con, CURLOPT_RETURNTRANSFER, 1);\n\t\treturn response(curl_exec($con))->header('Content-Type', 'image/png');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the task id for this object
public function setid($id) { if (empty($this->taskid)) { $this->taskid = $id; // Fetch the tasks info from the database $this->fetchProperties(); // Check this task is owned by this owner $user = new user(); $googleAuth_id = $user->getGoogleAuthId(); if(!$googleAuth_id == $this->owner){ // Set the task id $this->taskid = $id; return true; } else { // User does not own this task return false; } } else { // Object already has a task return false; } }
[ "public function setIDTask ($idTask) {\n\t\t$this->_idTask = $idTask;\n\t}", "public function setTaskID($task_id){\r\n\t\t$this->task_id = $task_id;\r\n\t}", "public function setTask_id($task_id)\n {\n $this->task_id = $task_id;\n\n return $this;\n }", "public function setTaskSetID($tasksetid) {\n\t\t$this->_taskset = new JTaskSet($this->_db);\n\t\tif ($tasksetid) {\n\t\t\t$this->_taskset->load($tasksetid);\n\t\t} // if its zero create a new taskset; no work required\n\t}", "public function setTask(&$task) {\n\t\t$this->task = &$task;\n\t}", "public function setTaskId(TechDivision_Lang_Integer $taskId = null) \n\t{\n\t\t$this->_taskId = $taskId;\n\t}", "public function getId()\n {\n return $this->task_id;\n }", "public function getTaskid()\r\n {\r\n return $this->taskid;\r\n }", "public function getIdTask()\n {\n return $this->id_task;\n }", "public function getTask_id()\n {\n return $this->task_id;\n }", "public function getTaskid()\r\n {\r\n return $this->taskId;\r\n }", "public function getTask_id() {\n return $this->_task_id;\n }", "public function getIdTask()\n {\n return $this->idTask;\n }", "public function setId($value) { $this->_id = $value; }", "public function setTodoId($id)\n {\n $this->id = $id;\n }", "public function update_task_id($id){\n\t\t$data = $this->TskFile->TskFileDetail->find('all', array('conditions' => array('TskFileDetail.rand_id' => $this->Session->read('rand_id')), \n\t\t'fields'=> array('id')));\n\t\tforeach($data as $file_detail){\n\t\t\t$this->TskFile->TskFileDetail->id = $file_detail['TskFileDetail']['id'];\n\t\t\t$this->TskFile->TskFileDetail->saveField('tsk_files_id', $id);\n\t\t}\n\t}", "public function setId($value) { $this->id = $value;}", "function assignObjectPid(string $resourceId, TaskParam $param);", "public function set_task($task)\n {\n $task = asciiwords($task);\n\n if ($this->user && $this->user->ID)\n $task = !$task || $task == 'login' ? 'mail' : $task;\n else\n $task = 'login';\n\n $this->task = $task;\n $this->comm_path = $this->url(array('task' => $this->task));\n \n if ($this->output)\n $this->output->set_env('task', $this->task);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delay sync action to ensure that all post meta is saved before SP syncs.
protected function delay_sync_actions() { if ( class_exists( 'SP_Sync_Manager' ) && has_action( 'save_post', [ SP_Sync_Manager(), 'sync_post' ] ) ) { remove_action( 'save_post' ,[ SP_Sync_Manager(), 'sync_post' ] ); add_action( 'save_post', [ SP_Sync_Manager(), 'sync_post' ], 1000 ); } }
[ "public function afterSyncing() {}", "public function afterPostImport() {\n\t\t$this->resumeSyncHooks();\n\t}", "public function testPostSync() {\n\t\t$sites = ep_get_sites();\n\n\t\tforeach( $sites as $site ) {\n\t\t\tswitch_to_blog( $site['blog_id'] );\n\n\t\t\tadd_action( 'ep_sync_on_transition', array( $this, 'action_sync_on_transition' ), 10, 0 );\n\n\t\t\t$post_id = ep_create_and_sync_post();\n\n\t\t\tep_refresh_index();\n\n\t\t\t$this->assertTrue( ! empty( $this->fired_actions['ep_sync_on_transition'] ) );\n\n\t\t\t$post = ep_get_post( $post_id );\n\t\t\t$this->assertTrue( ! empty( $post ) );\n\n\t\t\t$this->fired_actions = array();\n\n\t\t\trestore_current_blog();\n\t\t}\n\t}", "public function update_delay_post_meta_callback() {\n\t\t\n\t\tDBG::log( \"Update the delay input for the post/page meta\" );\n\t\t\n\t\tcheck_ajax_referer( 'e20r-sequence-post-meta', 'e20r_sequence_postmeta_nonce' );\n\t\t\n\t\tDBG::log( \"Nonce Passed for postmeta AJAX call\" );\n\t\t\n\t\t$seq_id = isset( $_POST['e20r_sequence_id'] ) ? intval( $_POST['e20r_sequence_id'] ) : null;\n\t\t$post_id = isset( $_POST['e20r_sequence_post_id'] ) ? intval( $_POST['e20r_sequence_post_id'] ) : null;\n\t\t\n\t\tDBG::log( \"Sequence: {$seq_id}, Post: {$post_id}\" );\n\t\t\n\t\tif ( ! $this->init( $seq_id ) ) {\n\t\t\twp_send_json_error( $this->get_error_msg() );\n\t\t}\n\t\t\n\t\t$view = apply_filters( 'get_sequence_views_class_instance', null );\n\t\t$html = $view->load_sequence_list_meta( $post_id, $seq_id );\n\t\t\n\t\twp_send_json_success( $html );\n\t}", "public function afterSyncHook() {\n \n }", "public function saveSyncMeta($post_id)\n {\n if (isset($_POST['post_title']) && get_post_meta($post_id, 'imported_post', true)) {\n $data = isset($_POST['sync-checkbox']) ? 1 : 0;\n update_post_meta($post_id, 'sync', $data);\n\n if ($data == 0) {\n $importClient = get_post_meta($post_id, 'import_client', true);\n add_post_meta($post_id, 'orig_import_client', $importClient, true);\n delete_post_meta($post_id, 'import_client');\n } else {\n $orig_client = get_post_meta($post_id, 'orig_import_client', true);\n add_post_meta($post_id, 'import_client', $orig_client, true);\n delete_post_meta($post_id, 'orig_import_client');\n }\n }\n }", "public function testPostSync() {\n\t\tadd_action( 'ep_sync_on_transition', array( $this, 'action_sync_on_transition' ), 10, 0 );\n\n\t\t$post_id = ep_create_and_sync_post();\n\n\t\tep_refresh_index();\n\n\t\t$this->assertTrue( ! empty( $this->fired_actions['ep_sync_on_transition'] ) );\n\n\t\t$post = ep_get_post( $post_id );\n\t\t$this->assertTrue( ! empty( $post ) );\n\t}", "private function resumeSyncHooks() {\n\t\t$WCMLSynchronizeProductData = $this->getWCMLSynchronizeProductData();\n\n\t\tif ( false !== $WCMLSynchronizeProductData ) {\n\t\t\tadd_action( 'deleted_post_meta', [ $this->getWCMLSynchronizeProductData(), 'delete_empty_post_meta_for_translations' ], 10, 3 );\n\t\t}\n\n\t}", "public function beforeSyncing() {}", "public function manual_sync_callback() {\n\t\t// Check if action is set, bail early if not.\n\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\t\tif ( self::MANUAL_SYNC_ACTION !== $action ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Verify nonce\n\t\t$nonce = filter_input( INPUT_POST, '_wpnonce', FILTER_SANITIZE_STRING );\n\t\tif ( ! wp_verify_nonce( $nonce, self::MANUAL_SYNC_ACTION ) ) {\n\t\t\twp_die( new \\WP_Error( 'wpp-youtube-invalid-nonce', _x( 'Invalid Nonce.', '', 'wpp-youtube' ) ) );\n\t\t};\n\n\t\t// Trigger Manual Sync!\n\t\twp_schedule_single_event( time(), Cron::MANUAL_SYNC, [ 'force' => true ] );\n\n\t\t// Redirect to Sync Status.\n\t\t$status_url = add_query_arg(\n\t\t\t[ 'page' => self::SYNC_PAGE_SLUG, ],\n\t\t\tget_admin_url( null, 'admin.php' )\n\t\t);\n\n\t\twp_safe_redirect( $status_url );\n\n\t\treturn true;\n\t}", "public function onPostFlush() {\n\t\t$this->emitSiteChanged();\n\t}", "public function sync() {\n\t\t$this->pull_db();\n\t\t$this->post_sync();\n\t}", "public function onPostFlush()\n {\n $this->emitSiteChanged();\n }", "public function check_sync() {\n\n\t\t\t// Display notice on success redirect.\n\t\t\tif ( isset( $_GET['acfsynccomplete'] ) ) {\n\t\t\t\t$ids = array_map( 'intval', explode( ',', $_GET['acfsynccomplete'] ) );\n\n\t\t\t\t// Generate text.\n\t\t\t\t$text = sprintf(\n\t\t\t\t\t_n( 'Field group synchronised.', '%s field groups synchronised.', count( $ids ), 'acf' ),\n\t\t\t\t\tcount( $ids )\n\t\t\t\t);\n\n\t\t\t\t// Append links to text.\n\t\t\t\t$links = array();\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\t$links[] = '<a href=\"' . get_edit_post_link( $id ) . '\">' . get_the_title( $id ) . '</a>';\n\t\t\t\t}\n\t\t\t\t$text .= ' ' . implode( ', ', $links );\n\n\t\t\t\t// Add notice.\n\t\t\t\tacf_add_admin_notice( $text, 'success' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Find items to sync.\n\t\t\t$keys = array();\n\t\t\tif ( isset( $_GET['acfsync'] ) ) {\n\t\t\t\t$keys[] = sanitize_text_field( $_GET['acfsync'] );\n\t\t\t} elseif ( isset( $_GET['post'], $_GET['action2'] ) && $_GET['action2'] === 'acfsync' ) {\n\t\t\t\t$keys = array_map( 'sanitize_text_field', $_GET['post'] );\n\t\t\t}\n\n\t\t\tif ( $keys && $this->sync ) {\n\t\t\t\tcheck_admin_referer( 'bulk-posts' );\n\n\t\t\t\t// Disabled \"Local JSON\" controller to prevent the .json file from being modified during import.\n\t\t\t\tacf_update_setting( 'json', false );\n\n\t\t\t\t// Sync field groups and generate array of new IDs.\n\t\t\t\t$files = acf_get_local_json_files();\n\t\t\t\t$new_ids = array();\n\t\t\t\tforeach ( $this->sync as $key => $field_group ) {\n\t\t\t\t\tif ( $field_group['key'] && in_array( $field_group['key'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} elseif ( $field_group['ID'] && in_array( $field_group['ID'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Ignore.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$local_field_group = json_decode( file_get_contents( $files[ $key ] ), true );\n\t\t\t\t\t$local_field_group['ID'] = $field_group['ID'];\n\t\t\t\t\t$result = acf_import_field_group( $local_field_group );\n\t\t\t\t\t$new_ids[] = $result['ID'];\n\t\t\t\t}\n\n\t\t\t\t// Redirect.\n\t\t\t\twp_redirect( $this->get_current_admin_url( '&acfsynccomplete=' . implode( ',', $new_ids ) ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "public function save()\n {\n $this->settings->savePostSettings();\n }", "function preSyncHook()\n {\n \t$aPreScripts = $this->iniGet('PreSyncScripts', 'SynchronizationSettings');\n\t foreach ($aPreScripts as $script)\n \t{\n\t \t\n \t\teZStaticExportLogger::log(\"Excuting POST sync script '$script'\");\n \t\t$return = null;\n\t \t$output = array();\n\t exec( $script, $output, $return );\t \n\t\n\t if ( $return != 0 )\n\t {\n\t eZStaticExportLogger::log(\"An error occured executing the POST sync script '$script'\", eZStaticExportLogger::LOG_TYPE_WARNING );\n\t echo implode( \"\\n\", $output );\n\t }\n\t else\n\t {\n\t eZLog::write(implode(\"\\n\", $output), 'staticexport-pre-sync.log');\n\t }\n \t}\n }", "protected function _postSave()\n {}", "public function setLastDynamicsSync(): void;", "protected function _afterSave()\r\n {\r\n $this->updatePostCommentCount();\r\n parent::_afterSave();\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get All Requisition Comments By Requisition Id
public function getAllRequisitionCommentsByRequisitionId($id) { $sql = " SELECT `requisition_comments`.`comment` as requisition_comment, `requisition_comments`.`datetime_added` as comment_datetime_added, `users`.`firstname` as user_firstname, `users`.`lastname` as user_lastname FROM `requisition_comments` JOIN `users` ON `users`.`id` = `requisition_comments`.`user_id` WHERE `requisition_comments`.`requisition_id` = $id "; return $this->raw($sql); }
[ "public function getAllInvoiceCommentById($id)\n {\n return DB::table( Database::COMMENT)->where('invoice_id', $id)->get();\n }", "public function getAllInvoiceComments($invoice_id = NULL)\n {\n\treturn $this->setRequestData(sprintf(self::RESOURCE_INVOICE_COMMENTS, $invoice_id));\n }", "public function getComments()\n {\n return Comment::whereIdFor(Auth()->user()->id)->get();\n }", "public function listComments($issue_id);", "public function getCommentsList($id);", "public function getAllComments()\n {\n $result = self::$dbInterface -> query(\"SELECT commentID, comment, card_cardID, user_userID \n FROM comment\");\n return $result;\n }", "public function allComments($id)\n {\n $comments = CourseComment::where('course_id', $id)->where('replay', 0)->with('replay')->with('user')->get();\n return CommentsResource::collection($comments)->additional(['success' => true, 'status' => 200]);\n }", "public function getComments() {\n if(!isset($this->comments))\n {\n $mapper = new Application_Model_CommentsMapper();\n $this->comments = $mapper->findAllByFieldsAndValues(array(\"id\"=>$this->id));\n }\n return $this->comments;\n }", "public function getCommentsList()\n\t{\n\t\treturn (new \\App\\Db\\Query())\n\t\t\t->select(['comments' => 'commentcontent'])\n\t\t\t->from('vtiger_modcomments')\n\t\t\t->where(['related_to' => $this->getId()])->column();\n\t}", "public function getComments();", "public function getMediaComments($id);", "public function getComments($activityId) {\n require_once __DIR__.'/../../../../vendor/google/apiclient/src/Google/Service/Plus.php';\n \n $this->_google->setAccessToken($this->_token['data']);\n \n $plus = new Google_Service_Plus($this->_google);//var_dump($plus->activities);die;\n $params = array();\n $comments = $plus->comments->listComments($activityId, $params); \n //$searchResponse = $plus->activities->listActivities('me', 'public', array('maxResults'=>1)); \n //var_dump($searchResponse);die;\n return $comments;\n }", "public function getComments($id)\n {\n return Product::find($id)->with('comments')->get();\n }", "public function getComments()\n {\n return Comment::getAllByThread($this->id);\n }", "public function getByIdWithRelations($commentId);", "public function getAllCommentaires()\n {\n $sql = 'SELECT COM_ID as id, COM_DATE as date,'\n . ' COM_AUTEUR as auteur, COM_CONTENU as contenu FROM t_commentaire'\n . ' ';\n $commentaires = $this->executerRequete($sql);\n return $commentaires;\n }", "private function allComments(){\n\t\t$modelComment = $this->factory->getModel('Comment'); \n\t\treturn $modelComment->all();\n\t}", "public function getComments()\n {\n $comments = array();\n\n $sql = 'SELECT id_comment, usercomment, comment';\n $sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_comments';\n $sql.= \" WHERE id_sondage='\".$this->db->escape($this->id_sondage).\"'\";\n $sql.= \" ORDER BY id_comment\";\n $resql = $this->db->query($sql);\n\n if ($resql)\n {\n $num_rows=$this->db->num_rows($resql);\n\n if ($num_rows > 0)\n {\n while ($obj = $this->db->fetch_object($resql))\n {\n $comments[] = $obj;\n }\n }\n }\n\n return $comments;\n }", "public static function find_comments_on($request_id = 0) {\n\t\tglobal $database;\n\t\t$sql = \"SELECT * FROM \" . self::$table_name;\n\t\t$sql .= \" WHERE request_id=\" . $database -> escape_value($request_id);\n\t\t$sql .= \" ORDER BY created ASC\";\n\t\treturn self::find_by_sql($sql);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ static function sets the id of the groupunit using their groupid
function setGroupUnitID($groupId) { global $default; $id = lookupID($default->groups_units_table, "group_id", $groupId); $this->iId= $id; }
[ "public function setGroup($id);", "public function setIdGroup($idGroup){\n $this->idGroup = $idGroup;\n\n }", "function set_group_id($value, $index=NULL) {\n\t\t$this->_data['cell_id'] = $value;\n\t}", "public function setIdGroup($id_group)\n\t{\n\t\t$this->id_group = $id_group;\n\t\treturn $this;\n\t}", "public function set_group_id( $group_id = 0 ) {\n\t\tglobal $wpdb;\n\n\t\t$group_id = (int)$group_id;\n\t\t// Add line before, set group\n\t\tif ( !$this->exists( ) ) {\n\t\t\t$this->add( );\n\t\t}\n\n\t\t// Set group if line exist\n\t\tif ( $this->exists( ) ) {\n\t\t\t$wpdb->update( $wpdb->bea_mm_connections, array( 'group_id' => $group_id ), array( 'id' => $this->obj->id ), array( '%d' ), array( '%d' ) );\n\t\t\t$this->obj->group_id = $group_id;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function testPutGroupsId()\n {\n }", "public function lookup_group($id);", "public function SupportSetGroup($id){\n\t if($this->support){\n return $this->support->SetGroup($id);\n }\n return false;\t\n\t}", "function LDAP_addNewGroupID($id)\n{\n\tLDAP_addNewID(\"group\",$id);\n}", "public function add_group($group_id);", "public function testSetId() {\n\t\techo (\"\\n********************Test SetId()************************************************************\\n\");\n\t\n\t\t$this->locus->setId( 120000 );\n\t\t$this->assertEquals ( 120000, $this->locus->getId() );\n\t}", "public function setUnitId($unit_id);", "public function testSetId() {\n\t\techo (\"\\n********************Test SetId()*********************************************************\\n\");\n\t\t\n\t\t$this->chromosome->setId ( 2 );\n\t\t$this->assertEquals ( 2, $this->chromosome->getId () );\n\t}", "function change_identity_group_name($telegram_id, $group_name = NULL) {\n $group_name_db = is_null($group_name) ? 'NULL' : \"'\" . db_escape($group_name) . \"'\";\n\n return db_perform_action(\"UPDATE `identity` SET `group_name` = {$group_name_db} WHERE `identity`.`telegram_id` = {$telegram_id}\");\n}", "public function setId($value) { $this->_id = $value; }", "function set_id($id){\n $this->id->value = $id;\n }", "public function setIdUnit($id_unit)\n {\n $this->id_unit = $id_unit;\n\n return $this;\n }", "function setItemGroupRefId($a_val)\n\t{\n\t\t$this->item_group_ref_id = $a_val;\n\t}", "function setEventGroupId($id)\n {\n $this->__eventgroupid = $id ;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test get/set placementDescription methods
public function testGetPlacementDescription() { $object = new ItemDescriptor(); $object->setPlacementDescription("none"); $actualValue = $object->getPlacementDescription(); $this->assertEquals($actualValue, "none"); }
[ "public function testSetGetDescription()\n {\n $this->item->setDescription('A fine javelin, suitable for throwing at retreating enemies.');\n $this->assertEquals($this->item->getDescription(), 'A fine javelin, suitable for throwing at retreating enemies.');\n }", "abstract protected function getPositionDescription();", "public function testGetAndSetDescriptionFunction()\n {\n $description = 'description';\n $this->assertEquals($description, $this->getContent()->setDescription($description)->getDescription());\n }", "public function testGetDescription()\n {\n $this->assertEquals(\n self::$testDescription,\n $this->researchGroup->getDescription()\n );\n }", "public function descriptionCanBeSetTest() {\n\t\t$description = 'a description';\n\t\t$this->fixture->setDescription($description);\n\t\t$this->assertEquals($description, $this->fixture->getDescription());\n\t}", "public function testPlaceClass()\n {\n $olapic_name = \"Olapic Argentina S.A\";\n $olapic_address = \"Santiago Derqui 33, Córdoba, Argentina\";\n\n $place = new Place();\n $place->__set(\"name\", $olapic_name);\n $place->__set(\"address\", $olapic_address);\n\n $this->assertEquals($olapic_name, $place->__get(\"name\"));\n $this->assertEquals($olapic_address, $place->__get(\"address\"));\n }", "public function testSetDescription()\n {\n $description = 'The quick brown fox jumps over the lazy dog';\n $this->description->setDescription($description);\n $this->assertEquals($description, self::getProperty($this->description, 'description'), 'Failed to set description');\n }", "function placement()\r\n {\r\n return $this->Placement;\r\n }", "public function testSetAndGetSpreadsheetDescription(){\n\n\t}", "public function testGetLocusDesc() {\n\t\techo (\"\\n********************Test GetLocusDesc()*****************************************************\\n\");\n\t\n\t\t$this->stubedLocus->method( 'getLocusDesc' )->willReturn ( 'getLocusDesc' );\n\t\t$this->assertEquals( 'getLocusDesc', $this->stubedLocus->getLocusDesc() );\n\t}", "public function testShowDescription()\n {\n $value = rand();\n $this->fixture->setDescription($value);\n\n $actual = $this->fixture->getDescription();\n $this->assertSame((string) $value, $actual, 'Problem getting or setting the Show Description as a string.');\n }", "public function test_description()\n\t{\n\t\treturn $this->context_description() . \" should $this->current_description\";\n\t}", "public function testGetDescription()\n {\n $this->assertEquals(\n self::$testDescription,\n $this->dataRepository->getDescription()\n );\n }", "public function getPlacement()\n {\n return $this->placement;\n }", "public function testGetDescription_success()\n {\n $listing= new Listing('CSL123_100259', 'Hill Farm', 'Plough Hill Road', 'Nuneaton', 'CV11 6PE', 'This is a rare opportunity...', '6','355000', 'CSL123_100327_IMG_00.JPG','1','For Sale');\n $result= $listing->getDescription();\n $expected= 'This is a rare opportunity...';\n $this->assertEquals($expected, $result);\n }", "public function testSetGetPlace()\n {\n $place = new Place();\n $operation = (new Operation())->setPlace($place);\n $this->assertEquals($place, $operation->getPlace());\n }", "public function testListPlace()\n {\n }", "public function testGetSetMonitoringPlace()\n {\n $fake_monitoring = new Monitoring;\n $fake_place = \"UED Lab. MOCAP\";\n $fake_monitoring->setMonitoringPlace($fake_place);\n $this->assertEquals($fake_place, $fake_monitoring\n ->getMonitoringPlace());\n }", "public function testGetBlockComponentDescription()\n {\n $this->assertEquals('description', $this->manager->getBlockComponentDescription('menu'));\n $this->assertEquals('', $this->manager->getBlockComponentDescription('fake'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get active emails quantity
public function getActiveEmailQty(): int { return $this->activeEmailQty; }
[ "public function getActiveEmailQty(): int;", "public function getInactiveEmailQty(): int\n {\n return $this->inactiveEmailQty;\n }", "public function getNbOfEMailings()\n\t{\n\t\t$sql = \"SELECT count(mc.email) as nb\";\n\t\t$sql.= \" FROM \".MAIN_DB_PREFIX.\"mailing_cibles as mc\";\n\t\t$sql.= \" WHERE mc.email = '\".$this->db->escape($this->email).\"'\";\n\t\t$sql.= \" AND mc.statut NOT IN (-1,0)\"; // -1 erreur, 0 non envoye, 1 envoye avec succes\n\n\t\t$resql=$this->db->query($sql);\n\t\tif ($resql)\n\t\t{\n\t\t\t$obj = $this->db->fetch_object($resql);\n\t\t\t$nb=$obj->nb;\n\n\t\t\t$this->db->free($resql);\n\t\t\treturn $nb;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error=$this->db->error();\n\t\t\treturn -1;\n\t\t}\n\t}", "public function countMails()\n\t{\n\t\treturn $this->count;\n\t}", "function countPending() {\n return IncomingMails::count(array('state > 0'));\n }", "public function getEmailTotal()\n {\n @list($messages, $octets) = explode(' ', $this->call('STAT'));\n $messages = is_numeric($messages) ? $messages : 0;\n\n return $messages;\n }", "public function getCntRecipients()\n {\n return $this->CntRecipients;\n }", "public function countmailsSupport(){\n $sql = \"SELECT COUNT(*) FROM customers_questions\";\n return $this->executeRequest($sql)->fetch();\n }", "public function getItemsQuantity(){\n return $this->oCart->itemcount();\n }", "public function getTotalMails(){\n if(!$this->marubox) return false; \n\n return imap_num_msg($this->marubox); \n }", "public function getPurchaseOrderCount();", "function it_exchange_get_abandoned_cart_email_times_sent( $email_id ) {\n\t$sent = (int) get_post_meta( $email_id, '_it_exchange_abandoned_cart_emails_sent', true );\n\treturn empty( $sent ) ? 0 : $sent;\n}", "public function getDeliveredQuantity()\n {\n return $this->deliveredQuantity;\n }", "public function getQuantityTickets()\n {\n return $this->quantity_tickets;\n }", "public function getReceivedQuantity()\n {\n return $this->receivedQuantity;\n }", "public function getTotalDeliveredQuantity()\n {\n return $this->totalDeliveredQuantity;\n }", "public function count()\n {\n return count($this->mails);\n }", "public function getUserQuantity()\n {\n return count($this->db->fetchAll(self::TODAY));\n }", "public function getMailboxTotal()\n {\n return $this->imap->getNumberOfMessages();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to create a Evento entity.
private function createCreateForm(Evento $entity) { $form = $this->createForm(new EventoType(), $entity, array( 'action' => $this->generateUrl('evento_create'), 'method' => 'POST', )); $form->add('submit', 'submit', array('label' => 'Crear')); return $form; }
[ "private function createCreateForm(Event $entity)\n {\n $form = $this->createForm(new EventType(), $entity, array(\n 'action' => $this->generateUrl('organizer_event_create'),\n 'method' => 'POST',\n ));\n// $em = $this->getDoctrine()->getManager();\n// $defaultPayment = $em->find('WOOrganizerBundle:Paymentmethod',1);\n// $form->add('paymentmethod', null, array('label' => 'Bezahlmethode',\n// 'data' => (isset($entity) && null !== ($entity->getPaymentmethod()))?$entity->getPaymentmethod():$defaultPayment));\n $form->add('submit', 'submit', array('label' => 'Speichern', 'attr' => array('class' => 'btn btn-primary pull-right')));\n return $form;\n }", "private function createCreateForm(TipoEvento $entity) {\n $form = $this->createForm(new TipoEventoType(), $entity, array(\n 'action' => $this->generateUrl('tipos_eventos_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Crear tipo de evento', 'attr' => array('class' => 'btn btn-success btn-large')));\n\n return $form;\n }", "private function createCreateForm(Event $entity)\n {\n $form = $this->createForm(new EventType(), $entity, array(\n 'action' => $this->generateUrl('event_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Event $entity)\n {\n $form = $this->createForm(new EventType(), $entity, array(\n 'action' => $this->generateUrl('event_new'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Event $entity)\n {\n $eventType = new EventType();\n $form = $this->createForm($eventType, $entity, array(\n 'attr' => ['id' => $eventType->getName() . \"_id\"],\n 'action' => $this->generateUrl('event_create'),\n 'method' => 'POST',\n ));\n\n return $form;\n }", "function CreateForm(){\r\n\t\t$form = parent::CreateForm();\r\n\t\tif(!$form) return; //there may be no form\r\n\t\tif($events = Event::current_events(5))\r\n\t\t\t$form->Fields()->push(new DropdownField('EventID','Event',$events->toDropdownMap()));\r\n\r\n\t\t$this->extend('updateCreateForm',$form,$this->modelClass);\r\n\t\treturn $form;\r\n\t}", "public function actionCreate()\n {\n $model = new Evento();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idevento]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function action_create() {\n\tif (Input::method() == \"POST\") {\n\t $val = Model_Orm_Event::validate('create');\n\t if ($val->run()) {\n\t\t$newEvent = new Model_Orm_Event();\n\t\t$newEvent->title = $val->validated(\"title\");\n\t\t$newEvent->start = $val->validated(\"start\");\n\t\t$newEvent->description = $val->validated(\"description\");\n\t\t$location = Model_Orm_Location::find(Input::post(\"location\"));\n\t\t$newEvent->location = $location;\n\t\t$newEvent->save();\n\t\tSession::set_flash(\"success\", \"New event created: \" . $val->validated(\"title\"));\n\t\tResponse::redirect(\"event/view/\" . $newEvent->id);\n\t } else {\n\t\tSession::set_flash(\"error\", $val->error());\n\t }\n\t $this->template->title = \"Trying to save an event\";\n\t} else {\n\t $this->template->title = \"Creating an event\";\n\t}\n\n\t$data = array();\n\t$data[\"locations\"] = Model_Orm_Location::get_locations();\n\n\t//since we have \"rich form\", additional scripts\n\t//and stylesheets are needed\n\t$this->template->libs_js = array(\n\t\t\"http://code.jquery.com/jquery-1.8.2.js\",\n\t\t\"http://code.jquery.com/ui/1.9.1/jquery-ui.js\",\n\t\t\"jquery-ui-timepicker-addon.js\",\n\t\t\"http://cdn.aloha-editor.org/latest/lib/require.js\"\n\t\t);\n\t$this->template->libs_css = array(\n\t\t\"http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css\",\n\t\t\"datetimepicker.css\",\n\t\t\"http://cdn.aloha-editor.org/latest/css/aloha.css\"\n\t\t\t);\n\n\t\n\t$this->template->page_content = View::forge(\"event/create\", $data);\n }", "public function createAction()\n {\n $entity = new InstanciaEvento();\n $request = $this->getRequest();\n \n $form = $this->createForm(new InstanciaEventoType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n if ($form['preview']->getData()) {\n \t$form['preview']->setData( false ); \n \t return array(\n\t\t \t\t'entity' => $entity,\n\t\t \t\t'form' => $form->createView(),\n\t\t \t\t'preview_invitacion' => $this->getFakeEmail($entity)\n\t\t \t\t \t\t);\n\t }\n \t\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\t\t\t$this->setSuccessMessage(\"Instancia de evento creada satisfactoriamente\");\n return $this->redirect($this->generateUrl('instancia_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function actionCreate()\n {\n $model = new EventForm();\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 'viewModel' => new EventCreateView(),\n ]);\n }", "public function newAction()\n {\n \t$entity = new InstanciaEvento();\n \n $eventoid = $this->getRequest()->query->get('evento_id', 0);\n \tif ($eventoid)\n \t\t$entity->setEvento($this->getRepository('CpmJovenesBundle:Evento')->find($eventoid));\n \t\t\n $form = $this->createForm(new InstanciaEventoType(), $entity);\n\t\t$form['preview']->setData(true);\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "private function createCreateForm(Equipo $entity)\n {\n $form = $this->createForm(new EquipoType(), $entity, array(\n 'action' => $this->generateUrl('tecnoequipo_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function actionCreate()\n {\n $this->setUpLayout('form');\n\n $this->model = $this->eventsModule->createModel('EventType');\n\n if ($this->model->load(Yii::$app->request->post()) && $this->model->validate()) {\n if ($this->model->save()) {\n Yii::$app->getSession()->addFlash('success', AmosEvents::t('amosevents', 'Element successfully created.'));\n return $this->redirect(['index']);\n } else {\n Yii::$app->getSession()->addFlash('danger', AmosEvents::t('amosevents', 'Element not created, check the data entered.'));\n }\n }\n\n return $this->render('create', [\n 'model' => $this->model,\n 'fid' => null,\n 'dataField' => null,\n 'dataEntity' => null,\n ]);\n }", "private function createCreateForm(Envio $entity)\r\n {\r\n $form = $this->createForm(new EnvioType(), $entity, array(\r\n 'action' => $this->generateUrl('envios_create'),\r\n 'method' => 'POST',\r\n 'em'=>$this->getDoctrine()->getManager(),\r\n ));\r\n\r\n //$form->add('submit', 'submit', array('label' => 'Create'));\r\n\r\n return $form;\r\n }", "public function create() {\n if ( $this->f3->exists( 'POST.create' ) ) {\n $event = new Event( $this->db );\n $event->add();\n\n $this->f3->reroute( '/esuccess/New event Created' );\n } else {\n $this->f3->set( 'page_head', 'Create Event' );\n $this->f3->set( 'view', 'event/create.htm' );\n $this->f3->set( 'type', 'event' );\n }\n\n }", "private function createCreateForm(Ecole $entity)\n {\n $form = $this->createForm(new EcoleType(), $entity, array(\n 'action' => $this->generateUrl('ecole_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm()\n {\n\n \n $form = $this->createForm(new EntregasHcType($this->getDoctrine()->getManager()),null, array(\n 'action' => $this->generateUrl('entregas_hc'),\n 'method' => 'POST',\n 'attr' => array('id' => 'entregas-form')\n ));\n\n \n $form->add('submit', 'submit', array('label' => 'Agregar',\n 'attr' => array('class' =>'btn btn-success')));\n\n \n \n return $form;\n }", "public function actionCreate()\n {\n $model = new Evento();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $model->id_usuario = $_SESSION['__id'];\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "private function createCreateForm(Pago $entity,$ev)\n {\n $form = $this->createForm(new PagoType(), $entity, array(\n 'action' => $this->generateUrl('pago_create',array('id'=>$ev)),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new ChildDocumentDateQuery object.
public static function create($modelAlias = null, Criteria $criteria = null) { if ($criteria instanceof ChildDocumentDateQuery) { return $criteria; } $query = new ChildDocumentDateQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
[ "private function get_date_query( $args = array() ) {\n\t\treturn new Queries\\Date( $args );\n\t}", "public function testQueryDateObject()\n {\n //The QueryDate\n $QueryDate = new MediaManager\\Analytics\\QueryDate('23-02-2016');\n\n //Check the default get\n $this->assertEquals('2016-02-23', $QueryDate->get());\n\n //Check setting of format works.\n $this->assertEquals('23-02-2016', $QueryDate->get('d-m-Y'));\n\n //Add 2 days\n $QueryDate->addDays(2);\n $this->assertEquals('25-02-2016', $QueryDate->get('d-m-Y'));\n\n //Remove two days.\n $QueryDate->subDays(4);\n $this->assertEquals('21-02-2016', $QueryDate->get('d-m-Y'));\n }", "public function whereDateTo($date)\n {\n $this->addWhereClause('node.creationDate <= :dateTo');\n $this->parameters[':dateTo'] = $date;\n\n return $this;\n }", "public function setDateRequest($dateRequest) : self\n {\n $this->dateRequest = $dateRequest;\n\n return $this;\n }", "public static function get_main_date_query() {\n $date_query = isset( self::$movie_query->date_query, self::$movie_query->date_query->queries ) ? self::$movie_query->date_query->queries : array();\n\n return $date_query;\n }", "public function newQuery()\n {\n return new Query($this);\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->processor);\n }", "public function dates()\n {\n return $this->hasMany(DocumentDate::class);\n }", "public function whereDateFrom($date)\n {\n $this->addWhereClause('node.creationDate >= :dateFrom');\n $this->parameters[':dateFrom'] = $date;\n\n return $this;\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->grammar, $this->processor);\n }", "public static function init(): self\n {\n return new self(new DateRange());\n }", "public function dateOrder()\n {\n $this->arguments[] = '--date-order';\n return $this;\n }", "public function newQuery()\n\t{\n\t\treturn new Sqloo_Query( $this );\n\t}", "public function newQuery() : QueryBuilder;", "public static function create($modelAlias = null, Criteria $criteria = null)\n {\n if ($criteria instanceof ChildGlDatesQuery) {\n return $criteria;\n }\n $query = new ChildGlDatesQuery();\n if (null !== $modelAlias) {\n $query->setModelAlias($modelAlias);\n }\n if ($criteria instanceof Criteria) {\n $query->mergeWith($criteria);\n }\n\n return $query;\n }", "protected function whereDate(Builder $query, $where) {\n\t return $this->dateBasedWhere('date', $query, $where);\n\t}", "public function createQuery()\n\t{\n\t\treturn $this->pp->createQuery('modules_blog/month');\n\t}", "public function setDocumentDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->document_date !== null || $dt !== null) {\n $currentDateAsString = ($this->document_date !== null && $tmpDt = new DateTime($this->document_date)) ? $tmpDt->format('Y-m-d') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->document_date = $newDateAsString;\n $this->modifiedColumns[] = DocPeer::DOCUMENT_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function createStrictQuery()\n\t{\n\t\treturn $this->pp->createQuery('modules_blog/month', false);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
save notime shipmentId to table 'notime_shipping'
public function notime_shipping_save_shipment_id($event) { if(!Mage::getStoreConfig('carriers/notime/active', Mage::app()->getStore()->getId())) return; $_quote = $event->getQuote(); $request = Mage::app()->getRequest(); $shipmentId = trim($request->getPost('notime_shipment_id')); if($shipmentId == '') { return; } try { $resource = Mage::getSingleton('core/resource'); $writeConnection = $resource->getConnection('core_write'); $writeConnection->delete( "notime_shipping", "quote_id=".$_quote->getId() ); $writeConnection->insert( "notime_shipping", array("quote_id" => $_quote->getId(),"shipment_id" => $shipmentId, "status" => 0) ); } catch (Exception $e) { mage::log('Error when processing shipping method:'.$e->getMessage(), false, 'notime_shipping.log'); } }
[ "public function saveShipment(ShipmentRequest $request){\n\t\t$shipmentRequest = $request->all();\n\t\t$shipment = new Shipment($shipmentRequest);\n\t\t$shipment->save();\n\t\treturn $shipment->id;\n\t}", "private function saveShipmentTrackingNoAction()\n\t\t{\n\t\t\tif(empty($_POST['id'])) {\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$query = \"\n\t\t\t\tSELECT shipmentid\n\t\t\t\tFROM [|PREFIX|]shipments\n\t\t\t\tWHERE shipmentid='\".(int)$_POST['id'].\"'\n\t\t\t\";\n\t\t\tif(!$this->db->fetchOne($query)) {\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Attempt to update the shipment ID\n\t\t\t$updatedShipment = array(\n\t\t\t\t'shiptrackno' => $_POST['trackingNo']\n\t\t\t);\n\t\t\tif(!$this->db->updateQuery('shipments', $updatedShipment, \"shipmentid='\".(int)$_POST['id'].\"'\")) {\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\techo isc_json_encode(array(\n\t\t\t\t'result' => true\n\t\t\t));\n\t\t\texit;\n\t\t}", "public function store_product_shipping(Request $request , int $post_id);", "public function save(\\Temando\\Shipping\\Api\\Data\\Shipment\\ShipmentReferenceInterface $shipment);", "function insertShippingAddress()\n\t{\n\t\n\t\t$obj=new Bin_Query();\n\t\t$sql=\"INSERT INTO addressbook_table(user_id,contact_name,first_name,company,address,city,suburb,state,country,zip,phone_no)VALUES('\".$_SESSION['user_id'].\"','\".$_POST['txtname'].\"','\".$_POST['txtname'].\"','\".$_POST['txtcompany'].\"','\".$_POST['txtstreet'].\"','\".$_POST['txtcity'].\"','\".$_POST['txtsuburb'].\"','\".$_POST['txtstate'].\"','\".$_POST['selshipcountry'].\"','\".$_POST['txtzipcode'].\"','\".$_POST['txtphone'].\"')\";\n\t\tif($obj->updateQuery($sql))\n\t\t{\n\t\t\t$obj1=new Bin_Query();\n\t\t\t$sql1=\"UPDATE users_table SET shipping_address_id='\".mysql_insert_id().\"' WHERE user_id='\".$_SESSION['user_id'].\"'\";\n\t\t\t$obj1->updateQuery($sql1);\n\t\t\theader(\"Location:?do=showcart&action=getshippingmethod\");\n\t\t\texit();\n\t\t}\n\n\n\t}", "public function save_shipping() {\n\t\t/* NEEDS FORM VALIDATION */\n\t\t$this->Mailing_Address->save_shipping($this->input->post());\n\n\t\tredirect('/billing');\n\t}", "public function shipped () {\n $this->shipped = true;\n $this->save();\n }", "public function saveAction()\n {\n $data = $this->getRequest()->getPost('shipment');\n if (!empty($data['comment_text'])) {\n Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);\n }\n\n try {\n $shipment = $this->_initShipment();\n\n if (!$shipment) {\n $this->_forward('noRoute');\n return;\n }\n\n $shipment->register();\n $comment = '';\n if (!empty($data['comment_text'])) {\n $shipment->addComment(\n $data['comment_text'],\n isset($data['comment_customer_notify']),\n isset($data['is_visible_on_front'])\n );\n if (isset($data['comment_customer_notify'])) {\n $comment = $data['comment_text'];\n }\n }\n\n if (!empty($data['send_email'])) {\n $shipment->setEmailSent(true);\n }\n\n $shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));\n $responseAjax = new Varien_Object();\n $isNeedCreateLabel = isset($data['create_shipping_label']) && $data['create_shipping_label'];\n\n if ($isNeedCreateLabel && $this->_createShippingLabel($shipment)) {\n $responseAjax->setOk(true);\n }\n\n $this->_saveNewPostWaybill($shipment);\n\n $this->_saveShipment($shipment);\n\n $shipment->sendEmail(!empty($data['send_email']), $comment);\n\n $shipmentCreatedMessage = $this->__('The shipment has been created.');\n $labelCreatedMessage = $this->__('The shipping label has been created.');\n\n $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage\n : $shipmentCreatedMessage);\n Mage::getSingleton('adminhtml/session')->getCommentText(true);\n\n } catch (Mage_Core_Exception $e) {\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage($e->getMessage());\n } else {\n $this->_getSession()->addError($e->getMessage());\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n } catch (Exception $e) {\n Mage::logException($e);\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage(\n Mage::helper('sales')->__('An error occurred while creating shipping label.'));\n } else {\n $this->_getSession()->addError($this->__('Cannot save shipment.'));\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n\n }\n if ($isNeedCreateLabel) {\n $this->getResponse()->setBody($responseAjax->toJson());\n } else {\n $this->_redirect('*/sales_order/view', array('order_id' => $shipment->getOrderId()));\n }\n }", "public function save(){\n\n $this->validate();\n\n if ($this->shipping_id) {\n $shipping = ShippingCompany::find($this->shipping_id);\n } else {\n $shipping = new ShippingCompany();\n }\n $shipping->name = $this->name;\n $shipping->phone = $this->phone;\n $shipping->address = $this->address;\n $shipping->mobile = $this->mobile;\n $shipping->save();\n\n $this->clear();\n }", "public function saveShipment(ShipmentInterface $shipment): ShipmentInterface;", "public function saveAction()\n {\n $data = $this->getRequest()->getPost('shipment');\n if (!empty($data['comment_text'])) {\n $this->_getSession()->setCommentText($data['comment_text']);\n }\n\n try {\n $shipment = $this->_initShipment();\n if (!$shipment) {\n $this->_forward('noRoute');\n return;\n }\n\n $shipment->register();\n $comment = '';\n if (!empty($data['comment_text'])) {\n $shipment->addComment(\n $data['comment_text'],\n isset($data['comment_customer_notify']),\n isset($data['is_visible_on_front'])\n );\n if (isset($data['comment_customer_notify'])) {\n $comment = $data['comment_text'];\n }\n }\n\n if (!empty($data['send_email'])) {\n $shipment->setEmailSent(true);\n }\n\n $shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));\n $responseAjax = new Varien_Object();\n $isNeedCreateLabel = isset($data['create_shipping_label']) && $data['create_shipping_label'];\n\n if ($isNeedCreateLabel && $this->_createShippingLabel($shipment)) {\n $responseAjax->setOk(true);\n }\n\n $this->_saveShipment($shipment);\n /*SEND shipment email here*/\n Mage::helper('vendorssales')->sendShipmentEmail($shipment,!empty($data['send_email']), $comment);\n\n $shipmentCreatedMessage = $this->__('The shipment has been created.');\n $labelCreatedMessage = $this->__('The shipping label has been created.');\n\n $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage\n : $shipmentCreatedMessage);\n Mage::getSingleton('adminhtml/session')->getCommentText(true);\n } catch (Mage_Core_Exception $e) {\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage($e->getMessage());\n } else {\n $this->_getSession()->addError($e->getMessage());\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n } catch (Exception $e) {\n Mage::logException($e);\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage(\n Mage::helper('sales')->__('An error occurred while creating shipping label.'));\n } else {\n $this->_getSession()->addError($this->__('Cannot save shipment.'));\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n\n }\n if ($isNeedCreateLabel) {\n $this->getResponse()->setBody($responseAjax->toJson());\n } else {\n $this->_redirect('*/sales_order/view', array('order_id' => $shipment->getOrderId()));\n }\n }", "public function saveShippingAction()\n {\n \n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getPost('shipping', array());\n $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n \t$result = $this->getOnepage()->saveShipping($data, $customerAddressId);\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$result['error'] = true;\n\t\t\t\t$result['error_messages'] = $e->getMessage(); \n\t\t\t}\n\t\t\treturn $result;\n \n }\n }", "function bill_ship_insert($data, $user_id) {\n $bill_id = '';\n $ship_id = '';\n if ($data['shipping_add']) {\n mysql_query(\"insert into nfw_billing_shipping_address (address1,address2,city,state,country,zip,user_id,shipping_address,billing_address,default_shipping_address,default_billing_address) values('\" . $data['address1'] . \"','\" . $data['address2'] . \"','\" . $data['city'] . \"','\" . $data['state'] . \"','\" . $data['country'] . \"','\" . $data['zip'] . \"','$user_id','no','yes','no','yes') \");\n $bill_id = mysql_insert_id();\n mysql_query(\"insert into nfw_billing_shipping_address (address1,address2,city,state,country,zip,user_id,shipping_address,billing_address,default_shipping_address,default_billing_address) values('\" . $data['s_address1'] . \"','\" . $data['s_address2'] . \"','\" . $data['s_city'] . \"','\" . $data['s_state'] . \"','\" . $data['s_country'] . \"','\" . $data['s_zip'] . \"','$user_id','yes','no','yes','no') \");\n $ship_id = mysql_insert_id();\n } else {\n mysql_query(\"insert into nfw_billing_shipping_address (address1,address2,city,state,country,zip,user_id,shipping_address,billing_address,default_shipping_address,default_billing_address) values('\" . $data['s_address1'] . \"','\" . $data['s_address2'] . \"','\" . $data['s_city'] . \"','\" . $data['s_state'] . \"','\" . $data['s_country'] . \"','\" . $data['s_zip'] . \"','$user_id','yes','yes','yes','yes') \");\n $ship_id = mysql_insert_id();\n $bill_id = $ship_id;\n }\n\n return [$bill_id, $ship_id];\n }", "public function setShippingMethodId($shipping_method_id);", "public function saveOrderShipment() {\n\t\t$this->layout = 'ajax';\n $order_id = $this->Shipment->saveOrderShipment($this->request->data);\n\t\tif($order_id) {\n $data = $this->Shipment->Order->find('first', array(\n 'conditions' => array(\n 'Order.id' => $order_id\n )\n ));\n } else {\n $this->set('json', FALSE);\n $this->render('/Common/echo_json');\n }\n $this->set('data', $data);\n $this->render('ship_cell');\n\t}", "function updateShipingid()\r\n {\r\n global $CFG,$objSmarty;\r\n\t \t\t$UpQuery = \"UPDATE \".$CFG['table']['cart'].\" SET shiping_id = '\".$this->filterInput($_POST['shipid']).\"' WHERE session_id ='\".session_id().\"' AND domain_id = '\".$this->filterInput($_POST['domain_id']).\"' \";\r\n\t\t\t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\r\n }", "public function save(){\n\n $this->validate();\n\n if ($this->shipping_price_id) {\n $shipping_price = ShippingCompanyPrice::find($this->shipping_price_id);\n } else {\n $shipping_price = new ShippingCompanyPrice();\n }\n $shipping_price->shipping_company_id = $this->shipping_company_id;\n $shipping_price->location_id = $this->location_id;\n $shipping_price->amount = $this->amount;\n $shipping_price->save();\n $this->clear();\n }", "public function add_shipping_status_tracking_info() {\n if ( ! is_user_logged_in() ) {\n die( -1 );\n }\n\n if ( ! isset( $_REQUEST['security'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['security'] ), 'add-shipping-status-tracking-info' ) ) {\n die( -1 );\n }\n\n $post_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : 0;\n\n if ( ! dokan_is_seller_has_order( dokan_get_current_user_id(), $post_id ) ) {\n die( -1 );\n }\n\n $shipment_comments = isset( $_POST['shipment_comments'] ) ? trim( sanitize_text_field( wp_unslash( $_POST['shipment_comments'] ) ) ) : '';\n $tracking_info = $this->prepare_for_db( $_POST );\n $user_id = dokan_get_current_user_id();\n\n if ( ! $tracking_info ) {\n die( -1 );\n }\n\n $order = dokan()->order->get( $post_id );\n\n if ( $order->get_status() === 'cancelled' || $order->get_status() === 'refunded' ) {\n die( -1 );\n }\n\n if ( empty( $order ) || $tracking_info['number'] === '' || $tracking_info['shipping_status'] === '' || $tracking_info['provider'] === '' ) {\n die();\n }\n\n $shipment_id = $this->create_shipping_tracking( $tracking_info );\n $tracking_info = (object) $tracking_info;\n\n if ( $shipment_id ) {\n dokan_shipment_cache_clear_group( $post_id );\n do_action( 'dokan_order_shipping_status_tracking_new_added', $post_id, $tracking_info, $user_id );\n } else {\n die( -1 );\n }\n\n $ship_info = __( 'Shipping Provider: ', 'dokan' ) . '<strong>' . $tracking_info->provider_label . '</strong><br />' . __( 'Shipping number: ', 'dokan' ) . '<strong>' . $tracking_info->number . '</strong><br />' . __( 'Shipped date: ', 'dokan' ) . '<strong>' . $tracking_info->date . '</strong><br />' . __( 'Shipped status: ', 'dokan' ) . '<strong>' . $tracking_info->status_label . '</strong>';\n\n if ( ! empty( $shipment_comments ) ) {\n $ship_info .= '<br><br><strong>' . __( 'Comments: ', 'dokan' ) . '</strong>' . $shipment_comments;\n }\n\n if ( 'on' === $tracking_info->is_notify ) {\n do_action( 'dokan_order_shipping_status_tracking_notify', $post_id, $tracking_info, $ship_info, $user_id, true );\n }\n\n dokan_pro()->shipment->add_shipping_status_tracking_notes( $post_id, $shipment_id, $ship_info, $order );\n\n echo '' . esc_html__( 'Sucessfully Created New Shipment', 'dokan' ) . '';\n\n die();\n }", "public function save_shippingAction() {\n $shipping_method = $this->getRequest()->getPost('shipping_method', '');\n $payment_method = $this->getRequest()->getPost('payment_method', false);\n $old_shipping_method = $this->getOnepage()->getQuote()->getShippingAddress()->getShippingMethod();\n if ($shipping_method && $shipping_method != '' && $shipping_method != $old_shipping_method) {\n ////Mage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\n $this->getOnepage()->saveShippingMethod($shipping_method);\n }\n\n if ($payment_method != '') {\n try{\n $payment = $this->getRequest()->getPost('payment', array());\n $payment['method'] = $payment_method;\n Mage::helper('onestepcheckout')->savePaymentMethod($payment);\n }\n catch(Exception $e) {\n }\n }\n \n // $paymentHtml = $this->_getPaymentMethodsHtml();\n // $reviewHtml = $this->_getReviewTotalHtml();\n // $result = array('payment' => $paymentHtml, \n // 'review' => $reviewHtml);\n // $this->getResponse()->setBody(Zend_Json::encode($result));\n $this->loadLayout(false);\n $this->renderLayout();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render passports and VISAs.
public function render_passports() { $passports = $this->get_meta( 'passports' ); if ( empty( $passports ) ) { $passports = []; } $visas = $this->get_meta( 'visas' ); if ( empty( $visas ) ) { $visas = []; } if ( empty( $visas ) && empty( $passports ) ) { return; } // Merge passports and VISAs. $passports = array_merge( $passports, $visas ); // Get first 12 items. $passports = array_slice( $passports, 0, 12 ); // Starting cell. $start = 47; foreach ( $passports as $passport ) { $this->cell( "A{$start}:F{$start}", $this->get_value( $passport, 'type' ) ); $this->cell( "M{$start}:P{$start}", $this->get_value( $passport, 'num' ) ); $this->cell( "Q{$start}:T{$start}", $this->get_date_format( $this->get_value( $passport, 'issue_date' ) ) ); $this->cell( "U{$start}:X{$start}", $this->get_value( $passport, 'issued_by' ) ); $this->cell( "Y{$start}:AB{$start}", $this->get_date_format( $this->get_value( $passport, 'valid_till' ) ) ); $start += 1; } }
[ "function render(){\r\n\t\t\t$this->auth->is_auth() ? $this->index->state['user']() : $this->index->state['guest']();\r\n\t\t}", "public function renderView()\n\t{\n\t}", "public function render() {\n /* if the user and view(s) are defined, \n * assign the user session to the view(s)\n */\n if ($this->user) {\n if ($this->actionView) {\n $key = \"user\";\n if ($this->actionView->get($key, false)) {\n $key = \"__user\";\n }\n $this->actionView->set($key, $this->user);\n }\n if ($this->layoutView) {\n $key = \"user\";\n if ($this->layoutView->get($key, false)) {\n $key = \"__user\";\n }\n $this->layoutView->set($key, $this->user);\n }\n }\n parent::render();\n }", "public function render() {\n /* if the user and view(s) are defined, \n * assign the user session to the view(s)\n */\n if ($this->user) {\n if ($this->actionView) {\n $key = \"user\";\n if ($this->actionView->get($key, false)) {\n $key = \"__user\";\n }\n $this->actionView->set($key, $this->user);\n }\n if ($this->layoutView) {\n $key = \"user\";\n if ($this->layoutView->get($key, false)) {\n $key = \"__user\";\n }\n $this->layoutView->set($key, $this->user);\n }\n }\n parent::render();\n }", "private function render()\n {\n foreach ($this->renderers as $renderer) {\n $renderer->render($this->state);\n }\n }", "public function render(): array\n {\n $pagevisits = [];\n /** @var Visitor $visitor */\n $visitor = $this->arguments['visitor'];\n /** @var Pagevisit $pagevisit */\n foreach ($visitor->getPagevisits() as $pagevisit) {\n if ($pagevisit->getPage() !== null) {\n if ((int)$this->arguments['pageIdentifier'] === $pagevisit->getPage()->getUid()) {\n $pagevisits[] = $pagevisit;\n }\n }\n }\n return $pagevisits;\n }", "public function renderIn(){ \n $login = $this->hlp->logn();\n $this->template->isVendor = $this->listings->isVendor($login);\n $this->template->listings = $this->listings->getListings($login); \n $this->template->currentUser = $login;\n }", "public function renderFilter()\n\t{\n\t}", "public function renderFilters()\n {\n }", "function student_cia_render() {\n\tlayout('student/layout.html.php');\n\tset(\"title\" ,\"Student CIA Marks\");\n\tset(\"view_active\" ,\"true\");\n\t\n\treturn render(\"student/student.cia.html.php\");\n}", "public function render($visitedUrls);", "public function directRender()\n {\n // Change the language if needed\n static::setLang();\n\n // Render in an HTML file and display it in an iframe\n $id = uniqid();\n Files::write(\"app/cache/admin-preview/{$id}.html\", $this->html(get_fields()[\"sections\"][0]));\n $this->iframe(Files::url(\"app/cache/admin-preview/{$id}.html\"));\n }", "public function render(){\n\n \\Timber\\Timber::render( $this->templates, $this->context );\n\n }", "final private function _passDataToView() {\n\t\t// Alle data doorgeven aan de view\n\t\tforeach($this->extractData as $name => $val) {\n\t\t\t$this->view->set($name, $val, true);\n\t\t}\n\t\t\n\t\t// Alle fetch data doorgeven aan de view\n\t\tforeach($this->fetchData as $name => $val) {\n\t\t\t$this->view->set($name, $val, false);\n\t\t}\n\t\t\n\t\t// Alle css data doorgeven aan de view\n\t\tforeach($this->cssData as $css) {\n\t\t\t$this->view->css($css);\n\t\t}\n\t\t\n\t\t// Alle script data doorgeven aan de view\n\t\tforeach($this->scriptData as $script) {\n\t\t\t$this->view->script($script);\n\t\t}\n\t\t\n\t\t// Alle img data doorgeven aan de view\n\t\tforeach($this->imgData as $img) {\n\t\t\t$this->view->img($img);\n\t\t}\n\n\t\t// Alle standaard Helpers laden\n\t\tforeach($this->helpers_static as $helper) {\n\t\t\t$this->view->loadHelper($helper);\n\t\t}\n\n\t\t// Alle extra helpers laden\n\t\tforeach($this->helpers as $helper) {\n\t\t\t$this->view->loadHelper($helper);\n\t\t}\n\t}", "public function renderData();", "private function renderPage()\n {\n // to the parent/app window\n $this->setViewTitle(_('Connection Authorization - Flex.io'));\n $this->renderPublic();\n $this->render();\n }", "function render() {\r\n //render all the areas\r\n $area1 = $this->renderPageArea(\"area1\");\r\n $area2 = $this->renderPageArea(\"area2\");\r\n $area3 = $this->renderPageArea(\"area3\");\r\n $area4 = $this->renderPageArea(\"area4\");\r\n $area5 = $this->renderPageArea(\"area5\");\r\n $header = $this->renderHeader();\r\n $footer = $this->renderFooter();\r\n\r\n // Load the layout and use it to arrange the page contents.\r\n //$this->loadLayout();\r\n global $theme;\r\n $layoutPath =\r\n $theme->layoutExists($this->layout) ?\r\n $theme->getLayoutPath($this->layout) :\r\n $theme->getLayoutPath(self::DEFAULT_LAYOUT);\r\n\r\n unset($template);\r\n $template = new template();\r\n $template->setFile($layoutPath);\r\n\r\n //pass all data to the layout and render\r\n $template->setVars(\r\n compact(\r\n \"area1\",\r\n \"area2\",\r\n \"area3\",\r\n \"area4\",\r\n \"area5\",\r\n \"header\",\r\n \"footer\",\r\n \"links\"));\r\n\r\n $template->set(\"pageid\",$this->id);\r\n $template->set(\"system\",$this->system);\r\n $template->depth = 1;\r\n $renderedPage = $template->fetch();\r\n\r\n return $renderedPage;\r\n }", "public function getRenderingData(){\n return json_encode($this->getRenderingCanal($this->getCanal())) ;\n }", "public function render() {\n //Extract defined vars in scope\n extract($this->_vars);\n \n ob_start();\n include($this->_view);\n $content = ob_get_contents();\n ob_end_clean();\n echo $this->_renderInLayout($content);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Class Edit Income Info function
public function edit($income_code) { $data['page_name'] = 'income_entry/edit_income_entry'; $data['page_title'] = 'Income Entry'; $data['income_info']=$this->income_entry->get_income_info_to_update($income_code); $this->load->view('backend/index',$data); }
[ "public function update(){\n $this->tax = $this->getTax();\n echo \"The new tax in the USA is: \". $this->tax .\" as of today.\";\n }", "public function update(){\n $this->tax = $this->getTax();\n echo \"The new tax in Canada is: \". $this->tax .\" as of today.\";\n }", "public function update($income){\n \t$data = array( \t\t \t\t\n \t\t'所得類別' => $income->type,\n \t\t'來源' => $income->from,\n \t\t'年或月收入' => $income->m_or_y,\n \t\t'金額' => $income->value,\n \t\t'利率' => $income->rate,\n \t\t'備註' => $income->note\n \t\t);\n \t$this->db->where('所得系統編號', $income->key);\n \t$this->db->update('family_mem_income', $data);\n\t}", "public function setIncome($income){\n\t\t$this->income = $income;\n\t}", "function income () {\n\t\t\t\n\t\tglobal $zurich;\n\t\t\n\t\t$rent = 0;\n\t\tforeach ($this->houses as $h) {\n\t\t\tif ($h->age < $h->max_age) $rent += $h->income_pt;\n\t\t\t}\n\t\tif ($rent) {\n\t\t\t$this->benefit('bank', $rent);\n\t\t\t$this->warn_player(\"received rent of \" . CURRSYM . \"$rent for houses\", $this->id, 2);\n\t\t\t$tax = round($rent * $zurich->players['politician']->tax_rate);\n\t\t\t$this->must_pay('politician', $tax);\n\t\t\t$this->warn_player(\"paid tax of \" . CURRSYM . \"$tax to the politician\", $this->id, 2);\n\t\t\t}\n\t}", "public function updateCostosPersonal()\n {\n\n }", "function editIncomeByJason() {\n $id = $this->input->get('id');\n $data['income'] = $this->cashier_model->getIncomeByIdex($id);\n echo json_encode($data);\n }", "function setInsuranceContractInfo()\n {\n }", "public function newIncome(){\n $this->data['meta_keyword'] = '';\n $this->data['meta_title'] = '';\n $this->data['meta_description'] = '';\n \n \n $this->data['incomeField'] = read('income_field');\n \n $this->load->view('admin/includes/header', $this->data);\n $this->load->view('admin/includes/aside', $this->data);\n $this->load->view('admin/includes/headermenu', $this->data);\n $this->load->view('admin/includes/nav', $this->data);\n $this->load->view('components/income/add', $this->data);\n $this->load->view('admin/includes/footer', $this->data);\n }", "public function edit(Outfit $outfit)\n {\n //\n }", "public function testUpdateAdditionalCost()\n {\n }", "public function testUpdateFund()\n {\n }", "public function update_payment_info() {\r\n\t\t\r\n\t}", "function updateInvoicedetails()\n {\n global $db;\n $requete = $db->prepare('UPDATE deposit_invoice_details SET `designation`, `unit`, `amount`, `unitprice`, \n `totaluwt`, `percentage`, `equivalent` WHERE idId = ?');\n $requete->execute(array(\n $this->designation,\n $this->unit,\n $this->amount,\n $this->unitprice,\n $this->totaluwt,\n $this->percentage,\n $this->idId\n ));\n }", "private function setEstablishedEarnedIncome(){\n $this->establishedEarnedIncome = floor($this->earnedIncome / 100) * 100;\n }", "function ciniki_sapos_expenseUpdateTotals($ciniki, $tnid, $expense_id) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashIDQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n\n //\n // Get the expense details, so we know what taxes are applicable for the expense date\n //\n $strsql = \"SELECT invoice_date, \"\n . \"paid_date, \"\n . \"total_amount \"\n . \"FROM ciniki_sapos_expenses \"\n . \"WHERE ciniki_sapos_expenses.id = '\" . ciniki_core_dbQuote($ciniki, $expense_id) . \"' \"\n . \"AND ciniki_sapos_expenses.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'expense');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['expense']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.18', 'msg'=>'Unable to find expense'));\n }\n $expense = $rc['expense'];\n\n //\n // Get the items from the expense\n //\n $strsql = \"SELECT id, \"\n . \"amount \"\n . \"FROM ciniki_sapos_expense_items \"\n . \"WHERE ciniki_sapos_expense_items.expense_id = '\" . ciniki_core_dbQuote($ciniki, $expense_id) . \"' \"\n . \"AND ciniki_sapos_expense_items.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $items = isset($rc['rows']) ? $rc['rows'] : array();\n\n //\n // Add the totals for the expense items\n //\n $expense_total_amount = 0;\n if( count($items) > 0 ) {\n foreach($items as $iid => $item) {\n $expense_total_amount = bcadd($expense_total_amount, $item['amount'], 4);\n }\n }\n \n $args = array();\n if( $expense_total_amount != floatval($expense['total_amount']) ) {\n $args['total_amount'] = $expense_total_amount;\n }\n if( count($args) > 0 ) {\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.sapos.expense', \n $expense_id, $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n return array('stat'=>'ok');\n}", "public static function edit_attribute()\n {\n }", "public function actionEditEstimate() {\n if (Yii::$app->request->isAjax) {\n $id = $_POST['id'];\n $name = $_POST['name'];\n $value = $_POST['valuee'];\n $estimate = CloseEstimate::find()->where(['id' => $id])->one();\n if ($name == 'unit' || $name == 'unit_rate') {\n if ($name == 'unit') {\n $estimate->fda = $estimate->unit_rate * $value;\n } else {\n $estimate->fda = $estimate->unit * $value;\n }\n }\n if ($value != '') {\n $estimate->$name = $value;\n $estimate->UB = Yii::$app->user->identity->id;\n if ($estimate->save()) {\n return 1;\n } else {\n return 2;\n }\n }\n }\n }", "public function edit_user_bank_detail($input){\r\n\t\t\t\r\n\t\t\t//define input\r\n\t\t\t$bank_id = $input['bank_id'];\r\n\t\t\t$amount = $input['amount'];\r\n\t\t\t\r\n\t\t\t//sql\r\n\t\t\t$sql = \"update \".$this->table_name .\" set current_amount ='\".$amount.\"' where bank_id = '\".$bank_id.\"'\";\r\n\t\t\t\r\n\t\t\t//run query\r\n\t\t\t$query = $this->connect_database->run_sql_query($sql);\r\n\t\t\t\r\n\t\t\t//returns true if the query is executed successfully\r\n\t\t\tif($query){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the Redirect URL using either the config loginRedirect or the Auth.redirect (Default).
public function redirectUrl() { if ($redirectUrl = $this->Session->read('Auth.redirect')) { $this->Session->delete('Auth.redirect'); return $redirectUrl; } return $this->config['loginRedirect']; }
[ "protected function getRedirectUrl()\n {\n return $this->getParameter('redirectUrl');\n }", "public function getRedirectUrl();", "public function getRedirectLoginUrl()\n {\n $loginUrl = $this->getWordpress()->getBlogInfo('wpurl')\n .'/wp-login.php?redirect_to='.urlencode($_SERVER['REQUEST_URI']);\n return $this->getWordpress()->applyFilters('uam_login_url', $loginUrl);\n }", "public function redirection () {\n\t\t$enable_redirect_status = Mage::getStoreConfig('sociallogin/general/enable_redirect');\n\t\t/**\n\t\t * Condition to check the enable redirect is set to yes.\n\t\t*/\n\t\tif ($enable_redirect_status) {\n\t\t\t$redirect = Mage::helper('customer')->getAccountUrl();\n\t\t} else {\n\t\t\t/**\n\t\t\t * Redirect to the referer page.\n\t\t\t */\n\t\t$redirect = Mage::getSingleton('customer/session')->getLink();\n\t\t \t\t}\n\t\treturn $redirect;\n\t\t\n\t}", "public function getRedirectUrl() {\n }", "public function get_login_url()\n\t{\n\t\t$params = array();\n\t\tif (isset($this->_scope)) $params['scope'] = $this->_scope;\n\t\tif (isset($this->_redirect)) $params['redirect_uri'] = $this->_redirect;\n\t\treturn $this->link->getLoginUrl($params);\n\t}", "public function getRedirectUrl()\n {\n return $this->getOptinRedirectUrl() ?: $this->_context->getRedirect()->getRefererUrl();\n }", "abstract public function getLoginRedirect();", "public function getLoginRedirectRoute()\n {\n return $this->loginRedirectRoute;\n }", "protected function getRedirectUrl() {\n return url(\"fluxservice/oauth/{$this->bundle()}/{$this->identifier()}\", array('absolute' => TRUE));\n }", "private function getConfigRedirect()\n {\n if (!is_null($redirect = Config::get('crust.redirect'))) {\n return $redirect;\n }\n\n return false;\n }", "public function getRedirectUrl() {\n return $this->helper->getTransactionURL($this->getConfigData('environment'));\n }", "public function redirectUrl()\n {\n $redirectUrl = $this->request->query('_redirect_url');\n $redirectUrlViewVar = $this->getViewVar('_redirect_url');\n\n if (!empty($redirectUrlViewVar)) {\n $redirectUrl = $redirectUrlViewVar;\n } else {\n $context = $this->Form->context();\n if ($context->val('_redirect_url')) {\n $redirectUrl = $context->val('_redirect_url');\n }\n }\n\n if (empty($redirectUrl)) {\n return null;\n }\n\n return $this->Form->hidden('_redirect_url', [\n 'name' => '_redirect_url',\n 'value' => $redirectUrl,\n 'id' => null,\n 'secure' => FormHelper::SECURE_SKIP\n ]);\n }", "public function getRedirect();", "public function getDefaultPostLoginUrl()\n {\n $result = '';\n $loginRedirectMode = (string) $this->config->get('concrete.misc.login_redirect');\n switch ($loginRedirectMode) {\n case 'CUSTOM':\n $loginRedirectCollectionID = $this->config->get('concrete.misc.login_redirect_cid');\n if ($this->valn->integer($loginRedirectCollectionID, 1)) {\n $page = Page::getByID($loginRedirectCollectionID);\n if ($page && !$page->isError()) {\n $result = (string) $this->resolverManager->resolve([$page]);\n }\n }\n break;\n case 'DESKTOP':\n $desktop = DesktopList::getMyDesktop();\n if ($desktop && !$desktop->isError()) {\n $result = (string) $this->resolverManager->resolve([$desktop]);\n }\n break;\n }\n\n return $result;\n }", "public function redirectPath()\n {\n return $this->loginRedirect();\n\n }", "public function get_redirecturi() {\n return (isset($this->redirecturi)) ? $this->redirecturi : null;\n }", "function Get_request_redirect_url() {\n\t\t\treturn (isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : null);\n\t\t}", "public function getRedirect()\n {\n return $this->redirect;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
is the provided template drag and drop? if so, filter down the scorecards
protected function isRanked(ScorecardCollection $scorecards, ScorecardTemplate $template) { if($template->type == 'R') { return $scorecards->filterRanked(); } return $scorecards; }
[ "protected function filterScorecardsByTemplate($scorecards, $template_id)\n\t{\n\t\treturn $scorecards->filter(function($sc) use($template_id) {\n\t\t\treturn $sc->template_id == $template_id;\n\t\t});\n\t}", "public function filter_boardingCards(){\r\n\t\tfor($i=0;$i<$this->boardingCards_num;$i++){\r\n\t\t\tif(strcmp($this->boardingCards[$i]->getPreviewID(),\"-1\")==0\r\n\t\t\t &&strcmp($this->boardingCards[$i]->getFollowID(),\"-1\")==0){\t//\tthis boarding card was not in the trip, drop it\r\n\t\t\t\tunset($this->boardingCards[$i]);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(strcmp($this->boardingCards[$i]->getPreviewID(),\"-1\")==0\r\n\t\t\t &&strcmp($this->boardingCards[$i]->getFollowID(),\"-1\")!=0){\t\r\n\t\t\t //\tthis boarding card was the start of the trip, push this card into the sorted cards and remove it from the original cards\r\n\t\t\t\t$this->depart = $this->boardingCards[$i]->getDepart();\r\n\t\t\t\tarray_push($this->sorted_boardingCards,$this->boardingCards[$i]);\r\n\t\t\t\tunset($this->boardingCards[$i]);\r\n\t\t\t}\r\n\t\t//\tif(strcmp($this->boardingCards[$i]->getPreviewID(),\"-1\")!=0\r\n\t\t//\t &&strcmp($this->boardingCards[$i]->getFollowID(),\"-1\")==0){\t//\tthis boarding card was the end of the trip\r\n\t\t//\t\t$this->arrive = $this->boardingCards[$i]->getArrive();\r\n\t\t//\t}\r\n\t\t}\r\n\t}", "function filter( $template )\n {\n $conf = $this->pObj->conf;\n $mode = $this->pObj->piVar_mode;\n $view = $this->pObj->view;\n\n $viewWiDot = $view . '.';\n $conf_view = $conf[ 'views.' ][ $viewWiDot ][ $mode . '.' ];\n\n if ( is_array( $conf_view[ 'displayList.' ][ 'display.' ] ) )\n {\n $lDisplay = $conf_view[ 'displayList.' ][ 'display.' ];\n }\n if ( !is_array( $conf_view[ 'displayList.' ][ 'display.' ] ) )\n {\n $lDisplay = $conf[ 'displayList.' ][ 'display.' ];\n }\n\n\n\n /////////////////////////////////////////////////////////////////\n //\n // RETURN filters shouldn't processed\n\n $bool_display = $this->pObj->objFlexform->bool_searchForm;\n if ( $bool_display == 0 )\n {\n // DRS - Development Reporting System\n if ( $this->pObj->b_drs_filter )\n {\n t3lib_div :: devlog( '[INFO/FILTER] Searchform is deactivated. Filters won\\'t processed.', $this->pObj->extKey, 0 );\n t3lib_div :: devlog( '[HELP/FILTER] If you want to use filters, please configure: ' . $viewWiDot . $mode . '.displayList.display.searchform = 1.', $this->pObj->extKey, 1 );\n }\n // DRS - Development Reporting System\n // Clean up the template and return\n $template = $this->pObj->cObj->substituteSubpart( $template, '###CATEGORY_MENU###', '', true );\n $arr_return[ 'data' ][ 'template' ] = $template;\n // #30912, 120127, dwildt+\n $arr_return[ 'data' ][ 'rows' ] = $this->rows_wo_limit;\n return $arr_return;\n // Clean up the template and return\n }\n // RETURN filters shouldn't processed\n /////////////////////////////////////////////////////////////////\n //\n // RETURN we don't have any filter array\n\n if ( !is_array( $conf_view[ 'filter.' ] ) )\n {\n if ( $this->pObj->b_drs_filter )\n {\n t3lib_div :: devlog( '[INFO/FILTER] ' . $viewWiDot . $mode . '.filters isn\\'t an array. There isn\\'t any filter for processing.', $this->pObj->extKey, 0 );\n }\n // Clean up the template and return\n $template = $this->pObj->cObj->substituteSubpart( $template, '###CATEGORY_MENU###', '', true );\n $arr_return[ 'data' ][ 'template' ] = $template;\n // #30912, 120127, dwildt+\n $arr_return[ 'data' ][ 'rows' ] = $this->rows_wo_limit;\n return $arr_return;\n }\n // RETURN we don't have any filter array\n /////////////////////////////////////////////////////////////////\n //\n // Set the global $arr_conf_tableFields\n\n if ( empty( $this->arr_conf_tableFields ) )\n {\n $this->get_tableFields();\n }\n // Set the global $arr_conf_tableFields\n /////////////////////////////////////////////////////////////////\n //\n // Init area\n // dwildt, 101211, #11402\n $arr_dummy = $this->pObj->objCal->area_init( array() );\n // Init area\n /////////////////////////////////////////////////////////////////\n //\n // Get the children devider\n\n $str_sqlDeviderDisplay = $this->pObj->objTyposcript->str_sqlDeviderDisplay;\n $str_sqlDeviderWorkflow = $this->pObj->objTyposcript->str_sqlDeviderWorkflow;\n $str_devider = $str_sqlDeviderDisplay . $str_sqlDeviderWorkflow;\n // Get the children devider\n // Fetch filtered rows before hit counting\n // #30912, 120127, dwildt+\n if ( $this->pObj->objFlexform->sheet_viewList_total_hits == 'controlled' )\n {\n $this->filter_fetch_rows();\n }\n // Fetch filtered rows before hit counting\n /////////////////////////////////////////////////////////////////\n //\n // Count the hits per filter item\n\n $this->hits_per_filter_item( $str_devider );\n // Count the hits per filter item\n /////////////////////////////////////////////////////////////////\n //\n // Get the content for the filter marker\n\n $arr_result = $this->filterLoop( $template );\n if ( $arr_result[ 'error' ][ 'status' ] )\n {\n return $arr_result;\n }\n $markerArray = $arr_result[ 'data' ][ 'marker' ];\n// dwildt, 110309: Werte sind aus db! Falsch!\n//var_dump(__METHOD__ . ': ' . __LINE__ , $markerArray);\n unset( $arr_result );\n // Get the content for the filter marker\n /////////////////////////////////////////////////////////////////\n //\n // DRS - Development Reporting System\n\n if ( $this->pObj->b_drs_filter )\n {\n $csv_markerKeys = implode( ', ', array_keys( $markerArray ) );\n t3lib_div :: devlog( '[INFO/FILTER] This markers allocate HTML filter snippets:' .\n $csv_markerKeys, $this->pObj->extKey, 0 );\n }\n // DRS - Development Reporting System\n /////////////////////////////////////////////////////////////////\n //\n // Replace filters in the HTML template\n\n if ( !is_array( $markerArray ) )\n {\n $markerArray = array();\n }\n\n // Filter can be a part of ###SEARCHFORM###\n $str_subpart = $this->pObj->cObj->getSubpart( $template, '###SEARCHFORM###' );\n $str_subpart = $this->pObj->cObj->substituteMarkerArray( $str_subpart, $markerArray );\n // Add the subparts marker, because another method (the search template) need this subpart marker\n $str_subpart = '<!-- ###SEARCHFORM### begin -->' . PHP_EOL . $str_subpart . '<!-- ###SEARCHFORM### end -->' . PHP_EOL;\n $template = $this->pObj->cObj->substituteSubpart( $template, '###SEARCHFORM###', $str_subpart, true );\n // Replace filters in the HTML template\n /////////////////////////////////////////////////////////////////\n //\n // Replace category menus in the HTML template\n\n $str_subpart = $this->pObj->cObj->getSubpart( $template, '###CATEGORY_MENU###' );\n $str_subpart = $this->pObj->cObj->substituteMarkerArray( $str_subpart, $markerArray );\n\n // Remove ###CATEGORY_MENU### from HTML template\n // :TODO: 120127, dwildt: subpart ###CATEGORY_MENU### is removed from the default templates\n if ( !$lDisplay[ 'category_menu' ] )\n {\n $str_subpart = null;\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = '###CATEGORY_MENU### is removed from HTML template because of TypoScript.';\n t3lib_div :: devlog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'If you like to use it, please configure local or global displayList.display.category_menu.';\n t3lib_div :: devlog( '[HELP/FILTER] ' . $prompt, $this->pObj->extKey, 1 );\n }\n }\n // Remove ###CATEGORY_MENU### from HTML template\n\n $template = $this->pObj->cObj->substituteSubpart( $template, '###CATEGORY_MENU###', $str_subpart, true );\n // Replace category menus in the HTML template\n // Fetch filtered rows after hit counting\n // #30912, 120127, dwildt+\n if ( $this->pObj->objFlexform->sheet_viewList_total_hits == 'independent' )\n {\n $this->filter_fetch_rows();\n }\n // Fetch filtered rows after hit counting\n\n $arr_return[ 'data' ][ 'template' ] = $template;\n // #30912, 120127, dwildt+\n $arr_return[ 'data' ][ 'rows' ] = $this->rows_wo_limit;\n return $arr_return;\n }", "protected function filter_drawer_content_template()\n {\n }", "public function filter_shortcodes($tmp_type=NULL) {\n\t\tif($tmp_type==NULL) return false;\n $items = array(\n\t\t\t'body' => array_keys(shortcode::get_template_shortcodes('body')),\n\t\t\t'loop' => array_keys(shortcode::get_template_shortcodes('loop')),\n\t\t);\n $template = $this->template;\n $pattern = get_shortcode_regex();\n\n\t\t$arr = isset($items[$tmp_type])?$items[$tmp_type]:$items['body'];\n\t\t$tmp_sec = \"template_{$tmp_type}\";\n\t\t$tmp = $template->$tmp_sec;\n\n preg_match_all('/' . $pattern . '/s', $tmp, $matches);\n $html = $tmp;\n foreach ($arr as $code) {\n if (is_array($matches) && in_array($code, $matches[2])) {\n foreach ($matches[0] as $match) {\n $html = str_replace($match, do_shortcode($match), $html);\n }\n }\n }\n return $html;\n }", "function filterSingle ($single_template){\n global $post;\n global $themify;\n $cpt_post_types = get_option('nmco_cpt_post_types');\n $post_type = $post->post_type;\n\n if(in_array($post_type, $cpt_post_types)){\n $themify = new ThemifyCPT($post_type);\n }\n $single_template = locate_template('single.php');\n\n return $single_template;\n}", "function is_filtered()\n {\n }", "public function load_template_callback() {\n\n // Make sure a template was submitted\n if ( ! isset($_POST['template']) ) {\n return;\n }\n // grabe the template being rendered\n $template = $_POST['template'];\n\n // Activate builder callbacks for the shortcodes\n $this->activate_builder_callbacks();\n\n // Remove inactive shortcodes\n $template = cv_strip_inactive_plugin_shortcodes( $template );\n\n // Display the rendered shortcodes\n echo do_shortcode( stripslashes( $template ) );\n\n die();\n\n }", "protected function addRankedScorecards($template, $scorecard_type)\n\t{\n\t\tforeach($this->getVideos($template) as $video_id)\n\t\t{\n\t\t\t$this->setupScorecard($template, $scorecard_type, $video_id);\n\t\t\t\n\t\t\t$this->scorecard->video_id = $video_id;\n\n\t\t\t$this->finalizeScorecard();\n\t\t}\n\t}", "function _tw_pre_process_template($tw_template){\n if ($tw_template['name'] == \"ww_widget\" && !empty($tw_template['arguments']['widget']->custom_template_suggestion)){\n // make this suggestion the first\n array_unshift($tw_template['files'], 'widget-[custom_template_suggestion].php');\n $tw_template['arguments']['custom_template_suggestion'] = $tw_template['arguments']['widget']->custom_template_suggestion;\n }\n return $tw_template;\n }", "public function filtermagazinsAction() {\n $avR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\AudioorvideoRepository');\n $mR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\MagazinRepository');\n $npR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\NewspaperRepository');\n $newarr = array();\n\n if ($this->request->hasArgument('data')) {\n // Holen der übergebenen Parameter\n $json = $this->request->getArgument('data');\n $position = intval($this->request->getArgument('position'));\n $limit = intval($this->request->getArgument('limit'));\n\n // Abfragen nach den zu filternden Kriterien\n if ($json == 'audioorvideo') {\n\n // Audio or video\n\n $avRs = $avR->findAll($position, $limit);\n\n $av = array();\n foreach ($avRs as $m) {\n $av[] = array(\n 'model' => $m,\n 'type' => 'av',\n 'sorting' => $m->getPubtstamp()\n );\n }\n\n $po = $this->array_msort($po, array('sorting' => SORT_DESC));\n $po = $this->cropResultArray($po, $limit, $position);\n\n $this->view->assign('data', $av);\n $doNotDie = true;\n } elseif ($json == 'printonline') {\n\n // Printed and Online\n\n $mR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\MagazinRepository');\n $ms = $mR->findAll();\n\n $dpR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\NewspaperRepository');\n $dps = $dpR->findAll();\n\n $po = array();\n foreach ($ms as $m) {\n $po[] = array(\n 'model' => $m,\n 'type' => 'm',\n 'sorting' => $m->getPubtstamp()\n );\n }\n foreach ($dps as $m) {\n $po[] = array(\n 'model' => $m,\n 'type' => 'dp',\n 'sorting' => $m->getPubtstamp()\n );\n }\n\n $po = $this->array_msort($po, array('sorting' => SORT_DESC));\n $po = $this->cropResultArray($po, $limit, $position);\n\n $this->view->assign('data', $po);\n $this->view->assign('position', $position);\n $doNotDie = true;\n } elseif ($json == 'dailypress') {\n // Gibts nicht mehr - 21.2.2017\n } else {\n\n // Freie Filter Dailypress, Magazine and Year\n\n $position = intval($this->request->getArgument('position'));\n $limit = intval($this->request->getArgument('limit'));\n\n $data = json_decode($json);\n\n $info = array(\n 'dailypresss' => array(),\n 'magazines' => array(),\n 'years' => array(),\n );\n\n $isNotEmpty = false;\n if (!empty((array) $data->dailypresss)) {\n $isNotEmpty = true;\n }\n if (!empty((array) $data->magazines)) {\n $isNotEmpty = true;\n }\n if (!empty((array) $data->years)) {\n $isNotEmpty = true;\n }\n\n if ($isNotEmpty === true) {\n foreach ($data as $index => $entry) {\n foreach ($entry as $subindex => $subentry) {\n $info[$index][$subindex] = $subindex;\n }\n }\n\n $mR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\MagazinRepository');\n $dpR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\NewspaperRepository');\n $avR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\AudioorvideoRepository');\n $jR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\JournalRepository');\n\n $findings = array();\n foreach ($info as $index => $criterium) {\n\n // Dailypress-Filter\n if ($index == 'dailypresss') {\n foreach ($criterium as $uid) {\n $dbRes = $jR->findByUid($uid);\n\n $dpRes = $dpR->findByJournal($dbRes->getTitle());\n\n if ($dpRes->count() > 0) {\n foreach ($dpRes as $m) {\n $findings[] = array(\n 'model' => $m,\n 'type' => 'm',\n 'sorting' => $m->getPubtstamp()\n );\n }\n }\n }\n }\n\n // Magazin-Filter\n if ($index == 'magazines') {\n foreach ($criterium as $uid) {\n $mRes = $jR->findByUid($uid);\n\n $title = $mRes->getTitle();\n\n // @Bug - Workaround, Methode trotz Deklaration und Cache-Leerens nicht aufrufbar\n $resM = $mR->findByJournal($title);\n\n $hRes = $mR->findAll();\n $hMRes = array();\n foreach ($hRes as $h) {\n if ($h->getJournal() == $title) {\n $hMRes[] = $h;\n }\n }\n $maRes = $hMRes;\n\n if (count($maRes) > 0) {\n foreach ($maRes as $m) {\n $findings[] = array(\n 'model' => $m,\n 'type' => 'm',\n 'sorting' => $m->getPubtstamp()\n );\n }\n }\n }\n }\n\n // Jahr-Filter\n if ($index == 'years') {\n\n foreach ($criterium as $year => $uid) {\n\n // @Bug - Workaround, Methode trotz Deklaration und Cache-Leerens nicht aufrufbar\n $resM = $mR->findByPubdate($year);\n\n $hRes = $mR->findAll();\n $hMRes = array();\n foreach ($hRes as $h) {\n if ($h->getPubdate() == $year) {\n $hMRes[] = $h;\n }\n }\n $resM = $hMRes;\n\n $resAV = $avR->findByPubdate($year);\n $resDP = $dpR->findByPubdate($year);\n\n //var_dump(get_class($f['model']), $types[$type]);\n // if($resM->count() > 0) {\n if (count($resM) > 0) {\n foreach ($resM as $m) {\n if (!$this->inFindings($m, $findings, 'm')) {\n $findings[] = array(\n 'model' => $m,\n 'type' => 'm',\n 'sorting' => $m->getPubtstamp()\n );\n }\n }\n }\n\n if ($resAV->count() > 0) {\n foreach ($resAV as $m) {\n if (!$this->inFindings($m, $findings, 'av')) {\n $findings[] = array(\n 'model' => $m,\n 'type' => 'av',\n 'sorting' => $m->getPubtstamp()\n );\n }\n }\n }\n\n if ($resDP->count() > 0) {\n foreach ($resDP as $m) {\n if (!$this->inFindings($m, $findings, 'dp')) {\n $findings[] = array(\n 'model' => $m,\n 'type' => 'dp',\n 'sorting' => $m->getPubtstamp()\n );\n }\n }\n }\n }\n }\n }\n\n $findings = $this->array_msort($findings, array('sorting' => SORT_DESC));\n $findings = $this->cropResultArray($findings, $limit, $position);\n\n $this->view->assign('data', $findings);\n $this->view->assign('position', $position);\n $doNotDie = true;\n\n if (empty($newarr)) {\n $newarr['respmessage'] = 'No Results';\n }\n } else {\n $newarr['respmessage'] = 'No Selection';\n }\n\n $this->view->assign('array', $newarr);\n $doNotDie = true;\n }\n }\n\n if ($doNotDie !== true) {\n echo json_encode($newarr);\n die();\n }\n }", "function hasEditTemplate() ;", "function unaib_filter_ld_focus_mode_template($template){\n $focus_mode = LearnDash_Settings_Section::get_section_setting('LearnDash_Settings_Theme_LD30', 'focus_mode_enabled');\n\n if ($focus_mode !== 'yes') {\n global $ld_in_focus_mode;\n $ld_in_focus_mode = true;\n\n return $template;\n }\n\n global $post;\n\n $user_id = get_current_user_id();\n $post_id = $post->ID;\n $has_access = sfwd_lms_has_access($course_id, $user_id);\n\n if (is_user_logged_in() && $has_access) {\n $post_types = array(\n 'sfwd-courses',\n 'sfwd-lessons',\n 'sfwd-topic',\n 'sfwd-assignment',\n 'sfwd-quiz',\n );\n } else {\n $post_types = array(\n 'sfwd-lessons',\n 'sfwd-topic',\n 'sfwd-assignment',\n 'sfwd-quiz',\n );\n }\n\n if (in_array(get_post_type(), $post_types, true) && is_singular($post_types)) {\n return LEARNDASH_LMS_PLUGIN_DIR . 'themes/ld30/templates/focus/index.php';\n }\n\n return $template;\n}", "public function hasTemplate();", "public function cardSort();", "function play() {\n \t\n \tglobal $zurich;\n \t\n \tif ($this->account > 1000) $filtration = 3;\n \telseif ($this->account > 700) $filtration = 2;\n \telse $filtration = 1;\n \tif ($filtration != $this->filter_level) {\n \t\t$this->change_filter_level($filtration);\n \t\treturn;\n \t}\n \t$this->pick_chance_card();\n\t}", "protected function _filterTemplateCommands( )\r\n\t{\r\n\t\tforeach ( $this->variables as $variablename => $variable )\r\n\t\t{\r\n\t\t\t$variableID = $this->configuration->getConfiguration( 'zeitgeist', 'template', 'variableSubstBegin' ) . $variablename . $this->configuration->getConfiguration( 'zeitgeist', 'template', 'variableSubstEnd' );\r\n\t\t\t$this->content = str_replace( $variableID, '', $this->content );\r\n\t\t}\r\n\r\n\t\tforeach ( $this->blocks as $blockname => $block )\r\n\t\t{\r\n\t\t\t$blockID = $this->configuration->getConfiguration( 'zeitgeist', 'template', 'blockSubstBegin' ) . $blockname . $this->configuration->getConfiguration( 'zeitgeist', 'template', 'blockSubstEnd' );\r\n\t\t\t$this->content = str_replace( $blockID, '', $this->content );\r\n\t\t}\r\n\r\n\t\t$this->debug->unguard( true );\r\n\t\treturn true;\r\n\t}", "function filtermediapress( $content ) {\n\n $type = get_post_type(get_the_ID());\n\n $post_like = $type.'_like';\n $post_rate = $type.'_rate';\n $post_review = $type.'_review';\n\n $like = false;\n $rate = false;\n $review = false;\n\n $seletedOptions = get_option('awSocialTabsPostOptions', true);\n\n if( in_array($post_like, $seletedOptions )){\n\n $flag = true;\n\n $user_ID = get_current_user_id();\n $postmeta = get_post_meta(get_the_ID(), 'awst_like', true);\n $isLiked = AwstComman::isLiked($postmeta, $user_ID);\n $totalLiked = AwstComman::getLikes($postmeta);\n\n if( $isLiked ){\n $like = '<div class=\"awst_like\"><span class=\"awst_like_btn\" id=\"awst_like_btn_'.get_the_ID().'\"><i data-post-like=\"true\" data-post-id=\"'.get_the_ID().'\" class=\"fa fa-thumbs-up\" aria-hidden=\"true\"></i></span><span class=\"total_like\"><label id=\"total_likes\" class=\"total_likes_'.get_the_ID().'\">'.$totalLiked.'</label> Me gusta</span></div>';\n }else{\n $like = '<div class=\"awst_like\"><span class=\"awst_like_btn\" id=\"awst_like_btn_'.get_the_ID().'\"><i data-post-like=\"true\" data-post-id=\"'.get_the_ID().'\" class=\"fa fa-thumbs-o-up\" aria-hidden=\"true\"></i></span><span class=\"total_like\"><label id=\"total_likes\" class=\"total_likes_'.get_the_ID().'\">'.$totalLiked.'</label> Me gusta</span></div>';\n }\n\n print_r($like);\n\n }\n\n if( in_array($post_rate, $seletedOptions )){\n\n $flag = true;\n\n $user_ID = get_current_user_id();\n\n $postdata = get_post_meta(get_the_ID(), 'awst_ratings', true);\n\n $ratings = AwstComman::getRatings($postdata);\n $useRated = $postdata[$user_ID];\n\n $rate = '<div class=\"awst_rate\">';\n for ($i = 1; $i <= 5; $i++) {\n if( $i <= $useRated ){\n $rate .= '<span id=\"star'.$i.'\" class=\"awst_rate_btn\"><i class=\"fa fa-star\" aria-hidden=\"true\" data-post-id=\"'.get_the_ID().'\" data-rate-id=\"'.$i.'\" ></i></span>';\n }else{\n $rate .= '<span id=\"star'.$i.'\" class=\"awst_rate_btn\"><i class=\"fa fa-star-o\" aria-hidden=\"true\" data-post-id=\"'.get_the_ID().'\" data-rate-id=\"'.$i.'\" ></i></span>';\n }\n }\n $rate .= '&nbsp;<span class=\"rating-text\">Valuación media: &nbsp;</span> <span class=\"rating-text\" id=\"average_rating\">'.$ratings.'</span>';\n $rate .= '</div>';\n\n }\n\n if( in_array($post_review, $seletedOptions )){\n $flag = true;\n\n $reviews = AwstComman::getReviews( get_the_ID() );\n\n $html = '<div id=\"review-list\">';\n $html .= '<ul>';\n\n foreach ($reviews as $key => $value) {\n # code...\n $userdetail = get_user_by( 'ID', $value->post_author );\n $html .= '<li><div class=\"review-content\"><i class=\"fa fa-comment\" aria-hidden=\"true\"></i>'.$value->post_content.'</div><div class=\"review-detail\"><span class=\"review-author\"><i class=\"fa fa-user\" aria-hidden=\"true\"></i>'.$userdetail->data->user_login.'</span><span class=\"review-date\"><i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>'.date(\"d F Y\", strtotime($value->post_date)).'</span></div></li>';\n\n }\n\n $html .= '</div>';\n $html .= '</ul>';\n\n $review = '<div class=\"awst_review\">\n <h2>'.get_the_title().' Reviews</h2>\n '.$html.'\n <textarea id=\"review_'.get_the_ID().'\" name=\"review\">Leave a Review.....</textarea>\n <span data-post-id=\"'.get_the_ID().'\" class=\"awst_rate_btn_review\">Add Review<i class=\"fa fa-comment\" aria-hidden=\"true\"></i></span>\n </div>';\n }\n\n $messageBlock = '<div class=\"err_msg\"><div id=\"awMessageBlock\"></div></div>';\n $clearfix = '<div style=\"clear:both;\"></div>';\n\n if( $flag ){\n return $content.\" <div class='awst_block'>\".$messageBlock.\" \".$like.\" \".$rate.\" \".$review.\" \".$clearfix.\"</div>\" ;\n }else{\n return $content;\n }\n\n }", "function _preview_theme_template_filter() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process put sides of the strat.
private function _process_put_side($row, $hour, $rsi_index) { // If we do not have an open trade we see if this is the time to open one. // We also do not put trades on late in the date. if(is_null($this->open_trade) && ($hour < 12)) { // Check to see if the RSI reading is under 30 if($rsi_index[$row['Data1MinSpyTime']] > 70) { // Figure out how many shares to buy. $shares = floor($this->balance / $row['Data1MinSpyLast']); // Open the trade. $this->open_trade = [ 'date' => $row['Data1MinSpyDate'], 'time' => $row['Data1MinSpyTime'], 'price' => $row['Data1MinSpyLast'], 'type' => 'put', 'rsi' => round($rsi_index[$row['Data1MinSpyTime']], 2), 'shares' => $shares ]; } } else { // Set failed price and success price. $failed = $this->open_trade['price'] + $this->signals['put_close_change_failed']; $success = $this->open_trade['price'] - $this->signals['put_close_change_success']; // See if we hit our stop limit. if(($row['Data1MinSpyLast'] >= $failed) && (! is_null($this->open_trade))) { $this->balance = $this->balance + ($this->open_trade['price'] - $row['Data1MinSpyLast']); // Log trade $this->trades[] = [ 'date' => $this->open_trade['date'], 'open_time' => $this->open_trade['time'], 'close_time' => $row['Data1MinSpyTime'], 'open_price' => $this->open_trade['price'], 'close_price' => $row['Data1MinSpyLast'], 'open_rsi' => $this->open_trade['rsi'], 'eod' => 'no', 'type' => $this->open_trade['type'], 'shares' => $this->open_trade['shares'], 'profit' => round($this->open_trade['price'] - $row['Data1MinSpyLast'], 2), 'balance' => $this->balance ]; $this->open_trade = null; // One trade per day return true; } // See if we hit our success target if(($row['Data1MinSpyLast'] <= $success) && (! is_null($this->open_trade))) { $this->balance = $this->balance + ($this->open_trade['price'] - $row['Data1MinSpyLast']); // Log trade $this->trades[] = [ 'date' => $this->open_trade['date'], 'open_time' => $this->open_trade['time'], 'close_time' => $row['Data1MinSpyTime'], 'open_price' => $this->open_trade['price'], 'close_price' => $row['Data1MinSpyLast'], 'open_rsi' => $this->open_trade['rsi'], 'eod' => 'no', 'type' => $this->open_trade['type'], 'shares' => $this->open_trade['shares'], 'profit' => round($this->open_trade['price'] - $row['Data1MinSpyLast'], 2), 'balance' => $this->balance ]; $this->open_trade = null; // One trade per day return true; } } // If we have reached 1pm PST and we still have a trade on we need to close it. if(($hour == 13) && (! is_null($this->open_trade)) && ($this->open_trade['type'] == 'put')) { $this->balance = $this->balance + ($row['Data1MinSpyLast'] - $this->open_trade['price']); // Log trade $this->trades[] = [ 'date' => $this->open_trade['date'], 'open_time' => $this->open_trade['time'], 'close_time' => $row['Data1MinSpyTime'], 'open_price' => $this->open_trade['price'], 'close_price' => $row['Data1MinSpyLast'], 'open_rsi' => $this->open_trade['rsi'], 'eod' => 'yes', 'shares' => $this->open_trade['shares'], 'profit' => round($this->open_trade['price'] - $row['Data1MinSpyLast'], 2), 'balance' => $this->balance ]; $this->open_trade = null; // One trade per day return true; } }
[ "function place($nile_id,$side){\n\t\t$current_side = FIND_KEY_BY_VALUE($this->neighbors,$nile_id);\n\t\tINFO(__METHOD__.\" put $nile_id on $side \");\n\t\tINFO(__METHOD__.\" Current side $current_side \");\n\t\tif(Strings::Same($current_side,$side)){\n\t\t\treturn;\n\t\t}\n\t\t//Put NILE on TOP\n\t\tswitch($current_side){\n\t\tcase 'rtop':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'top':\n\t\t\tbreak;\n\t\tcase 'rbottom':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'bottom':\n\t\t\t$this->rotate();\n\t\t\t$this->rotate();\n\t\t\tbreak;\n\t\tcase 'rleft':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'right':\n\t\t\t$this->rotate();\n\t\t\t$this->rotate();\n\t\t\t$this->rotate();\n\t\t\tbreak;\n\t\tcase 'rright':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'left':\n\t\t\t$this->rotate();\n\t\t\tbreak;\n\n\t\t\tbreak;\n\t\t}\n\t\t$current_side = FIND_KEY_BY_VALUE($this->neighbors,$nile_id);\n\t\tINFO(__METHOD__.\" Current side $current_side \");\n\t\tif($current_side != 'top')FATAL(__METHOD__.\" did not place it on top\");\n\n\t\t//target nile is set to top position, now place it where we need it\n\t\tswitch($side){\n\t\tcase 'rtop':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'top':\n\t\t\tbreak;\n\t\tcase 'rbottom':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'bottom':\n\t\t\t$this->rotate();\n\t\t\t$this->rotate();\n\t\t\tbreak;\n\t\tcase 'rleft':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'left':\n\t\t\t$this->rotate();\n\t\t\t$this->rotate();\n\t\t\t$this->rotate();\n\t\t\tbreak;\n\t\tcase 'rright':\n\t\t\t$this->flip();\n\t\t\t//fall thru\n\t\tcase 'right':\n\t\t\t$this->rotate();\n\t\t\tbreak;\n\n\t\t}\n\t\t$current_side = FIND_KEY_BY_VALUE($this->neighbors,$nile_id);\n\t\tINFO(__METHOD__.\" Current side $current_side \");\n\t\tif($current_side != $side)FATAL(__METHOD__.\" did not place it on $side\");\n\t}", "public function moveComponentToSegment($segfrom_id, $segto_id, $side)\n {\n $segfrom = tblSegment::find($segfrom_id);\n $need_move_rmds = tblSectiondataRMD::getOutsideBoundarySection($segfrom_id, $side);\n \n foreach ($need_move_rmds as $rec) \n {\n if (\\Helper::compareTwoPoint($rec->km_to, $rec->m_to, $segfrom->km_from, $segfrom->m_from) <= 0 || \\Helper::compareTwoPoint($segfrom->km_to, $segfrom->m_to, $rec->km_from, $rec->m_from) <= 0)\n {\n // whole moving\n DB::table('tblSectiondata_RMD')\n ->where('id', $rec->id)\n ->update([\n 'segment_id' => $segto_id,\n 'effect_at' => $segfrom->effect_at,\n 'updated_by' => Auth::user()->id\n ]);\n } \n else\n {\n // partial moving\n $this->separateRMDSection($rec, $segfrom, $segto_id, $side);\n } \n }\n\n $need_move_mhs = tblSectiondataMH::getOutsideBoundarySection($segfrom_id, $side);\n\n foreach ($need_move_mhs as $rec) \n {\n if (\\Helper::compareTwoPoint($rec->km_to, $rec->m_to, $segfrom->km_from, $segfrom->m_from) <= 0 || \\Helper::compareTwoPoint($segfrom->km_to, $segfrom->m_to, $rec->km_from, $rec->m_from) <= 0)\n {\n // whole moving\n DB::table('tblSectiondata_MH')\n ->where('id', $rec->id)\n ->update([\n 'segment_id' => $segto_id,\n 'effect_at' => $segfrom->effect_at,\n 'updated_by' => Auth::user()->id\n ]);\n } \n else\n {\n // partial moving\n $this->separateMHSection($rec, $segfrom, $segto_id, $side);\n } \n }\n\n $need_move_tvs = tblSectiondataTV::getOutsideBoundarySection($segfrom_id, $side);\n foreach ($need_move_tvs as $rec) \n {\n DB::table('tblSectiondata_TV')\n ->where('id', $rec->id)\n ->update([\n 'segment_id' => $segto_id,\n 'effect_at' => $segfrom->effect_at,\n 'updated_by' => Auth::user()->id\n ]);\n }\n }", "protected function handle_PUT() {\n $this->mark();\n // make sure that the post parameters are read\n $content = file_get_contents(\"php://input\");\n $this->log($content);\n $data = json_decode($content, true);\n if (!$data) {\n parse_str($content, $_POST);\n }\n\n if ( $this->item_id ) {\n $this->bad_request();\n }\n else if ( $this->dossier_id ) {\n $this->add_item($data);\n }\n else {\n $this->add_dossier();\n }\n }", "protected function put()\n {\n }", "public function place(int $x, int $y, string $direction): void;", "protected function executePut()\n\t{\n\t\tif (!is_string($this->requestBody)) {\n\t\t\t//$this->buildPostBody();\n\t\t}\n\n\t\tcurl_setopt($this->curlHandle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($this->curlHandle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t\tcurl_setopt($this->curlHandle, CURLOPT_POSTFIELDS, $this->requestBody);\n\n\t\t$this->doExecute();\n\t}", "public function set_sides($num){\n $this->sides = $num;\n }", "function action($action) {\n\n // Choice of possible actions\n // Note the frequent fallthroughs : the actions are decrementally \"long\"\n switch ($action) {\n\n case self::JSMIN_ACT_FULL :\n // Write A to output, then fall through\n\n $this->put($this->theA);\n\n case self::JSMIN_ACT_BUF : // N.B. possible fallthrough from above\n // Copy B to A\n\n $tmpA = $this->theA = $this->theB;\n\n // Treating a string as a single char : outputting it whole\n // Note that the string-opening char (\" or ') is memorized in B\n\n if ($tmpA == '\\'' || $tmpA == '\"') {\n\n $pos = $this->inPos;\n while (true) {\n // instead of looping char by char, we directly go to the next\n // revelant char, thanks to php strpos function.\n $pos = $this->getCloser($this->in, array($this->theB,'\\\\',\"\\n\"), $pos);\n\n if ( $pos === false ) {\n // Whoopsie\n throw new JsMinEnhException('UnterminatedStringLiteral');\n }\n\n $tmpA = $this->in[$pos];\n\n if ($tmpA == $this->theB) {\n // String terminated\n break; // from while(true)\n }\n if ($tmpA == \"\\n\") {\n // Whoopsie\n throw new JsMinEnhException('UnterminatedStringLiteral');\n }\n // else\n if ($tmpA == '\\\\') {\n // Escape next char immediately\n $pos += 2;\n }\n }\n\n // cool, we got the whole string\n $this->put(substr($this->in, $this->inPos - 1, $pos - $this->inPos + 1));\n $this->inPos = $pos + 1;\n $this->theA = $tmpA;\n }\n\n case self::JSMIN_ACT_IMM : // N.B. possible fallthrough from above\n // Get the next B\n\n $this->theB = $this->next();\n\n // Special case of recognising regular expressions (beginning with /) that are\n // preceded by '(', ',' or '='\n\n $tmpA = $this->theA;\n\n if ($this->theB == '/' && ($tmpA == '(' || $tmpA == ',' || $tmpA == '=')) {\n\n // Output the two successive chars\n $this->put($tmpA);\n $this->put($this->theB);\n\n // Look for the end of the RE literal, watching out for escaped chars or a control /\n // end of line char (the RE literal then being unterminated !)\n $pos = $this->inPos;\n while (true) {\n // instead of looping char by char, we directly go to the next\n // revelant char, thanks to php strpos function.\n $pos = $this->getCloser($this->in, array('/','\\\\',\"\\n\"), $pos);\n\n if ( $pos === false ) {\n // Whoopsie\n throw new JsMinEnhException('UnterminatedRegExpLiteral');\n }\n\n $tmpA = $this->in[$pos];\n\n if ($tmpA == '/') {\n // RE literal terminated\n break; // from while(true)\n }\n if ( $tmpA == \"\\n\") {\n // Whoopsie\n throw new JsMinEnhException('UnterminatedRegExpLiteral');\n }\n // else\n if ($tmpA == '\\\\') {\n // Escape next char immediately\n $pos += 2;\n }\n }\n $this->put(substr($this->in, $this->inPos, $pos - $this->inPos));\n $this->inPos = $pos + 1;\n $this->theA = $tmpA;\n\n\n // Move forward after the RE literal\n $this->theB = $this->next();\n }\n\n break;\n default :\n throw new JsMinEnhException('Expected a JSMin::ACT_* constant in action()');\n }\n }", "private function placeShips()\n {\n\n foreach($this->ships as $ship) {\n\n //build the helper coordinates and pass it to the recursion\n $coordinates = $this->coordinate->buildCoordinates($ship);\n\n $this->placeShip($ship, $coordinates);\n\n }\n }", "protected function validatePut()\n {\n }", "public function putData()\n {\n //is to take string value in put\n parse_str(file_get_contents(\"php://input\"), $_PUT);\n //if id is null\n if ($_PUT['id'] == null) {\n echo \"message: give id\";\n return;\n }\n $q = \"UPDATE user SET\";\n //make query according to user input\n foreach ($_PUT as $key => $value) {\n if ($key != \"id\") {\n $q .= \" \" . $key . \" = '\" . $value . \"',\";\n }\n }\n $q = substr($q, 0,- 1);\n $q .= \" WHERE id = \" . $_PUT['id'];\n ///$this->db->query($q);\n\n //run query\n $this->queryFun($q);\n }", "function op_PUT($value, &$stream, $stack, $memo, $debug, $mapper)\n\t\t{\n\t\t\t$stream->write($mapper->str2bin(\"PUT\"));\n\t\t\t$stream->write_line($value);\n\t\t\t\n\n\t\t}", "public function moveForwardWRTOrientation() :void\n {\n if($this->place->isPlaced()){\n $currentPosition = $this->place->getPosition();\n // Determine new position based on current direction\n switch ($currentPosition['orientation']) {\n case Config::ORIENTATION_NORTH:\n $currentPosition['y'] += Config::DEFAULT_MOVEMENT_UNIT;\n break;\n\n case Config::ORIENTATION_EAST:\n $currentPosition['x'] += Config::DEFAULT_MOVEMENT_UNIT;\n break;\n\n case Config::ORIENTATION_SOUTH:\n $currentPosition['y'] -= Config::DEFAULT_MOVEMENT_UNIT;\n break;\n\n case Config::ORIENTATION_WEST:\n $currentPosition['x'] -= Config::DEFAULT_MOVEMENT_UNIT;\n break;\n }\n $newPosition = ['x'=>$currentPosition['x'], 'y'=>$currentPosition['y'], 'orientation'=>$currentPosition['orientation']];\n $this->place->placeOnBoard($newPosition['x'],$newPosition['y'],$newPosition['orientation']);\n }\n\n }", "function _putstream($s)\n {\n if ($this->_encrypted) {\n $s = $this->_RC4($this->_objectkey($this->n), $s);\n }\n\n parent::_putstream($s);\n }", "protected function spaceShortcut()\n {\n\n $spaceKey = $this->positionInLayout(chr(32));\n $space = $this->getElement($spaceKey);\n $elmTwo = $this->elmTwo;\n\n $this->elmTwo = $space;\n $this->getPath($this->elmOne, $this->elmTwo);\n\n $this->elmTwo = $elmTwo;\n $pathToSpace = $this->path;\n\n $this->path = array();\n\n $elmOne = $this->elmOne;\n $this->elmOne = $space;\n $this->getPath($space, $this->elmTwo);\n $this->elmOne = $elmOne;\n\n $pathFromSpace = $this->path;\n\n $this->path = array();\n $this->path['space']['to'] = $pathToSpace;\n $this->path['space']['from'] = $pathFromSpace;\n $this->path['space']['score'] = $this->getScore($pathToSpace)+$this->getScore($pathFromSpace);\n\n }", "private function workOnPutAndDeleteMethods($currMethod)\n {\n if ($_SERVER['REQUEST_METHOD'] == 'PUT' || $_SERVER['REQUEST_METHOD'] == 'DELETE') {\n parse_str(file_get_contents(\"php://input\"), $_PUT);\n foreach ($_PUT as $key => $value) {\n unset($_PUT[$key]);\n $_PUT[str_replace('amp;', '', $key)] = $value;\n }\n $_POST = array_merge($_POST, $_PUT);\n $_REQUEST = array_merge($_REQUEST, $_PUT);\n }\n }", "public function placeSymbol(){\n\t\tfor($col = 0; $col < 3; $col++){\n\t\t\tfor($row = 0; $row < 3; $row++){\n\t\t\t\tif(isset($_GET[\"cell-\".$col.\"-\".$row])) {\n\t\t\t\t\tif(empty($this->board[$col][$row])) {\n\t\t\t\t\t\t$this->board[$col][$row] = $_GET[\"cell-\".$col.\"-\".$row];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function sc()\r\n {\r\n $this->sa();\r\n $this->sb();\r\n }", "protected abstract function setSPs();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the [fact_destinataire] column value.
public function getFactDestinataire() { return $this->fact_destinataire; }
[ "public function getCidadeDestino()\n {\n return $this->cidadeDestino;\n }", "public function getDestinataireId()\r\n {\r\n return $this->destinataireId;\r\n }", "public function getDestino()\n {\n return $this->destino;\n }", "public function getDestino()\r\n {\r\n return $this->destino;\r\n }", "public function getFkAlmoxarifadoPedidoTransferenciaItemDestino()\n {\n return $this->fkAlmoxarifadoPedidoTransferenciaItemDestino;\n }", "public function getDestRelance() {\n return $this->destRelance;\n }", "public function getComplFluxoXDest()\n {\n return $this->compl_fluxo_xDest;\n }", "public function getEsDestacadoAttribute()//tengo q poner get siempre y Destacado porqe tiene q coincidir con el nombre del campo en la tabla q quiero cambiar\n {\n $esDestacado=$this->destacado; // $this->destacado aca invoco al campo de la tabla y lo pongo en la variable\n if($esDestacado)//si es 1 es true y entro\n return 'Si';\n //si no\n return 'No';\n }", "function getDestVarName() {\n return $this->destVarName;\n }", "public function getDestId()\n\t{\n\t\treturn $this->dest_id;\n\t}", "function getId_ctr_destino()\n {\n if (!isset($this->iid_ctr_destino) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_ctr_destino;\n }", "public function getDescuento_factura()\n {\n return $this->descuento_factura;\n }", "public function getDestXNome()\n {\n return $this->dest_xNome;\n }", "function getTargetColumnID() {\n\t\treturn $this->data_array['target_taskboard_column_id'];\n\t}", "public function getDestActivo()\n {\n return $this->destActivo;\n }", "public function getDest()\n\t{\n\t\treturn $this->dest;\n\t}", "public function getDossierFactPme(): ?string {\n return $this->dossierFactPme;\n }", "public function getFkAlmoxarifadoPedidoTransferenciaItemDestinos()\n {\n return $this->fkAlmoxarifadoPedidoTransferenciaItemDestinos;\n }", "public function getDestanationDimensions()\n {\n if(!$this->getData('destanation_dimensions')) {\n $this->setData('destanation_dimensions', clone $this->getDimensions());\n }\n\n return $this->getData('destanation_dimensions');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return assignees implementation instance for this object
function assignees() { if($this->assignees === false) { $this->assignees = new ISubtaskAssigneesImplementation($this); } // if return $this->assignees; }
[ "public function assignees()\n {\n return $this->hasMany(Assignee::class, 'task_id');\n }", "public function getAssignees(): Generator\n {\n return $this->fetch(sprintf('%s/assignees', $this->url));\n }", "public function getAssignee()\n {\n return $this->hasOne(Assignee::className(), ['id' => 'assignee_id']);\n }", "public function getTaskAssignees() {\n\t\treturn $this->hasMany(TaskAssignee::className(), ['task_id' => 'id']);\n\t}", "abstract protected function getAssigneeClass();", "public function getAssignee()\n\t\t{\n\t\t\treturn User::model()->findAll(\"id_user IN (SELECT id_user FROM assign WHERE id_task = '\" . $this->id_task . \"')\", array(\"id_user\", \"username\"));\n\t\t}", "public function get_assignees() {\n\t\t//used only while creating an opportunity as it's only one opportunity\n\t\tif ($this->session->userdata('uid')) {\n\t\t\ttry {\n\t\t\t\t$json = file_get_contents(\"php://input\");\n\t\t\t\t$data = json_decode($json);\n\t\t\t\t$user_id = $this->session->userdata('uid');\n\t\t\t\t$data->user_id = $user_id;\n\t\t\t\t// Get users based on stage assignment or ownership assignment.\n\t\t\t\tif ($data->btn_status == 'oppOwner')\n\t\t\t\t{\n\t\t\t\t\t$users = $this->opp_mgr->fetch_users($data,'oppOwner');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$users = $this->opp_mgr->fetch_users($data,'stageOwner');\n\t\t\t\t}\n\n\t\t\t\techo json_encode($users);\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function getAssignee()\n {\n return $this->assignee;\n }", "public function getAssignee() {\n\t\t$assignee = null;\n\t\tif(isset($this->uID)) {\n\t\t\tif($this->uID == 0) {\n\t\t\t\t// 0 means to filter by the logged in user.\n\t\t\t\t$assignee = new User;\n\t\t\t} else {\n\t\t\t\t$assignee = User::getByUserID($this->uID);\n\t\t\t}\n\t\t}\n\t\treturn $assignee;\n\t}", "public function getAssigneeEmail();", "public function assignee()\n {\n return $this->belongsTo(User::class, 'user_id');\n }", "function assignedUsers()\n {\n return $this->morphMany('App\\AssignedUsers', 'assignable');\n }", "public function setAssignee($var)\n {\n GPBUtil::checkString($var, True);\n $this->assignee = $var;\n\n return $this;\n }", "public function assignment() {\n\t\treturn $this->hasMany('Assignment', 'user');\n\t}", "public function getAssignedToAttribute() {\n return $this->users()->wherePivot('type', 'assigned')->first();\n }", "public function allAssignedTo() {\n return $this->hasMany(TicketAssignedUser::class, 'ticket_id');\n }", "public function setAssignee($value)\n {\n return $this->set('Assignee', $value);\n }", "public function getAssignments()\n\t{\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t\n\t\t//get user course detail\n\t\t$course = $this->Session->read('UserData.usersCourses'); // is an array..\n\t\t\n\t\t//get course info\n\t\t$course_info = $this->getCourseNameOfUser($course[0]);\n\t\t\n\t\t//finding the assignment criteria for day before, week before, custom date.\n\t\t$assignment_crieteria = $this->getAssignmentConstraints();\n\t\n\t\t$options['limit'] = 10;\n\t\t$options['conditions'][] = array('PleAssignmentReminder.user_id' => $user);\n\t\t$options['conditions'][] = array('PleAssignmentReminder.course_id LIKE'=>$course_info->course_name.'[-]%'); //check for course name\n\t\t$options['conditions'][] = $assignment_crieteria;\n\t\t$options['fields'] = array('id', 'assignment_uuid', 'assignment_title', 'due_date');\n\t\t\n\t\t$options['order'] = array('PleAssignmentReminder.id desc');\n \n\t\t\n\t\t$this->Paginator->settings = $options;\n\t\t$assignmnet_detail = $this->Paginator->paginate('PleAssignmentReminder');\n\t\n\t\treturn $assignmnet_detail;\n\n\t}", "public function getAssigneeName();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the available routes for the resource.
protected function setUpRoutes() { }
[ "public function setRoutes(): void\n {\n $versions = $this->_versions;\n $default = 'api/v1/v0';\n\n Router::scope('/api', function ($routes) use ($versions, $default) {\n // Setting up fallback non-versioned API url calls.\n // It can handle `api/controller/index.json` as well\n // as `api/controller.json` calls.\n Router::prefix('api', function ($routes) use ($default) {\n $routes->setExtensions(['json']);\n $routes->connect('/:controller', ['prefix' => $default], ['routeClass' => DashedRoute::class]);\n $routes->connect('/:controller/:action/*', ['prefix' => $default], ['routeClass' => DashedRoute::class]);\n $routes->fallbacks(DashedRoute::class);\n });\n\n foreach ($versions as $version) {\n Router::prefix($version['prefix'], ['path' => $version['path']], function ($routes) {\n $routes->setExtensions(['json']);\n $routes->fallbacks(DashedRoute::class);\n });\n }\n });\n }", "public function rest_api_register_routes() {\n\t}", "protected function init_routes() \n\t{\n\t\t$this->routes[\"([^\\\\/]+)\"] = array(\n\t\t\t\"method\" => \"set_controller_action_parameters\",\n\t\t);\n\t}", "protected function setupRoutes()\r\n {\r\n // setup routes\r\n $this->registry()->routeConfig = new Zend_Config_Ini($this->registry->appRoot . \"/etc/conf/routes.ini\"); \r\n }", "public function register_routes()\n {\n register_rest_route($this->namespace, $this->rest_base, array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_menus'),\n )\n ));\n register_rest_route($this->namespace, $this->rest_base . '/(?P<slug>[a-zA-Z0-9_-]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_menu'),\n )\n ));\n }", "public function setupRoutes()\n {\n $routes = $this->config();\n\n if (PHP_SAPI == 'cli') {\n $scripts = ( isset($routes['scripts']) ? $routes['scripts'] : [] );\n foreach ($scripts as $scriptIdent => $scriptConfig) {\n $this->setupScript($scriptIdent, $scriptConfig);\n }\n } else {\n $templates = ( isset($routes['templates']) ? $routes['templates'] : [] );\n foreach ($templates as $routeIdent => $templateConfig) {\n $this->setupTemplate($routeIdent, $templateConfig);\n }\n\n $actions = ( isset($routes['actions']) ? $routes['actions'] : [] );\n foreach ($actions as $actionIdent => $actionConfig) {\n $this->setupAction($actionIdent, $actionConfig);\n }\n }\n }", "protected function setup_routes(): void {\n\t\t// Initiate Router\n\t $router = new App\\Router();\n\t // include our route definitions\n\t\tinclude CORE_DIRECTORY.'Routes.php';\n\t\t// run the router\n\t $router->run();\n\t}", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public function register_routes() {}", "public function setRoutes() : void\n {\n if (is_null($this->routes)) {\n $this->routes = [];\n $routesConfig = $this->config->getParam('routes') ?? [];\n foreach ($routesConfig as $routeName => $routeArr) {\n $route = new Route(\n $routeName,\n $routeArr['methods'],\n $routeArr['path'],\n $routeArr['params_defaults'],\n $routeArr['params_requirements'],\n $routeArr['handler'],\n $routeArr['handler_method'] ?? null\n );\n $this->routes[] = $route;\n }\n }\n }", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "public function registerRoutes()\n {\n $this->forAccessTokens();\n $this->forTransientTokens();\n $this->forClients();\n $this->forPersonalAccessTokens();\n }", "public function setRoutes()\n {\n // searching, sorting and filtering\n $this->setIndexRouteName('stgreject.index');\n\n // crud support\n $this->setCreateRouteName('stgreject.create');\n $this->setViewRouteName('stgreject.show');\n $this->setDeleteRouteName('stgreject.destroy');\n\n // default route parameter\n $this->setDefaultRouteParameter('unique_key');\n }", "public function register_rest_routes()\n {\n }", "static public function setupRoutes() {\n\t\t$application = Nette\\Environment::getApplication();\n\t\t$router = $application->getRouter();\n\t\t\n\t\t$router[] = new Route('files[<'.self::PARAM_NAME.'>]', array(\n\t\t\t\t\t\tself::PARAM_NAME => array(\n\t\t\t\t\t\t\t Route::PATTERN => '/([^/]*/)*[^/]+',\n\t\t\t\t\t\t\t Route::FILTER_IN => null,\n\t\t\t\t\t\t\t Route::FILTER_OUT => null\n\t\t\t\t\t\t),\n\t\t\t\t\t\tRoute::PRESENTER_KEY => 'System:Files',\n\t\t\t\t\t\t'action' => 'default'\n\t\t\t\t\t\t\t )\n\t\t);\n\t}", "function setRoutes()\n\t{\n\t\t/* Verifying if configs was loaded */\n\t\tif($this->_configs == null)\n\t\t{\n\t\t\t/* Loading configs */\n\t\t\t$this->loadConfigs();\n\t\t}\n\t\t\n\t\t/* Getting router */\n\t\t$router = $this->_front->getRouter();\n\t\t\n\t\t/* Getting configs */\n\t\t$routes = new Zend_Config_Ini(CONFIG_DIR . $this->_configs->system->routefile);\n\t\t\n\t\t/* Looping for init routes */\n\t\tforeach($routes as $route => $params)\n\t\t{\n\t\t\t$router->addRoute($route, \n\t\t\t\t\tnew Zend_Controller_Router_Route($params->route,array('module'=>$params->options->module,'controller'=>$params->options->controller,'action'=>$params->options->action)));\n\t\t}\n\t}", "protected function routes()\n {\n Nova::routes();\n }", "public function rest_api_register_routes() {\n\t\tif ( ! is_a( WC()->api, 'WC_API' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once( $this->plugin_path() . '/includes/class-wc-brands-rest-api-controller.php' );\n\n\t\t$controllers = array(\n\t\t\t'WC_Brands_REST_API_Controller',\n\t\t);\n\n\t\t// WooCommerce 3.5 has moved v2 endpoints to legacy classes\n\t\tif ( version_compare( WC_VERSION, '3.5', '>=' ) ) {\n\t\t\trequire_once( $this->plugin_path() . '/includes/class-wc-brands-rest-api-v2-controller.php' );\n\t\t\t$controllers[] = 'WC_Brands_REST_API_V2_Controller';\n\t\t}\n\n\t\tforeach ( $controllers as $controller ) {\n\t\t\tWC()->api->$controller = new $controller();\n\t\t\tWC()->api->$controller->register_routes();\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Restituisce la data di partenza di ricerca
public function getDataPartenzaRicerca() { if (isset($_REQUEST['data_partenza_ricerca'])) { return $_REQUEST['data_partenza_ricerca']; } else return 0; }
[ "public function getDatiCreaPartita() {\n\t\t$dati_richiesti=array('Titolo','Indirizzo','Descrizione','Data', 'Ora', 'Minuti', 'Giocatori', 'Attrezzatura','Prezzo', 'Categoria', 'Partecipazione');\n\t\t$dati=array();\n\t\tforeach ($dati_richiesti as $dato) {\n\t\t\tif (isset($_REQUEST[$dato]))\n\t\t\t\t$dati[$dato]=$_REQUEST[$dato];\n\t\t}\n\t\treturn $dati;\n\t}", "public function getDatiBeniServizi();", "private function _drawRepertoire() {\n\t\t//on fragmente notre information dans le tableau $urlParts (séparateur '/')\n\t\t$urlParts = explode('/', $this->_url);\n\n\t\t//shéma des url\n\t\t$urlParts[$this->_indicePage] = '[xx]';\n\t\t$shemaUrl = implode('/', $urlParts);\n\n\t\t//Affichage\n\t\treturn $this->_affichage($shemaUrl);\n\t}", "public function getDataPartenza() {\n return $this->dataPartenza;\n }", "public function getPartiProgettuali(){\n $em = $this->get('doctrine')->getManager();\n\n $partiprogettualis = $em->getRepository('FrontendBundle:PartiProgettuali')->findAll();\n\n foreach($partiprogettualis as $parti){\n $data['id'] = $parti->getId();\n $data['name'] = $parti-> getName();\n\n $result[] = $data;\n }\n return $result;\n }", "public function getInfoPart(){\n\t\t$codigoAlterno = $this->input->post('cod_alter');\n\t\t$jsonInfoParte = array();\n\t\tif($codigoAlterno == \"\" || $codigoAlterno == NULL){\n\t\t\t$jsonInfoParte['response_code'] = \"201\";\n\t\t\t$jsonInfoParte['response_msg'] = \"El codigo alterno esta vacio =(!\";\n\t\t}else{\n\t\t\t\n\t\t\t$parteInfo = $this->CatalogoAlmacen_model->getParteByCod($codigoAlterno);\n\t\t\tif(!is_null($parteInfo)){\n\t\t\t\t$jsonInfoParte['response_code'] = \"200\";\n\t\t\t\t$jsonInfoParte['response_msg'] = 'operacion exitosa';\n\t\t\t\t$jsonInfoParte['infoParte'] = $parteInfo;\n\n\t\t\t\t$idParte = $jsonInfoParte['infoParte']->Id_Parte;\n\t\t\t\t$jsonInfoParte['proveedores'] = $this->CatalogoAlmacen_model->getRelProv($codigoAlterno);\n\t\t\t\t$jsonInfoParte['ubicaciones'] = $this->CatalogoAlmacen_model->getRelUbic($idParte);\n\t\t\t}else{\n\t\t\t\t$jsonInfoParte['idPart'] = $this->genIdNext('B');\n\t\t\t\t$jsonInfoParte['response_code'] = \"201\";\n\t\t\t\t$jsonInfoParte['response_msg'] = 'no se encontro informacion';\n\t\t\t}\n\t\t}\n\t\techo json_encode($jsonInfoParte);\n\t}", "public function getDataAddRes(){\n $data['Add_Resident']=$this->lang->line('Add_Resident');\n $data['FirstName']=$this->lang->line('FirstName');\n $data['LastName']=$this->lang->line('LastName');\n $data['Gender']=$this->lang->line('Gender');\n $data['Birthday']=$this->lang->line('Birthday');\n $data['RoomNumber']=$this->lang->line('RoomNumber');\n $data['Facility']=$this->lang->line('Facility');\n $data['Add_FirstName']=$this->lang->line('Add_FirstName');\n $data['Add_LastName']=$this->lang->line('Add_LastName');\n $data['Select_Facility']=$this->lang->line('Select_Facility');\n $data['Add_Roomnumber']=$this->lang->line('Add_Roomnumber');\n $data['Upload_Image']=$this->lang->line('Upload_Image');\n $data['Day/Month/Year']=$this->lang->line('Day/Month/Year');\n return $data;\n }", "private function detallesObra(){\r\n\t\t\t$this->oLogger->debug( \"detallesObra\" );\r\n\t\t\t$sql= \"SELECT det.*, LPAD(det.id_obra,4,'0') proyecto, art.articulo, art.codigo, art.precio_compra, iva\"; \r\n\t\t\t$sql.=\" FROM proyectos_detalles det, articulos art, iva\";\r\n\t\t\t$sql.=\" WHERE det.id_articulo=art.id AND art.id_iva=iva.id AND det.id_obra=$_REQUEST[id] ORDER BY det.posicion;\";\r\n\t\t\t$resultado = $this->computeSQL($sql,false);\r\n\t\t\t\r\n\t\t\tif ( $this->oSystem->getOrderActionClass()->getChannel()=='html' || $this->oSystem->getOrderActionClass()->getChannel()=='pdf'){\r\n\t\t\t\t$this->oLogger->debug( \"formato html\" );\r\n\t\t\t\treturn $resultado;\r\n\t\t\t} else if ( $this->oSystem->getOrderActionClass()->getChannel()=='json' ){\r\n\t\t\t\t$this->oLogger->debug( \"formato json\" );\r\n\t\t\t\t$rows = array();\r\n\t\t\t\twhile ( $row = $this->oSystem->getConnection()->getColumnas($resultado) ){\r\n\t\t\t\t\tarray_push( $rows, array(\"id_obra\"=>$row[id_obra],\"proyecto\"=>$row[proyecto],\"cantidad\"=>$row[cantidad],\"id_articulo\"=>$row[id_articulo],\"articulo\"=>utf8_encode($row[articulo]),\"precio\"=>$row[precio],\"dto\"=>$row[dto],\"importe\"=>$row[importe],\"iva\"=>$row[iva],\"codigo\"=>$row[codigo],\"precio_compra\"=>$row[precio_compra]) );\r\n\t\t\t\t}\r\n\t\t\t\treturn json_encode($rows);\r\n\t\t\t} else {\r\n\t\t\t\t$this->oLogger->debug(\"Error, channel no esperado\");\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}", "public function getCittaPartenzaRicerca() {\n if (isset($_REQUEST['citta_partenza_ricerca'])) {\n return $_REQUEST['citta_partenza_ricerca'];\n } else\n return 0;\n }", "public function getDataEditRes(){\n $data['FirstName']=$this->lang->line('FirstName');\n $data['LastName']=$this->lang->line('LastName');\n $data['Gender']=$this->lang->line('Gender');\n $data['Birthday']=$this->lang->line('Birthday');\n $data['RoomNumber']=$this->lang->line('RoomNumber');\n $data['Facility']=$this->lang->line('Facility');\n $data['Add_FirstName']=$this->lang->line('Add_FirstName');\n $data['Add_LastName']=$this->lang->line('Add_LastName');\n $data['Select_Facility']=$this->lang->line('Select_Facility');\n $data['Add_Roomnumber']=$this->lang->line('Add_Roomnumber');\n $data['Upload_Image']=$this->lang->line('Upload_Image'); \n $data['Edit_Residents']=$this->lang->line('Edit_Residents');\n $data['Day/Month/Year']=$this->lang->line('Day/Month/Year');\n $data['EDIT']=$this->lang->line('EDIT');\n return $data;\n }", "function datosNuevaReferencia($id_referencia = NULL,$nombre,$fabricante,$proveedor,$nombre_pieza,$tipo_pieza,$ref_proveedor_pieza,$ref_fabricante_pieza,$part_value_name,$part_value_qty,$part_value_name_2,$part_value_qty_2,$part_value_name_3,$part_value_qty_3,$part_value_name_4,$part_value_qty_4,$part_value_name_5,$part_value_qty_5,$pack_precio,$unidades,$nombre_archivo,$comentarios,$id_motivo_compatibilidad) {\n\t\t$this->id_referencia = $id_referencia;\n\t\t$this->referencia = $nombre;\n\t\t$this->fabricante = $fabricante;\n\t\t$this->proveedor = $proveedor;\n\t\t$this->part_nombre = $nombre_pieza;\n\t\t$this->part_tipo = $tipo_pieza;\n\t\t$this->part_proveedor_referencia = $ref_proveedor_pieza;\n\t\t$this->part_fabricante_referencia = $ref_fabricante_pieza;\n\t\t$this->part_valor_nombre = $part_value_name;\n\t\t$this->part_valor_cantidad = $part_value_qty;\n\t\t$this->part_valor_nombre_2 = $part_value_name_2;\n\t\t$this->part_valor_cantidad_2 = $part_value_qty_2;\n\t\t$this->part_valor_nombre_3 = $part_value_name_3;\n\t\t$this->part_valor_cantidad_3 = $part_value_qty_3;\n\t\t$this->part_valor_nombre_4 = $part_value_name_4;\n\t\t$this->part_valor_cantidad_4 = $part_value_qty_4;\n\t\t$this->part_valor_nombre_5 = $part_value_name_5;\n\t\t$this->part_valor_cantidad_5 = $part_value_qty_5;\n\t\t$this->pack_precio = $pack_precio;\n\t\t$this->unidades = $unidades;\n\t\t$this->nombre_archivo = $nombre_archivo;\n\t\t$this->comentarios = $comentarios;\n\t\t$this->id_motivo_compatibilidad = $id_motivo_compatibilidad;\n\t}", "public function RicercaAvanzata(){\n $view = new VRicerca();\n $view->mostraFiltri();\n }", "function recuperar_precios($id_prod) {\r\n$sql=\"select id_proveedor,precio,observaciones,usuario,fecha\r\n from precios where id_producto=$id_prod order by id_producto, id_proveedor\";\r\n$res_precios=sql($sql,\"precios \") or fin_pagina();\r\n$precios=\"\";\r\n\r\n while (!$res_precios->EOF) {\r\n \t$id_prov=$res_precios->fields['id_proveedor'];\r\n $precios[$id_prov]['id_proveedor']=$id_prov;\r\n $precios[$id_prov]['precio']=$res_precios->fields['precio'];\r\n $precios[$id_prov]['observaciones']=$res_precios->fields['observaciones'];\r\n $precios[$id_prov]['usuario']=$res_precios->fields['usuario'];\r\n $precios[$id_prov]['fecha']=$res_precios->fields['fecha'];\r\n \t\r\n $res_precios->MoveNext();\t\r\n }\r\n \r\n return $precios;\r\n}", "public function cargar_datos()\n\t{\n\t\t$id_centros_costo = $this->CentroCosto_model->obtener_lista_centro_costo();\n\t\t\n\t\tforeach($id_centros_costo as $id)\n\t\t{\n\t\t\t// Paso 1: creamos el objeto fila del que estaremos advertidos\n\t\t\t$fila = new CentroCostoPrimarioFila_model();\n\t\t\t$fila->set_centro_costo($id);\n\t\t\t\n\t\t\t// Paso 2: obtener los id de los criterios primarios en donde se encuentra este centro de costo\n\t\t\t$id_criterios_primarios = $this->UnidadRepartoPrimario_model->obtener_id_reparto_primario_porcentrocosto($fila->get_centro_costo()['id_centro_costo']);\n\t\t\t\n\t\t\t// Paso 4: por cada id de criterio primario, obtener la informacion del criterio y su reparticion\n\t\t\tforeach ($id_criterios_primarios as $id_criterio)\n\t\t\t{\n\t\t\t\t$criterio_primario = $this->CriterioRepartoPrimario_model->obtener_datos_criterio_reparto_primario($id_criterio);\n\t\t\t\t$datos_centro_criterio = $this->UnidadRepartoPrimario_model->obtener_datos_centro_criterio($criterio_primario['id_criterio_reparto_primario'], $fila->get_centro_costo()['id_centro_costo']);\n\t\t\t\t$dinero_disponible = $this->obtener_saldo_cuenta($criterio_primario['id_cuenta_interno']);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$columna = new CriterioPrimarioColumna_model();\n\t\t\t\t$columna->set_criterio($criterio_primario);\n\t\t\t\t$columna->set_datos_centro_criterio($datos_centro_criterio);\n\t\t\t\t$columna->set_dinero_disponible($dinero_disponible);\n\t\t\t\t$columna->calcular_dinero_consumido();\n\t\t\t\t\n\t\t\t\t// Paso 5: añadir columna de criterio aplicado a la fila del centro de costo\n\t\t\t\t$fila->agregar_criterio_aplicado($columna);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Paso 6: agregamos al array de las filas y calculamos su total consumido por todos los criterios\n\t\t\t$fila->calcular_total_consumido();\n\t\t\tarray_push($this->centro_costo_filas, $fila);\n\t\t}\n\t}", "function _recuperarDataBean($objeto);", "function get_rechazadas() {\n\t\t$condicion = array(\n\t\t\t'pa_solicitudes.IdArea' => $this->session->userdata('id_area'),\n\t\t\t'pa_solicitudes.Estado' => '4'\n\t\t);\n\t\t$this->db->select('bc_documentos.IdDocumento,bc_documentos.Codigo,pa_solicitudes.IdSolicitud,pa_solicitudes.Estado,pa_solicitudes.Rechazo,bc_documentos.Fecha,pa_solicitudes.Causas,pa_solicitudes.Solicitud,pa_solicitudes.Observaciones');\n\t\t$this->db->join('bc_documentos','bc_documentos.IdDocumento = pa_solicitudes.IdDocumento');\n\t\t$consulta = $this->db->get_where('pa_solicitudes', $condicion );\n\t\t\n\t\treturn $consulta;\n\t}", "function getPrestamosRechazados(){\n error_log('PRESTAMOS_CONTROLLER::getPrestamosRechazados()');\n \n $res = [];\n \n $model = new JoinPrestamosUserModel();\n $prestamos = $model->getAllPrestamosRechazados();//devuelve todos los pagos de una planilla\n \n if($prestamos){//SI tiene un resultado \n \n foreach ($prestamos as $p) {\n array_push($res, $p->toArray());//estamos metiendo un arreglo dentro de otro arreglo, simulando estructura json\n }\n \n \n \n }else{\n \n array_push($res, [ 'cedula' => 'empty', 'mensaje' => 'No hay prestamos rechazados.' ]);\n \n }\n\n return $res;//devuelve objeto en forma de array\n \n }", "public function getDetailFromOneFactureAction($numero){\n\t\n\t\tif (!($this->container->get('user_service')->isOk('ROLE_GERANT'))) // On check les droits\n\t\t\treturn new \\SoapFault('Server','[GDFOF001] Vous n\\'avez pas les droits nécessaires.');\n\t\n\t\t$pdo = $this->container->get('bdd_service')->getPdo(); // On récup PDO depuis le service\n\t\t$result = array();\n\t\n\t\tif (!is_int($numero) || $numero < 0) // Vérif des arguments\n\t\t\treturn new \\SoapFault('Server', '[GDFOF002] Paramètres invalides.');\n\t\n\t\n\t\t$requete_detail_factures = 'SELECT id_facture ,nom_produit , date_de_facture, UPPER(nom_contact) as nom_contact_maj, prenom_contact, nom_article ,article_id , nb_article, montant_client ,reduction_article,\n\t\t\t\t\t\tSUM(CASE\n\t\t\t\t\t\t\tWHEN type_reduction = \\'taux\\' THEN (montant_client-montant_client*reduction_article/100)*(-1*nb_article)\n\t\t\t\t\t\t\tWHEN type_reduction = \\'remise\\' THEN (montant_client-reduction_article)*(-1*nb_article)\n\t\t\t\t\t\t\tELSE montant_client*(-1*nb_article)\n\t\t\t\t\t\tEND) AS montant,adresse_numero,adresse_rue,adresse_code_postal,adresse_ville,adresse_pays,nom_moyen_paiement\n\t\t\t\t FROM(\n\t\t\t\t SELECT \n\t\t\t\t\t\t\t lf.id as \"ligne_facture_id\",\n\t\t\t\t a.id as \"article_id\",\n\t\t\t\t\t\t\t a.code_barre as \"nom_article\",\n\t\t\t\t px.montant_client as \"prix_id\",\n\t\t\t\t f.id as \"id_facture\" ,\n\t\t\t\t f.date_facture as \"date_de_facture\",\n\t\t\t\t c.nom as \"nom_contact\",\n\t\t\t\t\t\t\t c.prenom as \"prenom_contact\",\n\t\t\t\t\t\t\t c.id as \"id_contact\",\n\t\t\t\t\t\t\t ad.num_voie as \"adresse_numero\",\n\t\t\t\t\t\t\t ad.voie as \"adresse_rue\",\n\t\t\t\t\t\t\t ad.code_postal as \"adresse_code_postal\",\n\t\t\t\t\t\t\t ad.ville as \"adresse_ville\",\n\t\t\t\t\t\t\t ad.pays as \"adresse_pays\",\n\t\t\t\t r.reduction as \"reduction_article\",\n\t\t\t\t m.quantite_mouvement as \"nb_article\",\n\t\t\t\t r.type_reduction as \"type_reduction\",\n\t\t\t\t px.montant_client as \"montant_client\",\n\t\t\t\t\t\t\t pt.nom as \"nom_produit\",\n\t\t\t\t\t\t\t mp.nom as \"nom_moyen_paiement\"\n\t\t\t\t \n\t\t\t\t FROM facture f\n\t\t\t\t\t\tJOIN ligne_facture lf ON lf.ref_facture = f.id \n\t\t\t\t\t\tJOIN mouvement_stock m ON lf.ref_mvt_stock = m.id\n\t\t\t\t\t\tJOIN article a ON m.ref_article = a.id\n\t\t\t\t JOIN prix px ON px.ref_article = a.id AND px.id = \n (SELECT MAX(prix.id) FROM prix WHERE prix.date_modif<f.date_facture AND prix.ref_article=a.id)\n\t\t\t\t JOIN produit pt ON a.ref_produit = pt.id\n\t\t\t\t LEFT OUTER JOIN remise r ON lf.ref_remise = r.id\n\t\t\t\t LEFT OUTER JOIN contact c ON f.ref_contact = c.id\n\t\t\t\t\t\tLEFT OUTER JOIN adresse ad ON c.id = ad.ref_contact AND ad.ref_type_adresse = 1\n LEFT OUTER JOIN moyen_paiement mp ON f.ref_moyen_paiement = mp.id \n\t\t\t\t\t\t\n\t\t\t\t\t\tWHERE f.id = '.(int)$numero.'\n\t\t\t\t\t\t ) t GROUP BY ligne_facture_id ORDER BY id_facture ASC';\n\t\n\t\tforeach ($pdo->query($requete_detail_factures) as $row) {\n\t\t\t$nombre_article = (-1*$row['nb_article']);\n\t\t\t$ligne = array('numero_facture' => $row['id_facture'],\n\t\t\t\t\t'date_facture'=>$row['date_de_facture'],\n\t\t\t\t\t'nom_produit'=>$row['nom_produit'],\n\t\t\t\t\t'nom_client'=>$row['nom_contact_maj'],\n\t\t\t\t\t'prenom_client'=>$row['prenom_contact'],\n\t\t\t\t\t'adresse_numero'=>$row['adresse_numero'],\n\t\t\t\t\t'adresse_rue'=>$row['adresse_rue'],\n\t\t\t\t\t'adresse_code_postal'=>$row['adresse_code_postal'],\n\t\t\t\t\t'adresse_ville'=>$row['adresse_ville'],\n\t\t\t\t\t'adresse_pays'=>$row['adresse_pays'],\n\t\t\t\t\t'nom_article'=>$row['nom_article'],\n\t\t\t\t\t'nombre_article'=>$nombre_article,\n\t\t\t\t\t'prix_article'=>$row['montant_client'],\n\t\t\t\t\t'reduction_article'=>$row['reduction_article'],\n\t\t\t\t\t'nom_moyen_paiement'=>$row['nom_moyen_paiement'],\n\t\t\t\t\t'montant_facture'=>$row['montant']);\n\t\t\tarray_push($result, $ligne);\n\t\t}\n\t\treturn json_encode($result);\n\t}", "protected function infosGeneralesRequest()\n {\n\n $resourcePath = '/rapport/InfosGenerales';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY');\n if ($apiKey !== null) {\n $headers['X-API-KEY'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-MEV-ID');\n if ($apiKey !== null) {\n $headers['X-MEV-ID'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if featured system are enable or not
function et_is_enable_feature(){ $job_option = new ET_JobOptions(); return $job_option->use_feature(); }
[ "public function is_featured()\n {\n }", "public function isSystemOn()\n\t{\n\t\treturn Craft::isSystemOn();\n\t}", "function getEnabled() {\n\t\tif (!Config::getVar('general', 'installed')) return true;\n\t\treturn parent::getEnabled();\n\t}", "public function actionCheckFeatured() {\n $front_user = isFrontUserLoggedIn();\n if (!$front_user) {\n $this->redirect(base_url() . '/user/login');\n } else {\n $front_user_id = frontUserId();\n $membership_model = Membership::model()->find(array('condition' => 'user_id = \"' . $front_user_id . '\" '));\n if ($membership_model->remaining_featured_listing > 0) {\n echo \"Y\";\n } else {\n echo \"N\";\n }\n }\n }", "function mysupport_points_system_enabled()\r\n{\r\n\tglobal $mybb, $cache;\r\n\t\r\n\t$plugins = $cache->read(\"plugins\");\r\n\t\r\n\tif($mybb->settings['mysupportpointssystem'] != \"none\")\r\n\t{\r\n\t\tif($mybb->settings['mysupportpointssystem'] == \"other\")\r\n\t\t{\r\n\t\t\t$mybb->settings['mysupportpointssystem'] = $mybb->settings['mysupportpointssystemname'];\r\n\t\t}\r\n\t\treturn in_array($mybb->settings['mysupportpointssystem'], $plugins['active']);\r\n\t}\r\n\treturn false;\r\n}", "private static function get_enabled_features()\n {\n }", "public function isFeatured ()\n {\n return $this->featured;\n }", "function is_featured() {\n\t\tif (get_post_meta($this->id, 'featured', true)=='yes') return true;\n\t\treturn false;\n\t}", "function enable()\n{\n\treturn $this->checkEnvironment();\n}", "public function isRapidServiceEnabled() {\n\n $test = Mage::getStoreConfig('rapidservice/general/enable');\n return (Mage::getStoreConfig('rapidservice/general/enable')) ? true : false;\n }", "function isEnableFeature($fetaure) {\n $enableFeature = FALSE;\n if (empty($fetaure)) {\n return $enableFeature;\n }\n if (defined('THEME_FEATURE')) {\n $featureList = json_decode(THEME_FEATURE, true);\n if (array_key_exists($fetaure, $featureList) && $featureList[$fetaure] == true) {\n $enableFeature = TRUE;\n }\n }\n return $enableFeature;\n}", "public function isFeatured() : bool\n {\n return $this->featured;\n }", "public static function isFeatureActive(): bool\n {\n //====================================================================//\n // Check if Parameter is Enabled\n if (!isset(Splash::configuration()->PsUseAdvancedDiscounts)) {\n return false;\n }\n if (empty(Splash::configuration()->PsUseAdvancedDiscounts)) {\n return false;\n }\n //====================================================================//\n // Check if Storage Table Exists\n return self::hasStorageTable();\n }", "function is_installed(){\n\n $constants = \"'\".implode(\"', '\",$this->settings_list()).\"'\";\n $q = db_query(\"select COUNT(*) FROM \".SETTINGS_TABLE.\"\n WHERE settings_constant_name IN (\".$constants.\")\");\n list($cnt) = db_fetch_row($q);\n\n return ($cnt != 0 );\n }", "public function isFeatured()\n {\n return $this->featured;\n }", "public function isEnabled()\n {\n return (1 == Mage::getStoreConfig('hermes/general/active'));\n }", "public static function isEnabled()\n {\n return CONFIG['maintenance_on'];\n }", "public function isEnable()\n\t{\n\t\t\n\t\treturn Mage::getStoreConfig('storeselector_options/activation/module',Mage::app()->getStore()->getId());\n\n\t}", "function is_enabled()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update update(array $u_data) if not include where, all columns will update
public function update(array $u_data) { $pre_data = ""; foreach ($u_data as $key => $value) { $pre_data .= $key . " = "; if(gettype($value) == "string") { $pre_data .= "'" . $value . "', "; } else { $pre_data .= $value . ", "; } } $update_data = rtrim($pre_data, ", "); $this->sql = "UPDATE " . $this->table_name . " SET " . $update_data . $this->where; var_dump($this->sql); $prep = $this->prepare($this->sql); $result = $prep->execute(); if($result) { echo "<b>Updated Successfully</b> <br>"; } else { echo "<b>Updated Failed</b> <br>"; } }
[ "function update($table, $data, $where=''){\n\t\t$data = $this->checkFields($table, $data);\n\t\tforeach($data as $column=>$value){\n\t\t\t$v_arr[] = \"$column='$value'\";\n\t\t}\n\t\t$sql = \"UPDATE $table SET \".implode(\",\", $v_arr).\" \".$where;\n\t\t$this->exec($sql);\n\t}", "function update_data($table,$cols=false,$where = false) {\n \n\t\tif($where){\n \t\t\t $this->db->where($where);\n \t\t }\n \t$this->db->update($table,$cols);\n\t //echo $this->db->last_query();die;\n return true;\n}", "function update_data($table,$cols=false,$where = false) {\n\t\tif($where){\n\t\t\t$this->db->where($where);\n\t\t}\n\t\t$this->db->update($table,$cols);\n\t\t//echo $this->db->last_query();die;\n\t\treturn true;\n\t}", "function query_update($table, $data, $where='1') {\n $q=\"UPDATE `\".$this->pre.$table.\"` SET \";\n \n foreach($data as $key=>$val) {\n if(strtolower($val)=='null') $q.= \"`$key` = NULL, \";\n elseif(strtolower($val)=='now()') $q.= \"`$key` = NOW(), \";\n else $q.= \"`$key`='\".$this->escape($val).\"', \";\n }\n \n $q = rtrim($q, ', ') . ' WHERE '.$where.';';\n \n return $this->query($q);\n }", "function update_seodata($where,$data)\n\t{\n\t\t$this->db->where($where);\n\t\t$this->db->update($this->table_name, $data);\n \n\t}", "public function update($data){\n\t\tif (isset($data[$this->_primary_key]) && $data[$this->_primary_key] != \"\") {\n $this->db->where($this->_primary_key, $data[$this->_primary_key]);\n return $this->db->update($this->_table, $data);\n }else{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function update($data, $table, $where) {\r\n\t\t$result = 0;\r\n\t\tforeach ($data as $column => $value) {\r\n\t\t\t$sql = \"UPDATE $table SET $column = $value WHERE $where\";\r\n\t\t\t//mysql_query($sql) or die(mysql_error());\r\n\t\t\t$result = $this->connection->exec($sql) or die($this->connection->errorInfo());\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "function update($table, $data);", "function Update() {\n\t\t$args = func_get_args();\n\t\t$tbl = $args[0];\n\t\t$fieldArr = $args[1];\n\t\t$where = isset($args[2]) ? $args[2] : \"\";\n\t\t\n\t\tif ($columnArr = $this->GetColumnNames($tbl)) {\n\t\t\t$updateStr = \"\";\n\t\t\tforeach ($fieldArr as $fieldName => $fieldVal) {\n\t\t\t\t//echo \"$fieldName => $fieldVal<br>\";\n\t\t\t\tif (in_array($fieldName,$columnArr)) {\n\t\t\t\t\t$updateStr .= $fieldName.\"='\".addslashes($fieldVal).\"',\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$updateStr = substr($updateStr,0,-1);\n\t\t\t$sql = \"update $tbl set $updateStr $where\";\n\t\t\t$this->sql = $sql;\n\t\t\treturn $this->Query($sql);\n\t\t}\n\t\treturn false;\n\t}", "protected function _prepareUpdateData($data) {\n }", "public function updateWhere(array $conditions, array $data);", "function updateMultipleColumn($data, $module, $id) {\n global $db;\n $ret = false;\n $updateArray = array();\n \n foreach ($data as $column => $value) {\n $updateArray[] = \"$column = '$value'\"; \n }\n if (count($updateArray) >= 1) {\n $sqlQuery = \"UPDATE `$module` SET \" . implode(', ', $updateArray) . \", \";\n $sqlQuery .= \"modified_by_id = '\" . getSessionValue('user') . \"', \"\n . \"modified_at = '\" . getFormattedDate() . \"'\";\n $sqlQuery .= \"WHERE id = $id\";\n $stmt = $db->prepare($sqlQuery);\n if ($stmt->execute()) {\n $ret = true;\n }\n }\n \n return $ret;\n}", "function update() {\n\t\treset($this->data);\n\t\twhile(list($key,$val)=each($this->data)){\n\t\t\tif($key != $this->idKey) {\n\t\t\t\tif($val === NULL || $val == '') {\n\t\t\t\t\t$my_sql[] = $key . \" = NULL\";\n\t\t\t\t} else {\n //dump($val, 'val');\n if(in_array($key, $this->binaryFields)) {\n //if(strpos($val, \"'\"))\n // raiseError(\"invalid character in binary field data\");\n $my_sql[] = $key . \" = '\". addslashes($val) . \"'\";\n } else {\n $my_sql[] = $key . \" = '\" . sotf_Utils::magicQuotes($val) . \"'\";\n }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$my_sql = implode(\", \", $my_sql);\n\n //execute the query\n $res = $this->db->query(\"UPDATE \" . $this->tablename . \" SET \" . $my_sql . \" WHERE \" . $this->idKey . \"='\" . $this->id . \"' \");\n \n //if the query is dead, stop executio, output error\n if(DB::isError($res)){\n raiseError($res);\n }\n\t}", "public function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = false);", "public function update_by()\n\t{\n\t\t// Collect function arguments and make sure there are some.\n\t\t$args = func_get_args();\n\t\tif (empty($args))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// The data is always the last array.\n\t\t$data = array_pop($args);\n\t\tif ( ! is_array($data) OR empty($data))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Format \"value\" and \"options\".\n\t\tif (isset($data['value']) && ! empty($data['value']))\n\t\t{\n\t\t\t$data['value'] = to_bool_or_serialize($data['value']);\n\t\t}\n\t\tif (isset($data['options']) && ! empty($data['options']))\n\t\t{\n\t\t\t$data['options'] = to_bool_or_serialize($data['options']);\n\t\t}\n\n\t\t// Prepare the update query.\n\t\t$this->ci->db->set($data);\n\n\t\t// All remaining arguments will be used as WHERE clause.\n\t\tif ( ! empty($args))\n\t\t{\n\t\t\t(is_array($args[0])) && $args = $args[0];\n\t\t\tforeach ($args as $key => $val)\n\t\t\t{\n\t\t\t\tif (is_int($key) && is_array($val))\n\t\t\t\t{\n\t\t\t\t\t$this->ci->db->where($val);\n\t\t\t\t}\n\t\t\t\telseif (is_array($val))\n\t\t\t\t{\n\t\t\t\t\t$this->ci->db->where_in($key, $val);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ci->db->where($key, $val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Proceed to update and return the status.\n\t\t$this->ci->db->update('options');\n\t\treturn ($this->ci->db->affected_rows() > 0);\n\t}", "function update_data_by_property($data = array(), $where = array())\n {\n //validate data\n if (is_null($data) || !is_array($data)) {\n return null;\n }\n if (is_null($where) || !is_array($where)) {\n return null;\n }\n //get data by condition where\n $this->db->where($where);\n //update data\n $this->db->update($this->table_name, $data);\n //return result\n if ($this->db->affected_rows() > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function prepareRowForUpdate(array $rowData);", "public function Update($data,$conditions='',$addtional_conditions=''){\n $update_start=\"UPDATE $this->table_name SET \";\n $sql_end=';';\n\n if (is_array($conditions)){\n $condition='WHERE ';\n foreach ($conditions as $key => $value) {\n if ($value==NULL) {$value='NULL';} else {$value=\"'$value'\";}\n $condition.=\"($key = $value) AND \";\n }\n $condition=substr($condition, 0, strlen($condition)-4);\n $conditions=$condition;\n }\n \n if (is_array($data)){\n $pairs='';\n foreach ($data as $key => $value) {\n if ($value==NULL) {$value='NULL';} else {$value=\"'$value'\";}\n $pairs.= \"$key = $value,\";\n }\n $pairs=substr($pairs, 0, strlen($pairs)-1);\n $pairs.=' ';\n $data=$pairs;\n }\n $sql=$update_start.$data.$conditions.$addtional_conditions.$sql_end;\n $ret=$this->db_link->query($sql);\n return $ret;\n }", "function updateData($table,$values,$where) {\n\t\t\t$qry = 'UPDATE ' .$table .' SET ';\n\t\t\t$i = 0;\n\t\t\tforeach($values as $key => $value) {\n\t\t\t\t$qry .= ' ' .$key .' = ' .$value .($i == count($values) - 1 ? '' : ', ');\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$qry .= ' WHERE ' .$where;\n\t\t\treturn $this->query($qry);\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Redirect Historical to New Permalink Structure /%year%/%postname%/ => /%__coauthor%/%year%/%monthnum%/%postname%/
public function redirect_historical( $wp ) { $pagename = isset( $wp->query_vars['pagename'] ) ? $wp->query_vars['pagename'] : false; if ( ! $pagename ) return; $parts = explode( '/', $pagename ); $count = count( $parts ); if ( $count === 1 ) return; if ( $parts[0] === 'author' && strlen( $parts[1] ) > 3 // author slug minimum is 3 characters ) { $this->redirect_historical_author( $parts, $wp ); } // Note: // Logic is specific to Thought Catalog's previous permalink structure /%year%/%postname%/ // This could be abstracted to use any previous permalink structure else if ( ( strlen( $parts[0] ) === 4 && checkdate( 1, 1, (int) $parts[0] ) ) && // is year strlen( $parts[1] ) > 2 // post slug minimum ) { $this->redirect_historical_post( $parts, $wp ); } }
[ "public function update_permalinks() {\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');\n\t}", "public function archive_redirect() {\n\t\tglobal $wp_query;\n\n\t\tif ( $wp_query->is_date || $wp_query->is_author ) {\n\t\t\t$this->redirect( home_url( '/' ), 301 );\n\t\t\texit;\n\t\t}\n\t}", "function press_releases_rewrite_rules() {\n add_rewrite_rule(\n 'articles/([0-9]{4})/?$',\n array(\n 'year_filter' => '$matches[1]',\n 'post_type' => 'article',\n ),\n 'top'\n );\n}", "function custom_author_base()\n{\n global $wp_rewrite;\n $wp_rewrite->author_base = \"about\";\n $wp_rewrite->author_structure =\n \"/\" . $wp_rewrite->author_base . \"/%author%\";\n}", "public function add_year_permalink($post_link, $post) {\n $year = Iccs__Schedule__Utils::sanitize_datetime(get_post_meta($post->ID, 'iccs_start_date', true), 'Y');\n if ( $year ){\n return str_replace( '%iccs_year%' , $year , $post_link );\n }\n return $post_link;\n }", "function wpcom_vip_old_slug_redirect() {\n global $wp_query;\n if ( is_404() && '' != $wp_query->query_vars['name'] ) :\n global $wpdb;\n\n // Guess the current post_type based on the query vars.\n if ( get_query_var('post_type') )\n $post_type = get_query_var('post_type');\n elseif ( !empty($wp_query->query_vars['pagename']) )\n $post_type = 'page';\n else\n $post_type = 'post';\n\n if ( is_array( $post_type ) ) {\n if ( count( $post_type ) > 1 )\n return;\n $post_type = array_shift( $post_type );\n }\n\n // Do not attempt redirect for hierarchical post types\n if ( is_post_type_hierarchical( $post_type ) )\n return;\n\n $query = $wpdb->prepare(\"SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s\", $post_type, $wp_query->query_vars['name']);\n\n // if year, monthnum, or day have been specified, make our query more precise\n // just in case there are multiple identical _wp_old_slug values\n if ( '' != $wp_query->query_vars['year'] )\n $query .= $wpdb->prepare(\" AND YEAR(post_date) = %d\", $wp_query->query_vars['year']);\n if ( '' != $wp_query->query_vars['monthnum'] )\n $query .= $wpdb->prepare(\" AND MONTH(post_date) = %d\", $wp_query->query_vars['monthnum']);\n if ( '' != $wp_query->query_vars['day'] )\n $query .= $wpdb->prepare(\" AND DAYOFMONTH(post_date) = %d\", $wp_query->query_vars['day']);\n\n $cache_key = md5( serialize( $query ) );\n\n if ( false === $id = wp_cache_get( $cache_key, 'wp_old_slug_redirect' ) ) {\n $id = (int) $wpdb->get_var($query);\n\n wp_cache_set( $cache_key, $id, 'wp_old_slug_redirect', 5 * MINUTE_IN_SECONDS );\n }\n\n if ( ! $id )\n return;\n\n $link = get_permalink($id);\n\n if ( !$link )\n return;\n\n wp_redirect( $link, 301 ); // Permanent redirect\n exit;\n endif;\n}", "function esportz_author_base() {\r\n global $wp_rewrite;\r\n $author_slug = 'user'; // change slug name\r\n $wp_rewrite->author_base = $author_slug;\r\n}", "function wcorg_subdomactories_redirect() {\n\tif ( ! is_404() )\n\t\treturn;\n\n\tif ( get_option( 'permalink_structure' ) != '/%postname%/' )\n\t\treturn;\n\n\t// russia.wordcamp.org/2014/2014/11/25/post-name/\n\t// russia.wordcamp.org/2014/11/25/post-name/\n\t// russia.wordcamp.org/2014/2014/25/post-name/\n\t// russia.wordcamp.org/2015-ru/...\n\n\tif ( ! preg_match( '#^/[0-9]{4}(?:-[^/]+)?/(?:[0-9]{4}/[0-9]{2}|[0-9]{2}|[0-9]{4})/[0-9]{2}/(.+)$#', $_SERVER['REQUEST_URI'], $matches ) )\n\t\treturn;\n\n\twp_safe_redirect( esc_url_raw( set_url_scheme( home_url( $matches[1] ) ) ) );\n\tdie();\n}", "function makePermalink($date, $name, $post_type, $excludeName = false) {\n\t\tif($post_type != 'page') {\n\t\t\t$y = date('Y', strtotime($date));\n\t\t\t$m = date('m', strtotime($date));\n\t\t\t$d = date('d', strtotime($date));\n\t\t\t$format = get_option('permalink_structure');\n\t\t\t$format = str_replace('%monthnum%', $m, $format);\n\t\t\t$format = str_replace('%year%', $y, $format);\n\t\t\t$format = str_replace('%day%', $d, $format);\n\t\t\t$format = $excludeName ? $format : str_replace('%postname%/', $name, $format);\n\t\t\treturn get_option('home') . $format;\n\t\t} else {\n\t\t\t\t//$format = $excludeName ? $format : str_replace('%postname%/', $name, $format);\n\t\t\t\treturn get_option('home') . '/%postname%/';\n\t\t}\n\t}", "function com_news_add_rewrite_rules(){\n\tglobal $wp_rewrite;\n\t$news_structure = '/news/%year%/%monthnum%/%news%';\n\t$wp_rewrite->add_rewrite_tag( \"%news%\", '([^/]+)', \"news=\" );\n\t$wp_rewrite->add_permastruct( 'news', $news_structure, false );\n\n}", "function modify_permalinks(){\n\t\tglobal $wp_rewrite;\n\n\t\tif ( get_option( 'permalink_structure' ) !== '/%postname%/' ){\n\t\t\tupdate_option( 'permalink_structure', '/%postname%/' );\n\t\t\t$wp_rewrite->init();\n\t\t\t$wp_rewrite->flush_rules();\n\t\t}\n\n\t}", "function _redirect_to_about_wordpress($new_version)\n{\n}", "function set_archive_rewrite()\n\t{\n\t\t$permalink = get_option( $this->_post_type.'_structure' );\n\t\t$this->_post_type_obj = get_post_type_object($this->_post_type);\n\t\t$slug = $this->_post_type_obj->rewrite['slug'];\n\t\tif ( !$slug )\n\t\t\t$slug = $this->_post_type;\n\t\t\n\t\tif (is_string( $this->_post_type_obj->has_archive )) {\n\t\t\t$slug = $this->_post_type_obj->has_archive;\n\t\t}\n\t\t\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&paged=$matches[2]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/author/([^/]+)/?$', 'index.php?author=$matches[1]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/page/?([0-9]{1,})/?$', 'index.php?paged=$matches[1]&post_type='.$this->_post_type, 'top' );\n\t\tadd_rewrite_rule( $slug.'/?$', 'index.php?post_type='.$this->_post_type, 'top' );\n\t}", "function replace_custom_url_tags( $url, $post ) {\n\n\t\t\t// this is based on the code in core's link-template.php\n\n\t\t\t// a list of tags we'll search for in the URL\n\t\t\t$tags = array( '%monthnameshort%', '%monthnamefull%' );\n\n\t\t\t// add the custom date fields\n\t\t\t$fields = explode( \" \", date( 'M F', strtotime( $post->post_date ) ) );\n\n\t\t\t// convert everything to lowerecase\n\t\t\t$fields = array_map( 'strtolower', $fields );\n\n\t\t\t// return the URL with tags replaced by data from the post\n\t\t\treturn str_replace( $tags, $fields, $url );\n\n\t\t}", "public static function kdg_fablab_rs_author_page_redirect() {\n if (is_author()) {\n wp_redirect(home_url());\n }\n }", "function date_archive_redirect( string $requested_url ) {\n\t$post_type = 'post';\n\t$real_home = PostTypes\\get_post_types_custom_home( $post_type );\n\tif ( is_wp_error( $real_home ) ) {\n\t\treturn;\n\t}\n\n\tsafe_redirect( $requested_url, $real_home );\n}", "function yb_set_permalinks() {\n\tglobal $wp_rewrite;\n\t$wp_rewrite->set_permalink_structure( '/%postname%/' );\n}", "public function hardcode_permalinks() : void {\n\t\tglobal $wp_rewrite;\n\t\t// Force the permalink structure.\n\t\t$permalink_prefix = apply_filters( self::HOOK_PERMALINK_ID_PREFIX, self::PERMALINK_ID_PREFIX );\n\t\t$permalink_postfix = apply_filters( self::HOOK_PERMALINK_ID_POSTFIX, self::PERMALINK_ID_POSTFIX );\n\t\t$permalink_structure = apply_filters( self::HOOK_PERMALINK_STRUCTURE, \"/article/${permalink_prefix}%post_id%${permalink_postfix}/%postname%.html\" );\n\t\t$wp_rewrite->set_permalink_structure( $permalink_structure );\n\t\t// Author rewrite rules.\n\t\t$wp_rewrite->author_structure = 'author/%author%';\n\t\t$wp_rewrite->add_rule( 'article/([0-9]+)/([^/]+).html(?:/([0-9]+))?/?$', 'index.php?p=$matches[1]&page=$matches[3]', 'top' );\n\t\t$wp_rewrite->add_rule( 'article/([0-9]+)/?$', 'index.php?p=$matches[1]', 'top' );\n\t\t// Set an alternative for blog rewrite rules.\n\t\t$wp_rewrite->add_rule( '^column/([^/]+)/?$', 'index.php?blogs=$matches[1]', 'top' );\n\t}", "function reset_permalinks() {\n global $wp_rewrite;\n $wp_rewrite->set_permalink_structure( '/%postname%/' );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ ===================== Folderize If the path part of the current URL does not end with "/", redirect with a "/" appended. This sets all relative URLs accessed from the page below the current path instead of alongside the last part. This is done with a 301 permanent redirect. Returns true if the redirect was done. =====================
public static function Folderize() { $parts = explode( "?", self::$url ); if ($parts[0][ strlen($parts[0]) - 1 ] != '/') { $parts[0] .= '/'; $url = implode( '?', $parts ); self::Redirect( $url ); return true; } return false; }
[ "private function tryDirectoryRedirect() {\n\t\tif (config('app.redirect_to_directories', true) === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\tProfiler::record('Check for directory redirection');\n\n\t\tif (substr($this->request->path(), -1) !== \"/\") {\n\t\t\t$originalUri = $this->request->path();\n\t\t\t$originalRequest = $this->request;\n\n\t\t\t// Add a trailing slash to the request uri\n\t\t\t$_SERVER['REQUEST_URI'] = $originalUri . '/';\n\n\t\t\t// Add query string\n\t\t\tif ($this->request->getQueryString()) {\n\t\t\t\t$_SERVER['REQUEST_URI'] .= '?' . $this->request->getQueryString();\n\t\t\t}\n\n\t\t\t// Store the path for errors\n\t\t\t$this->realPath = $this->request->path();\n\n\t\t\t// Create a new request object\n\t\t\t$this->createRequest();\n\n\t\t\t// See if the directory route matches\n\t\t\t$route = RouteLoader::getRouter()->match($this->request);\n\n\t\t\t// Redirect to the new uri\n\t\t\tif (!is_null($route) && substr($route->uri(), -1) === '/') {\n\t\t\t\t$this->response->redirect($this->request->getRequestUri(), 302);\n\t\t\t\t$this->close();\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Revert the request uri\n\t\t\t$this->realPath = $_SERVER['REQUEST_URI'] = $originalUri;\n\t\t\t$this->request = $originalRequest;\n\t\t}\n\n\t\treturn false;\n\t}", "function handle_redirects() {\n\t\tif(preg_match('/index|app\\/?$/', $_SERVER['REQUEST_URI'])) {\n\t\t\theader('HTTP/1.1 301 Moved Permanently');\n\t\t\theader('Location: ../');\n\t\t\treturn true;\n\t\t}\n\t\t// add trailing slash if required\n\t\tif(!preg_match('/\\/$/', $_SERVER['REQUEST_URI'])) {\n\t\t\theader('HTTP/1.1 301 Moved Permanently');\n\t\t\theader('Location:'.$_SERVER['REQUEST_URI'].'/');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function redirectForTrailingSlash()\n {\n $config = \\Nf\\Registry::get('config');\n $redirectionUrl = false;\n $requestParams = '';\n $requestPage = '/' . $this->_uri;\n \n // we don't redirect for the home page...\n if ($requestPage != '/' && mb_strpos($requestPage, '/?') !== 0) {\n // the url without the params is :\n if (mb_strpos($requestPage, '?') !== false) {\n $requestParams = mb_substr($requestPage, mb_strpos($requestPage, '?'), mb_strlen($requestPage) - mb_strpos($requestPage, '?'));\n $requestPage = mb_substr($requestPage, 0, mb_strpos($requestPage, '?'));\n }\n \n if (isset($config->trailingSlash->needed) && $config->trailingSlash->needed==true) {\n if (mb_substr($requestPage, - 1, 1) != '/') {\n $redirectionUrl = 'http://' . $_SERVER['HTTP_HOST'] . $requestPage . '/' . $requestParams;\n }\n } else {\n if (mb_substr($requestPage, - 1, 1) == '/') {\n $redirectionUrl = 'http://' . $_SERVER['HTTP_HOST'] . rtrim($requestPage, '/') . $requestParams;\n }\n }\n \n if ($redirectionUrl !== false) {\n $response = new \\Nf\\Front\\Response\\Http();\n $response->redirect($redirectionUrl, 301);\n $response->sendHeaders();\n return true;\n }\n }\n \n return false;\n }", "protected static function _initCheckPath()\n\t{\n\t\t$req_uri = $_SERVER[\"REQUEST_URI\"];\n\t\t$host = $_SERVER['HTTP_HOST'];\t\n\t\n\t\tif(strpos($req_uri, \"index.php\") !== FALSE){\n\t\t\t$clean_str = str_replace('index.php','',$req_uri);\n\t\t\t$clean_str = str_replace('//','/',$clean_str);\n\t\t\t$new_location = 'http://'.$_SERVER['HTTP_HOST'].$clean_str;\n\t\t\t\t\n\t\t\tHeader(\"HTTP/1.1 301 Moved Permanently\");\n\t\t\tHeader(\"Location: $new_location\");\n\t\t\texit();\n\t\t}\n\t}", "protected function redirect()\n {\n $redirect = false;\n $file = $this->file('301.txt');\n if (is_file($file)) {\n $map = array();\n foreach (array_filter(array_map('trim', file($file))) as $url) {\n if ($url[0] == '[' && substr($url, -1) == ']') {\n $new = substr($url, 1, -1);\n } elseif (isset($new) && !isset($map[$url])) {\n $map[$url] = $new;\n }\n }\n $endless = array();\n $path = $this->url['path'];\n parse_str(ltrim($this->url['query'], '?'), $params);\n while ($route = $this->routes($map, $path)) { // get all redirects at once\n $path = $route['target'];\n $params += $route['params'];\n if (in_array($path, $endless) || count($endless) > 5) {\n return false;\n } else {\n $endless[] = $path;\n $redirect = rtrim($path.'?'.http_build_query($params), '?');\n }\n }\n }\n\n return $redirect;\n }", "static function canonicalize_path() {\n if (add::current_controller()->path() != \"$_GET[add_mvc_path]\") {\n add::current_controller()->redirect();\n }\n }", "function redirects() {\n\t\tif ( ! is_404() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Learn.WordPress.org category changed from social-learning to online workshops.\n\t\tif ( str_starts_with( $_SERVER['REQUEST_URI'], '/category/social-learning' ) ) {\n\t\t\t$url = str_replace( '/social-learning', '/learn-wordpress-online-workshops', $_SERVER['REQUEST_URI'] );\n\t\t\twp_safe_redirect( $url, 301 );\n\t\t\tdie();\n\t\t}\n\n\t\t// Redirect /upload to submit-video\n\t\tif ( 'upload' === trim( $_SERVER['REQUEST_URI'], '/' ) ) {\n\t\t\twp_safe_redirect( '/submit-video/', 301 );\n\t\t\tdie();\n\t\t}\n\t}", "public function redirectIfTrailingSlash()\n\t{\n\t\tif ($this->runningInConsole()) return;\n\n\t\t// Here we will check if the request path ends in a single trailing slash and\n\t\t// redirect it using a 301 response code if it does which avoids duplicate\n\t\t// content in this application while still providing a solid experience.\n\t\t$path = $this['request']->getPathInfo();\n\n\t\tif ($path != '/' and ends_with($path, '/') and ! ends_with($path, '//'))\n\t\t{\n\t\t\twith(new SymfonyRedirect($this['request']->fullUrl(), 301))->send();\n\n\t\t\texit;\n\t\t}\n\t}", "public function try_rewrite_categories() {\n global $wp_query;\n global $wp;\n\n $wp_queried_object = get_queried_object();\n\n if ( ! $this->options['try_rewrite_categories']\n || ! ( isset ( $wp->query_vars['category_name'] )\n && isset( $wp->query_vars['name'] ) ) ) {\n return;\n }\n\n if ( ! $wp_query->is_single() ) {\n return;\n }\n\n $permalink = get_permalink( $wp_queried_object->ID );\n $wp_url = wp_parse_url( $permalink );\n $wp_url_pattern = '/^\\/' . preg_quote( $wp->query_vars['category_name'], '/' ) . '/';\n\n if ( ! preg_match( $wp_url_pattern, $wp_url['path'] ) ) {\n $this->send_http_header( Header::Location, $permalink, true, 301 );\n\n exit();\n }\n }", "public function fixHomeRedirect(){\n\n \t$check = $this->modx->getObject('modContextSetting',[\n 'key'=>'base_url',\n 'value:LIKE'=>'%'.$_GET[$this->modx->getOption('request_param_alias')].'%'\n ]);\n \n if($check){ //if new route is valid\n\n $siteStart = $this->modx->getObject('modContextSetting',[\n 'key' => 'site_start',\n 'context_key' => $check->get('context_key')\n ]);\n \n \n if($this->modx->getObject('modResource',$siteStart->get('value'))->get('published') == 1) \n $this->modx->sendRedirect($this->modx->makeUrl($siteStart->get('value')),['responseCode' => 'HTTP/1.1 301 Moved Permanently']);\n }\n }", "protected function checkMissingSlash() {\n\t\t$originalUri = $this->speakingUri = rtrim($this->speakingUri, '?');\n\n\t\t$regexp = '~^([^\\?]*[^/])(\\?.*)?$~';\n\t\tif (preg_match($regexp, $this->speakingUri)) { // Only process if a slash is missing:\n\t\t\t$options = GeneralUtility::trimExplode(',', $this->configuration->get('init/appendMissingSlash'), true);\n\t\t\tif (in_array('ifNotFile', $options)) {\n\t\t\t\tif (!preg_match('/\\/[^\\/\\?]+\\.[^\\/]+(\\?.*)?$/', '/' . $this->speakingUri)) {\n\t\t\t\t\t$this->speakingUri = preg_replace($regexp, '\\1/\\2', $this->speakingUri);\n\t\t\t\t\t$this->appendedSlash = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->speakingUri = preg_replace($regexp, '\\1/\\2', $this->speakingUri);\n\t\t\t\t$this->appendedSlash = true;\n\t\t\t}\n\t\t\tif ($this->appendedSlash && count($options) > 0) {\n\t\t\t\tforeach ($options as $option) {\n\t\t\t\t\t$matches = array();\n\t\t\t\t\tif (preg_match('/^redirect(\\[(30[1237])\\])?$/', $option, $matches)) {\n\t\t\t\t\t\t$code = count($matches) > 1 ? $matches[2] : 301;\n\t\t\t\t\t\t$status = 'HTTP/1.1 ' . $code . ' TYPO3 RealURL redirect';\n\t\t\t\t\t\t$locationUri = $this->restoreIgnoredUrlParametersInURL($this->speakingUri);\n\n\t\t\t\t\t\t// Check path segment to be relative for the current site.\n\t\t\t\t\t\t// parse_url() does not work with relative URLs, so we use it to test\n\t\t\t\t\t\tif (!@parse_url($this->speakingUri, PHP_URL_HOST)) {\n\t\t\t\t\t\t\t$this->logger->notice(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t'RealURL redirects from \"%s\" to \"%s\" due to missing slash',\n\t\t\t\t\t\t\t\t\t$originalUri,\n\t\t\t\t\t\t\t\t\t$locationUri\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t@ob_end_clean();\n\t\t\t\t\t\t\theader($status);\n\t\t\t\t\t\t\theader(self::REDIRECT_INFO_HEADER . ': redirect for missing slash');\n\t\t\t\t\t\t\theader('Content-length: 0');\n\t\t\t\t\t\t\theader('Connection: close');\n\t\t\t\t\t\t\theader('Location: ' . GeneralUtility::locationHeaderUrl($locationUri));\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function checkRedirectStringAndRedirect() {\n if($this->check404ModuleStatus() == 1) {\n $urlPart = $this->getUrlString();\n // Check if url part is empty or not,\n if (empty($urlPart)) {\n // Redirect user on root level \t\t\n $this->customRedirect('/', 'default');\n } else {\n // Get configured category suffix (we are considering that product/category/page all have same)\n $suffix = Mage::helper('catalog/category')->getCategoryUrlSuffix();\n $string = $this->trimSlash($urlPart);\n\n $plorp = substr(strrchr($string, '/'), 1);\n $string = $this->trimSlash(substr($string, 0, - strlen($plorp))) . $suffix;\n // Check string part is equal to suffix or not\n if ($string != $suffix) {\n // Redirect user according to url part\n $this->customRedirect($string, 'default');\n } else {\n // Redirect customer to base url \n $this->customRedirect('/', 'default');\n }\n }\n\t}\n }", "function redirect() {\n $isProtected = false;\n $isLanding = (DeMomentsomtresTools::get_option(self::OPTIONS, 'landing_mode', '') != ''); //checks if is landing\n $url = $_SERVER[\"REQUEST_URI\"];\n $protectedPrefixs = array(\n \"wp-login\",\n \"wp-admin\",\n \"wp-content\",\n );\n foreach ($protectedPrefixs as $prefix):\n if (!(strpos($url, $prefix) === false)):\n $isProtected = true;\n endif;\n endforeach;\n if (!$isProtected):\n if ($isLanding):\n wp_redirect($this->destination(), 301);\n exit;\n endif;\n endif;\n }", "function redirorig() {\n\t\tglobal $source;\n\t\t\n\t\tif(isset($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'])\n\t\t $location = 'https://';\n\t\telse\n\t\t $location = 'http://';\n\t\t\n\t\t$location .= $_SERVER['SERVER_NAME'].'/'.$source;\n\t\t\n\t\theader('Location: '.$location, false, 301);\n\t\texit();\n\t}", "function bporg_redirect() {\n\n\t// Explode the request. parse_url() is used here to exclude any query args which caused some redirects to be missed.\n\t$uri_chunks = explode( '/', parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ) );\n\n\t// No path, no redirects to handle.\n\tif ( empty( $uri_chunks[1] ) ) {\n\t\treturn;\n\t}\n\n\t// Redirect /forums/ to /support/ & /community/ to /support\n\tif ( ( $uri_chunks[1] === 'forums' || $uri_chunks[1] === 'community' ) && empty( $uri_chunks[2] ) ) {\n\t\tbp_core_redirect( home_url( '/support/' ) );\n\t}\n\n\t// Redirect members directory to root to block heavy paginated user queries\n\tif ( ( $uri_chunks[1] === 'members' ) && empty( $uri_chunks[2] ) ) {\n\t\tbp_core_redirect( home_url( '/' ) );\n\t}\n\n\t// Redirect old members profile pages to their new location\n\tif ( ( $uri_chunks[1] === 'community' ) && ( $uri_chunks[2] === 'members' ) && ! empty( $uri_chunks[3] ) ) {\n\t\tbp_core_redirect( home_url( '/members/' . $uri_chunks[3] . '/' ) );\n\t}\n\n\t// Redirect old plugin groups to deprecated plugin forums\n\tif ( ( $uri_chunks[1] === 'community' ) && ( $uri_chunks[2] === 'groups' ) ) {\n\n\t\t// /community/groups/ to Support root.\n\t\tif ( empty( $uri_chunks[3] ) ) {\n\t\t\tbp_core_redirect( home_url( '/support/' ) );\n\n\t\t// Single group topic redirect\n\t\t} elseif ( !empty( $uri_chunks[5] ) && ( $uri_chunks[5] === 'topic' ) && !empty( $uri_chunks[6] ) ) {\n\t\t\tbp_core_redirect( home_url( '/support/topic/' . $uri_chunks[6] . '/' ) );\n\n\t\t// Single group forum redirect\n\t\t} elseif ( empty( $uri_chunks[4] ) || ( $uri_chunks[4] === 'forum' ) ) {\n\n\t\t\t// Use legacy group slug\n\t\t\tif ( ! in_array( $uri_chunks[3], array( 'gallery', 'how-to-and-troubleshooting' ) ) ) {\n\t\t\t\tbp_core_redirect( home_url( '/support/forum/plugin-forums/' . $uri_chunks[3] . '/' ) );\n\n\t\t\t// Root forums, maybe with new slug\n\t\t\t} else {\n\n\t\t\t\t// New BuddyPress project forums locations\n\t\t\t\tswitch ( $uri_chunks[3] ) {\n\t\t\t\t\tcase 'gallery' :\n\t\t\t\t\t\t$url = '/support/forum/your-buddypress/';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'how-to-and-troubleshooting' :\n\t\t\t\t\t\t$url = '/support/forum/how-to/';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'creating-and-extending' :\n\t\t\t\t\t\t$url = '/support/forum/extending/';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'requests-and-feedback' :\n\t\t\t\t\t\t$url = '/support/forum/feedback/';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'buddypress' :\n\t\t\t\t\t\t$url = '/support/forum/installing/';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'third-party-plugins' :\n\t\t\t\t\t\t$url = '/support/forum/plugins/';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$url = trailingslashit( 'https://buddypress.org/support/forum/' . $uri_chunks[3] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbp_core_redirect( home_url( $url ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Redirect /support/topics/ to /support/\n\tif ( $uri_chunks[1] === 'support' && ( !empty( $uri_chunks[2] ) && ( 'topics' === $uri_chunks[2] ) ) ) {\n\t\tbp_core_redirect( home_url( '/support/' ) );\n\t}\n}", "protected function _redirect() {\n\t\t$newUrl = $this -> _connectUrlParts();\n\t\tif($this -> _currentUrl != $newUrl) {\n\t\t\tYii::app() -> request -> redirect($newUrl, true, 301);\n\t\t}\n\t}", "private function setupRedirects() {\n $redirectsFile = $this->repoPath . '/redirects/internal.txt';\n if (file_exists($redirectsFile)) {\n copy($redirectsFile, $this->publishPath . '/redirects.txt');\n }\n return TRUE;\n }", "function roots_fix_duplicate_subfolder_urls($input) {\n\t$output = roots_root_relative_url($input);\n\tpreg_match_all('!([^/]+)/([^/]+)!', $output, $matches);\n\n\tif (isset($matches[1][0]) && isset($matches[2][0])) {\n\t\tif ($matches[1][0] === $matches[2][0]) {\n\t\t\t$output = substr($output, strlen($matches[1][0]) + 1);\n\t\t}\n\t}\n\n\treturn $output;\n}", "function vida_do_301_redirect_url() {\n\t\n\tglobal $post;\n\t\n\t$vida_301_redirect_page_url = ViDA::get_metabox('vida_301_redirect_url') ? esc_url_raw( ViDA::get_metabox('vida_301_redirect_url') ) : null;\n\t\n\tif ( ! isset ( $vida_301_redirect_page_url ) )\n\t\treturn;\n\telse\n\t\twp_redirect( $vida_301_redirect_page_url, 301 );\n\t\n\texit();\n\t\t\n\t\t\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation foldersRenameAsync This method allows to rename a folder
public function foldersRenameAsync($name, $id) { return $this->foldersRenameAsyncWithHttpInfo($name, $id) ->then( function ($response) { return $response[0]; } ); }
[ "public function renameFolder(string $old, string $new): Response;", "public function testRenameFolder() {\n $this->objFromFixture('Member', 'apiuser')->login();\n \n\n //Test renaming a folder\n $response=$this->getAMFResponse('Snippets.renameFolder', array(\n 'id'=>$this->objFromFixture('SnippetFolder', 'folder1')->ID,\n 'name'=>'Lorem Ipsum'\n ));\n \n \n //Validate the response\n $this->assertEquals('HELO', $response['status'], 'Response status should have been HELO');\n \n\n //Test renaming a folder to a duplicate\n $response=$this->getAMFResponse('Snippets.renameFolder', array(\n 'id'=>$this->objFromFixture('SnippetFolder', 'folder1')->ID,\n 'name'=>'Test Folder 2'\n ));\n \n \n //Validate the response\n $this->assertEquals('EROR', $response['status'], 'Response status should have been EROR');\n $this->assertEquals(_t('CodeBank.FOLDER_EXISTS', '_A folder already exists with that name'), $response['message'], 'Response message should have been that there is a duplicate');\n }", "public function foldersV2RenameOldAsync($name, $id)\n {\n return $this->foldersV2RenameOldAsyncWithHttpInfo($name, $id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function foldersRenameAsyncWithHttpInfo($name, $id)\n {\n $returnType = '';\n $request = $this->foldersRenameRequest($name, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function renameFolder(\\TYPO3\\CMS\\Core\\Resource\\Folder $folder, $newName) {\n\t}", "public function renameTemplateFolderAsyncWithHttpInfo($id, $templatesFolderRenameRequest)\n {\n $returnType = '\\PandaDoc\\Client\\Model\\TemplatesFolderRenameResponse';\n $request = $this->renameTemplateFolderRequest($id, $templatesFolderRenameRequest);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function renameFolder(\\TYPO3\\CMS\\Core\\Resource\\Folder $folder, $newName) {\n\t\tif (self::DEBUG_MODE) \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump(array($newName => $folder), 'Hello from ' . __METHOD__);\n\t\t$this->resetIdentifierMap();\n\n\t\t$parentFolderName = dirname($folder->getIdentifier());\n\t\tif ($parentFolderName === '.') {\n\t\t\t$parentFolderName = '';\n\t\t} else {\n\t\t\t$parentFolderName .= '/';\n\t\t}\n\t\t$newIdentifier = $parentFolderName . $newName . '/';\n\n\t\tforeach ($this->getSubObjects($folder->getIdentifier(), FALSE) as $object) {\n\t\t\t$subObjectIdentifier = $object['Key'];\n\t\t\tif (self::is_dir($subObjectIdentifier)) {\n\t\t\t\t$this->renameSubFolder($this->getFolder($subObjectIdentifier), $newIdentifier);\n\t\t\t} else {\n\t\t\t\t$newSubObjectIdentifier = $newIdentifier . basename($subObjectIdentifier);\n\t\t\t\t$this->renameObject($subObjectIdentifier, $newSubObjectIdentifier);\n\t\t\t}\n\t\t}\n\n\t\t$this->renameObject($folder->getIdentifier(), $newIdentifier);\n\t\treturn $this->identifierMap;\n\t}", "public function updateAfterRenameFolder($old, $new);", "protected function foldersRenameRequest($name, $id)\n {\n // verify the required parameter 'name' is set\n if ($name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $name when calling foldersRename'\n );\n }\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling foldersRename'\n );\n }\n\n $resourcePath = '/api/Folders/rename/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($name !== null) {\n $queryParams['name'] = ObjectSerializer::toQueryValue($name);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function folderRename($inputArray){\r\n\t\t\treturn $this->host.'/file/renamefolder?'.$this->queryBuilder($inputArray);\r\n\t\t}", "function RenameFolder($path, $new_name) {\n\t\ttry{\n\t\t\tif(!$this->CheckPath($path))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\techo \"<br>rename<br>\";\n\t\t\t\t$this->soap_folder->rename(array('token' => $this->token,'fldPath' => $path,'newName' => $new_name));//($this->token, $path, $new_path);\n\t\t\t\t//(array('token' => $this->token, 'fldPath' => $this->folder->path))\n\t\t\t\techo \"error?\";\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}catch (Exception $e){\n\t\t\techo format_exception($e);\n\t\t}\n\t}", "public function RenameFolder($folder_id, $new_name)\n\t{\n\t\t$query = \"UPDATE [|PREFIX|]folders SET name = '\" . $this->Db->Quote($new_name) . \"' WHERE folderid = \" . intval($folder_id);\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function renameFolder($newname,$oldname){\n return rename ( WWW_ROOT .'files' . DS . $oldname , WWW_ROOT .'files' . DS . $newname );\n }", "public function onFolderWasRenamed(FolderWasRenamed $event)\n {\n \n $m = new Medium();\n $medium_path = $m->convertFilemanagerEventPathToMediumPath($event->oldPath(), false);\n $media = Medium::where('path', 'LIKE', '%'.$medium_path.'%')->get();\n foreach ($media as $medium) {\n $medium = Medium::find($medium->id);\n $medium->path = str_replace($medium_path, $m->convertFilemanagerEventPathToMediumPath($event->newPath(), false), $medium->path);\n $medium->update();\n }\n }", "function fmsCliRenameFolder( $parameters = array() )\n{\n global $filesystem;\n global $fmswd;\n\n /* Check that the user has supplied a FMS filename */\n if ( !isset( $parameters[1] ) )\n throw new Exception('Missing command parameter \"FMS directory name\".', CLI_MISSING_INPUT);\n\n /* Check that the user has supplied a new FMS filename */\n if ( !isset( $parameters[2] ) )\n throw new Exception('Missing command parameter \"New directory name\".', CLI_MISSING_INPUT);\n\n /* Obtain a list of folders within the current FMS working directory */\n $folders = $filesystem->getFolders( $fmswd );\n\n /* Identify which folder we are attempting to rename */\n $folder_to_rename = NULL;\n foreach( $folders as $folder )\n {\n if ( $folder->getName() == $parameters[1] )\n {\n $folder_to_rename = $folder;\n break;\n }\n }\n\n if ( empty( $folder_to_rename ) )\n throw new Exception( 'Unknown FMS file.', CLI_INVALID_INPUT );\n\n /* Rename the file */\n $filesystem->renameFolder( $folder_to_rename, $parameters[2] );\n\n return true;\n}", "abstract protected function getNameReplacementInFolder(AssetFolderModel $folder, $fileName);", "function rename_folder()\n\t{\n\t\t$this->db->set('name', $this->input->post('edit_folder_name'));\n\t\t$this->db->where('id_folder', $this->input->post('id_folder'));\n\t\t$this->db->update('user_folders');\n\t}", "public function renameFolder($name, $id) {\n $folder = $this->getFolderByID($id);\n if ($folder !== null) {\n return $folder->setName($name);\n }else{\n return false;\n }\n }", "public function testRenameFolder(){\n\t\t\t$title = \"Folder!@#\";\n\t\t\t$id = rand(0, 999999999);\n\t\t\t\n\t\t\t$this->expectOutputRegex(\"{getFolderList()}\"); //make sure the js call is made\n\t $model = $this->getMock(\"Model\", array(\"renameFolder\",\"getFolder\"));//create mock for model.renameFolder\n\t \n\t // Set up the expectation for the renameFolder() method\n\t // to be called only once and with the string $title and $ID\n\t // as its parameter.\n\t $model->expects($this->once())\n\t ->method(\"renameFolder\")\n\t ->with($this->equalTo($id),\n\t\t\t\t\t \t\t$this->equalTo($title));\n\t\t\t\t\t\t\t\n\t\t \t$model->expects($this->once())\n\t ->method(\"getFolder\")\n\t ->with($this->equalTo($id));\n\t \n\t $result = NoteBook::renameFolder($model, $id, $title);\n\t\t\t\n\t\t\t$this->assertEquals($result, \"\");//No output expected\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the original url found in DB. Empty string is returned if no record was found.
function fetchOriginalUrl($short_url, $pdo = NULL) { if (is_null($short_url) or $short_url === ''){ return ''; } if (is_null($pdo)) { $pdo = new PDO('mysql:host=localhost;dbname='.DB_NAME, DB_USER, DB_PASSWORD); } $stm = $pdo->prepare('SELECT original_url FROM url WHERE short_url = :short_url AND is_deleted = false'); $stm->bindParam(':short_url', $short_url, PDO::PARAM_STR); $stm->execute(); $row = $stm->fetch(PDO::FETCH_ASSOC); return isset($row['original_url'])? $row['original_url']: ''; }
[ "protected function getUrlFromDB()\n {\n if ($longUrl = $this->request->getData('long_url')) {\n return $this->Urls->findByLongUrl($longUrl)\n ->select(['id'])\n ->first();\n }\n }", "public function getOriginalLink()\n {\n if (!isset($this->data['fields']['originalLink'])) {\n if ($this->isNew()) {\n $this->data['fields']['originalLink'] = null;\n } elseif (!isset($this->data['fields']) || !array_key_exists('originalLink', $this->data['fields'])) {\n $this->addFieldCache('originalLink');\n $data = $this->getRepository()->getCollection()->findOne(array('_id' => $this->getId()), array('originalLink' => 1));\n if (isset($data['originalLink'])) {\n $this->data['fields']['originalLink'] = (string) $data['originalLink'];\n } else {\n $this->data['fields']['originalLink'] = null;\n }\n }\n }\n\n return $this->data['fields']['originalLink'];\n }", "public function getRawUrl(): string\n {\n $rawUrl = $this->db->handler->get($this->pathInfo, $this->queryParams)->fullUrl;\n\n return $rawUrl;\n }", "function getLastUrl ()\n\t{\n\t\t$sql = sprintf('select Url from qslogaccess\n\t\t\t\twhere UserID = %1$s and Url NOT LIKE \\'%%login.php%%\\' order by Date Desc limit 1', $db2->tosql($this->user_name, TEXT));\n\t\t$o_Query = $this->o_DB->fetchOne($sql);\n\t\tif ( $o_Query )\n\t\t$ret = $o_Query->Url;\n\t\treturn $ret;\n\t}", "public function get_original_url() {\n\t\treturn $this->original_url;\n\t}", "public function url()\n\t{\n\t\tif( $this->modified === false ) return $this->url;\n\t\telse\n\t\t{\n\t\t\t$url = $this->generateString();\n\t\t\treturn htmlentities( $url );\n\t\t}\n\t}", "public function getOriginalUrl();", "public function getUrl()\n {\n return $this->Urloriginal;\n }", "function get_url_one()\n\t{\n\t\t//Daten auslesen\n\t\t$sql = sprintf( \"SELECT * FROM %s WHERE flexint_id='%d'\", $this->cms->tbname['papoo_flexint_flexinttabelle'],\n\t\t\t$this->db->escape($this->checked->flexint_id) );\n\t\t$result = $this->db->get_results( $sql, ARRAY_A );\n\n\t\t$this->content->template['flexint_result'] = $result;\n\t\t$this->subverzeichnis = $result['0']['flexint_unterverzeichnis'];\n\t\treturn $result['0']['flexint_url'];\n\t}", "protected function getUrlFromDb($string) {\n $params=array(\n \"short_url\" => $string,\n );\n $query = \"SELECT id, long_url FROM \" . self::$table .\n \" WHERE short_url = :short_url LIMIT 1\";\n $stmt = $this->pdo->prepare($query);\n $stmt->execute($params); \n\n $result = $stmt->fetch();\n return (empty($result)) ? false : $result;\n }", "private function _getSocialSiteUrl() {\n $sqlStr = readResource(SQL_DIR . '/site/getSocialUrl.sql');\n $rslt = doSQLQuery($sqlStr);\n if ( is_array($rslt) ) {\n foreach ( $rslt as $Row ) {\n return NoNull($Row['social_url']);\n }\n }\n return '';\n }", "public function getUrl()\n {\n if ($this->source instanceof ContentActiveRecord || $this->source instanceof ContentAddonActiveRecord) {\n return $this->source->content->getUrl();\n } elseif ($this->source instanceof ContentContainerActiveRecord) {\n return $this->source->getUrl();\n }\n\n return \"#\";\n }", "public function getRealURL()\n {\n return $this->realURL()->full;\n }", "function zen_get_record_company_url($record_company_id, $language_id)\n{\n\tglobal $db;\n\t$record_company = $db->Execute(\"select record_company_url\n from \" . TABLE_RECORD_COMPANY_INFO . \"\n where record_company_id = '\" . (int)$record_company_id . \"'\n and languages_id = '\" . (int)$language_id . \"'\");\n\t\n\treturn $record_company->fields['record_company_url'];\n}", "public function getUrl()\n {\n $value = $this->get(self::url);\n return $value === null ? (string)$value : $value;\n }", "public function getURL() {\n\t\t\tif (!empty($this->url_override)) return $this->url_override;\n\t\t\treturn get_entity_url($this->getGUID()); \n\t\t}", "function get_sim_url($our_handler)\n {\n \t\t\n \t\t/* Query the table for the URL */\n \t\t$url_statement = $our_handler->prepare('SELECT our_url FROM avatar_url');\n \t\t$url_statement->execute();\n \t\t\n \t\t/* Fetch our one column and return it */\n \t\t$our_url = $url_statement->fetchColumn();\n \t\treturn $our_url;\n }", "protected function getImageOriginalURL()\n\t\t{\n\t\t\treturn $this->image_original_url;\n\t\t}", "public function insertaURL() {\r\n $database \t= self::getInstance();\r\n $query = \"UPDATE resultado_db as RES LEFT JOIN dblp_results AS DB ON RES.titulo=DB.titulo SET RES.url=DB.url WHERE RES.url IS NULL\";\r\n\r\n $result = $database->query($query);\r\n\r\n return $result;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end public function input_font_active create the ui element for field border_active
public function input_border_active( $params ) { //tpl: class ui:colorpicker $inputBorderActive = $this->view->newInput( 'input'.$this->prefix.'BorderActive' , 'Colorpicker' ); $this->items['border_active'] = $inputBorderActive; $inputBorderActive->addAttributes ( array ( 'name' => $this->keyName.'[border_active]', 'id' => 'wgt-input-'.$this->keyName.'_border_active'.($this->suffix?'-'.$this->suffix:''), 'class' => 'wcm wcm_ui_tip medium'.($this->assignedForm?' asgd-'.$this->assignedForm:''), 'title' => $this->view->i18n->l( 'Insert value for Border active (Color Node)', 'wbfsys.color_node.label' ), 'maxlength' => $this->entity->maxSize( 'border_active' ), ) ); $inputBorderActive->setWidth( 'medium' ); $inputBorderActive->setReadOnly( $this->isReadOnly( 'border_active' ) ); $inputBorderActive->setData( $this->entity->getSecure( 'border_active' ) ); $inputBorderActive->setLabel ( $this->view->i18n->l( 'Border active', 'wbfsys.color_node.label' ), $this->entity->required( 'border_active' ) ); $inputBorderActive->refresh = $this->refresh; $inputBorderActive->serializeElement = $this->sendElement; // activate the category $this->view->addVar ( 'showCat'.$this->namespace.'_Default' , true ); }
[ "public function get_font_color_control() {\n\t\t\t// Variables used in view\n\t\t\t$value = $this->value('font_color');\n\t\t\t$default_color = $this->default['font_color'];\n\t\t\t$current_color = isset( $value ) ? $value : $default_color;\n\n\t\t\t// Get control view\n\t\t\t?>\n <label><?php _e( 'Font Color', 'scratch' ); ?>\n <input class=\"color-picker-hex sc-font-color-text-box\" type=\"text\" maxlength=\"7\" placeholder=\"<?php esc_attr_e( 'Hex Value' ); ?>\"\n value=\"<?php echo $current_color; ?>\" data-default-color=\"<?php echo $default_color ?>\"\n <?php $this->link('font_color') ?>\n />\n </label>\n\n <?php\n\t\t}", "public function makeInputButton() {}", "function set_border_style($field){\n $value = is_error_field($field) ? 'style=\"border: rgb(202, 36, 36) 1px solid;\"' : '';\n return $value;\n}", "function apply_block_core_search_border_style($attributes, $property, $side, &$wrapper_styles, &$button_styles, &$input_styles)\n {\n }", "function ale_hover_border_wrapper_start(){\n echo \"<div class='border_style'>\";\n}", "function sc_chat_render_skin_header_fg( $input ) { \r\r\n\t\r\r\n\t// Get options\r\r\n\t$opts = sc_chat_get_options(); \r\r\n\r\r\n\t?>\r\r\n\t\r\r\n\t<input type=\"text\" name=\"sc_chat_opts[skin_header_fg]\" value=\"<?php echo $opts['skin_header_fg']; ?>\" class=\"sc-chat-color-field\" style=\"width: 75px\" />\r\r\n\r\r\n\t\r\r\n\r\r\n<?php }", "function CreateCurrentFont(){}", "public static function GetAutoFocusedFormField ();", "function fluid_edge_contact_form7_focus_styles_1() {\n\t\t$selector = array(\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-text:focus',\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-number:focus',\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-date:focus',\n\t\t\t'.cf7_custom_style_1 textarea.wpcf7-form-control.wpcf7-textarea:focus',\n\t\t\t'.cf7_custom_style_1 select.wpcf7-form-control.wpcf7-select:focus',\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-quiz:focus'\n\t\t);\n\t\t$styles = array();\n\n\t\t$color = fluid_edge_options()->getOptionValue('cf7_style_1_focus_text_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_1 input:focus::-webkit-input-placeholder',\n\t\t\t\t\t'.cf7_custom_style_1 textarea:focus::-webkit-input-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_1 input:focus:-moz-placeholder',\n\t\t\t\t\t'.cf7_custom_style_1 textarea:focus:-moz-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_1 input:focus::-moz-placeholder',\n\t\t\t\t\t'.cf7_custom_style_1 textarea:focus::-moz-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_1 input:focus:-ms-input-placeholder',\n\t\t\t\t\t'.cf7_custom_style_1 textarea:focus:-ms-input-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t}\n\n\t\t$background_color = fluid_edge_options()->getOptionValue('cf7_style_1_focus_background_color');\n\t\t$background_opacity = 1;\n\t\tif($background_color !== ''){\n\t\t\tif(fluid_edge_options()->getOptionValue('cf7_style_1_focus_background_transparency') !== ''){\n\t\t\t\t$background_opacity = fluid_edge_options()->getOptionValue('cf7_style_1_focus_background_transparency');\n\t\t\t}\n\t\t\t$styles['background-color'] = fluid_edge_rgba_color($background_color,$background_opacity);\n\t\t}\n\n\t\t$border_color = fluid_edge_options()->getOptionValue('cf7_style_1_focus_border_color');\n\t\t$border_opacity = 1;\n\t\tif($border_color !== ''){\n\t\t\tif(fluid_edge_options()->getOptionValue('cf7_style_1_focus_border_transparency') !== ''){\n\t\t\t\t$border_opacity = fluid_edge_options()->getOptionValue('cf7_style_1_focus_border_transparency');\n\t\t\t}\n\t\t\t$styles['border-color'] = fluid_edge_rgba_color($border_color,$border_opacity);\n\t\t}\n\n\t\techo fluid_edge_dynamic_css($selector, $styles);\n\t}", "public function CreateBorder()\n {\n return new MacBorder();\n }", "function genTextBox( $name, $initialValue )\n\t{\n \techo '<textarea name=\"' . $name . '\" class=\"groupBBS fbFont\">' .\n\t $initialValue . '</textarea>';\n\t}", "public function define_navbar_txt_activate($p_state)\r\n\t\t{\r\n\t\t\t$this->c_obj_graphic->define_navbar_txt_activate($p_state);\r\n\t\t}", "public function apply_border_color(){\n\t\tif($this->request->is('get')){\n\t\t\t$field_ar = array('keyword','from','to','vertical','spoc','opportunity','priority','type','sow',\n\t\t\t'proposal_done','proposal_approve','agree_sign','work_status','spot','source','work_complete');\n\t\t\tforeach($field_ar as $key => $val){\t\n\t\t\t\tif($this->request->query[$val] != ''){\n\t\t\t\t\t$this->set('bdsrchSel'.++$key, 'bdsrchSel');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}", "function fluid_edge_contact_form7_focus_styles_2() {\n\t\t$selector = array(\n\t\t\t'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-text:focus',\n\t\t\t'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-number:focus',\n\t\t\t'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-date:focus',\n\t\t\t'.cf7_custom_style_2 textarea.wpcf7-form-control.wpcf7-textarea:focus',\n\t\t\t'.cf7_custom_style_2 select.wpcf7-form-control.wpcf7-select:focus',\n\t\t\t'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-quiz:focus'\n\t\t);\n\t\t$styles = array();\n\n\t\t$color = fluid_edge_options()->getOptionValue('cf7_style_2_focus_text_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_2 input:focus::-webkit-input-placeholder',\n\t\t\t\t\t'.cf7_custom_style_2 textarea:focus::-webkit-input-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_2 input:focus:-moz-placeholder',\n\t\t\t\t\t'.cf7_custom_style_2 textarea:focus:-moz-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_2 input:focus::-moz-placeholder',\n\t\t\t\t\t'.cf7_custom_style_2 textarea:focus::-moz-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t\techo fluid_edge_dynamic_css(\n\t\t\t\tarray(\n\t\t\t\t\t'.cf7_custom_style_2 input:focus:-ms-input-placeholder',\n\t\t\t\t\t'.cf7_custom_style_2 textarea:focus:-ms-input-placeholder'\n\t\t\t\t),\n\t\t\t\tarray('color' => $color)\n\t\t\t);\n\t\t}\n\n\t\t$background_color = fluid_edge_options()->getOptionValue('cf7_style_2_focus_background_color');\n\t\t$background_opacity = 1;\n\t\tif($background_color !== ''){\n\t\t\tif(fluid_edge_options()->getOptionValue('cf7_style_2_focus_background_transparency') !== ''){\n\t\t\t\t$background_opacity = fluid_edge_options()->getOptionValue('cf7_style_2_focus_background_transparency');\n\t\t\t}\n\t\t\t$styles['background-color'] = fluid_edge_rgba_color($background_color,$background_opacity);\n\t\t}\n\n\t\t$border_color = fluid_edge_options()->getOptionValue('cf7_style_2_focus_border_color');\n\t\t$border_opacity = 1;\n\t\tif($border_color !== ''){\n\t\t\tif(fluid_edge_options()->getOptionValue('cf7_style_2_focus_border_transparency') !== ''){\n\t\t\t\t$border_opacity = fluid_edge_options()->getOptionValue('cf7_style_2_focus_border_transparency');\n\t\t\t}\n\t\t\t$styles['border-color'] = fluid_edge_rgba_color($border_color,$border_opacity);\n\t\t}\n\n\t\techo fluid_edge_dynamic_css($selector, $styles);\n\t}", "public function txtActive_Create($strControlId = null) {\n\t\t\t$this->txtActive = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtActive->Name = QApplication::Translate('Active');\n\t\t\t$this->txtActive->MaxLength = ListaCurso::ActiveMaxLength;\n\t\t\t$this->txtActive->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->txtActive->LinkedNode = QQN::ListaCurso()->Active;\n\t\t\t$this->txtActive->Text = $this->objListaCurso->Active;\n\t\t\treturn $this->txtActive;\n\t\t}", "function textBorder($im, $size, $angle, $x, $y, $font, $text, $textcolor, $bordercolor)\n\t{\n\t\timagettftext($im, $size, $angle, $x+1, $y, $bordercolor, $font, $text);\n\t\timagettftext($im, $size, $angle, $x-1, $y, $bordercolor, $font, $text);\n\t\timagettftext($im, $size, $angle, $x, $y-1, $bordercolor, $font, $text);\n\t\timagettftext($im, $size, $angle, $x, $y+1, $bordercolor, $font, $text);\n\t\timagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $text);\n\t}", "function setBorderColor($value) { $this->_bordercolor=$value; }", "public function input_font_hover( $params )\n {\n\n //tpl: class ui:colorpicker\n $inputFontHover = $this->view->newInput( 'input'.$this->prefix.'FontHover' , 'Colorpicker' );\n $this->items['font_hover'] = $inputFontHover;\n $inputFontHover->addAttributes\n (\n array\n (\n 'name' => $this->keyName.'[font_hover]',\n 'id' => 'wgt-input-'.$this->keyName.'_font_hover'.($this->suffix?'-'.$this->suffix:''),\n 'class' => 'wcm wcm_ui_tip medium'.($this->assignedForm?' asgd-'.$this->assignedForm:''),\n 'title' => $this->view->i18n->l( 'Insert value for Font hover (Color Node)', 'wbfsys.color_node.label' ),\n 'maxlength' => $this->entity->maxSize( 'font_hover' ),\n )\n );\n $inputFontHover->setWidth( 'medium' );\n\n $inputFontHover->setReadOnly( $this->isReadOnly( 'font_hover' ) );\n $inputFontHover->setData( $this->entity->getSecure( 'font_hover' ) );\n $inputFontHover->setLabel\n (\n $this->view->i18n->l( 'Font hover', 'wbfsys.color_node.label' ),\n $this->entity->required( 'font_hover' )\n );\n\n $inputFontHover->refresh = $this->refresh;\n $inputFontHover->serializeElement = $this->sendElement;\n\n // activate the category\n $this->view->addVar\n (\n 'showCat'.$this->namespace.'_Default' ,\n true\n );\n\n\n }", "static function GetDefaultBorder(){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the update_restaurant method updates an existing restaurant in the database. Details of the restaurant are posted in a form. Return true if succeed; false otherwise.
public function update_restaurant($id) { //if the script did not received post data, display an error message and then terminate the script immediately if (!filter_has_var(INPUT_POST, 'name') || !filter_has_var(INPUT_POST, 'phone') || !filter_has_var(INPUT_POST, 'address') || !filter_has_var(INPUT_POST, 'hours') || !filter_has_var(INPUT_POST, 'famous_dish')) { return false; } //retrieve data for the new restaurant; data are sanitized and escaped for security. $name = $this->dbConnection->real_escape_string(trim(filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING))); $phone = $this->dbConnection->real_escape_string(trim(filter_input(INPUT_POST, 'phone', FILTER_SANITIZE_STRING))); $address = $this->dbConnection->real_escape_string(filter_input(INPUT_POST, 'address', FILTER_DEFAULT)); $hours = $this->dbConnection->real_escape_string(trim(filter_input(INPUT_POST, 'hours', FILTER_SANITIZE_STRING))); $famous_dish = $this->dbConnection->real_escape_string(trim(filter_input(INPUT_POST, 'famous_dish', FILTER_SANITIZE_STRING))); try { //ensure name is not empty if ($name == "") { throw new RequiredValueException("Fatal Error:<br> Name is missing.<br>"); } //ensure phone is not empty if ($phone == "") { throw new RequiredValueException("Fatal Error:<br> Phone is missing.<br>"); } //ensure address is not empty if ($address == "") { throw new RequiredValueException("Fatal Error:<br> Address is missing.<br>"); } //ensure hours is not empty if ($hours == "") { throw new RequiredValueException("Fatal Error:<br> Hours is missing.<br>"); } //ensure famous dish is not empty if ($famous_dish == "") { throw new RequiredValueException("Fatal Error:<br> Famous Dish is missing.<br>"); } } catch(RequiredValueException $e){ $message = $e->getMessage(); } //query string for update $sql = "UPDATE " . $this->tblUser . " SET name='$name', phone_number='$phone', address='$address', hours_of_operation='$hours', famous_dish='$famous_dish' WHERE id='$id'"; //execute the query return $this->dbConnection->query($sql); }
[ "public function updated(Restaurant $restaurant)\n {\n //\n }", "public function updateRestaurant($restaurantId, $description, $address, $phoneNum) {\r\n $sql = \"UPDATE restaurant SET description=:description, address=:address, phone_no=:phoneNum \"\r\n . \" WHERE restaurant_id=:restaurantId\";\r\n $stmt = $this->dbh->prepare($sql);\r\n $stmt->bindParam(':restaurantId', $restaurantId);\r\n $stmt->bindParam(':description', $description);\r\n $stmt->bindParam(':address', $address);\r\n $stmt->bindParam(':phoneNum', $phoneNum);\r\n if (!$stmt->execute()) {\r\n print_r($stmt->errorInfo());\r\n return false;\r\n }\r\n return true;\r\n }", "public function updateRestaurant(restaurant $restaurant, array $data) : void\n {\n $sql = \"UPDATE Restaurants SET \n name=?,\n address=?,\n biography=?,\n duration=?,\n sessions=?,\n start_of_session=?,\n seats=?,\n stars=?,\n price=? \n WHERE restaurant_id = $restaurant->id\";\n \n // For every new categorie add it to the db\n foreach ($data['insert_cuisines'] as $cuisine) {\n $this->insertNewCategories($restaurant->id, $cuisine);\n }\n\n $this->deleteCategories($restaurant, $data);\n\n // Get connection and prepare statement\n if($query = $this->conn->prepare($sql)) {\n\n // Create bind params to prevent sql injection\n $query->bind_param(\"sssdisiid\", \n $data['name'],\n $data['address'],\n $data['biography'],\n $data['duration'],\n $data['sessions'],\n $data['start_of_session'],\n $data['seats'],\n $data['stars'],\n $data['price']\n );\n\n // Execute query\n $query->execute();\n } else {\n // If connection cannot be established, throw an error\n throw new Exception('Could not update the restaurant. Please try again');\n }\n }", "public function updated(Restaurant $restaurant)\n {\n $restaurant->updated_by_user_id = Auth::id();\n }", "public function restaurant_update_status($restaurant_id = '') {\n\t global $foodbakery_plugin_options;\n\t $foodbakery_restaurants_review_option = isset($foodbakery_plugin_options['foodbakery_restaurants_review_option']) ? $foodbakery_plugin_options['foodbakery_restaurants_review_option'] : '';\n\n\t $get_restaurant_id = foodbakery_get_input('restaurant_id', 0);\n\t $is_updating = false;\n\t if ($get_restaurant_id != '' && $get_restaurant_id != 0 && $this->is_publisher_restaurant($get_restaurant_id)) {\n\t\t$is_updating = true;\n\t }\n\n\t $user_data = wp_get_current_user();\n\n\t if ($foodbakery_restaurants_review_option == 'on') {\n\t\tupdate_post_meta($restaurant_id, 'foodbakery_restaurant_status', 'awaiting-activation');\n\t\t// Restaurant not approved\n\t\tdo_action('foodbakery_restaurant_not_approved_email', $user_data, $restaurant_id);\n\t } else {\n\t\tupdate_post_meta($restaurant_id, 'foodbakery_restaurant_status', 'active');\n\t\t// Restaurant approved\n\t\tdo_action('foodbakery_restaurant_approved_email', $user_data, $restaurant_id);\n\n\t\t// social sharing\n\t\t$get_social_reach = get_post_meta($restaurant_id, 'foodbakery_transaction_restaurant_social', true);\n\t\tif ($get_social_reach == 'on') {\n\t\t do_action('foodbakery_restaurant_social_post', $restaurant_id);\n\t\t}\n\t }\n\n\t $foodbakery_free_restaurants_switch = isset($foodbakery_plugin_options['foodbakery_free_restaurants_switch']) ? $foodbakery_plugin_options['foodbakery_free_restaurants_switch'] : '';\n\n\t if ($foodbakery_free_restaurants_switch != 'on') {\n\n\t\t$foodbakery_package_id = get_post_meta($restaurant_id, 'foodbakery_restaurant_package', true);\n\t\tif ($foodbakery_package_id) {\n\t\t $foodbakery_package_data = get_post_meta($foodbakery_package_id, 'foodbakery_package_data', true);\n\n\t\t $restaurant_duration = isset($foodbakery_package_data['restaurant_duration']['value']) ? $foodbakery_package_data['restaurant_duration']['value'] : 0;\n\n\t\t // calculating restaurant expiry date\n\t\t $foodbakery_trans_restaurant_expiry = $this->date_conv($restaurant_duration, 'days');\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_expired', strtotime($foodbakery_trans_restaurant_expiry));\n\t\t}\n\t }\n\t}", "public function SaveRestaurant() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->txtCountry) $this->objRestaurant->Country = $this->txtCountry->Text;\n\t\t\t\tif ($this->txtCity) $this->objRestaurant->City = $this->txtCity->Text;\n\t\t\t\tif ($this->txtAddress) $this->objRestaurant->Address = $this->txtAddress->Text;\n\t\t\t\tif ($this->txtRestaurantName) $this->objRestaurant->RestaurantName = $this->txtRestaurantName->Text;\n\t\t\t\tif ($this->txtLongitude) $this->objRestaurant->Longitude = $this->txtLongitude->Text;\n\t\t\t\tif ($this->txtLatitude) $this->objRestaurant->Latitude = $this->txtLatitude->Text;\n\t\t\t\tif ($this->txtQrCode) $this->objRestaurant->QrCode = $this->txtQrCode->Text;\n\t\t\t\tif ($this->txtQtycoins) $this->objRestaurant->Qtycoins = $this->txtQtycoins->Text;\n\t\t\t\tif ($this->txtIdUser) $this->objRestaurant->IdUser = $this->txtIdUser->Text;\n\t\t\t\tif ($this->txtType) $this->objRestaurant->Type = $this->txtType->Text;\n\t\t\t\tif ($this->txtLogo) $this->objRestaurant->Logo = $this->txtLogo->Text;\n\t\t\t\tif ($this->txtStatus) $this->objRestaurant->Status = $this->txtStatus->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the Restaurant object\n\t\t\t\t$this->objRestaurant->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->scenario = Restaurants::SCENARIO_UPDATE;\n $model->load(Yii::$app->request->post());\n $model->validate();\n $model->save();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['restaurants/details', 'id' => $model->id]);\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function testUpdate()\n {\n //login\n $client = static::createClient();\n $userRepository = static::$container->get(UserRepository::class);\n $userEmail = 'admin@admin.com';\n $testUser = $userRepository->findOneByEmail($userEmail);\n $client->loginUser($testUser);\n //get token & form data\n $restaurantTable = static::$container->get(RestaurantTableRepository::class)->findOneByNumber(1);//fixture restaurant table\n $crawler = $client->request('GET', '/restaurant/table/update/'.$restaurantTable->getId());\n $extract = $crawler->filter('input[name=\"restaurant_table[_token]\"]')->extract(['value']);\n $token = $extract[0];\n $newNumber = 2;\n $formData = [\n 'restaurant_table' => [\n 'number' => $newNumber,\n 'capacity' => 1,\n '_token' => $token,\n ],\n ];\n //request\n $crawler = $client->request('POST', '/restaurant/table/update/'.$restaurantTable->getId(), $formData);\n //assert\n $updatedRestaurantTable = static::$container->get(RestaurantTableRepository::class)->findOneByNumber($newNumber);\n $this->assertNotNull($updatedRestaurantTable);\n }", "public function update()\n {\n $hotelItem = HotelItem::find((int)get_request_value('hotel_item_id'));\n if (!$hotelItem) {\n notFoundError(400, \"invalid hotel item ID\");\n }\n if (isset($_POST['hotelier_id']) && $hotelItem->hotelier_id != (int)$_POST['hotelier_id']) {\n $hotelier = Hotelier::find((int)get_request_value('hotelier_id'));\n if (!$hotelier) {\n $result['errors']['hotelier_id'] = 'invalid hotelier ID!.';\n } else {\n $hotelItem->hotelier_id = $hotelier->id;\n }\n }\n\n $result = $this->validateInputData();\n if (count($result['errors'])) {\n returnValidatioErrors($result['errors']);\n }\n $hotelItem = $this->saveItem($hotelItem, $result);\n header('Content-type: application/json', true, 200);\n echo json_encode(['result' => true, 'item' => $hotelItem]);\n exit;\n }", "public function updatePizza()\n\t{\n\t\t$pizzas = new PizzaModel();\n\t\t$pizzas->update($_POST['id'], $_POST);\n\n\t\thelper(['form']);\n\t\t$data = [];\n\t\tif($this->request->getMethod() == \"post\")\n\t\t{\n\t\t\t$rules = [\n\t\t\t\t'name'=>'required',\n\t\t\t\t'price'=>'required',\n\t\t\t\t'ingredients'=>'required'\n\t\t\t];\n\t\t if(!$this->validate($rules)){\n\t\t\t\t$data['validation'] = $this->validator;\n\t\t\t\treturn redirect()->to(\"/dashboard\");\n\t\t\t}else{\t\t\t\n\t\t\t\t$pizzas = new PizzaModel();\n\t\t\t\t$pizzaData = array(\n\t\t\t\t\t'name'=>$this->request->getVar('name'),\n\t\t\t\t\t'price'=>$this->request->getVar('price'),\n\t\t\t\t\t'ingredients'=>$this->request->getVar('ingredients'),\n\t\t\t\t);\n\t\t\t\t$pizzas->addPizza($pizzaData);\n\t\t\t\treturn redirect()->to(\"/dashboard\");\n\t\t\t}\n\t }\t\n\t\treturn redirect()->to('/dashboard');\n\t}", "public function edit_client_restaurant_by_id($id){\n\t\t$updatingData = $this->input->post();\n\t\tif($updatingData){\n\t\t\t$result = $this->ClientModel->edit_client_by_id($id, $updatingData);\n\t\t\n\t\t\tif($result){\n\t\t\t\t$data['success_message'] = 'Restaurant is edited successfully';\n\t\t\t}else{\n\t\t\t\t$data['failed_message'] = 'Failed to edit restaurant';\n\t\t\t}\n\t\t}\n\t\t$data['title']= 'SmartSend::Manage Client';\n\t\t$this->session->set_userdata('user_data', $data);\n\t\t//$this->welcome_to_client_restaurant_page($data);\n\t\tredirect('client/client_restaurant_page');\n\t}", "public function updateLocation()\n {\n $core = Core::dbOpen();\n $sql = \"UPDATE program_locations SET city = :city, state = :state, zip = :zip\n WHERE locationID = :id\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':city', $this->city);\n $stmt->bindParam(':state', $this->state);\n $stmt->bindParam(':zip', $this->zip);\n $stmt->bindParam(':id', $this->locationID);\n \n Core::dbClose();\n \n try {\n if($stmt->execute()) {\n return true;\n }\n } catch (PDOException $e) {\n return false;\n }\n }", "public function actionSaveRestaurantDetails() {\n //validate webservice\n $requiredParams = ['user_id', 'name', 'restaurant_lat', 'restaurant_long'];\n\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n\n try {\n //Get request parameters.\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n\n $user_id = $post['user_id'];\n $name = $post['name'];\n $mobile = !empty($post['mobile']) ? $post['mobile'] : null;\n $address = !empty($post['address']) ? $post['address'] : null;\n $country_code = !empty($post['country_code']) ? $post['country_code'] : 'US';\n $restaurant_google_id = !empty($post['restaurant_google_id']) ? $post['restaurant_google_id'] : null;\n $restaurant_lat = $post['restaurant_lat'];\n $restaurant_long = $post['restaurant_long'];\n\n //Fetch country details\n $countryDetails = Countries::findOne([\"code\" => $country_code]);\n\n //Fetch logged in user details\n $userdata = Users::find()->where(['user_id' => $user_id])->one();\n\n //update user type to restaurant user\n $userdata->user_type = Yii::$app->params['USER_TYPE']['restaurant'];\n $userdata->save(false);\n\n //Check if Restaurannt exist or not\n //If exist then Update Restaurant details\n //If not exist then Add Restaurant details\n $restaurants = Restaurants::find()->where(['user_id' => $user_id])->one();\n if (empty($restaurants)) {\n $restaurants = new Restaurants();\n }\n $restaurants->user_id = $user_id;\n $restaurants->name = !empty($post['name']) ? trim($post['name']) : '';\n $restaurants->restaurant_google_id = !empty($post['restaurant_google_id']) ? trim($post['restaurant_google_id']) : '';\n $restaurants->country_id = $countryDetails->id;\n $restaurants->mobile = !empty($post['mobile']) ? trim($post['mobile']) : '';\n $restaurants->address = !empty($post['address']) ? trim($post['address']) : '';\n $restaurants->restaurant_lat = !empty($post['restaurant_lat']) ? trim($post['restaurant_lat']) : '';\n $restaurants->restaurant_long = !empty($post['restaurant_long']) ? trim($post['restaurant_long']) : '';\n $restaurants->save(false);\n\n //send email to owner about restaurant registration\n if (!empty(Yii::$app->params['SITE_OWNER_EMAIL'])) {\n $emailformatemodel = EmailFormat::findOne([\"id\" => Yii::$app->params['EMAIL_TEMPLATE_ID']['restaurant_registered'], \"status\" => '1']);\n if ($emailformatemodel) {\n //create email body\n $AreplaceString = array(\n '{site_owner_name}' => Yii::$app->params['SITE_OWNER_NAME'],\n '{restaurant_name}' => $restaurants->name,\n '{restaurant_owner_name}' => $userdata->name,\n '{phone_number}' => $restaurants->mobile,\n '{email}' => $userdata->email,\n '{address}' => $restaurants->address\n );\n $body = CommonApiHelper::MailTemplate($AreplaceString, $emailformatemodel->body);\n $ssSubject = $emailformatemodel->subject;\n //send email to new registered user\n Yii::$app->mailer->compose()\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name])\n ->setTo(Yii::$app->params['SITE_OWNER_EMAIL'])\n ->setSubject($ssSubject)\n ->setHtmlBody($body)\n ->send();\n }\n }\n\n //Prepare response\n $restaurantDetails = [\n 'name' => $restaurants->name,\n 'restaurant_google_id' => $restaurants->restaurant_google_id,\n 'mobile' => $restaurants->mobile,\n 'address' => $restaurants->address,\n 'restaurant_lat' => $restaurants->restaurant_lat,\n 'restaurant_long' => $restaurants->restaurant_long\n ];\n $response[] = [\n 'user_id' => $userdata->user_id,\n 'user_type' => $userdata->user_type,\n 'name' => $userdata->name,\n 'email' => $userdata->email,\n 'profile_pic' => !empty($userdata->profile_pic) ? $userdata->profile_pic : '',\n 'is_otp_verified' => $userdata->is_otp_verified,\n 'restaurant_details' => $restaurantDetails\n ];\n\n return CommonApiHelper::return_success_response(\"Restaurant details has been saved.\", \"\", $response);\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response('Sorry, Please try again.');\n }\n }", "public function testUpdate()\n\t{\n\t\t$this->withoutMiddleware();\n\t\t$this->call('POST', '/drug', $this->drugData);\n\t\t// Update the Drug\n\t\t$drugStored = Drug::orderBy('id','desc')->first();\n\n\t\t$this->withoutMiddleware();\n\t\t$this->call('PUT', '/drug/1', $this->drugUpdate);\n\n\t\t// $drugUpdated = Drug::find($drugStored->id);\n\t\t$drugUpdated = Drug::find('1');\n\t\t$this->assertEquals($drugUpdated->name , $this->drugUpdate['name']);\n\t\t$this->assertEquals($drugUpdated->description ,$this->drugUpdate['description']);\n\t}", "public function updaterecipe() {\n //method called when submit button is pressed\n $array = array();\n $array[] = array(\n 'code' => $this->input->post('code'),\n 'name' => $this->input->post('name'),\n 'description' => $this->input->post('description')\n );\n $this->recipes->update($array);\n redirect('/Administration/recipes');\n }", "public function approveNewRestaurant(restaurant $res){\n\n\t\t$query = sprintf(\"INSERT INTO restaurant(\n\n\t\t\t\t\t\t\t\t\t\t\tlatitude,\n\t\t\t\t\t\t\t\t\t\t\tlongitude,\n\t\t\t\t\t\t\t\t\t\t\timage,\n\t\t\t\t\t\t\t\t\t\t\tlink,\n\t\t\t\t\t\t\t\t\t\t\tapproved\n\t\t\t\t\t\t\t\t\t\t)VALUES (\n\n\t\t\t\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t\t\t\t'%s',\n\t\t\t\t\t\t\t\t\t\t\t'%d'\n\t\t\t\t\t\t\t\t\t\t)\",\n\t\t\t\t\t\t\t\t\t\t\t$res->getLat(),\n\t\t\t\t\t\t\t\t\t\t\t$res->getLong(),\n\t\t\t\t\t\t\t\t\t\t\t$res->getImage(),\n\t\t\t\t\t\t\t\t\t\t\t$res->getLink(),\n\t\t\t\t\t\t\t\t\t\t\t$res->getApproved()\n\t\t\t\t\t);\n\n\t\tif (!$this->mysqli->query($query))\n\t\t\tdie($this->mysqli->error);\n\n\t}", "public function update() {\n\t\t\tif($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\tif($this->id) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$result = $this->model->update($this->id);\n\t\t\t\t\t\tif($result) {\n\t\t\t\t\t\t\t$this->session->add('message', ucfirst($this->prefix).' updated.');\n\t\t\t\t\t\t\tif($result === true) {\n\t\t\t\t\t\t\t\t$result = ADMIN_URL.'/'.$this->prefix; // Return to the items main page.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texit(header('Location: '.$result));\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(\\exception $e) {\n\t\t\t\t\t\t$this->session->add('message', $e->getMessage());\n\t\t\t\t\t}\n\t\t\t\t\texit(header('Location: '.$_SERVER['HTTP_REFERER']));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\terror404(); // Id is not set.\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\texit(header('Location: '.ADMIN_URL.'/'.$this->prefix)); // Wrong request method.\n\t\t\t}\n\t\t}", "public function createEdit(Request $request, $restaurant_id)\n {\n $this->authorize('restaurateur-user');\n $restaurant = Restaurant::find($restaurant_id);\n\n if ($restaurant_id) {\n $validator = Validator::make(\n $request->all(),\n [\n 'name' => 'required',\n 'opening_time' => ['regex:/^[0-9]{2} : [0-9]{2}.*$/'],\n 'closing_time' => ['regex:/^[0-9]{2} : [0-9]{2}.*$/'],\n 'location' => 'required',\n 'telephone' => 'required|numeric',\n 'email' => 'required|email',\n 'address' => 'required',\n ]\n );\n\n if ($validator->fails()) {\n return redirect('/restaurants/edit')\n ->withInput()\n ->withErrors($validator);\n }\n\n $restaurant->fill($request->all());\n $restaurant->save();\n $user = auth()->user();\n $username = $user->username;\n\n return redirect('/dashboard');\n } else {\n abort(404);\n }\n }", "public function setRestaurant($restaurant)\r\n {\r\n $this->restaurant = $restaurant;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Locate class Block Node
protected function _getClassBlockNode($className) { if (!isset($this->_cache_class_block[$className])) { // Locate Class $classNode = $this->_getClassNode($className); if (VWP::isWarning($classNode)) { $this->_cache_class_block[$className] = $classNode; } else { $this->_cache_class_block[$className] = VWP::raiseWarning('Class block not found',get_class($this),null,false); $len = $classNode->childNodes->length; for($p = 0; $p < $len; $p++) { $node = $classNode->childNodes->item($p); if (strtolower($node->nodeName) == 'block') { $this->_cache_class_block[$className] = $node; $p = $len; } } } } return $this->_cache_class_block[$className]; }
[ "public function getBlockClass() {\n\t\t\treturn $this->block_class;\n\t\t}", "public static function getBlock($className) {\r\n if ($class = self::getClassPath($className)) {\r\n $className = _CL_NAMESPACE_ . '_Core_' . $class['name'];\r\n\r\n //set the model name for this class\r\n if (!isset(self::$instances[$className])) {\r\n\r\n /* if $core == true then call the class from core directory */\r\n self::includeBlock(_CL_CORE_DIR_, $class['name']);\r\n\r\n if (class_exists($className)) {\r\n self::$instances[$className] = new $className;\r\n return self::$instances[$className];\r\n }\r\n else\r\n exit(\"Block error: Can't call $className class\");\r\n }\r\n else\r\n return self::$instances[$className];\r\n }\r\n return;\r\n }", "function block_load_class($blockname) {\n global $CFG;\n\n @include_once($CFG->dirroot.'/blocks/moodleblock.class.php');\n $classname = 'CourseBlock_'.$blockname;\n @include_once($CFG->dirroot.'/blocks/'.$blockname.'/block_'.$blockname.'.php');\n\n // After all this, return value indicating success or failure\n return class_exists($classname);\n}", "public function findBlock($type)\n {\n if (isset($this->plugins[$type])) {\n $type = $this->plugins[$type]['class'];\n } else {\n $type = self::NAMESPACE_PLUGINS_BLOCKS . 'Plugin_' . str_replace(self::NAMESPACE_PLUGINS_BLOCKS.'Plugin',\n '', $type);\n }\n\n $keys = array_keys($this->stack);\n while (($key = array_pop($keys)) !== false) {\n if ($this->stack[$key] instanceof $type) {\n return $this->stack[$key];\n }\n }\n\n return false;\n }", "protected function getClassBlock($class)\n {\n return \\Magento\\Mtf\\ObjectManager::getInstance()->create(\n $class,\n ['element' => $this->find($this->selectBlock, Locator::SELECTOR_XPATH)]\n );\n }", "protected function findBlockInstance(Block $block) {\n return $this->xpath('//div[@id = :id]', [':id' => 'block-' . $block->id()]);\n }", "public function testFindByClass()\n {\n $root = new Node('<div class=\"test\"><div class=\"test\">Test<span class=\"test\">Test 1</span></div></div>');\n $elements = $root->find('.test');\n $this->assertCount(3, $elements);\n $this->assertContainsOnlyInstancesOf(NodeContract::class, $elements);\n }", "protected function get_block_type() {\n\t\treturn $this->namespace . '/' . $this->block_name;\n\t}", "public function testWithHugeClassDocBlockClass()\n {\n // test if we have the entry for the underscored class\n $this->assertTrue($this->structureMap->entryExists('Random\\Test\\NamespaceName\\HugeClassDocBlockClass'));\n }", "public function getBlockClass($blockName)\n {\n \t$blockClass = ucwords(strtolower($blockName));\n \t$blockClass = preg_replace('/\\s[\\s]+/','',$blockClass); // Strip off multiple spaces \n \t$blockClass = preg_replace('/[\\s\\W]+/','',$blockClass); // Strip off spaces and non-alpha-numeric\n \treturn $blockClass.'Block';\n }", "public function getNode() {\n\treturn new PHPParser_Node_Stmt_Class($this->name, array(\n\t 'type' => $this->type,\n\t 'extends' => $this->extends,\n\t 'implements' => $this->implements,\n\t 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods),\n\t));\n }", "public function getFirstChildByClass(string $class);", "function kiwi_preprocess_block(&$variables) {\n $variables['classes_array'][] = 'block-position-' . $variables['block_id'];\n}", "public static function getBlockIdentifier(): string\n {\n $class = Str::afterLast(static::class, '\\\\');\n return Str::slug(static::getBlockGroup() . '--' . $class);\n }", "public function visitClass(Node $node);", "function wp_register_custom_classname_support($block_type)\n {\n }", "private function getBlockNamespace() {\n return '\\\\ZincPHP\\\\Blocks' \n . str_replace('/', '\\\\', $this->segments)\n . '\\\\'\n . ucfirst($this->requestType)\n . ucfirst($this->blockLabel);\n }", "public function createBlock()\n {\n $class = $this->getClass();\n return new $class;\n }", "private function findNodeBlockInCollection()\n {\n if (!is_null($this->nodeBlock)) return $this->nodeBlock;\n\n foreach($this->collection->getTreeArray() as $id => $nodeBlock) {\n\n if ($this->id == $id) return $nodeBlock;\n\n if (isset($nodeBlock['children'])) {\n if ($result = $this->findNodeBlockRecursive($nodeBlock['children']))\n return $this->nodeBlock = $result;\n }\n }\n\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets sub settings that the setting should contain.
public function get_sub_settings() { return array( array( 'id' => 'site_url', 'title' => __( 'Custom Site URL', 'google-site-kit-dev-settings' ), 'description' => __( 'This will override your actual site URL, causing Site Kit to request and display insights for the site URL you enter here.', 'google-site-kit-dev-settings' ), 'section' => 'general', 'class' => 'regular-text code', ), array( 'id' => 'oauth2_client_id', 'title' => __( 'Google OAuth2 Client ID', 'google-site-kit-dev-settings' ), 'section' => 'authentication', 'class' => 'regular-text code', ), array( 'id' => 'oauth2_client_secret', 'title' => __( 'Google OAuth2 Client Secret', 'google-site-kit-dev-settings' ), 'section' => 'authentication', 'class' => 'regular-text code', ), ); }
[ "public function getSubSettings(): array;", "public function getSubsetting()\n {\n return $this->subsetting;\n }", "abstract public function getSettings();", "public function getAll()\n\t{\n\t\treturn $this->settings;\n\t}", "public function getSettings();", "private function get_settings()\r\n {\r\n if($this->user->has_access('Settings', 'Manage', FALSE))\r\n {\r\n // If they can manage the settings, show all\r\n return $this->setting_model->get_all();\r\n }\r\n else\r\n {\r\n // If they can't manage them, only show GUI settings\r\n return $this->setting_model->get_all_gui();\r\n }\r\n }", "public function getAllSettings()\n {\n return $this->_settings_array;\n }", "public function getSettings()\n {\n return $this->get('settings');\n }", "public function get_settings() {\n\t\treturn ITSEC_Modules::get_settings( $this->id );\n\t}", "public static function getAll()\n {\n return self::$settings;\n }", "public function get_settings(){\n return $this->_rpc->get_settings($this->_index_uid);\n }", "public function getSettings()\t{\n\t\t\treturn $this->m_settings;\n\t\t}", "function get_settings() {\r\n $user_settings = user_settings::retrieve_user_settings($this->id);\r\n return $user_settings;\r\n }", "public function getSettings()\n\t{\n\t}", "public function getSettingsSubForm() { }", "public function get_settings_sections() {\n\t\treturn tml_redirection_admin_get_settings_sections();\n\t}", "public function getAllSettings() {\n\t\ttry {\n\t\t\t\n\t\t\t$data = $this->invoke('getAllSettings', array());\n\t\t\t$results = array();\n\t\t\tforeach ($data as $settingsObj) {\n\t\t\t\tarray_push($results, VCDSoapTools::GetSettingsObj($settingsObj));\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn $results;\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}", "function &getSettings() {\n\t\t$conferenceSettingsDao =& DAORegistry::getDAO('ConferenceSettingsDAO');\n\t\t$settings =& $conferenceSettingsDao->getConferenceSettings($this->getId());\n\t\treturn $settings;\n\t}", "public function getSettings()\n {\n return $this->get(self::API_BASE_URL . '/ss3/subscriptions/' . $this->subscription->sid . '/settings/normal?forceUpdate=true');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Listen to the Category updated event.
public function updated(Category $Category) { //code... }
[ "public function track_product_category_updated($category_id)\n {\n }", "protected function emitCategoryUpdated(\\Lelesys\\Plugin\\News\\Domain\\Model\\Category $category) {\n\n\t}", "protected function categoryChanged() {\n if ( $url_tag_id = $this->get('url_tag_id') ) {\n // Update category_id on site url_tag record\n $url_tag = new UrlTag($this->container, $url_tag_id);\n $url_tag->update(['category_id'=>$this->get('category_id')]);\n }\n $cs = new CategorySite($this->container);\n $cs->findOrCreate(['site_id'=>$this->id(), 'category_id'=>$this->get('category_id')]);\n }", "public function whenSongCategoryChanged(SongCategoryChanged $event)\n {\n $song = $event->song;\n $newCategory = $song->category->name;\n $followers = $song->getFollowers();\n\n $notification = 'This song has been moved to \"' . $newCategory . '\"';\n\n foreach ($followers as $follower) {\n $user = $this->user->byId($follower->user->id);\n $this->mailer->sendSongActivityTo($user, $song, $notification);\n }\n }", "public function updated(Category $category)\n {\n //\n }", "public function updateCategory()\n {\n $categoryXml = $this->getXmlCategory($this->_category->getId());\n $categoryXml->getElementsByTagName('parent_id')->item(0)->nodeValue = $this->_category->getParentId();\n $categoryXml->getElementsByTagName('name')->item(0)->nodeValue = $this->_category->getName();\n $categoryXml->getElementsByTagName('url')->item(0)->nodeValue = $this->_category->getUrl();\n }", "private function update() {\n // Update data\n if ($this->categories->update()) {\n redirect('categories');\n } else {\n show_error('Have problem updating category');\n }\n }", "public function updateCategory()\n {\n\n /** Hook point */\n $this->hooks->call_hook('templates_updateCategory_pre');\n\n if ($this->input->post('catname') && $this->input->post('catid'))\n {\n $this->MTemplates->updateCategory($this->input->post('catname'), $this->input->post('catid'));\n\n /** Hook point */\n $this->hooks->call_hook('templates_updateCategory_success');\n\n $this->data['return']['responseCode'] = 1;\n $this->data['return']['responseHTML'] = $this->lang->line('templates_updateCategory_success');\n\n }\n else\n {\n /** Hook point */\n $this->hooks->call_hook('templates_uupdateCategory_error_missingdata');\n\n $this->data['return']['responseCode'] = 0;\n $this->data['return']['responseHTML'] = $this->lang->line('templates_updateCategory_error1');\n\n }\n\n /** Hook point */\n $this->hooks->call_hook('templates_updateCategory_post');\n\n die(json_encode($this->data['return']));\n\n }", "public function updated(QuestionCategory $questionCategory)\n {\n parent::saveHistory($questionCategory,'Update','Cập nhật ngân hàng câu hỏi');\n }", "public function updateCategory(Category $category)\n {\n }", "protected function setupCategoryEvents()\n {\n $category_taxonomy = get_taxonomy('category');\n\n $this->event_list['category'] = [\n 'title' => 'Category Events',\n 'group' => 'category',\n 'object' => 'category',\n 'description' => alm__('Responsible for logging all category related activities.'),\n 'object_id_label' => 'Category ID',\n\n 'events' => [\n /**\n * Fires when media is attached or detached from a post.\n * \n * @see wp_media_attach_action()\n */\n 'alm_insert_category' => [\n 'title' => 'Category created',\n 'action' => 'category_created',\n 'event_id' => 5701,\n 'severity' => 'notice',\n\n 'screen' => ['admin', 'network'],\n 'user_state' => 'logged_in',\n 'logged_in_user_caps' => ['edit_post'],\n\n 'message' => [\n '_main' => 'Created a new category (%s)',\n\n '_space_start' => '',\n 'category_id' => ['object_id'],\n 'category_name' => ['category_name'],\n 'category_slug' => ['category_slug'],\n 'category_parent' => ['category_parent'],\n 'category_alias_of' => ['category_alias_of'],\n 'taxonomy' => ['taxonomy'],\n 'description' => ['description'],\n '_space_end' => '',\n ],\n\n 'event_handler' => [\n 'num_args' => 2,\n ],\n ],\n ]\n ];\n }", "protected function registerCategoryEvents()\n {\n /**\n * Fires after a new term is created for a specific taxonomy.\n */\n add_action('create_category', function($term_id, $tt_id) {\n do_action('alm_insert_category', $term_id, $tt_id);\n }, 10, 2);\n }", "public function onCategoryDelete($event)\n {\n dispatch(new UpdateCache($event->category, true));\n }", "public function track_product_category_created($category_id)\n {\n }", "private function updateCategory($xmlCategory, Category $category)\n {\n $xmlName = $xmlCategory->getAttribute('name');\n $dbName = $category->getName();\n $xmlModificationDate = $xmlCategory->getAttribute('update_date');\n $dbModificationDate = $category->getModificationDate()->getTimestamp();\n if ($xmlName != $dbName) {\n if ($xmlModificationDate > $dbModificationDate) {\n $this->forumManager->editCategory($category, $dbName, $xmlName);\n // Update of the Dates\n $this->updateDate($category, $xmlCategory);\n }\n }\n }", "public function updated(ProductCategory $productCategory)\n {\n //\n }", "private function update_categories() {\n\t\t\t$categories = get_categories();\n\t\t\tforeach ( $categories as $category ) {\n\t\t\t\t$this->connection->hmSet(\n\t\t\t\t\t'category:' . $category->term_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'term_id' => $category->term_id,\n\t\t\t\t\t\t'name' => $category->name,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function updated(PageCategory $pageCategory)\n {\n //\n }", "public function modifyCategory()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('UPDATE Categories SET Name=:Name, Description=:Description, imgURL=:imgURL WHERE classID=:classID');\n $query->bindValue(':classID', $this->classID, PDO::PARAM_STR);\n $query->bindValue(':Name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':Description', $this->description, PDO::PARAM_STR);\n $query->bindValue(':imgURL', $this->imgURL, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fucntion to return dns packet(s)
public function pack_dns_packet() { $this->dns_packet = chr(0).chr(1). chr(1).chr(0). chr(0).chr(1). chr(0).chr(0). chr(0).chr(0). chr(0).chr(0). $this->QNAME. chr(0).chr(15). chr(0).chr(1); }
[ "private function dns_get_record($address)\n {\n $output = $dns = array();\n $retval = false;\n if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')\n {\n @exec('nslookup -type A '.$address, $output, $retval);\n if (!$retval and array_key_exists(1, $output))\n {\n $output[0] = $output[1];\n }\n }\n else\n {\n @exec('host '.$address, $output, $retval);\n }\n\n if (!$retval and array_key_exists(0, $output))\n {\n $explode = explode(' ', $output[0]);\n $result = $explode[count($explode)-1];\n if (filter_var($result, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))\n {\n $dns[0]['ip'] = $result;\n }\n unset($explode, $result);\n }\n \n return $dns;\n }", "protected function getDnsZoneRecords()\n {\n return '{\"page\": 1, \"total_pages\": 1, \"total_results\": 15, \"records\": [\n {\"id\": \"dnsrecord_1\", \"type\": \"NS\", \"ttl_sec\": 0, \"target\": \"\", \"name\": \"ns1.linode.com\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_2\", \"type\": \"NS\", \"ttl_sec\": 0, \"target\": \"\", \"name\": \"ns2.linode.com\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_3\", \"type\": \"NS\", \"ttl_sec\": 0, \"target\": \"admin\", \"name\": \"ns3.linode.com\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_4\", \"type\": \"A\", \"ttl_sec\": 0, \"target\": \"192.168.0.1\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_5\", \"type\": \"A\", \"ttl_sec\": 0, \"target\": \"192.168.0.1\", \"name\": \"*\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_6\", \"type\": \"AAAA\", \"ttl_sec\": 0, \"target\": \"0:0:0:0:0:ffff:c0a8:1\", \"name\": \"admin\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_7\", \"type\": \"CNAME\", \"ttl_sec\": 0, \"target\": \"ghs.google.com\", \"name\": \"mail\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_8\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"aspmx.l.google.com\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 1, \"service\": null}, \n {\"id\": \"dnsrecord_9\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"aspmx2.l.google.com\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 10, \"service\": null}, \n {\"id\": \"dnsrecord_10\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"aspmx3.l.google.com\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 10, \"service\": null}, \n {\"id\": \"dnsrecord_11\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"alt1.aspmx.l.google.com\", \"name\": \"admin\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 5, \"service\": null}, \n {\"id\": \"dnsrecord_12\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"alt2.aspmx.l.google.com\", \"name\": \"admin\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 5, \"service\": null}, \n {\"id\": \"dnsrecord_13\", \"type\": \"TXT\", \"ttl_sec\": 0, \"target\": \"v=spf1 ip4:192.168.0.1 include:_spf.google.com ~all\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_14\", \"type\": \"TXT\", \"ttl_sec\": 0, \"target\": \"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDfl0chtL4siFYCrSPxw43fqc4zOo3N+Il220oK2Cp+NZw9Kuvg8iu2Ua3zfbUnZWvWK4aEeooliRd7SXIhKpXkgkwnAB3DGAQ6+/7UVXf9xOeupr1DqtNwKt/NngC7ZIZyNRPx1HWKleP13UXCD8macUEbbcBhthrnETKoCg8wOwIDAQAB;\", \"name\": \"google._domainkey\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_15\", \"type\": \"SRV\", \"ttl_sec\": 0, \"target\": \"admin\", \"name\": \"_sip._tcp\", \"protocol\": \"_tcp\", \"weight\": 0, \"port\": 80, \"priority\": 10, \"service\": \"_sip\"}]}';\n }", "private function _parseDnsResponse($data)\n {\n $p = 0;\n $offset = array();\n $header = array();\n $rsize = strlen($data);\n\n if ($rsize < 12) {\n throw new \\Exception('DNS lookup failed. Response is less than 12 octets');\n }\n\n // read back transaction ID\n $id = unpack('n', substr($data, $p, 2));\n $p += 2;\n $header['ID'] = $id[1];\n\n // read query flags\n $flags = unpack('n', substr($data, $p, 2));\n $flags = $flags[1];\n $p += 2;\n\n // read flag bits\n $header['QR'] = ($flags >> 15);\n $header['Opcode'] = ($flags >> 11) & 0x0f;\n $header['AA'] = ($flags >> 10) & 1;\n $header['TC'] = ($flags >> 9) & 1;\n $header['RD'] = ($flags >> 8) & 1;\n $header['RA'] = ($flags >> 7) & 1;\n $header['RCODE'] = ($flags & 0x0f);\n\n // read count fields\n $counts = unpack('n4', substr($data, $p, 8));\n $p += 8;\n\n $header['QDCOUNT'] = $counts[1];\n $header['ANCOUNT'] = $counts[2];\n $header['NSCOUNT'] = $counts[3];\n $header['ARCOUNT'] = $counts[4];\n\n $records = array();\n $records['questions'] = array();\n $records['answers'] = array();\n $records['authority'] = array();\n $records['additional'] = array();\n\n for ($i = 0; $i < $header['QDCOUNT']; ++$i) {\n $records['questions'][] = $this->_readDNSQuestion($data, $p);\n }\n\n for ($i = 0; $i < $header['ANCOUNT']; ++$i) {\n $records['answers'][] = $this->_readDNSRR($data, $p);\n }\n\n for ($i = 0; $i < $header['NSCOUNT']; ++$i) {\n $records['authority'][] = $this->_readDNSRR($data, $p);\n }\n\n for ($i = 0; $i < $header['ARCOUNT']; ++$i) {\n $records['additional'][] = $this->_readDNSRR($data, $p);\n }\n\n return array(\n 'header' => $header,\n 'questions' => $records['questions'],\n 'answers' => $records['answers'],\n 'authority' => $records['authority'],\n 'additional' => $records['additional'],\n );\n }", "function return_ns_ip($domain) {\n\tglobal $dns_ip_list_c;\n\tif (!@file_exists(\"/usr/bin/dig\")) return;\n\t$msg=array();\n\t//echo $domain.\"\\n\";\n\tfor ($i=0;$i<sizeof($dns_ip_list_c);$i++) {\n\t\t//echo sizeof($dns_ip_list_c[$i]).\"\\n\";\n\t\tfor ($j=0;$j<sizeof($dns_ip_list_c[$i]);$j++) {\n\t\t\t$nip=$dns_ip_list_c[$i][$j][1];\n\t\t\t//echo $nip.\"\\n\";\n\t\t\texec(\"dig @$nip +short +time=1 +tries=1 +retry=1 $domain\",$str,$re);\n\t\t\t//$msg[$nip]=$str[0];\n\t\t\t$msg[]=$str[0];\n\t\t\t$str=\"\";\n\t\t\t//print_r($str);\n\t\t\t//$msg[]=$\n\t\t\t//echo $dns_ip_list_c[$i][$j][1].\"\\n\";\n\t\t}\n\t}\n\t//print_r($msg);\n\treturn $msg;\n}", "function hostcontrol_GetDNS($params)\n{\n $api_client = new HostControlAPIClient(HostControlHelper::getApiUrl($params), $params['ApiKey']);\n $domainname = strtolower($params[\"sld\"] . \".\" . $params[\"tld\"]);\n\n try\n {\n $dns = $api_client->domain->getDNSRecords($domainname);\n }\n catch(HostControlAPIClientError $e)\n {\n HostControlHelper::debugLog($params, 'domain-get-dns-records', array($domainname), $e);\n return array('error' => $e->getMessage());\n }\n\n $dns_records = array();\n foreach($dns->records as $record)\n {\n /* Filter some DNS types */\n if(in_array($record->type, HostControlHelper::get_ignored_dns_types()))\n {\n continue;\n }\n\n $dns_records[] = array(\n \"hostname\" => $record->name,\n \"type\" => $record->type,\n \"address\" => $record->content,\n \"ttl\" => $record->ttl,\n \"priority\" => $record->prio,\n );\n }\n\n return $dns_records;\n}", "public function getRecord(): DnsRecord;", "function getDNS($host,$ns)\n{\n\t$string = '';\n\texec(\"dig @$ns +short $host 2>&1\", $output, $retval);\n\tif ($retval != 0)\n\t{\n\t\treturn \"ERROR_NO_RESULT\";\n\t}\n\telse\n\t{\n\t\t$x=0;\n\t\twhile ($x < (sizeof($output)))\n\t\t{\n\t\t\t$string.= $output[$x];\n\t\t\t$x++;\n\t\t}\n\t}\n\n\tif (empty($string))\n\t{\n\t\treturn \"ERROR_NO_RESULT\";\n\t}\n\telse if($string[strlen($string)-1] == '.')\n\t{\n\t\t$string = substr($string, 0, -1);\n\t}\n\n\treturn $string;\n}", "private static function getDnsResults( $ip_addr ) {\n\t\tglobal $wgHoneyPotKey;\n\n\t\t// reverse the IP address\n\t\t$reverse_array = explode( '.', $ip_addr );\n\t\tkrsort( $reverse_array );\n\t\t$reverse_ip_addr = implode( '.', $reverse_array );\n\n\t\t// honey_pot_record = key + '.' + reversed ip address + '.' + honey pot dnsbl\n\t\t$honey_pot_record = $wgHoneyPotKey . '.' . $reverse_ip_addr . '.' . self::HONEY_POT_DNSBL;\n\n\t\t//wfDebug( __METHOD__ . \": honey_pot_record: $honey_pot_record\\n\" );\n\t\t$result = dns_get_record( $honey_pot_record, DNS_A );\n\t\treturn $result;\n\t}", "abstract protected function construct_dns();", "function extra_info($rip, $dnsbl){\n $details = array();\n\n logme(\"checking against $dnsbl\");\n\n $host = $rip.\".\".$dnsbl;\n\t$txtrecords = dns_get_record($host, DNS_TXT);\n logme(\"Details:\");\n foreach($txtrecords as $txtrecord){\n $details[] = $txtrecord['txt'];\n }\n\treturn $details;\n}", "function dnsbllookup($ip){\n$listed = array();\n$dnsbl_lookup=array(\"dnsbl-1.uceprotect.net\",\"dnsbl-2.uceprotect.net\",\"dnsbl-3.uceprotect.net\",\"dnsbl.dronebl.org\",\"dnsbl.sorbs.net\",\"zen.spamhaus.org\"); // Add your preferred list of DNSBL's\nif($ip){\n$reverse_ip=implode(\".\",array_reverse(explode(\".\",$ip)));\nforeach($dnsbl_lookup as $host){\nif(checkdnsrr($reverse_ip.\".\".$host.\".\",\"A\")){\n$listed[] = array($reverse_ip, $host, true);\n}\n}\n}\nif(isset($listed)){\nreturn $listed;\n}else{\nreturn 'error';\n}\n}", "function dns_get_record ($hostname, $type = 'DNS_ANY', array &$authns = null, array &$addtl = null) {}", "function dnsbllookup($ip){\n$dnsbl_lookup=array(\n \"bl.suomispam.net\",\n \"dnsbl-1.uceprotect.net\",\n \"dnsbl-2.uceprotect.net\",\n \"dnsbl-3.uceprotect.net\",\n \"dnsbl.dronebl.org\",\n \"dnsbl.sorbs.net\",\n \"zen.spamhaus.org\"); // Add your preferred list of DNSBL's\n $listed = '';\nif($ip){\n$reverse_ip=implode(\".\",array_reverse(explode(\".\",$ip)));\nforeach($dnsbl_lookup as $host){\n \nif(checkdnsrr($reverse_ip.\".\".$host.\".\",\"A\")){\n$listed.=$reverse_ip.'.'.$host.' <font color=\"red\">Listed</font><br />';\n}\n}\n}\nif($listed){\necho $listed;\n}else{\necho '\"A\" record was not found';\n}\n}", "private function responseParser( $packet ) {\r\n $i = 12;\r\n $this->datagram = $packet;\r\n $this->labels = array();\r\n $header = $this->Header_processor( $packet );\r\n $res_info = array( \r\n \"Header\" => $header,\r\n \"Records\" => array()\r\n );\r\n if ( $header['RCODE'] == 0\r\n && ( $header['ANCOUNT'] > 0 || $header['ARCOUNT'] > 0 || $header['NSCOUNT'] > 0 ) ) {\r\n $res_info[\"Request\"] = $this->readQuestion( $i );\r\n $len = strlen( $packet );\r\n for ( ; $i < $len; $i += 10 ) {\r\n $domain = $this->GetLable( $i );\r\n $type = $this->bit8to16( substr( $packet, $i , 2 ) );\r\n $class = $this->bit8to16( substr( $packet, $i + 2 , 2 ) );\r\n $ttl = $this->bit16to32( substr( $packet, $i + 4 , 4 ) );\r\n $rdlength = $this->bit8to16( substr( $packet, $i + 8 , 2 ) );\r\n $rdata = substr( $packet, $i + 10, $rdlength );\r\n $record = array( \r\n \"Domain\" => implode( \".\", $domain ),\r\n \"Type\" => array_search( $type , $this->qtypes ),\r\n \"Class\" => array_search( $class, $this->qclass ),\r\n \"Ttl\" => $ttl,\r\n \"Record\" => $this->RData( $type, $i + 10, $i + 10 + $rdlength )\r\n );\r\n $i += strlen( $rdata );\r\n $res_info[\"Records\"][] = $record;\r\n }\r\n return $res_info;\r\n }else {\r\n $this->t_log[] = \"There might be a problum in the request data, or the server had\".\r\n \t\t\t\t \" responded with zero records as response.\";\r\n \t}\r\n \treturn false;\r\n\t}", "protected function rrGet(Net_DNS2_Packet &$packet)\n {\n if ($this->afi == '0x47') {\n\n //\n // build the aa field\n //\n $aa = unpack('A2x/A2y/A2z', $this->aa);\n\n //\n // build the id field\n //\n $id = unpack('A8a/A4b', $this->id);\n\n //\n $data = pack(\n 'CnCCCCnnnNnC', \n hexdec($this->afi), \n hexdec($this->idi),\n hexdec($this->dfi),\n hexdec($aa['x']),\n hexdec($aa['y']),\n hexdec($aa['z']),\n hexdec($this->rsvd),\n hexdec($this->rd),\n hexdec($this->area),\n hexdec($id['a']),\n hexdec($id['b']),\n hexdec($this->sel)\n );\n\n if (strlen($data) == 20) {\n \n $packet->offset += 20;\n return $data;\n }\n }\n\n return null;\n }", "public function getDnsInfo()\n {\n return $this->get(self::DNSINFO);\n }", "private function getDNSRecords()\n {\n $zone_id = $this->getZoneID();\n\n $url = $this->api_url . 'zones/' . $zone_id . '/dns_records/';\n $data = $this->curl($url, [], 'GET', $this->getHeaders(), true);\n\n $result = [];\n\n if (!isset($data['result'])) {\n return $result;\n }\n\n foreach ($data['result'] as $record) {\n if (!in_array($record['name'], $this->dns_records)) {\n continue;\n }\n\n $result[] = $record;\n }\n\n return $result;\n }", "public function getClusterDns();", "final public function get_dns()\n {\n try\n {\n return $this->dns;\n }\n catch (Exception $e)\n {\n throw $e;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the permission callback.
public function permission(Closure $callback) { $this->permission = $callback; }
[ "public function setPermission($value);", "public function setPermission($permission);", "public function setPermissionCallback($permissionCallback)\n {\n $this->permissionCallback = $permissionCallback;\n\n return $this;\n }", "public function setPermissionGranted();", "public function setPermissions()\n\t{\n\n\t}", "public function permission( $permission );", "public static function permissionSynced(\\Closure|string|array $callback): void\n {\n static::registerLaratrustEvent('permission.synced', $callback);\n }", "public function setCallback($callback);", "public function setAccessTestCallback($callback) {\n\t\t$this->accessCallback = $callback;\n\t}", "public static function set_permission(){\n if ( ! current_user_can( 'edit_users' ) ) {\n return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to perform this action.', 'my-text-domain' ), array( 'status' => 401 ) );\n }\n \n // This approach blocks the endpoint operation. You could alternatively do this by an un-blocking approach, by returning false here and changing the permissions check.\n return true;\n }", "public function set_permission(){\n if ( ! current_user_can( 'edit_users' ) ) {\n return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to perform this action.', 'my-text-domain' ), array( 'status' => 401 ) );\n }\n \n // This approach blocks the endpoint operation. You could alternatively do this by an un-blocking approach, by returning false here and changing the permissions check.\n return true;\n }", "public function setCallback($callback)\r\n {\r\n $this->callback = $callback;\r\n }", "public function setPermission($permission): void\n {\n $this->permission = $permission;\n }", "function setPermission( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get();\n $this->Permission = $value;\n }", "public function setCallback($callback)\n {\n $this->action_function = $callback;\n }", "public function attachPermission($permission);", "public function setPermissions($permissions)\n {\n }", "public function setAuthCallback(callable $callable)\n\t{\n\t\t$this->authCallback = $callable;\n\t}", "public function setCallback(array $callback);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'liip_imagine.filter.loader.crop' shared service.
protected function getLiipImagine_Filter_Loader_CropService() { return $this->services['liip_imagine.filter.loader.crop'] = new \Liip\ImagineBundle\Imagine\Filter\Loader\CropFilterLoader(); }
[ "protected function getLiipImagine_Filter_Loader_StripService()\n {\n return $this->services['liip_imagine.filter.loader.strip'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\StripFilterLoader();\n }", "protected function getLiipImagine_Filter_Loader_PasteService()\n {\n return $this->services['liip_imagine.filter.loader.paste'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\PasteFilterLoader(${($_ = isset($this->services['liip_imagine']) ? $this->services['liip_imagine'] : $this->get('liip_imagine')) && false ?: '_'}, ($this->targetDirs[3].'\\\\app'));\n }", "protected function getLiipImagine_Filter_Loader_RelativeResizeService()\n {\n return $this->services['liip_imagine.filter.loader.relative_resize'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\RelativeResizeFilterLoader();\n }", "protected function getLiipImagine_Filter_Loader_ResizeService()\n {\n return $this->services['liip_imagine.filter.loader.resize'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\ResizeFilterLoader();\n }", "protected function getLiipImagine_Filter_Loader_InterlaceService()\n {\n return $this->services['liip_imagine.filter.loader.interlace'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\InterlaceFilterLoader();\n }", "protected function getLiipImagine_Filter_Loader_BackgroundService()\n {\n return $this->services['liip_imagine.filter.loader.background'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\BackgroundFilterLoader($this->get('liip_imagine'));\n }", "protected function getLiipImagine_Filter_Loader_ResampleService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/liip/imagine-bundle/Imagine/Filter/Loader/LoaderInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/liip/imagine-bundle/Imagine/Filter/Loader/ResampleFilterLoader.php';\n\n return $this->services['liip_imagine.filter.loader.resample'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\ResampleFilterLoader(($this->privates['liip_imagine.gd'] ?? $this->getLiipImagine_GdService()));\n }", "protected function getLiipImagine_Filter_Loader_ResampleService()\n {\n return $this->services['liip_imagine.filter.loader.resample'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\ResampleFilterLoader(${($_ = isset($this->services['liip_imagine']) ? $this->services['liip_imagine'] : $this->get('liip_imagine')) && false ?: '_'});\n }", "protected function getLiipImagine_Filter_Loader_ThumbnailService()\n {\n return $this->services['liip_imagine.filter.loader.thumbnail'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\ThumbnailFilterLoader();\n }", "final public function getCropperClass()\r\n {\r\n $cropClass = strtolower($this->getCropper());\r\n $fileName = SLIRConfig::$pathToSLIR . \"/core/libs/gd/croppers/$cropClass.class.php\";\r\n $class = 'SLIRCropper' . ucfirst($cropClass);\r\n\r\n if (!file_exists($fileName)) {\r\n throw new RuntimeException('The requested cropper could not be found: ' . $fileName);\r\n }\r\n\r\n require_once $fileName;\r\n\r\n return new $class();\r\n }", "protected function getLiipImagine_Filter_Loader_WatermarkService()\n {\n return $this->services['liip_imagine.filter.loader.watermark'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\WatermarkFilterLoader(${($_ = isset($this->services['liip_imagine']) ? $this->services['liip_imagine'] : $this->get('liip_imagine')) && false ?: '_'}, ($this->targetDirs[3].'\\\\app'));\n }", "protected function getLiipImagine_Filter_Loader_WatermarkService()\n {\n return $this->services['liip_imagine.filter.loader.watermark'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\WatermarkFilterLoader($this->get('liip_imagine'), ($this->targetDirs[3].'\\\\app'));\n }", "protected function getLiipImagine_Filter_Loader_WatermarkService()\n {\n return $this->services['liip_imagine.filter.loader.watermark'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\WatermarkFilterLoader($this->get('liip_imagine'), ($this->targetDirs[3].'/app'));\n }", "protected function getLiipImagine_Filter_Loader_FlipService()\n {\n return $this->services['liip_imagine.filter.loader.flip'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\FlipFilterLoader();\n }", "protected function getLiipImagine_Filter_Loader_RotateService()\n {\n return $this->services['liip_imagine.filter.loader.rotate'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\RotateFilterLoader();\n }", "protected function getLiipImagine_Filter_ManagerService()\n {\n $this->services['liip_imagine.filter.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Filter\\FilterManager($this->get('liip_imagine.filter.configuration'));\n\n $instance->addLoader('relative_resize', $this->get('liip_imagine.filter.loader.relative_resize'));\n $instance->addLoader('resize', $this->get('liip_imagine.filter.loader.resize'));\n $instance->addLoader('thumbnail', $this->get('liip_imagine.filter.loader.thumbnail'));\n $instance->addLoader('crop', $this->get('liip_imagine.filter.loader.crop'));\n $instance->addLoader('paste', $this->get('liip_imagine.filter.loader.paste'));\n $instance->addLoader('watermark', $this->get('liip_imagine.filter.loader.watermark'));\n $instance->addLoader('background', $this->get('liip_imagine.filter.loader.background'));\n $instance->addLoader('strip', $this->get('liip_imagine.filter.loader.strip'));\n $instance->addLoader('upscale', $this->get('liip_imagine.filter.loader.upscale'));\n $instance->addLoader('auto_rotate', $this->get('liip_imagine.filter.loader.auto_rotate'));\n\n return $instance;\n }", "protected function getLiipImagine_Filter_ManagerService()\n {\n $this->services['liip_imagine.filter.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Filter\\FilterManager($this->get('liip_imagine.filter.configuration'));\n\n $instance->addLoader('relative_resize', $this->get('liip_imagine.filter.loader.relative_resize'));\n $instance->addLoader('resize', $this->get('liip_imagine.filter.loader.resize'));\n $instance->addLoader('thumbnail', $this->get('liip_imagine.filter.loader.thumbnail'));\n $instance->addLoader('crop', $this->get('liip_imagine.filter.loader.crop'));\n $instance->addLoader('paste', $this->get('liip_imagine.filter.loader.paste'));\n $instance->addLoader('watermark', $this->get('liip_imagine.filter.loader.watermark'));\n $instance->addLoader('background', $this->get('liip_imagine.filter.loader.background'));\n $instance->addLoader('strip', $this->get('liip_imagine.filter.loader.strip'));\n $instance->addLoader('upscale', $this->get('liip_imagine.filter.loader.upscale'));\n\n return $instance;\n }", "protected function getLiipImagine_Filter_ManagerService()\n {\n $this->services['liip_imagine.filter.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Filter\\FilterManager($this->get('liip_imagine.filter.configuration'), $this->get('liip_imagine'), $this->get('liip_imagine.binary.mime_type_guesser'));\n\n $instance->addLoader('relative_resize', $this->get('liip_imagine.filter.loader.relative_resize'));\n $instance->addLoader('resize', $this->get('liip_imagine.filter.loader.resize'));\n $instance->addLoader('thumbnail', $this->get('liip_imagine.filter.loader.thumbnail'));\n $instance->addLoader('crop', $this->get('liip_imagine.filter.loader.crop'));\n $instance->addLoader('grayscale', $this->get('liip_imagine.filter.loader.grayscale'));\n $instance->addLoader('paste', $this->get('liip_imagine.filter.loader.paste'));\n $instance->addLoader('watermark', $this->get('liip_imagine.filter.loader.watermark'));\n $instance->addLoader('background', $this->get('liip_imagine.filter.loader.background'));\n $instance->addLoader('strip', $this->get('liip_imagine.filter.loader.strip'));\n $instance->addLoader('scale', $this->get('liip_imagine.filter.loader.scale'));\n $instance->addLoader('upscale', $this->get('liip_imagine.filter.loader.upscale'));\n $instance->addLoader('downscale', $this->get('liip_imagine.filter.loader.downscale'));\n $instance->addLoader('auto_rotate', $this->get('liip_imagine.filter.loader.auto_rotate'));\n $instance->addLoader('rotate', $this->get('liip_imagine.filter.loader.rotate'));\n $instance->addLoader('flip', $this->get('liip_imagine.filter.loader.flip'));\n $instance->addLoader('interlace', $this->get('liip_imagine.filter.loader.interlace'));\n $instance->addPostProcessor('jpegoptim', $this->get('liip_imagine.filter.post_processor.jpegoptim'));\n $instance->addPostProcessor('optipng', $this->get('liip_imagine.filter.post_processor.optipng'));\n $instance->addPostProcessor('pngquant', $this->get('liip_imagine.filter.post_processor.pngquant'));\n $instance->addPostProcessor('mozjpeg', $this->get('liip_imagine.filter.post_processor.mozjpeg'));\n\n return $instance;\n }", "protected function getLiipImagine_Filter_Loader_AutoRotateService()\n {\n return $this->services['liip_imagine.filter.loader.auto_rotate'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\AutoRotateFilterLoader();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Output start menu array
function print_start_menu_array() { global $conf; print '<div class="tmenudiv">'; print '<ul role="navigation" class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>'; }
[ "protected function generateMenu() {}", "function drawMenu() {\n\n system(\"clear\");\n mainHeader();\n\n echo \"(1) import file\\n\";\n echo \"(2) drop word indexes\\n\";\n echo \"(3) create word index\\n\";\n echo \"(0) Exit!\\n\";\n echo \"----------------------------\\n\\n\";\n\n \n}", "public function createMainMenu() {\n $enabled = CONFIG::getSection('enabled');\n $menu = [];\n $menu['index']['module'] = 'index';\n $menu['index']['link'] = MODULE.'index';\n $menu['index']['name'] = __('Index');\n $menu['index']['desc'] = '';\n $menu['index']['class'] = 'index';\n $menu['index']['width'] = mb_strlen($menu['index']['name'], 'UTF-8') * 7 * 2;\n foreach (self::$modules as $module => $data) {\n if (in_array($module, self::$menu) && array_key_exists($module, $enabled)) {\n $obj = strtoupper($module);\n $point = [];\n $point[$module]['module'] = $module;\n $point[$module]['link'] = MODULE.$module;\n $point[$module]['name'] = SYSTEM::$modules[$module]['title'];\n $point[$module]['desc'] = '';\n $point[$module]['class'] = $module;\n if (class_exists($obj)) {\n $point[$module]['sections'] = CMS::call($obj)->getSections();\n unset($point[$module]['sections']['drafts']);\n $point[$module]['width'] = mb_strlen($point[$module]['name'], 'UTF-8') * 7 * 2;\n foreach ($point[$module]['sections'] as $id => $section) {\n $point[$module]['sections'][$id]['desc'] = CMS::call('PARSER')->parseText($section['desc']);\n if (!empty($section['categories'])) {\n foreach ($section['categories'] as $key => $category) {\n $point[$module]['sections'][$id]['categories'][$key]['desc'] = CMS::call('PARSER')->parseText($category['desc']);\n }\n }\n }\n }\n $menu = array_merge($menu, $point);\n if (!empty($point[$module]['name'])) {\n $menu[$module]['width'] = mb_strlen($menu[$module]['name'], 'UTF-8') * 7 * 2;\n if (!empty($point[$module]['sections'])) {\n foreach($point[$module]['sections'] as $id => $section) {\n $width = mb_strlen($section['title'], 'UTF-8') * 7 + 55;\n $menu[$module]['sections'][$id]['width'] = $width;\n if (!empty($section['categories'])) {\n foreach($section['categories'] as $key => $category) {\n $width = mb_strlen($category['title'], 'UTF-8') * 7 + 55;\n $menu[$module]['categories'][$id]['width'] = $width;\n }\n }\n }\n }\n }\n }\n }\n return file_put_contents(CONTENT.'menu', json_encode($menu, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), LOCK_EX);\n }", "private function printMenu() {\n\t\t$this->logo();\n\t\t$this->line(\"Please select the number of options below:\");\n\t\t$action = $this->choice('Main Menu', $this->menu);\n\t\t$this->processAction($action);\n\t}", "private function getMainMenu(): array\n {\n return $this->getMenu('main');\n }", "function modMenu() {\n\t\treturn array();\n\t}", "function generate_menu() {\n $msg = 'Success!';\n try {\n $menu = $this->Species->find_species_types_exps();\n file_put_contents(CACHE . 'menu.array', serialize($menu));\n } catch (Exception $ex) {\n $msg = $ex;\n }\n $this->Session->setFlash($msg);\n }", "function MyApp_Interface_LeftMenu()\n {\n return\n array\n (\n $this->Htmls_Comment_Section\n (\n \"Left Menu Start\",\n $this->Htmls_Tag\n (\n \"ASIDE\",\n array\n (\n $this->MyApp_Interface_LeftMenu_Top_Welcome(),\n $this->MyApp_Interface_LeftMenu_Top_Period(),\n $this->MyApp_Interface_LeftMenu_Top_UserInfo(),\n $this->MyApp_Interface_LeftMenu_Top_ReadOnlyMessage(),\n $this->MyApp_Interface_LeftMenu_Top_AdminInfo(),\n $this->MyApp_Interface_LeftMenu_Generate()\n ) \n )\n ),\n );\n }", "public function appendMenuItems()\n {\n }", "function beginSubMenu() {\n\t\treturn html_ao('ul', array('class' => 'submenu'));\n\t}", "function drawMenu($menus)\n{\n global $rootPath;\n $menuId = 0;\n $input = \"\";\n $index = 0;\n\n while ($input !== \"quit\") {\n write(\"\\e[H\\e[J\"); //clear screen\n writeLine(str_repeat(\"=\", 100));\n writeLine(\"TINA4 - MENU ({$rootPath})\");\n writeLine(str_repeat(\"=\", 100));\n\n if ($menuId !== 0) {\n $found = false;\n foreach ($menus as $mid => $menu) {\n if ($menuId === $menu[\"id\"]) {\n $prompt = call_user_func($menu[\"menuCode\"], $index, $input, null);\n $index = $prompt[\"index\"];\n if ($index === 0) {\n $menuId = 0;\n } else {\n $input = readLn($prompt[\"prompt\"]);\n $found = true;\n }\n }\n }\n if (!$found) {\n $menuId = 0;\n }\n } else {\n foreach ($menus as $id => $menu) {\n if (!isset($menu[\"show\"])) {\n $menu[\"show\"] = true;\n }\n if ($menu[\"show\"]) {\n writeLine(($menu[\"id\"]) . \".) \" . $menu[\"description\"]);\n }\n\n }\n $input = readLn(\"Choose menu option or type \\\"quit\\\" to Exit:\");\n $menuId = (int)$input;\n }\n }\n}", "private function _mainmenu_left_array() {\n $menu = array(\n /*\n * Contributors\n */\n array(\n 'url' => 'contributors',\n 'title' => 'Contributors',\n 'submenu' => array(\n array(\n 'url' => 'contributors/markers',\n 'title' => 'Markers',\n 'access' => 'allow_markers',\n ),\n array(\n 'url' => 'contributors/loops',\n 'title' => 'Loops',\n 'access' => 'allow_loops',\n ),\n ),\n ),\n /*\n * Administration\n */\n array(\n 'url' => 'administration',\n 'title' => 'Administration',\n 'access' => 'admin',\n 'submenu' => array(\n array(\n 'url' => 'administration/contributors',\n 'title' => 'Manage Contributors',\n 'access' => 'admin',\n ),\n array(\n 'url' => 'administration/hint_maps',\n 'title' => 'Hint Maps',\n 'access' => 'admin',\n ),\n array(\n 'url' => 'administration/auditlog',\n 'title' => 'Log',\n 'access' => 'admin',\n ),\n ),\n ),\n );\n\n return $menu;\n}", "function menuFlow() {\n\t\tincludeFile('templates/mainmenu');\n\t\techo PHP_EOL;\n\t}", "public function generate()\n {\n $NOconf = [];\n $splitCount = count($this->menuArr);\n if ($splitCount) {\n list($NOconf) = $this->procesItemStates($splitCount);\n }\n if (!empty($this->mconf['debugItemConf'])) {\n echo '<h3>$NOconf:</h3>';\n debug($NOconf);\n }\n $this->result = $NOconf;\n }", "function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> ucfirst($_GET[\"object\"]).\" main\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"Add\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=add\",\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}", "function display()\n {\n echo $this->menu;\n }", "public function breadcrumbMenuArrayAction()\n {\n $frameworkConfig = $this->configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK\n );\n $parentMenuObject = $frameworkConfig['parentMenuObject'];\n\n if ($this->requestIsActorDetailView()) {\n unset($parentMenuObject->mconf['CUR']);\n }\n\n return '';\n }", "private function getMenuArrayRender()\n {\n $this->load->model('Menu_Model', \"menuModel\");\n $this->menuModel->setControllerName($this->_controllerName);\n return $this->menuModel->getMenuArray();\n }", "protected function SingleRecordMenuArray() {\n\t$arActs = array(\n\t // (array $arData,$sLinkKey,$sGroupKey=NULL,$sDispOff=NULL,$sDispOn=NULL,$sDescr=NULL)\n\t new clsActionLink_option(array(),KS_ACTION_PKG_LINES_EDIT,NULL,'edit',NULL,'edit the package contents'),\n\t new clsActionLink_option(array(),KS_ACTION_PKG_LINES_ADD,NULL,'add',NULL,'add package lines'),\n\t new clsAction_section('action'),\n\t $oMnuSend = new clsActionLink_option(array(),'pack','do',NULL,NULL,'add items from stock'),\n\t $oMnuRecv = new clsActionLink_option(array(),'unpack','do',NULL,NULL,'return items to stock'),\n\t );\n\t\n\t// 2016-08-26 There should probably be a better way of doing this.\n\t$oPage = $this->PageObject();\n\t$oMnuSend->Page($oPage);\n\t$oMnuRecv->Page($oPage);\n\t\n\t$this->Option_DoFetch($oMnuSend->Selected());\n\t$this->Option_DoReplace($oMnuRecv->Selected());\n\treturn $arActs;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }