query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Checks if the array of resources can be moved to the resource $parent by the $token.
private function checkMove(ResourceNode $parent, $resources, TokenInterface $token) { $errors = array(); $rightsCreation = $this->repository ->findCreationRights($this->ut->getRoles($token), $parent); if (count($rightsCreation) == 0) { $errors[] = $this->translator ->trans( 'resource_creation_denied', array('%path%' => $parent->getPathForDisplay()), 'platform' ); } else { foreach ($resources as $resource) { if (!$this->canCreate($rightsCreation, $resource->getResourceType()->getName())) { $errors[] = $this->translator ->trans( 'resource_creation_wrong_type', array( '%path%' => $parent->getPathForDisplay(), '%type%' => $this->translator->trans( strtolower($resource->getResourceType()->getName()), array(), 'resource' ) ), 'platform' ); } $rights = $this->repository->findMaximumRights($this->ut->getRoles($token), $resource); if (!$rights['canCopy']) { $errors[] = $this->getRoleActionDeniedMessage('COPY', $resource->getPathForDisplay()); } if (!$rights['canDelete']) { $errors[] = $this->getRoleActionDeniedMessage('DELETE', $resource->getPathForDisplay()); } } } return $errors; }
[ "public function isMoveable(Page $page, Page $oldParent, Page $newParent, &$reason) {\n\t\t\n\t\tif($oldParent->id == $newParent->id) return true; \n\t\t\n\t\t$config = $this->wire('config');\n\t\t$moveable = false;\n\t\t$isSystem = $page->hasStatus(Page::statusSystem) || $page->hasStatus(Page::statusSystemID);\n\t\t$toTrash = $newParent->id > 0 && $newParent->isTrash();\n\t\t$wasTrash = $oldParent->id > 0 && $oldParent->isTrash();\n\t\t\n\t\t// page was moved\n\t\tif($page->template->noMove && ($isSystem || (!$toTrash && !$wasTrash))) {\n\t\t\t// make sure the page template allows moves.\n\t\t\t// only move always allowed is to the trash (or out of it), unless page has system status\n\t\t\t$reason = \n\t\t\t\tsprintf($this->_('Page using template “%s” is not moveable.'), $page->template->name) . ' ' . \n\t\t\t\t\"(Template::noMove) [{$oldParent->path} => {$newParent->path}]\";\n\n\t\t} else if($newParent->template->noChildren) {\n\t\t\t// check if new parent disallows children\n\t\t\t$reason = sprintf(\n\t\t\t\t$this->_('Chosen parent “%1$s” uses template “%2$s” that does not allow children.'), \n\t\t\t\t$newParent->path, \n\t\t\t\t$newParent->template->name\n\t\t\t);\n\n\t\t} else if($newParent->id && $newParent->id != $config->trashPageID && count($newParent->template->childTemplates)\n\t\t\t&& !in_array($page->template->id, $newParent->template->childTemplates)) {\n\t\t\t// make sure the new parent's template allows pages with this template\n\t\t\t$reason = sprintf(\n\t\t\t\t$this->_('Cannot move “%1$s” because template “%2$s” used by page “%3$s” does not allow children using template “%4$s”.'), \n\t\t\t\t$page->name, \n\t\t\t\t$newParent->template->name, \n\t\t\t\t$newParent->path,\n\t\t\t\t$page->template->name\n\t\t\t);\n\n\t\t} else if(count($page->template->parentTemplates) && $newParent->id != $config->trashPageID\n\t\t\t&& !in_array($newParent->template->id, $page->template->parentTemplates)) {\n\t\t\t// check for allowed parentTemplates setting\n\t\t\t$reason = sprintf(\n\t\t\t\t$this->_('Cannot move “%1$s” because template “%2$s” used by new parent “%3$s” is not allowed by moved page template “%4$s”.'),\n\t\t\t\t$page->name, \n\t\t\t\t$newParent->template->name, \n\t\t\t\t$newParent->path, \n\t\t\t\t$page->template->name\n\t\t\t);\n\n\t\t} else if(count($newParent->children(\"name=$page->name, id!=$page->id, include=all\"))) {\n\t\t\t// check for page name collision\n\t\t\t$reason = sprintf(\n\t\t\t\t$this->_('Chosen parent “%1$s” already has a page named “%2$s”.'),\n\t\t\t\t$newParent->path,\n\t\t\t\t$page->name\n\t\t\t);\n\t\t\t\n\t\t} else {\n\t\t\t$moveable = true;\n\t\t}\n\t\t\n\t\treturn $moveable;\n\t}", "function canMoveFrom()\n {\n if (!isset($this->Permissions['can_move_from'])) {\n $this->Permissions['can_move_from'] = $this->checkAccess('edit') && $this->checkAccess('remove');\n }\n\n return ($this->Permissions['can_move_from'] == 1);\n }", "function canMoveFrom()\n {\n\n if (!isset($this->Permissions['can_move_from'])) {\n $this->Permissions['can_move_from'] = $this->checkAccess('edit') && $this->checkAccess('remove');\n }\n\n return ($this->Permissions['can_move_from'] == 1);\n }", "function canMove()\n {\n return $this->canMoveFrom();\n }", "protected function routeContainsParent()\n {\n // get just the base url\n $route = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n // lets split it into pieces\n $parts = explode('/', $route);\n\n // if a resource has a parent, it should be in the form /dogs/1/puppies\n // so the parent resource should be 2 spots before the child resource\n $resourcePosition = array_search($this->config->getResource(), $parts);\n\n return isset($parts[$resourcePosition - 2]);\n }", "final protected function CanMove()\n {\n return BackendModule::Guard()->Allow(BackendAction::Move(), $this->content);\n }", "public function move() \n\t{\n\t\n\t\t//convert our object id into an array. this is an array of objects we are moving\n\t\tif (is_array($this->objectId)) $objectArr = $this->objectId;\n\t\telse $objectArr = array($this->objectId);\n\n\t\t//now get the parent id from the parent_path parameter\n\t\tif ($this->apidata[\"dest_parent_id\"]) $parent = $this->apidata[\"dest_parent_id\"];\n\t\telse \n\t\t{\n\n\t\t\t$info = $this->objectFromPath($this->apidata[\"dest_parent_path\"]);\n\n\t\t\tif (!$info) \n\t\t\t{\n\n\t\t\t\t$this->throwError(_I18N_OBJECT_MOVE_PARENTNOTFOUND_ERROR);\n\t\t\t\treturn false;\n\n\t\t\t} \n\t\t\telse $parent = $info[\"id\"];\n\n\t\t}\n\n\t\t//get where we are moving it from. this has to be specified because a file can\n\t\t//be in multiple locations\n\t\tif ($this->apidata[\"source_parent_id\"]) $source = $this->apidata[\"source_parent_id\"];\n\t\telse \n\t\t{\n\n\t\t\t$info = $this->objectFromPath($this->apidata[\"source_parent_path\"]);\n\n\t\t\tif (!$info) \n\t\t\t{\n\n\t\t\t\t$this->throwError(_I18N_OBJECT_MOVE_SOURCENOTPASSED_ERROR);\n\t\t\t\treturn false;\n\n\t\t\t} \n\t\t\telse $source = $info[\"id\"];\n\n\t\t}\n\n\n\t\t//if moving to the root collection, make sure they have permission to do that\n\t\tif ($parent==\"0\" && !PERM::check(CREATE_ROOT))\n\t\t{\n\t\t\t$this->throwError(_I18N_ROOTLEVEL_MOVE_ERROR);\n\t\t\treturn false;\n\t\t}\n\n\t\t//make sure we are not moving something to a category where an object with its name already exists\n\t\t//there may be a more efficient way to do this without so many queries to the db\n\t\tforeach ($objectArr AS $curObj) \n\t\t{\n\n\t\t\t$sql = \"SELECT name FROM docmgr.dm_object WHERE id='$curObj'\";\n\t\t\t$info = $this->DB->single($sql);\n\n\t\t\tif (!checkObjName(sanitize($info[\"name\"]),$parent)) \n\t\t\t{\n\n\t\t\t\tif ($this->apidata[\"exist_rename\"])\n\t\t\t\t{\n\t\t\t\t\t$this->existRename($info[\"name\"],$parent,$curObj);\n\t\t\t\t}\n\t\t\t\t//otherwise complain\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\t$this->throwError(\"\\\"\".$info[\"name\"].\"\\\" \"._I18N_OBJECT_EXISTS_ERROR);\n\t\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\n\t\n\t\t//make sure we are allow to edit anything in the destination folder, since we are \n\t\t//moving things there\n\t\t$cb = DOCMGR_UTIL_OBJPERM::getuser($parent);\n\t\tif (!$this->permCheck(\"edit\",$cb))\n\t\t{\n\t\t\t$this->throwError(_I18N_OBJECT_PERMMOVE_ERROR);\n\t\t\treturn false;\n\t\t}\n\n\t\t//start the move\n\t\t$this->DB->begin();\n\n\t\t//get the old parents for later\n\t\t$sql = \"SELECT object_id,parent_id,account_id FROM docmgr.dm_object_parent WHERE object_id IN (\".implode(\",\",$objectArr).\") AND parent_id='$source';\";\n\t\t$list = $this->DB->fetch($sql);\n\n\t\tfor ($i=0;$i<$list[\"count\"];$i++)\n\t\t{\n\t\t\n\t\t\t//if we own the link we are moving, no need to do a permissions check (this happens when sharing is used)\n\t\t\tif ($list[$i][\"account_id\"]!=USER_ID)\n\t\t\t{\n\t\t\t\n\t\t\t\t//make sure we have permissions to move this object\n\t\t\t\t$cb = DOCMGR_UTIL_OBJPERM::getUser($list[$i][\"object_id\"]);\n\t\t\t\tif (!DOCMGR_UTIL_OBJPERM::check($cb,\"admin\")) \n\t\t\t\t{\n\t\t\t\t\t$this->throwError(_I18N_OBJECT_PERMMOVE_ERROR);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t//delete from our source folder and add to the new one\n\t\t\t$sql = \"UPDATE docmgr.dm_object_parent SET parent_id='$parent' WHERE object_id='\".$list[$i][\"object_id\"].\"' AND parent_id='$source';\";\n\t\t\t$this->DB->query($sql);\n\n\t\t\t//log it\n\t\t\tlogEvent('OBJ_MOVED',$list[$i][\"object_id\"]);\n\n\t\t}\n\n\t\t//update collection sizes\n\t\t$this->updateCollectionSizes($objectArr);\n\t\t$this->updateCollectionSizes(array($source));\n\n\t\t$this->DB->end();\n\n\t\t$err = $this->DB->error();\n\t\tif ($err) $this->throwError($err);\n\t\n\t}", "public function checkInvalidParentMenuLinks() {\n $last_link = NULL;\n $created_links = [];\n\n // Get the max depth of the tree.\n $menu_link_tree = \\Drupal::service('menu.link_tree');\n $max_depth = $menu_link_tree->maxDepth();\n\n // Create a maximum number of menu links, each a child of the previous.\n for ($i = 0; $i <= $max_depth - 1; $i++) {\n $parent = $last_link ? 'tools:' . $last_link->getPluginId() : 'tools:';\n $title = 'title' . $i;\n $edit = [\n 'link[0][uri]' => '/',\n 'title[0][value]' => $title,\n 'menu_parent' => $parent,\n 'description[0][value]' => '',\n 'enabled[value]' => 1,\n 'expanded[value]' => FALSE,\n 'weight[0][value]' => '0',\n ];\n $this->drupalGet(\"admin/structure/menu/manage/{$this->menu->id()}/add\");\n $this->submitForm($edit, 'Save');\n $menu_links = \\Drupal::entityTypeManager()->getStorage('menu_link_content')->loadByProperties(['title' => $title]);\n $last_link = reset($menu_links);\n $created_links[] = 'tools:' . $last_link->getPluginId();\n }\n\n // The last link cannot be a parent in the new menu link form.\n $this->drupalGet('admin/structure/menu/manage/admin/add');\n $value = 'tools:' . $last_link->getPluginId();\n $this->assertSession()->optionNotExists('edit-menu-parent', $value);\n\n // All but the last link can be parents in the new menu link form.\n array_pop($created_links);\n foreach ($created_links as $key => $link) {\n $this->assertSession()->optionExists('edit-menu-parent', $link);\n }\n }", "function canMove() {\n\t\treturn ($GLOBALS['objUser']->hasAccess(11) && !$this->getLvl('protected',4) && $this->canOutlineUp());\n\t}", "private function validateRecursively(array $tokens, ?array $parent_token): bool {\n\t\tforeach ($tokens as $token) {\n\t\t\tswitch ($token['type']) {\n\t\t\t\tcase CExpressionParserResult::TOKEN_TYPE_MATH_FUNCTION:\n\t\t\t\t\tif (!$this->math_function_data->isKnownFunction($token['data']['function'])\n\t\t\t\t\t\t\t&& $this->hist_function_data->isKnownFunction($token['data']['function'])) {\n\t\t\t\t\t\t$this->setError(_s('incorrect usage of function \"%1$s\"', $token['data']['function']));\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$math_function_validator = new CMathFunctionValidator([\n\t\t\t\t\t\t'parameters' => $this->math_function_parameters\n\t\t\t\t\t]);\n\n\t\t\t\t\tif (!$math_function_validator->validate($token)) {\n\t\t\t\t\t\t$this->setError($math_function_validator->getError());\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($token['data']['parameters'] as $parameter) {\n\t\t\t\t\t\tif (!$this->validateRecursively($parameter['data']['tokens'], $token)) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CExpressionParserResult::TOKEN_TYPE_HIST_FUNCTION:\n\t\t\t\t\tif (!$this->hist_function_data->isKnownFunction($token['data']['function'])\n\t\t\t\t\t\t\t&& $this->math_function_data->isKnownFunction($token['data']['function'])) {\n\t\t\t\t\t\t$this->setError(_s('incorrect usage of function \"%1$s\"', $token['data']['function']));\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$options = [\n\t\t\t\t\t\t'parameters' => $this->hist_function_parameters,\n\t\t\t\t\t\t'calculated' => $this->options['calculated']\n\t\t\t\t\t];\n\n\t\t\t\t\tif ($this->options['calculated']) {\n\t\t\t\t\t\t$options['aggregating'] = CHistFunctionData::isAggregating($token['data']['function']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$hist_function_validator = new CHistFunctionValidator($options);\n\n\t\t\t\t\tif (!$hist_function_validator->validate($token)) {\n\t\t\t\t\t\t$this->setError($hist_function_validator->getError());\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($options['calculated'] && $options['aggregating']) {\n\t\t\t\t\t\tif ($parent_token === null\n\t\t\t\t\t\t\t\t|| $parent_token['type'] != CExpressionParserResult::TOKEN_TYPE_MATH_FUNCTION\n\t\t\t\t\t\t\t\t|| !$this->math_function_data->isAggregating($parent_token['data']['function'])\n\t\t\t\t\t\t\t\t|| count($parent_token['data']['parameters']) != 1) {\n\t\t\t\t\t\t\t$this->setError(_s('incorrect usage of function \"%1$s\"', $token['data']['function']));\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CExpressionParserResult::TOKEN_TYPE_EXPRESSION:\n\t\t\t\t\tif (!$this->validateRecursively($parameter['data']['tokens'], $parent_token)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function move($newPlace, $parent=false){\n global $DB, $Controller, $USER;\n $this->getMenuPos();\n if($this->ID===false || $newPlace < 0) return false;\n //if($Controller->menuEditor(EDIT)) {\n if($parent === false) $parent = $this->parent;\n if($parent == false) $parent = 0;\n elseif(is_numeric($parent) || is_string($parent)) $parent = $Controller->{(string)$parent};\n\n if(!is_object($parent) && $parent != 0) return false;\n if(is_object($parent)) {\n if (!($parent->may($USER, EDIT))) {\n // only move if user has edit permission on the parent\n return false;\n }\n $pid = $parent->ID;\n }\n else {\n if (!($Controller->menuEditor(EDIT))) {\n // menu root is off limits unless you have edit permissions on the menu editor\n return false;\n }\n $pid = 0;\n }\n $length = $DB->menu->count(array(\"parent\" => $pid));\n if($newPlace === 'last' || $newPlace > $length) $newPlace = $length;\n if(!is_numeric($newPlace)) return false;\n if($this->place == $newPlace && $this->parentID == $pid) return true;\n $oldParent = $this->parentID;\n $oldPlace = $this->place;\n $tonext = ( $oldParent == $pid\n && $this->place !== false\n && $newPlace == self::$PLACES[$this->ID] + 1);\n\n $DB->menu->update( array('!!place' => '(`menu`.`place`+1)'),\n array('place>'.($tonext?'':'=') => $newPlace, 'parent' => $pid),\n false, false);\n $a = $DB->menu->update( array( \"parent\" => $pid,\n \"place\" => $newPlace+$tonext),\n array('id' => $this->ID),\n true);\n if($oldPlace !== false) {\n $DB->menu->update( array('!!place' => '(`menu`.`place`-1)'),\n array('place>' => $oldPlace, 'parent' => $oldParent),\n false, false);\n }\n self::$PLACES[$this->ID] = $newPlace;\n self::$PARENTS[$this->ID] = $pid;\n return true;\n //}\n }", "protected function isNestedResource()\n {\n $parent_association = $this->requestContainer->getParentAssociation();\n \n if(empty($parent_association) || is_null($parent_association)) {\n\n return false;\n }\n\n return true;\n }", "public function hasChildActions() {}", "public function canMoveSomewhere(): bool\n {\n $moves = [\n ['x' => $this->pos['x'] - 1, 'y' => $this->pos['y'] - 1],\n ['x' => $this->pos['x'] - 1, 'y' => $this->pos['y']],\n ['x' => $this->pos['x'] - 1, 'y' => $this->pos['y'] + 1],\n ['x' => $this->pos['x'], 'y' => $this->pos['y'] + 1],\n ['x' => $this->pos['x'] + 1, 'y' => $this->pos['y'] + 1],\n ['x' => $this->pos['x'] + 1, 'y' => $this->pos['y']],\n ['x' => $this->pos['x'] + 1, 'y' => $this->pos['y'] - 1],\n ['x' => $this->pos['x'], 'y' => $this->pos['y'] - 1],\n ];\n\n return $this->canAnyByMoves($moves);\n }", "private function isCircularReference(GroupInterface $parent) {\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group */\n $group = $this->context->getObject()->getEntity();\n $group_tree = $group->isNew()\n ? []\n : $this->subgroupsManager->getGroupsChildren($group, 0);\n\n // Circular reference can only appear if parent we want to add is already\n // referenced as children of the group.\n return in_array($parent->id(), $group_tree);\n }", "protected function guardAgainstImpossibleMove(): void\n {\n if (!$this->node->exists) {\n throw new MoveNotPossibleException('A new node cannot be moved.');\n }\n\n if (array_search($this->position, ['child', 'left', 'right', 'root']) === false) {\n throw new MoveNotPossibleException(\"Position should be one of ['child', 'left', 'right'] but is {$this->position}.\");\n }\n\n if (!$this->promotingToRoot()) {\n if (is_null($this->target)) {\n if ($this->position === 'left' || $this->position === 'right') {\n throw new MoveNotPossibleException(\"Could not resolve target node. This node cannot move any further to the {$this->position}.\");\n }\n\n throw new MoveNotPossibleException('Could not resolve target node.');\n }\n\n if ($this->node->equals($this->target)) {\n throw new MoveNotPossibleException('A node cannot be moved to itself.');\n }\n\n if ($this->target->insideSubtree($this->node)) {\n throw new MoveNotPossibleException('A node cannot be moved to a descendant of itself (inside moved tree).');\n }\n\n if (!$this->node->inSameScope($this->target)) {\n throw new MoveNotPossibleException('A node cannot be moved to a different scope.');\n }\n }\n }", "private function checkUpdateACL()\n {\n if (is_null($this->parentTemplates)) {\n $this->loadParentTemplates();\n }\n\n if (!$this->admin) {\n $db = \\CentreonDBInstance::getConfInstance();\n $query = \"SELECT update_acl \"\n . \"FROM session \"\n . \"WHERE update_acl = '1' \"\n . \"AND user_id IN (\" . join(', ', $this->parentTemplates) . \") \";\n $result = $db->query($query);\n if ($result->rowCount()) {\n $db->query(\n \"UPDATE session SET update_acl = '0' \" .\n \"WHERE user_id IN (\" . join(', ', $this->parentTemplates) . \")\"\n );\n $this->resetACL();\n }\n }\n }", "protected function validateParentMenuItem() {\r\n\t\tif(!empty($this->parentMenuItem)) {\r\n\t\t\t$found = false;\r\n\t\t\tforeach($this->parentMenuItems as $parent => $value) {\r\n\t\t\t\tif(isset($value[$this->parentMenuItem]) || $parent == $this->parentMenuItem) {\r\n\t\t\t\t\t$found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!$found) $this->parentMenuItem = '';\r\n\t\t}\r\n\t}", "final public function allowsParent() {\n\t\treturn true;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether user has been promoted after having given enough valid responses.
public static function promoted($threshold = null) { // Promotion has been disabled if (static::$config['promote'] === false)return false; // Use the config threshold if ($threshold===null) { $threshold = static::$config['promote']; } // Compare the valid response count to the threshold return (static::valid_count()>=$threshold); }
[ "public function promoted($threshold = NULL) {\n\t\t// Promotion has been disabled\n\t\tif (self::$config ['promote'] === FALSE)\n\t\t\treturn FALSE;\n\t\t\t\n\t\t// Use the config threshold\n\t\tif ($threshold === NULL) {\n\t\t\t$threshold = self::$config ['promote'];\n\t\t}\n\t\t\n\t\t// Compare the valid response count to the threshold\n\t\treturn ($this->valid_count () >= $threshold);\n\t}", "public function isCurrentlyBeingPromoted()\n {\n return $this->currentPromotions->count();\n }", "private function check_decision() {\n $percent = $this->checkpercent();\n\n //3rd has the boolean which checks if everyone has voted\n if ($percent[3]) {\n if ($percent[0] > 50) {\n //Almost half the people have agreed, So lets add it permanently..\n $this->apply();\n } else if ($percent[1] > 50) {\n //More than half of the people have rejected it, So lets remove the suggestion\n $this->apply();\n } else if ($percent[2] > 50) {\n //More than half of the people don't know about it\n //So we have no choice lets approve this suggestion\n $this->apply();\n }\n }\n }", "public function isOnPromotion()\n {\n $status = false;\n\n if($this->getMaxPromotionPrice() > 0)\n {\n $status = true;\n }\n elseif(count($this->getRtShopPromotions()) > 0)\n {\n // Check if any product promotions are available\n foreach($this->getRtShopPromotions() as $rt_shop_promotion)\n {\n if($rt_shop_promotion->isAvailable())\n {\n $status = true;\n }\n }\n }\n\n return $status;\n }", "public function testItemsPromotedFlag()\n {\n $this->markTestSkipped('Enable Neo4j');\n $this->assertFalse($this->query(\n Query::createMatchAll()->byUser($this->genereateUser()),\n self::$appId,\n self::$index\n )->getFirstItem()->isPromoted()\n );\n\n $this->assertTrue($this->query(\n Query::createMatchAll()->byUser($this->genereateUser()),\n self::$appId,\n self::$index,\n $this->genereateMachineLearningPluginToken()\n )->getFirstItem()->isPromoted()\n );\n }", "public function promote(User $user, UserManagement $status, User $promoted_user)\n {\n return $user->getUserCurrentRole() == 'administrator' && $user->id != $promoted_user->id;\n }", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "private function hasEnoughPointsToBeWon()\n {\n return max([$this->player1->points, $this->player2->points]) >= 4;\n }", "public function isUpVotedBy($user)\n {\n if ($user instanceof Model)\n $user = $user->getKey();\n return $this->upVoters()->wherePivot(config('vote.user_foreign_key'), $user)->count() > 0;\n }", "public function hasReputation()\n {\n return !empty($this->reputation);\n }", "public function hasEnoughPointsToBeWon()\n {\n return max([$this->player1->points, $this->player2->points]) >= 4;\n }", "public function validPromotion() {\n\t\t\tif (is_array($this->promotions) && !empty($this->promotions)) return true;\n\t\t\telse return false;\n\t\t}", "function hasVoted() {\n\t\treturn $this->voteHandler->hasVoted();\n\t}", "private function hasEnoughNonGiveaways()\n {\n return $this->getCartNonGiveawayProductsAmounts() >= $this->getNonGiveawaysPerCart();\n }", "public static function check_plugin_review() {\n \n \tglobal $current_user;\n \t$user_id = $current_user->ID;\n\n\t\tif (!current_user_can('publish_posts')) {\n\t\t\treturn;\n\t\t}\n\n $show_review_notice = false;\n $activation_timestamp = get_site_option(self::ACTIVATE_TIMESTAMP_OPTION);\n $review_dismissal_array = get_user_meta($user_id, self::REVIEW_DISMISS_OPTION, true);\n $dismiss_defer_period = isset($review_dismissal_array['dismiss_defer_period']) ? $review_dismissal_array['dismiss_defer_period'] : 0;\n $dismiss_timestamp = isset($review_dismissal_array['dismiss_timestamp']) ? $review_dismissal_array['dismiss_timestamp'] : time();\n \n if ($dismiss_timestamp + $dismiss_defer_period <= time()) {\n $show_review_notice = true;\n }\n\n if (!$activation_timestamp) {\n $activation_timestamp = time();\n add_site_option(self::ACTIVATE_TIMESTAMP_OPTION, $activation_timestamp);\n }\n\n // display review message after a certain period of time after activation\n if ((time() - $activation_timestamp > self::REVIEW_FIRST_PERIOD) && $show_review_notice == true) {\n add_action('admin_notices', array('YARPP_Admin', 'display_review_notice'));\n }\n }", "function has_voted($user){\n\t\treturn in_array($user, get_voted_users()); \n\t}", "protected function has_valid_premium_subscription()\n {\n }", "private function checkIfUserCanVote() {\n $wrapper = entity_metadata_wrapper('user', $this->account);\n $points = $wrapper->field_reputation->value();\n\n if (!$this->account->uid) {\n throw new \\RestfulBadRequestException(\"Anonymous users can't vote. Please login.\");\n }\n\n if (user_access('can bypass vote limitation', $this->account)) {\n // This user can by pass the voting limitation.\n return;\n }\n\n if ($this->type == 'down' && variable_get('drupalhub_min_points_downvote', 20) >= $points) {\n // User under 20 points cannot vote against something.\n throw new \\RestfulBadRequestException(\"You need at lest 20 points for down voting.\");\n }\n\n if ($this->type == 'up' && variable_get('drupalhub_max_points_upvote', 5) >= $points) {\n // User with less than 5 points cannot vote for a question.\n throw new \\RestfulBadRequestException(\"You need at lest 5 points for up voting.\");\n }\n }", "public function hasMaxPlayerDeployedPokemon()\n {\n return $this->max_player_deployed_pokemon !== null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets value of 'iGoldGainAmount_W' property
public function setIGoldGainAmountW($value) { return $this->set(self::IGOLDGAINAMOUNT_W, $value); }
[ "public function setIGoldGainAmount($value)\n {\n return $this->set(self::IGOLDGAINAMOUNT, $value);\n }", "public function getGain()\n {\n return $this->gain;\n }", "public function setWage(?ShiftWage $wage): void\n {\n $this->wage = $wage;\n }", "public function setGold($gold);", "public function setPower()\n {\n $this->_role->power = 200;\n }", "public function setGold($gold) {\n\t\t$this->gold = $gold;\n\t}", "public function setWageSetting(WageSetting $wageSetting): void\n {\n $this->wageSetting = $wageSetting;\n }", "public function getMeterGain();", "function setWeightGoal($numDays, $weightChange)\n {\n //get current weight\n $weightSQL = \"SELECT USER_WEIGHT FROM USER_INFORMATION WHERE USER_FFLD_ID='$this->goalOwner'\";\n $result = mysqli_fetch_array($this->comMod->queryDatabase($weightSQL));\n $currentWeight = $result['USER_WEIGHT'];\n\n //set goal as long as weight exists\n if($currentWeight!=\"\")\n {\n //determine if weight gain or loss\n if($weightChange<1)\n {\n $flagGainLoss = -1;\n }//end if\n else\n {\n $flagGainLoss = 1;\n }//end else\n \n //calc new weight\n $newWeight = $currentWeight + $weightChange;\n \n //build SQL to insert goal into database\n $sql = \"INSERT INTO FITNESS_GOALS \t(FITNESS_GOAL_OWNER, FITNESS_GOAL_DURATION, FITNESS_GOAL_TYPE, FITNESS_GOAL_WEIGHT, FITNESS_GOAL_WEIGHT_CHANGE, FITNESS_GOAL_ACTIVE)\n VALUES \t\t\t\t\t ('$this->goalOwner', '$numDays', 'WEIGHT', '$newWeight', '$flagGainLoss', '1')\";\n\n //query database\n $this->comMod->queryDatabase($sql);\n }//end if\n }", "function Take_Gold($amount = 0) {\r\n\t\tglobal $character, $gameinstance;\r\n\t\tif(isset($amount) && is_numeric($amount) && $amount >= 0 && $amount <= $character['gold']) \r\n\t\t{\r\n\t\t\tdbn(__FILE__,__LINE__,\"update ${gameinstance}_characters set gold = gold - '$amount' where login_id = '$character[login_id]'\");\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tSystemMessage(CHAR_NOT_ENOUGH_GOLD);\r\n\t\t}\r\n\t}", "function buy_waste_water() {\n\t\t\n\t\t$bill = 0;\n\t\tforeach ($this->houses as $h) {\n\t\t\tif ($h->age < $h->max_age) $bill += $this->water_standing_charge;\n\t\t\t}\t\t\n\t\t$bill += $this->waste_variable_charge * $this->water_demand();\n\t\t$this->must_pay('waste_water_utility', $bill);\n\t\t$this->warn_player(\"paid \" . CURRSYM . \"$bill for waste water removal from houses\", \n\t\t\t$this->id, 2);\t\t\n\t}", "public function setPower()\n {\n $this->_role->power = 100;\n }", "function adjustPower(float $adjustmentValue) {\r\n $this->power += $adjustmentValue;\r\n $this->databaseUpToDate = false;\r\n }", "public function getGold()\n {\n return $this->Gold;\n }", "public function testSetAndGetWeight()\n {\n $value = 20;\n\n self::assertEquals(0, $this->fixture->getWeight());\n self::assertEquals($this->fixture, $this->fixture->setWeight($value));\n self::assertEquals($value, $this->fixture->getWeight());\n }", "public function setWeightUnit(?string $weightUnit): void\n {\n $this->weightUnit = $weightUnit;\n }", "function setW($w) {\n\t\t$this->w = $w;\n\t\treturn $this;\n\t}", "public function getGold() {\n\t\treturn $this->gold;\n\t}", "public function setGoldPay($value)\n {\n return $this->set(self::GOLD_PAY, $value);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the user info using a search on responsible entry
public function getUsersResponsibleInfoSearch($selectEntry, $searchTxt, $sortentry = "") { if ($sortentry == "responsible") { $sortentry = "resp_name"; } $sortIsResp = false; if ($sortentry == "is_responsible") { $sortentry = "id"; $sortIsResp = true; } $sql = "SELECT user.id AS id, user.login AS login, user.firstname AS firstname, user.name AS name, user.email AS email, user.tel AS tel, user.convention AS convention, user.date_convention AS date_convention, user.date_created AS date_created, user.date_last_login AS date_last_login, core_units.name AS unit, resp.name AS resp_name, resp.firstname AS resp_firstname, core_status.name AS status FROM core_users AS user INNER JOIN core_users AS resp ON user.id_responsible = resp.id INNER JOIN core_units ON user.id_unit = core_units.id INNER JOIN core_status ON user.id_status = core_status.id WHERE resp." . $selectEntry . " LIKE '%$searchTxt%'"; if ($sortentry != "") { $sql .= " ORDER BY " . $sortentry; } //echo "sql = " . $sql; $req = $this->runRequest($sql); $users = $req->fetchAll(); //echo "<p> count users = " . count($users) . "</p>"; $respModel = new CoreResponsible (); for ($i = 0; $i < count($users); $i ++) { $users [$i] ['is_responsible'] = $respModel->isResponsible($users [$i] ['id']); } if ($sortIsResp) { foreach ($users as $key => $row) { $isresp[$key] = $row['is_responsible']; } array_multisort($isresp, SORT_ASC, $users); } return $users; }
[ "function GetSearchUser() {\n\t\t$session = &GetSession();\n\t\t$switched_user = $session->Get('SwitchUser');\n\t\tif (!$switched_user) {\n\t\t\t$thisuser = $session->Get('UserDetails');\n\t\t\t$userid = $thisuser->userid;\n\t\t} else {\n\t\t\t$userid = $switched_user;\n\t\t}\n\t\t$this->SearchUserID = \"userid='\" . addslashes($userid) . \"'\";\n\t\treturn;\n\t}", "function fetch_info() {\n \n // Check if a fetch is necessary\n if($this->fetched_info_from_directory == true) return $this->search_status; \n \n // Perform error checking on directory and sunetid\n $this->check_before_query();\n \n // Get user info\n $user_info = $this->directory->get_user_info($this->sunetid);\n \n // Check the result\n if(sizeof($user_info) == 0) {\n // Set search status and return false\n $this->search_status = false;\n return false;\n }\n \n // Store user information\n if(is_array($user_info)) { \n \n // Set search status\n $this->search_status = true;\n \n // Parse the resultset\n $this->sunetid = $user_info[uid][0];\n $this->first_name = $user_info[sudisplaynamefirst][0];\n $this->last_name = $user_info[sudisplaynamelast][0];\n $this->middle_name = $user_info[sudisplaynamemiddle][0];\n $this->full_name = $user_info[displayname][0];\n $this->email = $user_info[mail][0];\n \n $this->home_phone = $user_info[homephone][0];\n $this->mobile_phone = $user_info[mobile][0];\n $this->pager_number = $user_info[pager][0];\n $this->work_phone = $user_info[telephonenumber][0];\n $this->pager_email = $user_info[suemailpager][0];\n \n $this->home_postal_address = $user_info[homepostaladdress][0];\n $this->work_postal_address = $user_info[postaladdress][0];\n $this->permanent_postal_address = $user_info[supermanentaddress][0];\n \n $this->job_title = $user_info[title][0];\n \n // Get affiliations\n if(isset($user_info[suaffiliation])) {\n $this->affiliations = $user_info[suaffiliation];\n unset($this->affiliations['count']);\n \n // Primary affiliation\n $primary_affiliation = $user_info[sugwaffilcode1][0];\n \n foreach($this->affiliations as $affiliation) {\n if(strpos($affiliation, \"nonactive\") !== false) continue;\n \n if(strpos($affiliation, \"stanford:staff\") !== false) {\n $this->is_staff = true;\n if($affiliation == $primary_affiliation) {$this->primary_affiliation = StanfordPerson::STAFF; }\n }\n \n if(strpos($affiliation, \"stanford:student\") !== false) {\n $this->is_student = true;\n if($affiliation == $primary_affiliation) {$this->primary_affiliation = StanfordPerson::STUDENT; }\n }\n \n if(strpos($affiliation, \"stanford:faculty\") !== false) {\n $this->is_faculty = true;\n if($affiliation == $primary_affiliation) {$this->primary_affiliation = StanfordPerson::FACULTY; }\n }\n \n if(strpos($affiliation, \"stanford:affiliate\") !== false) {\n $this->is_affiliate = true;\n if($affiliation == $primary_affiliation) {$this->primary_affiliation = StanfordPerson::AFFILIATE; }\n }\n }\n }\n }\n \n // Set flag to not search the directory again\n $this->fetched_info_from_directory = true;\n \n // Close the connection if necessary\n if($this->close_ldap_after_search == true) {\n $this->directory->disconnect();\n }\n \n return $this->search_status;\n }", "public function get_user_info();", "function find_users() {\n\t\tmain()->NO_GRAPHICS = true;\n\t\tif (!$_POST || !main()->USER_ID || IS_ADMIN != 1) {\n\t\t\techo '';\n\t\t}\n\t\t// Continue execution\n\t\t$Q = db()->query(\n\t\t\t\"SELECT id, nick \n\t\t\tFROM \".db('user').\" \n\t\t\tWHERE \"._es($_POST[\"search_field\"]).\" LIKE '\"._es($_POST[\"param\"]).\"%' \n\t\t\tLIMIT \".intval($this->USER_RESULTS_LIMIT));\n\t\twhile($A = db()->fetch_assoc($Q)) {\n\t\t\t$finded_users[$A['id']] = $A['nick'];\n\t\t}\n\t\techo $finded_users ? json_encode($finded_users) : '*';\n\t}", "public function fetch_user()\n {\n $this->seeInDatabase('users', ['first_name' => 'David',\n 'last_name' => 'Bishop']);\n }", "function searchUser($artist, $connection) {\r\t$results = $connection->get(\"users/search\", array(\"q\" => $artist, \"count\" => \"20\"));\r\t$verifiedFound = false;\r\tfor ($i = 0; $i < count($results); $i++) {\r\t\t$verified = $results[$i]->verified;\r\t\tif ($verified == 1) {\r\t\t\t$accountName = $results[$i]->name;\r\t\t\t$verifiedFound = true;\r\t\t\tbreak;\r\t\t}\r\t}\r\tif ($verifiedFound == true) {\r\t\tparseData($accountName, $connection, 0);\r\t} else {\r\t\t$output = \"<br>Failure<br>\";\r\t\techo $output;\r\t}\r}", "public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }", "function user_info($user,$fields=NULL){\n\t\tif ($user!=NULL){\n\t\t\tif ($this->_ad_username!=NULL){ $this->rebind(); } //bind as a another account if necessary\n\t\t\t\n\t\t\tif ($this->_bind){ //perform the search and grab all their details\n\t\t\t\t$filter=\"samaccountname=\".$user;\n\t\t\t\tif ($fields==NULL){ $fields=array(\"samaccountname\",\"mail\",\"displayname\"); }\n\t\t\t\t$sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);\n\t\t\t\t$entries = ldap_get_entries($this->_conn, $sr);\n\t\t\t\t\n\t\t\t\treturn $entries;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function searchUser($man, $username, $userID, $inputUname, $shouldVerify) {\n if ($shouldVerify && $username == $inputUname) {\n return [];\n }\n $encodedInput = preg_quote($inputUname);\n $filter = ['username' => ['$regex' => '^' . $encodedInput]];\n $query = new Query($filter, []);\n\n try {\n $docs = array();\n $cursor = $man->executeQuery(\"sandbox.users\", $query);\n foreach ($cursor as $doc) {\n if ($shouldVerify ? $doc->username != $username : true) {\n $foundUser = array(\n 'username' => $doc->username,\n 'name' => $doc->name,\n 'isFriend' => $userID == \"\" ? null : in_array($userID, $doc->friends)\n );\n if ($userID != \"\") {\n $foundUser['isRequested'] = count(getDocuments($man, \"requests\", ['$or' => array(['fromID' => (string) $doc->_id, 'to' => $userID], ['fromID' => $userID, 'to' => (string) $doc->_id])], [])) > 0;\n }\n if (isset($doc->GHUsername))\n $foundUser['ghUsername'] = $doc->GHUsername;\n $docs[] = $foundUser;\n }\n }\n return $docs;\n } catch (Exception $ex) {\n printf(\"Error: %s\\n\", $ex->getMessage());\n exit;\n }\n}", "function get_user_info($sunetid, $attributes=0) {\n // Connect if necessary\n if($this->is_connected() == false) $this->connect_and_bind();\n \n $result = $this->search(\"uid=$sunetid\", $attributes);\n \n if($result) {\n return $result[0];\n }\n else {\n return array();\n }\n }", "function view_by_user () {\n\t\t$_GET[\"id\"] = intval($_GET[\"id\"]);\n\t\tif (empty($_GET[\"id\"])) {\n\t\t\treturn _e(\"No user id!\");\n\t\t}\n\t\t$user_id = $_GET[\"id\"];\n\t\t// Try to get get user info\n\t\t$user_info = user($user_id);\n\t\tif (empty($user_info)) {\n\t\t\treturn _e(\"No such user!\");\n\t\t}\n\t\t// Do save filter\n\t\t$_REQUEST[\"user_id\"] = $user_id;\n\t\t$this->clear_filter(1);\n\t\t$this->save_filter(1);\n\t\t// Custom articles list(search) header\n\t\t$this->_custom_search_header = _display_name($user_info);\n\t\t// Display results\n\t\t$OBJ = $this->_load_sub_module(\"articles_search\");\n\t\treturn is_object($OBJ) ? $OBJ->_go(0) : \"\";\n\t}", "function searchOwner($ownerId){\n\t\tglobal $con;\n\t\t$userQuery = \"SELECT user_id,user_name FROM user_login_details\";\n\t\tif(!($userQuery_run = mysqli_query($con,$userQuery))) die(\"Could load book owners data\");\n\t\twhile ($userQuery_row = mysqli_fetch_assoc($userQuery_run)){\n\t\t\t$id = $userQuery_row['user_id'];\n\t\t\t$username = $userQuery_row['user_name'];\n\t\t\tif($id==$ownerId) return $username;\n\t\t}\n\t}", "private function getUserInfo(){\n $authenticationHeader = $this->request->getServer('HTTP_AUTHORIZATION');\n helper('jwt');\n $encodedToken = getJWTFromRequest($authenticationHeader);\n $key = Services::getSecretKey();\n $decodedToken = JWT::decode($encodedToken, $key, ['HS256']);\n return $this->service->findUserByEmailAddress($decodedToken->email);\n }", "public function ownerSearch()\n {\n if(isset($_GET['q']))\n {\n $search = $_GET['q'];\n $users = UserDetails::whereRaw(\"(first_name LIKE '%$search%' OR first_name LIKE '%$search%') AND is_active = 1 \")->get();\n $usersArray = array();\n foreach($users as $user)\n {\n $dataArray = array();\n $dataArray['id'] = $user->user_id;\n $dataArray['full_name'] = $user->first_name.' '.$user->last_name;\n $usersArray[] = $dataArray;\n }\n }\n else\n {\n $usersArray = array();\n }\n \n $ajaxArray = array();\n $ajaxArray['incomplete_results'] = false;\n $ajaxArray['items'] = $usersArray;\n return Response::json($ajaxArray);\n }", "function ldap_find_user_info ($login) {\n //error_log('Entering ldap_find_user_info('.$login.')',0);\n global $ldap_host, $ldap_port, $ldap_basedn, $ldap_rdn, $ldap_pass, $ldap_search_dn;\n // basic sequence with LDAP is connect, bind, search,\n // interpret search result, close connection\n\n //echo \"Connecting ...\";\n $ldap_connect = ldap_connect( $ldap_host, $ldap_port);\n ldap_set_version($ldap_connect);\n if ($ldap_connect) {\n //echo \" Connect to LDAP server successful \";\n //echo \"Binding ...\";\n $ldap_bind = false;\n $ldap_bind_res = ldap_handle_bind($ldap_connect,$ldap_bind);\n if ($ldap_bind_res) {\n //echo \" LDAP bind successful... \";\n //echo \" Searching for uid... \";\n // Search surname entry\n //OLD: $sr=ldap_search($ldapconnect,\"dc=rug, dc=ac, dc=be\", \"uid=$login\");\n //echo \"<p> ldapDc = '$LDAPbasedn' </p>\";\n if(!empty($ldap_search_dn)) {\n $sr=ldap_search($ldap_connect, $ldap_search_dn, \"uid=$login\");\n } else {\n $sr=ldap_search($ldap_connect, $ldap_basedn, \"uid=$login\");\n }\n //echo \" Search result is \".$sr;\n //echo \" Number of entries returned is \".ldap_count_entries($ldapconnect,$sr);\n //echo \" Getting entries ...\";\n $info = ldap_get_entries($ldap_connect, $sr);\n //echo \"Data for \".$info[\"count\"].\" items returned:<p>\";\n } else {\n //echo \"LDAP bind failed...\";\n }\n //echo \"Closing LDAP connection<hr>\";\n ldap_close($ldap_connect);\n } else {\n //echo \"<h3>Unable to connect to LDAP server</h3>\";\n }\n //DEBUG: $result[\"firstname\"] = \"Jan\"; $result[\"name\"] = \"De Test\"; $result[\"email\"] = \"email@ugent.be\";\n $result[\"firstname\"] = $info[0][\"cn\"][0];\n $result[\"name\"] = $info[0][\"sn\"][0];\n $result[\"email\"] = $info[0][\"mail\"][0];\n $tutor_field = api_get_setting('ldap_filled_tutor_field');\n $result[$tutor_field] = $info[0][$tutor_field]; //employeenumber by default\n\n return $result;\n}", "function get_user_info($p_user_id, $p_field)\n{\n global $g_mantis_user_table, $g_use_ldap_email, $g_login_method;\n if ((ON == $g_use_ldap_email) && (\"email\" == $p_field)) {\n # Find out what username belongs to the p_user_id and ask ldap\n return ldap_emailaddy(\"$p_user_id\");\n }\n\n $query = \"SELECT $p_field\n\t\t\t\tFROM $g_mantis_user_table\n\t\t\t\tWHERE id='$p_user_id'\";\n\n\n $result = db_query($query);\n return db_result($result, 0, 0);\n\n}", "private function _findUser()\n\t{\n\t\t$id = $this->_getParam('id');\n\t\t$username = $this->_getParam('username');\n\n\t\tif (!empty($id)) {\n\t\t\t$user = Doctrine_Core::getTable('Models_Main_Personnel')->findOneByID_number($id);\n\t\t} elseif (!empty($username)) {\n\t\t\t$user = Doctrine_Core::getTable('Models_Main_Personnel')->findOneByUsername($username);\n\t\t}\n\n\t\treturn $user;\n\t}", "function findUser($uid)\n {\n\n $info=array();\n $info['entity_table'] = USER_TBL;\n $info['fields']= array('username');\n $info['where'] = \"uid='$uid'\";\n $info['debug'] = false;\n\n $res=select($info);\n\n if(count($res))\n {\n foreach($res as $v)\n {\n $name=$v->username;\n break;\n }\n } //if count\n return $name;\n }", "public function searchUser()\n {\n $query = $this->prepareSearchUserQuery();\n $userSearchRes = $this->db->ExecuteSelectQueryAndFetchAll($query['sql'], $query['params']);\n\n $query = $this->prepareNumberOfRowsQuery();\n $res = $this->db->ExecuteSelectQueryAndFetchAll($query['sql'], $query['params']);\n\n\n if ($res && !empty($res)) {\n $this->numOfRows = $res[0]->rows;\n } else {\n $this->numOfRows = 0;\n $userSearchRes = null;\n }\n\n return $userSearchRes;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Action that updates the product list based on the Manufacturer
public function updateProductListAction() { //Remove form attributes that were not set. $formRawData = $this->getRequest()->getPost(); $formData = array(); foreach ($formRawData as $key => $value) { if ($value != '') { $formData[$key] = $value; } } $form = $this->getModel()->getForm('add'); $this->view->element = $form->updateHwProductIdElement($formData); }
[ "public function updating(Manufacturer $manufacturer, array $data);", "public function GetManufacturerInformationAction()\n {\n \t//recupere l'objet\n \t$object = mage::GetModel('Purchase/ProductManufacturer')\n \t\t\t\t->load($this->getRequest()->getParam('ppm_id'));\n \t\t\t\n \t//retourne en ajax\n \t$this->getResponse()->setHeader('Content-type', 'application/x-json');\n $this->getResponse()->setBody($object->toJson());\n }", "public function product_by_search() {\n $CI = & get_instance();\n $CI->load->model('manufacturers');\n $manufacturers_list = $CI->manufacturers->product_search_item($manufacturer_id);\n $i = 0;\n foreach ($manufacturers_list as $k => $v) {\n $i++;\n $manufacturers_list[$k]['sl'] = $i;\n }\n $data = array(\n 'title' => display('manage_manufacturer'),\n 'manufacturers_list' => $manufacturers_list\n );\n $manufacturerList = $CI->parser->parse('manufacturer/manufacturer', $data, true);\n return $manufacturerList;\n }", "public function byManufacturer();", "public function get_product_by_manufacturer(){\n\t\t$manufacturer_id = $this->input->post('manufacturer_id',true);\n\n\t\t$product_info_by_manufacturer = $this->db->select('a.*,b.*')\n\t\t\t\t\t\t\t\t\t\t\t->from('product_information a')\n\t\t\t\t\t\t\t\t\t\t\t->join('manufacturer_product b','a.product_id=b.product_id')\n\t\t\t\t\t\t\t\t\t\t\t->where('b.manufacturer_id',$manufacturer_id)\n\t\t\t\t\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t\t\t\t\t->result();\n\n\t\tif ($product_info_by_manufacturer) {\n\t\t\techo \"<select class=\\\"form-control\\\" id=\\\"manufacturer_id\\\" name=\\\"manufacturer_id\\\">\n\t <option value=\\\"\\\">\".display('select_one').\"</option>\";\n\t\t\tforeach ($product_info_by_manufacturer as $product) {\n\t\t\t\techo \"<option value='\".$product->product_id.\"'>\".$product->product_name.'-('.$product->product_model.')'.\" </option>\";\n\t\t\t}\n\t\t\techo \" </select>\";\n\t\t}\n\n\t}", "public function updateProduct()\n\t{\n\t}", "private function loadManufacturer()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = \"SELECT m.* \"\n\t\t\t. \"FROM `#__redshop_manufacturer` AS m \";\n\t\t$db->setQuery($query);\n\n\t\tif (!($manufacturers = $db->LoadObjectList()))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$i = 0;\n\n\t\tif (count($manufacturers) > 0)\n\t\t{\n\t\t\tfor ($e = 0; $e < count($manufacturers); $e++)\n\t\t\t{\n\t\t\t\t$row = $manufacturers[$e];\n\t\t\t\t$row = (array) $row;\n\t\t\t\t$fields = count($row);\n\n\t\t\t\tif ($i == 0)\n\t\t\t\t{\n\t\t\t\t\tforeach ($row as $id => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\techo $this->_text_qul . str_replace('\"', '\"\"', $id) . $this->_text_qul;\n\n\t\t\t\t\t\tif ($i < ($fields - 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo ',';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\n\t\t\t\t\techo ',' . $this->_text_qul . 'product_id' . $this->_text_qul;\n\t\t\t\t\techo \"\\r\\n\";\n\t\t\t\t}\n\n\t\t\t\t$i = 0;\n\t\t\t\t$query = \"SELECT p.product_id \"\n\t\t\t\t\t. \"FROM `#__redshop_product` AS p \"\n\t\t\t\t\t. \"WHERE p.manufacturer_id=\" . $manufacturers[$e]->manufacturer_id;\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$pids = $db->LoadResultArray();\n\t\t\t\t$pids = implode(\"|\", $pids);\n\n\t\t\t\tforeach ($row as $id => $value)\n\t\t\t\t{\n\t\t\t\t\techo $this->_text_qul . str_replace('\"', '\"\"', $value) . $this->_text_qul;\n\n\t\t\t\t\tif ($i < ($fields - 1))\n\t\t\t\t\t{\n\t\t\t\t\t\techo ',';\n\t\t\t\t\t}\n\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\n\t\t\t\techo ',' . $this->_text_qul . $pids . $this->_text_qul;\n\t\t\t\techo \"\\r\\n\";\n\t\t\t}\n\t\t}\n\t}", "public function listManufacturers() {\n\t\t$this->load->model ( 'catalog/manufacturer' );\n\t\t$this->load->model ( 'tool/image' );\n\t\t$json = array (\n\t\t\t\t'success' => true \n\t\t);\n\t\t\n\t\t$data ['start'] = 0;\n\t\t$data ['limit'] = 1000;\n\t\t\n\t\t$results = $this->model_catalog_manufacturer->getManufacturers ( $data );\n\t\t\n\t\t$manufacturers = array ();\n\t\t\n\t\tforeach ( $results as $manufacturer ) {\n\t\t\t$manufacturers [] = $this->getManufacturerInfo ( $manufacturer );\n\t\t}\n\t\t\n\t\tif (empty ( $manufacturers )) {\n\t\t\t$json ['success'] = false;\n\t\t\t$json ['error'] = \"No manufacturer found\";\n\t\t} else {\n\t\t\t$json ['data'] = $manufacturers;\n\t\t}\n\t\t\n\t\t$this->sendResponse ( $json );\n\t}", "public function searchForManufacturerAction ()\n {\n $results = [];\n $manufacturerId = $this->getParam('manufacturerId', false);\n if ($manufacturerId)\n {\n $manufacturer = ManufacturerMapper::getInstance()->find($manufacturerId);\n if ($manufacturer instanceof ManufacturerModel)\n {\n $results = [\n \"id\" => $manufacturer->id,\n \"text\" => $manufacturer->fullname\n ];\n }\n }\n else\n {\n $searchTerm = $this->getParam('manufacturerName', false);\n\n\n if ($searchTerm !== false)\n {\n foreach (ManufacturerMapper::getInstance()->searchByName($searchTerm) as $manufacturer)\n {\n $results[] = [\n \"id\" => $manufacturer->id,\n \"text\" => $manufacturer->fullname\n ];\n }\n }\n }\n $this->sendJson($results);\n }", "public function storeManufacturer(array $data): void\n {\n }", "public function manufactureAction() {\n if($this->_getParam('id',false)) {\n $this->view->manufactures = $this->getManufactures()\n ->getManufactureDetails($this->_getParam('id'));\n } else {\n throw new Pas_Exception_Param($this->_missingParameter, 500);\n }\n }", "public function testUpdateSupplierProduct()\n {\n }", "function getManufacturerList()\n {\n $man_list = modApiFunc('Manufacturers',\n 'getManufacturerProductAttributeValues',\n false, true);\n\n $output = '';\n if (is_array($man_list) && !empty($man_list))\n foreach($man_list as $v)\n $output .= '<option value=\"' . $v['id'] . '\"' .\n ((@$this -> Filter['manufacturer'] == $v['id'])\n ? ' selected=\"selected\"' : '') . '>' .\n prepareHTMLDisplay($v['value']) . '</option>';\n\n return $output;\n }", "public function setManufacturer($manufacturer);", "protected function _initManufacturer()\n {\n $manufacturerModel = Mage::getSingleton('manufacturer/provider_manufacturer')\n ->getStoreManufacturerById(\n $this->_removeAdditionalParameters($this->getRequest()->getParam('key')),\n Mage::app()->getStore()->getId()\n );\n /* @var $manufacturerModel Powerbody_Manufacturer_Model_Manufacturer */\n Mage::register('current_manufacturer', $manufacturerModel);\n }", "private function product_list( ){\n\t\t$this->product_list->display_product_list( );\n\t}", "public function testUpdateProduct()\n {\n }", "protected function assignAll()\n\t{\n\t\tif (Configuration::get('PS_DISPLAY_SUPPLIERS'))\n\t\t{\n\t\t\t$data = Manufacturer::getManufacturers(true, $this->context->language->id, true, false, false, false);\n\t\t\t$nbProducts = count($data);\n\t\t\t$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));\n\t\t\t$this->p = abs((int)(Tools::getValue('p', 1)));\n\t\t\t$data = Manufacturer::getManufacturers(true, $this->context->language->id, true, $this->p, $this->n, false);\n\t\t\t$this->pagination($nbProducts);\n\n\t\t\tforeach ($data as &$item)\n\t\t\t\t$item['image'] = (!file_exists(_PS_MANU_IMG_DIR_.$item['id_manufacturer'].'-'.ImageType::getFormatedName('medium').'.jpg')) ? $this->context->language->iso_code.'-default' : $item['id_manufacturer'];\n\n\t\t\t$this->context->smarty->assign(array(\n\t\t\t\t'pages_nb' => ceil($nbProducts / (int)($this->n)),\n\t\t\t\t'nbManufacturers' => $nbProducts,\n\t\t\t\t'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),\n\t\t\t\t'manufacturers' => $data,\n\t\t\t\t'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),\n\t\t\t));\n\t\t}\n\t\telse\n\t\t\t$this->context->smarty->assign('nbManufacturers', 0);\n\t}", "public function manufacturers_list()\n\t{\n\n\t\t$cat_id = ee()->TMPL->fetch_param('cat_id');\n\n\t\t$variables = array();\n\n\t\t$query = ee()->db\n\t\t\t->select('field_id_19')\n\t\t\t->where('channel_id', 1)\n\t\t\t->where('field_id_19 !=', '')\n\t\t\t->like('field_id_3', '[' . $cat_id . ']', 'after')\n\t\t\t->distinct()\n\t\t\t->order_by('field_id_19', 'asc')\n\t\t\t->get('channel_data');\n\n\t\tforeach($query->result() as $row)\n\t\t{\n\t\t\t$variables[] = array(\n \t\t'manufacturer' => $row->field_id_19\n \t\t);\n\t\t\t\n\t\t}\n\n\t\tif(count($variables) < 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\t\n\n \treturn ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $variables);\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ / /Method Name: EditFormScript /Description: Edit Form Script / /
public static function EditFormScript($contextname) { $script = '<script type="text/javascript">'; $script .= '$(document).ready(function () {'; $script .= '$(\'#' . $contextname . 'EditForm\').validate();'; $script .= '$(\'#' . $contextname . 'EditForm\').keypress(function (e) {'; $script .= 'if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {'; $script .= 'SubmitCE(\'' . $contextname . '\');'; $script .= '}'; $script .= '});'; $script .= '$(\'#' . $contextname . 'EditForm\').submit(function (event) {'; $script .= 'event.preventDefault();'; $script .= 'SubmitCE(\'' . $contextname . '\');'; $script .= '});'; $script .= '});'; $script .= '</script>'; return $script; }
[ "function alterForm();", "function setEditFieldsFormScript($url=\"\"){\n echo \"<script type='text/javascript'>\\n\";\n echo \"<!--\\n\";\n //echo $url;\n //document.\".$this->unique_prefix.\"frmEditRow.action ='\".str_replace($this->amp,'&',$url).\"'; \n echo \"function \".$this->unique_prefix.\"sendEditFields(){\n if(window.\".$this->unique_prefix.\"onSubmitMyCheck){ if(!\".$this->unique_prefix.\"onSubmitMyCheck()){ return false; } }\n if(onSubmitCheck(document.\".$this->unique_prefix.\"frmEditRow, \".$this->js_validation_errors.\")){\n \";\n // two different parts of code to find & save wysiwyg editor data\n if($this->browser_name == \"Firefox\"){\n echo \"\n elements = document.getElementsByTagName('*');\n for (var idx = 0; idx < elements.length; idx++) {\n node = elements.item(idx);\n field_name = node.getAttribute('name');\n field_full_name = 'wysiwyg' + field_name; \n if(document.getElementById(field_full_name)){\n document.getElementById(field_name).value = document.getElementById(field_full_name).contentWindow.document.body.innerHTML; \n }\n }\n \";\n }else{ // \"MSIE\" or other\n echo \"\n for (var idx=0; idx < document.\".$this->unique_prefix.\"frmEditRow.length; idx++) {\n field_name = \".$this->unique_prefix.\"frmEditRow.elements.item(idx).name; \n field_full_name = 'wysiwyg' + field_name; \n if(document.getElementById(field_full_name)){ \n document.getElementById(field_name).value = document.getElementById(field_full_name).contentWindow.document.body.innerHTML; \n } \n };\n \";\n };\n echo \" \n document.\".$this->unique_prefix.\"frmEditRow.submit();\n }else{\n return false;\n }\n }\";\n echo \"\\n//-->\\n\";\n echo \"</script>\\n\";\n }", "public function executeEdit_field()\n {\n }", "private function createEditForm(Script $entity)\n {\n $form = $this->createForm(new ScriptType(), $entity, array(\n 'action' => $this->generateUrl('script_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function update_form( $form_id, $data );", "function editQuestion()\n\t{\n\t\tglobal $ilDB, $tpl;\t\t\t\t\t\n\t\t\t\n\t\t$plugin = $this->object->getPlugin();\t\t\n\t\t\n\t\t$this->getQuestionTemplate();\n\t\tinclude_once(\"./Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($this->ctrl->getFormAction($this));\n\t\t$form->setTitle($this->outQuestionType());\n\t\t$form->setMultipart(FALSE);\n\t\t$form->setTableWidth(\"100%\");\n\t\t$form->setId(\"assJSMEQuestion\");\n\t\t// Basiseingabefelder: title, author, description, question, working time (assessment mode)\t\t\n\t\t$this->addBasicQuestionFormProperties($form);\n\t\t// points\n\t\t$points = new ilNumberInputGUI($plugin->txt(\"points\"), \"points\");\n\t\t$points->setValue($this->object->getPoints());\n\t\t$points->setRequired(TRUE);\n\t\t$points->setSize(10);\n\t\t$points->setMinValue(0.0);\n\t\t$form->addItem($points);\t\n\t\t\n\t\t// optionString for the JSME-Applet\n\t\tinclude_once(\"./Services/Form/classes/class.ilTextInputGUI.php\");\n\t\t$optionString = new ilTextInputGUI($plugin->txt(\"optionString\"), \"optionString\");\t\t\n\t\t$optionString->setValue($this->object->getOptionString());\t\t\t\t\n\t\t$form->addItem($optionString);\n\t\t\n\t\t// JSME-Applet for sampleSolution\n\t\tinclude_once(\"./Services/Form/classes/class.ilCustomInputGUI.php\");\n\t\t$sampleSolution = new ilCustomInputGUI($plugin->txt(\"sampleSolution\"), \"sampleSolution\");\n\t\t$template = $this->getJsmeOutputTemplate(\"\", $this->object->getOptionString(), $this->object->getSampleSolution() );\n\t\t$sampleSolution->setHtml($template->get());\n\t\t$form->addItem($sampleSolution);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t$form->addCommandButton('save', $plugin->txt(\"save\"));\n\t\t\n\t\t$this->tpl->setVariable(\"QUESTION_DATA\", $form->getHTML());\t\t\n\t}", "public function formEditAsistenciaManual(){\r\n Obj::run()->View->render();\r\n }", "protected function _getEditForm()\n {\n }", "public function edit_form(){\n\t\t?>\n\t\t<form action=\"<?php echo get_save_url($this->page) ?>\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t\t<legend>Editing</legend>\n\t\t\t\t<label for=\"text\">Content:</label><br>\n\t\t\t\t<textarea cols=\"78\" rows=\"20\" name=\"text\" id=\"text\"><?php echo $this->file->data; ?></textarea>\n\t\t\t\t<br>\n\n\t\t\t\t<input type=\"submit\" name=\"preview\" value=\"Preview\">\n\t\t\t\t<input type=\"submit\" name=\"save\" value=\"Save\">\n\t\t\t\t<input type=\"hidden\" name=\"updated\" value=\"<?php echo $this->file->time; ?>\">\n\t\t\t</fieldset>\n\t\t</form>\n\t\t<?php\n\t}", "public function testUpdateMetaform()\n {\n }", "protected function edit() {\n\t}", "function edit($ChunkID)\n{\n global $app;\n\n // Check our request variables to see if we need to load variables.\n if (!isset($_REQUEST['Action'])) {\n if (!$this->loadStory($ChunkID)) return;\n $this->showEditForm();\n return;\n }\n\n // If we made it here, there is an action that has been set that we\n // need to look at. In other words, the user hit a button on the\n // form.\n $this->getFormVars();\n\n switch($_REQUEST['Action']) {\n case \"edit\":\n // We came from the edit form. Do something with what the \n // user gave us.\n $this->processEdit();\n break;\n\n default:\n $this->showEditForm();\n break;\n }\n}", "function edit() {\n\n //quay tro lai trang danh sach\n }", "public function __edit()\n {\n // Load up settings from the environments\n $file = filter_naughty(post_param_string('file'));\n $lang = filter_naughty(post_param_string('lang'));\n $zone = filter_naughty(post_param_string('zone'));\n if (addon_installed('page_management')) {\n $new_file = filter_naughty(has_actual_page_access(get_member(), 'admin_sitemap') ? post_param_string('title', $file) : $file);\n } else {\n $new_file = filter_naughty($file);\n }\n if ($file == '') {\n $file = $new_file;\n }\n\n $validated = post_param_integer('validated', 0);\n if (!addon_installed('unvalidated')) {\n $validated = 1;\n }\n require_code('antispam');\n inject_action_spamcheck();\n if (!has_bypass_validation_comcode_page_permission($zone)) {\n $validated = 0;\n }\n $parent_page = post_param_string('parent_page', '');\n $order = post_param_integer('order');\n $show_as_edit = post_param_integer('show_as_edit', 0);\n $text_raw = post_param_string('post');\n require_code('content2');\n $meta_data = actual_meta_data_get_fields('comcode_page', $zone . ':' . $file, null, $new_file);\n\n // Handle attachments\n require_code('attachments2');\n $_text = do_comcode_attachments($text_raw, 'comcode_page', $zone . ':' . $file);\n $text = $_text['comcode'];\n\n // Some general CRUD maintenance that we don't do within the save_comcode_page function\n $resource_owner = $GLOBALS['SITE_DB']->query_select_value_if_there('comcode_pages', 'p_submitter', array('the_zone' => $zone, 'the_page' => $file));\n if (is_null($resource_owner)) { // Add\n if (!has_add_comcode_page_permission($zone)) {\n access_denied('ADD_COMCODE_PAGE');\n }\n\n require_code('submit');\n give_submit_points('COMCODE_PAGE_ADD');\n\n require_code('member_mentions');\n dispatch_member_mention_notifications('comcode_page', $zone . ':' . $file, $resource_owner);\n } else { // Edit\n if (!has_edit_comcode_page_permission($zone, $file, $resource_owner)) {\n access_denied('EDIT_COMCODE_PAGE');\n }\n\n require_code('submit');\n $just_validated = (!content_validated('comcode_page', $zone . ':' . $file)) && ($validated == 1);\n if ($just_validated) {\n send_content_validated_notification('comcode_page', $zone . ':' . $file);\n }\n }\n require_code('permissions2');\n set_page_permissions_from_environment($zone, $file);\n if (addon_installed('awards')) {\n require_code('awards');\n handle_award_setting('comcode_page', $zone . ':' . $new_file);\n }\n if (addon_installed('content_reviews')) {\n require_code('content_reviews2');\n content_review_set('comcode_page', $zone . ':' . $new_file, $zone . ':' . $file);\n }\n\n // Main save function\n $path = save_comcode_page($zone, $new_file, $lang, $text, $validated, $parent_page, $order, $meta_data['add_time'], $meta_data['edit_time'], $show_as_edit, $meta_data['submitter'], $file, post_param_string('meta_keywords', ''), post_param_string('meta_description', ''));\n\n // Deleting?\n if (post_param_integer('delete', 0) == 1) {\n check_delete_permission('high', $resource_owner);\n unlink(get_custom_file_base() . '/' . $path);\n sync_file($path);\n\n // Delete custom fields\n require_code('fields');\n delete_form_custom_fields('comcode_page', $zone . ':' . $file);\n } else {\n // Save custom fields\n require_code('fields');\n save_form_custom_fields('comcode_page', $zone . ':' . $new_file, $zone . ':' . $file);\n }\n\n // Look for bad title semantics\n $_text['html'] = $_text['tempcode']->evaluate();\n if ((substr($file, 0, 1) != '_') && (substr($file, 0, 6) != 'panel_') && (trim($_text['html']) != '')) {\n if ((strpos($_text['html'], '<h1') === false) && (strpos($_text['comcode'], '[title]') === false) && (strpos($_text['comcode'], '[title=\"1\"]') === false)) {\n attach_message(do_lang_tempcode('NO_LEVEL_1_HEADERS'), 'notice');\n }\n $matches = array();\n if ((strpos($_text['html'], '<h2') === false) && (preg_match_all('#\\n\\[(b|font|size)\\][^\\.]+\\[/(b|font|size)\\]\\n#', $_text['comcode'], $matches) >= 2)) {\n attach_message(do_lang_tempcode('NO_LEVEL_2_HEADERS'), 'inform');\n }\n }\n\n // Messaging to user\n if ($validated == 0) {\n require_code('submit');\n $edit_url = build_url(array('page' => '_SELF', 'type' => '_edit', 'page_link' => $zone . ':' . $new_file), '_SELF', null, false, false, true);\n if (addon_installed('unvalidated')) {\n send_validation_request('COMCODE_PAGE_EDIT', 'comcode_pages', true, $zone . ':' . $new_file, $edit_url);\n }\n }\n $completion_text = ($validated == 0) ? do_lang_tempcode('SUBMIT_UNVALIDATED') : do_lang_tempcode('SUCCESS');\n $url = post_param_string('redirect', '');\n if ($url != '') {\n return redirect_screen($this->title, $url, $completion_text);\n }\n return $this->do_next_manager($this->title, $file, $zone, $completion_text);\n }", "function showEditForm()\n{\n global $app;\n\n $tpl = new acmsTemplate($this->templatePath . \"edit_form.tpl\");\n $tpl->assign(\"Action\", \"edit\");\n $tpl->assign(\"ChunkID\", $this->ChunkID);\n $tpl->assign(\"ChunkName\", $this->ChunkName);\n $tpl->assign(\"Chunk\", $this->Chunk);\n $tpl->assign(\"Title\", $this->Title);\n $tpl->assign(\"Perms\", $this->Perms);\n\n $app->addBlock(10, CONTENT_ZONE, \"Edit Menu\", $tpl->get());\n}", "function OC_HTML_doConfigurationForm($file,$section,$theItems,$md5)\n {\n ?>\n <form name=\"section_form\" method=\"post\" action=\"<?PHP echo \"$PHP_SELF?type=tool&display=configedit&file=$file\" ?>\">\n\n <input type=hidden name=\"themd5\" value=\"<?PHP echo $md5 ?>\">\n\n <input type=hidden name=\"updateSection\" value=\"<?PHP echo $section ?>\">\n\n <h2><?PHP echo \"Edit: $section\" ?></h2>\n\n <textarea name=\"section_text\" cols=100 rows=\"<?PHP echo $this->_OC_HTML_textarea_rows ?>\" wrap=\"off\"><?PHP foreach($theItems as $item) print \"$item\";?></textarea> <br>\n\n <input type=\"Submit\" name=\"tryUpdate\" value=\"Update\">\n\n </form>\n\n <script language=\"JavaScript\">\n <!--\n var TRange=null\n\n function findString (str) {\n\n var strFound;\n\n if (navigator.appName.indexOf(\"Microsoft\")!=-1) {\n\n // EXPLORER-SPECIFIC CODE\n\n if (TRange!=null) {\n TRange.collapse(false)\n strFound=TRange.findText(str)\n if (strFound) TRange.select()\n }\n if (TRange==null || strFound==0) {\n TRange=self.document.section_form.section_text.createTextRange()\n strFound=TRange.findText(str)\n if (strFound) TRange.select()\n }\n if (!strFound) alert (\"String '\"+str+\"' not found!\")\n }\n else alert (\"Browser does not support this feature.\")\n }\n //-->\n </script>\n\n <?PHP\n }", "function edit(){\n\t\t$this->page_title = sprintf(_(\"Editing the creature #%s\"),$this->creature->getId());\n\n\t\t$this->form = Atk14Form::GetForm(\"CreateNewForm\");\n\t\t$this->form->set_initial($this->creature);\n\n\t\tif($this->request->post() && ($d = $this->form->validate($this->params))){\n\t\t\t$this->creature->s($d);\n\t\t\t$this->flash->success(_(\"The creature has been changed successfuly.\"));\n\t\t\t$this->_redirect_to_action(\"index\");\n\t\t}\n\t}", "function handleEditMetadataForm(&$form_id, &$form_values, &$soap_client) {\n $dom = new DomDocument(\"1.0\", \"UTF-8\");\n $dom->formatOutput = TRUE;\n $mods = $this->modsFromForm($form_values, $dom);\n $dom->appendChild($mods);\n\n if ($this->item->modify_datastream_by_value($dom->saveXML(), 'MODS', \"MODS Record\", 'text/xml') !== NULL) {\n drupal_set_message(t('Successfully updated MODS datastream for object %pid', array('%pid' => $this->pid)));\n }\n drupal_goto('/fedora/repository/' . $this->pid);\n }", "function EditWithAjax()\n {\n //$Panel = new Panel();\n //$ln_sys = new SysLang();\n if( $this->id!=NULL )\n {\n $q=\"SELECT * FROM `\".$this->spr.\"` WHERE `id`='\".$this->id.\"'\";\n // edit (U)\n $res = $this->Rights->Query($q, $this->user_id, $this->module);\n if( !$res ) return false;\n $mas = $this->Rights->db_FetchAssoc();\n }\n\n /* Write Form Header */\n $this->Form->WriteHeader( $this->script, 'target=\"_parent\"' );\n\n $this->Form->Hidden( 'module_name', $this->module_name );\n $this->Form->Hidden( 'spr', $this->spr );\n $this->Form->Hidden( 'root_script', $this->root_script );\n $this->Form->Hidden( 'parent_script', $this->parent_script );\n $this->Form->Hidden( 'parent_id', $this->parent_id );\n $this->Form->Hidden( 'sort', $this->sort );\n $this->Form->Hidden( 'display', $this->display );\n $this->Form->Hidden( 'start', $this->start );\n\n $this->Form->Hidden( 'fln', $this->fln );\n $this->Form->Hidden( 'srch', $this->srch );\n\n $this->Form->Hidden( 'item_img', \"\" );\n $this->Form->Hidden( 'lang_id', \"\" );\n $this->Form->Hidden( 'usemeta', $this->usemeta );\n $this->Form->Hidden( 'useshort', $this->useshort );\n $this->Form->Hidden( 'useimg', $this->useimg );\n $this->Form->Hidden( 'uselevels', $this->uselevels );\n\n if( $this->id!=NULL ) $txt = $this->Msg_text['TXT_EDIT'];\n else $txt = $this->Msg_text['_TXT_ADD_DATA'];\n\n AdminHTML::PanelSubH( $txt );\n\n //-------- Show Error text for validation fields --------------\n $this->ShowErrBackEnd();\n //-------------------------------------------------------------\n\n /* Write Simple Panel*/\n AdminHTML::PanelSimpleH();\n\n $q=\"SELECT * FROM `\".$this->spr.\"` ORDER BY `cod` desc LIMIT 1\";\n $res = $this->Rights->Query($q, $this->user_id, $this->module);\n //echo '<br> $q='.$q.' $res='.$res.' $this->Rights->result='.$this->Rights->result;\n $tmp = $this->Rights->db_FetchAssoc();\n $this->field_type = mysql_field_type($this->Rights->result,1);\n $fields_col = mysql_num_fields($this->Rights->result);\n\n ?>\n <table border=\"0\" width=\"100%\" align=\"center\" class=\"EditTable\">\n <tr>\n <td><b><?echo $this->Msg_text['FLD_ID']?>:</b></td>\n <td width=\"95%\">\n <?\n if( $this->id ){\n echo $mas['id'];\n $this->Form->Hidden( 'id', $mas['id'] );\n }\n ?>\n </td>\n </tr>\n <tr>\n <td><b><?echo $this->Msg_text['_FLD_CODE']?>:</b></td>\n <td>\n <?\n if( $this->id ){\n $this->Form->TextBox( 'cod', $mas['cod'], 50, 'id=\"cod\"' );\n $this->cod = $mas['cod'];\n $this->Form->Hidden('cod', $this->cod);\n }\n else{\n if ($this->field_type=='int') $new_cod = $tmp['cod']+1;\n else $new_cod='';\n $this->Form->TextBox( 'cod', $new_cod, 50, 'id=\"cod\"' );\n }\n ?>\n </td>\n </tr>\n <?\n if($this->uselevels==1){?>\n <tr>\n <td><b><?echo $this->Msg_text['_FLD_LEVEL']?>:</b></td>\n <td>\n <?\n $arr_levels = $this->GetStructureInArray($this->spr, 0, NULL, $this->Msg_text['_TXT_ROOT_LEVEL'], '&nbsp;', $this->useshort);\n $this->Form->Select( $arr_levels, 'level_new', $this->level );\n ?>\n </td>\n </tr>\n <?}?>\n <tr>\n <td colspan=\"2\">\n <div id=\"edlngpanel\">\n <?=$this->EditLngPanel();?>\n </div>\n <script language=\"JavaScript\">\n var idResp;\n function onAjaxSuccess(data)\n {\n // Здесь мы получаем данные, отправленные сервером\n $(\"#\"+idResp).empty();\n $(\"#\"+idResp).append(data);\n }\n\n function makeRequest(script, idForm, idRes){\n idResp = idRes;\n document.<?=$this->Form->name?>.task.value='edit_lng_panel';\n $.post(script, $('#'+idForm).formSerialize(), onAjaxSuccess);\n } // end of function makeRequest\n\n function ChangeTabStyle(lang, on_off)\n {\n if(on_off=='on') {\n $(\"#tabpanel\"+lang).toggleClass(\"tab-panel-passive\");\n $(\"#tabpanel\"+lang).addClass(\"tab-panel-hover\");\n }\n if(on_off=='off') {\n $(\"#tabpanel\"+lang).toggleClass(\"tab-panel-hover\");\n $(\"#tabpanel\"+lang).addClass(\"tab-panel-passive\");\n }\n }\n\n function upl_file(uri, div_id, form) {\n document.<?=$this->Form->name?>.task.value='add_img_on_lang';\n Did = \"#\"+div_id;\n $.ajaxUpload\n ({\n url:uri,\n secureuri:false,\n uploadform: form,\n type: 'POST',\n dataType: 'html',\n success: function (img_upload, status)\n {\n $(Did).html(img_upload).animate({\n opacity: 'show'\n }, \"slow\", \"easein\");\n },\n error: function (img_upload, status)\n {\n $(Did).html(status).animate({\n opacity: 'show'\n }, \"slow\", \"easein\");\n }\n\n });\n }\n\n function DelItemImg(uri, idForm, div_id){\n document.<?=$this->Form->name?>.task.value='delitemimg';\n Did = \"#\"+div_id;\n $.ajax\n ({\n url:uri,\n type: 'POST',\n dataType: 'html',\n success: function (img_upload, status)\n {\n $(Did).html(img_upload).animate({\n opacity: 'show'\n }, \"slow\", \"easein\");\n },\n error: function (img_upload, status)\n {\n $(Did).html(status).animate({\n opacity: 'show'\n }, \"slow\", \"easein\");\n }\n\n });\n } // end of function DelItemImg\n </script>\n </td>\n </tr>\n <?\n /*\n $tmp_db = new DB();\n $q = \"SELECT * FROM `\".$this->spr.\"` WHERE 1 LIMIT 1\";\n $res = $tmp_db->db_Query($q);\n //echo '<br>q='.$q.' res='.$res.' $tmp_db->result='.$tmp_db->result;\n if ( !$res ) return false;\n if ( !$tmp_db->result ) return false;\n $fields_col = mysql_num_fields($tmp_db->result);\n */\n if($fields_col>4){\n if($this->id==NULL){\n $tmp_q = \"select MAX(`move`) as maxx from `\".$this->spr.\"` order by `move` desc\";\n $res = $this->db->db_Query( $tmp_q );\n if( !$res )return false;\n $tmp_row = $this->db->db_FetchAssoc();\n $move = $tmp_row['maxx'];\n $move=$move+1;\n }\n else $move=$mas['move'];\n $this->Form->Hidden( 'move', $move );\n }\n ?>\n <tr>\n <td colspan=\"2\" align=\"left\">\n <?\n $this->Form->WriteSavePanelNew( $this->script, 'save' );\n //$this->Form->WriteSavePanel( $this->script, 'save', 'checkCod();' );\n $this->Form->WriteCancelPanel( $this->script );\n ?>\n </td>\n </tr>\n </table>\n <?\n AdminHTML::PanelSimpleF();\n AdminHTML::PanelSubF();\n $this->Form->WriteFooter();\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will unsubscribe the specified email address from the associated mailing list.
public function unsubscribe($email) { try { if (empty($this->mailing_list)) { throw new Exception('Failed to unsubscribe because no mailing list has been set.'); } if (empty($this->subscriber)) { throw new Exception("Failed to unsubscribe because no subscriber has been set."); } $data = 'email^' . rawurlencode($this->subscriber); $response = $this->subscriber->unsubscribe($this->mailing_list['listID'], $data, 0); if (!(isset($response['isSuccess']) && $response['isSuccess'])) { throw new Exception("Failed to unsubscribe because {$response['reason']}"); } if ($this->do_notify) { $mailer = $this->mailer; if (is_null($mailer)) { $mailer = new Mailer('WHAT_COUNTS'); $mailer->set_recipient($this->subscriber); $mailer->set_subject('Goodbye! Your email was unsubscribed.'); $mailer->set_message('We have successfully unsubscribed this email from our mailing list.'); } $sent = $mailer->send(); if (!$sent) { $error = $mailer->get_error(); throw new Exception($error['message'], $error['code']); } } } catch (Exception $ex) { $this->error = array( 'message' => $ex->getMessage(), 'code' => $ex->getCode() ); return FALSE; } $this->error = NULL; return TRUE; }
[ "public function unsubscribeFrom($list, $email);", "public function removeRecipient($email);", "public function unsubscribeAction()\r\n {\r\n $emailAddress = Mage::app()->getRequest()->getParam('email');\r\n\r\n if ($emailAddress) {\r\n $session = Mage::getSingleton('core/session');\r\n try {\r\n $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($emailAddress);\r\n\r\n if ($subscriber) {\r\n $subscriber->unsubscribe();\r\n }\r\n $session->addSuccess($this->__('You have been unsubscribed.'));\r\n }\r\n catch (Mage_Core_Exception $e) {\r\n $session->addException($e, $e->getMessage());\r\n }\r\n catch (Exception $e) {\r\n $session->addException($e, $this->__('There was a problem with the un-subscription.'));\r\n }\r\n }\r\n $this->_redirectReferer();\r\n }", "public function unsubscribe(): void\n {\n $this->user->unsubscribe();\n $this->messages->add($this->adapter->lexicon('commerce_abandonedcart.unsubscribed_from_emails'));\n }", "public function removeRecipient($email){\n\t\tunset($this->_addresses[trim(strtolower($email))]);\n\t}", "public function smtpUnsubscribeEmails($emails);", "public function unsubscribe(){\n\t\t\n\t\tif($this->data) {\n\t\t\t$subscriber = $this->Subscriber->find('first',array('conditions' => array('Subscriber.email' => $this->data['email'])));\n \n\t\t\tif($subscriber){\n\t\t\t\tif($this->Subscriber->delete($subscriber['Subscriber']['_id'])) {\t\t\t\t\t\n\t\t\t\t\t$this->render('unsubscribesuccess');\n\t\t\t\t\treturn;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$this->render('unsubscribefailed');\n\t\t\t\t\treturn;\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__d('email','Die Email wurde nicht gefunden',false));\n $this->render('unsubscribefailed');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public function unsubscribe($email, $lists = [])\n {\n $this->hubspot->email()\n ->updateSubscription($this->config['portal_id'], $email, [\n 'unsubscribeFromAll' => true,\n ]);\n }", "public function unSubscribeAddress($list, $email)\n {\n return $this->client->put(\n 'lists/' . $list . '/members/' . $this->getAddressId($email),\n ['status' => 'unsubscribed', 'email_address' => $email]\n );\n }", "function unsubscribe($enc_email)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$s_email = decrypt($enc_email);\t\r\n\t\t\tif($s_email!='')\r\n\t\t\t{\r\n\t\t\t\t$s_where = \" WHERE s_email = '\".$s_email.\"' \";\t\t\t\t\r\n\t\t\t\t$s_table = $this->db->NEWSLETTERSUBCRIPTION;\r\n\t\t\t\t$i_count = $this->mod_common->common_count_rows($s_table,$s_where);\r\n\t\t\t\tif($i_count>0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$arr_where = array('s_email'=>$s_email);\r\n\t\t\t\t\t$i_delete = $this->mod_common->common_delete_info($s_table,$arr_where);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_table = $this->db->EMAILLOG;\r\n\t\t\t\t\t$arr_where = array('s_to_emails'=>$s_email);\r\n\t\t\t\t\t$i_deleted = $this->mod_common->common_delete_info($s_table,$arr_where);\r\n\t\t\t\t\tif($i_delete)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->session->set_userdata(array('message'=>$this->cls_msg[\"unsubscribe_succ\"],'message_type'=>'succ'));\r\n\t\t\t\t\t\tredirect(base_url().\"home/message\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->session->set_userdata(array('message'=>$this->cls_msg[\"unsubscribe_err\"],'message_type'=>'err'));\r\n\t\t\t\t\t\tredirect(base_url().\"home/message\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->session->set_userdata(array('message'=>$this->cls_msg[\"already_unsuscribe_err\"],'message_type'=>'err'));\r\n\t\t\t\t\tredirect(base_url().\"home/message\");\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tunset($s_table,$arr_where,$i_delete,$i_deleted);\r\n\t\t}\r\n\t\tcatch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n\t}", "public function unsubscribeAction()\n {\n $email = @$_REQUEST[\"customerEmail\"];\n if (!$email) {\n $cryptkey = Mage::getStoreConfig('mailup_newsletter/mailup/webhook_crypt_key');\n foreach ($_REQUEST as $k=>$v) {\n $k = self::rc4($cryptkey, base64_decode($k));\n $parsed_vars = array();\n parse_str($k, $parsed_vars);\n if ($parsed_vars and isset($parsed_vars[\"customerEmail\"])) {\n $email = $parsed_vars[\"customerEmail\"];\n break;\n }\n }\n }\n\n if (!$email) {\n echo 0;\n die();\n }\n\n $model = Mage::getModel('newsletter/subscriber')\n ->setStoreId(Mage::app()->getStore()->getId())\n //->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\n ->loadByEmail($email)\n ;\n \n if (!$model->getSubscriberId()) {\n echo 0;\n die();\n }\n\n $GLOBALS['__sl_mailup_save_from_webhook'] = 1; //avoids observer\n $model\n ->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED)\n ->save();\n\n echo 1;\n die();\n }", "public function unsubscribe() {\n\n\t\t$controller = NewsletterUnsubscription::instance();\n\n\t\t$user = $controller->get_user( $this->user->get_id() );\n\n\t\tif ( $user ) {\n\n\t\t\tif ( $user->status == TNP_User::STATUS_UNSUBSCRIBED ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$user = $controller->refresh_user_token( $user );\n\t\t\t$user = $controller->set_user_status( $user, TNP_User::STATUS_UNSUBSCRIBED );\n\n\t\t\t$controller->add_user_log( $user, 'unsubscribe' );\n\n\t\t}\n\n\t\tdo_action( 'newsletter_unsubscribed', $user );\n\n\t\tglobal $wpdb;\n\n\t\t$email = $this->user->get_email();\n\t\tif ( $email ) {\n\t\t\t$wpdb->update( NEWSLETTER_USERS_TABLE, array(\n\t\t\t\t'unsub_email_id' => 0,\n\t\t\t\t'unsub_time' => time()\n\t\t\t), array( 'id' => $user ? $user->id : 0 ) );\n\t\t}\n\n\t\t$controller->send_unsubscribed_email( $user );\n\n\t\tNewsletterSubscription::instance()->notify_admin( $user, 'Newsletter unsubscription' );\n\n\t}", "function mailchimp_unsubscribe_user( $user_email, $list_id, $delete = false ) {\n\n\t$api = mailchimp_load_API();\n\n\tif ( is_wp_error( $api ) )\n\t\treturn $api;\n\n\treturn $api->lists->unsubscribe( $list_id, array( 'email' => $user_email ), $delete );\n}", "public static function process_unsubscribe() {\n\t\t// Ensure the unsubscribe flag is set.\n\t\tif ( empty( $_GET['unsubscribe'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Try to get a user by the given email address.\n\t\t$user = get_user_by( 'email', sanitize_email( $_GET['unsubscribe'] ) );\n\t\tif ( false === $user ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Unsubscribe the user.\n\t\tself::set_unsubscribe( $user->ID, true );\n\t}", "public function set_list_unsubscribe($email)\n {\n $email = $this->clean_email($email);\n if ($this->validate) {\n $this->validate_email($email);\n }\n\n $this->set_header('List-Unsubscribe', $email);\n }", "function subscription_delete($email, $list_id)\r\n {\r\n return $this->call_api(Http::DELETE, 'lists/'. $list_id . '/subscribers/' . $email . '/');\r\n }", "public function removeWorkflowSubscriber($workflow_id, $email_address)\n {\n $data = [\"email_address\" => $email_address];\n return self::execute(\"POST\", \"automations/{$workflow_id}/removed-subscribers\", $data);\n }", "public function removeEmail(string $email): ContactListInterface;", "private function unsubscribe()\n {\n $this->botman->hears('unsubscribe', function(BotMan $bot) {\n $userId = $bot->getUser()->getId();\n Subscriber::where('telegram_user_id', $userId)->delete();\n $bot->reply('You have just unsubscribed from our updates!');\n });\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a javascript json var
public static function addJsonVar($sName, $mValue) { self::$aJavascriptVars[$sName] = $mValue; }
[ "function jsonset(array $variables){\n\t$ret = '<script type=\"text/javascript\">'.\"\\n\";\n\tforeach ($variables as $name => $value)\n\t\t$ret .= $name.' = '.json_encode($value).';'.\"\\n\";\n\t$ret .= '</script>'.\"\\n\";\n\treturn $ret;\n\t}", "function addJSVariable($name, $value) {\n\t\t$this->jsVars[$name] = $value;\n\t}", "function to_js_var($str)\n{\n return json_encode($str); \n}", "public function addJson($value)\n {\n $this->json[] = $value;\n }", "static function initJson()\n\t {\n\t\tglobal $tpl;\n\t\t$tpl->addJavaScript(\"./Services/YUI/js/\".self::$ver.\"/yahoo-dom-event/yahoo-dom-event.js\");\t\t\n\t \t$tpl->addJavaScript(\"./Services/YUI/js/\".self::$ver.\"/json/json-min.js\");\n\t }", "public function setJsonName($var) {}", "function add_json($json, $array)\n{\n\t// convert to array\n\t$json = json_decode($json, TRUE);\n\t// add to array\n\t$json = add_array($json, $array);\n\t// convert to json string\t\n\treturn json_encode($json);\n}", "public static function addclientjavascriptvars() {\n $information = array( \n \"routing\" => Array(\n \"controller\" => Wi3::inst()->routing->controller,\n \"action\" => Wi3::inst()->routing->action,\n ),\n \"urlof\" => Array(\n \"wi3\" => Wi3::inst()->urlof->wi3files,\n \"fileroot\" => Wi3::inst()->urlof->wi3files, // Is the same as Wi3::inst()->urlof->wi3files\n \"controllerroot\" => Wi3::inst()->urlof->wi3controllers, // Shortcut how sites can ask for a controller\n \"site\" => Wi3::inst()->urlof->site,\n ),\n //\"editmode\" => Wi3::inst()->editmode,\n );\n Request::instance()->response = str_replace(\"</head>\", \"<script> var wi3 = \" . json_encode($information) . \"</script></head>\", Request::instance()->response);\n }", "function acf_json_encode( $json ) {\n}", "public function addJson() {\n $this->autoRender = false;\n if($this->request->is('post')) {\n if($question = $this->Question->save($this->request->data)) {\n echo json_encode(array('data' => $question, 'ok' => true));\n } else {\n echo json_encode(array('ok' => false));\n }\n }\n }", "public function _js_vars()\n {\n }", "public function _js_vars()\n {\n }", "public function json() { $this->cfi->json_object['fields'][$this->field]['type'] = 'json'; return $this;}", "public function addEditJSVars()\n\t{\n\t\t$this->jsVars['decisiontree_url'] = Yii::app()->createUrl('OphCoTherapyapplication/default/getDecisionTree/');\n\t\t$this->jsVars['nhs_date_format'] = Helper::NHS_DATE_FORMAT_JS;\n\t}", "public function addJS($js){\n\t\t$this->javaScript[] .= $js;\n\t}", "function php_to_js($vars, $key = 'server_vars', $encode = true){\n\t$vars = $encode === true ? json_encode($vars) : $vars;\n\treturn 'var ' . $key . ' = ' . $vars . ';';\n}", "function acf_json_encode($json)\n{\n}", "function add($json) {\n $j = json_decode($json, true);\n \n $r = array(\n \"m\" => $j['horaire']['m'],\n \"h\" => $j['horaire']['h'],\n \"day\" => '*',\n \"month\" => '*',\n \"dow\" => $j['jours'],\n \"command\" => '/root/proq/scripts/wakeup.py',\n \"enable\" => $j['actif'],\n \"name\" => $j['nom']\n );\n \n return $r;\n }", "public function addJavaScriptCode($code) {\n $this->additionalCode = $code;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation addSupplementTagWithHttpInfo Add new tags for a supplement.
public function addSupplementTagWithHttpInfo($supplement_id, $supplement_tag) { $returnType = ''; $request = $this->addSupplementTagRequest($supplement_id, $supplement_tag); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $request->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { } throw $e; } }
[ "protected function addSupplementTagRequest($supplement_id, $supplement_tag)\n {\n // verify the required parameter 'supplement_id' is set\n if ($supplement_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $supplement_id when calling addSupplementTag'\n );\n }\n // verify the required parameter 'supplement_tag' is set\n if ($supplement_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $supplement_tag when calling addSupplementTag'\n );\n }\n\n $resourcePath = '/beta/supplement/{supplementId}/tag/{supplementTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($supplement_id !== null) {\n $resourcePath = str_replace(\n '{' . 'supplementId' . '}',\n ObjectSerializer::toPathValue($supplement_id),\n $resourcePath\n );\n }\n // path params\n if ($supplement_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'supplementTag' . '}',\n ObjectSerializer::toPathValue($supplement_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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 }", "public function addSupplementTagAsyncWithHttpInfo($supplement_id, $supplement_tag)\n {\n $returnType = '';\n $request = $this->addSupplementTagRequest($supplement_id, $supplement_tag);\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 updateSupplementWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateSupplementRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function addToSupplements(\\Maseuropa\\Booking\\StructType\\SAParamSupplement $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Maseuropa\\Booking\\StructType\\SAParamSupplement) {\n throw new \\InvalidArgumentException(sprintf('The supplements property can only contain items of type \\Maseuropa\\Booking\\StructType\\SAParamSupplement, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->supplements[] = $item;\n return $this;\n }", "public function updateSupplement($body)\n {\n $this->updateSupplementWithHttpInfo($body);\n }", "public function addOfferTag($data = NULL)\n {\n\treturn $this->setRequestData(self::RESOURCE_OFFER_TAGS, $data, 'post');\n }", "public function addSupplementFile($supplement_id, $file_name)\n {\n $this->addSupplementFileWithHttpInfo($supplement_id, $file_name);\n }", "public function getDuplicateSupplementByIdWithHttpInfo($supplement_id)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\Supplement';\n $request = $this->getDuplicateSupplementByIdRequest($supplement_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\Supplement',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function addSupplementTagAsync($supplement_id, $supplement_tag)\n {\n return $this->addSupplementTagAsyncWithHttpInfo($supplement_id, $supplement_tag)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function addTag($tag, $value = true);", "public function addTag(\\Psr\\Http\\Message\\ResponseInterface $response, $tag);", "public function addTag($tag);", "public function addToExtraInfo(\\Restoore\\SystempayWebservice\\StructType\\ExtInfo $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Restoore\\SystempayWebservice\\StructType\\ExtInfo) {\n throw new \\InvalidArgumentException(sprintf('The extraInfo property can only contain items of \\Restoore\\SystempayWebservice\\StructType\\ExtInfo, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->extraInfo[] = $item;\n return $this;\n }", "public function addExtrinsic($name, $value)\n {\n $el = $this->simple_xml_element->Request->PunchOutSetupRequest;\n $extrinsic = $el->addChild('Extrinsic', $value);\n $extrinsic->addAttribute('name', $name);\n }", "public function addApplicationInfo(\\ZendService\\ZendServerAPI\\DataTypes\\ApplicationInfo $applicationInfo)\n {\n $this->applicationInfos[] = $applicationInfo;\n }", "public function addPickFaceAssignmentTagWithHttpInfo($pick_face_assignment_id, $pick_face_assignment_tag)\n {\n \n // verify the required parameter 'pick_face_assignment_id' is set\n if ($pick_face_assignment_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $pick_face_assignment_id when calling addPickFaceAssignmentTag');\n }\n // verify the required parameter 'pick_face_assignment_tag' is set\n if ($pick_face_assignment_tag === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $pick_face_assignment_tag when calling addPickFaceAssignmentTag');\n }\n \n // parse inputs\n $resourcePath = \"/beta/pickFaceAssignment/{pickFaceAssignmentId}/tag/{pickFaceAssignmentTag}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n \n if ($pick_face_assignment_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"pickFaceAssignmentId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($pick_face_assignment_id),\n $resourcePath\n );\n }// path params\n \n if ($pick_face_assignment_tag !== null) {\n $resourcePath = str_replace(\n \"{\" . \"pickFaceAssignmentTag\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($pick_face_assignment_tag),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'PUT',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n }\n \n throw $e;\n }\n }", "public function addExtensionProvider(ProviderContract $provider, int $priority = null);", "public function addTag();", "public function addToAddonInformation(\\StructType\\AddonInformation $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\AddonInformation) {\n throw new \\InvalidArgumentException(sprintf('The AddonInformation property can only contain items of \\StructType\\AddonInformation, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->AddonInformation[] = $item;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a class's annotations by type.
public function classAnnotationsByType(string $type, string $class): array;
[ "public function classMembersAnnotationsByType(string $type, string $class): array;", "public function getClassAnnotations(\\ReflectionClass $class);", "public function methodsAnnotationsByType(string $type, string $class): array;", "public function getClassAnnotations(ReflectionClass $class);", "function el_get_annotations_by_type(array $params){\n\t$annotation = new ElAnnotation;\n\treturn $annotation->searchAnnotation($params);\n}", "public function getClassAnnotations(\\ReflectionClass $reflector);", "static function getClassAnnotation(ReflectionClass $class);", "public function getAnnotation(string $annotationClass);", "public function getClassAnnotation(\\ReflectionClass $class, $annotation);", "public function getClassAnnotations(ReflectionClass $class)\n {\n $cacheKey = $class->getName() . self::$CACHE_SALT;\n\n // Attempt to grab data from cache\n if (($data = $this->cache->fetch($cacheKey)) !== false) {\n return $data;\n }\n\n $annotations = $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());\n $this->cache->save($cacheKey, $annotations, null);\n\n return $annotations;\n }", "public static function for_class($class) {\n\t return self::parse_annotations(new ReflectionClass($class));\n\t}", "public function getAnnotationsByType(string $className): array\n {\n return array_filter($this->annotations, static function (MiddlewareAnnotationInterface $annotation) use ($className) {\n return $annotation instanceof $className;\n });\n }", "abstract protected function getAnnotationClass();", "public function getClassesAndAnnotations() {\n\t\tstatic $classesAndAnnotations;\n\t\tif ($classesAndAnnotations === NULL) {\n\t\t\tforeach (array_keys($this->indexAnnotations) AS $className) {\n\t\t\t\t$classesAndAnnotations[$className] = $this->indexAnnotations[$className]['annotation'];\n\t\t\t}\n\t\t}\n\n\t\treturn $classesAndAnnotations;\n\t}", "public function getAnnotations()\n {\n\n // check if the annotations has been loaded\n if (isset($this->annotations) === false) {\n $this->annotations = ReflectionAnnotation::fromReflectionClass($this);\n }\n\n // return the annotations\n return $this->annotations;\n }", "public function getAnnotationClassNames ();", "public function classMembersAnnotations(string $class): array;", "public function getAnnotations();", "public function firstNamed(string $type): Annotation\n {\n if ($this->contain($type)) {\n return $this->types[$type][0];\n }\n\n throw new \\ReflectionException('Can not find annotation ' . $type . ' for ' . $this->target);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'usersGetUserMetadata'
protected function usersGetUserMetadataRequest() { $resourcePath = '/v0.1/user/metadata/optimizely'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { $httpBody = \GuzzleHttp\json_encode($httpBody); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); } } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token'); if ($apiKey !== null) { $headers['X-API-Token'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function userSummariesAllGetRequest()\n {\n\n $resourcePath = '/user/summaries/all';\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getOidcUserInfoRequest()\n {\n\n $resourcePath = '/userinfo';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function retrieveUserRequest($ids)\n {\n // verify the required parameter 'ids' is set\n if ($ids === null || (is_array($ids) && count($ids) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ids when calling retrieveUser'\n );\n }\n\n $resourcePath = '/users/entities/users/v1';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($ids !== null) {\n if('form' === 'form' && is_array($ids)) {\n foreach($ids as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['ids'] = $ids;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function userGetRequest()\n {\n\n $resourcePath = '/user';\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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'],\n ['application/json', 'application/x-www-form-urlencoded']\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('api-key');\n if ($apiKey !== null) {\n $headers['api-key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api-nonce');\n if ($apiKey !== null) {\n $headers['api-nonce'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api-signature');\n if ($apiKey !== null) {\n $headers['api-signature'] = $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 }", "public function getUserMetadata()\n {\n return $this->user_metadata;\n }", "public function fetchProfileInfoRequest()\n {\n\n $resourcePath = '/v2/employee';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function userSummariesGetRequest($search_name)\n {\n // verify the required parameter 'search_name' is set\n if ($search_name === null || (is_array($search_name) && count($search_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $search_name when calling userSummariesGet'\n );\n }\n\n $resourcePath = '/user/summaries';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($search_name !== null) {\n $queryParams['search_name'] = ObjectSerializer::toQueryValue($search_name);\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getUserMeRequest(): Request\n {\n\n $resourcePath = '/user/me';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n [self::APPLICATION_JSON]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [self::APPLICATION_JSON],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n self::NAME => $formParamName,\n self::CONTENTS => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers[self::CONTENT_TYPE] === self::APPLICATION_JSON) {\n $httpBody = Utils::jsonEncode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = Query::build($formParams);\n }\n }\n\n // this endpoint requires Bearer authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers[self::AUTHORIZATION] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent() !== '') {\n $defaultHeaders[self::USER_AGENT] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = Query::build($queryParams);\n return new Request(\n self::GET,\n $this->config->getHost() . $resourcePath . ($query !== '' ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function apiUsersMeGetRequest()\n {\n $resourcePath = '/api/users/me';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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\n if ($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if (is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\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-AUTH-TOKEN');\n if ($apiKey !== null) {\n $headers['X-AUTH-TOKEN'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-AUTH-USER');\n if ($apiKey !== null) {\n $headers['X-AUTH-USER'] = $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\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function userGetMembershipDataForCurrentUserRequest()\n {\n\n $resourcePath = '/User/GetMembershipsForCurrentUser/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\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 (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n if ($this->config->getApiKey('X-API-Key') !== null) {\n $headers['X-API-Key'] = $this->config->getApiKey('X-API-Key');\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 }", "protected function getMetadata1UsingGETRequest()\n {\n\n $resourcePath = '/v1/get-metadata-1';\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // 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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "protected function getMetadata3UsingGETRequest()\n {\n\n $resourcePath = '/v1/get-metadata-3';\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // 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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getUserInformation()\n {\n return $this->makeRequest('GET','users/me');\n }", "protected function userfilesGetRequest()\n {\n\n $resourcePath = '/userfiles';\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', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data']\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('cbrain_api_token');\n if ($apiKey !== null) {\n $queryParams['cbrain_api_token'] = $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 }", "public function availableOperationsRequest()\n {\n\n $resourcePath = '/user';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getUserFollowsUserRequest(int $limit = 10, int $offset = null): Request\n {\n if ($limit !== null && $limit > 100) {\n throw new InvalidArgumentException('invalid value for \"$limit\" when calling UserApi.getUserFollowsUser, must be smaller than or equal to 100.');\n }\n if ($limit !== null && $limit < 1) {\n throw new InvalidArgumentException('invalid value for \"$limit\" when calling UserApi.getUserFollowsUser, must be bigger than or equal to 1.');\n }\n\n if ($offset !== null && $offset < 0) {\n throw new InvalidArgumentException('invalid value for \"$offset\" when calling UserApi.getUserFollowsUser, must be bigger than or equal to 0.');\n }\n\n\n $resourcePath = '/user/follows/user';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($limit !== null) {\n if(self::FORM === self::FORM && is_array($limit)) {\n foreach($limit as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams[self::LIMIT] = $limit;\n }\n }\n // query params\n if ($offset !== null) {\n if(self::FORM === self::FORM && is_array($offset)) {\n foreach($offset as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams[self::OFFSET] = $offset;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n [self::APPLICATION_JSON]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [self::APPLICATION_JSON],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n self::NAME => $formParamName,\n self::CONTENTS => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers[self::CONTENT_TYPE] === self::APPLICATION_JSON) {\n $httpBody = Utils::jsonEncode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = Query::build($formParams);\n }\n }\n\n // this endpoint requires Bearer authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers[self::AUTHORIZATION] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent() !== '') {\n $defaultHeaders[self::USER_AGENT] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = Query::build($queryParams);\n return new Request(\n self::GET,\n $this->config->getHost() . $resourcePath . ($query !== '' ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getUserProfile(): array\n {\n $this->endpoint = 'https://api.amazon.com';\n return $this->operation(\"user/profile\");\n }", "protected function getScimV2UsersRequest($startIndex = '1', $count = '25', $attributes = null, $excludedAttributes = null, $filter = null)\n {\n\n $resourcePath = '/api/v2/scim/v2/users';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($startIndex !== null) {\n $queryParams['startIndex'] = ObjectSerializer::toQueryValue($startIndex);\n }\n // query params\n if ($count !== null) {\n $queryParams['count'] = ObjectSerializer::toQueryValue($count);\n }\n // query params\n if (is_array($attributes)) {\n $queryParams['attributes'] = $attributes;\n } else\n if ($attributes !== null) {\n $queryParams['attributes'] = ObjectSerializer::toQueryValue($attributes);\n }\n // query params\n if (is_array($excludedAttributes)) {\n $queryParams['excludedAttributes'] = $excludedAttributes;\n } else\n if ($excludedAttributes !== null) {\n $queryParams['excludedAttributes'] = ObjectSerializer::toQueryValue($excludedAttributes);\n }\n // query params\n if ($filter !== null) {\n $queryParams['filter'] = ObjectSerializer::toQueryValue($filter);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/scim+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/scim+json'],\n ['application/json', 'application/scim+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Serializes this header and appends it to the given ezcArchiveCharacterFile $archiveFile.
public function writeEncodedHeader( $archiveFile ) { $this->properties["extraFieldLength" ] = 13; // 9 + 4. $enc = pack( "VvvvvvvVVVvvvvvVV", self::magic, // V magic number $this->versionMadeBy, // v $this->versionNeededToExtract, // v $this->bitFlag, // v $this->compressionMethod, // v $this->lastModFileTime, // v $this->lastModFileDate, // v $this->crc, // V $this->compressedSize, // V $this->uncompressedSize, // V $this->fileNameLength, // v $this->extraFieldLength, // v extra data. $this->fileCommentLength , // v Comment $this->diskNumberStart , // v disknumber start $this->internalFileAttributes, // v Internal attribute $this->externalFileAttributes, // V external attributes $this->relativeHeaderOffset // V relative header offset? ); $time = pack( "vvcV", self::EF_TIME, 5, 1, $this->mtime ); // fixme atime? $unix2 = pack( "vv", self::EF_IZUNIX2, 0 ); // Add empty unix2 stamp. $archiveFile->write( $enc . $this->fileName . $time . $unix2 . $this->comment ); }
[ "protected abstract function writeHeader();", "public function __construct( ezcArchiveCharacterFile $file = null )\n {\n if ( !is_null( $file ) )\n {\n $this->properties = unpack (\n \"vversionMadeBy/\".\n \"vversionNeededToExtract/\".\n \"vbitFlag/\".\n \"vcompressionMethod/\".\n \"vlastModFileTime/\".\n \"vlastModFileDate/\".\n \"Vcrc/\".\n \"VcompressedSize/\".\n \"VuncompressedSize/\".\n \"vfileNameLength/\".\n \"vextraFieldLength/\".\n \"vfileCommentLength/\".\n \"vdiskNumberStart/\".\n \"vinternalFileAttributes/\".\n \"VexternalFileAttributes/\".\n \"VrelativeHeaderOffset\",\n $file->read( 42 ) );\n\n $this->properties[\"fileName\"] = $file->read( $this->properties[\"fileNameLength\"] );\n $extraField = $file->read( $this->properties[\"extraFieldLength\"] ); // FIXME, extra fields.\n $this->properties[\"comment\"] = $file->read( $this->properties[\"fileCommentLength\"] );\n\n // Append extra field information.\n $this->setExtraFieldData( $extraField );\n }\n else\n {\n // Some default values:\n $this->properties[\"versionMadeBy\"] = 791;\n $this->properties[\"versionNeededToExtract\"] = 10;\n $this->properties[\"diskNumberStart\"] = 0;\n $this->setComment( \"\" );\n }\n }", "protected function writeKeyExpansionArchiveExtraHeader()\n\t{\n\t\t$expansionParams = $this->encryptionObject->getKeyDerivationParameters();\n\n\t\tswitch ($expansionParams['algorithm'])\n\t\t{\n\t\t\tdefault:\n\t\t\tcase 'sha1':\n\t\t\t\t$algo = 0;\n\t\t\t\tbreak;\n\n\t\t\tcase 'sha256':\n\t\t\t\t$algo = 1;\n\t\t\t\tbreak;\n\n\t\t\tcase 'sha512':\n\t\t\t\t$algo = 2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$hasStaticSalt = $expansionParams['useStaticSalt'];\n\t\t$staticSalt = $expansionParams['staticSalt'];\n\n\t\tif (!$hasStaticSalt)\n\t\t{\n\t\t\t$staticSalt = \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\";\n\t\t\t$staticSalt .= \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\";\n\t\t\t$staticSalt .= \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\";\n\t\t\t$staticSalt .= \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\";\n\t\t}\n\n\t\t// -- Header\n\t\t$this->fwrite($this->fp, \"JH\\x00\\x01\");\n\t\t// -- Field length (with header)\n\t\t$this->fwrite($this->fp, pack('v', 12 + $this->stringLength($staticSalt)));\n\t\t// -- Algorithm, iterations, has static salt\n\t\t$this->fwrite($this->fp, pack('CVC', $algo, $expansionParams['iterations'], $hasStaticSalt));\n\t\t// -- Static salt\n\t\t$this->fwrite($this->fp, $staticSalt);\n\t}", "public function writeHeader();", "public function addFileHeader(): void\n {\n $name = static::filterFilename($this->name);\n\n // calculate name length\n $nameLength = strlen($name);\n\n // create dos timestamp\n $time = static::dosTime($this->opt->getTime()->getTimestamp());\n\n $comment = $this->opt->getComment();\n\n if (!mb_check_encoding($name, 'ASCII') ||\n !mb_check_encoding($comment, 'ASCII')) {\n // Sets Bit 11: Language encoding flag (EFS). If this bit is set,\n // the filename and comment fields for this file\n // MUST be encoded using UTF-8. (see APPENDIX D)\n if (mb_check_encoding($name, 'UTF-8') &&\n mb_check_encoding($comment, 'UTF-8')) {\n $this->bits |= self::BIT_EFS_UTF8;\n }\n }\n\n if ($this->method->equals(Method::DEFLATE())) {\n $this->version = Version::DEFLATE();\n }\n\n $force = (bool)($this->bits & self::BIT_ZERO_HEADER) &&\n $this->zip->opt->isEnableZip64();\n\n $footer = $this->buildZip64ExtraBlock($force);\n\n // If this file will start over 4GB limit in ZIP file,\n // CDR record will have to use Zip64 extension to describe offset\n // to keep consistency we use the same value here\n if ($this->zip->ofs->isOver32()) {\n $this->version = Version::ZIP64();\n }\n\n $fields = [\n ['V', ZipStream::FILE_HEADER_SIGNATURE],\n ['v', $this->version->getValue()], // Version needed to Extract\n ['v', $this->bits], // General purpose bit flags - data descriptor flag set\n ['v', $this->method->getValue()], // Compression method\n ['V', $time], // Timestamp (DOS Format)\n ['V', $this->crc], // CRC32 of data (0 -> moved to data descriptor footer)\n ['V', $this->zlen->getLowFF($force)], // Length of compressed data (forced to 0xFFFFFFFF for zero header)\n ['V', $this->len->getLowFF($force)], // Length of original data (forced to 0xFFFFFFFF for zero header)\n ['v', $nameLength], // Length of filename\n ['v', strlen($footer)], // Extra data (see above)\n ];\n\n // pack fields and calculate \"total\" length\n $header = ZipStream::packFields($fields);\n\n // print header and filename\n $data = $header . $name . $footer;\n $this->zip->send($data);\n\n // save header length\n $this->hlen = Bigint::init(strlen($data));\n }", "private function writeHeader() {\n $this->write($this->header);\n }", "function cyprus_attr_archive_header( $attr ) {\n\n\t$attr['class'] = 'archive-header';\n\t$attr['itemscope'] = 'itemscope';\n\t$attr['itemtype'] = 'http://schema.org/WebPageElement';\n\n\treturn $attr;\n}", "function zues_attr_archive_header( $attr ) {\n\n\t$attr['class'] = 'archive-header';\n\t$attr['itemscope'] = 'itemscope';\n\t$attr['itemtype'] = 'http://schema.org/WebPageElement';\n\n\treturn $attr;\n}", "public static function archive() {\r\n return new FileAttributes(\"ARCHIVE\", 32);\r\n }", "function _store_header() {\n $record = 0x0014; // Record identifier\n\n $str = $this->_header; // header string\n $cch = strlen($str); // Length of header string\n $length = 1 + $cch; // Bytes to follow\n\n $header = pack(\"vv\", $record, $length);\n $data = pack(\"C\", $cch);\n\n $this->_append($header . $data . $str);\n }", "public function setBaseArchiveFile($baseArchiveFile) {\n $this->baseArchiveFile = escapeshellarg($baseArchiveFile);\n }", "private function crearHeader() {\n $fileSize = $this->bytesToString($this->toUint32(strlen($this->fileContents) + 4));\n $this->fileHeader = \"RIFF\" . $fileSize . \"WEBP\";\n }", "private function _writeHeader()\n {\n // Identifier.\n fwrite($this->_targetHandle, \"ID3\");\n\n // Version.\n fwrite($this->_targetHandle, $this->_tagWriter->getVersion());\n\n // Flags.\n fwrite($this->_targetHandle, \"\\x00\");\n\n // Tag-Size.\n $sizeSynchSafe = Helpers::addSynchSafeBits($this->_tagSize);\n fwrite($this->_targetHandle, $sizeSynchSafe);\n }", "public function setHeaderFromArchiveEntry( ezcArchiveEntry $entry )\n {\n $this->fileName = $entry->getPath( false );\n $this->fileMode = $entry->getPermissions();\n $this->userId = $entry->getUserId();\n $this->groupId = $entry->getGroupId();\n $this->fileSize = $entry->getSize();\n $this->modificationTime = $entry->getModificationTime();\n $this->linkName = $entry->getLink( false );\n\n switch ( $entry->getType() )\n {\n case ezcArchiveEntry::IS_FILE:\n $this->type = \"\";\n break; // ends up as a \\0 character.\n\n case ezcArchiveEntry::IS_LINK:\n $this->type = 1;\n break;\n\n case ezcArchiveEntry::IS_SYMBOLIC_LINK:\n $this->type = 2;\n break;\n\n case ezcArchiveEntry::IS_DIRECTORY:\n $this->type = 5;\n break;\n\n // Devices, etc are set to \\0.\n default:\n $this->type = \"\";\n break; // ends up as a \\0 character.\n }\n\n $length = strlen( $this->fileName );\n\n if ( $entry->getType() == ezcArchiveEntry::IS_DIRECTORY )\n {\n // Make sure that the filename ends with a slash.\n if ( $this->fileName[ $length - 1] != \"/\" )\n {\n $this->fileName .= \"/\";\n }\n }\n else\n {\n if ( $this->fileName[ $length - 1] == \"/\" )\n {\n $this->fileName = substr( $header->fileName, 0, -1 ); // Remove last character.\n }\n }\n }", "public function addFile($pathToFile, $pathInArchive)\n {\n $this->entries[$pathInArchive] = $pathInArchive;\n }", "function AddCustomHeader($custom_header) {\n $this->CustomHeader[] = $custom_header;\n }", "public function addEntry($archiveEntry)\n\t{\n\t\tif ($archiveEntry instanceof ArchiveEntry)\n\t\t{\n\t\t\t$this->entries[] = $archiveEntry;\n\t\t}\n\t}", "protected function _packAndWriteCurrentFile()\n {\n $archiveWriter = $this->_getWriter();\n $archiveWriter->write($this->_composeHeader());\n $currentFile = $this->_getCurrentFile();\n $fileSize = 0;\n if (is_file($currentFile) && !is_link($currentFile)) {\n $fileReader = new Mage_Archive_Helper_File($currentFile);\n $fileReader->open('r');\n while (!$fileReader->eof()) {\n $archiveWriter->write($fileReader->read());\n }\n $fileReader->close();\n $fileSize = filesize($currentFile);\n }\n $appendZerosCount = (self::TAR_BLOCK_SIZE - $fileSize % self::TAR_BLOCK_SIZE) % self::TAR_BLOCK_SIZE;\n $archiveWriter->write(str_repeat(\"\\0\", $appendZerosCount));\n }", "function AddCustomHeader($custom_header) {\n $this->CustomHeader[] = explode(\":\", $custom_header, 2);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
upload a photo by random address to google cloud services
function upload($image_info) { $cloud = new ServiceBuilder([ 'keyFilePath' => #'creditals-path'//__DIR__ .'/codex-site-komantnick-5264d6f5074b.json', 'projectId' =>'codex-site-komantnick' ]); $storage = $cloud->storage(); $bucket = $storage->bucket('codex-storage-by-komantnick'); $object = $bucket->object('image.jpg'); $path_parts = pathinfo($image_info['name']); $extension=$path_parts['extension']; $name_file=$image_info['tmp_name']; $filePath=$name_file; $objectName=generateRandomString().".".$extension; echo $objectName."<br>"; $object = $bucket->upload(file_get_contents($filePath), [ 'name' => $objectName, 'predefinedAcl' => 'publicRead' ]); }
[ "public function upload();", "public function actionPutimageinbucket() {\n//first find out which service the API will be accessing and get the details of that service\n\n if (CHttpRequest::getParam('which_service')) {\n $service = CHttpRequest::getParam('which_service');\n $service_details = self::_get_service($service);\n\n//if an image name is given, insert that image, else sync them all\n\n if (isset($_FILES['new_image'])) {\n\n//$image_name = CHttpRequest::getParam('image_name');\n $JSON_array = ApiHelper::_add_image_to_bucket($service_details['bucket'], $_FILES['new_image'], $service_details['database']);\n }\n else\n $JSON_array = ApiHelper::_fill_bucket($service_details['local_file'], $service_details['bucket']);\n }\n else\n throw new CHttpException(404, \"The page you are looking for does not exist.\");\n\n ApiHelper::_sendResponse(200, CJSON::encode($JSON_array));\n }", "public function StaticImageUpload(){\n $design_id = $_POST['new_filename'];\n $uid = $_POST['uid'];\n $uid = empty($uid) ? 0 : $uid;\n $exp = explode(\".\", $_FILES[\"file\"][\"name\"])[1];\n $filename = $design_id.'.'.$exp;\n $new_file = 'public://files/'.$uid.'/kmds/images/static_image/' . $filename;\n $uploaded_image = file_get_contents($_FILES[\"file\"][\"tmp_name\"]);\n file_put_contents($new_file, $uploaded_image);\n $source_original = array(\"src\" => file_create_url($new_file));\n return new JsonResponse($source_original);\n }", "function upload_image($name, $filepath) {\r\n\r\n // Get the $s3 connection\r\n global $s3;\r\n\r\n // Push the image to S3\r\n $result = $s3->putObject([\r\n 'Bucket' => S3_BUCKET,\r\n 'Key' => $name,\r\n // 'Body' => 'test text',\r\n 'SourceFile' => $filepath,\r\n 'ACL' => 'public-read'\r\n ]);\r\n\r\n // Return the public URL\r\n return $result['ObjectURL'];\r\n }", "abstract public function uploadImageToGeocacheLog(array $params);", "function upload_file($event_id, $picture_name, $picture_data)\r\n{\r\n\t// Set save directory\r\n\t$dir = \"img/$event_id\";\r\n\r\n\t// Save Image to database\r\n\t$result = file_put_contents(\"$dir/$picture_name\", file_get_contents(\"data://\".$picture_data));\r\n\t\r\n\treturn $result;\r\n\r\n}", "private function _api_upload_file()\n\t{\n\t\t$this->_api_upload_image();\n\t}", "public function testCreateUploadPhotoRequest()\n {\n }", "function Trigger_ImageUpload4(&$tNG) {\n $uploadObj = new tNG_ImageUpload($tNG);\n $uploadObj->setFormFieldName(\"foto3\");\n $uploadObj->setDbFieldName(\"foto3\");\n $uploadObj->setFolder(\"../Uploads/fotos/\");\n $uploadObj->setResize(\"true\", 200, 0);\n $uploadObj->setMaxSize(1500);\n $uploadObj->setAllowedExtensions(\"gif, jpg, jpe, jpeg, png\");\n $uploadObj->setRename(\"auto\");\n return $uploadObj->Execute();\n}", "function Trigger_ImageUpload2(&$tNG) {\r\r\n $uploadObj = new tNG_ImageUpload($tNG);\r\r\n $uploadObj->setFormFieldName(\"photo3\");\r\r\n $uploadObj->setDbFieldName(\"photo3\");\r\r\n $uploadObj->setFolder(\"assets/images/magasins/\");\r\r\n $uploadObj->setResize(\"true\", 400, 400);\r\r\n $uploadObj->setMaxSize(1500);\r\r\n $uploadObj->setAllowedExtensions(\"gif, jpg, jpe, jpeg, png\");\r\r\n $uploadObj->setRename(\"auto\");\r\r\n return $uploadObj->Execute();\r\r\n}", "function insert_file_into_image(){\n\t\t// Set parameters and execute\n\t\t/*\n\t\t$name = \"demo_img_1\";\n\t\t$url = \"/images/$name\";\n\t\t$location = 1;\n\t\t*/\n\t\tglobal $app, $conn;\n\t\t$req = $app->request();\n\t\t$body = json_decode($req->getBody());\n\t\t$sql = \"INSERT INTO image (name, url) VALUES (?, ?)\";\n\t\t$stmt = $conn->prepare($sql);\n\t\tif($stmt === false) {\n\t\t echo json_encode('Wrong SQL: ' . $sql . ' Error: ' . $conn->errno . ' ' . $conn->error, E_USER_ERROR);\n\t\t return;\n\t\t}\n\t\telse {\n\t\t // Bind parameters. Types: s = string, i = integer, d = double, b = blob \n\t\t $stmt->bind_param(\"ss\", $body->name, $body->url);\n\t\t $stmt->execute();\n\t\t\t//echo \"New records created successfully\\n\";\n\t\t}\n\t}", "abstract public function getRandomPhoto();", "public function upload_IMAGE_file()\n\t{\n\t\tif (!$this->is_allowed('store_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'store',\n\t\t]);\n\t}", "public function uploadImage($vendor_id, $request);", "public function uploadImage()\n {\n }", "function gstore_photo_upload($photo_name)\n {\n\t global $database, $url;\n \n\t // SET KEY VARIABLES\n\t $file_maxsize = \"4194304\";\n\t $file_exts = explode(\",\", str_replace(\" \", \"\", strtolower($this->gstoreowner_level_info['level_gstore_photo_exts'])));\n\t $file_types = explode(\",\", str_replace(\" \", \"\", strtolower(\"image/jpeg, image/jpg, image/jpe, image/pjpeg, image/pjpg, image/x-jpeg, x-jpg, image/gif, image/x-gif, image/png, image/x-png\")));\n\t $file_maxwidth = $this->gstoreowner_level_info['level_gstore_photo_width'];\n\t $file_maxheight = $this->gstoreowner_level_info['level_gstore_photo_height'];\n\t $photo_newname = \"0_\".rand(1000, 9999).\".jpg\";\n\t $file_dest = $this->gstore_dir($this->gstore_info['gstore_id']).$photo_newname;\n\t $thumb_dest = substr($file_dest, 0, strrpos($file_dest, \".\")).\"_thumb\".substr($file_dest, strrpos($file_dest, \".\"));\n \n\t $new_photo = new se_upload();\n\t $new_photo->new_upload($photo_name, $file_maxsize, $file_exts, $file_types, $file_maxwidth, $file_maxheight);\n \n\t // UPLOAD AND RESIZE PHOTO IF NO ERROR\n\t if( !$new_photo->is_error )\n {\n\t // DELETE OLD AVATAR IF EXISTS\n\t $this->gstore_photo_delete();\n \n\t // UPLOAD THUMB\n\t $new_photo->upload_thumb($thumb_dest, 130);\n \n\t // CHECK IF IMAGE RESIZING IS AVAILABLE, OTHERWISE MOVE UPLOADED IMAGE\n\t if( $new_photo->is_image )\n\t $new_photo->upload_photo($file_dest);\n\t else\n\t $new_photo->upload_file($file_dest);\n \n\t // UPDATE gstore INFO WITH IMAGE IF STILL NO ERROR\n\t if( !$new_photo->is_error )\n {\n $sql = \"UPDATE se_gstores SET gstore_photo='{$photo_newname}' WHERE gstore_id='{$this->gstore_info['gstore_id']}'\";\n\t $database->database_query($sql);\n\t $this->gstore_info['gstore_photo'] = $photo_newname;\n\t }\n\t }\n \n\t $this->is_error = $new_photo->is_error;\n\t $this->error_message = $new_photo->error_message;\n\t}", "public function uploadAvatar()\n {\n\n $userId = $this->getUserId();\n\n $conn = Db::getConnection();\n $statement = $conn->prepare(\"update Users set profileImage=:avatar where id = :id \");\n $statement->bindValue(':avatar', $this->avatar);\n $statement->bindValue(':id', $userId);\n $statement->execute();\n }", "public function testReplicateFileSuccess()\n {\n $user = $this->initUser(str_random(5) . \"@imac.com\", str_random(10));\n $token = \\JWTAuth::fromUser($user);\n $bucket = str_random(10);\n $this->createBucket($user, $bucket);\n $this->uploadFile($bucket, $token);\n $this->post(\"api/v1/file/replicate?token={$token}\", [\n \"bucket\" => $bucket,\n \"file\" => \"test.jpg\"\n ], [])\n ->seeStatusCode(200)\n ->seeJsonContains([\n \"message\" => \"Replication is successfully\"\n ]);\n }", "public function executeUploadPics()\n {\n $limit = 12; //3x4\n\n $currentDir = $this->inicialize(true);\n\n if ($this->getRequestParameter('type') == 'url'){\n $absCurrentDir = sfConfig::get('sf_upload_dir').'/pic/' . $currentDir;\n \n $fileName = $this->sanitizeFile($this->getRequest()->getFileName('file'));\n \n if ( strstr($this->getRequest()->getFileType('file'), 'image') == false ){\n\treturn 'Fail';\n }\n \n\t\n $absFile = $absCurrentDir .'/' . $fileName;\n\t\n while(file_exists($absFile)){\n\t$r = rand ();\n\t$absFile = $absCurrentDir .'/' . $r . $fileName;\n }\n\n\n //copiar archivo\n //$this->getRequest()->moveFile('file', $absCurrentDir . '/' . $fileName);\n //Crear miniatura.\n try{\n\t$thumbnail = new sfThumbnail(sfConfig::get('app_thumbnail_hor'), sfConfig::get('app_thumbnail_ver'));\n\t$thumbnail->loadFile($this->getRequest()->getFilePath('file'));\n\t@mkdir($absCurrentDir, 0777, true);\n\n\t$thumbnail->save($absFile, 'image/jpeg');\n }catch(Exception $e){\n\t$this->getRequest()->moveFile('file', $absFile);\n }\n \n\n \n $aux = 'Pic'.ucfirst($this->que);\n \n $pic = new Pic();\n $pic->setUrl('/uploads/pic/' . $currentDir . '/' . $r . $fileName);\n $pic->save();\n $pic_object = new $aux;\n $pic_object->setPicId($pic->getId());\n $pic_object->setOtherId($this->object_id);\n $pic_object->save();\n }\n\n $this->mm_id = $this->getRequestParameter('mm');\n $this->msg_alert = array('info', \"Nueva imagen insertada.\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find the changeset post ID for a given changeset UUID.
public function find_changeset_post_id($uuid) { }
[ "public function find_changeset_post_id($uuid)\n {\n }", "public function find_changeset_post_id($uuid)\n {\n $cache_group = 'customize_changeset_post';\n $changeset_post_id = wp_cache_get($uuid, $cache_group);\n if ($changeset_post_id && 'customize_changeset' === get_post_type($changeset_post_id)) {\n return $changeset_post_id;\n }\n\n $changeset_post_query = new WP_Query(array(\n 'post_type' => 'customize_changeset',\n 'post_status' => get_post_stati(),\n 'name' => $uuid,\n 'posts_per_page' => 1,\n 'no_found_rows' => true,\n 'cache_results' => true,\n 'update_post_meta_cache' => false,\n 'update_post_term_cache' => false,\n 'lazy_load_term_meta' => false,\n ));\n if (!empty($changeset_post_query->posts)) {\n // Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed.\n $changeset_post_id = $changeset_post_query->posts[0]->ID;\n wp_cache_set($this->_changeset_uuid, $changeset_post_id, $cache_group);\n return $changeset_post_id;\n }\n\n return null;\n }", "public function changeset_post_id() {}", "public function changeset_uuid()\n {\n return $this->_changeset_uuid;\n }", "public function getPostId();", "private function getPostID()\n {\n global $post;\n\n if (defined('REST_REQUEST') && REST_REQUEST && $this->is_posts_request) {\n return $this->post_id;\n }\n\n if (!empty($post) && is_object($post)) {\n return ('auto-draft' == $post->post_status) ? 0 : $post->ID;\n\t\t} elseif (isset($_REQUEST['post'])) {\n return (int)$_REQUEST['post'];\n } elseif (isset($_REQUEST['post_ID'])) {\n return (int)$_REQUEST['post_ID'];\n } elseif (isset($_REQUEST['post_id'])) {\n return (int)$_REQUEST['post_id'];\n }\n\t}", "protected function findAncestorId( $post ) {\n\t\t$ancestors = get_post_ancestors( $post );\n\t\tif ( count( $ancestors ) )\n\t\t\treturn end( $ancestors );\n\t\telse\n\t\t\treturn $post->ID;\n\t}", "public function changeset_post_id()\n {\n }", "public function get_post_id()\n {\n global $post;\n return $this->post_id = $post->ID;\n }", "protected function _getPostId()\n {\n return (int) $this->_coreRegistry->registry(\n ViewAction::REGISTRY_KEY_POST_ID\n );\n }", "public function changeset_post_id()\n {\n }", "function give_get_admin_post_id() {\n\t$post_id = isset( $_REQUEST['post'] ) ? absint( $_REQUEST['post'] ) : null;\n\n\t$post_id = ! empty( $post_id ) ? $post_id : ( isset( $_REQUEST['post_id'] ) ? absint( $_REQUEST['post_id'] ) : null );\n\n\t$post_id = ! empty( $post_id ) ? $post_id : ( isset( $_REQUEST['post_ID'] ) ? absint( $_REQUEST['post_ID'] ) : null );\n\n\treturn $post_id;\n}", "private function get_post_id_by_request() {\n\t\tif ( isset( $_GET['post'] ) && is_numeric( $_GET['post'] )) {\n\t\t\treturn $_GET['post'];\n\t\t}\n\t\tif ( isset( $_POST['post_ID'] ) && is_numeric( $_POST['post_ID'] ) ) {\n\t\t\treturn $_POST['post_ID'];\n\t\t}\n\n\t\treturn null;\n\t}", "function getPostIdbyContent($post){\n\t\t$conn=mysqli_connect(\"cse.unl.edu\",\"rcarlso\",\"a@9VUi\",\"rcarlso\");\n\t\tif (mysqli_connect_errno($conn)){\n\t\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t}\n\t\t$query = $conn->prepare(\"SELECT PostID FROM Post WHERE Post = ?\");\n\t\t$query->bind_param(\"s\", $post);\n\t\t$query->execute();\n\t\t$query->bind_result($postId);\n\t\t$query->fetch();\n\t\n\t\t$query->close();\n\t\t$conn->close();\n\t\treturn $postId;\n\t}", "public static function get_post_id() {\n\t\t$post_id = 0;\n\n\t\tif ( isset( $_REQUEST['post'] ) ) {\n\t\t\t$post_id = $_REQUEST['post'];\n\t\t} elseif ( isset( $_REQUEST['post_id'] ) ) {\n\t\t\t$post_id = $_REQUEST['post_id'];\n\t\t}\n\n\t\treturn absint( wp_unslash( $post_id ) );\n\t}", "public function getPostId()\n {\n $itemId = $this->meta_input['rss_id'];\n $postType = $this->post_type;\n\n global $wpdb;\n $tablePrefix = $wpdb->prefix;\n $sql = \"\n SELECT {$tablePrefix}posts.ID\n FROM {$tablePrefix}posts\n LEFT JOIN {$tablePrefix}postmeta ON {$tablePrefix}postmeta.post_id = {$tablePrefix}posts.ID\n WHERE {$tablePrefix}postmeta.meta_value = '{$itemId}' AND {$tablePrefix}posts.post_type = '{$postType}' AND {$tablePrefix}posts.post_status != 'trash'\n \";\n $results = $wpdb->get_results($sql, ARRAY_A);\n\n if (empty($results)) {\n return 0;\n }\n\n return (int) $results[0]['ID'];\n }", "function get_post_id() {\n\t\treturn apply_filters( 'bpsp_editable_post_id', 0 );\n\t}", "public function get_stepID($UUID)\n {\n $this->db->select('id');\n $this->db->from('tb_line_step');\n $this->db->where('UUID',$UUID);\n $query = $this->db->get();\n return $query->result_array()[0]['id'];\n }", "function bf_get_admin_current_post_id() {\n\n\t\tglobal $post;\n\n\t\t$p_post_id = isset( $_POST['post_ID'] ) ? $_POST['post_ID'] : null;\n\n\t\t$g_post_id = isset( $_GET['post'] ) ? $_GET['post'] : null;\n\n\t\t$post_id = $g_post_id ? $g_post_id : $p_post_id;\n\n\t\t$post_id = isset( $post->ID ) ? $post->ID : $post_id;\n\n\t\tif ( isset( $post_id ) ) {\n\t\t\treturn (integer) $post_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created TblPalabras in storage.
public function store(CreateTblPalabrasRequest $request) { $input = $request->all(); $tblPalabras = $this->tblPalabrasRepository->create($input); Flash::success('TblPalabras saved successfully.'); return redirect(route('tblPalabras.index')); }
[ "public function SaveBalancoPecas() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstOrdemProducaoGrade) $this->objBalancoPecas->OrdemProducaoGradeId = $this->lstOrdemProducaoGrade->SelectedValue;\n\t\t\t\tif ($this->txtBalanco) $this->objBalancoPecas->Balanco = $this->txtBalanco->Text;\n\t\t\t\tif ($this->txtQuantidadeProduzida) $this->objBalancoPecas->QuantidadeProduzida = $this->txtQuantidadeProduzida->Text;\n\t\t\t\tif ($this->chkConcluido) $this->objBalancoPecas->Concluido = $this->chkConcluido->Checked;\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 BalancoPecas object\n\t\t\t\t$this->objBalancoPecas->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 saveAction(){\n\t\t$table = new ProfessorAluno();\n\t\t$table->save();\n\t\t$this->_redirect('ProfessorAluno/list');\n\t}", "public function save()\n {\n $this->insert(array_keys($this->rowData), $this->rowData);\n }", "public function store()\n { \n $this->model->load('BinhLuan');\n $this->model->BinhLuan->baihat_id = $_POST['baihat_id'];\n $this->model->BinhLuan->user_id = $_POST['user_id'];\n $this->model->BinhLuan->noi_dung = $_POST['noi_dung'];\n \n $this->model->BinhLuan->save();\n\n go_back();\n }", "public function SaveBalancoAcoes() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstOrdemProducaoGrade) $this->objBalancoAcoes->OrdemProducaoGradeId = $this->lstOrdemProducaoGrade->SelectedValue;\n\t\t\t\tif ($this->lstFluxogramaItemReal) $this->objBalancoAcoes->FluxogramaItemRealId = $this->lstFluxogramaItemReal->SelectedValue;\n\t\t\t\tif ($this->txtQuantidadeDisponivel) $this->objBalancoAcoes->QuantidadeDisponivel = $this->txtQuantidadeDisponivel->Text;\n\t\t\t\tif ($this->txtQuantidadeRemetida) $this->objBalancoAcoes->QuantidadeRemetida = $this->txtQuantidadeRemetida->Text;\n\t\t\t\tif ($this->txtQuantidadeProduzida) $this->objBalancoAcoes->QuantidadeProduzida = $this->txtQuantidadeProduzida->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 BalancoAcoes object\n\t\t\t\t$this->objBalancoAcoes->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 saveToDb()\n\t{\n\t\t$this->saveQuestionSequence();\n\t\t$this->saveNewlyCheckedQuestion();\n\t}", "public function SaveOrdemProducao() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->txtNumero) $this->objOrdemProducao->Numero = $this->txtNumero->Text;\n\t\t\t\tif ($this->lstReferencia) $this->objOrdemProducao->ReferenciaId = $this->lstReferencia->SelectedValue;\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 OrdemProducao object\n\t\t\t\t$this->objOrdemProducao->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 persist() {\n $this -> rules ? $this -> course['rules'] = serialize($this -> rules) : $this -> course['rules'] = null;\n $this -> options ? $this -> course['options'] = serialize($this -> options) : $this -> course['options'] = null;\n $this -> course['price'] = str_replace(array($GLOBALS['configuration']['decimal_point'], $GLOBALS['configuration']['thousands_sep']), array('.', ''), $this -> course['price']); //This way, you handle the case where the price is in the form 1,000.00\n $fields = $this -> validateAndSanitizeCourseFields($this -> course);\n eF_updateTableData(\"courses\", $fields, \"id=\".$this -> course['id']);\n if (!defined(_DISABLE_SEARCH) || _DISABLE_SEARCH !== true) {\n EfrontSearch :: removeText('courses', $this -> course['id'], '');\n EfrontSearch :: insertText($fields['name'], $this -> course['id'], \"courses\", \"title\");\n }\n return true;\n }", "function salva()\n {\n restauraConObj($this->mapa, $this->postgis_mapa);\n $this->mapa->save($this->arquivo);\n }", "public function save()\n\t{\n\t\t$db = Database::getInstance();\n\t\t$sql = \"INSERT INTO pedido(CodUsu, fecPedido, numeroPedido) values (:idu, :fec, :tok)\";\n\n\t\t$data = [\n\t\t\t\":idu\" => \"{$this->CodUsu}\",\n\t\t\t\":fec\" => \"{$this->fecPedido}\",\n\t\t\t\":tok\" => \"{$this->numeroPedido}\"\n\t\t];\n\n\t\techo \"<pre>\" . print_r($data, true) . \"</pre>\";\n\t\t//die() ;\n\n\t\t$db->bindAll($sql, $data);\n\t}", "function save() {\n\t\tparent::save();\n\t\tif (null !== $this->_relation && null !== ($relation = $this->_storage->getInstance($this->_relation)))\n\t\t\t$relation->save();\n\t}", "public function insert($lecturabalancehidrico);", "function saveNew()\n\t{\n\t\tglobal $sql;\n\t\t$name = sql::Escape($this->name);\n\t\t$link = sql::Escape($this->link);\n\t\t$image = sql::Escape($this->image);\n\t\t$sql->Query(\"INSERT INTO $this->tablename SET\n\t\t\t\t\tname = '$name',\n\t\t\t\t\ttype = '$this->type',\n\t\t\t\t\tlink = '$link',\n\t\t\t\t\timage = '$image',\n\t\t\t\t\tparent = '$this->parent'\n\t\t\t\t\t\");\n\t\t$this->id=$sql->GetLastId();\n\t}", "public function saveToDB(){\n\t\t\tforeach($this->formFields_ as $formField)\n\t\t\t\t$formField->saveToDB($this->formID(), $this->moduleID());\n\t\t}", "public function store(CreateDataPenjualanBarangRequest $request)\n {\n DB::beginTransaction();\n try {\n $input = $request->all();\n $input['TOTAL_BERSIH'] = str_replace('.','', $input['TOTAL_BERSIH']);\n $dataPenjualanBarang = $this->dataPenjualanBarangRepository->create($input);\n foreach ($input['id_barang'] as $key => $row) {\n $detail_penjualan_barang = new \\App\\Models\\DetailPenjualanBarang();\n $barang = DataBarang::where('ID_BARANG', $input['id_barang'][$key])->first();\n $detail_penjualan_barang->ID_TRANSAKSI_PENJUALAN = $dataPenjualanBarang->ID_TRANSAKSI_PENJUALAN;\n $detail_penjualan_barang->ID_BARANG = $barang->ID_BARANG;\n $detail_penjualan_barang->QTY = $input['qty'][$key];\n $detail_penjualan_barang->HARGA_JUAL = $input['harga'][$key];\n $detail_penjualan_barang->SUBTOTAL = $input['subtotal'][$key];\n $detail_penjualan_barang->save();\n $new_stok = (int)$barang->STOK - (int)$input['qty'][$key];\n if ($new_stok<0) {\n Flash::error('Barang Habis');\n DB::rollBack();\n return redirect(route('dataPenjualanBarangs.create'));\n }\n else {\n $barang->STOK = $new_stok;\n $barang->save(); \n $result = $dataPenjualanBarang->id;\n DB::commit();\n Flash::success('Data Penjualan Barang saved successfully.');\n return redirect(route('dataPenjualanBarangs.index'));\n }\n }\n } catch (Exception $e) {\n DB::rollBack();\n } \n }", "function salva()\n\t{\n\t\trestauraConObj($this->mapa,$this->postgis_mapa);\n\t\t$this->mapa->save($this->arquivo);\n\t}", "function saveNew() {\n\t\t$this->prepareForDb(); \n\t\t$query = \"INSERT INTO `\".sql_table('plug_miniforum_templates').\"` \".\n\t\t\t $this->prepareQuery();\t\t\n\t\t\t\t\t\n\t\tsql_query($query);\n }", "public function actionCreate()\n {\n $model = new PdmB7();\n $id = \\Yii::$app->session->get('id_perkara');\n\n $modelSpdp = PdmSpdp::findOne(['id_perkara' => $id]);\n\n $barbuk = Yii::$app->globalfunc->getBarbuk($id);\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->db->beginTransaction();\n\n try {\n\n $seq = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_b7', 'id_b7', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n\n $model->id_perkara = $id;\n $model->id_b7 = $seq['generate_pk'];\n $model->save();\n\n //PdmTembusan::deleteAll(['id_perkara' => $model->id_perkara,'kode_table'=>GlobalConstMenuComponent::B7]);\n if(!empty($_POST['new_tembusan'])){\n for($i = 0; $i < count($_POST['new_tembusan']); $i++){\n $modelNewTembusan= new PdmTembusan();\n $modelNewTembusan->id_table = $model->id_b7;\n $seqTembusan = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_tembusan', 'id_tembusan', '\" . \\Yii::$app->globalfunc->getSatker()->inst_satkerkd . \"', '\" . date('Y') . \"')\")->queryOne();\n $modelNewTembusan->id_tembusan = $seqTembusan['generate_pk'];\n $modelNewTembusan->kode_table = GlobalConstMenuComponent::B7;\n $modelNewTembusan->keterangan = $_POST['new_tembusan'][$i];\n $modelNewTembusan->tembusan = $_POST['new_tembusan'][$i];\n $modelNewTembusan->no_urut=$_POST['new_no_urut'][$i];\n $modelNewTembusan->id_perkara = $model->id_perkara;\n $modelNewTembusan->nip = null;\n $modelNewTembusan->save();\n }\n }\n\n Yii::$app->globalfunc->getSetStatusProcces($model->id_perkara,GlobalConstMenuComponent::B7);\n $transaction->commit();\n\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Simpan',\n 'title' => 'Ubah Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect('index');\n }catch (Exception $e) {\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'danger',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Gagal di Simpan',\n 'title' => 'Error',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n $transaction->rollback();\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'modelSpdp' => $modelSpdp,\n 'barbuk'=>$barbuk,\n ]);\n }\n }", "public function saveSchema()\n {\n $db = ezcDbInstance::get();\n $schema = ezcDbSchema::createFromDb( $db );\n $schema->writeToFile( \"array\", dirname( __FILE__ ) . \"/relation.dba\" );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invalidate update pivot for belongsToMany.
public function belongsToManyUpdatedExistingPivot($relation, Model $model, $ids) { $this->invalidateCache($model, $relation, $model->{$relation}()->findMany($ids)); }
[ "public function updatePivotRecords()\n {\n $pivots = $this->entityMap->getPivotRelationships();\n\n foreach ($pivots as $pivot) {\n if (array_key_exists($pivot, $this->relationships)) {\n $this->updatePivotRelation($pivot);\n }\n }\n }", "public function touch()\n {\n $key = $this->getRelated ()->getKeyName ();\n $columns = $this->getRelatedFreshUpdate ();\n $ids = $this->getRelatedIds ();\n if ( count ( $ids ) > 0 ) {\n $this->getRelated ()->newQuery ()->whereIn ( $key, $ids )->update ( $columns );\n }\n }", "public function invalidatePropertyIds()\n {\n Yii::$app->cache->delete(\"PropertyIdsForGroup:{$this->id}\");\n Yii::$app->cache->delete(\"AutoAddedGroupsIds:{$this->applicable_property_model_id}\");\n }", "public function touch()\n {\n $key = $this->getRelated()->getKeyName();\n\n $columns = [\n $this->related->getUpdatedAtColumn() => $this->related->freshTimestampString(),\n $this->related->getUpdatedByColumn() => $this->related->currentUserId(),\n ];\n\n // If we actually have IDs for the relation, we will run the query to update all\n // the related model's timestamps, to make sure these all reflect the changes\n // to the parent models. This will help us keep any caching synced up here.\n if (count($ids = $this->allRelatedIds()) > 0) {\n $this->getRelated()->newQuery()->whereIn($key, $ids)->updateOwnerships($columns);\n }\n }", "public function touchOwners()\n {\n foreach ($this->getTouchedRelations() as $relation) {\n $this->$relation()->touch();\n\n if ($this->$relation instanceof self) {\n $this->$relation->fireModelEvent('saved', false);\n\n $this->$relation->touchOwners();\n } elseif ($this->$relation instanceof Collection) {\n $this->$relation->each->touchOwners();\n }\n }\n }", "public function touch(): void\n {\n $model = $this->getRelated();\n\n if (!$model::isIgnoringTouch()) {\n $entity = $this->getResults();\n if (null !== $entity) {\n $entity->updateTimestamps();\n $entity->save();\n }\n }\n }", "public function resetChildHasChanges();", "public function updateProductListPivot()\n {\n $model = $this->productListable;\n $products = $model->products()->get('id');\n $this->products()->sync($products->pluck('id'));\n }", "public function deleteMany(){}", "protected function afterSave()\n {\n foreach ($this->getMetaData()->relations as $name => $relation) {\n if ($this->hasRelated($name) && is_array($values = $this->$name)) {\n unset($this->$name);\n $className = $this->getMetaData()->relations[$name]->className;\n $foreignKey = $this->getMetaData()->relations[$name]->foreignKey;\n $primaryKey = $this::model($className)->getTableSchema()->primaryKey;\n $savedModelList = array();\n foreach ($this->$name as $value) {\n $savedModelList[$value->$primaryKey] = $value;\n }\n foreach ($values as $value) {\n if (isset($savedModelList[$value[$primaryKey]])) {\n $model = clone($savedModelList[$value[$primaryKey]]);\n unset($savedModelList[$value[$primaryKey]]);\n } else {\n $model = new $className();\n }\n $model->attributes = $value;\n $model->$foreignKey = $this->$foreignKey;\n if (!$model->save())\n throw new CDbException(Yii::t('base', 'Save relations fail!'), 0, $model);\n }\n if ($savedModelList) {\n $cri = new CDbCriteria();\n $cri->addInCondition($primaryKey, array_keys($savedModelList));\n $this::model($className)->deleteAll($cri);\n }\n }\n }\n parent::afterSave();\n }", "public function checkOutVersion(){\n\n foreach($this->relations as $key => $relationModel){\n if(!is_null($relationModel)){\n if($relationModel instanceof Collection){\n $relationModel->each(function($relationModel, $key){\n $relationModel->checkOutVersion();\n });\n }else if($relationModel instanceof self){\n $relationModel->checkOutVersion();\n }\n }\n }\n\n session()->forget($this->getSessionKey($this->getAttribute($this->getKeyName())));\n\n }", "public function beforeDelete()\n {\n /** @var BaseActiveRecord $owner */\n $owner = $this->owner;\n foreach ($this->_relationsCascadeDelete as $relationName => $params) {\n if ($params === true) {\n /** @var ActiveQuery $relation */\n $relation = $owner->getRelation($relationName);\n if (!empty($owner->{$relationName})) {\n if ($relation->multiple === true) { // Has many relation\n $this->_relationsToDelete = ArrayHelper::merge($this->_relationsToDelete, $owner->{$relationName});\n } else {\n $this->_relationsToDelete[] = $owner->{$relationName};\n }\n }\n }\n }\n }", "private function clearRelatedProducts()\n {\n ShopRelatedProduct::model()->deleteAll('product_id=:id', array('id' => $this->id));\n }", "public function deleteRelatedData(){\n $modelManager = \\Phalcon\\Di::getDefault()->getShared('modelsManager');\n $relations = $modelManager->getRelations(get_class( $this ));\n foreach($relations as $relation)\n {\n if($relation->getType() == 2){ //only has many\n $referenceModel = $relation->getReferencedModel();\n $this->$referenceModel->delete();\n }\n }\n }", "public function transform(): void\n {\n $this->extractSchemaInfos();\n\n $hasConstraintAnomaly = false;\n\n foreach ($this->foreignKeysConstraintsInfo as $constraint) {\n // If there are data that do not respect a foreign key constraint,\n // it will be impossible to restore the constraint after deleting it.\n // So, we check this before doing any action.\n if ($this->hasConstraintAnomaly($constraint)) {\n $this->message(\n \"Foreign key constraint anomaly: [{$constraint['name']}] \"\n .\"{$constraint['table']}.{$constraint['column']} references \"\n .\"{$constraint['relatedTable']}.{$constraint['relatedColumn']}\",\n 'error'\n );\n\n $hasConstraintAnomaly = true;\n }\n }\n\n if ($hasConstraintAnomaly) {\n return;\n }\n\n // DROP FOREIGN KEY CONSTRAINTS\n\n foreach ($this->foreignKeysConstraintsInfo as $constraint) {\n $this->message(\"Drop foreign on {$constraint['table']}.{$constraint['column']}\");\n\n $this->schemaBuilder->table($constraint['table'], function (Blueprint $blueprint) use ($constraint) {\n $blueprint->dropForeign($constraint['name']);\n });\n }\n\n // CHANGE INT TO BIGINT\n\n foreach ($this->intColumnsInfo as $column) {\n $this->message(\"Change INT to BIGINT for {$column['table']}.{$column['column']}\");\n\n $this->schemaBuilder->table($column['table'], function (Blueprint $blueprint) use ($column) {\n $blueprint\n ->unsignedBigInteger($column['column'], $column['autoIncrement'])\n ->nullable($column['nullable'])\n ->default($column['default'])\n ->change();\n });\n }\n\n // RESTORE FOREIGN KEY CONSTRAINTS\n\n foreach ($this->foreignKeysConstraintsInfo as $constraint) {\n $this->message(\"Restore foreign on {$constraint['table']}.{$constraint['column']}\");\n\n $this->schemaBuilder->table($constraint['table'], function (Blueprint $blueprint) use ($constraint) {\n $blueprint\n ->foreign($constraint['column'], $constraint['name'])\n ->references($constraint['relatedColumn'])\n ->on($constraint['relatedTable'])\n ->onDelete($constraint['onDelete'])\n ->onUpdate($constraint['onUpdate']);\n });\n }\n }", "public function invalidate() {\r\n $this->setNullHandle();\r\n parent::invalidate();\r\n }", "public function afterValidate()\n {\n /* @var $model BaseActiveRecord */\n $model = $this->owner;\n if (!empty($this->_savedHasOneModels) && $model->hasErrors()) {\n $this->_rollbackSavedHasOneModels();\n }\n }", "abstract public function removeQuestionSetRelatedData();", "protected function disableForeignKeys(){\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup text domain, settings and tabs. Called by "plugins_loaded" action hook.
public function setup_plugin() { load_plugin_textdomain($this->get_text_domain(), false, dirname(plugin_basename(__FILE__)).'/languages/'); $tab = ''; if(isset($_GET['tab'])) { $tab = $_GET['tab']; } else if($_SERVER['REQUEST_METHOD'] == 'POST') { parse_str(parse_url(wp_get_referer(), PHP_URL_QUERY), $var_array); if(isset($var_array['page']) && 'seo-core-options' == $var_array['page'] && isset($var_array['tab'])) { $tab = $var_array['tab']; } } switch($tab) { case 'models': $this->settings = $this->get_model_settings(); break; case 'advanced': $this->settings = $this->get_advanced_settings(); break; default: $this->settings = $this->get_model_settings(); break; } $this->tabs = array( 'models' => __("Models", $this->get_text_domain()), 'advanced' => __("Advanced", $this->get_text_domain()), ); }
[ "public function internalSetup()\n {\n // set the text domain according to the current theme text domain, but only if it is not yet set specifically\n if ($this->textDomain == 'default') {\n $wordpressTheme = wp_get_theme();\n $textDomain = $wordpressTheme->get('TextDomain');\n\n // make sure we have something usable\n if (strlen($textDomain) > 0) {\n $this->textDomain = $textDomain;\n }\n }\n }", "function plugin_init() {\r\n // before all load plugin text domain\r\n load_plugin_textDomain( WPS_TEXT_DOMAIN, false, dirname(WPS_DIRECTORY_BASENAME) . '/languages' );\r\n }", "function plugin_init() {\n\t\tload_plugin_textDomain( '<%= projectName %>', false, dirname(<%= definePrefix %>_DIR_BASENAME) . '/languages' );\n\t}", "public static function load_text_domain() {\n\t\tif ( function_exists( 'learn_press_load_plugin_text_domain' ) ) {\n\t\t\tlearn_press_load_plugin_text_domain( LP_ADDON_CONTENT_DRIP_PATH, true );\n\t\t}\n\t}", "public function loadTextdomain()\n {\n load_plugin_textdomain($this->domain, false, $this->directory);\n }", "function init() {\n\n\t// Load plugin text domain.\n\tload_plugin_textdomain(\n\t\t'dashboard-summary',\n\t\tfalse,\n\t\tdirname( DS_BASENAME ) . '/languages'\n\t);\n\n\t// If this is in the must-use plugins directory.\n\tload_muplugin_textdomain(\n\t\t'dashboard-summary',\n\t\tdirname( DS_BASENAME ) . '/languages'\n\t);\n\n\t/**\n\t * Class autoloader\n\t *\n\t * The autoloader registers plugin classes for later use,\n\t * such as running new instances below.\n\t */\n\trequire_once DS_PATH . 'includes/autoloader.php';\n\n\t// Settings and core methods.\n\tnew Classes\\Settings;\n\tnew Classes\\Summary;\n\tnew Classes\\User_Options;\n\n\t// Add settings link to plugin row.\n\tadd_filter( 'plugin_action_links_' . DS_BASENAME, [ __NAMESPACE__ . '\\Classes\\Settings', 'settings_link' ], 99 );\n\tadd_filter( 'network_admin_plugin_action_links_' . DS_BASENAME, [ __NAMESPACE__ . '\\Classes\\Settings', 'settings_link' ], 99 );\n}", "private function setLocale() {\n\n\t\t$plugin_i18n = new BackupProi18n();\n\t\t$plugin_i18n->setDomain( $this->getPluginName() );\n\n\t\t$this->loader->addAction( 'plugins_loaded', $plugin_i18n, 'loadPluginTextdomain' );\n\n\t}", "public function load_plugin_text_domain() {\n load_plugin_textdomain(\n 'text-domain',\n false,\n dirname(dirname(plugin_basename(__FILE__))) . '/languages/'\n );\n\n }", "public function textdomain() {\n\t\tload_plugin_textdomain( 'bbpress-private-replies-enhanced', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\t}", "public function setTextDomain ()\n {\n load_theme_textdomain(THEME_SLUG, THEME_DIR . 'includes/langs');\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new DT_Dummy_i18n();\n\t\t$plugin_i18n->set_domain( $this->get_plugin_name() );\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function setLocale()\n {\n $plugin_i18n = new PointTrackeri18n();\n\n $this->loader->addAction('plugins_loaded', $plugin_i18n, 'loadPluginTextdomain');\n }", "public function textdomain() {\n\t\tload_plugin_textdomain( 'cubepoints', false, dirname( plugin_basename( $this->plugin_file ) ) . '/lang' );\n\t}", "public function loadPluginTextDomain()\n {\n \\load_plugin_textdomain(\n $this->app->text_domain,\n false,\n $this->app->path('lang')\n );\n }", "private function set_locale() {\r\n\r\n\t\t$plugin_i18n = new Acme_Demo_Setup_i18n();\r\n\r\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\r\n\r\n\t}", "public function init(){\n\n\t\t// Before init action\n\t\tdo_action( 'before_masterslider_init' );\n\n\t\t// Load plugin text domain\n\t\t$this->load_plugin_textdomain();\n\n\t\t// Init action\n\t\tdo_action( 'masterslider_init' );\n\t}", "private function setup_locale()\n {\n load_plugin_textdomain(\n DIVIROIDS_PLUGIN_SLUG,\n false,\n DIVIROIDS_PLUGIN_DIR . '/languages/'\n );\n }", "private static function set_locale() {\n\n $plugin_i18n = new PTB_Extra_i18n();\n $plugin_i18n->set_domain(self::$plugin_name);\n $plugin_i18n->load_plugin_textdomain();\n }", "public function admin_init()\r\n\t{\r\n \t \tif ( isset( $_POST[$this->_tag] ) ) {\r\n\t\t\t$this->validate_domain( $_POST[$this->_tag] );\r\n\t\t}\r\n\t\tadd_settings_field(\r\n\t\t\t$this->_tag.'-id',\r\n\t\t\t$this->_name,\r\n\t\t\tarray( &$this, 'setting_callback_function' ),\r\n\t\t\t'permalink',\r\n\t\t\t'optional',\r\n\t\t\t$this->_domain\r\n\t\t);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is given $array with data and weights it according to the of games
function calibrateArray($array, $weight){ $returnArray = initializeArrayToZero($array); foreach($array as $key => $value) { $returnArray[$key] += $weight * $value; } return $returnArray; }
[ "function getBestCompositionOfBrawlers(&$arr) {\n \n global $bdd, $region;\n \n $compositions = array();\n \n $statement = $bdd->prepare('SELECT id from `match`\n WHERE region = \"'.$region.'\"');\n \n $statement->execute();\n $data = $statement->fetchAll();\n \n $numberOfGames = count($data);\n \n $combinations = array();\n \n for ($i = 0; $i < $numberOfGames; $i++) {\n \n $array_tmpB = array();\n $array_tmpR = array();\n \n for ($j = 1; $j <= 4; $j++) {\n \n $itemID = 3610 + $j;\n \n // Blue\n $statement = $bdd->prepare('SELECT count(event.itemID) FROM event\n WHERE event.itemID = '.$itemID.'\n AND event.matchID = '.$data[$i][\"id\"].'\n AND event.participantID < 6');\n $statement->execute();\n $items = $statement->fetchAll();\n \n $nbItem = $items[0][0];\n \n for ($k = 0; $k < $nbItem; $k++) {\n \n array_push($array_tmpB, $j);\n \n }\n \n // Red\n $statement = $bdd->prepare('SELECT count(event.itemID) FROM event\n WHERE event.itemID = '.$itemID.'\n AND event.matchID = '.$data[$i][\"id\"].'\n AND event.participantID >= 6');\n $statement->execute();\n $items = $statement->fetchAll();\n \n $nbItem = $items[0][0];\n \n for ($k = 0; $k < $nbItem; $k++) {\n \n array_push($array_tmpR, $j);\n \n }\n \n }\n\n sort($array_tmpB);\n sort($array_tmpR);\n $combinationB = implode($array_tmpB);\n $combinationR = implode($array_tmpR);\n \n if (!isset($combinations[$combinationB])) {\n \n $combinations[$combinationB] = 0;\n \n }\n \n $combinations[$combinationB]++;\n \n if (!isset($combinations[$combinationR])) {\n \n $combinations[$combinationR] = 0;\n \n }\n \n $combinations[$combinationR]++;\n \n }\n \n arsort($combinations);\n \n $firstKey = array_keys($combinations)[0];\n \n $arr[\"compositions\"] = array();\n $arr[\"compositions\"][\"mostPopular\"] = array();\n \n $arr[\"compositions\"][\"mostPopular\"][\"setup\"] = $firstKey;\n $arr[\"compositions\"][\"mostPopular\"][\"number\"] = $combinations[$firstKey];\n \n $arr[\"compositions\"][\"noBrawlers\"] = $combinations[null];\n \n }", "function calculatePlates($targetweight, $barbellweight, $plates)\n{\n\n$loadedweights = [];\n$loadedweight = $barbellweight;\n\nforeach ($plates as $plate)\n{\n while ($loadedweight + ($plate*2) <= $targetweight )\n {\n\n array_push($loadedweights, $plate);\n $loadedweight += $plate*2;\n }\n\n}\n\nreturn $loadedweights;\n}", "public function calculateTotalRanking()\n {\n $resultsGames = Cache::get('resultsGameLines');\n //data in cache are received in array of games\n foreach ($resultsGames as $keyGame => $game) {\n\n foreach ($game as $keyPlayer => $playerLineScore) {\n\n if ($keyGame == 'league') {\n $newLinePlayerGameData = new dataGamePlayer();\n if (is_array($playerLineScore)) {\n\n $newLinePlayerGameData->setLinePlayerGameData(\n $keyGame,\n $playerLineScore[0],\n $playerLineScore[1],\n $playerLineScore[2],\n $playerLineScore[3],\n $playerLineScore[4],\n $playerLineScore[5],\n $playerLineScore[6],\n $playerLineScore[7],\n $playerLineScore[8],\n $playerLineScore[9]);\n\n $playersLeague[] = $newLinePlayerGameData->calculateScoreByGameAndPlayer();\n\n }\n }\n if ($keyGame == 'valorant') {\n $newLinePlayerGameData = new dataGamePlayer();\n if (is_array($playerLineScore)) {\n //$game, $player, $nick, $team,$winner, $kills, $deaths\n $newLinePlayerGameData->setLinePlayerGameDataB(\n $keyGame,\n $playerLineScore[0],\n $playerLineScore[1],\n $playerLineScore[2],\n $playerLineScore[3],\n $playerLineScore[4],\n $playerLineScore[5]\n );\n $playersValorant[] = $newLinePlayerGameData->calculateScoreByGameAndPlayer();\n\n }\n }\n\n }\n }\n\n //apply order\n $playersLeagueNickAndScore = array_column($playersLeague, \"score\",\"nick\");\n array_multisort($playersLeagueNickAndScore, SORT_DESC, $playersLeagueNickAndScore);\n\n $playersValorantNickAndScore = array_column($playersValorant, \"score\",\"nick\");\n array_multisort($playersValorantNickAndScore, SORT_DESC, $playersValorantNickAndScore);\n\n $totalRanking = array();\n foreach ($playersLeagueNickAndScore as $keyNick => $value) {\n $totalRanking[$keyNick] = $value;\n }\n foreach ($playersValorantNickAndScore as $keyNick => $value) {\n if(isset($totalRanking[$keyNick])){\n $totalRanking[$keyNick]=$totalRanking[$keyNick] + $value;\n }else{\n $totalRanking[$keyNick] = $value;\n }\n }\n asort($totalRanking);\n\n //encode html message for print\n $htmlReply = \"E-Ranking<br>\";\n $i=1;\n $position ='position :';\n foreach($totalRanking as $key=>$value){\n $htmlReply .=$position.$i.' Nick :'.$key.' Total points :'.$value.'<br>';\n $i++;\n }\n return json_encode($htmlReply);\n\n\n }", "function workshop_get_teacher_weights() {\n $weights = array();\n for ($i=10; $i>=0; $i--) {\n $weights[$i] = $i;\n }\n return $weights;\n}", "public function weights();", "function array_fetch_random_weighted_value( &$array )\n {\n if( !empty($array) )\n {\n $total_weight = 0;\n foreach( $array as $element )\n {\n $weight = is_array($element) ? (isset($element['weight']) ? $element['weight'] : 0) : (isset($element->weight) ? $element->weight : 0);\n $total_weight += max(0, $weight);\n }\n\n if( $total_weight <= 0 )\n {\n return null;\n }\n\n $roll = mt_rand(0, $total_weight-1);\n\n foreach( $array as $key => $element )\n {\n $weight = is_array($element) ? (isset($element['weight']) ? $element['weight'] : 0) : (isset($element->weight) ? $element->weight : 0);\n $roll -= max(0, $weight);\n if( $roll < 0 )\n {\n return $element;\n }\n\n }\n }\n\n return null;\n }", "private static function evaluateWeightings()\n\t\t{\n\t\t\t$total = 0;\n\n\t\t\tforeach(self::$weightCounts as $weight => $count)\n\t\t\t\t$total += ($weight * 20) * $count;\n\n\t\t\tself::$total = $total;\n\t\t}", "private function generate_weighting_array(){\n\t\t\n\t\tif(file_exists(\"weighting.txt\") && is_writable(\"weighting.txt\") && !empty(trim(file_get_contents(\"weighting.txt\")))){\n\t\t\t$json_derulo = json_decode(file_get_contents('./weighting.txt', FILE_USE_INCLUDE_PATH),TRUE);\n\t\t\t$this->weighting_array = $json_derulo;\n\t\t}\n\t\telse{\n\t\t\t$tmp_heuritic_name_ara = array();\n\t\t\tfor($i=0; $i<=$this->number_of_heuristics; $i++){\n\t\t\t\t$tmp_heuritic_name_ara[] = 'Heutistic' . $i;\n\t\t\t}\n\t\t\t$this->weighting_array = array_fill_keys($tmp_heuritic_name_ara, 3);\n\t\t\t@$this->normalize_weightings();//normalize the weighting array\n\t\t}\n\t }", "function avg_weighted_sum($arr,$init=3){\r\n $avgw=0;\r\n if(count($arr)<1){return 0;}\r\n $tot_elems_weight=facsum(count($arr),$init);\r\n for($i=0;$i<count($arr);$i++){\r\n $avgw+=(floatval($arr[$i])/$tot_elems_weight)*($i+1+$init);\r\n }\r\n return floatval(toFixed($avgw,2));\r\n}", "function calc_dream_mp_score_a($db, $dreamid, $personid) {\n global $pwpdo;\n $query = \"select pw_vote.vote as mpvote, pw_dyn_dreamvote.vote as dreamvote from\n pw_vote, pw_dyn_dreamvote, pw_division, pw_mp where\n pw_vote.division_id = pw_division.division_id and\n pw_dyn_dreamvote.division_number = pw_division.division_number and\n pw_dyn_dreamvote.division_date = pw_division.division_date\n and pw_vote.mp_id = pw_mp.mp_id\n and pw_mp.person = ? and pw_dyn_dreamvote.dream_id = ?\";\n\n $qrowarray=$pwpdo->fetch_all_rows($query,array($personid,$dreamid));\n $t = 0.0;\n $c = 0.0;\n foreach ($qrowarray as $qrow)\n {\n $weight = 1;\n $mpvote = $qrow['mpvote'];\n $mpvote = str_replace(\"tell\", \"\", $mpvote);\n $dreamvote = $qrow['dreamvote'];\n if ($dreamvote == \"aye3\" or $dreamvote == \"no3\") {\n $dreamvote = str_replace(\"3\", \"\", $dreamvote);\n $weight = 3;\n }\n $t += $weight;\n\n if ($mpvote == $dreamvote)\n $c += $weight;\n elseif ($mpvote == \"both\" or $dreamvote == \"both\")\n $c = $c + ($weight / 2);\n }\n\n return array($c, $t);\n}", "function finishing_probability ($s_split = 0, $s_week = 0)\n{\n\tglobal $matchups, $pro_matches, $current_week, $current_split;\n\n\t$s_week = ($s_week == 0) ? $current_week : $s_week;\n\t$s_split = ($s_split == 0) ? $current_split : $s_split;\n\t$weeks = count($pro_matches[$current_split]) - $s_week;\n\n\t// Find current table\n\t$table = generate_table($s_split, generate_rollback($s_split, $s_week));\n\n\t$wins = array();\n\tfor ($i = 0; $i < 8; $i++)\n\t{\n\t\tfor ($j = 0; $j <8; $j++)\n\t\t{\n\t\t\t$sum[$i][$j] = 0;\n\t\t}\n\t}\n\n\t$matchups_involved = count($matchups[$s_split][$s_week]);\n\t\n\tif ($weeks > 0)\n\t{\t\n\t\t$w = $s_week;\n\t\tfor ($total = 0; $total < pow(pow(2, $matchups_involved), $weeks); $total++)\n\t\t{\n\t\t\tfor ($i = 0; $i < 8; $i++)\n\t\t\t{\n\t\t\t\t$wins[$i] = $table['wins'][$i];\n\t\t\t\tif ($matchups_involved*2 <= $i)\n\t\t\t\t{\n\t\t\t\t\t$wins[$i] = -1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (($i % 3) == 0)\n\t\t\t{\n\t\t\t\t$w++;\n\t\t\t}\n\t\t\t$total2 = $total;\n\t\t\tfor ($i = 0; $i < ($matchups_involved * $weeks); $i++)\n\t\t\t{\n\t\t\t\t$winner = ($total2 & 1) ? 0 : 1;\n\n\t\t\t\t$players = explode('-', $matchups[$s_split][$w][$i % 3]);\n\t\t\t\t$wins[$players[$winner]]++;\n\n\t\t\t\t$total2 = floor($total2 / 2);\n\t\t\t}\n\t\t\t\n\t\t\tarsort($wins);\n\t\t\t$counts = array_count_values($wins);\n\t\t\t$unique = array_unique($wins);\n\t\t\t$pos = 0;\n\t\t\tforeach ($unique as $win)\n\t\t\t{\n\t\t\t\t$found = array_keys($wins, $win);\n\t\t\t\tfor ($j = 0; $j < count($found); $j++)\n\t\t\t\t{\n\t\t\t\t\tfor ($i = 0; $i < $counts[$win]; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sum[$found[$j]][$pos+$i] += 1 / $counts[$win];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$pos += $counts[$win];\n\t\t\t}\n\t\t}\n\n\t\tif ($total > 0)\n\t\t{\n\t\t\tforeach ($sum as $id1 => $key1)\n\t\t\t{\n\t\t\t\tforeach ($key1 as $id2 => $key2)\n\t\t\t\t{\n\t\t\t\t\t$sum[$id1][$id2] = round($key2 / $total * 100, 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$positions = sort_table(generate_table($s_split));\n\t\tforeach ($positions as $player => $position)\n\t\t{\n\t\t\t$sum[$player][$position] = 100;\n\t\t}\n\t}\n\treturn $sum;\n}", "function timj_weight_tracks($tracks) {\n $groups = array();\n $maxSize = 0;\n\n foreach ($tracks as $track) {\n $hash = md5(strtolower(\"{$track[1]} by {$track[0]}\"));\n $groups[$hash][] = $track;\n \n if (count($groups[$hash]) > $maxSize) {\n $maxSize = count($groups[$hash]);\n }\n }\n\n $result = array();\n\n foreach ($groups as $group) {\n $track = $group[0];\n $count = count($group);\n $track['usernames'] = array();\n foreach ($group as $groupMember) {\n if (in_array($groupMember['username'], $track['usernames'])) {\n --$count;\n } else {\n $track['usernames'][] = $groupMember['username'];\n }\n }\n $track['weight'] = $count / $maxSize;\n $result[] = $track;\n }\n\n return $result;\n}", "function calculateWeightedAverages()\n\t{\n\t\t$stamp = time();\n\t\t# 1 = weighted\n\t\tif ($this->calculationType == 1)\n\t\t{\n\n\t\t\tforeach($this->students AS $username=>$stuObj)\n\t\t\t{\n\t\t\t\t$categoryPercentSums = array();\n\t\t\t\t//loop through the GB's definition of how many entires there are\n\t\t\t\t// to get proper weights for the students\n\t\t\t\treset($this->entries);\n\t\t\t\twhile ( list($k,$v) = @each($this->entries) ) {\n\t\t\t\t\t$categoryPercentSums[ $v->idClassGradebookCategories ]['count'] ++;\n//\t\t\t\t\tprint \"<!-- catid \".$v->idClassGradebookCategories .\"-->\\n\";\n\t\t\t\t}\n\t\t\t\treset($this->entries);\n\t\t\t\tforeach ($stuObj->vals AS $valId=>$valObj)\n\t\t\t\t{\n\n\t\t\t\t\t$catid = $this->entries[$valObj->idClassGradebookEntries]->idClassGradebookCategories;\n//testing new 0 handling\n\t\t\t\t\tif ( $this->entries[$valObj->idClassGradebookEntries]->dateDue > $stamp && $valObj->score == 0 ) { continue; }\n\t\t\t\t\tif ( $this->entries[$valObj->idClassGradebookEntries]->totalPoints > 0 ) {\n\t\t\t\t\t//store the sum of all value percentages for a particular category in an array\n\t\t\t\t\t//this algorithm was made by mike and mark\n\t\t\t\t\t\tif ($valObj->_new) continue;\n\t\t\t\t\t\t$categoryPercentSums[ $catid ]['total'] += \n\t\t\t\t\t\t\tsprintf('%.2f',$valObj->score / $this->entries[ $valObj->idClassGradebookEntries ]->totalPoints) \n\t\t\t\t\t\t\t* sprintf('%.2f',$this->categoryWeights[$catid]['weight']/$categoryPercentSums[$catid]['count']);\n\n\t\t\t\t\t\t$stuObj->percentCount[$this->entries[$valObj->idClassGradebookEntries]->idClassGradebookCategories]++;\n//\t\t\t\t\t\tprint \"<!-- avg so far \".$categoryPercentSums[$catid]['total'] .\"-->\\n\";\n\t\t\t\t\t}\n//\t\t\t\t\t$stuObj->weightedAverage += $this->entries[$valObj->idClassGradebookEntries]->weightedPercent * ($valObj->score / $this->entries[$valObj->idClassGradebookEntries]->totalPoints );\t\n\n\t\t\t\t}\n\t\t\t\t//once the vals are sorted by category, find the average\n\t\t\t\tforeach ($categoryPercentSums as $catid => $percentArray ) {\n\t\t\t\t\tif (!isset($percentArray['total']) ) { //print \"<!--nothing completed in this category $catid-->\\n\\n\";\n\t\t\t\t\tcontinue; }\n\t\t\t\t\t//print \"\\n\\n<!--new category $catid-->\\n\";\n\n\t\t\t\t\t$stuObj->weightedAverage += $percentArray['total'];\n\t\t\t\t\t$stuObj->catWeightTotals += sprintf('%.2f',$this->categoryWeights[$catid]['weight'] / $percentArray['count']) /100 \n\t\t\t\t\t\t* $stuObj->percentCount[$catid];\n\n\n\t\t\t\t\t/*\n\t\t\t\t\tprint \"<!-- \".$stuObj->username.\" has \".$stuObj->percentCount[$catid] .\" grades in this category weighing \".$this->categoryWeights[$catid]['weight'] .\"% with \". $percentArray['count'] .\" entries -->\\n\";\n\t\t\t\t\tprint \"<!-- \" . $this->categoryWeights[$catid]['weight'].\" / \".$percentArray['count'].\" * \".( $percentArray['total'] ).\" /100 -->\\n\";\n\t\t\t\t\tprint \"<!-- weight total so far \".$stuObj->catWeightTotals .\"-->\\n\";\n\t\t\t\t\tprint \"<!-- avg so far \".$stuObj->weightedAverage .\"-->\\n\";\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\t\tprint \"<!-- / \" .$stuObj->weightedAverage .\" \" . $stuObj->catWeightTotals .\"-->\\n\\n\";\n\t\t\t\t$stuObj->weightedAverage = $stuObj->weightedAverage / $stuObj->catWeightTotals;\n\t\t\t\t$stuObj->weightedAverage = sprintf('%.3f',$stuObj->weightedAverage);\n\t\t\t\t$this->students[$username] = $stuObj;\n\t\t\t}\n\t\t}\n\t}", "function aca_year_weights($match)\n{\n\t//will be ordered lowest to highest\n\t$years = get_terms('aca_year', array('fields'=>'names'));\n\t$increment = 8 / count($years);\n\n\t$post_type = relevanssi_get_post_type($match->doc);\n\n\tif($post_type === 'staract' || $post_type === 'plans' || $post_Type === 'transfer_plans')\n\t{\n\t\t$year = get_the_terms( $match->doc, 'aca_year');\n\t\t$mult = array_search($year[0]->name, $years);\n\t\t$match->weight = $match->weight * (.25 + $mult * $increment);\n\t}\n\n\treturn $match;\n}", "private function set_weight_nutrition($arr){\r\n\t\t$qno = $this->getFirstQuestionNo('weight_nutrition');\r\n\t\t$err=null;\r\n\t\ttry{//10. Do you eat breakfast?\r\n \t\t$v=$this->vc->exists('q21',$arr,\"enum\",array(\"values\"=>array(1,2,3)),false,false);\r\n \t\t$this->data['weight_nutrition']['q21']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please tell us if you eat breakfast on a daily basis\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n\r\n\t\t$qno += 1;\r\n\t\ttry{//11. How often do you snack in between meals (chips, pastry, cookies, candy etc)?\r\n \t\t$v=$this->vc->exists('q22',$arr,\"enum\",array(\"values\"=>array(1,2,3)),false,false);\r\n \t\t$this->data['weight_nutrition']['q22']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please tell us if you snack between meals\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n\r\n\t\t\t$qno += 1;\r\n \tfor($x=1;$x<=8;$x++){\r\n \t//12. How many servings do you eat from the following food groups? - \r\n\t\t\ttry{\t\t\t\r\n \t\t\t$v=$this->vc->exists('q23_'.$x,$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t\t\t$this->data['weight_nutrition']['q23_'.$x]=($v==\"\")?0:$v;\r\n \t\t}catch(ValidationException $e){\r\n \t\t\t$eb=$e->createErrorObject();\r\n \t\t\t$eb->message = \"Be sure to fill out all of the food groups\";\r\n \t\t\t$eb->name = \"Question \" . $qno;\r\n \t\t}\r\n\t\t}\r\n\t\tif (isset($eb)) {\r\n\t\t\t$err[] = $eb;\r\n\t\t}\r\n\r\n\t\t$qno += 1;\r\n\t\ttry {//13. How often do you add salt to your food or eat salty foods?\r\n\t\t\t$v = $this->vc->exists('qn24', $arr, \"enum\", array(\"values\" => array(1,2,3,4,5)), false, false);\r\n\t\t\t$this->data['weight_nutrition']['qn24'] = ($v == \"\") ? 0 : $v;\r\n\t\t}\r\n\t\tcatch (ValidationException $e) {\r\n\t\t\t$eob = $e->createErrorObject();\r\n\t\t\t$eob->message = \"Please answer if you use salt or eat salty foods\";\r\n\t\t\t$eob->name = \"Question \" . $qno;\r\n\t\t\t$err[] = $eob;\r\n\t\t}\r\n\r\n\t\t$qno += 1;\r\n\t\ttry {//14. How often do you eat high fat foods?\r\n\t\t\t$v = $this->vc->exists('qn25', $arr, \"enum\", array(\"values\" => array(1,2,3,4,5)), false, false);\r\n\t\t\t$this->data['weight_nutrition']['qn25'] = ($v == \"\") ? 0 : $v;\r\n\t\t}\r\n\t\tcatch (ValidationException $e) {\r\n\t\t\t$eob = $e->createErrorObject();\r\n\t\t\t$eob->message = \"Please tell us if you eat high fat foods\";\r\n\t\t\t$eob->name = \"Question \" . $qno;\r\n\t\t\t$err[] = $eob;\r\n\t\t}\r\n\r\n\t\treturn ($err)?$err:false;\r\n\t}", "function generate_data_set($heights, $weights) {\n $output = [[]];\n for ($x=0; $x<=count($heights)-1; $x++) {\n for ($y=0; $y<=count($weights)-1; $y++) {\n $output[$y][$x] = get_bmi($heights[$x], $weights[$y]);\n }\n }\n return $output;\n}", "function calc_match($user,$set,$config,$extra=2) {\n $results = array();\n foreach ($set as $s) {\n $sum = 0;\n $count = 0;\n if (isset($user['vote']) and count($user['vote']) > 0) {\n foreach($user['vote'] as $key => $uv) {\n //weight\n if (isset($user['weight'][$key])) $w = $extra;\n else $w = 1;\n //existing divisions only:\n if ((property_exists($s,'vote')) and (property_exists($s->vote,$key)) and ($uv != 0)) {\n $sum = $sum + $w*$s->vote->$key*sign($uv);\n $count = $count + $w;\n }\n }\n }\n if ($count == 0) $count = 1; // to allow match = 0/1 = 0;\n //read what data should go to result\n $res = array();\n foreach ($config->result as $item) {\n $res[$item] = $s->$item;\n }\n //common results for any calc\n $res['result'] = (1+$sum/$count)/2;\n $res['result_percent'] = round((100+100*$sum/$count)/2);\n $res['id'] = $s->id;\n $res['random'] = rand(0,1000000);\n $results[] = $res;\n \n }\n //sort by result\n foreach ($results as $key => $row) {\n $result[$key] = $row['result'];\n $random[$key] = $row['random'];\n }\n array_multisort($result, SORT_DESC, $random, SORT_ASC, $results);\n \n return $results;\n}", "public function generateInputArrayForGamesPerDay($data)\n {\n $valueName = 'probability-per-day';\n $probabilityPerDayData = array();\n for ($i = 1; $i <= 14; $i++) {\n if (isset($data[$valueName . $i]) && $data[$valueName . $i] > 0) {\n $probabilityPerDayData[] = array(\n 'value' => $i,\n 'probability' => $data[$valueName . $i]\n );\n }\n }\n\n return $probabilityPerDayData;\n }", "public function tableTennisStatistics($player_ids_array,$match_type,$is_win='')\n\t{\n\t\t//$player_ids_array = explode(',',$player_ids);\n\t\tforeach($player_ids_array as $user_id)\n\t\t{\n\t\t\t//check already user id exists or not\n\t\t\t$tennis_statistics_array = array();\n\t\t\t$tennisStatistics = TtStatistic::select()->where('user_id',$user_id)->where('match_type',$match_type)->get();\n\t\t\tif(count($tennisStatistics)>0)\n\t\t\t{\n\t\t\t\t$tennis_statistics_array = $tennisStatistics->toArray();\n\t\t\t\t$matches = $tennis_statistics_array[0]['matches'];\n\t\t\t\t$won = $tennis_statistics_array[0]['won'];\n\t\t\t\t$lost = $tennis_statistics_array[0]['lost'];\n\t\t\t\t\tTtStatistic::where('user_id',$user_id)->where('match_type',$match_type)->update(['matches'=>$matches+1]);\n\t\t\t\tif($is_win=='yes') //win count\n\t\t\t\t{\n\t\t\t\t\t$won_percentage = ($won+1/$matches)*100;\n\t\t\t\t\tTtStatistic::where('user_id',$user_id)->where('match_type',$match_type)->update(['won'=>$won+1,'won_percentage'=>$won_percentage]);\n\t\t\t\t\t\n\t\t\t\t}else if($is_win=='no')//loss count\n\t\t\t\t{\n\t\t\t\t\tTtStatistic::where('user_id',$user_id)->where('match_type',$match_type)->update(['lost'=>$lost+1]);\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$won='';\n\t\t\t\t$won_percentage='';\n\t\t\t\t$lost='';\n\t\t\t\tif($is_win=='yes') //win count\n\t\t\t\t{\n\t\t\t\t\t$won = 1;\n\t\t\t\t\t$won_percentage = 100;\n\t\t\t\t}else if($is_win=='no') //lost count\n\t\t\t\t{\n\t\t\t\t\t$lost=1;\n\t\t\t\t}\n\t\t\t\t$tennisStatisticsModel = new TtStatistic();\n\t\t\t\t$tennisStatisticsModel->user_id = $user_id;\n\t\t\t\t$tennisStatisticsModel->match_type = $match_type;\n\t\t\t\t$tennisStatisticsModel->matches = 1;\n\t\t\t\t$tennisStatisticsModel->won_percentage = $won_percentage;\n\t\t\t\t$tennisStatisticsModel->won = $won;\n\t\t\t\t$tennisStatisticsModel->lost = $lost;\n\t\t\t\t$tennisStatisticsModel->save();\n\t\t\t}\n\t\t}\n\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/$this>profiler = $profiler; $this>container = $container; $base = $host.$prefix; parent::__construct($base);
public function __construct($container, $host, $prefix, $profiler=null) { }
[ "public function __construct()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n parent::__construct(\"webconfig-httpd\");\n }", "public function __construct()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n parent::__construct('spamassassin');\n }", "public function __construct()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n parent::__construct('altermime');\n }", "public function __construct()\n {\n $this->define_superglobals();\n }", "public function __construct() {\n\t\t$this->name = str_replace('tx_enetcacheanalytics_performance_backend_', '', get_class($this));\n\t}", "function __construct() {\n \n $f3=Base::instance();\n $this->f3=$f3;\n $this->mbLog = $this->f3->get('webappLog');\n $this->logSuffix = \"[BaseClass]\";\n \n $this->log(\"Creazione istanza core/Utils/BaseClass\", 3);\n\n $this->log(\"Ho istanziato il FatFree\", 3);\n }", "function __construct()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n parent::__construct('plexmediaserver');\n }", "public function __construct() {\n $this->base = Base::instance();\n\n /* Set config instance */\n $this->config = Config::instance();\n }", "public function __construct()\n {\n parent::__construct('BaseAta_program');\n }", "function __construct(){\n\t\t\t$this->_name = \"htdb_services\";\n\t\t\tparent::__construct(array());\n\t\t}", "public function __construct()\n\t{\n\t\t$this->loadServices();\n\t}", "public function __construct()\n {\n $envPrefixName = self::ENV_PREFIX_NAME;\n if (isset($_SERVER[$envPrefixName]) and $_SERVER[$envPrefixName]) {\n $this->_envPrefix = $_SERVER[$envPrefixName] . self::ENV_PREFIX_SEPARATOR;\n }\n\n $this->_cacheEnabled = Agl::app()->isCacheEnabled();\n $this->_configPath = Agl::app()->getConfigPath();\n }", "private function __construct()\n {\t\n self::$vars = array();\n }", "public function __construct(){\n\t\techo \"Constructor dari class komputer <br>\";\n\t}", "public function __construct () {\n //$this->logger = $logger;\n //$this->translator = $translator;\n }", "function __construct()\n {\n //$this->webroot = realpath(ROOT . '/webroot');\n //$this->version = preg_split('/[\\\\x5c\\/]/', str_replace(ROOT, '', __FILE__))[4];\n $this->phproot = PHPROOT;\n $this->webroot = WEBROOT;\n $this->version = VERSION;\n $this->apiroot = APIROOT;\n }", "protected function __construct() {\n \t$this->init();\n \t$this->connect();\n }", "function __construct() {\n\t\t$this->starttime = microtime(true);\n\t}", "public function __construct()\n {\n parent::__construct();\n echo \"A new constructor in \" . __CLASS__ . \" was initiated. <br />\";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Testing that an exception is thrown when a given group was not found when retrieving members
public function testConsumerThrowsExceptionWhenGroupDoesNotExistsForMembers(string $groupName) { $mock = new MockHandler( [ new ClientException( 'Group not found', new Request('GET', 'test'), new Response(404, ['Content-Legnth: 0']) ), ] ); $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $consumer = $this->getConsumer($client); $members = $consumer->getGroupMemberCollection($groupName); $this->assertNull( $members, 'Expected an empty connection, but it seems to have a value' ); }
[ "public function test_isNotGroupMember() {\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertFalse($this->fixture->isNotGroupMember('validGroup'));\r\n\r\n // Assert true with an user with an unvalid group\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember('unvalidGroup'));\r\n\r\n // Assert true if no group is provided\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember(''));\r\n\r\n // Assert true if an unknown group is provided\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember('unkownGroup'));\r\n\r\n // Assert true if no user is provided\r\n $this->userAuth('', '');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember('validGroup'));\r\n\r\n // Assert true if no user and no group are provided\r\n $this->userAuth('', '');\r\n\t\t$this->assertTrue($this->fixture->isNotGroupMember(''));\r\n }", "function testCheckMembershipInGroup()\n {\n $inGroup = $this->GroupsMembers->checkMembershipInGroup(1, 7);\n $this->assertTrue($inGroup);\n\n //Test student not in existing group\n $inGroup = $this->GroupsMembers->checkMembershipInGroup(2, 5);\n $this->assertFalse($inGroup);\n\n //Test invalid student in existing group\n $inGroup = $this->GroupsMembers->checkMembershipInGroup(1, 999);\n $this->assertFalse($inGroup);\n\n //Test student in invalid existing group\n $inGroup = $this->GroupsMembers->checkMembershipInGroup(999, 3);\n $this->assertFalse($inGroup);\n\n //Test invalid student in invalid existing group\n $inGroup = $this->GroupsMembers->checkMembershipInGroup(999, 999);\n $this->assertFalse($inGroup);\n }", "public function testGetGroupsFailure()\n\t{\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 401;\n\t\t$returnData->body = $this->errorString;\n\n\t\t$token = $this->oauth->getToken();\n\n\t\t$this->client->expects($this->once())\n\t\t->method('get')\n\t\t->with('me/groups?access_token=' . $token['access_token'])\n\t\t->will($this->returnValue($returnData));\n\n\t\t$this->object->getGroups('me');\n\t}", "public function testGetLangueGroupIdException() {\n\n try {\n $illegal = array('%', '-', '.');\n $langUpdated = $this->localizationDao->getLanguageGroupById($illegal);\n } catch (Exception $ex) {\n return;\n }\n\n $this->fail('An expected exception has not been raised.');\n }", "public function testGetInvalidMemberByEmail() {\n\t\t// grab an at email that does not exist\n\t\t$member = Member::getMemberByEmail($this->getPDO(), $this->VALID_EMAIL);\n\t\t$this->assertNull($member);\n\t}", "public function testSetNoGroupException() {\n /** @var \\Drupal\\og\\Entity\\OgMembershipInterface $membership */\n $membership = OgMembership::create();\n $membership\n ->setUser($this->user)\n ->save();\n }", "public function testInvalidGroup(): void\n {\n $this->expectException(\\RuntimeException::class);\n $manager = $this->getDataFixtureManager('invalid-group');\n }", "public function testSetNoGroupException() {\n /** @var \\Drupal\\og\\OgMembershipInterface $membership */\n $membership = OgMembership::create();\n $membership\n ->setOwner($this->user)\n ->save();\n }", "public function test_isGroupMember() {\r\n $this->userAuth('validUser', 'test');\r\n $this->assertTrue($this->fixture->isGroupMember('validGroup'));\r\n\r\n // Assert false with an user with an unvalid group\r\n $this->userAuth('unvalidUser', 'test');\r\n\t\t$this->assertFalse($this->fixture->isGroupMember('validGroup'));\r\n\t\t\r\n // Assert false if no group is provided\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertFalse($this->fixture->isGroupMember(''));\r\n\r\n // Assert false if an unknown group is provided\r\n $this->userAuth('validUser', 'test');\r\n\t\t$this->assertFalse($this->fixture->isGroupMember('unkownGroup'));\r\n\t\t\r\n // Assert false if no user is provided\r\n $this->userAuth('', '');\r\n\t\t$this->assertFalse($this->fixture->isGroupMember('validGroup'));\r\n\r\n // Assert false if no user and no group are provided\r\n $this->userAuth('', '');\r\n\t\t$this->assertFalse($this->fixture->isGroupMember(''));\r\n }", "public function testGetInvalidProperty() {\n $permission = new GroupPermission();\n $permission->get('invalid property');\n }", "public function testGroupPoolGetPhotosExceptionGroupIdInvalid()\n {\n $this->flickr->getHttpClient()->setAdapter($this->httpClientAdapterTest);\n\n $this->httpClientAdapterTest->setResponse($this->loadResponse(__FUNCTION__));\n\n $this->setExpectedException(\n 'ZendService\\Flickr\\Exception\\RuntimeException',\n 'Group not found'\n );\n $this->flickr->groupPoolGetPhotos('2e38a9d9425d7e2c9d0788455e9ccc61');\n }", "public function testGroupPoolGetPhotosExceptionGroupIdInvalid()\n {\n $this->_flickr->getRestClient()\n ->getHttpClient()\n ->setAdapter($this->_httpClientAdapterTest);\n\n $this->_httpClientAdapterTest->setResponse($this->_loadResponse(__FUNCTION__));\n\n try {\n $this->_flickr->groupPoolGetPhotos('2e38a9d9425d7e2c9d0788455e9ccc61');\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('Group not found', $e->getMessage());\n }\n }", "public function testAdminCoGroupIdCoNotFound() {\n $this->setExpectedException(InvalidArgumentException::class, 'Group admins Not Found');\n $this->CoGroup->adminCoGroupId(2);\n }", "public function testGroupExistsGetGroupsidExists()\n {\n\n }", "public function testCanRemoveMemberFromGroup()\n {\n // Create a group\n $generatedGroupName = strtolower(uniqid('zf-list-'));\n $group = $this->gdata->createGroup(\n $generatedGroupName,\n 'Test Group',\n 'testCanDeleteGroupMember()'\n );\n $this->autoDelete($group);\n\n // Create a user for the group\n $user = $this->gdata->createUser(\n $this->id,\n self::GIVEN_NAME,\n self::FAMILY_NAME,\n sha1(self::PASSWORD),\n self::PASSWORD_HASH\n );\n $this->autoDelete($user);\n $this->gdata->addMemberToGroup($this->id, $generatedGroupName);\n\n // Assert that the member exists, just in case...\n $members = $this->gdata->retrieveAllMembers($generatedGroupName);\n $this->assertTrue(count($members->entry) == 1);\n\n // Remove the member from the group\n $this->gdata->removeMemberFromGroup(\n $user->login->username,\n $generatedGroupName\n );\n\n // Ensure that user was deleted\n $members = $this->gdata->retrieveAllMembers($generatedGroupName);\n $this->assertTrue(count($members->entry) == 0);\n }", "public function testJoinGroupFailure()\n\t{\n\t\t$group_id = '12345';\n\t\t$show_logo = true;\n\t\t$digest_frequency = 'daily';\n\t\t$announcements = true;\n\t\t$allow_messages = true;\n\t\t$new_post = true;\n\n\t\t$path = '/v1/people/~/group-memberships';\n\n\t\t$xml = '<group-membership>\n\t\t\t\t <group>\n\t\t\t\t <id>' . $group_id . '</id>\n\t\t\t\t </group>\n\t\t\t\t <show-group-logo-in-profile>true</show-group-logo-in-profile>\n\t\t\t\t <email-digest-frequency>\n\t\t\t\t <code>daily</code>\n\t\t\t\t </email-digest-frequency>\n\t\t\t\t <email-announcements-from-managers>true</email-announcements-from-managers>\n\t\t\t\t <allow-messages-from-members>true</allow-messages-from-members>\n\t\t\t\t <email-for-every-new-post>false</email-for-every-new-post>\n\t\t\t\t <membership-state>\n\t\t\t\t <code>member</code>\n\t\t\t\t </membership-state>\n\t\t\t\t</group-membership>';\n\n\t\t$header['Content-Type'] = 'text/xml';\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 403;\n\t\t$returnData->body = 'Throttle limit for calls to this resource is reached.';\n\n\t\t$this->client->expects($this->once())\n\t\t\t->method('post', $xml, $header)\n\t\t\t->with($path)\n\t\t\t->will($this->returnValue($returnData));\n\n\t\t$this->object->joinGroup($group_id, $show_logo, $digest_frequency, $announcements, $allow_messages, $new_post);\n\t}", "public function testGetGroupFieldForNonExistingGroupField() {\n\n $groupFieldId = 34;\n\n $groupField = $this->reportableDao->getGroupField($groupFieldId);\n\n $this->assertEquals(null, $groupField);\n }", "public function testGroupViewNotExistingID() {\n $id = $this->getNotExistingID('Group');\n $response = $this->get('group/' . $id);\n $this->assertEquals('404', $response->foundation->getStatusCode());\n }", "public function testCreateGroupMembership()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the distance between characters until next occurrence of the same character. If the character has more than 2 occurrence, the distance will be setted to 10.
public function getCharactersDistance() { $phrase = $this->getData('phrase'); // Fix spaces between entire string $newString = preg_replace('/[\s\W]+/', '#', $phrase); $arrayItems = (array)str_split($phrase); foreach ($arrayItems as $value) { if ($value == ' ') continue; // Set value to 10 if character > 2 if (substr_count($phrase, $value) > 2){ $this->processor[$value][self::KEY_DISTANCE] = 10; continue; } // Calculate distance between 2 characters if (substr_count($phrase, $value) === 2 && $value != ' ') { $distance1 = (int)strpos($newString, $value, 0); $distance2 = (int)strpos($newString, $value, $distance1 + 1); $this->processor[$value][self::KEY_DISTANCE] = abs($distance1 - $distance2); continue; } $this->processor[$value][self::KEY_DISTANCE] = 'N/A'; } }
[ "public function getDistance(){\n if( strlen($this->string1) != strlen($this->string2)){\n echo \"not same length\";\n return;\n }\n for($i = 0; $i < strlen($this->string2); $i++){\n if($this->string1[$i] != $this->string2[$i]){\n $this->distance += 1;\n }\n }\n return $this->distance;\n }", "function getDistanceByCommonUniqueChars($word1,$word2)\n{\n\t$word1Arr = preg_split('//u', $word1, -1, PREG_SPLIT_NO_EMPTY);\n $word2Arr = preg_split('//u', $word2, -1, PREG_SPLIT_NO_EMPTY);\n\n \n $uniqueCommonChars = array_unique(array_intersect($word1Arr, $word2Arr));\n \n $commonChars = implode($uniqueCommonChars);\n \n $extraPoints = 0;\n \n\n //echoN(\"$word1,$word2 $commonChars\");\n // if tword 1 mtches word2 in both first and last character then add more similarity score\n if ( current($uniqueCommonChars)==current($word2Arr) )\n {\n \n \t$extraPoints = $extraPoints+1;\n }\n \n if ( end($uniqueCommonChars)==end($word2Arr) )\n {\n \n \t$extraPoints = $extraPoints+1;\n }\n \n \n \n\n \n return (mb_strlen($commonChars)+$extraPoints);\n}", "private function incrementDistance()\n {\n if($this->strA{$this->position} != $this->strB{$this->position}) ++$this->distance;\n }", "public function calculate_number_of_equal_first_characters(){\n $counter = 0;\n for ($key=0; $key<strlen($this->initial_word); $key++) {\n if($this->initial_word[$key] == $this->final_word[$key]){\n $counter += 1;\n }else{\n $this->number_of_equal_first_characters = $counter;\n return;\n }\n }\n $this->number_of_equal_first_characters = $counter;\n }", "public function getDistance(): int\n {\n $distance = 0;\n $input = $this->input->getInput();\n\n foreach ($input as $word) {\n if (\\array_key_exists($word, $this->cache)) {\n $distance += $this->cache[$word];\n\n continue;\n }\n\n $score = $this->distanceFromVocabulary($word);\n\n $this->cache[$word] = $score;\n $distance += $score;\n }\n\n return $distance;\n }", "public function calculateDistance()\n {\n if ($this->isBothEmpty()) return \"Both strings are empty. The minimum Edit Distance is 0\";\n if (!$this->isSameLength()) return \"Not of same length! Hamming can not be performed. Refer to Levenshtein\";\n return $this->calculate();\n }", "function getSameCharAmount($haystack, $compare):int {\n $count = 0;\n for($i = 0; $i<strlen($haystack); $i++){\n if($haystack[$i] === $compare[$i]){\n $count++;\n }else {\n break;\n }\n }\n return $count;\n}", "public function compute_string_distance($string1, $string2)\n {\n }", "protected static function measureCharDistances(string $str, string $char) : array\n {\n $charDistances = [];\n $currChar = Sikker::strpos($str, $char);\n do {\n $nextChar = Sikker::strpos($str, $char, $currChar + 1);\n if ($nextChar > $currChar) {\n $charDistances[] = $nextChar - $currChar;\n $currChar = $nextChar;\n }\n } while ($nextChar !== false);\n\n return $charDistances;\n }", "function distance($a, $b)\n{\n //\n // YOUR CODE GOES HERE\n //\n $ax = str_split($a);\n $bx = str_split($b);\n $dist = 0;\n\n if (count($ax) !== count($bx)) {\n throw new InvalidArgumentException('DNA strands must be of equal length.');\n }\n\n for($i = 0; $i<count($ax); $i++){\n \tif($ax[$i] != $bx[$i])\n \t\t$dist++;\n }\n\n return $dist;\n}", "function lcs_distance($str1, $str2, $must_reach_least = null) {\n // Reduce all charachers that exists in neither string,\n // This should not affect the result and should improve many real world cases.\n $str1_chars = \\count_chars($str1, 1);\n $str2_chars = \\count_chars($str2, 1);\n $unique_chars = \\array_keys(\\array_diff_key($str1_chars, $str2_chars) + \\array_diff_key($str2_chars, $str1_chars));\n $unique_chars = \\array_map(function($c) { return \\chr($c); }, $unique_chars);\n $str1 = \\str_replace($unique_chars, array(), $str1);\n $str2 = \\str_replace($unique_chars, array(), $str2);\n // Take distances into account.\n $m = \\strlen($str1);\n $n = \\strlen($str2);\n if ($must_reach_least !== null) {\n $max_lcs = \\max($m, $n);\n if ($max_lcs < $must_reach_least)\n return false;\n else if ($max_lcs === $must_reach_least)\n return \\strcmp($str1, $str2) === 0? $max_lcs: false;\n }\n $lcs_row_a = \\array_fill(0, $n + 1, 0);\n $lcs_row_b = \\array_fill(0, $n + 1, 0);\n // This variable holds the max lcs for the current row.\n // It is equal to the maximum value on row above + 1.\n $max_row_lcs = 1;\n for ($i = 1; $i <= $m; $i++) {\n // Reduces array copying in memory by flipping references.\n if (($i % 2) == 0) {\n $lcs_row_above =& $lcs_row_a;\n $lcs_table_current =& $lcs_row_b;\n } else {\n $lcs_row_above =& $lcs_row_b;\n $lcs_table_current =& $lcs_row_a;\n }\n // Make comparision that short circuits if max lcs is reached.\n for ($j = 1; $j <= $n; $j++) {\n if ($str1[$i - 1] == $str2[$j - 1])\n $new_lcs = $lcs_row_above[$j - 1] + 1;\n else\n $new_lcs = \\max($lcs_table_current[$j - 1], $lcs_row_above[$j]);\n $lcs_table_current[$j] = $new_lcs;\n if ($new_lcs == $max_row_lcs) {\n // Max lcs is reached, row can no longer increment - so just fill.\n $max_row_lcs++;\n for ($j++; $j <= $n; $j++)\n $lcs_table_current[$j] = $new_lcs;\n break;\n }\n }\n if ($must_reach_least !== null) {\n // Check that LCS can still reach at least value.\n $max_lcs_possible = ($m - $i) + ($max_row_lcs - 1);\n if ($max_lcs_possible < $must_reach_least)\n return false;\n }\n }\n return $max_row_lcs - 1;\n}", "function doubleLetterCount($word)\n{\n $counter = 0;\n for ($index = 1; $index < strlen($word); $index++) {\n\n $currChar = $word[$index];\n $oldChar = $word[$index - 1];\n\n if ($currChar == $oldChar) {\n $counter += 1;\n }\n }\n return $counter;\n}", "public function distanceTries();", "private function getStrLen() \n {\n \n $len = 0;\n \n foreach (array_merge(array_key_exists(0, $this->bracket) ? $this->bracket[0] : array(), $this->bracket[1]) as $m) {\n if (($newlen = strlen($m['c1'])) > $len) $len = $newlen;\n if (($newlen = strlen($m['c2'])) > $len) $len = $newlen;\n }\n \n foreach ($this->roundsInfo as $arr) {\n if (($newlen = strlen($arr[0])) > $len) $len = $newlen;\n }\n\n return $len;\n }", "public function compute_string_distance($string1, $string2)\n {\n }", "function getTries(& $word) {\r\n //Remember you want 2x the number of letters in the word\r\n $tries = strlen($word) * 2;\r\n return $tries;\r\n}", "function CountCharacters($startPos, $endPos){}", "public function getOccurenceByCharacter()\n\t{\n\t\t$array = (array)str_split($this->getData('phrase'));\n $array = array_filter($array, function($value) { return $value != ' '; });\n\t\t$count = array_count_values($array);\n\t\tforeach($count as $key => $value) {\n\t\t if ($key != '')\n\t\t\t $this->processor[$key][self::KEY_OCCURRENCES] = $value;\n\t\t}\n\t}", "public function part2()\n {\n $currentSantaFloor = 0;\n\n foreach (str_split($this->input) as $index => $step) {\n $step = $step === '(' ? 1 : -1;\n\n $currentSantaFloor += $step;\n\n if ($currentSantaFloor === -1) {\n return $index + 1;\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the redraw frequency.
public function setRedrawFrequency(?int $freq): void { $this->redrawFreq = null !== $freq ? max(1, $freq) : null; }
[ "public function setRedrawFrequency($freq)\n {\n $this->redrawFreq = (int) $freq;\n }", "public function setRedrawFrequency(int $freq)\n {\n $this->redrawFreq = max($freq, 1);\n }", "public function setRedrawFreq(float|int $freq): void\n {\n $this->redrawFreq = max((int)$freq, 1);\n }", "public function setRefreshFrequency($refresh_frequency);", "function setFrequency($__freq)\n\t{\n\t\t$this->frequency = $__freq;\n\t}", "public function setPaintMode() { }", "public function setClockFrequency($frequency)\n {\n $payload = '';\n $payload .= pack('V', $frequency);\n\n $this->sendRequest(self::FUNCTION_SET_CLOCK_FREQUENCY, $payload);\n }", "function set_frequency($frequency)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! $this->is_loaded)\n $this->_load_config();\n\n $this->_set_parameter('frequency', $frequency);\n }", "public function setFrequency(float $fFrequency) : self;", "function SetChangeFreq($changeFreq) {\r\n\t\t$this->_changeFreq=(string) $changeFreq;\t\r\n\t}", "public function reDraw()\n {\n }", "function SetChangeFreq($changeFreq) {\r\r\n\t\t$this->_changeFreq=(string) $changeFreq;\r\r\n\t}", "function SetTargetFPS(int $fps): void { }", "public final function redrawLine() {\n\t\t$this->_print(self::RESET_LINE);\n//\t\tflush();\n\t\t$this->drawLine();\n\t}", "function setImageTicksPerSecond($ticks_per_second){}", "public function set_frequency ($frequency) {\n $this->frequency = $frequency;\n }", "public function SetChangeFreq($changeFreq) {\n\t\t$this->_changeFreq = (string) $changeFreq;\n\t}", "function SetMeasuringFont(wxFont $font){}", "public function setFrequency($value)\n {\n $this->validateInt('Frequency', $value);\n $this->validateNotNull('Frequency', $value);\n\n if ($this->data['frequency'] === $value) {\n return;\n }\n\n $this->data['frequency'] = $value;\n $this->setModified('frequency');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run an async job to optimize images in background.
function imagify_do_async_job( $body ) { $args = [ 'timeout' => 0.01, 'blocking' => false, 'body' => $body, 'cookies' => isset( $_COOKIE ) && is_array( $_COOKIE ) ? $_COOKIE : [], 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), ]; /** * Filter the arguments used to launch an async job. * * @since 1.6.6 * @author Grégory Viguier * * @param array $args An array of arguments passed to wp_remote_post(). */ $args = apply_filters( 'imagify_do_async_job_args', $args ); /** * It can be a XML-RPC request. The problem is that XML-RPC doesn't use cookies. */ if ( defined( 'XMLRPC_REQUEST' ) && get_current_user_id() ) { /** * In old WP versions, the field "option_name" in the wp_options table was limited to 64 characters. * From 64, remove 19 characters for "_transient_timeout_" = 45. * Then remove 12 characters for "imagify_rpc_" (transient name) = 33. * Luckily, a md5 is 32 characters long. */ $rpc_id = md5( maybe_serialize( $body ) ); // Send the request to our RPC bridge instead. $args['body']['imagify_rpc_action'] = $args['body']['action']; $args['body']['action'] = 'imagify_rpc'; $args['body']['imagify_rpc_id'] = $rpc_id; $args['body']['imagify_rpc_nonce'] = wp_create_nonce( 'imagify_rpc_' . $rpc_id ); // Since we can't send cookies to keep the user logged in, store the user ID in a transient. set_transient( 'imagify_rpc_' . $rpc_id, get_current_user_id(), 30 ); } $url = admin_url( 'admin-ajax.php' ); /** * Filter the URL to use for async jobs. * * @since 1.9.5 * @author Grégory Viguier * * @param string $url An URL. * @param array $args An array of arguments passed to wp_remote_post(). */ $url = apply_filters( 'imagify_async_job_url', $url, $args ); wp_remote_post( $url, $args ); }
[ "public function enqueue()\n {\n dispatch(new ImageCropJob($this))->delay(10);\n }", "protected function optimizeNewMedia()\n {\n // Submit background process to continue to run after this request returns\n $script = ROOT_DIR . 'vendor/pitoncms/engine/cli/cli.php';\n exec(\"php $script optimizeMedia > /dev/null &\");\n }", "function parser_run_in_background($jid) {\n parser_run_batch($jid);\n $batch = &batch_get();\n $batch['progressive'] = FALSE;\n batch_process('');\n}", "public function backgroundJob($flag = true);", "public function run_queue() {\n if ($videos = $this->load_job_queue()) {\n foreach ($videos as $video) {\n $this->process($video);\n }\n //clear cache once completed the conversion to update the file paths\n cache_clear_all('*', 'cache_content', true);\n }\n }", "function postSyncJob(){\n// $url = 'fetchMProductInfo';\n// $json = [\n// \"async\" => true,\n// \"url\" => route('product_price_collect', ['product_id'=>$this->id]),\n// \"urls\" => \\GuzzleHttp\\json_decode($this->trace_urls,true)\n// ];\n// Log::info('Enqueue job for product '.$this->id);\n// Log::info($json);\n// $client = self::getClient();\n// $response = $client->request('POST', $url, compact('json'));\n// return self::processResult($response);\n $urls = \\GuzzleHttp\\json_decode($this->trace_urls,true);\n\n foreach ($urls as $url){\n FetchPriceJob::dispatch($url, $this);\n }\n }", "protected function startImages()\n {\n $imageCount = 0;\n // sync images\n foreach ((new \\luya\\admin\\image\\Query())->all() as $image) {\n /** @var Item $image */\n if (!$image->fileExists) {\n $curl = new Curl();\n $curl->setOpt(CURLOPT_RETURNTRANSFER, true);\n $curl->get($this->build->imageProviderUrl, [\n 'buildToken' => $this->build->buildToken,\n 'machine' => $this->build->machineIdentifier,\n 'imageId' => $image->id,\n ]);\n\n if (!$curl->error) {\n if ($this->storageUpload($image->systemFileName, $curl->response)) {\n $imageCount++;\n $this->build->command->outputInfo('[+] Image ' . $image->source.' downloaded.');\n }\n }\n\n $curl->close();\n unset($curl);\n gc_collect_cycles();\n }\n }\n\n $this->build->command->outputInfo(\"[=] {$imageCount} Images downloaded.\");\n }", "public static function launchIt()\n {\n (new AsyncHandler())->launchjob();\n }", "public static function process() {\n\t\t\tif ( ($job = self::_next_job()) !== false ) {\n\t\t\t\tself::_run_task($job);\n\t\t\t}\n\t\t}", "function spawn_background_process( $tempfile ){\n if ( class_exists( 'CourseSequenceQueue' ) ):\n // spawn background process for loading\n $q = new CourseSequenceQueue();\n $q->push_to_queue( $tempfile );\n $q->save()->dispatch();\n endif;\n }", "function fetch() {\n\n\t\t$items = $this->get_items();\n\n\t\tif ( is_wp_error( $items ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $items as $item ) {\n\t\t\t$this->background_process->push_to_queue( $item );\n\t\t}\n\n\t\t$this->background_process->save()->dispatch();\n\n\t}", "abstract protected function doInBackground($parameters);", "public function execute()\n\t{\n\t\t$startTime = time();\n\t\t$hasTask = true;\n\t\t$maxExecutionTime = mage::getStoreConfig('backgroundtask/general/max_execution_time');\n\t\twhile (((time() - $startTime) < $maxExecutionTime) && ($hasTask))\n\t\t{\n\t\t\t//collect next task to execute\n\t\t\t$task = $this->getNextTaskToExecute();\n\n\t\t\t//execute task\n\t\t\tif ($task)\n\t\t\t{\n\t\t\t\t$task->execute();\n\t\t\t\t$this->setbtg_executed_tasks($this->getbtg_executed_tasks() + 1)->save();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t//no task to execute, quit loop\n\t\t\t\t$hasTask = false;\n\t\t\t}\n\t\t}\n\t}", "function flux_enqueue_responsive_background( $selector, $image_id )\n{\n global $bg_queue;\n $bg_queue[] = [ 'selector' => $selector, 'id' => $image_id ];\n}", "protected function processImage() {}", "function us_ajax_auto_optimize_assets() {\r\n\t\tif ( ! check_ajax_referer( 'us_ajax_auto_optimize_assets', '_nonce', FALSE ) ) {\r\n\t\t\twp_send_json_error(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'message' => us_translate( 'An error has occurred. Please reload the page and try again.' ),\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\twp_die();\r\n\t\t}\r\n\r\n\t\t/* @var $instance US_Auto_Optimize_Assets */\r\n\t\t$instance = US_Auto_Optimize_Assets::instance();\r\n\t\t// Run next step or start\r\n\t\t$instance->run();\r\n\r\n\t\t$res = array(\r\n\t\t\t// Check is processing\r\n\t\t\t'processing' => $instance->is_processing(),\r\n\t\t);\r\n\r\n\t\t// Getting a list of used assets\r\n\t\tif ( ! us_arr_path( $res, 'processing', TRUE ) ) {\r\n\t\t\t$assets_config = us_config( 'assets', array() );\r\n\t\t\t$used_assets = $instance->get_used_assets();\r\n\t\t\t// Forming new value for Optimize JS/CSS assets option\r\n\t\t\t$assets_value = array();\r\n\t\t\tforeach ( $assets_config as $component => $component_atts ) {\r\n\t\t\t\tif ( in_array( $component, $used_assets) ) {\r\n\t\t\t\t\t$assets_value[ $component ] = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$assets_value[ $component ] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$res = array_merge(\r\n\t\t\t\t$res, array(\r\n\t\t\t\t\t'message' => __( 'Optimization completed', 'us' ),\r\n\t\t\t\t\t'used_assets' => $used_assets,\r\n\t\t\t\t\t'assets_value' => $assets_value,\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\twp_send_json_success( $res );\r\n\t}", "public function createimgs(){\n /*$offers = (new \\app\\common\\model\\Projectoffer())->get_list(['isdel'=>0],'id',0);\n $this->createimg_job('offer_doc',$offers);*/\n /*$reports = (new \\app\\common\\model\\Projectreport())->get_list(['isdel'=>0],'id',0);\n $this->createimg_job('report_doc',$reports);*/\n $statics = (new \\app\\common\\model\\Projectstatic())->get_list(['isdel'=>0],'id',0);\n $this->createimg_job('static_doc',$statics,1);\n /*$pus = (new \\app\\common\\model\\Purchase())->get_list(['isdel'=>0],'id',0);\n $this->createimg_job('pu_doc',$pus);*/\n }", "protected function maybe_handle_async() {\n\t\tif ( $this->is_process_running() ) {\n\t\t\t// Background process already running.\n\t\t\twp_die();\n\t\t}\n\n\t\tif ( $this->is_queue_empty() ) {\n\t\t\t// No data to process: we're done.\n\t\t\t$this->complete();\n\t\t\twp_die();\n\t\t}\n\n\t\tcheck_ajax_referer( $this->identifier, 'nonce' );\n\n\t\t$this->handle();\n\n\t\twp_die();\n\t}", "protected function runCommandInBackground()\n {\n $this->callBeforeCallbacks();\n\n (new Process(\n $this->buildCommand(),\n null,\n null,\n null,\n null\n ))->run();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a translation for the listing in a specific language.
public function getTranslation( string $language ) { $translation = $this->request( "GET", "/application/shops/{$this->shop_id}/listings/{$this->listing_id}/translations/{$language}", "ListingTranslation" ); if($translation) { $translation->shop_id = $this->shop_id; } return $translation; }
[ "public function getTranslation($lang);", "public function getTranslation();", "public static function getTranslatedLanguage()\n {\n\n $api_url = Session::get(\"domainname\") . env(\"API_URL\");\n $API_TOKEN = env('API_TOKEN');\n $objCurlHandler = CurlRequestHandler::getInstance();\n $url = $api_url . \"/language-translate\";\n $data['user_id'] = Session::get('fs_user')['id'];\n $data['api_token'] = $API_TOKEN;\n $curlResponse = $objCurlHandler->curlUsingPost($url, $data);\n return $curlResponse->data;\n\n }", "public static function getTranslatedLanguage()\n {\n\n $api_url = env('API_URL');\n $API_TOKEN = env('API_TOKEN');\n $objCurlHandler = CurlRequestHandler::getInstance();\n $url = $api_url . \"/language-translate\";\n $data['user_id'] = Session::get('fs_user')['id'];\n $data['api_token'] = $API_TOKEN;\n $curlResponse = $objCurlHandler->curlUsingPost($url, $data);\n return $curlResponse->data;\n\n }", "abstract public function getTranslationIn(string $locale);", "public function getTranslations($language);", "public static function getTranslation()\n\t{\n\t\t// This language file is need by default.\n\t\tinclude($_SESSION['root'] . '/langs/en_US.php');\n\t\t$en_US = $LANG;\n\t\t\n\t\t// This file will be called when the user or the administrator select \n\t\t// a diferent language. But the primary language will be called first.\n\t\t// So if some words are not translated by the selected language it can be \n\t\t// displayed by the original language. \n\t\tinclude($_SESSION['root'] . '/langs/' . $_SESSION['site']['localization'] . '.php');\n\t\treturn array_merge($en_US, $LANG);\n\t}", "public function getLanguage();", "protected function get_translation ($language) {\n\t\t/**\n\t\t * Get current system translations\n\t\t */\n\t\t$translation = &$this->translation[$language];\n\t\t$translation = $this->get_translation_from_json(LANGUAGES.\"/$language.json\");\n\t\t$translation = $this->fill_required_translation_keys($translation, $language);\n\t\t/**\n\t\t * Set modules' translations\n\t\t */\n\t\tforeach (get_files_list(MODULES, false, 'd', true) as $module_dir) {\n\t\t\tif (file_exists(\"$module_dir/languages/$language.json\")) {\n\t\t\t\t$translation = $this->get_translation_from_json(\"$module_dir/languages/$language.json\") + $translation;\n\t\t\t}\n\t\t}\n\t\tEvent::instance()->fire(\n\t\t\t'System/general/languages/load',\n\t\t\t[\n\t\t\t\t'clanguage' => $language,\n\t\t\t\t'clang' => $translation['clang'],\n\t\t\t\t'cregion' => $translation['cregion']\n\t\t\t]\n\t\t);\n\t\t/**\n\t\t * If current language was set - append its translation to fill potentially missing keys\n\t\t */\n\t\tif ($this->current_language) {\n\t\t\t$translation = $translation + $this->translation[$this->current_language];\n\t\t}\n\t\treturn $translation;\n\t}", "public function get(string $label) {\n $langObj = $this->getTranslation();\n\n if ($langObj !== null) {\n return $langObj->get($label);\n }\n\n return $label;\n }", "public function getLanguage()\n {\n $data = $this->getLanguageFromCache();\n\n if (empty($data)) {\n $api = SugarApiUtil::getInstance();\n $reply = $api->call(\"lang/{$this->lang}?platform={$this->platform}\");\n if (!empty($reply['reply'])) {\n $data = $reply['reply'];\n $this->writeLanguageToCache($data);\n }\n }\n\n return $data;\n }", "public function getCurrentTranslation();", "function getTranslation($lang, $id) {\n $product = getProductById($id);\n $trans = getProductTranslationByLanguage($lang, $id);\n $response = array(\n 'id' => $product['id'],\n 'name' => $product['name'],\n 'description' => $product['description'],\n 'trans_name' => $trans['name'],\n 'trans_description' => $trans['description']\n );\n return $response;\n}", "public function get_current_language(){\n /*====================================\n * Get & set language\n *====================================*/\n $lang_code = \\Cookie::get('lang_code');\n $lang_code = (isset($lang_code) && !empty($lang_code))?$lang_code:\\Config::get('language');\n $data = \\Model_VsvnLanguage::find('first', ['where' => ['code' => $lang_code]]);\n \n /*================================================\n * Translate Name\n *================================================*/\n if(!empty($data)){\n $data->name = __($data->name, [], $data->name);\n }\n /*==================================================\n * Response Data\n *==================================================*/\n $response = ['status' => 'success',\n 'code' => Exception::E_ACCEPTED,\n 'message' => Exception::getMessage(Exception::E_ACCEPTED),\n 'data' => $data];\n return $this->response($response);\n }", "public function getTranslation($field, $locale);", "function getProductTranslationByLanguage($lang, $id) {\n if ($lang && array_search('product_'.$lang,R::inspect())!='') {\n return R::load('product_' . $lang . '', $id);\n }\n return null;\n}", "public function get_language($id)\n\t{\n\t\treturn $this->get_single($id);\n\t}", "function getTextByLabel($label)\n{\n $result = $label;\n\n static $translation;\n\n if (!isset($translation)) {\n\n // Get language code from cookies...\n if (isset($_COOKIE['lang']) && !empty($_COOKIE['lang'])) {\n $languageCode = $_COOKIE['lang'];\n\n // or from main installation settings\n } else {\n global $lcSettings;\n $languageCode = $lcSettings['default_language_code'];\n }\n\n // Check if language code value is satisfied to alpha-2 pattern for security reasons\n if (!preg_match('/^[a-z]{2}$/', $languageCode)) {\n $languageCode = 'en';\n }\n\n // Generate name of file that should contain language variables\n $labelsFile = constant('LC_DIR_ROOT') . 'Includes/install/translations/' . $languageCode . '.php';\n\n // Check if this file exists and include it (it must be correct php script, that is contained $translation array) otherwise include default translations(english)\n if (!file_exists($labelsFile)) {\n $labelsFile = constant('LC_DIR_ROOT') . 'Includes/install/translations/' . 'en.php';\n }\n include_once $labelsFile;\n }\n\n // Check if label value defined in translation array and assign this as a result\n if (!empty($translation[$label])) {\n $result = $translation[$label];\n }\n\n return $result;\n}", "function get_translation($id, $lang, $args=array()) {\n global $ryzom_texts, $user;\n if(!isset($ryzom_texts[$id])) return '{'.$id.'}';\n\t\tif(empty($ryzom_texts[$id][$lang])){\n\t\t\tif(isset($ryzom_texts[$id]['en'])) return @vsprintf($ryzom_texts[$id]['en'], $args);\n\t\t\treturn '{'.$id.'['.$lang.']}';\n\t\t}\n return @vsprintf($ryzom_texts[$id][$lang], $args);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Append joins from filter param entity to main filtered entity Exp: From Municipality (m) to AntiqueCar (h) is one join $qb>join('m.antiquecars', 'h');
private function appendEntityJoin($qb, $filterparam) { //how do i go from filter param to antiquecar entity (joins) switch ($filterparam) { case 'municipality': $qb->join('filter.antiquecars', 'h'); break; case 'brand': $qb->join('filter.cars', 'h'); break; case 'province': $qb->join('filter.municipalities', 'm') ->join('m.antiquecars', 'h'); break; } }
[ "#[@arg]\n public function setJoin() {\n $this->criteria->setFetchmode(Fetchmode::join('Person'));\n }", "function join($column,$filter,$foreign_column, $kind='inner', $filter_in_join=false)\n \t{\n \t\t$this->joins[]=new Join($column,$filter,$foreign_column,$kind, $filter_in_join);\n \t}", "private function _applyJoinParams()\n {\n if ($this->join !== null) {\n foreach ($this->join as $join) {\n $this->query->join[] = $join;\n $this->subQuery->join[] = $join;\n }\n }\n }", "protected function formJoinsUsingFilters(&$builder)\n {\n $this->join_models = [];\n foreach ($this->filters as $filter){\n $field_parts = explode('.', $filter[self::FILTER_PARAM_FIELD]);\n if (count($field_parts) > 1) {\n unset($field_parts[count($field_parts) - 1]);\n $this->formJoins($builder, $field_parts);\n }\n }\n }", "public function joinFields()\n {\n\t\t$this->getSelect()\n\t\t ->join(\n array('mad' => $this->getTable('magebid/auction_detail')), \n 'mad.magebid_auction_detail_id = main_table.magebid_auction_detail_id')\t\n\t\t ->join(\n array('mat' => $this->getTable('magebid/auction_type')), \n 'mat.magebid_auction_type_id = main_table.magebid_auction_type_id');\t\t\t\t\t\n\t\t//echo $this->getSelect()->__toString();\n }", "private function getJoinConditions() {\n $sql = $this->configuration['source_sql'];\n\n $selection = isset($this->configuration['selection']) ? $this->configuration['selection'] : [];\n\n // build em\n $join = [\n 'conditions' => 'f.fid = sourcetable.' . $sql['field'],\n 'args' => [],\n ];\n\n // bundle?\n if (!empty($sql['bundle'])) {\n $join['conditions'] .= ' AND sourcetable.bundle = :bundle';\n $join['args'][':bundle'] = $sql['bundle'];\n }\n\n // delta?\n if (isset($sql['delta'])) {\n $join['conditions'] .= ' AND sourcetable.delta = :delta';\n $join['args'][':delta'] = $sql['delta'];\n }\n\n // range?\n if (isset($selection['from']) && (int) $selection['from'] > 0) {\n $join['conditions'] .= ' AND sourcetable.entity_id >= :from';\n $join['args'][':from'] = (int) $selection['from'];\n }\n if (isset($selection['to']) && (int) $selection['to'] > 0) {\n $join['conditions'] .= ' AND sourcetable.entity_id <= :to';\n $join['args'][':to'] = (int) $selection['to'];\n }\n\n // node status?\n if (isset($selection['status'])) {\n $join['node'] = [\n 'alias' => 'n',\n 'conditions' => 'sourcetable.entity_id = n.nid AND sourcetable.bundle = n.type AND n.status = :nodestatus',\n 'args' => [\n ':nodestatus' => (int) $selection['status'],\n ]\n ];\n }\n\n // entity queue?\n if (isset($selection['entity_queue'])) {\n $join['entityqueue'] = [\n 'table' => 'field_data_eq_node',\n 'alias' => 'eq',\n 'conditions' => 'sourcetable.entity_id = eq.eq_node_target_id AND eq.entity_type = :entity_type AND eq.bundle = :entityqueue_bundle AND eq.deleted = 0',\n 'args' => [\n ':entity_type' => 'entityqueue_subqueue',\n ':entityqueue_bundle' => $selection['entity_queue'],\n ],\n ];\n }\n\n return $join;\n }", "abstract function getJoinPredicate($entity);", "private function join_associations_table( $join ) {\n\t\t$association_table = $this->get_table_names()->association_table();\n\t\t$posts_table_name = $this->wpdb->posts;\n\t\t$target_element_column = $this->target_role->get_name() . '_id';\n\t\t$for_element_column = $this->target_role->other() . '_id';\n\n\t\t$join .= $this->wpdb->prepare(\n\t\t\t\" LEFT JOIN {$association_table} AS toolset_associations ON ( \n\t\t\t\ttoolset_associations.relationship_id = %d\n\t\t\t\tAND toolset_associations.{$target_element_column} = {$posts_table_name}.ID\n\t\t\t\tAND toolset_associations.{$for_element_column} = %d\n\t\t\t) \",\n\t\t\t$this->relationship->get_row_id(),\n\t\t\t$this->for_element->get_default_language_id()\n\t\t);\n\n\t\treturn $join;\n\t}", "public function leftJoin($entity);", "protected function _buildJoin () {\r\n if (empty ($this->_join))\r\n return;\r\n\r\n foreach ($this->_join as $data) {\r\n list ($joinType, $joinTable, $joinCondition) = $data;\r\n\r\n if (is_object ($joinTable))\r\n $joinStr = $this->_buildPair (\"\", $joinTable);\r\n else\r\n $joinStr = $joinTable;\r\n\r\n $this->_query .= \" \" . $joinType. \" JOIN \" . $joinStr .\" on \" . $joinCondition;\r\n\r\n // Add join and query\r\n if (!empty($this->_joinAnd) && isset($this->_joinAnd[$joinStr])) {\r\n foreach($this->_joinAnd[$joinStr] as $join_and_cond) {\r\n list ($concat, $varName, $operator, $val) = $join_and_cond;\r\n $this->_query .= \" \" . $concat .\" \" . $varName;\r\n $this->conditionToSql($operator, $val);\r\n }\r\n }\r\n }\r\n }", "protected function _setJoins() {\n\t\tif(!empty($this->filter['CoursesTadirahObject.tadirah_object_id'])) {\n\t\t\t$subquery = $this->Course->find('all', array(\n\t\t\t\t'joins' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'alias' => 'CoursesTadirahObject',\n\t\t\t\t\t\t'table' => 'courses_tadirah_objects',\n\t\t\t\t\t\t'type' => 'INNER',\n\t\t\t\t\t\t'conditions' => 'CoursesTadirahObject.course_id = Course.id'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'CoursesTadirahObject.tadirah_object_id' => $this->filter['CoursesTadirahObject.tadirah_object_id']\n\t\t\t\t),\n\t\t\t\t'fields' => array('DISTINCT (CoursesTadirahObject.course_id) AS ids_filtered'),\n\t\t\t\t'contain' => array('CoursesTadirahObject')\n\t\t\t));\n\t\t\t$this->filter['Course.id'] = Set::extract('/CoursesTadirahObject/ids_filtered', $subquery);\n\t\t\tunset($this->filter['CoursesTadirahObject.tadirah_object_id']);\n\t\t}\n\t\tif(!empty($this->filter['CoursesTadirahTechnique.tadirah_technique_id'])) {\n\t\t\t$subquery = $this->Course->find('all', array(\n\t\t\t\t'joins' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'alias' => 'CoursesTadirahTechnique',\n\t\t\t\t\t\t'table' => 'courses_tadirah_techniques',\n\t\t\t\t\t\t'type' => 'INNER',\n\t\t\t\t\t\t'conditions' => 'CoursesTadirahTechnique.course_id = Course.id'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'CoursesTadirahTechnique.tadirah_technique_id' => $this->filter['CoursesTadirahTechnique.tadirah_technique_id']\n\t\t\t\t),\n\t\t\t\t'fields' => array('DISTINCT (CoursesTadirahTechnique.course_id) AS ids_filtered'),\n\t\t\t\t'contain' => array('CoursesTadirahTechnique')\n\t\t\t));\n\t\t\t$this->filter['Course.id'] = Set::extract('/CoursesTadirahTechnique/ids_filtered', $subquery);\n\t\t\tunset($this->filter['CoursesTadirahTechnique.tadirah_technique_id']);\n\t\t}\n\t\tif(!empty($this->filter['CoursesTadirahActivity.tadirah_activity_id'])) {\n\t\t\t$subquery = $this->Course->find('all', array(\n\t\t\t\t'joins' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'alias' => 'CoursesTadirahActivity',\n\t\t\t\t\t\t'table' => 'courses_tadirah_activities',\n\t\t\t\t\t\t'type' => 'INNER',\n\t\t\t\t\t\t'conditions' => 'CoursesTadirahActivity.course_id = Course.id'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'CoursesTadirahActivity.tadirah_activity_id' => $this->filter['CoursesTadirahActivity.tadirah_activity_id']\n\t\t\t\t),\n\t\t\t\t'fields' => array('DISTINCT (CoursesTadirahActivity.course_id) AS ids_filtered'),\n\t\t\t\t'contain' => array('CoursesTadirahActivity')\n\t\t\t));\n\t\t\t$this->filter['Course.id'] = Set::extract('/CoursesTadirahActivity/ids_filtered', $subquery);\n\t\t\tunset($this->filter['CoursesTadirahActivity.tadirah_activity_id']);\n\t\t}\n\t\tif(!empty($this->filter['CoursesNwoDiscipline.nwo_discipline_id'])) {\n\t\t\t$subquery = $this->Course->find('all', array(\n\t\t\t\t'joins' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'alias' => 'CoursesNwoDiscipline',\n\t\t\t\t\t\t'table' => 'courses_nwo_disciplines',\n\t\t\t\t\t\t'type' => 'INNER',\n\t\t\t\t\t\t'conditions' => 'CoursesNwoDiscipline.course_id = Course.id'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'CoursesNwoDiscipline.nwo_discipline_id' => $this->filter['CoursesNwoDiscipline.nwo_discipline_id']\n\t\t\t\t),\n\t\t\t\t'fields' => array('DISTINCT (CoursesNwoDiscipline.course_id) AS ids_filtered'),\n\t\t\t\t'contain' => array('CoursesNwoDiscipline')\n\t\t\t));\n\t\t\t$this->filter['Course.id'] = Set::extract('/CoursesNwoDiscipline/ids_filtered', $subquery);\n\t\t\tunset($this->filter['CoursesNwoDiscipline.nwo_discipline_id']);\n\t\t}\n\t}", "protected function GetFilterQueryCustomJoins()\n {\n $sQueryJoin = ' LEFT JOIN `cms_tpl_module_cms_usergroup_mlt` ON `cms_tpl_module_instance`.`cms_tpl_module_id` = `cms_tpl_module_cms_usergroup_mlt`.`source_id`\n LEFT JOIN `cms_tpl_module_cms_portal_mlt` ON `cms_tpl_module_instance`.`cms_tpl_module_id` = `cms_tpl_module_cms_portal_mlt`.`source_id` ';\n\n return $sQueryJoin;\n }", "private function addJoinsToQuery()\n {\n if (!empty($this->joins)) {\n foreach ($this->joins as $join) {\n $this->query .= \" {$join->type} `{$this->dbName}`.`{$join->tableToJoin}`\";\n \n if (!empty($join->alias)) {\n $this->query .= \" AS {$join->alias}\";\n }\n \n $this->query .= \" ON `{$this->dbName}`.\";\n \n $this->query .= \"`\".(!empty($join->alias) ? $join->alias : $join->tableToJoin).\"`.\";\n \n $this->query .= \"`{$join->tableField}` =\";\n \n $this->query .= \" `{$this->dbName}`.`{$join->parentTable}`.`{$join->parentField}`\";\n if ($join->additionalCondition) {\n $this->query .= \" \".$join->additionalCondition;\n }\n }\n }\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "protected function _buildQueryJoins(&$query)\n {\n \n\t\t\n }", "abstract public function get_sql_join_clause( $filter_value): string;", "public function joinProductFilter()\n\t{\n\t $this->joinExportCategoryProduct();\n\t}", "private function _addJoinQuery($select, array $params = array())\r\n {\r\n if (isset($params['joinTables']) && count($params['joinTables']))\r\n $this->_joinTables = $params['joinTables'];\r\n\r\n /* If needs to add some data from other table, tests the joinTables\r\n * property. If not empty add tables and join clauses.\r\n */\r\n if (count($this->_joinTables) > 0)\r\n {\r\n // Loop on tables list(given by object class) to build the query\r\n foreach ($this->_joinTables as $key => $object)\r\n {\r\n if (is_array($object)){\r\n $objName = $object['obj'];\r\n $foreignKey = $object['foreignKey'];\r\n }\r\n else{\r\n $objName = $object;\r\n if($objName==\"ProductsInfoObject\"){\r\n $foreignKey = \"APBP_Productinfo\";\r\n }\r\n elseif($objName==\"BranchesObject\"){\r\n $foreignKey = \"APBP_Branch\";\r\n }\r\n else{\r\n $foreignKey = $params['foreignKey'];\r\n }\r\n }\r\n //Create an object and fetch data from object.\r\n $tmpObject = new $objName();\r\n $tmpDataTable = $tmpObject->getDataTableName();\r\n $tmpIndexTable = $tmpObject->getIndexTableName();\r\n $tmpColumnData = $tmpObject->getDataColumns();\r\n $tmpColumnIndex = $tmpObject->getIndexColumns();\r\n //Add data to tables list\r\n $tables[$tmpDataTable] = $tmpColumnData;\r\n $tables[$tmpIndexTable] = $tmpColumnIndex;\r\n //Get the primary key of the first data object to join table\r\n $tmpDataId = $tmpObject->getDataId();\r\n // If it's the first loop, join first table to the current table\r\n\r\n\r\n //LEFT JOIN `DocumentationsCategoryData` ON DCD_ID = DD_ID LEFT JOIN `DocumentationsCategoryIndex` ON DCD_ID = DCI_ID\r\n\r\n\r\n if ($key == 0)\r\n {\r\n $select->joinLeft($tmpDataTable, $tmpDataId . ' = ' . $foreignKey);\r\n //If there's an index table then it too and filter according language\r\n if (!empty($tmpIndexTable))\r\n {\r\n $tmpIndexId = $tmpObject->getIndexId();\r\n $select->joinLeft(\r\n $tmpIndexTable, $tmpDataId . ' = ' . $tmpIndexId);\r\n $select->where(\r\n $tmpIndexTable . '.' . $tmpObject->getIndexLanguageId() . ' = ?', $this->_defaultEditLanguage);\r\n }\r\n }\r\n elseif ($key > 0){\r\n // We have an other table to join to previous.\r\n $tmpDataId = $tmpObject->getDataId();\r\n\r\n $select->joinLeft(\r\n $tmpDataTable, $tmpDataId . ' = ' . $foreignKey);\r\n\r\n if (!empty($tmpIndexTable))\r\n {\r\n $tmpIndexId = $tmpObject->getIndexId();\r\n $select->joinLeft(\r\n $tmpIndexTable,\r\n $tmpDataId . ' = ' . $tmpIndexId);\r\n\r\n $select->where(\r\n $tmpIndexTable . '.' . $tmpObject->getIndexLanguageId() . ' = ?', $this->_defaultEditLanguage);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return $select;\r\n }", "private function buildJoin()\n {\n if (empty($this->join)) {\n return;\n }\n\n foreach ($this->join as $data) {\n list ($joinType, $joinTable, $joinCondition) = $data;\n\n if (is_object($joinTable)) {\n $joinStr = $this->buildPair(\"\", $joinTable);\n } else {\n $joinStr = $joinTable;\n }\n\n $this->query .= \" \".$joinType.\" JOIN \".$joinStr.\n (false !== stripos($joinCondition, 'using') ? \" \" : \" ON \")\n .$joinCondition;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Fields for game signup Note: this is strongly tied to the hydra sites need for sortable games lists. The frontend uses jquery sortable to allow users to order games by preference order
public function GameSignupFields($reg){ $fields = new FieldList(); $currentID = $this->getCurrentEvent()->ID; $event = Event::get()->byID($currentID); $prefNum = $event->PreferencesPerSession; $reg = $this->getCurrentRegistration(); $fields->push(HiddenField::create('RegistrationID', 'Reg', $reg->ID)); if (!$this->DisableFavourite()) { $fields->push($fav = HiddenField::create('FavouriteID', 'Favourite')); $fav->addExtraClass('favourite-id'); } $fields->push(LiteralField::create('no-js','<p class="js-hide">This page works better with javascript. If you can\'t use javascript, rank the items below in your order of preference. 1 for your first choice, 2 for your second. Note, only the top ' . $prefNum . ' will be recorded</p>')); for ($session = 1; $session <= $event->NumberOfSessions; $session++){ $evenOdd = $session % 2 == 0 ? 'even': 'odd'; $fieldset = '<fieldset id="round'.$session.'" class="preference-group preference-'.$prefNum.' data-preference-select="preference-select-group">'; $fields->push(LiteralField::create('Heading_'.$session, '<h5>Round '.$session.' preferences</h5>'. $fieldset)); $games = Game::get()->filter(array( 'Session' => $session, 'ParentID' =>$currentID, 'Status' => true ))->sort('RAND()'); $i = 1; foreach ($games as $game){ $gameOptions = NumericField::create("GameID_".$game->ID, ''); $gameOptions->setValue($i) ->setRightTitle($game->Title) ->setAttribute('type','number') ->setAttribute('data-id',$game->ID) ->addExtraClass('small-input js-hide-input'); $fields->push($gameOptions); $i++; } if($this->EnableLuckyDip()) { // Add not playing option $gameOptions = NumericField::create("LuckyDip_".$session, ''); $gameOptions->setValue($i) ->setRightTitle("Lucky dip") ->setAttribute('type','number') ->addExtraClass('small-input js-hide-input isfinal'); $fields->push($gameOptions); $i++; } // Add not playing option $gameOptions = NumericField::create("NotPlaying_".$session, ''); $gameOptions->setValue($i) ->setRightTitle("No game (or Facilitating)") ->setAttribute('type','number') ->addExtraClass('small-input js-hide-input not-playing isfinal'); $fields->push($gameOptions); $fields->push(LiteralField::create('fieldset', '</fieldset>')); } $allgames = Game::get()->filter(array( 'ParentID' => $currentID, 'Status' => true )); $allgamesMap = $allgames->map("ID", "Title")->toArray(); asort($allgamesMap); // tag input field $fields->push($tagfield = new Listboxfield( 'HasPlayed', 'I have already played these games' )); $tagfield->setMultiple(true) ->setSource($allgamesMap) ->setAttribute( 'data-placeholder', 'Select games' ); $tagfield->addExtraClass('js-select2 ptl'); return $fields; }
[ "function bplm_get_the_games_form( $game ){\n\n\t// Add Scripts and Style\n\twp_enqueue_script( 'bplm_js' );\n\twp_enqueue_style( 'bplm_screen' );\n\n\t$registered_player = $game->registered_players;\n\n\t$player_list = '<ul class=\"tabs\">';\n\t$forms = '';\n\n\tforeach ($registered_player as $player_nicename ) {\n\n\t\t$user = get_user_by('slug', $player_nicename);\n\n\t\t$player_list .= \"<li><a href='#tab_\". $player_nicename .\"'>$user->display_name</a></li>\";\n\t\t$forms .= bplm_get_players_forms( $player_nicename, $game );\n\n\t}\n\n\t$player_list .= '</ul>';\n\t$forms = '<div class=\"games-forms\">' . $player_list . $forms . '</div>';\n\t$forms .= '<div class=\"total-partie\">'. $game->get_total() . '</div>';\n\n\treturn $forms;\n}", "function goxeedmodule_goxeedmodule_preprocess_page_goxeedmodule_game_user ($variables)\n{\n\n $variables[\"display_submitted\"] = FALSE;\n \n global $user;\n $node = $variables[\"node\"];\n $node = goxeedmodule_node_secure_load ($node->nid);\n // EDIT\n\n $items = goxeedmodule_field_secure_get_items (\"node\", $node, \"field_goxeed_game_nid\");\t\t\t\t// Get the game field and ..\n $game_local = goxeedmodule_node_secure_load ($items[0][\"value\"]);\t\t\t\t\t\t\t\t\t// .. load the corresponding game node.\n if ($user->uid > 1 && arg(2) == \"edit\")\t\t\t\t\t\t\t\t\t\t\t// If edit selected and not Drupal admin\n drupal_goto (\"node/\".$game_local->nid.\"/edit\");\t\t\t\t\t\t\t\t\t// .. go to edit the game\n \n // TITLE SET\n \n $items_user = goxeedmodule_field_secure_get_items (\"node\", $node, \"field_goxeed_user_uid\");\t\t\t\t// Get user id field items\n $user_local = goxeedmodule_user_secure_load ($items_user[0][\"value\"]);\n $items_node = goxeedmodule_field_secure_get_items (\"node\", $node, \"field_goxeed_game_nid\");\t\t\t\t// Get game id field items\n $title_new = $game_local->title;\t\t\t\t\t\t\t\t\t\t\t\t// Title is initially just the title of the game\n if ($user->uid != $items_user[0][\"value\"])\t\t\t\t\t\t\t\t\t\t// If the user in not the logged in user\n {\n $title_new = $title_new . \" \" . t(\"for\") . \" \" .\n goxeedmodule_real_name($user_local);\t\t\t\t\t\t\t\t\t\t\t// Add the name of the user to the title\n }\n drupal_set_title ($title_new);\t\t\t\t\t\t\t\t\t\t\t\t\t// Set the changed title in Drupal\n\n return NULL; //$variables;\n}", "function show_all_signups ()\n{\n $EventId = intval (trim ($_REQUEST['EventId']));\n\n if (! isset ($_REQUEST['OrderBy']))\n $OrderBy = ORDER_BY_NAME;\n else\n $OrderBy = intval (trim ($_REQUEST['OrderBy']));\n\n if (isset ($_REQUEST['CSV']))\n $csv = intval (trim ($_REQUEST['CSV']));\n else\n $csv = 0;\n\n if (array_key_exists ('FirstTime', $_REQUEST))\n {\n $include_name_checked = 'CHECKED';\n $include_email_checked = 'CHECKED';\n $include_confirmed_checked = 'CHECKED';\n $include_waitlisted_checked = 'CHECKED';\n }\n else\n {\n if (array_key_exists ('IncludeName', $_REQUEST))\n $include_name_checked = 'CHECKED';\n else\n $include_name_checked = '';\n\n\n if (array_key_exists ('IncludeEmail', $_REQUEST))\n $include_email_checked = 'CHECKED';\n else\n $include_email_checked = '';\n\n if (array_key_exists ('IncludeConfirmed', $_REQUEST))\n $include_confirmed_checked = 'CHECKED';\n else\n $include_confirmed_checked = '';\n\n if (array_key_exists ('IncludeWaitlisted', $_REQUEST))\n $include_waitlisted_checked = 'CHECKED';\n else\n $include_waitlisted_checked = '';\n }\n\n // Fetch the game title\n\n $Title = $_SESSION['GameTitle'];\n\n echo \"<I><B><FONT SIZE='+2'>$Title</FONT></B></I><P>\\n\";\n\n switch ($OrderBy)\n {\n default:\n case ORDER_BY_SEQ:\n $order_by_text = 'Signup';\n $order_by_sql = 'Signup.SignupId';\n break;\n\n case ORDER_BY_NAME:\n $order_by_text = 'Player Name';\n $order_by_sql = 'Users.LastName, Users.FirstName';\n break;\n\n }\n\n // Get the list of GMs. We'll want to know if any aren't signed up\n\n $sql = 'SELECT GMs.UserId, Users.DisplayName ';\n $sql .= ' FROM Users, GMs';\n $sql .= \" WHERE GMs.EventId=$EventId\";\n $sql .= ' AND Users.UserId=GMs.UserId AND GMs.Role != \\'performer\\'';\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query failed for GM list for Event $EventId\",\n\t\t\t\t$sql);\n\n $gms = array();\n\n while ($row = mysql_fetch_object ($result))\n $gms[$row->UserId] = \"$row->DisplayName\";\n\n // Fetch the list of confirmed and waitlisted users\n\n $status = array ();\n $conf_counter = 0;\n $wait_counter = 0;\n\n $sql = 'SELECT Signup.SignupId, Signup.State, Signup.Counted';\n $sql .= ' FROM Signup, Runs';\n $sql .= \" WHERE Runs.EventId=$EventId\";\n $sql .= ' AND Signup.RunId=Runs.RunId';\n $sql .= ' AND Signup.State<>\"Withdrawn\"';\n $sql .= ' ORDER BY SignupId';\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error ('Query failed for signup list', $sql);\n\n while ($row = mysql_fetch_object ($result))\n {\n if ('N' == $row->Counted)\n $status[$row->SignupId] = \"N/C\";\n else\n {\n if ('Confirmed' == $row->State)\n\t$status[$row->SignupId] = sprintf ('%03d', ++$conf_counter);\n else\n\t$status[$row->SignupId] = sprintf ('%03d', ++$wait_counter);\n }\n }\n\n // Fetch the list of players signed up\n\n $sql = 'SELECT DISTINCT Users.UserId, Users.DisplayName,';\n $sql .= ' Users.EMail, Runs.Day, Runs.StartHour, ';\n $sql .= ' Signup.SignupId';\n $sql .= ' FROM Signup, Runs, Users';\n $sql .= \" WHERE Runs.EventId=$EventId\";\n $sql .= ' AND Signup.RunId=Runs.RunId';\n $sql .= ' AND Users.UserId=Signup.UserId';\n\n if ($csv)\n {\n $csv_checked = 'CHECKED';\n $html_checked = '';\n }\n else\n {\n $csv_checked = '';\n $html_checked = 'CHECKED';\n }\n\n echo \"<FORM METHOD=POST ACTION=Schedule.php>\\n\";\n printf (\"<INPUT TYPE=HIDDEN NAME=action VALUE=%d>\\n\",\n\t SCHEDULE_SHOW_ALL_SIGNUPS);\n echo \"<INPUT TYPE=HIDDEN NAME=EventId VALUE=$EventId>\\n\";\n echo \"<INPUT TYPE=HIDDEN NAME=OrderBy VALUE=$OrderBy>\\n\";\n\n echo \"<TABLE>\\n\";\n echo \" <TR VALIGN=TOP>\\n\";\n echo \" <TD>Display as</TD>\\n\";\n echo \" <TD>\\n\";\n echo \" <B>\\n\";\n echo \" <INPUT TYPE=RADIO NAME=CSV VALUE=0 $html_checked>HTML Table</BR>\\n\";\n echo \" <INPUT TYPE=RADIO NAME=CSV VALUE=1 $csv_checked>Comma Separated Values\\n\";\n echo \" </B>\\n\";\n echo \" </TD>\\n\";\n echo \" </TR>\\n\";\n echo \" <TR VALIGN=TOP>\\n\";\n echo \" <TD>Include fields:</TD>\\n\";\n echo \" <TD>\\n\";\n echo \" <B>\\n\";\n echo \" <INPUT TYPE=CHECKBOX NAME=IncludeName $include_name_checked>&nbsp;Name\\n\";\n echo \" <INPUT TYPE=CHECKBOX NAME=IncludeEmail $include_email_checked>&nbsp;EMail<BR>\\n\";\n echo \" </B>\\n\";\n echo \" <INPUT TYPE=SUBMIT VALUE=\\\"Update\\\">\\n\";\n echo \" </TD>\\n\";\n echo \" </TR>\\n\";\n echo \"</TABLE>\\n\";\n echo \"<P>\\n\";\n\n if ($csv)\n {\n $sql .= ' AND Signup.State<>\"Withdrawn\"';\n\n // echo \"$sql<p>\\n\";\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error ('Query failed for CSV players', $sql);\n\n\n echo \"<DIV class=\\\"class11\\\" NOWRAP>\\n\";\n while ($row = mysql_fetch_object ($result))\n {\n if (empty ($gms[$row->UserId]))\n\t$gm = '&nbsp;';\n else\n {\n\t$gm = 'GM';\n\tunset ($gms[$row->UserId]);\n }\n\n $name = stripslashes (trim (\"$row->DisplayName\"));\n\n if (0 == $row->BirthYear)\n\t$age = '?';\n else\n\t$age = birth_year_to_age ($row->BirthYear);\n\n if ($include_name_checked != '')\n\techo \"\\\"$name\\\",\";\n\n if ($include_email_checked != '')\n\techo \"$row->EMail,\";\n\n echo \" \".$row->Day.\", \".start_hour_to_am_pm($row->StartHour);\n echo \"<BR>\\n\";\n }\n echo \"</DIV>\\n\";\n }\n else\n {\n $conf_sql = $sql . \" AND Signup.State='Confirmed' ORDER BY $order_by_sql\";\n $wait_sql = $sql . \" AND Signup.State='Waitlisted' ORDER BY $order_by_sql\";\n\n // echo \"$conf_sql<P>\\n\";\n\n $result = mysql_query ($conf_sql);\n if (! $result)\n return display_mysql_error (\"Query for list of confirmed participants for event $EventId failed\",\n\t\t\t\t $conf_sql);\n\n if (0 == mysql_num_rows ($result))\n {\n echo \"No players are signed up for this event\\n\";\n }\n else\n {\n $can_edit = can_edit_game_info ();\n\n show_signups_state (true, $EventId, 0, $order_by_text,\n\t\t\t $OrderBy, $result, $status, $gms, $can_edit,\n\t\t\t '', $include_name_checked,\n\t\t\t $include_email_checked, '',\n\t\t\t '',\n\t\t\t $include_confirmed_checked,\n\t\t\t $include_waitlisted_checked, TRUE);\n\n $result = mysql_query ($wait_sql);\n if (! $result)\n\treturn display_mysql_error (\"Query for list of waitlisted players for event $EventId failed\",\n\t\t\t\t $wait_sql);\n\n if (0 != mysql_num_rows ($result))\n\tshow_signups_state (false, $EventId, 0, $order_by_text,\n\t\t\t $OrderBy, $result, $status, $gms, $can_edit,\n\t\t\t '', $include_name_checked,\n\t\t\t $include_email_checked, '',\n\t\t\t '',\n\t\t\t $include_confirmed_checked,\n\t\t\t $include_waitlisted_checked, TRUE);\n }\n }\n\n if (sizeof ($gms) > 0)\n {\n echo \"<P><B>The following Presenters are not signed up for this event:</B><BR>\\n\";\n foreach ($gms as $gmid => $name)\n echo \"&nbsp;&nbsp;&nbsp;&nbsp;$name<BR>\\n\";\n }\n\n echo \"<P>\\n\";\n printf (\"Return to <A HREF=Schedule.php?action=%d&EventId=%d><I>%s</I></A>\\n\",\n\t SCHEDULE_SHOW_GAME,\n\t $EventId,\n\t $Title);\n echo \"<P>\\n\";\n}", "function fill_in_additional_list_fields()\n\t{\n\t\t//$this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);\n\n\n\n\t}", "private function addSignUpFields()\n {\n $this->add([\n 'name' => 'username',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Username',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n $this->add([\n 'name' => 'passwordConfirm',\n 'type' => 'password',\n 'options' => [\n 'label' => 'Confirm Password',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n \n $this->add([\n 'name' => 'firstname',\n 'type' => 'text',\n 'options' => [\n 'label' => 'First name',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]); \n $this->add([\n 'name' => 'lastname',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Last name',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n $this->add([\n 'name' => 'registration_type',\n 'type' => 'radio',\n 'options' => [\n 'value_options' => [\n '1' => [\n 'label' => '<span></span> Client',\n 'label_attributes' => ['class' => 'css-input css-radio css-radio-success push-10-r'],\n 'disable_html_escape' => true,\n 'value' => '1'\n ],\n '2' => [\n 'label' => '<span></span> Artisant',\n 'label_attributes' => ['class' => 'css-input css-radio css-radio-success'],\n 'value' => '2'\n ],\n ],\n 'label' => 'You are?',\n 'label_options' => [\n 'disable_html_escape' => true,\n ]\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n }", "function it_exchange_mailchimp_sign_up_add_field_to_registration_template_parts( $fields ) {\n\n /**\n * We want to add our field right before the save button\n * 1) Find the save button\n * 2) Spice our value in right before the save button\n * 3) In the event that the save button wasn't found, just tack onto the end\n */\n\n $key = array_search( 'password2', $fields );\n if ( false === $key )\n $fields[] = 'mailchimp-signup';\n else\n array_splice( $fields, ++$key, 0, array( 'mailchimp-signup' ) );\n\n return $fields;\n}", "public function render_upgradable_field( $args ) {\n\t\t\t$id = $args['id'];\n\t\t\t$icon = $args['icon'];\n\t\t\t$label = $args['label'];\n\t\t\t$plan = isset( $args['plan'] ) ? $args['plan'] : '';\n\n\t\t\techo '<li id=\"' . $id . '_list \" class=\"ur-registered-item ur-upgradable-field ui-draggable-disabled\" data-field-id=\"' . $id . '\" data-plan=\"' . $plan . '\"><span class=\"' . $icon . '\"></span>' . $label . '</li>';\n\t\t}", "public function action_permissions_fields_game($game)\n {\n // Ajax?\n if(!Request::$is_ajax)\n {\n exit;\n }\n\n // Games\n $games = Gameloader::get_games();\n\n // Valid game?\n if(!isset($games[$game]))\n {\n exit;\n }\n\n // Display\n echo View::factory('servers/fields', array('current' => 0, 'fields' => Gameloader::get_permissions($game)))\n ->render();\n\n // Done\n exit;\n }", "private function viewRegistrations(){ \n\t \n\t\t $html='<div class=\"h3\"><h3>Registrations</h3></div>';\n\t\t $html.='<table class=\"gameAdmin rego\">';\n\t\t $html.='<tr><th class=\"editRow\"></th><th>Name</th><th>User Name</th><th>Email</th><th class=\"details\">Details</th>';\n\t\t \n\t $results=$this->generated->getRegistrations();\n\t\t//print_r($results);\n\t\tif(is_array($results)){\n\t\t $count=0;\n\t\t foreach($results as $person){\n\t\t\tif($count==1){\n\t\t\t\t$alt=\"alt\";\n\t\t }else{\n\t\t\t\t$alt=\"alt2\";\n\t\t }\t\n\t\t\textract($person);\n\t\t \n\t\t\t$html.='<tr class=\"'.$alt.'\">';\n\t\t\t$html.='<td class=\"editRow\"><a href=\"index.php?pageName=admin&amp;userID='.$userID.'&amp;edit=userReg\"';\n\t\t\t$html.=' class=\"buttonImg edit\" title=\"Edit\">Admin</a></td>';\t\n\t\t\t$html.='<td class=\"name\">';//index.php?pageName=profile&userID=3\n\t\t\t$html.='<a href=\"index.php?pageName=profile&userID='.$userID.'\">'.$userFullName.'</a>';\n\t\t\t$html.='</td>';\n\t\t\t$html.='<td class=\"userName\">';//index.php?pageName=profile&userID=3\n\t\t\t$html.=$userName;\n\t\t\t$html.='</td>';\n\t\t\t$html.='<td class=\"email\"><a href=\"mailto:'.$userEmail.'\">'.$userEmail.'</a></td>';\n\t\t\t$html.='<td class=\"details\"><a href=\"#\" class=\"button show noView\" id=\"'.$userName.'\">show</a></td>';\n\t\t\t$html.='</tr>';\n\t\t\t$html.='<tr class=\"'.$userName.'\"><td class=\"toggle\" colspan=\"5\">';\n\t\t\t$html.='<ul class=\"gameList hidden\">';\n\t\t\t$html.='<li><span class=\"label\">Membership:</span> '.$infoMemberShip.'</li>'; // infoMemberShip, infoAttend, infoAccom, infoPlayWith, infoNotPlayWith, infoTransport, infoFood, infoComments\n\t\t\t$html.='<li><span class=\"label\">Attending:</span>'.$infoAttend.'</li>';\n\t\t\t$html.='<li><span class=\"label\">Accommodation:</span>'.$infoAccom.'</li>';\n\t\t $html.='<li><span class=\"label\">Play With:</span>'.$infoPlayWith.'</li>';\n\t\t $html.='<li><span class=\"label\">Not Play With:</span>'.$infoNotPlayWith.'</li>';\n\t\t $html.='<li><span class=\"label\">Transport:</span>'.$infoTransport.'</li>';\n\t\t $html.='<li><span class=\"label\">Food:</span>'.$infoFood.'</li>';\n\t\t $html.='<li><span class=\"label\">Comments:</span><span class=\"tableText\">'.$infoComments.'</span></li>';\n\t\t \n\t\t\t$html.='</ul>';\n\t\t\t$html.='</td></tr>';\n\t\t\tif($count==1){\n\t\t\t\t$count=0;\n\t\t }else{\n\t\t\t\t$count=1;\n\t\t }\n\t\t }\n\t\t}\n\t\t$html.='</table>';\n\t\t$html.='<div class=\"rego\">';\n\t\t$html.='<div class=\"downloadFile\"><a href=\"index.php?pageName=admin&download=reg\" class=\"expand\"><span class=\"buttonImg download\">Download</span>Download CSV file</a></div>';\n\t\t $html.='</div>';\n\t\t $html.='<p class=\"note\">Note: Ignore all reg details associated with the admin account</p>';\n\t\treturn $html;\n\t}", "function jigoshop_admin_fields($options) {\n\t?>\n\t<div id=\"tabs-wrap\">\n\t\t<p class=\"submit\"><input name=\"save\" type=\"submit\" value=\"<?php _e('Save changes','jigoshop') ?>\" /></p>\n\t\t<?php\n\t\t $counter = 1;\n\t\t echo '<ul class=\"tabs\">';\n\t\t foreach ($options as $value) {\n\t\t\t\tif ( 'tab' == $value['type'] ) :\n\t\t echo '<li><a href=\"#'.$value['type'].$counter.'\">'.$value['tabname'].'</a></li>'. \"\\n\";\n\t\t $counter = $counter + 1;\n\t\t\t\tendif;\n\t\t }\n\t\t echo '</ul>';\n\t\t $counter = 1;\n\t\t foreach ($options as $value) :\n\t\t switch($value['type']) :\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"titledesc\"><?php echo $value['name']; ?></td>\n\t\t\t\t\t\t\t<td class=\"forminp\"><?php echo $value['desc']; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tbreak;\n\t\t case 'tab':\n\t\t echo '<div id=\"'.$value['type'].$counter.'\" class=\"panel\">';\n\t\t echo '<table class=\"widefat fixed\">'. \"\\n\\n\";\n\t\t break;\n\t\t case 'title':\n\t\t \t?><thead><tr><th scope=\"col\" width=\"200px\"><?php echo $value['name'] ?></th><th scope=\"col\" class=\"desc\"><?php if (isset($value['desc'])) echo $value['desc'] ?>&nbsp;</th></tr></thead><?php\n\t\t break;\n\t\t case 'text':\n\t\t \t?><tr>\n\t\t <td class=\"titledesc\"><?php if ($value['tip']) { ?><a href=\"#\" tip=\"<?php echo $value['tip'] ?>\" class=\"tips\" tabindex=\"99\"></a><?php } ?><?php echo $value['name'] ?>:</td>\n\n\t\t <td class=\"forminp\"><input name=\"<?php echo $value['id'] ?>\" id=\"<?php echo $value['id'] ?>\" type=\"<?php echo $value['type'] ?>\" style=\"<?php echo $value['css'] ?>\"\n\t\t\t\t\t\t\t\tvalue=\"<?php if ( get_option( $value['id']) !== false && get_option( $value['id']) !== null ) echo get_option( $value['id'] ); else echo $value['std'] ?>\" /><br /><small><?php echo $value['desc'] ?></small></td>\n\t\t </tr><?php\n\t\t break;\n\t\t case 'select':\n\t\t \t?><tr>\n\t\t <td class=\"titledesc\"><?php if ($value['tip']) { ?><a href=\"#\" tip=\"<?php echo $value['tip'] ?>\" class=\"tips\" tabindex=\"99\"></a><?php } ?><?php echo $value['name'] ?>:</td>\n\t\t <td class=\"forminp\"><select name=\"<?php echo $value['id'] ?>\" id=\"<?php echo $value['id'] ?>\" style=\"<?php echo $value['css'] ?>\">\n\t\t <?php\n\t\t foreach ($value['options'] as $key => $val) {\n\t\t ?>\n\t\t <option value=\"<?php echo $key ?>\" <?php if (get_option($value['id']) == $key) { ?> selected=\"selected\" <?php } ?>><?php echo ucfirst($val) ?></option>\n\t\t <?php\n\t\t }\n\t\t ?>\n\t\t </select><br /><small><?php echo $value['desc'] ?></small>\n\t\t </td>\n\t\t </tr><?php\n\t\t break;\n\t\t case 'textarea':\n\t\t \t?><tr>\n\t\t <td class=\"titledesc\"><?php if ($value['tip']) { ?><a href=\"#\" tip=\"<?php echo $value['tip'] ?>\" class=\"tips\" tabindex=\"99\"></a><?php } ?><?php echo $value['name'] ?>:</td>\n\t\t <td class=\"forminp\">\n\t\t <textarea <?php if ( isset($value['args']) ) echo $value['args'] . ' '; ?>name=\"<?php echo $value['id'] ?>\" id=\"<?php echo $value['id'] ?>\" style=\"<?php echo $value['css'] ?>\"><?php if (get_option($value['id'])) echo stripslashes(get_option($value['id'])); else echo $value['std']; ?></textarea>\n\t\t <br /><small><?php echo $value['desc'] ?></small>\n\t\t </td>\n\t\t </tr><?php\n\t\t break;\n\t\t case 'tabend':\n\t\t\t\t\t\techo '</table></div>';\n\t\t $counter = $counter + 1;\n\t\t break;\n\t\t case 'single_select_page' :\n\t\t \t$page_setting = (int) get_option($value['id']);\n\n\t\t \t$args = array( 'name'\t=> $value['id'],\n\t\t \t\t\t\t 'id'\t\t=> $value['id']. '\" style=\"width: 200px;',\n\t\t \t\t\t\t 'sort_column' \t=> 'menu_order',\n\t\t \t\t\t\t 'sort_order'\t\t=> 'ASC',\n\t\t \t\t\t\t 'selected'\t\t=> $page_setting);\n\n\t\t \tif( isset($value['args']) ) $args = wp_parse_args($value['args'], $args);\n\n\t\t \t?><tr class=\"single_select_page\">\n\t\t <td class=\"titledesc\"><?php if ($value['tip']) { ?><a href=\"#\" tip=\"<?php echo $value['tip'] ?>\" class=\"tips\" tabindex=\"99\"></a><?php } ?><?php echo $value['name'] ?>:</td>\n\t\t <td class=\"forminp\">\n\t\t\t\t\t \t<?php wp_dropdown_pages($args); ?>\n\t\t\t\t\t \t<br /><small><?php echo $value['desc'] ?></small>\n\t\t\t\t\t </td>\n\t\t \t</tr><?php\n\t\t break;\n\t\t case 'single_select_country' :\n\t\t \t$countries = jigoshop_countries::$countries;\n\t\t \t$country_setting = (string) get_option($value['id']);\n\t\t \tif (strstr($country_setting, ':')) :\n\t\t \t\t$country = current(explode(':', $country_setting));\n\t\t \t\t$state = end(explode(':', $country_setting));\n\t\t \telse :\n\t\t \t\t$country = $country_setting;\n\t\t \t\t$state = '*';\n\t\t \tendif;\n\t\t \t?><tr class=\"multi_select_countries\">\n\t\t <td class=\"titledesc\"><?php if ($value['tip']) { ?><a href=\"#\" tip=\"<?php echo $value['tip'] ?>\" class=\"tips\" tabindex=\"99\"></a><?php } ?><?php echo $value['name'] ?>:</td>\n\t\t <td class=\"forminp\"><select name=\"<?php echo $value['id'] ?>\" title=\"Country\" style=\"width: 150px;\">\n\t\t\t\t\t \t<?php echo jigoshop_countries::country_dropdown_options($country, $state); ?>\n\t\t\t\t\t </select>\n\t\t \t\t</td>\n\t\t \t</tr><?php\n\t\t break;\n\t\t case 'multi_select_countries' :\n\t\t \t$countries = jigoshop_countries::$countries;\n\t\t \tasort($countries);\n\t\t \t$selections = (array) get_option($value['id']);\n\t\t \t?><tr class=\"multi_select_countries\">\n\t\t <td class=\"titledesc\"><?php if ($value['tip']) { ?><a href=\"#\" tip=\"<?php echo $value['tip'] ?>\" class=\"tips\" tabindex=\"99\"></a><?php } ?><?php echo $value['name'] ?>:</td>\n\t\t <td class=\"forminp\">\n\t\t \t<div class=\"multi_select_countries\"><ul><?php\n\t\t\t \t\t\tif ($countries) foreach ($countries as $key=>$val) :\n\n\t\t\t \t\t\t\techo '<li><label><input type=\"checkbox\" name=\"'. $value['id'] .'[]\" value=\"'. $key .'\" ';\n\t\t\t \t\t\t\tif (in_array($key, $selections)) echo 'checked=\"checked\"';\n\t\t\t \t\t\t\techo ' />'. $val .'</label></li>';\n\n\t\t \t\tendforeach;\n\t\t \t\t\t?></ul></div>\n\t\t \t\t</td>\n\t\t \t</tr><?php\n\t\t break;\n\t\t case 'coupons' :\n\t\t \t$coupons = new jigoshop_coupons();\n\t\t \t$coupon_codes = $coupons->get_coupons();\n\t\t \t?><tr>\n\t\t <td class=\"titledesc\"><?php echo $value['name'] ?>:</td>\n\t\t <td class=\"forminp\" id=\"coupon_codes\">\n\t\t \t<table class=\"coupon_rows\" cellspacing=\"0\">\n\t\t\t \t<thead>\n\t\t\t \t\t<tr>\n\t\t\t \t\t\t<th><?php _e('', 'jigoshop'); ?></th>\n\t\t\t \t\t\t<th><?php _e('Code', 'jigoshop'); ?></th>\n\t\t\t \t\t\t<th><?php _e('Type', 'jigoshop'); ?></th>\n\t\t\t \t\t\t<th><?php _e('Amount', 'jigoshop'); ?></th>\n\t\t\t \t\t\t<th><?php _e(\"ID's\", 'jigoshop'); ?></th>\n\t\t\t \t\t\t<th><?php _e('From', 'jigoshop'); ?></th>\n\t\t\t \t\t\t<th><?php _e('To', 'jigoshop'); ?></th>\n\t\t\t \t\t\t<th><?php _e('Alone', 'jigoshop'); ?></th>\n\t\t\t \t\t</tr>\n\t\t\t \t</thead>\n\t\t\t \t<tbody>\n\t\t\t \t<?php\n\t\t\t \t$i = -1;\n\t\t\t \tif ($coupon_codes && is_array($coupon_codes) && sizeof($coupon_codes)>0) foreach( $coupon_codes as $coupon ) : $i++;\n\t\t\t \t\techo '<tr class=\"coupon_row\">';\n\t\t\t \t\techo '<td><a href=\"#\" class=\"remove button\" title=\"'.__('Delete this Coupon','jigoshop').'\">&times;</a></td>';\n\t\t\t \t\techo '<td><input type=\"text\" value=\"'.$coupon['code'].'\" name=\"coupon_code['.$i.']\" title=\"'.__('Coupon Code', 'jigoshop').'\" placeholder=\"'.__('Coupon Code', 'jigoshop').'\" class=\"text\" /></td><td><select name=\"coupon_type['.$i.']\" title=\"Coupon Type\">';\n\n\t\t\t \t\t$discount_types = array(\n\t\t\t \t\t\t'fixed_cart' \t=> __('Cart Discount', 'jigoshop'),\n\t\t\t \t\t\t'percent' \t\t=> __('Cart % Discount', 'jigoshop'),\n\t\t\t \t\t\t'fixed_product'\t=> __('Product Discount', 'jigoshop'),\n\t\t\t \t\t\t'percent_product'\t=> __('Product % Discount', 'jigoshop')\n\t\t\t \t\t);\n\n\t\t\t \t\tforeach ($discount_types as $type => $label) :\n\t\t\t \t\t\t$selected = ($coupon['type']==$type) ? 'selected=\"selected\"' : '';\n\t\t\t \t\t\techo '<option value=\"'.$type.'\" '.$selected.'>'.$label.'</option>';\n\t\t\t \t\tendforeach;\n\t\t\t \t\techo '</select></td>';\n\t\t\t \t\techo '<td><input type=\"text\" value=\"'.$coupon['amount'].'\" name=\"coupon_amount['.$i.']\" title=\"'.__('Coupon Amount', 'jigoshop').'\" placeholder=\"'.__('Amount', 'jigoshop').'\" class=\"text\" /></td>\n\t\t\t \t\t\t<td><input type=\"text\" value=\"'.implode(', ', $coupon['products']).'\" name=\"product_ids['.$i.']\" placeholder=\"'.__('1, 2, 3,', 'jigoshop').'\" class=\"text\" /></td>';\n\t\t\t \t\t\n\t\t\t \t\t$date_from = $coupon['date_from'];\n\t\t\t\t\t\t\t\t\t\techo '<td><label for=\"coupon_date_from['.$i.']\"></label><input type=\"text\" class=\"text date-pick\" name=\"coupon_date_from['.$i.']\" id=\"coupon_date_from['.$i.']\" value=\"';\n\t\t\t\t\t\t\t\t\t\tif ($date_from) echo date('Y-m-d', $date_from);\n\t\t\t\t\t\t\t\t\t\techo '\" placeholder=\"'. __('yyyy-mm-dd', 'jigoshop').'\" /></td>';\n\n\t\t\t \t\t$date_to = $coupon['date_to'];\n\t\t\t\t\t\t\t\t\t\techo '<td><label for=\"coupon_date_to['.$i.']\"></label><input type=\"text\" class=\"text date-pick\" name=\"coupon_date_to['.$i.']\" id=\"coupon_date_to['.$i.']\" value=\"';\n\t\t\t\t\t\t\t\t\t\tif ($date_to) echo date('Y-m-d', $date_to);\n\t\t\t\t\t\t\t\t\t\techo '\" placeholder=\"'. __('yyyy-mm-dd', 'jigoshop').'\" /></td>';\n\n\t\t\t \t\techo '<td><input type=\"checkbox\" name=\"individual['.$i.']\" ';\n\t\t\t\t\t if (isset($coupon['individual_use']) && $coupon['individual_use']=='yes')\n\t\t\t\t\t \techo 'checked=\"checked\"';\n\t\t\t\t\t echo ' /></td>';\n\t\t\t\t\t echo '</tr>';\n\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t\t\t\t\t/* <![CDATA[ */\n\t\t\t\t\t\t\t\t\t\t\tjQuery(function() {\n\t\t\t\t\t\t\t\t\t\t\t\t// DATE PICKER FIELDS\n\t\t\t\t\t\t\t\t\t\t\t\tDate.firstDayOfWeek = 1;\n\t\t\t\t\t\t\t\t\t\t\t\tDate.format = 'yyyy-mm-dd';\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('.date-pick').datePicker();\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_from[<?php echo $i; ?>]').bind(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'dpClosed',\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(e, selectedDates)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar d = selectedDates[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (d) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td = new Date(d);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_to[<?php echo $i; ?>]').dpSetStartDate(d.addDays(1).asString());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_to[<?php echo $i; ?>]').bind(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'dpClosed',\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(e, selectedDates)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar d = selectedDates[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (d) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td = new Date(d);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_from[<?php echo $i; ?>]').dpSetEndDate(d.addDays(-1).asString());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t \tendforeach;\n\t\t\t \t?>\n\t\t\t \t</tbody>\n\t\t </table>\n\t\t <p><a href=\"#\" class=\"add button\"><?php _e('+ Add Coupon', 'jigoshop'); ?></a></p>\n\t\t </td>\n\t\t </tr>\n\t\t <script type=\"text/javascript\">\n\t\t\t\t\t\t/* <![CDATA[ */\n\t\t\t\t\t\t\tjQuery(function() {\n\t\t\t\t\t\t\t\tjQuery('#coupon_codes a.add').live('click', function(){\n\t\t\t\t\t\t\t\t\tvar size = jQuery('#coupon_codes table.coupon_rows tbody .coupon_row').size();\n\t\t\t\t\t\t\t\t\t// Make sure tbody exists\n\t\t\t\t\t\t\t\t\tvar tbody_size = jQuery('#coupon_codes table.coupon_rows tbody').size();\n\t\t\t\t\t\t\t\t\tif (tbody_size==0) jQuery('#coupon_codes table.coupon_rows').append('<tbody></tbody>');\n\n\t\t\t\t\t\t\t\t\t// Add the row\n\t\t\t\t\t\t\t\t\tjQuery('<tr class=\"coupon_row\">\\\n\t\t\t\t\t\t\t\t\t\t<td><a href=\"#\" class=\"remove button\" title=\"<?php __('Delete this Coupon','jigoshop'); ?>\">&times;</a></td>\\\n\t\t\t\t\t\t\t\t\t\t<td><input type=\"text\" value=\"\" name=\"coupon_code[' + size + ']\" title=\"<?php _e('Coupon Code', 'jigoshop'); ?>\" placeholder=\"<?php _e('Coupon Code', 'jigoshop'); ?>\" class=\"text\" /></td>\\\n\t\t\t\t\t\t\t\t\t\t<td><select name=\"coupon_type[' + size + ']\" title=\"Coupon Type\">\\\n\t\t\t \t\t\t<option value=\"fixed_cart\"><?php _e('Cart Discount', 'jigoshop'); ?></option>\\\n\t\t\t \t\t\t<option value=\"percent\"><?php _e('Cart % Discount', 'jigoshop'); ?></option>\\\n\t\t\t \t\t\t<option value=\"fixed_product\"><?php _e('Product Discount', 'jigoshop');?></option>\\\n\t\t\t \t\t\t<option value=\"percent_product\"><?php _e('Product % Discount', 'jigoshop');?></option>\\\n\t\t\t \t\t</select></td>\\\n\t\t\t \t\t<td><input type=\"text\" value=\"\" name=\"coupon_amount[' + size + ']\" title=\"<?php _e('Coupon Amount', 'jigoshop'); ?>\" placeholder=\"<?php _e('Amount', 'jigoshop'); ?>\" class=\"text\" /></td>\\\n\t\t\t \t\t<td><input type=\"text\" value=\"\" name=\"product_ids[' + size + ']\" \\\n\t\t\t \t\t\tplaceholder=\"<?php _e('1, 2, 3,', 'jigoshop'); ?>\" class=\"text\" /></td>\\\n\t\t\t \t\t<td><label for=\"coupon_date_from[' + size + ']\"></label>\\\n\t\t\t \t\t\t<input type=\"text\" class=\"text date-pick\" name=\"coupon_date_from[' + size + ']\" \\\n\t\t\t \t\t\tid=\"coupon_date_from[' + size + ']\" value=\"\" \\\n\t\t\t \t\t\tplaceholder=\"<?php _e('yyyy-mm-dd', 'jigoshop'); ?>\" /></td>\\\n\t\t\t \t\t<td><label for=\"coupon_date_to[' + size + ']\"></label>\\\n\t\t\t \t\t\t<input type=\"text\" class=\"text date-pick\" name=\"coupon_date_to[' + size + ']\" \\\n\t\t\t \t\t\tid=\"coupon_date_to[' + size + ']\" value=\"\" \\\n\t\t\t \t\t\tplaceholder=\"<?php _e('yyyy-mm-dd', 'jigoshop'); ?>\" /></td>\\\n\t\t\t \t\t<td><input type=\"checkbox\" name=\"individual[' + size + ']\" /></td>').appendTo('#coupon_codes table.coupon_rows tbody');\n\n\t\t\t\t\t\t\t\t\tjQuery(function() {\n\t\t\t\t\t\t\t\t\t\t// DATE PICKER FIELDS\n\t\t\t\t\t\t\t\t\t\tDate.firstDayOfWeek = 1;\n\t\t\t\t\t\t\t\t\t\tDate.format = 'yyyy-mm-dd';\n\t\t\t\t\t\t\t\t\t\tjQuery('.date-pick').datePicker();\n\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_from[' + size + ']').bind(\n\t\t\t\t\t\t\t\t\t\t\t'dpClosed',\n\t\t\t\t\t\t\t\t\t\t\tfunction(e, selectedDates)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar d = selectedDates[0];\n\t\t\t\t\t\t\t\t\t\t\t\tif (d) {\n\t\t\t\t\t\t\t\t\t\t\t\t\td = new Date(d);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_to[' + size + ']').dpSetStartDate(d.addDays(1).asString());\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_to[' + size + ']').bind(\n\t\t\t\t\t\t\t\t\t\t\t'dpClosed',\n\t\t\t\t\t\t\t\t\t\t\tfunction(e, selectedDates)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar d = selectedDates[0];\n\t\t\t\t\t\t\t\t\t\t\t\tif (d) {\n\t\t\t\t\t\t\t\t\t\t\t\t\td = new Date(d);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#coupon_date_from[' + size + ']').dpSetEndDate(d.addDays(-1).asString());\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tjQuery('#coupon_codes a.remove').live('click', function(){\n\t\t\t\t\t\t\t\t\tvar answer = confirm(\"<?php _e('Delete this coupon?', 'jigoshop'); ?>\")\n\t\t\t\t\t\t\t\t\tif (answer) {\n\t\t\t\t\t\t\t\t\t\tjQuery('input', jQuery(this).parent().parent()).val('');\n\t\t\t\t\t\t\t\t\t\tjQuery(this).parent().parent().hide();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t</script>\n\t\t <?php\n\t\t break;\n\t\t case 'tax_rates' :\n\t\t \t$_tax = new jigoshop_tax();\n\t\t \t$tax_classes = $_tax->get_tax_classes();\n\t\t \t$tax_rates = get_option('jigoshop_tax_rates');\n\t\t \t?><tr>\n\t\t <td class=\"titledesc\"><?php if ($value['tip']) { ?><a href=\"#\" tip=\"<?php echo $value['tip'] ?>\" class=\"tips\" tabindex=\"99\"></a><?php } ?><?php echo $value['name'] ?>:</td>\n\t\t <td class=\"forminp\" id=\"tax_rates\">\n\t\t \t<div class=\"taxrows\">\n\t\t\t \t<?php\n\t\t\t \t$i = -1;\n\t\t\t \tif ($tax_rates && is_array($tax_rates) && sizeof($tax_rates)>0) foreach( $tax_rates as $rate ) : $i++;\n\t\t\t \t\techo '<p class=\"taxrow\"><select name=\"tax_class['.$i.']\" title=\"Tax Class\"><option value=\"\">'.__('Standard Rate', 'jigoshop').'</option>';\n\n\t\t\t \t\tif ($tax_classes) foreach ($tax_classes as $class) :\n\t\t\t\t\t echo '<option value=\"'.sanitize_title($class).'\"';\n\n\t\t\t\t\t if ($rate['class']==sanitize_title($class)) echo 'selected=\"selected\"';\n\n\t\t\t\t\t echo '>'.$class.'</option>';\n\t\t\t\t\t endforeach;\n\n\t\t\t\t\t echo '</select><select name=\"tax_country['.$i.']\" title=\"Country\">';\n\n\t\t\t\t\t jigoshop_countries::country_dropdown_options($rate['country'], $rate['state']);\n\n\t\t\t\t\t echo '</select><input type=\"text\" class=\"text\" value=\"'.$rate['rate'].'\" name=\"tax_rate['.$i.']\" title=\"'.__('Rate', 'jigoshop').'\" placeholder=\"'.__('Rate', 'jigoshop').'\" maxlength=\"8\" />% <label><input type=\"checkbox\" name=\"tax_shipping['.$i.']\" ';\n\n\t\t\t\t\t if (isset($rate['shipping']) && $rate['shipping']=='yes') echo 'checked=\"checked\"';\n\n\t\t\t\t\t echo ' /> '.__('Apply to shipping', 'jigoshop').'</label><a href=\"#\" class=\"remove button\">&times;</a></p>';\n\t\t\t \tendforeach;\n\t\t\t \t?>\n\t\t </div>\n\t\t <p><a href=\"#\" class=\"add button\"><?php _e('+ Add Tax Rule', 'jigoshop'); ?></a></p>\n\t\t </td>\n\t\t </tr>\n\t\t <script type=\"text/javascript\">\n\t\t\t\t\t\t/* <![CDATA[ */\n\t\t\t\t\t\t\tjQuery(function() {\n\t\t\t\t\t\t\t\tjQuery('#tax_rates a.add').live('click', function(){\n\t\t\t\t\t\t\t\t\tvar size = jQuery('.taxrows .taxrow').size();\n\n\t\t\t\t\t\t\t\t\t// Add the row\n\t\t\t\t\t\t\t\t\tjQuery('<p class=\"taxrow\"> \\\n\t\t\t\t <select name=\"tax_class[' + size + ']\" title=\"Tax Class\"> \\\n\t\t\t\t \t<option value=\"\"><?php _e('Standard Rate', 'jigoshop'); ?></option><?php\n\t\t\t\t \t\t$tax_classes = $_tax->get_tax_classes();\n\t\t\t\t \t\tif ($tax_classes) foreach ($tax_classes as $class) :\n\t\t\t\t \t\t\techo '<option value=\"'.sanitize_title($class).'\">'.$class.'</option>';\n\t\t\t\t \t\tendforeach;\n\t\t\t\t \t?></select><select name=\"tax_country[' + size + ']\" title=\"Country\"><?php\n\t\t\t\t \t\tjigoshop_countries::country_dropdown_options('','',true);\n\t\t\t\t \t?></select><input type=\"text\" class=\"text\" name=\"tax_rate[' + size + ']\" title=\"<?php _e('Rate', 'jigoshop'); ?>\" placeholder=\"<?php _e('Rate', 'jigoshop'); ?>\" maxlength=\"8\" />%\\\n\t\t\t\t \t<label><input type=\"checkbox\" name=\"tax_shipping[' + size + ']\" /> <?php _e('Apply to shipping', 'jigoshop'); ?></label>\\\n\t\t\t\t \t<a href=\"#\" class=\"remove button\">&times;</a>\\\n\t\t\t </p>').appendTo('#tax_rates div.taxrows');\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tjQuery('#tax_rates a.remove').live('click', function(){\n\t\t\t\t\t\t\t\t\tvar answer = confirm(\"<?php _e('Delete this rule?', 'jigoshop'); ?>\");\n\t\t\t\t\t\t\t\t\tif (answer) {\n\t\t\t\t\t\t\t\t\t\tjQuery('input', jQuery(this).parent()).val('');\n\t\t\t\t\t\t\t\t\t\tjQuery(this).parent().hide();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t</script>\n\t\t <?php\n\t\t break;\n\t\t case \"shipping_options\" :\n\n\t\t \tforeach (jigoshop_shipping::get_all_methods() as $method) :\n\n\t\t \t\t$method->admin_options();\n\n\t\t \tendforeach;\n\n\t\t break;\n\t\t case \"gateway_options\" :\n\n\t\t \tforeach (jigoshop_payment_gateways::payment_gateways() as $gateway) :\n\n\t\t \t\t$gateway->admin_options();\n\n\t\t \tendforeach;\n\n\t\t break;\n\t\t endswitch;\n\t\t endforeach;\n\t\t?>\n\t\t<p class=\"submit\"><input name=\"save\" type=\"submit\" value=\"<?php _e('Save changes','jigoshop') ?>\" /></p>\n\t</div>\n\t<script type=\"text/javascript\">\n\tjQuery(function($) {\n\t // Tabs\n\t\tjQuery('ul.tabs').show();\n\t\tjQuery('ul.tabs li:first').addClass('active');\n\t\tjQuery('div.panel:not(div.panel:first)').hide();\n\t\tjQuery('ul.tabs a').click(function(){\n\t\t\tjQuery('ul.tabs li').removeClass('active');\n\t\t\tjQuery(this).parent().addClass('active');\n\t\t\tjQuery('div.panel').hide();\n\t\t\tjQuery( jQuery(this).attr('href') ).show();\n\n\t\t\tjQuery.cookie('jigoshop_settings_tab_index', jQuery(this).parent().index('ul.tabs li'))\n\n\t\t\treturn false;\n\t\t});\n\n\t\t<?php if (isset($_COOKIE['jigoshop_settings_tab_index']) && $_COOKIE['jigoshop_settings_tab_index'] > 0) : ?>\n\n\t\t\tjQuery('ul.tabs li:eq(<?php echo $_COOKIE['jigoshop_settings_tab_index']; ?>) a').click();\n\n\t\t<?php endif; ?>\n\n\t\t// Countries\n\t\tjQuery('select#jigoshop_allowed_countries').change(function(){\n\t\t\tif (jQuery(this).val()==\"specific\") {\n\t\t\t\tjQuery(this).parent().parent().next('tr.multi_select_countries').show();\n\t\t\t} else {\n\t\t\t\tjQuery(this).parent().parent().next('tr.multi_select_countries').hide();\n\t\t\t}\n\t\t}).change();\n\n\t\t// permalink double save hack\n\t\t$.get('<?php echo admin_url('options-permalink.php') ?>');\n\n\t});\n\t</script>\n\t<?php\n\tflush_rewrite_rules();\n}", "function xprofile_ajax_reorder_fields() {\n\n\t// Check the nonce.\n\tcheck_admin_referer( 'bp_reorder_fields', '_wpnonce_reorder_fields' );\n\n\tif ( empty( $_POST['field_order'] ) ) {\n\t\treturn false;\n\t}\n\n\tparse_str( $_POST['field_order'], $order );\n\n\t$field_group_id = $_POST['field_group_id'];\n\n\tforeach ( (array) $order['draggable_field'] as $position => $field_id ) {\n\t\txprofile_update_field_position( (int) $field_id, (int) $position, (int) $field_group_id );\n\t}\n}", "function fill_in_additional_list_fields()\n\t{\n\t//\t$this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);\n\t\t$this->remove_redundant_http();\n\t}", "public function build_user_panel() {\n\t\t// Gravatar\n\t\tif ( $this->get_option( 'show_gravatar' ) ) {\n\t\t\t$this->add_field( 'user_avatar', 'general', array(\n\t\t\t\t'type' => 'custom',\n\t\t\t\t'html' => '<div class=\"tml-user-avatar\">' . get_avatar( wp_get_current_user()->ID, $this->get_option( 'gravatar_size' ) ) . '</div>'\n\t\t\t) );\n\t\t}\n\n\t\t// User links\n\t\t$this->add_field( 'user_links', 'general', array(\n\t\t\t'type' => 'custom',\n\t\t\t'html' => self::get_user_link_html()\n\t\t) );\n\n\t\t// Submit group\n\t\t$this->add_group( 'submit', array(\n\t\t\t'before_group' => '<p class=\"submit\">',\n\t\t\t'after_group' => '</p>'\n\t\t) );\n\n\t\t// Submit field\n\t\t$this->add_field( 'wp-submit', 'submit', array(\n\t\t\t'type' => 'submit',\n\t\t\t'id' => 'wp-submit',\n\t\t\t'value' => __( 'Log Out' )\n\t\t) );\n\n\t\t// Instance field\n\t\t$this->add_field( 'instance', 'submit', array(\n\t\t\t'type' => 'hidden',\n\t\t\t'value' => $this->get_option( 'instance' )\n\t\t) );\n\n\t\t// Action field\n\t\t$this->add_field( 'action', 'submit', array(\n\t\t\t'type' => 'hidden',\n\t\t\t'value' => 'logout'\n\t\t) );\n\n\t\t// Nonce field\n\t\t$this->add_field( '_wpnonce', 'submit', array(\n\t\t\t'type' => 'hidden',\n\t\t\t'value' => wp_create_nonce( 'log-out' )\n\t\t) );\n\n\t\t// Remove action links\n\t\t$this->set_option( 'show_reg_link', false );\n\t\t$this->set_option( 'show_pass_link', false );\n\n\t\t// Change title\n\t\t$this->set_option( 'title', sprintf( __( 'Howdy, %1$s' ), wp_get_current_user()->display_name ) );\n\t}", "function sync_bp_fields(){\r\n\t\tglobal $wpdb;\t\r\n\t\t$options = get_option('csds_userRegAide_Options');\r\n\t\t$plugin = 'buddypress/bp-loader.php';\r\n\t\t$class = 'BuddyPress';\r\n\t\t$msg = (string) '';\r\n\t\t$error = (int) 0;\r\n\t\t$order = (int) 1;\r\n\t\tif ( class_exists( $class ) ){\r\n\t\t\tif( is_plugin_active( $plugin ) ){\r\n\t\t\t\tif( !empty( $options ) ){\r\n\t\t\t\t\tif( $options['buddy_press_fields_sync'] == 2 || $options['buddy_press_fields_sync'] == \"2\" ){\r\n\t\t\t\t\t\t$table_name = $wpdb->prefix . \"ura_fields\";\r\n\t\t\t\t\t\tif( $wpdb->get_var( \"SHOW TABLES LIKE '$table_name'\" ) != $table_name ) {\r\n\t\t\t\t\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t\t\t\t\t$field->create_fields_database();\r\n\t\t\t\t\t\t\tunset( $field );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$req_fields = get_option( 'csds_userRegAide_registrationFields' );\r\n\t\t\t\t\t\t$temp_field_key = (string) '';\r\n\t\t\t\t\t\t$all_info = array();\r\n\t\t\t\t\t\t$field_id = (int) 0;\r\n\t\t\t\t\t\t$field_name = (string) '';\r\n\t\t\t\t\t\t$field_title = (string) '';\r\n\t\t\t\t\t\t$option_str = (string) 'option';\r\n\t\t\t\t\t\t$objects = $this->select_bp_fields();\r\n\t\t\t\t\t\t$cnt = (int) 1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$foption = (string) '';\r\n\t\t\t\t\t\t$length = (int) 0;\r\n\t\t\t\t\t\t$max_length = (int) 29;\r\n\t\t\t\t\t\t$error = (int) 0;\r\n\t\t\t\t\t\t$msg = (string) '';\r\n\t\t\t\t\t\t$meta_key = (string) '';\r\n\t\t\t\t\t\tforeach( $objects as $object ){\r\n\t\t\t\t\t\t\tif( $object->id != '1' ){\r\n\t\t\t\t\t\t\t\t//exit( print_r( $object ) );\r\n\t\t\t\t\t\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t\t\t\t\t\t$field_id = $object->id;\r\n\t\t\t\t\t\t\t\t$field_name = $object->name;\r\n\t\t\t\t\t\t\t\t$parent_id = $object->parent_id;\r\n\t\t\t\t\t\t\t\t$group_id = $object->group_id;\r\n\t\t\t\t\t\t\t\t$data_type = $object->type;\r\n\t\t\t\t\t\t\t\t$length = strlen( $field_name );\r\n\t\t\t\t\t\t\t\t$temp_field_key = explode( ' ', $object->name );\r\n\t\t\t\t\t\t\t\t$temp_field_key = implode( '_', $temp_field_key );\r\n\t\t\t\t\t\t\t\t$field_key_temp = strtolower( $temp_field_key );\r\n\t\t\t\t\t\t\t\t$field_key = preg_replace(\"/[^a-zA-Z0-9\\s]/\", \"\", $field_key_temp);\r\n\t\t\t\t\t\t\t\tif( $length > $max_length ){\r\n\t\t\t\t\t\t\t\t\t$field_key = substr( $field_key, 0, $max_length );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$key_exists = $field->meta_key_exists( $field_key );\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif( empty( $key_exists ) ){\r\n\t\t\t\t\t\t\t\t\t$field_key = $field_key;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$exists = $field->meta_key_change( $field_key );\r\n\t\t\t\t\t\t\t\t\tif( empty( $exists ) ){\r\n\t\t\t\t\t\t\t\t\t\t$msg .= $field_key.' Meta Key already exists! ';\r\n\t\t\t\t\t\t\t\t\t\t$error++;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$field_key = $exists;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$name_exists = $field->field_name_exists( $field_name );\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif( empty( $name_exists ) ){\r\n\t\t\t\t\t\t\t\t\t$field_name = $field_name;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$fieldname_exists = $field->field_name_change( $field_name );\r\n\t\t\t\t\t\t\t\t\tif( empty( $fieldname_exists ) ) {\r\n\t\t\t\t\t\t\t\t\t\t$msg .= $field_name.' Field Title already exists! ';\r\n\t\t\t\t\t\t\t\t\t\t$error++;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$field_name = $fieldname_exists;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif( $error == 0 ){\r\n\t\t\t\t\t\t\t\t\t$field->meta_key = $field_key;\r\n\t\t\t\t\t\t\t\t\t$field->field_name = $field_name;\r\n\t\t\t\t\t\t\t\t\t$field->data_type = $data_type;\r\n\t\t\t\t\t\t\t\t\t$field->field_description = $object->description;\r\n\t\t\t\t\t\t\t\t\t$field->field_required = $object->is_required;\r\n\t\t\t\t\t\t\t\t\t$field->is_default_option = $object->is_default_option;\r\n\t\t\t\t\t\t\t\t\t$field->field_order = $order;\r\n\t\t\t\t\t\t\t\t\t$field->approve_view = '0';\r\n\t\t\t\t\t\t\t\t\t$field->bp_id = $field_id;\r\n\t\t\t\t\t\t\t\t\t$field->bp_parent_id = $parent_id;\r\n\t\t\t\t\t\t\t\t\t$field->bp_group_id = $group_id;\r\n\t\t\t\t\t\t\t\t\t$field->insert_fields( $field );\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$order++;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif( $object->is_required == true ){\r\n\t\t\t\t\t\t\t\t\t\t$req_fields[$field_key] = $field_name;\r\n\t\t\t\t\t\t\t\t\t\tupdate_option( 'csds_userRegAide_registrationFields', $req_fields );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$parent_id = $field->get_field_id_by_meta_key( $field_key );\r\n\t\t\t\t\t\t\t\t\t$field_id = $object->id;\r\n\t\t\t\t\t\t\t\t\t$table_name = $wpdb->prefix.'bp_xprofile_fields';\r\n\t\t\t\t\t\t\t\t\t$options_query = \"SELECT * FROM $table_name WHERE parent_id = %d\";\r\n\t\t\t\t\t\t\t\t\t$options_query = $wpdb->prepare( $options_query, $field_id );\r\n\t\t\t\t\t\t\t\t\t$bp_options = $wpdb->get_results( $options_query, OBJECT );\r\n\t\t\t\t\t\t\t\t\t$id = $field->get_field_id( $field_id );\r\n\t\t\t\t\t\t\t\t\tif( !empty( $bp_options ) ){\r\n\t\t\t\t\t\t\t\t\t\tforeach( $bp_options as $option ){\r\n\t\t\t\t\t\t\t\t\t\t\t$option_name = $option->name;\r\n\t\t\t\t\t\t\t\t\t\t\t$option_id = $option->id;\r\n\t\t\t\t\t\t\t\t\t\t\t$length = strlen( $field_name );\r\n\t\t\t\t\t\t\t\t\t\t\t$temp_option_key = explode( ' ', $option->name );\r\n\t\t\t\t\t\t\t\t\t\t\t$temp_option_key = implode( '_', $temp_option_key );\r\n\t\t\t\t\t\t\t\t\t\t\t$option_key_temp = strtolower( $temp_option_key );\r\n\t\t\t\t\t\t\t\t\t\t\t$option_key = preg_replace( \"/[^a-zA-Z0-9\\s]/\", \"\", $option_key_temp );\r\n\t\t\t\t\t\t\t\t\t\t\tif( $length > 30 ){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$option_key = substr( $option_key, 0, 30 );\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$option_key_exists = $field->meta_key_exists( $option_key );\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif( empty( $option_key_exists ) ){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$option_key = $option_key;\r\n\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$exists = $field->meta_key_change( $option_key );\r\n\t\t\t\t\t\t\t\t\t\t\t\tif( empty( $exists ) ){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$msg .= $option_key.' Meta Key already exists! ';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$error++;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$option_key = $exists;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$option_name_exists = $field->field_name_exists( $option_name );\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif( empty( $option_name_exists ) ){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$option_name = $option_name;\r\n\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fieldname_exists = $field->field_name_change( $option_name );\r\n\t\t\t\t\t\t\t\t\t\t\t\tif( empty( $fieldname_exists ) ) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$msg .= $option_name.' Field Title already exists! ';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$error++;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$option_name = $fieldname_exists;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$field->meta_key = $option_key;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->parent_id = $parent_id;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->field_name = $option_name;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->data_type = 'option';\r\n\t\t\t\t\t\t\t\t\t\t\t$field->field_description = $option->description;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->field_required = $option->is_required;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->is_default_option = $option->is_default_option;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->field_order = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->option_order = $cnt;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->bp_id = $option->id;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->bp_parent_id = $option->parent_id;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->bp_group_id = $option->group_id;\r\n\t\t\t\t\t\t\t\t\t\t\t$field->insert_fields( $field );\r\n\t\t\t\t\t\t\t\t\t\t\t$cnt++;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//do_action( 'update_new_field_order', $field_key );\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// getting list of user ids\r\n\t\t\t\t\t\t\t\t\t$table_name = $wpdb->prefix.'users';\r\n\t\t\t\t\t\t\t\t\t$users_id_query = \"SELECT ID FROM $table_name\";\r\n\t\t\t\t\t\t\t\t\t$user_ids = $wpdb->get_col( $users_id_query );\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// updating wordpress profile user meta from buddypress xprofile data\r\n\t\t\t\t\t\t\t\t\t$table_name = $wpdb->prefix.'bp_xprofile_data';\r\n\t\t\t\t\t\t\t\t\tforeach( $user_ids as $id ){\r\n\t\t\t\t\t\t\t\t\t\t$update_query = \"SELECT value FROM $table_name WHERE field_id = %d AND user_id = %d\";\r\n\t\t\t\t\t\t\t\t\t\t$update_query = $wpdb->prepare( $update_query, $field_id, $id );\r\n\t\t\t\t\t\t\t\t\t\t$update_results = $wpdb->get_var( $update_query );\r\n\t\t\t\t\t\t\t\t\t\tif( !empty( $update_results ) ){\r\n\t\t\t\t\t\t\t\t\t\t\tif( $data_type != 'datebox' ){\r\n\t\t\t\t\t\t\t\t\t\t\t\tupdate_user_meta( $id, $field_key, $update_results );\r\n\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$temp = explode( \" \", $update_results );\r\n\t\t\t\t\t\t\t\t\t\t\t\t$update = $temp[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\tupdate_user_meta( $id, $field_key, $update );\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$error = 0;\r\n\t\t\t\t\t\t\t$cnt = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$options['buddy_press_fields_sync'] = 1;\r\n\t\t\t\t\t\tupdate_option( 'csds_userRegAide_Options', $options );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t}", "function ihc_save_user_field($post_data){\r\n\tif (isset($post_data['name']) && $post_data['name']\r\n\t\t\t&& isset($post_data['label']) && isset($post_data['type']) ){\r\n\t\t$new = array(\r\n\t\t\t\t//'display' => 0,// deprecated\r\n\t\t\t\t'display_admin' => 0,\r\n\t\t\t\t'display_public_reg' => 0,\r\n\t\t\t\t'display_public_ap' => 0,\r\n\t\t\t\t'name' => ihc_make_string_simple($post_data['name']),\r\n\t\t\t\t'label' => $post_data['label'],\r\n\t\t\t\t'type' => $post_data['type'],\r\n\t\t\t\t'native_wp' => 0,\r\n\t\t\t\t'sublabel' => @$post_data['sublabel'],\r\n\t\t\t\t'target_levels' => @$post_data['target_levels'],\r\n\t\t\t\t'class' => @$post_data['class'],\r\n\t\t);\r\n\t\t$new['req'] = (isset($post_data['req'])) ? $post_data['req'] : 0; \r\n\t\t$new['display_admin'] = (isset($post_data['display_admin'])) ? $post_data['display_admin'] : 0; \r\n\t\t$new['display_public_reg'] = (isset($post_data['display_public_reg'])) ? $post_data['display_public_reg'] : 0; \r\n\t\t$new['display_public_ap'] = (isset($post_data['display_public_ap'])) ? $post_data['display_public_ap'] : 0;\r\n\t\t \r\n\t\t$optional_metas = array(\r\n\t\t\t\t\t\t\t\t\t'values',\r\n\t\t\t\t\t\t\t\t\t'theme',\r\n\t\t\t\t\t\t\t\t\t'plain_text_value',\r\n\t\t\t\t\t\t\t\t\t'conditional_text',\r\n\t\t\t\t\t\t\t\t\t'error_message',\r\n\t\t\t\t\t\t\t\t\t'conditional_logic_show',\r\n\t\t\t\t\t\t\t\t\t'conditional_logic_corresp_field',\r\n\t\t\t\t\t\t\t\t\t'conditional_logic_corresp_field_value',\r\n\t\t\t\t\t\t\t\t\t'conditional_logic_cond_type',\r\n\t\t);\r\n\t\t\r\n\t\t$data = get_option('ihc_user_fields');\r\n\t\tif (ihc_array_value_exists($data, $post_data['name'], 'name')!==FALSE){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($optional_metas as $optional_meta){\r\n\t\t\tif (isset($post_data[$optional_meta])){\r\n\t\t\t\t$new[$optional_meta] = $post_data[$optional_meta];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($data!==FALSE){\r\n\t\t\t$data[]= $new;\t\t\t\r\n\t\t} else {\r\n\t\t\t$data = ihc_native_user_field();\r\n\t\t\t$data[] = $new;\r\n\t\t}\r\n\t\tupdate_option('ihc_user_fields', $data);\r\n\t}\r\n}", "function add_custom_userprofile_fields( $user ) { ?>\n<table class=\"form-table\">\n<tr>\n<th>\n\t<label for=\"rdp_role\"><?php _e('Station Role', 'your_textdomain'); ?>\n</label></th>\n<td>\n\t<input type=\"text\" name=\"rdp_role\" id=\"rdp_role\" value=\"<?php echo esc_attr( get_the_author_meta( 'rdp_role', $user->ID ) ); ?>\" class=\"regular-text\" /><br />\n\t<span class=\"description\"><?php _e('Please enter your Radio DePaul Position.', 'your_textdomain'); ?></span>\n</td>\n</tr>\n<tr>\n</table>\n<?php }", "function racketeers_manage_players_form( ) {\n\t?>\n\t<fieldset>\n\t\t<legend>Manage Players</legend>\n\t\t<form method=\"post\">\t\n\t\t\t<?php \n\t\t\t\t$all_players = racketeers_get_all_players();\n\t\t\t\t$subscribed_players = racketeers_get_subscribed_players();\n\t\t\t\tracketeers_create_player_menu( $all_players, \"all_players[]\");\n\t\t\t\techo \"</br>\";\n\t\t\t\tracketeers_create_player_menu( $subscribed_players, \"subscribed_players[]\");\n\t\t\t?>\n\t\t\t<input type=\"submit\" name=\"racketeers_action\" value=\"Add Players\" />\n\t\t\t<input type=\"submit\" name=\"racketeers_action\" value=\"Remove Players\" />\n\t\t\t<input type=\"submit\" name=\"racketeers_action\" value=\"Remove ALL Players\" />\n\t\t\t<input type=\"submit\" name=\"racketeers_action\" value=\"Manage Group Complete\" />\n\t\t</form>\n\t\t</form>\n\t</fieldset>\n\t<?php\n}", "function add_managers_field_to_add_division_screen() {\n\n // get all managers\n $args = array( 'role' => 'division_manager' );\n $users = get_users( $args );\n // create html output\n $html = '<div class=\"form-field term-assign-managers\"><h4 for=\"\">Assign Managers</h4>';\n $html .= '<div class=\"user-list\"><input class=\"js-user-search\" type=\"text\" placeholder=\"Search Division Managers\"><br>';\n $select_html = '<select class=\"js-user-selection\" name=\"assigned-managers[]\" multiple hidden>';\n $table_html = '<table class=\"user-list__table js-user-list\"><tr><th id=\"user-name\" class=\"user-list__header js-user-list-header\">User Name</th><th id=\"user-id\" class=\"user-list__header js-user-list-header\">User ID</th></tr>';\n\n // loop through users and depending on whether they are assigned or not add them respective attributes\n foreach ( $users as $user ) {\n\n $select_html .= '<option value=\"' . $user->ID . '\" data-elem=\"' . $user->ID . '\">' . $user->display_name . '</option>';\n $table_html .= '<tr class=\"user-list__item js-selectable-element\" data-elem=\"' . $user->ID . '\"><td>' . $user->display_name . '</td><td>' . $user->ID . '</td></tr>';\n\n }\n\n $select_html .= '</select>';\n $table_html .= '</table>';\n $select_html .= $table_html;\n $html .= $select_html;\n $html .= '</div></div>';\n\n\n\n echo $html;\n }", "public function display_signup_fields() {\n\t\t\t?>\n\t\t\t<div class=\"mp-form-row mepr_phone_number\">\n\t\t\t\t<div class=\"mp-form-label\">\n\t\t\t\t\t<label for=\"phone_number\"><?php _e('Mobile Phone Number:* '); ?><small>(1 555 555 5555)</small></label>\n\t\t\t\t\t<span class=\"cc-error\"><?php _ex('Invalid Phone Number', 'ui', 'memberpress'); ?></span>\n\t\t\t\t</div>\n\t\t\t\t<input type=\"text\" name=\"mepr_phone_number\" id=\"phone_number\" class=\"input-phone mepr-form-input\" value=\"\" required />\n\t\t\t</div>\n\t\t\t<?php\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates that file is an image.
function file_is_valid_image($path) { }
[ "function file_validate_is_image(&$file) {\n $errors = array();\n\n $info = image_get_info($file->filepath);\n if (!$info || empty($info['extension'])) {\n $errors[] = t('Only JPEG, PNG and GIF images are allowed.');\n }\n\n return $errors;\n}", "public function validate_image() \n {\n # check image file\n if (!preg_match(\"/\\.(gif|jpg|jpeg|JPG|JPEG|png|PNG|svg|SVG)$/i\", $this->file_name)) \n {\n # throw an error\n exit('Your file was not an IMAGE file!');\n } \n }", "public function testFileValidateIsImage() {\n $this->assertFileExists($this->image->getFileUri());\n $errors = file_validate_is_image($this->image);\n $this->assertCount(0, $errors, 'No error reported for our image file.');\n\n $this->assertFileExists($this->nonImage->getFileUri());\n $errors = file_validate_is_image($this->nonImage);\n $this->assertCount(1, $errors, 'An error reported for our non-image file.');\n }", "private function validateImg()\n\t{\n\t\t$imageinfo = getimagesize( $this->file['tmp_name'] );\n\n\t\tif($imageinfo['mime'] != 'image/gif' && $imageinfo['mime'] != 'image/jpeg' && $imageinfo['mime'] != 'image/png' && isset($imageinfo))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isValidImage() : bool\n {\n return $this->file->isValidImage();\n }", "function is_image(){\r\n\t\tif (stristr($this->file_type, \"image/\") !== false){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function is_image()\n {\n if (substr($this->file->getMimeType(), 0, 5) == 'image') {\n return true;\n } else {\n return false ;\n }\n }", "private function isImage()\n {\n return preg_match('/image/i', $this->type);\n }", "private function validadeFormatImage()\n {\n switch ($this->dadosImg['type']) {\n case 'image/jpeg':\n case 'image/pjpeg':\n $this->image = imagecreatefromjpeg($this->dadosImg['tmp_name']);\n $this->resizeImg();\n $this->validateDirectory();\n imagejpeg($this->imgResized, $this->directory . $this->nameImg);\n break;\n case 'image/png':\n case 'image/x-png':\n $this->image = imagecreatefrompng($this->dadosImg['tmp_name']);\n $this->resizeImg();\n $this->validateDirectory();\n imagepng($this->imgResized, $this->directory . $this->nameImg);\n break;\n }\n }", "private function validadeFormatImage()\n {\n switch ($this->dadosImg['type']) {\n case 'image/jpeg':\n case 'image/pjpeg':\n $this->image = imagecreatefromjpeg($this->dadosImg['tmp_name']);\n break;\n case 'image/png':\n case 'image/x-png':\n $this->image = imagecreatefrompng($this->dadosImg['tmp_name']);\n break;\n }\n if ($this->image) {\n return $this->validateDirectory();\n }\n $_SESSION['msg'] = \"<div class='alert alert-danger'>Erro no formato da\n imagem, selecione imagem com formato JPEG ou PNG</div>\";\n return $this->result = false;\n }", "function validate_image()\n {\n $result = 1;\n \n if ($this->extension == 'jpg' || $this->extension == 'jpeg')\n {\n $this->image_resource = imagecreatefromjpeg($this->temporary_name);\n }\n elseif ($this->extension == 'gif')\n {\n $this->image_resource = imagecreatefromgif($this->temporary_name);\n }\n elseif ($this->extension == 'png')\n {\n $this->image_resource = imagecreatefrompng($this->temporary_name);\n }\n else\n {\n $result = 0;\n }\n \n return $result;\n }", "public function isImage() {\n $image = getimagesize($this->getPath());\n return in_array($image['mime'], self::$imageMimeType);\n }", "protected function checkIfImageMimeIsAllowed()\n {\n if ($this->request->file('img')['error'] != 0) {\n trigger_error($this->uploads->getUploadsErrorMessage($this->request->file('img')['error']));\n }\n\n if (in_array($this->image->getMime($this->request->file('img')['tmp_name']), self::ALLOWED_MIME, true) === false) {\n trigger_error($this->user->lang('CAPSULE_ERROR_MIME'));\n } \n }", "public function checkImageType()\n {\n if (empty($this->checkImageType)) {\n return true;\n }\n\n if (('image' == substr($this->mediaType, 0, strpos($this->mediaType, '/')))\n || (!empty($this->mediaRealType)\n && 'image' == substr($this->mediaRealType, 0, strpos($this->mediaRealType, '/')))\n ) {\n if (!@getimagesize($this->mediaTmpName)) {\n $this->setErrors(\\XoopsLocale::E_INVALID_IMAGE_FILE);\n return false;\n }\n }\n return true;\n }", "public function isImage()\n\t{\n\t\treturn substr($this->mime_type, 0, 5) === 'image';\n\t}", "public function isImage()\r\n {\r\n if ($this->_reaktorfile->getIdentifier() == \"image\")\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "final public function isImage()\n {\n if (substr($this->mime, 0, 6) == 'image/') {\n return true;\n } else {\n return false;\n }\n }", "public function validate_image(){\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function ppom_is_file_image( $file_name ){\n\t\n\t$type = strtolower ( substr ( strrchr ( $file_name , '.' ), 1 ) );\n\tif (($type == \"gif\") || ($type == \"jpeg\") || ($type == \"png\") || ($type == \"pjpeg\") || ($type == \"jpg\"))\n\t\treturn true;\n\telse\n\t\treturn false;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the position of the starting record signature in the file/data. An 'empty' ZIP file consists only of an End of Central Directory record.
public function findMarker() { if ($this->markerPosition !== null) return $this->markerPosition; // Buffer the data to search try { $buff = $this->read(min($this->length, $this->maxReadBytes)); $this->rewind(); } catch (Exception $e) { return false; } // Try to find the first Local File or Central File record if (($pos = strpos($buff, pack('V', self::RECORD_LOCAL_FILE))) !== false || ($pos = strpos($buff, pack('V', self::RECORD_CENTRAL_FILE))) !== false ) { return $this->markerPosition = $pos; } // Otherwise this could be an empty ZIP file return $this->markerPosition = strpos($buff, pack('V', self::RECORD_ENDCENTRAL)); }
[ "public function get_file_position();", "function _getFilePosition()\n\t{\n\t\t// gzipped file... unpack it first\n\t\t$position = 0;\n\t\t$info = @ unpack('CCM/CFLG/VTime/CXFL/COS', substr($this->_data, $position +2));\n\t\tif (!$info) {\n\t\t\t$this->set('error.message', 'Unable to decompress data');\n\t\t\treturn false;\n\t\t}\n\t\t$position += 10;\n\n\t\tif ($info['FLG'] & $this->_flags['FEXTRA']) {\n\t\t\t$XLEN = unpack('vLength', substr($this->_data, $position +0, 2));\n\t\t\t$XLEN = $XLEN['Length'];\n\t\t\t$position += $XLEN +2;\n\t\t}\n\n\t\tif ($info['FLG'] & $this->_flags['FNAME']) {\n\t\t\t$filenamePos = strpos($this->_data, \"\\x0\", $position);\n\t\t\t$filename = substr($this->_data, $position, $filenamePos - $position);\n\t\t\t$position = $filenamePos +1;\n\t\t}\n\n\t\tif ($info['FLG'] & $this->_flags['FCOMMENT']) {\n\t\t\t$commentPos = strpos($this->_data, \"\\x0\", $position);\n\t\t\t$comment = substr($this->_data, $position, $commentPos - $position);\n\t\t\t$position = $commentPos +1;\n\t\t}\n\n\t\tif ($info['FLG'] & $this->_flags['FHCRC']) {\n\t\t\t$hcrc = unpack('vCRC', substr($this->_data, $position +0, 2));\n\t\t\t$hcrc = $hcrc['CRC'];\n\t\t\t$position += 2;\n\t\t}\n\n\t\treturn $position;\n\t}", "public function getStartOffset() {\n\t\treturn $this->_startOffset;\n\t}", "public function getPositionOfFile()\n {\n return $this->positionOfFile;\n }", "public function getFilePos()\n\t{\n\t\treturn $this->file_pos;\n\t}", "public function getFileOffset() {\n return $this->to->file() - $this->from->file();\n }", "public function getStartOffset()\n {\n return $this->start_offset;\n }", "public function currentOffset()\n {\n return $this->fileObject->ftell();\n }", "function read_xref_start_value()\n {\n //------------------------------\n $buffer = $this->get_buffer();\n $chunks = preg_split('/\\bxref\\b/', $buffer, -1, PREG_SPLIT_OFFSET_CAPTURE);\n return intval($chunks[1][1]) - 4; //-4 , relative to end of xref\n }", "protected function findFileHeader()\n\t{\n\t\t// Buffer the data to search\n\t\t$start = $this->offset;\n\t\ttry {\n\t\t\t$buffer = $this->read(min($this->length, $this->maxReadBytes));\n\t\t\t$this->rewind();\n\t\t} catch (Exception $e) {return false;}\n\n\t\t// Get all the offsets to test\n\t\tif (!($positions = self::strposall($buffer, pack('C', self::BLOCK_FILE))))\n\t\t\treturn false;\n\n\t\tforeach ($positions as $offset) try {\n\t\t\t$offset += $start;\n\t\t\t$this->seek($offset - 2);\n\n\t\t\t// Run a File header CRC & sanity check\n\t\t\t$block = $this->getNextBlock();\n\t\t\tif ($this->checkFileHeaderCRC($block)) {\n\t\t\t\t$this->seek($block['offset'] + self::HEADER_SIZE);\n\t\t\t\t$this->processBlock($block);\n\t\t\t\tif ($this->sanityCheckFileHeader($block)) {\n\n\t\t\t\t\t// A valid File header was found\n\t\t\t\t\t$this->format = self::FMT_RAR15;\n\t\t\t\t\treturn $this->markerPosition = $block['offset'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t// No more readable data, or read error\n\t\t} catch (Exception $e) {continue;}\n\n\t\treturn false;\n\t}", "function read_xref_start_value() {\n\t\t//------------------------------\n\t\t\t$buffer=$this->get_buffer();\n\t\t\t$chunks = preg_split('/\\bxref\\b/', $buffer, -1, PREG_SPLIT_OFFSET_CAPTURE);\n\t\t\treturn intval($chunks[1][1])-4; //-4 , relative to end of xref\n\t\t}", "function GetRecordToStart() {\n\t\t\t\t$RecordToStart = 0;\n\t\t\t\tif($this->CurrentPage > $this->GetTotalPages()) {\n\t\t\t\t\t$this->CurrentPage = $this->GetTotalPages();\n\t\t\t\t}\n\t\t\t\t$RecordToStart = ($this->CurrentPage - 1) * $this->RecordsPerPage;\n\t\t\t\tif($RecordToStart < 0) {\n\t\t\t\t\t$RecordToStart = 0;\n\t\t\t\t}\n\t\t\t\treturn $RecordToStart;\n\t\t\t}", "public function findMarker()\n\t{\n\t\tif ($this->markerPosition !== null)\n\t\t\treturn $this->markerPosition;\n\n\t\ttry {\n\t\t\t$buff = $this->read(min($this->length, $this->maxReadBytes));\n\t\t\t$this->rewind();\n\t\t\tif (($pos = strpos($buff, $this->markerBlock)) !== false) {\n\t\t\t\t$this->format = self::FMT_RAR15;\n\t\t\t} elseif (($pos = strpos($buff, $this->markerRar50)) !== false) {\n\t\t\t\t$this->format = self::FMT_RAR50;\n\t\t\t}\n\t\t\treturn $this->markerPosition = $pos;\n\t\t} catch (Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "protected function readFileHeader()\n\t{\n\t\t// If the current part is over, proceed to the next part please\n\t\tif ($this->isEOF(true))\n\t\t{\n\t\t\tdebugMsg('Opening next archive part');\n\t\t\t$this->nextFile();\n\t\t}\n\n\t\t$this->currentPartOffset = ftell($this->fp);\n\n\t\tif ($this->expectDataDescriptor)\n\t\t{\n\t\t\t// The last file had bit 3 of the general purpose bit flag set. This means that we have a\n\t\t\t// 12 byte data descriptor we need to skip. To make things worse, there might also be a 4\n\t\t\t// byte optional data descriptor header (0x08074b50).\n\t\t\t$junk = @fread($this->fp, 4);\n\t\t\t$junk = unpack('Vsig', $junk);\n\t\t\tif ($junk['sig'] == 0x08074b50)\n\t\t\t{\n\t\t\t\t// Yes, there was a signature\n\t\t\t\t$junk = @fread($this->fp, 12);\n\t\t\t\tdebugMsg('Data descriptor (w/ header) skipped at ' . (ftell($this->fp) - 12));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No, there was no signature, just read another 8 bytes\n\t\t\t\t$junk = @fread($this->fp, 8);\n\t\t\t\tdebugMsg('Data descriptor (w/out header) skipped at ' . (ftell($this->fp) - 8));\n\t\t\t}\n\n\t\t\t// And check for EOF, too\n\t\t\tif ($this->isEOF(true))\n\t\t\t{\n\t\t\t\tdebugMsg('EOF before reading header');\n\n\t\t\t\t$this->nextFile();\n\t\t\t}\n\t\t}\n\n\t\t// Get and decode Local File Header\n\t\t$headerBinary = fread($this->fp, 30);\n\t\t$headerData =\n\t\t\tunpack('Vsig/C2ver/vbitflag/vcompmethod/vlastmodtime/vlastmoddate/Vcrc/Vcompsize/Vuncomp/vfnamelen/veflen', $headerBinary);\n\n\t\t// Check signature\n\t\tif (!($headerData['sig'] == 0x04034b50))\n\t\t{\n\t\t\tdebugMsg('Not a file signature at ' . (ftell($this->fp) - 4));\n\n\t\t\t// The signature is not the one used for files. Is this a central directory record (i.e. we're done)?\n\t\t\tif ($headerData['sig'] == 0x02014b50)\n\t\t\t{\n\t\t\t\tdebugMsg('EOCD signature at ' . (ftell($this->fp) - 4));\n\t\t\t\t// End of ZIP file detected. We'll just skip to the end of file...\n\t\t\t\twhile ($this->nextFile())\n\t\t\t\t{\n\t\t\t\t};\n\t\t\t\t@fseek($this->fp, 0, SEEK_END); // Go to EOF\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdebugMsg('Invalid signature ' . dechex($headerData['sig']) . ' at ' . ftell($this->fp));\n\t\t\t\t$this->setError(AKText::_('ERR_CORRUPT_ARCHIVE'));\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// If bit 3 of the bitflag is set, expectDataDescriptor is true\n\t\t$this->expectDataDescriptor = ($headerData['bitflag'] & 4) == 4;\n\n\t\t$this->fileHeader = new stdClass();\n\t\t$this->fileHeader->timestamp = 0;\n\n\t\t// Read the last modified data and time\n\t\t$lastmodtime = $headerData['lastmodtime'];\n\t\t$lastmoddate = $headerData['lastmoddate'];\n\n\t\tif ($lastmoddate && $lastmodtime)\n\t\t{\n\t\t\t// ----- Extract time\n\t\t\t$v_hour = ($lastmodtime & 0xF800) >> 11;\n\t\t\t$v_minute = ($lastmodtime & 0x07E0) >> 5;\n\t\t\t$v_seconde = ($lastmodtime & 0x001F) * 2;\n\n\t\t\t// ----- Extract date\n\t\t\t$v_year = (($lastmoddate & 0xFE00) >> 9) + 1980;\n\t\t\t$v_month = ($lastmoddate & 0x01E0) >> 5;\n\t\t\t$v_day = $lastmoddate & 0x001F;\n\n\t\t\t// ----- Get UNIX date format\n\t\t\t$this->fileHeader->timestamp = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);\n\t\t}\n\n\t\t$isBannedFile = false;\n\n\t\t$this->fileHeader->compressed = $headerData['compsize'];\n\t\t$this->fileHeader->uncompressed = $headerData['uncomp'];\n\t\t$nameFieldLength = $headerData['fnamelen'];\n\t\t$extraFieldLength = $headerData['eflen'];\n\n\t\t// Read filename field\n\t\t$this->fileHeader->file = fread($this->fp, $nameFieldLength);\n\n\t\t// Handle file renaming\n\t\t$isRenamed = false;\n\t\tif (is_array($this->renameFiles) && (count($this->renameFiles) > 0))\n\t\t{\n\t\t\tif (array_key_exists($this->fileHeader->file, $this->renameFiles))\n\t\t\t{\n\t\t\t\t$this->fileHeader->file = $this->renameFiles[$this->fileHeader->file];\n\t\t\t\t$isRenamed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Handle directory renaming\n\t\t$isDirRenamed = false;\n\t\tif (is_array($this->renameDirs) && (count($this->renameDirs) > 0))\n\t\t{\n\t\t\tif (array_key_exists(dirname($this->fileHeader->file), $this->renameDirs))\n\t\t\t{\n\t\t\t\t$file =\n\t\t\t\t\trtrim($this->renameDirs[dirname($this->fileHeader->file)], '/') . '/' . basename($this->fileHeader->file);\n\t\t\t\t$isRenamed = true;\n\t\t\t\t$isDirRenamed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Read extra field if present\n\t\tif ($extraFieldLength > 0)\n\t\t{\n\t\t\t$extrafield = fread($this->fp, $extraFieldLength);\n\t\t}\n\n\t\tdebugMsg('*' . ftell($this->fp) . ' IS START OF ' . $this->fileHeader->file . ' (' . $this->fileHeader->compressed . ' bytes)');\n\n\n\t\t// Decide filetype -- Check for directories\n\t\t$this->fileHeader->type = 'file';\n\t\tif (strrpos($this->fileHeader->file, '/') == strlen($this->fileHeader->file) - 1)\n\t\t{\n\t\t\t$this->fileHeader->type = 'dir';\n\t\t}\n\t\t// Decide filetype -- Check for symbolic links\n\t\tif (($headerData['ver1'] == 10) && ($headerData['ver2'] == 3))\n\t\t{\n\t\t\t$this->fileHeader->type = 'link';\n\t\t}\n\n\t\tswitch ($headerData['compmethod'])\n\t\t{\n\t\t\tcase 0:\n\t\t\t\t$this->fileHeader->compression = 'none';\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$this->fileHeader->compression = 'gzip';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Find hard-coded banned files\n\t\tif ((basename($this->fileHeader->file) == \".\") || (basename($this->fileHeader->file) == \"..\"))\n\t\t{\n\t\t\t$isBannedFile = true;\n\t\t}\n\n\t\t// Also try to find banned files passed in class configuration\n\t\tif ((count($this->skipFiles) > 0) && (!$isRenamed))\n\t\t{\n\t\t\tif (in_array($this->fileHeader->file, $this->skipFiles))\n\t\t\t{\n\t\t\t\t$isBannedFile = true;\n\t\t\t}\n\t\t}\n\n\t\t// If we have a banned file, let's skip it\n\t\tif ($isBannedFile)\n\t\t{\n\t\t\t// Advance the file pointer, skipping exactly the size of the compressed data\n\t\t\t$seekleft = $this->fileHeader->compressed;\n\t\t\twhile ($seekleft > 0)\n\t\t\t{\n\t\t\t\t// Ensure that we can seek past archive part boundaries\n\t\t\t\t$curSize = @filesize($this->archiveList[$this->currentPartNumber]);\n\t\t\t\t$curPos = @ftell($this->fp);\n\t\t\t\t$canSeek = $curSize - $curPos;\n\t\t\t\tif ($canSeek > $seekleft)\n\t\t\t\t{\n\t\t\t\t\t$canSeek = $seekleft;\n\t\t\t\t}\n\t\t\t\t@fseek($this->fp, $canSeek, SEEK_CUR);\n\t\t\t\t$seekleft -= $canSeek;\n\t\t\t\tif ($seekleft)\n\t\t\t\t{\n\t\t\t\t\t$this->nextFile();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->currentPartOffset = @ftell($this->fp);\n\t\t\t$this->runState = AK_STATE_DONE;\n\n\t\t\treturn true;\n\t\t}\n\n\t\t// Remove the removePath, if any\n\t\t$this->fileHeader->file = $this->removePath($this->fileHeader->file);\n\n\t\t// Last chance to prepend a path to the filename\n\t\tif (!empty($this->addPath) && !$isDirRenamed)\n\t\t{\n\t\t\t$this->fileHeader->file = $this->addPath . $this->fileHeader->file;\n\t\t}\n\n\t\t// Get the translated path name\n\t\tif (!$this->mustSkip())\n\t\t{\n\t\t\tif ($this->fileHeader->type == 'file')\n\t\t\t{\n\t\t\t\t$this->fileHeader->realFile = $this->postProcEngine->processFilename($this->fileHeader->file);\n\t\t\t}\n\t\t\telseif ($this->fileHeader->type == 'dir')\n\t\t\t{\n\t\t\t\t$this->fileHeader->timestamp = 0;\n\n\t\t\t\t$dir = $this->fileHeader->file;\n\n\t\t\t\t$this->postProcEngine->createDirRecursive($dir, 0755);\n\t\t\t\t$this->postProcEngine->processFilename(null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Symlink; do not post-process\n\t\t\t\t$this->fileHeader->timestamp = 0;\n\t\t\t\t$this->postProcEngine->processFilename(null);\n\t\t\t}\n\n\t\t\t$this->createDirectory();\n\t\t}\n\n\t\t// Header is read\n\t\t$this->runState = AK_STATE_HEADER;\n\n\t\treturn true;\n\t}", "public function getFirstRecordIndex()\n {\n $col = $this->getColumn(\"FIRST\");\n if ($col) {\n $f = $col->getDataByIndex(0);\n return $f === null ? 0 : intval($f, 10);\n }\n if ($this->getRecordsCount()) {\n return 0;\n }\n return null;\n }", "public function getFirstLineNumber() {\n return $this->lineNumbers['start'];\n }", "function getCurrentRecordNumberStart()\n {\n if (is_null($this->page)) {\n return 1;\n } elseif ($this->getRecordCount() == 0) {\n return 0;\n } else {\n return ($this->page - 1) * $this->rowLimit + 1;\n }\n }", "public function getStartPosition($fileSize)\n {\n $size = (int)$fileSize;\n\n if ($this->firstByte === null) {\n return ($size - 1) - $this->lastByte;\n }\n\n if ($size <= $this->firstByte) {\n throw new UnsatisfiableRangeException(\n 'Start position is after the end of the file'\n );\n }\n\n return $this->firstByte;\n }", "protected function _getFirstUploadFileInfo()\n {\n $upload = $this->getTransfer();\n $files = $upload->getFileInfo();\n\n $fileName = $this->_getFirsUploadedFileName();\n\n return $files[$fileName];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return text with quotes escaped for use in a tab or commadelimited file
function caEscapeForDelimitedOutput($ps_text) { return '"'.str_replace("\"", "\"\"", $ps_text).'"'; }
[ "function csv_quote($value)\n{\n // Stripslashes if we need to\n if (get_magic_quotes_gpc()) \n {\n $value = stripslashes($value);\n }\n\n // Double quote it if it's not a number\n if (!is_numeric($value)) \n {\n $value = \"\\\"\" . str_replace('\"', '\"\"', $value) . \"\\\"\";\n }\n\n return $value;\n}", "function echocsv( $fields )\n {\n $separator = '';\n foreach ( $fields as $field )\n {\n if ( preg_match( '/\\\\r|\\\\n|,|\"/', $field ) )\n {\n $field = '\"' . str_replace( '\"', '\"\"', $field ) . '\"';\n }\n echo $separator . $field;\n $separator = ',';\n }\n echo \"\\r\\n\";\n }", "private function esc_csv($content)\n {\n return str_replace('\"', '\"\"', $content);\n }", "function csv_escape($value)\n{\n\t$value = str_replace('\"','\"\"',$value);\n\t$value = '\"'.$value.'\"';\n\n\treturn($value);\n}", "function table_escape_csv ($cell) {\n return '\"' . str_replace('\"', '\\\"', $cell) . '\"'; \n}", "function csv_escape_string($input) {\n $input = ereg_replace(\"[\\r\\n\\t]\", ' ', $input);\n $input = ereg_replace('\"', '\"\"', $input);\n $input = '\"' . $input . '\"';\n\n return $input;\n }", "function CSVUnquote($field) {\n //print $field.\":\";\n $field = preg_replace(\"/^\\040*\\\"/\", \"\", $field);\n $field = preg_replace(\"/\\\"\\040*$/\", \"\", $field);\n $field = str_replace('\"\"', '\"', $field);\n //print $field.\"\\n\";\n return $field;\n}", "public function getTabDelimitedExport() {\r\n \r\n // ensure that the name and description don't include any tabs\r\n $name = str_replace(chr(9), \" \", $this->name);\r\n $description = str_replace(chr(9), \" \", $this->description);\r\n\r\n return ($name . chr(9) . $description . chr(9) . str_replace(Array(\" \", PHP_EOL), \"\", strtoupper(Genocad_Utilities_Designs_ReverseComplement::sequence_reverse($this->sequence))) . PHP_EOL);\r\n\r\n }", "function wpcom_vip_csv_quote( $v ) {\n\tif ( is_array( $v ) )\n\t\treturn join(',', array_map( 'wpcom_vip_csv_quote', $v ));\n\n\tif ( strstr( $v, '\"' ) || strstr( $v, ',' ) || strstr( $v, \"\\n\" ) )\n\t\treturn '\"' . str_replace( '\"', '\"\"', $v ) . '\"';\n\n\treturn \"$v\";\n}", "function csv_escape_string( $p_str ) {\r\n\t\tif ( strpos( $p_str, csv_get_separator() ) !== false ) {\r\n\t\t\t$p_str = '\"' . str_replace( '\"', '\"\"', $p_str ) . '\"';\r\n\t\t}\r\n\r\n\t\treturn $p_str;\r\n\t}", "function util_prepare_text_for_export($text) {\n\n $text = str_replace(\",\", \":\", $text);\n $text = strip_tags($text);\n $text = str_replace(\"\\r\", \" \", $text);\n $text = str_replace(\"\\n\", \" \", $text);\n\n return $text;\n}", "function Advancedform_escapeCsvField($field)\n{\n global $plugin_cf;\n\n $specialChars = \"\\\"\\r\\n\" . $plugin_cf['advancedform']['csv_separator'];\n $specialChars = preg_quote($specialChars, '/');\n if (preg_match('/[' . $specialChars . ']/', $field)) {\n $field = str_replace('\"', '\"\"', $field);\n $field = '\"' . $field . '\"';\n }\n return $field;\n}", "#[@test]\n public function readQuotedWithSingleQuotes() {\n $in= $this->newReader(\"Timm;'Karlsruhe';76137\", create(new \\text\\csv\\CsvFormat())->withQuote(\"'\"));\n $this->assertEquals(array('Timm', 'Karlsruhe', '76137'), $in->read());\n }", "function get_tab_delimited_text($result, $cols)\n {\n\n $data = '';\n\n // field data\n foreach($result as $row) {\n $line = '';\n foreach($cols as $name) {\n $value = $row[$name];\n if (!isset($value) || $value == \"\") {\n $value = \"\\t\";\n }\n else {\n $value = quote_if_contains_tab($value) . \"\\t\";\n }\n $line .= $value;\n }\n $data .= trim($line).\"\\n\";\n }\n\n $dataNoCR = str_replace(\"\\r\",\"\",$data);\n\n return $dataNoCR;\n }", "public static function quoteCsv($val)\n\t{\n\t\tif (!isset($val))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tif (strpos($val, \"\\n\") !== false || strpos($val, ',') !== false)\n\t\t{\n\t\t\treturn '\"' . str_replace(array('\\\\', '\"'), array('\\\\\\\\', '\"\"'), $val) . '\"';\n\t\t}\n\n\t\treturn $val;\n\t}", "function clean_csv( $field ){\n\t\t\n\t\t if ( preg_match( '/\\\\r|\\\\n|,|\"/', $field ) )\n\t\t {\n\t\t\t $field = '\"' . str_replace( '\"', '\"\"', $field ) . '\"';\n\t\t }\n\t\t\n\t\treturn $field;\n\t }", "function make_csv_line($values)\n{\n\t//then surrond it with quotes and replace any quotes inside it with two quotes\n\tforeach($values as $i=> $value)\n\t{\n\t\tif ((strpos($value, ',') !== false) || (strpos($value, '\"') !== false) || (strpos($value, ' ') !== false) || (strpos($value, \"\\t\") !== false) || (strpos($value, \"\\n\") !== false) || (strpos($value, \"\\r\") !== false))\n\t\t\t$values[$i] = '\"' . str_replace('\"', '\"\"', $value) . '\"';\n\t}\n\treturn implode(',', $values) . \"\\n\";\n}", "function escapeForCSV($str, $delimiter = '\"', $seperator = ',') {\n $escapeSymbols = array($delimiter, $seperator, \"\\n\", \"\\t\", \"\\r\", ' ');\n $needsEscaping = FALSE;\n foreach ($escapeSymbols as $symbol) {\n if (papaya_strings::strpos($str, $symbol) !== FALSE) {\n $needsEscaping = TRUE;\n break;\n }\n }\n if ($needsEscaping) {\n $str = $delimiter.str_replace($delimiter, $delimiter.$delimiter, $str).$delimiter;\n }\n return $str;\n }", "static function csv_clean($value) {\n\n if (Toolbox::get_magic_quotes_runtime()) {\n $value = stripslashes($value);\n }\n\n $value = str_replace(\"\\\"\", \"''\", $value);\n $value = Html::clean($value);\n\n return $value;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Refreshes caches for the provided cache types.
public function refresh($types) { $updatedTypes = 0; $message = ""; if (!empty($types)) { foreach ($types as $type) { try { $tags = Mage::app()->getCacheInstance()->cleanType($type); $updatedTypes++; } catch (Exception $e) { $message .= "{$type} cache unknown error:\n" . $e->getMessage() . "\n"; } } } if ($updatedTypes > 0) { $message .= "{$updatedTypes} cache type(s) refreshed.\n"; } }
[ "function fusion_reset_all_caches( $delete_cache = [] ) {\n\t\t// Reset fusion-caches.\n\t\tif ( ! class_exists( 'Fusion_Cache' ) ) {\n\t\t\trequire_once FUSION_LIBRARY_PATH . '/inc/class-fusion-cache.php';\n\t\t}\n\n\t\t$fusion_cache = new Fusion_Cache();\n\t\t$fusion_cache->reset_all_caches( $delete_cache );\n\n\t\twp_cache_flush();\n\t}", "public function warmUpCache()\n {\n foreach ($this->all() as $type => $_) {\n $this->reload($type);\n }\n }", "public function refresh(): void\n\t{\n\t\t$this->loadCache();\n\t\tif (!$this->refreshed) {\n\t\t\t$this->refreshClasses();\n\t\t\t$this->saveCache();\n\t\t}\n\t}", "function avada_reset_all_caches( $delete_cache = [] ) {\n\t// Reset fusion-caches.\n\tif ( ! class_exists( 'Fusion_Cache' ) ) {\n\t\trequire_once Avada::$template_dir_path . '/includes/lib/inc/class-fusion-cache.php';\n\t}\n\n\t$fusion_cache = new Fusion_Cache();\n\t$fusion_cache->reset_all_caches( $delete_cache );\n\n\twp_cache_flush();\n}", "private function refreshCache()\n\t{\n\t\t$this->lookupCache = array();\n\n\t\tif ($this instanceof IComponentContainer) {\n\t\t\tforeach ($this->getComponents() as $component) {\n\t\t\t\tif ($component instanceof self) {\n\t\t\t\t\t$component->refreshCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function cacheRefresh() { }", "public function flushCaches() {}", "function drupal_flush_all_caches() {\n // Change query-strings on css/js files to enforce reload for all users.\n _drupal_flush_css_js();\n\n registry_rebuild();\n drupal_clear_css_cache();\n drupal_clear_js_cache();\n\n // Rebuild the theme data. Note that the module data is rebuilt above, as\n // part of registry_rebuild().\n system_rebuild_theme_data();\n drupal_theme_rebuild();\n\n entity_info_cache_clear();\n node_types_rebuild();\n // node_menu() defines menu items based on node types so it needs to come\n // after node types are rebuilt.\n menu_rebuild();\n\n // Synchronize to catch any actions that were added or removed.\n actions_synchronize();\n\n // Don't clear cache_form - in-progress form submissions may break.\n // Ordered so clearing the page cache will always be the last action.\n $core = array('cache', 'cache_path', 'cache_filter', 'cache_bootstrap', 'cache_page');\n $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);\n foreach ($cache_tables as $table) {\n cache_clear_all('*', $table, TRUE);\n }\n\n // Rebuild the bootstrap module list. We do this here so that developers\n // can get new hook_boot() implementations registered without having to\n // write a hook_update_N() function.\n _system_update_bootstrap_status();\n}", "public function flushCaches() {\n\t\t$this->systemLogger->log('Flushing all registered caches.', LOG_NOTICE);\n\t\tforeach ($this->caches as $cache) {\n\t\t\t$cache->flush();\n\t\t}\n\t}", "public function resetRegisteredCaches(): void;", "protected function clear_caches() {\n\t\tif ( ! wp_using_ext_object_cache() || apply_filters( 'action_scheduler_queue_runner_flush_cache', false ) ) {\n\t\t\twp_cache_flush();\n\t\t}\n\t}", "public function fill_cache( $site_type_filter ) {\n\t\t$site_types = $site_type_filter->get_sitetypes( false );\n\n\t\tforeach ( $site_types as $name ) {\n\t\t\t$this->fill_theme_cache( $name, $site_type_filter->get_theme_slugs( $name ) );\n\t\t\t$this->fill_plugin_cache( $name, $site_type_filter->get_plugins( $name ) );\n\t\t}\n\t}", "public function _flush_caching_plugins_caches() {\n\t\t/**\n\t\t * Filter whether the caches of common caching plugins shall be flushed.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param bool $flush Whether caches of caching plugins shall be flushed. Default true.\n\t\t */\n\t\tif ( ! apply_filters( 'tablepress_flush_caching_plugins_caches', true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// W3 Total Cache\n\t\tif ( function_exists( 'w3tc_pgcache_flush' ) ) {\n\t\t\tw3tc_pgcache_flush();\n\t\t}\n\t\t// WP Super Cache\n\t\tif ( function_exists( 'wp_cache_clear_cache' ) ) {\n\t\t\twp_cache_clear_cache();\n\t\t}\n\t\t// Cachify\n\t\tdo_action( 'cachify_flush_cache' );\n\t\t// Quick Cache\n\t\tif ( isset( $GLOBALS['quick_cache'] ) && method_exists( $GLOBALS['quick_cache'], 'clear_cache' ) ) {\n\t\t\t$GLOBALS['quick_cache']->clear_cache();\n\t\t}\n\t\t// WP Fastest Cache\n\t\tif ( isset( $GLOBALS['wp_fastest_cache'] ) && method_exists( $GLOBALS['wp_fastest_cache'], 'deleteCache' ) ) {\n\t\t\t$GLOBALS['wp_fastest_cache']->deleteCache();\n\t\t}\n\t}", "public function rebuildCurrencyCaches()\n\t{\n\t\t$this->rebuildCurrencyCache();\n\t}", "public function flushCaches()\n {\n $this->_schema = null;\n $this->_schemaDef = null;\n $this->_contentFieldCache = [];\n TypeLoader::flush();\n GqlEntityRegistry::flush();\n TypeManager::flush();\n $this->invalidateCaches();\n }", "public function refreshCache()\n {\n $this->routes = array();\n $this->cached = FALSE;\n }", "final public function rebuild_cache($cache_name = null) {\n\n\t\t\t// if we want to rebuild specific kind of cache or all of it\n\t\t\t$rebild_cache = (!is_null($cache_name) && array_key_exists($cache_name, $this->cache)) ? array($cache_name => $this->cache[$cache_name]) : $this->cache;\n\n\t\t\tforeach ($rebild_cache as $name => $options) {\n\t\t\t\tif (!array_key_exists('fields', $options)) continue;\n\n\t\t\t\t$options = array_merge(array('conditions' => null, 'order' => null, 'limit' => null), $options);\n\n\t\t\t\t// find if the array of fields is multidimensional array - so we got to consider the the associations\n\t\t\t\tif (count($options['fields']) == count($options['fields'], 1)) {\n\t\t\t\t\t// no multidimensional array so no associations\n\t\t\t\t\t$associations = array();\n\t\t\t\t\t// keys to fetch are all 'fields' elements\n\t\t\t\t\t$keys = array_combine($options['fields'], $options['fields']);\n\t\t\t\t} else {\n\t\t\t\t\t// filter the associations out\n\t\t\t\t\t$associations = array_filter($options['fields'], 'is_array');\n\t\t\t\t\t// get only the fields which are no associations\n\t\t\t\t\t$keys = array_diff_key($options['fields'], $associations);\n\t\t\t\t\t// keys to fetch from main object\n\t\t\t\t\t$keys = array_combine($keys, $keys);\n\t\t\t\t}\n\n\t\t\t\t$store = array();\n\t\t\t\t// we loop through all locales\n\t\t\t\tforeach (Config()->LOCALE_SHORTCUTS as $lang) {\n\t\t\t\t\t$this->set_locale($lang);\n\t\t\t\t\t// preserve index for better cache structure\n\t\t\t\t\t$preserve_index = $this->preserve_index;\n\t\t\t\t\t$this->preserve_index = true;\n\t\t\t\t\t// find all elements according to conditions, order and limit\n\t\t\t\t\t$items = $this->find_all($options['conditions'], $options['order'], $options['limit']);\n\t\t\t\t\t// return preserve index to its original state\n\t\t\t\t\t$this->preserve_index = $preserve_index;\n\n\t\t\t\t\tforeach ($items as $id => $item) {\n\t\t\t\t\t\t// fetch the coresponding fields from each item\n\t\t\t\t\t\t$values = array();\n\t\t\t\t\t\tforeach($keys as $k) {\n\t\t\t\t\t\t $values[$k] = $item->$k;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// store them according to i18n settings\n\t\t\t\t\t\tif ($this->is_i18n == true) {\n\t\t\t\t\t\t\t$store[$lang][$id] = $values;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$store[$id] = $values;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// loop through associations and fetch their data\n\t\t\t\t\t\tforeach ($associations as $association => $fields) {\n\t\t\t\t\t\t\t// fetch the coresponding fields from each association\n\t\t\t\t\t\t\t$values = array_intersect_key((array)($item->$association()), array_combine($fields, $fields));\n\t\t\t\t\t\t\tif (empty($values)) continue;\n\t\t\t\t\t\t\t// store them according to i18n settings\n\t\t\t\t\t\t\tif ($this->is_i18n == true) {\n\t\t\t\t\t\t\t\t$store[$lang][$id][$association] = $values;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$store[$id][$association] = $values;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// write cache\n\t\t\t\t$cache_with_model = Inflector::tableize($this->get_class_name()) . '_' . $name;\n\t\t\t\t$cache_file = Config()->ROOT_PATH . 'cache/site/' . $cache_with_model . '.cache';\n\t\t\t\t$file = fopen($cache_file, \"w\");\n\t\t\t\t@flock($file, LOCK_EX);\n\t\t\t\tfwrite($file, \"<?php\\n\\$this->cached_results['\" . $cache_with_model . \"'] = \" . var_export($store, true) . \";\\n?>\");\n\t\t\t\t@flock($file, LOCK_UN);\n\t\t\t\tfclose($file);\n\t\t\t\t@chmod($cache_file, 0666);\n\t\t\t}\n\n\t\t\t// return back to original locale\n\t\t\t$this->set_locale(Registry()->locale);\n\t\t}", "public function flushCaches()\n {\n $this->createAllCaches();\n foreach ($this->caches as $cache) {\n $cache->flush();\n }\n }", "private function refresh() {\n $this->cacheManager->delete('quickbooks_default_product_cache');\n $this->cacheManager->delete('quickbooks_terms_cache');\n $this->cacheManager->delete('quickbooks_payment_cache');\n $this->cacheManager->delete('quickbooks_account_cache');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads entries from cache
private function _loadCache() { $cfile = $this->_getCacheFilename(); $data = unserialize(file_get_contents($cfile)); $refresh_cache = false; $this->_tweets = $data['tweets']; //check if tweets were cached if ( !is_array($this->_tweets) || count($this->_tweets) == 0 ) { $this->_parseTweets(); $refresh_cache = true; } $this->_gplus = $data['gplus']; //check if gplus posts were cached if ( !is_array($this->_gplus) || count($this->_gplus) == 0 ) { $this->_parseGplus(); $refresh_cache = true; } if ( $refresh_cache === true ) { $this->_makeCache(false); } }
[ "protected function loadFromCache() {}", "protected function load()\n {\n if ($this->cache->contains($this->getCacheKey())) {\n $this->map = $this->cache->fetch($this->getCacheKey());\n } else {\n $this->generateMap();\n }\n }", "protected function loadCache()\n {\n Rakshak::loadCache();\n }", "public static function loadCache()\n {\n if (self::$cache_loaded) {\n return;\n }\n\n self::$cache_loaded = true;\n self::$cache = unserialize(File::get(Path::tidy(BASE_PATH . \"/_cache/_app/content/content.php\")));\n\n if (!is_array(self::$cache)) {\n // something has gone wrong, log a message and set to an empty array\n self::$cache = array();\n Log::fatal('Could not find or access your cache.', 'core', 'ContentService');\n }\n }", "public function load()\n {\n $this->cache->setContent($this->content_cacher->load());\n $this->cache->setUsers($this->user_cacher->load());\n $this->cache->setAssets($this->asset_cacher->load());\n }", "protected function loadRegistryIntoCache()\n {\n $db = $this->app['db'];\n\n $this->cacheData = Cache::rememberForever(\n $this->cache,\n function () use ($db) {\n $cache = [];\n foreach ($db->table($this->table)->get() as $registryEntry) {\n $cache[$registryEntry->key] = json_decode($registryEntry->value, true);\n }\n\n return $cache;\n }\n );\n }", "protected function _readCache()\n\t{\n\t\t$this->_items = $this->_persistenceProvider->read();\n\t}", "private static function load()\n\t{\n\t\t$data = file_get_contents(CACHE_LOCATION);\n\t\t$data = json_decode($data, true);\n\n\t\tself::setContent($data);\n\t}", "public function getCache();", "private function loadCache(){\n\t\t$query='SELECT parameter, value, valid_for FROM '.DB_PREFIX.'_cache';\n\t\t$DBC=DBC::getInstance();\n\t\t$stmt=$DBC->query($query);\n\t\tif($stmt){\n\t\t\twhile($ar=$DBC->fetch($stmt)){\n\t\t\t\t$this->cacheValues[$ar['parameter']]['valid_for']=$ar['valid_for'];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function loadCache() {\n\t\tif ($this->tags !== null) return;\n\n\t\t// get cache\n\t\tWCF::getCache()->addResource($this->cacheName, WCF_DIR.'cache/cache.businessCategoryTagCloud-'.$this->categoryID.'-'.StringUtil::getHash(implode(',', $this->languageIDArray)).'.php', WCF_DIR.'lib/system/cache/CacheBuilderBusinessCategoryTagCloud.class.php', 0, 86400);\n\t\t$this->tags = WCF::getCache()->get($this->cacheName);\n\t}", "function loadFromCache() {\n\t\tif ($this->isCached()) {\n\t\t\t$this->links = unserialize(file_get_contents(CACHE_FILE));\n\t\t\tforeach ($this->links as $link=>$result) {\n\t\t\t\tif ($this->consoleMode) print $link;\n\t\t\t\t$content = $this->getPageContent($link);\n\t\t\t\tif ($content == -1) continue;\n\t\t\t\t//Check the content of the page and add link and result to the array\n\t\t\t\t$result = $this->getParser()->check($content);\n\t\t\t\tif ($this->consoleMode) echo ' ['.($result ? 'OK' : 'ERROR').']'.\"\\n\";\n\t\t\t\t//Save the result\n\t\t\t\t$this->links[$link] = $result;\n\t\t\t}\n\t\t}\n\t}", "public function get_data_to_cache();", "protected function initializeCache() {}", "function _loadFromCache()\n\t{\n\t\t$sectionFullName=$this->_createSectionFullName();\n\n\t\t$sectionUrlsQuery = \"\n\t\t\tSELECT * \n\t\t\tFROM\n\t\t\t\t`\".$this->_tableName.\"`\n\t\t\tWHERE\n\t\t\t\t`\".$this->_colnSectionNames.\"` LIKE '%,\".$sectionFullName.\",%'\n\t\t\";\n\n\t\t//$sectionUrls = cmfcMySql::getRowsCustomWithCustomIndex($sectionUrlsQuery, $this->_colnUrl);\n\t\t\n\t\t$sectionUrls = cmfcMySql::getRowsCustom($sectionUrlsQuery);\n\t\t\n\t\tif($sectionUrls)\n\t\t{\n\t\t\tforeach($sectionUrls as $sectionUrl)\n\t\t\t{\n\t\t\t\t$this->_cachedAlias[$sectionUrl['url']]['alias'] = $sectionUrl['alias'];\n\t\t\t\t\n\t\t\t\t$alternativeUrls = $sectionUrl[$this->_colnAlternativeUrls];\n\t\t\t\t\n\t\t\t\t$alternativeUrls = substr($alternativeUrls, 1, strlen($alternativeUrls)-2);\n\t\t\t\t\n\t\t\t\tif($alternativeUrls)\n\t\t\t\t{\n\t\t\t\t\t$alternativeUrlsArray = explode(',', $alternativeUrls);\n\t\t\t\t\tif($alternativeUrlsArray)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($alternativeUrlsArray as $alternativeUrlsItem)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_cachedAlias[$alternativeUrlsItem]['alias'] = $sectionUrl['alias'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected function loadCache()\n\t{\n\t\tif (\n\t\t\t$this->memCache &&\n\t\t\t($this->content = $this->memCache->get($this->memCacheKey))\n\t\t) {\n\t\t\t$this->cache = unserialize($this->content);\n\t\t\t$this->content = '';\n\t\t} elseif ($this->isReadable()) {\n\t\t\tparent::loadCache();\n\t\t\t$this->content = serialize($this->cache);\n\t\t\t$this->saveMemCache();\n\t\t}\n\t}", "public function load(): void\n {\n try {\n $keys = $this->cache->get(self::INDEXING_KEY);\n if ($keys instanceof Keys) {\n $this->keys = $keys;\n return;\n }\n } catch (CacheException $e) {\n trigger_error($e->getMessage(), E_USER_WARNING);\n }\n\n $this->keys = new Keys();\n }", "protected function initCaches() {}", "protected function _loadCache()\n\t{\n\t\treturn false;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show a view to create a new artical
public function create(){ return view ('artical.create'); }
[ "function addNewShow()\n {\n\t return view('client.extractor.new');\n }", "public function createView ()\n {\n }", "public function create()\n\t{\n\t\treturn View::make('overlords.create');\n\t}", "public function newAction()\n {\n $entity = new Artwork();\n $form = $this->createForm(new ArtworkType(), $entity);\n\n return $this->render('SquazicHighlineGuideBundle:Artwork:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('representatives.create');\n\t}", "public function create()\n\t{\n\t\t// return View::make('espressioni.create');\n\t\treturn View::make('espressioni.edit');\n\t}", "public function create()\n {\n return view('airline.create');\n }", "public function actionCreate()\n {\n $model = new Artista();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t\treturn View::make('lifesreflections.create');\n\t}", "public function create()\n\t{\n\t\treturn View::make('pictures.create');\n\t}", "public function create()\n {\n return view('intros.create', ['title' => 'Create Intro']);\n }", "public function create()\n {\n // Show the page\n return view('admin.tutorial.create_edit');\n }", "public function create()\n {\n /** Titulo da página */\n $title = \"Apólice\";\n /** Breadcrumb */\n $breadcrumb = new \\stdClass;\n $breadcrumb->nome = \"addApolice\";\n\n return view('apolices.create', compact('title', 'breadcrumb'));\n }", "protected function createView()\r\n {\r\n $section1=new buildSection(100,100);\r\n $menu=new buildMenu();\r\n $menu->changeMenuSizeFont(\"12px\");\r\n $headern=new modelHeader_1(true);\r\n $headern->setMenu($menu);\r\n $headern->addItemIcon(new itemIcon(\"fas fa-search\"));\r\n $headern->addItemIcon(new itemIcon(\"fab fa-twitter\"));\r\n $headern->addItemIcon(new itemIcon(\"fab fa-facebook-square\"));\r\n $headern->textLogo(\"TAGUIG\");\r\n $header=new slideView(false);\r\n $headerItem=new itemSlideView('image/cinema.jpg',$section1->getAtrributStyle());\r\n $headerItem1=new itemSlideView('image/musique.jpg',$section1->getAtrributStyle());\r\n $headerItem2=new itemSlideView('image/culture.png',$section1->getAtrributStyle());\r\n $header->addHeader($headern);\r\n $header->addView($headerItem);\r\n $header->addView($headerItem1);\r\n $header->addView($headerItem2);\r\n $section1->addView($header);\r\n $this->addView($section1);\r\n $this->addJsLib(\"jquery-3.5.1\");\r\n $this->setTitre(\"mon site \");\r\n $this->addMetaData('og:url', 'facebook');\r\n $this->addMetaData('fg:url', 'facebook');\r\n $this->addMetaData('pg:url', 'facebook');\r\n $this->addMetaData('description', 'facebook');\r\n\r\n \r\n \r\n \r\n }", "public function create()\n {\n return view('office_expenditures.create');\n }", "public function create()\n\t{\n\t\t$this->layout->content = View::make('discographyes.create', compact('discographyes'));\n\t}", "public function create()\n\t{\n\t\treturn view('pilpres.create');\n\t}", "public function create()\n {\n return view('examples.create');\n }", "public function create()\n\t{\n\t\t//\n\t\treturn View::make('control.estudios_nuevo');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Return number of records in tables, where some foreign key $id is used. $id searched key value $tables array of table names (without prefix); when table name is used as a key, then value is name of foreign key field. For numeric keys $stdkey field name is used. $stdkey standard name of foreign key.
function key_in_foreign_table($id, $tables, $stdkey) { if (!is_array($tables)) $tables = array($tables); $sqls = array(); foreach ($tables as $tbl => $key) { if (is_numeric($tbl)) { $tbl = $key; $key = $stdkey; } $sqls[] = "(SELECT COUNT(*) as cnt FROM `".TB_PREF."$tbl` WHERE `$key`=".db_escape($id).")\n"; } $sql = "SELECT sum(cnt) FROM (". implode(' UNION ', $sqls).") as counts"; $result = db_query($sql, "check relations for ".implode(',',$tables)." failed"); $count = db_fetch($result); return $count[0]; }
[ "protected function countForeignKey($idTable)\n {\n $nbFK = 0;\n $xPath = new \\DOMXPath($this->domDoc);\n\n $indexes = $xPath->query(\"//c:Tables/o:Table[@Id='\" . $idTable . \"']/c:Indexes/o:Index\");\n\n foreach ($indexes as $index) {\n $code = $this->getNodeValue($index->getElementsByTagName(\"Code\")->item(0));\n $type = substr($code, (strlen($code) - 2), strlen($code));\n if ($type == \"FK\") {\n $nbFK++;\n }\n }\n\n return $nbFK;\n }", "function count_by_id($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(id) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n return($db->fetch_assoc($result));\n }\n}", "function count_by_id($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(id) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n return($db->fetch_assoc($result));\n }\n}", "function count_by_id_sintomas($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(idsintomas) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n return($db->fetch_assoc($result));\n }\n}", "function count_by_id($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(Id) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n $valor=$db->fetch_assoc($result);\n return $valor;\n }\n}", "public static function getCountOfRecords($table);", "public function show_numTbl(){\r\n\t\t$sql = \"SHOW TABLES\";\r\n\t\t$result= $this->bd->conn->prepare($sql);\r\n\t\t$result->execute();\r\n\t\t\r\n\t\tif($result != false){\r\n\t\t\t$name_tbl = $result->fetchAll(FETCH_COLUMN);\r\n\t\t\treturn count($name_tbl);\r\n\t\t}else{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "function countTables() {\n\t\treturn count(static::$db->query(\"SHOW TABLES\")->fetchAll());\n\t}", "public function count_required_tables()\n\t{\n\t\treturn $this->db->where('required',1)->count_all_results($this->table);\n\t}", "public function countTables()\r\n\t{\r\n\t\tif ($this->tables)\r\n\t\t\treturn count($this->tables);\r\n\t}", "function count_all_tables($table_arr)\n\t{\n\t\t$new_arr = array();\n\t\tfor($i=0; $i<count($table_arr); $i++)\n\t\t{\n\t\t\t$table_name = $table_arr[$i];\n\t\t\t$table_id = $this->ret_pk($table_name);\n\t\t\t$new_arr[$i] = $this->count_table($table_id, $table_name);\n\t\t}\n\t\treturn $new_arr;\n\t}", "public function testResultNumTables()\n {\n \t$this->assertEquals(1, $this->conn->query('SELECT * FROM test')->numTables());\n \t$this->assertEquals(2, $this->conn->query('SELECT * FROM test INNER JOIN child ON test.id = child.idTest')->numTables(), \"SELECT FROM test, child\");\n }", "function get_number_of_entries($tableName, $where = \"\")\n {\n $nb = 0;\n $query = \"select count(*) as Nb from $tableName \" . $where;\n $result = $this->configDB->query($query);\n $obj = $result->nextAssoc();\n if($obj)\n\t{\n\t $nb = $obj[\"Nb\"];\n\t}\n $result->freeResult();\n return $nb;\n }", "function get_count_of($table){\n return $this->db->get($table)->num_rows();\n }", "function qa_db_table_size()\n{\n\tif (defined('QA_MYSQL_USERS_PREFIX')) { // check if one of the prefixes is a prefix itself of the other\n\t\tif (stripos(QA_MYSQL_USERS_PREFIX, QA_MYSQL_TABLE_PREFIX) === 0)\n\t\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX);\n\t\telseif (stripos(QA_MYSQL_TABLE_PREFIX, QA_MYSQL_USERS_PREFIX) === 0)\n\t\t\t$prefixes = array(QA_MYSQL_USERS_PREFIX);\n\t\telse\n\t\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX, QA_MYSQL_USERS_PREFIX);\n\n\t} else\n\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX);\n\n\t$size = 0;\n\tforeach ($prefixes as $prefix) {\n\t\t$statuses = qa_db_read_all_assoc(qa_db_query_raw(\n\t\t\t\"SHOW TABLE STATUS LIKE '\" . $prefix . \"%'\"\n\t\t));\n\n\t\tforeach ($statuses as $status)\n\t\t\t$size += $status['Data_length'] + $status['Index_length'];\n\t}\n\n\treturn $size;\n}", "function count_by_staffID($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(staffID) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n return($db->fetch_assoc($result));\n }\n}", "public function countTables()\n {\n $nb = 0;\n foreach ($this->getDatabases() as $database) {\n $nb += $database->countTables();\n }\n\n return $nb;\n }", "function count_by_catID($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(catID) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n return($db->fetch_assoc($result));\n }\n}", "public function getTablesCount()\n {\n return $this->count(self::TABLES);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the riskLevelAggregated property value. The aggregated risk level. Possible values: none, low, medium, high, hidden, or unknownFutureValue. The value hidden means the user or signin was not enabled for Azure AD Identity Protection. Supports $filter (eq). Note: Details for this property are only available for Azure AD Premium P2 customers. All other customers are returned hidden.
public function getRiskLevelAggregated(): ?RiskLevel { $val = $this->getBackingStore()->get('riskLevelAggregated'); if (is_null($val) || $val instanceof RiskLevel) { return $val; } throw new \UnexpectedValueException("Invalid type found in backing store for 'riskLevelAggregated'"); }
[ "public function get_group_level() {\n\n if ( $this->is_giving_consent() ) {\n\n $consent_level = (int) ct_ultimate_gdpr_get_value( 'level', $this->get_request_array(), 0 );\n\n if ( $consent_level ) {\n return $consent_level;\n }\n\n }\n\n\n $cookie_consent_level = $this->get_cookie( 'consent_level', $this->get_option( 'cookie_cookies_group_default', $this->get_default_group_level() ) );\n\n if ( $this->user_meta ) {\n $meta_consent_level = ct_ultimate_gdpr_get_value( 'consent_level', $this->user_meta );\n }\n\n return ! empty( $meta_consent_level ) ? $meta_consent_level : $cookie_consent_level;\n }", "public function getSurchargeLevel()\n {\n return isset($this->SurchargeLevel) ? $this->SurchargeLevel : null;\n }", "public function getAwardedBadgeLevels()\n {\n return $this->awarded_badge_levels;\n }", "public function get_group_level()\n {\n\n if ($this->is_giving_consent()) {\n\n $consent_level = (int)ct_ultimate_gdpr_get_value('level', $this->get_request_array(), 0);\n\n if ($consent_level) {\n return $consent_level;\n }\n\n }\n\n $cookie_consent_level = $this->get_cookie('consent_level', $this->get_option('cookie_cookies_group_default', 1));\n\n return $cookie_consent_level;\n }", "public function getUserLevel()\n {\n $value = $this->get(self::USERLEVEL);\n return $value === null ? (integer)$value : $value;\n }", "public function getRisk()\n {\n return $this->risk;\n }", "public function groupAccessLevel(){\n\t\n\t global $db;\n\t \n\t #see if user is guest, if so, they have zero-level access.\n\t\tif($this->user == \"guest\"){\n\t\t $getAccessLevel = 0;\n\t\t return($getAccessLevel);\n\t\t}else{\n\t \t$db->SQL = \"SELECT Level FROM ebb_groups where id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$getAccessLevel = $db->fetchResults();\n\n\t\t\treturn($getAccessLevel['Level']);\n\t\t}\n\t}", "public function getLevel(){\n return $this->userLevel;\n }", "public function getApplicableLevel()\n\t{\n\t\treturn $this->applicableLevel;\n\t}", "public function getRiskArea()\n {\n return $this->riskArea;\n }", "function getRisk() {\n\t\treturn $this->m_risk;\n\t}", "public function getConfidenceLevelMetrics()\n {\n return $this->confidence_level_metrics;\n }", "private function getStudentCountByRiskLevel()\n {\n $studentCountByRiskLevelArray = [\n 0 => [\n 'risk_level' => 1,\n 'count' => 601,\n 'risk_text' => 'red2',\n 'image_name' => 'risk-level-icon-r2.png',\n 'color_hex' => '#c70009'\n ],\n 1 => [\n 'risk_level' => 2,\n 'count' => 774,\n 'risk_text' => 'red',\n 'image_name' => 'risk-level-icon-r1.png',\n 'color_hex' => '#f72d35'\n ],\n 2 => [\n 'risk_level' => 3,\n 'count' => 617,\n 'risk_text' => 'yellow',\n 'image_name' => 'risk-level-icon-y.png',\n 'color_hex' => '#fec82a'\n ],\n 3 => [\n 'risk_level' => 4,\n 'count' => 5717,\n 'risk_text' => 'green',\n 'image_name' => 'risk-level-icon-g.png',\n 'color_hex' => '#95cd3c'\n ],\n 4 => [\n 'risk_level' => 6,\n 'count' => 59,\n 'risk_text' => 'gray',\n 'image_name' => 'risk-level-icon-gray.png',\n 'color_hex' => '#cccccc'\n ]\n ];\n return $studentCountByRiskLevelArray;\n }", "public function getLevel()\r\n {\r\n return $this->get(self::_LEVEL);\r\n }", "public function getRiskAnalysis()\n {\n return $this->risk_analysis;\n }", "public function getRisk() {\n return $this->getFieldFromDescription('risk');\n }", "public function getLevel() {\n return intval($this->level);\n }", "public function getLevel()\n {\n return $this->getGame()->calculateLevel($this);\n }", "public function getRegionLevel()\n {\n return $this->region_level;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a new node to the left of the supplied focusNode
function insertSibling($focusNode, $extrafields) { $siblingNode[$this->left_column_name] = $focusNode[$this->left_column_name]; $siblingNode[$this->right_column_name] = $focusNode[$this->left_column_name]+1; $this->_modifyNode($siblingNode[$this->left_column_name], 2); $this->_setNewNode($siblingNode, $extrafields); $siblingNode = array_merge($siblingNode, $extrafields); return $siblingNode; }
[ "public function AddLeftChildNode(ExpressionTreeNode $node)\n {\n parent::AddLeftChildNode($node);\n }", "public function moveLeft(): Node\n {\n return $this->moveToLeftOf($this->getLeftSibling());\n }", "public function moveToLeftOf($node);", "protected function insertLeft(){\n\t\t$parentInfo = $this->getNodeInfo($this->_parent);\n\t\t$parentLeft = $parentInfo['lft'];\n\t\t\n\t\t$bind\t\t= array(\"lft\"\t\t=> new Zend_db_Expr('lft + 2'));\n\t\t$where\t\t= 'lft >= '. $parentLeft;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt + 2'));\n\t\t$where\t\t= 'rgt >= '. ($parentLeft + 1);\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$data = $this->_data;\t\t\n\t\t$data['parents']\t= $this->_parent;\n\t\t$data['lft'] \t\t= $parentLeft + 1;\n\t\t$data['rgt'] \t\t= $parentLeft + 2;\n\t\t$data['level'] \t\t= $parentInfo['level'] + 1;\n\t\t\n\t\t$this->_db->insert($this->_name,$data);\n\t}", "public function moveToLeftOf($node) {\n return $this->moveTo($node, 'left');\n }", "public function moveLeft() {\n return $this->moveToLeftOf($this->getLeftSibling());\n }", "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "function moveLeft()\n {\n $this->position--;\n if ($this->position < 0) {\n $this->position++;\n array_unshift($this->line, '_');\n }\n }", "public function setLeftValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'left');\n return $node->$setter($value);\n }", "public function insertBefore (DOMNode $newnode, DOMNode $refnode = null) {}", "protected function moveLeft()\n {\n\n $infoMoveNode = $this->getNodeInfo($this->_id);\n\n $lftMoveNode = $infoMoveNode['lft'];\n $rgtMoveNode = $infoMoveNode['rgt'];\n $widthMoveNode = $this->widthNode($lftMoveNode, $rgtMoveNode);\n\n $sqlReset = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t SET rgt = (rgt - ' . $rgtMoveNode . '),\n\t\t\t\t\t \t lft = (lft - ' . $lftMoveNode . ')\n\t\t\t\t\t WHERE lft BETWEEN ' . $lftMoveNode . ' AND ' . $rgtMoveNode;\n $this->execute($sqlReset);\n\n $slqUpdateRight = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t\t SET rgt = (rgt - ' . $widthMoveNode . ')\n\t\t\t\t\t\t\tWHERE rgt > ' . $rgtMoveNode;\n $this->execute($slqUpdateRight);\n\n $slqUpdateLeft = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t\t SET lft = (lft - ' . $widthMoveNode . ')\n\t\t\t\t\t\t WHERE lft > ' . $rgtMoveNode;\n $this->execute($slqUpdateLeft);\n\n $infoParentNode = $this->getNodeInfo($this->_parent);\n $lftParentNode = $infoParentNode['lft'];\n\n $slqUpdateLeft = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t\t SET lft = (lft + ' . $widthMoveNode . ')\n\t\t\t\t\t\t WHERE lft > ' . $lftParentNode . '\n\t\t\t\t\t\t AND rgt > 0\n\t\t\t\t\t\t ';\n $this->execute($slqUpdateLeft);\n\n $slqUpdateRight = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t\t SET rgt = (rgt + ' . $widthMoveNode . ')\n\t\t\t\t\t\t\tWHERE rgt > ' . $lftParentNode;\n $this->execute($slqUpdateRight);\n\n $levelMoveNode = $infoMoveNode['level'];\n $levelParentNode = $infoParentNode['level'];\n $newLevelMoveNode = $levelParentNode + 1;\n\n $slqUpdateLevel = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t\t SET level = (level - ' . $levelMoveNode . ' + ' . $newLevelMoveNode .\n ')\n\t\t\t\t\t\t WHERE rgt <= 0';\n $this->execute($slqUpdateLevel);\n\n\n $newParent = $infoParentNode['id'];\n $newLeft = $infoParentNode['lft'] + 1;\n $newRight = $infoParentNode['lft'] + $widthMoveNode;\n $slqUpdateParent = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t\t SET parents = ' . $newParent . ',\n\t\t\t\t\t\t lft = ' . $newLeft . ',\n\t\t\t\t\t\t \t rgt = ' . $newRight . '\n\t\t\t\t\t\t WHERE id = ' . $this->_id;\n $this->execute($slqUpdateParent);\n\n\n $slqUpdateNode = 'UPDATE ' . $this->_table . '\n\t\t\t\t\t\t SET rgt = (rgt + ' . $newRight . '),\n\t\t\t\t\t\t \t lft = (lft + ' . $newLeft . ')\n\t\t\t\t\t\t WHERE rgt <0';\n $this->execute($slqUpdateNode);\n\n return true;\n }", "public function moveNodeBeforeNode(Tx_PtExtbase_Tree_Node $nodeToBeMoved, Tx_PtExtbase_Tree_Node $nodeToMoveBefore);", "public function moveBefore($node)\n {\n return $this->moveTo($node, 'left');\n }", "public function left($offset = 0): self\n {\n $this->left = $offset;\n $this->right = null;\n\n return $this;\n }", "function MoveCursorLeftBlock($expandSelection){}", "public function setLeft($val) {\n\t\t$this->__left = $val;\n\t}", "protected function moveLeft()\n {\n if (!$this->keyExists($this->row, $this->column - 1)) {\n return;\n }\n\n $this->column--;\n }", "public function setXPaddingLeft($left)\n {\n $this->ensureXPadding();\n $this->data['x']['padding']['left'] = $left;\n }", "public function insertAsFirstChildOf(\\App\\DomainObject\\Node $node);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update illness model with the following id and data.
public function update($id , $data) { // }
[ "public function update($id, $data) {\n\t\t$this->assureAllowed('update');\n // Validation\n V::intVal()->check($id);\n V::objectType()\n ->attribute('name', V::alnum('_-.')->length(1, 50))\n ->attribute('location', V::stringType()->length(0, 255))\n ->attribute('division', V::intVal())\n ->attribute('server_endpoint_mode', V::intVal()->between(0, 1))\n ->attribute('network_ip_mode', V::intVal()->between(0, 2))\n ->attribute('network_mac_mode', V::intVal()->between(0, 1))\n ->attribute('proxy_mode', V::intVal()->between(0, 1))\n ->attribute('update_interval', V::optional(V::intVal()->between(1, 60)))\n ->attribute('service_network', V::optional(V::regex('/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/(?:30|2[0-9]|1[0-9]|[1-9]?)$/')))\n ->attribute('firmware', V::optional(V::intVal()))\n ->attribute('services', V::arrayVal()->each(V::objectType()\n ->attribute('service', V::intVal())\n ->attribute('revision')\n ))->check($data);\n // Persistence\n $em = $this->getEntityManager();\n\t\t$sensor = $em->getRepository('HoneySens\\app\\models\\entities\\Sensor')->find($id);\n V::objectType()->check($sensor);\n $sensor->setName($data->name);\n $sensor->setLocation($data->location);\n // TODO Move this sensor's events to the new Division, too\n $division = $em->getRepository('HoneySens\\app\\models\\entities\\Division')->find($data->division);\n V::objectType()->check($division);\n $sensor->setDivision($division);\n $sensor->setServerEndpointMode($data->server_endpoint_mode);\n if($sensor->getServerEndpointMode() == Sensor::SERVER_ENDPOINT_MODE_CUSTOM) {\n V::attribute('server_endpoint_host', V::stringType()->ip())\n ->attribute('server_endpoint_port_https', V::intVal()->between(0, 65535))\n ->check($data);\n $sensor->setServerEndpointHost($data->server_endpoint_host)\n ->setServerEndpointPortHTTPS($data->server_endpoint_port_https);\n } else {\n $sensor->setServerEndpointHost(null)\n ->setServerEndpointPortHTTPS(null);\n }\n $sensor->setNetworkIPMode($data->network_ip_mode);\n if($sensor->getNetworkIPMode() == Sensor::NETWORK_IP_MODE_STATIC) {\n V::attribute('network_ip_address', V::stringType()->ip())\n ->attribute('network_ip_netmask', V::stringType()->ip())\n ->attribute('network_ip_gateway', V::optional(V::stringType()->ip()))\n ->attribute('network_ip_dns', V::optional(V::stringType()->ip()))\n ->check($data);\n $sensor->setNetworkIPAddress($data->network_ip_address)\n ->setNetworkIPNetmask($data->network_ip_netmask)\n ->setNetworkIPGateway($data->network_ip_gateway)\n ->setNetworkIPDNS($data->network_ip_dns);\n } else {\n $sensor->setNetworkIPAddress(null)\n ->setNetworkIPNetmask(null)\n ->setNetworkIPGateway(null)\n ->setNetworkIPDNS(null);\n }\n $sensor->setNetworkMACMode($data->network_mac_mode);\n if($sensor->getNetworkMACMode() == Sensor::NETWORK_MAC_MODE_CUSTOM) {\n V::attribute('network_mac_address', V::stringType()->macAddress())\n ->check($data);\n $sensor->setNetworkMACAddress($data->network_mac_address);\n } else {\n $sensor->setNetworkMACAddress(null);\n }\n $sensor->setProxyMode($data->proxy_mode);\n if($sensor->getProxyMode() == Sensor::PROXY_MODE_ENABLED) {\n V::attribute('proxy_host', V::stringType())\n ->attribute('proxy_port', V::intVal()->between(0, 65535))\n ->attribute('proxy_user', V::optional(V::stringType()))\n ->check($data);\n $sensor->setProxyHost($data->proxy_host)\n ->setProxyPort($data->proxy_port);\n if(strlen($data->proxy_user) > 0) {\n $sensor->setProxyUser($data->proxy_user);\n // Only change the password if one was explicitly submitted\n if(V::attribute('proxy_password', V::stringType())->validate($data)) {\n $sensor->setProxyPassword($data->proxy_password);\n }\n } else {\n $sensor->setProxyUser(null);\n $sensor->setProxyPassword(null);\n }\n } else {\n $sensor->setProxyHost(null)\n ->setProxyPort(null)\n ->setProxyUser(null)\n ->setProxyPassword(null);\n }\n $firmware = null;\n if($data->firmware != null) {\n $firmware = $em->getRepository('HoneySens\\app\\models\\entities\\Firmware')->find($data->firmware);\n V::objectType()->check($firmware);\n }\n $sensor->setFirmware($firmware);\n $sensor->setUpdateInterval($data->update_interval);\n $sensor->setServiceNetwork($data->service_network);\n // Service handling, merge with existing data\n $serviceRepository = $em->getRepository('HoneySens\\app\\models\\entities\\Service');\n $revisionRepository = $em->getRepository('HoneySens\\app\\models\\entities\\ServiceRevision');\n // Clone the collection into an array so that newly added models won't interfere with the removal process\n $assignments = $sensor->getServices()->toArray();\n // Add/Update of service assignments\n $handledAssignments = array();\n foreach($data->services as $serviceAssignment) {\n $assigned = false;\n // Validate availability of the assignment\n $service = $serviceRepository->find($serviceAssignment->service);\n V::objectType()->check($service);\n $revision = $serviceAssignment->revision == null ? null : $revisionRepository->find($serviceAssignment->revision);\n // TODO Check if revision belongs to service\n // Update existing assignment\n foreach($assignments as $assignment) {\n if($assignment->getService()->getId() == $service->getId()) {\n $assigned = true;\n $handledAssignments[] = $assignment;\n $assignment->setRevision($revision);\n }\n }\n // Add so far unassigned services\n if(!$assigned) {\n $newAssignment = new ServiceAssignment();\n $sensor->addService($newAssignment);\n $service->addAssignment($newAssignment);\n $newAssignment->setRevision($revision);\n $em->persist($newAssignment);\n }\n }\n // Deletion of remaining service assignments\n foreach(array_udiff($assignments, $handledAssignments, function($a, $b) {return strcmp(spl_object_hash($a), spl_object_hash($b));}) as $deletionCandidate) {\n $deletionCandidate->getSensor()->removeService($deletionCandidate);\n $deletionCandidate->getService()->removeAssignment($deletionCandidate);\n $deletionCandidate->setRevision(null);\n $em->remove($deletionCandidate);\n }\n\t\t$em->flush();\n // Regenerate sensor config\n // TODO only do that on config changes\n $this->getServiceManager()->get(ServiceManager::SERVICE_BEANSTALK)->putSensorConfigCreationJob($sensor, $em);\n return $sensor;\n\t}", "public function updatePatientOtherIllness($patient_id, $illness_id)\r\n {\r\n // patient_id illness_id\r\n $input = Request::all();\r\n $updatedpatientIllness = PatientIllnessOther::findOrFail($illness_id);\r\n $updatedpatientIllness->update([ 'patient_id'=>$input['patient_id'], 'other_illness'=>$input['other_illness']]);\r\n if($updatedpatientIllness->save()){\r\n return response()->json(['msg' => 'Updated Illness','data'=> $updatedpatientIllness]);\r\n }else{\r\n return response(\"there seems to have been a problem while updating\");\r\n }\r\n\r\n }", "public function update($data)\n {\n $this->db->where('id',$data['id']);\n return $this->db->update('prediction',$data);\n }", "public function update($id, $data) {\n\t\t$this->assureAllowed('update');\n // Validation\n V::intVal()->check($id);\n V::objectType()\n ->attribute('name', V::alnum('_-.')->length(1, 50))\n ->attribute('location', V::stringType()->length(0, 255))\n ->attribute('division', V::intVal())\n ->attribute('config', V::optional(V::intVal()))\n ->attribute('server_endpoint_mode', V::intVal()->between(0, 1))\n ->attribute('network_ip_mode', V::intVal()->between(0, 1))\n ->attribute('network_mac_mode', V::intVal()->between(0, 1))\n ->attribute('proxy_mode', V::intVal()->between(0, 1))\n ->attribute('services', V::arrayVal()->each(V::objectType()\n ->attribute('service', V::intVal())\n ->attribute('revision')\n ))->check($data);\n // Persistence\n $em = $this->getEntityManager();\n\t\t$sensor = $em->getRepository('HoneySens\\app\\models\\entities\\Sensor')->find($id);\n V::objectType()->check($sensor);\n $sensor->setName($data->name);\n $sensor->setLocation($data->location);\n // TODO Move this sensor's events to the new Division, too\n $division = $em->getRepository('HoneySens\\app\\models\\entities\\Division')->find($data->division);\n V::objectType()->check($division);\n $sensor->setDivision($division);\n // TODO config update handling within the frontend\n if(V::intVal()->validate($data->config)) {\n $config = $em->getRepository('HoneySens\\app\\models\\entities\\SensorConfig')->find($data->config);\n $config->addSensor($sensor);\n }\n $sensor->setServerEndpointMode($data->server_endpoint_mode);\n if($sensor->getServerEndpointMode() == Sensor::SERVER_ENDPOINT_MODE_CUSTOM) {\n V::attribute('server_endpoint_host', V::stringType()->ip())\n ->attribute('server_endpoint_port_https', V::intVal()->between(0, 65535))\n ->check($data);\n $sensor->setServerEndpointHost($data->server_endpoint_host)\n ->setServerEndpointPortHTTPS($data->server_endpoint_port_https);\n } else {\n $sensor->setServerEndpointHost(null)\n ->setServerEndpointPortHTTPS(null);\n }\n $sensor->setNetworkIPMode($data->network_ip_mode);\n if($sensor->getNetworkIPMode() == Sensor::NETWORK_IP_MODE_STATIC) {\n V::attribute('network_ip_address', V::stringType()->ip())\n ->attribute('network_ip_netmask', V::stringType()->ip())\n ->attribute('network_ip_gateway', V::optional(V::stringType()->ip()))\n ->attribute('network_ip_dns', V::optional(V::stringType()->ip()))\n ->check($data);\n $sensor->setNetworkIPAddress($data->network_ip_address)\n ->setNetworkIPNetmask($data->network_ip_netmask)\n ->setNetworkIPGateway($data->network_ip_gateway)\n ->setNetworkIPDNS($data->network_ip_dns);\n } else {\n $sensor->setNetworkIPAddress(null)\n ->setNetworkIPNetmask(null)\n ->setNetworkIPGateway(null)\n ->setNetworkIPDNS(null);\n }\n $sensor->setNetworkMACMode($data->network_mac_mode);\n if($sensor->getNetworkMACMode() == Sensor::NETWORK_MAC_MODE_CUSTOM) {\n V::attribute('network_mac_address', V::stringType()->macAddress())\n ->check($data);\n $sensor->setNetworkMACAddress($data->network_mac_address);\n } else {\n $sensor->setNetworkMACAddress(null);\n }\n $sensor->setProxyMode($data->proxy_mode);\n if($sensor->getProxyMode() == Sensor::PROXY_MODE_ENABLED) {\n V::attribute('proxy_host', V::stringType())\n ->attribute('proxy_port', V::intVal()->between(0, 65535))\n ->attribute('proxy_user', V::stringType())\n ->check($data);\n $sensor->setProxyHost($data->proxy_host)\n ->setProxyPort($data->proxy_port)\n ->setProxyUser($data->proxy_user);\n // Only change the password if one was explicity submitted\n if(V::attribute('proxy_password', V::stringType())->validate($data)) {\n $sensor->setProxyPassword($data->proxy_password);\n }\n if($data->proxy_user == null) {\n $sensor->setProxyPassword(null);\n }\n } else {\n $sensor->setProxyHost(null)\n ->setProxyPort(null)\n ->setProxyUser(null)\n ->setProxyPassword(null);\n }\n // Service handling, merge with existing data\n $serviceRepository = $em->getRepository('HoneySens\\app\\models\\entities\\Service');\n $revisionRepository = $em->getRepository('HoneySens\\app\\models\\entities\\ServiceRevision');\n $assignments = $sensor->getServices()->toArray(); // clone the collection into an array so that newly added models won't interfere with the removal process\n // Add/Update of service assignments\n $handledAssignments = array();\n foreach($data->services as $serviceAssignment) {\n $assigned = false;\n // Validate availability of the assignment\n $service = $serviceRepository->find($serviceAssignment->service);\n V::objectType()->check($service);\n $revision = $serviceAssignment->revision == null ? null : $revisionRepository->find($serviceAssignment->revision);\n // TODO Check if revision belongs to service\n // Update existing assignment if the revision changed\n foreach($assignments as $assignment) {\n if($assignment->getService() == $service ) {\n $assigned = true;\n $handledAssignments[] = $assignment;\n if($assignment->getRevision() != $revision) {\n $assignment->getService()->setRevision($revision);\n }\n }\n }\n // Add so far unassigned services\n if(!$assigned) {\n $newAssignment = new ServiceAssignment();\n $sensor->addService($newAssignment);\n $service->addAssignment($newAssignment);\n $newAssignment->setRevision($revision);\n $em->persist($newAssignment);\n }\n }\n // Deletion of remaining service assignments\n foreach(array_udiff($assignments, $handledAssignments, function($a, $b) {return $a === $b;}) as $deletionCandidate) {\n $deletionCandidate->getSensor()->removeService($deletionCandidate);\n $deletionCandidate->getService()->removeAssignment($deletionCandidate);\n $deletionCandidate->setRevision(null);\n $em->remove($deletionCandidate);\n }\n\t\t$em->flush();\n // Regenerate sensor config\n // TODO only do that on config changes\n $this->getBeanstalkService()->putSensorConfigCreationJob($sensor, $em);\n return $sensor;\n\t}", "public function update($id, $data) {\n \n //print_r($data); exit;\n $this->db->where('id', $id);\n $this->db->update('ad_s', $data);\n }", "public function update($id){\n $req_u = request()->all();\n //验证\n $verify = $this->verify($req_u,$id);\n if($verify) return $verify;\n $rgba = turnInt($req_u['r'],$req_u['g'],$req_u['b'],$req_u['a']);\n try{\n DB::beginTransaction();\n $lineMaterial = PosterHoleLineMaterialDefine::where(IekModel::ID,$id)\n ->update([\n IekModel::NAME => $req_u['name'],\n IekModel::DESC => $req_u['des'],\n IekModel::MATERIAL_ID => $req_u['materialId'],\n IekModel::CATEGORY_ID => $req_u['categoryId'],\n IekModel::FACADE_ID => $req_u['facadeId'],\n IekModel::FACADE_ID => $req_u['facadeId'],\n IekModel::PHY_DEPTH => $req_u['phyDepth'],\n IekModel::PHY_HEIGHT => $req_u['phyHeight'],\n IekModel::CONTENT_DEPTH => $req_u['phyContentDepth'],\n IekModel::PRESS_HEIGHT => $req_u['phyPressHeight'],\n IekModel::PRESS_DEPTH => $req_u['phyPressDepth'],\n IekModel::PRESS_OFFSET => $req_u['phyPressOffset'],\n IekModel::SLOT_HEIGHT => $req_u['phySlotHeight'],\n IekModel::SLOT_DEPTH => $req_u['phySlotDepth'],\n IekModel::SLOT_OFFSET => $req_u['phySlotOffset'],\n IekModel::COLOR_NAME => $req_u['colorName'],\n IekModel::RGBA => $rgba,\n IekModel::PRICE => $req_u['price'],\n IekModel::PRICE_UNIT => $req_u['priceUnit'],\n IekModel::CURRENCY => $req_u['currency'],\n ]);\n DB::commit();\n }catch (\\Exception $e){\n DB::rollBack();\n $err = new Error();\n $err->setError(Errors::UNKNOWN_ERROR);\n $err->setMessage($e->getMessage());\n return response()->json($err);\n }\n return $this->curd(Errors::OK,Errors::FAILED,\"修改成功\",\"修改失败\",$lineMaterial);\n }", "public function updateOne($data)\n {\n }", "abstract protected function updateModel();", "public function actionHuinongupdate($id)\n {\n $model = $this->findModel($id);\n\t\tif ($model->load(Yii::$app->request->post())) {\n//\t\t\tif(Yii::$app->request->post('goodseed'))\n//\t\t\t\t$model->typeid = Yii::$app->request->post('goodseed');\n\t\t\tif(Yii::$app->request->post('plant'))\n\t\t\t\t$model->typeid = Yii::$app->request->post('plant');\n\t\t\t$model->create_at = time();\n\t\t\t$model->update_at = $model->create_at;\n\t\t\t$model->year = (string)$model->year;\n//\t\t\tif(Yii::$app->request->post('goodseed'))\n//\t\t\t\t$model->totalsubsidiesarea = sprintf(\"%.2f\", Plantingstructurecheck::find()->where(['goodseed_id'=>$model->typeid,'year'=>$model->year])->sum('area'));\n\t\t\tif(Yii::$app->request->post('plant'))\n\t\t\t\t$model->totalsubsidiesarea = sprintf(\"%.2f\", Plantingstructurecheck::find()->where(['plant_id'=>$model->typeid,'year'=>$model->year])->sum('area'));\n//\t\t\tif(Yii::$app->request->post('goodseed'))\n//\t\t\t\t$model->totalamount = sprintf(\"%.2f\", Plantingstructurecheck::find()->where(['goodseed_id'=>$model->typeid,'year'=>$model->year])->sum('area')*$model->subsidiesmoney);\n\t\t\tif(Yii::$app->request->post('plant'))\n\t\t\t\t$model->totalamount = Plantingstructurecheck::find()->where(['plant_id'=>$model->typeid,'year'=>$model->year])->sum('area')*$model->subsidiesmoney;\n\t\t\t$model->save();\n//\t\t\tif($model->save()) {\n////\t\t\t\tvar_dump($model);exit;\n//\t\t\t\tif(Yii::$app->request->post('goodseed'))\n//\t\t\t\t\t$plantingsructure = Plantingstructurecheck::find()->andFilterWhere(['goodseed_id'=>$model->typeid,'year'=>$model->year])->all();\n//\t\t\t\tif(Yii::$app->request->post('plant'))\n//\t\t\t\t\t$plantingsructure = Plantingstructurecheck::find()->andFilterWhere(['plant_id'=>$model->typeid,'year'=>$model->year])->all();\n//\n//// \t\tforeach ($plantingsructure as $val) {\n//// \t\t\t$temp = new Tempprogress();\n//// \t\t\t$temp->id = $val['id'];\n//// \t\t\t$temp->save();\n//// \t\t}\n////\t\t\t\tvar_dump($model);\n////\t\t\t\tvar_dump($plantingsructure);exit;\n//\t\t\t\tforeach ($plantingsructure as $value) {\n//\t\t\t\t\t$huinongascription = Lease::getHuinonginfo($value['lease_id']);\n////\t\t\t\t\tvar_dump($huinongascription);\n//\t\t\t\t\tif($huinongascription) {\n//\t\t\t\t\t\t$plant = Plant::findOne($model->typeid);\n//\t\t\t\t\t\t$bfb = ['farmer' => 0, 'lessee' => 0];\n//\t\t\t\t\t\tswitch ($plant->typename) {\n//\t\t\t\t\t\t\tcase '大豆':\n//\t\t\t\t\t\t\t\t$bfb['farmer'] = Lease::getBFBnumber($huinongascription['farmer']['ddcj']);\n//\t\t\t\t\t\t\t\t$bfb['lessee'] = Lease::getBFBnumber($huinongascription['lessee']['ddcj']);\n//\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\tcase '玉米':\n//\t\t\t\t\t\t\t\t$bfb['farmer'] = Lease::getBFBnumber($huinongascription['farmer']['ymcj']);\n//\t\t\t\t\t\t\t\t$bfb['lessee'] = Lease::getBFBnumber($huinongascription['lessee']['ymcj']);\n//\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tvar_dump($bfb);\n//\t\t\t\t\t\tif (bccomp($bfb['farmer'], 0) == 1) {\n//\t\t\t\t\t\t\t$huinonggrantModel = Huinonggrant::find()->where(['farms_id' => $value['farms_id'], 'lease_id' => 0, 'huinong_id' => $model->id, 'typeid' => $model->typeid])->one();\n//\t\t\t\t\t\t\tif (empty($huinonggrantModel)) {\n//\t\t\t\t\t\t\t\t$huinonggrantModel = new Huinonggrant();\n//\t\t\t\t\t\t\t\t$huinonggrantModel->create_at = time();\n//\t\t\t\t\t\t\t\t$huinonggrantModel->update_at = $huinonggrantModel->create_at;\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\t$huinonggrantModel->update_at = time();\n//\t\t\t\t\t\t\t}\n//\n//\t\t\t\t\t\t\t$huinonggrantModel->farms_id = $value['farms_id'];\n//\t\t\t\t\t\t\t$huinonggrantModel->management_area = $value['management_area'];\n//\t\t\t\t\t\t\t$huinonggrantModel->huinong_id = $model->id;\n//\t\t\t\t\t\t\t$huinonggrantModel->subsidiestype_id = $model->subsidiestype_id;\n//\t\t\t\t\t\t\t$huinonggrantModel->typeid = $model->typeid;\n//\t\t\t\t\t\t\t$huinonggrantModel->lease_id = 0;\n//\t\t\t\t\t\t\t$huinonggrantModel->money = $model->subsidiesarea * 0.01 * $value['area'] * $model->subsidiesmoney * ($bfb['farmer'] / 100);\n//\t\t\t\t\t\t\t$huinonggrantModel->area = $value['area'];\n//\t\t\t\t\t\t\t$huinonggrantModel->state = 0;\n//\t\t\t\t\t\t\t$huinonggrantModel->issubmit = 0;\n//\t\t\t\t\t\t\t$huinonggrantModel->subsidyobject = Farms::find()->where(['id'=>$value['farms_id']])->one()['farmername'];\n//\t\t\t\t\t\t\t$huinonggrantModel->proportion = $bfb['farmer'].'%';\n//\t\t\t\t\t\t\t$huinonggrantModel->year = $model->year;\n//\t\t\t\t\t\t\t$huinonggrantModel->save();\n//\t\t\t\t\t\t\tvar_dump($huinonggrantModel->getErrors());\n//\t\t\t\t\t\t\tLogs::writeLogs('建立所有符合条件用户数据', $huinonggrantModel);\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tif (bccomp($bfb['lessee'], 0) == 1) {\n//\t\t\t\t\t\t\t$huinonggrantModel = Huinonggrant::find()->where(['farms_id' => $value['farms_id'], 'lease_id' => $value['lease_id'], 'huinong_id' => $model->id, 'typeid' => $model->typeid])->one();\n//\t\t\t\t\t\t\tif (empty($huinonggrantModel)) {\n//\t\t\t\t\t\t\t\t$huinonggrantModel = new Huinonggrant();\n//\t\t\t\t\t\t\t\t$huinonggrantModel->create_at = time();\n//\t\t\t\t\t\t\t\t$huinonggrantModel->update_at = $huinonggrantModel->create_at;\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\t$huinonggrantModel->update_at = time();\n//\t\t\t\t\t\t\t}\n//\n//\t\t\t\t\t\t\t$huinonggrantModel->farms_id = $value['farms_id'];\n//\t\t\t\t\t\t\t$huinonggrantModel->management_area = $value['management_area'];\n//\t\t\t\t\t\t\t$huinonggrantModel->huinong_id = $model->id;\n//\t\t\t\t\t\t\t$huinonggrantModel->subsidiestype_id = $model->subsidiestype_id;\n//\t\t\t\t\t\t\t$huinonggrantModel->typeid = $model->typeid;\n//\t\t\t\t\t\t\t$huinonggrantModel->lease_id = $value['lease_id'];\n//\t\t\t\t\t\t\t$huinonggrantModel->money = $model->subsidiesarea * 0.01 * $value['area'] * $model->subsidiesmoney * ($bfb['lessee'] / 100);\n//\t\t\t\t\t\t\t$huinonggrantModel->area = $value['area'];\n//\t\t\t\t\t\t\t$huinonggrantModel->state = 0;\n//\t\t\t\t\t\t\t$huinonggrantModel->issubmit = 0;\n//\t\t\t\t\t\t\t$huinonggrantModel->subsidyobject = Lease::find()->where(['id'=>$value['lease_id']])->one()['lessee'];\n//\t\t\t\t\t\t\t$huinonggrantModel->proportion = $bfb['lessee'].'%';\n//\t\t\t\t\t\t\t$huinonggrantModel->year = $model->year;\n//\t\t\t\t\t\t\t$huinonggrantModel->save();\n//\t\t\t\t\t\t\tLogs::writeLogs('建立所有符合条件用户数据', $huinonggrantModel);\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\texit;\n\t\t\tLogs::writeLogs('更新惠农政策',$model);\n\t\t\treturn $this->redirect(['huinongindex']);\n\t\t} else {\n\t\t\treturn $this->render('huinongcreate', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n }", "public function updateMinistryHead($id,$data){\n $this->db->where('ministry_head_id',$id);\n $qry=$this->db->update('ministry_heads_tbl',$data);\n if($qry){return true;}\n else{return false;}\n }", "function updateData($data,$id)\n\t{\n\t\tdbIdReport('update','update Permision',json_encode($data), 10);\n\t\t$this->db->where('permit_id', $id);\n\t\t$this->db->update($this->table, $data);\n\t\t$str = $this->db->last_query();\t\n\t\tlogConfig(\"update Permision:$str\",'logDB');\n\t\t\n\t}", "public function updateExisting($id, $data)\n {\n // Make sure we have a valid model instance\n $updated = $this->findById($id);\n\n if ($updated instanceof $this->model) {\n // Get the fillable fields for the model from the request data\n $fillableFields = $this->getFillableFieldsArray($data);\n\n foreach ($fillableFields as $key => $value) {\n // If the field value is different than the stored value, update it\n if ($updated->$key != $value) {\n $updated->$key = $value;\n }\n }\n // Save the updated model\n $updated->save();\n }\n\n // Return the updated model or the ModelNotFoundException\n return $updated;\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $mdlmain = new InvtMain();\n\n\t\t Yii::$app->view->title = 'ปรับปรุงรายการ '.$model::fn()['name'].': ' . $model->ir_id.' - '. $this->moduletitle;\n\t\t \n if ($model->load(Yii::$app->request->post())) {\n\t\t\tif($model->save()){\n AdzpireComponent::succalert('edtflsh', 'ปรับปรุงรายการเรียบร้อย');\n\t\t\t return $this->redirect(['update', 'id' => $model->ir_id]);\n\t\t\t}else{\n AdzpireComponent::dangalert('edtflsh', 'ปรับปรุงรายการไม่ได้');\n\t\t\t}\n print_r($model->getErrors());\n exit;\n }else{\n $qstaff = Person::getPersonList();\n\n $searchModel = new InvtRepairDetailSearch(['ird_irID' => $model->ir_id]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->sort = false;\n\n return $this->render('update', [\n 'model' => $model,\n 'mdlmain' => $mdlmain,\n 'staff' => $qstaff,\n 'dataProvider' => $dataProvider,\n ]);\n }\n\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelsDnsDetail = $model->krsdnsDetails;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n $oldIDs = ArrayHelper::map($modelsDnsDetail, 'id', 'id');\n $modelsDnsDetail1 = Model::createMultiple(KrsdnsDetail::classname(), $modelsDnsDetail);\n Model::loadMultiple($modelsDnsDetail, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelsDnsDetail1, 'id', 'id'))); \n \n // validate all models\n $valid1 = $model->validate();\n $valid = Model::validateMultiple($modelsDnsDetail) && $valid1;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if (! empty($deletedIDs)) {\n KrsdnsDetail::deleteAll(['id' => $deletedIDs]);\n } \n if ($flag = $model->save(false)) {\n foreach ($modelsDnsDetail as $modelKrsDetail) {\n $modelKrsDetail->krsdns_id = $model->id;\n $modelKrsDetail->scenario = 'update';\n if (! ($flag = $modelKrsDetail->save())) { \n $transaction->rollBack();\n // break;\n return $this->render('update', [\n 'model' => $model,\n 'modelsDnsDetail' => (empty($modelsDnsDetail)) ? [new KrsdnsDetail] : $modelsDnsDetail\n ]); \n }\n }\n } \n \n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n } \n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelsDnsDetail' => (empty($modelsDnsDetail)) ? [new KrsdnsDetail] : $modelsDnsDetail\n ]);\n }\n }", "public function update($id, $data) {\n\t\t$this->assureAllowed('update');\n // Validation\n V::intVal()->check($id);\n // Only allow admin users to change the system-wide default configuration\n if($id == 1 and $_SESSION['user']['role'] != User::ROLE_ADMIN) throw new ForbiddenException();\n V::objectType()\n ->attribute('interval', V::intVal()->between(1, 200))\n ->attribute('recon', V::boolVal())\n ->attribute('kippoHoneypot', V::boolVal())\n ->attribute('dionaeaHoneypot', V::boolVal())\n ->attribute('image', V::optional(V::intVal()))\n ->check($data);\n\t\t$config = $this->getEntityManager()->getRepository('HoneySens\\app\\models\\entities\\SensorConfig')->find($id);\n V::objectType()->check($config);\n $config->setUpdateInterval($data->interval);\n $config->setRecon($data->recon);\n $config->setKippoHoneypot($data->kippoHoneypot);\n $config->setDionaeaHoneypot($data->dionaeaHoneypot);\n if(V::intVal()->not(V::equals(0))->validate($data->image)) {\n\t\t\t$image = $this->getEntityManager()->getRepository('HoneySens\\app\\models\\entities\\SensorImage')->find($data->image);\n V::objectType()->check($image);\n\t\t\t$config->setImage($image);\n\t\t} else {\n // Never reset the default image\n if($id != 1) $config->setImage(null);\n }\n\t\t$this->getEntityManager()->flush();\n return $config;\n\t}", "public function update_welfarefee($data ,$id)\n {\n $this->db->where('id' , $id);\n $this->db->update('welfarefee', $data );\n }", "public function actionUpdate($id)\n {\n if (!isset($id) || !is_numeric($id)) {\n Yii::$app->session->addFlash('danger', Module::t('modules/finance/app', \"The RCN for which the process was requested cound not be found.\"));\n return $this->redirect(['/finance/finance-kaewithdrawal/index']);\n }\n\n $model = $this->findModel($id);\n $model->kaewithdr_amount = Money::toCurrency($model->kaewithdr_amount);\n //echo \"<pre>\"; var_dump($model); echo \"</pre>\"; die();\n $kaeCredit = FinanceKaecredit::findOne(['kaecredit_id' => $model->kaecredit_id]);\n $kaeCreditSumPercentage = FinanceKaecreditpercentage::getKaeCreditSumPercentage($kaeCredit->kaecredit_id);\n $kae = FinanceKae::findOne(['kae_id' => $kaeCredit->kae_id]);\n $kaeWithdrwals = FinanceKaewithdrawal::find()->where(['kaecredit_id' => $model->kaecredit_id])->all();\n\n if ($model->load(Yii::$app->request->post())) {\n try {\n if (Money::toCents($model->kaewithdr_amount) < FinanceExpendwithdrawal::getExpendituresSum($id)) { \n throw new Exception();\n }\n $oldModel = $this->findModel($id);\n $available = ($kaeCredit->kaecredit_amount)*Money::toPercentage($kaeCreditSumPercentage, false);\n $balance = $available - FinanceKaewithdrawal::getWithdrawsSum($kaeCredit->kaecredit_id);\n $model->kaewithdr_amount = Money::toCents($model->kaewithdr_amount);\n $newBalance = $balance - $oldModel->kaewithdr_amount + $model->kaewithdr_amount;\n\n if ($newBalance < 0) {\n throw new Exception(Module::t('modules/finance/app', \"Failure in currying out the RCN withdrawal. Please check the validity of the withdraw amount or contact with the administrator.\"));\n }\n\n if (!$model->save()) {\n throw new Exception(Module::t('modules/finance/app', \"Failure in currying out the RCN withdrawal. Please check the validity of the withdraw amount or contact with the administrator.\"));\n }\n \n if(($model->decisionfile = UploadedFile::getInstance($model, 'decisionfile')) == null)\n throw new Exception(\"Error in uploading file. The action did not complete succesfully.\");\n\n if(!$model->upload())\n throw new Exception(Module::t('modules/finance/app', \"Error in uploading file. The action did not complete succesfully.\"));\n \n if (!$model->save(false)) {\n throw new Exception(Module::t('modules/finance/app', \"Failure in currying out the RCN withdrawal. Please check the validity of the withdraw amount or contact with the administrator.\"));\n }\n \n $user = Yii::$app->user->identity->username;\n $year = Yii::$app->session[\"working_year\"];\n Yii::info('User ' . $user . ' working in year ' . $year . ' updated withdrawal with ' . $id, 'financial');\n\n Yii::$app->session->addFlash('success', Module::t('modules/finance/app', \"The update of the withdrawal completed successfully.\"));\n return $this->redirect(['index', 'id' => $model->kaewithdr_id]);\n } catch (Exception $e) {\n Yii::$app->session->addFlash('danger', $e->getMessage());\n return $this->redirect(['/finance/finance-kaewithdrawal/index']);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'kae' => $kae,\n 'kaeCredit' => $kaeCredit,\n 'kaeCreditSumPercentage' => $kaeCreditSumPercentage,\n 'kaeWithdrwals' => $kaeWithdrwals\n ]);\n }\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 putUpdateField866aHolding($id) {\n\n\n\t\t\t$new866a = Input::get('new866a');\n\t\t\t$holdingsset_id = Holding::find($id)->holdingsset_id;\n\n\t\t\t$newhol_nrm = normalize866a($new866a, Holding::find($id)->sys2);\n\t\t\t// echo 'Y el resultado es: <br>';\n\t\t\t// die(var_dump($new866a));\n\t\t\t$holding = Holding::find($id)->update(['f866aupdated'=>$new866a, 'hol_nrm' => $newhol_nrm]);\n\n\t\t\tholdingsset_recall($holdingsset_id);\n\t\t\t\n\t\t\t$holdingssets[] = Holdingsset::find($holdingsset_id);\n\t\t\t$newset = View::make('holdingssets/hos', ['holdingssets' => $holdingssets]);\n\t\t\treturn $newset;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Listar boletos com dataTables
public function data_tables() { $t = new Datatables; $t->select(' id, sacado_nome, sacado_cpf_cnpj, sacado_cep, pedido_valor_unitario, taxa_boleto, pedido_numero, data_documento, data_vencimento, dias_de_prazo_para_pagamento, status ') ->from('boleto') ->order_by('id desc'); $t->datatable('tabela_boletos') // table's id for html ->set_options('searching', 'true') ->searchable('sacado_nome, sacado_cpf_cnpj, pedido_numero') ->style(array( 'class' => 'table table-bordered table-striped', )) ->column('Nome', 'sacado_nome') ->column('CPF/CNPJ', 'sacado_cpf_cnpj',function($data, $row){ $o = new Validacpfcnpj($row['sacado_cpf_cnpj']); return ($o->valida())?'<span style="color: blue;">'.$o->formata().'<i class="fa fa-check" aria-hidden="true"></i></span>':'<span style="color: red;">'.$o->formata().'<i class="fa fa-times" aria-hidden="true"></i></span>'; }) ->column('CEP','sacado_cep',function($data, $row){ return ($this->validaCep($row['sacado_cep']))?'<span style="color: blue;">'.$row['sacado_cep'].'<i class="fa fa-check" aria-hidden="true"></i></span>':'<span style="color: red;">'.$row['sacado_cep'].'<i class="fa fa-times" aria-hidden="true"></i></span>'; }) ->column('Valor do Boleto', 'pedido_valor_unitario',function($data, $row){ return $this->fbradesco->valor_boleto(1,$row['pedido_valor_unitario'],$row['taxa_boleto']); }) ->column('Data do Vencimento', 'data_documento',function($data, $row){ return date('d/m/Y', strtotime($row['data_vencimento'])); }) ->column('Nosso Número', 'pedido_numero',function($data, $row){ $nnum = $this->fbradesco->nnum($row['pedido_numero']); return $nnum.'-'.$this->fbradesco->digitoVerificador_nossonumero($nnum); }) ->column('Status', 'status') ->column('Ações', 'id', function ($data, $row){ $str = '<a href="'.site_url("index.php/boleto/edit/{$row['id']}").'" class="btn btn-info btn-xs"><span class="fa fa-pencil"></span> Editar</a> | '; $str .= '<a href="'.site_url("index.php/boleto/remove/{$row['id']}").'" class="btn btn-danger btn-xs"><span class="fa fa-trash"></span> Deletar</a> | '; $str .= '<a href="'.site_url("index.php/boleto/getBoleto/{$row['id']}").'" target="_Blank" class="btn btn-default btn-xs"><span class="fa fa-ticket"></span> Boleto</a>'; return $str; }); $t->init(); $data['_view'] = 'boleto/dataTables'; $this->load->view('layouts/main',$data); }
[ "public function listDataTable()\n {\n $destinos = Destino::whereHas('getCiudad');\n return Datatables::of($destinos)\n ->addColumn('ubicacion', function($destinos) {\n return $destinos->getCiudad->getUbicacion();\n })\n ->addColumn('descripcion',function($destinos){\n return $destinos->descripcion;\n })\n ->addColumn('direccion',function($destinos){\n return $destinos->direccion;\n })\n ->addColumn('km_recorrer',function($destinos){\n return $destinos->km_recorrer;\n })\n ->addColumn('cant_dias_traslado',function($destinos){\n return $destinos->cant_dias_traslado;\n })\n ->addColumn('action',function($destinos){\n return '<div>'\n .'<div class=\"inline m-l-sm\" >'\n .'<input type=\"radio\" name=\"destino\" value=\"'.$destinos->codigo.'\" />'\n .'<label></label>'\n .'</div>'\n .'</div>';\n })\n ->rawColumns(['action'])\n ->make(true);\n }", "private function _get_datatables_Cobrados()\n {\n $this->db->select(self::SELECT);\n $this->db->from(self::TABLE_COBROS);\n $this->db->where(self::WHE_RE);\n $this->db->join('cliente cl', 'cr.Cliente_idCliente = cl.idCliente', 'INNER');\n $i = 0;\n\n foreach ($this->column as $item)\n {\n if($_POST['search']['value'])\n ($i===0) ? $this->db->like($item, $_POST['search']['value']) : $this->db->or_like($item, $_POST['search']['value']);\n $column[$i] = $item;\n $i++;\n }\n\n if(isset($_POST['order']))\n {\n $this->db->order_by($column[$_POST['order']['0']['column']], $_POST['order']['0']['dir']);\n }\n else if(isset($this->order))\n {\n $order = $this->order;\n $this->db->order_by(key($order), $order[key($order)]);\n }\n }", "public function mostrarTablas(){\t\r\n\r\n\t\t$item = null;\r\n \t\t$valor = null;\r\n\r\n \t\t$prospectos = ControladorProspectos::ctrMostrarProspectos($item, $valor);\r\n\r\n\r\n \t\t$datosJson = '{\r\n\t\t \r\n\t \t\"data\": [ ';\r\n\r\n\t \tfor($i = 0; $i < count($prospectos); $i++){\r\n\r\n\t\t\t/*=============================================\r\n \t\t\tREVISAR ESTADO\r\n \t\t\t=============================================*/\r\n\r\n\r\n\t \t\t\t\r\n $fase = \"Nuevo Prospecto\";\r\n\r\n\t \t\t/*=============================================\r\n\t\t\tDEVOLVER DATOS JSON\r\n\t\t\t=============================================*/\r\n\r\n\t\t\t$datosJson\t .= '[\r\n\t\t\t\t \"'.($i+1).'\",\r\n\t\t\t\t \"P000-'.$prospectos[$i][\"codigoProspecto\"].'\",\r\n\t\t\t\t \"'.$prospectos[$i][\"rfc\"].'\",\r\n\t\t\t\t \"'.$prospectos[$i][\"nombreProspecto\"].'\",\r\n\t\t\t\t \"'.$fase.'\",\r\n\t\t\t\t \"'.$prospectos[$i][\"agenteContactado\"].'\",\r\n\t\t\t\t \"'.$prospectos[$i][\"fechaIngreso\"].'\"\r\n\t\t\t\t \r\n\t\t\t\t ],';\r\n\r\n\t \t}\r\n\r\n\t \t$datosJson = substr($datosJson, 0, -1);\r\n\r\n\t\t$datosJson.= ']\r\n\t\t\t \r\n\t\t}'; \r\n\r\n\t\techo $datosJson;\r\n\r\n \t}", "function MyMod_Handle_Export_Datas_Table()\n {\n $nmax=$this->MyMod_Handle_Export_CGI_NFields();\n\n $table=array();\n for ($n=1;$n<=$nmax;$n++)\n {\n array_push\n (\n $table,\n array\n (\n $this->B(\"Col. #\".$n),\n $this->MakeSelectField\n (\n \"Data_\".$n,\n $this->Datas,\n $this->Data_Names,\n $this->MyMod_Handle_Export_CGI_Fields($n,\"Data\")\n ),\n $this->MakeCheckBox\n (\n \"Sort_\".$n,\n 1,\n $this->MyMod_Handle_Export_CGI_Fields($n,\"Sort\")\n )\n )\n );\n }\n\n /* array_push */\n /* ( */\n /* $table, */\n /* array */\n /* ( */\n /* \"\",\"\", */\n /* $this->B(\"Todos os Dados:\"), */\n /* $this->MakeCheckBox */\n /* ( */\n /* \"All_Data\", */\n /* 1, */\n /* $this->MyMod_Handle_Export_CGI_All_Data() */\n /* ) */\n /* ) */\n /* ); */\n\n return $table;\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora decolare</th>\";\n\t\techo \"<th>Destinatia</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_decolare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"destinatia\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "public function generateDatatable()\n {\n // Ambil data sekaligus generate datatables\n $this->datatables->select('*, idBarang');\n $this->datatables->from('barang');\n $this->datatables->add_column('action', '<a href=\"barang/ubah/$1\" class=\"badge badge-warning\">Ubah</a> <a href=\"barang/hapus/$1\" class=\"badge badge-danger tmb-hapus\">Hapus</a>', 'idBarang');\n return $this->datatables->generate();\n }", "protected function _combinarTablas() {\n\t\ttry {\n\t\t\t$conexion = ConnectionManager::getDataSource('default');\n\t\t\t$conexion->query(sprintf('CALL %s.CombinarTablas()', $conexion->getSchemaName()));\n\t\t} catch (Exception $e) {\n\t\t\t$this->error($e->getMessage());\n\t\t}\n\t}", "abstract function list_tables();", "private function table_data()\n {\n \t global $wpdb;\n\t \t $tablename = $wpdb->prefix . 'ejemplo_plugin';\n $data = $wpdb->get_results(\"SELECT * FROM $tablename\",ARRAY_A);\n\n return $data;\n }", "public function listTables()\n {\n include_once 'Structures/DataGrid.php';\n $this->dg = new Structures_DataGrid();\n $this->dg->setRequestPrefix($this->prefix);\n\n // Bind the DataObject to the Datagrid\n $options = array(\n 'natsort' => true,\n );\n\n /*\n * If the enabled-attribute of <table>-tag is not present, defaults\n * to 'yes'.\n * Cannot seem to do that using only xpath, so we loop through all\n * <table>-elements discards the disabled and now use the 'array'-\n * datasource of datagrid instead of xml.\n */\n $xml = simplexml_import_dom($this->configDOM);\n $xml = $xml->xpath('/frontend/tables/table');\n foreach ($xml as $index => $value) {\n $enabled = (string) $value['enabled'];\n if (!empty($enabled) && $enabled != 'yes' && $enabled != '1' ) {\n unset($xml[$index]);\n }\n }\n\n $this->dg->bind($xml, $options, 'Array');\n\n include_once 'DB/DataObject/FormBuilder/Frontend/Column/Callback.php';\n $col = new DB_DataObject_FormBuilder_Frontend_Column_Callback(\n 'displayName',\n $this->labels['tableColumn'],\n $this,\n array(\n 'callbackName' => array($this, 'linkToTableEdit'),\n 'params' => array(),\n 'allowOrderBy' => true,\n )\n );\n $this->dg->addColumn($col->getColumn());\n\n include_once 'DB/DataObject/FormBuilder/Frontend/Column/Standard.php';\n $col = new DB_DataObject_FormBuilder_Frontend_Column_Standard(\n 'description',\n $this->labels['tableDescription'],\n $this,\n array('allowOrderBy' => true)\n );\n $this->dg->addColumn($col->getColumn());\n\n return $this->getDataGridOutput();\n }", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $imagen = $this->Imagenes($this->PrimaryKey,12);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = \"SELECT L.clientetercerizado,\".$imagen.\",L.nombre,\".$editar.\",\".$eliminar.\" FROM \".$this->Table.\" L where estado='A'\";\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 5, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "public function getListadoDatosCargados($data = null){\n if($data) {\n $sql = 'SELECT u.usuario, pagina, seccion, modulo, n.fechaCarga as fechaCarga, DATE_FORMAT(n.fechaCarga,\"%d/%m/%Y %H:%i:%S\" ) as fechaCargaES\n FROM notificaciones n\n LEFT JOIN paginas p USING (idPagina)\n LEFT JOIN secciones s using (idSeccion)\n LEFT JOIN modulos m using (idModulo)\n LEFT JOIN usuarios u ON u.idUsuario = n.idUsuarioCarga\n WHERE n.idUsuario = '.$_SESSION['usuarioLogueadoIdUsuario'].' AND escritorio\n ORDER BY n.fechaCarga DESC\n ';\n $data = getDataTableSqlDataFilter($data, $sql);\n if ($data['data']) {\n //DATOS\n foreach ($data['data'] as $row) {\n $auxRow['detallePagina'] = 'Nuevo registro en el módulo <b>'.$row['modulo'].'</b>'; $auxRow['detallePagina'] .= ($row['seccion'] != '-')? ', sección <b>'.$row['seccion'].'</b>' : ''; $auxRow['detallePagina'] .= ', página <b>'.$row['pagina'].'</b>';\n $auxRow['pagina'] = $row['pagina'];\n $auxRow['seccion'] = $row['seccion'];\n $auxRow['modulo'] = $row['modulo'];\n $auxRow['usuario'] = $row['usuario'];\n $auxRow['fechaCarga'] = $row['fechaCarga'];\n $auxRow['fechaCargaES'] = $row['fechaCargaES'];\n $auxData[] = $auxRow;\n }\n $data['data'] = $auxData;\n }\n echo json_encode($data);\n } else { // si es NULL devuelve los parametros del datatable\n //Parametros columnas\n $objColumns = null; //Nombre: Indica nombre de los campos que se mostraran en el excel y el Datatable\n $objColumns[] = array('nombre' => 'Detalle página', 'bVisible' => true, 'className' => false, 'aDataSort' => 'pagina', 'bSortable' => true, 'searchable' => false, 'exportable' => false); //className: Indica de que lado estara ordenado el elmento de esa columna\n $objColumns[] = array('nombre' => 'pagina', 'bVisible' => false, 'className' => false, 'aDataSort' => false, 'bSortable' => true, 'searchable' => true, 'exportable' => false); //bVIsible:Indica si la columna se muestra\n $objColumns[] = array('nombre' => 'seccion', 'bVisible' => false, 'className' => false, 'aDataSort' => false, 'bSortable' => false, 'searchable' => true, 'exportable' => false); //bSorteable: Indica si se podra ordenar por esa columna\n $objColumns[] = array('nombre' => 'modulo', 'bVisible' => false, 'className' => false, 'aDataSort' => false, 'bSortable' => false, 'searchable' => true, 'exportable' => false); //sercheable: indica si se podra buscar mediante el textbox de busqueda este campo\n $objColumns[] = array('nombre' => 'usuario', 'bVisible' => true, 'className' => false, 'aDataSort' => false, 'bSortable' => true, 'searchable' => true, 'exportable' => false);\n $objColumns[] = array('nombre' => 'fecha IngresoEN', 'bVisible' => false, 'className' => false, 'aDataSort' => false, 'bSortable' => true, 'searchable' => true, 'exportable' => false);\n $objColumns[] = array('nombre' => 'fecha Ingreso', 'bVisible' => true, 'className' => 'right', 'aDataSort' => 'fecha IngresoEN', 'bSortable' => true, 'searchable' => true, 'exportable' => false);\n\n $listadoDatosCargados['columnas'] = $objColumns;\n $columnNames = array('detallePagina','pagina','seccion','modulo','usuario','fechaCarga','fechaCargaES');//muy importante el orden\n //Debe tener el mismo orden y nombre que tienen en el llamado asincrono\n\n foreach ($listadoDatosCargados['columnas'] as $campo) {\n $campos[] = ucfirst($campo['nombre']);//Se carga un array con los campos\n }\n for ($i = 0; $i < count($listadoDatosCargados['columnas']); $i++) {\n if ($listadoDatosCargados['columnas'][$i]['bVisible'] == false) {//Se carga un array con los campos que nos seran visibles\n $bVisible[] = $i;\n }\n if ($listadoDatosCargados['columnas'][$i]['bSortable'] == false) {//Se carga un array con los campos que nos seran ordebables\n $bSortable[] = $i;\n }\n if ($listadoDatosCargados['columnas'][$i]['searchable'] == false) {//Se carga un array con los campos que no seran searcheables\n $searchable[] = $i;\n }\n if ($listadoDatosCargados['columnas'][$i]['className'] == 'left') {//Se carga un array con los campos que se ordenan a la izquierda\n $lefts[] = $i;\n }\n if ($listadoDatosCargados['columnas'][$i]['className'] == 'center') {//Se carga un array con los campos que se ordenan al centro\n $centers[] = $i;\n }\n if ($listadoDatosCargados['columnas'][$i]['className'] == 'right') {//Se carga un array con los campos que se ordenan a la derecha\n $rights[] = $i;\n }\n if (is_array($listadoDatosCargados['columnas'][$i]['aaSorting'])) {\n $orden = $listadoDatosCargados['columnas'][$i]['aaSorting'][0];\n $criterio[$orden] = $listadoDatosCargados['columnas'][$i]['aaSorting'][1];\n $col[$orden] = $i;\n }\n if ($listadoDatosCargados['columnas'][$i]['exportable'] == true) {\n $exportables[] = $i;\n }\n\n if ($listadoDatosCargados['columnas'][$i]['aDataSort'] != false) {\n foreach ($campos as $campo) {\n if (strtolower($listadoDatosCargados['columnas'][$i]['aDataSort']) == strtolower($campo)) {\n $aDataSorts[] = '{\"aDataSort\":[' . array_search($campo, $campos) . '], \"aTargets\": [' . $i . ']}';// en cada elemento del array aDataSorts hay un string con la estructura del aDataSort para agregar a las propiedades del datatable\n }\n }\n }\n }\n\n if (is_array($bVisible)) {\n $bVisible = implode(', ', $bVisible);\n }\n if (is_array($bSortable)) {\n $bSortable = implode(', ', $bSortable);\n }\n if (is_array($searchable)) {\n $searchable = implode(', ', $searchable);\n }\n if (is_array($lefts)) {\n $lefts = implode(', ', $lefts);\n }\n if (is_array($centers)) {\n $centers = implode(', ', $centers);\n }\n if (is_array($rights)) {\n $rights = implode(', ', $rights);\n }\n if (is_array($exportables)) {\n $exportables = implode(', ', $exportables);\n }\n //Se pasan todos los arrays creados a la variable de retorno\n $listadoDatosCargados['campos'] = $campos;//Estos seran los nombres de las columnas\n\n $parametros['aDataSorts'] = $aDataSorts;\n $parametros['bVisible'] = '{\"bVisible\": false, \"aTargets\":[' . $bVisible . ']},';\n $parametros['bSortable'] = '{\"bSortable\": false, \"aTargets\":[' . $bSortable . ']},';\n $parametros['searchable'] = '{\"searchable\" : false, \"aTargets\":[' . $searchable . ']},';\n $parametros['lefts'] = '{\"className\": \"dt-left\", \"aTargets\":[' . $lefts . ']},';\n $parametros['centers'] = '{\"className\": \"dt-center\", \"aTargets\":[' . $centers . ']},';\n $parametros['rights'] = '{\"className\": \"dt-right\", \"aTargets\":[' . $rights . ']},';\n $parametros['exportables'] = '[' . $exportables . ']';\n\n //COLUMNDEFS\n $aoColumnDefs = '\"aoColumnDefs\": [\n { \"width\": \"70%\", \"targets\": 0 },\n ';//agregado para el ancho de las columnas\n\n (isset($parametros['bVisible']))? $aoColumnDefs .= $parametros['bVisible'] : '';\n (isset($parametros['bSortable']))? $aoColumnDefs .= $parametros['bSortable'] : '';\n (isset($parametros['searchable']))? $aoColumnDefs .= $parametros['searchable'] : '';\n (isset($parametros['lefts']))? $aoColumnDefs .= $parametros['lefts']: '';\n (isset($parametros['centers']))? $aoColumnDefs .= $parametros['centers'] : '';\n (isset($parametros['rights']))? $aoColumnDefs .= $parametros['rights'] : '';\n (is_array($parametros['aDataSorts']))? $aoColumnDefs .= implode(',', $parametros['aDataSorts']) : '';//Importante que los DataSort esten al final\n $aoColumnDefs .= '],';\n //COLUMNDEFS\n\n //AASORTING\n $aaSorting = '\"aaSorting\": [[5, \"desc\"]],';\n //AASORTING\n\n //COLUMN NAMES\n $columns = '\"columns\": [';\n foreach ($columnNames as $name) {\n $columns .= '{\"data\": \"'.$name.'\"},';\n }\n $columns = rtrim($columns,',');\n $columns .= '],';\n //COLUMN NAMES\n\n $listadoDatosCargados['columns'] = $columns;\n $listadoDatosCargados['aaSorting'] = $aaSorting;\n $listadoDatosCargados['aoColumnDefs'] = $aoColumnDefs;\n\n return $listadoDatosCargados;// Retorna campos,columns, aoColumnDefs y aaSorting\n }\n }", "function AllTables($data)\r\n\t\t{\t\t\t\r\n\t\t\tforeach ($data as $value)\r\n\t\t\t{\r\n\t\t\t\t$columns[] = $value[table_name];\r\n\t\t\t}\t\r\n\t\t\t$columns = array_unique($columns);\r\n\t\t\t$columns = implode(', ', $columns);\r\n\t\t\treturn $columns;\r\n\t\t}", "function listado(){\n $bd = ControladorBD::getControlador();\n $bd->abrirBD();\n $consulta = \"select * from alumnos\";\n $filas = $bd->consultarBD($consulta);\n $bd->cerrarBD();\n return $filas;\n }", "public function get_datatable(){\n checkPermissao('papel.listar');\n\n $papeis = Papel::query();\n \n return DataTables::eloquent($papeis)\n ->addColumn('action', function ($papel){\n $retorno = permissaoParaLinks($papel, 'papel.atualizar', 'papel.excluir', 'papeis.edit', 'papeis.destroy');\n //Permissão adicionar permissão ao papel\n if(\\Auth::user()->can('papel.addpermissao', $papel)){\n $retorno .= '<a href=\"'. route(\"papeis.permissao\",$papel->id) .'\" class=\"btn btn-sm btn-primary\" style=\"margin-left: 5px;\" '. ($papel->id == 1 ? 'disabled' : 'enabled') .'><i class=\"fas fa-plus\"></i> Permissões</a>';\n }\n return $retorno;\n })->make(true);\n }", "public function getTables();", "public function mostrarTablaConsumoTelas(){\n\n\n $consumoTelas = ControladorAlmacenCorte::ctrRangoFechasConsumoTelas($_GET[\"fechaInicial\"], $_GET[\"fechaFinal\"]);\t\n if(count($consumoTelas)>0){\n\n $datosJson = '{\n \"data\": [';\n\n for($i = 0; $i < count($consumoTelas); $i++){\n\n \n /*=============================================\n TRAEMOS LAS ACCIONES\n =============================================*/ \n\n $datosJson .= '[\n \"'.$consumoTelas[$i][\"almacencorte\"].'\",\n \"'.$consumoTelas[$i][\"nota_salida\"].'\",\n \"'.$consumoTelas[$i][\"guia\"].'\",\n \"'.$consumoTelas[$i][\"fechas\"].'\",\n \"'.$consumoTelas[$i][\"mat_pri\"].\" - \".$consumoTelas[$i][\"DesPro\"].'\",\n \"'.$consumoTelas[$i][\"Color\"].'\",\n \"'.$consumoTelas[$i][\"Unidad\"].'\",\n \"'.$consumoTelas[$i][\"Stk_Act\"].'\"\n ],'; \n }\n\n $datosJson=substr($datosJson, 0, -1);\n\n $datosJson .= '] \n\n }';\n\n echo $datosJson;\n }else{\n\n echo '{\n \"data\":[]\n }';\n return;\n\n }\n }", "private function montaLista(){\r\n\t\t\t$this->sql = \"SELECT \" . $this->campos . \" FROM `\" . $this->tabela . \"` \" . $this->joinTabela . \" WHERE 1=1 \" . $this->criterio . $this->ordem . $this->grupo . $this->limite;\r\n\t\t}", "public function getTable()\n {\n $data= DB::table('dispositivo')->select('*')->where('dispositivo.estado','ACTIVO')->orderBy('dispositivo.id', 'desc')->get();\n return Datatables::of($data)->make(true);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets you all languages of the platform
static function getAllLanguages() { return KenedoPlatform::p()->getLanguages(); }
[ "private function getAllApplicationLanguages()\r\n {\r\n return Multilanguage::getLanguagesList();\r\n }", "public static function getLanguages();", "public function getSystemLanguages() {}", "public function getLanguages() {}", "public function getLanguages();", "public function getAvailableLanguages ();", "public function listLanguages();", "public static function get_list_languages();", "public function getSupportedLanguages();", "public function getSupportedLanguages(): array;", "public function getEnabledLanguages();", "public static function getAvailableLangs()\n {\n return self::getLangs();\n }", "public function getLangs()\n {\n foreach ($this->langs as $lang){\n echo $lang;\n }\n }", "public static function getLangs(){\n\t\treturn self::$LANGS_LIST;\n\t}", "public function languageList();", "public function getClientLanguages();", "public static function getLangs() {\n return Config::get('lang.list');\n }", "function get_languages() {\n return get_instance()->lang->getSupported();\n }", "public function getSysLanguages()\n {\n return $this->queryBuilder('sys_language')->select('uid', 'title', 'language_isocode')\n ->from('sys_language')\n ->execute()\n ->fetchAll();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Social network connector
public function getSocialNetwork() : SocialNetworkConnector { return new FacebookConnector($this->username, $this->password); }
[ "abstract public function getSocialNetwork() : SocialNetworkConnector;", "public function getSocial(){\n return $this->Csz_model->getSocial(FALSE);\n }", "public function getConnector()\r\n {\r\n return $this->connector;\r\n }", "public function getConnector()\n {\n return $this->connector;\n }", "public function getSocialNetwork()\n {\n return $this->hasOne(SocialNetworks::className(), ['id' => 'social_network_id']);\n }", "public function getSocial(){\n return $this->Cms_model->getSocial(FALSE);\n }", "protected final function getConnectorConfig() {\n $git_settings = \\Drupal::config('simple_git.settings');\n return $git_settings->get($this->getConnectorType());\n }", "public function getConnector() {\n return $this->client->getConnector();\n }", "function getConnector() {\n if (empty($this->connector)) $this->connector = new Connector($this->config);\n\n return $this->connector;\n }", "public function getConnectorLibrary()\n {\n return $this->connector_library;\n }", "public function getConnectorId()\n {\n return $this->connector_id;\n }", "public function getSocialComplement() {\n return $this->socialComplement;\n }", "public function getUseSocial()\n {\n return $this->use_social;\n }", "static function getConnector($type) {\n $connector = null;\n\n switch ($type) {\n case GIT_TYPE_GITHUB:\n $connector = \\Drupal::service('simple_git.github_connector.service');\n break;\n default:\n $connector = \\Drupal::service('simple_git.github_connector.service');\n }\n return $connector;\n }", "public function getSocialUrl(): string {\n\t\treturn ($this->socialUrl);\n\t}", "private function get_connect_url() {\n\t\t$connect_url = '';\n\n\t\tif ( defined( 'IS_WPCOM' ) && IS_WPCOM && function_exists( 'wpcom_keyring_get_connect_URL' ) ) {\n\t\t\t$connect_url = wpcom_keyring_get_connect_URL( 'instagram-basic-display', 'instagram-widget' );\n\t\t} else {\n\t\t\t$jetpack_blog_id = Jetpack_Options::get_option( 'id' );\n\t\t\t$response = Client::wpcom_json_api_request_as_user(\n\t\t\t\tsprintf( '/sites/%d/external-services', $jetpack_blog_id )\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t$body = json_decode( $response['body'] );\n\t\t\t$connect_url = new WP_Error( 'connect_url_not_found', 'Connect URL not found' );\n\t\t\tif ( ! empty( $body->services->{'instagram-basic-display'}->connect_URL ) ) {\n\t\t\t\t$connect_url = $body->services->{'instagram-basic-display'}->connect_URL;\n\t\t\t}\n\t\t}\n\n\t\treturn $connect_url;\n\t}", "public function get_connector_class()\n {\n return $this->connector_class;\n }", "abstract function getSocialShareLinkManager();", "static public function connect_url() {\n\t\treturn Controller::join_links(\"facebook\", \"connect\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes the widget. This overrides the parent implementation by displaying the generated page buttons.
public function run() { if ($this->registerLinkTags) { $this->registerLinkTags(); } echo $this->renderPageButtons(); }
[ "public function run()\n\t{\n\t\t$buttons=$this->createPageButtons();\n\t\tif(empty($buttons))\n\t\t\treturn;\n\t\techo CHtml::tag('div',$this->htmlOptions,implode(\"\\n\",$buttons));\n\t}", "public function run()\n {\n if ($this->registerLinkTags) {\n $this->registerLinkTags();\n }\n echo $this->renderPageButtons();\n }", "public function run()\n\t{\n\t\t$buttons=$this->createPageButtons();\n\t\tif(empty($buttons))\n\t\t\treturn;\n\t\techo $this->header;\n\t\techo implode(\"&nbsp;\",$buttons);\n\t\techo $this->footer;\n\t}", "public function run()\n {\n $this->registerClientScript();\n $buttons=$this->createPageButtons();\n if(empty($buttons))\n return;\n echo $this->header;\n echo CHtml::tag('ul',$this->htmlOptions,implode(\"\\n\",$buttons));\n echo $this->footer;\n }", "public function run()\n\t{\n\t\t$this->registerClientScript();\n\t\t$buttons=$this->createPageButtons();\n\t\tif(empty($buttons))\n\t\t\treturn;\n\t\techo $this->header;\n\t\techo CHtml::tag('ul',$this->htmlOptions,implode(\"\\n\",$buttons));\n\t\techo $this->footer;\n\t}", "public function run()\n {\n $this->initializeInfiniteScrollPlugin();\n if ($this->registerLinkTags) {\n $this->registerLinkTags();\n }\n echo $this->renderPageButtons();\n }", "public function run()\n {\n if ($this->registerLinkTags) {\n $this->registerLinkTags();\n }\n\n $summary = $this->renderSummary();\n // $perPage = $this->renderPerPage();\n $perPage = '';\n $button = $this->renderPageButtons();\n\n $output = $perPage . $button;\n $output = $this->showSummary ? $summary . $output : $output;\n\n echo $output;\n }", "public function page()\n {\n\n do_action(\"admin/{$this->get_slug()}/before\");\n\n ?>\n <div class=\"wrap\">\n <h1 class=\"wp-heading-inline\"><?php echo $this->get_title(); ?></h1>\n <?php $this->do_title_actions(); ?>\n <hr class=\"wp-header-end\">\n <?php\n\n if (method_exists($this, $this->get_current_action())) {\n call_user_func([$this, $this->get_current_action()]);\n } else if (has_action(\"admin/{$this->get_slug()}/display/{$this->get_current_action()}\")) {\n do_action(\"admin/{$this->get_slug()}/display/{$this->get_current_action()}\", $this);\n } else {\n call_user_func([$this, 'view']);\n }\n\n ?>\n </div>\n <?php\n\n do_action(\"admin/{$this->get_slug()}/after\");\n }", "function designer_pages_widget() {\r\n\t\tglobal $designerPages;\r\n\t\t$designerPages->widgetOutput( array() );\r\n\t}", "private function renderPage()\n {\n // to the parent/app window\n $this->setViewTitle(_('Connection Authorization - Flex.io'));\n $this->renderPublic();\n $this->render();\n }", "public function run()\n {\n // Initialize jQuery IAS plugin\n $pluginSettings = Json::encode([\n 'container' => $this->container,\n 'item' => $this->item,\n 'pagination' => \"{$this->container} .pagination\",\n 'next' => '.next a',\n 'noneleft' => $this->noneLeft,\n 'loader' => $this->loader,\n 'loaderDelay' => $this->loaderDelay,\n 'triggerPageTreshold' => $this->triggerPageThreshold,\n 'trigger' => $this->trigger,\n 'tresholdMargin' => $this->thresholdMargin,\n 'history' => $this->history,\n 'scrollContainer' => new JsExpression($this->scrollContainer)\n ]);\n $this->view->registerJs(\"jQuery.ias({$pluginSettings});\", View::POS_READY);\n\n // Render pagination links\n echo LinkPager::widget([\n 'pagination' => $this->pagination\n ]);\n }", "protected function renderPageButtons()\n {\n $pageCount = $this->pagination->getPageCount();\n if ($pageCount < 2 && $this->hideOnSinglePage) {\n return '';\n }\n $currentPage = $this->pagination->getPage();\n\n if (($page = $currentPage + 1) >= $pageCount - 1) {\n $page = $pageCount - 1;\n }\n\n $linkOptions = $this->loadButtonOptions;\n $linkOptions['data-page'] = $page;\n $linkOptions['id'] = $this->id;\n $button = Html::a($this->loadButtonLabel, $this->pagination->createUrl($page), $linkOptions);\n\n return $button;\n }", "public function display() {\n \n $pageProcesor = new PageProcessor();\n $pageProcesor->processPage($this->pageContext);\n }", "private function runPage(){\n list($source, $formOptions, $logStatus, $tableData, $studentData, $studentSchools) = $this->model->preparePageContent($this->nav);\n print $this->view->pageView($source, $formOptions, $logStatus, $tableData, $this->url, $studentData, $studentSchools);\n }", "public function render_wizard() {\n\t\tinclude Plugin::instance()->get_view( 'common/page' );\n\t}", "function run()\r\n {\r\n // Run parent CWidget run function.\r\n parent::run();\r\n echo '<!-- AddThis Button BEGIN -->';\r\n echo CHtml::openTag('div', $this->htmlOptions) . \"\\n\";\r\n if ($this->singleButton) {\r\n $img = CHtml::image(\"http://s7.addthis.com/static/btn/v2/lg-share-{$this->config['ui_language']}.gif\", Yii::t('addThis', 'Bookmark and Share'));\r\n echo CHtml::link($img, \"http://www.addthis.com/bookmark.php?v=300&amp;#pubid={$this->pubid}\", $this->singleButtonOptions);\r\n }\r\n\r\n // Check what services to show.\r\n if (!$this->singleButton && !empty($this->services)) {\r\n while ($item = current($this->services)) {\r\n is_array($item) ? $service = array('name' => key($this->services), 'htmlOptions' => $item) : $service = array('name' => $item, 'htmlOptions' => array());\r\n next($this->services);\r\n\r\n if ($service['name'] == 'vk_like') {\r\n if (!empty($this->vkApiId) && is_int($this->vkApiId)) {\r\n $service['htmlOptions']['id'] = 'vk_like';\r\n echo CHtml::tag('a', $service['htmlOptions'], '');\r\n }\r\n } else {\r\n $service['htmlOptions']['class'] = \"addthis_button_{$service['name']}\";\r\n echo CHtml::tag('a', $service['htmlOptions'], '');\r\n }\r\n }\r\n }\r\n echo CHtml::closeTag('div');\r\n echo '<!-- AddThis Button END -->';\r\n }", "protected function renderPageButtons()\n {\n $pageCount = $this->pagination->getPageCount();\n if ($pageCount < 2 && $this->hideOnSinglePage) {\n return '';\n }\n\n $buttons = [];\n $currentPage = $this->pagination->getPage();\n\n // first page\n $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel;\n if ($firstPageLabel !== false) {\n $buttons[] = $this->renderPageButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false);\n }\n\n // prev page\n if ($this->prevPageLabel !== false) {\n if (($page = $currentPage - 1) < 0) {\n $page = 0;\n }\n $buttons[] = $this->renderPageButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false);\n }\n\n // internal pages\n list($beginPage, $endPage) = $this->getPageRange();\n for ($i = $beginPage; $i <= $endPage; ++$i) {\n $buttons[] = $this->renderPageButton($i + 1, $i, null, $this->disableCurrentPageButton && $i == $currentPage, $i == $currentPage);\n }\n\n // next page\n if ($this->nextPageLabel !== false) {\n if (($page = $currentPage + 1) >= $pageCount - 1) {\n $page = $pageCount - 1;\n }\n $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n // last page\n $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel;\n if ($lastPageLabel !== false) {\n $buttons[] = $this->renderPageButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n // go\n if ($this->go) {\n $goPage = $currentPage + 2;\n $total = Yii::t('backend', 'Total');\n $page = Yii::t('backend', 'Pages');\n $go_to = Yii::t('backend', 'go to');\n $go = Yii::t('backend', 'Go');\n\n $goHtml = <<<goHtml\n <div class=\"form\" style=\"float: left; color: #999; margin-left: 10px; font-size: 12px;\">\n <span class=\"text\">{$total} {$pageCount} {$page}</span>\n <span class=\"text\">{$go_to}</span>\n <input class=\"input\" type=\"number\" value=\"{$goPage}\" min=\"1\" max=\"{$pageCount}\" aria-label=\"页码输入框\" style=\"text-align: center; height: 25px; line-height: 20px; margin-top: 5px; width: 40px;border-radius: 3px;border: 1px solid\">\n <span class=\"text\">{$page}</span>\n <span class=\"btn go-page\" role=\"button\" tabindex=\"0\" style=\"border: solid 1px #ccc; padding: 0px; height: 25px; width: 46px; line-height: 25px;\">{$go}</span>\n </div> \ngoHtml;\n $buttons[] = $goHtml;\n $pageLink = $this->pagination->createUrl(false);\n\n $goJs = <<<goJs\n $(document).on('click', '.go-page', function(){\n var _this = $(this),\n _pageInput = _this.siblings(\"input\"),\n goPage = _pageInput.val(),\n pageLink = \"{$pageLink}\",\n pageLink = pageLink.replace(\"page=1\", \"page=\"+goPage);\n if (goPage >= 1 && goPage <= {$pageCount}) {\n window.location.href = pageLink;\n } else {\n _pageInput.focus(); \n }\n });\ngoJs;\n $this->view->registerJs($goJs);\n }\n\n $options = $this->options;\n $tag = ArrayHelper::remove($options, 'tag', 'ul');\n return Html::tag($tag, implode(\"\\n\", $buttons), $options);\n }", "protected function createPageButtons()\r\n\t{\r\n\t\tif(($pageCount=$this->getPageCount())<=1)\r\n\t\t\treturn array();\r\n\t\r\n\t\tlist($beginPage,$endPage)=$this->getPageRange();\r\n\t\t$currentPage=$this->getCurrentPage(false); // currentPage is calculated in getPageRange()\r\n\t\t$buttons=array();\r\n\t\r\n\t\t// first page\r\n\t\t//$buttons[]=$this->createPageButton($this->firstPageLabel,0,self::CSS_FIRST_PAGE,$currentPage<=0,false);\r\n\t\r\n\t\t// prev page\r\n\t\tif(($page=$currentPage-1)<0)\r\n\t\t\t$page=0;\r\n\t\t$buttons[]=$this->createPageButton($this->prevPageLabel,$page,self::CSS_PREVIOUS_PAGE,$currentPage<=0,false);\r\n\t\t\r\n\t\t// internal pages\r\n\t\t//for($i=$beginPage;$i<=$endPage;++$i)\r\n\t\t//\t$buttons[]=$this->createPageButton($i+1,$i,self::CSS_INTERNAL_PAGE,false,$i==$currentPage);\r\n\r\n\t\t$eitherside = (self::SHOW_EACH_SIDE + 1) / 2;\r\n\t\t$curPage = $currentPage + 1;\r\n\t\tif($curPage > $eitherside) {\r\n\t\t\t$start = $curPage - $eitherside;\r\n\t\t\tif ($start > $pageCount - self::SHOW_EACH_SIDE - $eitherside) {\r\n\t\t\t\t$start = $pageCount - self::SHOW_EACH_SIDE - $eitherside + 1;\r\n\t\t\t\t\r\n\t\t\t\tif ($start <= 0) {\r\n\t\t\t\t\t$start = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$start = 1;\r\n\t\t}\r\n\t\t\r\n\t\tif($curPage + $eitherside <= $pageCount) {\r\n\t\t\t$end = $curPage + $eitherside;\r\n\t\t\t\r\n\t\t\tif ($end < self::SHOW_EACH_SIDE + $eitherside) {\r\n\t\t\t\t$end = self::SHOW_EACH_SIDE + $eitherside;\r\n\t\t\t\t\r\n\t\t\t\tif ($end > $pageCount) {\r\n\t\t\t\t\t$end = $pageCount;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$end = $pageCount;\r\n\t\t}\r\n\t\t\r\n\t\tif ($start > 1) {\r\n\t\t\t// first page\r\n\t\t\t$buttons[]=$this->createPageButton('1',0,self::CSS_INTERNAL_PAGE,false,$currentPage==0);\r\n\t\t}\r\n\t\t\r\n\t\tif ($start > 2) {\r\n\t\t\t$buttons[] = \" .... \";\r\n\t\t}\r\n\t\t\r\n\t\tfor ($i = $start; $i <= $end; $i++) {\r\n\t\t\t$buttons[]=$this->createPageButton($i,$i-1,self::CSS_INTERNAL_PAGE,false,$i==$curPage);\r\n\t\t}\r\n\t\tif($end != $pageCount) {\r\n\t\t\tif ($end < $pageCount - 1) {\r\n\t\t\t\t$buttons[] = \" .... \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// last page\r\n\t\t\tif ($pageCount > 1) {\r\n\t\t\t\t$buttons[]=$this->createPageButton($pageCount,$pageCount-1,self::CSS_INTERNAL_PAGE,false,$currentPage==$pageCount-1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*if(($page=$currentPage)<0) {\r\n\t\t\t$currPage = 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$currPage = $page + 1;\r\n\t\t}\r\n\t\t$pageUrl = $this->getController()->createUrl($this->getPages()->route, array());\r\n\t\t$buttons[] = \"<input size='3' onkeypress='javascript:goToSpecificPage(\\\"\".$pageUrl.\"\\\")' id='currPage' value='$currPage' /> of \".$this->pageCount;*/\r\n\r\n\t\t// next page\r\n\t\tif(($page=$currentPage+1)>=$pageCount-1)\r\n\t\t\t$page=$pageCount-1;\r\n\t\t$buttons[]=$this->createPageButton($this->nextPageLabel,$page,self::CSS_NEXT_PAGE,$currentPage>=$pageCount-1,false);\r\n\t\t\r\n\t\t$buttons[] = CHtml::hiddenField('currPage', $currentPage + 1); // Store the current page to hidden field\r\n\t\r\n\t\t// last page\r\n\t\t//$buttons[]=$this->createPageButton($this->lastPageLabel,$pageCount-1,self::CSS_LAST_PAGE,$currentPage>=$pageCount-1,false);\r\n\t\r\n\t\treturn $buttons;\r\n\t}", "function showPageContent() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the download PDF.
public function getDownloadPDF() { return $this->downloadPDF; }
[ "public function getPDF();", "abstract protected function getPDFURL();", "public function downloadPDF(){\n $products = Product::where('product_status',1)->get();\n $orders = Order::all();\n $last_order_id = OrderDetail::max('order_id');\n $order_receipt = OrderDetail::where('order_id',$last_order_id)->get();\n $pdf = PDF::loadView('admin.reports.receipt', compact('products','order_receipt','orders'));\n return $pdf->download('invoice.pdf');\n }", "public function getDownload(){\n $file= public_path(). \"/download/info.pdf\";\n $headers = array(\n 'Content-Type: resume/docx',\n );\n return Response::download($file, 'alexandra_gutierrez_resume.pdf', $headers);\n\t}", "public function getPdf() {\n\t\treturn $this->api->getEstimatePdf($this);\n\t}", "public function getPdfUrl()\n {\n return isset($this->pdf_url) ? $this->pdf_url : null;\n }", "function pdf_link_download() {\n\t\t\t global $woocommerce;\n\t\t\t \n\t\t\t if ( isset( $_GET['pdfid'] ) && isset( $_GET['pdfnonce'] ) ) {\n\n\t\t\t \tif( !class_exists('WC_send_pdf') ){\n\t\t\t\t\tinclude( 'class-pdf-send-pdf-class.php' );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$orderid \t= stripslashes( $_GET['pdfid'] );\n\t\t\t\t$order \t= new WC_Order( $orderid );\n\n\t\t\t\t$pdfnonce \t= stripslashes( $_GET['pdfnonce'] );\n\t\t\t\t$ordernonce = wp_hash( $order->get_order_key(), 'nonce' );\n\t\t\t\t\n\t\t\t\t// Check ordernonce and pdfnonce match\n\t\t\t\tif ( $ordernonce == $pdfnonce ) {\n\t\t\t\t\techo WC_send_pdf::get_woocommerce_invoice( $order, NULL, 'false' );\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\n\t\t }", "public function downloadPDF(){\n $classrooms_data = $this->getClassesInformation();\n $pdf = PDF::loadView('pdf', compact('classrooms_data'));\n return $pdf->download('Classrooms Information.pdf');\n }", "public function download($filename = 'document.pdf');", "public function get_pdf() {\n if ( isset( $_REQUEST[ 'action' ] ) && !empty( $_REQUEST[ 'booking-id' ] ) ) {\n $booking_id = absint( $_REQUEST[ 'booking-id' ] );\n switch ( $_REQUEST[ 'action' ] ) {\n case 'get-booking-pdf-customer':\n YITH_WCBK()->exporter->generate_pdf( $booking_id, false );\n break;\n\n case 'get-booking-pdf-admin':\n YITH_WCBK()->exporter->generate_pdf( $booking_id, true );\n break;\n }\n }\n }", "function get_the_pdf( $main_guide_post ) {\n\t$args = array(\n\t\t'post_type' => 'attachment',\n\t\t'post_mime_type' => 'application/pdf',\n\t\t'numberposts' => 1,\n\t\t'post_status' => null,\n\t\t'post_parent' => $main_guide_post\n\t);\n\t$attachments = get_posts( $args );\n\n\tif ( $attachments )\n\t\treturn wp_get_attachment_url( $attachments[0]->ID );\n\n\treturn '';\n}", "public function getDownload()\n {\n return $this->download;\n }", "abstract public function getPdf();", "public function getDownload(){\n $file= public_path(). \"/download/info.pdf\";\n\n $headers = array(\n 'Content-Type: application/pdf',\n );\n\n return Response::download($file, 'filename.pdf', $headers);\n //return response()->download(storage_path(\"app/public/{$filename}\"));\n //$path = storage_path('./storage/app/public/info.pdf');\n\n //return response()->download($path);\n }", "public function getdownload()\n {\n return $this->download;\n }", "public function getPdfFile()\n {\n $pdf = $this->getPdfPath();\n if (!$this->filesystem->exists($pdf)) {\n throw new \\Robinson\\Frontend\\Model\\Exception(sprintf('Pdf does not exist at location: \"%s\"', $pdf));\n }\n \n return $pdf;\n }", "public function getPdfUrl()\n {\n $url = get_post_meta($this->id, 'sb-pdf-url', true);\n\n if (!empty($url)) {\n return $url;\n }\n\n return false;\n }", "public function getPdf($action = 'OutputPdf')\n {\n require_once '../vendor/autoload.php';\n include_once('email_layout.php');\n\n $html = getEmailLayoutResult($this->testID, 'link', true);\n $mpdf = new \\Mpdf\\Mpdf([\n 'default_font' => 'arial'\n ]);\n $mpdf->WriteHTML($html);\n\n if ($action == 'OutputPdf') {\n $mpdf->Output();\n } else if ($action == 'GetFilePath') {\n $date = new DateTime();\n $fileName = 'pdf/discPdf-' . $date->format('dmY-Gis-v') . \".pdf\";\n $mpdf->Output($fileName);\n return $fileName;\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 }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation marketingCampaignsIdLinksClickedPost Spinen&39;s PHP ConnectWise Client for Marketing API generated by Swagger Code Generator.
public function marketingCampaignsIdLinksClickedPost($id, $link_clicked) { list($response) = $this->marketingCampaignsIdLinksClickedPostWithHttpInfo($id, $link_clicked); return $response; }
[ "public function get_campaign_link_clicks( $campaign_id = '', $args = [] ) {\n $endpoint = \"/reports/$campaign_id/click-details\";\n $defaults = [\n 'count' => 25,\n ];\n $args = wp_parse_args( $args, $defaults );\n $data = $this->get_request( $endpoint, $args );\n if ( isset( $data->urls_clicked ) ) {\n return $data->urls_clicked;\n }\n return [];\n }", "public function linkClicks()\n {\n return $this->hasMany(EmailCampaignLinkClick::class);\n }", "private function DiscussionsClickable($Sender) {\n // Make sure that discussion clicks (anywhere in a discussion row) take the user to the discussion.\n if (property_exists($Sender, 'Head') && is_object($Sender->Head)) {\n $Sender->Head->AddString('\n<script type=\"text/javascript\">\n jQuery(document).ready(function($) {\n $(\"ul.DataList li.Item\").click(function() {\n var href = $(this).find(\".Title a\").attr(\"href\");\n if (typeof href != \"undefined\")\n document.location = href;\n });\n });\n</script>');\n }\n }", "public function clicks()\n {\n return $this->hasMany('App\\ViewUrl', 'short_url', 'short_url');\n }", "public function getCampaignSubscriberClicks($campaignId = null)\n\t{\n\t\t// set ID\n\t\t$campaignId = empty($campaignId) ? $this->getCampaignId() : $campaignId;\n\n\t\t// set parameters\n\t\t$parameters['CampaignID'] = (string) $campaignId;\n\n\t\t// make the call\n\t\t$records = (array) $this->doCall('Campaign.GetSubscriberClicks', $parameters);\n\n\t\t// stop here if no records were set\n\t\tif(empty($records)) return array();\n\n\t\t// if SubscriberClick is set in the first level, we have multiple results\n\t\t$records = (isset($records['SubscriberClick']['EmailAddress'])) ? $records : $records['SubscriberClick'];\n\n\t\t// reserve variables\n\t\t$results = array();\n\t\t$i = 0;\n\n\t\t// loop the records\n\t\tforeach($records as $record)\n\t\t{\n\t\t\t// shorten the email var for re-use ease\n\t\t\t$email = $record['EmailAddress'];\n\n\t\t\t// set result values\n\t\t\t$results[$email]['list_id'] = $record['ListID'];\n\t\t\t$results[$email]['clicked_links'] = array();\n\n\t\t\t// check if there are clickedlinks present\n\t\t\tif(empty($record['ClickedLinks'])) continue;\n\n\t\t\t// if Link is set in the level below SubscriberClickedLink, we have 1 result. Otherwise, we have multiple\n\t\t\t$links = (isset($record['ClickedLinks']['SubscriberClickedLink']['Link'])) ? $record['ClickedLinks'] : $record['ClickedLinks']['SubscriberClickedLink'];\n\n\t\t\t// loop the clicked links\n\t\t\tforeach($links as $link)\n\t\t\t{\n\t\t\t\t// set clicked link values\n\t\t\t\t$results[$email]['clicked_links'][$i]['link'] = $link['Link'];\n\t\t\t\t$results[$email]['clicked_links'][$i]['clicks'] = $link['Clicks'];\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t// reset the link counter\n\t\t\t$i = 0;\n\t\t}\n\n\t\t// return the records\n\t\treturn $results;\n\t}", "function SetLinkClicked($linkclicked){}", "public function action_click()\n\t{\n\t\t$url = Core::config('common.front_url');\n\n\t\t$utm = '?utm_source=adserum&utm_medium=banner&utm_campaign='.date('Y-m-d');\n\n\t\t//valid referral\n\t\tif (CSRF::valid('c'.Core::get('h'),'get'))\n\t\t{\n\t\t\t//get the ad\n\t\t\t$ad = new Model_Ad(NULL,NULL,Core::get('ad'));\n\t\t\tif ($ad->loaded())\n\t\t\t{\n\t\t\t\t$url = $ad->click_url;\n\t\t\t\t$ad->click(Core::get('h'));\n\t\t\t}\n\t\t}\n\t\t//d($url);\n\t\t$this->request->redirect($url.$utm);\n\t\t\n\t}", "function tep_update_links_click_count($links_id) {\n tep_db_query(\"update \" . TABLE_LINKS . \" set links_clicked = links_clicked + 1 where links_id = '\" . (int)$links_id . \"'\");\n }", "function newsletter_reportsGetLinksClicked($newsletter_id) {\t\n\t## save the name\n\t$db_connection = new DB_Sql();\n\n\t## first we need to get the total numbe rof links clicked\n\t$query = \"SELECT url,COUNT(*) AS clicks FROM \".DB_PREFIX.\"reports_newsletter_externallinks WHERE newsletter_id='$newsletter_id' GROUP BY url\";\n\t$rp = $db_connection->query($query);\n\t\n\t$data = array();\n\twhile($db_connection->next_record()) {\n\t\t$data[$page_id]['url'] = $db_connection->Record[\"url\"];\n\t\t$data[$page_id]['clicks'] = $db_connection->Record[\"clicks\"];\n\t}\n\t\n\treturn $data;\n}", "public function share_link_post()\n\t{\n\t\tlog_message('debug', 'Network/share_link_post');\n\t\tlog_message('debug', 'Network/share_link_post:: [1] userId='.extract_id($this->post('userId')));\n\t\t\n\t\t$result = $this->_network->add_share_link(\n\t\t\textract_id($this->post('userId'))\n\t\t);\n\t\t\n\t\tlog_message('debug', 'Network/share_link_post:: [2] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "public function click(Link $link);", "public function fetchClicks()\n {\n return $this->fetch(self::ENDPOINT_CLICK);\n }", "public static function banner_click_action()\n\t{\n\t\t// Banner Click\n\t\tif( isset( $_GET['_dnlink'] ) && !empty( $_GET['_dnlink'] ) )\n\t\t{\n\t\t\tadd_filter('strack_track_page_view', 0);\n\t\t\t$banner_id = is_numeric($_GET['_dnlink']) ? $_GET['_dnlink'] : base64_decode($_GET['_dnlink']);\n\t\t\t$adzone_id = isset($_GET['aid']) && is_numeric($_GET['aid']) ? $_GET['aid'] : 0;\n\t\t\t$banner = ADNI_CPT::load_post($banner_id, array('filter' => 0));\n\t\t\t$save_stats = $banner['args']['enable_stats'];\n\n\t\t\tADNI_Init::error_log(__('Adning - loaded from click. banner_id:'.$banner_id,'adn'));\n\t\t\t\n\t\t\t// Filter -------------------------------------------------------\n\t\t\tif( $save_stats )\n\t\t\t{\n\t\t\t\tif(!is_admin())\n\t\t\t\t{\n\t\t\t\t\tapply_filters('adning_save_stats', array(\n\t\t\t\t\t\t'type' => 'click',\n\t\t\t\t\t\t'banner_id' => $banner_id,\n\t\t\t\t\t\t'adzone_id' => $adzone_id,\n\t\t\t\t\t\t'advertiser_id' => $banner['post']->post_author\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($_GET['bgskin']))\n\t\t\t{\n\t\t\t\t$url = $banner['args']['bg_takeover_'.$_GET['bgskin'].'_skin_url'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$url = $banner['args']['banner_url'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\theader('Location: '. $url);\n\t\t\texit;\n\t\t}\n\t}", "function wpd_click_track() {\n\n\t// Is there a redirect request? If not, stop\n\n\tif ( empty( $_GET['wpd_redirect'] ) || $_GET['wpd_redirect'] != 1 ) {\n\t\treturn;\n\t}\n\n\t// Is there a post ID we can use? If not, stop\n\n\tif ( empty( $_GET['pid'] ) ) {\n\t\treturn;\n\t}\n\n\t$pid = intval( $_GET['pid'] );\n\n\t// Get the Outbound Link. If none, stop\n\n\t$link = get_post_meta( $pid, 'link', TRUE );\n\n\tif ( empty( $link ) ) {\n\t\treturn;\n\t}\n\n\t// Add a click to the click count\n\n\t$curr_count = get_post_meta( $pid, '_wpd_click_count', TRUE );\n\t$curr_count = empty( $curr_count ) ? 1 : absint( $curr_count ) + 1;\n\tupdate_post_meta( $pid, '_wpd_click_count', $curr_count );\n\n\t// Beat it\n\n\twp_redirect( esc_url( $link ), 302 );\n\texit();\n}", "public function postCreatelinksAction(Request $request, $id)\n {\n /** @var LibraryVideoDemandAdTagInterface $libraryDemandAdTag */\n $libraryDemandAdTag = $this->one($id);\n\n // fetch all params\n $waterfallIds = $request->request->get('waterfalls', null);\n $targeting = $request->request->get(ExpressionInterface::TARGETING, false);\n $targetingOverride = $request->request->get('targetingOverride', false);\n $priority = $request->request->get('priority', null);\n $rotationWeight = $request->request->get('rotationWeight', null);\n $active = $request->request->get('active', null);\n $position = $request->request->get('position', null);\n $shiftDown = $request->request->get('shiftDown', false);\n\n // validate: requested waterfalls as array\n if (!is_array($waterfallIds)) {\n throw new InvalidArgumentException('expect \"waterfalls\" to be an array');\n }\n\n // optional\n $targetingOverride = filter_var($targetingOverride, FILTER_VALIDATE_BOOLEAN);\n $priority = false == filter_var($priority, FILTER_VALIDATE_INT) ? null : filter_var($priority, FILTER_VALIDATE_INT);\n $rotationWeight = false == filter_var($rotationWeight, FILTER_VALIDATE_INT) ? null : filter_var($rotationWeight, FILTER_VALIDATE_INT);\n $active = filter_var($active, FILTER_VALIDATE_INT);\n $position = false == filter_var($position, FILTER_VALIDATE_INT) ? null : filter_var($position, FILTER_VALIDATE_INT);\n $shiftDown = filter_var($shiftDown, FILTER_VALIDATE_BOOLEAN);\n\n // do linking library demand ad tag to many video waterfall tags\n /** @var DeployLibraryVideoDemandAdTagServiceInterface $deployService */\n $deployService = $this->get('tagcade_app.service.core.video_demand_ad_tag.deploy_library_video_demand_ad_tag');\n $deployService->deployLibraryVideoDemandAdTagToWaterfalls($libraryDemandAdTag, $rule = null, $waterfallIds, $targeting, $targetingOverride, $priority, $rotationWeight, $active, $position, $shiftDown);\n\n return $this->view( null, Codes::HTTP_CREATED );\n }", "function get_clicks_for_post($post_row, $user_id, $analytics, $start_range, $end_range) {\n \n\t$analytics->setDateRange($start_range, $end_range);\t //Set date in GA $analytics->setMonth(date('$post_date'), date('$new_date'));\n\n \t#SET UP POST ID AND AUTHOR ID DATA, POST DATE, GET LINK CLICKS DATA FROM GA \n\t$profile_author_id = $user_id;\n\t$post_id = $post_row->ID;\n\t$click_track_tag = '/yoast-ga/' . $post_id . '/' . $profile_author_id . '/outbound-article/';\n\n\t$clickURL = ($analytics->getPageviewsURL($click_track_tag));\n\t$sumClick = 0;\n\n\tforeach ($clickURL as $data) {\n \t\t$sumClick = $sumClick + $data;\n\t}\n\n // Get url product button is linked to\n $sql_product_url = 'SELECT meta_value \n FROM wp_postmeta \n WHERE post_id = \"'. $post_id .'\"\n AND meta_key = \"gp_advertorial_product_url\";';\n\n $product_url_results = mysql_query($sql_product_url);\n mysql_data_seek($product_url_results, 0);\n $product_url_row = mysql_fetch_object($product_url_results);\t\n\t$product_url = $product_url_row->meta_value;\n\n\tif ( !empty($product_url) ) {\t\t# IF 'BUY IT' BUTTON ACTIVATED, GET CLICKS\n\t $click_track_tag_product_button = '/outbound/product-button/' . $post_id . '/' . $profile_author_id . '/' . $product_url . '/'; \t \n\t\t$clickURL_product_button = ($analytics->getPageviewsURL($click_track_tag_product_button));\n \n\t\tforeach ($clickURL_product_button as $data) {\n \t\t\t$sumClick = $sumClick + $data;\n\t\t}\n\t}\n \n return $sumClick;\n}", "function campaignEngagement7Days($id) {\n $db = $this->classes['db']->getConnection();\n $stmt = $db->prepare('SELECT id, code FROM links WHERE campaignId = ?');\n $stmt->bind_param('i', $id);\n $stmt->execute();\n $stmt->bind_result($linkId, $linkCode);\n $stmt->store_result();\n while ($stmt->fetch()) {\n $result[$linkId]['label'] = $linkCode;\n $result[$linkId]['color'] = $this->colorRandomizer();\n $result[$linkId]['data'] = array();\n $stmt1 = $db->prepare(\"SELECT CONCAT(MONTH(dateCreated), '/', DAY(dateCreated), '/', YEAR(dateCreated)) AS days, COUNT(id) as count FROM linkclicks WHERE dateCreated >= NOW() - INTERVAL 7 DAY AND linkId = ? GROUP BY days\");\n $stmt1->bind_param('i', $linkId);\n $stmt1->execute();\n $stmt1->bind_result($days, $count);\n while ($stmt1->fetch()) {\n array_push($result[$linkId]['data'], array($days=>$count));\n }\n $stmt1->close();\n }\n $stmt->free_result();\n $stmt->close();\n header('Content-Type: application/json');\n echo !empty($result) ? json_encode($result) : 'false';\n die();\n }", "public function click($id)\n\t{\n\t\t$this->connection()->post(\"element/$id/click\", array());\n\t}", "public function marketingCampaignsIdLinksClickedLinkClickedIdGet($id, $link_clicked_id)\n {\n list($response) = $this->marketingCampaignsIdLinksClickedLinkClickedIdGetWithHttpInfo($id, $link_clicked_id);\n return $response;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load the main content depending on what type is selected
private static function loadContent($type, $id) { $db = self::getDB(); $query = $db->getQuery(true); $cond = array($db->quoteName('r.driver') . ' = ' . $db->quoteName('d.id'), $db->quoteName('r.event') . ' = ' . $db->quoteName('e.id'), $db->quoteName('rding.passenger') . ' = ' . $db->quoteName('p.id'), $db->quoteName('rding.ride') . ' = ' . $db->quoteName('r.id')); if ($type != 'all') { if ($type == 'driver') { array_push($cond, $db->quoteName('d.id') . ' = ' . $db->quote($id)); } else if ($type == 'passenger') { array_push($cond, $db->quoteName('p.id') . ' = ' . $db->quote($id)); } } $query ->select($db->quoteName(array('e.id', 'e.name', 'e.date', 'd.id', 'd.firstname', 'd.lastname', 'p.firstname', 'p.lastname', 'r.place', 'r.time', 'r.n'), array('eid', 'ename', 'edate', 'did', 'dfirst', 'dlast', 'pfirst', 'plast', 'place', 'time', 'n'))) ->from($db->quoteName(array('driver', 'event', 'passenger', 'ride', 'riding'), array('d', 'e', 'p', 'r', 'rding'))) ->where($cond) ->order(array($db->quoteName('e.date') . ' asc', $db->quoteName('d.id') . ' asc')); $db->setQuery($query); return $db->loadObjectList(); }
[ "private function mainContent(){\r\n if ($this->model->showPage){\r\n $this-> beginMainContent();\r\n $this-> middleMainContent();\r\n $this-> endMainContent();\r\n }\r\n else {\r\n $this->htmlElement('p', 'Page['.$this->model->page.'] not found', 'text-center lead text-danger');\r\n }\r\n }", "private function LoadContent() {\r\n echo '<section id=\"main\">\r\n <section id=\"content\">';\r\n include $this->Path['includes'] . $this->currentPage . '.php';\r\n echo '</section>';\r\n include $this->Path['core'] . 'footer.html';\r\n echo '</section>';\r\n }", "public function loadContent()\n {\n }", "public function loadMainPanel(){\n \n if($this->_static == ''){\n \n $this->setMainPanel();\n $this->loadTemplate($this->mainpanel,'main');\n }\n else{\n $this->response->setContent(require PROJECT_PATH .DS. $this->_static);\n }\n }", "public function ajax_load_main_image_editor() {\n\t\t$slide_default_settings = BQW_SliderPro_Settings::getSlideSettings();\n\n\t\t$data = json_decode( stripslashes( $_POST['data'] ), true );\n\t\t$content_type = isset( $_POST['content_type'] ) ? $_POST['content_type'] : $slide_default_settings['content_type']['default_value'];\n\t\t$content_class = $content_type === 'custom' ? 'custom' : 'dynamic';\n\n\t\tinclude( 'views/main-image-editor.php' );\n\n\t\tdie();\n\t}", "public function load_content() {\n\t\t\t$template = \\rtCamp\\WP\\rtPeople\\RTPEOPLE_PATH . 'templates/content-people.php';\n\n\t\t\t//filters template to load for content\n\t\t\t$template = apply_filters( 'rt_load_content_template', $template );\n\t\t\t$location = locate_template( 'template-parts/content-people.php', true );\n\t\t\tif ( '' === $location ) {\n\t\t\t\tload_template( $template );\n\t\t\t}\n\t\t}", "function main($content,$conf)\t{\n\t\tglobal $TSFE;\n\n\t\t// GETTING configuration for the extension:\n\t\t$confArray = unserialize($GLOBALS[\"TYPO3_CONF_VARS\"][\"EXT\"][\"extConf\"][\"rlmp_tmplselector\"]);\n\t\t$tmplConf = $TSFE->tmpl->setup[\"plugin.\"][\"tx_rlmptmplselector_pi1.\"];\n\t\t$rootLine = $TSFE->rootLine;\n\t\t$pageSelect = t3lib_div::makeInstance('t3lib_pageSelect');\n\t\t\n\t\t\t// If we should inherit the template from above the current page, search for the next selected template\n\t\t\t// and make it the default template\n\t\tif (is_array ($rootLine)) {\n\t\t\tif (intval($tmplConf['inheritMainTemplates']) == 1) {\n\t\t\t\tforeach ($rootLine as $rootLinePage) {\n\t\t\t\t\t$page = $pageSelect->getPage ($rootLinePage['uid']);\t\t\t\t\t\n\t\t\t\t\tif ($page['tx_rlmptmplselector_main_tmpl']) {\n\t\t\t\t\t\t$tmplConf['defaultTemplateFileNameMain'] = $tmplConf['defaultTemplateObjectMain'] = $page['tx_rlmptmplselector_main_tmpl'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (intval($tmplConf['inheritSubTemplates']) == 1) {\n\t\t\t\tforeach ($rootLine as $rootLinePage) {\n\t\t\t\t\t$page = $pageSelect->getPage ($rootLinePage['uid']);\n\t\t\t\t\tif ($page['tx_rlmptmplselector_ca_tmpl']) {\n\t\t\t\t\t\t$tmplConf['defaultTemplateFileNameSub'] = $tmplConf['defaultTemplateObjectSub'] = $page['tx_rlmptmplselector_ca_tmpl'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\t// Determine mode: If it is 'file', work with external HTML template files\n\t\tif ($confArray['templateMode']=='file') {\n\t\t\t\t// Getting the \"type\" from the input TypoScript configuration:\n\t\t\tswitch ((string)$conf['templateType']) {\n\t\t\t\tcase 'sub':\n\t\t\t\t\t$templateFile = $TSFE->page['tx_rlmptmplselector_ca_tmpl'];\n\t\t\t\t\t$relPath = $tmplConf['templatePathSub'];\n\t\t\t\t\t\t// Setting templateFile reference to the currently selected value - or the default if not set:\n\t\t\t\t\tif (! $templateFile) { $templateFile = $tmplConf['defaultTemplateFileNameSub']; }\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'main':\n\t\t\t\t\tdefault:\n\t\t\t\t\t$templateFile = $TSFE->page['tx_rlmptmplselector_main_tmpl'];\n\t\t\t\t\t$relPath = $tmplConf['templatePathMain'];\n\t\t\t\t\t\t// Setting templateFile reference to the currently selected value - or the default if not set:\n\t\t\t\t\tif (! $templateFile) { $templateFile = $tmplConf['defaultTemplateFileNameMain']; }\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t \n\t\t\tif ($relPath) { // if a value was found, we dare to continue\n\t\t\t\tif (strrpos ($relPath, '/') != strlen ($relPath) - 1) {\n\t\t\t\t\t$relPath .= '/';\n\t\t\t\t }\n\t\t\t\t// get absolute filepath:\n\t\t\t\t$absFilePath = t3lib_div::getFileAbsFileName($relPath.$templateFile);\n\t\t\t\tif ($absFilePath && @is_file($absFilePath)) {\n\t\t\t\t\t$content = t3lib_div::getURL($absFilePath);\t\t\t\n\t\t\t\t\treturn $content;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t// Don't use external files - do it the TS way instead\n\t\tif ($confArray['templateMode']=='ts') {\n\n\t\t\t\t// Getting the \"type\" from the input TypoScript configuration:\n\t\t\tswitch ((string)$conf['templateType']) {\n\t\t\t\tcase 'sub':\n\t\t\t\t\t$templateObjectNr = $TSFE->page['tx_rlmptmplselector_ca_tmpl'];\n\t\t\t\t\tif (!$templateObjectNr) {\t$templateObjectNr = $tmplConf['defaultTemplateObjectSub'];\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'main':\n\t\t\t\tdefault:\n\t\t\t\t\t$templateObjectNr = $TSFE->page['tx_rlmptmplselector_main_tmpl'];\n\t\t\t\t\tif (!$templateObjectNr) {\t$templateObjectNr = $tmplConf['defaultTemplateObjectMain'];\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t\t// Parse the template\n\t\t\t$lConf = &$tmplConf['templateObjects.'][(string)$conf['templateType'].'.'][$templateObjectNr.'.'];\n\t\t\t$content = $this->cObj->TEMPLATE ($lConf);\n\t\t\treturn $content;\t \t \n\t\t}\n\t}", "protected function pick_view() {\t\t\n\t $sections = array_reverse($this->section_stack);\n\t if($this->is_page()) $type = \"page\";\n\t else $type = \"list\";\n\t $this->use_view = \"cms_\".$type;\n\t //if languages exist check for generics with language attached\n\t if($has_language = (count($this->langauges > 1)) && ($lang_id = Session::get(\"wildfire_language_id\")) && $this->languages[$lang_id]){\n\t $language_suffix = \"_\".$this->languages[$lang_id];\n\t if(!$this->use_format && $this->is_viewable($this->use_view.$language_suffix)) $this->use_view .= $language_suffix;\n\t \tif($this->is_viewable($this->use_view.$language_suffix, $this->use_format)) $this->use_view .= $language_suffix;\n\t if(!$this->use_format && $this->is_viewable($this->controller.\"/\".$this->use_view.$language_suffix)) $this->use_view .= $language_suffix;\n\t \tif($this->is_viewable($this->controller.\"/\".$this->use_view.$language_suffix, $this->use_format)) $this->use_view .= $language_suffix;\n }\n\t \n\t foreach($sections as $section) {\n\t $view = \"cms_\".$section.\"_\".$type;\n\t $check_view = $this->controller.\"/\".$view;\n\t if(!$this->use_format && $this->is_viewable($check_view)) $this->use_view = $view;\n\t \tif($this->is_viewable($check_view, $this->use_format)) $this->use_view = $view;\n \t\tif($has_language){\n \t if(!$this->use_format && $this->is_viewable($check_view.$language_suffix)) $this->use_view = $view.$language_suffix;\n \t \tif($this->is_viewable($check_view.$language_suffix, $this->use_format)) $this->use_view = $view.$language_suffix;\n \t }\n\t }\n\n\t\tif($this->is_page() && $this->is_viewable($this->controller.\"/cms_\".$this->cms_content->url.\"_\".$type,$this->use_format) ) $this->use_view = \"cms_\".$this->cms_content->url.\"_\".$type;\n\t\tif($has_language){\n \t\tif($this->is_page() && $this->is_viewable($this->controller.\"/cms_\".$this->cms_content->url.\"_\".$type.$language_suffix,$this->use_format) ) $this->use_view = \"cms_\".$this->cms_content->url.\"_\".$type.$language_suffix;\n \t}\n \t\n\t\tif($has_language){\n if(!$this->use_format && is_readable(VIEW_DIR.\"layouts/\".$this->use_layout.\"_\".$this->languages[$lang_id])) $this->use_layout .= \"_\".$this->languages[$lang_id];\n \t if(is_readable(VIEW_DIR.\"layouts/\".$this->use_layout.\"_\".$this->languages[$lang_id].\".\".$this->use_format)) $this->use_layout .= \"_\".$this->languages[$lang_id];\n\t }\n\t}", "function loadContent(){\n\n\t\t/* Initialize output var */\n\t\t$output = '';\n\n\t\t/* Set Initial Tags */\n\t\t$this->setTags();\n\n\t\tif(isset($_GET['photo_id']) && isset($_GET['secret'])){ // Single Photo Pages\n\n\t\t\t/* Single Photos */\n\t\t\t$photo_id = $_GET['photo_id'];\n\t\t\t$secret = $_GET['secret'];\n\t\t\t$output .= $this->printPhoto($photo_id,$secret);\n\n\t\t} elseif(isset($_GET['search'])){ // Search Page\n\n\t\t\t/* For Search & Tags */\n\t\t\t$search = $_GET['search'];\n\t\t\t$page = isset($_GET['page']) ? $_GET['page'] : 1;\n\t\t\t$tags = isset($_GET['tags']) ? $_GET['tags'] : false;\n\n\t\t\t/* Print Search */\n\t\t\t$output .= $this->printSearch($search, $page, 'search', $tags);\n\n\t\t} elseif(isset($_GET['recent'])){ // Recent Photos\n\n\t\t\t/* Basically the Same as the Search Function but without a Query */\n\t\t\t$page = isset($_GET['page']) ? $_GET['page'] : 1;\n\t\t\t$output .= $this->printSearch(false, $page, 'recent');\n\n\t\t} elseif( isset($_GET['set']) && isset($_GET['id'])) { // Load Set if Called\n\n\t\t\t/* For Sets */\n\t\t\t$set = $_GET['set'];\n\t\t\t$id = $_GET['id'];\n\n\t\t\t/* Print Set */\n\t\t\t$output .= $this->printSet($id);\n\n\t\t} elseif( isset($_GET['about']) ){ // About Page\n\n\t\t\t/* About Page */\n\t\t\t$output .= $this->printUserInfo();\n\n\t\t} elseif( isset($_GET['collections'])){\n\n\t\t\t/* Collections Page, Maybe Home Page Soon */\n\t\t\t$output .= $this->printCollections();\n\n\t\t} else { // Same as elseif( isset($_GET['home']\n\n\t\t\t/* Default to Home Page */\n\t\t\t$output .= $this->printSets();\n\t\t}\n\t\treturn $output;\n\t}", "public function load_single_page()\n {\n $id = isset($_GET['id']) ? sanitize_text_field($_GET['id']) : 0;\n $layout = isset($_GET['layout']) ? sanitize_text_field($_GET['layout']) : 'm1';\n \n // Initialize the skin\n $this->initialize(array('id'=>$id, 'layout'=>$layout));\n \n // Fetch the events\n $this->fetch();\n \n // Return the output\n echo $this->output();\n exit;\n }", "function display_contents_by_page_type()\n{\n\n global $current_page_obj;\n\n display_contents_by_theme($current_page_obj->type);\n}", "public function loader() {\r\n // if the file is not there\r\n $load_file = '';\r\n $cms_page_id = FALSE;\r\n $cms_content = '';\r\n $file = $this->view_path . '/' . $this->page_name . '.php';\r\n\r\n if ( !file_exists($file) ) {\r\n\r\n $cms_page_id = $this->is_cms_page( $this->page_name );\r\n\r\n if ( !$cms_page_id )\r\n $load_file = $this->view_path . '/' . '404.php';\r\n\r\n\t} else {\r\n\r\n $load_file = $file;\r\n\r\n }\r\n\r\n //Include the template or echo cms content\r\n if ( $cms_page_id ){\r\n\r\n $pageData = $this->get_cms_page_content( $cms_page_id );\r\n $pageTitle = $pageData['title'];\r\n $pageContent = $pageData['content'];\r\n\r\n echo '<div class=\"cmspage-wrapper\">';\r\n echo '<h1 class=\"cmspage-title\">'.$pageTitle.'</h1>';\r\n echo '<div class=\"page-content\">'.$pageContent.'</div>';\r\n echo '</div>';\r\n\r\n }\r\n else\r\n include $load_file;\r\n }", "function main_page($content,$conf) {\n\t\t$this->conf =$conf;\n\n\t\t\t// Current page record which we MIGHT manipulate a little:\n\t\t$pageRecord = $GLOBALS['TSFE']->page;\n\t\t$this->tmplTFdata = unserialize($pageRecord['tx_typoflash_data']);\n\t\t$this->tmplTFdata = $this->tmplTFdata[$pageRecord['tx_typoflash_template']];\n\t\t\n\t\t\t// Find Template in root line IF there is no Data Structure set for the current page:\n\t\tif (!$pageRecord['tx_typoflash_template'])\t{\n\t\t\t\n\t\t\tforeach($GLOBALS['TSFE']->tmpl->rootLine as $pRec)\t{\n\t\t\t\t\n\t\t\t\tif ($pageRecord['uid'] != $pRec['uid'])\t{\n\t\t\t\t\tif ($pRec['tx_typoflash_template'])\t{\t// If there is a next-level DS:\n\t\t\t\t\t\t$pageRecord['tx_typoflash_template'] = $pRec['tx_typoflash_template'];\n\t\t\t\t\t\t$this->tmplTFdata = unserialize($pRec['tx_typoflash_data']);\n\t\t\t\t\t\t$this->tmplTFdata = $this->tmplTFdata[$pRec['uid']];\n\t\t\t\t\t} \n\t\t\t\t} else break;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\treturn $this->renderElement($pageRecord, 'pages');\n\n }", "public function loadPage()\n {\n // Navigation\n $data['nav'] = $this->loadNavigation($this->page);\n $data['pageNow'] = $this->page;\n $data['theme'] = $this->getTheme();\n\n // Home\n if ($this->page == 'home') {\n \\HbgStyleGuide\\View::show('home', $data);\n return true;\n }\n\n // Sections\n $data['docs'] = $this->loadPageDocumentation($this->page);\n \\HbgStyleGuide\\View::show('sections', $data);\n return true;\n }", "public function loadasset($type){\n switch($type){\n case \"misc\":\n $files = \\Miscfile::all();\n return \\View::make('backend/assets/list')->withFiles($files);\n break;\n }\n }", "public function main()\r\n\t{\r\n\t\t$content = $this->content;\r\n\r\n\t\t$this->output('<div class=\"qa-main'.(@$this->content['hidden'] ? ' qa-main-hidden' : '').'\">');\r\n\r\n\t\tif ((qa_request()!='questions')\t&& ((qa_request()!='tag')) ) { \r\n\t\t\t$this->output('<div class=\"qa-page-title-error\">');\r\n\t\t\t$this->page_title_error();\r\n\t\t\t$this->output('</div>');\r\n\t\t}\r\n\r\n\t\t$this->widgets('main', 'top');\r\n\t\t$this->widgets('main', 'high');\r\n\r\n\t\t// Tabs\r\n\t\t$this->nav('sub');\r\n\r\n\t\t// Second row of tabs\r\n\t\t$sub_navi_second = isset($content['sub-navi-second']) ? : '';\t\t\r\n\t\tif ($sub_navi_second) {\r\n\t\t\t$this->output($sub_navi_second);\r\n\t\t}\r\n\t\t\r\n\t\t$this->main_parts($content);\r\n\t\t$this->widgets('main', 'low');\r\n\t\t$this->page_links();\r\n\t\t$this->suggest_next();\r\n\t\t$this->widgets('main', 'bottom');\r\n\t\t$this->output('</div> <!-- END qa-main -->', '');\r\n\t}", "public function pageLoad()\n {\n global $objGeneral;\n global $oCache;\n $objCore = new Core();\n $objReport = new Reports();\n $objClassCommon = new ClassCommon();\n \n if(isset($_REQUEST['section']) && $_REQUEST['section'] != ''){ //Requesting for sections\n $sectionName=$_REQUEST['section']; \n if($sectionName=='orders'){ //Orders Section\n $actionName=(isset($_REQUEST['action']) && $_REQUEST['action'] != '') ? $_REQUEST['action']: 'today';\n \n //echo $actionName;\n \n }\n if($sectionName=='visitors'){ //Orders Section\n $this->arrData['content']=$objReport->getUniqueVisitorsData(); \n }\n }else{ //Reuesting for dashboard\n $this->arrData['section']='dashboard';\n $this->arrData['content']=$objReport->getDashboardData();\n }\n \n }", "public function load_contents_by_category() {\n \n // Get contents\n (new MidrubBaseAdminCollectionFrontendHelpers\\Contents)->load_contents_by_category();\n \n }", "public function loadPage() {\n //We have to insert the following pages.\n /*\n * 1. Header\n\t\t *\t-> Admin Ajax / User Ajax\n * 2. Navigation Bar\n\t\t *\t-> Admin navBar / User navBar\n * 3. Main Body\n * 4. Footer\n */\n\t\t//First we decide whether the page is an admin page or not.\n\t\tglobal $session;\n\t\tif(stripos($this->pageName, 'admin') === false)\t{\n\t\t\t$navBarType = 'user';\n\t\t\t$this->setTemplateVar('isadmin', 0);\n\t\t\t//We Load the data for the top fixed infobar.\n\t\t\t$this->setTemplateVar('currentBalance', getCurrentBalance());\n\t\t\t$this->setTemplateVar('prodQueueCount', getProdQueueCount());\n\t\t\t$this->setTemplateVar('username', $session->getUserName());\n\t\t} else {\n\t\t\t$navBarType = 'admin';\n\t\t\t$this->setTemplateVar('isadmin', 1);\n\t\t}\n\t\t\n\t\t//Now we also have to note wheather the user is an admin user or not.\n\t\t$this->setTemplateVar('isAdminUser', ($session->isAdminUser() ? 1 : 0));\n\t\t\n\t\t//Now we load all the pages.\n\t\tinclude $this->rootPath.'templates/header.php';\n\t\tinclude $this->rootPath.'templates/'.$navBarType.'_navbar.php';\n\t\tinclude $this->rootPath.'templates/t_'.$this->pageName.'.php';\n\t\tinclude $this->rootPath.'templates/footer.html';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get date of birth
public function getDateofBirth() { return $this->dateOfBirth; }
[ "function getBirthDate()\n {\n $evBirth = $this->getBirthEvent();\n if ($evBirth)\n return $evBirth->getDate($this->bprivlim);\n else\n return '';\n }", "public function getDateBirth()\n {\n return $this->dateBirth;\n }", "public function getDateOfBirth() {\n\t\treturn $this->dateOfBirth;\n\t}", "public function getBirthDate()\n {\n return $this->birth_date;\n }", "protected function getBirthDate()\n {\n return $this->birthDate;\n }", "public function getBirthDate()\n {\n return $this->getIfSetDate('birthDate');\n }", "public function getDateOfBirth() {\n return $this->dateOfBirth;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getBirthDate()\n {\n [$year, $month, $day] = $this->getYearMonthDate();\n\n return DateTime::createFromFormat('Y-m-d H:i:s', \"$year-$month-$day 00:00:00\");\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }", "public function getBirthdate()\r\n {\r\n return $this->birthdate;\r\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getDate_of_birth()\n {\n return $this->date_of_birth;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getDateOfBirth()\n {\n return isset($this->DateOfBirth) ? $this->DateOfBirth : null;\n }", "public function getBirthDay()\n {\n return $this->birth_day;\n }", "public function getBirthdate()\n {\n if (is_null($this->birthdate)) {\n return null;\n }\n\n return $this->birthdate;\n }", "function getBirthday() \n {\n return $this->getValueByFieldName( 'ren_birthday' );\n }", "function getBirthDate()\n {\n return $this->__birthdate ;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Escape keyword to force it to be parsed as one term
public static function escape($keyword) { return '\\' . implode('\\', str_split($keyword)); }
[ "public function registerKeyword(/*string*/ $keyword);", "public function enclose(string $keyword): string\n {\n return $this->getConnector()->enclose($keyword);\n }", "public function placeholder_escape()\n {\n }", "public function applySearchKeyword($searchKeyword = \"\");", "public static function escape_term($term) {\n $term = trim($term);\n if (empty($term)) {\n return '';\n }\n if (($term{0} == '\"' && $term{strlen($term)-1} == '\"')\n || $term{0} == '(' && $term{strlen($term)-1} == ')') {\n return $term;\n }\n if (strpos($term, ' TO ') !== FALSE) {\n return $term;\n }\n\n if (strpos($term, ' ') !== FALSE) {\n return Drupal_Apache_Solr_Service::phrase($term);\n }\n return Drupal_Apache_Solr_Service::escape($term);\n }", "function secure_keyword($search)\r\n {\r\n $secured = str_replace(\" \",\"\",trim(str_replace(\"\\'\",\"'\",$search)));\r\n if(strpos($secured,\"'\")>-1 && strpos($secured,\"n'\")===false) { return $this->nullstring; }\r\n return $secured;\r\n }", "public function enableKeyword($word);", "public static function sanitizeKeyword($keyword)\n\t{\n\t\t$keyword = strtoupper($keyword);\n\t\t$valid_keywords = array(\n\t\t'ABS','ALL','ALLOCATE','ALTER','AND','ANY','ARE','ARRAY','AS','ASENSITIVE','ASYMMETRIC','AT','ATOMIC','AUTHORIZATION','AVG',\n\t\t'BEGIN','BETWEEN','BIGINT','BINARY','BLOB','BOOLEAN','BOTH','BY',\n\t\t'CALL','CALLED','CARDINALITY','CASCADED','CASE','CAST','CEIL','CEILING','CHAR','CHAR_LENGTH','CHARACTER','CHARACTER_LENGTH','CHECK','CLOB','CLOSE','COALESCE','COLLATE','COLLECT','COLUMN','COMMIT','COMPARABLE','CONDITION','CONNECT','CONSTRAINT','CONVERT','CORR','CORRESPONDING','COUNT','COVAR_POP','COVAR_SAMP','CREATE','CROSS','CUBE','CUME_DIST','CURRENT','CURRENT_CATALOG','CURRENT_DATE','CURRENT_DEFAULT_TRANSFORM_GROUP','CURRENT_PATH','CURRENT_ROLE','CURRENT_SCHEMA','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_TRANSFORM_GROUP_FOR_TYPE','CURRENT_USER','CURSOR','CYCLE',\n\t\t'DATE','DAY','DEALLOCATE','DEC','DECIMAL','DECLARE','DEFAULT','DELETE','DENSE_RANK','DEREF','DESCRIBE','DETERMINISTIC','DISCONNECT','DISTINCT','DO','DOUBLE','DROP','DYNAMIC',\n\t\t'EACH','ELEMENT','ELSE','ELSEIF','END','END_EXEC','ESCAPE','EVERY','EXCEPT','EXEC','EXECUTE','EXISTS','EXIT','EXP','EXTERNAL','EXTRACT',\n\t\t'FALSE','FETCH','FILTER','FIRST_VALUE','FLOAT','FLOOR','FOR','FOREIGN','FREE','FROM','FULL','FUNCTION','FUSION',\n\t\t'GET','GLOBAL','GRANT','GROUP','GROUPING',\n\t\t'HANDLER','HAVING','HOLD','HOUR',\n\t\t'IDENTITY','IN','INDICATOR','INNER','INOUT','INSENSITIVE','INSERT','INT','INTEGER','INTERSECT','INTERSECTION','INTERVAL','INTO','IS','ITERATE',\n\t\t'JOIN',\n\t\t'LAG','LANGUAGE','LARGE','LAST_VALUE','LATERAL','LEAD','LEADING','LEAVE','LEFT','LIKE','LIKE_REGEX','LN','LOCAL','LOCALTIME','LOCALTIMESTAMP','LOOP','LOWER',\n\t\t'MATCH','MAX','MAX_CARDINALITY','MEMBER','MERGE','METHOD','MIN','MINUTE','MOD','MODIFIES','MODULE','MONTH','MULTISET',\n\t\t'NATIONAL','NATURAL','NCHAR','NCLOB','NEW','NO','NONE','NORMALIZE','NOT','NTH_VALUE','NTILE','NULL','NULLIF','NUMERIC',\n\t\t'OCCURRENCES_REGEX','OCTET_LENGTH','OF','OFFSET','OLD','ON','ONLY','OPEN','OR','ORDER','OUT','OUTER','OVER','OVERLAPS','OVERLAY',\n\t\t'PARAMETER','PARTITION','PERCENT_RANK','PERCENTILE_CONT','PERCENTILE_DISC','POSITION','POSITION_REGEX','POWER','PRECISION','PREPARE','PRIMARY','PROCEDURE',\n\t\t'RANGE','RANK','READS','REAL','RECURSIVE','REF','REFERENCES','REFERENCING','REGR_AVGX','REGR_AVGY','REGR_COUNT','REGR_INTERCEPT','REGR_R2','REGR_SLOPE','REGR_SXX','REGR_SXY','REGR_SYY','RELEASE','REPEAT','RESIGNAL','RESULT','RETURN','RETURNS','REVOKE','RIGHT','ROLLBACK','ROLLUP','ROW','ROW_NUMBER','ROWS',\n\t\t'SAVEPOINT','SCOPE','SCROLL','SEARCH','SECOND','SELECT','SENSITIVE','SESSION_USER','SET','SIGNAL','SIMILAR','SMALLINT','SOME','SPECIFIC','SPECIFICTYPE','SQL','SQLEXCEPTION','SQLSTATE','SQLWARNING','SQRT','STACKED','START','STATIC','STDDEV_POP','STDDEV_SAMP','SUBMULTISET','SUBSTRING','SUBSTRING_REGEX','SUM','SYMMETRIC','SYSTEM','SYSTEM_USER',\n\t\t'TABLE','TABLESAMPLE','THEN','TIME','TIMESTAMP','TIMEZONE_HOUR','TIMEZONE_MINUTE','TO','TRAILING','TRANSLATE','TRANSLATE_REGEX','TRANSLATION','TREAT','TRIGGER','TRIM','TRIM_ARRAY','TRUE','TRUNCATE',\n\t\t'UESCAPE','UNDO','UNION','UNIQUE','UNKNOWN','UNNEST','UNTIL','UPDATE','UPPER','USER','USING',\n\t\t'VALUE','VALUES','VAR_POP','VAR_SAMP','VARBINARY','VARCHAR','VARYING',\n\t\t'WHEN','WHENEVER','WHERE','WIDTH_BUCKET','WINDOW','WITH','WITHIN','WITHOUT','WHILE',\n\t\t'YEAR');\n\n\t\tif (in_array($keyword, $valid_keywords)) {\n\t\t\treturn $keyword;\n\t\t} else {\n\t\t\tthrow new InvalidSQLException(\"Not a valid SQL keyword: '$keyword'\");\n\t\t}\n\t}", "function tag_escape($tag_name)\n {\n }", "protected function quoteTerm($term)\n {\n $term = str_replace(\"%\", \"*\", $term); // Mssql wildcard is *\n return '\"'.$term.'\"';\n }", "private function escapeMultiwords($query) {\n $query = ' ' . $query . ' ';\n for ($i = count($this->context->dictionary->multiwords); $i--;) {\n $multiword = $this->context->dictionary->multiwords[$i];\n $query = str_replace(' ' . $multiword . ' ', ' \"' . $multiword . '\" ', $query);\n }\n return trim($query);\n }", "function highlight_keywords($text, $keywords)\n{\n foreach ($keywords as $kw) {\n $kw_len = strlen($kw);\n list($done, $remaining) = ['', $text];\n\n while (TRUE) {\n $pos = stripos($remaining, $kw);\n if ($pos !== FALSE) {\n # match -> escape the prefix, highlight the kw, and continue\n $match = substr($remaining, $pos, $kw_len);\n $done .=\n htmlspecialchars(substr($remaining, 0, $pos))\n . \"<span class=\\\"caption-highlight\\\">$match</span>\";\n $remaining = \n substr($remaining, $pos + $kw_len);\n } else {\n # no match -> escape the remaining text, and break\n $text = $done . htmlspecialchars($remaining);\n break;\n }\n }\n }\n\n return $text;\n}", "static public function addKeyword($new_keyword) {\n\t\tself::$page_keywords[] = (string)trim($new_keyword);\n\t}", "public function format_search_keyword($keyword){\n\t\t$prefix_key = '+'.$keyword;\n\t\t$format = str_replace(' ', ' +', $prefix_key);\n\t\t$format_amp = str_replace('||', '&', $format);\n\t\treturn $format_amp;\n\t}", "function handleEOFQuote($word, $pevent)\n {\n // echo $this->wp->getPos() . \": word=|$word|\\t\\t\\tlastword=|$this->p_vars['last_word']|\\n\";\n if (trim($this->p_vars['last_word']) == \"<<<\")\n {\n // ok we found the keyword\n //echo \"Keyword == $word\\n\";\n $this->p_vars['oldtoken'] = $this->tokens[STATE_EOFQUOTE];\n $this->tokens[STATE_EOFQUOTE] = array($word);\n } \n else if ($this->p_vars['last_pevent'] || PARSER_EVENT_EOFQUOTE) \n {\n // i don't think anything will ever use this so were not going to set it\n //$this->p_vars['quote_data'] = $this->p_vars['last_word']; \n $this->p_vars['event_stack']->popEvent();\n $this->tokens[STATE_EOFQUOTE] = $this->p_vars['oldtoken'];\n }\n }", "public function shouldEscape();", "function handleQuote($word, $pevent)\n {\n if ($this->_pf_inmethod && is_array($word) && $word[0] == T_VARIABLE) {\n $this->_pv_lastvar = $word;\n }\n if ($this->checkEventPush($word, $pevent)) {\n $this->_addoutput($word);\n return;\n }\n if ($this->_pf_quote_active &&\n (($this->_pv_last_word == '\"' && \n $this->_last_pevent != PARSER_EVENT_QUOTE) ||\n (is_array($this->_pv_last_word) && \n $this->_pv_last_word[0] == T_END_HEREDOC &&\n $this->_last_pevent != PARSER_EVENT_EOFQUOTE))\n ) {\n $this->_pf_quote_active = false;\n $this->_wp->backupPos($word);\n $this->_event_stack->popEvent();\n return;\n }\n if (!$this->_pf_quote_active && \n (($this->_pv_last_word == '\"' && \n $this->_last_pevent != PARSER_EVENT_QUOTE) ||\n (is_array($this->_pv_last_word) && \n $this->_pv_last_word[0] == T_END_HEREDOC &&\n $this->_last_pevent != PARSER_EVENT_EOFQUOTE))\n ) {\n if (is_array($word) && $word[0] == T_VARIABLE) {\n $this->_pv_lastvar = $word;\n }\n $this->_pf_quote_active = true;\n $this->_save_highlight_state = $this->_converter->getHighlightState();\n $this->_converter->startHighlight();\n $this->_addoutput($word);\n $this->checkEventPop($word, $pevent);\n return;\n } elseif (is_array($this->_pv_last_word) && \n $this->_pv_last_word[0] == T_CONSTANT_ENCAPSED_STRING\n ) {\n //$this->_pv_quote_data = $this->_pv_last_word[1];\n $this->_event_stack->popEvent();\n $this->_wp->backupPos($word);\n return;\n }\n if ($this->checkEventPop($word, $pevent)) {\n $this->_pf_quote_active = false;\n }\n $this->_addoutput($word);\n }", "public function add_placeholder_escape($query)\n {\n }", "function get_keyword_query()\n\t{\n\t\t$keywords = $this->keywords;\n\t\t$keywords = preg_replace(\"/, /\",\",\",$keywords);\n\t\t$keywords = preg_replace(\"/ ,/\",\",\",$keywords);\n\t\t$keywords = explode(\",\",$keywords);\n\t\t$query = \"\";\n\t\tforeach($keywords as $keyword)\n\t\t{\n\t\t\tif(!empty($query))\n\t\t\t\t$query .=\"%7C\";\n\t\t\t$query .= urlencode($keyword);\n\t\t}\n\t\t\n\t\treturn $query;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if sake installed otherwise install it
protected static function hasSake() { if(file_exists('/usr/bin/sake')) return true; exec('./framework/sake installsake'); self::$event->getIO()->write(":: silverstripe sake was successfully installed"); }
[ "public function needs_installing() {\n\t\t$settings = red_get_options();\n\n\t\tif ( $settings['database'] === '' && $this->get_old_version() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private function checkinstall()\n\t{\n\t\t$file = APPPATH.'controllers/setup/install.php';\n\t\tif ( ! file_exists($file))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static function installToolEnableFileExists() {}", "function ensure_installed($name) {\r\n \t$this->ensure_version($name, \"\");\r\n }", "private function _checkInstalled()\n {\n $request = $this->_symfonyContext->getRequest();\n\n // Prepare the symfony application if it has not been prepared yet\n if (!$this->_symfonyContext->getUser() instanceof sfSympalUser)\n {\n chdir(sfConfig::get('sf_root_dir'));\n $task = new sfSympalEnableForAppTask($this->_dispatcher, new sfFormatter());\n $task->run(array($this->_invoker->getProjectConfiguration()->getApplication()), array());\n\n $this->_symfonyContext->getController()->redirect('@homepage');\n }\n\n /*\n * Redirect to install module if...\n * * not in test environment\n * * sympal has not been installed\n * * module is not already sympal_install\n */\n if (sfConfig::get('sf_environment') != 'test'\n && !sfSympalConfig::get('installed')\n && $request->getParameter('module') != 'sympal_install')\n {\n $this->_symfonyContext->getController()->redirect('@sympal_install');\n }\n\n /*\n * Redirect to homepage if no site record exists so we can prompt the\n * user to create a site record for this application.\n * \n * This check is only ran in dev mode\n */\n if (sfConfig::get('sf_environment') == 'dev'\n && !$this->_sympalContext->getSite()\n && $this->_symfonyContext->getRequest()->getPathInfo() != '/')\n {\n $this->_symfonyContext->getController()->redirect('@homepage');\n }\n }", "public function maybe_install() {\r\n\t\t\r\n\t\t// Need to check db tables exist, activate hook not working in mu-plugins folder. \r\n\t\tif ( get_site_option( 'bp-chat-db-version' ) < BP_CHAT_DB_VERSION )\r\n\t\t\t$this->install();\r\n\t}", "protected function checkInstallation(){\r\n\t\t\r\n\t}", "function can_install();", "function on_stitches_install()\n{\n installer::load();\n\n if (file_exists('site/installation.php')) {\n require_once('site/installation.php');\n }\n\n installer::run();\n}", "function yourls_is_installing() {\n\treturn (bool)yourls_apply_filter( 'is_installing', defined( 'YOURLS_INSTALLING' ) && YOURLS_INSTALLING );\n}", "private function mayInstall()\n {\n $destinationDir = $this->file->get(self::SETTING_DESTINATION_DIR) . DIRECTORY_SEPARATOR;\n\n return !(file_exists($destinationDir . 'composer.json'));\n }", "public static function installed() {\n global $CFG;\n if (!file_exists($CFG->dirroot.'/mod/questionnaire/version.php')) {\n return false;\n }\n return true;\n }", "function canBeInstalled() ;", "function install_check()\n {\n $setup = $this->settings('setup');\n\n\t\t// (TOP) DELETE what's in between after install has been done\n\t\tif( ($setup == null || $setup->get('complete') != 'true') && \n\t\t file_exists('install.php') ){\n\t\t\techo '<p><strong>Database Setup: </strong></p>';\n\t\t\tinclude('install.php');\n\t\t\tdie();\n\t\t}\n\t\t\n }", "protected function checkEnableInstallToolFile() {}", "function checkInstall() {\n if (file_exists($this->_addon . \"install.php\"))\n return true;\n }", "function is_initial_install() : bool {\n\t// Support for PHPUnit & direct calls to install.php.\n\t// phpcs:ignore -- Ignoring requirement for isset on $_SERVER['PHP_SELF'] and wp_unslash().\n\tif ( php_sapi_name() === 'cli' && basename( $_SERVER['PHP_SELF'] ) === 'install.php' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! defined( 'WP_CLI' ) ) {\n\t\treturn false;\n\t}\n\n\t$runner = WP_CLI::get_runner();\n\n\t// Check it's the core command.\n\tif ( $runner->arguments[0] !== 'core' ) {\n\t\treturn false;\n\t}\n\n\t// If it's the is-installed command and --network is set then\n\t// allow MULTISITE to be defined.\n\tif ( $runner->arguments[1] === 'is-installed' && isset( $runner->assoc_args['network'] ) ) {\n\t\treturn false;\n\t}\n\n\t// Check it's an install related command.\n\t$commands = [ 'is-installed', 'install', 'multisite-install', 'multisite-convert' ];\n\tif ( ! in_array( $runner->arguments[1], $commands, true ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function checkInstall(){\r\n\r\n\tif (file_exists(\"install/install.php\")){\r\n\t\t$setupExist = 1;\r\n\t}else{\r\n\t\t$setupExist = 0;\r\n\t}\r\n\treturn ($setupExist);\r\n}", "function checkmk_install() {\n\t$checkmk_bin = \"/usr/local/bin/check_mk_agent\";\n\t$checkmk_url = 'http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/check_mk_agent.freebsd;hb=e13899bde8bdafe13780427811c8153c59be807f';\n\tmwexec(\"/usr/bin/fetch -o {$checkmk_bin} \\\"{$checkmk_url}\\\"\");\n\tchmod($checkmk_bin, 0755);\n\n\t/* Detect possible junk left over after previous bad package versions */\n\tcheckmk_decrapify();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get current active Branch Name If there is no commits (eg new repo) then branch name is 'NEW REPO' This git command needs at least one commit before if show the correct branch name.
public function getCurrentBranch(): string { try { $branchName = $this->command->runCommand($this->initGitCommand() . ' symbolic-ref --short -q HEAD'); } catch (RunGitCommandException $e) { $branchName = $this->getCurrentBranchOldGit(); } if (!$branchName) { return '(No Branch)'; } return trim($branchName); }
[ "public function getCurrentBranchName()\n\t\t{\n\t\t\ttry {\n\t\t\t\t$branch = $this->extractFromCommand(['branch', '-a', '--no-color'], function($value) {\n\t\t\t\t\tif (isset($value[0]) && $value[0] === '*') {\n\t\t\t\t\t\treturn trim(substr($value, 1));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn FALSE;\n\t\t\t\t});\n\n\t\t\t\tif (is_array($branch)) {\n\t\t\t\t\treturn $branch[0];\n\t\t\t\t}\n\n\t\t\t} catch (GitException $e) {\n\t\t\t\t// nothing\n\t\t\t}\n\n\t\t\tthrow new GitException('Getting of current branch name failed.');\n\t\t}", "public function getCurrentBranchName()\n {\n return $this->git->getCurrentBranchName();\n }", "public function getCurrentBranchName() : string\n {\n // Gitlab 9+\n $branchName = getenv('CI_COMMIT_REF_NAME');\n if ($branchName !== false) {\n return $branchName;\n }\n\n $repo = new GitRepository(getcwd());\n return $repo->getCurrentBranchName();\n }", "public function branchName()\n\t\t{\n\t\t\t$output = array();\n\t\t\t$exitCode = NULL;\n\t\t\t\n\t\t\texec('git branch', $output, $exitCode);\n\t\t\t\n\t\t\tif($exitCode === 0 && is_array($output))\n\t\t\t{\n\t\t\t\tforeach($output as $line)\n\t\t\t\t{\n\t\t\t\t\tif($line[0] === '*')\n\t\t\t\t\t{\n\t\t\t\t\t\treturn trim(substr($line, 1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthrow new GitException('Pokus o ziskani jmena aktualni vetvi selhal.');\n\t\t}", "private function getBranchName(): string\n {\n // get the contents of the current HEAD file\n $head = trim(file_get_contents(base_path('.git/HEAD')));\n\n // get the end of the string (ref: refs/heads/{branchName})\n return Str::afterLast($head, '/');\n }", "public function getCurrentBranch(){\n // Look for default branch\n $default_branch = 'master';\n chdir($this->getUrl('localhost', 'path'));\n $cmd = \"git branch -a\";\n $branches = array();\n exec($cmd, $branches);\n foreach ($branches as $branch){\n // Sometimes there is no default set, like for help.git\n $default_branch = $branch;\n if (strpos($branch, '*') === 0){\n $default_branch = str_replace('* ', '', $branch);\n break;\n }\n }\n return $default_branch;\n }", "public function getCurrentBranch()\n\t{\n\t\twith($process = new Process('git rev-parse --abbrev-ref HEAD', getcwd()))->run();\n\n\t\treturn trim($process->getOutput());\n\t}", "public static function branch()\n {\n $head = base_path().'/.git/HEAD';\n\n if (File::exists($head)) {\n $exp = explode('/', File::get($head));\n\n return str_replace(\"\\n\", '', $exp[2]);\n }\n\n return 'master';\n }", "protected function getCurrentBranch() {\n $process = new Process('git rev-parse --abbrev-ref HEAD');\n $process->setTimeout(NULL);\n $process->run();\n\n return trim($process->getOutput());\n }", "public function getBranchName() {\n if ($this->isBranch()) {\n $this->getRefName();\n } else {\n return NULL;\n }\n }", "public function get_current_branch()\n\t{\n\t\t// @codeCoverageIgnoreStart\n\t\t$head_file = base_path('.git/HEAD');\n\t\t$branch_ = file_get_contents($head_file);\n\t\t//separate out by the \"/\" in the string\n\t\t$branch_ = explode('/', $branch_, 3);\n\n\t\treturn trim($branch_[2]);\n\t\t// @codeCoverageIgnoreEnd\n\t}", "public function get_current_branch()\n\t{\n\t\tif ($this->branch == false) {\n\t\t\t$this->branch = @file_get_contents(sprintf('%s/HEAD', $this->git_path()));\n\t\t\tif ($this->branch != false) {\n\t\t\t\t// this is to handle CI where it actually checks a commit instead of a branch\n\t\t\t\tif (substr($this->branch, 0, 4) == 'refs:') {\n\t\t\t\t\t$this->branch = explode('/', $this->branch, 3)[2]; //separate out by the \"/\" in the string\n\t\t\t\t} else {\n\t\t\t\t\t$this->branch = 'master';\n\t\t\t\t\t$this->CI_commit = $this->branch;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLogs::notice(__METHOD__, __LINE__, 'Could not access: ' . $this->git_path() . '/HEAD');\n\t\t\t}\n\t\t\t$this->branch = trim($this->branch);\n\t\t}\n\n\t\treturn $this->branch;\n\t}", "private function getBranchName(): string\n {\n $branchName = trim((new GitWrapper())->git('symbolic-ref --short HEAD', $this->path));\n\n if (null !== $this->logger) {\n $this->logger->notice(sprintf('Bundle \"%s\" is on branch \"%s\".', $this->key, $branchName));\n }\n\n return $branchName;\n }", "public function getCurrentBranch();", "protected function defaultBranch()\n {\n $process = new Process(['git', 'config', '--global', 'init.defaultBranch']);\n\n $process->run();\n\n $output = trim($process->getOutput());\n\n return $process->isSuccessful() && $output ? $output : 'main';\n }", "public function getGitBranch()\n\t{\n\t\treturn $this->config->get('rocketeer::git.branch');\n\t}", "public function getGitBranch()\n {\n $gitBranch = array_reverse(explode(\"/\", trim(file_get_contents(ROOT . DS . \".git\" . DS . \"HEAD\"))))[0];\n return $gitBranch;\n }", "function ozh_show_git_branch( $text ) {\n\tif( $branch = ozh_get_git_branch() ) {\n\t\t$text .= ' <span style=\"color:red;\">&ndash; Git branch: <strong>' . $branch . '</strong></span>';\n\t}\n\treturn $text;\n}", "public function getDefaultBranch(): string\n {\n return $this->defaultBranch;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test send a copy of request
public function testCloneRequest() { $request = Curl\Request::newRequest($this->getTestCallbackUrl()); $params = array( 'param1' => 1, 'param2' => 2, ); $request->setMethod('POST')->addPostParams($params); $result = json_decode($request->send(), true); $this->assertInternalType('array', $result); $this->assertArrayHasKey('param2', $result['params']); $result = null; try { $result = $request->send(); } catch (\BadMethodCallException $e) { } $this->assertNull($result); $request2 = clone $request; $result = $result = json_decode($request2->send(), true); $this->assertInternalType('array', $result); $this->assertArrayHasKey('param2', $result['params']); }
[ "private function _beforeDownloadTest() {\n\t\treturn $this->getRequestMock( function ( ...$args ) {\n\t\t\t$this->requestsArgs = $args;\n\n\t\t\treturn true;\n\t\t} )->andReturnUsing( function ( ...$args ) {\n\t\t\treturn new Response( 200, [], $args[1] );\n\t\t} )->atLeast()->once();\n\t\t//\t$this->getRequestMockSucessfulReturnCaptureArgs( [], $this->skynetDataHeaders );\n\t\t/*\t\t$this->getRequestMock()->andReturnUsing( function ( $url ) {\n\t\t\t\t\treturn new Response(200, [], $url);\n\t\t\t\t});*/\n\t}", "public function should_allow_building_new_response_w_diff_body()\n {\n $response = new Response;\n $cloneResponse = $response->withBody(new StringStream('Hello there!'));\n\n $this->assertNotSame($response,$cloneResponse);\n $this->assertEquals('Hello there!', $cloneResponse->getBody()->getContents());\n }", "abstract public function testSendSuccess();", "function test_http_request_get()\n {\n $data = rand(0, 100000);\n\n $rmt = new mdl_remotes();\n $result = $rmt->http_request(APP_ROOT .\n \"tests/models/network_helpers/test_http_request.php?d=$data\");\n\n $this->assertEquals(sha1($data), $result);\n }", "public function testSingle()\n {\n $request = new DummyRequest();\n $request->setUrl('http://www.example.org/some/other/path');\n $this->assertTrue($request->send());\n $this->assertEquals(\"I am Example\", $request->getResponseBody());\n }", "public function testPostChunked() {\n $this->executeMethod('POST', TRUE);\n }", "public function testCopyBodyStreamWithoutArguments()\n {\n $response = $this->response;\n $testContent = 'copyBodyStreamTestContent';\n $memStream = fopen('php://memory', 'w+');\n fwrite($memStream, $testContent);\n $response->copyBodyStream($memStream);\n rewind($response->getBodyStream());\n $actualRequestContent = fread($response->getBodyStream(), 1024);\n $this->assertSame($testContent, $actualRequestContent);\n }", "public function testUploadPartCopy()\n\t{\n\t\t$url = \"https://\" . $this->options->get(\"testBucket\") . \".\" . $this->options->get(\"api.url\")\n\t\t\t. \"/\" . $this->options->get(\"testObject\") . \"?partNumber=\" . $this->options->get(\"testPartNumber\")\n\t\t\t. \"&uploadId=\" . $this->options->get(\"testUploadId\");\n\t\t$content = \"\";\n\t\t$headers = array(\n\t\t\t\"Date\" => date(\"D, d M Y H:i:s O\"),\n\t\t\t\"x-amz-copy-source\" => \"/jgsoc/my-movie.m2ts?versionId=OYcLXagmS.WaD..oyH4KRguB95_YhLs7\",\n\t\t\t\"x-amz-copy-source-range\" => \"bytes=500-6291456\",\n\t\t);\n\t\t$authorization = $this->object->createAuthorization(\"PUT\", $url, $headers);\n\t\t$headers['Authorization'] = $authorization;\n\n\t\t$this->client->expects($this->once())\n\t\t\t->method('put')\n\t\t\t->with($url, $content, $headers)\n\t\t\t->will($this->returnValue(null));\n\n\t\t$this->assertThat(\n\t\t\t$this->object->put->uploadPartCopy(\n\t\t\t\t$this->options->get(\"testBucket\"),\n\t\t\t\t$this->options->get(\"testObject\"),\n\t\t\t\t$this->options->get(\"testPartNumber\"),\n\t\t\t\t$this->options->get(\"testUploadId\"),\n\t\t\t\t$this->options->get(\"testCopySource\")\n\t\t\t),\n\t\t\t$this->equalTo(null)\n\t\t);\n\t}", "public function testGetSetRequestValid()\n {\n $this->assertEquals($this->request, $this->service->getRequest());\n }", "public function testHttpRequestCopyBodyStreamWithoutArgumentsOnSocketStream()\n {\n $request = $this->request;\n $testContent = 'copyBodyStreamTestContent';\n $streamServer = stream_socket_server('tcp://127.0.0.1:31337');\n $streamClient = fsockopen('tcp://127.0.0.1:31337');\n if (!$streamClient) {\n throw new \\Exception(\"Unable to create socket\");\n }\n $streamConnection = stream_socket_accept($streamServer);\n fwrite($streamConnection, $testContent);\n $request->copyBodyStream($streamClient, strlen($testContent));\n rewind($request->getBodyStream());\n $actualRequestContent = fread($request->getBodyStream(), strlen($testContent));\n $this->assertSame($testContent, $actualRequestContent);\n // close all sockets\n fclose($streamConnection);\n fclose($streamClient);\n fclose($streamServer);\n }", "public function testPutObjectCopy()\n\t{\n\t\t$url = \"https://\" . $this->options->get(\"testBucket\") . \".\" . $this->options->get(\"api.url\")\n\t\t\t. \"/\" . $this->options->get(\"testObjectCopy\");\n\t\t$content = \"\";\n\t\t$headers = array(\n\t\t\t\"Date\" => date(\"D, d M Y H:i:s O\"),\n\t\t\t\"x-amz-grant-read\" => \"uri=\\\"http://acs.amazonaws.com/groups/global/AllUsers\\\"\",\n\t\t\t\"x-amz-grant-write-acp\" => \"emailAddress=\\\"alex.ukf@gmail.com\\\"\",\n\t\t\t\"x-amz-grant-full-control\" => \"id=\\\"6e887773574284f7e38cacbac9e1455ecce62f79929260e9b68db3b84720ed96\\\"\"\n\t\t);\n\t\t$headers[\"x-amz-copy-source\"] = \"/\" . $this->options->get(\"testBucket\")\n\t\t\t. \"/\" . $this->options->get(\"testObject\");\n\t\t$authorization = $this->object->createAuthorization(\"PUT\", $url, $headers);\n\t\t$headers['Authorization'] = $authorization;\n\n\t\t$this->client->expects($this->once())\n\t\t\t->method('put')\n\t\t\t->with($url, $content, $headers)\n\t\t\t->will($this->returnValue(null));\n\n\t\t$this->assertThat(\n\t\t\t$this->object->put->putObjectCopy(\n\t\t\t\t$this->options->get(\"testBucket\"),\n\t\t\t\t$this->options->get(\"testObjectCopy\"),\n\t\t\t\t\"/\" . $this->options->get(\"testBucket\") . \"/\" . $this->options->get(\"testObject\"),\n\t\t\t\t$this->options->get(\"testRequestHeaders\")\n\t\t\t),\n\t\t\t$this->equalTo(null)\n\t\t);\n\t}", "function testMultipleRequests() {\n $request = new TestRequest();\n $response = $request->execute();\n $this->assertTrue(\n strpos($response->getContent(), 'DokuWiki') >= 0,\n 'DokuWiki was not a word in the output'\n );\n\n $request = new TestRequest();\n $response = $request->execute();\n $this->assertTrue(\n strpos($response->getContent(), 'DokuWiki') >= 0,\n 'DokuWiki was not a word in the output'\n );\n }", "abstract public function sendRequest();", "public function testCallClone()\n {\n }", "public function testCopyMultiple()\n {\n $config = array(\n 'test1' => 'new1',\n 'test2' => 'new2',\n );\n $request = array(\n 'Attributes' => array('test1' => array('val1'), 'test2' => array('val2.1','val2.2')),\n );\n $result = self::processFilter($config, $request);\n $attributes = $result['Attributes'];\n $this->assertArrayHasKey('new1', $attributes);\n $this->assertEquals($attributes['new1'], array('val1'));\n $this->assertArrayHasKey('new2', $attributes);\n $this->assertEquals($attributes['new2'], array('val2.1','val2.2'));\n }", "public function testReswebRequest()\n {\n $hash = md5(microtime());\n\n $testData = $this->generateRandomTestJson();\n $this->client->getContainer()->get('event_dispatcher')->dispatch('utilbundle.reswebrequest', new ReswebCallEvent($hash, $testData, get_class($this), 'http://url', 'pairkey-1234567890', 0));\n\n sleep(1);\n\n $lastEntry = $this->getEntryByHash($hash);\n @$getData = $lastEntry['value']['http_request'];\n $this->assertEquals(json_encode($testData), json_encode($getData));\n }", "public function processTestingRequest() {\n\n $this->request = RestUtility::processRequest(false);\n $this->post = $this->request->getRequestVars();\n\n $this->checkAuthentication();\n $this->handleEndpoint();\n //$this->handleResponse();\n }", "public function testPromoteAutomatchUrlUsingGET()\n {\n }", "public function testSend()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get normalized method identifier
public function getId () { if (null !== $this->id) { return $this->id; } $namespace = $this->getNamespace(); $class = $this->getClass(); $name = $this->getName(); $id = ''; $filter = new CamelCaseToDashFilter(); foreach (explode('\\', $namespace) as $segment) { $id .= $filter->filter($segment) . '.'; } $id .= $filter->filter($class) . '.methods.' . $filter->filter($name); $this->id = strtolower($id); return $this->id; }
[ "public function getMethodIdentifier(): string\n {\n return $this->identifier;\n }", "public function getMethodId()\n {\n return \\XLite\\Core\\Request::getInstance()->method_id;\n }", "function ConvertObjcMethodName ($method) {\n\t\t$params = explode(\":\", $method);\n\t\t$name = \"\";\n\t\t$count = 0;\n\t\t\n\t\tif (count($params) > 1) {\n\t\t\tforeach ($params as $value) {\n\t\t\t\tif (eregi(\"([a-zA-Z0-9]+)$\", $value, $captures)) $name .= $captures[1].\"_\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (eregi(\"([a-zA-Z0-9]+)(;)*$\", $params[0], $captures)) $name .= $captures[1].\"_\";\n\t\t}\n\t\t\n\t\t// clean it up\n\t\tif ($this->trailing_underscore) {\n\t\t if (!in_array($method, $this->trailing_underscore_methods)) $name = trim($name, \"_\");\t\n\t\t}\n\t\t\n\t\t$name = $this->ReplaceObjcType($name);\n\t\t\n\t\treturn $name;\n\t}", "public function parsedMethod()\n {\n return strtolower($this->method());\n }", "public function get_normalized_http_method() {\n return strtoupper($this->http_method);\n }", "public function get_normalized_http_method()\n {\n return strtoupper($this->http_method);\n }", "public function getMethodCallId(): string\n {\n return $this->methodCallId;\n }", "private function getMethodNamePrefix(): string\n {\n return (string)substr($this->methodName, 0, self::PREFIX_LENGTH);\n }", "public function getEventIdentifier()\n {\n $namespace = Str::normalizeClassName(get_called_class());\n if (strpos($namespace, '\\\\') === null) {\n return $namespace;\n }\n\n $parts = explode('\\\\', $namespace);\n $class = array_pop($parts);\n $slice = array_slice($parts, 1, 2);\n $code = strtolower(implode('-', $slice) . '-' . $class);\n\n return $code;\n }", "public function get_method_name()\n\t{\n\t\treturn $this->method_name;\n\t}", "private function _convertMethod($method) {\n\t\treturn str_replace('_', '/', $method);\n\t}", "private function __sanitizeMethod($method)\n\t{\n\t\treturn strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $method));\n\t}", "private function __sanitizeMethod($method)\n {\n return strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $method));\n }", "private function _convertMethod($method) {\n return str_replace('_', '.', $method);\n }", "public function parseMethod() {\n // Get request method.\n $component = 'method';\n $resource = $this->parseResourceIdentifier($component);\n\n return ($resource)? $resource : '';\n }", "protected function generateMetadataIdent()\n {\n $ident = preg_replace('/([a-z])([A-Z])/', '$1-$2', static::class);\n $ident = strtolower(str_replace('\\\\', '/', $ident));\n return $ident;\n }", "public function get_normalized_http_method() {\n\t\treturn strtoupper( $_SERVER['REQUEST_METHOD'] );\n\t}", "public function getMethodName();", "protected function getPureMethodNameFromService(){\n $service=$this->getServiceNameAndMethodFromRequestUri();\n return preg_replace('@\\?(.*)@is','',end($service));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Test get_latest_by_remote function +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function test_get_latest_by_remote() { $rmt_mock = new mck_mdl_remotes('',''); $result = get_latest_by_remote($rmt_mock, 'http://localhost/messages/follow/fred'); $this->assertEquals($result[0]['ID'], 3); $this->assertEquals($result[0]['Remote_URL'], 'http://localhost/messages/follow/fred'); $this->assertEquals($result[0]['Remote_name'], 'fred'); $this->assertEquals($result[0]['Remote_message'], 'Message 2 by fred'); }
[ "function test_get_latest_by_local()\n {\n $result = get_latest_by_local(2);\n\n $this->assertEquals($result[0]['ID'], 1);\n $this->assertEquals($result[0]['Message'], 'Message by sue');\n }", "function zabbix_get_last_update($url, $authtoken){\n\t$data = array(\n\t\t'jsonrpc' => \"2.0\",\n\t\t'method' => \"item.get\",\n\t\t'params' => array(\n\t\t\t'output' => array('lastclock'),\n\t\t\t'host' => \"Anycast 91.233.218.254\",\n\t\t\t'application' => \"region1\",\n\t\t\t\"search\" => array (\n \t\t\t\"key_\" => \"to[linx]\"\n \t\t\t),\n\t\t\t),\n\t\t'id' => \"2\",\n\t\t'auth' => $authtoken\n\t\t);\n\t$response = json_request($url, $data);\n\treturn $response['result'];\n}", "public function test_it_Repository_method_getRecent()\n {\n\n }", "public static function getLatest() {\r\n \t$updates = parent::getWhere(\"status = 'public'\",['date'=>'DESC']);\r\n \tif(count($updates) > 0){\r\n \t\treturn $updates[0];\r\n \t}else{\r\n \t\treturn null;\r\n \t}\r\n }", "function get_latest_devlog()\r\n{\r\n\t$query = \"SELECT date_created, id FROM todo_dates WHERE date_created = (SELECT MAX( date_created ) FROM todo_dates)\";\r\n\t$result = mysql_query($query);\r\n\r\n\tif (!$result) {\r\n\t $message = 'Invalid query: ' . mysql_error() . \"\\n\";\r\n\t $message .= 'Whole query: ' . $query;\r\n\t die($message);\r\n\t}\r\n\r\n\t$dbarray = mysql_fetch_array($result);\r\n\t$return_me = $dbarray;\r\n\r\n\tmysql_free_result($result);\r\n\r\n\treturn $return_me;\r\n}", "public function getLatestItem();", "public function testRemote()\n {\n $cache = $this->getCache();\n $cache->set('remote', 'original');\n\n $data = $cache->getOrCreate('remote', array('younger-than' => 'http://google.com'), function() {\n return 'modified';\n });\n $data = $cache->getOrCreate('remote', array('younger-than' => 'ftps://google.com'), function() {\n return 'modified';\n });\n $this->assertEquals('original', $data);\n }", "static private function retrieveOldestCommand(){\n\t\t$ret=null;\n\t\t$dbo=new DB();\n\t\t$db=$dbo->db;\n\t\t$stmt = $db->prepare(\t'SELECT UNIX_TIMESTAMP(min(timestamp)) '.\n\t\t\t\t\t\t\t\t'FROM pipeline '\n\t\t\t\t\t\t\t\t\t);\n\t $stmt->bind_result($ret);\n\t $stmt->execute();\n\t $stmt->fetch();\n\t $stmt->close();\n\t return $ret;\n\t}", "public function getLatestRevision() \n {\n $feed = $this->getServer().'/revision';\n $client = new self(array('curl_options' => array('CURLOPT_URL' => $feed)));\n $response = $client->getResponse();\n\t if (isset($response['content']) && $response['content'] != \"\") {\n\t return $response['content'];\n } else {\n return 0;\n }\n }", "public function test_latestData() {\n\t\t$this->testAction('/reading/latestData/25', array('method' => 'get'));\n\t\t$results = $this->vars;\n\t\t$this->assertEquals(2, count($results[\"readings\"]));\n\t}", "function getLatest($item , $table ,$order, $limit=5){\n global $db ;\n $getStmt = $db ->prepare(\"SELECT $item FROM $table ORDER BY $order DESC LIMIT $limit\"); \n $getStmt ->execute();\n $rows = $getStmt ->fetchAll();\n return $rows; \n }", "public function getRemote_version() { \n\t\t\t$request = wp_remote_get( $this->update_url . '/latest' . ( isset($this->updater_dev) ? $this->updater_dev : '' ) );\n\t\t\tif ( ! is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {\n\t\t\t\treturn $request['body'];\n\t\t\t}\n\t\n\t\t\treturn false;\n\t\t}", "function getLatestUpdated() {\n\t\t\n\t\t$sql = \"\n\t\t\tSELECT IFNULL(MAX(last_updated_order), 0)\n\t\t\tFROM \". DB_PREFIX. ZENARIO_FORUM_PREFIX. \"threads\n\t\t\tWHERE forum_id = \". (int) $this->forumId;\n\t\t\n\t\t$result = ze\\sql::select($sql);\n\t\tlist($latestUpdated) = ze\\sql::fetchRow($result);\n\t\treturn $latestUpdated;\n\t}", "public function getRemote();", "function getLatestVersionOfDB($agbSourceId){\n\t\t//Select row with max published_at value\n\t\t$abfrage = $this->mysqli->prepare(\"SELECT * FROM `agb_version` WHERE published_at = (SELECT MAX(published_at) FROM agb_version WHERE `agb_source_id` like ?) AND `agb_source_id` like ?\");\n\t\t$abfrage->bind_param(\"ii\", $agbSourceId, $agbSourceId);\n\t\t$abfrage->execute();\n\t\t\n\t\t$ergebnis = $abfrage->get_result();\n\n\t\treturn $this->sqlToAGBVersionObject($ergebnis);\n\t}", "public function get_latest()\r\n {\r\n $status = \"'\" . 'LIVE' . \"'\";\r\n $query = $this->db->query(\"SELECT TOP 6\r\n id , \r\n created , \r\n updated , \r\n author_id , \r\n summary , \r\n title , \r\n url , \r\n created_on , \r\n featured_image\r\n FROM articles \r\n WHERE status = $status \r\n ORDER BY created DESC, weight ASC\r\n\");\r\n $articles = array();\r\n foreach ($query->result_object() as $article) {\r\n $date = getdate($article->created_on);\r\n $year = $date['year'];\r\n $month = strtolower($date['month']);\r\n $article->url = $year . '/' . $month . '/' . $article->url;\r\n $articles[] = $article;\r\n }\r\n\r\n $date = getdate();\r\n return array('articles' => $articles, 'block_title' => $date['month'] . ' ' . $date['year']);\r\n }", "public function latest()\n {\n $cache_for = self::CACHE_TIME_IN_HOURS * 60;\n\n $release = $this->cache->remember('fixhub_latest_version', $cache_for, function () {\n $request = Request::get($this->github_url)\n ->expectsJson()\n ->withAccept('application/vnd.github.v3+json');\n\n if (config('fixhub.github_oauth_token')) {\n $request->withAuthorization('token ' . config('fixhub.github_oauth_token'));\n }\n\n $response = $request->send();\n\n if ($response->hasErrors()) {\n return false;\n }\n\n return $response->body;\n });\n\n if (is_object($release)) {\n return $release->tag_name;\n }\n\n return false;\n }", "public function getLatestWithTrashed();", "public function getLatestRevision();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ / / unction to delete a file from server(local/s3) / / / $fileName = name of file / $fileType = type of file(image/video) /
function _deleteFile($fileName, $fileDir) { //echo $fileName; die if ($this->amazons3) { $bucket = bucket; $aws = Aws::factory(APPPATH . 'config/amazoneS3.php'); // Get the client from the service locator by namespace $client = $aws->get('s3'); $newFilePath = $fileName; $existFile = $client->doesObjectExist($bucket, $newFilePath); if ($existFile) { $result = $client->deleteObject(array( // Bucket is required 'Bucket' => bucket, // Key is required 'Key' => $newFilePath, )); if ($result) { return true; } } else { return false; } } else { $filePath = $fileDir . $fileName; if (file_exists($filePath)) { unlink($filePath); } } }
[ "public function DeleteCloudinary($type, $fileName){\n\t\t\t$file = $type . '/' . $fileName;\n\n\t\t\tinclude_once($_SERVER['DOCUMENT_ROOT'].'/vendor/cloudinary/cloudinary_php/autoload.php');\n\t\t\t$result = \\Cloudinary\\Uploader::destroy(\n\t\t\t\t$file, \n\t\t\t\tarray(\n\t\t\t\t\t'resource_type' => $type,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function delete($filename);", "public function deleteUploadedFile ($filename) {\n S3::deleteObject($this->getResourcesPath().\"/\".$filename);\n }", "public function delete($file);", "public function removeFile();", "function delete_file($container, $file_name)\n\t{\n\t\t$my_container = $this->_conn->get_container($container);\n\t\t$my_container->delete_object($file_name);\n\t}", "private function removeUploadedFile()\n {\n if(!isset($_REQUEST['file']))\n {\n exit; \n }\n \n list($file, $src, $size) = explode(':', $_REQUEST['file']);\n \n if(file_exists($src))\n {\n @unlink($src);\n }\n exit;\n }", "function delete_file_from_server($path_name) {\n if (file_exists($path_name)) {\n unlink($path_name);\n }\n}", "public function deleteFile($fileName)\n\t{\n\t\tif(!$this->connected)\n\t\t\tthrow new FTPException('Could not delete file: not connected to remote FTP server');\n \n\t\tif(!ftp_delete($this->resource, $fileName))\n\t\t\tthrow new FTPException('Could not delete file: unknown error');\n\t}", "function audio_delete_files($type, $fileNameArray) {\n\tglobal $path;\n\t$deletePath = $path . $type. \"/\";\n\t\n\tif (!is_array($fileNameArray)) { $fileNameArray = array($fileNameArray); } // if string is passed, turn into array\n\n\tforeach($fileNameArray as $currentFile) {\n\t\tunlink($deletePath . $currentFile);\n\t\t\n\t}\n\t\n\t$msgType = 'success';\n\t$msgText = 'Successfully deleted <strong>'.audio_current($fileNameArray[0]).'</strong>.';\n\treturn array('msgType' => $msgType, 'msgText' => $msgText);\n}", "public function handleFileDelete()\n {\n $uploadRepository = new UploadRepository;\n $uploadedFileResult = $uploadRepository->findWhere('public_id', $_POST['id']);\n if (empty($uploadedFileResult)) {\n echo json_encode([\n 'success' => false,\n 'message' => 'File not found'\n ]);\n exit();\n }\n\n $uploadedFile = $uploadedFileResult[0];\n $uploadRepository->destroy($uploadedFile->id);\n\n $serverFilePath = realpath(phpb_config('storage.uploads_folder') . '/' . $uploadedFile->server_file);\n if ($serverFilePath) {\n unlink($serverFilePath);\n }\n\n $parentDirectory = realpath(phpb_config('storage.uploads_folder') . '/' . dirname($uploadedFile->server_file));\n if ($parentDirectory && dirname($uploadedFile->server_file) !== '.') {\n rmdir($parentDirectory);\n }\n\n echo json_encode([\n 'success' => true\n ]);\n exit();\n }", "function ticket_delete_file()\n {\n ///delete image\n \n UTIL::unlinkFile($_GET['filename'],URI::getAbsMediaPath(CFG::$ticketDir));\n //update database if id is passed\n \n if(APP::$curId!='')\n {\n $arrFields=array(\"image_name\"=>'');\n DB::Update(CFG::$tblPrefix.\"ticket\",$arrFields,\"id = %d \",APP::$curId);\n }\n echo json_encode(array(\"result\" => \"success\"));\n exit;\n }", "public function deleteFile()\n { \n StorageService::deleteFile($this);\n }", "function handleDELETE() {\n\n $id = file_get_contents('php://input');\n\n // test if id was supplied\n if (!isset($id)) {\n \n // Nope, Bad Request\n http_response_code(400);\n return;\n }\n\n // Find the file and remove it from the server\n $success = FilePond\\RequestHandler::deleteTempFile($id);\n\n // will always return success, client has no use for failure state\n\n // no content to return\n http_response_code(204);\n}", "function deleteFile ($page, $url, $pagetype = '', $name = '') {\n\n\tif ($name == '') :\n\t\tif (is_file('../../../uploads/' . $page . '/' . $url)) :\n\t\t\tunlink('../../../uploads/' . $page . '/' . $url);\n\t\tendif;\n\telse :\n\t\t$queryImage = 'SELECT ' . $name . ' FROM ' . PREFIX.$pagetype . ' WHERE id = ' . $_REQUEST['ID'];\n\t\t$resultImage = mysql_query($queryImage) or die(mysql_error());\n\t\t$rowImage = mysql_fetch_assoc($resultImage);\n\t\tif (is_file('../../../uploads/' . $page . '/' . $rowImage[$name])) :\n\t\t\tunlink('../../../uploads/' . $page . '/' . $rowImage[$name]);\n\t\tendif;\n\t\treturn $rowImage[$name];\n\tendif;\n\n}", "private function do_delete()\n\t{\n\n\t\t$this->checkLoggedIn();\n\t\tlist($file_url, $pathFile, $file) = $this->getFileParamsFromPost();\n\n\t\t$fileMarkdown = $file . CONTENT_EXT;\n\n\t\tif( file_exists(CONTENT_DIR . $pathFile . $fileMarkdown ) ) {\n\t\t\t\tdie( unlink(CONTENT_DIR . $pathFile . $fileMarkdown) );\n\t\t}\n\t\telse {\n\t\t\t// Delete asset file\n\t\t\tif( is_file($file_url)) {\n\t\t\t\tunlink($file_url);\n\t\t\t\t\t// Update meta.php\n\t\t\t\t$path = str_replace($file, '', $file_url);\n\t\t\t\tif( file_exists($path . 'meta.php') ) {\n\t\t\t\t\t$meta = array();\n\t\t\t\t\tinclude($path . 'meta.php');\n\n\t\t\t\t\tif( array_key_exists($file, $meta)) {\n\t\t\t\t\t\t$attributes = $meta[$filenameOld];\n\t\t\t\t\t\tunset($meta[$file]);\n\t\t\t\t\t\tfile_put_contents($path . 'meta.php', '<?php $meta = ' . var_export($meta, true) . ';');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t// Delete thumb file\n\t\t\t\tif ( file_exists($path . '/thumbs' . $file) ) {\n\t\t\t\t\tunlink($path . '/thumbs' . $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdie();\n\t}", "function SERVER_deleteFile($fileName)\n{\n\texec(\"sudo rm '$fileName'\",$output,$rv);\n\treturn($rv == 0);\n}", "public function removeImage($fileName)\n {\n return Storage::disk('s3')->delete($fileName);\n }", "function ajaxdeletefile($filename = null){\n\n\t\t$filename = base64_decode(urldecode($filename));\n\n\t\t//Delete uploaddir\n\t\tif(file_exists($this->uploaddir.$filename)){\n\t\t\tunlink($this->uploaddir.$filename);\n\t\t}\n\n\t\t//Delete torrent\n\t\tif(file_exists($this->torrentdir.$filename.'.torrent')){\n\t\t\tunlink($this->torrentdir.$filename.'.torrent');\n\t\t}\n\n\t\t//Delete from DB\n\t\t$this->Torrent->deleteAll(array('name'=>$filename));\n\n\t\t$this->autoRender = false; //Dont render view. Complete action will update screen\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter query vars; e.g., remove those we ignore.
public function filterQueryVars($_vars) { $_vars = (array) $_vars; // Force array. $cache_key = $_vars === $_GET ? md5(serialize($_vars)) : ''; if ($cache_key && ($vars = &$this->staticKey(__FUNCTION__, $cache_key)) !== null) { return $vars; // Already cached this. } $vars = $_vars; // Copy. $short_name_lc = mb_strtolower(SHORT_NAME); $ignore_get_request_vars_regex = defined('COMET_CACHE_IGNORE_GET_REQUEST_VARS') ? COMET_CACHE_IGNORE_GET_REQUEST_VARS : ''; foreach ($vars as $_key => $_value) { if (!is_string($_key)) { continue; // Not applicable. } elseif ($_key === $short_name_lc.'AC' || $_key === $short_name_lc.'ABC') { unset($vars[$_key]); } elseif ($ignore_get_request_vars_regex && preg_match($ignore_get_request_vars_regex, $_key)) { unset($vars[$_key]); } } // unset($_key, $_value); // Housekeeping. return $vars = $vars ? $this->ksortDeep($vars) : []; }
[ "protected function FilterGetVars() {\n\t\n\t\tif(sizeof($_GET) > 0 && is_array($_GET)) {\n\t\n\t\t\tforeach($_GET as $key => $value) {\n\t\t\t\t\t\n\t\t\t\t$fOut = addslashes($value);\n\t\t\t\t$fOut = htmlentities($fOut);\n\t\t\t\t$fOut = strip_tags($fOut);\n\t\t\t\t$this->mGetVars[$key] = $fOut;\n\t\t\t}\n\t\t}\n\t}", "static function filterQueryString() {\n\t\t$clean = array();\n\t\tforeach ($_GET as $key => $val) {\n\t\t\t$clean[$key] = htmlspecialchars_decode(filter_var($val, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW));\n\t\t}\n\t\treturn $clean;\n\t}", "function ignore_empty_query_vars( $query_vars ) {\n\t\t// bbPress query vars that sometimes have weird urls as a result.\n\t\t$ignore_emptyish_values = [ 'topic', 'reply', 'forum', 'topic-tag', 'bbp_view' ];\n\n\t\tforeach ( $ignore_emptyish_values as $q ) {\n\t\t\tif ( isset( $query_vars[ $q ] ) && empty( $query_vars[ $q ] ) ) {\n\t\t\t\t// It's set, but empty so not a useful QV?\n\t\t\t\tunset( $query_vars[ $q ] );\n\t\t\t}\n\t\t}\n\n\t\treturn $query_vars;\n\t}", "function filterJsonQueryVars($vars) {\n\t\t$vars[] = 'meta_key';\n\t\t$vars[] = 'meta_value';\n\t\treturn $vars;\n\t}", "function wporg_themes_remove_query_vars( $qv ) {\n\t$not_needed = [\n\t\t'm', 'w', 'year', 'monthnum', 'day', 'hour', 'minute', 'second',\n\t\t'posts', 'withcomments', 'withoutcomments', 'favicon', 'cpage',\n\t\t'search', 'exact', 'sentence', 'calendar', 'more', 'tb', 'pb',\n\t\t'attachment_id', 'subpost', 'subpost_id', 'preview',\n\t\t'post_format', 'cat', 'category_name',\n\t];\n\n\treturn array_diff( $qv, $not_needed );\n}", "public function filterQueryVars($vars)\n {\n $vars[] = 'selected_date';\n\n return $vars;\n }", "public function global_filtering()\n {\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val)\n ctx()->getRequest()->get($this->_clean_input_keys($key) , $this->_clean_input_data($val));\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n ctx()->getRequest()->post($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val)\n ctx()->getRequest()->cookie($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n ctx()->getRequest()->request($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n }", "public static function purge_amp_query_vars() {\n\t\t$query_vars = array(\n\t\t\t'__amp_source_origin',\n\t\t\t'_wp_amp_action_xhr_converted',\n\t\t\t'amp_latest_update_time',\n\t\t\t'amp_last_check_time',\n\t\t);\n\n\t\t// Scrub input vars.\n\t\tforeach ( $query_vars as $query_var ) {\n\t\t\tif ( ! isset( $_GET[ $query_var ] ) ) { // phpcs:ignore\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tself::$purged_amp_query_vars[ $query_var ] = wp_unslash( $_GET[ $query_var ] ); // phpcs:ignore\n\t\t\tunset( $_REQUEST[ $query_var ], $_GET[ $query_var ] );\n\t\t\t$scrubbed = true;\n\t\t}\n\n\t\tif ( isset( $scrubbed ) ) {\n\t\t\t$build_query = function( $query ) use ( $query_vars ) {\n\t\t\t\t$pattern = '/^(' . join( '|', $query_vars ) . ')(?==|$)/';\n\t\t\t\t$pairs = array();\n\t\t\t\tforeach ( explode( '&', $query ) as $pair ) {\n\t\t\t\t\tif ( ! preg_match( $pattern, $pair ) ) {\n\t\t\t\t\t\t$pairs[] = $pair;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn join( '&', $pairs );\n\t\t\t};\n\n\t\t\t// Scrub QUERY_STRING.\n\t\t\tif ( ! empty( $_SERVER['QUERY_STRING'] ) ) {\n\t\t\t\t$_SERVER['QUERY_STRING'] = $build_query( $_SERVER['QUERY_STRING'] );\n\t\t\t}\n\n\t\t\t// Scrub REQUEST_URI.\n\t\t\tif ( ! empty( $_SERVER['REQUEST_URI'] ) ) {\n\t\t\t\tlist( $path, $query ) = explode( '?', $_SERVER['REQUEST_URI'], 2 );\n\n\t\t\t\t$pairs = $build_query( $query );\n\t\t\t\t$_SERVER['REQUEST_URI'] = $path;\n\t\t\t\tif ( ! empty( $pairs ) ) {\n\t\t\t\t\t$_SERVER['REQUEST_URI'] .= \"?{$pairs}\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function remove_query_var( $name ) {\n\t\t$this->public_query_vars = array_diff( $this->public_query_vars, array( $name ) );\n\t}", "function post_query_meta_exclude_vars()\n\t{\n\t\treturn ['method', 'session_id', 'category', 'slug', 'fid', 'files', 'meta'];\n\t}", "protected function FilterPostVars() {\n\t\n\t\tif(sizeof($_POST) > 0 && is_array($_POST)) {\n\t\n\t\t\tforeach($_POST as $key => $value) {\n\t\n\t\t\t\t$fOut = addslashes($value);\n\t\t\t\t$fOut = htmlentities($fOut);\n\t\t\t\t$fOut = strip_tags($fOut);\n\t\t\t\t$this->mPostVars[$key] = $fOut;\n\t\t\t}\n\t\t}\n\t}", "function getUrlVariablesFiltered($skip=array(), $prefix=false)\n {\n $filter = array();\n foreach ($skip as $key) {\n $filter[MYOOS_FORM_VARIABLE_PREFIX . $key] = true;\n }\n\n $values = array();\n $prefixLength = strlen(MYOOS_FORM_VARIABLE_PREFIX);\n foreach ($_GET as $key => $value) {\n if (empty($filter[$key])) {\n $values[$prefix ? substr($key, $prefixLength) : $key] = $value;\n }\n }\n\n return $values;\n }", "function remove_ignored_query() {\n\t\tcheck_ajax_referer( 'searchwp_metrics_ajax' );\n\n\t\tif ( ! class_exists( 'SearchWP_Stats' ) || ! defined( 'SEARCHWP_PREFIX' ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$searchwp_core_stats = new \\SearchWP_Stats();\n\n\t\t// Query ignoring expects the query to be md5 hashed\n\t\t$query_to_remove = isset( $_REQUEST['hash'] ) ? $_REQUEST['hash'] : '';\n\n\t\tif ( empty( $query_to_remove ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$user_id = empty( $user_id ) ? get_current_user_id() : $user_id;\n\t\t$ignored_queries = $searchwp_core_stats->get_ignored_queries( $user_id );\n\n\t\tif ( array_key_exists( $query_to_remove, $ignored_queries ) ) {\n\t\t\tunset( $ignored_queries[ $query_to_remove ] );\n\t\t}\n\n\t\tupdate_user_meta( absint( $user_id ), SEARCHWP_PREFIX . 'ignored_queries', $ignored_queries );\n\n\t\twp_send_json_success();\n\t}", "protected function get_filtered_query_args() {\n\n\t\t/**\n\t\t * Filter query args to ignore.\n\t\t *\n\t\t * @since 0.2\n\t\t * @param array $query_args_to_ignore\n\t\t */\n\t\t$query_args_to_ignore = apply_filters(\n\t\t\t'cfcr/plugin/query_args_to_ignore',\n\t\t\t[ 'page', 'q', 'reset', 'noheader', 'civiwp' ]\n\t\t);\n\n\t\treturn array_reduce(\n\t\t\tarray_keys( $_GET ),\n\t\t\tfunction( $args, $arg_name ) use ( $query_args_to_ignore ) {\n\n\t\t\t\tif ( in_array( $arg_name, $query_args_to_ignore ) ) return $args;\n\n\t\t\t\tif ( $arg_name == 'id' ) {\n\t\t\t\t\t$args[\"{$this->redirect_page_type}_$arg_name\"] = $_GET[$arg_name];\n\t\t\t\t} else {\n\t\t\t\t\t$args[$arg_name] = $_GET[$arg_name];\n\t\t\t\t}\n\n\t\t\t\treturn $args;\n\n\t\t\t},\n\t\t\t[]\n\t\t);\n\n\t}", "function xapi_post_query_meta_exclude_vars() {\n return ['xapi', 'session_id', 'category', 'title', 'content', 'fid', 'meta'];\n}", "public function getFilteredParameters()\n {\n $parameters = array_merge($this->config->getRequest()->request->all(), $this->config->getRequest()->query->all());\n\n foreach ($this->config->getBlacklist() as $term) {\n $parameters = $this->filter($parameters, $term);\n }\n\n return $parameters;\n }", "protected function filterValues()\n {\n if (! $this->request->value) {\n return;\n }\n\n $this->query->whereIn($this->select[0], Arr::wrap($this->request->value));\n }", "function CleanRequest () {\n\t\t$vars = array();\n\t\tforeach ($_REQUEST as $var => $value) {\n\t\t\t$vars[CleanUserInput($var)] = CleanUserInput($value);\n\t\t}\n\t\treturn $vars;\n\t}", "private function _prune($vars)\n\t{\n\t\tforeach ($vars as $k => $v)\n\t\t{\n\t\t\tif (trim($v) == '')\n\t\t\t{\n\t\t\t\tunset($vars[$k]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$vars[$k] = $v;\n\t\t\t}\n\t\t}\n\n\t\treturn $vars;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Valore ARR GAS MAGGIORAZIONE GAS : Parametri : Ordine, Gas
function valore_reale_maggiorazione_percentuale_gas($id_ordine,$id_gas){ $magg = valore_percentuale_maggiorazione_mio_gas($id_ordine,$id_gas); return (float)(valore_totale_mio_gas($id_ordine,$id_gas)/100)*$magg; }
[ "function tentukan_deret_geometri($arr) {\n // kode di sini\n}", "function valore_costi_esterni_gas($id_ordine,$id_gas){\r\n\r\n $costo_trasporto = valore_costo_trasporto_ordine_gas($id_ordine,$id_gas); \r\n $costo_gestione = valore_costo_gestione_ordine_gas($id_ordine,$id_gas);\r\n $costi = $costo_trasporto+\r\n $costo_gestione;\r\n \r\n return (float)$costi; \r\n}", "function valore_costo_mio_gas_amico($id_ordine,$id_user,$id_amico){\r\n \r\n $id_gas = id_gas_user($id_user);\r\n $valore_personale_attuale_netto_qarr =valore_netto_singolo_amico($id_ordine,$id_user,$id_amico);\r\n $valore_gas_attuale_netto_qarr = valore_totale_mio_gas($id_ordine,$id_gas);\r\n $percentuale_mio_ordine_gas = ($valore_personale_attuale_netto_qarr / $valore_gas_attuale_netto_qarr) *100;\r\n $costo_globale_mio_gas = valore_assoluto_costo_mio_gas($id_ordine,$id_gas);\r\n $costo_personale_mio_gas = ($costo_globale_mio_gas /100) * $percentuale_mio_ordine_gas;\r\n return (float)$costo_personale_mio_gas;\r\n}", "public function hitung_luas (){\n Return $this->alas * $this->tinggi;\n }", "public function acionarTurbina($ligar);", "public function arctangente(){\n $this->pantalla = atan((float)$this->pantalla);\n //Devuelve el valor en radianes\n }", "function graficoLinhas()\n{\n\tglobal $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path,$R_libpath;\n\tglobal $percentual,$nome,$margem,$margemexterna,$margeminterna,$xlab,$ylab,$grid,$ppontos,$spline,$locaplic,$dir_tmp,$gw,$gh,$res,$bg,$collab,$colaxis,$cexlab,$cexaxis,$fontlab,$las,$tck,$cexmain,$border,$lty,$lwd,$lty,$lwd,$pch,$tpt,$main,$colmain,$fontmain,$nome;\n\t//pega os valores\n\t$dir = dirname(dirname($map_file));\n\tif($nome == \"\")\n\t{\n\t\t$temp = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,$percentual,\"\",false);\n\t\t$nnval = $temp[\"dados\"];\n\t\t$nome = $dir.\"/\".nomeRandomico(20);\n\t\tgravaDados($nnval,$nome);\n\t}\n\t$gfile_name = nomeRandomico(20);\n\t$rcode = iniciaParGrafico($gw,$gh,$res,$dir_tmp,$gfile_name,$margem,$margemexterna,$margeminterna,$locaplic,$R_libpath);\n\t$rcode[] = 'valores=read.table(\"'.$nome.'\",header=TRUE,sep=\";\")';\n\t$rcode[] = 'attach(valores)';\n\t$rcode[] = 'names(x)= n';\n\t$parametros = 'col.lab='.$collab.',col.axis='.$colaxis.',cex.lab='.$cexlab.',cex.axis='.$cexaxis.',font.lab='.$fontlab.',las='.$las.',tck='.$tck.',cex.main='.$cexmain;\n\t$rcode[] = 'par(pty=\"s\")';\n\t$rcode[] = 'plot(x,'.$parametros.', type = \"n\", axes = FALSE, ann = FALSE)';\n\tif ($grid == \"TRUE\")\n\t$rcode[] = \"grid()\";\n\tif ($spline==\"FALSE\")\n\t{$rcode[] = 'lines(x,col='.$border.',lty='.$lty.',lwd='.$lwd.')';}\n\telse\n\t{$rcode[] = 'lines(spline(x),col='.$border.',lty='.$lty.',lwd='.$lwd.')';}\n\tif ($ppontos==\"TRUE\")\n\t{$rcode[] = 'points(x, pch =\"'.$pch.'\", bg = \"light grey\", cex ='.$tpt.')';}\n\t$rcode[] = \"axis(2,lines=NA)\";\n\t$rcode[] = 'axis(1, lines=NA)';\n\t$rcode[] = 'box()';\n\t$rcode[] = 'title(xlab = \"'.$xlab.'\")';\n\t$rcode[] = 'title(ylab = \"'.$ylab.'\")';\n\t$rcode[] = 'title(main = \"'.$main.'\",col.main='.$colmain.',font.main='.$fontmain.')';\n\t$rcode[]='close.screen(all = TRUE)';\n\t$rcode[] = 'dev.off()';\n\t$r = executaR($rcode,$dir_tmp,$R_path);\n\t$map = ms_newMapObj($map_file);\n\t$webo = $map->web;\n\t$url = dirname($webo->imageurl).\"/\";\n\treturn($url.$gfile_name.\".png,\".$url.(basename($nome)).\",\".$nome);\n}", "function _GrandeurNormale($ladd, $dga ,$pee )\n{\nreturn $dga/ sqrt( 1 - ($pee*$pee) * ( sin($ladd)*sin($ladd) ) );\n\n}", "PUBLIC function dataGraficoLinea($parametros){\r\n if(!class_exists('ArbolOrganizacional')){\r\n import('clases.organizacion.ArbolOrganizacional');\r\n }\r\n $parametros = $this->dbl->corregir_parametros($parametros);\r\n \r\n /*PARAMETROS FORMULARIO*/\r\n $sql_parametros = '';\r\n if (strlen($parametros[\"b-origen_hallazgo\"])>0)\r\n $sql_parametros .= \" AND origen_hallazgo = \" . ($parametros[\"b-origen_hallazgo\"]) . \"\";\r\n if (strlen($parametros[\"b-responsable_analisis\"])>0)\r\n $sql_parametros .= \" AND responsable_analisis = \". $parametros[\"b-responsable_analisis\"] . \"\";\r\n if (strlen($parametros[\"b-alto_potencial\"])>0)\r\n $sql_parametros .= \" AND alto_potencial = '\". $parametros[\"b-alto_potencial\"] . \"'\";\r\n //echo $sql_parametros;\r\n if ((strlen($parametros[\"b-id_organizacion\"])>0) && ($parametros[\"b-id_organizacion\"] != \"2\")){ \r\n //$id_org_padre = $ao->BuscaOrgNivelHijos($parametros[\"b-id_organizacion\"]);\r\n $id_org_padre = $parametros[\"b-id_organizacion\"];\r\n } \r\n else{\r\n $id_org_padre = 2;\r\n }\r\n $ao = new ArbolOrganizacional();\r\n switch ($parametros[tipo_data]) {\r\n case 'SEMANAL':\r\n $sql=\"Select * from mos_organizacion\r\n\t\t\t\tWhere parent_id IN ($id_org_padre)\";\r\n \r\n $data = $this->dbl->query($sql, $atr);\r\n foreach ($data as $value) {\r\n $ids_hija = $ao->BuscaOrgNivelHijos($value[id]);\r\n /*SE CONSULTAN LOS VALORES DE LOS HIJOS */\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,IFNULL(sum(total),0) total \r\n ,IFNULL(sum(atrasada),0) atrasada\r\n ,IFNULL(sum(en_plazo),0) en_plazo\r\n ,IFNULL(sum(realizada),0) realizada\r\n ,IFNULL(sum(realizada_atraso),0) realizada_atraso\r\n ,mes\t\r\n ,anio \r\n FROM\r\n mos_acciones_correctivas_foto_sem\r\n where id_org in ($ids_hija) $sql_parametros \r\n and (sema >= \".date('Y').\"01 AND sema < \".(date('YW')) .\" )\r\n group by sema\r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n $data_mes = array();\r\n /*Se inicializan valores en cero*/\r\n for($i=1;$i<=date('W')*1;$i++)\r\n //for($i=1;$i<=40;$i++)\r\n {\r\n \r\n $data_mes[date('Y').str_pad($i,2,'0',STR_PAD_LEFT)] = array('y'=>0,'valor'=> '0/0', 'total'=>0);\r\n } \r\n \r\n /*SE ASIGNAN VALORES REALES*/\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[sema]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[sema]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n// $data_mes[$value_org[mes]][total] = $value_org[total] ;\r\n// $data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[sema]][y] = 0;\r\n $data_mes[$value_org[sema]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n /*OBTENEMOS SEMANA ACTUAL*/\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,count(id) total\r\n ,IFNULL(sum(case when estado=1 then 1 else 0 end),0) as atrasada\r\n ,IFNULL(sum(case when estado=2 then 1 else 0 end),0) as en_plazo\r\n ,IFNULL(sum(case when estado=3 then 1 else 0 end),0) as realizada_atraso\r\n ,IFNULL(sum(case when estado=4 then 1 else 0 end),0) as realizada\r\n ,YEARWEEK(now()) sema \r\n FROM\r\n mos_acciones_correctivas\r\n where id_organizacion in ($ids_hija) $sql_parametros \r\n and (fecha_generacion >= STR_TO_DATE('\".date('YW').\" Monday', '%X%V %W') or fecha_realizada is null) \r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[sema]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[sema]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n //$data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n //$data_mes[$value_org[mes]][total] = $value_org[total];\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[sema]][y] = 0;\r\n $data_mes[$value_org[sema]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $serie .= \"{name: '\" . $value[title] . \"',data:[ \";\r\n foreach ($data_mes as $value_mes) {\r\n //$serie .= json_encode($value_mes) .\",\";\r\n $serie .= \"{y:$value_mes[y],valor:'$value_mes[valor]'},\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1) . \" ] },\"; \r\n \r\n //print_r($data_mes);\r\n }\r\n $nombre_x = '';\r\n for($i=1;$i<=date('W')*1;$i++)\r\n //for($i=1;$i<=52*1;$i++)\r\n {\r\n $nombre_x .= \"'\" . $i . \"',\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1);\r\n //echo $serie;\r\n \r\n $return = array();\r\n $return[serie] = str_replace('\"', '', $serie);\r\n $return[nombre_x] = $serie = substr($nombre_x, 0, strlen($nombre_x) - 1);\r\n $return[subtitle] = 'Semanal - ' . date('Y');\r\n break;\r\n case 'YTD':\r\n case 'MES':\r\n $sql=\"Select * from mos_organizacion\r\n\t\t\t\tWhere parent_id IN ($id_org_padre)\";\r\n \r\n $data = $this->dbl->query($sql, $atr);\r\n $sql ='';\r\n $serie = '';\r\n foreach ($data as $value) {\r\n $ids_hija = $ao->BuscaOrgNivelHijos($value[id]);\r\n /*SE CONSULTAN LOS VALORES DE LOS HIJOS */\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,IFNULL(sum(total),0) total \r\n ,IFNULL(sum(atrasada),0) atrasada\r\n ,IFNULL(sum(en_plazo),0) en_plazo\r\n ,IFNULL(sum(realizada),0) realizada\r\n ,IFNULL(sum(realizada_atraso),0) realizada_atraso\r\n ,mes\t\r\n ,anio \r\n FROM\r\n mos_acciones_correctivas_foto_mes\r\n where id_org in ($ids_hija) and tipo = 1 $sql_parametros \r\n and (anio >= \".date('Y').\" AND mes < \".(date('m')*1) .\" )\r\n group by mes, anio\r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n $data_mes = array();\r\n /*Se inicializan valores en cero*/\r\n for($i=1;$i<=date('m')*1;$i++)\r\n {\r\n $data_mes[$i] = array('y'=>0,'valor'=> '0', 'total'=>0);\r\n }\r\n /*SE ASIGNAN VALORES REALES*/\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n// $data_mes[$value_org[mes]][total] = $value_org[total] ;\r\n// $data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,count(id) total\r\n ,IFNULL(sum(case when estado=1 then 1 else 0 end),0) as atrasada\r\n ,IFNULL(sum(case when estado=2 then 1 else 0 end),0) as en_plazo\r\n ,IFNULL(sum(case when estado=3 then 1 else 0 end),0) as realizada_atraso\r\n ,IFNULL(sum(case when estado=4 then 1 else 0 end),0) as realizada\r\n ,\".(date('m')*1) .\" mes \r\n FROM\r\n mos_acciones_correctivas\r\n where id_organizacion in ($ids_hija) $sql_parametros\r\n and (fecha_generacion >= '\".date('Y').\"-\".(date('m')*1) .\"-01' or fecha_realizada is null) \r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n //$data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n //$data_mes[$value_org[mes]][total] = $value_org[total];\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $serie .= \"{name: '\" . $value[title] . \"',data:[ \";\r\n foreach ($data_mes as $value_mes) {\r\n //$serie .= json_encode($value_mes) .\",\";\r\n $serie .= \"{y:$value_mes[y],valor:'$value_mes[valor]'},\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1) . \" ] },\"; \r\n \r\n //print_r($data_mes);\r\n }\r\n $nombre_x = '';\r\n for($i=1;$i<=date('m')*1;$i++)\r\n {\r\n $nombre_x .= \"'\" . descripcion_mes_corto($i) . \"',\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1);\r\n //echo $serie;\r\n \r\n $return = array();\r\n $return[serie] = str_replace('\"', '', $serie);\r\n $return[nombre_x] = $serie = substr($nombre_x, 0, strlen($nombre_x) - 1);\r\n $return[subtitle] = 'YTD - ' . date('Y');\r\n //echo $return[nombre_x];\r\n //return $return;\r\n break;\r\n\r\n case 'M12':\r\n $sql=\"Select * from mos_organizacion\r\n\t\t\t\tWhere parent_id IN ($id_org_padre)\";\r\n \r\n $data = $this->dbl->query($sql, $atr);\r\n $sql ='';\r\n $serie = '';\r\n foreach ($data as $value) {\r\n $ids_hija = $ao->BuscaOrgNivelHijos($value[id]);\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,IFNULL(sum(total),0) total \r\n ,IFNULL(sum(atrasada),0) atrasada\r\n ,IFNULL(sum(en_plazo),0) en_plazo\r\n ,IFNULL(sum(realizada),0) realizada\r\n ,IFNULL(sum(realizada_atraso),0) realizada_atraso\r\n ,mes\t\r\n ,anio \r\n FROM\r\n mos_acciones_correctivas_foto_mes\r\n where id_org in ($ids_hija) and tipo = 1 $sql_parametros\r\n and (anio >= YEAR(DATE_SUB(now(),INTERVAL 1 YEAR)) and mes <= MONTH(DATE_SUB('2016-12-16',INTERVAL 1 YEAR)) and anio >= \".date('Y').\" AND mes < \".(date('m')*1) .\" )\r\n group by mes, anio\r\n order by anio asc, mes asc\r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n $data_mes = array();\r\n /* Se setean todos los valores a cero */\r\n $fecha = date('Y-m-j');\r\n $nuevafecha = strtotime ( '-11 month' , strtotime ( $fecha ) ) ;\r\n for($i=1;$i<=12*1;$i++)\r\n {\r\n $data_mes[date ( 'm' , $nuevafecha )*1] = array('y'=>0,'valor'=> '0/0');\r\n// $nombre_x .= \"'\" . descripcion_mes_corto(date ( 'm' , $nuevafecha )*1) . \"',\";\r\n $nuevafecha = strtotime ( '+1 month' , strtotime ( date ( 'Y-m-j' , $nuevafecha ) ) ) ;\r\n\r\n }\r\n /* Se asignan valores reales */ \r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n// $data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n// $data_mes[$value_org[mes]][total] = $value_org[total];\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = '0/0';\r\n $data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,count(id) total\r\n ,IFNULL(sum(case when estado=1 then 1 else 0 end),0) as atrasada\r\n ,IFNULL(sum(case when estado=2 then 1 else 0 end),0) as en_plazo\r\n ,IFNULL(sum(case when estado=3 then 1 else 0 end),0) as realizada_atraso\r\n ,IFNULL(sum(case when estado=4 then 1 else 0 end),0) as realizada\r\n ,\".(date('m')*1) .\" mes \r\n FROM\r\n mos_acciones_correctivas\r\n where id_organizacion in ($ids_hija) $sql_parametros\r\n and (fecha_generacion >= '\".date('Y').\"-\".(date('m')*1) .\"-01' or fecha_realizada is null) \r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = 0;\r\n }\r\n }\r\n $serie .= \"{name: '\" . $value[title] . \"',data:[ \";\r\n foreach ($data_mes as $value_mes) {\r\n //$serie .= json_encode($value_mes) .\",\";\r\n $serie .= \"{y:$value_mes[y],valor:'$value_mes[valor]'},\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1) . \" ] },\"; \r\n \r\n //print_r($data_mes);\r\n }\r\n $nombre_x = '';\r\n /*Nombre de los meses*/\r\n $fecha = date('Y-m-j');\r\n $nuevafecha = strtotime ( '-11 month' , strtotime ( $fecha ) ) ;\r\n for($i=1;$i<=12*1;$i++)\r\n {\r\n $nombre_x .= \"'\" . descripcion_mes_corto(date ( 'm' , $nuevafecha )*1) . \"',\";\r\n $nuevafecha = strtotime ( '+1 month' , strtotime ( date ( 'Y-m-j' , $nuevafecha ) ) ) ;\r\n \r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1);\r\n //echo $serie;\r\n \r\n $return = array();\r\n $return[serie] = str_replace('\"', '', $serie);\r\n $return[nombre_x] = $serie = substr($nombre_x, 0, strlen($nombre_x) - 1);\r\n $return[subtitle] = 'M12 - ' . date('Y');\r\n //echo $return[nombre_x];\r\n //return $return;\r\n break;\r\n case 'QUARTIL':\r\n $sql=\"Select * from mos_organizacion\r\n\t\t\t\tWhere parent_id IN ($id_org_padre)\";\r\n \r\n $data = $this->dbl->query($sql, $atr);\r\n $sql ='';\r\n $serie = '';\r\n $fecha_actual = new DateTime(\"now\");\r\n $primer_cuartil = new DateTime(Date('Y'.'-03-31'));\r\n $segundo_cuartil = new DateTime(Date('Y'.'-06-30'));\r\n $tercer_cuartil = new DateTime(Date('Y'.'-09-30'));\r\n $cuartil = 0;\r\n if ($fecha_actual > $primer_cuartil){\r\n if ($fecha_actual > $segundo_cuartil){\r\n if ($fecha_actual > $tercer_cuartil){\r\n $cuartil = 4;\r\n $fecha_ini_cuartil = Date('Y').'-10-01';\r\n }\r\n else\r\n {\r\n $cuartil = 3;\r\n $fecha_ini_cuartil = Date('Y').'-07-01';\r\n }\r\n }\r\n else\r\n {\r\n $cuartil = 2;\r\n $fecha_ini_cuartil = Date('Y').'-04-01'; \r\n }\r\n }\r\n else{\r\n $cuartil = 1;\r\n $fecha_ini_cuartil = Date('Y').'-01-01';\r\n }\r\n \r\n \r\n foreach ($data as $value) {\r\n $ids_hija = $ao->BuscaOrgNivelHijos($value[id]);\r\n /*SE CONSULTAN LOS VALORES DE LOS HIJOS */\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,IFNULL(sum(total),0) total \r\n ,IFNULL(sum(atrasada),0) atrasada\r\n ,IFNULL(sum(en_plazo),0) en_plazo\r\n ,IFNULL(sum(realizada),0) realizada\r\n ,IFNULL(sum(realizada_atraso),0) realizada_atraso\r\n ,mes\t\r\n ,anio \r\n FROM\r\n mos_acciones_correctivas_foto_mes \r\n where id_org in ($ids_hija) and tipo = 2 $sql_parametros\r\n and (anio >= \".date('Y').\" AND mes < $cuartil )\r\n group by mes, anio\r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n $data_mes = array();\r\n /*Se inicializan valores en cero*/\r\n for($i=1;$i<=$cuartil;$i++)\r\n {\r\n $data_mes[$i] = array('y'=>0,'valor'=> '0', 'total'=>0);\r\n }\r\n /*SE ASIGNAN VALORES REALES*/\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n// $data_mes[$value_org[mes]][total] = $value_org[total] ;\r\n// $data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,count(id) total\r\n ,IFNULL(sum(case when estado=1 then 1 else 0 end),0) as atrasada\r\n ,IFNULL(sum(case when estado=2 then 1 else 0 end),0) as en_plazo\r\n ,IFNULL(sum(case when estado=3 then 1 else 0 end),0) as realizada_atraso\r\n ,IFNULL(sum(case when estado=4 then 1 else 0 end),0) as realizada\r\n ,$cuartil mes \r\n FROM\r\n mos_acciones_correctivas\r\n where id_organizacion in ($ids_hija) $sql_parametros\r\n and (fecha_generacion >= '$fecha_ini_cuartil' or fecha_realizada is null) \r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n //$data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n //$data_mes[$value_org[mes]][total] = $value_org[total];\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $serie .= \"{name: '\" . $value[title] . \"',data:[ \";\r\n foreach ($data_mes as $value_mes) {\r\n //$serie .= json_encode($value_mes) .\",\";\r\n $serie .= \"{y:$value_mes[y],valor:'$value_mes[valor]'},\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1) . \" ] },\"; \r\n \r\n //print_r($data_mes);\r\n }\r\n $nombre_x = '';\r\n for($i=1;$i<=$cuartil;$i++)\r\n {\r\n $nombre_x .= \"'Q\" . $i . \"',\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1);\r\n //echo $serie;\r\n \r\n $return = array();\r\n $return[serie] = str_replace('\"', '', $serie);\r\n $return[nombre_x] = $serie = substr($nombre_x, 0, strlen($nombre_x) - 1);\r\n $return[subtitle] = 'Cuartiles - ' . date('Y');\r\n //echo $return[nombre_x];\r\n //return $return;\r\n break; \r\n case 'SEM':\r\n $sql=\"Select * from mos_organizacion\r\n\t\t\t\tWhere parent_id IN ($id_org_padre)\";\r\n \r\n $data = $this->dbl->query($sql, $atr);\r\n $sql ='';\r\n $serie = '';\r\n $fecha_actual = new DateTime(\"now\");\r\n $primer_semestre = new DateTime(Date('Y'.'-03-31')); \r\n $semestre = 0;\r\n if ($fecha_actual > $primer_semestre){ \r\n $semestre = 2;\r\n $fecha_ini_semestre = Date('Y').'-07-01';\r\n \r\n }\r\n else{\r\n $semestre = 1;\r\n $fecha_ini_semestre = Date('Y').'-01-01';\r\n }\r\n \r\n \r\n foreach ($data as $value) {\r\n $ids_hija = $ao->BuscaOrgNivelHijos($value[id]);\r\n /*SE CONSULTAN LOS VALORES DE LOS HIJOS */\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,IFNULL(sum(total),0) total \r\n ,IFNULL(sum(atrasada),0) atrasada\r\n ,IFNULL(sum(en_plazo),0) en_plazo\r\n ,IFNULL(sum(realizada),0) realizada\r\n ,IFNULL(sum(realizada_atraso),0) realizada_atraso\r\n ,mes\t\r\n ,anio \r\n FROM\r\n mos_acciones_correctivas_foto_mes\r\n where id_org in ($ids_hija) and tipo = 2 $sql_parametros\r\n and (anio >= \".date('Y').\" AND mes < $semestre )\r\n group by mes, anio\r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n $data_mes = array();\r\n /*Se inicializan valores en cero*/\r\n for($i=1;$i<=$semestre;$i++)\r\n {\r\n $data_mes[$i] = array('y'=>0,'valor'=> '0', 'total'=>0);\r\n }\r\n /*SE ASIGNAN VALORES REALES*/\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n// $data_mes[$value_org[mes]][total] = $value_org[total] ;\r\n// $data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $sql = \"SELECT\r\n $value[id] id_organizacion \r\n ,count(id) total\r\n ,IFNULL(sum(case when estado=1 then 1 else 0 end),0) as atrasada\r\n ,IFNULL(sum(case when estado=2 then 1 else 0 end),0) as en_plazo\r\n ,IFNULL(sum(case when estado=3 then 1 else 0 end),0) as realizada_atraso\r\n ,IFNULL(sum(case when estado=4 then 1 else 0 end),0) as realizada\r\n ,$semestre mes \r\n FROM\r\n mos_acciones_correctivas\r\n where id_organizacion in ($ids_hija) $sql_parametros\r\n and (fecha_generacion >= '$fecha_ini_semestre' or fecha_realizada is null) \r\n \"; \r\n //echo $sql;\r\n \r\n $data_org = $this->dbl->query($sql, $atr);\r\n foreach ($data_org as $value_org) {\r\n if ($value_org[total] != '0'){\r\n $data_mes[$value_org[mes]][y] = $value_org[atrasada] / $value_org[total] * 100;\r\n $data_mes[$value_org[mes]][valor] = $value_org[atrasada] . '/'. $value_org[total];\r\n //$data_mes[$value_org[mes]][valor] = $value_org[atrasada] ;\r\n //$data_mes[$value_org[mes]][total] = $value_org[total];\r\n }\r\n else\r\n {\r\n $data_mes[$value_org[mes]][y] = 0;\r\n $data_mes[$value_org[mes]][valor] = '0/0';\r\n //$data_mes[$value_org[mes]][total] = 0;\r\n }\r\n }\r\n $serie .= \"{name: '\" . $value[title] . \"',data:[ \";\r\n foreach ($data_mes as $value_mes) {\r\n //$serie .= json_encode($value_mes) .\",\";\r\n $serie .= \"{y:$value_mes[y],valor:'$value_mes[valor]'},\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1) . \" ] },\"; \r\n \r\n //print_r($data_mes);\r\n }\r\n $nombre_x = '';\r\n for($i=1;$i<=$semestre;$i++)\r\n {\r\n $nombre_x .= \"'Semestre \" . $i . \"',\";\r\n }\r\n $serie = substr($serie, 0, strlen($serie) - 1);\r\n //echo $serie;\r\n \r\n $return = array();\r\n $return[serie] = str_replace('\"', '', $serie);\r\n $return[nombre_x] = $serie = substr($nombre_x, 0, strlen($nombre_x) - 1);\r\n $return[subtitle] = 'Semestres - ' . date('Y');\r\n //echo $return[nombre_x];\r\n //return $return;\r\n break; \r\n default:\r\n break;\r\n }\r\n switch ($parametros[tipo_data]) {\r\n case 'MES':\r\n $return[subtitle] = 'Mensual - ' . date('Y');\r\n\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n \r\n return $return;\r\n }", "private function montaGrafico ()\n {\n\n // CRIA AS TABELAS\n $tabela = array(\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"i\", \"j\", \"l\", \"m\", \"n\", \"o\", \"h\", \"q\",\"r\", \"er\", \"es\", \"et\", \"cr\", \"cs\", \"ct\");\n $tabela2 = array(\"Entrada R\",\"Entrada S\",\"Entrada T\",\"Saida R\",\"Saida S\",\"Saida T\", \"Corrente R\", \"Corrente S\", \"Corrente T\", \"Corrente Saida R\", \"Corrente Saida S\", \"Corrente Saida T\", \"Bateria\", \"Temperatura Ambiente\",\"Temperatura Banco bateria\", \"Pontência entrada R\", \"Pontência entrada S\", \"Pontência entrada T\", \"Pontência saída R\", \"Pontência saída S\", \"Pontência saída T\");\n\n // CONVERTE DA BASE 64\n //$sim_num = base64_decode($this->parametros[0]);\n $equipId = $this->parametros[0];\n\n //RECUPERA O SIM ATRAVES DO NUMERO DO EQUIPAMENTO\n if(is_numeric($equipId)){\n\n $querySim = \"SELECT id_sim FROM tb_sim_equipamento WHERE id_equipamento = '$equipId' AND status_ativo = '1'\";\n\n // print_r($querySim);\n // exit();\n\n $resultadoSim = $this->verificaQuery($querySim);\n\n if(!empty($resultadoSim)){\n\n $sim_num = $resultadoSim[0]['id_sim'];\n\n // Coleta os itens ativados\n $opc = explode(\",\",$this->parametros[1]);\n\n //RECUPERA OS HORÁRIOS PASSADOS PELO USUÁRIO\n $horaIni = $opc[23];\n $horaFim = $opc[24];\n\n // Recupera as datas de inicio e fim de periodo\n\n $dataIni = date( \"Y-m-d \".$horaIni.\":00\", strtotime($opc[21]) );\n $dataFim = date( \"Y-m-d \".$horaFim.\":59\", strtotime($opc[22]) );\n\n $datetime1 = date_create($opc[21]);\n $datetime2 = date_create($opc[22]);\n $intervalInDays = ($datetime2->format(\"U\") - $datetime1->format(\"U\"))/(3600 * 24);\n\n $diasDiff = $intervalInDays;\n\n /*\n * QUERY PARA CARREGAR AS VARIAVEIS DE CALIBRAÇÃO DO EQUIPAMENTO\n */\n\n // $variaveisCalib = array();\n\n // Monta a sequencia de opções de calibração para serem carregadas no gráfico\n // for ($a = 0; $a < sizeof($tabela) ; $a++)\n // {\n //\n // if (($opc[$a] == 1) && (is_numeric($opc[$a]))){\n\n // $queryCalibracao = \"SELECT cali.variavel_cal FROM tb_equipamento_calibracao cali JOIN tb_sim_equipamento simEquip ON simEquip.id_equipamento = cali.id_equip WHERE simEquip.id_sim = '{$sim_num}' AND cali.posicao_tab = '$tabela[$a]' AND simEquip.status_ativo = '1'\";\n\n // BUSCA OS DADOS NO BANCO\n // $resultCalib = $this->verificaQuery($queryCalibracao);\n\n // if(!empty($resultCalib)){\n //\n // // Adiciona o valor de calibração na array\n //\n // foreach ($resultCalib as $cal){\n //\n // //print_r($cal['variavel_cal']);\n //\n // array_push($variaveisCalib, array($tabela[$a] => $cal['variavel_cal']));\n //\n // }\n //\n // }\n\n // }\n //\n // }\n\n //print_r($opc);\n //var_dump($variaveisCalib);\n //exit();\n\n /*\n * QUERY PARA TRAZER OS DADOS DA TABELA NORMAL\n */\n // Monta a query para buscar os resultados\n $query = \"SELECT DATE(dad.dt_criacao) date, MINUTE(dad.dt_criacao) minut, DAY(dad.dt_criacao) day, HOUR(dad.dt_criacao) hour, MIN(dad.dt_criacao) min_date, UNIX_TIMESTAMP(dad.dt_criacao) AS 'dt_criacao', \";\n\n // Define os parametros\n for ($a = 0; $a < sizeof($tabela) ; $a++)\n {\n if (($opc[$a] == 1) && (is_numeric($opc[$a]))){\n\n // $query .= ' dad.'.$tabela[$a] . \",\";\n // Query para procurar a variavel de calibracao da posição da tabela.\n $queryCalibracao = \"SELECT cali.variavel_cal FROM tb_equipamento_calibracao cali JOIN tb_sim_equipamento simEquip ON simEquip.id_equipamento = cali.id_equip WHERE simEquip.id_sim = '{$sim_num}' AND cali.posicao_tab = '$tabela[$a]' AND simEquip.status_ativo = '1'\";\n\n // BUSCA OS DADOS NO BANCO\n $resultCalib = $this->verificaQuery($queryCalibracao);\n\n if(!empty($resultCalib)){\n\n // Adiciona o valor de calibração na query\n\n foreach ($resultCalib as $cal){\n\n //print_r($cal['variavel_cal']);\n $query .= ' ( dad.'.$tabela[$a].' * '.$cal['variavel_cal'].') AS \"'.$tabela[$a].'\",';\n }\n\n }else{\n\n //Coreção para não misturar parametros desta query com as da outra tabela\n if(($tabela[$a] != 'er') && ($tabela[$a] != 'es') && ($tabela[$a] != 'et') && ($tabela[$a] != 'ct') && ($tabela[$a] != 'cr') && ($tabela[$a] != 'cs')){\n\n $query .= ' dad.'.$tabela[$a] . \",\";\n\n }\n }\n\n\n // if($tabela[$a] == 'h'){\n // //$query .= ''.$tabela[$a] . \" + (800) AS 'h',\";\n // $query .= ' IF(dad.h > 0, dad.h + 1700, dad.h) AS \"h\",';\n // }else{\n // //Coreção para não misturar parametros desta query com as da outra tabela\n // if(($tabela[$a] != 'er') && ($tabela[$a] != 'es') && ($tabela[$a] != 'et') && ($tabela[$a] != 'ct') && ($tabela[$a] != 'cr') && ($tabela[$a] != 'cs')){\n //\n // $query .= ' dad.'.$tabela[$a] . \",\";\n //\n // }\n //\n // }\n\n }\n\n }\n\n // Trata a ultima posicao\n $query .= \".\";\n $query = str_replace(\",.\",\"\",$query);\n\n $query .= \" FROM tb_dados dad\";\n\n // $query .= \" JOIN tb_sim_equipamento sim_equip ON sim_equip.id_sim = dad.num_sim\";\n //\n // $query .= \" JOIN tb_equipamento equip ON equip.id = sim_equip.id_equipamento\";\n\n //$query .= \" JOIN tb_dados_potencia dadPot ON (dadPot.num_sim = '{$sim_num}' AND dad.num_sim = '{$sim_num}' AND dad.dt_criacao = dadPot.data_registro) \";\n\n $query .= \" WHERE dad.dt_criacao BETWEEN '{$dataIni}' AND '{$dataFim}' AND dad.num_sim = '{$sim_num}' AND dad.status_ativo = '1'\";\n\n if($diasDiff > 7){\n $query .=\" GROUP BY DATE(dad.dt_criacao)\";\n }elseif($diasDiff > 2){\n $query .=\" GROUP BY DATE(dad.dt_criacao),HOUR(dad.dt_criacao)\";\n }else{\n $query .=\" GROUP BY DATE(dad.dt_criacao),HOUR(dad.dt_criacao), MINUTE(dad.dt_criacao)\";\n }\n\n // var_dump( $opc, $query, $diasDiff);\n // print_r($query);\n // exit();\n\n // BUSCA OS DADOS NO BANCO\n $result = $this->verificaQuery($query);\n\n /*\n * QUERY PARA TRAZER OS DADOS DE POTENCIA\n */\n $queryPot = \"SELECT DATE(dadPot.data_registro) date, MINUTE(dadPot.data_registro) minut, DAY(dadPot.data_registro) day, HOUR(dadPot.data_registro) hour, MIN(dadPot.data_registro) min_date, UNIX_TIMESTAMP(dadPot.data_registro) AS 'dt_criacao', \";\n // Define os parametros\n for ($a = 0; $a < sizeof($tabela) ; $a++)\n {\n if (($opc[$a] == 1) && (is_numeric($opc[$a]))){\n\n if(($tabela[$a] == 'er') || ($tabela[$a] == 'es') || ($tabela[$a] == 'et') || ($tabela[$a] == 'ct') || ($tabela[$a] == 'cr') || ($tabela[$a] == 'cs')){\n\n $queryPot .= ' dadPot.'.$tabela[$a] . \",\";\n\n }\n\n }\n }\n\n // Trata a ultima posicao\n $queryPot .= \".\";\n $queryPot = str_replace(\",.\",\"\",$queryPot);\n\n $queryPot .= \" FROM tb_dados_potencia dadPot\";\n $queryPot .= \" WHERE dadPot.data_registro BETWEEN '{$dataIni}' AND '{$dataFim}' AND dadPot.num_sim = '{$sim_num}'\";\n\n if($diasDiff > 7){\n $queryPot .=\" GROUP BY DATE(dadPot.data_registro)\";\n }elseif($diasDiff > 2){\n $queryPot .=\" GROUP BY DATE(dadPot.data_registro),HOUR(dadPot.data_registro)\";\n }else{\n $queryPot .=\" GROUP BY DATE(dadPot.data_registro),HOUR(dadPot.data_registro), MINUTE(dadPot.data_registro)\";\n }\n\n // BUSCA OS DADOS NO BANCO\n $resultPot = $this->verificaQuery($queryPot);\n\n // var_dump($resultPot);\n // print_r($queryPot);\n // exit();\n\n // Inicia a variavel da data\n $respDate = \"[\";\n $respRawDate = array();\n\n // JUNÇÃO DOS RESULTADOS DAS DUAS QUERYES\n\n if((!empty($result)) || (!empty($resultPot))){\n\n // Realiza o loop na result\n for ($a = 0; $a < sizeof($result); $a++)\n {\n // $respDate é responsavel por armazenar as séries das datas.\n // $respDate .= \"'\".date('d-M-y H:i',strtotime($result[$a]['dt_criacao'])).\"',\";\n $respDate .= \"'\".$result[$a]['dt_criacao'].\"',\";\n\n //SALVA NA ARRAY A DATA PURA\n array_push($respRawDate, $result[$a]['dt_criacao']);\n\n for ($b = 0; $b < sizeof($tabela) ; $b++)\n {\n if ($opc[$b] == 1 && empty ($respData[$tabela[$b]][0]))\n {\n $respData[$tabela[$b]][0] = \"{name:'{$tabela2[$b]}',data:[\";\n\n }\n\n //VERIFICA SE O PARAMETRO ESTÁ ESCOLHIDO OU NÃO PARA ADICIONAR NA SÉRIE\n if ($opc[$b] == 1){\n\n //EFETUA A DISCRIMINAÇÃO DOS PARAMETROS ESCOLHIDOS\n if(($tabela[$b] != \"er\") && ($tabela[$b] != \"es\") && ($tabela[$b] != \"et\") && ($tabela[$b] != \"cr\") && ($tabela[$b] != \"cs\") && ($tabela[$b] != \"ct\")){\n //CONVERTE AS POTÊNCIAS EM (Kw)\n $respData[$tabela[$b]][0] .= \"\".floatval($result[$a][$tabela[$b]]/100).\",\";\n }else{\n //$respData[$tabela[$b]][0] .= \"\".intval(floatval($result[$a][$tabela[$b]]/100)).\",\";\n //$respData[$tabela[$b]][0] .= \"\".floatval($result[$a][$tabela[$b]]/100).\",\";\n }\n\n }\n\n }\n }\n\n // Realiza o loop na resultPot\n for ($a = 0; $a < sizeof($resultPot); $a++)\n {\n\n // TESTA SE $result RETORNOU RESULTADO, CASO NEGATIVO\n if(empty($result)){\n\n $respDate .= \"'\".$resultPot[$a]['dt_criacao'].\"',\";\n\n //SALVA NA ARRAY A DATA PURA\n array_push($respRawDate, $resultPot[$a]['dt_criacao']);\n }\n\n for ($b = 0; $b < sizeof($tabela) ; $b++)\n {\n if ($opc[$b] == 1 && empty ($respData[$tabela[$b]][0]))\n {\n $respData[$tabela[$b]][0] = \"{name:'{$tabela2[$b]}',data:[\";\n\n }\n\n //VERIFICA SE O PARAMETRO ESTÁ ESCOLHIDO OU NÃO PARA ADICIONAR NA SÉRIE\n if ($opc[$b] == 1){\n\n //EFETUA A DISCRIMINAÇÃO DOS PARAMETROS ESCOLHIDOS\n if(($tabela[$b] == \"er\") || ($tabela[$b] == \"es\") || ($tabela[$b] == \"et\") || ($tabela[$b] == \"cr\") || ($tabela[$b] == \"cs\") || ($tabela[$b] == \"ct\")){\n //CONVERTE AS POTÊNCIAS EM (Kw)\n $respData[$tabela[$b]][0] .= \"\".floatval($resultPot[$a][$tabela[$b]]/1000).\",\";\n }else{\n //$respData[$tabela[$b]][0] .= \"\".intval(floatval($result[$a][$tabela[$b]]/100)).\",\";\n //$respData[$tabela[$b]][0] .= \"\".floatval($result[$a][$tabela[$b]]/100).\",\";\n }\n\n }\n }\n\n }\n\n\n // Adiciona e remove os caracteres\n $respDate .= \"]\";\n $respDate = str_replace(\",]\",\"]\",$respDate);\n\n foreach ($respData as $campo => $valor)\n {\n $respData[$campo][0] = $valor[0] . \",}\";\n $respData[$campo][0] = str_replace(\",,\",\"]\",$respData[$campo][0]);\n }\n\n }else{\n $respDate = \"[]\";\n $respData = \"{}\";\n $respRawDate = array();\n $diff = 0;\n }\n\n }else{\n //CASO O EQUIPAMENTO NÃO POSSUA DADOS SALVOS NO BD AINDA\n $respDate = \"[]\";\n $respData = \"{}\";\n $respRawDate = array();\n $diasDiff = 0;\n }\n\n }else{\n $respDate = \"[]\";\n $respData = \"{}\";\n $respRawDate = array();\n $diasDiff = 0;\n }\n\n // Converte para json\n $this->respData = $respData;\n $this->respDate = $respDate;\n $this->respRawDate = $respRawDate;\n $this->respDiference = $diasDiff;\n\n }", "function valore_costo_trasporto_ordine_amico($id_ordine,$id_user,$id_amico){\r\n $valore_globale_attuale_netto_qarr = valore_totale_ordine_qarr($id_ordine);\r\n $valore_personale_attuale_netto_qarr = valore_netto_singolo_amico($id_ordine,$id_user,$id_amico);\r\n $percentuale_mio_ordine = ($valore_personale_attuale_netto_qarr / $valore_globale_attuale_netto_qarr) *100;\r\n $costo_globale_trasporto = valore_trasporto($id_ordine,100);\r\n $costo_trasporto = ($costo_globale_trasporto / 100) * $percentuale_mio_ordine;\r\n return (float)$costo_trasporto;\r\n}", "public function jarjesta() {\n usort($this->ravinnon_saannit, \"self::vertaaPvm\");\n }", "public function horasdisponibles(){\n return round($this->gethorasturno()-($this->gethorasparada() /*+$this->hpp*/),2);\n \n }", "public function Visualizza(){ \n $VSquadra= USingleton::getInstance('VSquadra');\n $session = USingleton::getInstance('USession'); \n $nome_squadra=$session->getValore('squadra');\n $DSquadra= new DSquadra($nome_squadra);\n $FRosa= USingleton::getInstance('FRosa');\n $giocatori=$FRosa->getRosa($nome_squadra);\n foreach($giocatori as $key => $value){\n $DGiocatore=new DGiocatore($value['id'],$value['nome'],$value['cognome'],$value['ruolo'],\n $value['squadra_reale'],$value['valore'],$value['voto']); \n $DSquadra->Aggiungi($DGiocatore);\n }\n $array_giocatori=$DSquadra->getgiocatori();\n $modulo=array('3-4-3','3-5-2','4-3-3','4-4-2','4-5-1','5-3-2','5-4-1');\n $VSquadra->impostaDati('moduli',$modulo);\n if(isset($array_giocatori)){\n $portieri=$array_giocatori['POR'];\n $portieri1=array();\n foreach($portieri as $key => $value)\n array_push($portieri1,$value->getAsArray());\n $VSquadra->impostaDati('portieri',$portieri1);\n $difensore=$array_giocatori['DIF'];\n $difensore1=array();\n foreach($difensore as $key => $value)\n array_push($difensore1,$value->getAsArray());\n $VSquadra->impostaDati('difensore',$difensore1);\n $centrocampo=$array_giocatori['CEN'];\n $centrocampo1=array();\n foreach($centrocampo as $key => $value)\n array_push($centrocampo1,$value->getAsArray());\n $VSquadra->impostaDati('centrocampo',$centrocampo1);\n $attacco=$array_giocatori['ATT'];\n $attacco1=array();\n foreach($attacco as $key => $value)\n array_push($attacco1,$value->getAsArray());\n $crediti=$DSquadra->get_crediti();\n $VSquadra->impostaDati('attacco',$attacco1);\n $VSquadra->impostaDati('crediti',\"CREDITI\");\n $VSquadra->impostaDati('fantasycosto',$crediti);\n }\n return $VSquadra->processaTemplate('squadra');\n\t}", "public function getIva_gravado()\n {\n return $this->iva_gravado;\n }", "function arreglasecuord(){\n\t\t$mSQL='SELECT codigo,precio1,precio2,precio3,precio4 FROM sinv WHERE precio2>precio1 OR precio3>precio2 OR precio3>precio1 OR precio4>precio3 OR precio4>precio2 OR precio4>precio1';\n\t\t$query = $this->db->query($mSQL);\n\t\tforeach ($query->result() as $row){\n\t\t\t$dbcodigo= $this->db->escape($row->codigo);\n\t\t\t$precios = array($row->precio1,$row->precio2,$row->precio3,$row->precio4);\n\t\t\tsort($precios);\n\t\t\t$precios=array_reverse($precios);\n\n\t\t\t$data=array();\n\t\t\tforeach($precios as $i=>$prec){\n\t\t\t\t$o=$i+1;\n\t\t\t\t$ind='precio'.$o;\n\t\t\t\t$data[$ind] = $prec;\n\t\t\t}\n\n\t\t\t$where = \"codigo = ${dbcodigo}\";\n\t\t\t$sql = $this->db->update_string('sinv', $data, $where);\n\t\t\t$this->db->query($sql);\n\t\t}\n\t\t$this->arreglamarbases();\n\t}", "public function hesapla(){\n\t\t$zirveEsitler = $this->esitPuanlilar( max(array_values($this->points) ), $this->points );\n\t\t\n\t\t// zirve puani\n\t\t$zirvePuan = $this->points[$zirveEsitler[0]];\n\t\t\n\t\t// sampiyonluk sansi olan takimlar\n\t\t$this->yarisanlar = $this->zirveTakibi( $zirvePuan, $this->points, $this->kalanHafta );\n\t\t\n\t\t// yarisanlarin baslangic yuzdesi\n\t\t$yarisanlarYuzdesi = round(100/ count($this->yarisanlar));\n\t\t\n\t\t// zirvedekilerin baslangic yuzdesini ata. Cunku diger takimlarin kayip degeri ustune eklenecek\n\t\tforeach( array_keys($zirveEsitler) as $key )\n\t\t\t$this->yuzde[$key] = (int)$yarisanlarYuzdesi;\n\t\t\t\n\t\tfor( $i = count($this->yarisanlar) -1 ; $i >= count($zirveEsitler) ; $i-- ){\n\t\t\t// zirveden kaybedilen oran\n\t\t\t$kayipOran = ( $zirvePuan - $this->yarisanlar[$i] ) / ( $this->kalanHafta * 3 + 1 );\n\t\t\t\n\t\t\t$kayipPuanDegeri =round( $yarisanlarYuzdesi * $kayipOran); // liderden uzaklasilan puan degeri. Lider bu oran kadar kazanirken,rakip bu kadar kaybetmis\n\t\t\t\n\t\t\t// liderden bu oranda kaybetti\n\t\t\t$this->yuzde[$i] = (int)$yarisanlarYuzdesi - $kayipPuanDegeri; \n\t\t\t\n\t\t\t// zirvedeki takimlara, diger takimlarin kayip orani ekle\n\t\t\tfor( $j = count( $zirveEsitler )-1 ; $j >= 0; $j-- ){\n\t\t\t\t$this->yuzde[$j] += (int)($kayipPuanDegeri / count( $zirveEsitler ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tksort( $this->yuzde );\n\t}", "function calcAguaDestilada($loratadina, $betametasona) {\n $aguaTotal = ($loratadina * 0.1 + $betametasona * 0.15);\n return $aguaTotal;\n}", "function calculerSurface ($longueur, $largeur, $hauteur)\n{\n \n $surfaceMurs = 2 * $hauteur * ($longueur + $largeur);\n\n return $surfaceMurs;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apologizes to user with message.
function apologize($message) { render("apology.php", ["message" => $message]); }
[ "function apologize($message)\n {\n render(\"apologize.php\", [\"message\" => $message]);\n }", "function apologize($message)\n {\n render(\"apology.php\", [\"message\" => $message]);\n exit;\n }", "function apologize($message)\r\n {\r\n // require template\r\n require_once(\"apology.php\");\r\n\r\n // exit immediately since we're apologizing\r\n exit;\r\n }", "function apologize($message)\n {\n // require template\n require_once(\"apology.php\");\n\n // exit immediately since we're apologizing\n exit;\n }", "function apologize($message)\n {\n $return_msg = \"back\";\n\t\t$type = \"Sorry!\";\n\t\t// require template\n require_once(\"apology.php\");\n\n // exit immediately since we're apologizing\n exit;\n }", "function alert_private_chat_you($user,$message){\n\t\tglobal $db, $prefix, $x7s;\n\t\t$time = time();\n\t\t$db->DoQuery(\"INSERT INTO {$prefix}messages VALUES('0','$user','7','$message','null','$x7s->username:0','$time')\");\n\t}", "public function set_alt_message($message);", "public function addLoginMessage($message)\n {\n $login_message = new sfGuardLoginMessage();\n $login_message->setUserId($this->getIncremented());\n $login_message->setDisplayed(false);\n $login_message->setMessage($message);\n $login_message->save();\n }", "function modify_message(&$message) {\n//Add here whatever you need to recognize and modify this message:\n\n global $user;\n \n // Hide these messages:\n $message = preg_replace('/No posts in this group\\./', '', $message);\n $message = preg_replace('/Fetching data from GeoNames failed.*/', '', $message);\n $message = preg_replace('/The directory .*? has been created\\./', '', $message);\n \n //If the administrator has removed _himself_, the message should instead of\n //\"Username_ABC is no longer a group administrator.\" say:\n //\"You are no longer an administrator for this group. To regain administrator privileges, please contact an administrator for this group.\"\n $current_name = $user->name;\n preg_match('/(.*) is no longer a\\.*/', $message, $matches_A);\n //check if the current user is the same as the user in the message:\n if ($matches_A[1]) preg_match(\"/$current_name/\", $matches_A[1], $matches_B);\n if ($matches_B[0]) $message = \"You are no longer an administrator for this group. To regain administrator privileges, please contact an administrator for this group.\";\n}", "function user_approval_admin_notification_message_filter( $message, $user_id ) {\n\t\tglobal $theme_my_login;\n\t\t$_message = $theme_my_login->options->get_option( array( 'email', 'user_approval', 'admin_message' ) );\n\t\treturn empty( $_message ) ? $message : Theme_My_Login_Custom_Email::replace_vars( $_message, $user_id, array( '%pendingurl%' => admin_url( 'users.php?role=pending' ) ) );\n\t}", "function save_suppressed_messages() {\n\t\t\tupdate_user_meta( $this->user_id, 'wordpress_flash_suppressed_messages', $this->user_suppress );\n\t\t}", "public function allowMessage()\n {\n $this->_data['Mensaje'] = 1;\n }", "public function hide_automotive_message() {\n\t\t\t$hidden_notices = get_option( \"automotive_hide_messages\" );\n\t\t\t$hidden_notices = ( empty( $hidden_notices ) ? array() : $hidden_notices );\n\n\t\t\t$hidden_notices[] = sanitize_text_field( $_POST['id'] );\n\n\t\t\tupdate_option( \"automotive_hide_messages\", $hidden_notices );\n\t\t}", "function pmproio_pmpro_confirmation_message($message)\r\n{\r\n\tglobal $current_user, $wpdb;\r\n\t\r\n\t$invite_code = $current_user->pmpro_invite_code;\r\n\t\t\t\r\n\tif(!empty($invite_code))\r\n\t{\r\n\t\t$message .= \"<div class=\\\"pmpro_content_message\\\"><p>Give this invite code to others to use at checkout: <strong>\" . $invite_code . \"</strong></p></div>\";\r\n\t}\r\n\treturn $message;\r\n}", "function user_approval_notification_message_filter( $message, $new_pass, $user_id ) {\n\t\tglobal $theme_my_login;\n\t\t$_message = $theme_my_login->options->get_option( array( 'email', 'user_approval', 'message' ) );\n\t\treturn empty( $_message ) ? $message : Theme_My_Login_Custom_Email::replace_vars( $_message, $user_id, array( '%loginurl%' => $theme_my_login->get_login_page_link(), '%user_pass%' => $new_pass ) );\n\t}", "function ura_lost_xwrd_approve( $message, $key, $user_login, $user_data ){\r\n\t\t//wp_die( print_r( $user_data ) );\r\n\t\t//wp_die( 'MY LOST PASSWORD FILTER' );\r\n\t\t$options = get_option('csds_userRegAide_Options');\r\n\t\t$msg = ( string ) '';\r\n\t\t$url = site_url();\r\n\t\t$approve = ( int ) 0;\r\n\t\t$approve = $options['new_user_approve'];\r\n\t\t$verify = $options['verify_email'];\r\n\t\t$user_id = $user_data->ID;\r\n\t\tif( $approve == 2 && $verify == 2 ){\r\n\t\t\treturn $message;\r\n\t\t}\r\n\t\t\r\n\t\tif( $approve == 1 && $verify == 1 ){\r\n\t\t\t$status = get_user_meta( $user_id, 'approval_status', true );\r\n\t\t\t$verify = get_user_meta( $user_id, 'email_verification', true );\r\n\t\t\tif( $status == 'pending' ){\r\n\t\t\t\t$msg = __( 'Your Account has not been Approved by an Administrator yet, you cannot reset your password until your account has been Approved!', $this->domain );\r\n\t\t\t\t$msg .= \"\\r\\n\\n\";\r\n\t\t\t}\r\n\t\t\tif( $verify == 'unverified' ){\r\n\t\t\t\t$msg .= __( 'Your Email Address for this Account has not yet been Verified. You cannot reset your password until your email address has been verified!', $this->domain );\r\n\t\t\t\t$msg .= \"\\r\\n\\n\";\r\n\t\t\t}\r\n\t\t\tif( !empty( $msg ) ){\r\n\t\t\t\t$msg .= '<'.$url. '>';\r\n\t\t\t\treturn $msg;\r\n\t\t\t}else{\r\n\t\t\t\treturn $message;\r\n\t\t\t}\r\n\t\t}elseif( $approve == 1 && $verify == 2 ){\r\n\t\t\t$status = get_user_meta( $user_id, 'approval_status', true );\r\n\t\t\tif( $status == 'pending' ){\r\n\t\t\t\t$msg = __( 'Your Account has not been Approved by an Administrator yet, you cannot reset your password until your account has been Approved!', $this->domain );\r\n\t\t\t\t$msg .= \"\\r\\n\\n\";\r\n\t\t\t\t$msg .= '<'.$url. '>';\r\n\t\t\t\treturn $msg;\r\n\t\t\t}else{\r\n\t\t\t\treturn $message;\r\n\t\t\t}\r\n\t\t}elseif( $approve == 2 && $verify == 1 ){\r\n\t\t\t$verify = get_user_meta( $user_id, 'email_verification', true );\r\n\t\t\tif( $verify == 'unverified' ){\r\n\t\t\t\t$msg = __( 'Your Email Address for this Account has not yet been Verified. You cannot reset your password until your email address has been verified!', $this->domain );\r\n\t\t\t\t$msg .= \"\\r\\n\\n\";\r\n\t\t\t\t$msg .= '<'.$url. '>';\r\n\t\t\t\treturn $msg;\r\n\t\t\t}else{\r\n\t\t\t\treturn $message;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function password_change_notification_message_filter( $message, $user_id ) {\n\t\tglobal $theme_my_login;\n\t\t$_message = $theme_my_login->options->get_option( array( 'email', 'reset_pass', 'admin_message' ) );\n\t\treturn empty( $_message ) ? $message : Theme_My_Login_Custom_Email::replace_vars( $_message, $user_id );\n\t}", "function captiveportal_logportalauth($user,$mac,$ip,$status, $message = null) {\n\t$message = trim($message);\n\t// Log it\n\tif (!$message)\n\t\t$message = \"$status: $user, $mac, $ip\";\n\telse\n\t\t$message = \"$status: $user, $mac, $ip, $message\";\n\tcaptiveportal_syslog($message);\n}", "public function default_authentication_message( $status ) {\n $message = '';\n\n if ( $status == 'pending' ) {\n $message = __( '<strong>エラー</strong>: 現在お客さまのアカウントは、認証待ちの状態です。恐れ入りますが、当方より認証結果のご案内メールが届くまで今しばらくお待ちくださいませ。', 'new-user-approve' );\n $message = apply_filters( 'new_user_approve_pending_error', $message );\n } else if ( $status == 'denied' ) {\n $message = __( '<strong>ERROR</strong>: Your account has been denied access to this site.', 'new-user-approve' );\n $message = apply_filters( 'new_user_approve_denied_error', $message );\n } else if ( $status == 'confirm-email' ) {\n $message = __( '<strong>エラー:</strong>このメールアドレスでの会員登録は、まだ完了していません。当方から個別にお送りしたメール内に記載されているURLをクリックし、登録を完了してください。もしメールが届いていない場合は、お手数ですがcontact@atelierbourgeons.comまでお問い合わせください。', 'new-user-approve' );\n $message = apply_filters( 'new_user_confirm_email_error', $message );\n }\n\n\n\n $message = apply_filters( 'new_user_approve_default_authentication_message', $message, $status );\n\n return $message;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of isTrusted
public function getIsTrusted() { return $this->isTrusted; }
[ "public function isTrusted()\n\t{\n\t\treturn $this->trusted == true;\n\t}", "public function getDeviceTrusted()\n {\n return $this->getProperty('deviceTrusted');\n }", "public function trusted()\n { \n return ($this->trusted == 1) ? true : false; \n }", "public function isInTrustedMode() {\n return (bool) $this->getParams()->get('trusted_mode', false);\n }", "public static function isFromTrustedProxy(): bool\n {\n return self::proxy()->isFromTrustedProxy();\n }", "public function getTrustedSignature()\n {\n return $this->trustedSignature;\n }", "public function isFromTrustedProxy(): bool;", "static function isIGBTrusted(){\n\n $igbHeaderData = self::getIGBHeaderData();\n\n return $igbHeaderData->trusted;\n }", "public static function isFromTrustedProxy()\n {\n //Method inherited from \\Symfony\\Component\\HttpFoundation\\Request \n return \\Illuminate\\Http\\Request::isFromTrustedProxy();\n }", "public function isTrust() {\n\t\t$this->getTrust();\n\t}", "public function getTrust()\n {\n return $this->trust;\n }", "public function isTrustedDevicesAllowed()\n {\n return !!$this->scopeConfig->getValue(static::XML_PATH_ALLOW_TRUSTED_DEVICES);\n }", "public function getSafe() {\n\t\treturn $this->safe;\n\t}", "public function isTrustedRequest(): bool\n {\n return $this->checkIp($this->request->getAttribute('ip'), static::IPS);\n }", "public function isFromTrustedProxy(): bool\n {\n return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR', ''), self::$trustedProxies);\n }", "private static function isTrustedProxy(): bool {\n $trusted_proxies = self::getTrustedProxies();\n\n foreach ($trusted_proxies as $trustedProxy) {\n if (IpUtils::checkIp($_SERVER['REMOTE_ADDR'], $trustedProxy)) {\n return true;\n }\n }\n\n return false;\n }", "public function setIsTrusted(?bool $value): void {\n $this->getBackingStore()->set('isTrusted', $value);\n }", "public function isFromTrustedProxy(): bool\n {\n return self::$trustedProxies\n && IpUtils::checkIp($this->getServerParam('REMOTE_ADDR'), self::$trustedProxies);\n }", "function trusted() {\n\t//-----------------------------------------------------------\n\t// Check for trusted host\n\tif(getenv('HTTP_REFERRER')) {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERRER'));\n\t\t} else {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERER'));\n\t\t}\n\tif($ref_url_parts['host'] !== $this->accept_host) {\n\t\treturn false;\n\t\t//print \"ERROR - You do not have permission to access this site remotely.\";\n\t\t//exit;\n\t} else {\n\t\treturn true;\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Retrieves a User Profile in the UserProfile table by RMH Staff Approver by profileID $profileid is the User Profile being retrieved for the RMH Staff Approver null used to keep order of constructor when unused column in constructor Returns an array
function retrieve_UserProfile_RMHStaffApprover($userProfileId) { connect(); $query="SELECT U.UserProfileID, U.UserCategory,R.RMHStaffProfileID ,R.Title,R.FirstName, R.LastName,U.UsernameID, U.Password, U.UserEmail, R.Phone FROM userprofile U JOIN rmhstaffprofile R ON U.UserProfileID= R.UserProfileID WHERE U.UserCategory='RMH Staff Approver' AND U.UserProfileID=\"".$userProfileId."\""; $result = mysql_query ($query); if (mysql_num_rows($result) <1) { mysql_close(); return false; } $user=array(); while ($result_row = mysql_fetch_assoc($result)) { $userprofile = new UserProfile($result_row['UserCategory'], $result_row['UserProfileID'], $result_row['UsernameID'],$result_row['UserEmail'], $result_row['Password'], $result_row['RMHStaffProfileID'],$result_row['Title'], $result_row['FirstName'], $result_row['LastName'], $result_row['Phone'],'null', 'null', 'null', 'null', 'null', 'null', 'null'); $user[] = $userprofile; } mysql_close(); return $user; }
[ "public static function getProfile($profile_id) {\n $db = Db::instance(); // create db connection\n // build query\n $q = sprintf(\"SELECT * FROM `%s` WHERE `profile_id` = %d;\",\n self::DB_TABLE,\n $profile_id\n );\n $result = $db->query($q); // execute query\n if($result->num_rows == 0) {\n return null;\n } else {\n $row = $result->fetch_assoc(); // get results as associative array\n\n $profile = new Profile(); // instantiate\n $profile->profile_id = $row['profile_id'];\n $profile->firstname = $row['firstname'];\n $profile->lastname = $row['lastname'];\n $profile->username = $row['username'];\n $profile->password = $row['password'];\n $profile->photo = $row['photo'];\n $profile->number_posts = $row['number_posts'];\n\n return $profile; // return the member\n }\n }", "function user_get_profile_row( $p_user_id, $p_profile_id ) {\n\t\t$c_user_id\t\t= db_prepare_int( $p_user_id );\n\t\t$c_profile_id\t= db_prepare_int( $p_profile_id );\n\n\t\t$t_user_profile_table = config_get( 'mantis_user_profile_table' );\n\n\t\t$query = \"SELECT *\n\t\t\t\t FROM $t_user_profile_table\n\t\t\t\t WHERE id='$c_profile_id'\n\t\t\t\t AND user_id='$c_user_id'\";\n\t\t$result = db_query( $query );\n\n\t\tif ( db_num_rows( $result ) < 1 ) {\n\t\t\ttrigger_error( ERROR_USER_PROFILE_NOT_FOUND, ERROR );\n\t\t}\n\n\t\t$row = db_fetch_array( $result );\n\n\t\treturn $row;\n\t}", "public function getProfileById($profileId)\n {\n $table = \\ProfileTable::getInstance();\n return $table->findOneById($profileId);\n }", "function retrieve_UserProfile_RMHApprover_OBJ($userProfileId)\r\n{\r\n connect();\r\n $query=\"SELECT U.UserProfileID, U.UserCategory,R.RMHStaffProfileID ,R.Title,R.FirstName, R.LastName,U.UsernameID, U.Password, U.UserEmail, R.Phone\r\n FROM userprofile U JOIN rmhstaffprofile R\r\n ON U.UserProfileID= R.UserProfileID\r\n WHERE U.UserCategory='RMH Staff Approver' AND U.UserProfileID=\\\"\".$userProfileId.\"\\\"\"; \r\n \r\n $result = mysql_query($query) or die(mysql_error());\r\n \r\n if (mysql_num_rows($result) <1)\r\n {\r\n mysql_close();\r\n return false;\r\n }\r\n $result_row = mysql_fetch_assoc($result); \r\n $user = new UserProfile($result_row['UserCategory'], $result_row['UserProfileID'], $result_row['UsernameID'],$result_row['UserEmail'],\r\n $result_row['Password'], $result_row['RMHStaffProfileID'],$result_row['Title'], $result_row['FirstName'],\r\n $result_row['LastName'], $result_row['Phone'],'null', 'null',\r\n 'null', 'null', 'null', 'null', 'null');\r\n\t\r\n mysql_close();\r\n\treturn $user; \r\n\r\n}", "function retrieve_UserProfile_SW($userProfileId)\r\n{\r\n connect();\r\n\t$query=\"SELECT U.UserProfileID, U.UserCategory, S.SocialWorkerProfileID,S.Title,S.FirstName, S.LastName,U.UsernameID, U.Password, U.UserEmail, S.Phone,S.HospitalAffiliation,S.EmailNotification\r\n FROM userprofile U JOIN socialworkerprofile S\r\n ON U.UserProfileID= S.UserProfileID\r\n WHERE U.UserCategory='Social Worker' AND U.UserProfileID=\\\"\".$userProfileId.\"\\\"\";\r\n \r\n $result = mysql_query ($query);\r\n \r\n if (mysql_num_rows($result) <1)\r\n {\r\n mysql_close();\r\n return false;\r\n }\r\n $user=array();\r\n while ($result_row = mysql_fetch_assoc($result)) {\r\n $userprofile = new UserProfile($result_row['UserCategory'], $result_row['UserProfileID'], $result_row['UsernameID'],$result_row['UserEmail'],\r\n $result_row['Password'],'null','null', 'null',\r\n 'null', 'null', $result_row['SocialWorkerProfileID'], $result_row['Title'],\r\n $result_row['FirstName'], $result_row['LastName'], $result_row['HospitalAffiliation'], $result_row['Phone'], \r\n $result_row['EmailNotification']);\r\n\t\r\n $user[] = $userprofile;\r\n }\r\n\tmysql_close();\r\n\treturn $user; \r\n\r\n}", "public function getProfileUserById($id) {\n\n $requete_prepare = $this->connexion->prepare(\n \"SELECT * FROM UserDog WHERE id = :id\");\n \n $requete_prepare -> execute(array(\"id\" => $id ));\n $userProfile=$requete_prepare->fetchObject(\"UserProfile\");\n return $userProfile; \n }", "function get_profiles ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `smartiptv_profiles` WHERE user_id = '{$user_id}'\");\n }", "function get_tbl_profile($id)\n {\n return $this->db->get_where('tbl_profile',array('id'=>$id))->row_array();\n }", "public function get_profile( $id = 0 ) {\n\t\tif ( $id === 0 ) {\n\t\t\t$this->db->order_by( 'naam', 'asc' );\n\t\t\t/**\n\t\t\t * @var CI_DB_result $query\n\t\t\t */\n\t\t\t$query = $this->db->get( self::TABLE );\n\n\t\t\treturn $query->result();\n\t\t}\n\t\t/**\n\t\t * @var CI_DB_result $query\n\t\t */\n\t\t$this->db->limit( 1 );\n\t\t$query = $this->db->get_where( self::TABLE, [ 'id' => $id ] );\n\n\t\treturn $query->first_row( 'User' );\n\t}", "function getUsersByProfile($profid)\n{\n\tglobal $dbuser;\n\tglobal $herr;\n\n\t$rxa = $dbuser->queryUsersProfId($profid);\n\tif ($rxa == false)\n\t{\n\t\tif ($herr->checkState())\n\t\t\thandleError($herr->errorGetMessage());\n\t\telse\n\t\t\treturn NULL;\n\t}\n\n\t// Build the response array.\n\t$result = array();\n\tforeach ($rxa as $kx => $vx)\n\t{\n\t\t$rxb = $dbuser->queryContact($vx['userid']);\n\t\tif ($rxb == false)\n\t\t{\n\t\t\tif ($herr->checkState())\n\t\t\t\thandleError($herr->errorGetMessage());\n\t\t\telse\n\t\t\t\thandleError('Database Error: User contact information missing.'\n\t\t\t\t\t. '<br>USERID=' . $vx['userid']\n\t\t\t\t\t. '<br>Contact your administrator.');\n\t\t}\n\t\t$result[$rxb['name']] = $vx['userid'];\n\t}\n\n\treturn $result;\n}", "public static function getProfileById($id) {\n\t\t$bro = Roster::getBrother($id);\n\t\t$pub_prof_url = $bro->linkedin;\n\t\tif($pub_prof_url == null) {\n\t\t\treturn null;\n\t\t}\n\t\t$pub_prof_url = urlencode($pub_prof_url);\n\t\t$url = \"http://api.linkedin.com/v1/people/url=$pub_prof_url\";\n\t\t$url .= \":(first-name,last-name,headline,location:(name),industry,picture-urls::(original))\";\n\n\t\t$oauth = new OAuth(static::$api_key, static::$secret_key);\n\t\t$oauth->setToken(static::$oauth_token, static::$oauth_key);\n\n\t\t$params = array();\n\t\t$headers = array();\n\t\t$method = OAUTH_HTTP_METHOD_GET;\n\t\t \n\t\t// By default, the LinkedIn API responses are in XML format. \n\t\t// If you prefer JSON, simply specify the format in your call\n\t\t// $url = \"http://api.linkedin.com/v1/people/~?format=json\";\n\n\t\t// Make call to LinkedIn to retrieve your own profile\n\t\t$oauth->fetch($url, $params, $method, $headers);\n\t\t \n\t\t$xmlString = $oauth->getLastResponse();\n\t\t$simpleXML = simplexml_load_string($xmlString);\n\t\t$results = array($simpleXML);\n\t\t$results = $results[0];\n\t\tLinkedin::updateProfile($id, $results);\n\t\treturn $results;\n\t}", "function get_user_profile($iduser) {\r\n $CI =& get_instance();\r\n $CI->load->model('profile_model', 'profile');\r\n return $CI->profile->get_by_iduser($iduser);\r\n }", "public function findProfileByUserID($id) {\n AppLogger::info(\"Entering ProfileBusinessService.findProfileByUserID()\");\n\n //create connection to database\n $conn = new DatabaseConnection();\n\n //create a profile dao with this connection and try to find profile by id\n $service = new ProfileDataService($conn);\n $flag = $service->findProfileByUserID($id);\n\n //return the finder results\n AppLogger::info(\"Exit ProfileBusinessService.findProfileByUserID() with \" . print_r($flag, true));\n return $flag;\n }", "public function getProfiles() {\n if(isset($_SESSION['AAT']['debug']) && $_SESSION['AAT']['debug'] === 1) \n { \n $this->oDebugLog->addLog('input','MusaFunctions','getProfiles',\n 'Profile Owner (UID): ' . $_SESSION['AAT']['uid']);\n }\n \n // the profile ids are there to later offer a run link ONLY for those complete/active profiles\n $aSelect = array('aat_profile.profile_id', 'profile_name', 'profile_description', 'aat_profile.lms_id');\n $aFrom = array('aat_profile');\n $aWhere = array('aat_profile.user_id = ' . $_SESSION['AAT']['uid']);\n $aOrder = array('profile_name');\n\n $aaResult = $this->oMusa->fetchData($aSelect,$aFrom,$aWhere,$aOrder);\n\n return $aaResult;\n }", "function retrieve_UserProfile_SW_OBJ($userProfileId)\r\n{\r\n connect();\r\n\t$query=\"SELECT U.UserProfileID, U.UserCategory, S.SocialWorkerProfileID,S.Title,S.FirstName, S.LastName,U.UsernameID, U.Password, U.UserEmail, S.Phone,S.HospitalAffiliation,S.EmailNotification\r\n FROM userprofile U JOIN socialworkerprofile S\r\n ON U.UserProfileID= S.UserProfileID\r\n WHERE U.UserCategory='Social Worker' AND U.UserProfileID=\\\"\".$userProfileId.\"\\\"\";\r\n \r\n $result = mysql_query($query) or die(mysql_error());\r\n \r\n if (mysql_num_rows($result) <1)\r\n {\r\n mysql_close();\r\n return false;\r\n }\r\n \r\n $result_row = mysql_fetch_assoc($result); \r\n $user = new UserProfile($result_row['UserCategory'], $result_row['UserProfileID'], $result_row['UsernameID'],$result_row['UserEmail'],\r\n $result_row['Password'],'null','null', 'null',\r\n 'null', 'null', $result_row['SocialWorkerProfileID'], $result_row['Title'],\r\n $result_row['FirstName'], $result_row['LastName'], $result_row['HospitalAffiliation'], $result_row['Phone'], \r\n $result_row['EmailNotification']);\r\n\t\r\n mysql_close();\r\n\treturn $user; \r\n\r\n}", "public function getUserProfile();", "public static function GetProfile($user_id){\n // then it's visible or it must be user's own profile if it's private.\n }", "function get_profile($profile_id)\n {\n --$profile_id;\n\n if ($profile_id == '-1' || !isset($this->settings['profiles'][$profile_id])) {\n return $this->default_profile;\n }\n\n return $this->settings['profiles'][$profile_id];\n }", "public function getProfile();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return an array of User objects of all the Studentss in the database.
public static function getAllStudents() { $allTAs = array(); $db = DB::getInstance(); $ta_rows = $db->prep_execute('SELECT email FROM users WHERE isStudent = 1;', array()); foreach( $ta_rows as $row ) { $allTAs[] = USER::fromDatabase($row['email']); } return $allTAs; }
[ "public function getAllStudents(){\n $repository = $this->getUserRepository();\n\n $students = $repository->getUserByRole(\"ROLE_STUDENT\");\n return $students;\n }", "private function getListStudentAll() {\n\treturn \\App\\User::where('users.status','=','active')\n\t\t\n\t\t->join('user_submits','user_submits.userid','=','users.id')\n ->join('class_members','class_members.student','=','users.id')\n ->join('classrooms','classrooms.id','=','class_members.classid')\n ->join('users as x','x.id','=','users.uplink')\n ->select('users.id','users.name','users.email','users.roleid','classrooms.name as classname','x.name as teacher')\n\t\t->orderBy('users.uplink','asc')\n ->orderBy('class_members.classid','asc')\n ->orderBy('users.name','asc')\n ->get();\n\n }", "private function getStudentUsers()\n {\n $result = $this->db->get_records_sql('SELECT DISTINCT u.id FROM {enrol_ues_students} s\n INNER JOIN {user} u ON u.id = s.userid\n INNER JOIN {enrol_ues_sections} sec ON sec.id = s.sectionid\n WHERE sec.idnumber IS NOT NULL\n AND sec.idnumber <> \"\"\n AND s.status = \"enrolled\"');\n\n return $result;\n }", "public function getAllStudenti() {\n $res = Model::getDB()->query(self::$SELECT_ALL_STUDENTI);\n $studenti = array();\n while ($obj = $res->fetch_assoc()) {\n $studenti[] = new Utente($obj['matricola'], $obj['username'], $obj['password'], $obj['tipologia'], $obj['nome'], $obj['cognome'], $obj['cdl_matricola']);\n }\n return $studenti;\n }", "public function displayStudents()\n {\n $student = Model\\User::getAll();\n\n return $student;\n }", "public function displayStudents()\n {\n $student = Model\\User::getAll();\n return $student;\n }", "function getAllStudents(){\n $query =\"SELECT * FROM `student`\";\n $params = [];\n return DataBase::getInstance()->getRows($query,$params);\n }", "function get_all_student() {\n $query = $this->conn->prepare(\"SELECT * FROM `student_info`\");\n $query->execute();\n return $query->fetchAll();\n }", "public function getAllStudents(){\n $stmt = $this->con->prepare(\"SELECT * FROM students\");\n $stmt->execute();\n $students = $stmt->get_result();\n $stmt->close();\n return $students;\n }", "function listUsers()\n {\n return $this->fetchAll()->toArray();\n }", "function getStudents()\n {\n #$sql = \"SELECT u.name,u.regid,c.classname from users as u,classes as c INNER JOIN students as s ON c.id=s.class WHERE u.regid=s.admno\";\n return $this->select('u.name','u.regid','c.classname')\n ->from('users as u,classes as c')\n ->join('INNER JOIN students as s ON c.id=s.class WHERE u.regid=s.admno')\n ->limit(20)\n ->fetchAll();\n }", "public function getAllUsers()\n {\n $users = [];\n $res = $this->__read(self::TABLE) ?? [];\n foreach ($res as $data) {\n $users[] = new UserDto($data);\n }\n return $users;\n }", "public function fetchUsers(): array\r\n {\r\n return $this->getPdo()->prepare('SELECT * FROM user')\r\n ->fetchAll(\\PDO::FETCH_ASSOC);\r\n }", "public function getAllUsers(){\n return $this->getAllEntries($this->db_table);\n }", "public function getAllUsers() {\n if ($this->user_type < 2)\n throw new Exception('Permission denied.');\n\n $stmt = $this->db->prepare(\"\n SELECT * FROM users\n \");\n $result = array();\n $users = $stmt->execute();\n while ($user = $users->fetchArray(SQLITE3_ASSOC))\n $result[] = $user;\n return $result;\n }", "function getAllUsers() {\r\n global $conn;\r\n $result = $conn->query(\"SELECT * FROM User\");\r\n $users = array();\r\n if ($result) {\r\n if ($result->num_rows > 0) {\r\n while($row = $result->fetch_assoc()) {\r\n array_push($users, new UserProfile($row[\"UserID\"], $row[\"Username\"], $row[\"Email\"], $row[\"PhoneNumber\"]));\r\n }\r\n }\r\n }\r\n $result->free();\r\n return $users;\r\n }", "public function get_all_users(){\n\t\treturn ORM::factory('user')->find_all();\n\t}", "public function getStudents()\n {\n //opening connection to the database\n $pdo = Database::openConnection();\n //prepare->execute->fetch query\n $handle = $pdo->prepare('SELECT student.studentId,student.studentName,student.email,teacher.teacherName ,class.className FROM student \n LEFT JOIN teacher ON student.teacherId = teacher.teacherId\n LEFT JOIN class ON student.classId = class.classId'); \n $handle->execute();\n $students = $handle->fetchAll();\n //loop through the array of the results\n foreach ($students as $student) {\n //create objects with the specific data, and push them to the array of $students\n $newStudent = new Student(intval($student['studentId']),$student['studentName'],$student['email'],$student['teacherName'],$student['className']);\n $this->students []= $newStudent;\n }\n\n }", "function getUsers() {\n\t$alluser = new User();\n\t$alluser->getAllUsers();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a method builder.
public function method($name) { return new MethodBuilder($name); }
[ "public function getBuilder();", "public function builder(): BuilderInterface;", "public function createMethod(ElementBuilder $e)\n {\n $method = new MethodElement(end($this->classes));\n $method->setSignature($e);\n $method->setName($this->tokenParser->findElementName($e));\n $this->addElementDocBlock($method);\n $this->lastCreatedMethod = $method;\n return $method;\n }", "public function builder()\n {\n return new Builder;\n }", "public static function create()\r\n\t{\r\n\t\treturn new Builder;\r\n\t}", "public function getNewBuilder() : Builder\r\n {\r\n return new Builder();\r\n }", "public function call() {\n\t\tforeach ( $this->methods as $k => $v ) {\n\t\t\tif ( is_array($v) && sizeof($v) > 0 ) {\n\t\t\t\tif ( $k != 'select' ) {\n\t\t\t\t\tforeach ( $v as $v1 ) {\n\t\t\t\t\t\tif ( is_array($v1) ) {\n\t\t\t\t\t\t\tcall_user_func_array(array($this->builder, $k), $v1);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcall_user_func_array(array($this->builder, $k), $v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->builder;\n\t}", "private function makeMethod(Column $column): Method\n {\n $length = $column->getLength() === self::DEFAULT_PRECISION ? null : $column->getLength();\n\n if ($length !== null) {\n return new Method($column->getType(), $column->getName(), $length);\n }\n\n return new Method($column->getType(), $column->getName());\n }", "protected function createCommandBuilder()\n {\n return new CFirebirdCommandBuilder($this);\n }", "private function createBuilder()\n {\n return Builder::create(\n new Configuration(\n sys_get_temp_dir(),\n ['sqon' => $this->settings]\n )\n );\n }", "public function scopeMethod(Builder $builder, string $method): Builder\n {\n return $builder->where('method', $method);\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function withMethod($method)\n {\n }", "protected function createCommandBuilder()\n {\n return new CMdblibCommandBuilder($this);\n }", "public function addBuildFactoryMethod(DI\\FactoryMethod $factory)\n {\n $this->getBuilder()->addFactoryMethod($factory);\n return $this;\n }", "protected function createMethodGenerator()\n {\n return new MethodGenerator();\n }", "public function build()\n {\n $constructorArgs = $this->resolveConstructorParameters();\n $built = new $this->className(...$constructorArgs);\n foreach ((array)$this->afterBuildMethods as $afterBuildMethod) {\n $built->{$afterBuildMethod}();\n }\n return $built;\n }", "public function getSyntaxBuilder();", "protected function initializeClassBuilder()\n {\n // build the mock class\n $builder = new ClassBuilder();\n if (class_exists($this->className)) {\n $builder->setExtends($this->className);\n } elseif (interface_exists($this->className)) {\n $builder->addInterface($this->className);\n } else {\n throw new \\InvalidArgumentException(\"Class or interface \" . $this->className . \" does not exist\");\n }\n\n // every mocked method goes through this invocation, which delegates\n // the retrieval of the correct Spec to this Instance's Ordering constraint.\n $resolveCall = function (Invocation $inv) {\n $spec = $this->ordering->nextSpec($inv->getMethodName());\n return $spec->doInvocation($inv);\n };\n\n return $this->addMethodsToBuilder($builder, $resolveCall);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provenance of the correction. Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. There can only be a single `TextAnchor.text_segments` element. If the start and end index of the text segment are the same, the text change is inserted before that index. Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1;
public function getTextAnchor() { return $this->text_anchor; }
[ "public function setAnchorText($var)\n {\n GPBUtil::checkString($var, True);\n $this->anchor_text = $var;\n\n return $this;\n }", "public function setTextAnchor($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DocumentAI\\V1beta1\\Document\\TextAnchor::class);\n $this->text_anchor = $var;\n\n return $this;\n }", "public function setTextAnchor($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DocumentAI\\V1\\Document\\TextAnchor::class);\n $this->text_anchor = $var;\n\n return $this;\n }", "public function getAnchorText()\n {\n return $this->anchor_text;\n }", "public function setAnchorText(string $anchor_text = null) : CNabuDataObject\n {\n $this->setValue('nb_catalog_taxonomy_lang_anchor_text', $anchor_text);\n \n return $this;\n }", "public function setAnchorText(string $anchor_text = null) : CNabuDataObject\n {\n $this->setValue('nb_catalog_tag_lang_anchor_text', $anchor_text);\n \n return $this;\n }", "public function getAnchorText()\n {\n return $this->getValue('nb_catalog_tag_lang_anchor_text');\n }", "public function getAnchorText()\n\t{\n\t\tif ($this->_getData('anchor_text')) {\n\t\t\treturn $this->_getData('anchor_text');\n\t\t}\n\t\treturn $this->_node->getLabel();\n\t}", "public function testGetTextSegment()\n {\n $this->assertEquals($this->alignment->getTextSegmentId(), $this->alignment->getTextSegment()->getId());\n }", "public function setTextOffset($var)\n {\n GPBUtil::checkInt64($var);\n $this->text_offset = $var;\n\n return $this;\n }", "public function drawText(int $x, int $y, int $anchor, string $text): int\n {\n return $this->command_flush(sprintf('T%d,%d,%d,%s%c',$x,$y,$anchor,$text,27));\n }", "public function setAnchors($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Yoti\\Protobuf\\Attrpubapi\\Anchor::class);\n $this->anchors = $arr;\n\n return $this;\n }", "public function getTextSegment()\n {\n return $this->text_segment;\n }", "public function setTextSections($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->text_sections = $arr;\n\n return $this;\n }", "public function addText($textParams, $paragraphParams = [])\n {\n $paragraphParams = self::setRTLOptions($paragraphParams);\n $textParams = self::translateTextOptions2StandardFormat($textParams);\n $paragraphParams = self::translateTextOptions2StandardFormat($paragraphParams);\n $class = get_class($this);\n $text = CreateText::getInstance();\n $text->createText($textParams, $paragraphParams);\n //PhpdocxLogger::logger('Add text to word document.', 'info');\n if ($class == 'WordFragment') {\n $this->wordML .= (string) $text;\n } else {\n $this->_wordDocumentC .= (string) $text;\n }\n }", "function getCurrentTextPos(){}", "public function look_for_anchors() {\n //TODO(performance) - write real code, for now think no anchoring is in expressions\n $this->anchor = new stdClass;\n $this->anchor->start = false;\n $this->anchor->end = false;\n }", "function addText($params)\n {\n $x = $this->_getX($params['x']);\n $y = $this->_getY($params['y']);\n $text = $params['text'];\n $color = (isset($params['color']) ? $params['color'] : false);\n $alignment = (isset($params['alignment']) ? $params['alignment'] : false);\n\n $this->_setFont();\n\n $textWidth = $this->textWidth($text);\n $textHeight = $this->textHeight($text);\n\n if (!is_array($alignment)) {\n $alignment = array('vertical' => 'top', 'horizontal' => 'left');\n }\n \n if (!isset($alignment['vertical'])) {\n $alignment['vertical'] = 'top';\n }\n \n if (!isset($alignment['horizontal'])) {\n $alignment['horizontal'] = 'left';\n }\n\n if ($alignment['horizontal'] == 'right') {\n $x = $x - $textWidth;\n } elseif ($alignment['horizontal'] == 'center') {\n $x = $x - ($textWidth / 2);\n }\n\n $y -= $textHeight;\n\n if ($alignment['vertical'] == 'bottom') {\n $y = $y + $textHeight;\n } elseif ($alignment['vertical'] == 'center') {\n $y = $y + ($textHeight / 2);\n }\n\n if (($color === false) && (isset($this->_font['color']))) {\n $color = $this->_font['color'];\n }\n\n pdf_show_xy($this->_pdf, $text, $x, $y);\n\n parent::addText($params);\n }", "public function getTextAd()\n {\n return $this->readOneof(3);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change the color by the given HSV values and return a new color
public function AlteredColorHSV($hChange, $sChange, $vChange){ list($R, $G, $B) = self::HEX_TO_RGB($this->value); list($H, $S, $V) = self::RGB_TO_HSV($R, $G, $B); list($R, $G, $B) = self::HSV_TO_RGB( fmod($H + $hChange + 1, 1), self::clamp($S + $sChange, 0.0, 1.0), self::clamp($V + $vChange, 0.0, 1.0)); $color = new Color(); $color->setValue(self::RGB_TO_HEX($R, $G, $B)); return $color; }
[ "function HSV_TO_RGB($H, $S, $V) { \n if($S == 0) {\n return array('red' => $V * 255, 'green' => $V * 255, 'blue' => $V * 255);\n } else {\n $var_H = $H * 6;\n $var_i = floor($var_H);\n $var_1 = $V * (1 - $S);\n $var_2 = $V * (1 - $S * ($var_H - $var_i));\n $var_3 = $V * (1 - $S * (1 - ($var_H - $var_i)));\n \n switch($var_i) {\n case 0: $var_R = $V; $var_G = $var_3; $var_B = $var_1; break;\n case 1: $var_R = $var_2; $var_G = $V; $var_B = $var_1; break;\n case 2: $var_R = $var_1; $var_G = $V; $var_B = $var_3; break;\n case 3: $var_R = $var_1; $var_G = $var_2; $var_B = $V; break;\n case 4: $var_R = $var_3; $var_G = $var_1; $var_B = $V; break;\n default: $var_R = $V; $var_G = $var_1; $var_B = $var_2;\n }\n \n return array('red' => $var_R * 255,\n 'green' => $var_G * 255,\n 'blue' => $var_B * 255);\n }\n}", "public function fromRgbToHsv($red, $green, $blue);", "public function fromHsvToRgb($hue, $saturation, $value);", "static function hsv2rgb( $h, $s, $v ){\n\t\t// Validation\n\t\t$h = ( $h < 0 ) ? 0 : ( ( $h > 360 ) ? 360 : $h );\n\t\t$s = ( $s < 0 ) ? 0 : ( ( $s > 1 ) ? 1 : $s );\n\t\t$v = ( $v < 0 ) ? 0 : ( ( $v > 1 ) ? 1 : $v );\n\t\t// Formula\n\t\t$c = $v * $s;\n\t\t$hp = (float) $h / 60;\n\t\t$x = $c * ( 1 - abs( fmod( $hp, 2 ) - 1 ) );\n\t\t$m = $v - $c;\n\t\tswitch ( true ){\n\t\t\tcase ( $hp <= 1 ):\n\t\t\t\t$rgb = array( $c + $m, $x + $m, $m );\n\t\t\t\tbreak;\n\t\t\tcase ( $hp <= 2 ):\n\t\t\t\t$rgb = array( $x + $m, $c + $m, $m );\n\t\t\t\tbreak;\n\t\t\tcase ( $hp <= 3 ):\n\t\t\t\t$rgb = array( $m, $c + $m, $x + $m );\n\t\t\t\tbreak;\n\t\t\tcase ( $hp <= 4 ):\n\t\t\t\t$rgb = array( $m, $x + $m, $c + $m );\n\t\t\t\tbreak;\n\t\t\tcase ( $hp <= 5 ):\n\t\t\t\t$rgb = array( $x + $m, $m, $c + $m );\n\t\t\t\tbreak;\n\t\t\tcase ( $hp <= 6 ):\n\t\t\t\t$rgb = array( $c + $m, $m, $x + $m );\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $rgb;\n\t}", "function hsv2rgb($h, $s, $v)\n{\n\t$i = $h * 6;\n\t$f = $h * 6 - $i;\n\t$p = $v * (1 - $s);\n\t$q = $v * (1 - $s * $f);\n\t$t = $v * (1 - $s * (1 - $f));\n\n\tswitch ($i)\n\t{\n\t\tcase 0: $r = $v; $g = $t; $b = $p; break;\n\t\tcase 1: $r = $q; $g = $v; $b = $p; break;\n\t\tcase 2: $r = $p; $g = $v; $b = $t; break;\n\t\tcase 3: $r = $p; $g = $q; $b = $v; break;\n\t\tcase 4: $r = $t; $g = $p; $b = $v; break;\n\t\tdefault: $r = $v; $g = $p; $b = $q;\n\t}\n\n\treturn color2hex($r, $g, $b);\n}", "public function fromHsvToHex($hue, $saturation, $value);", "public function toHsvFloat()\n {\n $rgb = $this->toRgbInt();\n \n $rgbMin = min($rgb);\n $rgbMax = max($rgb);\n \n $hsv = array(\n 'hue' => 0,\n 'sat' => 0,\n 'val' => $rgbMax\n );\n \n // If v is 0, color is black\n if ($hsv['val'] == 0) {\n return $hsv;\n }\n \n // Normalize RGB values to 1\n $rgb['red'] /= $hsv['val'];\n $rgb['green'] /= $hsv['val'];\n $rgb['blue'] /= $hsv['val'];\n $rgbMin = min($rgb);\n $rgbMax = max($rgb);\n \n // Calculate saturation\n $hsv['sat'] = $rgbMax - $rgbMin;\n if ($hsv['sat'] == 0) {\n $hsv['hue'] = 0;\n return $hsv;\n }\n \n // Normalize saturation to 1\n $rgb['red'] = ($rgb['red'] - $rgbMin) / ($rgbMax - $rgbMin);\n $rgb['green'] = ($rgb['green'] - $rgbMin) / ($rgbMax - $rgbMin);\n $rgb['blue'] = ($rgb['blue'] - $rgbMin) / ($rgbMax - $rgbMin);\n $rgbMin = min($rgb);\n $rgbMax = max($rgb);\n \n // Calculate hue\n if ($rgbMax == $rgb['red']) {\n $hsv['hue'] = 0.0 + 60 * ($rgb['green'] - $rgb['blue']);\n if ($hsv['hue'] < 0) {\n $hsv['hue'] += 360;\n }\n } else if ($rgbMax == $rgb['green']) {\n $hsv['hue'] = 120 + (60 * ($rgb['blue'] - $rgb['red']));\n } else {\n $hsv['hue'] = 240 + (60 * ($rgb['red'] - $rgb['green']));\n }\n \n return $hsv;\n }", "protected function calcualteHSV()\n {\n $red = $this->red / 255;\n $green = $this->green / 255;\n $blue = $this->blue / 255;\n\n $min = min($red, $green, $blue);\n $max = max($red, $green, $blue);\n\n switch ($max) {\n case 0:\n // If the max value is 0.\n $this->hue = 0;\n $this->hsv_saturation = 0;\n $this->value = 0;\n break;\n case $min:\n // If the maximum and minimum values are the same.\n $this->hue = 0;\n $this->hsv_saturation = 0;\n $this->value = round($max, 4);\n break;\n default:\n $delta = $max - $min;\n if ($red == $max) {\n $this->hue = 0 + ($green - $blue) / $delta;\n } elseif ($green == $max) {\n $this->hue = 2 + ($blue - $red) / $delta;\n } else {\n $this->hue = 4 + ($red - $green) / $delta;\n }\n $this->hue *= 60;\n if ($this->hue < 0) {\n $this->hue += 360;\n }\n $this->hsv_saturation = $delta / $max;\n $this->value = round($max, 4);\n }\n\n // Ensure that Luma is also calculated.\n $this->calculateLuma();\n }", "public function hsv2rgb($h,$s,$v) {\n\t\t//Convert HSV to RGB\n\t\tif ($s == 0) {\n\t\t\t$r = $g = $b = $v;\n\t\t} else {\n\t\t\t$h /= 60.0;\n\t\t\t$s = $s;\n\t\t\t$v = $v;\n\n\t\t\t$hi = floor($h);\n\t\t\t$f = $h - $hi;\n\t\t\t$p = ($v * (1.0 - $s));\n\t\t\t$q = ($v * (1.0 - ($f * $s)));\n\t\t\t$t = ($v * (1.0 - ((1.0 - $f) * $s)));\n\n\t\t\tswitch($hi) {\n\t\t\t\tcase 0: $r = $v; $g = $t; $b = $p; break;\n\t\t\t\tcase 1: $r = $q; $g = $v; $b = $p; break;\n\t\t\t\tcase 2: $r = $p; $g = $v; $b = $t; break;\n\t\t\t\tcase 3: $r = $p; $g = $q; $b = $v; break;\n\t\t\t\tcase 4: $r = $t; $g = $p; $b = $v; break;\n\t\t\t\tdefault: $r = $v; $g = $p; $b = $q; break;\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t(integer) ($r * 255 + 0.5),\n\t\t\t(integer) ($g * 255 + 0.5),\n\t\t\t(integer) ($b * 255 + 0.5)\n\t\t);\n\t}", "function RGB_TO_HSV(&$R, &$G, &$B) {\n $HSL = array();\n\n $var_R = ($R / 255);\n $var_G = ($G / 255);\n $var_B = ($B / 255);\n\n $var_Min = min($var_R, $var_G, $var_B);\n $var_Max = max($var_R, $var_G, $var_B);\n $del_Max = $var_Max - $var_Min;\n\n $V = $var_Max;\n\n if ($del_Max == 0) {\n $H = 0;\n $S = 0;\n } else {\n $S = $del_Max / $var_Max;\n\n $del_R = ( ( ( $var_Max - $var_R ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n $del_G = ( ( ( $var_Max - $var_G ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n $del_B = ( ( ( $var_Max - $var_B ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n\n if ($var_R == $var_Max) $H = $del_B - $del_G;\n else if ($var_G == $var_Max) $H = ( 1 / 3 ) + $del_R - $del_B;\n else if ($var_B == $var_Max) $H = ( 2 / 3 ) + $del_G - $del_R;\n\n if ($H<0) $H++;\n if ($H>1) $H--;\n }\n\n $R = min(max((int)($H * 255), 0), 255);\n $G = min(max((int)($S * 255), 0), 255);\n $B = min(max((int)($V * 255), 0), 255);\n}", "public function toHsvInt()\n {\n $rgb = $this->toRgbInt();\n \n $rgbMin = min($rgb);\n $rgbMax = max($rgb);\n \n $hsv = array(\n 'hue' => 0,\n 'sat' => 0,\n 'val' => $rgbMax\n );\n \n // If value is 0, color is black\n if ($hsv['val'] == 0) {\n return $hsv;\n }\n \n // Calculate saturation\n $hsv['sat'] = round(255 * ($rgbMax - $rgbMin) / $hsv['val']);\n if ($hsv['sat'] == 0) {\n $hsv['hue'] = 0;\n return $hsv;\n }\n \n // Calculate hue\n if ($rgbMax == $rgb['red']) {\n $hsv['hue'] = round(0 + 43 * ($rgb['green'] - $rgb['blue']) / ($rgbMax - $rgbMin));\n } else if ($rgbMax == $rgb['green']) {\n $hsv['hue'] = round(85 + 43 * ($rgb['blue'] - $rgb['red']) / ($rgbMax - $rgbMin));\n } else {\n $hsv['hue'] = round(171 + 43 * ($rgb['red'] - $rgb['green']) / ($rgbMax - $rgbMin));\n }\n if ($hsv['hue'] < 0) {\n $hsv['hue'] += 255;\n }\n \n return $hsv;\n }", "function testRgbToHsv() {\n\t\t// black\n\t\t$this->assertEquals(\n\t\t\tColorFunctions\\color_rgb_to_hsv( 0, 0, 0 ),\n\t\t\tarray('r' => 0, 'g' => 0, 'b' => 0, 'h' => 0, 's' => 0, 'v' => 0 )\n\t\t);\n\n\t\t// white\n\t\t$this->assertEquals(\n\t\t\tColorFunctions\\color_rgb_to_hsv( 255, 255, 255 ),\n\t\t\tarray('r' => 255, 'g' => 255, 'b' => 255, 'h' => 0, 's' => 0, 'v' => 1.0 )\n\t\t);\n\n\t\t// maroon\n\t\t$this->assertEquals(\n\t\t\tColorFunctions\\color_rgb_to_hsv( 128, 0, 0 ),\n\t\t\tarray('r' => 128, 'g' => 0, 'b' => 0, 'h' => 0, 's' => 1.0, 'v' => 0.5 )\n\t\t);\n\n\t\t// Olive\n\t\t$this->assertEquals(\n\t\t\tColorFunctions\\color_rgb_to_hsv( 128,128,0 ),\n\t\t\tarray('r' => 128, 'g' => 128, 'b' => 0, 'h' => 60.0, 's' => 1.0, 'v' => 0.5 )\n\t\t);\n\t}", "function getHSV() // RGB values: 0-255, 0-255, 0-255\n {\n // Convert the RGB byte-values to percentages\n $r = ($this->r / 255);\n $g = ($this->g / 255);\n $b = ($this->b / 255);\n\n // Calculate a few basic values, the maximum value of R,G,B, the\n // minimum value, and the difference of the two (chroma).\n $maxRGB = max($r, $g, $b);\n $minRGB = min($r, $g, $b);\n $chroma = $maxRGB - $minRGB;\n\n // Value (also called Brightness) is the easiest component to calculate,\n // and is simply the highest value among the R,G,B components.\n // We multiply by 100 to turn the decimal into a readable percent value.\n $computedV = 100 * $maxRGB;\n\n // Special case if hueless (equal parts RGB make black, white, or grays)\n // Note that Hue is technically undefined when chroma is zero, as\n // attempting to calculate it would cause division by zero (see\n // below), so most applications simply substitute a Hue of zero.\n // Saturation will always be zero in this case, see below for details.\n if ($chroma == 0){\n return [\n 'h' => 0, \n 's' => 0, \n 'v' => $computedV\n ];\n }\n\n // Saturation is also simple to compute, and is simply the chroma\n // over the Value (or Brightness)\n // Again, multiplied by 100 to get a percentage.\n $computedS = 100 * ($chroma / $maxRGB);\n\n // Calculate Hue component\n // Hue is calculated on the \"chromacity plane\", which is represented\n // as a 2D hexagon, divided into six 60-degree sectors. We calculate\n // the bisecting angle as a value 0 <= x < 6, that represents which\n // portion of which sector the line falls on.\n if ($r == $minRGB)\n $h = 3 - (($g - $b) / $chroma);\n elseif ($b == $minRGB)\n $h = 1 - (($r - $g) / $chroma);\n else // $g == $minRGB\n $h = 5 - (($b - $r) / $chroma);\n\n // After we have the sector position, we multiply it by the size of\n // each sector's arc (60 degrees) to obtain the angle in degrees.\n $computedH = 60 * $h;\n\n return [\n 'h' => $computedH, \n 's' => $computedS, \n 'v' => $computedV\n ];\n }", "public function toHSV(){\n return $this->toRGB()->toHSV();\n }", "static function hsv2rgb_int( $h, $s, $v ){\n\t\t$result = self::hsv2rgb( (int) $h, (int) $s / 100, (int) $v / 100 );\n\t\treturn array( (int) round( $result[0] * 255 ), (int) round( $result[1] * 255 ), (int) round( $result[2] * 255 ) );\t\n\t}", "function setHSL($hue, $saturation, $luminosity){}", "public function toRGB()\n {\n $hue = $this->hue / 360;\n $saturation = $this->saturation / 100;\n $value = $this->value / 100;\n if ($saturation == 0) {\n $red = $value * 255;\n $green = $value * 255;\n $blue = $value * 255;\n } else {\n $var_h = $hue * 6;\n $var_i = floor($var_h);\n $var_1 = $value * (1 - $saturation);\n $var_2 = $value * (1 - $saturation * ($var_h - $var_i));\n $var_3 = $value * (1 - $saturation * (1 - ($var_h - $var_i)));\n\n if ($var_i == 0) {\n $var_r = $value;\n $var_g = $var_3;\n $var_b = $var_1;\n } elseif ($var_i == 1) {\n $var_r = $var_2;\n $var_g = $value;\n $var_b = $var_1;\n } elseif ($var_i == 2) {\n $var_r = $var_1;\n $var_g = $value;\n $var_b = $var_3;\n } elseif ($var_i == 3) {\n $var_r = $var_1;\n $var_g = $var_2;\n $var_b = $value;\n } else {\n if ($var_i == 4) {\n $var_r = $var_3;\n $var_g = $var_1;\n $var_b = $value;\n } else {\n $var_r = $value;\n $var_g = $var_1;\n $var_b = $var_2;\n }\n }\n\n $red = round($var_r * 255);\n $green = round($var_g * 255);\n $blue = round($var_b * 255);\n }\n return new RGB($red, $green, $blue);\n }", "function CVT($value, $color_space) {\n\tglobal $mode;\n\t## The mode is a bit field; set binary flags indicate specific transformations.\n\t## Flags are checked, and applied, in order from lowest bit position to highest.\n\t##\n\t## 0x0001: lightness inversion (in Lab).\n\t## 0x0002: hue inversion (in Lab).\n\t##\n\t## The following six flags are mutually exclusive:\n\t##\n\t## 0x0004: maps whites to reds (in HSV; keeps V constant, sets H to 0°, S to maximum)\n\t## 0x0008: maps whites to yellows (in HSV; keeps V constant, sets H to 60°, S to maximum)\n\t## 0x0010: maps whites to greens (in HSV; keeps V constant, sets H to 120°, S to maximum)\n\t## 0x0020: maps whites to teal/turquoise (in HSV; keeps V constant, sets H to 180°, S to maximum)\n\t## 0x0040: maps whites to blue (in HSV; keeps V constant, sets H to 240°, S to maximum)\n\t## 0x0080: maps whites to magenta (in HSV; keeps V constant, sets H to 300°, S to maximum)\n\t\n\tif ($mode & 0x0001) {\n\t\t$value[0] = 100 - $value[0];\n\t}\n\tif ($mode & 0x0002) {\n\t\t\t$value[1] *= -1;\n\t\t\t$value[2] *= -1;\n\t}\n\n\t$hsv_value = HSVFromRGB(RGBFromXYZ(XYZFromLab($value)));\n\tif ($mode & 0x0004) {\n\t\t$hsv_value[0] = 0.0 / 360.0;\n\t\t$hsv_value[1] = 1.0;\n\t} else if ($mode & 0x0008) {\n\t\t$hsv_value[0] = 60.0 / 360.0;\n\t\t$hsv_value[1] = 1.0;\n\t} else if ($mode & 0x0010) {\n\t\t$hsv_value[0] = 120.0 / 360.0;\n\t\t$hsv_value[1] = 1.0;\n\t} else if ($mode & 0x0020) {\n\t\t$hsv_value[0] = 180.0 / 360.0;\n\t\t$hsv_value[1] = 1.0;\n\t} else if ($mode & 0x0040) {\n\t\t$hsv_value[0] = 240.0 / 360.0;\n\t\t$hsv_value[1] = 1.0;\n\t} else if ($mode & 0x0080) {\n\t\t$hsv_value[0] = 300.0 / 360.0;\n\t\t$hsv_value[1] = 1.0;\t\n\t}\n\t$value = LabFromXYZ(XYZFromRGB(RGBFromHSV($hsv_value)));\n\tdebug_log(\" → {$color_space} \".PCC($value));\n\n\treturn $value;\n}", "function hsv2hex($h, $s, $v)\n {\n $s /= 256.0;\n $v /= 256.0;\n if ($s == 0.0) {\n $r = $g = $b = $v;\n return '';\n } else {\n $h = $h / 256.0 * 6.0;\n $i = floor($h);\n $f = $h - $i;\n\n $v *= 256.0;\n $p = (integer)($v * (1.0 - $s));\n $q = (integer)($v * (1.0 - $s * $f));\n $t = (integer)($v * (1.0 - $s * (1.0 - $f)));\n switch($i) {\n case 0:\n $r = $v;\n $g = $t;\n $b = $p;\n break;\n\n case 1:\n $r = $q;\n $g = $v;\n $b = $p;\n break;\n\n case 2:\n $r = $p;\n $g = $v;\n $b = $t;\n break;\n\n case 3:\n $r = $p;\n $g = $q;\n $b = $v;\n break;\n\n case 4:\n $r = $t;\n $g = $p;\n $b = $v;\n break;\n\n default:\n $r = $v;\n $g = $p;\n $b = $q;\n break;\n }\n }\n return Image_Color::rgb2hex(array($r, $g, $b));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get, set or clear a global value from persistent application storage (runtime/state.bin)
function globalState($key, $value = null, $defaultValue = null) { if($value === null) return app()->getGlobalState($key, $defaultValue); else app()->setGlobalState($key, $value, $defaultValue); }
[ "public function getStoredState();", "protected function saveGlobalState () {\r\n if ($this->_stateChanged) {\r\n $persister = $this->getStatePersister();\r\n $this->_stateChanged = false;\r\n $persister->save( \r\n $this->_globalState );\r\n }\r\n }", "protected function loadGlobalState () {\r\n $persister = $this->getStatePersister();\r\n if (($this->_globalState = $persister->load()) === null) $this->_globalState = array();\r\n $this->_stateChanged = false;\r\n $this->attachEventHandler( \r\n 'onEndRequest' , \r\n array(\r\n \r\n $this, \r\n 'saveGlobalState'\r\n ) );\r\n }", "public static function getGlobalStorage() {\n\t\t$storage = self::getStorageManager()->getGlobalStorage();\n\n\t\treturn $storage;\n\t}", "function set_persistent_var( $name, $scope = 'self', $value = false ) {\n global $jlf_persistent_vars, $jlf_persistent_var_scopes;\n\n if( $value === NULL ) {\n if( $scope ) {\n unset( $jlf_persistent_vars[ $scope ][ $name ] );\n } else {\n foreach( $jlf_persisten_var_scopes as $scope )\n unset( $jlf_persistent_vars[ $scope ][ $name ] );\n // fixme: remove from database here and now? remember to do so later?\n }\n } else {\n if( $value !== false ) {\n $GLOBALS[ $name ] = $value;\n }\n $jlf_persistent_vars[ $scope ][ $name ] = & $GLOBALS[ $name ];\n }\n}", "public function setPersistentVar(string $key, $value);", "function set_persistence($val)\n\t{\n\t\t$this->persistent = ($val === TRUE) ? TRUE : FALSE;\n\t}", "function sp()\n{\n return Yii::app()->getStatePersister();\n}", "public function saveState();", "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 }", "public function load()\n {\n if ($this->getName()) {\n $this->setValue(getenv($this->getName()));\n }\n }", "public static function updateFromLocal(){\n session_start();\n $_SESSION = array();\n foreach (self::$_values as $key => $value){\n $_SESSION[$key] = $value;\n }\n session_write_close();\n }", "abstract protected function getApplicationState();", "function get( $value, $tag ){ $this->set_storage('general'); return $this->cache->save($value, $tag);}", "protected function loadValue() {\n\t\treturn NULL;\n\t}", "public function saveState()\n {\n $this->stateService->setByKey(self::IDENTIFIER, $this->getData());\n }", "function MyApp_Setup_Globals_Load()\n {\n $hash=$this->MyApp_Setup_Globals_Read();\n $this->MyHash_Args2Object($hash);\n }", "private function persistState() {\n\t\t$session = Environment::getSession(\"insertingBook\");\n\t\t$session->setExpiration(1800); // 30 minutes\n\t\t$session[\"state\"] = $this->state;\n\t}", "public function setVars() {\r\n\t$this->varGlobalContener->save();\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provides current requested URI
public static function getRequestedURI() { return eZSys::serverURL() . $_SERVER['REQUEST_URI']; }
[ "protected static function getRequestUri()\n {\n return $_SERVER['REQUEST_URI'];\n }", "public static function current_url()\n\t\t{\n\t\t\treturn $_SERVER['REQUEST_URI'];\n\t\t}", "private function get_current_uri()\r\n {\r\n $current_uri = explode('?' , $_SERVER['REQUEST_URI']) ;\r\n return rtrim($current_uri[0] , '/');\r\n }", "public static function getCurrentUrl()\n\t{\n\t\treturn self::getProtocol().'://'.self::getHost().$_SERVER['REQUEST_URI'];\n\t}", "private function current_uri() {\r\n return implode('/', $this->uri->rsegments);\r\n }", "public static function getCurrentUrl() {\n\t\treturn self::getCurrentScheme() . '://' . getenv( 'HTTP_HOST' ) . getenv( 'REQUEST_URI' );\n\t}", "public static function requested_url() {\r\n\t\t$url = $_SERVER[\"REQUEST_URI\"];\r\n\t\t$url = site_url($url);\r\n\t\treturn $url;\r\n\t}", "protected static function getCurrentUrl()\n {\n return self::getCurrentScheme() . '://'\n . self::getCurrentHost()\n . self::getCurrentScriptName()\n . self::getCurrentQueryString();\n }", "function getCurrentUrl()\n {\n return $this->scheme . '://' . $this->host . $this->path;\n }", "public function getRequestUri()\n\t\t{\n\t\t\tif (!isset($this->server['REQUEST_URI']) && isset($this->server['PHP_SELF'])) {\n\t\t\t\t$this->server['REQUEST_URI'] = substr($this->server['PHP_SELF'], 0);\n\t\t\t\tif (isset($this->server['QUERY_STRING']) && $this->server['QUERY_STRING'] != '') {\n\t\t\t\t\t$this->server['REQUEST_URI'] .= '?' . $this->server['QUERY_STRING'];\n\t\t\t\t}\n\n\t\t\t\t// Fix for the rest of the CMS where $_SERVER is accessed directly\n\t\t\t\t$_SERVER['REQUEST_URI'] = $this->server['REQUEST_URI'];\n\t\t\t}\n\n\t\t\tif (isset($this->server['REQUEST_URI'])) {\n\t\t\t\treturn $this->server['REQUEST_URI'];\n\t\t\t}\n\t\t}", "function app_current_uri()\n{\n $url='http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI'];\n return $url;\n}", "public function getRequestUri()\n\t{\n\t\tif (isset($this->getServerParams()['REQUEST_URI'])) {\n\t\t\treturn $this->getServerParams()['REQUEST_URI'];\n\t\t}\n\t}", "function _s2ajax_get_my_uri() {\n\t\treturn $_SERVER[\"REQUEST_URI\"];\n\t}", "protected function getUri()\n {\n return $this->request->getUri();\n }", "public function getCurrentUri() : string\n {\n $basePath = $this->getBaseUrl();\n $uri = $this->currentUrl;\n\n $this->base = $basePath;\n $uri = substr($uri, strlen($basePath));\n\n // Don't take query params into account on the URL\n if (strstr($uri, '?')) {\n $uri = substr($uri, 0, strpos($uri, '?'));\n }\n\n // Remove trailing slash + enforce a slash at the start\n $uri = '/'.trim($uri, '/');\n\n return $uri;\n }", "public function getRequestUri()\n {\n return $this->history[0]['request']->getUri()->__toString();\n }", "public static function getCurrentUrl()\n {\n return (is_ssl() ? 'https://' : 'http://')\n .$_SERVER['HTTP_HOST']\n .$_SERVER['REQUEST_URI'];\n }", "public static function getCurrentUrl()\n {\n return ( is_ssl() ? 'https://' : 'http://' )\n . $_SERVER['HTTP_HOST']\n . $_SERVER['REQUEST_URI'];\n }", "private function getRequestUri()\n {\n $requestUri = $this->server('REQUEST_URI');\n\n if(strpos($requestUri,'?') !== false)\n list($requestUri,$queryString) = explode('?',$requestUri);\n\n return $requestUri ? $requestUri : '/';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks to see if the current post is restricted and if any redirect URLs are in place the user is redirected to the URL with the highest priority
function pms_restricted_post_redirect() { if( ! is_singular() ) return; global $post; /** * Filter to change the $post_id of the current restricted post * * This is useful when wanting the redirect of the current post to actually * be from another post * */ $post_id = apply_filters( 'pms_restricted_post_redirect_post_id', $post->ID ); $redirect_url = ''; $post_restriction_type = get_post_meta( $post_id, 'pms-content-restrict-type', true ); $settings = get_option( 'pms_content_restriction_settings', array() ); $general_restriction_type = ( ! empty( $settings['content_restrict_type'] ) ? $settings['content_restrict_type'] : 'message' ); if( $post_restriction_type !== 'redirect' && $general_restriction_type !== 'redirect' ) return; if( ! in_array( $post_restriction_type, array( 'default', 'redirect' ) ) ) return; if( ! pms_is_post_restricted( $post_id ) ) return; /** * Get the redirect URL from the post meta if enabled * */ if( $post_restriction_type === 'redirect' ) { $post_redirect_url_enabled = get_post_meta( $post_id, 'pms-content-restrict-custom-redirect-url-enabled', true ); $post_redirect_url = get_post_meta( $post_id, 'pms-content-restrict-custom-redirect-url', true ); $redirect_url = ( ! empty( $post_redirect_url_enabled ) && ! empty( $post_redirect_url ) ? $post_redirect_url : '' ); } /** * If the post doesn't have a custom redirect URL set, get the default from the Settings page * */ if( empty( $redirect_url ) ) { $redirect_url = ( ! empty( $settings['content_restrict_redirect_url'] ) ? $settings['content_restrict_redirect_url'] : '' ); } if( empty( $redirect_url ) ) return; /** * To avoid a redirect loop we break in case the redirect URL is the same as * the current page URl * */ $current_url = pms_get_current_page_url(); if( $current_url == $redirect_url ) return; /** * Redirect * */ wp_redirect( apply_filters( 'pms_restricted_post_redirect_url', pms_add_missing_http( $redirect_url ) ) ); exit; }
[ "function template_redirect() {\n\t\tglobal $wp_query, $wpdb, $cp_options;\n\n\t\tif ( ! $cp_options->redirect_hidden_ads ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post = get_post( $wpdb->get_var( $wp_query->request ) );\n\n\t\t$redirect_statuses = array( 'trash', 'draft' );\n\n\t\tif ( $cp_options->post_prune ) {\n\t\t\t$redirect_statuses[] = CP_POST_STATUS_EXPIRED;\n\t\t}\n\n\t\tif ( $post && APP_POST_TYPE === $post->post_type && in_array( $post->post_status, $redirect_statuses, true ) ) {\n\n\t\t\t$url = home_url();\n\n\t\t\tif ( 'category' === $cp_options->redirect_hidden_ads ) {\n\t\t\t\t$terms = get_the_terms( $post->ID, APP_TAX_CAT );\n\t\t\t\tif ( ! is_wp_error( $terms ) && ! empty( $terms ) ) {\n\t\t\t\t\t$url = get_term_link( $terms[0] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$url = apply_filters( 'cp_redirect_non_public_ads_url', $url, $post );\n\n\t\t\twp_redirect( $url, 302 );\n\t\t\tdie();\n\t\t}\n\t}", "public function set_do_redir_post()\n\t{\n\t\tswitch ($this->seo_opt['zero_dupe']['post_redir'])\n\t\t{\n\t\t\tcase 'guest':\n\t\t\t\tif (empty($this->user->data['is_registered']))\n\t\t\t\t{\n\t\t\t\t\t$this->seo_opt['zero_dupe']['do_redir_post'] = true;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'all':\n\t\t\t\t$this->seo_opt['zero_dupe']['do_redir_post'] = true;\n\n\t\t\t\tbreak;\n\t\t\tcase 'off': // Do not redirect\n\t\t\t\t$this->seo_opt['zero_dupe']['do_redir'] = false;\n\t\t\t\t$this->seo_opt['zero_dupe']['go_redir'] = false;\n\t\t\t\t$this->seo_opt['zero_dupe']['do_redir_post'] = false;\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->seo_opt['zero_dupe']['do_redir_post'] = false;\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $this->seo_opt['zero_dupe']['do_redir_post'];\n\t}", "function wa_custom_redirect () {\n\tglobal $post;\n\tif ( is_page() || is_object( $post ) ) {\n \tif ( $redirect = get_post_meta($post->ID, 'redirect', true ) ) {\n wp_redirect( $redirect );\n exit;\n }\n }\n}", "function force_page_exclusion(){\n\t\tglobal $post;\n\t\t$post_id = isset( $post ) ? $post->ID : null;\n\n\t\tif( self::utils()->is_mapped_domain() && ( $this->is_excluded_by_id( $post_id ) || $this->is_excluded_by_request() ) ){\n\t\t\t$current_url = is_ssl() ? $this->_http->getHostInfo(\"https\") . $this->_http->getUrl() : $this->_http->getHostInfo(\"http\") . $this->_http->getUrl();\n\t\t\t$current_url = self::utils()->unswap_url( $current_url );\n\t\t\twp_redirect( $current_url );\n\t\t\tdie;\n\t\t}\n\t}", "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 }", "public function mustRedirect();", "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 redirect_restricted_content( $wp_object ) {\n\n\t\tif ( 'redirect' !== get_option( 'wc_memberships_restriction_mode' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_singular() && ! is_user_logged_in() ) {\n\t\t\tglobal $post;\n\n\t\t\tif ( in_array( $post->post_type, array( 'product', 'product_variation' ), true ) ) {\n\t\t\t\t// product is restricted\n\t\t\t\t$restricted = wc_memberships_is_product_viewing_restricted() && ! current_user_can( 'wc_memberships_view_restricted_product', $post->ID );\n\t\t\t} else {\n\t\t\t\t// post is restricted\n\t\t\t\t$restricted = wc_memberships_is_post_content_restricted() && ! current_user_can( 'wc_memberships_view_restricted_post_content', $post->ID );\n\t\t\t}\n\n\t\t\tif ( $restricted ) {\n\n\t\t\t\t$redirect_page_id = get_option( 'wc_memberships_redirect_page_id' );\n\t\t\t\t$redirect_url = add_query_arg(\n\t\t\t\t\tarray( 'r' => $post->ID ),\n\t\t\t\t\t$redirect_page_id ? get_permalink( $redirect_page_id ) : home_url()\n\t\t\t\t);\n\n\t\t\t\twp_redirect( $redirect_url );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}", "function filter_template_redirect() {\n\tif ( is_404() || get_queried_object() === null ) {\n\t\t// Do not redirect.\n\t\treturn;\n\t}\n\n\tif ( isset( $_SERVER['HTTP_HOST'] ) ) {\n\t\t// build the URL in the address bar\n\t\t$requested_url = is_ssl() ? 'https://' : 'http://';\n\t\t$requested_url .= $_SERVER['HTTP_HOST'];\n\t\t$requested_url .= $_SERVER['REQUEST_URI'];\n\t}\n\n\t// phpcs:ignore\n\t$original = @parse_url( $requested_url );\n\tif ( false === $original ) {\n\t\treturn;\n\t}\n\n\tif ( is_front_page() || is_home() ) {\n\t\t// It's the front/blog page.\n\t\tfront_page_redirect( $requested_url );\n\t} elseif ( is_singular() ) {\n\t\t// It's a post.\n\t\tsingular_redirect( $requested_url );\n\t} elseif ( is_post_type_archive() ) {\n\t\t// It's a post type archive.\n\t\tpost_type_archive_redirect( $requested_url );\n\t} elseif ( is_tax() || is_category() || is_tag() ) {\n\t\t// It's a taxonomy archive.\n\t\tterm_archive_redirect( $requested_url );\n\t} elseif ( is_date() ) {\n\t\t// It's a date archive (posts).\n\t\tdate_archive_redirect( $requested_url );\n\t}\n}", "public function access_redirect() {\n\n\t\t// Bail if not a single Program.\n\t\tif ( ! is_singular( 'wampum_program' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if Woo Memberships is not active.\n\t\tif ( ! class_exists( 'WC_Memberships' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if super user.\n\t\tif ( is_user_logged_in() && current_user_can( 'wc_memberships_access_all_restricted_content' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$parent_program_id = wampum_get_top_parent_id();\n\n\t\t// Bail if viewing parent program, let Woo Memb do its thing.\n\t\tif ( get_the_ID() == $parent_program_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if the program is not restricted at all.\n\t\tif ( ! wc_memberships_is_post_content_restricted( $parent_program_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if user already has access.\n\t\tif ( current_user_can( 'wc_memberships_view_restricted_post_content', $parent_program_id ) ) {\n\t\t\treturn;\n\t\t} elseif ( current_user_can( 'wc_memberships_view_delayed_post_content', $parent_program_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$restriction_mode = get_option( 'wc_memberships_restriction_mode' );\n\n\t\t// If resctriction mode is set to \"Redirect to page\"\n\t\tif ( 'redirect' === $restriction_mode ) {\n\n\t\t\t// Redirect to Content Restricted page\n\t\t\t$redirect_page_id = get_option( 'wc_memberships_redirect_page_id' );\n\t\t\t$redirect_url = add_query_arg(\n\t\t\t\tarray( 'r' => $parent_program_id ),\n\t\t\t\t$redirect_page_id ? get_permalink( $redirect_page_id ) : home_url()\n\t\t\t);\n\t\t\twp_redirect( $redirect_url );\n\t\t\texit;\n\n\t\t}\n\t\t// If resctriction mode is set to \"Hide completely\"\n\t\telseif ( 'hide' === $restriction_mode ) {\n\n\t\t\t// Redirect home\n\t\t\twp_redirect( home_url() );\n\t\t\texit;\n\n\t\t}\n\t\t// If resctriction mode is set to \"Hide content\".\n\t\telseif ( 'hide_content' ) {\n\n\t\t\t// Remove the post content.\n\t\t\tremove_action( 'genesis_entry_content', 'genesis_do_post_content' );\n\n\t\t\t$content = '';\n\t\t\tif ( ! current_user_can( 'wc_memberships_view_restricted_post_content', $parent_program_id ) ) {\n\t\t\t\t$content = WC_Memberships_User_Messages::get_message_html( 'content_restricted', array( 'post_id' => $parent_program_id ) );\n\t\t\t} elseif ( ! current_user_can( 'wc_memberships_view_delayed_post_content', $parent_program_id ) ) {\n\t\t\t\t$content = WC_Memberships_User_Messages::get_message_html( 'content_delayed', array( 'post_id' => $parent_program_id ) );\n\t\t\t}\n\n\t\t\t// Output the content.\n\t\t\tadd_action( 'genesis_entry_content', function() use ( $content ) {\n\t\t\t\t$html = '';\n\t\t\t\tif ( wc_memberships()->get_restrictions_instance()->showing_excerpts() ) {\n\t\t\t\t\t$html .= get_the_excerpt( get_the_ID() );\n\t\t\t\t}\n\t\t\t\t$html .= $content;\n\t\t\t\tif ( true === (bool) apply_filters( 'wc_memberships_message_process_shortcodes', true, 'hide_content', array() ) ) {\n\t\t\t\t\t$html = do_shortcode( $html );\n\t\t\t\t}\n\t\t\t\techo $html;\n\t\t\t});\n\n\t\t}\n\n\t}", "function AccessDeniedRedirect(){\n if ($this->Page->Kernel->Package->Settings->HasItem(\"authorization\", $this->Page->PageMode . \"_HREF_Access_Denied\")) {\n $redirect_url = $this->Page->Kernel->Package->Settings->GetItem(\"authorization\", $this->Page->PageMode . \"_HREF_Access_Denied\");\n }\n else {\n $redirect_url = $this->Page->Kernel->Settings->GetItem(\"authorization\", $this->Page->PageMode . \"_HREF_Access_Denied_project\");\n }\n $this->SmartRedirect($redirect_url, $this->Page->Kernel->Settings->GetItem(\"Authorization\", \"FLG_EVAL_HREF_Not_Logged\"), $_SERVER[\"QUERY_STRING\"]);\n }", "public function template_redirect_action() {\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_404() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$request_url = TT::get_the_request_url();\n\t\tif ( null === $request_url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$request_path = trim( $request_url['path'], '/' ); // Remove leading and trailing slashes.\n\n\t\t$cache_key = md5( $request_path );\n\t\tif ( false === $link = wp_cache_get( $cache_key, self::CACHE_GROUP ) ) {\n\t\t\t$id = (int) $wpdb->get_var( $wpdb->prepare(\n\t\t\t\t\"\n\t\t\t\t\tSELECT post_id\n\t\t\t\t\tFROM $wpdb->postmeta\n\t\t\t\t\tWHERE ( meta_key = %s )\n\t\t\t\t\t AND ( meta_value = %s )\n\t\t\t\t\"\n\t\t\t\t,self::META_FIELD\n\t\t\t\t,$request_path\n\t\t\t)); // WPCS: db call ok.\n\n\t\t\tif ( $id ) {\n\t\t\t\t$link = get_permalink( $id );\n\t\t\t}\n\t\t\twp_cache_set( $cache_key, $link, self::CACHE_GROUP, 5 * MINUTE_IN_SECONDS );\n\t\t}\n\n\t\tif ( ! $link ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add back original query string.\n\t\tif ( array_key_exists( 'query', $request_url ) ) {\n\t\t\tparse_str( $request_url['query'], $request_query );\n\t\t\t$link = add_query_arg( $request_query, $link );\n\t\t}\n\n\t\twp_redirect( $link, 301 );\n\t\texit;\n\t}", "public function redirectWilokeSubmissionToFrontEnd(){\n\t\tif ( defined('DOING_AJAX') && DOING_AJAX )\n\t\t{\n\t\t\t$isAllowed = true;\n\t\t}\n\n\t\tif ( !isset($isAllowed) ){\n\t\t\t$userID = get_current_user_id();\n\t\t\t$oUserData = get_userdata($userID);\n\n\t\t\tif ( in_array(User::$wilokeSubmissionRole, $oUserData->roles) ){\n\t\t\t\t$aPaymentSettings = get_option(RegisterWilokeSubmission::$submissionConfigurationKey);\n\t\t\t\t$aPaymentSettings = !empty($aPaymentSettings) ? json_decode(stripslashes($aPaymentSettings), true) : '';\n\n\t\t\t\tif ( isset($aPaymentSettings['myaccount']) ){\n\t\t\t\t\t\twp_redirect(get_permalink($aPaymentSettings['myaccount']));\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function template_redirect() {\n\t\tif ( ! is_single() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $post;\n\n\t\t$permalink = get_post_meta( $post->ID, 'permalink', true );\n\n\t\tif ( $permalink ) {\n\t\t\twp_redirect( $permalink, 301 );\n\t\t}\n\t}", "function adverts_template_redirect_expired() {\n if( is_singular( 'advert' ) && get_post( get_the_ID() )->post_status == \"expired\" ) {\n $redirect_url = adverts_config( 'expired_ad_redirect_url' );\n \n if( empty( $redirect_url ) ) {\n $redirect_url = get_site_url();\n }\n \n $redirect_url = apply_filters( \"adverts_redirect_expired_url\", $redirect_url );\n $status = apply_filters( \"adverts_redirect_expired_status\", 301 );\n \n wp_redirect( $redirect_url, $status );\n exit;\n }\n}", "protected function checkPermissionRedirect()\n\n {\n\n if (!$this->user->hasAccess('backend.access_dashboard')) {\n\n $true = function () { return true; };\n\n if ($first = array_first(BackendMenu::listMainMenuItems(), $true)) {\n\n return Redirect::intended($first->url);\n\n }\n\n }\n\n }", "protected function checkPermissionRedirect()\n {\n if (!$this->user->hasAccess('xitara.core.dashboard')) {\n $true = function () {return true;};\n if ($first = array_first(BackendMenu::listMainMenuItems(), $true)) {\n return Redirect::intended($first->url);\n }\n }\n }", "function avoidLevelsPage() {\n\n\n\t\tglobal $current_user;\n\t\tglobal $post;\n\n\t\t$has_pdb = $this->util->_get_variable( 'pdb', false );\n\n\t\tif ( is_user_logged_in() && pmpro_getMembershipLevelForUser() && is_page( $this->pdb_page_list ) && false === $has_pdb ) {\n\n\t\t\t$record = $this->getUserRecord( $current_user->ID, true );\n\n\t\t\tif ( ! empty( $record ) ) {\n\n\t\t\t\t$redirect_url = add_query_arg( 'pdb', $record->id, site_url( \"/{$post->post_name}/\" ) );\n\n\t\t\t\tif ( WP_DEBUG ) {\n\t\t\t\t\terror_log( \"Redirecting with PDB ID: {$record->id} to {$redirect_url}\" );\n\t\t\t\t}\n\n\t\t\t\twp_redirect( $redirect_url );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_page( 'membership-levels' ) ) {\n\t\t\twp_redirect( home_url( '/membership-account/choose-your-membership-level/' ) );\n\t\t}\n\t}", "public function hasRedirect()\n {\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cleans up the warnings for deprecated PHPUnit methods. This is not ideal, but it's required to keep back compoat.
public function cleanupDeprecatedPHPUnitMethodsWarnings() { $currentWarnings = readPrivateProperty($this, 'warnings'); $warnings = array_filter($currentWarnings, static function ($warning) { return strpos($warning, 'assertFileNotExists() is deprecated') === false; }); setPrivateProperties($this, [ 'warnings' => $warnings ]); }
[ "public function testDeprecationWarning(): void\n {\n $current = error_reporting(E_ALL & ~E_USER_DEPRECATED);\n deprecationWarning('This method is deprecated');\n error_reporting($current);\n\n $this->expectDeprecation();\n $this->expectExceptionMessageMatches('/^This method is deprecated/');\n $this->expectExceptionMessageMatches('/You can disable deprecation warnings by setting `error_reporting\\(\\)` to `E_ALL & ~E_USER_DEPRECATED`\\.$/');\n deprecationWarning('This method is deprecated');\n }", "public function testDeprecationWarning()\n {\n $currentErrorReporting = error_reporting(E_ALL & ~E_USER_DEPRECATED);\n deprecationWarning('This method is deprecated');\n error_reporting($currentErrorReporting);\n\n $this->expectException(Deprecated::class);\n $this->expectExceptionMessageRegExp('/^This method is deprecated/');\n $this->expectExceptionMessageRegExp('/You can disable deprecation warnings by setting `error_reporting\\(\\)` to `E_ALL & ~E_USER_DEPRECATED`\\.$/');\n deprecationWarning('This method is deprecated');\n }", "public function testDeprecationWarningLevelDisabled(): void\n {\n $this->expectNotToPerformAssertions();\n\n $this->withErrorReporting(E_ALL ^ E_USER_DEPRECATED, function (): void {\n deprecationWarning('This is leaving');\n });\n }", "public function testDeprecationWarningEnabledDefaultFrame(): void\n {\n $this->expectDeprecation();\n $this->expectDeprecationMessageMatches('/This is going away too\\n(.*?)[\\/\\\\\\]TestCase.php, line\\: \\d+/');\n\n $this->withErrorReporting(E_ALL, function (): void {\n deprecationWarning('This is going away too');\n });\n }", "protected function logDeprecation() {}", "public function expectDeprecation() {\n\t\t$this->expectException( '\\PHPUnit\\Framework\\Error\\Deprecated' );\n\t}", "public function testDeprecationWarningEnabledDefaultFrame(): void\n {\n $error = $this->captureError(E_ALL, function (): void {\n deprecationWarning('5.0.0', 'This is going away too ' . uniqid());\n });\n $this->assertMatchesRegularExpression(\n '/This is going away too \\w+\\n(.*?)[\\/\\\\\\]TestCase.php, line\\: \\d+/',\n $error->getMessage()\n );\n }", "function clearWarnings(){\r\n\t\tdie('Not implemented');\r\n\t}", "public function expectedDeprecated()\n {\n if (false !== ($key = array_search('wp_title', $this->caught_deprecated))) {\n unset($this->caught_deprecated[$key]);\n }\n parent::expectedDeprecated();\n }", "public function expectedDeprecated() {\n\t\t if ( false !== ( $key = array_search( 'wp_title', $this->caught_deprecated ) ) ) {\n\t\t unset( $this->caught_deprecated[ $key ] );\n\t\t }\n\t\t parent::expectedDeprecated();\n\t\t}", "public function fix_deprecated() {\n // Reassign deprecated \"allowed_functions\" to \"api\".\n if ( isset( $this->allowed_functions ) ) {\n error_log('DustPress: Model property \"allowed_functions\" is deprecated, use \"api\" instead.');\n $this->api = $this->allowed_functions;\n }\n }", "public function testWarning(\\unittest\\TestWarning $warning) {\n // Empty\n }", "protected static function removeDeprecationLogFile() {}", "public function getAndResetWarnings();", "public function resetWarnings()\n\t{\n\t\t$this->_warnings = array();\n\t}", "#[Deprecated('Method is old')]\n #[Deprecated(message: 'Use newMethod() instead')]\n public function oldMethod(): void\n {\n echo 'old method';\n }", "public function testCanResolveDeprecatedClasses(): void\n {\n // @see https://github.com/davejamesmiller/laravel-breadcrumbs/blob/master/README.md\n foreach (\n [\n \\DaveJamesMiller\\Breadcrumbs\\BreadcrumbsManager::class,\n \\DaveJamesMiller\\Breadcrumbs\\BreadcrumbsGenerator::class,\n \\DaveJamesMiller\\Breadcrumbs\\BreadcrumbsServiceProvider::class,\n \\DaveJamesMiller\\Breadcrumbs\\Facades\\Breadcrumbs::class,\n ]\n as $deprecatedClassReferencedInREADME\n ) {\n $this->assertTrue(\\class_exists($deprecatedClassReferencedInREADME));\n }\n }", "public function testErrorOnSiteUnderTest() {\n $this->expectDeprecation('This is the deprecation message for deprecation_test_function().');\n $this->drupalGet(Url::fromRoute('deprecation_test.route'));\n }", "public function checkWarnings() { }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ return an array of exercise forms
public function getAllExerciseforms(): array { try { $this->db->query('SELECT `id`, `name` FROM `exerciseform`'); return $this->db->resultSet(); } catch (PDOException $e) { throw new PDOException('kan oefeningenvormen niet ophalen uit de database.'); } }
[ "function getAnswers() {\n\t\t// Declare array and ensure it is empty\n\t\t$questions = array(NULL, NULL, NULL);\n\n\t\t$questions[0] = $_POST[\"Political-Party\"];\n\t\t$questions[1] = $_POST[\"Direction\"];\n\t\t$questions[2] = $_POST[\"Candidate\"];\n\t\t$questions[3] = $_POST[\"Watch-Debate\"];\n\t\t$questions[4] = $_POST[\"Changed-Vote\"];\n\t\t$questions[5] = $_POST[\"Age\"];\n\t\t$questions[6] = $_POST[\"Race\"];\n\t\t$questions[7] = $_Post[\"Gender\"];\n\n\t\t// Make like a leaf\n\t\treturn $questions;\n\t}", "function extract_data() {\n $num_forms = (int) $this->lines[6];\n\n $form_1_answers = array();\n\n $extra_form_seqs = array();\n $extra_form_answers = array();\n\n foreach (range(1, $num_forms - 1) as $n) {\n $extra_form_seqs[] = array();\n $extra_form_answers[] = array();\n }\n\n $answer_lines = array_slice($this->lines, 16);\n\n $base_step = ($num_forms - 1) * 4 + 5;\n\n $letter_steps = array(\n $base_step + 7 * 0 => 'A',\n $base_step + 7 * 1 => 'B',\n $base_step + 7 * 2 => 'C',\n $base_step + 7 * 3 => 'D',\n $base_step + 7 * 4 => 'E'\n );\n\n foreach ($answer_lines as $line) {\n $answer = $line[0];\n\n $tmp_answer = '';\n\n if ($answer == 'V') {\n foreach ($letter_steps as $number => $letter) {\n if ($line[$number] . $line[$number + 1] != ' 0') {\n $tmp_answer .= $letter;\n }\n }\n\n $form_1_answers[] = $tmp_answer;\n } else {\n $form_1_answers[] = $line[0];\n }\n\n $line_arr = str_split($line);\n\n foreach($extra_form_seqs as $k => $extra_form) {\n $seq_num = (int) implode('', array_slice($line_arr, 5 + $k * 4, 3));\n\n $extra_form_seqs[$k][] = $seq_num;\n }\n }\n\n // For each form, find the index at which the appropriate answer is held\n // in $form_1_answers\n foreach ($form_1_answers as $n => $answer) {\n foreach ($extra_form_seqs as $i => $extra_form) {\n $answer = $form_1_answers[array_search($n + 1, $extra_form_seqs[$i])];\n\n $extra_form_answers[$i][] = $answer;\n }\n }\n\n $ret = array();\n\n $ret[] = implode('|', $form_1_answers);\n\n foreach ($extra_form_answers as $answers) {\n $ret[] = implode('|', $answers);\n }\n\n return implode(';', $ret);\n }", "public function getExercises(): array\n {\n try {\n $this->db->query('SELECT `id`, `name`, `description`, `repetitions`, `sets` FROM exercises');\n return $this->db->resultSet();\n } catch (PDOException $e) {\n throw new PDOException('Kan geen records vinden');\n }\n }", "function getAllExercises() {\r\n\r\n // Executes query\r\n try {\r\n\r\n $data = array();\r\n $stmt = $this->dbh->prepare( \"\r\n SELECT exerID, exerName, areaName, muscleName, exerDescription, exerInstructions, userName \r\n FROM exercise\r\n JOIN area\r\n ON exerArea = areaID\r\n JOIN muscle\r\n ON exerMuscle = muscleID\r\n JOIN user\r\n ON exerAuthor = userID\r\n \" );\r\n $stmt->execute();\r\n\r\n while ( $exercise = $stmt->fetch() ) {\r\n $data[] = $exercise;\r\n }\r\n\r\n return $data;\r\n\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n die();\r\n } // Ends try catch\r\n\r\n }", "function createAnswersForm ($form) {\n\n\t\t$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759.\n\t\t$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));\n\n\t\t$obj_ex = $_SESSION['objExercise'];\n \n\t\t$html.='<div class=\"row\">\n\t\t\t <div class=\"label\">\n\t\t\t '.get_lang('Answers').'<br /><img src=\"../img/fill_field.png\">\n\t\t\t </div>\n\t\t\t <div class=\"formw\">'; \n \n $html2 ='<div class=\"row\">\n <div class=\"label\"> \n </div>\n <div class=\"formw\">';\n \n $form -> addElement ('html', $html2); \n $form -> addElement ('html', '<table><tr>'); \n $renderer = & $form->defaultRenderer();\n $defaults = array();\n //Extra values True, false, Dont known\n if (!empty($this->extra)) {\n $scores = explode(':',$this->extra);\n \n if (!empty($scores)) {\n for ($i = 1; $i <=3; $i++) {\n $defaults['option['.$i.']']\t= $scores[$i-1]; \n } \n } \n }\n \n // 3 scores\n $form->addElement('text', 'option[1]',get_lang('True'), array('size'=>'5','value'=>'1'));\n $form->addElement('text', 'option[2]',get_lang('False'), array('size'=>'5','value'=>'-0.5')); \n $form->addElement('text', 'option[3]',get_lang('DoubtScore'),array('size'=>'5','value'=>'0')); \n \n $form -> addElement('hidden', 'options_count', 3);\n \n $form -> addElement ('html', '</tr></table>');\n $form -> addElement ('html', '</div></div>');\n \n\t\t$html.='<table class=\"data_table\">\n\t\t\t\t\t<tr style=\"text-align: center;\">\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t'.get_lang('Number').'\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t'.get_lang('True').'\n\t\t\t\t\t\t</th>\n <th>\n '.get_lang('False').'\n </th> \n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t'.get_lang('Answer').'\n\t\t\t\t\t\t</th>';\n \t\t\t\t// show column comment when feedback is enable\n \t\t\t\tif ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM ) {\n \t\t\t\t $html .='<th>'.get_lang('Comment').'</th>';\n \t\t\t\t}\n\t\t\t\t$html .= '</tr>';\n\t\t$form -> addElement ('html', $html);\n\n\t\t\n\t\t$correct = 0;\n\t\tif (!empty($this -> id))\t{\n\t\t\t$answer = new Answer($this -> id);\n\t\t\t$answer->read();\t\t\t\n\t\t\tif (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {\n\t\t\t\t$nb_answers = $answer->nbrAnswers;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$form -> addElement('hidden', 'nb_answers');\n\t\t$boxes_names = array();\n\n\t\tif ($nb_answers < 1) {\n\t\t\t$nb_answers = 1;\n\t\t\tDisplay::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));\n\t\t}\n \n // Can be more options \n $option_data = Question::readQuestionOption($this->id); \n \n \n\t\tfor ($i = 1 ; $i <= $nb_answers ; ++$i) {\n \n $renderer->setElementTemplate('<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error -->{label} &nbsp;&nbsp;{element}</td>'); \n $answer_number=$form->addElement('text', null,null,'value=\"'.$i.'\"');\n $answer_number->freeze(); \n \n\t\t\tif (is_object($answer)) { \n\t\t\t\t$defaults['answer['.$i.']'] = $answer -> answer[$i];\n\t\t\t\t$defaults['comment['.$i.']'] = $answer -> comment[$i];\n\t\t\t\t//$defaults['weighting['.$i.']'] = float_format($answer -> weighting[$i], 1);\n \n $correct = $answer->correct[$i];\n \n $defaults['correct['.$i.']'] = $correct; \n\t\t\t\n $j = 1; \n if (!empty($option_data)) {\n foreach ($option_data as $id=>$data) { \n $form->addElement('radio', 'correct['.$i.']', null, null, $id);\n $j++;\n if ($j == 3) {\n \tbreak;\n }\n \n } \n }\n\t\t\t} else { \n $form->addElement('radio', 'correct['.$i.']', null, null, 1); \n $form->addElement('radio', 'correct['.$i.']', null, null, 2);\n \n $defaults['answer['.$i.']'] = '';\n $defaults['comment['.$i.']'] = '';\n $defaults['correct['.$i.']'] = ''; \n\t\t\t} \n \n //$form->addElement('select', 'correct['.$i.']',null, $this->options, array('id'=>$i,'onchange'=>'multiple_answer_true_false_onchange(this)'));\n \n\t\t\t$boxes_names[] = 'correct['.$i.']';\n\n\t\t\t$form->addElement('html_editor', 'answer['.$i.']',null, 'style=\"vertical-align:middle\"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));\n\t\t\t$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');\n\n\t\t\t// show comment when feedback is enable\n\t\t\tif ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {\n\t\t\t\t$form->addElement('html_editor', 'comment['.$i.']',null, 'style=\"vertical-align:middle\"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));\n\t\t\t}\n\t\t\t$form->addElement ('html', '</tr>');\n\t\t}\n\t\t$form -> addElement ('html', '</table>');\n\t\t$form -> addElement ('html', '<br />');\n\n\t\t//$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');\n\n\n\t\t$navigator_info = api_get_navigator();\n\n\t\tglobal $text, $class, $show_quiz_edition;\n\t\tif ($show_quiz_edition) {\n\t\t\t//ie6 fix\n\t\t\tif ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {\n \n $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class=\"minus\"');\n $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class=\"plus\"');\t\t\t\t\n $form->addElement('submit', 'submitQuestion',$text, 'class=\"'.$class.'\"');\n\t\t\t} else {\n // setting the save button here and not in the question class.php\n \n $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class=\"minus\"');\n $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class=\"plus\"');\n $form->addElement('style_submit_button', 'submitQuestion',$text, 'class=\"'.$class.'\"');\t\n\t\t\t}\n\t\t}\n\t\t$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');\n\t\t$renderer->setElementTemplate('{element}&nbsp;','submitQuestion');\n\t\t$renderer->setElementTemplate('{element}','moreAnswers');\n\t\t$form -> addElement ('html', '</div></div>');\n\t\t$defaults['correct'] = $correct;\n\n\t\tif (!empty($this -> id)) {\n\t\t\t$form -> setDefaults($defaults);\n\t\t} else {\n\t\t\t//if ($this -> isContent == 1) {\n\t\t\t\t$form -> setDefaults($defaults);\n\t\t\t//}\n\t\t}\n\n\t\t$form->setConstants(array('nb_answers' => $nb_answers));\n\t}", "function getAnswers(){\n $a = array();\n for ($i = 2; $i < count($this->question);$i++){\n $a[] = $this->question[$i];\n }\n return $a;\n}", "function printQuiz($questions)\n{\n foreach ($questions as $q) {\n echo \"{$q['descriptions']}\" . PHP_EOL;\n switch ($q['type']) {\n case 'boolean':\n echo \"1. True\\n2. False\" . PHP_EOL;\n break;\n case 'multipleChoice':\n $index = 1;\n\n foreach ($q['options'] as $option) {\n echo \"$index. $option\" . PHP_EOL;\n $index++;\n }\n break;\n case 'text':\n echo \"Answer: ________________________\";\n break;\n // hasil tambahan\n case 'range':\n echo \"Minimum: \" . PHP_EOL;\n echo \"Maximum: \" . PHP_EOL;\n break;\n }\n echo PHP_EOL;\n }\n}", "public function getAllExercises() {\n return $this->exercises;\n }", "public function getExercises()\r\n {\r\n return $this->_exercises;\r\n }", "public function createAnswersForm($form)\n {\n // Getting the exercise list\n $obj_ex = Session::read('objExercise');\n\n $editor_config = array(\n 'ToolbarSet' => 'TestProposedAnswer',\n 'Width' => '100%',\n 'Height' => '125'\n );\n\n //this line defines how many questions by default appear when creating a choice question\n // The previous default value was 2. See task #1759.\n $nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 4;\n $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));\n\n /*\n Types of Feedback\n $feedback_option[0]=get_lang('Feedback');\n $feedback_option[1]=get_lang('DirectFeedback');\n $feedback_option[2]=get_lang('NoFeedback');\n */\n\n $feedback_title = '';\n\n if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {\n //Scenario\n $comment_title = '<th width=\"20%\">' . get_lang('Comment') . '</th>';\n $feedback_title = '<th width=\"20%\">' . get_lang('Scenario') . '</th>';\n } else {\n $comment_title = '<th width=\"40%\">' . get_lang('Comment') . '</th>';\n }\n\n $html = '<table class=\"table table-striped table-hover\">\n <thead>\n <tr style=\"text-align: center;\">\n <th width=\"5%\">' . get_lang('Number') . '</th>\n <th width=\"5%\"> ' . get_lang('True') . '</th>\n <th width=\"40%\">' . get_lang('Answer') . '</th>\n ' . $comment_title . '\n ' . $feedback_title . '\n <th width=\"10%\">' . get_lang('Weighting') . '</th>\n </tr>\n </thead>\n <tbody>';\n\n $form->addHeader(get_lang('Answers'));\n $form->addHtml($html);\n\n $defaults = array();\n $correct = 0;\n if (!empty($this->id)) {\n $answer = new Answer($this->id);\n $answer->read();\n if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {\n $nb_answers = $answer->nbrAnswers;\n }\n }\n $form->addElement('hidden', 'nb_answers');\n\n //Feedback SELECT\n $question_list = $obj_ex->selectQuestionList();\n $select_question = array();\n $select_question[0] = get_lang('SelectTargetQuestion');\n if (is_array($question_list)) {\n foreach ($question_list as $key => $questionid) {\n //To avoid warning messages\n if (!is_numeric($questionid)) {\n continue;\n }\n $question = Question::read($questionid);\n $select_question[$questionid] = 'Q' . $key . ' :' . cut(\n $question->selectTitle(), 20\n );\n }\n }\n $select_question[-1] = get_lang('ExitTest');\n\n $list = new LearnpathList(api_get_user_id());\n $flat_list = $list->get_flat_list();\n $select_lp_id = array();\n $select_lp_id[0] = get_lang('SelectTargetLP');\n\n foreach ($flat_list as $id => $details) {\n $select_lp_id[$id] = cut($details['lp_name'], 20);\n }\n\n $temp_scenario = array();\n\n if ($nb_answers < 1) {\n $nb_answers = 1;\n Display::display_normal_message(\n get_lang('YouHaveToCreateAtLeastOneAnswer')\n );\n }\n\n for ($i = 1; $i <= $nb_answers; ++$i) {\n $form->addHtml('<tr>');\n if (isset($answer) && is_object($answer)) {\n if ($answer->correct[$i]) {\n $correct = $i;\n }\n $defaults['answer[' . $i . ']'] = $answer->answer[$i];\n $defaults['comment[' . $i . ']'] = $answer->comment[$i];\n $defaults['weighting[' . $i . ']'] = float_format(\n $answer->weighting[$i],\n 1\n );\n\n $item_list = explode('@@', $answer->destination[$i]);\n\n $try = isset($item_list[0]) ? $item_list[0] : '';\n $lp = isset($item_list[1]) ? $item_list[1] : '';\n $list_dest = isset($item_list[2]) ? $item_list[2] : '';\n $url = isset($item_list[3]) ? $item_list[3] : '';\n\n if ($try == 0) {\n $try_result = 0;\n } else {\n $try_result = 1;\n }\n if ($url == 0) {\n $url_result = '';\n } else {\n $url_result = $url;\n }\n\n $temp_scenario['url' . $i] = $url_result;\n $temp_scenario['try' . $i] = $try_result;\n $temp_scenario['lp' . $i] = $lp;\n $temp_scenario['destination' . $i] = $list_dest;\n } else {\n $defaults['answer[1]'] = get_lang('DefaultUniqueAnswer1');\n $defaults['weighting[1]'] = 10;\n $defaults['answer[2]'] = get_lang('DefaultUniqueAnswer2');\n $defaults['weighting[2]'] = 0;\n\n $temp_scenario['destination' . $i] = array('0');\n $temp_scenario['lp' . $i] = array('0');\n }\n $defaults['scenario'] = $temp_scenario;\n\n $renderer = $form->defaultRenderer();\n\n $renderer->setElementTemplate(\n '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n 'correct'\n );\n $renderer->setElementTemplate(\n '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n 'counter[' . $i . ']'\n );\n $renderer->setElementTemplate(\n '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n 'answer[' . $i . ']'\n );\n $renderer->setElementTemplate(\n '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n 'comment[' . $i . ']'\n );\n $renderer->setElementTemplate(\n '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n 'weighting[' . $i . ']'\n );\n\n $answer_number = $form->addElement(\n 'text', 'counter[' . $i . ']', null, ' value = \"' . $i . '\"'\n );\n $answer_number->freeze();\n $form->addElement(\n 'radio', 'correct', null, null, $i, 'class=\"checkbox\"'\n );\n\n $form->addHtmlEditor('answer[' . $i . ']', null, null, true, $editor_config);\n\n $form->addRule(\n 'answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'\n );\n\n if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {\n $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config);\n // Direct feedback\n //Adding extra feedback fields\n $group = array();\n $group['try' . $i] = $form->createElement(\n 'checkbox',\n 'try' . $i,\n null,\n get_lang('TryAgain')\n );\n $group['lp' . $i] = $form->createElement(\n 'select',\n 'lp' . $i,\n get_lang('SeeTheory') . ': ',\n $select_lp_id\n );\n $group['destination' . $i] = $form->createElement(\n 'select',\n 'destination' . $i,\n get_lang('GoToQuestion') . ': ',\n $select_question\n );\n $group['url' . $i] = $form->createElement(\n 'text',\n 'url' . $i,\n get_lang('Other') . ': ',\n array(\n 'class' => 'col-md-2',\n 'placeholder' => get_lang('Other')\n )\n );\n $form->addGroup($group, 'scenario');\n\n $renderer->setElementTemplate(\n '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}',\n 'scenario'\n );\n } else {\n $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config);\n }\n $form->addText('weighting[' . $i . ']', null, null, array('value' => '0'));\n $form->addHtml('</tr>');\n }\n\n $form->addHtml('</tbody>');\n $form->addHtml('</table>');\n\n global $text;\n\n $buttonGroup = [];\n //ie6 fix\n if ($obj_ex->edit_exercise_in_lp == true) {\n\n //setting the save button here and not in the question class.php\n $buttonGroup[] = $form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers', true);\n $buttonGroup[] = $form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers', true);\n $buttonGroup[] = $form->addButtonSave($text, 'submitQuestion', true);\n\n $form->addGroup($buttonGroup);\n }\n\n // We check the first radio button to be sure a radio button will be check\n if ($correct == 0) {\n $correct = 1;\n }\n\n $defaults['correct'] = $correct;\n\n if (!empty($this->id)) {\n $form->setDefaults($defaults);\n } else {\n if ($this->isContent == 1) {\n // Default sample content.\n $form->setDefaults($defaults);\n } else {\n $form->setDefaults(array('correct' => 1));\n }\n }\n $form->setConstants(array('nb_answers' => $nb_answers));\n }", "function makeFormRows(){\n \n $a='';\n\n foreach($this->form_array as $fieldname => $fieldinfo){\n\n \tswitch ($fieldinfo['type']){\n\n \t\tcase 'open':\n \t\t\t\n \t\t\t$a .= $this->openForm($fieldname);\n\n \t\t\tbreak;\n\n \t\tcase 'openEnctype':\n \t\t\t\n \t\t\t$a .= $this->openEnctype();\n\n \t\t\tbreak;\n\n \t\tcase 'text':\n \t\t\t\n \t\t\t$a .= $this->makeInputRow($fieldname);\n\n \t\t\tbreak;\n\n \t\tcase 'search':\n \t\t\t\n \t\t\t$a .= $this->makeInputRow($fieldname);\n\n \t\t\tbreak;\n\n \t\tcase 'text_area':\n \t\t\t\n \t\t\t$a .= $this->makeTextarea($fieldname);\n\n \t\t\tbreak;\n \t\t\n \t\tcase 'select':\n\n \t\t\t$a .= $this->makeSelectRow($fieldname);\n\n \t\t\tbreak;\n\n \t\tcase 'password':\n\n \t\t\t$a .= $this->makeInputRow($fieldname);\n\n \t\t\tbreak;\n\n \t\tcase 'file_input':\n\n \t\t\t$a .= $this->makeFileInput();\n\n \t\t\tbreak;\n\n \t}\n\n }\n \n return $a;\n\n }", "public function testExerciseAddingMultipleAnswers()\n {\n\n // give this test admin user access\n $this->asAdmin();\n\n $input = [\n 'ex_title' => 'Test Title',\n 'ex_content' => 'Test content',\n 'ex_author' => '',\n 'ex_hint' => '',\n 'ex_solution' => '',\n 'category' => 'füüsika',\n 'age_group' => 'uurija',\n 'difficulty' => 'keskmine',\n 'answer_count' => '3',\n 'answer_1' => 'Test answer 1',\n 'answer_2' => 'Test answer 2',\n 'answer_3' => 'Test answer 3'\n ];\n\n $this->call('POST', '/admin/exercise/create/1', $input);\n\n $this->assertCount(1, Exercise::all());\n $this->assertCount(3, Answer::all());\n }", "public static function exercise()\n {\n return self::randomElement(self::$exercises);\n }", "function get_answers_from_exam($qid){\n\t$data = array();\n\t$result = mysql_query(\"SELECT * FROM `mock_exam_answers` WHERE `question_id` = '$qid'\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\treturn $data;\n}", "public function getExerciseTests(): Collection;", "function answers()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Answer WHERE AlternativeID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAnswer( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public function questions() {\n return ORM::factory('exercisequestion')\n ->where('exercise_id', ' = ', $this->id)\n ->find_all();\n }", "function faq_to_array($faq)\n{\n\t$blocks = array();\n\t$quests = array();\n\n\t$block_no = -1;\n\t$quest_no = 0;\n\n\tfor($i = 0; $i < count($faq); $i++)\n\t{\n\t\tif($faq[$i][0] == '--')\n\t\t{\n\t\t\t$block_no++;\n\t\t\t$blocks[$block_no] = $faq[$i][1];\n\t\t\t$quests[$block_no] = array();\n\t\t\t$quest_no = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$quests[$block_no][$quest_no][Q] = $faq[$i][0];\n\t\t\t$quests[$block_no][$quest_no][A] = $faq[$i][1];\n\t\t\t$quest_no++;\n\t\t}\n\t}\n\n\treturn array($blocks, $quests);\n}", "private function copy_testcases_from_form(&$question) {\n $testcases = array();\n $numTests = count($question->testcode);\n assert(count($question->output) == $numTests);\n for($i = 0; $i < $numTests; $i++) {\n $input = filterCrs($question->testcode[$i]);\n $stdin = filterCrs($question->stdin[$i]);\n $output = filterCrs($question->output[$i]);\n if ($input == '' && $stdin == '' && $output == '') {\n continue;\n }\n $testcase = new stdClass;\n $testcase->questionid = isset($question->id) ? $question->id : 0;\n $testcase->testcode = $input;\n $testcase->stdin = $stdin;\n $testcase->output = $output;\n $testcase->useasexample = isset($question->useasexample[$i]);\n $testcase->display = $question->display[$i];\n $testcase->hiderestiffail = isset($question->hiderestiffail[$i]);\n $testcases[] = $testcase;\n }\n\n $question->testcases = $testcases;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'updateColorCollection'
protected function updateColorCollectionRequest($collection_id, $body) { // verify the required parameter 'collection_id' is set if ($collection_id === null || (is_array($collection_id) && count($collection_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $collection_id when calling updateColorCollection' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $body when calling updateColorCollection' ); } $resourcePath = '/color_collections/{collection_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($collection_id !== null) { $resourcePath = str_replace( '{' . 'collection_id' . '}', ObjectSerializer::toPathValue($collection_id), $resourcePath ); } // body params $_tempBody = null; if (isset($body)) { $_tempBody = $body; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function colorCollectionRequest($collection_id, $fields = null)\n {\n // verify the required parameter 'collection_id' is set\n if ($collection_id === null || (is_array($collection_id) && count($collection_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $collection_id when calling colorCollection'\n );\n }\n\n $resourcePath = '/color_collections/{collection_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n // path params\n if ($collection_id !== null) {\n $resourcePath = str_replace(\n '{' . 'collection_id' . '}',\n ObjectSerializer::toPathValue($collection_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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\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 }", "protected function deleteColorCollectionRequest($collection_id)\n {\n // verify the required parameter 'collection_id' is set\n if ($collection_id === null || (is_array($collection_id) && count($collection_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $collection_id when calling deleteColorCollection'\n );\n }\n\n $resourcePath = '/color_collections/{collection_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($collection_id !== null) {\n $resourcePath = str_replace(\n '{' . 'collection_id' . '}',\n ObjectSerializer::toPathValue($collection_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function allColorCollectionsRequest($fields = null)\n {\n\n $resourcePath = '/color_collections';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(Request $request, Color $color)\n {\n // Validate the fields\n request()->validate([\n 'name' => ['required','string'],\n 'rgb' => ['required','string']\n ]);\n // Data verification\n if(isset($request->name) && isset($request->rgb) && !is_null($request->name) && !is_null($request->rgb) && !empty($request->name) && !empty($request->rgb) && is_string($request->name) && is_string($request->rgb)){\n // if datas entered are the same.\n if(($request->name == $color->name) && ($request->rgb == $color->rgb) && ($request->opacity == $color->opacity) ){\n return redirect('/color');\n }else{\n $color->name = e($request->name);\n $color->rgb = e($request->rgb);\n $color->opacity = e($request->opacity);\n $color->save();\n return redirect('/color')->with('message', 'Les données ont bien été modifiées');\n }\n }else{\n return redirect('/website')->with('messageError', \"Une erreur est survenue lors de l'enregistrement des données.\");\n } \n \n }", "protected function allColorCollectionsRequest($fields = null)\n {\n\n $resourcePath = '/color_collections';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function editColor(Request $request)\n {\n $perameters = $request->all();\n $perameters['id'] = base64_decode($perameters['id']);\n $validation = Validator::make($perameters, [\n 'id' => 'required',\n 'color_name' => 'required|unique:device_colors,color_name,'.$perameters['id'],\n ]);\n if ( $validation->fails() ) {\n return redirect()->back()->withInput()->with('error',$validation->messages()->first());\n }else{\n $editColor = DeviceColor::find($perameters['id']);\n $editColor->color_name = $perameters['color_name'];\n if($editColor->save()){\n return redirect('admin/colors-list')->withInput()->with('success','Color update successfully.');\n }else{\n return redirect()->back()->withInput()->with('error','Color not add.');\n }\n }\n }", "protected function colorCollectionsCustomRequest($fields = null)\n {\n\n $resourcePath = '/color_collections/custom';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function designAtomsViewerUpdateByColorDataRequest($tenant_id = null, $update_colors_request = null)\n {\n\n $resourcePath = '/api/atoms/v1/ccviewer/UpdateByColorData';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($tenant_id !== null) {\n if('form' === 'form' && is_array($tenant_id)) {\n foreach($tenant_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantId'] = $tenant_id;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($update_colors_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($update_colors_request));\n } else {\n $httpBody = $update_colors_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n // aurigmafix 6\n if (gettype($formParamValueItem) === 'object') {\n if (!($formParamValueItem instanceof StreamInterface \n || $formParamValueItem instanceof \\Iterator \n || method_exists($formParamValueItem, '__toString'))) {\n $formParamValueItem = json_encode($formParamValueItem);\n }\n } \n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function editProductColor(Request $request)\n {\n $request->validate([\n 'description' => 'required|max:100',\n ]);\n\n $color = Colors::where('color_id', $request['color_id'])->first();\n $color->description = $request['description'];\n\n $color->save();\n\n return array('error' => false, \"message\" => \"Product color successfully updated!\");\n }", "public function updateColorCollectionWithHttpInfo($collection_id, $body)\n {\n $returnType = '\\Funeralzone\\LookerClient\\Model\\ColorCollection';\n $request = $this->updateColorCollectionRequest($collection_id, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\ColorCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\ValidationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function update(){ \n $jd = new JsonData();\n $jd->set(\"error\", \"Update color functionality not yet implemented\");\n return $jd;\n }", "public function updateColorOptionsArray()\n {\n if(current_user_can('manage_categories') && is_admin() && isset($_POST['termId']) && isset($_POST['color']) && isset($_POST['taxonomy'])) {\n $taxonomy = sanitize_text_field($_POST['taxonomy']);\n $termId = absint($_POST['termId']);\n $color = substr($_POST['color'], 0, 7);\n if($this->isTaxonomyInUse($taxonomy) && $termId > 0) {\n if(!update_term_meta($termId, 'cc_color', $color)) {\n add_term_meta($termId, 'cc_color', $color);\n }\n }\n }\n\n exit;\n }", "function update_colors($id, $data) {\n\n\t\t//Set where clause\n\t\t$this -> db -> where('Id', $id);\n\n\t\t// var_dump($data);\n\n\t\t//update database\n\t\treturn $this -> db -> update('Team', $data);\n\n\t}", "public function createCollectionStatus(Collection $collection, int $newStatus): Collection;", "function count_collection_colors_colors($colors, $count_colors, $weights=array())\n {\n assert_is_array($colors, \"colors\");\n assert_is_array($weights, \"weights\");\n assert_is_array($count_colors, \"count_colors\");\n\n $params = array();\n fill_array_params($params, $colors, \"colors\");\n fill_array_params($params, $weights, \"weights\");\n fill_array_params($params, $count_colors, \"count_colors\");\n\n return $this->request('count_collection_colors', $params);\n }", "public function storeColor(Request $request)\n {\n // Validate the fields\n request()->validate([\n 'name' => ['required','string'],\n 'rgb' => ['required','string'],\n ]);\n\n // Data verification\n if(isset($request->name) && isset($request->rgb) && !is_null($request->name) && !is_null($request->rgb) && !empty($request->name) && !empty($request->rgb) && is_string($request->name) && is_string($request->rgb)){\n // Check if color exists in database\n $colors = Color::all();\n foreach ($colors as $item) {\n if(($item->name == $request->name) && ($item->rgb == $request->rgb)){\n return back()->with('message', 'Cette couleur existe déjà');\n }\n }\n // Save data\n $color = New Color;\n $color->name = e($request->name);\n $color->rgb = e($request->rgb);\n if($request->opacity == null){\n $opacity = 1;\n }else{\n $opacity = $request->opacity;\n }\n $color->opacity = e($opacity);\n $color->save();\n return redirect()->route('colors.list')->with('message', 'Les données ont bien été ajoutées');\n }else{\n return redirect()->route('create.color')->with('messageError', \"Une erreur est survenue lors de l'enregistrement des données.\");\n } \n }", "public function defaultColorCollectionWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\ColorCollection';\n $request = $this->defaultColorCollectionRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ColorCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function createColorCollectionAsyncWithHttpInfo($body)\n {\n $returnType = '\\Swagger\\Client\\Model\\ColorCollection';\n $request = $this->createColorCollectionRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function rest_update_colors( $color, $object, $field_name ) {\n\t\t$color = colorposts_sanitize_hex_color_no_hash( $color );\n\n\t\tif ( ! isset( $color ) || ! empty( $color ) ) {\n\t\t\treturn new WP_Error( 'bad-post-color', __( 'The specified color is in an invalid format.', 'color-posts' ) );\n\t\t}\n\n\t\t$colors = array(\n\t\t\t'color' => $color,\n\t\t\t'contrast' => colorposts_get_contrast( $color ),\n\t\t\t'custom' => true,\n\t\t);\n\n\t\treturn update_post_meta( $object->ID, '_post_colors', $colors );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolves a path to a absolute plugin path.
protected function resolvePath($plugin, $path) { $path = strtr($path, '\\', '/'); if (!($path[0] == '/' || (strlen($path) > 3 && ctype_alpha($path[0]) && $path[1] == ':' && $path[2] == '/'))) { $path = $plugin['path']."/$path"; } return $path; }
[ "public function resolve(string $path): string;", "public static function resolveFilePath($path)\n {\n // resolve MOD: prefix\n if (strtoupper(substr($path, 0, 3)) === 'MOD') {\n $path = str_ireplace('mod:', PLUGINS_DIR, $path);\n }\n // check if file exists\n if (file_exists($path)) {\n return $path;\n }\n return null;\n }", "public function resolveLocalPath($path);", "public function resolvedPath();", "public function relative_url ($path) {\n if (function_exists('plugins_url') && function_exists('plugin_dir_path')) {\n $plugin_dir = plugin_dir_path( dirname(__FILE__) );\n $path = str_replace($plugin_dir, \"\", $path);\n return plugins_url($path, $plugin_dir);\n } else {\n return $path;\n }\n }", "public function resolve ( $path )\n {\n $path = (string) $path;\n\n // If the path is global, no resolution necessary\n if ( \\substr($path, 0, 1) === '\\\\' )\n return $path;\n\n // if the first part of the namespace is registered as a namespace,\n // then resolve it\n $pathParts = explode('\\\\', $path);\n $firstPart = array_shift($pathParts);\n if ( isset($this->aliases[$firstPart]) ) {\n $path = $this->aliases[$firstPart]->getPath()\n .'\\\\'. implode('\\\\', $pathParts);\n }\n\n // Finally, resolve a path relative to this namespace\n else if ( \\substr($path, 0, 1) !== '\\\\' ) {\n $path = $this->path .'\\\\'. $path;\n }\n\n return \\r8\\str\\head($path, '\\\\');\n }", "function front_controller_resolve($plugin, $file)\n{\n $file = $plugin == '_framework'\n ? 'framework/' . $file\n : 'plugins/' . $plugin . '/' . $file\n ;\n $file = filesystem_realpath($file);\n return is_file($file) ? $file : false;\n}", "public function relative_file_path ($path) {\n if (function_exists('plugin_dir_path')) {\n $plugin_dir = plugin_dir_path( dirname(__FILE__) );\n $path = $plugin_dir . $path;\n }\n\n return $path;\n }", "public function resolvePath($path, $currentDir);", "public static function resolve(...$paths): string;", "static public function resolvePath ( $path )\n {\n $path = trim( (string) $path );\n $path = str_replace( '\\\\', '/', $path );\n\n // Pull the root value off of the path\n if ( preg_match('/^((?:[a-z]+:)?\\/)(.*)/i', $path, $pathRootReg) ) {\n $root = $pathRootReg[1];\n $path = $pathRootReg[2];\n }\n else {\n $root = \"\";\n }\n\n // Record whether the path we are resolving ends with a \"/\"... this will\n // be used to re-attach the trailing slash later\n $hasTail = \\r8\\str\\endsWith($path, \"/\");\n\n $pathStack = explode(\"/\", $path);\n\n $out = array();\n\n foreach ($pathStack AS $pathElem) {\n\n if ( !empty($pathElem) ) {\n\n if ($pathElem == \"..\")\n @array_pop($out);\n\n else if ($pathElem != \".\")\n $out[] = $pathElem;\n\n }\n\n }\n\n return $root . implode(\"/\", $out) . ( $hasTail ? \"/\" : \"\" );\n }", "public function resolveAbsolutePath($path)\n {\n if ($this->inAllowedPaths($path)) {\n $file = new SplFileInfo($path);\n if ($file->isReadable() && !$file->isDir()) {\n $filePath = $file->getRealPath();\n $mimeType = $this->getMimeResolver()->getMimeType($filePath);\n $asset = new FileAsset($filePath);\n $asset->mimetype = $mimeType;\n return $asset;\n }\n }\n return null;\n }", "private static function get_absolute_path( $file_path ) {\n\t\treturn plugin_dir_path( LEADIN_BASE_PATH ) . $file_path;\n\t}", "public static function resolve_path($path)\n\t{\n\t\tif($path[0] == \"/\")\n\t\t{\n\t\t\t$path = DOCROOT.$path;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Join the CSS directory with the requested directory\n\t\t\t$path = join_path(CSSPATH,CSScaffold::config('core.request.relative_dir'),$path);\n\t\t\t\n\t\t\t# Get the full server path to the file\n\t\t\t$path = realpath($path);\n\t\t}\n\t\t\n\t\treturn $path;\n\t}", "function fromBasepathTo(string $path){\n\t\t// The absolute path string\n\t\treturn realpath($this->basePath . '/' . $path);\n\t}", "static public function resolvePathWithExtPrefix ($path) {\n\t\tif(substr($path, 0, 4) == 'EXT:') {\n\t\t\tlist($extKey, $local) = explode('/', substr($path, 4), 2);\n\t\t\tif(\\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::isLoaded($extKey)) {\n\t\t\t\t$path = self::getSiteRelativeExtensionPath($extKey) . $local;\n\t\t\t}\n\t\t}\n\t\treturn $path;\n\t}", "function tryresolvepath($path)\n {\n $result = '';\n\n $path = trim($path);\n if (strlen($path) === 0)\n {\n return $result;\n }\n\n $path = is_windows($path) ? str_replace('/', SEP, $path) : str_replace('\\\\', SEP, $path);\n\n\n // Explode by current filesystem path separator\n $pathnodes = str_explode(SEP, $path);\n\n if (sizeof($pathnodes) > 0)\n {\n $result = $pathnodes[0];\n\n foreach ($pathnodes as $node)\n {\n $result = concat($result, SEP, $node);\n $realpath = realpath($result);\n\n if (is_string($realpath))\n {\n $result = $realpath;\n\n // If current result is a path to file, there's no point trying to resolve for the next node\n break;\n }\n }\n }\n\n return $result;\n }", "protected function resolvePath($path)\n {\n $rootPath = defined('ROOT_PATH') ? ROOT_PATH : getcwd();\n\n return mb_substr($path, 0, 1) == '/' ? $path : $rootPath.'/'.$path;\n }", "function acfe_get_abs_path_to_url($path = ''){\n \n $abspath = untrailingslashit(ABSPATH);\n \n $url = str_replace($abspath, site_url(), $path);\n $url = wp_normalize_path($url);\n \n return esc_url_raw($url);\n \n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a PeriodLib object from a Year and a Week.
public static function createFromWeek($year, $week) { $startDate = new DateTimeImmutable( self::validateYear($year).'W'.sprintf('%02d', self::validateRange($week, 1, 53)) ); return new self($startDate, $startDate->add(new DateInterval('P1W'))); }
[ "public static function createFromWeek($year, $week)\n\t {\n\t $start = new DateTime();\n\t $start->setISODate(self::validateYear($year), self::validateRange($week, 1, 53));\n\t $start->setTime(0, 0, 0);\n\n\t return self::createFromDuration($start, '1 WEEK');\n\t }", "public static function createFromWeek($year, $week)\n {\n return static::createFromDuration(\n static::validateYear($year).'W'.sprintf('%02d', static::validateRange($week, 1, 53)),\n '1 WEEK'\n );\n }", "public static function createFromWeek($year, $week)\n {\n return self::createFromDuration(\n self::validateYear($year).'W'.sprintf('%02d', self::validateRange($week, 1, 53)),\n '1 WEEK'\n );\n }", "public function setWeekYear($week_year);", "static public function normalizeWeekYear(&$week, &$year)\n {\n $week = ($week === null) ? date('W') : $week;\n $year = ($year === null) ? date('Y') : $year;\n\n $date = new \\DateTime();\n $date->setISODate($year, $week);\n $week = $date->format('W');\n $year = $date->format('Y');\n\n }", "function getStartAndEndDate($week, $year) {\n $dto = new DateTime();\n $ret['week_start'] = $dto->setISODate($year, $week)->format('Y-m-d');\n $ret['week_end'] = $dto->modify('+6 days')->format('Y-m-d');\n return $ret;\n}", "function getStartAndEndDate($week, $year) {\n $time = new DateTime();\n $time->setISODate($year, $week);\n $ret['week_start'] = $time->format('d-m-Y');\n date_modify($time, \"+ 7 day\");\n $ret['week_end'] = $time->format('d-m-Y');\n return $ret;\n}", "public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null);", "public static function getPeriodByYear($year)\n {\n $derp = new Period();\n $db = $derp->getDb();\n\n $db->addWhere('year', $year);\n\n $result = $db->select();\n\n // if null results return null\n if(empty($result) || is_null($result)){\n return null;\n }\n\n // Create the Period object\n $period = new Period($result[0]['id']);\n\n return $period;\n }", "public function setDateFromWeek($year, $week) {\n\t\t$this->unixtime = strtotime(\"01 January $year + $week weeks\");\n\t\t$this->unixtime = $this->getMonday(true);\n\t}", "public function validateWeek($week = null, $year = null) {\n\t\tif ($week == null) {\n\t\t\treturn $this->currentWeek();\n\t\t}\n\t\tif (!is_numeric($week) || $week < 1 || $week > $this->lastWeekOfYear($year)) {\n\t\t\tthrow new InvalidArgumentException('Invalid Week of the Year');\n\t\t}\n\t\treturn $week;\n\t}", "function getStartEndDate( $week, $year ) {\n $dto = new DateTime();\n $dto->setISODate( $year, $week, 0 );\n $dates['start'] = $dto->format( \"Y-m-d\" );\n $dto->modify( \"+6 days\" ); // move forward one week\n $dates['end'] = $dto->format( \"Y-m-d\" );\n return $dates;\n}", "function get_week_date_range_sql_mode_0($week, $year)\n {\n $weeks = [];\n $date = \\Carbon\\Carbon::now();\n\n $adjuster = 0;\n $firstDateYear = \\Carbon\\Carbon::createFromDate($year, 1, 1);\n if ($firstDateYear->weekday() >= 5) {\n $adjuster = 1;\n }\n\n for ($i = 1; $i <= 53; $i++) {\n $date->setISODate($year, $i - $adjuster);\n if ($i == 1) {\n $weekStart = $year . '-01-01';\n } else {\n $weekStart = $date->startOfWeek(0)->toDateString();\n }\n if ($i <= 52) {\n $weekEnd = $date->endOfWeek(6)->toDateString();\n } else {\n $weekEnd = $year . '-12-31';\n }\n $weeks[$i] = [\n 'week_start' => $weekStart,\n 'week_end' => $weekEnd,\n ];\n }\n\n if (!is_null($week)) {\n return get_if_exist($weeks, $week);\n }\n\n return $weeks;\n }", "public static function createWeek(Week $week) {\n CommonDao::connectToDb();\n $query = \"insert into week(year, week_number, start_time)\n values (\" .\n $week->getYear() . \", \" .\n $week->getWeekNumber() . \", '\" .\n $week->getStartTime() . \"')\";\n $result = mysql_query($query);\n if (!$result) {\n echo \"Week \" . $week->toString() . \" already exists in DB. Try again.\";\n return null;\n }\n\n $idQuery = \"select week_id from week where year = \" . $week->getYear() .\n \" and week_number = \" . $week->getWeekNumber();\n $result = mysql_query($idQuery) or die('Invalid query: ' . mysql_error());\n $row = mysql_fetch_assoc($result);\n $week->setId($row[\"week_id\"]);\n return $week;\n }", "public static function startOfWeek($wk_num, $yr)\n\t{\n\t\t$time = strtotime($yr . '0104 +' . ($wk_num - 1) . ' weeks');\n\t\t$mon_ts = strtotime('-' . (date('N', $time) - 1) . ' days', $time);\n\t\treturn new self($mon_ts);\n\t}", "public function createWeek(\\DateTimeInterface $begin): Week;", "public function setWeek($var)\n {\n GPBUtil::checkString($var, True);\n $this->week = $var;\n\n return $this;\n }", "public static function createFromYear($year)\n\t {\n\t return self::createFromDuration(self::validateYear($year).'-01-01', '1 YEAR');\n\t }", "public static function createFromYear($year)\n {\n $startDate = new DateTimeImmutable(static::validateYear($year).'-01-01');\n\n return new static($startDate, $startDate->add(new DateInterval('P1Y')));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets an accepted result
public function set_result($result) { $this->acceptedresult = $result; }
[ "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\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()\n {\n }", "public function SetResult ($result = \\MvcCore\\Ext\\IForm::RESULT_SUCCESS);", "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 setMatcherResult($result)\n {\n $this->_matcherResult = $result;\n }", "public function setResult($result)\n {\n if ($result instanceof P4_Result) {\n $this->_result = $result;\n }\n }", "protected function setResult( ResourceResult $result ) {\n\t\t$this->result = $result;\n\t}", "public function setApplyResult($val)\n {\n $this->_propDict[\"applyResult\"] = $val;\n return $this;\n }", "public function setAccepted(bool $accepted): TransitionResult;", "function setEventResult($ok = true, $message = \"\") {\r\n $this->eventResult = $ok;\r\n $this->eventMessage = $message;\r\n }", "public function testSetWrongValueForResult()\n {\n $this->oResponse->setResult('abc123');\n\n $this->assertSame(1, $this->oResponse->getResult());\n }", "public function testSetResult()\n {\n $result = new IterationResult(10, 10);\n $this->iteration->setResult($result);\n $this->iteration->setResult($result);\n $this->assertSame($result, $this->iteration->getResult());\n }", "public function signalResult(\n $result\n ) {\n\n if( $result == false ) {\n if( $this->abort_on_fail == true ) {\n $this->abort_next = true;\n }\n $this->result = false;\n }\n\n }", "private function setTeamResult($team, $result)\n {\n switch ($result) {\n case 'win':\n $this->teams[$team]->wins++;\n break;\n case 'lose':\n $this->teams[$team]->loses++;\n break;\n case 'draw':\n $this->teams[$team]->draws++;\n break;\n }\n\n }", "public function setResultFailed() {\r\n $this->result['type'] = 'failed';\r\n }", "public function setResult($results)\n {\n $this->results = $results;\n }", "public function setAskResult(bool $askResult)\n {\n $this->askResult = $askResult;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the plural name if a value greater than 1 $myItemName = getPluralName($value, $ItemDetails>SingularName, $ItemDetails>PluralName)
function getPluralName($quantity, $singleName, $pluralName) { if ($quantity == 1) { $ItemName = $singleName; return $ItemName; } elseif ($quantity >1) { $ItemName = $pluralName; return $ItemName; } // END if/else }
[ "static function getPluralName();", "public function getPluralName();", "public function getPluralName()\n { \n return $this->m_name.$this->m_plural; \n }", "public function getPluralLabel();", "public function plural_name() {\n\t\tif (_t($this->class . '.PLURALNAME')) {\n\t\t\treturn _t($this->class . '.PLURALNAME');\n\t\t} else {\n\t\t\treturn parent::plural_name();\n\t\t} \n\t}", "public function getPluralNameAttribute()\n\t{\n\t\treturn Str::plural($this->getAttribute('name'));\n\t}", "public function getPluralName()\n\t{\n\t\treturn GetLang(get_class($this) . '_Name_Plural');\n\t}", "function str_plural($value)\n {\n return $value.'s';\n }", "public function getPluralName()\n\t{\n\t\tif (!isset($this->description['plural']))\n\t\t{\n\t\t\tif ($this->isArray())\n\t\t\t{\n\t\t\t\treturn $fieldName;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fieldNameLen = strlen();\n\t\t\t\tif ($fieldNameLen - 1 == strrchr('s'))\n\t\t\t\t{\n\t\t\t\t\treturn $fieldName . 'es';\n\t\t\t\t}\n\t\t\t\telseif ($fieldNameLen - 1 == strrchr('y'))\n\t\t\t\t{\n\t\t\t\t\treturn substr(0, $fieldNameLen-1) . 'ies';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $fieldName . 's';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->description['plural'];\n\t}", "public static function getPluralName()\n {\n return trans_class(__CLASS__, 'name.plural');\n }", "public function getPluralLabel()\n {\n return array_key_exists(EntityDefinitionConfig::PLURAL_LABEL, $this->items)\n ? $this->items[EntityDefinitionConfig::PLURAL_LABEL]\n : null;\n }", "function _pluralName($name) {\n\t\treturn Inflector::variable(Inflector::pluralize($name));\n\t}", "public function getPluralName(): string\n {\n if (isset($this->pluralName)) {\n return $this->pluralName;\n }\n\n if (isset($this->payloadKey)) {\n return Str::plural($this->payloadKey);\n }\n\n return Str::plural($this->getTable());\n }", "public static function modelTitlePlural()\n {\n return \\Yii::t('admin/t', 'Auth Items');\n }", "function Plural($value, $singular, $plural=\"\")\n{\n $plural = ($plural==\"\") ? $singular . 's' : $plural;\n return ($value==1) ? \"$value $singular\" : \"$value $plural\";\n}", "static function getPluralName():string {\r\n\t\t\t$class = strtolower(get_called_class());\r\n\t\t\treturn $class. \"s\"; // this may need improvement if new type names are introduced in the future\r\n\t\t}", "function xxx_pluralize($quantity, $singular, $plural) {\r\n return sprintf($quantity == 1 ? $singular : $plural, $quantity);\r\n}", "public static function modelTitlePlural()\n {\n return 'Товарные позиции';\n }", "private function _setPluralName()\n {\n $this->_addCompileData('plural_name', str_plural($this->getName()));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getGridUpdatedTime Find the transaction time when grid was generated. This is different than the time when grid was actually generated. The txn timestamp refers to the time when fresh value was available for any of the stations for a given epoch. This generally happens when station data was not gathered at exact time (probably because it was in maintenance mode).
public function getGridUpdatedTime($timestamp) { //$sql = "select txnat from interpolation_step01_txn $sql = "select updatedat from interpolation_step01_txn where epoch=$timestamp"; $result = mysql_query($sql, $this->link); if ($result === false) { $this->setLastError('Query Mgr: getGridUpdatedTime Query Failed ' . mysql_error()); return false; } $line = mysql_fetch_array($result); mysql_free_result($result); return intval($line[0]); }
[ "public function getProcessorTransactionTime();", "public function getUpdateTime()\n\t{\n\t\t$column = self::COL_UPDATE_TIME;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function getUpdatedTs()\n\t{\n\t\treturn $this->updated_ts;\n\t}", "public static function getLastChangeTime()\n {\n $ins = self::getInstance();\n return date(\"Y-m-d H:i:s\",$ins->updateTs);\n }", "function getTime() \n {\n $this->calibrate();\n return $this->_time['gmtime'];\n }", "public function getTransactionTime()\n {\n return $this->transactionTime;\n }", "public function getUpdateTs()\n {\n return $this->update_ts;\n }", "public function getLastUpdated() {\n return $this->getConfigData('LST_UPD');\n }", "public function getLastOrdersSyncTime()\r\n {\r\n $time = $this->getLastOrdersSync();\r\n if(!$time){\r\n return '';\r\n }\r\n return date('F d, Y / h:i', $time);\r\n }", "public function getUpdateTime()\n\t{\n return $this->getData(self::UPDATE);\n }", "public function getLastSyncTime()\n {\n return $this->lastSyncTime;\n }", "function getLoggedTime() {\n\t\t$tt = $this->_taskQuery->join('synd_issue_task','t');\n\t\t$query = clone $this->_taskQuery;\n\n\t\t$query->column($this->_grouping->getReceivedTaskKey($this, $query), 'PK');\n\t\t$query->column(\"COUNT(DISTINCT $tt.parent_node_id)\", 'ISSUES');\n\t\t$query->column(\"SUM($tt.info_duration)*60\", 'TIME_LOGGED');\n\t\t$query->groupBy($this->_grouping->getReceivedTaskKey($this, $query));\n\t\t\n\t\t$sql = $query->toString();\n\t\t$rows = $this->_db->getAll($sql);\n\t\t\n\t\t$result = array();\n\t\tforeach ($rows as $row)\n\t\t\t$result[$row['PK']] = $row;\n\t\t\t\n\t\treturn $this->_grouping->filter($result);\n\t}", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getLastRefreshTimestamp()\n {\n return $this->lastUpdate;\n }", "public function getQueryTime()\n {\n return $this->source->query_time;\n }", "public function getGevalAddtimeAgain()\n {\n return $this->geval_addtime_again;\n }", "public function getNextSyncTime()\n {\n return $this->lastSync + $this->refreshRate;\n }", "public function getLastUpdateTimesamp()\n\t{\n\t\treturn $this->lastUpdate;\n\t}", "public function getRefreshStaminaTime()\n {\n $value = $this->get(self::REFRESH_STAMINA_TIME);\n return $value === null ? (integer)$value : $value;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all hdd entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $hdds = $em->getRepository('ManagerITBundle:Hdd')->findAll(); return $this->render('hdd/index.html.twig', array( 'hdds' => $hdds, )); }
[ "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $disks = $em->getRepository('WardLeonardDiscoBundle:Disk')->findAll();\n\n return $this->render('WardLeonardDiscoBundle:disk:index.html.twig', array(\n 'disks' => $disks,\n ));\n }", "public function entityList() {\n $route = \"eck.entity.{$this->entityTypeMachineName}.list\";\n $routeArguments = [];\n $expectedUrl = \"admin/content/{$this->entityTypeMachineName}\";\n $expectedTitle = ucfirst(\"{$this->entityTypeLabel} content\");\n $crumbs = ['Content'];\n\n $this->assertCorrectPageOnRoute($route, $routeArguments, $expectedUrl, $expectedTitle, $crumbs);\n }", "public function showAllAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n return $this->render('admin/index.html.twig', array(\n 'characters' => $em->getRepository('LotrBundle:Characters')->findAll(),\n 'places' => $em->getRepository('LotrBundle:Places')->findAll(),\n 'events' => $em->getRepository('LotrBundle:Events')->findAll(),\n 'races' => $em->getRepository('LotrBundle:Races')->findAll(),\n 'status' => $em->getRepository('LotrBundle:Status')->findAll(),\n 'pageActive' => 'dashboard',\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminProdDphBundle:Dph')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n //$entities = $em->getRepository('RegistryBundle:System')->findAll();\n $entities = $em->getRepository('RegistryBundle:System')->findAllOrderedBySystemKey();\n //$entities = $em->getRepository('RegistryBundle:System')->findAllWhere('type', '<>', 'bln');\n \n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex()\n {\n $searchModel = new DiskModelSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $data = [];\n $emptyImages= DiskModel::find()->where('image IS Null')->count();\n $emptyDescs= DiskModel::find()->where('long_desc IS Null')->count();\n $emptyMeta= DiskModel::find()->where('(pageTitle IS Null) OR (meta_k IS Null) OR (meta_d IS Null) ')->count();\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n \n 'emptyImages'=>$emptyImages,\n 'emptyDescs'=>$emptyDescs,\n 'emptyMeta'=>$emptyMeta\n ]);\n }", "function catalyst_eck__entity_type_list() {\n $path = eck__entity_type__path();\n $header = array(t('Name'), array('data' => t('Operations'), 'colspan' => '1'));\n $rows = array();\n\n $entity_types = EntityType::loadAll();\n // The only change by catalyst\n unset($entity_types['catalyst']);\n usort($entity_types, 'eck_alphabetical_cmp');\n\n foreach ($entity_types as $entity_type) {\n $allowed_operations = '';\n // Check that the user has permissions to delete:\n if (eck__multiple_access_check(array('eck administer entity types', 'eck delete entity types'))) {\n $allowed_operations = l(t(\"delete\"), \"{$path}/{$entity_type->name}/delete\");\n }\n\n if (eck__multiple_access_check(array(\n 'eck administer bundles',\n 'eck list bundles',\n \"eck administer {$entity_type->name} bundles\",\n \"eck list {$entity_type->name} bundles\",\n ))) {\n $label = l(t(\"@el\", array(\"@el\" => $entity_type->label)), \"{$path}/{$entity_type->name}\");\n }\n else {\n $label = t(\"@el\", array(\"@el\" => $entity_type->label));\n }\n\n $rows[] = array($label, $allowed_operations);\n }\n\n $build['entity_table'] = array(\n '#theme' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n );\n\n return $build;\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MaithPumpMyGasBundle:FuelData')->findAll();\n\n return $this->render('MaithPumpMyGasBundle:FuelData:index.html.twig', array(\n 'entities' => $entities,\n 'smallnavigation' => true,\n ));\n }", "public function getEntityList();", "public function hardDisks();", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $ios = $em->getRepository('ZtrintFinanceAdminBundle:Io')->findBy([], ['at' => 'DESC']);\n\n return $this->render('ZtrintFinanceAdminBundle:Io:index.html.twig', array(\n 'ios' => $ios,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $vehicles = $em->getRepository('WorkshopBundle:Vehicle')->findAll();\n\n return $this->render('WorkshopBundle:Admin:panelVehicles_showAll.html.twig', array(\n 'vehicles' => $vehicles,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('HypoTestBundle:File')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('InnovaLearningPathBundle:Path')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $deviceNames = $em->getRepository('MicroBundle:Device')->findAll();\n\n return $this->render('device/index.html.twig', array('deviceNames' => $deviceNames,));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('AppBundle:Especie')->findByEstado(1);\n\n return array(\n 'entities' => $entities\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('bonavallBancdeltempsBundle:EstatServei')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "private function all()\n\t{\n\t\t//Get all the Vehicles\n\t\t$result = $this->model->all();\n\t\t$this->loadProperties();\n\t\tforeach($result as &$vehicle)\n\t\t{\n \t\t\t$modelName = $this->models->details($vehicle['idModel']);\n \t\t\t$vehicle['idModel'] = $modelName->name;\n \t\t\t$colorName = $this->colors->details($vehicle['idColor']);\n \t\t\t$vehicle['idColor'] = $colorName->name;\n \t\t\t$carTypeName = $this->carTypes->details($vehicle['idCarType']);\n \t\t\t$vehicle['idCarType'] = $carTypeName->name;\n\t\t}\n\n\t\t$this->smarty->assign('vehicles',$result);\n\t\tif(isset($result))\n\t\t{\n\t\t\t//Load view\n\t\t\tif(isset($_GET['deleted']) && $_GET['deleted']==true) \t\t\t\n\t\t\t\t$this->smarty->assign('deleted',true);\n\t\t\t$this->smarty->display('./views/Vehicle/index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Ohh well... :(\n\t\t\t$this->smarty->display('./views/error.tpl');\n\t\t}\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DigitalthoreauFileBundle:File')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows a specific revision of an entity to be returned by entity id and a revision number
public function GETEntityRevisionsByRevisionID( $entity_id, $revision_id) { $params = array(); $params['entity_id'] = $entity_id; $params['revision_id'] = $revision_id; return CentralIndex::doCurl("GET","/entity/revisions/byRevisionID",$params); }
[ "public function get_revision($revision_id);", "public function getRevision();", "public function getRevisionId();", "public function getLatestRevision($entity_type_id, $entity_id);", "public function getRevision() ;", "public function actionGetModuleByRevision() {\n $idRevision = Yii::app()->request->getPost('idRevision');\n $moduleRev= RevisionModule::model()->findByPk($idRevision);\n echo $moduleRev->id_module;\n }", "public function revisionAction()\n {\n $revisionId = (int)$this->getEvent()->getRouteMatch()->getParam('revisionId');\n\n $revision = \\SoliantEntityAudit\\Module::getModuleOptions()->getEntityManager()\n ->getRepository('SoliantEntityAudit\\\\Entity\\\\Revision')\n ->find($revisionId);\n\n if (!$revision)\n return $this->plugin('redirect')->toRoute('audit');\n\n return array(\n 'revision' => $revision,\n );\n }", "protected function getGitRevision() {}", "private function getRevision_id() {\n return $this->revision_id;\n }", "public function getLatestPublishedRevision($config_entity_id);", "public function getRevisionId()\n {\n return $this->revision_id;\n }", "public function getRevisionId(): int|string {\n return $this->nodeKey->getRevisionId();\n }", "function revisioning_get_current_node_revision_id($nid) {\n $result = db_query(\"SELECT vid FROM {node} WHERE nid = :nid\", array(':nid' => $nid));\n return $result->fetchField();\n}", "function conduit_views_revision($view) {\n $view = $view->clone_view();\n\n // Change base information.\n $view->name .= '_revision';\n $view->base_table = conduit_views_revision_table($view->base_table);\n $view->human_name .= ' (revision)';\n\n $display = $view->display['default'];\n\n // Change fields and a arguments table.\n foreach ($display->display_options['fields'] as &$field) {\n $field['table'] = conduit_views_revision_table($field['table']);\n }\n foreach ($display->display_options['arguments'] as &$argument) {\n $argument['table'] = conduit_views_revision_table($argument['table']);\n }\n\n // Convert entity_id_raw argument to entity_id.\n $display->display_options['arguments']['entity_id'] = $display->display_options['arguments']['entity_id_raw'];\n $entity_id = &$display->display_options['arguments']['entity_id'];\n $entity_id['id'] = $entity_id['field'] = 'entity_id';\n\n // Add revision ID argument.\n $display->display_options['arguments']['revision_id_raw'] = $display->display_options['arguments']['entity_id_raw'];\n $revision_id = &$display->display_options['arguments']['revision_id_raw'];\n $revision_id['id'] = $revision_id['field'] = 'revision_id_raw';\n $revision_id['validate']['type'] = 'numeric';\n unset($revision_id['validate_options']);\n\n unset($display->display_options['arguments']['entity_id_raw']);\n\n // Convert the page display path.\n $display = $view->display['page'];\n $display->display_options['path'] = str_replace('node/%', 'node/%/revisions/%', $display->display_options['path']);\n\n return $view;\n}", "function wp_get_post_revision(&$post, $output = \\OBJECT, $filter = 'raw')\n {\n }", "public function getRevisionId()\n {\n return $this->revisionId;\n }", "public function getRevisionEntities($entity)\r\n {\r\n $entityManager = \\SoliantEntityAudit\\Module::getModuleOptions()->getEntityManager();\r\n\r\n if (gettype($entity) != 'string' and in_array(get_class($entity), array_keys(\\SoliantEntityAudit\\Module::getModuleOptions()->getAuditedClassNames()))) {\r\n $auditEntityClass = 'SoliantEntityAudit\\\\Entity\\\\' . str_replace('\\\\', '_', get_class($entity));\r\n $identifiers = $this->getEntityIdentifierValues($entity);\r\n } elseif ($entity instanceof AbstractAudit) {\r\n $auditEntityClass = get_class($entity);\r\n $identifiers = $this->getEntityIdentifierValues($entity, true);\r\n } else {\r\n $auditEntityClass = 'SoliantEntityAudit\\\\Entity\\\\' . str_replace('\\\\', '_', $entity);\r\n }\r\n\r\n $search = array('auditEntityClass' => $auditEntityClass);\r\n if (isset($identifiers)) $search['entityKeys'] = serialize($identifiers);\r\n\r\n return $entityManager->getRepository('SoliantEntityAudit\\\\Entity\\\\RevisionEntity')\r\n ->findBy($search, array('id' => 'DESC'));\r\n }", "function getFileIdAndRevision() {\n\t\t$id = $this->getFileId();\n\t\t$revision = $this->getRevision();\n\t\t$idAndRevision = $id;\n\t\tif ($revision) {\n\t\t\t$idAndRevision .= '-'.$revision;\n\t\t}\n\t\treturn $idAndRevision;\n\t}", "public function getRevisionid()\n {\n return $this->revisionid;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the plugin provider which is responsible for the plugin item.
public function getProvider( \Aimeos\MShop\Plugin\Item\Iface $item, $type ) { $type = ucwords( $type ); $names = explode( ',', $item->getProvider() ); if( ctype_alnum( $type ) === false ) { throw new \Aimeos\MShop\Plugin\Exception( sprintf( 'Invalid characters in type name "%1$s"', $type ) ); } if( ( $provider = array_shift( $names ) ) === null ) { throw new \Aimeos\MShop\Plugin\Exception( sprintf( 'Provider in "%1$s" not available', $item->getProvider() ) ); } if( ctype_alnum( $provider ) === false ) { throw new \Aimeos\MShop\Plugin\Exception( sprintf( 'Invalid characters in provider name "%1$s"', $provider ) ); } $classname = '\\Aimeos\\MShop\\Plugin\\Provider\\' . $type . '\\' . $provider; if( class_exists( $classname ) === false ) { throw new \Aimeos\MShop\Plugin\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); } $context = $this->getContext(); $config = $context->getConfig(); $provider = new $classname( $context, $item ); self::checkClass( '\\Aimeos\\MShop\\Plugin\\Provider\\Factory\\Iface', $provider ); /** mshop/plugin/provider/order/decorators * Adds a list of decorators to all order plugin provider objects automatcally * * Decorators extend the functionality of a class by adding new aspects * (e.g. log what is currently done), executing the methods of the underlying * class only in certain conditions (e.g. only for logged in users) or * modify what is returned to the caller. * * This option allows you to wrap decorators * ("\Aimeos\MShop\Plugin\Provider\Decorator\*") around the order provider. * * mshop/plugin/provider/order/decorators = array( 'decorator1' ) * * This would add the decorator named "decorator1" defined by * "\Aimeos\MShop\Plugin\Provider\Decorator\Decorator1" to all order provider * objects. * * @param array List of decorator names * @since 2014.03 * @category Developer * @see mshop/plugin/provider/order/decorators */ $decorators = $config->get( 'mshop/plugin/provider/' . $item->getType() . '/decorators', [] ); $provider = $this->addPluginDecorators( $item, $provider, $names ); $provider = $this->addPluginDecorators( $item, $provider, $decorators ); return $provider->setObject( $provider ); }
[ "public static function getCurrentAuthProviderPlugin()\n {\n $session = self::getSession();\n\n $authPlugins = PluginManager::getManager()->dispatchEvent(\n GetAuthenticationPlugins::EVENT_NAME,\n new GetAuthenticationPlugins()\n );\n\n $auth_provider = $session->get('user.auth_plugin_provider_name');\n\n foreach ($authPlugins->getPlugins() as $plugin) {\n if ($plugin->getProviderMachineName() == $auth_provider) {\n return $plugin;\n }\n }\n }", "protected function getProvider()\n\t{\n\t\treturn $this->provider;\n\t}", "public function getProvider()\n\t{\n\t\tif( isset( $this->values['plugin.provider'] ) ) {\n\t\t\treturn (string) $this->values['plugin.provider'];\n\t\t}\n\n\t\treturn '';\n\t}", "public function getPlugin()\n {\n return $this->plugin;\n }", "public function getProvider()\n {\n if (array_key_exists(\"provider\", $this->_propDict)) {\n return $this->_propDict[\"provider\"];\n } else {\n return null;\n }\n }", "public function get_plugin() {\n\t\t\treturn $this->plugin;\n\t\t}", "protected function get_plugin() {\n\n\t\treturn $this->plugin;\n\t}", "public function get_plugin() {\n\n\t\treturn $this->get_gateway()->get_plugin();\n\t}", "public function getCurrentProvider()\n {\n return $this->provider;\n }", "public function plugin(): Plugin\n {\n return $this->plugin;\n }", "protected function getProvider() {\n if (!isset($this->provider)) {\n $this->provider = $this->theme->getCdnProvider();\n }\n return $this->provider;\n }", "public function getPlugin()\n {\n $rtn = $this->data['plugin'];\n\n return $rtn;\n }", "public function getProviderInstance()\n {\n if (!class_exists($this->getProviderClassName())) {\n \\Sys25\\RnBase\\Utility\\Logger::warn(\n sprintf(\n 'Providerclass \"%3$s\" for Provider \"%2$s (%1$s)\" could not be loaded',\n $this->getUid(),\n $this->getName(),\n $this->getProviderClassName()\n ),\n 't3rest'\n );\n\n return null;\n }\n\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance($this->getProviderClassName());\n if ($instance instanceof Tx_T3rest_Model_ProviderHolder) {\n $instance->setProvider($this);\n }\n\n return $instance;\n }", "public function getOauthProvider()\n\t{\n Craft::app()->social->checkPluginRequirements();\n\n\t\treturn Craft::app()->oauth->getProvider($this->getHandle(), false);\n\t}", "public function getPlugin();", "protected function getPlugin () {\r\n\t\treturn $this->mb->get('Pkj\\Minibase\\Plugin\\AuthPlugin\\AuthPlugin');\r\n\t}", "public function getPlugin()\r\n {\r\n if( null === $this->_plugin ) {\r\n $class = $this->plugin;\r\n Engine_Loader::loadClass($class);\r\n $plugin = new $class($this);\r\n if( !($plugin instanceof Experts_Payment_Plugin_Abstract) ) {\r\n throw new Engine_Exception(sprintf('Payment plugin \"%1$s\" must ' .\r\n 'implement Experts_Payment_Plugin_Abstract', $class));\r\n }\r\n $this->_plugin = $plugin;\r\n }\r\n return $this->_plugin;\r\n }", "public function getAppProvider()\n {\n return $this->getProvider(app\\Provider::class);\n }", "function &getPaymentPlugin() {\n\t\t$paymentMethodPluginName = $this->press->getSetting('paymentPluginName');\n\t\t$paymentMethodPlugin = null;\n\t\tif (!empty($paymentMethodPluginName)) {\n\t\t\t$plugins =& PluginRegistry::loadCategory('paymethod');\n\t\t\tif (isset($plugins[$paymentMethodPluginName])) $paymentMethodPlugin =& $plugins[$paymentMethodPluginName];\n\t\t}\n\t\treturn $paymentMethodPlugin;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of fileSize
public function setFileSize($fileSize) { $this->fileSize = $fileSize; }
[ "private function setFileSize()\n {\n\n }", "function setFileSize($fileSize)\n\n\t{\n\n\t\t$this->userFileSize = $fileSize;\n\n\t}", "public function setFileSize($size)\n {\n $this->size = $size;\n }", "private function updateFileSize() {\n if (isset($this->document->size) && $this->document->isClean('path')) {\n return;\n }\n\n // calculate and set file size\n if (Storage::disk('documents')->exists($this->document->path)) {\n $this->document->size = Storage::disk('documents')->size($this->document->path);\n }\n }", "public function setFileSize($file_size)\n\t{\n\t\tif(is_numeric($file_size))\n\t\t{\n\t\t\t$this->file_size=$file_size;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('A valid file size was not set.', E_RECOVERABLE_ERROR);\n\t\t}\n\t}", "protected function updateSize()\n {\n $fstat = fstat($this->resource);\n\n if (false === $fstat) {\n $this->size = null;\n } else {\n $this->size = ! empty($fstat['size']) ? $fstat['size'] : null;\n }\n }", "public function setsize($size) {\n\t\t$this->size = $size;\n\t}", "public function refreshSize() {\n $this->size = filesize($this->_path);\n }", "public function __set($size) { \n $this->size=$size;\n }", "function max_filesize($size){\n\t\t$this->max_filesize = (int) $size;\n\t}", "public function setMediaSize(?string $value): void {\n $this->getBackingStore()->set('mediaSize', $value);\n }", "protected function setLastFetchedSize($file, $file_size)\n {\n $this->state[$file] = (int)$file_size;\n }", "public function setContentLength($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTLENGTH] \n = $value;\n }", "public function setSizeInByte(?int $value): void {\n $this->getBackingStore()->set('sizeInByte', $value);\n }", "public function setSizeInBytes(?int $value): void {\n $this->getBackingStore()->set('sizeInBytes', $value);\n }", "public function getFileSize()\n {\n return $this->fileSize;\n }", "public function getFileSize() {\n\t\treturn $this->fileSize;\n\t}", "public function SetMaxFileSize($size)\r\n\t\t{\r\n\t\t\t$this->MaxFileSize = $size;\r\n\t\t}", "public function setFileSize2($fileSize2) {\n\t\t$this->fileSize2 = $fileSize2;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Count payment status list based on orders
public function getPaymentStatusCount() { $orders = Order::select( DB::raw('COUNT(str_order.order_status) as status_count, order_status') ) ->groupBy('order_status') ->get()->toArray(); return $orders; }
[ "public function get_order_count($status)\n {\n }", "function getOrderCount($status) {\n\t\t$sql = 'select \n\t\t\t\t\tdistinct concat(' . TABLE_ORDERS_PRODUCTS . '.orders_id, \"-\", ' . TABLE_ORDERS_PRODUCTS . '.products_id) as idx \n\t\t\t\tfrom \n\t\t\t\t\t' . TABLE_ORDERS . '\n\t\t\t\t\tjoin ' . TABLE_ORDERS_PRODUCTS . ' on ' . TABLE_ORDERS_PRODUCTS . '.orders_id=' . TABLE_ORDERS . '.orders_id \n\t\t\t\t\tleft join DobaLog on DobaLog.local_id=' . TABLE_ORDERS . '.orders_id and DobaLog.datatype=\"order\"';\n\t\tif ($status == 'new') {\n\t\t\t$sql .= ' where DobaLog.doba_log_id is NULL';\n\t\t} else if ($status == 'submitted') {\n\t\t\t$sql .= ' where DobaLog.api_response is not NULL';\n\t\t} else if ($status == 'unsubmitted') {\n\t\t\t$sql .= ' where DobaLog.api_response is NULL';\n\t\t}\n\t\t\t\t\t\t\n\t\t$cnt_query = tep_db_query($sql);\n \t\t$cnt = tep_db_num_rows($cnt_query);\n\t\t\t\n\t\treturn $cnt;\n\t}", "public static function totalByStatusOrder($orders)\n {\n $summary = [\n 'open' => ['qty' => 0, 'total' => 0],\n 'pending' => ['qty' => 0, 'total' => 0],\n 'sent' => ['qty' => 0, 'total' => 0],\n 'closed' => ['qty' => 0, 'total' => 0],\n 'cancelled' => ['qty' => 0, 'total' => 0],\n ];\n\n $orders->each(function ($order, $key) use (&$summary) {\n $total = self::totalOrder($order->details);\n\n switch ($order->status) {\n case 'open':\n $summary['open']['qty']++;\n $summary['open']['total'] += $total['total'];\n break;\n\n case 'pending':\n $summary['pending']['qty']++;\n $summary['pending']['total'] += $total['total'];\n break;\n\n case 'sent':\n $summary['sent']['qty']++;\n $summary['sent']['total'] += $total['total'];\n break;\n\n case 'closed':\n $summary['closed']['qty']++;\n $summary['closed']['total'] += $total['total'];\n break;\n\n case 'cancelled':\n $summary['cancelled']['qty']++;\n $summary['cancelled']['total'] += $total['total'];\n break;\n }\n });\n\n return $summary;\n }", "function ordersCount(){\n\t\t\t\n\t\t$sql= 'SELECT COUNT( * ) AS numrows\n\t\tFROM orders\n\t\tWHERE status = \"Pending\"\n\t\t';\t\n\t\t$Q = $this-> db-> query($sql);\n\t\treturn $Q->row ()->numrows;\n\t\t\t\n\t\t}", "public function totalOrdersByStatus()\n {\n $ano = date('Y');\n $mes = date('m');\n $dia = date('d');\n $inicioMes = \"{$ano}-{$mes}-01 00:00:00\";\n\n $pedidos = Pedido\n ::selectRaw('status, marketplace, COUNT(*) as count')\n ->whereNotNull('status')\n ->where('status', '!=', 5)\n ->where('created_at', '>=', $inicioMes)\n ->groupBy('status')\n ->groupBy('marketplace')\n ->orderBy('status', 'ASC')\n ->orderBy('marketplace', 'ASC')\n ->get();\n\n /**\n * Organiza os marketplaces\n */\n $marketplaces = [];\n foreach ($pedidos as $pedido) {\n if (!in_array(strtoupper($pedido->marketplace), $marketplaces)) {\n $marketplaces[] = strtoupper($pedido->marketplace);\n }\n }\n\n /**\n * Status possíveis\n */\n $status = \\Config::get('core.pedido_status');\n\n /**\n * Prepara a lista para quando não existir preenche corretamente com 0\n */\n $list = [];\n foreach ($status as $state) {\n foreach ($marketplaces as $marketplace) {\n $list[strtolower($state)][] = 0;\n }\n }\n\n /**\n * Organiza os dados pra mostrar no gráfico\n */\n foreach ($pedidos as $pedido) {\n $list[strtolower($status[$pedido->status])][array_search(strtoupper($pedido->marketplace), $marketplaces)] = $pedido->count;\n }\n\n /**\n * Altera o nome do marketplace\n */\n if ($index = array_search('MERCADOLIVRE', $marketplaces)) {\n $marketplaces[$index] = 'M.LIVRE';\n }\n\n $list['marketplaces'] = $marketplaces;\n\n return $this->listResponse($list);\n }", "public function getOrderStatusCounts()\n {\n $orders = $this->order;\n\n $all = $orders->count();\n $on_hold = $orders->orderType([config(\"config.order_status.on_hold\")])->count();\n $cancelled = $orders->orderType([config(\"config.order_status.cancelled\")])->count();\n $completed = $orders->orderType([config(\"config.order_status.completed\")])->count();\n\n return array(\n 'all' => $all,\n 'on_hold' => $on_hold,\n 'cancelled' => $cancelled,\n 'completed' => $completed\n );\n }", "public function getPaymentStatuses();", "public function getOrderCount();", "public function getPurchaseOrderCount();", "public static function check_commission_status( $order, $status ) { \n\n\t\tglobal $wpdb; \n\n\t\t$table_name \t= $wpdb->prefix . \"pv_commission\";\n\n\t\t$order_id \t\t= $order[ 'order_id' ]; \n\t\t$vendor_id \t\t= $order[ 'vendor_id' ]; \n \t$product_id\t\t= $order[ 'product_id' ]; \n\n\t\t$query = \"SELECT count(order_id) AS order_count \n\t\t\t\t \tFROM {$table_name}\n\t\t\t\t \tWHERE order_id = {$order_id} \n\t\t\t\t \tAND vendor_id = {$vendor_id} \n\t\t\t\t \tAND product_id = {$product_id}\n\t\t\t\t \tAND status = %s\n\t\t\"; \n\n\t\treturn $wpdb->get_var( $wpdb->prepare( $query , $status ) ); \n\n\t}", "public function getPaymentStatusAction()\n {\n // Load shop repository\n $repository = Shopware()->Models()->getRepository(\\Shopware\\Models\\Order\\Order::class);\n\n $query = $repository->getPaymentStatusQuery(\n $this->Request()->getParam('filter'),\n $this->Request()->getParam('sort'),\n $this->Request()->getParam('start'),\n $this->Request()->getParam('limit')\n );\n\n // Get total result of the query\n $total = Shopware()->Models()->getQueryCount($query);\n\n // Select all shop as array\n $data = $query->getArrayResult();\n\n /** @var \\Shopware\\Components\\StateTranslatorServiceInterface $stateTranslator */\n $stateTranslator = $this->get('shopware.components.state_translator');\n $data = array_map(function ($paymentStateItem) use ($stateTranslator) {\n $paymentStateItem = $stateTranslator->translateState(StateTranslatorService::STATE_PAYMENT, $paymentStateItem);\n\n return $paymentStateItem;\n }, $data);\n\n // Return the data and total count\n $this->View()->assign(['success' => true, 'data' => $data, 'total' => $total]);\n }", "public function get_order_count()\n {\n }", "public function display_order_to_approve_count(){\n if(env(\"DB_CONNECTION\") == \"pgsql\"){\n $getOrderToApproveCount = DB::select(\"SELECT COUNT(*) as data FROM orders WHERE is_approved = '0'\");\n }else{\n $getOrderToApproveCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = 0');\n }\n \n return response()->json([\n 'count' => $getOrderToApproveCount[0],\n 'status' => 200\n ]);\n }", "public static function pendingOrder()\n {\n $order = Sale::whereIn('status', [1,2])->get();;\n $total = $order->count();\n return $total;\n }", "protected function testGetPaymentStatuses() {\n $statuses = array($this->statusManager->createInstance('payment_pending'), $this->statusManager->createInstance('payment_failed'));\n $this->assertEqual(spl_object_hash($this->payment->setPaymentStatuses($statuses)), spl_object_hash($this->payment));\n $retrieved_statuses = $this->payment->getPaymentStatuses();\n $this->assertEqual(spl_object_hash(reset($retrieved_statuses)), spl_object_hash(reset($statuses)));\n $this->assertEqual(spl_object_hash(end($retrieved_statuses)), spl_object_hash(end($statuses)));\n // Make sure we always get the last status.\n $this->assertEqual(spl_object_hash($this->payment->getPaymentStatus()), spl_object_hash(end($statuses)));\n }", "public function countAuditorAction()\n {\n $user_id = $this->log_user_data->user_id;\n $status = array(0,3);\n $this->db->select('po.id')\n ->from('purchase_order po')\n ->where('po.approve_by', $user_id)\n ->where_in('po.status', $status);\n return $this->db->get();\n }", "public function amount_of_orders($conn){\n \n $amount_query = \"SELECT * FROM `order`;\";\n $amount_order=$conn->prepare($amount_query);\n $amount_order->execute();\n \n if($amount_order->rowCount() > 0){\n while($order = $amount_order->fetch(PDO::FETCH_ASSOC)){\n $this->amount_id[] =$order['hist_id'];\n $this->details[] =$order['order_details'];\n }//End of while loop\n }//End of if rowCount() >0\n }", "public function countSuccessOrderForVendor($vendor_id)\n {\n return OrderDetail::where('vendor_id', $vendor_id)\n ->whereHas('order', function ($query) {\n $query->where('order_status', 2);\n })\n ->distinct('order_id')\n ->count('order_id');\n\n /*$orders = OrderDetail::leftjoin('order', 'order.order_id', '=', 'order_detail.order_id')\n ->where('vendor_id', $vendor_id)\n ->where('order_status', 2)\n ->distinct('order.order_id')\n ->count('order.order_id');\n return $orders;*/\n }", "public function getPaymentStatusCountForVendor($vendor_id)\n {\n return Order::whereHas('orderline', function ($query) use ($vendor_id) {\n $query->where('vendor_id', $vendor_id);\n })\n ->select('order_status', DB::raw('count(order_status) as status_count'))\n ->groupBy('order_status')\n ->get()->toArray();\n\n // $orders = Order::join('order_detail', 'order_detail.order_id', '=', 'order.order_id')\n // ->select( DB::raw('COUNT(str_order.order_status) as status_count, order_status') )\n // ->where('order_detail.vendor_id', $vendor_id)\n // ->groupBy('order_status')\n // ->get()->toArray();\n\n // return $orders;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts rights to bitmask.
public function toBitmask(array $rights) { $bitmask = []; foreach ($this->levels as $level) $bitmask[$level] = '0'; foreach ($rights as $level => $value) { $this->assertLevelExists($level); if ($value) $bitmask[$level] = '1'; } $bitmask = implode('', $bitmask); $bitmask = bindec($bitmask); return $bitmask; }
[ "public function getRights()\n {\n $result = (int)$this->read\n | (int)$this->write << 1\n | (int)$this->manage << 2\n | (int)$this->delete << 3\n | (int)$this->create << 4\n | (int)$this->get << 5\n | (int)$this->update << 6\n | (int)$this->join << 7;\n return $result;\n }", "protected function convertAclToMask()\n {\n $result = 0;\n if (strpos($this->_acl, 'l') !== false) {\n $result |= Horde_Perms::SHOW;\n }\n if (strpos($this->_acl, 'r') !== false) {\n $result |= Horde_Perms::READ;\n }\n if (strpos($this->_acl, 'i') !== false) {\n $result |= Horde_Perms::EDIT;\n }\n if (strpos($this->_acl, 'd') !== false ||\n strpos($this->_acl, 't') !== false) {\n $result |= Horde_Perms::DELETE;\n }\n return $result;\n }", "public function getAllPermissionsBits();", "private function updateRights()\n {\n if ($this->isAnonymous()) {\n $this->rights = array();\n return;\n }\n\n $query = <<< EOD\nSELECT right_name AS name, user__right_value AS value\n\tFROM user__right\n\t\tINNER JOIN right_ ON right_.right_id = user__right.right_id\n\tWHERE user_id = ?\nUNION\nSELECT right_name AS name, group__right_value AS value\n\tFROM user__group\n\t\tINNER JOIN group__right ON group__right.group_id = user__group.group_id\n\t\tINNER JOIN right_ ON right_.right_id = group__right.right_id\n\tWHERE user_id = ?\nEOD;\n $dbRights = $this->database->fetchAll($query, array($this->userId, $this->userId));\n $rights = array();\n foreach ($dbRights as $dbRight) {\n $value = ($dbRight->value === 'allow');\n if (!array_key_exists($dbRight->name, $rights)) {\n $rights[$dbRight->name] = $value;\n } else {\n if ($rights[$dbRight->name] && ($value === FALSE)) {\n $rights[$dbRight->name] = FALSE;\n }\n }\n }\n $this->rights = array_keys(array_filter($rights));\n }", "protected function getBitwiseAttribute()\n {\n if (BigInt::is32BitWithGMP()) { // x86 with GMP\n $bitwise = \\gmp_init(0);\n\n foreach ($this->permissions as $permission => $value) {\n \\gmp_setbit($bitwise, $value, $this->attributes[$permission]);\n }\n\n return \\gmp_strval($bitwise);\n }\n\n $bitwise = 0;\n\n foreach ($this->permissions as $permission => $value) {\n if ($this->attributes[$permission]) {\n $bitwise |= 1 << $value;\n }\n }\n\n return $bitwise;\n }", "public function getPermissions($mask = null, $setOnly = false);", "public function getPermissions()\n {\n $pattern = self::ALL_OFF;\n $length = strlen($pattern);\n $bitmask = str_pad(decbin($this->mask), $length, '0', STR_PAD_LEFT);\n\n $permissions = array();\n for ($i=$length-1; $i>=0; $i--) {\n if ('1' === $bitmask[$i]) {\n $permissions[] = 1 << ($length - $i - 1);\n }\n }\n\n return $permissions;\n }", "public function getRights();", "function decode_bitmask($mask=0, $properties=[]){\n\n\t$properties = array_flip($properties);\n\t$n = -1;\n\tforeach($properties as $property => &$value)\n\t\t$value = ($mask & 1<<++$n) ? true : false;\n\n\treturn $properties;\n}", "public function getBitmask()\n {\n return $this->bitmask;\n }", "public function get_available_rights();", "public function getAccessLevel($mask, $permission = null);", "function octal_permissions($perms)\n\t{\n\t\treturn substr(sprintf('%o', $perms), -3);\n\t}", "function encode_bitmask($properties=[]){\n\n\t$mask = 0;\n\t$n = -1;\n\tforeach($properties as $property => $value){\n\t\t$n++;\n\t\tif($value)\n\t\t\t$mask |= 1<<$n;\n\t}\n\n\treturn $mask;\n}", "public function checkBitmask()\n {\n \n }", "function readRights()\n {\n $this->right_ids = array();\n\n $result = $this->readUserRights($this->perm_user_id);\n if ($result === false) {\n return false;\n }\n\n $result = $this->readGroups($this->perm_user_id);\n if ($result === false) {\n return false;\n }\n\n $result = $this->readGroupRights($this->group_ids);\n if ($result === false) {\n return false;\n }\n\n $groupRights = is_array($this->group_right_ids) ? $this->group_right_ids : array();\n\n // Check if user has individual rights...\n if (is_array($this->user_right_ids)) {\n // Overwrite values from temporary array with values from userrights\n foreach ($this->user_right_ids as $right => $level) {\n if (array_key_exists($right, $groupRights)) {\n if ($level < 0) {\n // Revoking rights: A negative value indicates a maximum\n // possible right level\n $max_allowed_level = LIVEUSER_MAX_LEVEL + $level;\n $this->right_ids[$right] = min($groupRights[$right], $max_allowed_level);\n } elseif ($level > 0) {\n $this->right_ids[$right] = max($groupRights[$right], $level);\n } elseif ($level == 0) {\n unset($this->right_ids[$right]);\n }\n unset($groupRights[$right]);\n } elseif ($level < 0) {\n $this->right_ids[$right] = LIVEUSER_MAX_LEVEL + $level;\n } elseif ($level > 0) {\n $this->right_ids[$right] = $level;\n } elseif ($level == 0) {\n unset($this->right_ids[$right]);\n }\n }\n }\n\n $this->right_ids+= $groupRights;\n\n return $this->right_ids;\n }", "public abstract function getRequiredRights();", "protected function reduceToBitmask($list)\n {\n $this->logger->debug('Swivel - reducing to bitmask.', compact('list'));\n\n return !is_array($list) ? $list : array_reduce($list, function ($mask, $index) {\n if ((int)$index == 0) {\n return $mask;\n }\n return $mask | (1 << ($index - 1));\n }, 0);\n }", "private function getRights()\n {\n //====================================================================//\n // Permissions\n $rights = array(); // Permission array used by this module\n $index = 0;\n\n $rights[$index][0] = 9201; // id de la permission\n $rights[$index][1] = 'Lire les Données'; // libelle de la permission\n $rights[$index][2] = 'r'; // type de la permission (deprecie a ce jour)\n $rights[$index][3] = 1; // La permission est-elle une permission par defaut\n $rights[$index][4] = 'lire';\n $index++;\n\n $rights[$index][0] = 9202; // id de la permission\n $rights[$index][1] = 'Creer/modifier des données'; // libelle de la permission\n $rights[$index][2] = 'w'; // type de la permission (deprecie a ce jour)\n $rights[$index][3] = 0; // La permission est-elle une permission par defaut\n $rights[$index][4] = 'creer';\n $index++;\n\n $rights[$index][0] = 9203; // id de la permission\n $rights[$index][1] = 'Modifier les paramètres du Module'; // libelle de la permission\n $rights[$index][2] = 'w'; // type de la permission (deprecie a ce jour)\n $rights[$index][3] = 0; // La permission est-elle une permission par defaut\n $rights[$index][4] = 'creer';\n $index++;\n\n $rights[$index][0] = 9204; // id de la permission\n $rights[$index][1] = 'Supprimer des données'; // libelle de la permission\n $rights[$index][2] = 'd'; // type de la permission (deprecie a ce jour)\n $rights[$index][3] = 0; // La permission est-elle une permission par defaut\n $rights[$index][4] = 'supprimer';\n $index++;\n\n return $rights;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Execute Contact Form 7 Import Form
public function save_import_custom_form_cf7() { global $wpdb, $wpcf7_shortcode_manager; if ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled( 'cf7' ) ) { wp_send_json_error( __( 'Import Export Feature disabled.', Forminator::DOMAIN ) ); } // Validate nonce forminator_validate_ajax( "forminator_save_import_custom_form_cf7" ); $post_data = $this->get_post_data(); $importable = ( isset( $post_data['cf7_forms'] ) ? $post_data['cf7_forms'] : '' );// wpcs: CSRF ok $importer = ( ! empty ( $this->importers( 'cf7' ) ) ? $this->importers( 'cf7' ) : '' ); if ( ! empty( $importer ) ) : if ( ! empty( $importable ) ) { if ( 'specific' === $importable ) { $forms = isset( $post_data['cf7-form-id'] ) ? $post_data['cf7-form-id'] : array(); } else { $forms = forminator_list_thirdparty_contact_forms( 'cf7' ); } if ( ! empty( $forms ) ) { foreach ( $forms as $key => $value ) { $values = 'specific' === $importable ? $value : $value->ID; $imported = $importer->import_form( $values, $post_data ); if ( 'fail' === $imported['type'] ) { $error = $imported['message']; } } if ( ! empty( $error ) ) { wp_send_json_error( $error ); } wp_send_json_success( $imported ); } } else { wp_send_json_error( __( 'Can\'t find form to import', Forminator::DOMAIN ) ); } endif; wp_send_json_error( __( 'Could not import the forms. Check if the selected form plugin is active', Forminator::DOMAIN ) ); }
[ "public function import_form();", "public function load_import_custom_form() {\n\t\tif ( ! Forminator::is_import_export_feature_enabled() ) {\n\t\t\twp_send_json_success( '' );\n\t\t}\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_popup_import_cform\" );\n\n\t\t$html = forminator_template( 'custom-form/popup/import' );\n\n\t\twp_send_json_success( $html );\n\t}", "function sac_salesforce_integration( $cf7 ) {\n\n\n\n\t$form = WPCF7_Submission::get_instance();\n\n\n\n\tif ( $form ) {\n\n\n\n $black_list = array('_wpcf7', '_wpcf7_version', '_wpcf7_locale', '_wpcf7_unit_tag',\n\n '_wpcf7_is_ajax_call','cfdb7_name', '_wpcf7_container_post');\n\n\n\n $data = $form->get_posted_data();\n\n $form_data = array();\n\n\n\n foreach ($data as $key => $d) {\n\n if ( !in_array($key, $black_list ) ) {\n\n \n\n $tmpD = $d;\n\n \n\n if ( ! is_array($d) ){\n\n\n\n $bl = array('\\\"',\"\\'\",'/','\\\\');\n\n $wl = array('&quot;','&#039;','&#047;', '&#092;');\n\n\n\n $tmpD = str_replace($bl, $wl, $tmpD );\n\n } \n\n\n\n $form_data[$key] = $tmpD; \n\n }\n\n }\n\n\n\n $subject = (isset($form_data['subject'])) ? $form_data['subject'] : '';\n\n\t \t$first_name = (isset($form_data['first_name'])) ? $form_data[\"first_name\"] : $form_data[\"full_name\"];\n\n\t\t$last_name = (isset($form_data['last_name'])) ? $form_data[\"last_name\"] : '';\n\n\t\t$job_title = (isset($form_data['job_title'])) ? $form_data[\"job_title\"] : '';\n\n\t\t$institution = (isset($form_data['institution'])) ? $form_data[\"institution\"] : '';\n\n\t\t$phone = (isset($form_data['phone'])) ? $form_data[\"phone\"] : '';\n\n\t\t$email = (isset($form_data['email'])) ? $form_data[\"email\"] : '';\n\n\t\t$country = (isset($form_data['country'])) ? $form_data[\"country\"] : '';\n\n\t\t$state = (isset($form_data[\"state\"])) ? $form_data[\"state\"] : '';\n\n\t\t$message = (isset($form_data['message'])) ? $form_data[\"message\"] : '';\n\n\t\t$ckey = (isset($form_data['ckey'])) ? $form_data[\"ckey\"] : '';\n\n\t\t\n\n\t\t$post_items[] = 'oid=00DK000000XGIGZMA5'; //'.get_option('sf_oid','option');\n\n\t\t$post_items[] = 'subject=' . $subject;\n\n\t\t$post_items[] = 'first_name=' . $first_name;\n\n\t\t$post_items[] = 'last_name=' . $last_name;\n\n\t\t$post_items[] = 'title=' . $job_title;\n\n\t\t$post_items[] = 'company=' . $institution;\n\n\t\t$post_items[] = 'campaign_id=' . $ckey;\n\n\t\t$post_items[] = 'country=' . $country;\n\n\t\t$post_items[] = 'state=' . $state;\n\n\t\t$post_items[] = 'description='.$message;\n\n\t\t$post_items[] = 'email=' . $email;\n\n\t\t$post_items[] = 'phone=' . $phone;\n\n\t\t//$post_items[] = 'debug=1';\n\n\t\t//$post_items[] = 'debugEmail=avniyayin2@gmail.com';\n\n\t\t\n\n\t\t\n\n\t \tif(!empty($email) ) {\n\n\t\t $post_string = implode ('&', $post_items);\n\n\t\t // Create a new cURL resource\n\n\t\t $ch = curl_init();\n\n\t\t \n\n\t\t if (curl_error($ch) != \"\")\n\n\t\t {\n\n\t\t // error handling\n\n\t\t }\n\n\t\t\t\t\n\n\t\t curl_setopt($ch, CURLOPT_URL, 'https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8'); // SANDBOX\n\n\t\t //curl_setopt($ch, CURLOPT_URL, 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8'); // PRODUCTION\n\n\t\t\t\t\n\n\t\t // Set the method to POST\n\n\t\t curl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t // Pass POST data\n\n\t\t curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_string);\n\n\t\t $sf_res = curl_exec($ch); // Post to Salesforce\n\n\t\t\t\t$fp = fopen('sf_log.txt', 'w');\n\n\t\t\t\tfwrite($fp, print_r($post_items,true));\n\n\t\t\t\tfclose($fp);\n\n\t\t curl_close($ch); // close cURL resource\n\n\t \t}\n\n }\n\n}", "public function load_import_custom_form_gravity() {\n\t\tif ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled('gravityforms') ) {\n\t\t\twp_send_json_success( '' );\n\t\t}\t\t\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_popup_import_cform_gravityforms\" );\n\n\t\t$html = forminator_template( 'custom-form/popup/import-gravityforms' );\n\n\t\twp_send_json_success( $html );\n\t}", "public function load_import_form(){\n\t\t\n\t\t$current_page = $_SERVER['REQUEST_URI'];\n\n\t\techo \"\n\t\t\t<div style='margin: 20px 0; border: 3px solid green; background: white; padding: 20px; width: 500px; font-family: Raleway; font-size: 1.2em;'>\n\t\t\t<p>First line of CSV file must be labels. It will be processed accordingly. </p>\n\t\t\t<form action='$current_page' method='post' enctype='multipart/form-data'>\n\t\t\t<label for='nb_csv'>Upload Recent Records:</label>\n\t\t\t<input type='file' name='nb_csv' id='file'><br>\n\t\t\t<input type='submit' name='submit' value='Upload'>\n\t\t\t</form>\n\t\t\t</div>\n\t\t\";\n\t}", "private static function import_settings_form($args,$options) {\r\n $_SESSION['uploaded_file'] = import_helper::get_uploaded_file($options);\r\n // by this time, we should always have an existing file\r\n if (empty($_SESSION['uploaded_file'])) throw new Exception('File to upload could not be found');\r\n $request = parent::$base_url.\"index.php/services/plant_portal_import/get_plant_portal_import_settings/\".$options['model'];\r\n $request .= '?'.self::array_to_query_string($options['auth']['read']);\r\n $response = self::http_post($request, array());\r\n if (!empty($response['output'])) {\r\n // get the path back to the same page\r\n $reload = self::get_reload_link_parts();\r\n $reloadpath = $reload['path'] . '?' . self::array_to_query_string($reload['params']);\r\n $r = '<div class=\"page-notice ui-state-highlight ui-corner-all\">'.lang::get('import_settings_instructions').\"</div>\\n\".\r\n \"<div class=\\\"page-notice ui-state-highlight ui-corner-all\\\"><em>Important: If you have missing spatial references in your data, please leave this option off.</em></div>\\n\". \r\n \"<form method=\\\"post\\\" id=\\\"entry_form\\\" action=\\\"$reloadpath\\\" class=\\\"iform\\\">\\n\".\r\n \"<fieldset><legend>\".lang::get('Import Settings').\"</legend>\\n\";\r\n $formArray = json_decode($response['output'], true);\r\n if (!is_array($formArray)) {\r\n if (class_exists('kohana')) {\r\n kohana::log('error', 'Problem occurred during upload. Sent request to get_plant_portal_import_settings and received invalid response.');\r\n kohana::log('error', \"Request: $request\");\r\n kohana::log('error', 'Response: '.print_r($response, true));\r\n }\r\n return 'Could not upload file. Please check that the plant_portal_import module is enabled on the Warehouse.';\r\n }\r\n $formOptions = array(\r\n 'form' => $formArray,\r\n 'readAuth' => $options['auth']['read'],\r\n 'nocache'=>true\r\n );\r\n if (isset($options['presetSettings'])) {\r\n // skip parts of the form we have a preset value for\r\n $formOptions['extraParams'] = $options['presetSettings'];\r\n }\r\n \r\n //Don't display the survey drop-down on the setting form as this has been specified in the $args\r\n if (!empty($args['override_survey_id'])) {\r\n unset($formOptions['form']['survey_id']);\r\n $r .= '<input id=\"survey_id\" name=\"survey_id\" type=\"hidden\" value = \"'.$args['override_survey_id'].'\">';\r\n }\r\n \r\n //Don't display the species list drop-down on the setting form as this has been specified in the $args\r\n if (!empty($args['override_taxon_list_id'])) {\r\n unset($formOptions['form']['occurrence:fkFilter:taxa_taxon_list:taxon_list_id']);\r\n $r .= '<input id=\"occurrence:fkFilter:taxa_taxon_list:taxon_list_id\" name=\"occurrence:fkFilter:taxa_taxon_list:taxon_list_id\" type=\"hidden\" value = \"'.$args['override_taxon_list_id'].'\">';\r\n }\r\n \r\n //For Plant Portal, all records are uploaded as in-progress, until the user approves the records for final submission.\r\n unset($formOptions['form']['occurrence:record_status']);\r\n $r .= '<input id=\"occurrence:record_status\" name=\"occurrence:record_status\" type=\"hidden\" value = \"I\">';\r\n \r\n $form = self::build_params_form($formOptions, $hasVisibleContent);\r\n // If there are no settings required, skip to the next step.\r\n if (!$hasVisibleContent)\r\n return self::upload_mappings_form($options);\r\n $r .= $form; \r\n if (isset($options['presetSettings'])) {\r\n // The presets might contain some extra values to apply to every row - must be output as hiddens\r\n $extraHiddens = array_diff_key($options['presetSettings'], $formArray);\r\n unset($extraHiddens['password']);\r\n foreach ($extraHiddens as $hidden=>$value)\r\n $r .= \"<input type=\\\"hidden\\\" name=\\\"$hidden\\\" value=\\\"$value\\\" />\\n\";\r\n }\r\n $r .= '<input type=\"hidden\" name=\"import_step\" value=\"1\" />';\r\n $r .= '<input type=\"submit\" name=\"submit\" value=\"'.lang::get('Next').'\" class=\"ui-corner-all ui-state-default button\" />';\r\n // copy any $_POST data into the form, as this would mean preset values that are provided by the form which the uploader\r\n // was triggered from.\r\n foreach ($_POST as $key=>$value)\r\n $r .= \"<input type=\\\"hidden\\\" name=\\\"$key\\\" value=\\\"$value\\\" />\\n\";\r\n $r .= '</fieldset></form>';\r\n return $r;\r\n } else {\r\n // No settings form, so output the mappings form instead which is the next step.\r\n return self::upload_mappings_form($options);\r\n }\r\n }", "private static function import_settings_form($args,$options) {\r\n $_SESSION['uploaded_file'] = self::get_uploaded_file($options);\r\n // by this time, we should always have an existing file\r\n if (empty($_SESSION['uploaded_file'])) throw new Exception('File to upload could not be found');\r\n $request = parent::$base_url.\"index.php/services/plant_portal_import/get_plant_portal_import_settings/\".$options['model'];\r\n $request .= '?'.self::array_to_query_string($options['auth']['read']);\r\n $response = self::http_post($request, array());\r\n if (!empty($response['output'])) {\r\n // get the path back to the same page\r\n $reload = self::get_reload_link_parts();\r\n $reloadpath = $reload['path'] . '?' . self::array_to_query_string($reload['params']);\r\n $r = \"<form method=\\\"post\\\" id=\\\"entry_form\\\" action=\\\"$reloadpath\\\" class=\\\"iform\\\">\\n\".\r\n \"<fieldset><legend>\".lang::get('Import Settings').\"</legend>\\n\";\r\n $formArray = json_decode($response['output'], true);\r\n if (!is_array($formArray)) {\r\n if (class_exists('kohana')) {\r\n kohana::log('error', 'Problem occurred during upload. Sent request to get_plant_portal_import_settings and received invalid response.');\r\n kohana::log('error', \"Request: $request\");\r\n kohana::log('error', 'Response: '.print_r($response, true));\r\n }\r\n return 'Could not upload file. Please check that the plant_portal_import module is enabled on the Warehouse.';\r\n }\r\n $formOptions = array(\r\n 'form' => $formArray,\r\n 'readAuth' => $options['auth']['read'],\r\n 'nocache'=>true\r\n );\r\n if (isset($options['presetSettings'])) {\r\n // skip parts of the form we have a preset value for\r\n $formOptions['extraParams'] = $options['presetSettings'];\r\n }\r\n \r\n //Don't display the survey drop-down on the setting form as this has been specified in the $args\r\n if (!empty($args['override_survey_id'])) {\r\n unset($formOptions['form']['survey_id']);\r\n $r .= '<input id=\"survey_id\" name=\"survey_id\" type=\"hidden\" value = \"'.$args['override_survey_id'].'\">';\r\n }\r\n \r\n //Don't display the species list drop-down on the setting form as this has been specified in the $args\r\n if (!empty($args['override_taxon_list_id'])) {\r\n unset($formOptions['form']['occurrence:fkFilter:taxa_taxon_list:taxon_list_id']);\r\n $r .= '<input id=\"occurrence:fkFilter:taxa_taxon_list:taxon_list_id\" name=\"occurrence:fkFilter:taxa_taxon_list:taxon_list_id\" type=\"hidden\" value = \"'.$args['override_taxon_list_id'].'\">';\r\n }\r\n \r\n //For Plant Portal, all records are uploaded as in-progress, until the user approves the records for final submission.\r\n unset($formOptions['form']['occurrence:record_status']);\r\n $r .= '<input id=\"occurrence:record_status\" name=\"occurrence:record_status\" type=\"hidden\" value = \"I\">';\r\n \r\n $form = self::build_params_form($formOptions, $hasVisibleContent);\r\n // If there are no settings required, skip to the next step.\r\n if (!$hasVisibleContent)\r\n return self::upload_mappings_form($options);\r\n $r .= $form; \r\n if (isset($options['presetSettings'])) {\r\n // The presets might contain some extra values to apply to every row - must be output as hiddens\r\n $extraHiddens = array_diff_key($options['presetSettings'], $formArray);\r\n foreach ($extraHiddens as $hidden=>$value)\r\n $r .= \"<input type=\\\"hidden\\\" name=\\\"$hidden\\\" value=\\\"$value\\\" />\\n\";\r\n }\r\n $r .= '<input type=\"hidden\" name=\"import_step\" value=\"1\" />';\r\n $r .= '<input type=\"submit\" name=\"submit\" value=\"'.lang::get('Next').'\" class=\"ui-corner-all ui-state-default button\" />';\r\n // copy any $_POST data into the form, as this would mean preset values that are provided by the form which the uploader\r\n // was triggered from.\r\n foreach ($_POST as $key=>$value)\r\n $r .= \"<input type=\\\"hidden\\\" name=\\\"$key\\\" value=\\\"$value\\\" />\\n\";\r\n $r .= '</fieldset></form>';\r\n return $r;\r\n } else {\r\n // No settings form, so output the mappings form instead which is the next step.\r\n return self::upload_mappings_form($options);\r\n }\r\n }", "function ninja_forms_import_form( $file ){\n\tglobal $wpdb;\n\t$form = unserialize( trim( $file ) );\n\t$form_fields = isset( $form['field'] ) ? $form['field'] : null;\n\t$notifications = isset ( $form['notifications'] ) ? $form['notifications'] : null;\n\n\tunset ( $form['field'] );\n\tunset ( $form['notifications'] );\n\n\t$form = apply_filters( 'ninja_forms_before_import_form', $form );\n\t// Remove our last_sub setting. This is our starting seq_num.\n\tif ( isset ( $form['data']['last_sub'] ) )\n\t\tunset( $form['data']['last_sub'] );\n\n\t// Create our form\n\t$form_id = Ninja_Forms()->form()->create( $form['data'] );\n\n\t$form['id'] = $form_id;\n\n\tif(is_array($form_fields)){\n\t\tfor ($x=0; $x < count( $form_fields ); $x++) {\n\t\t\t$form_fields[$x]['form_id'] = $form_id;\n\t\t\t$form_fields[$x]['data'] = apply_filters( 'nf_before_import_field', $form_fields[$x]['data'], $form_fields[$x]['id'] );\n\t\t\t$form_fields[$x]['data'] = serialize( $form_fields[$x]['data'] );\n\t\t\t$old_field_id = $form_fields[$x]['id'];\n\t\t\t$form_fields[$x]['id'] = NULL;\n\t\t\t$wpdb->insert( NINJA_FORMS_FIELDS_TABLE_NAME, $form_fields[$x] );\n\t\t\t$form_fields[$x]['id'] = $wpdb->insert_id;\n\t\t\t$form_fields[$x]['old_id'] = $old_field_id;\n\t\t\t$form_fields[$x]['data'] = unserialize( $form_fields[$x]['data'] );\n\t\t}\n\t}\n\n\t$form['field'] = $form_fields;\n\t$form['notifications'] = $notifications;\t\n\n\t// Insert any notifications we might have.\n\tif ( is_array( $notifications ) ) {\n\t\tforeach ( $notifications as $n ) {\n\t\t\t$n_id = nf_insert_notification( $form_id );\n\t\t\t$n = apply_filters( 'nf_import_notification_meta', $n, $n_id, $form );\n\t\t\tunset( $n['conditions'] );\n\t\t\tforeach ( $n as $meta_key => $meta_value ) {\n\t\t\t\tforeach ( $form_fields as $field ) {\n\t\t\t\t\t// We need to replace any references to old fields in our notification\n\t\t\t\t\tif ( 'email_message' == $meta_key ) {\n\t\t\t\t\t\t$meta_value = str_replace( '[ninja_forms_field id=' . $field['old_id'].']', '[ninja_forms_field id='.$field['id'].']', $meta_value );\n\t\t\t\t\t\t$meta_value = str_replace( 'ninja_forms_field_' . $field['old_id'], 'ninja_forms_field_' . $field['id'], $meta_value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$meta_value = preg_replace( '/\\bfield_' . $field['old_id'] . '\\b/u', 'field_' . $field['id'], $meta_value );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnf_update_object_meta( $n_id, $meta_key, $meta_value );\n\t\t\t}\n\t\t}\n\t}\n\n\t\n\tdo_action( 'ninja_forms_after_import_form', $form );\n\treturn $form['id'];\n}", "public function render_external_import_form() {\n\t\t$post_types = ssp_post_types( true );\n\t\t$series = get_terms( 'series', array( 'hide_empty' => false ) );\n\t\tob_start();\n\t\t?>\n\t\t<p>If you have a podcast hosted on an external service (like Libsyn, Soundcloud or Simplecast) enter the url to\n\t\t\tthe RSS Feed in the form below and the plugin will import the episodes for you.</p>\n\t\t<table class=\"form-table\">\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\">RSS feed</th>\n\t\t\t\t<td>\n\t\t\t\t\t<input id=\"external_rss\" name=\"external_rss\" type=\"text\" placeholder=\"https://externalservice.com/rss\" value=\"\" class=\"regular-text\">\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<?php if ( count( $post_types ) > 1 ) { ?>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\">Post Type</th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select id=\"import_post_type\" name=\"import_post_type\">\n\t\t\t\t\t\t\t<?php foreach ( $post_types as $post_type ) { ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $post_type; ?>\"><?php echo ucfirst( $post_type ); ?></option>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t<?php } ?>\n\t\t\t<?php if ( count( $series ) > 1 ) { ?>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\">Series</th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select id=\"import_series\" name=\"import_series\">\n\t\t\t\t\t\t\t<?php foreach ( $series as $series_item ) { ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $series_item->term_id; ?>\"><?php echo $series_item->name; ?></option>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t<?php } ?>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<p class=\"submit\">\n\t\t\t<input id=\"ssp-settings-submit\" name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"<?php echo esc_attr( __( 'Begin Import Now', 'seriously-simple-podcasting' ) ) ?>\"/>\n\t\t</p>\n\t\t<?php\n\t\t$html = ob_get_clean();\n\n\t\treturn $html;\n\t}", "public function execute() {\n\n\t\t/** @var WireInput $input */\n\t\t$input = $this->wire('input');\n\t\t$form = $this->form;\n\n\t\t/** @var Modules $modules */\n\t\t$modules = $this->wire('modules');\n\t\t/** @var Session $session */\n\t\t$session = $this->wire('session');\n\t\t\n\t\t$formEditUrl = '../editForm/?id=' . $form->id;\n\n\t\t$json = $input->post('_import_json');\n\t\tif(!$json) throw new WireException('No JSON data specified');\n\t\t$newData = json_decode($json, true);\n\n\t\tif(!$newData) {\n\t\t\t$this->error($this->_('Invalid import JSON data'));\n\t\t\t$session->redirect($formEditUrl);\n\t\t}\n\n\t\t/** @var InputfieldForm $inputfields */\n\t\t$inputfields = $modules->get('InputfieldForm');\n\t\t$inputfields->attr('id', 'import_form');\n\t\t$inputfields->attr('method', 'post');\n\t\t$inputfields->attr('action', '../import/');\n\n\t\t/** @var InputfieldHidden $f */\n\t\t$f = $modules->get('InputfieldHidden');\n\t\t$f->attr('name', 'form_id');\n\t\t$f->attr('value', $form->id);\n\t\t$inputfields->add($f);\n\n\t\t$f = $modules->get('InputfieldTextarea');\n\t\t$f->attr('name', '_import_json');\n\t\t$f->attr('value', $json);\n\t\t$f->label = 'Import Data (JSON)';\n\t\t$f->collapsed = Inputfield::collapsedYes;\n\t\t$f->wrapAttr('hidden', 'hidden');\n\t\t$inputfields->add($f);\n\n\t\tif($input->post('submit_import_commit')) {\n\t\t\t// process submitted data\n\t\t\t$numChanges =\n\t\t\t\t$this->processImportChildren($form, $newData['children']) +\n\t\t\t\t$this->processImportProperties($form, $newData);\n\t\t\t\n\t\t\tif(in_array('sort', $input->post('_import_properties'))) {\n\t\t\t\t$order = explode(',', $input->post('_import_sort'));\n\t\t\t\t$this->importFormOrder($form, $order); \n\t\t\t\t$this->message($this->_('Updated fields sort'));\n\t\t\t\t$numChanges++;\n\t\t\t}\n\t\t\t\n\t\t\tif($numChanges) {\n\t\t\t\t$this->wire('forms')->save($form);\n\t\t\t}\n\t\t} else {\n\t\t\t$numChanges = 0;\n\t\t}\n\n\t\t// analyze submitted data\n\t\t/** @var InputfieldCheckboxes $fc */\n\t\t$fc = $modules->get('InputfieldCheckboxes');\n\t\t$fc->attr('name', '_import_children');\n\t\t$fc->label = $this->_('Select the fields you would like to import');\n\t\t$fc->description = $this->_('Below is a list of fields found in the import data that are not identical to those already in the form.');\n\t\t$fc->appendMarkup = \"<p class='detail'>\" . $this->wire('sanitizer')->unentities(\n\t\t\t\t$this->_('Values indicated <del>in red</del> are the old value while values indicated <ins>in green</ins> are the new value.') . ' ' .\n\t\t\t\t$this->_('Note that only changed values are shown.')\n\t\t\t) . \"</p>\";\n\t\t$fc->table = true;\n\t\t$fc->thead =\n\t\t\t$this->_('Name') . '|' .\n\t\t\t$this->_('Label') . '|' .\n\t\t\t$this->_('Type') . '|' .\n\t\t\t$this->_('Differences');\n\t\t$fc->entityEncodeText = false;\n\t\t$fc->set('themeOffset', 1);\n\n\t\t/** @var InputfieldCheckboxes $fp */\n\t\t$fp = $modules->get('InputfieldCheckboxes');\n\t\t$fp->attr('name', '_import_properties');\n\t\t$fp->label = $this->_('Select the form properties you would like to import');\n\t\t$fp->description = $this->_('Below is a list of properties found in the import data that are not identical to those already in the form.');\n\t\t$fp->appendMarkup = $fc->appendMarkup;\n\t\t$fp->table = true;\n\t\t$fp->thead =\n\t\t\t$this->_('Property') . '|' .\n\t\t\t$this->_('Action') . '|' .\n\t\t\t$this->_('Value');\n\t\t$fp->entityEncodeText = false;\n\t\t$fp->set('themeOffset', 1);\n\n\t\t$order1 = $this->getFormOrder($form);\n\t\t$order2 = array(); // new order\n\t\t$numChildrenDifferences = $this->buildImportChildren($form, $fc, $newData['children'], '', $order2);\n\t\t$numPropertyDifferences = $this->buildImportProperties($form, $fp, $newData);\n\n\t\tif($order1 !== $order2) {\n\t\t\t$order = $this->mergeFormOrders($order1, $order2);\n\t\t\t$diff = $this->getFormOrderDiff($order1, $order); \n\t\t\tif(strpos($diff, '<') !== false) {\n\t\t\t\t// <ins> and/or <del> present\n\t\t\t\t$fieldsLabel = $this->_('Fields');\n\t\t\t\t$sortLabel = $this->_('Order');\n\t\t\t\t$row = \"<strong>$fieldsLabel</strong>|$sortLabel|$diff\";\n\t\t\t\t$fp->addOption('sort', $row, array());\n\t\t\t\t$numPropertyDifferences++;\n\t\t\t\t$sortOrder = implode(',', $order);\n\t\t\t\t$fp->appendMarkup = \"<input type='hidden' name='_import_sort' value='$sortOrder' />\";\n\t\t\t}\n\t\t}\n\n\t\t$numDifferences = $numChildrenDifferences + $numPropertyDifferences;\n\t\t\n\t\tif($numDifferences) {\n\t\t\tif($numChildrenDifferences && $numPropertyDifferences) {\n\t\t\t\t// $fp->collapsed = Inputfield::collapsedYes;\n\t\t\t\t$fc->label = $fc->label . \" ($numChildrenDifferences)\";\n\t\t\t\t$fp->label = $fp->label . \" ($numPropertyDifferences)\";\n\t\t\t}\n\t\t\tif($numPropertyDifferences) $inputfields->prepend($fp);\n\t\t\tif($numChildrenDifferences) $inputfields->prepend($fc);\n\t\t} else {\n\t\t\tif(!$numChanges) {\n\t\t\t\t$inputfields->prependMarkup = '<p>' . wireIconMarkup('check') . ' ' .\n\t\t\t\t\t$this->_('The import data is consistent with the current form (no field differences found).') . '</p>';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$removals = $this->findRemoveFields($form, $newData);\n\t\tif(count($removals)) {\n\t\t\t$f = $modules->get('InputfieldMarkup');\n\t\t\t$f->label = $this->_('Field removals?') . ' (' . count($removals) . ')';\n\t\t\t$out = $this->_('The following fields are present on the current form, but not in the import data. If these fields should be deleted, please delete them manually:') . ' ';\n\t\t\t$out = \"<p>$out</p><ul class='pwfb-import-diff'><li>\" . implode('</li><li>', $removals) . '</li></ul>';\n\t\t\t$f->value = $out;\n\t\t\t$f->collapsed = Inputfield::collapsedYes;\n\t\t\t$inputfields->add($f);\n\t\t}\n\n\t\t\n\t\tif($numChanges) {\n\t\t\t$f = $modules->get('InputfieldMarkup');\n\t\t\t$f->label = $this->_('Import results');\n\t\t\t$ul = '';\n\t\t\tforeach($this->wire('notices') as $notice) {\n\t\t\t\t$ul .= \"<li>\" . $this->wire('sanitizer')->entities($notice->text) . '</li>';\n\t\t\t}\n\t\t\t$f->value = \"<ul class='pwfb-import-diff'>$ul</ul>\";\n\t\t\t$inputfields->prepend($f);\n\t\t}\n\t\n\t\tif($numDifferences) {\n\t\t\t/** @var InputfieldSubmit $submit */\n\t\t\t$submit = $modules->get('InputfieldSubmit');\n\t\t\t$submit->attr('name', 'submit_import_commit');\n\t\t\t$submit->attr('value', 'Import Now');\n\t\t\t$submit->icon = 'sign-in';\n\t\t\t$submit->showInHeader(true);\n\t\t\t$inputfields->add($submit);\n\t\t}\n\n\t\t/** @var InputfieldButton $f */\n\t\t$f = $modules->get('InputfieldButton');\n\t\t$f->href = $formEditUrl;\n\t\t$f->value = $this->_('Return to form editor');\n\t\t$f->icon = 'angle-right';\n\t\t$f->setSecondary(true);\n\t\t$inputfields->add($f);\n\t\t\n\t\treturn $inputfields->render();\n\t}", "public function import_forms() {\n\n\t\tcheck_ajax_referer( 'frm_ajax', 'nonce' );\n\t\tFrmAppHelper::permission_check( 'frm_edit_forms' );\n\n\t\t$forms = FrmAppHelper::get_simple_request(\n\t\t\tarray(\n\t\t\t\t'param' => 'form_id',\n\t\t\t\t'type' => 'post',\n\t\t\t\t'sanitize' => 'absint',\n\t\t\t)\n\t\t);\n\n\t\tif ( is_array( $forms ) ) {\n\t\t\t$imported = array();\n\t\t\tforeach ( (array) $forms as $form_id ) {\n\t\t\t\t$imported[] = $this->import_form( $form_id );\n\t\t\t}\n\t\t} else {\n\t\t\t$imported = $this->import_form( $forms );\n\t\t}\n\n\t\twp_send_json_success( $imported );\n\t}", "function import_panel() {\n\t\t\tglobal $wpseo_admin_pages;\n\n\t\t\t$upload_dir = wp_upload_dir();\n\t\t\t$wpseo_upload_dir = $upload_dir[\"basedir\"] . '/wpseo/import/';\n\n\t\t\t$content = '<p>' . sprintf( __('View the %sdocumentation%s to check what format of the CSV file should be.', 'yoast-local-seo'), '<a href=\"https://yoast.com/question/csv-import-file-local-seo-look-like/\" target=\"_blank\">', '</a>' ) . '</p>';\n\n\t\t\t$content .= '<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\n\t\t\t$content .= $wpseo_admin_pages->file_upload( 'csvuploadlocations', __( 'Upload CSV', 'yoast-local-seo' ) );\n\t\t\t$content .= '<label for=\"csv_separator\" class=\"checkbox\">' . __( 'Column separator', 'yoast-local-seo' ) . ':</label>';\n\t\t\t$content .= '<select class=\"textinput\" id=\"csv_separator\" name=\"csv_separator\">';\n\t\t\t$content .= '<option value=\"comma\">' . __( 'Comma', 'yoast-local-seo' ) . '</option>';\n\t\t\t$content .= '<option value=\"semicolon\">' . __( 'Semicolon', 'yoast-local-seo' ) . '</option>';\n\t\t\t$content .= '</select>';\n\t\t\t$content .= '<br class=\"clear\">';\n\t\t\t$content .= '<p>';\n\t\t\t$content .= '<input class=\"checkbox double\" id=\"is-simplemap-import\" type=\"checkbox\" name=\"is-simplemap-import\" value=\"1\"> ';\n\t\t\t$content .= '<label for=\"is-simplemap-import\">' . __( 'This CSV is exported by the SimpleMap plugin', 'yoast-local-seo' ) . '</label>';\n\t\t\t$content .= '</p>';\n\t\t\t$content .= '<br class=\"clear\">';\n\t\t\t$content .= '<br/>';\n\n\t\t\t$content .= '<p><em>' . __('Note', 'yoast-local-seo') . ': ' . __('The Geocoding API is limited to 2,500 queries a day, so when you have large CSV files, with no coordinates, cut them in pieces of 2,500 rows and import them one a day. Indeed, it\\'s not funny. It\\'s reality.', 'yoast-local-seo') . '</em></p>';\n\n\t\t\tif( ! is_writable( $wpseo_upload_dir ) ) {\n\t\t\t\t$content .= '<p>' . sprintf( __( 'Make sure the %s directory is writeable.', 'yoast-local-seo' ), '<code>\"' . $wpseo_upload_dir . '\"</code>' ) . '</p>';\n\t\t\t}\n\n\t\t\t$content .= '<input type=\"submit\" class=\"button-primary\" name=\"csv-import\" value=\"Import\" ' . ( ! is_writable( $wpseo_upload_dir ) ? ' disabled=\"disabled\"' : '' ) . ' />';\n\t\t\t$content .= '</form>';\n\n\t\t\tif ( !empty( $_POST[\"csv-import\"] ) ) {\n\t\t\t\t$csv_path = $wpseo_upload_dir . basename( $_FILES['wpseo']['name']['csvuploadlocations'] );\n\t\t\t\tif ( !empty( $_FILES['wpseo'] ) && !move_uploaded_file( $_FILES['wpseo']['tmp_name']['csvuploadlocations'], $csv_path ) ) {\n\t\t\t\t\t$content .= '<p class=\"error\">' . __( 'Sorry, there was an error while uploading the CSV file.<br>Please make sure the ' . $wpseo_upload_dir . ' directory is writable (chmod 777).', 'yoast-local-seo' ) . '</p>';\n\t\t\t\t} else {\n\t\t\t\t\t$is_simplemap_import = !empty( $_POST['is-simplemap-import'] ) && $_POST['is-simplemap-import'] == '1';\n\n\t\t\t\t\t$separator = \",\";\n\t\t\t\t\tif ( ( !empty( $_POST['csv_separator'] ) && $_POST['csv_separator'] == \"semicolon\" ) && false == $is_simplemap_import ) {\n\t\t\t\t\t\t$separator = \";\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get location data from CSV\n\t\t\t\t\t$column_names = array( \"name\", \"address\", \"city\", \"zipcode\", \"state\", \"country\", \"phone\", \"phone2nd\", \"description\", \"image\", \"category\" );\n\t\t\t\t\tif( $is_simplemap_import )\n\t\t\t\t\t\t$column_names = array( \"name\", \"address\", \"address2\", \"city\", \"state\", \"zipcode\", \"country\", \"phone\", \"email\", \"fax\", \"url\", \"description\", \"special\", \"lat\", \"long\", \"pubdate\", \"category\", \"tag\" );\n\n\t\t\t\t\t$handle = fopen( $csv_path, \"r\" );\n\t\t\t\t\t$locations = array();\n\t\t\t\t\t$row = 0;\n\t\t\t\t\twhile ( ( $csvdata = fgetcsv( $handle, 1000, $separator ) ) !== FALSE ) {\n\t\t\t\t\t\tif ( $row > 0 ) {\n\t\t\t\t\t\t\t$tmp_location = array();\n\t\t\t\t\t\t\tfor ( $i = 0; $i < count( $column_names ); $i++ ) {\n\n\t\t\t\t\t\t\t\t// Skip columns for simplemap import\n\t\t\t\t\t\t\t\tif( $is_simplemap_import && in_array( $column_names[$i], array( 'address2', 'email', 'url', 'special', 'pubdate', 'tag' ) ) ) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( isset( $csvdata[$i] ) ) {\n\t\t\t\t\t\t\t\t\t$tmp_location[$column_names[$i]] = addslashes( $csvdata[$i] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarray_push( $locations, $tmp_location );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$row++;\n\t\t\t\t\t}\n\t\t\t\t\tfclose( $handle );\n\n\t\t\t\t\t$debug = false;\n\n\t\t\t\t\t\n\t\t\t\t\t// Create WordPress posts in custom post type\n\t\t\t\t\tforeach ( $locations as $location ) {\n\t\t\t\t\t\t// Create standard post data\n\t\t\t\t\t\t$current_post['ID'] = '';\n\t\t\t\t\t\t$current_post['post_title'] = isset( $location[\"name\"] ) ? $location[\"name\"] : '';\n\t\t\t\t\t\t$current_post['post_content'] = isset( $location[\"description\"] ) ? $location[\"description\"] : '';\n\t\t\t\t\t\t$current_post['post_status'] = \"publish\";\n\t\t\t\t\t\t$current_post['post_date'] = date( \"Y-m-d H:i:s\", time() );\n\t\t\t\t\t\t$current_post['post_type'] = 'wpseo_locations';\n\n\t\t\t\t\t\tif ( !$debug ) {\n\t\t\t\t\t\t\t$errors = array();\n\t\t\t\t\t\t\t$post_id = wp_insert_post( $current_post );\n\n\t\t\t\t\t\t\t// Insert custom fields for location details\n\t\t\t\t\t\t\tif ( !empty( $post_id ) ) {\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, \"_wpseo_business_name\", isset( $location[\"name\"] ) ? $location[\"name\"] : '', true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_address', isset( $location[\"address\"] ) ? $location[\"address\"] : '', true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_city', isset( $location[\"city\"] ) ? $location[\"city\"] : '', true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_state', isset( $location[\"state\"] ) ? $location[\"state\"] : '', true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_zipcode', isset( $location[\"zipcode\"] ) ? $location[\"zipcode\"] : '', true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_country', isset( $location[\"country\"] ) ? $location[\"country\"] : '', true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_phone', isset( $location[\"phone\"] ) ? $location[\"phone\"] : '', true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_fax', isset( $location[\"fax\"] ) ? $location[\"fax\"] : '', true );\n\n\t\t\t\t\t\t\t\tif( isset( $location[\"phone_2nd\"] ) )\n\t\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_phone_2nd', $location[\"phone_2nd\"], true );\n\t\t\t\t\t\t\t\tif( isset( $location[\"email\"] ) )\n\t\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_business_email', $location[\"email\"], true );\n\n\t\t\t\t\t\t\t\tif( isset( $location['category'] ) )\n\t\t\t\t\t\t\t\t\twp_set_object_terms( $post_id, $location['category'], 'wpseo_locations_category' );\n\n\n\t\t\t\t\t\t\t\tif( empty( $location['lat'] ) && empty( $location['long'] ) ) {\n\t\t\t\t\t\t\t\t\t$full_address = $location['address'] . ', ' . wpseo_local_get_address_format( $location['zipcode'], $location['city'], $location['state'], true, false, false );\n\t\t\t\t\t\t\t\t\tif( ! empty( $location['country'] ) )\n\t\t\t\t\t\t\t\t\t\t$full_address .= ', ' . WPSEO_Local_Frontend::get_country( $location['country'] );\n\n\t\t\t\t\t\t\t\t\t$geo_data = wpseo_geocode_address( $full_address );\n\n\t\t\t\t\t\t\t\t\tif ( ! is_wp_error( $geo_data ) && !empty( $geo_data->results[0] ) ) {\n\t\t\t\t\t\t\t\t\t\t$location['lat'] = $geo_data->results[0]->geometry->location->lat;\n\t\t\t\t\t\t\t\t\t\t$location['long'] = $geo_data->results[0]->geometry->location->lng;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t$location['lat'] = '';\n\t\t\t\t\t\t\t\t\t\t$location['long'] = '';\n\n\t\t\t\t\t\t\t\t\t\tif( $geo_data->get_error_code() == 'wpseo-query-limit' ) {\n\t\t\t\t\t\t\t\t\t\t\t$errors[] = sprintf( __('The usage of the Google Maps API has exceeds their limits. Please consider entering an API key in the %soptions%s', 'yoast-local-seo' ), '<a href=\"' . admin_url( 'admin.php?page=wpseo_local' ) . '\">', '</a>' );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t$errors[] = sprintf( __('Location <em>' . esc_attr( $location[\"name\"] ) . '</em> could not be geo-coded. %sEdit this location%s.', 'yoast-local-seo' ), '<a href=\"' . admin_url( 'post.php?post=' . esc_attr( $post_id ) . '&action=edit' ) . '\">', '</a>' );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_coordinates_lat', $location[\"lat\"], true );\n\t\t\t\t\t\t\t\tadd_post_meta( $post_id, '_wpseo_coordinates_long', $location[\"long\"], true );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Add image as post thumbnail\n\t\t\t\t\t\t\tif ( !empty( $location[\"image\"] ) ) {\n\t\t\t\t\t\t\t\t$upload_dir = wp_upload_dir();\n\t\t\t\t\t\t\t\t$filepath = $upload_dir[\"basedir\"] . '/wpseo/import/images/' . $location[\"image\"];\n\n\t\t\t\t\t\t\t\t$wpseo_admin_pages->insert_attachment( $post_id, $filepath, true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$msg = '';\n\t\t\t\t\tif ( count( $locations ) > 0 ) {\n\t\t\t\t\t\t$msg .= count( $locations ) . ' locations found and succesfully imported.<br/>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif( ! empty( $errors ) ) {\n\n\t\t\t\t\t\t$msg .= '<p>';\t\t\t\t\t\t\n\t\t\t\t\t\t$msg .= '<strong>' . __('Some errors has occured', 'yoast-local-seo') . '</strong><br>';\t\t\t\t\t\t\n\t\t\t\t\t\tforeach( $errors as $error ) {\n\t\t\t\t\t\t\t$msg .= $error . '<br>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$msg .= '</p>';\n\t\t\t\t\t}\n\t\t\t\t\tif ( $msg != '' ) {\n\t\t\t\t\t\techo '<div id=\"message\" class=\"message updated\" style=\"width:94%;\"><p>' . $msg . '</p></div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$wpseo_admin_pages->postbox( 'xmlgeositemaps', __( 'CSV import of locations for Local Search', 'yoast-local-seo' ), $content );\n\t\t}", "function import_surat_keputusan_edar_alkes_import_form() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal ${$GLOBALS['session_vars']}, ${$GLOBALS['get_vars']};\n\t\t$field_arr[] = array ('name' => 'userfile');\n\t\t$optional_arr['userfile'] = 'user_defined';\n\t\t$value_arr['userfile'] = '<input class=text type=file name=userfile>';\n\n\t\teval($this->save_config);\n\t\t$label_arr['userfile'] = 'Import File';\n\t\t$label_arr['submit_val'] = 'Import'; // default Submit\n\t\t$label_arr['form_extra'] = '<input type=hidden name=action value=postimport>'; // default null\n\t\t$label_arr['form_title'] = ('Import Surat keputusan Izin Edar Alkes Import Form'); // default null\n\t\t$label_arr['form_width'] = '100%'; // default 100%\n\t\t$label_arr['form_name'] = 'theform'; // default form\n\n\t\t$_form = new form();\n\t\t$_form->set_config(\n\t\t\tarray (\n\t\t\t\t'field_arr'\t\t=> $field_arr,\n\t\t\t\t'label_arr'\t\t=> $label_arr,\n\t\t\t\t'value_arr'\t\t=> $value_arr,\n\t\t\t\t'optional_arr'\t=> $optional_arr\n\t\t\t)\n\t\t);\n\t\treturn $_form->parse_field();\n\t}", "protected function fromForm() {\n\t\t\t$importer = array('about' => array(\n\t\t\t\t\t'name'\t\t\t=> General::sanitize($_POST['fields']['about']['name']),\n\t\t\t\t\t'description'\t=> General::sanitize($_POST['fields']['about']['description']),\n\t\t\t\t\t'file'\t\t\t=> \"\",\n\t\t\t\t\t'created'\t\t=> DateTimeObj::getGMT('c'),\n\t\t\t\t\t'updated'\t\t=> DateTimeObj::getGMT('c'),\n\t\t\t\t)\n\t\t\t);\n\t\t\t// if the creation time was specified in the post data overwrite the default above\n\t\t\tif (isset($_POST['fields']['about']['created'])) {\n\t\t\t\t$importer['about']['created'] = $_POST['fields']['about']['created'];\n\t\t\t}\n\t\t\t// if the file was specified in the post data then add this to the importer\n\t\t\tif (isset($_POST['fields']['about']['file'])) {\n\t\t\t\t$importer['about']['file'] = $_POST['fields']['about']['file'];\n\t\t\t}\n\t\t\tif (isset($_POST['fields']['about']['author'])) {\n\t\t\t\t$importer['about']['author'] = $_POST['fields']['about']['author'];\n\t\t\t} else {\n\t\t\t\t$importer['about']['author']['name'] = $this->_Parent->Author->getFullName();\n\t\t\t\t$importer['about']['author']['website'] = URL;\n\t\t\t\t$importer['about']['author']['email'] = $this->_Parent->Author->get('email');\n\t\t\t}\n\t\t\tif (isset($_FILES['fields']['tmp_name']['source']) and $_FILES['fields']['error']['source'] == UPLOAD_ERR_OK) {\n\t\t\t\t// because this is a multistage form construction we need the file data\n\t\t\t\t// to persist across multiple requests. thus, we store the accumulating\n\t\t\t\t// data in hidden fields in the form and move the file to a custom directory\n\t\t\t\t// to prevent php deleting it. we use the temp directory so that the file will\n\t\t\t\t// get cleaned up automatically if the user does not save the importer.\n\t\t\t\t$temp_name = tempnam(sys_get_temp_dir(), $_FILES['fields']['name']['source']);\n\t\t\t\tmove_uploaded_file($_FILES['fields']['tmp_name']['source'], $temp_name);\n\t\t\t\t$importer['source']['path'] = $temp_name;\n\t\t\t\t$importer['source']['name'] = $_FILES['fields']['name']['source'];\n\t\t\t}\n\t\t\tif (isset($_POST['fields']['source']['tmp_name'])) {\n\t\t\t\t$importer['source']['path'] = $_POST['fields']['source']['tmp_name'];\n\t\t\t\t$importer['source']['name'] = $_POST['fields']['source']['name'];\n\t\t\t}\n\t\t\t// sanity check the input handle\n\t\t\t$context = $this->Context();\n\t\t\tif (isset($context[1])) {\n\t\t\t\t$importer['handle'] = $context[1];\n\t\t\t} else {\n\t\t\t\t$importer['handle'] = str_replace('-', '', Lang::createHandle($importer['about']['name']));\n\t\t\t}\n\t\t\t$importer['source']['header'] = $_POST['fields']['header'];\n\t\t\t$importer['section']['id'] = $_POST['fields']['section'];\n\t\t\t$sectionManager = new SectionManager($this->Parent);\n\t\t\tif (isset($importer['section']['id'])) {\n\t\t\t\t$importer['section']['name'] = $sectionManager->fetch($importer['section']['id'])->get('name');\n\t\t\t}\n\t\t\t$importer['mappings'] = $_POST['fields']['mapping'];\n\t\t\treturn $importer;\n\t\t}", "function _form_section_import_settings (&$form, &$form_state) {\n \n $form['erpal_crm_mailaction']['import_settings'] = array (\n '#type' => 'fieldset',\n '#title' => t('Import settings'),\n '#tree' => TRUE,\n '#collapsible' => TRUE,\n '#collapsed' => TRUE\n );\n \n $form['erpal_crm_mailaction']['import_settings']['publish_imports'] = array (\n '#type' => 'checkbox',\n '#title' => t('Publish imported content'),\n '#default_value' => Settings::get ('import_settings', 'publish_imports', FALSE),\n ); \n \n $form['erpal_crm_mailaction']['import_settings']['publish_attachments'] = array (\n '#type' => 'checkbox',\n '#title' => t('Publish imported attachments'),\n '#default_value' => Settings::get ('import_settings', 'publish_attachments', FALSE),\n ); \n \n $form['erpal_crm_mailaction']['import_settings']['create_contact_for_unknown_user'] = array (\n '#type' => 'checkbox',\n '#title' => t('Create contacts for unknown users. (NOT SECURE!)'),\n '#default_value' => Settings::get ('import_settings', 'create_contact_for_unknown_user', FALSE),\n ); \n \n $form['erpal_crm_mailaction']['import_settings']['cc_box'] = array (\n '#type' => 'textfield',\n '#title' => t('Reply (cc) box'),\n '#default_value' => Settings::get ('import_settings', 'cc_box', ''),\n '#description' => t('It is the email address which will all the mails of a conversion per cc.')\n ); \n \n return;\n}", "public function save_import_custom_form_ninja() {\n\n\t\tif ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled('ninjaforms') ) {\n\t\t\twp_send_json_error( __( 'Import Export Feature disabled.', Forminator::DOMAIN ) );\n\t\t}\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_save_import_custom_form_ninja\" );\n\n\t\t$post_data = $this->get_post_data();\n\t\t$importable = isset( $post_data['ninjaforms'] ) ? $post_data['ninjaforms'] : '';// wpcs: CSRF ok\n\t\t$importer \t= ( ! empty ( $this->importers( 'ninja' ) ) ? $this->importers( 'ninja' ) : '' );\n\n\t\tif( ! empty( $importer ) ):\n\t\t\tif( 'all' !== $importable && '' !== $importable ){\n\n\t\t\t\t$importable = absint( $importable );\n\t\t\t\t$imported = $importer->import_form( $importable );\n\n\t\t\t\tif( 'fail' === $imported['type'] ){\n\n\t\t\t\t\twp_send_json_error( $imported['message'] );\n\t\t\t\t}\n\n\t\t\t\twp_send_json_success( $imported );\n\t\t\t\t\n\t\t\t}elseif( '' !== $importable ){\n\n\t\t\t\t$forms = forminator_list_thirdparty_contact_forms( 'ninjaforms' );\n\n\t\t\t\tforeach ($forms as $key => $value) {\n\n\t\t\t\t\t$imported = $importer->import_form( $value->get_id() );\n\n\t\t\t\t\tif( 'fail' === $imported['type'] ){\n\n\t\t\t\t\t\t$error = $imported['message'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif( !empty( $error ) ){\n\t\t\t\t\twp_send_json_error( $error );\t\n\t\t\t\t}\n\n\t\t\t\twp_send_json_success( $imported );\n\t\t\t}\n\t\tendif;\n\n\t\twp_send_json_error( __( 'Could not import the forms. Check if the selected form plugin is active', Forminator::DOMAIN ) );\n\n\t}", "private function _generate_excel_import_form(){\n\t\t\t/*---------------------------------------------------------*/\n\t\t\tforeach( $this->table_fields as $k => $v ){\n\t\t\t\tswitch( $k ){\n\t\t\t\tcase 'file':\n\t\t\t\t//case 'import_template_type':\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->class_settings['hidden_records'][ $v ] = 1;\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->class_settings['hide_clear_form_button'] = 1;\n\t\t\t$this->class_settings['form_heading_title'] = '<h4>Select Excel File & Start Import &darr;</h4>';\n\t\t\t$this->class_settings['form_submit_button'] = 'Start Import &rarr;';\n\t\t\t$this->class_settings['form_action_todo'] = 'save_and_start_operator_excel_import';\n\t\t\t\n\t\t\t$recent_activity_data = array();\n\t\t\t\n\t\t\t$this->class_settings[ 'html' ] = array( 'html-files/templates-1/package/'.HYELLA_PACKAGE.'/'.$this->table_name.'/import-excel-form.php' );\n\t\t\t$this->class_settings[ 'data' ] = array(\n 'excel_import_form' => $this->_generate_new_data_capture_form(),\n\t\t\t\t'import_type' => isset( $this->class_settings[\"import_type\"] )?$this->class_settings[\"import_type\"]:\"\",\n );\n\t\t\t$returning_html_data = $this->_get_html_view();\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'new-status',\n\t\t\t\t'javascript_functions' => array( 'prepare_new_record_form_new', 'set_function_click_event' ),\n\t\t\t);\n\t\t}", "public function wpcf7_save_entry($contact_form) {\n\t\tglobal $wpdb;\n\n\t\t$submission_saving = get_option('wpcf7_entries_submission_saving', 1);\t\t\n\t\tif ( !$submission_saving ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$email = get_option( 'wpcf7_entries_field_email', 'your-email' );\n\t\tif (empty($email) ) {\n\t\t\t$email = 'your-email';\n\t\t}\n\n\t\t$name = get_option( 'wpcf7_entries_field_name', 'your-name' );\n\t\tif (empty($name) ) {\n\t\t\t$name = 'your-name';\n\t\t}\n\n\t\t$subject = get_option( 'wpcf7_entries_field_subject', 'your-subject' );\n\t\tif (empty($subject) ) {\n\t\t\t$subject = 'your-subject';\n\t\t}\n\n\t\t$result = $wpdb->insert($wpdb->prefix . 'wpcf7_entries', array( \n\t\t\t'form_id' => $_POST['_wpcf7'], \n\t\t\t'email' => $_POST[$email], \n\t\t\t'name' => $_POST[$name], \n\t\t\t'subject' => $_POST[$subject]\n\t\t));\n\n\t\t\n\t\tif ( !$result ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$entry_id = $wpdb->insert_id;\n\t\t\n\t\t$others_fields = array_filter($_POST, function($value, $key) use($email, $name, $subject) {\n\t\t\tif ( in_array($key, [$email, $name, $subject]) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( strpos($key, '_wpcf7') !== false) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}, ARRAY_FILTER_USE_BOTH);\n\n\t\tforeach ($others_fields as $key => $value) {\n\t\t\t$wpdb->insert($wpdb->prefix . 'wpcf7_entries_fields', array( \n\t\t\t\t'entry_id' => $entry_id,\n\t\t\t\t'field_id' => $key, \n\t\t\t\t'value' => $value\n\t\t\t));\n\t\t}\n\t}", "function _bt_export_form($form, &$form_state){\n\t$form = array();\n\t drupal_add_library('system', 'drupal.collapse');\n\t module_load_include('class.php', 'bt_export', 'classes/bt_export_ds_view_modes');\n\t \n\t \n\t //chow the result chanel log\n\t\tif(!empty($form_state['chanel_log'])){\n\t\t\t$form['chanel_log'] = array(\n\t\t\t\t'#type' => 'fieldset',\n\t\t\t\t'#collapsible' => TRUE,\n\t\t\t\t'#collapsed' => TRUE,\n\t\t\t\t'#title' => t('Chanel Log'),\n\t\t\t);\n\t\t\t$form['chanel_log']['prev_results'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => drupal_render($form_state['chanel_log']),\n\t\t\t);\n\t\t}\n\t\n\t//import section\n\t//import vertcle tab\n\t$form['wrapper'] = array(\n\t\t'#type' => 'vertical_tabs',\n\t);\n\t$form['imports_wrapper'] = array(\n\t\t'#type' => 'fieldset',\n\t\t'#title' => t('Import'),\n\t\t'#collapsed' => TRUE,\n\t\t'#collapsible' => TRUE,\n\t\t'#group' => 'wrapper',\n\t);\n\t$form['imports_wrapper']['title'] = array(\n\t\t'#title' => t('Content Type Name'),\n\t\t'#type' => 'textfield',\n\t\t//'#required' => TRUE,\n\t);\n\t$form['imports_wrapper']['machine_name'] = array(\n\t\t'#title' => t('Content Type Machine Name'),\n\t\t'#type' => 'textfield',\n\t\t//'#required' => TRUE,\n\t);\n\t$form['imports_wrapper']['import'] = array(\n\t\t'#title' => t('Code'),\n\t\t'#type' => 'text_format',\n\t\t'#cols' => 60,\n\t\t'#rows' => 20,\n\t\t'#group' => 'wrapper',\n\t\t'#default_value' => '',\n\t\t'#format' => 'plain_text',\n\t\t//'#required' => TRUE,\n\t);\n\t$form['imports_wrapper']['submit'] = array(\n\t\t'#type' => 'submit',\n\t\t'#value' => t('Import'),\n\t);\n\t//end import section\n\n\n\n\t//export section\n\n\t//export verticle tab\n\t$form['export_wrapper'] = array(\n\t\t'#type' => 'fieldset',\n\t\t'#title' => t('Export'),\n\t\t'#collapsed' => TRUE,\n\t\t'#collapsible' => TRUE,\n\t\t'#group' => 'wrapper',\n\t);\n\t$form['export_wrapper']['content_types'] = array(\n\t\t'#type' => 'fieldset',\n\t\t'#title' => t('Content Types'),\n\t\t'#collapsed' => TRUE,\n\t\t'#collapsible' => TRUE,\n\t);\n\n\t//taxonomy export\n\t$form['export_wrapper']['taxonomy_terms'] = array(\n\t\t'#type' => 'fieldset',\n\t\t'#title' => t('Taxonomy'),\n\t\t'#collapsed' => TRUE,\n\t\t'#collapsible' => TRUE,\n\t);\n\t$taxonomy_vocabularies = bt_export_taxonomy_handler();\n\t$form['export_wrapper']['taxonomy_terms']['taxonomy_terms'] = array(\n\t\t'#title' => t('Select Taxonomy Vocabularies'),\n\t\t'#type' => 'checkboxes',\n\t\t'#options' => $taxonomy_vocabularies,\n\t\t'#default_value' => array(),\n\t\t'#multiple' => TRUE,\n\t);\n\n\t//end taxonomy\n\t\n\t\n\t\n\t//advanced display suit\n\t//get all the entity view modes\n\t$entity_info = new BtExportDsViewModes();\n\t$view_modes = $entity_info->listViewModes();\n\t//taxonomy export\n\t$form['export_wrapper']['ds_view_modes_fieldsets'] = array(\n\t\t'#type' => 'fieldset',\n\t\t'#title' => t('Advanced Display Suite'),\n\t\t'#collapsed' => TRUE,\n\t\t'#collapsible' => TRUE,\n\t);\n\t$form['export_wrapper']['ds_view_modes_fieldsets']['ds_view_modes'] = array(\n\t\t'#title' => t('View Mode'),\n\t\t'#type' => 'checkboxes',\n\t\t'#options' => $view_modes,\n\t\t'#multiple' => TRUE,\n\t\t'#description' => t('Export all Field Groups, Field Settings and Layout Settings for each node using the selected View Mode(s).'),\n\t);\n\t//checkbox states\n\t$states = array();\n\tforeach($view_modes as $name => $value){\n\t\t$states['visible'][] = array(':input[name=\"ds_view_modes['.$name.']\"]' => array('checked' => TRUE));\n\t}\n\t$form['export_wrapper']['ds_view_modes_fieldsets']['advanced_ds_custom_fields'] = array(\n\t\t'#title' => t('Display Suite Custom Fields'),\n\t\t'#type' => 'checkboxes',\n\t\t'#options' => array(\n\t\t\t'yes' => 'yes',\n\t\t),\n\t\t'#description' => t('Export Code Fields for selected View Mode(s)'),\n\t\t'#states' => $states,\n\t);\n\t\n\t\n\n\t//get all the content types\n\t$content_types = node_type_get_types();\n\t$content_types = array_keys($content_types);\n\t$select_content_types = array(\n\t\t'_none' => '-Select Content Type-',\n\t);\n\tforeach($content_types as $delta => $value){\n\t\t$select_content_types[$value] = $value;\n\t}\n\t//select content type\n\t$form['export_wrapper']['content_types']['export_content_type'] = array(\n\t\t'#type' => 'select',\n\t\t'#title' => t('Select Content Type'),\n\t\t'#options' => $select_content_types,\n\t);\n\t//export compenent options depending on which module are available\n\t$export_components = _bt_export_export_components();\n\t//export component types\n\t$form['export_wrapper']['content_types']['export_types'] = array(\n\t\t'#title' => t('Export components'),\n\t\t'#type' => 'checkboxes',\n\t\t'#options' => $export_components,\n\t\t'#multiple' => TRUE,\n\t);\n\t\n\t$form['export_wrapper']['content_types']['ds_custom_fields'] = array(\n\t\t'#type' => 'checkboxes',\n\t\t'#title' => t('Display Suite Custom Fields'),\n\t\t'#options' => array(\n\t\t\t'yes' => t('Yes'),\n\t\t),\n\t\t'#states' => array(\n\t\t\t\t'visible' => array( // action to take.\n\t\t\t\t\t':input[name=\"export_types[ds]\"]' => array('checked' => TRUE),\n\t\t\t\t),\n\t\t\t),\n\t);\n\t\n\t\n\t//our field group options per module\n\t$field_group_options = array();\n\tif(!empty($export_components['field_group'])){\n\t\t$field_group_options['form_field_groups'] = t('Form Field Groups');\n\t\tif(!empty($export_components['ds'])){\n\t\t\t$field_group_options['ds_field_groups'] = t('Display Suite Field Groups');\n\t\t}\n\t}\n\t//if we have field group options\n\t//create our field group checkboxes\n\tif(!empty($field_group_options)){\n\t\t$form['export_wrapper']['content_types']['export_field_groups_type'] = array(\n\t\t\t'#title' => t('Field Group Types'),\n\t\t\t'#type' => 'checkboxes',\n\t\t\t'#options' => $field_group_options,\n\t\t\t'#multiple' => TRUE,\n\t\t\t'#states' => array(\n\t\t\t\t'visible' => array( // action to take.\n\t\t\t\t\t':input[name=\"export_types[field_group]\"]' => array('checked' => TRUE),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}\n\t$form['export_wrapper']['submit'] = array(\n\t\t'#type' => 'submit',\n\t\t'#value' => t('Export'),\n\t);\n\tif(!empty($form_state['values']['export_content_type'])){\n\t\t$form['export_wrapper']['code_placeholder'] = array(\n\t\t\t'#type' => 'text_format',\n\t\t\t'#cols' => 60,\n\t\t\t'#rows' => 20,\n\t\t\t'#title' => t('Export Code'),\n\t\t\t'#default_value' => !empty($form_state['code']) ? $form_state['code'] : NULL,\n\t\t\t'#prefix' => '<div id=\"bt-export-select\">',\n\t\t\t'#suffix' => '</div>',\n\t\t\t'#format' => 'plain_text',\n\t\t);\n\t}\n\t//end export section\n\t$form['#validate'] = array('_bt_export_validate');\n\t$form['#submit'] = array('_bt_export_submit');\n\n\treturn $form;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set open and close tag variables.
private function setTags($tag) { $this->open_tag = $this->makeOpenTag($tag); $this->close_tag = $this->makeCloseTag($tag); }
[ "function tag_open($parser, $tag, $attributes) {\n\n\t\t$this->cdata = '';\n\t\tarray_unshift($this->tmp, array('tag' => $tag, 'attributes' => $attributes, 'tag_id' => ++$this->tag_id));\n\n\t}", "public function setTemplateTags($openingTag, $closingTag) {\n\t\t\tif(is_string($openingTag) && !empty($openingTag)) {\n\t\t\t\t$this->openingTag = $openingTag;\n\t\t\t}\n\t\t\tif(is_string($closingTag) && !empty($closingTag)) {\n\t\t\t\t$this->closingTag = $closingTag;\n\t\t\t}\n\t\t}", "public static function setEscapedContentTags($openTag, $closeTag) {\n \n }", "private function setCloseTag(){\n if(substr($this->doctype, 0, 5) == 'xhtml' || substr($this->doctype, 0, 5) == 'html5'){\n $this->closetag = \" />\";\n }else{\n $this->closetag = \">\";\n }\n }", "function _tagOpen($parser, $tag, $attribs) {\n\t\t$this->currentData = '';\n\t\tarray_push($this->stack, $tag);\n\t\t$this->onTagOpen($tag);\n\n\t\t//xml-structure of errors and warnings are the same\n\t\t//we can use $this->errosPos and $this->errorsCountTemp for creating $this->errors AND $this->warnings - @see _tagClose();\n\t\tif($this->_getParentTag() == 'errors' || $this->_getParentTag() == 'warnings'){\n\t\t\tswitch ($tag) {\n\t\t\t\tcase 'sr':\n\t\t\t\tcase 'su':\n\t\t\t\tcase 'sv':\n\t\t\t\tcase 'sa':\n\t\t\t\tcase 'ls':\n\t\t\t\tcase 'sl':\n\t\t\t\tcase 'sf':\n\t\t\t\t\t$this->errorPos = $tag;\n\t\t\t\t\t$this->errorCountTemp = 0;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "function tag_open($parser, $tag, $attrs)\n {\n $this->rss['current_tag'] = $tag = strtolower($tag);\n switch ($tag)\n {\n case 'channel':\n case 'image':\n case 'textinput':\n $this->type = $tag;\n break;\n case 'item':\n $this->type = $tag;\n $this->rss['index']++;\n break;\n default:\n break;\n }\n if (sizeof($attrs))\n foreach ($attrs as $k => $v)\n if (strpos($k, 'xmlns') !== false)\n $this->data['namespaces'][$k] = $v;\n }", "public function open()\n\t{\n\t\t$singletag = in_array($this->_vars['tag'], $this->_singles);\n\n\t\t// return the string tag\n\t\treturn '<'\n\t\t\t . $this->_vars['tag']\n\t\t\t . $this->_attr_to_str()\n\t\t\t . (($singletag === TRUE)\n\t\t\t // Do not end the tag if it's a single tag\n\t\t\t ? NULL\n\t\t\t // Otherwise close the tag\n\t\t\t : \">\\n\");\n\t}", "function setTags( $startTag, $endTag )\n\t{\n\t\t$this->_options['startTag']\t=\t$startTag;\n\t\t$this->_options['endTag']\t=\t$endTag;\n\n\t\t$this->_startTag\t=\t$startTag;\n\t\t$this->_endTag\t\t=\t$endTag;\n\t\treturn true;\n\t}", "function _parseTag ($args) {\r\n\t\t\t$wholetag = $args[0];\r\n\t\t\t$openclose = $args[1];\r\n\t\t\t$tag = strtolower($args[2]);\r\n\r\n\t\t\tif ($tag == 'else') return '<?php } else { ?>';\r\n\r\n\t\t\tif (preg_match(\"/^<\\/|{\\/|<!--\\/$/s\", $openclose) || preg_match(\"/^end[if|loop|unless|comment]$/\", $tag)) {\r\n\t\t\t\tif ($tag == 'loop' || $tag == 'endloop') array_pop($this->_namespace);\r\n\t\t\t\tif ($tag == 'comment' || $tag == 'endcomment') {\r\n\t\t\t\t\treturn '<?php */ ?>';\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn '<?php } ?>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// arrange attributes\r\n\t\t\tfor ($i=3; $i < 8; $i=($i+2)) {\r\n\t\t\t\tif (empty($args[$i]) && empty($args[($i+1)])) break;\r\n\t\t\t\t$key = (empty($args[$i])) ? 'name' : strtolower($args[$i]);\r\n\t\t\t\tif ($key == 'name' && preg_match('/^(php)?include$/', $tag)) $key = 'file';\r\n\t\t\t\t$$key = $args[($i+1)];\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (isset($name)) {\r\n\t\t\t\t$var = ($this->OPTIONS['CASELESS']) ? strtolower($name) : $name;\r\n\r\n\t\t\t\tif ($this->_debug && !empty($var)) {\r\n\t\t\t\t\tif (preg_match(\"/^global\\.([A-Za-z_]+[_A-Za-z0-9]*)$/\", $var, $matches)) $var2 = $matches[1];\r\n\t\t\t\t\tif (empty($this->_debugTemplatevars[$tag])) $this->_debugTemplatevars[$tag] = array();\r\n\t\t\t\t\tif (!isset($var2)) $var2 = $var;\r\n\t\t\t\t\tif (!in_array($var2, $this->_debugTemplatevars[$tag])) array_push($this->_debugTemplatevars[$tag], $var2);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (preg_match(\"/^([A-Za-z_]+[_A-Za-z0-9]*(\\.)+)?([A-Za-z_]+[_A-Za-z0-9]*)$/\", $var, $matches)) {\r\n\t\t\t\t\t$var = $matches[3];\r\n\t\t\t\t\t$namespace = $matches[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// return correct string (tag dependent)\r\n\t\t\tswitch ($tag) {\r\n\t\t\t\tcase 'var':\r\n\t\t\t\t\tif (empty($escape) && (!empty($this->OPTIONS['DEFAULT_ESCAPE']) && strtolower($this->OPTIONS['DEFAULT_ESCAPE']) != 'none')) {\r\n\t\t\t\t\t\t$escape = strtolower($this->OPTIONS['DEFAULT_ESCAPE']);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn '<?php '.$this->_parseVar ($wholetag, $tag, $var, @$escape, @$format, @$namespace).' ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'if':\r\n\t\t\t\t\treturn '<?php if ('. $this->_parseIf($var, @$value, @$op, @$namespace) .') { ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'unless':\r\n\t\t\t\t\t return '<?php if (!'. $this->_parseIf($var, @$value, @$op, @$namespace) .') { ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'elseif':\r\n\t\t\t\t\t return '<?php } elseif ('. $this->_parseIf($var, @$value, @$op, @$namespace) .') { ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'loop':\r\n\t\t\t\t\t return '<?php '. $this->_parseLoop($var) .'?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'comment':\r\n\t\t\t\t\tif (empty($var)) { // full open/close style comment\r\n\t\t\t\t\t\treturn '<?php /* ?>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { // just ignore tag if it was a one line comment\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'phpinclude':\r\n\t\t\t\t\tif ($this->OPTIONS['ENABLE_PHPINCLUDE']) {\r\n\t\t\t\t\t\treturn '<?php include(\\''.$file.'\\'); ?>';\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'include':\r\n\t\t\t\t\treturn '<?php $this->_getData($this->_fileSearch(\\''.$this->_parseIncludeFile($file).'\\'), 1); ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif ($this->OPTIONS['STRICT']) vlibTemplateError::raiseError('VT_ERROR_INVALID_TAG', KILL, htmlspecialchars($wholetag, ENT_QUOTES));\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}", "public function open_tag(){\n if ( ! $this->is_fragment() ) {\n return El::open( $this->tag, $this->compile_attributes_array() );\n }\n }", "public function setEscapedContentTags($openTag, $closeTag)\n\t{\n\t\t$this->setContentTags($openTag, $closeTag, true);\n\t}", "public function _open_tag() \n\t{\n\t\t$id = $this->EE->TMPL->fetch_param('id');\n\t\t$name = $this->EE->TMPL->fetch_param('name');\n\t\t$class = $this->EE->TMPL->fetch_param('class');\n\t\t\n\t\t$return = '<select';\n\t\tif($id) {\n\t\t\t$return .= ' id=\"'.$id.'\"';\n\t\t}\n\t\tif($name) {\n\t\t\t$return .= ' name=\"'.$name.'\"';\n\t\t}\n\t\tif($class) {\n\t\t\t$return .= ' class=\"'.$class.'\"';\n\t\t}\n\t\t$return .= \">\";\n\t\treturn $return;\n\t}", "private function renderOpenTag(): string\n {\n $html = '<' . $this->name;\n $attrs = $this->renderAttrs();\n if ($attrs) {\n $html .= ' ' . $attrs;\n }\n $html .= '>';\n return $html;\n }", "protected function setOpenGraphTags()\n {\n // Should be overridden by the plugin\n }", "private function _openTag($parser, $tagName, $attributes) \n {\n \n if ('Product' === $tagName) {\n \n $offset = 0;\n \n if (true === isset($this->_productTagCharPointers[($this->_productTagOccourrences - 1)])) {\n $offset = $this->_productTagCharPointers[($this->_productTagOccourrences - 1)]['end']; \n }\n \n $this->_productTagCharPointers[$this->_productTagOccourrences]['start'] = strpos($this->_xml, '<Product>', $offset);\n\n } else if ('Header' === $tagName) {\n \n $this->_headerTagCharPointers['start'] = strpos($this->_xml, '<Header>', 0);\n \n }\n \n }", "function foldOpen(&$parser, $tag, $attrs=array(), $empty = FALSE) {\r\n $this->orig_obj->{$this->orig_open_method}($parser, strtoupper($tag), $attrs, $empty);\r\n }", "private function createOpenTag()\n {\n $openTag = '<' . $this->tag;\n $openTag .= $this->id;\n $openTag .= $this->mergeAttributes();\n $openTag .= '>';\n\n return $openTag;\n }", "protected function writeOpenTag(XMLElement $element)\n\t\t{\n\t\t\t$this->append($this->tagLeftChar);\n\t\t\t$this->append($element->getTagName());\n\t\t\t\n\t\t\tforeach($element->getAttributes() as $attribute)\n\t\t\t{\n\t\t\t\t$this->writeAttribute($attribute->getName(), $attribute->getValue());\n\t\t\t}\n\n\t\t\t$this->append($this->tagRightChar);\n\t\t}", "public function getOpenTagWrapper()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getSprite($name) $name: The name of the sprite to return
function getSprite($name) { if(isset($this->_sprites[$name])) return $this->_sprites[$name]; return false; }
[ "public function getSprite()\n {\n return $this->sprite;\n }", "public function getSprite(string $label): Sprite\n {\n foreach($this->sprites AS $sprite) {\n if ($sprite->getLabel() === $label) {\n return $sprite;\n }\n }\n throw new Exception(\"Sprite does not exist: {$label}\");\n }", "public function getTileByName($name) {\n\t\treturn $this->manager->getTileByName($name);\n\t}", "function retrieveImageByName(string $name):string;", "public function getImageByName($name)\n {\n foreach ($this->items as $instance) {\n if ($instance->getName() == $name) {\n return $instance;\n }\n }\n return null;\n }", "public function getCSprite()\n {\n return $this->cSprite;\n }", "public function getImageByName($name)\r\n {\r\n $query = Image::find()->where([\r\n 'object_id' => $this->owner->primaryKey,\r\n 'handler_hash' => $this->owner->getHash()\r\n ]);\r\n $query->andWhere(['name' => $name]);\r\n // $imageQuery = Image::find();\r\n\r\n //$finder = $this->getImagesFinder(['name' => $name]);\r\n //$imageQuery->where($finder);\r\n //$imageQuery->orderBy(['is_main' => SORT_DESC, 'id' => SORT_ASC]);\r\n //$imageQuery->orderBy(['ordern' => SORT_DESC]);\r\n\r\n $img = $query->one();\r\n if (!$img) {\r\n // return Yii::$app->getModule('images')->getPlaceHolder();\r\n return NULL;\r\n }\r\n\r\n return $img;\r\n }", "function getImageProfile($name){}", "public function getByName($name);", "public function getTileByName($name) {\n\t\t$query = \"SELECT tile_id, name, title, description, version, author, default_height, default_width, custom_css_file FROM tiles where name = ?\";\n\t\t$stmt = $this->mysqli->prepare($query);\n\t\tif ($stmt === false) {\n\t\t\tthrow new RepositoryException($this->mysqli->error, $this->mysqli->errno);\n\t\t}\n\t\t$rc = $stmt->bind_param(\"s\", $name);\n\t\tif ($rc === false) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\tif (!$stmt->execute()) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\t$a = array();\n\t\t$rc = $stmt->bind_result($a[\"tileId\"], $a[\"name\"], $a[\"title\"], $a[\"description\"], $a[\"version\"], $a[\"author\"], $a[\"defaultHeight\"], $a[\"defaultWidth\"], $a[\"customCssFile\"]);\n\t\tif ($rc === false) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\n\t\tif ($stmt->fetch()) {\n\t\t\t$tile = Tile::CreateModelFromRepositoryArray($a);\n\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->close();\n\t\t\t$tile->parameters = $this->getParametersOfObjectType($tile->getObjectType());\n\t\t\t\t\n\t\t\treturn $tile;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function get($name)\n {\n foreach ($this->container as &$snipe) {\n if ($snipe->name == $name) {\n return $snipe;\n }\n }\n }", "public function getSpriteCache()\n {\n return $this->spriteImageRegistry->getSpriteCache();\n }", "public function getTileByName($name) {\n\t\tif ($name == \"\") {\n\t\t\tthrow new ParameterException(\"name is empty\");\n\t\t}\n\t\t$model = $this->repository->getTileByName($name);\n\t\tif ($model == null) {\n\t\t\tthrow new NotFoundException($name);\n\t\t}\n\t\treturn $model;\n\t}", "public function byId(int $id): ?Sprite\n {\n if (is_dir($this->directory . DIRECTORY_SEPARATOR . self::BASE_NAME . $id)) {\n return new Sprite($this->directory . DIRECTORY_SEPARATOR . self::BASE_NAME . $id);\n }\n\n $paths = glob($this->directory . DIRECTORY_SEPARATOR . self::BASE_NAME . $id . '_*');\n\n if (empty($paths)) {\n return null;\n }\n\n return new Sprite(current($paths));\n }", "public function getIconSpriteName()\n {\n return $this->get(self::ICONSPRITENAME);\n }", "public function getPlayer(string $name) {\r\n\r\n return isset($this->players[$name]) ? $this->players[$name] : null;\r\n\r\n }", "public function getImageProfile($name) {\n\t}", "public function get($name)\n {\n return $this->has($name) ? $this->assets[$name] : null;\n }", "public function getSpriteCache()\n {\n return $this->cSprite->getSpriteCache();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a $range drafts surveys starting from $start
public function findRangeOfSurveysDrafts($start , $range ,$user,$categorieId){ if($categorieId == 41 ){ return $this->getEntityManager() ->createQuery('SELECT q FROM QuizmooQuestionnaireBundle:Questionnaire q WHERE q.state = 1 and q.isTemplate is NULL and q.user = :user order by q.created DESC') ->setParameter('user', $user) ->setFirstResult(($start-1) * $range) ->setMaxResults($range) ->getResult(); }else{ return $this->getEntityManager() ->createQuery('SELECT q FROM QuizmooQuestionnaireBundle:Questionnaire q WHERE q.state = 1 and q.isTemplate is NULL and q.user = :user and q.categorie = :categorie_id order by q.created DESC') ->setParameter('user', $user) ->setParameter('categorie_id', $categorieId) ->setFirstResult(($start-1) * $range) ->setMaxResults($range) ->getResult(); } }
[ "public function getPageRange();", "public function getSearchRange() {}", "public function retrieveDateRange($start, $end) {\n\t\t\t$query =\n\t\t\t\t\"SELECT run_timestamp, keyname, content_date, score\n\t\t\t\tFROM \" . Scorcher::DBTABLE . \"\n\t\t\t\tWHERE content_date\n\t\t\t\tBETWEEN '$start'\n\t\t\t\tAND '$end'\n\t\t\t\tORDER BY content_date ASC\";\n\t\t\t$result = Scorcher::executeQuery($query);\n\t\t\techo \"<b>Date range retrieved:</b> <br />\\n\";\n\t\t\tScorcher::printRows($result);\n\t\t}", "public function createRange();", "private function _get_range()\n\t{\n\t\t// --------------------------------------\n\t\t// Initiate range array (faux object)\n\t\t// --------------------------------------\n\n\t\t$range = array(\n\t\t\t'start_date' => NULL,\n\t\t\t'start_time' => NULL,\n\t\t\t'end_date' => NULL,\n\t\t\t'end_time' => NULL\n\t\t);\n\n\t\t// --------------------------------------\n\t\t// Passed, Active and Upcoming\n\t\t// --------------------------------------\n\n\t\tforeach (array('passed', 'active', 'upcoming') AS $key)\n\t\t{\n\t\t\t$range[$key] = ! ($this->_get_param('show_'.$key) == 'no');\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Get field IDs from param\n\t\t// --------------------------------------\n\n\t\t$range['fields'] = $this->_get_event_field_ids();\n\n\t\t// --------------------------------------\n\t\t// Site IDs\n\t\t// --------------------------------------\n\n\t\t$range['site_id'] = implode('|', ee()->TMPL->site_ids);\n\n\t\t// Return it\n\t\treturn $range;\n\t}", "public static function inBounds( $start = 0, $stop = 10 )\n\t{\n\t\tglobal $wpdb;\n\t\t$posts_table = $wpdb->prefix . 'timeline';\n\t\t$results = $wpdb->get_results( \"SELECT * FROM $posts_table ORDER BY time DESC LIMIT $start, $stop\" );\n\n\t\t$trailer = new stdClass();\n\t\t$trailer->service = $wpdb->num_rows < $stop ? 'end' : 'more';\n\t\t$results[] = $trailer;\n\n\t\treturn $results;\n\t}", "public function getRange($start,$end){\n if(!is_integer($start) || $start < 0){\n throw new InvalidArgumentException(\"Start must be a non-negative integer\");\n }\n\n if(!is_integer($end) || $end < 1){\n throw new InvalidArgumentException(\"End must be a positive integer\");\n }\n\n if($start >= $end){\n throw new InvalidArgumentException(\"End must be greater than start\");\n }\n\n if($start >= $this->count()){\n throw new InvalidArgumentException(\"Start must be less than the count of the items in the Collection\");\n }\n\n if($end >= $this->count()){\n throw new InvalidArgumentException(\"End must be less than the count of the items in the Collection\");\n }\n\n\n $subsetItems = array_slice($this->items,$start,$end - 1);\n $subset = new Collection($this->objectName);\n $subset->addRange($subsetItems);\n return $subset;\n\n }", "public function range($offset = NULL, $limit = NULL);", "public function rangeStartProvider()\n {\n return [[1]];\n }", "function selectOpeningsInRange($start, $end)\n{\n require_once(\"model/dbConnector.php\");\n $start = date(\"Y-m-d H:i:s\", $start);\n $end = date(\"Y-m-d H:i:s\", $end);\n $query = 'SELECT * FROM openings WHERE end > :start OR start < :end';\n return executeQuerySelect($query, createBinds([[\":start\", $start], [\":end\", $end]]));\n}", "function getRange($start, $end)\r\n{\r\n $outputarray = array();\r\n\r\n for($i=$start; $i<=$end; ++$i)\r\n {\r\n $outputarray[]=$i;\r\n }\r\n return $outputarray;\r\n}", "public function getRangeFrom () {\n\t$data = $this->rangeFrom;\n\t return $data;\n}", "function ot_range( $start, $limit, $step = 1 ) {\n \n if ( $step < 0 )\n $step = 1;\n \n $range = range( $start, $limit, $step );\n \n foreach( $range as $k => $v ) {\n if ( strpos( $v, 'E' ) ) {\n $range[$k] = 0;\n }\n }\n \n return $range;\n}", "function range () {\n\n\t\t$offset = 2;\n\n\t\t$low_end = max(1, ($this->_page_num - $offset));\n\n\t\t$offset = 2;\n\n\t\t$high_end = min($this->_page_count, ($this->_page_num + $offset));\n\n\t\t$range = array();\n\t\tfor ( $i = $low_end; $i <= $high_end; $i++ ) {\n\t\t\tarray_push($range, $i);\n\t\t}\n\t\t\n\t\treturn($range);\n\t}", "private function range($start, $end, $step = 1) {\n if ($end - $start < $step) {\n return array();\n } else {\n return range($start, $end, $step);\n }\n }", "private function calculateRange()\n {\n $this->from = $this->pageNo * $this->perPageNo - $this->perPageNo;\n }", "function rawWikiSlices($range,$id,$rev=''){\n list($from,$to) = split('-',$range,2);\n $text = io_readFile(wikiFN($id,$rev));\n if(!$from) $from = 0;\n if(!$to) $to = strlen($text)+1;\n\n $slices[0] = substr($text,0,$from-1);\n $slices[1] = substr($text,$from-1,$to-$from);\n $slices[2] = substr($text,$to);\n\n return $slices;\n}", "function tripal_pub_AGL_range($yazc, $search_str, $start, $num_to_retrieve, $total_records) {\n\n yaz_range($yazc, 1, $total_records);\n if (!yaz_present($yazc)) {\n $error_no = yaz_errno($yazc);\n $error_msg = yaz_error($yazc);\n $additional = yaz_addinfo($yazc);\n if ($additional != $error_msg) {\n $error_msg .= \" $additional\";\n }\n drupal_set_message(\"ERROR waiting on search at AGL: ($error_no) $error_msg\", \"error\");\n watchdog('tpub_import', \"ERROR waiting on search at AGL: (%error_no) %error_msg\",\n array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);\n return array(\n 'total_records' => 0,\n 'search_str' => $search_str,\n 'pubs' => array(),\n );\n }\n if ($start + $num_to_retrieve > $total_records) {\n $num_to_retrieve = $total_records - $start;\n }\n\n $pubs = array();\n for($i = $start; $i < $start + $num_to_retrieve; $i++) {\n // retrieve the XML results\n $pub_xml = yaz_record($yazc, $i + 1, 'xml; charset=marc-8,utf-8');\n if (!$pub_xml) {\n $error_no = yaz_errno($yazc);\n $error_msg = yaz_error($yazc);\n drupal_set_message(\"ERROR retrieving records from AGL: ($error_no) $error_msg\", \"error\");\n watchdog('tpub_import', \"ERROR retrieving records from AGL: (%error_no) %error_msg\",\n array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);\n return array(\n 'total_records' => 0,\n 'search_str' => $search_str,\n 'pubs' => array(),\n );\n }\n\n // parse the pub XML\n $pub = tripal_pub_AGL_parse_pubxml($pub_xml);\n $pubs[] = $pub;\n }\n return array(\n 'total_records' => $total_records,\n 'search_str' => $search_str,\n 'pubs' => $pubs,\n );\n}", "public function getRange()\n {\n return $this->range;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the storageRequireEncryption property value. Require encryption on Android devices.
public function setStorageRequireEncryption(?bool $value): void { $this->getBackingStore()->set('storageRequireEncryption', $value); }
[ "public function setStorageRequireDeviceEncryption(?bool $value): void {\n $this->getBackingStore()->set('storageRequireDeviceEncryption', $value);\n }", "public function setStorageRequireMobileDeviceEncryption(?bool $value): void {\n $this->getBackingStore()->set('storageRequireMobileDeviceEncryption', $value);\n }", "public function setEncryptStorage($var)\n {\n GPBUtil::checkMessage($var, \\Jason\\Chain33\\Kernel\\Protobuf\\EncryptNotaryStorage::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }", "public function getStorageRequireEncryption()\n {\n if (array_key_exists(\"storageRequireEncryption\", $this->_propDict)) {\n return $this->_propDict[\"storageRequireEncryption\"];\n } else {\n return null;\n }\n }", "public function setStorageRestrictAppInstallToSystemVolume($val)\n {\n $this->_propDict[\"storageRestrictAppInstallToSystemVolume\"] = boolval($val);\n return $this;\n }", "public function setStorageRequirements($value)\n {\n $this->storageRequirements = $value;\n }", "public function setStorageRestrictAppDataToSystemVolume($val)\n {\n $this->_propDict[\"storageRestrictAppDataToSystemVolume\"] = boolval($val);\n return $this;\n }", "public function setStorageRequired($required) {\n $this->definition['storage_required'] = $required;\n return $this;\n }", "public function testSettingEncryption()\n {\n // Disable Encrypting\n $this->model->setEncrypting(false);\n $this->assertFalse($this->model->getEncrypting());\n\n // Enable Encrypting\n $this->model->setEncrypting(true);\n $this->assertTrue($this->model->getEncrypting());\n }", "function setEncryptionMode($mode)\n {\n $this->encryptionMode = $mode;\n }", "public function setBitLockerEncryptDevice(?bool $value): void {\n $this->getBackingStore()->set('bitLockerEncryptDevice', $value);\n }", "public function setEncryptShareStorage($var)\n {\n GPBUtil::checkMessage($var, \\Jason\\Chain33\\Kernel\\Protobuf\\EncryptShareNotaryStorage::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }", "public function getStorageRequireDeviceEncryption(): ?bool {\n $val = $this->getBackingStore()->get('storageRequireDeviceEncryption');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'storageRequireDeviceEncryption'\");\n }", "public function setEncryption($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->encryption !== $v) {\n $this->encryption = $v;\n $this->modifiedColumns[ApConfigTableMap::COL_ENCRYPTION] = true;\n }\n\n return $this;\n }", "public function setBitLockerEncryptDevice($val)\n {\n $this->_propDict[\"bitLockerEncryptDevice\"] = boolval($val);\n return $this;\n }", "public function set_encryption_none()\n\t{\n\t\treturn $this->set_encryption(self::ENCRYPTION_NONE);\n\t}", "public function use_encryption(): bool\n {\n return FALSE;\n }", "public function setICloudStorageDisabled($val)\n {\n $this->_propDict[\"iCloudStorageDisabled\"] = boolval($val);\n return $this;\n }", "public function setSecurityDeviceRequired($val)\n {\n $this->_propDict[\"securityDeviceRequired\"] = boolval($val);\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the Class ListID
public function getClassListID() { return $this->get('ClassRef ListID'); }
[ "public function getClassRefListID() {\n return $this->ClassRef_ListID;\n }", "public function getListID()\n {\n return $this->listID;\n }", "public function getClassId()\n {\n return $this->class_id;\n }", "public function get_listId() {\n\t\treturn $this->listId;\n\t}", "public function getListId()\n\t\t{\n\t\t\treturn $this->list_id;\n\t\t}", "public function getListid()\n {\n return $this->listid;\n }", "public function listId()\n {\n return $this->listId;\n }", "public function getListId()\n {\n return $this->list_id;\n }", "public function getClassId()\n {\n return $this->classId;\n }", "public function getListId()\n {\n return $this->listId;\n }", "public function getClassID() {\n if ($this->role->slug == 'student') {\n // Student\n return $this->cls->id ?? 0;\n } else if ($this->role->slug == 'teacher' || $this->role->slug == 'assistant-teacher') {\n // Teacher / Assistant Teacher\n return $this->classes->pluck('id')->sort()->values()->toArray();\n } else {\n return 0;\n }\n }", "public function getId_clasificacion()\r\n\t{\r\n\t\treturn($this->id_clasificacion);\r\n\t}", "public function getIdClasses() {\n return intval($this->idClasses);\n }", "public function getCustomerListID()\n\t{\n\t\treturn $this->get('CustomerRef ListID');\n\t}", "public function getClassId(): string\n {\n return $this->classId;\n }", "function __getRelatedListUniqueId() {\n\t\tglobal $adb;\n\t\treturn $adb->getUniqueID('vtiger_relatedlists');\n\t}", "public function getItemRefListID() {\n return $this->ItemRef_ListID;\n }", "public function getAccountListID()\n\t{\n\t\treturn $this->get('SalesOrPurchase AccountRef ListID');\n\t}", "public function getUlClass()\n {\n return $this->_ulClass;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Declares an association between this object and a Regions object.
public function setRegions(Regions $v = null) { if ($v === null) { $this->setRegionId(NULL); } else { $this->setRegionId($v->getId()); } $this->aRegions = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Regions object, it will not be re-added. if ($v !== null) { $v->addCoupons($this); } return $this; }
[ "public function regions()\n {\n return $this->hasOne('UpfModels\\Regions', 'id', 'region_id');\n }", "public function setRegions(?ObjectStorage $regions): void\n {\n $this->regions = $regions;\n }", "public static function addRegionsToPlaces()\r\n {\r\n $regions = Region::find()->all();\r\n\r\n foreach($regions as $region) {\r\n\r\n Place::addNewPlace([\r\n 'region' => $region->code,\r\n ]);\r\n }\r\n }", "public function regions()\n {\n return $this->belongsToMany('Villato\\Region', 'company_region_product', 'product_id', 'region_id');\n }", "public function region()\n {\n return $this->belongsTo(\\App\\Models\\Region::class);\n }", "protected \tfunction create_regObjects() {\n\t\t$this->working_node = $this->oai_pmh->addChild($this->working_node,'registryObjects');\n\t\t$this->working_node->setAttribute('xmlns',\"http://ands.org.au/standards/rif-cs/registryObjects\");\n\t\t$this->working_node->setAttribute('xmlns:xsi',\"http://www.w3.org/2001/XMLSchema-instance\");\n\t\t$this->working_node->setAttribute('xsi:schemaLocation','http://ands.org.au/standards/rif-cs/registryObjects http://services.ands.org.au/documentation/rifcs/1.2.0/schema/registryObjects.xsd');\n\t}", "protected function defineRelationships()\n {\n parent::defineRelationships();\n\n $this->declareOneToManyRelationships(\n [\n \"Organisation\" =>\n [\n \"Contacts\" => \"Contact.OrganisationID\"\n ]\n ]\n );\n }", "public function regions()\n {\n return $this->hasMany('Region', 'lot_id');\n }", "public function associate($object, Taxon $taxon);", "public function getAgencyRegions()\n {\n return $this->hasMany(AgencyRegion::className(), ['region_id' => 'id']);\n }", "public function regions()\n {\n return new Regions($this->credentials, $this->adapter);\n }", "public function regions()\n {\n return $this->hasMany(Region::class, Region::FIELD_ID_COUNTRY, self::FIELD_ID);\n }", "protected abstract function RegisterEntityMaps(Registrar $Registrar);", "function region($id) {\n\t\t$this->regions[] = intval($id);\n\t}", "public function setRegions(PropelCollection $regions, PropelPDO $con = null)\n {\n $this->clearRegions();\n $currentRegions = $this->getRegions();\n\n $this->regionsScheduledForDeletion = $currentRegions->diff($regions);\n\n foreach ($regions as $region) {\n if (!$currentRegions->contains($region)) {\n $this->doAddRegion($region);\n }\n }\n\n $this->collRegions = $regions;\n\n return $this;\n }", "public function setRegions($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Clarifai\\Internal\\_Region::class);\n $this->regions = $arr;\n\n return $this;\n }", "public function setCountriesAndRegions($val)\n {\n $this->_propDict[\"countriesAndRegions\"] = $val;\n return $this;\n }", "public function Add(IRegion $region)\n {\n \n }", "function set_regions($regions)\n {\n if (count($regions))\n {\n $this->regions = array(\n '_scripts' => array(),\n '_styles' => array(),\n );\n foreach ($regions as $key => $region) \n {\n // Regions must be arrays, but we take the burden off the template \n // developer and insure it here\n if ( ! is_array($region))\n {\n $this->add_region($region);\n }\n else {\n $this->add_region($key, $region);\n }\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sorts posts by newest source time first.
protected static function sortByNewest(Post $a, Post $b) { return strcmp($b->source_time, $a->source_time); }
[ "private function _sortPosts() {\r\n usort($this->posts, function($a, $b) {\r\n return strtotime($b->getDate()) - strtotime($a->getDate());\r\n });\r\n }", "function blog_order($sources) {\n foreach ($sources as $source => $data) {\n $dates[] = $data['posted'];\n }\n array_multisort ($dates, SORT_DESC, $sources);\n return $sources;\n}", "public function sortPosts($posts) {\n uasort($posts, function($a, $b) {\n if ($a->ts == $b->ts) {\n return 0;\n }\n return ($a->ts < $b->ts) ? 1 : -1;\n });\n return $posts;\n }", "private function sortPosts()\n {\n $this->app->writeln(\"\\n<comment>Sorting</comment>\");\n\n $cmpFn = function (Content $one, Content $other) {\n // Sort by chapters\n if ($one instanceof Doc && $other instanceof Doc) {\n if ($one->chapter == $other->chapter) {\n return 0;\n }\n\n return ($one->chapter < $other->chapter) ? -1 : 1;\n }\n\n // Sort by date\n if ($one->date == $other->date) {\n return 0;\n }\n\n return ($one->date > $other->date) ? -1 : 1;\n };\n\n foreach ($this->site->categories as $cat => &$posts) {\n // Sort posts\n usort($posts, $cmpFn);\n\n // Assign next and previous post within the category\n foreach ($posts as $key => $post) {\n if (isset($posts[$key - 1])) {\n $post->next = $posts[$key - 1];\n }\n if (isset($posts[$key + 1])) {\n $post->prev = $posts[$key + 1];\n }\n }\n }\n\n $this->app->writeln(\"Done!\");\n }", "private function sortPostsByDate($posts)\n\t{\n\t\t\n\t\tusort($posts, array($this, 'cmp'));\n\t\t\n\t\treturn $posts;\n\t}", "static public function sortDiscPostByUpdateTime($discussion_id, $ascdesc)\n {\n $posts = App\\Post::where('discussion_id', $discussion_id)->orderBy('updated_at', $ascdesc)->get();\n return $posts;\n }", "public function sort_chronologically() {\n\t\tusort($this->rssFeedArray, function ($x, $y) {\t\t\t\n\t\t\treturn strtotime($y[\"pubDate\"]) - strtotime($x[\"pubDate\"]);\n\t\t});\n\t}", "function syt_archive_sort($a, $b)\n{\n\tif($a->post_date == $b->post_date) return 0;\n\treturn ($a->post_date > $b->post_date) ? -1 : 1;\n\n}", "private function sortPostFeedElements()\n {\n foreach($this->post as $key=>$value) {\n if (is_array($value) && strpos($key, 'UNL_MediaHub_Feed') !== false) {\n usort($value, array($this,'comparePostFeedElements'));\n $this->post[$key] = $value;\n }\n }\n }", "function latest_post_load() {\n\tglobal $db;\n\t$posts = $db->array_load_all('POST');\n\tusort($posts,'sort_post_date_descend');\n\treturn isset($posts[0]) ? $posts[0]: null;\n}", "function sortByRecent($a, $b) {\r\r\r\n\tif($a[0] == 'comments') {\r\r\r\n\t\t$a_time = get_comment_date('d-m-Y H:i:s', $a[1]);\r\r\r\n\t} else {\r\r\r\n\t\t$a_time = get_the_date('d-m-Y H:i:s', $a[1]);\r\r\r\n\t}\r\r\r\n\tif($b[0] == 'comments') {\r\r\r\n\t\t$b_time = get_comment_date('d-m-Y H:i:s', $b[1]);\r\r\r\n\t} else {\r\r\r\n\t\t$b_time = get_the_date('d-m-Y H:i:s', $b[1]);\r\r\r\n\t}\r\r\r\n\t\r\r\r\n\t$a_date = date_create($a_time);\r\r\r\n\t$b_date = date_create($b_time);\r\r\r\n\r\r\r\n\tif ($a_time == $b_time) {\r\r\r\n return 0;\r\r\r\n\t}\r\r\r\n\t$interval = date_diff($a_date, $b_date)->format('%R');\r\r\r\n\r\r\r\n return ($interval == '-') ? -1 : 1;\r\r\r\n}", "function sort_media($a, $b) {\n if ($a->timestamp == $b->timestamp) return 0;\n return ($a->timestamp > $b->timestamp) ? -1 : 1;\n}", "public function sortFeeds()\n {\n uasort(\n $this->_data['feeds'],\n 'Feed::sortByTitle'\n );\n }", "function sortByDate(){\r\n \ttry{\r\n \t$sortedDate = array();\r\n \t$stmt = $this->dbh->prepare(\"SELECT * FROM Project ORDER BY PostDate ASC\");\r\n \t$stmt->execute();\r\n while ($row = $stmt->fetch())\r\n {\r\n \t\t\t\t$sortedDate[] = $row;\r\n \t\t\t}\r\n \treturn $sortedDate;\r\n }\r\n catch(PDOException $e){\r\n \techo $e->getMessage();\r\n \tdie();\r\n }\r\n }", "public function actionSort()\n {\n $params = func_get_args();\n if (empty($params)) {\n $this->_redirect('/');\n }\n $month = (isset($params[0])) ? $params[0] : null;\n $year = (isset($params[1])) ? $params[1] : null;\n $day = null;\n // is this m/d/y format?\n if (strlen($year) == 2) {\n $day = $year;\n $year = (isset($params[2])) ? $params[2] : null;\n }\n\n $this->posts = $this->_model->posts->fetchPublishedPostsByDate($year, $month, $day);\n if (empty($this->posts)) {\n $this->_view = 'notfound';\n } else {\n $this->_view = 'main';\n }\n }", "function cd_sort_podcasts( $wp_query ) {\n\n if ( is_admin() ) {\n\n \t// Get the post type from the query\n \t$post_type = $wp_query->query[ 'post_type' ];\n\n \t// If it's the podcast post type, order by date desc\n if ( 'podcast' == $post_type ) {\n $wp_query->set( 'orderby', 'date' );\n $wp_query->set( 'order', 'DESC' );\n }\n }\n}", "private function sort_posts( $post_set, $settings ) {\r\n\t\tif ( empty( $post_set ) ) {\r\n\t\t\treturn $post_set;\r\n\t\t}\r\n\r\n\t\t// sorting done with \"merge_posts\" to be more efficient\r\n\t\tif ( $settings['sortby'] === 'alternate' || $settings['sortby'] === 'api' ) {\r\n\t\t\t$return_post_set = $post_set;\r\n\t\t} elseif ( $settings['sortby'] === 'random' ) {\r\n\t\t\t/*\r\n * randomly selects posts in a random order. Cache saves posts\r\n * in this random order so paginating does not cause some posts to show up\r\n * twice or not at all\r\n */\r\n\t\t\tusort($post_set, 'sbi_rand_sort' );\r\n\t\t\t$return_post_set = $post_set;\r\n\r\n\t\t} else {\r\n\t\t\t// compares posted on dates of posts\r\n\t\t\tusort($post_set, 'sbi_date_sort' );\r\n\t\t\t$return_post_set = $post_set;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Apply a custom sorting of posts\r\n\t\t *\r\n\t\t * @param array $return_post_set Ordered set of filtered posts\r\n\t\t * @param array $settings Settings for this feed\r\n\t\t *\r\n\t\t * @since 2.1/5.2\r\n\t\t */\r\n\r\n\t\treturn apply_filters( 'sbi_sorted_posts', $return_post_set, $settings );\r\n\t}", "public function testPostsAreSorted()\n {\n $this->contextBlogWithTwoPostsOneInACategory();\n $this->post1->publish();\n sleep(1);\n $this->post2->publish();\n $this->manager->commit();\n\n $posts = $this->manager->getPosts(array('published' => true));\n $this->assertEquals(2, count($posts));\n $this->assertEquals($this->post2, $posts[0]);\n $this->assertEquals($this->post1, $posts[1]);\n }", "private function order_posts() {\n\n\t\t$posts = $this->posts;\n\t\t$orderby = $this->orderby();\n\n\t\t// --------------------------------------------\n\t\t// Loop through posts and add sorting flags\n\t\t// --------------------------------------------\n\t\tforeach ( $posts as $post => $object ) {\n\t\t\t\n\t\t\tforeach ( $orderby as $i => $args ){\n\t\t\t\t$key = 'key'.$i;\n\t\t\t\t${$key}[ $post ] = $object->{$args['key']};\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// --------------------------------------------\n\t\t// Assemble multisort parameters\n\t\t// --------------------------------------------\n\t\t$orderers = array();\n\n\t\tforeach ( $orderby as $i => $args ){\n\n\t\t\t// Names for variable variables\n\t\t\t$key = 'key'.$i;\n\t\t\t$sort = 'sort'.$i;\n\t\t\t$orderer = 'orderer'.$i;\n\n\t\t\t${$sort} = array( \n\t\t\t\t'order' => $args['order'],\n\t\t\t\t'by' => SORT_STRING\n\t\t\t\t);\n\n\t\t\t${$orderer} = array( &${$key}, &${$sort}['order'], &${$sort}['by'] );\n\t\t\t$orderers = array_merge( &$orderers, &${$orderer} );\n\n\t\t}\n\n\t\tcall_user_func_array( 'array_multisort', array_merge( &$orderers, array( &$posts ) ) );\n\t\t\n\t\t$this->posts = $posts;\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Publish the article, setting the published_at field to the current date and time
public function publish($link) { $sql = "UPDATE article SET published_at = :published_at WHERE id = :id"; $stmt = $link->prepare($sql); $stmt->bindValue(":id", $this->id, PDO::PARAM_INT); $published_at = date("Y-m-d H:i:s"); $stmt->bindValue(":published_at", $published_at, PDO::PARAM_STR); if ($stmt->execute()) { return $published_at; } }
[ "public function publish()\n {\n \n if($this->userHasPrivilege('publish'))\n {\n $this['status'] = 'published';\n if(is_null($this['published_at']))\n {\n $this['published_at'] = date('Y-m-d H:i:s');\n }\n $this->save();\n }\n }", "protected function performPublishOnModel()\n\t{\n\t\t$query = $this->newQuery()->where($this->getKeyName(), $this->getKey());\n\n\t\t$this->{$this->getPublishedAtColumn()} = $time = $this->freshTimestamp();\n\n\t\t$query->update(array($this->getPublishedAtColumn() => $this->fromDateTime($time)));\n\t}", "private function setPublishedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-published` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setPublishedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-published` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->datePublished = $row['datetime-published'];\n\t\t}\n\n\t\t// Also set the last modified datetime\n\t\t$this->setLastModifiedDateTime();\n\t}", "public function actionPublish()\n {\n Console::output('Start...');\n\n //GET news with `to publicate` status with publish date less then current datetime, and enabled/displayed\n $articlesToPublish = News::find()\n ->andWhere(['status' => News::STATUS_PUBLICATE, 'enabled' => News::ENABLED_ON])\n ->andWhere(['display' => News::DISPLAY_OFF])\n ->andWhere(['<=','public_at', date(\"Y-m-d H:i:s\")])\n ->all();\n\n //for each object do...\n //loop begin...\n foreach ($articlesToPublish as $article) {/**@var $article News*/\n\n //SET status to 'publish'\n $article->status = News::STATUS_PUBLISHED;\n //SET datetime (published_at)\n $article->published_at = date('Y-m-d H:i:s');\n //RESET datetime (public_at)\n $article->public_at = null;\n\n //SAVE selected model\n if ($article->save()) {\n Console::output(sprintf('Topic #%d has been published!', $article->id));\n //if article hasn't been saved than to throw notification\n } else {\n Console::output(sprintf('Topic #%d has NOT been published!', $article->id));\n }\n\n }\n //loop end\n\n Console::output('Finish.');\n }", "public function updatePublishedAt() {\n\t\tif (!$this->private && !$this->published_at) {\n\t\t\t$this->published_at = $this->updated_at;\n\t\t}\n\t}", "public function setPubDate() {\n if (isset($this->raw_item->pubDate)) {\n $this->vars->post_pubdate_int = strtotime( $this->raw_item->pubDate );\n $this->vars->post_pubdate = date(\"Y-m-d H:i:s\",$this->vars->post_pubdate_int);\n }\n else {\n // how do you not put pubDate in your feed?\n // accomodate this foolishness by using the current date and time\n $this->vars->post_pubdate_int = strtotime(\"now\");\n $this->vars->post_pubdate = date(\"Y-m-d H:i:s\",$this->vars->post_pubdate_int);\n }\n\n // if, for example, the pubdate is in the future give it current date and time\n $diff = time() - $this->vars->post_pubdate_int;\n if ($diff < 0) {\n $this->vars->post_pubdate_int = strtotime(\"now\");\n $this->vars->post_pubdate = date(\"Y-m-d H:i:s\",$this->vars->post_pubdate_int);\n }\n }", "public function getPublishAt();", "public function publish()\n {\n return $this->update(['published' => 1]);\n }", "public function onBeforeWrite()\n {\n if ($this->owner->ID) {\n if ($this->owner->PublishDate == '') {\n $this->owner->PublishDate = date('Y-m-d H:i:s', strtotime('now'));\n }\n }\n parent::onBeforeWrite();\n }", "function publish()\n {\n $db = eZDB::instance();\n $db->begin();\n $this->removeAll( $this->ID );\n $object = $this->attribute( 'contentobject' );\n if ( $object )\n {\n $objectRelations = $object->relatedContentObjectList( false, false, false );\n $objectRelationIDString = array();\n\n foreach( $objectRelations as $relatedObject )\n {\n $objectRelationIDString[] = $relatedObject->attribute( 'id' );\n }\n $this->setAttribute( 'object_relations', '/' . implode( '/', $objectRelationIDString ) . '/' );\n }\n\n $this->setAttribute( 'status', eZNewsletter::StatusPublished );\n $this->store();\n $db->commit();\n }", "public function generate_open_graph_article_published_time()\n {\n }", "public function publish(Article $article): Article;", "public function publish($id = NULL)\n\t\t{\n\t\t\t$this->autoRender = false;\n\n\t\t\tif (!$id) {\n\t\t\t\tthrow new NotFoundException(__('Invalid'));\n\t\t\t}\n\n\t\t\t$article = $this->Article->findById($id);\n\n\t\t\tif (!$article) {\n\t\t\t\tthrow new NotFoundException(__('Article not found'));\n\t\t\t}\n\t\t\t$published = $article['Article']['published'];\n\t\t\tif ($published == 1){\n\t\t\t\t$this->Session->setFlash(__('Failed to publish the article.'));\n\t\t\t\t\n\t\t\t\t$this->redirect(array('action' => 'view', $id));\n\t\t\t\t\n\t\t\t\texit();\n\t\t\t}\n\t\t\n\t\t\t\t$this->Article->id = $id;\n\t\t\tif ($this->Article->save(array('published' => 1))) {\n\t\t\t\t$this->Session->setFlash(__('Successfully published article.'));\n\t\t\t\t\n\t\t\t\t$this->redirect(array('action' => 'view', $id));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Failed to publish the article.'));\n\t\t\t\n\t\t\t\t$this->redirect(array('action' => 'view', $id));\n\t\t\t} \n\t\t}", "public function getPublishDate()\n\t{\n\t\treturn $this->publishDate;\n\t}", "public function updatedPublishedAt()\n {\n $this->publishedAtFormatted = Carbon::createFromFormat('Y-m-d', $this->publishedAt)->toRfc7231String();\n }", "public function actionPublish()\n {\n // Get params\n $id = $this->request->getParam('id');\n $status = (bool)$this->request->getParam('status');\n\n // Get document\n $document = Document::model()->findByPk(new \\MongoId($id));\n $document->isPublished = $status;\n $document->save();\n\n // Redirect to edit page\n $this->redirect(array('edit', 'id' => $document->_id));\n }", "public function getPublishDate() {\n\t\t\treturn get_post_time('U',false,$this->aritcle_id);\n\t\t}", "public static function admin_action_workflow_publish_now() {\n if (isset($_REQUEST['n'], $_REQUEST['post']) && wp_verify_nonce(sanitize_key($_REQUEST['n']), 'workflow_publish_now' . absint($_REQUEST['post']))) {\n $post = get_post(absint(wp_unslash($_REQUEST['post'])));\n self::publish_post($post->ID);\n wp_redirect(admin_url('edit.php?post_type=' . $post->post_type));\n }\n }", "public function published($id)\n {\n\n $article = Article::findOrFail($id);\n\n $article->published_at = Carbon::now();\n\n $article->save();\n\n Session::flash('successMessage', 'Artikel berhasil diterbitkan.'); \n\n return Redirect::route('admin.article.index');\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets whether the comparer should ignore all timestamp attributes.
public function ignoreTimestamps(bool $ignore = true): static;
[ "public function ignoreTimestamps(bool $ignore = true): void\n {\n $this->ignoreTimestamps = $ignore;\n }", "public function usesTimestamps()\n {\n return $this->timestamps;\n }", "public function ignoreDirtyForTimestamps() {\n\t\treturn [\n\t\t];\n\t}", "public function usesTimestamps()\n\t{\n\t\treturn $this->timestamps;\n\t}", "public function testSetTimestampRemovesTime()\n {\n $date = new Date();\n $date->setTimestamp(strtotime('+2 hours +2 minutes'));\n $this->assertSame(0, $date->hour);\n $this->assertSame(0, $date->minute);\n $this->assertSame(0, $date->second);\n\n $date = new Date();\n $date->timestamp(strtotime('+2 hours +2 minutes'));\n $this->assertSame(0, $date->hour);\n $this->assertSame(0, $date->minute);\n $this->assertSame(0, $date->second);\n }", "public function hasTimestampAttributes($attributes=null);", "public function shouldLogTimestamps(): bool\n {\n return $this->logTimestamps ?? config()->get('journal.timestamps', false);\n }", "private function _set_timestamps()\n {\n if($this->timestamps === TRUE || is_array($this->timestamps))\n {\n $this->_created_at_field = (is_array($this->timestamps) && isset($this->timestamps[0])) ? $this->timestamps[0] : 'created_at';\n $this->_updated_at_field = (is_array($this->timestamps) && isset($this->timestamps[1])) ? $this->timestamps[1] : 'updated_at';\n $this->_deleted_at_field = (is_array($this->timestamps) && isset($this->timestamps[2])) ? $this->timestamps[2] : 'deleted_at';\n }\n return TRUE;\n }", "public function usesTimestamps(): bool\n {\n return $this->modelTimestamps;\n }", "public function unixTimeStampsEnable()\n {\n return \\property_exists($this, 'unixTimestamps') && $this->unixTimestamps;\n }", "public function timestamp()\n\t{\n\t\treturn false;\n\t}", "public function hasTimestampEnabled(): bool\n {\n return $this->getEntityDao()->hasTimestampEnabled();\n }", "public function isTimestamped(): bool\n {\n return $this->getFormat() == static::TIMESTAMP_FORMAT;\n }", "public function setTimestamps($value = false) {\n $timestamps = array_keys(config('crud-definitions.timestamps'));\n\n if ($value === 'none') {\n $this->timestamps = false;\n } else if (empty($value)) {\n $this->timestamps = $timestamps[0];\n } else {\n if (!in_array($value, $timestamps)) {\n throw new \\Exception(\"Allowed values for timestamps are : \" . implode(', ', $timestamps));\n }\n\n $this->timestamps = $value;\n }\n }", "public function timestamps()\n {\n $this->dataFields[\"createdAt\"] = \"\\\"createdAt\\\" timestamp without time zone\";\n $this->dataFields[\"updatedAt\"] = \"\\\"updatedAt\\\" timestamp without time zone\";\n }", "public function isTimestampInAbsorbMode()\n {\n return $this->config->get('current.timestamp.mode') == Constants::MODE_ABSORB;\n }", "static public function setIgnoredCustomAttributes(array $attributes)\n {\n self::$ignored_custom_attributes = $attributes;\n }", "public function notUseNowInSelectDateTime() {\n\n $this->notUseNowInSelectDateTime = true;\n }", "public function hasTimestamp()\n {\n return $this->timestamp !== null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build item hash for item class instance
static protected function _getItemHash(BaseZF_Item_Abstract $item) { return spl_object_hash($item); }
[ "abstract public function generateHash($item);", "public function getHash()\n {\n return $this->itemHash;\n }", "function InitItems($hash=array())\n {\n }", "public function buildItemConfiguration() {\n\t\treturn $this->buildConfigurationGeneric('item');\n\t}", "public static function saveItemInstance(BaseZF_Item_Abstract $item, $itemClassName)\n {\n // get item hash\n $itemHash = self::_getItemHash($item);\n\n // do we have this item instance in registry indexed by item hash then save it\n if (\n array_key_exists($itemClassName, self::$_itemsInstances) === false ||\n array_key_exists($itemHash, self::$_itemsInstances[$itemClassName]) === false\n ) {\n self::$_itemsInstances[$itemClassName][$itemHash] = &$item;\n }\n\n // do we have this item instance in registry indexed by item id then save it\n if (array_key_exists($itemClassName, self::$_itemsIdToItemHash) == false) {\n self::$_itemsIdToItemHash[$itemClassName] = array();\n }\n\n self::$_itemsIdToItemHash[$itemClassName][$itemHash] = $item->getId();\n\n return $itemHash;\n }", "public function __construct()\n\t{\n\n\t\t$this->setClassKey(ItemPeer::CLASSKEY_2);\n\t}", "public function generateFlowsItemObject();", "protected function get_items_key($item)\n {\n }", "public function calculateHash()\n {\n $answerModel = $this->getAnswerModel('en');\n $items = [];\n foreach($answerModel->getItemsOrdered() as $item) {\n $result = $answerModel->get($item, ['label', 'type', 'multiOptions', 'parent_question', 'thClass', 'group', 'description']);\n if (array_key_exists('label', $result)) {\n $items[$item] = $result;\n }\n }\n\n $hash = md5(serialize($items));\n\n return $hash;\n }", "public function buildClass() {\n\n foreach ($this->_optionsFrom($this->_reflect) as $options) {\n\n $this->_map->add(\n $this->_makeItemFromOptions($options)\n );\n\n }\n\n }", "protected function createItem() {\n\t\treturn new stdClass;\n\t}", "abstract public function getItemClass();", "public function creer_definition_item_ws() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$item = array (\n\t\t\t\t\"delay\" => $this->getDelay (),\n\t\t\t\t\"hostId\" => $this->getHostId (),\n\t\t\t\t\"interfaceid\" => $this->getInterfaceId (),\n\t\t\t\t\"key_\" => $this->getKey_ (),\n\t\t\t\t\"name\" => $this->getName (),\n\t\t\t\t\"type\" => $this->getType (),\n\t\t\t\t\"value_type\" => $this->getValueType (),\n\t\t\t\t\"authtype\" => $this->getAuthtype (),\n\t\t\t\t\"data_type\" => $this->getDataType (),\n\t\t\t\t\"delay_flex\" => $this->getDelayFlex (),\n\t\t\t\t\"delta\" => $this->getDelta (),\n\t\t\t\t\"description\" => $this->getDescription (),\n\t\t\t\t\"formula\" => $this->getFormula (),\n\t\t\t\t\"history\" => $this->getHistory (),\n\t\t\t\t\"inventory_link\" => $this->getInventoryLink (),\n\t\t\t\t\"ipmi_sensor\" => $this->getIpmiSensor (),\n\t\t\t\t\"logtimefmt\" => $this->getLogtimefmt (),\n\t\t\t\t\"mtime\" => $this->getMtime (),\n\t\t\t\t\"multiplier\" => $this->getMultiplier (),\n\t\t\t\t\"params\" => $this->getParams (),\n\t\t\t\t\"password\" => $this->getPassword (),\n\t\t\t\t\"port\" => $this->getPort (),\n\t\t\t\t\"privatekey\" => $this->getPrivatekey (),\n\t\t\t\t\"publickey\" => $this->getPublickey (),\n\t\t\t\t\"snmp_community\" => $this->getSnmp_Community (),\n\t\t\t\t\"snmp_oid\" => $this->getSnmp_Oid (),\n\t\t\t\t\"snmpv3_authpassphrase\" => $this->getSnmpv3_Authpassphrase (),\n\t\t\t\t\"snmpv3_authprotocol\" => $this->getSnmpv3_Authprotocol (),\n\t\t\t\t\"snmpv3_contextname\" => $this->getSnmpv3_Contextname (),\n\t\t\t\t\"snmpv3_privpassphrase\" => $this->getSnmpv3_Privpassphrase (),\n\t\t\t\t\"snmpv3_privprotocol\" => $this->getSnmpv3_Privprotocol (),\n\t\t\t\t\"snmpv3_securitylevel\" => $this->getSnmpv3_Securitylevel (),\n\t\t\t\t\"snmpv3_securityname\" => $this->getSnmpv3_Securityname (),\n\t\t\t\t\"state\" => $this->getState (),\n\t\t\t\t\"status\" => $this->getStatus (),\n\t\t\t\t\"trapper_hosts\" => $this->getTrapperHosts (),\n\t\t\t\t\"trends\" => $this->getTrends (),\n\t\t\t\t\"units\" => $this->getUnits (),\n\t\t\t\t\"username\" => $this->getUsername (),\n\t\t\t\t\"valuemapid\" => $this->getValuemapId (),\n\t\t\t\t\"applications\" => $this->getApplications () \n\t\t);\n\t\t\n\t\treturn $item;\n\t}", "function getHash(){\r\n\r\n\t\t$hash = array();\r\n \r\n\t\t$hash['id'] = $this->id;\r\n\t\t$hash['user_id'] = $this->user_id;\r\n\t\t$hash['username'] = $this->username;\r\n\t\t$hash['gender'] = $this->gender;\r\n\t\t$hash['dob'] = $this->dob;\r\n\t\t$hash['country_id'] = $this->country_id;\r\n\t\t$hash['picture'] = $this->picture;\r\n\t\t$hash['link'] = $this->link;\r\n\t\t$hash['phone'] = $this->phone;\r\n\t\t$hash['likes'] = $this->likes;\r\n\t\t$hash['dislikes'] = $this->dislikes;\r\n\t\t$hash['hobbies'] = $this->hobbies;\r\n\t\t$hash['is_active'] = $this->is_active;\r\n\t\t$hash['created_on'] = $this->created_on;\r\n\t\t$hash['last_modified_on'] = $this->last_modified_on;\r\n\r\n\t\treturn $hash;\r\n\t}", "public function generateHash($force = false)\n {\n if ($this->lineItem === false) {\n $this->itemHash = null;\n\n $cartItemArray = (array) clone $this;\n\n unset($cartItemArray['discounted']);\n unset($cartItemArray['options']['qty']);\n\n foreach ($this->excludeFromHash as $option) {\n unset($cartItemArray['options'][$option]);\n }\n\n ksort($cartItemArray['options']);\n\n $this->itemHash = app(LaraCart::HASH)->hash($cartItemArray);\n } elseif ($force || empty($this->itemHash) === true) {\n $this->itemHash = app(LaraCart::RANHASH);\n }\n\n app('events')->dispatch(\n 'laracart.updateItem',\n [\n 'item' => $this,\n 'newHash' => $this->itemHash,\n ]\n );\n\n return $this->itemHash;\n }", "protected function itemClass() {\n $type = $this->type;\n if ($this->multiple)\n $type = \"container\";\n $class = \"form-item \".cssClass(\"form-type-\".$type).\" \".cssClass(\"form-name-\".$this->name);\n if ($this->icon)\n $class.= \" form-item-icon\";\n if ($this->isTextfield())\n $class.= \" form-item-textfield\";\n if ($this->required)\n $class.= \" form-item-required\";\n if ($this->error)\n $class.= \" form-item-error\";\n if ($this->sortable)\n $class.= \" form-item-sortable\";\n if ($this->childError())\n $class.= \" form-item-child-error\";\n if (!$this->multiple && !empty($this->item_class))\n $class.= \" \".$this->item_class;\n if ($this->multiple && !empty($this->wrap_class))\n $class.= \" \".$this->wrap_class;\n return $class;\n }", "public function class()\n {\n if (!isset($this->classObj)) {\n $this->classObj = new ItemClass($this->class, $this->subclass);\n }\n\n return $this->classObj;\n }", "protected function makeKey($item) {\n\n return collect($this->aggregator->getGroupingRules()[$this->level] ?? [])\n ->map(function ($field) use ($item) {\n return $this->getItemValue($item, $field);\n })\n ->toJson();\n }", "protected function _get_hash($data,$itemName='') {\n\t\tif ($itemName != '') {\n\t\t\treturn md5((string) $data[$itemName]);\n\t\t} else {\n\t\t\treturn md5((string) $data);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adding metabox for event information
function mes_add_event_info_metabox() { add_meta_box( 'mes-event-info-metabox', __( 'Event Info', 'max-event' ), 'mes_render_event_info_metabox', 'event', 'normal', 'high' ); add_meta_box( 'mes-event-info-metabox', __( 'Event Info', 'max-event' ), 'mes_render_event_info_metabox', 'event_moment', 'normal', 'high' ); }
[ "public function addMetaboxes()\n {\n $helper = Metabox::get(self::EVENT_TYPE);\n\n // Add section for the main event information\n $helper->addMetabox('event-main', 'Informationen zur Veranstaltung', 'normal');\n //$helper->addEditor('post_content', 'event-main', 'Beschreibung', 10);\n $helper->addDateTime('event-start', 'event-main', 'Beginn');\n $helper->addDateTime('event-end', 'event-main', 'Ende (optional)');\n // Add optional fields\n $helper->addTextarea('post_excerpt', 'event-main', 'Kurzbeschreibung', 65);\n $helper->addInputText('event-location', 'event-main', 'Veranstaltungsort');\n $helper->addAddressLocation('event-address', 'event-main');\n $helper->addInputText('event-map-url', 'event-main', 'Karten-Link', array(\n 'description' => 'Optionaler Link um z.B. eine Kartenansicht auf Google Maps zu verlinken'\n ));\n\n // Subscription features\n $helper->addMetabox('event-subscribe', 'Anmeldung zur Veranstaltung', 'normal');\n $helper->addCheckbox('subscribe-active', 'event-subscribe', 'Anmeldung per Formular ermöglichen');\n $helper->addDateTime('subscribe-end', 'event-subscribe', 'Anmeldeschluss');\n $helper->addInputText('subscribe-email', 'event-subscribe', 'E-Mail-Empfänger der Anmeldungen', array(\n 'description' => '\n Es wird automatisch eine E-Mail an sie, den Veranstalter geschickt. Die E-Mail enthält alle Daten zum Event sowie die Formular-Daten.<br>\n Wenn Sie eine Bestätigung an den Teilnehmer senden wollen, kann dies als Aktion im verknüpften Anmeldeformular hinterlegt werden.\n '\n ));\n // Create a dropdown of all forms that can be used as template\n $helper->addDropdown('subscribe-form-id', 'event-subscribe', 'Anmeldeformular', array(\n 'items' => $this->getFormDropdownItems(),\n 'description' => 'Anmeldeforumlare können unter \"Forumlare\" erstellt und konfiguriert werden.'\n ));\n // Subscribe text, if subscription end is reached\n $helper->addTextarea('subscribe-end-alternate-text', 'event-subscribe', 'Text nach Anmeldeschluss', 65, array(\n 'description' => 'Text, der angezeigt wird, wenn der Anmeldeschluss abgelaufen ist (Leer lassen, wenn kein Text angezeigt werden soll).'\n ));\n\n // Features to deactivate display of elements\n $helper->addMetabox('event-hiders', 'Steuerung der Darstellung', 'normal');\n $helper->addCheckbox('hide-ics-download', 'event-hiders', 'Kalender-Download ausblenden');\n $helper->addCheckbox('hide-map-url', 'event-hiders', 'Karten-Link ausblenden');\n }", "function pbd_events_meta_box() {\n\tadd_meta_box('pbd-events-meta-box', 'Event Details', 'pbd_events_create_meta_box', 'eventv1', 'normal', 'high');\n}", "function addEventsMetaBox() {\n\t\tadd_meta_box( 'wpt_events_location', 'Event Information', array( $this, 'showEvents' ), \\MavenEvents\\Core\\EventsConfig::eventTypeName, 'normal', 'default' );\n\t}", "public function events_meta_box() {\n\n\t\tadd_meta_box(\n\t\t\t'event_meta_box', // Unique ID\n 'Events', // Box title\n [$this, 'events_custom_box_html'], // Content callback\n 'cpt_event', // screen on which to show the box\n 'normal', // or 'side', 'advanced'\n 'default', // 'high', 'low'\n null // $args property of the box array\n );\n\n\t}", "function custom_meta_boxes() {\r\n\t\tglobal $post_type;\r\n\r\n\t\tif( 'event' != $post_type )\r\n\t\t\treturn;\r\n\r\n\t\tadd_meta_box('event_start', __('Event Start', 'bp-simple-events'), array( $this, 'event_start' ), 'event', 'normal', 'default');\r\n\r\n\t\tadd_meta_box('event_stop', __('Event Stop', 'bp-simple-events'), array( $this, 'event_stop' ), 'event', 'normal', 'default');\r\n\r\n\t\tadd_meta_box('event_location', __('Location', 'bp-simple-events'), array( $this, 'location_show' ), 'event', 'normal', 'default');\r\n\r\n\t\tadd_meta_box('event_url', __('URL', 'bp-simple-events'), array( $this, 'url_show' ), 'event', 'normal', 'default');\r\n\r\n\t\tadd_meta_box('event_attending', __('Attending Options', 'bp-simple-events'), array( $this, 'attending_show' ), 'event', 'normal', 'default');\r\n\r\n\t\tadd_meta_box('event_groups', __('Groups', 'bp-simple-events'), array( $this, 'groups_show' ), 'event', 'normal', 'default');\r\n\t}", "function upnrunning_em_zoom_settings_meta_boxes()\n{\n add_meta_box('em-event-zoom-settings', 'upnrunning Zoom Integration', 'upnrunning_em_zoom_settings_metabox', EM_POST_TYPE_EVENT, 'side','high');\n add_meta_box('em-event-zoom-settings', 'upnrunning Zoom Integration', 'upnrunning_em_zoom_settings_metabox', 'event-recurring', 'side','high');\n}", "function metaboxes() {\n\n\t\tadd_meta_box('uvasomdeptrfd-settings', 'Faculty Listing Settings', array( $this, 'uvasomdeptrfd_meta_box' ), $this->pagehook, 'main', 'high');\n\n\t}", "function add_group_metabox() {\r\n\r\n\t\tadd_meta_box( 'bp_group_events', _x( 'Group Events', 'group admin edit screen', 'bp-simple-events' ), array( $this, 'show_group_metabox'), get_current_screen()->id, 'side' );\r\n\r\n\t}", "function add_events_meta_boxes( $post ) {\n add_meta_box( 'fwddc_event_fb', __('Facebook Event ID', 'roots'), 'fwddc_event_meta', 'fwddc_event', 'normal', 'default', array( 'name' => 'fb', 'prefix' => 'http://facebook.com/events/' ) );\n add_meta_box( 'fwddc_event_tix', __('Ticket Link', 'roots'), 'fwddc_event_meta', 'fwddc_event', 'normal', 'default', array( 'name' => 'tix', 'prefix' => '' ) );\n add_meta_box( 'fwddc_event_date', __('Event Date', 'roots'), 'fwddc_event_meta', 'fwddc_event', 'normal', 'default', array( 'name' => 'event_date', 'prefix' => '' ) );\n}", "function add_meet_date_metabox() {\n add_meta_box( 'meet_event_date_start', 'Date et heure du Meet', 'meet_date_metabox_html', 'meet', 'side', 'default', array( 'id' => '_start') );\n}", "public function metabox() {\n\t\t\n\t\t/**\n\t\t * Initialize the metabox\n\t\t */\n\t\t$cmb = new_cmb2_box( array(\n\t\t\t'id' => 'expedia_hotel_id',\n\t\t\t'title' => __( 'Expedia Hotel ID', 'cmb2' ),\n\t\t\t'object_types' => array( 'hawaii-hotels', ), // Post type\n\t\t\t'context' => 'side',\n\t\t\t'priority' => 'high',\n\t\t\t'closed' => true,\n\t\t\t'show_names' => false, // Show field names on the left\n\t\t\t'show_on_cb' => [ $this, 'excludeFromPages' ],\n\t\t) );\n\n\t\t// Regular text field\n\t\t$cmb->add_field( array(\n\t\t\t'name' => __( 'Expedia Hotel ID', 'cmb2' ),\n\t\t\t'id' => '_expedia_hotel_id',\n\t\t\t'type' => 'text_small',\n\t\t\t'sanitization_cb' => [ $this, 'sanitize' ], // custom sanitization callback parameter\n\t\t\t'on_front' => false, // Optionally designate a field to wp-admin only\n\t\t\t'attributes' => array(\n\t\t\t\t'placeholder' => 'Must be 6 numbers',\n\t\t\t),\n\t\t\t'render_row_cb' => [$this, 'renderRow'],\n\t\t) );\n\t\t\n\t}", "function my_em_event_order_boxes(){ \n\tadd_meta_box('em-event-order', 'Order Details', 'my_em_event_order_metabox','tribe_events', 'side','low');\n}", "function metaboxes() {\n\t\tadd_meta_box('uvasom-settings', 'UVA SOM Site Settings', array( $this, 'uvasom_settings_meta_box' ), $this->pagehook, 'main', 'high');\n\t}", "function add_meta_box() {\n add_meta_box('sent_mail_details', 'Sent Mail Details', array(&$this, 'show_meta_box'), 'sent_mail', 'normal', 'high');\n }", "public function additional_information() {\n\t\t?>\n\t\t<div id=\"event-additional-information\" class=\"postbox\">\n\t\t\t<div class=\"handlediv\" title=\"Click to toggle\"><br />\n\t\t\t</div>\n\t\t\t<h3 class=\"hndle\"> <span>\n\t\t\t\tAdditional Information\t\n\t\t\t</span> </h3>\n\t\t\t<div class=\"inside\">\n\t\t\t\t<?php echo $this->nonce_input( 'additional_information_noncename' ); ?>\n\t\t\t\t<?php $this->the_textboxes(); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "function smarty_consultation_add_meta_box() {\n\t\tadd_meta_box( 'consultation_email', __('User Email'), 'smarty_consultation_email_callback', 'smarty-consulting', 'side', 'default' );\n\t\tadd_meta_box( 'consultation_price', __('Price'), 'smarty_consultation_price_callback', 'smarty-consulting', 'side', 'default' );\n\t}", "function metaboxes()\n\t{\n\t\tif('wpnukes_galleries' != $GLOBALS['post_type']) return;\n\t\t\n\t\tadd_meta_box('the_shortcode', __('Shortcode', THEME_NAME), array($this, 'shortcode'), 'wpnukes_galleries', 'side', 'high');\n\t\t\n\t\tadd_meta_box('the_image_uploader', __('Upload Images', THEME_NAME), array($this, 'upload_images'), 'wpnukes_galleries', 'normal', 'high');\n\t\tadd_meta_box('the_video_uploader', __('Upload Videos', THEME_NAME), array($this, 'upload_Videos'), 'wpnukes_galleries', 'normal', 'high');\n\t}", "function esb_tm_meta_box() {\n\n add_meta_box( 'esb_tm_testimonial_meta', __( 'Testimonial Options', 'esbtm' ), 'esb_tm_testimonial_meta_options_page', ESB_TM_POST_TYPE, 'normal', 'high' );\n \n}", "function dil_metabox_further_info() {\n add_meta_box( \n 'further-info', \n 'Further Information', \n 'dil_further_info_metabox_content', \n 'post', \n 'advanced', \n 'high' \n );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a action column.
public function addAction(array $attributes = []) { $attributes = array_merge( [ 'defaultContent' => '', 'data' => 'action', 'name' => 'action', 'title' => 'Action', 'orderable' => false, 'searchable' => false, ], $attributes ); $this->collection->push(new Column($attributes)); return $this; }
[ "protected function appendActionsColumn()\n {\n if (!$this->option('useActions')) {\n return;\n }\n\n $grid = $this;\n $callback = $this->actionsCallback;\n $column = $this->addColumn('__actions__', '操作');\n\n $column->display(function ($value) use ($grid, $column, $callback) {\n $actions = new Actions($value, $grid, $column, $this);\n\n return $actions->display($callback);\n });\n }", "protected function appendActionsColumn()\n {\n if (!$this->option('show_actions')) {\n return;\n }\n\n $this->addColumn('__actions__', trans('admin.action'))\n ->displayUsing(Actions::class, [$this->actionsCallback]);\n }", "public function addActionColumns(){\n $this->addColumnType('actions', 'object');\n AMI_Event::addHandler('on_list_body_{actions}', array($this, 'handleActionCell'), $this->getModId());\n }", "protected function _prepareActionColumn()\n {\n return $this->addColumn(\n 'action',\n array(\n 'header' => $this->__('Actions'),\n 'index' => 'id',\n 'renderer' => 'customgrid/widget_grid_column_renderer_grid_action',\n 'filter' => false,\n 'sortable' => false,\n 'getter' => 'getId',\n 'width' => '120px',\n 'actions' => array(\n array(\n 'caption' => $this->__('Edit'),\n 'field' => 'grid_id',\n 'url' => array(\n 'base' => '*/*/edit',\n ),\n 'permissions' => array(\n BL_CustomGrid_Model_Grid_Sentry::ACTION_CUSTOMIZE_COLUMNS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_ENABLE_DISABLE,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_FORCED_TYPE,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_CUSTOMIZATION_PARAMS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_DEFAULT_PARAMS_BEHAVIOURS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_ROLES_PERMISSIONS,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_ASSIGN_PROFILES,\n BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_PROFILES,\n ),\n ),\n array(\n 'caption' => $this->__('Enable'),\n 'url' => array('base' => '*/*/enable'),\n 'field' => 'grid_id',\n 'permissions' => array(BL_CustomGrid_Model_Grid_Sentry::ACTION_ENABLE_DISABLE),\n ),\n array(\n 'caption' => $this->__('Disable'),\n 'url' => array('base' => '*/*/disable'),\n 'field' => 'grid_id',\n 'permissions' => array(BL_CustomGrid_Model_Grid_Sentry::ACTION_ENABLE_DISABLE),\n ),\n array(\n 'caption' => $this->__('Delete'),\n 'confirm' => $this->__('Are you sure?'),\n 'url' => array('base' => '*/*/delete'),\n 'field' => 'grid_id',\n 'permissions' => array(BL_CustomGrid_Model_Grid_Sentry::ACTION_DELETE),\n )\n ),\n )\n );\n }", "public function setActionColumn($config = [], $key = 'actions', $title = 'Actions')\n {\n $column = new Column($key, $title, $config);\n $column->setAction(true);\n\n $this->columns->put($key, $column);\n\n return $this;\n }", "function addAction($action)\n {\n $this->_actions[] = $action;\n }", "protected function column_default_add_action( $item, $column_name, &$actions ) {\n\t\t\tparent::column_default_add_action( $item, $column_name, $actions );\n\t\t\t$wp_nonce_action = 'wpdp-export-project-' . $item['project_id'];\n\t\t\t$wp_nonce = wp_create_nonce( $wp_nonce_action );\n\t\t\t$src = '?action=wpda_export_project&project_id=' . $item['project_id'] . '&wpnonce=' . $wp_nonce;\n\t\t\t$actions['export'] = sprintf(\n\t\t\t\t'\n\t\t\t\t\t<a href=\"javascript:void(0)\" onclick=\"javascript:jQuery(\\'#stealth_mode\\').attr(\\'src\\',\\'%s\\')\" title=\"Export project\">\n\t\t\t\t\t\tExport\n\t\t\t\t\t</a>\n\t\t\t\t',\n\t\t\t\t$src\n\t\t\t);\n\t\t}", "function add_action_column($subsystem, $section, $table_data, $actions_to_use=array('pdf', 'edit', 'delete',), $additional_capabilities=array()) {\n $this->load->helper('inflector');\n\n $table_data['headings']['actions'] = 'Actions';\n $controller_folder = ($subsystem == 'site') ? '' : \"$subsystem/\";\n\n $actions_array = array();\n foreach ($actions_to_use as $label => $action) {\n switch ($action) {\n case 'pdf':\n $thislabel = (is_int($label)) ? 'PDF' : $label;\n if (has_capability(\"$subsystem:view\" . plural($section)) || (array_key_exists('pdf', $additional_capabilities) && has_capability($additional_capabilities['pdf']))) {\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.'export/export_'.$section.'/pdf/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/pdf_16.gif', 'class' => 'icon'))\n . '</a>';\n }\n break;\n case 'edit':\n $thislabel = (is_int($label)) ? 'Edit' : $label;\n if (has_capability(\"$subsystem:view\" . plural($section)) || (array_key_exists('edit', $additional_capabilities) && has_capability($additional_capabilities['edit']))) {\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.$section.'/edit/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/edit_16.gif', 'class' => 'icon'))\n . '</a>';\n }\n break;\n case 'delete':\n $thislabel = (is_int($label)) ? 'Delete' : $label;\n if (has_capability(\"$subsystem:delete\" . plural($section)) || (array_key_exists('delete', $additional_capabilities) && has_capability($additional_capabilities['delete']))) {\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.$section.'/delete/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/delete_16.gif',\n 'class' => 'icon',\n 'title' => 'Completely delete this '.$section.' and all associated records',\n 'onclick' => 'return deletethis();'))\n . '</a>';\n }\n break;\n case 'vault':\n $thislabel = (is_int($label)) ? 'Document Vault' : $label;\n // if (has_capability(\"$subsystem:delete\" . plural($section)) || (array_key_exists('delete', $additional_capabilities) && has_capability($additional_capabilities['delete']))) {\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.$section.'/vault/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/file-manager.png',\n 'class' => 'icon',\n 'title' => 'Completely delete this '.$section.' and all associated records',\n //'onclick' => 'return deletethis();'\n ))\n . '</a>';\n // }\n break;\n case 'duplicate':\n $thislabel = (is_int($label)) ? 'Duplicate' : $label;\n if (has_capability(\"$subsystem:write\" . plural($section)) || (array_key_exists('duplicate', $additional_capabilities) && has_capability($additional_capabilities['duplicate']))) {\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.$section.'/duplicate/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/copy_16.gif', 'class' => 'icon'))\n . '</a>';\n }\n break;\n case 'user_edit':\n $thislabel = (is_int($label)) ? 'Edit users' : $label;\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.$section.'/user_edit/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/user_edit.png', 'class' => 'icon'))\n . '</a>';\n\n break;\n case 'key':\n $thislabel = (is_int($label)) ? 'Edit permissions' : $label;\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.$section.'/capabilities/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/key.png', 'class' => 'icon'))\n . '</a>';\n\n break;\n default:\n $thislabel = (is_int($label)) ? $action : $label;\n $actions_array[$action] = '<a class=\"'.$action.'\" href=\"/'.$controller_folder.$section.'/'.$action.'/%d\" title=\"'.$thislabel.'\">'\n . img(array('src' => 'images/admin/icons/'.$action.'.png', 'class' => 'icon'))\n . '</a>';\n break;\n }\n }\n\n foreach ($table_data['rows'] as $key => $row) {\n $actions = '';\n\n foreach ($actions_array as $action) {\n $actions .= sprintf($action, $row[0]);\n }\n $table_data['rows'][$key][] = $actions;\n }\n\n return $table_data;\n }", "public function add(Action $action)\n {\n $this->actions[] = $action;\n }", "public function getActionColumn($action)\n {\n switch ($action) {\n default:\n case 'creating':\n return 'created_by';\n break;\n\n case 'updating':\n return 'updated_by';\n break;\n\n case 'deleting':\n return 'deleted_by';\n break;\n }\n }", "protected function column_default_add_action( $item, $column_name, &$actions ) {\n\t\t\t$form_id = '_' . self::$list_number ++;\n\t\t\t$wp_nonce_keys = '';\n\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t$wp_nonce_keys .= '-' . esc_attr( $item[ $key ] );\n\t\t\t}\n\n\t\t\t// Prepare argument schema name.\n\t\t\tif ( '' === $this->schema_name ) {\n\t\t\t\t$schema_name = '';\n\t\t\t} else {\n\t\t\t\t$schema_name = \"&schema_name={$this->schema_name}\";\n\t\t\t}\n\n\t\t\t// Prepare argument page.\n\t\t\t$page = esc_attr( $this->page );\n\n\t\t\t// Prepare argument table name.\n\t\t\t$table_name = esc_attr( $this->table_name );\n\n\t\t\t$wp_nonce_action = \"wpda-delete-{$this->table_name}$wp_nonce_keys\";\n\t\t\t$wp_nonce = wp_create_nonce( $wp_nonce_action );\n\n\t\t\t$delete_form =\n\t\t\t\t\"<form\" .\n\t\t\t\t\" id='delete_form$form_id'\" .\n\t\t\t\t\" action='?page=$page$schema_name&table_name=$table_name'\" .\n\t\t\t\t\" method='post'>\" .\n\t\t\t\t$this->get_key_input_fields( $item ) .\n\t\t\t\t$this->add_parent_args_as_string( $item ) .\n\t\t\t\t\"<input type='hidden' name='action' value='delete' />\" .\n\t\t\t\t\"<input type='hidden' name='_wpnonce' value='$wp_nonce'>\" .\n\t\t\t\t$this->page_number_item .\n\t\t\t\t\"</form>\";\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(\"#wpda_invisible_container\").append(\"<?php echo $delete_form; ?>\");\n\t\t\t</script>\n\t\t\t<?php\n\t\t\tif ( isset( $this->child['relation_nm'] ) ) {\n\t\t\t\t$link_label = __( 'Delete Relationship', 'wp-data-access' );\n\t\t\t} else {\n\t\t\t\t$link_label = __( 'Delete', 'wp-data-access' );\n\t\t\t}\n\t\t\t$warning = __(\"You are about to permanently delete these items from your site.\\\\nThis action cannot be undone.\\\\n\\\\'Cancel\\\\' to stop, \\\\'OK\\\\' to delete.\",'wp-data-access');\n\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t'<a href=\"javascript:void(0)\" \n class=\"delete\" \n onclick=\"if (confirm(\\'%s\\')) jQuery(\\'#%s\\').submit()\">\n %s\n </a>\n ',\n\t\t\t\t$warning,\n\t\t\t\t\"delete_form$form_id\",\n\t\t\t\t$link_label\n\t\t\t);\n\t\t}", "public function column_default_add_action( $item, $column_name, &$actions ) {\n\t\t\tparent::column_default_add_action( $item, $column_name, $actions );\n\n\t\t\t// Add copy publication to actions\n\t\t\t$wp_nonce_action = \"wpda-copy-{$this->table_name}\";\n\t\t\t$wp_nonce = esc_attr( wp_create_nonce( $wp_nonce_action ) );\n\t\t\t$form_id = '_' . ( self::$list_number - 1 );\n\t\t\t$copy_form =\n\t\t\t\t\"<form\" .\n\t\t\t\t\" id='copy_form$form_id'\" .\n\t\t\t\t\" action='?page=\" . esc_attr( $this->page ) . \"&table_name=\" . esc_attr( $this->table_name ) . \"'\" .\n\t\t\t\t\" method='post'>\" .\n\t\t\t\t$this->get_key_input_fields( $item ) .\n\t\t\t\t\"<input type='hidden' name='action' value='copy' />\" .\n\t\t\t\t\"<input type='hidden' name='_wpnonce' value='$wp_nonce'>\" .\n\t\t\t\t$this->page_number_item .\n\t\t\t\t\"</form>\"\n\t\t\t?>\n\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(\"#wpda_invisible_container\").append(\"<?php echo $copy_form; ?>\");\n\t\t\t</script>\n\n\t\t\t<?php\n\t\t\t$copy_warning = __( \"Copy table options set?\\\\n\\\\'Cancel\\\\' to stop, \\\\'OK\\\\' to copy.\", 'wp-data-access' );\n\t\t\t$actions['copy'] = sprintf(\n\t\t\t\t'<a href=\"javascript:void(0)\" \n\t\t\t\t\t\t\t\t\ttitle=\"%s\"\n class=\"edit\" \n onclick=\"if (confirm(\\'%s\\')) jQuery(\\'#%s\\').submit()\">\n %s\n </a>\n ',\n\t\t\t\t__( 'New publication name = old publication name + _ + n', 'wp-data-access' ),\n\t\t\t\t$copy_warning,\n\t\t\t\t\"copy_form$form_id\",\n\t\t\t\t__( 'Copy', 'wp-data-access' )\n\t\t\t);\n\n\t\t\tif ( 'rdb:' !== substr( $item['pub_schema_name'], 0, 4) ) {\n\t\t\t\t// Check if database exists. If database is not found, a test link is not provided. This might happen\n\t\t\t\t// when a user transfers a publication from one repository to another.\n\t\t\t\tif ( WPDA_Dictionary_Exist::schema_exists( $item['pub_schema_name'] ) ) {\n\t\t\t\t\t// Show publication directly from Data Publisher main page\n\t\t\t\t\tif ( 'pub_id' === $column_name ) {\n\t\t\t\t\t\tWPDA_Publisher_Form::show_publication( $item['pub_id'], $item['pub_table_name'] );\n\t\t\t\t\t}\n\t\t\t\t\t$actions['test'] = sprintf(\n\t\t\t\t\t\t'<a href=\"javascript:void(0)\"\n\t\t\t\t\t\t\t\t\ttitle=\"%s\"\n class=\"view\"\n onclick=\"jQuery(\\'#data_publisher_test_container_%s\\').toggle()\">\n %s\n </a>\n ',\n\t\t\t\t\t\t__( 'Test shortcode in popup', 'wp-data-access' ),\n\t\t\t\t\t\t$item['pub_id'],\n\t\t\t\t\t\t__( 'Test', 'wp-data-access' )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$actions['test'] = sprintf(\n\t\t\t\t\t\t'<a href=\"javascript:void(0)\"\n\t\t\t\t\t\t\t\t\ttitle=\"%s\"\n class=\"delete\">\n %s\n </a>\n ',\n\t\t\t\t\t\t__( 'ERROR: Database not found!', 'wp-data-access' ),\n\t\t\t\t\t\t__( 'Test', 'wp-data-access' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$actions['test'] = sprintf(\n\t\t\t\t\t'<a href=\"javascript:void(0)\"\n\t\t\t\t\t\t\t\t\ttitle=\"%s\"\n class=\"view\">\n %s\n </a>\n ',\n\t\t\t\t\t__( 'Shortcode test not available for remote database connections', 'wp-data-access' ),\n\t\t\t\t\t__( 'Test', 'wp-data-access' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Show publication shortcode directly from Data Publisher main page\n\t\t\t$actions['shortcode'] = sprintf(\n\t\t\t\t'<a href=\"javascript:void(0)\" \n\t\t\t\t\t\t\t\t\ttitle=\"%s\"\n class=\"view\" \n onclick=\\'prompt(\"%s\", \"[wpdataaccess pub_id=\\\"%s\\\"]\")\\'>\n %s\n </a>\n ',\n\t\t\t\t__( 'Show/copy shortcode in popup', 'wp-data-access' ),\n\t\t\t\t__( 'Publication Shortcode', 'wp-data-access' ),\n\t\t\t\t$item['pub_id'],\n\t\t\t\t__( 'Shortcode', 'wp-data-access' )\n\t\t\t);\n\t\t}", "public function adcolumnAction()\n {\n return array();\n }", "function admin_add() {\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Column->create();\n\t\t\tif ($this->Column->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('The Column name has been saved', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The Column name could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t}\n\t}", "function add_actions()\n {\n }", "public function addDecoratorColumnActions(array &$columns)\n {\n $columns['actions'] = [\n 'title' => 'label_tableheader_actions',\n 'decorator' => $this->getDecorator(),\n ];\n\n return $this;\n }", "public function addColumn( $table, $column, $type );", "protected function column_default_add_action( $item, $column_name, &$actions ) {\n\t\t\tparent::column_default_add_action( $item, $column_name, $actions );\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(\"#view_form_\" + <?php echo( self::$list_number - 1 ) ?>).append('<input type=\"hidden\" name=\"tab\" value=\"tables\">');\n\t\t\t\tjQuery(\"#edit_form_\" + <?php echo( self::$list_number - 1 ) ?>).append('<input type=\"hidden\" name=\"tab\" value=\"tables\">');\n\t\t\t\tjQuery(\"#delete_form_\" + <?php echo( self::$list_number - 1 ) ?>).append('<input type=\"hidden\" name=\"tab\" value=\"tables\">');\n\t\t\t</script>\n\t\t\t<?php\n\t\t\t// Add copy table options action.\n\t\t\t$wp_nonce_action = \"wpda-copy-{$this->table_name}\";\n\t\t\t$wp_nonce = esc_attr( wp_create_nonce( $wp_nonce_action ) );\n\t\t\t$form_id = '_' . ( self::$list_number - 1 );\n\t\t\t$copy_form =\n\t\t\t\t\"<form\" .\n\t\t\t\t\" id='copy_form$form_id'\" .\n\t\t\t\t\" action='?page=\" . esc_attr( $this->page ) . \"&schema_name=\" . esc_attr( $this->schema_name ) . \"&table_name=\" . esc_attr( $this->table_name ) . \"'\" .\n\t\t\t\t\" method='post'>\" .\n\t\t\t\t$this->get_key_input_fields( $item ) .\n\t\t\t\t$this->add_parent_args_as_string( $item ) .\n\t\t\t\t\"<input type='hidden' name='action' value='copy' />\" .\n\t\t\t\t\"<input type='hidden' name='_wpnonce' value='$wp_nonce'>\" .\n\t\t\t\t$this->page_number_item .\n\t\t\t\t\"<input type='hidden' name='tab' value='tables'>\" .\n\t\t\t\t\"</form>\"\n\t\t\t?>\n\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(\"#wpda_invisible_container\").append(\"<?php echo $copy_form; ?>\");\n\t\t\t</script>\n\n\t\t\t<?php\n\n\t\t\t// Add link to submit form.\n\t\t\t$copy_warning = __( \"Copy table options set?\\\\n\\\\'Cancel\\\\' to stop, \\\\'OK\\\\' to copy.\", 'wp-data-access' );\n\t\t\t$actions['copy'] = sprintf(\n\t\t\t\t'<a href=\"javascript:void(0)\" \n class=\"edit\" \n onclick=\"if (confirm(\\'%s\\')) jQuery(\\'#%s\\').submit()\">\n %s\n </a>\n ',\n\t\t\t\t$copy_warning,\n\t\t\t\t\"copy_form$form_id\",\n\t\t\t\t__( 'Copy', 'wp-data-access' )\n\t\t\t);\n\t\t}", "public function actions(Closure $actions): Column\n {\n $this->data('dt-actions', $actions)->class('visible-on-hover text-nowrap')->notSearchable()->notOrderable();\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the Schools model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Schools::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.')); }
[ "protected function findModel($id)\n {\n if (($model = Schools::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\t\tif (($model = StudentWorks::findOne($id)) !== NULL) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "public function getSchool()\n \t{\n $school_id = $this->school_id;\n if($school_id == null) return null;\n $this->load->model(\"Schools_model\");\n return Schools_model::LoadWithData(Schools_model::LoadById($school_id));\n \t}", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = School::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = WpIschoolSchool::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SchoolAdmin::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "protected function findModel($id)\n {\n if (($model = SchoolScore::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Certificate::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = ContentSource::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel()\n {\n $id = Yii::$app->request->get('id');\n $id = $id ? $id : Yii::$app->request->post('id');\n if (($model = ShipAddress::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function getById($id): School {\n return School::findOrFail($id);\n }", "protected function findModel2($id) \n { \n if (($model = TrainingClassStudentCertificate::findOne($id)) !== null) { \n return $model; \n } else { \n throw new NotFoundHttpException(Yii::t('app','SYSTEM_TEXT_PAGE_NOT_FOUND')); \n } \n }", "protected function findModel($id)\n {\n if (($model = SchoolDetails::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\r\n\t\tif (($model = Staff::findOne ( $id )) !== null) {\r\n\t\t\treturn $model;\r\n\t\t} else {\r\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\r\n\t\t}\r\n\t}", "protected function findModel($id)\n\t{\n\t\tif (($model = Schedules::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}", "protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id_riwayat)\n {\n if (($model = Riwayat::findOne($id_riwayat)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the salt that was originally used to encode the password. This can return null if the password was not encoded using a salt.
public function getSalt() { // you *may* need a real salt depending on your encoder // see section on salt below return null; }
[ "protected function getPasswordSalt() {\n\t\treturn $this->_salt;\n\t}", "public function salt()\n\t{\n\t\treturn $this->salt;\n\t}", "public function getSalt()\r\n {\r\n return $this->salt;\r\n }", "public function get_salt(){\n return $this->_get_session('salt');\n }", "public function getPasswordSalt(){\n\n\t global $db;\n\n\t #obtain password salt.\n $db->SQL = \"SELECT salt FROM ebb_users WHERE Username='\".$this->user.\"' LIMIT 1\";\n\t\t$pwdSlt = $db->fetchResults();\n\n\t\treturn($pwdSlt['salt']);\n\t}", "static public function getSalt()\n {\n static $salt = null;\n if(is_null($salt))\n {\n $config = Zend_Registry::get('config');\n if($config !== false)\n {\n $salt = @$config->superuser->salt;\n }\n }\n return $salt;\n }", "public static function salt() {\n return static::get('app.salt');\n }", "public function getSalt()\r\n {\r\n $time = Carbon::now()->subMinutes(3);\r\n $time->second(0);\r\n $salt = $time->getTimestamp();\r\n\r\n return $salt;\r\n }", "protected function getStoredSalt($salt)\n {\n if (!strncmp('$', $salt, 1)) {\n if (!strncmp($this->getSetting(), $salt, strlen($this->getSetting()))) {\n $saltParts = GeneralUtility::trimExplode('$', $salt, 4);\n $salt = $saltParts[2];\n }\n }\n return $this->base64Decode($salt);\n }", "private function _get_salt(){\n return bin2hex(openssl_random_pseudo_bytes(32));\n }", "public function getUserSalt() : string {\n\t\treturn($this->userSalt);\n\t}", "public function getSalt(){\n\t\t\t$email=$this->email;\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$query = \"Select salt from $this->table where email='$email'\";\n\t\t\t\t$result = mysql_query($query);\n\t\t\t\t\n\t\t\t\tif(mysql_num_rows($result)>0){\n\t\t\t\t\twhile($row=mysql_fetch_assoc($result)){\n\t\t\t\t\t\treturn $row['salt'];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}catch(Exception $ex){\n\t\t\t\treturn \"F:\".$ex;\n\t\t\t}\n\t\t}", "public function wp_auth_salt(){\n\n return $this->oCRNRSTN_ENV->wp_auth_salt();\n\n }", "function getSalt() { return 'Zk1*<@]]$4bU;5=i9#(pqCL/&$paoKj.Q7g-(D==Z)C[?Ih(Y]%}0xF/u Dc`SlU'; }", "function getSalt(){\r\n\t\treturn \"sticeCraftAdministrationS@lT123\";\r\n\t}", "public function getTokenSalt()\n {\n return $this->_tokenSalt;\n }", "public function getFosUserSalt() {\n $query = $this->em\n ->createQueryBuilder()\n ->select('p.salt')\n ->from('ESERVMAINSecurityBundle:User', 'p')\n ->where('p.username = :u')\n ->setParameter('u', $this->username)\n ->getQuery()->getSingleResult();\n\n return $query['salt'];\n }", "public function getSalt() {\n\t\t}", "public function getProfileSalt() {\n\t\treturn ($this->profileSalt);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the ignoreVersionDetection A boolean to control whether the app's version will be used to detect the app after it is installed on a device. Set this to true for Windows Mobile MSI Line of Business (LoB) apps that use a self update feature.
public function getIgnoreVersionDetection() { if (array_key_exists("ignoreVersionDetection", $this->_propDict)) { return $this->_propDict["ignoreVersionDetection"]; } else { return null; } }
[ "public function setIgnoreVersionDetection($val)\n {\n $this->_propDict[\"ignoreVersionDetection\"] = boolval($val);\n return $this;\n }", "public function getAntiMalwareVersion()\n {\n if (array_key_exists(\"antiMalwareVersion\", $this->_propDict)) {\n return $this->_propDict[\"antiMalwareVersion\"];\n } else {\n return null;\n }\n }", "public function getAppVersion()\n {\n $version = false;\n\n $onlineVer = $this->configs['ONLINE_VER'];\n $previewVer = $this->configs['PREVIEW_VER'];\n\n if ($onlineVer == $previewVer) {\n // not in publishing process\n $throttleRate = $this->configs['THROTTLE_PERCENT'];\n if ($throttleRate == 0 // no throttle\n || $this->checkThrottle($throttleRate) // passed the throttle\n ) {\n $version = $onlineVer;\n }\n } else {\n // in publishing process\n if ($this->checkThrottle($this->configs['PREVIEW_PERCENT'])) {\n $version = $previewVer; // pass the throttle means preview player\n } else {\n $version = $onlineVer;\n }\n }\n\n return $version;\n }", "public function getBackwardsCompatibilityIgnoreRules()\n\t{\n\t\treturn $this->getConfigSetting('bc_ignore', array());\n\t}", "public function getIgnoreVersionDetection(): ?bool {\n $val = $this->getBackingStore()->get('ignoreVersionDetection');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'ignoreVersionDetection'\");\n }", "public function ignorePlatformReqs()\n {\n return $this->getBoolean('ignore-platform-reqs');\n }", "public function getExcludeApplications()\n {\n if (array_key_exists(\"excludeApplications\", $this->_propDict)) {\n return $this->_propDict[\"excludeApplications\"];\n } else {\n return null;\n }\n }", "public function hasAppVersion()\n {\n return $this->app_version !== null;\n }", "public function auto_detect_exclude(){\n return $this->auto_detect_exclude;\n }", "public function getImportIgnore() {\n return $this->getThirdPartySetting('config_import_ignore', 'import_ignore', $this->import_ignore);\n }", "public function getIgnoreDeprecatedWarnings()\n {\n return $this->ionSwitches['ignore-deprecated-warnings'];\n }", "public function getRestoreFromAndroidDisabled()\n {\n if (array_key_exists(\"restoreFromAndroidDisabled\", $this->_propDict)) {\n return $this->_propDict[\"restoreFromAndroidDisabled\"];\n } else {\n return null;\n }\n }", "function getIgnoreList(){\n\t App::import('Lib','Survey.SurveyUtil');\n\t return SurveyUtil::getConfig('ignore');\n\t}", "public function getAppVersion()\n {\n if (array_key_exists(\"appVersion\", $this->_propDict)) {\n return $this->_propDict[\"appVersion\"];\n } else {\n return null;\n }\n }", "public function getMinimumWipeAppVersion()\n {\n if (array_key_exists(\"minimumWipeAppVersion\", $this->_propDict)) {\n return $this->_propDict[\"minimumWipeAppVersion\"];\n } else {\n return null;\n }\n }", "public function getYiiAppExclude()\n {\n if (!empty($this->yiiAppExclude)) {\n return $this->yiiAppExclude;\n }\n return ArrayHelper::merge(\n $this->getYiiAppBasicExclude(),\n $this->getYiiAppAdvancedExclude()\n );\n }", "public static function shouldIgnoreBotRequests(): bool\n {\n return config('laravel-server-analytics.ignore_bot_requests');\n }", "public function getBypassDirSyncOverridesEnabled()\n {\n if (array_key_exists(\"bypassDirSyncOverridesEnabled\", $this->_propDict)) {\n return $this->_propDict[\"bypassDirSyncOverridesEnabled\"];\n } else {\n return null;\n }\n }", "public function getIgnore()\n {\n return $this->ignore;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if 'Imgcode' property is set, false otherwise
public function hasImgcode() { return $this->get(self::IMGCODE) !== null; }
[ "public function isValidImage() : bool\n {\n return $this->loadImageInfo();\n }", "public function hasImgStatus()\n {\n return $this->get(self::IMGSTATUS) !== null;\n }", "public function getHasImage(){\n\t\tforeach ($this->getAttributes() as $attribute){\n\t\t\tif ($attribute->getType() == 'image'){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function isValidImage() : bool\n {\n return $this->valid;\n }", "public function isImage()\r\n {\r\n if ($this->_reaktorfile->getIdentifier() == \"image\")\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "public function isImage(){\n\t\treturn $this->_isImage;\n\t}", "public function isCode()\n {\n return $this->_type == self::PROPERTY_CODE;\n }", "public function hasImage();", "public static function hasImageIdentify()\n {\n return !is_null( self::getImageIdentifyExecutable() );\n }", "public function isImage()\n {\n return substr($this->type, 0, 5) == 'image';\n }", "public function isCode(): bool\n {\n return 0 === strcasecmp($this->name, 'code');\n }", "public function isImage(){\n $ok = true;\n $fileInfo = new finfo(FILEINFO_MIME_TYPE);\n if(false === $ext = array_search($fileInfo->file($this->tmpFile), $this->imgMime, true)){\n $ok = false;\n }\n return $ok;\n }", "public function isImage()\n {\n return in_array($this->fileextension, [\n 'jpg',\n 'jpeg',\n 'JPG',\n 'JPEG',\n 'png',\n 'PNG',\n 'gif',\n 'GIF',\n ]);\n }", "public function validate_image(){\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public function isValidImage() : bool\n {\n return $this->file->isValidImage();\n }", "public function getHasImage();", "function is_picture(){\t\nreturn (com() == \"image\");\t\n}", "public function hasFeatureImage(): bool\n {\n return !empty($this->getFeatureImageId());\n }", "public function isImage(): bool\n\t{\n\t\treturn str_starts_with($this->getMimeType(), 'image');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read contents from a gzipfile
function gzip_readFileContent($fName,$fileSize) { $content = null; $zp = gzopen($fName, "rb9"); if ($zp) { $content = gzread($zp,$fileSize); gzclose($zp); } return $content; }
[ "private function getContent($file)\n {\n $content = file_get_contents($file->getPathname());\n if ($file->getClientMimeType() == 'application/gzip') {\n $gzip = gzopen($file->getPathname(), 'rb');\n $content = '';\n while(!gzeof($gzip)) {\n $buffer_size = 51200;\n $content .= gzread($gzip, $buffer_size);\n\n }\n }\n\n return $content;\n }", "function gzfile_get_contents($filename, $use_include_path = 0) {\n //File does not exist\n if (!@file_exists($filename)) {\n return false;\n }\n\n //Read and implode array to produce a one line string\n $data = gzfile($filename, $use_include_path);\n $data = implode($data);\n return $data;\n }", "function gzfile($filename)\n{\n\treturn array();\n}", "public function gzip();", "function gz_eof ($zp)\n{\n return gzeof($zp);\n}", "function bzfile($file){\n $bz = bzopen($file,\"r\");\n $str = '';\n while (!feof($bz)){\n //8192 seems to be the maximum buffersize?\n $str = $str . bzread($bz,8192);\n }\n bzclose($bz);\n return $str;\n}", "function read_tgz_file($gzfilename, $destination, $single_file = false, $overwrite = false, $files_to_extract = null)\n{\n\tif (substr($gzfilename, 0, 7) == 'http://')\n\t{\n\t\t$data = fetch_web_data($gzfilename);\n\n\t\tif ($data === false)\n\t\t\treturn false;\n\t}\n\telse\n\t{\n\t\t$data = @file_get_contents($gzfilename);\n\n\t\tif ($data === false)\n\t\t\treturn false;\n\t}\n\n\treturn read_tgz_data($data, $destination, $single_file, $overwrite, $files_to_extract);\n}", "function proxy_cache_stream ($qs)\n{\n\t$fn = $qs.'.gz';\n\tif (file_exists($fn))\n\t{\n\t\t$fp = gzopen($fn, 'r');\n\t\twhile(!gzeof($fp)) echo gzgets($fp);\n\t\tgzclose($fp);\n\t}\n\texit();\n}", "function load_json($fn) {\n $gz = file_get_contents($fn);\n if ($gz) {\n $json = gzuncompress($gz);\n $data = json_decode($json, true);\n return $data;\n } else {\n echo \"[-] Cant load file $fn\\n\";\n return false;\n }\n}", "public function gzdecodeFileContentsIfNecessary(string $url, $contents): string\n {\n if (substr_compare($url, '.gz', strlen($url) - strlen('.gz'), strlen('.gz')) === 0) {\n\n $this->logger->debug('Got a file ending in .gz. Trying to gzdecode.');\n\n $isGzip = (0 === mb_strpos($contents, \"\\x1f\" . \"\\x8b\" . \"\\x08\", 0, 'US-ASCII'));\n\n if ($isGzip) {\n $contents = gzdecode($contents);\n } else {\n $this->logger->info(\n 'Skipped gzdecoding as the file is not a real gzipped file although ending in .gz.'\n );\n }\n }\n\n return $contents;\n }", "function gzseek ($zp, $offset) {}", "public function getFileContents($file);", "public function gzReadDeCompressed(string $source)\n {\n if ('gz' !== rex_file::extension($source)) {\n throw new Exception('Expecting a file with .gz suffix');\n }\n\n $str = '';\n if ($fpIn = gzopen($source, 'r')) {\n while (!gzeof($fpIn)) {\n $str .= gzgets($fpIn, 1024 * 512);\n }\n gzclose($fpIn);\n } else {\n return false;\n }\n\n return $str;\n }", "function make_download_file_unpack_gzip($filename, $download_location) {\n // Find out where contents will end up. Retrieve last column of output using awk.\n drush_shell_exec(\"gzip --list %s\", $filename);\n $info = drush_shell_exec_output();\n if ($info) {\n foreach ($info as $line) {\n $matches = array();\n preg_match('/^\\s+[0-9]+\\s+[0-9-]+\\s+[0-9\\.%]+\\s+(.*)$/', $line, $matches);\n if (isset($matches[1])) {\n $file = $matches[1];\n break;\n }\n }\n if (isset($file)) {\n // Unzip it and then delete the tar file.\n drush_shell_exec('gzip -d %s', $filename);\n return make_download_file_unpack_tar($file, $download_location);\n }\n }\n}", "function gz_decode ($data, $length = null)\n{\n return gzdecode($data, $length);\n}", "private static function getContents($fh)\n\t{\n\t\tfseek($fh, 0, SEEK_SET);\n\t\t$data = fread($fh, 10000);\n\t\tfclose($fh);\n\t\treturn $data;\n\t}", "function xml_read_archive( $filename )\n\t{\n\t\tif ( file_exists( $filename ) )\n\t\t{\n\t\t\tif ( strstr( $filename, '.gz' ) )\n\t\t\t{\n\t\t\t\tif ( $FH = @gzopen( $filename, 'r' ) )\n\t\t\t\t{\n\t\t\t\t\t$data = @gzread( $FH, $filename );\n\t\t\t\t\t@gzclose( $FH );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error_number = '005';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $FH = @fopen( $filename, 'r' ) )\n\t\t\t\t{\n\t\t\t\t\t$data = @fread( $FH, filesize( $filename ) );\n\t\t\t\t\t@fclose( $FH );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error_number = '005';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->xml_read_archive_data( $data );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error_number = '001';\n\t\t}\n\t}", "abstract public function decompress($content);", "public function gz_file($sourcefile) {\n // read a file\n $content \t= $this->read($sourcefile);\n\t\t$destfile \t= $sourcefile.'.gz';\n\n\t\t// open file for writing\n $zp \t\t= gzopen($destfile, \"wb\");\n\n\t\tgzwrite($zp, $content); // write string to file\n gzclose($zp); // close file\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ USAGE: DELETE a Doctor Email
public function deleteDoctorEmail($email_id){ $db = Database::getDB(); $query = "DELETE FROM doctor_email where id = :email_id "; $statement = $db->prepare($query); $statement->bindValue(':email_id', $email_id); $statement->execute(); $statement->closeCursor(); }
[ "function m_emailDelete()\n\t{\n\t\tif(isset($this->request['id']) && !empty($this->request['id']))\n\t\t{\t\t\t\n\t\t\t\t$this->obDb->query = \"DELETE FROM \".EMAILS.\" WHERE iMailid_PK =\".$this->request['id'];\n\t\t\t\t$this->obDb->updateQuery();\n\t\t}\n\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"sales/adminindex.php?action=email.home&msg=3\");\t\n\t\texit;\t\n\t}", "function deleteEmail() {\r\n\t\t\r\n\t\t$email = new Email($this->db);\r\n\t\t$email->deleteEmail($this->f3->get('PARAMS.messageid'));\r\n\t\t\t\t\r\n\t\t$this->f3->reroute('/inbox');\r\n\r\n\t}", "public function delete() {\r\n\t\tdebug(\"delete\");\n\t\tdebug($_GET['id'].\" \".$_GET['email'].\" \".$_GET['profiletype']);\n\t\t\r\n\t\t$this->deleteAnnouncements($_GET['id']);\n\t\t$this->delete_Applies($_GET['id']);\r\n\t\t$this->deleteUser($_GET['id']);\r\n\t\n\t\t$email = $_GET['email'];\n\t\t$mailman = new EmailNotification($email,_(\"Your association has been removed\"),_(\"Your association has been removed.\"));\n\t\t$mailman->send();\n\t\t\r\n\t\t$this->redirectTo(\"?action=admin\");\r\n\t}", "public function deleted(ContatoEmail $contatoEmail)\n {\n //\n }", "public function deleteAllDoctorEmail($doctor_id){\n $db = Database::getDB();\n \n $query = \"DELETE FROM doctor_email where doctor_id = :doctor_id \"; \n \n $statement = $db->prepare($query); \n $statement->bindValue(':doctor_id', $doctor_id); \n $statement->execute(); \n $statement->closeCursor(); \n }", "function email_deleteData($vPageID) {\n\tglobal $Auth;\n\t\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\n\t## data connection\n\t$db_connectionMain = new DB_Sql();\n\t## get all text elements\n\t$query = \"DELETE FROM \".PAGE_LINK.\" WHERE page_id='$vPageID' AND client_id='$client_id'\";\n\t$result_pointer = $db_connectionMain->query($query);\n}", "function deleteNewsletterEmail( $sEmail ){\n $oSql = Sql::getInstance( );\n $oSql->query( 'DELETE FROM newsletter WHERE sEmail = '.$oSql->quote( $sEmail ) );\n}", "function delspamer()\n{\n $del = $_REQUEST['spamdel'];\n $query = \"DELETE FROM \".$this->db->get('SpamDB').\" WHERE SpamEmail=? AND Account=?\";\n\t$data = array( $del, $this->auth->get_account() );\n\t$this->db->sqldo($query, $data);\n}", "function clients_email_deleteData($ctlData,$clientID) {\t\n\t## the email element is stored within the main client table-\n\t## so we don't need to delete anything- it will be gone already\n}", "public function sent_delete() {\n if(!Auth::LoggedIn()) {\n $this->set('message', 'You must be logged in to access this feature!');\n $this->render('core_error');\n return;\n }\n $mailid = $_GET['mailid'];\n MailData::deletesentmailitem($mailid);\n $this->sent();\n }", "public function delete(){\n\t\t\tif($_SERVER['REQUEST_METHOD'] == \"POST\"){\n\t\t\t\tif($this->session->userdata(\"adminLoggedin\") == true){\n\t\t\t\t\tif($this->attendees->view_where(array(\"attendeeID\" => $this->input->post(\"inputAttendeeID\")))->num_rows()>0){\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\"attendeeID\" => $this->input->post(\"inputAttendeeID\")\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->attendees->delete($data);\n\t\t\t\t\t\techo json_encode(array(\n\t\t\t\t\t\t\t\t\"success\" => true,\n\t\t\t\t\t\t\t\t\"responseMsg\" => \"Attendee has been removed!\"\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\techo json_encode(array(\n\t\t\t\t\t\t\t\t\"success\" => false,\n\t\t\t\t\t\t\t\t\"responseMsg\" => \"No such Attendee exists!\"\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tshow_404();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshow_404();\n\t\t\t}\n\t\t}", "public function deleteUserByMail() {\n\t\t$this->load->model ( 'expressly/migrator' );\n\t\t\n\t\tif ($this->model_expressly_migrator->isAuthorizedRequest ( getallheaders () )) {\n\t\t\t$this->load->model ( 'account/customer' );\n\t\t\t\n\t\t\t$customer = $this->model_account_customer->getCustomerByEmail ( $this->request->get ['user_mail'] );\n\t\t\t$this->model_expressly_migrator->deleteCustomer ( $customer ['customer_id'] );\n\t\t} else {\n\t\t\theader(\"HTTP/1.0 401 Unauthorized\");\n\t\t}\n\t}", "protected function _mailDelete()\n\t{\n\t\t$id = intval( $this->request['id'] );\n\t\t\n\t\t$active = $this->DB->buildAndFetch( array( 'select' => 'mail_id', 'from' => 'bulk_mail', 'where' => 'mail_active=1 AND mail_id <>' . $id ) );\n\t\t\n\t\tif( !$active['mail_id'] )\n\t\t{\n\t\t\t$this->DB->update( 'task_manager', array( 'task_enabled' => 0 ), \"task_key='bulkmail'\" );\n\t\t}\n\t\t\n\t\t$this->DB->delete( 'bulk_mail', 'mail_id=' . $id );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t$this->registry->output->global_message = $this->lang->words['b_deleted'];\n\t\t$this->_mailStart();\n\t}", "function subscription_delete($email, $list_id)\r\n {\r\n return $this->call_api(Http::DELETE, 'lists/'. $list_id . '/subscribers/' . $email . '/');\r\n }", "public function deleted(Email $email)\n {\n session()->flash('success',\"اطلاعات با موفقیت حذف شد. \");\n\n }", "public function deleteContact(){\n\t\tif(!$this->hasPermission && !$this->user->isAdmin) {\n $this->load->view('errors/forbidden.php');\n return;\n }\n\n\t\tif($this->emailModel->delete('contacts',$this->input->post('id'))){\n\t\t\techo \"success\";\n\t\t}else{\n\t\t\techo \"warning\";\n\t\t}\n\t}", "function delete_email_confirmation($id)\n {\n return $this->db->delete('email_confirmations',array('id'=>$id));\n }", "public function delete_mail($domain, $email){\n $input=array(\n 'module' => 'Email',\n 'function' => 'delpop',\n 'domain' => $domain,\n 'email' => $email\n );\n $query=$this->build_query($input);\n $raw=$this->query($query);\n $ob=json_decode($raw, false);\n $status=$ob->cpanelresult->data[0]->result;\n \n if ($status==1) { \n return TRUE;\n } else {\n return FALSE;\n }\n }", "function deleteVisitor($email)\n{\n $sql = sprintf(\"DELETE FROM visitors WHERE email = %s\", prepareString($email));\n $sth = $connection->prepare($sql);\n $sth->execute();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch unread count Grab the number of items truly unread This is called upon by 'markRead' when the number of items left hits zero (or less).
public function fetchUnreadCount( $data, $readItems, $lastReset ) { $count = 0; $lastItem = 0; $approved = ' AND entry_status != \'draft\''; $readItems = is_array( $readItems ) ? $readItems : array( 0 ); /* Fix up approved properly now */ if ( $this->registry->isClassLoaded('blogFunctions') ) { $blog = $this->registry->getClass('blogFunctions')->getActiveBlog(); if ( $blog['blog_id'] AND $this->memberData['member_id'] ) { if ( $this->registry->getClass('blogFunctions')->ownsBlog( $blog, $this->memberData ) ) { $approved = ''; } else if ( $this->memberData['g_is_supmod'] OR $this->memberData['_blogmod']['moderate_can_view_draft'] ) { $approved = ''; } } } if ( $data['blogID'] ) { $_count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as cnt, MIN(entry_last_update) as lastItem', 'from' => 'blog_entries', 'where' => "blog_id=" . intval( $data['blogID'] ) . " {$approved} AND entry_id NOT IN(".implode(",",array_keys($readItems)).") AND entry_last_update > ".intval($lastReset) ) ); $count = intval( $_count['cnt'] ); $lastItem = intval( $_count['lastItem'] ); } return array( 'count' => $count, 'lastItem' => $lastItem ); }
[ "public static function unreadCount()\n {\n return self::where('user_id', user()->id)->count();\n }", "public function countUnread()\n {\n $user = Auth::user();\n $adminId = $user->adminId();\n $condict = [\n ['user_id', $adminId],\n ['unread', true]\n ];\n $commentCount = (new CommentRespository($adminId))->getCount($condict);\n $messageCount = (new MessageRespository($adminId))->getCount($condict);\n return $commentCount + $messageCount;\n }", "public static function unread_message_count() {\n\t\t$db = instance(':db');\n\t\t$sql = instance(':sel-sql');\n\t\t\n\t\t$query = $db->prepare($sql->getUnreadMessageCount);\n\t\t$query->execute(array('id' => UserSession::userid()));\n\t\t$query->setFetchMode(\\PDO::FETCH_OBJ);\n\t\t$result = $query->fetch();\n\t\treturn ($result->messageCount > 0)?$result->messageCount:'';\n\t}", "public static function getUnreadCount() {\n\n\t\t# Get number of messages\n\t\treturn sky::$db->make(\"messages\")\n\t\t\t->where(\"to\", auth::$me[\"id\"], \"private\")\n\t\t\t->where(\"read\", 0)\n\t\t\t->records(\"COUNT(*)\")\n\t\t\t->get(\"value\");\n\n\t}", "public function countUnreadNotification()\n {\n return $this->model->ofLoggedInUser()->where('is_read', false)->count();\n }", "public function unreadMessageCount()\n {\n $user = $this->securityContext->getToken()->getUser();\n\n $unreadMessageCount = $this->registryHelper->findOneRegistryForUserByIdId($user);\n\n if ($unreadMessageCount == null) {\n return 0;\n }\n\n return $unreadMessageCount->getCachedUnreadMessageCount();\n }", "public function unreadCount()\n {\n $messages = Message::where(['displayed' => 0, 'recipient_id' => $this->id])->cursor();\n\n $user_ids = [];\n $users = [];\n\n foreach($messages as $message)\n {\n if(!in_array($message->sender_id, $user_ids))\n $user_ids[] = $message->sender_id;\n }\n foreach($user_ids as $id)\n {\n $users[] = User::find($id);\n }\n $users = array_filter($users, function($id) {\n return ($this->hasContact($id));\n });\n\n return count($users);\n }", "public function countUnreadNotifications() {\n return $this->notifications()->where('read', false)->count();\n }", "public function countUnseenNewsItems(){\n return $this->newsModel->countUnseenNewsItems();\n }", "public static function getCountUnreadMessages(){\n $count = \\DB::table('messages')\n ->where('status', 3)\n ->get()\n ->count();\n return $count;\n }", "public function getUnreadNumber() {\n $userLoggedIn = $this->user_obj->getUsername();\n \n $query = mysqli_query($this->con, \"SELECT * FROM messages WHERE viewed='no' AND user_to='$userLoggedIn'\");\n\n return mysqli_num_rows($query);\n }", "public function getUnreadNotificationCount()\n {\n return $this->_notificationList->getSize();\n }", "public function countUnread(): int\n {\n $unread = 0;\n foreach ($this->_Postings as $posting) {\n if ($posting->isUnread()) {\n $unread++;\n }\n }\n\n return $unread;\n }", "public function getReadCount()\n {\n return $this->user->readNotifications()->count();\n }", "function set_unread_count()\n\t{\n\t\tlog_message('debug', 'Account/set_unread_count');\n\t\t$unread = $this->_api->get('message/statistics', array('fields'=>'unread'));\n\t\tlog_message('debug', 'Account/set_unread_count:: [1] unread='.json_encode($unread));\n\t\tif(!empty($unread['unread'])) $this->native_session->set('__unread_count', $unread['unread']);\n\t}", "public function countUnReadMail()\n\t\t\t{\n\t\t\t\t$sql = 'SELECT COUNT( mi.info_id ) AS count '.\n\t\t\t\t\t\t'FROM '.$this->CFG['db']['tbl']['users'].' AS u, '.$this->CFG['db']['tbl']['messages'].' AS ms, '.$this->CFG['db']['tbl']['messages_info'].' AS mi '.\n\t\t\t\t\t\t'WHERE mi.to_id = '.$this->dbObj->Param($this->CFG['user']['user_id']).' '.\n\t\t\t\t\t\t'AND mi.from_id = u.user_id '.\n\t\t\t\t\t\t'AND mi.message_id = ms.message_id '.\n\t\t\t\t\t\t'AND mi.to_viewed = \\'No\\' '.\n\t\t\t\t\t\t'AND mi.to_delete = \\'No\\' '.\n\t\t\t\t\t\t'AND mi.to_stored = \\'No\\' ';\n\t\t\t\t\t\t//'AND mi.email_status = \\'Normal\\' ';\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt, array($this->CFG['user']['user_id']));\n\t\t\t\tif (!$rs)\n\t\t\t\t trigger_db_error($this->dbObj);\n\t\t\t\t$row = $rs->FetchRow();\n\t\t\t\treturn $row['count'];\n\t\t\t}", "public function unread()\n {\n return $transactions = $this->transactions()->where('read',(int)false)->count();\n }", "public function unreadNotificationCount()\n {\n $storeId = Auth::guard('store')->user()->id;\n $notificationCount = StoreNotifications::where('store_id',$storeId)->where('is_read',false)->count();\n return $notificationCount;\n }", "public function get_position_unread_count(){\n\t\t$this->loadModel('ReqRead');\n\t\t$count = $this->ReqRead->find('count', array('conditions' => array('users_id' => $this->Session->read('USER.Login.id'),\n\t\t'ReqRead.status' => 'U'),'group' => array('ReqRead.requirements_id')));\n\t\t$this->set('new_pos_count', $count);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the filter form class name
public function getFilterFormClass() { return 'LogMailtoFormFilter'; }
[ "public function getFilterFormClass()\n {\n return 'AperoFormFilter';\n }", "public function getFilterFormClass()\n {\n return 'EventFormFilter';\n }", "public function getFilterFormClass()\n {\n return 'memberFormFilter';\n }", "public function getFilterFormClass()\n {\n return 'TaskFormFilter';\n }", "protected function getFilterFormType()\n {\n return sprintf('%s_filter', $this->action->getAdministration()->getNameLowerCase());\n }", "public function getFilterClass(): string\n {\n return $this->filter_class;\n }", "public function getFilterFormClass()\n {\n return 'Seguridad_AlertaVisitanteFormFilter';\n }", "public function getFormClassName()\n {\n return get_form_class_name($this);\n }", "abstract protected function getFilterClassName();", "protected function filterClass()\n {\n return Str::studly($this->filterName());\n }", "public function findFormClassName()\n {\n $this->runIfNotCached(\n 'formClassName',\n function () {\n return $this->findFormTag()->attr(self:: FORM_CLASS_NAME_ATTR_NAME);\n }\n );\n\n return $this->formClassName;\n }", "public function getFilterClass()\n {\n return $this->_stack->get();\n }", "public function getFormName();", "protected function getFormClass(){\n return (\n (\n $this->_class!==NULL &&\n is_string($this->_class) &&\n strlen(trim($this->_class))\n )\n ?$this->_class\n :$this->setFormClass()\n );\n }", "public function getFilterFormId()\n {\n return $this->getId() . '-' . 'filter';\n }", "protected function queryFilterName(): string\n {\n return '\\\\App\\\\QueryFilters\\\\' . class_basename($this) . 'Filter';\n }", "protected function getFormClass()\n {\n $class = new \\ReflectionClass( get_called_class() );\n\n $namespace = app()->getNamespace();\n\n $name = Str::singular(\n str_replace('Controller', '', $class->getShortName())\n );\n\n return sprintf('\\%sHttp\\Forms\\%sForm', $namespace,$name);\n }", "public function getFormClassName()\n {\n return SearchBlockType::class;\n }", "abstract public function getFilterClass();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Elimina un objeto Monitor en la base de datos.
public function delete($monitor){ $id=$monitor->getId(); try { $sql ="DELETE FROM `monitor` WHERE `id`='$id'"; return $this->insertarConsulta($sql); } catch (SQLException $e) { throw new Exception('Primary key is null'); } }
[ "public function unsetMonitor($monitor) {\n if(!empty($monitor)) {\n unset($this->monitors[strtolower($monitor->name)]);\n }\n}", "public function deleteMonitorServidores($id)\n {\n \tMonitoramentoServidores::find($id)->delete();\n }", "public function remove() {\n $modx =& $this->modx;\n $objClass = $this->getClass();\n /* Class ID Key, Name Key => Name Value Pair */\n $idKey = $this->dbClassIDKey;\n $name = $this->getName();\n $nameKey = $this->getNameField();\n $id = null;\n\n\n /* See if the object exists */\n $obj = $modx->getObject($objClass, array($nameKey => $name));\n if ($obj) {\n $obj->remove();\n $temp = $this->modx->setLogLevel(modX::LOG_LEVEL_INFO);\n $this->helpers->sendLog(modX::LOG_LEVEL_INFO, ' ' .\n $this->modx->lexicon('mc_removed')\n . ' '. $objClass . ': ' . $name);\n $this->modx->setLogLevel($temp);\n } else {\n $this->helpers->sendLog(modX::LOG_LEVEL_INFO,\n '[Object Adapter] ' .\n $this->modx->lexicon('mc_class_file_nf')\n . ' ' . $objClass . ': ' . $name);\n }\n }", "public function removeObject()\n {\n $sql = 'DELETE FROM {sql:tableName} WHERE {sql:primaryKey} = {primaryValue}';\n $this->db->query(Strings::prepareSql($sql, array(\n 'tableName' => $this->table,\n 'primaryKey' => $this->primaryKey[0],\n 'primaryValue' => $this->id\n )));\n\n $this->resetCache();\n }", "public function eliminar(){\r\n $sql = \"DELETE FROM mvp where id_mvp = '{$this->id}'\";\r\n $this->con->consulta($sql);\r\n }", "function remove_hrs_buses($handle,$id_hr)\n{\n\t//significa que esta eliminando horarios del bus\n\t$handle->query(\"DELETE FROM sunrise WHERE num_hr='$id_hr'\");\t\t\n\t//mostramos mensaje de confirmacion\t\t\n}", "public function remove() {\n\t\t$this->remove_room($this->data['rid']);\n\t\t$this->data = [];\n\t}", "function clearMonitor() {\n\t\t$result = db_query_params('DELETE FROM docgroup_monitored_docman WHERE docgroup_id = $1',\n\t\t\t\t\tarray($this->getID()));\n\t\tif (!$result) {\n\t\t\t$this->setError(_('Unable To Clear Monitor').' : '.db_error());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM miembro_ageia WHERE ID_MIEMBRO = '$this->id'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar el miembro\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Miembro eliminado\";\n\t\t}", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function deleteMonitorServidoresColetas( $id ){\n\t\t MonitoramentoServidoresColetas::where( 'monitoramento_servidores_id' , $id)->delete();\n }", "function eliminaRecord()\n\t\t{\n\t\tif (!$this->modulo->elimina(true))\n\t\t\t$this->mostraErroreDB($this->modulo->righeDB->connessioneDB);\n\t\t\n\t\t$this->ritorna();\n\t\t}", "function eliminar() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\tif ($mdb2->only_read) {\n\t\t\tthrow new Exception('Por el momento esta trabajando solo en modo lectura.');\n\t\t}\n\n\t\t$sql = \"SELECT * FROM public.horario_elimina(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->horario_id).\")\";\n\t\t//print($sql.\"<br>\");\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\t\t$log->setChange(\"ELIMINO HORARIO\", $this->toString());\n\t}", "public function remove_capteur() {\n \n //find and delete all the data related to this capteur\n $donnee_to_delete = $this->find_donnee();\n $donnee_to_delete->delete();\n\n //then delete the capteur\n $this->delete();\n }", "private function eliminar_informacion_reciclado($indice)\r\n\t{\r\n\t\t//Si el dato era reciclable, lo saco de las listas de reciclado\r\n\t\tif($this->existe_dato_reciclable($indice)){\r\n\t\t\t$tipo = $this->celda_memoria_actual['reciclables'][$indice];\r\n\t\t\t//Si el reciclado es de tipo 'acceso', tengo que sacarlo de la lista de reciclables activos\r\n\t\t\tif($tipo == apex_hilo_reciclado_acceso){\r\n\t\t\t\tforeach(array_keys($this->celda_memoria_actual['reciclables_activos']) as $reciclable){\r\n\t\t\t\t\tif($this->celda_memoria_actual['reciclables_activos'][$reciclable]==$indice){\r\n\t\t\t\t\t\tunset($this->celda_memoria_actual['reciclables_activos'][$reciclable]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tunset($this->celda_memoria_actual['reciclables'][$indice]);\r\n\t\t}\r\n\t}", "public function deleteHistorique()\n {\n \n $this->historique= new requete (\"DELETE FROM `donnees_meteo`\") ;\n\n echo \"historique supprimer\";\n }", "public function eliminarnotasolicitud(Request $request){\n $notasolicitud = Notasolicitud::find($request->get('nota_id'));\n if ($notasolicitud){\n $monitor_detalle = Monitorsolicitud::where('notasolicitud_id',$notasolicitud->id)->first();\n $solicitud = $request->get('solicitud_id');\n $notasolicitud->eliminado = true;\n $notasolicitud->save();\n\n Monitorsolicitud::create([\n 'solicitud_id' => $solicitud,\n 'accion_id' => 9,\n 'user_id' => auth()->user()->id,\n 'detalles' => $monitor_detalle->detalles. ' fue eliminada'\n ]);\n\n return back();\n }\n }", "public function removeRetainsObjectForObjectsNotInCurrentSession() : void {}", "public function remove(){\n $this->heap[0] = end($this->heap);\n array_pop($this->heap);\n Heap::reposicionaDescendo(0);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update height & width in storage metadata
protected function _updateMetadata() { $this->_originalWidth = parent::getOriginalWidth(); $this->_originalHeight = parent::getOriginalHeight(); $storageModel = Mage::getSingleton('core/file_storage')->getStorageModel(); $storageModel->updateMetadata($this->_getModel()->getBaseFile(), [ 'width' => $this->_originalWidth, 'height' => $this->_originalHeight, ]); return $this; }
[ "public function update_metadata_size() {\n\t\t$size = $this->filesystem->get_image_size( $this->get_original_path() );\n\n\t\tif ( ! $size ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->image->meta_data['width'] = $size['width'];\n\t\t$this->image->meta_data['height'] = $size['height'];\n\t\t$this->image->meta_data['full']['width'] = $size['width'];\n\t\t$this->image->meta_data['full']['height'] = $size['height'];\n\n\t\tnggdb::update_image_meta( $this->id, $this->image->meta_data );\n\t}", "private function add_image_size() {\n\t\t$image_meta = wp_get_attachment_metadata( $this->attachment_id );\n\t\tif ( empty( $image_meta['width'] ) || empty( $image_meta['height'] ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->data['width'] = $image_meta['width'];\n\t\t$this->data['height'] = $image_meta['height'];\n\t}", "public static function metadata_image_sizes() {\n\t\tif ( function_exists( 'fly_add_image_size' ) ) {\n\t\t\tfly_add_image_size( 'wprm-metadata-1_1', 500, 500, true );\n\t\t\tfly_add_image_size( 'wprm-metadata-4_3', 500, 375, true );\n\t\t\tfly_add_image_size( 'wprm-metadata-16_9', 480, 270, true );\n\t\t} else {\n\t\t\tadd_image_size( 'wprm-metadata-1_1', 500, 500, true );\n\t\t\tadd_image_size( 'wprm-metadata-4_3', 500, 375, true );\n\t\t\tadd_image_size( 'wprm-metadata-16_9', 480, 270, true );\n\t\t}\n\t}", "public function updateResourceDimensions();", "function refreshImageSize() {\n\t\tif($this->intTableKeyValue != \"\") {\n\t\t\tif ( $this->arrObjInfo['imageurl'] ) {\n\t\t\t\tif($this->arrObjInfo['imagewidth'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imagewidth'] = $imageSize[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->arrObjInfo['imageheight'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imageheight'] = $imageSize[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function updateSize()\n {\n $fstat = fstat($this->resource);\n\n if (false === $fstat) {\n $this->size = null;\n } else {\n $this->size = ! empty($fstat['size']) ? $fstat['size'] : null;\n }\n }", "protected function calculateDimensions( )\n {\n list( $width, $height, $type, $attr ) = getimagesize( $this->filepath );\n $this->width = $width;\n $this->height = $height;\n }", "private function setImageDimensions()\n {\n global $Core;\n\n if ($this->allowedSizes) {\n if (!isset($this->allowedSizes[$this->sizeType]) || !isset($this->allowedSizes[$this->sizeType][$this->sizeKey])) {\n $Core->doOrDie();\n } else {\n $this->width = $this->allowedSizes[$this->sizeType][$this->sizeKey]['width'];\n $this->height = $this->allowedSizes[$this->sizeType][$this->sizeKey]['height'];\n }\n }\n }", "public function initDimensions()\n {\n $this->log(\"Init dimension (before) newWidth x newHeight is {$this->newWidth} x {$this->newHeight}.\");\n\n // width as %\n if ($this->newWidth\n && $this->newWidth[strlen($this->newWidth)-1] == '%') {\n $this->newWidth = $this->width * substr($this->newWidth, 0, -1) / 100;\n $this->log(\"Setting new width based on % to {$this->newWidth}\");\n }\n\n // height as %\n if ($this->newHeight\n && $this->newHeight[strlen($this->newHeight)-1] == '%') {\n $this->newHeight = $this->height * substr($this->newHeight, 0, -1) / 100;\n $this->log(\"Setting new height based on % to {$this->newHeight}\");\n }\n\n is_null($this->aspectRatio) or is_numeric($this->aspectRatio) or $this->raiseError('Aspect ratio out of range');\n\n // width & height from aspect ratio\n if ($this->aspectRatio && is_null($this->newWidth) && is_null($this->newHeight)) {\n if ($this->aspectRatio >= 1) {\n $this->newWidth = $this->width;\n $this->newHeight = $this->width / $this->aspectRatio;\n $this->log(\"Setting new width & height based on width & aspect ratio (>=1) to (w x h) {$this->newWidth} x {$this->newHeight}\");\n\n } else {\n $this->newHeight = $this->height;\n $this->newWidth = $this->height * $this->aspectRatio;\n $this->log(\"Setting new width & height based on width & aspect ratio (<1) to (w x h) {$this->newWidth} x {$this->newHeight}\");\n }\n\n } elseif ($this->aspectRatio && is_null($this->newWidth)) {\n $this->newWidth = $this->newHeight * $this->aspectRatio;\n $this->log(\"Setting new width based on aspect ratio to {$this->newWidth}\");\n\n } elseif ($this->aspectRatio && is_null($this->newHeight)) {\n $this->newHeight = $this->newWidth / $this->aspectRatio;\n $this->log(\"Setting new height based on aspect ratio to {$this->newHeight}\");\n }\n\n // Change width & height based on dpr\n if ($this->dpr != 1) {\n if (!is_null($this->newWidth)) {\n $this->newWidth = round($this->newWidth * $this->dpr);\n $this->log(\"Setting new width based on dpr={$this->dpr} - w={$this->newWidth}\");\n }\n if (!is_null($this->newHeight)) {\n $this->newHeight = round($this->newHeight * $this->dpr);\n $this->log(\"Setting new height based on dpr={$this->dpr} - h={$this->newHeight}\");\n }\n }\n\n // Check values to be within domain\n is_null($this->newWidth)\n or is_numeric($this->newWidth)\n or $this->raiseError('Width not numeric');\n\n is_null($this->newHeight)\n or is_numeric($this->newHeight)\n or $this->raiseError('Height not numeric');\n\n $this->log(\"Init dimension (after) newWidth x newHeight is {$this->newWidth} x {$this->newHeight}.\");\n\n return $this;\n }", "public static function update_metadata($size, $attachment_id, $data) {\n\t\t$metadata = wp_get_attachment_metadata($attachment_id);\n\t\t$metadata['sizes'][$size] = $data;\n\t\twp_update_attachment_metadata($attachment_id, $metadata);\n\t}", "public function testUpdateMetadata4()\n {\n }", "public function save()\n {\n global $_CMAPP;\n\n $dm = $this->getSize();\n $s = round($this->size/1024);\n $this->metadata = \"$dm[x]|$dm[y]|$s\";\n\t\t\n $old_state = $this->state;\n \t \n try{\n \tparent::save();\n }catch(CMException $e) {\n \tnew AMErrorReport($e, 'AMImage::save', AMLog::LOG_CORE);\n \tthrow $e;\n }\n\n\t //we must delete all the existing thumbnails of this image if the save was sucessfull\n \t//see AMThumb for more information about thumbnail generation\n if($old_state==CMObj::STATE_DIRTY) {\n $p = AMThumb::getImagesPattern($this->codeFile);\n\n $_conf = $_CMAPP['config'];\n $path = (string) $_conf->app[0]->paths[0]->thumbnails;\n $handle = opendir($path);\n\n while (($file = readdir($handle))!==false) {\n if(ereg($p,$file)) {\n unlink($path.'/'.$file);\n }\n }\n }\n }", "public function refresh() {\n\t\t$adjustments = array(\n\t\t\tnew ResizeImageAdjustment(\n\t\t\t\tarray(\n\t\t\t\t\t'maximumWidth' => $this->maximumWidth,\n\t\t\t\t\t'maximumHeight' => $this->maximumHeight,\n\t\t\t\t\t'ratioMode' => $this->ratioMode,\n\t\t\t\t\t'allowUpScaling' => $this->allowUpScaling,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $adjustments);\n\n\t\t$this->resource = $processedImageInfo['resource'];\n\t\t$this->width = $processedImageInfo['width'];\n\t\t$this->height = $processedImageInfo['height'];\n\t}", "private function setImageSize()\n {\n list($this->width, $this->height) = getimagesize($this->file);\n }", "public function setWidthAndHeight()\n {\n $this->width = $this->layer->getWidth();\n $this->height = $this->layer->getHeight();\n }", "function Set($width, $height){}", "public function saveMeta()\n {\n $video = $this->video\n ->getStreams()\n ->videos()\n ->first();\n\n $this->record->update([\n 'duration' => $video->get('duration'),\n 'width' => $video->get('width'),\n 'height' => $video->get('height'),\n 'frame_rate' => (int) str_before($video->get('avg_frame_rate'), '/') / 1000,\n ]);\n }", "public function testUpdateContentMetadata()\n {\n }", "protected function setImageSize()\n {\n $this->width = imagesx($this->file);\n $this->height = imagesy($this->file);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }