query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Test case for groupV2GetUserClanInviteSetting .
public function testGroupV2GetUserClanInviteSetting() { // TODO: implement $this->markTestIncomplete('Not implemented'); }
[ "public function testProjectProjectIDInviteeInviteIDGet()\n {\n }", "public function groupV2GetUserClanInviteSettingRequest($m_type)\n {\n // verify the required parameter 'm_type' is set\n if ($m_type === null || (is_array($m_type) && count($m_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $m_type when calling groupV2GetUserClanInviteSetting'\n );\n }\n\n $resourcePath = '/GroupV2/GetUserClanInviteSetting/{mType}/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($m_type !== null) {\n $resourcePath = str_replace(\n '{' . 'mType' . '}',\n ObjectSerializer::toPathValue($m_type),\n $resourcePath\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 $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 testProjectProjectIDInviteGet()\n {\n }", "public function testInvitationTicketsIdTargetTeamGet()\n {\n\n }", "public function testTeamsIdBuilderConfigsGet()\n {\n\n }", "public function testSubaccountsEmailSettingsGet()\n {\n }", "public function testTeamsIdPortalsNkDefaultBuilderConfigGet()\n {\n\n }", "public function testTeamBuilderConfigsGet()\n {\n\n }", "public function testTeamBuilderConfigProductGroupsIdBuilderConfigGet()\n {\n\n }", "public function testTeamMembersIdTeamPermissionGet()\n {\n\n }", "public function testChannelsInvite()\n {\n }", "public function testTeamBuilderConfigsIdTeamGet()\n {\n\n }", "public function testInvitationTicketsIdTargetTemplateMemberGet()\n {\n\n }", "public function testTeamMembersIdTeamBillingCachedGet()\n {\n\n }", "public function testTeamBuilderConfigProductGroupsGet()\n {\n\n }", "public function testTeamMembersIdSharedDesignsGet()\n {\n\n }", "public function testTeamMembersIdTeamBuilderConfigsCountGet()\n {\n\n }", "public function testExternalMembersInvite()\n {\n }", "public function testConversationsInvite()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets issuer (payload[iss]). Sets name of the token generating service.
public function setIssuer($issuer) { return $this->setClaim('iss', (string)$issuer); }
[ "public function setTokenIssuerName($val)\n {\n $this->_propDict[\"tokenIssuerName\"] = $val;\n return $this;\n }", "public function setIssuer(string $issuer)\n {\n \t$this->claims['iss'] = $issuer;\n }", "public function setIssuer($issuer);", "public function setIssuer($issuer){\n\t\treturn $this->setClaim('iss', $issuer);\n\t}", "public function setIssuer(string $issuer): TokenBuilder\n {\n $this->issuer = $issuer;\n\n return $this;\n }", "public function setCertificateIssuerName($val)\n {\n $this->_propDict[\"certificateIssuerName\"] = $val;\n return $this;\n }", "public function setIssuer($var)\n {\n GPBUtil::checkString($var, True);\n $this->issuer = $var;\n\n return $this;\n }", "public function getIssuerName()\n {\n return $this->issuer_name;\n }", "private function setIssuerId(): void\n {\n $issuerId = config('liap.appstore_issuer_id');\n assert(is_string($issuerId) || is_null($issuerId));\n\n if (null === $issuerId) {\n throw new RuntimeException('The issuer ID is not configured');\n }\n\n $this->serviceBuilder->issuerId($issuerId);\n }", "public function setIssuer(string $issuer): self\n {\n $this->issuer = $issuer;\n\n return $this;\n }", "public function set_issuer()\n {\n if (!empty($this->request->post['mollie_issuer_id'])) {\n $this->session->data['mollie_issuer'] = $this->request->post['mollie_issuer_id'];\n } else {\n $this->session->data['mollie_issuer'] = null;\n }\n\n echo $this->session->data['mollie_issuer'];\n }", "public function testSettingIssuer()\n {\n $this->context->setIssuer('foo');\n $this->assertEquals('foo', $this->context->getIssuer());\n }", "public function withIssuer(string $iss): self\n {\n return (clone $this)->setIssuer($iss);\n }", "public function setTokenIssuerType($val)\n {\n $this->_propDict[\"tokenIssuerType\"] = $val;\n return $this;\n }", "public function setIssuer(string $issuer): self\n {\n $this->issuer = rtrim($issuer, \"/\");\n\n return $this;\n }", "function getIssuer();", "public function getIssuer()\n {\n return $this->issuer;\n }", "public function setIssuer($var)\n {\n GPBUtil::checkMessage($var, \\Io\\Token\\Proto\\Common\\Token\\TokenMember::class);\n $this->issuer = $var;\n\n return $this;\n }", "public function getIssuer()\n\t{\n\t\treturn $this->getPayloadEntry('iss');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register the page service.
protected function registerService() { $this->app->bind('pages.service', function(Application $app) { return new PageService( $app->make('pages.repository'), $app->make('cache'), $app ); }); }
[ "public function register(): void\n {\n add_menu_page(\n $this->pageTitle ?: $this->menuTitle,\n $this->menuTitle,\n $this->capability,\n $this->menuSlug,\n [$this, 'view'],\n $this->icon,\n $this->position\n );\n\n $this->submenus();\n }", "public function register()\n {\n $this->app['pagegraphic'] = $this->app->share(function($app)\n {\n return new PageGraphic;\n });\n\n // Shortcut so developers don't need to add an Alias in app/config/app.php\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('PageGraphic', 'Sterling\\Facades\\PageGraphic');\n });\n }", "function register_site_page($id, $page, $oCallback = null, $version = null, $version_type = 4)\r\n{\r\n return Pager::addSitePage($id, $page, $oCallback, $version, $version_type);\r\n}", "protected function getForm_Type_Seo_PageService()\n {\n return $this->services['form.type.seo.page'] = new \\Victoire\\Bundle\\SeoBundle\\Form\\PageSeoType();\n }", "public function register_single_page( Page $page ): void {\n\t\t// Register view if required.\n\t\tif ( \\method_exists( $page, 'set_view' ) ) {\n\t\t\t$page->set_view( $this->view );\n\t\t}\n\n\t\ttry {\n\t\t\t$this->registrar->register_primary( $page, null );\n\t\t} catch ( \\Throwable $th ) {\n\t\t\t$this->admin_exception_notice( $page, $th );\n\t\t}\n\t}", "protected function getSonata_Page_Manager_PageService()\n {\n return $this->services['sonata.page.manager.page'] = new \\Sonata\\PageBundle\\Entity\\PageManager('Application\\\\Sonata\\\\PageBundle\\\\Entity\\\\Page', $this->get('doctrine'), array('templateCode' => 'default', 'enabled' => true, 'routeName' => NULL, 'name' => NULL, 'slug' => NULL, 'url' => NULL, 'requestMethod' => NULL, 'decorate' => true), array('homepage' => array('templateCode' => 'default', 'enabled' => true, 'routeName' => NULL, 'name' => NULL, 'slug' => NULL, 'url' => NULL, 'requestMethod' => NULL, 'decorate' => false)));\n }", "protected function getVictoirePage_Twig_PageExtensionService()\n {\n return $this->services['victoire_page.twig.page_extension'] = new \\Victoire\\Bundle\\PageBundle\\Twig\\Extension\\PageExtension($this->get('victoire_business_page.business_page_helper'), $this->get('router'), $this->get('victoire_page.page_helper'), $this->get('victoire_core.current_view'), $this->get('victoire_core.view_css_builder'), $this->get('doctrine.orm.default_entity_manager'));\n }", "function addPage(){}", "abstract public function addPage(Page $page);", "public function register_pages() {\n add_menu_page('REST Plugin Test', 'REST Plugin Test', 'manage_options', 'rest-plugin-test', [&$this, 'page_rest_plugin_test']);\n }", "public function addPage()\n {\n }", "public function addPageResolver(PageResolverInterface $resolver);", "public function register()\n\t{\n\t\t$this->app->singleton(\n\t\t\t'tap-payment', function() {\n\t\t\treturn new TapService();\n\t\t}\n\t\t);\n\t}", "protected function registerService()\n {\n $this->app->singleton('rockid', function () {\n return new Rockid();\n });\n }", "protected function getSocial_Dao_Cache_PageService()\n {\n return $this->services['social.dao.cache.page'] = new \\Ology\\SocialBundle\\DAO\\CacheDAO\\PageCacheDAO($this->get('memcache'));\n }", "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function registerServices()\n {\n $di = new FactoryDefault();\n $loader = new Loader();\n\n $namespaces = [];\n $map = require_once(__DIR__. '/../autoload_namespaces.php');\n\n foreach ($map as $k => $values) {\n $k = trim($k, '\\\\');\n if (!isset($namespaces[$k])) {\n $dir = '/' . str_replace('\\\\', '/', $k) . '/';\n $namespaces[$k] = implode($dir . ';', $values) . $dir;\n }\n }\n\n $loader->registerNamespaces($namespaces);\n\n $loader->register();\n\n /**\n * Register a router\n */\n $di->set('router', function () {\n $router = new Router();\n\n $router->setDefaultModule('frontend');\n\n //set frontend routes\n $router->mount(new FrontendRoutes());\n//\n return $router;\n });\n\n $this->setDI($di);\n }", "protected function _getPageService()\n {\n return new ZFEngine_Module_Pages_Model_PageService();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ This function add a lane to a game result
public function addLaneToResult($resultId, $laneId) { try { $q = $this->db->prepare('UPDATE `results` SET `fkLane`=:idLane WHERE `pkResult` = :idResult'); $q->bindValue(':idLane', $laneId, PDO::PARAM_STR); $q->bindValue(':idResult', $resultId, PDO::PARAM_STR); $this->db->beginTransaction(); $q->execute(); $this->db->commit(); } catch (PDOException $e) { $this->db->rollback(); } }
[ "function argPlayWall()\n {\n //1)lava tiles open exits which do NOT touch the edge of the board (including villages)\n //2)any edge in the active player's village\n //obviously there must also not currently be a wall present in the space CHECK IF REPLACE?\n\n //To more easily/efficiently do this, I'm actually going to return the spaces I want to display the arror in, \n //i.e, the empty space and direction which is connected to the lava tile. This is similar to the code for valid tile placements\n\n $emptySpaces = $this->board_spaces;\n $connectedEmptySpaces = array();\n $connectedDirections = array();\n\n //remove all spaces with tiles on\n for ($i = 0; $i< count($emptySpaces); $i++)\n {\n $x = $emptySpaces[$i][\"x\"];\n $y = $emptySpaces[$i][\"y\"];\n if ($this->isSpaceUsed($x, $y))\n {\n array_splice($emptySpaces, $i, 1);\n $i--;\n }\n else if ($this-> isSpaceConnected($x, $y))\n {\n //where is it connected by lava? we want all the directions\n $north = $this->getConnectionState($x, $y +1, $this->dirN);\n $northEast = $this->getConnectionState($x - 1, $y +1, $this->dirNE);\n $southEast = $this->getConnectionState($x-1, $y, $this->dirSE);\n $south = $this->getConnectionState($x, $y - 1, $this->dirS);\n $southWest = $this->getConnectionState($x + 1, $y - 1, $this->dirSW);\n $northWest = $this->getConnectionState($x + 1, $y, $this->dirNW);\n \n //add to results array\n if ($north == $this->tileStateLava)\n {\n $connectedEmptySpaces[] = $emptySpaces[$i];\n $connectedDirections[] = $this->dirS;\n }\n if ($northEast == $this->tileStateLava)\n {\n $connectedEmptySpaces[] = $emptySpaces[$i];\n $connectedDirections[] = $this->dirSW;\n }\n if ($southEast == $this->tileStateLava)\n {\n $connectedEmptySpaces[] = $emptySpaces[$i];\n $connectedDirections[] = $this->dirNW;\n }\n if ($south == $this->tileStateLava)\n {\n $connectedEmptySpaces[] = $emptySpaces[$i];\n $connectedDirections[] = $this->dirN;\n }\n if ($southWest == $this->tileStateLava)\n {\n $connectedEmptySpaces[] = $emptySpaces[$i];\n $connectedDirections[] = $this->dirNE;\n }\n if ($northWest == $this->tileStateLava)\n {\n $connectedEmptySpaces[] = $emptySpaces[$i];\n $connectedDirections[] = $this->dirSE;\n }\n }\n }\n\n //add home base thingies\n\n $playerPosition = $this->getPlayerVariable('player_position', self::getActivePlayerId());\n $dangerTiles = $this->getDangerTiles($playerPosition);\n //every home space is valid so long as it has no wall, even if lava is already connected\n foreach ($dangerTiles as $tile)\n {\n $connectedEmptySpaces[] = array('x' => $tile[0], 'y' => $tile[1]);\n $connectedDirections[] = $tile[2];\n }\n\n //exclude places where existing walls are (tricky, since I'm returning the connected ones...)\n $walls = $this->getWalls();\n\n for ($i = 0; $i< count($connectedEmptySpaces); $i++)\n {\n $x = $connectedEmptySpaces[$i]['x'];\n $y = $connectedEmptySpaces[$i]['y'];\n $dir = $connectedDirections[$i];\n\n $this->moveCoords($x, $y, $dir);\n foreach ($walls as $wall)\n {\n if ($wall['wall_x'] == $x && $wall['wall_y'] == $y && ($dir+3)%6 == $wall['wall_rotation'])\n {\n array_splice($connectedEmptySpaces, $i, 1);\n array_splice($connectedDirections, $i, 1);\n $i--;\n }\n }\n }\n\n $isCardEffect = $this->getGameStateValue(\"isCardEffect\");\n\n return array(\"canBuild\"=> $this->canBuildWall(), \"isCardEffect\" => $isCardEffect, \"connectedEmptySpaces\" => $connectedEmptySpaces, \"connectedDirections\" => $connectedDirections);\n }", "function addNewRoute($eventid, $data) {\n $newresult = FALSE;\n $id = $data->resultid;\n if (($data->resultid == 0) || ($data->resultid == GPS_RESULT_OFFSET)) {\n // result needs to be allocated a new id\n $newresult = TRUE;\n // allow for this being the first entry for an event with no results\n if (file_exists(KARTAT_DIRECTORY.\"kilpailijat_\".$eventid.\".txt\")) {\n $rows = count(file(KARTAT_DIRECTORY.\"kilpailijat_\".$eventid.\".txt\"));\n } else {\n $rows = 0;\n }\n $rows++;\n if ($data->resultid == 0) {\n $id = $rows;\n } else {\n $id = $rows + GPS_RESULT_OFFSET;\n }\n }\n\n $write[\"oldid\"] = $data->resultid;\n $write[\"newid\"] = $id;\n \n if ($id >= GPS_RESULT_OFFSET) {\n $name = ' GPS '.$data->name;\n } else {\n $name = $data->name;\n }\n //\n $name = encode_rg_output($name);\n // tidy up commments\n $comments = tidyNewComments($data->comments);\n $newcommentdata = $data->courseid.\"|\".$id.\"|\".$name.\"||\".$comments.PHP_EOL;\n\n // convert x,y to internal RG format\n $track = \"\";\n for ($i = 0; $i < count($data->x); $i++) {\n $track .= 'N'.$data->x[$i].';-'.$data->y[$i];\n }\n\n $controls = \"\";\n for ($i = 0; $i < count($data->controlx); $i++) {\n $controls .= 'N'.$data->controlx[$i].';-'.$data->controly[$i];\n }\n \n $newtrackdata = $data->courseid.\"|\".$id.\"|\".$name.\"|null|\".$track.\"|\".$controls.PHP_EOL;\n\n $newresultdata = \"\";\n if (($newresult === TRUE) || ($id >= GPS_RESULT_OFFSET)) {\n // New result or GPS record so need to add result record as well\n // GPS track saved here as a point every three seconds\n // input can in theory have any time between points\n // so we need to interpolate\n $track= \"\";\n if ($id >= GPS_RESULT_OFFSET) {\n $oldtime = $data->time[0];\n $oldx = $data->x[0];\n $oldy = $data->y[0];\n $track = $data->x[0].';-'.$data->y[0].',0N';\n for ($i = 1; $i < count($data->x); $i++) {\n $difftime = $data->time[$i] - $oldtime;\n if ($difftime >= GPS_INTERVAL) {\n $xpersec = ($data->x[$i] - $oldx) / $difftime;\n $ypersec = ($data->y[$i] - $oldy) / $difftime;\n $time = GPS_INTERVAL;\n while ($time <= $difftime) {\n $track .= intval($oldx + ($xpersec * $time)).';-'.intval($oldy + ($ypersec * $time)).',0N';\n $time = $time + GPS_INTERVAL;\n }\n $oldx = intval($oldx + ($xpersec * $time));\n $oldy = intval($oldy + ($ypersec * $time));\n $oldtime = $oldtime + $time - GPS_INTERVAL;\n }\n }\n }\n \n $newresultdata = $id.\"|\".$data->courseid.\"|\".encode_rg_output($data->coursename).\"|\".$name;\n if ($id >= GPS_RESULT_OFFSET) {\n $newresultdata .= \"|\".$data->startsecs.\"|||\".$data->totaltime.\"||\".$track.PHP_EOL;\n } else {\n $newresultdata .= \"|\".$data->startsecs.\"|||\".$data->totaltime.\"|\".$data->totalsecs.\";|\".PHP_EOL;\n }\n }\n\n $write[\"status_msg\"] = \"\";\n \n if (($handle = @fopen(KARTAT_DIRECTORY.\"kommentit_\".$eventid.\".txt\", \"a\")) !== FALSE) {\n $status =fwrite($handle, $newcommentdata);\n if (!$status) {\n $write[\"status_msg\"] = \"Save error for kommentit. \";\n }\n @fflush($handle);\n @fclose($handle);\n }\n \n $filename = KARTAT_DIRECTORY.\"merkinnat_\".$eventid.\".txt\";\n // don't report error if file doesn't exist yet\n $oldfile = @file($filename);\n // if we read something...\n if ($oldfile) {\n $updatedfile = array();\n // copy each existing row to output file\n foreach ($oldfile as $row) {\n $data = explode(\"|\", $row);\n // but not if it is a drawn route for the current result\n if (($data[1] != $id) || ($data[1] >= GPS_RESULT_OFFSET)) {\n $updatedfile[] = $row;\n }\n }\n }\n // add new track at end of file\n $updatedfile[] = $newtrackdata;\n \n $status = file_put_contents($filename, $updatedfile);\n \n if (!$status) {\n $write[\"status_msg\"] .= \" Save error for merkinnat. \";\n }\n\n if (($newresult === TRUE) || ($id >= GPS_RESULT_OFFSET)) {\n if (($handle = @fopen(KARTAT_DIRECTORY.\"kilpailijat_\".$eventid.\".txt\", \"a\")) !== FALSE) {\n $status =fwrite($handle, $newresultdata);\n if (!$status) {\n $write[\"status_msg\"] .= \" Save error for kilpailijat.\";\n }\n @fflush($handle);\n @fclose($handle);\n }\n }\n\n if ($write[\"status_msg\"] == \"\") {\n $write[\"ok\"] = TRUE;\n $write[\"status_msg\"] = \"Record saved\";\n //rg2log(\"Route saved|\".$eventid.\"|\".$id);\n } else {\n $write[\"ok\"] = FALSE;\n }\n \n return $write;\n\n}", "function space_in_this_lane($game_state, $horse_state) {\n /** @var horse_details $details */\n $details = $game_state->get_details($horse_state->horseid);\n // compare location of all horses to potential location in adjacent lanes\n\n // calc adjacent point\n $adj_point = $game_state->get_adjacent_point(\n $details->get_lane(),\n $horse_state->lane,\n $details->get_position_x(),\n $details->get_position_y()\n );\n // calc distance along to that point\n $distance_to_adj_pt = $game_state->distance_along_lane($details->get_lane(), $adj_point[0], $adj_point[1]);\n // adjust for number of laps around\n $distance_to_adj_pt += $game_state->lane_length($details->get_lane()) * $details->get_lap_counter();\n\n $horses = $game_state->get_horses();\n foreach ($horses as $horse) {\n /** @var horse_details $horse_details */\n $horse_details = $game_state->get_details($horse->get_id());\n\n // if they're us, they don't overlap\n if ($horse->get_id() == $horse_state->horseid) {\n continue;\n }\n // if they're in an irrelevant lane, they don't overlap\n if ($horse_details->get_lane() != $horse_state->lane) {\n continue;\n }\n // otherwise check bounding boxes\n $distance_to_horse = $game_state->distance_along_lane($details->get_lane(), $horse_details->get_position_x(), $horse_details->get_position_y());\n // adjust for number of laps around\n $distance_to_horse += $game_state->lane_length($details->get_lane()) * $horse_details->get_lap_counter();\n if (abs($distance_to_adj_pt - $distance_to_horse) < 9) {\n return \"no\";\n }\n }\n return \"yes\";\n}", "function add_activity_result($result) {\n\t\t$this->_activity_result[] = $result;\n\t}", "public function addLap(Lap $lap) {\n $this->laps[] = $lap;\n }", "protected function pmap_checkResultLayers()\n {\n // ADD RESULTLAYER: MARKING SHAPE(S) AND ADD AS IN NEW CREATED LAYER\n if (isset($_REQUEST[\"resultlayer\"])) {\n $resultlayerStr = $_REQUEST[\"resultlayer\"];\n if ($resultlayerStr == \"remove\") {\n unset($resultlayers);\n } else {\n $resultlayer = explode(\" \", $resultlayerStr);\n $reslayname = $resultlayer[0];\n $shpindexes = explode(\"|\", $resultlayer[1]);\n $resultlayers[$reslayname] = $shpindexes;\n $this->pmap_addResultLayer($reslayname, $shpindexes);\n }\n }\n }", "public function addToTurnSummary($log)\n {\n array_push($this->battle_frame['turn_summary'], $log);\n }", "public function addToLanes($lanes)\n {\n $this->lanes[] = $lanes;\n return $this;\n }", "public function testLadderAddMatch()\n {\n $ladder = $this->createNewLadderForTests(array(\n 'name' => 'Ladder ' . uniqid(),\n 'scoringModel' => 'glicko2',\n ));\n\n $signups = $this->generateRandomSignups(8);\n $this->client->addSignups($ladder['type'], $ladder['id'], $signups);\n $this->client->addLadderMatch($ladder['id'], array(\n 'remoteId' => $signups[3]['remoteId'],\n 'remoteIdOpponent' => $signups[5]['remoteId'],\n 'score' => 5,\n 'scoreOpponent' => 15,\n ));\n\n $ranking = $this->client->getLadderRanking($ladder['id']);\n $this->assertCount(8, $ranking);\n\n foreach ($ranking as $idx => $rank)\n {\n if ($idx == 0)\n {\n $this->assertLessThan($rank['score'], 1500);\n }\n else if ($idx < 7)\n {\n $this->assertEquals(1500, $rank['score']);\n }\n else\n {\n $this->assertLessThan(1500, $rank['score']);\n }\n }\n }", "public function populateMatchStandings(){\n\t\t $team = new Application_Model_Mapper_Team();\n\t\t //cath all teams\n\t\t $teamList=$team->fetchAll();\n\t\t $prosGoal= null;\n\t\t $agaistGoal=null;\n\t\t if(count($teamList)>0){\n\t\t \t foreach($teamList as $row){\n\t\t \t \t //begin team statistics by 0\n\t\t \t \t $row->setWins(0);\n\t\t \t \t $row->setLosses(0);\n\t\t \t \t $row->setPoints(0);\n\t\t \t \t $row->setDraws(0);\n\t\t \t \t //catch all matches by team\n\t\t $championship = $this->seachMatchByTeam($row->getId());\n\t\t foreach ($championship as $match) {\n\t\t //if a team is a visitor team goals of visitor team it is\n\t\t \t $prosGoal=$match['goalVisitorTeam'];\n\t\t \t $agaistGoal=$match['goalHomeTeam'];\n\t\t \t //if a team is a home team goals of home team it is\n\t\t \t if($match['idHomeTeam']==$row->getId()){\n\t\t \t \t $prosGoal=$match['goalHomeTeam'];\n\t\t \t \t $agaistGoal=$match['goalVisitorTeam'];\n\t\t \t }\n\t\t \t //if team win\n\t\t \t if($agaistGoal<$prosGoal){\n\t\t \t \t$row->setWins($row->getWins()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+3);\n\t\t \t }//if team lost\n\t\t \t elseif($agaistGoal>$prosGoal){\n\t\t \t \t$row->setLosses($row->getLosses()+1);\n\t\t \t }//if team draw\n\t\t \t else{\n\t\t \t \t$row->setDraws($row->getDraws()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+1);\n\t\t \t }\n\t\t }\n\t\t //update table team\n\t\t $team->updateTeam($row);\n\t\t \t }\n\t\t }\n\t}", "private function addResult($result) {\n //Adds a result to the results array\n $this->results[] = $result;\n }", "private function showGameResult()\n {\n $gameWinningPlayers = [];\n foreach ($this->players as $player) {\n if (count($gameWinningPlayers) === 0) {\n // Initialize with the first player\n $gameWinningPlayers[] = $player;\n\n } else if ($gameWinningPlayers[0]->getScore() < $player->getScore()) {\n // Reset the list of winning players with the current player\n $gameWinningPlayers = [$player];\n\n } elseif ($gameWinningPlayers[0]->getScore() === $player->getScore()) {\n // Add the current player to the list of winning players\n $gameWinningPlayers[] = $player;\n }\n }\n\n echo 'Résultat de la partie : ';\n echo self::playersResultToString($gameWinningPlayers); \n echo \"\\n\";\n }", "protected function addCurrentPositionToRoad()\n {\n $this->road[] = $this->currentPosition;\n }", "function gameResults($game) {\r\n }", "protected function addToLeague($name, $id){\n //check for an empty name and disregard the team completely :(\n if(empty($name)){\n return -1;\n } else {\n $index = $this->League->findTeamIndex($id);\n if($index == -1){ // if it is -1 the team doesnt exist, see libs/League.php\n \t//make teamForRPI object\n \t$team = new teamForRPI($name, $id);\n \t//push into League while also getting its index\n\t return $this->League->addTeam($team);\n } else {\n\t //is in league return the index\n\t return $index;\n }\n }\n }", "public function getLane()\n {\n return $this->lanes;\n }", "function getplayerLineups($reqLineup, $value) {\n $objLineUp = Application_Model_Lineup::getInstance();\n $objSportsModel = Application_Model_Sports::getInstance();\n $objGamePlayers = Application_Model_GamePlayers::getInstance();\n $objAbbreviation = Engine_Utilities_Abbreviations::getInstance();\n $objGameStats = Application_Model_GameStats::getInstance();\n $objContest = Application_Model_Contests::getInstance();\n $gameDate = date('Y-m-d', strtotime($value['start_time']));\n switch ($value['sports_id']) {\n\n case 1:\n $statsresponse = $objGameStats->getGameStats($value['sports_id'], $gameDate);\n $teamabbreviation = $objAbbreviation->getNFLAbbreviations(); // get team Abbreviations\n break;\n case 2:\n $statsresponse = $objGameStats->getGameStats($value['sports_id'], $gameDate);\n $teamabbreviation = $objAbbreviation->getMLBAbbreviations(); // get team Abbreviations\n break;\n case 3:\n $statsresponse = $objGameStats->getGameStats($value['sports_id'], $gameDate);\n\n $teamabbreviation = $objAbbreviation->getNBAAbbreviations(); // get team Abbreviations\n break;\n case 4:\n $statsresponse = $objGameStats->getGameStats($value['sports_id'], $gameDate);\n $teamabbreviation = $objAbbreviation->getNHLAbbreviations(); // get team Abbreviations\n break;\n\n default:\n break;\n } \n if (isset($statsresponse)) {\n $gamestat_res = json_decode($statsresponse['game_stat'], true);\n\n $contestDate = strtotime(date('Y-m-d', strtotime($value['start_time'])));\n if (isset($teamabbreviation)) {\n $Tabbrevations = (array) json_decode($teamabbreviation);\n $teamAbb = array();\n $group = array();\n $j = 0;\n\n //create array to get team code for hometeam and away team\n foreach ($gamestat_res['match'] as $matchinfo) {\n\n $hometeamNaming = array_search($matchinfo['hometeam']['name'], $Tabbrevations);\n\n $awayteamNaming = array_search($matchinfo['awayteam']['name'], $Tabbrevations);\n\n $teamAbb[$j]['time'] = $matchinfo['formatted_date'] . $matchinfo['time'];\n $teamAbb[$j]['hometeam']['name'] = $hometeamNaming;\n $teamAbb[$j]['hometeam']['id'] = $matchinfo['hometeam']['id'];\n $teamAbb[$j]['awayteam']['name'] = $awayteamNaming;\n $teamAbb[$j]['awayteam']['id'] = $matchinfo['awayteam']['id'];\n\n $group[$hometeamNaming] = $awayteamNaming;\n $group[$awayteamNaming] = $hometeamNaming;\n $j++;\n }\n if (!empty($teamAbb)) {\n\n $groupIds = array();\n\n foreach ($teamAbb as $pkey => $pvalue) {\n\n $groupIds[$pvalue['hometeam']['name']] = $pvalue['hometeam']['id'];\n $groupIds[$pvalue['awayteam']['name']] = $pvalue['awayteam']['id'];\n }\n\n $hometeam = array_map(function($item) {\n return strtolower($item['hometeam']['name']);\n }, $teamAbb);\n\n $awayteam = array_map(function($item) {\n return strtolower($item['awayteam']['name']);\n }, $teamAbb);\n\n\n // merge hometeam and away team to get players \"TEST1\n $mergegroupTeamName = array_merge($hometeam, $awayteam);\n $contestteamString = implode(\"','\", $mergegroupTeamName);\n\n $playerLists = $objGamePlayers->getPlayersByGameTeam($value['sports_id'], $contestteamString);\n\n switch ($value['sports_id']) {\n case 1:\n $virtualcontestLineup = $this->createNflVirtualLineup($reqLineup, $playerLists);\n break;\n case 2 :\n $virtualcontestLineup = $this->createMlbVirtualLineup($reqLineup, $playerLists);\n break;\n case 3 :\n $virtualcontestLineup = $this->createNbaVirtualLineup($reqLineup, $playerLists);\n break;\n case 4 :\n $virtualcontestLineup = $this->createNhlVirtualLineup($reqLineup, $playerLists);\n break;\n\n default:\n break;\n }\n if (isset($virtualcontestLineup) && is_array($virtualcontestLineup) && !empty($virtualcontestLineup)) {\n return $virtualcontestLineup;\n }\n }\n }\n }\n }", "public function lap( $name = null ) {\n $lapTime = $this->getCurrentTime();\n\n # end the last lap\n $this->endLap();\n\n # Create new lap\n $this->laps[] = array(\n \"name\" => ( $name ? $name : $this->lapCount ),\n \"start\" => $lapTime,\n \"end\" => -1,\n \"total\" => -1,\n );\n\n $this->lapCount += 1;\n }", "function getMatchTeamLineUpsLive_Football($CronID) {\r\n\r\n /* To Get Completed Matches */ \r\n $MatchesData = $this->Football_model->getMatches('MatchIDLive,LeagueID,MatchID,TeamIDLocal,TeamIDVisitor,TeamIDLiveLocal,TeamIDLiveVisitor',array('StatusID' => 5, 'IsTeamLineUp' => 'No', 'MatchSource' => 'API', 'OrderBy' => 'MatchStartDateTime', 'Sequence' => 'DESC'),TRUE,1,20);\r\n if(empty($MatchesData)){\r\n $this->db->where('CronID', $CronID);\r\n $this->db->limit(1);\r\n $this->db->update('log_cron', array('CronStatus' => 'Exit'));\r\n return true;\r\n }\r\n\r\n /* To Get All Team Ids */\r\n $TeamIds = array_column($MatchesData['Data']['Records'], 'TeamIDLocal','TeamIDLiveLocal') + array_column($MatchesData['Data']['Records'], 'TeamIDVisitor','TeamIDLiveVisitor');\r\n\r\n /* Player Positions */\r\n $PlayerPositions = array('G' => 'Goalkeeper', 'D' => 'Defender', 'M' => 'Midfielder', 'A' => 'Forward');\r\n\r\n /* To Get Completed Fixtures Data */\r\n foreach($MatchesData['Data']['Records'] as $Match){\r\n\r\n /* To Get Live Data */\r\n $Response = $this->callSportsAPI(SPORTMONKS_API_URL . 'fixtures/'.$Match['MatchIDLive'].'?include=lineup&api_token=');\r\n\r\n /* Update Team Lineup */\r\n if(empty($Response['data']['lineup']['data'])){\r\n continue;\r\n }\r\n\r\n $TeamPlayersData = array();\r\n foreach($Response['data']['lineup']['data'] as $Player){\r\n\r\n /* To check if player is already exist */\r\n $Query = $this->db->query('SELECT PlayerID FROM football_sports_players WHERE PlayerIDLive = \"' . $Player['player_id'] . '\" LIMIT 1');\r\n $PlayerID = ($Query->num_rows() > 0) ? $Query->row()->PlayerID : FALSE;\r\n\r\n /* Insert Player */\r\n if (!$PlayerID) {\r\n\r\n /* Add players to entity table and get EntityID. */\r\n $PlayerGUID = get_guid();\r\n $PlayerID = $this->Entity_model->addEntity($PlayerGUID, array(\"EntityTypeID\" => 10, \"StatusID\" => 2));\r\n $PlayersAPIData = array(\r\n 'PlayerID' => $PlayerID,\r\n 'PlayerGUID' => $PlayerGUID,\r\n 'PlayerIDLive' => $Player['player_id'],\r\n 'PlayerName' => $Player['player_name']\r\n );\r\n $this->db->insert('football_sports_players', $PlayersAPIData);\r\n }\r\n\r\n /* Manage Match Team Players Data */\r\n $TeamPlayersData[] = array(\r\n 'PlayerID' => $PlayerID,\r\n 'LeagueID' => $Match['LeagueID'],\r\n 'TeamID' => $TeamIds[$Player['team_id']],\r\n 'MatchID' => $Match['MatchID'],\r\n 'PlayerRole' => $PlayerPositions[$Player['position']]\r\n );\r\n }\r\n\r\n /* Insert Team Players Data */\r\n if (!empty($TeamPlayersData)) {\r\n\r\n /* To Delete Already Exist Player */\r\n $this->db->query('DELETE FROM `football_sports_team_players` WHERE MatchID = '.$Match['MatchID']);\r\n\r\n /* Insert Match Players */\r\n $this->db->insert_batch('football_sports_team_players', $TeamPlayersData);\r\n\r\n /* Update Team Lineup Flag */\r\n $this->db->where(array('MatchID' => $Match['MatchID'], 'IsTeamLineUp' => 'No'));\r\n $this->db->limit(1);\r\n $this->db->update('football_sports_matches',array('IsTeamLineUp' => 'Yes'));\r\n }\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
On read items post
public function onReadItemsPost(PostEvent $event) { $serializer = $this->getOptions ()->getSerializer (); $result = $event->getResult (); foreach ( $result as &$value ) { $value = $serializer->unserialize ( $value ); } $event->setResult ( $result ); }
[ "function PostProcessAllItems()\n {\n $this->NoSearches=TRUE;\n $this->NoPaging=TRUE;\n $this->IncludeAll=TRUE;\n\n $this->MyMod_Items_Read(\"\",array(),TRUE,TRUE,TRUE);\n }", "public function onReadItemsPost(PostEvent $event)\n {\n $serializer = $this->getOptions()->getSerializer();\n $result = $event->getResult();\n $params = $event->getParams();\n \n foreach ($result as &$value) { \n ### time to decrypt the result\n $decrypt = new data_decryptor() ;\n $decrypt->setDataLockKey(md5($params['key'])) ;\n $decrypted_value = $decrypt->filter($value) ;\n \n $value = $serializer->unserialize($decrypted_value);\n }\n $event->setResult($result);\n }", "private function readItems() {\n\t\tif (empty($this->items)) {\n\t\t\t$item = ClassRegistry::init('Item');\n\t\t\t$this->items = $item->find('list');\n\t\t}\n\t}", "function PostProcessItemData()\n {\n parent::PostProcessItemData();\n }", "function post() {\n //\n //Aler the user if you need to unpost future invoces, relative\n //to the current one????\n //\n //Post all the items in the natural order\n foreach ($this->record->items as $item) {\n //\n //Post this item\n $item->post();\n }\n //\n //Done\n echo \"Ok\";\n }", "function event_PostItem(&$data) {\n\t\tarray_push($this->posted_items, $data['item']->itemid);\n\t}", "function PostProcessItemData()\n {\n $this->ItemData[ \"State\" ][ \"Values\" ]=$this->ApplicationObj()->States_Short;\n $this->ItemData[ \"State\" ][ \"Default\" ]=9;//GO...\n \n $this->InscriptionsObj()->ItemData(\"ID\");\n $this->InscriptionsObj()->ItemDataGroups(\"Basic\");\n $this->InscriptionsObj()->Actions(\"Search\");\n\n\n $this->Unit2ItemData();\n $this->Today2ItemData();\n \n $this->ItemData[ \"HtmlIcon1\" ][ \"Coordinator\" ]=2;\n $this->ItemData[ \"HtmlIcon2\" ][ \"Coordinator\" ]=2;\n $this->ItemData[ \"Initials\" ][ \"Coordinator\" ]=2;\n }", "public function processItem(): void;", "abstract protected function doGetItemData();", "function PostProcessItemData()\n {\n $this->AddEventQuestDatas();\n $this->ItemDataGroups();\n }", "public function set_entry_read(){\n\t\t\tif(isset($_GET['post']) && is_numeric($_GET['post'])){\n\t\t\t\tif(get_post_type($_GET['post']) == 'flo_form_entry'){\n\t\t\t\t\tupdate_post_meta(sanitize_text_field($_GET['post']),'entry_read','read'); // set a meta data for the read entries\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function PostProcessItemData()\n {\n $this->PostProcessUnitData();\n $this->PostProcessEventData();\n }", "function set_posts_read () {\n if ($this->uid) {\n // the following 6 lines haven't changed since the old version -- I've\n // just added new code begining with the $count variable.\n $query = \"SELECT post_uid FROM tx_chcforum_posts_read WHERE feuser_uid=$this->uid\";\n $results = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);\n if (mysql_error()) t3lib_div::debug(array(mysql_error(), $query));\n while ($row = mysql_fetch_assoc($results)) {\n $posts_read_rows[] = $row['post_uid'];\n }\n $GLOBALS['TYPO3_DB']->sql_free_result($results);\n $count = count($posts_read_rows);\n if ($count > 1) {\n // There shouldn't ever really be more than one row per user in this table.\n // If there is, odds are it's because the data in the table is left over\n // from an old version of the forum (in older versions, we stored date for\n // one read post on each row, rather than in a serialized array. The\n // following lines take all this data and condense it into a serialized\n // array and stick it back in.\n\n // first, delete all the rows in the post table where uid = $this->uid\n $posts_read = $posts_read_rows;\n $table = 'tx_chcforum_posts_read';\n $where = 'feuser_uid='.$this->uid;\n $GLOBALS['TYPO3_DB']->exec_DELETEquery($table,$where);\n\n // then, add the new posts read array\n $data_arr['post_uid'] = serialize($posts_read);\n $data_arr['feuser_uid'] = $this->uid;\n $GLOBALS['TYPO3_DB']->exec_INSERTquery($table,$data_arr);\n } elseif ($count < 1) {\n $this->posts_read = array();\n } elseif ($count == 1) {\n $posts_read = unserialize($posts_read_rows[0]); \n }\n }\n $this->posts_read = $posts_read;\n if (!is_array($this->posts_read)) $this->posts_read = array();\n }", "public function takeItem(): void {\n $item = $this->spider->getItem();\n if($item) { //Check for a valid item\n $this->local_item_repository->addItem($item);\n }\n }", "public function postReadWatches();", "function OnEditItem(){\n if (! $this->error) {\n if ($this->disabled_edit) {\n }\n if ($this->item_id != 0) {\n\n $this->_data = $this->Storage->{$this->GetItemMethod}(array(\n $this->key_field => $this->item_id));\n $form_data = $this->Request->Form;\n $this->_data = array_merge($this->_data, $this->Request->Form);\n if ($this->multilevel) {\n $this->parent_id = $this->_data[$this->parent_field];\n }\n }\n $this->OnBeforeCreateEditControl();\n $this->InitItemsEditControl();\n } //!error\n }", "public function read_unread_entry(){\n\t\t\tif($_POST['is_read'] == 1){ // if the Entry was read already\n\t\t\t\t// we want to mark it as unread\n\t\t\t\tdelete_post_meta( sanitize_text_field($_POST['post_id']), 'entry_read');\n\t\t\t\t$response['is_read'] = 0;\n\t\t\t\t$response['text'] = __('Mark as read','flo-forms');\n\t\t\t}else{\n\t\t\t\tupdate_post_meta(sanitize_text_field($_POST['post_id']) ,'entry_read','read');\n\t\t\t\t$response['is_read'] = 1;\n\t\t\t\t$response['text'] = __('Mark as unread','flo-forms');\n\t\t\t}\n\n\t\t\techo json_encode($response);\n\t\t\texit();\n\t\t}", "abstract function process_item( $item );", "public function markRead() {\n\t\t$this->status = 'read';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation formsFormIdExportsGetAsyncWithHttpInfo Get list of Word and Excel exports
public function formsFormIdExportsGetAsyncWithHttpInfo($formId) { $returnType = 'object'; $request = $this->formsFormIdExportsGetRequest($formId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } ); }
[ "public function listExports()\n\t{\n\t\t$url = $this->getBetaAPIURL() . 'exports';\n\t\t$header = $this->getHeaderAuthBearer();\n\t\t$request = json_decode($this->cURLGet($url, $header));\n\t\treturn $request;\n\t}", "protected function formsFormIdExportsGetRequest($formId)\n {\n // verify the required parameter 'formId' is set\n if ($formId === null || (is_array($formId) && count($formId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $formId when calling formsFormIdExportsGet'\n );\n }\n\n $resourcePath = '/forms/{formId}/exports';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($formId !== null) {\n $resourcePath = str_replace(\n '{' . 'formId' . '}',\n ObjectSerializer::toPathValue($formId),\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function index()\n {\n $formId = intval($this->request->get('form_id'));\n\n $form = wpFluent()->table('fluentform_forms')->find($formId);\n\n if (!$form) {\n exit('No Form Found');\n }\n\n $type = sanitize_text_field($this->request->get('format', 'csv'));\n if (!in_array($type, ['csv', 'ods', 'xlsx', 'json'])) {\n exit('Invalid requested format');\n }\n\n if ($type == 'json') {\n $this->exportAsJSON($form);\n }\n\n if (!defined('FLUENTFORM_DOING_CSV_EXPORT')) {\n define('FLUENTFORM_DOING_CSV_EXPORT', true);\n }\n\n $formInputs = FormFieldsParser::getEntryInputs($form, array('admin_label', 'raw'));\n\n $inputLabels = FormFieldsParser::getAdminLabels($form, $formInputs);\n\n $submissions = $this->getSubmissions($formId);\n\n $submissions = FormDataParser::parseFormEntries($submissions, $form, $formInputs);\n $exportData = [];\n\n foreach ($submissions as $submission) {\n $submission->response = json_decode($submission->response, true);\n $temp = [];\n foreach ($inputLabels as $field => $label) {\n $temp[] = trim(\n wp_strip_all_tags(\n FormDataParser::formatValue(\n Arr::get($submission->user_inputs, $field)\n )\n )\n );\n }\n\n if ($form->has_payment && $this->tableName == 'fluentform_submissions') {\n $temp[] = round($submission->payment_total / 100, 1);\n $temp[] = $submission->payment_status;\n $temp[] = $submission->currency;\n }\n\n $temp[] = @$submission->id;\n $temp[] = @$submission->status;\n $temp[] = @$submission->created_at;\n\n $exportData[] = $temp;\n }\n\n $extraLabels = [];\n if ($form->has_payment && $this->tableName == 'fluentform_submissions') {\n $extraLabels[] = 'payment_total';\n $extraLabels[] = 'payment_status';\n $extraLabels[] = 'currency';\n }\n\n $extraLabels[] = 'entry_id';\n $extraLabels[] = 'entry_status';\n $extraLabels[] = 'created_at';\n\n $inputLabels = array_merge($inputLabels, $extraLabels);\n\n $data = array_merge([array_values($inputLabels)], $exportData);\n\n $data = apply_filters('fluentform_export_data', $data, $form, $exportData, $inputLabels);\n\n $fileName = sanitize_title($form->title, 'export', 'view') . '-' . date('Y-m-d');\n\n $this->downloadOfficeDoc($data, $type, $fileName);\n }", "public function listExports()\n\t{\n\t\t$url = $this->config['Config']['US']['BETA_API_URL'] . 'exports';\n\n\t\t$header = array(\n\t\t\t'Authorization: Bearer ' . $this->config['Config']['BETA_API_KEY']\n\t\t);\n\n\t\t$request = json_decode($this->cURLGet($url, $header));\n\t\treturn $request;\n\t}", "function getForms($id){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/formtemplates/';\n\t\t$request = $baseUrl . $endpoint . $id . '/forms';\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}", "function cf_support_rest_form_ids(){\n\treturn rest_ensure_response( cf_support_form_ids() );\n}", "public function retrieveForms()\n {\n return $this->start()->uri(\"/api/form\")\n ->get()\n ->go();\n }", "public function formsFormIdMultipleDataExportsExportIdPdfPostAsyncWithHttpInfo($formId, $exportId, $body = null)\n {\n $returnType = 'string';\n $request = $this->formsFormIdMultipleDataExportsExportIdPdfPostRequest($formId, $exportId, $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 forms() {\n\n return self::request($this->api_key, 'forms', array());\n }", "public function formsFormIdDataDataIdExportsExportIdPdfGetWithHttpInfo($formId, $dataId, $exportId)\n {\n $returnType = 'string';\n $request = $this->formsFormIdDataDataIdExportsExportIdPdfGetRequest($formId, $dataId, $exportId);\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 (!in_array($returnType, ['string','integer','bool'])) {\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 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function rest_api_all(WP_REST_Request $request) {\n // Check export\n if (!get_option('h5p_export', TRUE)) {\n return array(); // Export not enabled.\n }\n\n return rest_ensure_response($this->get_h5p_exports_list());\n }", "public function attendanceExportForm(){\n return Excel::download(new AttendanceFormat, 'attendanceForm.xlsx');\n }", "public function actionExport()\n {\n // Initialize export array.\n $data = [\n 'siteGroups' => [],\n 'sites' => [],\n 'routes' => [],\n 'fieldGroups' => [],\n 'filesystems' => [],\n 'volumes' => [],\n 'transforms' => [],\n 'tagGroups' => [],\n 'categoryGroups' => [],\n 'sections' => [],\n 'fields' => [],\n 'entryTypes' => [],\n 'globalSets' => [],\n 'userGroups' => [],\n 'users' => [],\n ];\n // The list of exportable items.\n $exportList = [\n 'sites' => [\n 'bodyParam' => 'siteSelection',\n 'postProcess' => [\n 'groupId' => 'siteGroups'\n ],\n ],\n 'sections' => [\n 'bodyParam' => 'sectionSelection',\n 'postProcess' => [\n 'entryTypes' => 'entryTypes'\n ],\n ],\n 'routes' => [\n 'bodyParam' => 'routeSelection',\n ],\n 'filesystems' => [\n 'bodyParam' => 'filesystemSelection',\n ],\n 'volumes' => [\n 'bodyParam' => 'volumeSelection',\n ],\n 'transforms' => [\n 'bodyParam' => 'imageTransformSelection',\n ],\n 'tagGroups' => [\n 'bodyParam' => 'tagSelection',\n ],\n 'categoryGroups' => [\n 'bodyParam' => 'categorySelection',\n ],\n 'fields' => [\n 'bodyParam' => 'fieldSelection',\n 'postProcess' => [\n 'groupId' => 'fieldGroups'\n ],\n ],\n 'globalSets' => [\n 'bodyParam' => 'globalSelection',\n ],\n 'userGroups' => [\n 'bodyParam' => 'userGroupSelection',\n ],\n 'users' => [\n 'bodyParam' => 'userSelection',\n ]\n ];\n\n foreach ($exportList as $processorName => $processorInfo) {\n $exportIds = Craft::$app->request->getBodyParam($processorInfo['bodyParam']);\n if ($exportIds) {\n foreach ($exportIds as $exportId) {\n if ($processorName === 'routes') {\n $exportObj = Architect::$processors->$processorName->exportByUid($exportId);\n } else if ($processorName === 'filesystems') {\n $exportObj = Architect::$processors->$processorName->exportByHandle($exportId);\n } else {\n $exportObj = Architect::$processors->$processorName->exportById($exportId);\n }\n\n if (isset($processorInfo['postProcess'])) {\n foreach ($processorInfo['postProcess'] as $postProcessKey => $postProcessorName) {\n switch ($postProcessKey) {\n case 'groupId':\n $groupName = Architect::$processors->$postProcessorName->exportById($exportObj[$postProcessKey]);\n if (in_array($groupName, $data[$postProcessorName], false) === false) {\n $data[$postProcessorName][] = $groupName;\n }\n unset($exportObj[$postProcessKey]);\n break;\n case 'entryTypes':\n if (isset($exportObj[$postProcessKey]) && is_array($exportObj[$postProcessKey])) {\n $data[$postProcessorName] = array_merge($data[$postProcessorName], $exportObj[$postProcessKey]);\n unset($exportObj[$postProcessKey]);\n }\n break;\n }\n }\n }\n\n $data[$processorName][] = $exportObj;\n }\n }\n }\n\n foreach ($data as $key => $value) {\n if (count($value) <= 0) {\n unset($data[$key]);\n }\n }\n\n $this->renderTemplate('architect/export_results', ['dump' => json_encode($data, JSON_PRETTY_PRINT)]);\n }", "function catalyst_expand_exports($exports, $groups) {\n // Build the collection of exports based on form input and export dependencies\n foreach (array_keys($exports) AS $type) {\n $group = $groups[$type];\n // Collect the export ids from submitted values\n foreach ($exports[$type] AS $id => &$export) {\n // Add dependency exports for this item\n $exports = catalyst_merge_exports($exports,\n catalyst_expand_export($export, $groups[$type], $groups));\n }\n }\n return $exports;\n}", "public static function ajax_process_export() {\n check_admin_referer('rg_start_export', 'rg_start_export_nonce');\n\n if (!GFCommon::current_user_can_any('gravityforms_export_entries')) {\n die();\n }\n\n $offset = absint(rgpost('offset'));\n $export_id = sanitize_key((rgpost('exportId')));\n\n $form_id = $_POST['export_form'];\n $form = RGFormsModel::get_form_meta($form_id);\n\n if (empty($export_id)) {\n $export_id = wp_hash(uniqid('export', true));\n $export_id = sanitize_key($export_id);\n }\n\n $status = self::start_export($form, $offset, $export_id);\n\n $filename = sanitize_title_with_dashes($form['title']) . '-' . gmdate('Y-m-d', GFCommon::get_local_timestamp(time())) . '.csv';\n $charset = get_option('blog_charset');\n header('Content-Description: File Transfer');\n header(\"Content-Disposition: attachment; filename=$filename\");\n header('Content-Type: text/csv; charset=' . $charset, true);\n echo $status['content'];\n\n die();\n }", "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}", "public function export_bulk() {\n\n\t\tif ( ! empty( $_POST['bulk_export_type'] ) ) {\n\t\t\tif ( ! empty( $_POST['bulk_export_fields'] ) ) {\n\t\t\t\t$export_fields = $_POST['bulk_export_fields'];\n\n\t\t\t\t$this->fields['export '] = array();\n\n\t\t\t\tif ( $this->pod ) {\n\t\t\t\t\t$fields = $this->pod->fields();\n\n\t\t\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t\t\tif ( in_array( $field['name'], $export_fields ) ) {\n\t\t\t\t\t\t\t$this->fields['export'][] = $field;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set up where clause so that export function finds it\n\t\t\tif ( ! empty( $_POST['action_bulk_ids'] ) ) {\n\t\t\t\t$ids = (array) explode( ',', $_POST['action_bulk_ids'] );\n\t\t\t\t$ids = array_map( 'absint', $ids );\n\t\t\t\t$ids = array_filter( $ids );\n\n\t\t\t\tif ( ! empty( $ids ) ) {\n\t\t\t\t\t$ids = implode( ', ', $ids );\n\n\t\t\t\t\t$this->where = array(\n\t\t\t\t\t\t'manage' => '`' . pods_sanitize( $this->sql['field_id'] ) . '` IN ( ' . $ids . ' )',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->export( $_POST['bulk_export_type'] );\n\n\t\t\t// Cleanup since export function calls get_data before returning\n\t\t\t$this->action_bulk = '';\n\t\t\t$this->where = array();\n\t\t\t$this->data = false;\n\n\t\t\t$_GET['action_bulk_ids'] = '';\n\n\t\t\t$this->manage();\n\t\t} else {\n\t\t\t$this->export_fields_form();\n\t\t}//end if\n\n\t}", "public function formsFormIdDataMultipleExcelCustomPostAsyncWithHttpInfo($body, $formId)\n {\n $returnType = '';\n $request = $this->formsFormIdDataMultipleExcelCustomPostRequest($body, $formId);\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 assignmentsSearchAndExportAsyncWithHttpInfo($real_estate_agency_id, $assignment_ids = null, $assignment_phases = null, $availabilty_statuses = null, $country_code = null, $employee_ids = null, $filter_by_assignment_types = null, $filter_by_real_estate_groups = null, $for_rent = null, $for_sale = null, $include_statistics = null, $listing_types = null, $localities = null, $office_ids = null, $order_by = null, $relation_ids = null, $term_fields = null, $culture = null, $filter_by_project_assignment_ids = null, $filter_by_object_type_assignment_ids = null, $filter_by_acquisition_assignment_ids = null, $ignore_old_versions = null, $has_key = null, $filter_by_key_numbers = null, $filter_by_furnishings = null, $filter_by_min_price = null, $filter_by_max_price = null, $filter_by_number_of_bedrooms_min = null, $filter_by_number_of_bedrooms_max = null, $is_cancelled = null, $acquisition_statuses = null, $available_from_min = null, $available_from_max = null, $available_until_min = null, $available_until_max = null, $filter_by_active = null, $order = null, $skip = null, $take = null, $term = null)\n {\n $returnType = '';\n $request = $this->assignmentsSearchAndExportRequest($real_estate_agency_id, $assignment_ids, $assignment_phases, $availabilty_statuses, $country_code, $employee_ids, $filter_by_assignment_types, $filter_by_real_estate_groups, $for_rent, $for_sale, $include_statistics, $listing_types, $localities, $office_ids, $order_by, $relation_ids, $term_fields, $culture, $filter_by_project_assignment_ids, $filter_by_object_type_assignment_ids, $filter_by_acquisition_assignment_ids, $ignore_old_versions, $has_key, $filter_by_key_numbers, $filter_by_furnishings, $filter_by_min_price, $filter_by_max_price, $filter_by_number_of_bedrooms_min, $filter_by_number_of_bedrooms_max, $is_cancelled, $acquisition_statuses, $available_from_min, $available_from_max, $available_until_min, $available_until_max, $filter_by_active, $order, $skip, $take, $term);\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 }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run this in the beginning of each cycle (updates all friends to recent engagement value)
private static function updateEngagement ( $uniID // <int> The UniID of the user to update the engagement with. , $friendID // <int> The UniID of the friend to update the engagement with. ) // RETURNS <bool> TRUE when finished, FALSE if fails. // self::updateEngagement($uniID, $friendID) { // End if the user is not a friend or follower if(!$clearance = AppFriends::getClearance($uniID, $friendID)) { return false; } // Retrieve the user's engagement levels over the past few cycles $total = 0; $lastCycle = date("Ym", time() - (3600 * 24 * 31 * 4)); $engagements = Database::selectMultiple("SELECT engage_value FROM friend_engagement WHERE uni_id=? AND cycle > ? AND friend_id=?", array($uniID, $lastCycle, $friendID)); foreach($engagements as $eng) { $total += (int) $eng['engage_value']; } // Set the Friend Engagement Value return Database::query("UPDATE IGNORE friends_list SET engage_value=? WHERE uni_id=? AND friend_id=? LIMIT 1", array($total, $uniID, $friendID)); }
[ "public function upcoming_meetings()\n {\n // Get upcoming meeting details\n $meetings = $this->reminder->get_upcoming_meetings();\n // Add memmbers\n $extended_meetings = $this->reminder->include_meeting_members($meetings);\n // Add emails to the queue\n $this->reminder->notify_members_of_upcoming_meeting($extended_meetings);\n // Update db\n $this->reminder->mark_meetings_as_sent($meetings);\n }", "private function setActivity()\n {\n $this->db->query(\"\n UPDATE\n `public_users`\n SET\n `last_activity` = NOW(),\n `online` = '1'\n WHERE\n `id` = '\" . $this->user['data']['id'] . \"'\n \");\n }", "function getFriendsAndBirthdays() {\n\t\n\tglobal $facebookapp, $cache, $db;\n\t\n\t// get friends with birthdays from cache or API\n\t$cacheid = \"friends_\".$facebookapp->userId;\n\t$friendsAndBirthdays = $cache->getCacheVal($cacheid,true);\n\tif ($friendsAndBirthdays === false) {\n\t\t$friendsAndBirthdays = array();\n\t\t$friends = $facebookapp->getGraphObject(\"me/friends\"); \n\t\tif ($friends !== false) {\n\t\t\t$urlarray = array();\n\t\t\tforeach ($friends['data'] as $friend) {\n\t\t\t\tarray_push($urlarray,$friend['id']);\n\t\t\t\tif (count($urlarray) == 50) {\n\t\t\t\t\t$batchrepsonse = $facebookapp->getBatchRequests($urlarray);\n\t\t\t\t\t$friendsAndBirthdays = array_merge($friendsAndBirthdays,$batchrepsonse);\n\t\t\t\t\t$urlarray = array();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count($urlarray) > 0) {\n\t\t\t\t$batchrepsonse = $facebookapp->getBatchRequests($urlarray);\n\t\t\t\t$friendsAndBirthdays = array_merge($friendsAndBirthdays,$batchrepsonse);\n\t\t\t}\n\t\t\t$cache->setCacheVal($cacheid,$friendsAndBirthdays,true,\"+1 day\");\n\t\t}\n\t}\n\t\n\t// create aray of friend ids\n\t$friendids = array();\n\tforeach ($friendsAndBirthdays as $freind) {\n\t\tarray_push($friendids,$freind['id']);\n\t}\n\t\n\t// now get scheduled greetings, and update friend info\n\t$sql = \"select userid, friendid, message, image, date from greeting where userid=?\";\n\t$stmt = $db->prepare($sql);\n\t$stmt->bind_param(\"s\",$facebookapp->userId);\n\t$stmt->execute();\n\t$stmt->bind_result($userid, $friendid, $message, $image, $date);\n\twhile ($stmt->fetch()) {\n\t\t$index = array_search($friendid,$friendids);\n\t\tif ($index !== false) {\n\t\t\t$friendsAndBirthdays[$index]['message'] = $message;\n\t\t\t$friendsAndBirthdays[$index]['image'] = $image;\n\t\t\t$friendsAndBirthdays[$index]['birthday'] = $date;\n\t\t}\n\t}\n\t$stmt->close();\n\t\n\treturn $friendsAndBirthdays;\n}", "public function updateYoutubeFollowers()\n {\n $needUpdate = YoutubeFollowers::whereDate('updated_at', '<', Carbon::today()->subDays(3)->toDateString())\n ->orWhere('updated_at', null)\n ->limit(env('UPDATE_LIMIT'))\n ->get();\n if ($needUpdate) {\n foreach ($needUpdate as $item) {\n /** @var YoutubeFollowers $item */\n $item->checkUsername()->getYoutubeInformation()->touch();\n }\n }\n }", "public function update_all_followers() {\r\n\t\t$counters = array();\r\n\t\t\r\n\t\t$require_check_in_cache = false;\r\n\t\tforeach ( $this->active_social_networks() as $social ) {\r\n\t\t\tswitch ($social) {\r\n\t\t\t\tcase 'twitter' :\r\n\t\t\t\t\t$count = $this->updater()->update_twitter ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'facebook' :\r\n\t\t\t\t\t$count = $this->updater()->update_facebook ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'google' :\r\n\t\t\t\t\t$count = $this->updater()->update_googleplus ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'pinterest' :\r\n\t\t\t\t\t$count = $this->updater()->update_pinterest ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'linkedin' :\r\n\t\t\t\t\t$count = $this->updater()->update_linkedin ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'vimeo' :\r\n\t\t\t\t\t$count = $this->updater()->update_vimeo ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'github' :\r\n\t\t\t\t\t$count = $this->updater()->update_github ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'dribbble' :\r\n\t\t\t\t\t$count = $this->updater()->update_dribbble ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'envato' :\r\n\t\t\t\t\t$count = $this->updater()->update_envato ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'soundcloud' :\r\n\t\t\t\t\t$count = $this->updater()->update_soundcloud ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'behance' :\r\n\t\t\t\t\t$count = $this->updater()->update_behance ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'foursquare' :\r\n\t\t\t\t\t$count = $this->updater()->update_foursquare ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'forrst' :\r\n\t\t\t\t\t$count = $this->updater()->update_forrst ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'mailchimp' :\r\n\t\t\t\t\t$count = $this->updater()->update_mailchimp ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'delicious' :\r\n\t\t\t\t\t$count = $this->updater()->update_delicious ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'instgram':\r\n\t\t\t\tcase 'instagram' :\r\n\t\t\t\t\t$count = $this->updater()->update_instagram ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'youtube' :\r\n\t\t\t\t\t$count = $this->updater()->update_youtube ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'vk' :\r\n\t\t\t\t\t$count = $this->updater()->update_vk ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'rss' :\r\n\t\t\t\t\t$count = $this->updater()->update_rss ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'vine' :\r\n\t\t\t\t\t$count = $this->updater()->update_vine ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'tumblr' :\r\n\t\t\t\t\t$count = $this->updater()->update_tumblr ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'slideshare' :\r\n\t\t\t\t\t$count = $this->updater()->update_slideshare ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '500px' :\r\n\t\t\t\t\t$count = $this->updater()->update_c500Px ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'flickr' :\r\n\t\t\t\t\t$count = $this->updater()->update_flickr ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'wp_posts' :\r\n\t\t\t\t\t$count = $this->updater()->update_wpposts ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'wp_comments' :\r\n\t\t\t\t\t$count = $this->updater()->update_wpcomments ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'wp_users' :\r\n\t\t\t\t\t$count = $this->updater()->update_wpusers ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'audioboo' :\r\n\t\t\t\t\t$count = $this->updater()->update_audioboo ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'steamcommunity' :\r\n\t\t\t\t\t$count = $this->updater()->update_steamcommunity ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'weheartit' :\r\n\t\t\t\t\t$count = $this->updater()->update_weheartit ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'feedly' :\r\n\t\t\t\t\t$count = $this->updater()->update_feedly ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'love' :\r\n\t\t\t\t\t$count = $this->updater()->update_love ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'spotify':\r\n\t\t\t\t\t$count = $this->updater()->update_spotify();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'twitch':\r\n\t\t\t\t\t$count = $this->updater()->update_twitch();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'mymail':\r\n\t\t\t\t\t$count = $this->updater()->update_mymail();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'mailpoet':\r\n\t\t\t\t\t$count = $this->updater()->update_mailpoet();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault :\r\n\t\t\t\t\t$count = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$counters[$social] = $count;\r\n\t\t\t\r\n\t\t\tif (empty($count)) {\r\n\t\t\t\t$require_check_in_cache = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// validete and apply active manual user values\r\n\t\t$is_active_selfcounts = HFSocialFollowersCounterHelper::get_option('uservalues');\r\n\t\tif ($is_active_selfcounts) {\r\n\t\t\tforeach ( $this->active_social_networks() as $social ) {\r\n\t\t\t\t$user_value = HFSocialFollowersCounterHelper::get_option($social.'_uservalue');\r\n\t\t\t\t$count = isset($counters[$social]) ? $counters[$social] : 0;\r\n\t\t\t\t\r\n\t\t\t\tif (intval($user_value) > intval($count)) {\r\n\t\t\t\t\t$count = $user_value;\r\n\t\t\t\t\t$counters[$social] = $count;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($require_check_in_cache) {\r\n\t\t\t// apply additional check for previously cached counters for blanked values\r\n\t\t\t$cached_counters = get_option ( $this->hellofollowers_cache_option_name );\r\n\t\t\t\r\n\t\t\tforeach ( $this->active_social_networks() as $social ) {\r\n\t\t\t\t$prev_value = isset($cached_counters[$social]) ? $cached_counters[$social] : 0;\r\n\t\t\t\t$new_value = isset($counters[$social]) ? $counters[$social] : 0;\r\n\t\t\t\t\r\n\t\t\t\tif (intval($new_value) < intval($prev_value)) {\r\n\t\t\t\t\t$counters[$social] = $prev_value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$expire_time = HFSocialFollowersCounterHelper::get_option ( 'update' );\r\n\t\tif ($expire_time == '') { $expire_time = 0; }\r\n\t\t\r\n\t\tupdate_option ( $this->hellofollowers_cache_option_name, $counters );\r\n\t\tupdate_option ( $this->hellofollowers_expire_name, (time () + ($expire_time * 60)) );\r\n\t\t\r\n\t\t// Profile Analytics Bridge\r\n\t\tif (class_exists('HFFollowersCounterBridge')) {\r\n\t\t\tforeach ( $this->active_social_networks() as $social ) {\r\n\t\t\t\t$new_value = isset($counters[$social]) ? $counters[$social] : 0;\r\n\r\n\t\t\t\tHFFollowersCounterBridge::log_single_network($social, $new_value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $counters;\r\n\t}", "function markAllConversationsAsRead()\r\n{\r\n\tglobal $config;\r\n\t$this->esoTalk->db->query(\"UPDATE {$config[\"tablePrefix\"]}members SET markedAsRead=\" . time() . \" WHERE memberId={$this->esoTalk->user[\"memberId\"]}\");\r\n\t$this->esoTalk->user[\"markedAsRead\"] = $_SESSION[\"user\"][\"markedAsRead\"] = time();\r\n}", "protected function updateCurrentLeads()\n\t{\n\t\t$stats_limits = new Stats_Limits($this->getConfig()->olp_db->getConnection()->getConnection());\n\t\tforeach ($this->target_list as $target)\n\t\t{\n\t\t\t$company = CompanyData::getCompany(EnterpriseData::resolveAlias($target->getStateData()->campaign_name));\n\t\t\t\n\t\t\t$target->getStateData()->current_leads =\n\t\t\t\t$stats_limits->count(\n\t\t\t\t\t\"bb_\".strtolower($company).\"_preferred_look\",\n\t\t\t\t\tNULL,\n\t\t\t\t\tNULL,\n\t\t\t\t\tNULL,\n\t\t\t\t\tBlackbox_Utils::getToday()\n\t\t\t\t);\n\t\t}\n\t}", "private function refreshRosters()\n {\n $this->teamA = $this->playingTeamA->refreshRoster($this->teamA);\n $this->teamB = $this->playingTeamB->refreshRoster($this->teamB);\n\n $this->teamA->restFor3Days();\n $this->teamB->restFor3Days();\n LogEvents::log(\"FS,\" . $this->goals[0] . ',' . $this->goals[1]);\n }", "protected function _accountFollowingMemberlist()\r\n\t{\r\n\t}", "private function friends()\n {\n $this->io->text('Adding friends ...');\n $this->storage->save(\"{$this->new->id}_friends\", $this->new->friends);\n \n $this->io->text([\n '✓ Complete',\n '-----------------------------------'\n ]);\n }", "function updateAllUsersStatus()\n {\n if (!is_object($this->members_obj));\n {\n $this->members_obj = new ilEphorusMembers($this);\n }\n\n $mems = $this->members_obj->getMembers();\n foreach ($mems as $mem)\n {\n $this->updateUserStatus($mem);\n }\n }", "public function update_become_friend()\n {\n log_message('info', '[update_become_friend] Starting recreate point');\n\n $users = $this->user_friend_model\n ->select('DISTINCT(user_friend.user_id)')\n ->join('user', 'user_friend.user_id = user.id')\n ->where('user.primary_type', 'student')\n ->where('user.status', 'active')\n ->where('user_friend.status', 'active')\n ->all();\n\n foreach ($users AS $user) {\n\n log_message('info', 'Create point for user_id: ' . $user->user_id);\n\n $this->user_rabipoint_model->create_rabipoint([\n 'user_id' => $user->user_id,\n 'case' => 'become_friend',\n 'modal_shown' => 0\n ]);\n }\n }", "public function _set_mutual_frnd_box() {\n\t\t// set mutual friend details\n\t\tif ($this->activeUser != null) {\n\t\t\t$user_friends_details = $this->FbFriend->find('all', array('conditions' => array('user_fb_id' => $this->activeUser['User']['fb_id'])));\n\t\t\t// pr($user_friends_details);\n\t\t\t$user_fb_id = array();\n\t \tforeach ($user_friends_details as $key => $value) {\n\t \t\t\tarray_push($user_fb_id, $value['FbFriend']['fb_id']);\n\t \t}\n\t \t// pr($user_fb_id);\n\t \t$mutual_friend_details = array();\n\t \tforeach ($user_fb_id as $fb_id) {\n\t \t\t$tmp_detials = $this->User->find('first', array('fields' => array('fb_name', 'fb_profilepic', 'fb_id'), 'conditions' => array('fb_id' => $fb_id)));\n\n\t \t\t// get last ad of friend\n\t \t\t$find_result = 'by_fb_id:\"'.$fb_id.'\"';\n\t\t\t\t$post = $this->AdPost->curlGet('axi_fxchng/_design/ad/_search/adSearch?q='.$find_result.'&sort=%22-sort_time%22&include_docs=true&limit=1');\n\t\t\t\t// pr($post);\n\t\t\t\tif ($post['total_rows'] == 1) {\n\t\t\t\t\t$this->set('post' ,$post['rows']);\n\t\t\t\t\t// pr($post);\n\t\t\t\t\t$ad_detail = '1 ad posted till';\n\t\t\t\t\t$ad_id = $post['rows'][0]['doc']['_id'];\n\t\t\t\t} else if ($post['total_rows'] > 1) {\n\t\t\t\t\t$ad_detail = $post['total_rows']. ' ads posted till.';\n\t\t\t\t\t$ad_id = $post['rows'][0]['doc']['_id'];\n\t\t\t\t} else {\n\t\t\t\t\t$ad_detail = 'No ad posted till';\n\t\t\t\t\t$ad_id = '0';\n\t\t\t\t}\n\t\t\t\tif ($tmp_detials != null) {\n\t\t\t\t\t$tmp_mutual_friend_details['mutual_friend_fb_id'] = $tmp_detials['User']['fb_id'];\n\t\t \t\t$tmp_mutual_friend_details['mutual_friend_name'] = $tmp_detials['User']['fb_name'];\n\t\t \t\t$tmp_mutual_friend_details['mutual_friend_pic'] = $tmp_detials['User']['fb_profilepic'];\n\t\t \t\t$tmp_mutual_friend_details['ad_detial'] = $ad_detail;\n\t\t \t\t$tmp_mutual_friend_details['mutual_friend_ad_details'] = $ad_id;\n\t\t \t\tarray_push($mutual_friend_details, $tmp_mutual_friend_details);\n\t\t\t\t}\n\t \t}\n\n\t \t$this->set('mutual_friend_details', $mutual_friend_details);\n\t\t}\n\t}", "function doEverything($session)\n{\n $user = $session->getSessionedUser();\n $current_timestamp = time();\n $yesterday = $current_timestamp - 1*24*60*60;\n $last_week = $current_timestamp - 7*24*60*60;\n $last_month = $current_timestamp - 30*24*60*60;\n $last_year = $current_timestamp - 365*24*60*60;\n //$updatesQuery = \"SELECT * FROM social.updates WHERE guid='{$user->guid}' AND pubDate > '$last_week'\";\n $updatesQuery = \"SELECT * FROM social.updates(100) WHERE guid='{$user->guid}'\";\n $updates = $session->query($updatesQuery);\n //error_log(print_r(countUpdatesPerGuid($updates), true));\n\n /*error_log($updates->query->count);\n error_log($updates->query->results->update[0]->profile_nickname);\n error_log($updates->query->results->update[0]->profile_guid);\n error_log($updates->query->results->update[0]->profile_displayImage);\n */\n //print_r($updates);\n // Fetch the updates for the contacts of the current user.\n $contactUpdatesQuery = \"select * from social.contacts.updates(0,10) where guid=me and updates='100';\";//select * from social.connections.updates(0,100) where guid='{$user->guid}' AND updates = '200'\";\n $mem_key_contacts=\"contacts:v9:updates:{$user->guid}\";\n $contactUpdates= mem_get($mem_key_contacts);\n if (!$contactUpdates)\n {\n $contactUpdates = $session->query($contactUpdatesQuery);\n mem_set($mem_key_contacts,$contactUpdates,3600);\n }\n // print_r($contactUpdates);\n $distinct_sources = array();\n $distinct_sources[0] = array();\n $allMyUpdates = countUpdatesForMe($updates,&$distinct_sources[0]);\n // error_log(print_r($allMyUpdates,true));\n $distinct_sources1 = array();\n $allContactUpdates = countUpdatesPerGuid($contactUpdates, &$distinct_sources1);\n $allDistinctSources = array_merge($distinct_sources, $distinct_sources1);\n $allUpdates = array_merge($allMyUpdates, $allContactUpdates);\n // error_log(print_r($allMyUpdates, true));\n // error_log(print_r($allContactUpdates, true));\n\n $badges=getMyBadges1($distinct_sources);\n foreach($allUpdates as $key=>$person)\n {\n// $badges = getMyBadges($person['guid'], $session);\n if(count($allDistinctSources[$key]) >= 8)\n {\n $badges = array_merge($badges, array(\"socialite\" => count($allDistinctSources[$key])));\n }\n $allUpdates[$key]['badges'] = $badges;\n break;\n }\n foreach($allUpdates as $key=>$person)\n {\n $newkey=$person['count']*100+$key;\n $newallUpdates[$newkey]=$person;\n }\n// return ($newallUpdates);\n //$badges = getMyBadges($user->guid,$session);\n //echo json_encode($badges);\n // $badges = getMyBadges($user->guid, $session);\n// return $badges;\n sendVitality($user,$session,$badges);\n return $newallUpdates;\n}", "public function setUpdatedMessaging() {\n $this->readedAt = new \\DateTime();\n $this->setIsReaded(true);\n }", "private function fillMemcacheUserVars()\n\t{\n\t\t$info = $this->model->getVal('infomail_message', 'foodsaver', fsId());\n\t\t\n\t\tif((int)$info > 0)\n\t\t{\n\t\t\tMem::userSet(fsId(), 'infomail', true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tMem::userSet(fsId(), 'infomail', false);\n\t\t}\n\t\t\n\t\t$this->model->updateActivity();\n\t}", "public function reset_user_notification_next_hour() {\n\t\tini_set('memory_limit', '1024M');\n\t\t\n\t\t$next_hour = date('H', strtotime('+1 hour')); \n\t\t\n\t\t$user_notifications = $this->UserNotification->find('all', array(\n\t\t\t'fields' => array('UserNotification.id', 'UserNotification.user_id', 'UserNotification.'.$next_hour),\n\t\t\t'order' => 'UserNotification.id ASC',\n\t\t\t'recursive' => -1\n\t\t)); \n\t\t$total = count($user_notifications);\n\t\t\n\t\t$this->out('Updating '.$total.' records for '.$next_hour.':00'); \n\t\t$i = 0; \n\t\tforeach ($user_notifications as $user_notification) {\n\t\t\t$i++; \n\t\t\tif (empty($user_notification['UserNotification'][$next_hour])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->UserNotification->create();\n\t\t\t$this->UserNotification->save(array('UserNotification' => array(\n\t\t\t\t'id' => $user_notification['UserNotification']['id'],\n\t\t\t\t$next_hour => '0',\n\t\t\t\t'modified' => false\n\t\t\t)), true, array($next_hour)); \n\t\t\t$pct = round($i / $total * 100, 2);\n\t\t\t$this->out($i .' / '.$total.' ('.$pct.'%) '.$user_notification['UserNotification']['user_id']); \n\t\t}\n\t\t$this->out('Completed');\n\t}", "static function dailyAward() {\n \t$fromdate = date(\"Y-m-d\", strtotime(\"-1 day\")) .\" 00:00:00\";\n \t$todate = date(\"Y-m-d\", strtotime(\"-1 day\")) .\" 23:59:59\";\n \t$profile = new Profile();\n \t$profile->query('BEGIN');\n\t\t$profile->query(\"select id, followers from profile\");\n\t\twhile($profile->fetch()) {\n\t\t\tif($profile->followers>999) {\n\t\t\t\tif(User::getNoticesNum($profile->id, $fromdate, $todate)>4){\n\t\t\t\t\tUser_grade::addScore($profile->id, 50);\n\t\t\t\t\t// Send a system message to the user who got award\n $content = '您的跟随者达到了1000人以上,昨日发消息数超过5条,'. common_config('site', 'name') . '为您增加了5个铜G币作为奖励。';\n System_message::saveNew(array($profile->id), $content, $content, 0);\n\t\t\t\t}\n\t\t\t}else if($profile->followers>99){\n\t\t\t if(User::getNoticesNum($profile->id, $fromdate, $todate)>4){\n\t\t\t\t\tUser_grade::addScore($profile->id, 20);\n\t\t\t\t\t$content = '您的跟随者达到了100人以上,昨日发消息数超过5条,' . common_config('site', 'name') . '为您增加了2个铜G币作为奖励。';\n System_message::saveNew(array($profile->id), $content, $content, 0);\n\t\t\t\t}\n\t\t\t}else if($profile->followers>49){\n\t\t\t if(User::getNoticesNum($profile->id, $fromdate, $todate)>4){\n\t\t\t\t\tUser_grade::addScore($profile->id, 10);\n\t\t\t\t\t$content = '您的跟随者达到了50人以上,昨日发消息数超过5条,'. common_config('site', 'name') . '为您增加了1个铜G币作为奖励。';\n System_message::saveNew(array($profile->id), $content, $content, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$profile->query('COMMIT');\n\t\t$profile->free();\n }", "public function updateOnline() : void\n {\n $this->lastOnline = time();\n $this->lastIp = Net::ip();\n\n DB::table('users')\n ->where('user_id', $this->id)\n ->update([\n 'user_last_online' => $this->lastOnline,\n 'last_ip' => Net::pton($this->lastIp),\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
List of migration file paths to be loaded
public function migrationPaths() { return [ dirname(__DIR__, 3) . '/database/migrations', ]; }
[ "public function getMigrationPaths();", "public function getMigrationsPaths(): iterable;", "protected function getAllMigrationFiles() {\n\t\treturn $this->migrator->getMigrationFiles($this->getMigrationPaths());\n\t}", "protected function getAllMigrationFiles()\n {\n return $this->migrator->getMigrations();\n }", "protected function getAllMigrationFiles()\n {\n return $this->migrator->getMigrationFiles($this->getMigrationPaths());\n }", "public function loadMigrationFromModules()\n {\n $paths = [];\n if (!$this->modules) {\n return $paths;\n }\n $modulesCollection = collect($this->modules);\n $activeModules = $modulesCollection->get(self::MODULE_VERSION);\n\n foreach ($activeModules as $key => $moduleName) {\n $paths[] = $this->path . DIRECTORY_SEPARATOR . self::MODULE_VERSION . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR . 'Migrations';\n }\n\n return $paths;\n }", "protected function get_migration_file_list()\n\t{\n\t\tif ($this->migrations !== false)\n\t\t{\n\t\t\treturn $this->migrations;\n\t\t}\n\n\t\t// Only have the finder search in this extension path directory\n\t\t$migrations = $this->extension_finder\n\t\t\t->extension_directory('/migrations')\n\t\t\t->find_from_extension($this->extension_name, $this->extension_path);\n\n\t\t$migrations = $this->extension_finder->get_classes_from_files($migrations);\n\n\t\t$this->migrator->set_migrations($migrations);\n\n\t\t$migrations = $this->migrator->get_migrations();\n\n\t\treturn $migrations;\n\t}", "private function getMigrationsOnFileSystem()\n {\n $migrationFiles = glob($this->migrationPath);\n \n $migrations = array();\n foreach( $migrationFiles as $migrationFile ) {\n $migrations += $this->loader->loadFile($migrationFile);\n }\n \n ksort($migrations);\n \n return $migrations;\n }", "protected function loadMigrations()\n {\n $migrations = sfFinder::type('file')->name('/^\\d{3}.*\\.php$/')->maxdepth(0)->in($this->getMigrationsDir());\n sort($migrations);\n foreach($migrations as $migration)\n {\n $this->migrations[current(explode('_', basename($migration), 2))] = $migration;\n }\n \n // grab \n }", "private static function migrationPaths()\n {\n $migrationDirs = [];\n foreach (app('migrator')->paths() as $path) {\n $migrationDirs[] = str_replace([\n '\\\\',\n '/',\n ], [\n DIRECTORY_SEPARATOR,\n DIRECTORY_SEPARATOR,\n ], $path);\n }\n\n /*foreach ($migrationDirs as $dir) {\n $parts = explode(DIRECTORY_SEPARATOR, $dir);\n\n foreach($parts as $part) {\n\n }\n }*/\n\n return $migrationDirs;\n }", "protected function getMigrationFiles()\n {\n $config = $this->getConfig();\n $paths = $config->getMigrationPaths();\n $files = [];\n\n foreach ($paths as $path) {\n $files = array_merge(\n $files,\n Util::glob($path . DIRECTORY_SEPARATOR . '*.php')\n );\n }\n // glob() can return the same file multiple times\n // This will cause the migration to fail with a\n // false assumption of duplicate migrations\n // http://php.net/manual/en/function.glob.php#110340\n $files = array_unique($files);\n\n return $files;\n }", "protected function getMigrationPaths() {\n\t\t// Here, we will check to see if a path option has been defined. If it has we will\n\t\t// use the path relative to the root of the installation folder so our database\n\t\t// migrations may be run for any customized path from within the application.\n\t\tif ($this->input->hasOption('path') && $this->input->getOption('path')) {\n\t\t\treturn collect($this->input->getOption('path'))->map(function ($path) {\n\t\t\t\treturn ! $this->usingRealPath()\n\t\t\t\t\t\t\t\t? App::getApp()->getBasePath(). '/' .$path\n\t\t\t\t\t\t\t\t: $path;\n\t\t\t})->all();\n\t\t}\n\n\t\treturn array_merge(\n\t\t\t$this->migrator->paths(),\n\t\t\t[$this->getMigrationPath()]\n\t\t);\n\t}", "static function load_migrations() {\n\t\t$migration_file_contents = file_get_contents(self::$migration_file);\n\t\t$migrations = json_decode($migration_file_contents);\n\t\treturn $migrations;\n\t}", "protected function getMigrationPaths(): array\n {\n // Here, we will check to see if a path option has been defined. If it has we will\n // use the path relative to the root of the installation folder so our database\n // migrations may be run for any customized path from within the application.\n if ($this->input->hasOption('path') && $this->input->getOption('path')) {\n return collect($this->input->getOption('path'))->map(function ($path) {\n return ! $this->usingRealPath()\n ? BASE_PATH . DIRECTORY_SEPARATOR . $path\n : $path;\n })->all();\n }\n\n return array_merge(\n $this->migrator->paths(),\n [$this->getMigrationPath()]\n );\n }", "private function pluginMigrations()\n {\n $files = [];\n\n if (file_exists($this->pluginManifestOfMigrations)) {\n $basePath = base_path();\n /** @noinspection PhpIncludeInspection */\n $migrations = include $this->pluginManifestOfMigrations;\n foreach ($migrations as $name => $file) {\n $files[$name] = $basePath . DIRECTORY_SEPARATOR . $file;\n }\n }\n\n return $files;\n }", "protected function getMigrationPaths(): array|string\n {\n $module = $this->getLastMigrationModule();\n\n if ($module !== null) {\n return $this->getMigrationPathByModule($module);\n }\n\n return $this->parentCall(\"getMigrationPaths\");\n }", "protected function getMigrationPaths()\n {\n return [\n database_path('migrations/tenant')\n ];\n }", "public function getMigrationFiles(string $path): array;", "public static function getMigrationPathsInfo()\n {\n $variables = Config::get('yentu:default.variables', []);\n $otherMigrations = Config::get('yentu:default.other_migrations', []);\n \n return array_merge(\n array(\n array(\n 'home' => Yentu::getPath('migrations'),\n 'variables' => $variables\n )\n ), \n $otherMigrations\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$fd>addText($text); // default weight is "c" $fd>addText($text,"a"); $fd>addText($text,array("weight" => "a"));
function addText($text,$options = array()){ if(is_string($options)){ $options = array("weight" => $options); } $options += array( "weight" => "c", ); $weight = $options["weight"]; $weight = strtolower($weight); if(!in_array($weight,array("a","b","c","d"))){ throw new Exception("Unknown text weight: $weight"); } $text = trim($text); if(!strlen($text)){ return; } $this->$weight .= " ".$text; $this->$weight = ltrim($this->$weight); }
[ "public function setfontweight($weight){}", "public function stylingAttributeTextWeight($text_weight)\n {\n }", "public function setfontweight($weight)\n {\n }", "function getFontWeight(){}", "public function getfontweight()\n {\n }", "public function setWeight($weight);", "function PDF_add_textflow($pdfdoc, $textflow, $text, $optlist){}", "public function addText($text)\n {}", "function AddText($pdf, $text, $x, $y, $a, $f, $t, $s, $r, $g, $b)\n {\n $pdf->SetFont($f, $t, $s);\n $pdf->SetXY($x, $y);\n $pdf->SetTextColor($r, $g, $b);\n $pdf->Cell(0, 10, $text, 0, 0, $a);\n }", "public function getFontWeight () {}", "public function __construct($text = null, $weight = null, $link = null)\n\t{\n\t\tif ($text)\n\t\t\t$this->_text = $text;\n\t\t\t\n\t\tif ($link)\n\t\t\t$this->_link = $link;\n\t\t\t\n\t\tif ($weight)\n\t\t\t$this->_weight = $weight;\n\t}", "function HasFontWeight(){}", "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 getFontWeight() {}", "function wb_create_font($name, $height, $color = null, $flags = null) {}", "function\taddMyText( $_text='') {\n\t\tBDoc::addText( $this->defParaFmt, $_text, false) ;\n\t}", "function pdf_add_textflow(& $pdf, $textflow, $text, $optlist = [])\n\t{\n\t}", "function addText($params)\n {\n $x0 = $this->_getX($params['x']);\n $y0 = $this->_getY($params['y']);\n $text = str_replace(\"\\r\", '', $params['text']);\n $color = (isset($params['color']) ? $params['color'] : false);\n $textHeight = $this->textHeight($text);\n $alignment = (isset($params['alignment']) ? $params['alignment'] : false);\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 (($color === false) && (isset($this->_font['color']))) {\n $color = $this->_font['color'];\n }\n\n if ($color == 'transparent') {\n return;\n }\n\n if (strpos($this->_font['file'], '.') === false) {\n $this->_font['file'] = IMAGE_CANVAS_SYSTEM_FONT_PATH . $this->_font['file'] . '.fdb';\n }\n\n $textColor = $this->_color($color);\n $textOpacity = $this->_opacity($color);\n\n $lines = explode(\"\\n\", $text);\n foreach ($lines as $line) {\n\n $x = $x0;\n $y = $y0;\n\n $y0 += $textHeight + 2;\n\n $width = $this->textWidth($line);\n $height = $this->textHeight($line);\n\n if ($alignment['horizontal'] == 'right') {\n $x -= $width;\n } else if ($alignment['horizontal'] == 'center') {\n $x -= $width / 2;\n }\n\n $font = new SWFFont($this->_font['file']);\n $text = new SWFText();\n $text->setFont($font);\n $text->moveTo($x, $y + $this->_font['size']);\n $text->setColor($textColor[0], $textColor[1], $textColor[2], $textOpacity);\n $text->setHeight($this->_font['size']);\n $text->addString($line);\n $this->_canvas->add($text);\n }\n\n parent::addText($params);\n }", "function AppendText($text){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all companies belonging to current user.
private function getUserCompanies() { $userId = Auth::user()->id; return Company::where('user', $userId)->get(); }
[ "public function getCompanies(User $user)\n {\n return response($user->getCompanies()->paginate());\n }", "public static function companies(){\n return Company::all();\n }", "public function getCompanyAll();", "public function getAllCompanyList()\n {\n return $this->model\n ->where('status', '=', '2')\n ->get();\n }", "public function get_companies() {\n\n\t\t\t$request = $this->base_uri . '/core/companies';\n\n\t\t\treturn $this->fetch( $request );\n\n\t\t}", "public function userCompanies()\n {\n return $this->hasMany(UserCompany::class, 'user_id');\n }", "function getCompanies() {\n\n\t\t/******************************\n\t\t* Get which fields to fetch\n\t\t******************************/\n\n\t\t$ids = array();\n\n\t\tfor($i = 0, $num = func_num_args(); $i < $num; $i++) {\n\t\t\t$arg = func_get_arg($i);\n\n\t\t\tif (is_array($arg)) {\n\t\t\t\t$ids = array_merge($ids, $arg);\n\t\t\t} else {\n\t\t\t\t$ids[] = $arg;\n\t\t\t}\n\t\t}\n\n\t\t$ids = array_unique($ids);\n\t\t$got_ids = array_keys($this->companies);\n\n\t\t// Only get the ones that aren't already cachced\n\t\t$fetch_ids = array_diff($ids, $got_ids);\n\n\n\t\t/******************************\n\t\t* Get the comps\n\t\t******************************/\n\n\t\tif ($fetch_ids) {\n\t\t\tglobal $db;\n\n\t\t\t$db->query(\"\n\t\t\t\tSELECT * FROM user_company\n\t\t\t\tWHERE id IN \" . array2sql($fetch_ids) . \"\n\t\t\t\");\n\n\t\t\twhile ($comp = $db->row_array()) {\n\t\t\t\t$this->companies[$comp['id']] = $comp;\n\t\t\t}\n\t\t}\n\n\n\t\t/******************************\n\t\t* Return them\n\t\t******************************/\n\n\t\t$ret = array();\n\n\t\tforeach ($ids as $id) {\n\t\t\t$ret[$id] = $this->companies[$id];\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function getUsersWithCompanies()\n {\n $users = User::with('companies')->get();\n\n return $users;\n }", "public function getCompanies();", "public function getCompany()\n {\n $company = user()->company;\n if ($company) {\n $meta = $company->meta ?? [];\n $company = array_merge($meta, $company->toArray());\n $company['industry'] = user()->company->industry;\n }\n return $this->respond(compact('company'));\n }", "public function getActiveCompanies()\n {\n return $this->company->getActiveCompanies();\n }", "public function get_company_of_user(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'user_id' => 'required',\n ]);\n if ($validator->fails()) {\n return AdapterHelper::sendResponse(false, 'Validator error', 400, $validator->errors()->first());\n }\n try {\n //code...\n $user = User::find($request->user_id);\n if (!$user) {\n return AdapterHelper::sendResponse(false, 'Not found', 404, 'User Not Found');\n }\n $data = $user->company()->get();\n } catch (\\Throwable $th) {\n //throw $th;\n AdapterHelper::write_log_error($th, \"Mobile\", $request->getRequestUri());\n return AdapterHelper::sendResponse(false, 'Undefined error', 500, $th->getMessage());\n }\n return AdapterHelper::sendResponse(true, $data, 200, 'success');\n }", "function get_all_user_company()\n {\n $this->db->order_by('Id', 'desc');\n return $this->db->get('user_company')->result_array();\n }", "public function get_company($id_user)\n\t{\n\t\t return $this->CI->db->select(PREFIX.'companies.Name, '.PREFIX.'companies.LogoPath, '.PREFIX.'companies.Street, '.PREFIX.'companies.StreetNumber, '.PREFIX.'companies.Country, '.PREFIX.'companies.ZIP, '.PREFIX.'companies.City')\n\t\t \t\t\t\t\t ->from(PREFIX.'users, '.PREFIX.'companies')\n\t\t \t\t\t\t\t ->where(PREFIX.'users.id', $id_user)\n\t\t \t\t\t\t\t ->where(PREFIX.'companies.ID', 1)\n \t\t\t\t\t ->get();\n\t}", "public function getCustomerCompanies()\n {\n return $this->customerCompanies;\n }", "public function companies()\n {\n return $this->belongsToMany('App\\Company', 'company_user', 'user_id', 'company_id')->withTimestamps();\n }", "function get_user_company($user_companies_id)\n {\n return $this->db->get_where('user_companies',array('user_companies_id'=>$user_companies_id))->row_array();\n }", "private function getRequestedCompanies()\n {\n $collection = $this->companyCollectionFactory->create();\n $collection = $this->filter->getCollection($collection);\n\n return $collection->getItems();\n }", "public function Findallcompanies()\n {\n \treturn TblAcaCompanies::find()->joinWith('client')->where(['tbl_aca_clients.is_deleted'=>0])->All();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set alanguageChanger.show to true if we need to show the language changer.
private function makeLanguageChanger() { $this->aSurveyInfo['alanguageChanger']['show'] = false; $alanguageChangerDatas = getLanguageChangerDatas($this->sLangCode); if ($alanguageChangerDatas) { $this->aSurveyInfo['alanguageChanger']['show'] = true; $this->aSurveyInfo['alanguageChanger']['datas'] = $alanguageChangerDatas; } }
[ "public function showLanguagesPanel()\n {;\n return $this->render('admin/languages.html.twig');\n }", "public function showLanguage()\n {\n return view('pages.settings.language.index');\n }", "function setLanguage(/*...*/);", "function showSwitchLangForm($display = true, array $options = []) {\n\n $params = [\n 'value' => $_SESSION[\"glpilanguage\"],\n 'display' => false,\n 'showbutton' => true\n ];\n\n foreach ($options as $key => $value) {\n $params[$key] = $value;\n }\n\n $out = '';\n $out .= \"<form method='post' name='switchlang' action='\".User::getFormURL().\"' autocomplete='off'>\";\n $out .= \"<p class='center'>\";\n $out .= Dropdown::showLanguages(\"language\", $params);\n if ($params['showbutton'] === true) {\n $out .= \"&nbsp;<input type='submit' name='update' value=\\\"\"._sx('button', 'Save').\"\\\" class='submit'>\";\n }\n $out .= \"</p>\";\n $out .= Html::closeForm(false);\n\n if ($display === true) {\n echo $out;\n } else {\n return $out;\n }\n }", "public function toggle() {\n $lang_code = $this->routeMatch->getParameter('code');\n\n $languages = $this->config('origins_translations.languages')->getRawData();\n\n $languages[$lang_code][1] = !$languages[$lang_code][1];\n\n $this->configFactory->getEditable('origins_translations.languages')->setData($languages)->save();\n\n return $this->redirect('origins_translations.settings.languages');\n\n }", "public function setLanguage();", "public static function disableAcfLanguageAppending()\n {\n add_filter(self::LANGUAGE_SETTING_ACF_FILTER, '__return_false');\n }", "public function changeLanguageBasedOnBrowserHint()\n {\n if (function_exists('http_negotiate_language'))\n {\n $this->changeLanguage(http_negotiate_language(array_keys($this->languages)));\n }\n }", "public function isLanguageAlterable();", "function show_deprecated_domain_setting( $show ) {\n\t\treturn true;\n\t}", "public function setLocaleChecked()\n {\n $this->_getSession()->setLanguageChecked(true);\n }", "function change_lang_block()\n{\n\n\tif (get_locale() != 'ar')\n\t{\n\t\t$lang = 'ar';\n\t\t$lang_txt = 'العربية';\n\t}\n\telse\n\t{\n\t\t$lang = 'en';\n\t\t$lang_txt = 'English';\n\t}\n\t\n\techo '<div id=\"lang-box\">' . PHP_EOL .\n\t\t '<a href=\"' . qtrans_convertURL('', $lang) . '\">' . $lang_txt . '</a>' . PHP_EOL .\n\t\t '</div>';\n\n}", "function displayLanguagesForm() {\n\t\t$show['form'] = $this->addEditLangForm ();\n\t\t$show['list'] = $this->getLangsList ();\n\n\t\treturn $this->output = $this->html->languagesMain($show);\n\t}", "protected function setLanguage() {\n\t\tglobal $wgLang;\n\t\t$language = false;\n\t\t\n\t\tif ( $this->isSomething( 'uselang' ) ) {\n\t\t\t$language = $this->getVal( 'uselang' );\n\t\t} elseif ( $this->isSomething( 'language' ) ) {\n\t\t\t$language = $this->getVal( 'language' );\n\t\t}\n\t\t\n\t\tif ( $language == false\n\t\t\t|| !Language::isValidBuiltInCode( $this->normalized['language'] ) )\n\t\t{\n\t\t\t$language = $wgLang->getCode() ;\n\t\t}\n\t\t\n\t\t$this->setVal( 'language', $language );\n\t\t$this->expunge( 'uselang' );\n\t\t\n\t\tif ( !$this->isSomething( 'premium_language' ) ){\n\t\t\t$this->setVal( 'premium_language', $language );\n\t\t}\n\t\t\n\t}", "protected function redirect_lang() {\n\t\t?>\n\t\t<label>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<input name=\"redirect_lang\" type=\"checkbox\" value=\"1\" %s/> %s',\n\t\t\t\tchecked( $this->options['redirect_lang'], 1, false ),\n\t\t\t\tesc_html__( 'The front page url contains the language code instead of the page name or page id', 'polylang' )\n\t\t\t);\n\t\t\t?>\n\t\t</label>\n\t\t<p class=\"description\">\n\t\t\t<?php\n\t\t\t// That's nice to display the right home urls but don't forget that the page on front may have no language yet\n\t\t\t$lang = $this->model->post->get_language( $this->page_on_front );\n\t\t\t$lang = $lang ? $lang : $this->model->get_language( $this->options['default_lang'] );\n\t\t\tprintf(\n\t\t\t\t/* translators: %1$s example url when the option is active. %2$s example url when the option is not active */\n\t\t\t\tesc_html__( 'Example: %1$s instead of %2$s', 'polylang' ),\n\t\t\t\t'<code>' . esc_html( $this->links_model->home_url( $lang ) ) . '</code>',\n\t\t\t\t'<code>' . esc_html( _get_page_link( $this->page_on_front ) ) . '</code>'\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t\t<?php\n\t}", "function setLanguage($shortLanguage)\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t\t$this->options['language'] = I18N_m23instLanguage($shortLanguage);\n\t\t$this->addInfoMessage($I18N_languageChangedTo_one.$this->options['language'].$I18N_languageChangedTo_two);\n\t}", "public function actionSwitchLanguage()\n {\n if (!\\Yii::$app->user->can('editCompanyData', ['class'=>static::class])) {\n \\Yii::$app->getSession()->setFlash('AccessDenied', 'Access denied');\n return $this->render('@app/modules/account/views/denied/access-denied');\n }\n\n Yii::$app->cookieLanguageSelector->setLanguage(Yii::$app->request->post('language'));\n $this->redirect(Yii::$app->request->post('redirectTo', ['settings']));\n }", "public function showEncodingSelectionUi( $blShowCharsetError = false )\n {\n $sCurrCharset = oxLang::getInstance()->translateString( 'charset', null, true );\n\n ?><html>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <style>\n body, input { font:11px Trebuchet MS, Tahoma, Verdana, Arial, Helvetica, sans-serif; }\n body { margin: 20px; }\n b { color: red; }\n </style>\n <title>Update script</title>\n\n <body>\n <form>\n <input type=\"hidden\" name=\"sCurrAction\" value=\"setCharset\">\n\n <?php if ( $blShowCharsetError ) { ?>\n <b></>Wrong charset name</b><br>\n <?php } ?>\n\n Please write old admin charset name:\n <input type=\"text\" name=\"sCurrCharset\" value=\"<?php echo $sCurrCharset;?>\">\n <input type=\"submit\" value=\"proceed\"><br />\n <?php if ( $sCurrCharset ) { echo '(Current value is taken from admin language file)<br>'; } ?>\n\n </form>\n </body>\n </html><?php\n exit;\n }", "public function showLocalizationView()\n {\n $this->subMenu['localization']['active'] = true;\n\n Session::flash('redirect_to', $this->subMenu['localization']['url']);\n\n return View::make('admin.settings.localization')\n ->withPageTitle(trans('admin.settings.localization.localization').' - '.trans('admin.admin'))\n ->withSubMenu($this->subMenu);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the policy rules from registry
public static function getPolicyRules () { return Registry::get ('MVC_POLICY'); }
[ "public function getPolicyRules()\n {\n if (array_key_exists(\"policyRules\", $this->_propDict)) {\n return $this->_propDict[\"policyRules\"];\n } else {\n return null;\n }\n }", "public function getRules();", "protected function getRules()\n {\n return array_merge($this->_instanceRules, static::$_rules);\n }", "public static function getRules(): Rules\n {\n $config = config('domain-parser');\n $manager = self::getManager($config);\n $url = $config['url_psl'] ?? Manager::PSL_URL;\n $ttl = $config['cache_ttl'] ?? null;\n\n try {\n return $manager->getRules($url, $ttl);\n } catch (TypeError $e) {\n return $manager->getRules($url, $ttl);\n }\n }", "public function policy()\n {\n \t$return = array();\n \t\n \t// Itterate over policy rules\n \tforeach( $this->rules as $k => $v )\n \t{\n \t\t// If rule is enabled, add string to array\n \t\t$string = $this->get_rule_error($k);\n \t\tif( $string ) {\n \t\t\t$return[$k] = $string;\n \t\t}\n \t}\n \treturn $return;\n }", "public function get_rules() {\n if ( isset( $this->dynamic_rules ) )\n return $this->dynamic_rules;\n\n if ( is_callable( array( YITH_WC_Dynamic_Pricing(), 'recover_pricing_rules' ) ) ) {\n $this->dynamic_rules = YITH_WC_Dynamic_Pricing()->recover_pricing_rules();\n } else {\n $this->dynamic_rules = YITH_WC_Dynamic_Pricing()->get_option( 'pricing-rules' );\n }\n\n return $this->dynamic_rules;\n }", "public function storeRules()\n {\n return [];\n }", "function getPolicies($absPath);", "public function getRegisterRules()\n {\n return $this::$registerRules;\n }", "public function getRules(): array\n {\n return $this->aRules;\n }", "private static function getRules() {\n return [\n 'title' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'director' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ],\n 'runlength' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 30,\n 'max_range' => 300\n ]\n ],\n 'description' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'activated' => [\n 'filter' => FILTER_VALIDATE_BOOLEAN,\n 'flags' => FILTER_NULL_ON_FAILURE\n ],\n 'price' => FILTER_VALIDATE_FLOAT\n ];\n }", "function ratty_admin_get_rules($scope) {\n return ratty_do_call('admin_get_rules', array($scope));\n}", "private function generateRules()\n \t{\n \t\treturn CMap::mergeArray($this->generateContentRules(), $this->generateCategoryRules());\n \t}", "public function getRules()\n {\n $rules = SOE\\DB\\User::where('users.id', '=', $this->primary_key)\n ->join('role_users', 'users.id', '=', 'role_users.user_id')\n ->join('roles', 'role_users.role_id', '=', 'roles.id')\n ->join('role_rules', 'roles.id', '=', 'role_rules.role_id')\n ->join('rules', 'role_rules.rule_id', '=', 'rules.id')\n ->groupBy('rules.id')\n ->get(array('rules.*'));\n $return = array();\n foreach($rules as $r)\n {\n $rule = Rule::blank();\n foreach($r->getAttributes as $key => $value)\n {\n $rule->$key = $value;\n }\n $rule->primary_key = $r->id;\n $rule->sync();\n $return[] = $rule;\n }\n return $return;\n }", "public function getRules()\n {\n return $this->config('rules', []);\n }", "public function getPolicies()\n {\n $policies = [];\n $cls = new \\ReflectionClass($this);\n foreach ($cls->getMethods() as $method) {\n $matches = [];\n if (preg_match('/^policy(.+)$/', $method->name, $matches)) {\n $policies[] = lcfirst($matches[1]);\n }\n }\n sort($policies);\n\n return $policies;\n }", "public function getRules()\n\t{\n\t\t// rules are already loaded, skip loading\n\t\tif (is_null($this->rules))\n\t\t{\n\t\t\t$this->rules = self::loadYaml();\n\t\t\t\n\t\t\t// convert rule arrays to objects\n\t\t\tforeach($this->rules as $class_name => &$rule_definition)\n\t\t\t{\n\t\t\t\t$rule_definition = $this->loadRule($class_name, $rule_definition);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// return rules\n\t\treturn $this->rules;\n\t}", "function getEffectivePolicies($absPath);", "public static function getAvailableRules(): array\n {\n return array_map(function ($lang) {\n return strtolower(basename($lang, '.json'));\n }, glob(__DIR__.'/../rules/[^common].json'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the action to check if we have an import running
public function actionCheck_import_status() { $pid = $this->getImportPID(); $update = Tbl_ImportTplFiles::model()->updateAll(array('pid'=>0),$pid ? 'pid != :pid':'',$pid ? array(':pid'=>$pid):array()); echo $update ? 'true':'false'; }
[ "protected function isImportEnabled() : bool {}", "public static function is_importing() {\n\t\tforeach ( self::get_schedulers() as $scheduler ) {\n\t\t\tif ( $scheduler::is_importing() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function isRunning(ImportPart $part);", "public function hasImports()\n {\n return count($this->imports) > 0;\n }", "private static function is_processing_import() {\n\t\treturn ( get_query_var( 'page' ) == __CLASS__ . '_import' );\n\t}", "public function canImport() {\n\t\treturn $this->source->canImport();\n\t}", "public function isImportFailed(): bool\n {\n }", "public function isImported(): bool\n {\n return $this->importedAsset !== null;\n }", "private static function check_import_free()\n {\n $import_status = explode(':', self::get_import_status());\n if ($import_status[0] !== 'free') {\n return false;\n }\n\n return true;\n }", "public function importCanStart()\n {\n if (is_null($this->_file)) {\n $this->getFlagFile();\n }\n if (!$this->addFlagToFile()) {\n $timestamp = $this->readFlagFile();\n if ($timestamp !== false && (time() - (integer)$timestamp) > (60 * 25)) {\n $this->addFlagToFile();\n return true;\n }\n return false;\n }\n return true;\n }", "public abstract function isImported();", "function getImportStatus();", "public function _checkImportStatus()\n {\n if ($items = $this->_getImportingItems($this->bulkSyncLimit)) {\n foreach ($items as $item) {\n $websiteId = $item->getWebsiteId();\n $client = false;\n if ($this->helper->isEnabled($websiteId)) {\n $client = $this->helper->getWebsiteApiClient(\n $websiteId\n );\n }\n if ($client) {\n try {\n if ($item->getImportType() == self::IMPORT_TYPE_CONTACT ||\n $item->getImportType() == self::IMPORT_TYPE_SUBSCRIBERS ||\n $item->getImportType() == self::IMPORT_TYPE_GUEST\n ) {\n $response = $client->getContactsImportByImportId($item->getImportId());\n } else {\n $response = $client->getContactsTransactionalDataImportByImportId(\n $item->getImportId()\n );\n }\n } catch (\\Exception $e) {\n $item->setMessage($e->getMessage())\n ->setImportStatus(self::FAILED);\n $this->saveItem($item);\n continue;\n }\n\n $this->processResponse($response, $item, $websiteId);\n }\n }\n }\n }", "public static function isFromTask() {\n // if is from cmd script\n try{\n $sf_instance = sfContext::getInstance();\n } catch (Exception $ex) {\n $sf_instance = null;\n }\n $module = $sf_instance ? $sf_instance->getModuleName() : null;\n if (empty($module)) {\n return true;\n }else{\n return false;\n } \n }", "public function is_import_export_screen() {\n\t\treturn is_admin() && ! wp_doing_ajax() && isset( $_GET['page'] ) && 'rank-math-status' === $_GET['page'] && isset( $_GET['view'] ) && 'import_export' === $_GET['view'];\n\t}", "public static function isExecuting(): bool\n {\n // Get the ROOT path, which will also throw the PluginNotInitializedException if necessary.\n $root = self::getRootPath();\n\n // Return TRUE if the UCRM specified file exists!\n return file_exists(\"$root/.ucrm-plugin-execution-requested\");\n }", "public function isForceImport(): bool\n {\n return (bool) $this->forceImport;\n }", "public function checkImportPrerequisites() {}", "public function testImporting()\n {\n $importer = new Importer(100);\n $result = $importer->startImport();\n $this->assertEquals($result->result, true);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this is for fetching top book recomendations when the user is not selecting any books or genres
public function getTopBookRecommendation() { $recommendation = (new BookRepository(new BookRecommendation())); $data = $recommendation->getWithOrderBy('counts','desc')->map(function($data){ return array( 'genre_id_1' => $data->genre_id_1, 'genre_id_2' => $data->genre_id_2, ); }); $data = $this->getUniqueRecommended($data); $finalData = []; foreach($data as $key => $values) { $data = $this->getBookByGenre($values); $finalData = array_merge($finalData,$data); } return json_encode($finalData); }
[ "public function getTopReview()\n {\n $fields = [\n 'name',\n 'image',\n 'avg_rating',\n ];\n $reviewBooks = Book::select($fields)->withCount(['posts' => function ($query) {\n $query->where('type', Book::REVIEW_TYPE);\n }])->orderBy('posts_count', 'DESC')\n ->limit(Book::TOP_REVIEW_LIMIT)\n ->get();\n return metaResponse(['data' => $reviewBooks]);\n }", "static function top_requested_books($limit = BOOK_NUMBER_HOME)\r\n {\r\n return Book::top_requested($limit);\r\n }", "function getTopViewBooks() {\r\n $query = $this->db\r\n ->select('bookTitle, bookViewCount')\r\n ->from('book')\r\n ->order_by('bookViewCount', 'DESC')\r\n ->limit(5)\r\n ->get()\r\n ->result();\r\n return $query;\r\n }", "function getBooksMostRecommendedNumRows($local_search) {\n\t//\t$query = \"SELECT COUNT(*) as count FROM book_title b WHERE b.rating>0 \";\n\t\t\t$query = \"SELECT COUNT(*) as count FROM book_title b, \".$GLOBALS['COMIC_DBWEB'].\".comic_rating a WHERE a.code=b.code AND a.recommended>0 \";\n\t\tif ( $genre != \"\" )\n\t\t\t$query = $query.\" AND b.genre='\".$genre.\"' \";\n\t\tif ( $local_search != \"\" ) {\n\t\t\t$local_search = str_replace(' ', '%', $local_search);\n\t\t\t$query = $query. \" AND ( b.title LIKE ('%\".$local_search.\"%') OR b.author_name LIKE ('%\".$local_search.\"%'))\";\n\t\t}\n\t\t$mysql = new MySQLComic($GLOBALS['COMIC_DB']);\n\t\t$result = $mysql->query($query);\n\t\t$row = mysqli_fetch_array($result);\n\t\treturn $row['count'];\n\t}", "public function getMostViewedBooks($connection){\n $query = \"SELECT * FROM book_info ORDER BY view_count DESC LIMIT 0,3\";\n $result = $connection->query($query);\n return $result;\n }", "public function mostPopular(){\n $this->_curl->get( $this->_path.'discover/movie',[\n 'sort_by' => 'popularity.desc',\n 'page' => 1,\n 'year' => date('Y'),\n 'api_key' => $this->_key\n ]);\n\n if ($this->_curl->error) {\n echo $this->_curl->error_code;\n }\n else {\n echo $this->_curl->response;\n }\n }", "public static function top_rated($limit = BOOK_NUMBER_HOME)\r\n {\r\n $books = collect();\r\n BookEvaluation::orderBy('evaluate', 'desc')->limit($limit)->groupBy('book_id')->get()->map(function ($item) use ($books) {\r\n if ($book = $item->book) {\r\n $books->push($book);\r\n }\r\n return $item;\r\n });\r\n return $books;\r\n }", "public function findTop10()\n {\n $criteria = ['rgm_inner.rating IS NOT NULL', 'rgm_inner.rating_count > :rating_count'];\n $params = ['rating_count' => 20];\n $order_by = [\"rgm_inner.rating DESC\", \"rgm_inner.rating_count DESC\"];\n $limit = 12;\n $sql = $this->buildAlbumSelectQuery($criteria, $order_by, $limit);\n return $this->getEntityManager()->getConnection()->executeQuery($sql, $params)->fetchAll();\n }", "public function getTopSixBooks($bookId)\n {\n $this->db->select('userId');\n $this->db->where('isbnNo', $bookId);\n $this->db->from('user_viewed_book');\n $subQuery1 = $this->db->get_compiled_select();\n\n $this->db->distinct();\n $this->db->select('isbnNo');\n $this->db->select('COUNT(isbnNo) as total');\n $this->db->from('user_viewed_book');\n $this->db->where(\"userId IN ($subQuery1)\", null, false);\n $this->db->group_by(\"isbnNo\");\n $this->db->order_by('total', 'DESC');\n $this->db->limit(6);\n $subQuery2 = $this->db->get_compiled_select();\n\n $this->db->select('*');\n $this->db->from('book AS bookTable');\n $this->db->join(\"($subQuery2) AS viewTable\", 'bookTable.isbnNo = viewTable.isbnNo', 'INNER');\n $this->db->order_by('viewTable.total', 'DESC');\n $result = $this->db->get();\n\n /*\n SELECT\n *\n FROM\n book AS bookTable\n INNER JOIN(\n SELECT DISTINCT\n isbnNo,\n COUNT(isbnNo) AS total\n FROM\n user_viewed_book\n WHERE\n userId IN(\n SELECT\n userId\n FROM\n user_viewed_book\n WHERE\n isbnNo = '6240934'\n )\n GROUP BY\n isbnNo\n ORDER BY\n total\n DESC\n LIMIT 6\n ) AS viewTable\n ON\n bookTable.isbnNo = viewTable.isbnNo\n ORDER BY\n viewTable.total\n DESC;\n */\n\n // check the number of rows in the result\n if ($result->num_rows() === 0) {\n return false;\n } else {\n return $result->result();\n }\n }", "function getPopular($conn) {\n $popular = \"SELECT title FROM audio_book INNER JOIN purchase On audio_book.ISBN = purchase.ISBN GROUP BY title ORDER BY count(purchase.ISBN) DESC LIMIT 6\";\n $result = mysqli_query($conn, $popular);\n if(mysqli_num_rows($result) > 0) {\n return $result;\n } else {\n echo 'Nothing <br>';\n exit;\n }\n }", "function top_review (){\n \n $this->stmt = $this->pdo->prepare(\n \"SELECT COUNT(remark) AS ReviewNumber, product_id, product_image, product_url FROM product_review GROUP BY product_id order by ReviewNumber desc limit 5\");\n $this->stmt->execute();\n $top_review = $this->stmt->fetchAll();\n\t \n // create key array\n /* foreach ($top_review as $key => $row) {\n $review[$key] = $row[\"ReviewNumber\"];\n }\n\n //sort results based on key\n array_multisort($review, SORT_DESC, $top_review);\n\n\t $five_top_review_product = array_slice($review, 0, 5, true);\n\t return $five_top_review_product;*/\n\t \n\t return $top_review;\n }", "public static function top_liked($limit = BOOK_NUMBER_HOME)\r\n {\r\n $books = BookFavourite::join('books', 'books.id', '=', 'book_likes.book_id')\r\n ->select('books.*', DB::raw('COUNT(book_likes.book_id) as book_count'))\r\n ->groupBy('books.id')\r\n ->orderBy('book_count', 'desc')->limit(BOOK_NUMBER_HOME)->get()->toArray();\r\n return Book::hydrate($books);\r\n }", "public static function HighestRatedBooks()\n\t{\n\t\t$query = \"SELECT *\n FROM books\n GROUP BY stars / ratings DESC\n LIMIT 5\";\n\t\t\t\t \n\t\treturn Database::Query($query);\n\t}", "public function getOpinions($book){\n $sql = \"SELECT o.title, o.txt, o.note, o.pubDate, a.username, o.id, o.author FROM opinion o\n INNER JOIN account a ON o.author=a.id\n INNER JOIN book b ON o.book=b.id\n WHERE b.id=\".intval($book).\"\n ORDER BY o.pubDate DESC;\";\n $res = mysqli_query($this->link, $sql);\n $opinions = mysqli_fetch_all($res);\n return $opinions;\n }", "public function get_most_popular($params = [])\n {\n // Validate\n $v = $this->validator($params);\n $v->set_rules('subject_id', '教科書ID', 'required|valid_multiple_id');\n\n if (FALSE === $v->run()) {\n return $v->error_json();\n }\n\n // Load model\n $this->load->model('textbook_model');\n\n if(isset($params['textbook_id'])) {\n $this->textbook_model->where_in('textbook.id', $params['textbook_id']);\n }\n\n // Get textbook info\n $textbook = $this->textbook_model\n ->join('cache_textbook_count', 'cache_textbook_count.textbook_id = textbook.id', 'left')\n ->with_publisher()\n ->with_master_subject()\n ->with_master_grade()\n ->select('cache_textbook_count.count')\n ->where_in('master_subject.id', explode(',', $params['subject_id']))\n ->all();\n\n // Build the textbook\n $res = [];\n if($textbook) {\n foreach ($textbook as $k) {\n\n // Get the most popular textbook by subject_id\n if(isset($res[$k->subject_id])) {\n if($res[$k->subject_id]->count < $k->count) {\n $res[$k->subject_id] = $k;\n }\n continue;\n }\n\n $res[$k->subject_id] = $k;\n }\n\n // Sort the most popular subject first\n usort($res, function($a, $b) {\n return $b->count - $a->count;\n });\n }\n\n // Return\n return $this->true_json([\n 'items' => $this->build_responses($res, ['subject_detail', 'school_count']),\n 'total' => count($res),\n ]);\n }", "public function top(){\r\n $this->model->getTopProducts();\r\n $this->extra();\r\n $this->model->setPageHeader('Top 5');\r\n include_once 'views/productTopDoc.php';\r\n $view = new productTopDoc($this->model);\r\n $view->show();\r\n }", "function find_most_popular_movie($limit_num=50){\n\t\t//$limit_num is the limit number of the top rows in the result\n\t\tglobal $connection;\n\t\t$query =\"select id, name, year, picture, ave_star, director,rating from movie \";\n\t\t$query .=\"Order by count desc \";\n\t\t$query .= \"Limit {$limit_num}; \";\n\t\t$result = mysqli_query($connection, $query);\n\t\tconfirm_query($result);\n\t\treturn $result;\n\t}", "public function getBestSellers(){\n\n\t\t$best_sellers = array();\n\n\t\t$this->db->selectTable('book');\n\t\t$this->db->select(array('id', 'name', 'price', 'sale_off', 'hot', 'rating', 'image'))\n\t\t\t\t\t->where(array('best_seller' => 1));\n\n\t\t$best_sellers = $this->db->query();\n\n\t\t$this->db->selectTable('author');\n\t\t$this->db->joinTable('book');\n\n\t\t// getting books' authors\n\t\tforeach($best_sellers as &$best_seller) {\n\n\t\t\t$this->db->select(array('id', 'name'))->join(array('id' => 'author_id'))\n\t\t\t\t\t\t->where(array('id' => $best_seller['id']), \"book\");\n\n\t\t\t$best_seller['author'] = $this->db->query()[0];\n\t\t\n\t\t}\n\n\t\treturn $best_sellers;\n\n\t}", "public static function getRecommendationsForUser($buyer_id, $seller_id = 0) {\n\n $results = Database::query('SELECT Auction.* FROM Auction WHERE Auction.id IN\n (SELECT Bid.auction_id FROM Bid WHERE Bid.userrole_id IN\n (SELECT Bid.userrole_id FROM Bid WHERE Bid.auction_id IN\n (SELECT Bid.auction_id FROM Bid WHERE Bid.userrole_id = ?)))\n AND Auction.end_date > now() AND NOT Auction.userrole_id = ?\n AND NOT EXISTS (SELECT * FROM Bid WHERE Bid.auction_id = Auction.id AND userrole_id = ?)',\n [$buyer_id, $seller_id, $buyer_id]);\n\n\n if(count($results) == 0) {\n /*\n if on the auctions the user bid he was the only bidder\n give suggestions from top categories he bought from\n\n */\n $results = Database::query('SELECT DISTINCT Auction.* FROM Auction JOIN Item ON Auction.id = Item.auction_id\n WHERE Item.id IN (SELECT DISTINCT(ItemCategory.item_id) FROM ItemCategory JOIN\n (SELECT ItemCategory.category_id, COUNT(ItemCategory.item_id) as no_items FROM ItemCategory JOIN\n (SELECT Item.id FROM Bid JOIN Item ON Bid.auction_id = Item.auction_id\n WHERE Bid.userrole_id = ?) AS BidItems\n ON ItemCategory.item_id = BidItems.id\n GROUP BY ItemCategory.category_id\n ORDER BY no_items\n LIMIT 1) as TopCategories\n ON ItemCategory.category_id = TopCategories.category_id)\n AND Auction.end_date > now()\n AND NOT Auction.userrole_id = ?\n AND NOT EXISTS (SELECT * FROM Bid WHERE Bid.auction_id = Auction.id AND userrole_id = ?)', [$buyer_id, $seller_id, $buyer_id]);\n\n }\n\n if(count($results) == 0) {\n\n /*\n if the user did not bid on any auction, recommend from popular categories\n\n */\n\n $results = Database::query('SELECT DISTINCT Auction.* FROM Auction JOIN Item ON Auction.id = Item.auction_id\n WHERE Item.id IN (SELECT DISTINCT(ItemCategory.item_id) FROM ItemCategory JOIN\n (SELECT ItemCategory.category_id, COUNT(ItemCategory.item_id) as no_items FROM ItemCategory\n GROUP BY ItemCategory.category_id\n ORDER BY no_items\n LIMIT 1) as TopCategories\n ON ItemCategory.category_id = TopCategories.category_id)\n AND Auction.end_date > NOW()\n AND NOT Auction.userrole_id = ?\n AND NOT EXISTS (SELECT * FROM Bid WHERE Bid.auction_id = Auction.id AND userrole_id = ?)', [$seller_id, $buyer_id]);\n\n\n }\n\n return self::processAuctionsResultSetSql($results);\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets conversion options for idn_to_ascii. combination of IDNA_ constants (except IDNA_ERROR_ constants).
public function getAsciiIDNAOption(): int { return $this->asciiIDNAOption; }
[ "function idnSupported()\r\n {\r\n return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');\r\n }", "public function idnSupported()\n {\n // @TODO: Write our own \"idn_to_ascii\" function for PHP <= 5.2.\n return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');\n }", "public function getConvertOptionsAsString()\n {\n $options = $this->imagePath . ' ';\n foreach ($this->convertCommandOptions as $commandKey => $commandValue) {\n $options .= implode(' ', $this->getConvertFilters($commandKey)) . ' ';\n $options .= \"-{$commandKey} {$commandValue} \";\n }\n\n return $options;\n }", "function idn_to_unicode($ascii_domain, &$errorcode = NULL)\n{\n}", "protected function getIsoCodes() {}", "public function idnaEncodeDataProvider()\n {\n return [\n 'empty string' => [\n '',\n ''\n ],\n 'null value' => [\n null,\n ''\n ],\n 'string with ascii chars' => [\n 'example',\n 'example'\n ],\n 'domain (1) with utf8 chars' => [\n 'dömäin.example',\n 'xn--dmin-moa0i.example'\n ],\n 'domain (2) with utf8 chars' => [\n 'äaaa.example',\n 'xn--aaa-pla.example'\n ],\n 'domain (3) with utf8 chars' => [\n 'déjà.vu.example',\n 'xn--dj-kia8a.vu.example'\n ],\n 'domain (4) with utf8 chars' => [\n 'foo.âbcdéf.example',\n 'foo.xn--bcdf-9na9b.example'\n ],\n 'domain with utf8 char (german umlaut)' => [\n 'exömple.com',\n 'xn--exmple-xxa.com'\n ],\n 'email with utf8 char (german umlaut)' => [\n 'joe.doe@dömäin.de',\n 'joe.doe@xn--dmin-moa0i.de'\n ]\n ];\n }", "protected function getOptions() {\n return [\n STR_PAD_RIGHT => $this->t('Right'),\n STR_PAD_LEFT => $this->t('Left'),\n STR_PAD_BOTH => $this->t('Both'),\n ];\n }", "protected function getItoa64()\n {\n return self::ITOA64;\n }", "public static function getYesNoOptions()\n {\n return [\n 1 => UsniAdaptor::t('application', 'Yes'),\n 0 => UsniAdaptor::t('application', 'No'),\n ];\n }", "function getValidacionInspeccionOptions() {\r\n $opciones = null;\r\n $sql = \"SELECT evi_id , evi_nombre from encuesta_validar_inspeccion \";\r\n $r = $this->db->ejecutarConsulta($sql);\r\n if ($r) {\r\n $cont = 0;\r\n while ($w = mysql_fetch_array($r)) {\r\n $opciones[$cont]['id'] = $w['evi_id'];\r\n $opciones[$cont]['nombre'] = $w['evi_nombre'];\r\n $cont++;\r\n }\r\n }\r\n return $opciones;\r\n }", "protected function _mapAscii() {\n\t\t$this->_ascii_class = array(\n\t\t\tself::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR,\n\t\t\tself::S_ERR, self::S_WSP, self::S_WSP, self::S_ERR, self::S_ERR, self::S_WSP, self::S_ERR, self::S_ERR,\n\t\t\tself::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR,\n\t\t\tself::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR, self::S_ERR,\n\n\t\t\tself::S_SPA, self::S_ETC, self::S_QUO, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC,\n\t\t\tself::S_ETC, self::S_ETC, self::S_ETC, self::S_PLU, self::S_COM, self::S_MIN, self::S_DOT, self::S_SLA,\n\t\t\tself::S_ZER, self::S_DIG, self::S_DIG, self::S_DIG, self::S_DIG, self::S_DIG, self::S_DIG, self::S_DIG,\n\t\t\tself::S_DIG, self::S_DIG, self::S_COL, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC,\n\n\t\t\tself::S_ETC, self::S_A_F, self::S_A_F, self::S_A_F, self::S_A_F, self::S_E , self::S_A_F, self::S_ETC,\n\t\t\tself::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC,\n\t\t\tself::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC,\n\t\t\tself::S_ETC, self::S_ETC, self::S_ETC, self::S_LBT, self::S_BAC, self::S_RBT, self::S_ETC, self::S_ETC,\n\n\t\t\tself::S_ETC, self::S__A_, self::S__B_, self::S__C_, self::S__D_, self::S__E_, self::S__F_, self::S_ETC,\n\t\t\tself::S_ETC, self::S_ETC, self::S_ETC, self::S_ETC, self::S__L_, self::S_ETC, self::S__N_, self::S_ETC,\n\t\t\tself::S_ETC, self::S_ETC, self::S__R_, self::S__S_, self::S__T_, self::S__U_, self::S_ETC, self::S_ETC,\n\t\t\tself::S_ETC, self::S_ETC, self::S_ETC, self::S_LBE, self::S_ETC, self::S_RBE, self::S_ETC, self::S_ETC\n\t\t);\n\t}", "public function getAccIdAsOptions()\n {\n $accIds = (new Account())->getAccIdAsOptions($this->getNIC());\n $tblQuery = \"\";\n foreach ($accIds as $value) { \n $tblQuery = $tblQuery . \n \"<option value='\".$value[\"accID\"].\"'>\".$value[\"accID\"].\"</option>\";\n }\n return $tblQuery;\n }", "public function withAsciiIDNAOption(int $option): self\n {\n if ($option === $this->asciiIDNAOption) {\n return $this;\n }\n\n return new self($this->publicSuffix, $this->section, $option, $this->unicodeIDNAOption);\n }", "function getCharsetSelect() {\n //jc:12293 - the \"labels\" or \"human-readable\" representations of the various charsets\n //should be translatable\n $translated = array();\n foreach($this->availableCharsets as $key)\n {\n \t //$translated[$key] = translate($value);\n $translated[$key] = translate($key);\n }\n\n\t\treturn $translated;\n //end:12293\n\t}", "public function setAsciiOptions($options = array())\n {\n $this->asciiOptions = $options;\n }", "function UTF2ASCII($code) {\n $UTFchars = array ( //code point UTF8 character name\n '/À/' => 'A', // U+00C0 c3 80 Latin capital letter A with grave\n '/Á/' => 'A', // U+00C1 c3 81 Latin capital letter A with acute\n '/Â/' => 'A', // U+00C2 c3 82 Latin capital letter A with circumflex\n '/Ã/' => 'A', // U+00C3 c3 83 Latin capital letter A with tilde\n '/Ä/' => 'A', // U+00C4 c3 84 Latin capital letter A with diaeresis\n '/Å/' => 'A', // U+00C5 c3 85 Latin capital letter A with ring above\n '/Æ/' => 'AE', // U+00C6 c3 86 Latin capital letter AE\n '/Č/' => 'C', // U+010C c4 8c Latin capital letter C with caron\n '/Ç/' => 'C', // U+00C7 c3 87 Latin capital letter C with cedilla\n '/È/' => 'E', // U+00C8 c3 88 Latin capital letter E with grave\n '/É/' => 'E', // U+00C9 c3 89 Latin capital letter E with acute\n '/Ê/' => 'E', // U+00CA c3 8a Latin capital letter E with circumflex\n '/Ë/' => 'E', // U+00CB c3 8b Latin capital letter E with diaeresis\n '/Ì/' => 'I', // U+00CC c3 8c Latin capital letter I with grave\n '/Í/' => 'I', // U+00CD c3 8d Latin capital letter I with acute\n '/Î/' => 'I', // U+00CE c3 8e Latin capital letter I with circumflex\n '/Ï/' => 'I', // U+00CF c3 8f Latin capital letter I with diaeresis\n '/Ł/' => 'L', // U+0141 c5 81 Latin capital letter L with stroke\n '/Ñ/' => 'N', // U+00D1 c3 91 Latin capital letter N with tilde\n '/Ò/' => 'O', // U+00D2 c3 92 Latin capital letter O with grave\n '/Ó/' => 'O', // U+00D3 c3 93 Latin capital letter O with acute\n '/Ô/' => 'O', // U+00D4 c3 94 Latin capital letter O with circumflex\n '/Õ/' => 'O', // U+00D5 c3 95 Latin capital letter O with tilde\n '/Ö/' => 'O', // U+00D6 c3 96 Latin capital letter O with diaeresis\n '/Ø/' => 'O', // U+00D8 c3 98 Latin capital letter O with stroke\n '/Ù/' => 'U', // U+00D9 c3 99 Latin capital letter U with grave\n '/Ú/' => 'U', // U+00DA c3 9a Latin capital letter U with acute\n '/Û/' => 'U', // U+00DB c3 9b Latin capital letter U with circumflex\n '/Ü/' => 'U', // U+00DC c3 9c Latin capital letter U with diaeresis\n '/Ř/' => 'R', // U+0158 c5 98 Latin capital letter R with caron\n '/Š/' => 'S', // U+0160 c5 a0 Latin capital letter S with caron\n '/Ý/' => 'Y', // U+00DD c3 9d Latin capital letter Y with acute\n '/Ỳ/' => 'Y', // U+1EF2 e1 bb b2 Latin capital letter Y with grave\n '/Ž/' => 'Z', // U+017D c5 bd Latin capital letter Z with caron\n '/Ż/' => 'Z', // U+017B c5 bb Latin capital letter Z with dot above\n '/à/' => 'a', // U+00E0 c3 a0 Latin small letter a with grave\n '/á/' => 'a', // U+00E1 c3 a1 Latin small letter a with acute\n '/â/' => 'a', // U+00E2 c3 a2 Latin small letter a with circumflex\n '/ã/' => 'a', // U+00E3 c3 a3 Latin small letter a with tilde\n '/ä/' => 'a', // U+00E4 c3 a4 Latin small letter a with diaeresis\n '/å/' => 'a', // U+00E5 c3 a5 Latin small letter a with ring above\n '/æ/' => 'ae', // U+00E6 c3 a6 Latin small letter ae\n '/č/' => 'c', // U+010D c4 8d Latin small letter c with caron\n '/ç/' => 'c', // U+00E7 c3 a7 Latin small letter c with cedilla\n '/è/' => 'e', // U+00E8 c3 a8 Latin small letter e with grave\n '/é/' => 'e', // U+00E9 c3 a9 Latin small letter e with acute\n '/ê/' => 'e', // U+00EA c3 aa Latin small letter e with circumflex\n '/ë/' => 'e', // U+00EB c3 ab Latin small letter e with diaeresis\n '/ì/' => 'i', // U+00EC c3 ac Latin small letter i with grave\n '/í/' => 'i', // U+00ED c3 ad Latin small letter i with acute\n '/î/' => 'i', // U+00EE c3 ae Latin small letter i with circumflex\n '/ï/' => 'i', // U+00EF c3 af Latin small letter i with diaeresis\n '/ł/' => 'l', // U+0142 c5 82 Latin small letter l with stroke\n '/ñ/' => 'n', // U+00F1 c3 b1 Latin small letter n with tilde\n '/ò/' => 'o', // U+00F2 c3 b2 Latin small letter o with grave\n '/ó/' => 'o', // U+00F3 c3 b3 Latin small letter o with acute\n '/ô/' => 'o', // U+00F4 c3 b4 Latin small letter o with circumflex\n '/õ/' => 'o', // U+00F5 c3 b5 Latin small letter o with tilde\n '/ö/' => 'o', // U+00F6 c3 b6 Latin small letter o with diaeresis\n '/ø/' => 'o', // U+00F8 c3 b8 Latin small letter O with stroke\n '/ù/' => 'u', // U+00F9 c3 b9 Latin small letter u with grave\n '/ú/' => 'u', // U+00FA c3 ba Latin small letter u with acute\n '/û/' => 'u', // U+00FB c3 bb Latin small letter u with circumflex\n '/ü/' => 'u', // U+00FC c3 bc Latin small letter u with diaeresis\n '/ř/' => 'r', // U+0159 c5 99 Latin small letter r with caron\n '/š/' => 's', // U+0161 c5 a1 latin small letter s with caron\n '/ÿ/' => 'y', // U+00FF c3 bf Latin small letter y with diaeresis\n '/ý/' => 'y', // U+00FD c3 bd Latin small letter y with acute\n '/ỳ/' => 'y', // U+1EF3 e1 bb b3 Latin small letter y with acute\n '/ž/' => 'z', // U+017E c5 be Latin small letter z with caron\n '/ż/' => 'z' // U+017C c5 bc Latin small letter z with dot above\n );\n\n $code = preg_replace(array_keys($UTFchars), array_values($UTFchars), $code);\n return $code;\n }", "public function getEncodeOptions(): int\n {\n $options = $this->getConfig('encode_options');\n if (!is_int($options)) {\n if (is_string($options)) {\n $list = preg_split('/[\\s,|]+/', $options);\n $options = 0;\n if ($list) {\n foreach ($list as $option) {\n if (isset($this->encodeOptions[$option])) {\n $options += $this->encodeOptions[$option];\n }\n }\n }\n } else {\n $options = 0;\n }\n }\n\n return $options;\n }", "function convertEx($exID){\n switch ($exID) {\n case '1':\n return '1';\n break;\n\n case '2':\n return '2';\n break;\n\n case '3':\n return '3';\n break;\n\n case '4':\n return '4';\n break;\n\n case '5':\n return '6';\n break;\n\n case '6':\n return '5';\n break;\n\n case '7':\n return '7';\n break;\n\n case '8':\n return '8';\n break;\n\n case '9':\n return '9';\n break;\n\n case '10':\n return '10';\n break;\n \n default:\n return 'null';\n break;\n }\n}", "public function getConvertEncoding();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unlocks the video while it was processing
public function unlock() { $originalFile = VideoFileOriginal::where('video_id', $this->video_id)->first(); if (!$originalFile) { // Create original file $originalFile = new VideoFileOriginal(); $originalFile->video_id = $this->video_id; $originalFile->path = $this->path; } $originalFile->status = 'Complete'; $originalFile->save(); VideoProcessingEvent::fire('unlock', $this, 'success'); }
[ "public function unlock() {\n \n }", "public function unlock()\n {\n }", "private function processUnlock()\n {\n $lockfile = $this->lockFileStr();\n unlink($lockfile);\n }", "public function lockOut();", "public function unlock(): void\n {\n $this->isLocked = false;\n\n if (!$this->isWaiting()) {\n $this->awakeWaiters();\n }\n }", "public function _destruct() {\n\t\t$this->unlock();\n\t}", "public function unlock()\n\t{\n\t\t//Call getProducts() to set $this->arrProducts array with existing locked data\n\t\t$this->getProducts();\n\t\t$this->blnLocked = false;\n\t}", "private static function realUnlock()\n {\n clearstatcache();\n if (file_exists(self::$lockFilePath) && trim(file_get_contents(self::$lockFilePath)) == getmypid()) {\n @unlink(self::$lockFilePath);\n }\n }", "public function locked();", "function release_lock()\n {\n $this->server->delete('channel_lock_'.$this->channelID);\n }", "function unlock_process($fp)\n{\n\t@flock($fp, LOCK_UN);\n\t@fclose($fp);\n}", "function EndTextureMode(): void { }", "function x_video_lock_output() {\r\n\r\n require( X_VIDEO_LOCK_PATH . '/views/site/video-lock.php' );\r\n\r\n}", "public function onLoadCaptureStop()\n {\n $data = ob_get_clean();\n $this->_captureLock = false;\n\n $this->addOnLoad($data);\n return true;\n }", "public function __destruct(){\r\n\t\tif(!$this->_is_lock)return ;\r\n\t\t$this->_cache->unlock($this->_param());\r\n\t}", "public function unlock()\n {\n $this->locked_by_id = null;\n $this->locked_until = null;\n $this->save();\n }", "private function lock() {\n\t\tif(!file_exists(FILE_LOCKED)) {\n\t\t\tif(file_exists(FILE_UNLOCKED)) {\n\t\t\t\tunlink(FILE_UNLOCKED);\n\t\t\t}\n\t\t\t$file = fopen(FILE_LOCKED, 'w');\n\t\t\tfclose($file);\n\t\t}\n\t}", "public function unblockAccess();", "function unlock() {\n\t\t\tif (!$this->fileHandle)\n\t\t\t\tthrow new LogicException('Cannot unlock file ' . $this->filename . ', not locked');\n\t\t\tfclose($this->fileHandle);\n\t\t\t$this->fileHandle = false;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get account page object.
function but_get_account_page_object() { return get_page_by_path( 'account' ); }
[ "public function account()\n {\n return $this->httpRequest(\"v3/account\", \"GET\", [], true);\n }", "public function getAccount()\n {\n return $this->account;\n }", "public function getAccount() {\n return $this->account;\n }", "public function getAccount() {\n return Account::retrieve($this->externalAccount->__get('data')['object']['account']);\n }", "public function account()\n {\n return new Resources\\Account($this->request, $this->settings);\n }", "public function getPage(): Page\n {\n return $this->page;\n }", "public function getAccount()\n {\n return isset($this->Account) ? $this->Account : null;\n }", "public function getAccountDetailsInstance()\n\t\t{\n\t\t\tif( !$this->isAuthenticated() )\n\t\t\t\treturn $this->error(2);\n\t\t\t\n\t\t\treturn $this->account_info;\n\t\t}", "public function account() \n\t{\n\t\tif (!isset($this->account)) {\n\t\t\t$this->account = new \\Zamzar\\Account($this->getConfig());\n\t\t}\n\t\treturn $this->account;\t\t\n\t}", "public function Account ()\n\t\t{\n\t\t\tif (!$this->_actAccount)\n\t\t\t{\n\t\t\t\t$intAccount = $this->Pull ('Account')->getValue ();\n\t\t\t\t\n\t\t\t\tif ($intAccount == NULL)\n\t\t\t\t{\n\t\t\t\t\treturn NULL;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_actAccount = new Account ($intAccount);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->_actAccount;\n\t\t}", "public function getAccount()\n {\n return $this->isAuthenticated() ? $this->account: null;\n }", "public function getAccount()\n\t{\n\t\treturn Controllers\\AccountController::getInstance();\n\t}", "public function getAccountInformation ();", "public function getLinkOwnContentsOnAccountPage()\n {\n return $this->linkOwnContentsOnAccountPage;\n }", "public function getPage()\n {\n return PagesModel::getPageById($this->id_page);\n }", "public function getAccount(): Account {\n static::$accounts[] = $account = Account::create(\"Dummy\", \"Dummy\");\n return $account;\n }", "public function memberProfilePage() {\n\t\treturn DataObject::get_one('MemberProfilePage');\n\t}", "public function getAccount()\n {\n // Show the creation form view\n return View::make('account.index')->with('user', Auth::user());\n }", "protected function _getAccount()\n {\n return $this->_account;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Formats a string containing the fullyqualified path to represent a organization_effective_custom_module resource.
public static function organizationEffectiveCustomModuleName(string $organization, string $effectiveCustomModule): string { return self::getPathTemplate('organizationEffectiveCustomModule')->render([ 'organization' => $organization, 'effective_custom_module' => $effectiveCustomModule, ]); }
[ "public static function effectiveSecurityHealthAnalyticsCustomModuleName(string $organization, string $effectiveCustomModule): string\n {\n return self::getPathTemplate('effectiveSecurityHealthAnalyticsCustomModule')->render([\n 'organization' => $organization,\n 'effective_custom_module' => $effectiveCustomModule,\n ]);\n }", "public static function folderEffectiveCustomModuleName(string $folder, string $effectiveCustomModule): string\n {\n return self::getPathTemplate('folderEffectiveCustomModule')->render([\n 'folder' => $folder,\n 'effective_custom_module' => $effectiveCustomModule,\n ]);\n }", "public static function format(string $actionPath): string\n {\n return preg_replace('/_([^_]*)$/', '/$1', str_replace('/', '_', $actionPath));\n }", "private static function formatPath($path)\n {\n if (!preg_match('/\\.php$/', $path)) {\n $path .= '.php';\n }\n $path = preg_replace('/\\/{2,}/', '/', $path);\n return $path;\n }", "protected function formatPath($path)\n {\n // canary...\n if(empty($path)){ return ''; }//if\n \n // make sure path doesn't end with a slash...\n if(mb_substr($path,-1) == DIRECTORY_SEPARATOR)\n {\n $path = mb_substr($path,0,-1);\n }//if\n \n return $path;\n \n }", "public function getPathStringFormat()\n {\n return $this->getPathFormat($this->path);\n }", "private function getModuleTemplatePath(): string\n {\n return sprintf('@Modules/%s/views/templates/admin/', $this->name);\n }", "private function standardize($path)\n\t{\n\t\t$content_root = array_get($this->config, 'content_root');\n\n\t\t$path = Path::trimSlashes(Path::assemble($content_root, $path));\n\n\t\t// If an already standardized path is passed in, the content root will double up.\n\t\t// Address that.\n\t\t$path = str_replace($content_root . '/' . $content_root, $content_root, $path);\n\n\t\treturn $path;\n\t}", "public function getFullModuleCode(){\n\t\treturn self::CATEGORY . '/' . self::MODULE_CODE;\n\t}", "protected function getModLocalePath(){\n return '';\n }", "public function getFriendlyName(): string\n {\n $extra = $this->getPackage()->getExtra();\n $regularName = str_replace(['component-', 'module-'], '', $this->getPackageName());\n\n return (string) Arr::get($extra, 'friendly-name', $regularName);\n }", "private function _formatRouteNameAndViewPathModifiers()\n {\n if ($this->alias) {\n $this->alias = str_finish($this->alias, '.');\n }\n\n if ($this->theme) {\n $this->theme = str_finish($this->theme, '.');\n }\n\n if ($this->module) {\n if (!ends_with($this->module, '::')) {\n $this->module .= '::';\n }\n }\n\n if ($this->prefix) {\n $this->prefix = str_finish($this->prefix, '.');\n }\n\n if ($this->resourceName) {\n $this->resourceName = str_finish($this->resourceName, '.');\n }\n }", "public static function formatPath($path){\r\n\r\n \t$osSeparator = FilesManager::getInstance()->getDirectorySeparator();\r\n\r\n \tif($path == null){\r\n\r\n \t\treturn '';\r\n \t}\r\n\r\n \tif(!is_string($path)){\r\n\r\n \t\tthrow new Exception('StringUtils->formatPath: Specified path must be a string');\r\n \t}\r\n\r\n \t// Replace all slashes on the path with the os default\r\n \t$path = str_replace('/', $osSeparator, $path);\r\n \t$path = str_replace('\\\\', $osSeparator, $path);\r\n\r\n \t// Remove duplicate path separator characters\r\n \twhile(strpos($path, $osSeparator.$osSeparator) !== false) {\r\n\r\n \t\t$path = str_replace($osSeparator.$osSeparator, $osSeparator, $path);\r\n \t}\r\n\r\n \t// Remove the last slash only if it exists, to prevent duplicate directory separator\r\n \tif(substr($path, strlen($path) - 1) == $osSeparator){\r\n\r\n \t\t$path = substr($path, 0, strlen($path) - 1);\r\n \t}\r\n\r\n \treturn $path;\r\n }", "public static function getModulePath()\n {\n return \\Orion::base() . \\Orion::MODULE_PATH . self::$MODULE_NAME . DS;\n }", "private function getModulePath(): string\n {\n if (!$this->modulePath) {\n $this->modulePath = 'src/' . $this->moduleName;\n }\n\n return $this->modulePath;\n }", "public function get_custom_path(){\n return (is_null($this->custompath)) ? false : $this->custompath;\n }", "public static function folderCustomModuleName(string $folder, string $customModule): string\n {\n return self::getPathTemplate('folderCustomModule')->render([\n 'folder' => $folder,\n 'custom_module' => $customModule,\n ]);\n }", "function build(): string\n {\n if ($this->host !== null && $this->preferredFormat === static::ABSOLUTE) {\n return $this->buildAbsolute();\n } else {\n return $this->buildRelative();\n }\n }", "function original_to_representative($path, $representative_ext)\n{\n $pos = strrpos($path, '/');\n $path = substr_replace($path, 'pwg_representative/', $pos+1, 0);\n $pos = strrpos($path, '.');\n return substr_replace($path, $representative_ext, $pos+1);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for updateConfiguration Updates a binding configuration for given binding ID and returns the old configuration..
public function testUpdateConfiguration() { }
[ "public function testUpdateConfiguration2()\n {\n }", "public function testUpdateConfiguration3()\n {\n }", "public function pg_config_update()\n\t{\n\t\t$data['id'] = $this->input->post('id');\n\t\t$data['name'] = $this->input->post('name');\n\t\t$data['modified_on'] = date('Y-m-d H:i:s');\n\t\t$this->Setting_model->pg_config_update($data);\n\n\t\t$this->session->set_flashdata('pg_success', 'Payment Gateway Config has been updated successfully.');\n\t redirect('payment-config');\n\t}", "public function test_updating_config_value()\n {\n $endpoint = 'http://mytest.domain';\n $config = [\n 'endpoint' => $endpoint\n ];\n $this->pwned->setConfig($config);\n $updated = $this->pwned->getConfig();\n $this->assertEquals(\n $endpoint,\n $updated['endpoint']\n );\n }", "public function testUpdateLdapConfig()\n {\n }", "private function UpdateConfig()\n\t{\n\t\t$GLOBALS['PrivateKeyPass'] = GetConfig('EncryptionToken');\n\t\t$GLOBALS['MerchantID'] = $this->GetValue('merchantid');\n\t\t$GLOBALS['ReturnURL'] = GetConfig('ShopPathSSL') . \"/finishorder.php\";\n\n\t\t$urls = $this->GetIDealURLs($this->GetValue('bank'));\n\n\t\tif ($this->GetValue('testmode') == \"YES\") {\n\t\t\t$acquirerURL = $urls['test'];\n\t\t}\n\t\telse {\n\t\t\t$acquirerURL = $urls['live'];\n\t\t}\n\t\t$GLOBALS['AcquirerURL'] = $acquirerURL;\n\n\t\t$configContents = $this->ParseTemplate('config', true);\n\n\t\tif (($handle = fopen($this->_configFile, \"wb\")) === false) {\n\t\t\t// could not open config file for writing\n\t\t\t$this->SetError(GetLang('IdealCantOpenConfigFile', array('configFile' => $this->_configFile)));\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfwrite($handle, $configContents);\n\t\tfclose($handle);\n\t}", "public function update(\\Wallee\\Sdk\\Model\\PaymentMethodConfiguration $configuration);", "public static function update_config() {\n\t\t$return = \\wordfence::ajax_updateConfig_callback();\n\t\treturn $return;\n\t}", "public function updateConfig()\n {\n \t// fetch the file\n $client = new \\MRPIDX\\HTTP\\Client( \"http://\" . MRPIDX\\InlineClient::SERVER . self::CONFIG_LOCATION);\n $client->makeRequest();\n $response = $client->getResponse();\n\n // we only update on a 200\n if ($response->getResponseCode() == 200) {\n $content = $response->getContent();\n $json = json_decode($content,true);\n if (json_last_error() != JSON_ERROR_NONE) {\n //$this->logger->warn(\"Config JSON is invalid: \" . self::CONFIG_LOCATION);\n //error_log(\"Config JSON is invalid: \" . self::CONFIG_LOCATION . \" : \" . json_last_error() );\n return;\n }\n $config = $json;\n //$config = get_object_vars($json);\n\n // if the config we downloaded is newer, update\n $current = isset($this->config[\"version\"]) ? $this->config[\"version\"] : \"0.0\";\n if (isset($config[\"version\"]) && version_compare($current, $config[\"version\"]) < 0) {\n $this->config = $config;\n update_option(self::CONFIG_OPT_NAME, $content);\n $this->logger->debug(\"Updating config from \" . $current . \" to \" . $config[\"version\"]);\n }\n else {\n\t //error_log( \"Config update skipped: version same or lower: \" . $config[\"version\"] );\n }\n } else {\n $this->logger->warn(\"Could not update configuration from: \" . self::CONFIG_LOCATION);\n }\n }", "public function testUpdateSamlConfig()\n {\n }", "private function updateConfiguration()\r\n {\r\n $yaml = $this->loader->dump($this->config,2);\r\n file_put_contents(__DIR__.self::CONFIG_PATH.'.bkp', $yaml);\r\n \r\n //Update new config\r\n $newConfig = array_replace_recursive($this->config,$this->skConfig);\r\n $yaml = $this->loader->dump($newConfig,3);\r\n file_put_contents(__DIR__.self::CONFIG_PATH, $yaml);\r\n \r\n //Backing up old routing\r\n $this->routing = $this->loader->parse(__DIR__.self::ROUTING_PATH);\r\n $yaml = $this->loader->dump($this->routing,2);\r\n file_put_contents(__DIR__.self::ROUTING_PATH.'.bkp', $yaml);\r\n \r\n //Update new config\r\n $newRouting = array_replace_recursive($this->routing,$this->skRouting);\r\n $yaml = $this->loader->dump($newRouting,3);\r\n file_put_contents(__DIR__.self::ROUTING_PATH, $yaml);\r\n }", "public function updateconfig()\n {\n // Security check\n if (!SecurityUtil::checkPermission($this->name . '::', '::', ACCESS_ADMIN)) {\n throw new Zikula_Exception_Forbidden();\n }\n\n // Confirm the forms authorisation key\n $this->checkCsrfToken();\n\n $domainControllers = $this->request->getPost()->get(ADLibrary_Constant::MODVAR_ADDCS, false);\n $this->setVar(ADLibrary_Constant::MODVAR_ADDCS, $domainControllers);\n\n $accountSuffix = $this->request->getPost()->get(ADLibrary_Constant::MODVAR_ADACCOUNTSUFFIX, false);\n $this->setVar(ADLibrary_Constant::MODVAR_ADACCOUNTSUFFIX, $accountSuffix);\n\n $baseDN = $this->request->getPost()->get(ADLibrary_Constant::MODVAR_ADBASEDN, false);\n $this->setVar(ADLibrary_Constant::MODVAR_ADBASEDN, $baseDN);\n\n $adminUsername = $this->request->getPost()->get(ADLibrary_Constant::MODVAR_ADPROXYUSERNAME, false);\n $this->setVar(ADLibrary_Constant::MODVAR_ADPROXYUSERNAME, $adminUsername);\n\n $adminPassword = $this->request->getPost()->get(ADLibrary_Constant::MODVAR_ADPROXYPASSWORD, false);\n $this->setVar(ADLibrary_Constant::MODVAR_ADPROXYPASSWORD, $adminPassword);\n\n $isEnabled = $this->request->getPost()->get(ADLibrary_Constant::MODVAR_ADENABLEAUTH, false);\n $this->setVar(ADLibrary_Constant::MODVAR_ADENABLEAUTH, $isEnabled);\n\t\n // the module configuration has been updated successfuly\n $this->registerStatus($this->__('Done! Saved module configuration.'));\n\n // This function generated no output, and so now it is complete we redirect\n // the user to an appropriate page for them to carry on their work\n $this->redirect(ModUtil::url($this->name, 'admin', 'main'));\n }", "private function updateConfig()\n {\n $stub = $this->stub.'/config';\n $path = config_path();\n (new Filesystem)->copyDirectory($stub, $path);\n }", "public function updateconfigparameterget()\n\t\t{\n\t\t\t$logger = Logger::getLogger(__CLASS__);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$taskCode = \"configparameters\";\n\t\t\t\t$this->LogAccess($taskCode);\n\t\t\t\t$authResult = $this->Authorize($taskCode);\n\t\t\t\tif ($authResult == \"LOGIN\")\n\t\t\t\t{\n\t\t\t\t\treturn $this->view->outputJson(Constants::$LOGIN, \"\", \"\");\n\t\t\t\t}\n\t\t\t\t$ParameterID = 0;\n\t\t\t\tif(isset($_POST[\"rstate\"]) && !empty($_POST[\"rstate\"]))\n\t\t\t\t{\n\t\t\t\t\t$ParameterID = RequestStateHelper::GetRequestState(\"ParameterID\", $_POST[\"rstate\"]);\n\t\t\t\t}\n\t\t\t\t$configParameterBO = new ConfigParameterBO($this->_UserInfo);\n\t\t\t\t$_ConfigParameter = $configParameterBO->SelectByParameterID($ParameterID);\n\t\t\t\t$_ConfigParameter->setParameterID($ParameterID);\n\t\t\t\t$_ConfigParameter->setRequestStateDictionary(RequestStateHelper::SetRequestState(\"ParameterID\", $_ConfigParameter->getParameterID(), $_ConfigParameter->getRequestStateDictionary()));\n\t\t\t\t$_ConfigParameter->SetRequestState(\"ContextName\", \"configparameters\");\n\t\t\t\t$this->model = $_ConfigParameter;\n\t\t\t\tob_start();\n\t\t\t\tinclude('views/configparameter/_configparametersedit.php');\n\t\t\t\t$output = ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t\treturn $this->view->outputJson(Constants::$OK, $output, \"\");\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$logger->error($ex->getMessage());\n\t\t\t}\n\t\t}", "public function testUpdateOidcConfig()\n {\n }", "public function testUpdateAppStoreConfig()\n {\n }", "function updateConfig($id, $value)\r\n\t{\r\n\t\tglobal $mysqli,$db_table_prefix;\r\n\t\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"configuration\r\n\t\t\tSET \r\n\t\t\tvalue = ?\r\n\t\t\tWHERE\r\n\t\t\tid = ?\");\r\n\t\tforeach ($id as $cfg){\r\n\t\t\t$stmt->bind_param(\"si\", $value[$cfg], $cfg);\r\n\t\t\t$stmt->execute();\r\n\t\t}\r\n\t\t$stmt->close();\t\r\n\t}", "public function apply_config() {\n\t\tcheck_ajax_referer( 'smush_handle_config' );\n\n\t\t$capability = is_multisite() ? 'manage_network' : 'manage_options';\n\t\tif ( ! current_user_can( $capability ) ) {\n\t\t\twp_send_json_error( null, 403 );\n\t\t}\n\n\t\t$id = filter_input( INPUT_POST, 'id', FILTER_SANITIZE_STRING );\n\t\tif ( ! $id ) {\n\t\t\t// Abort if no config ID was given.\n\t\t\twp_send_json_error(\n\t\t\t\tarray( 'error_msg' => esc_html__( 'Missing config ID', 'wp-smushit' ) )\n\t\t\t);\n\t\t}\n\n\t\t$configs_handler = new Configs();\n\t\t$response = $configs_handler->apply_config_by_id( $id );\n\n\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\twp_send_json_success();\n\t\t}\n\n\t\twp_send_json_error(\n\t\t\tarray( 'error_msg' => esc_html( $response->get_error_message() ) )\n\t\t);\n\t}", "public function updateConfig()\r\n {\r\n // Change old config paths (ver < 1.19.0)\r\n $pathLike = 'mageworx_sales/orderspro/%';\r\n /** @var Mage_Core_Model_Resource_Config_Data_Collection $configCollection */\r\n $configCollection = Mage::getModel('core/config_data')->getCollection();\r\n $configCollection->getSelect()->where('path like ?', $pathLike);\r\n\r\n /** @var array $fields */\r\n $fields = $this->getModuleConfigFields();\r\n /** @var Mage_Core_Model_Config_Data $conf */\r\n foreach ($configCollection as $conf) {\r\n $realPath = $conf->getPath();\r\n $path = explode('/', $realPath);\r\n $lastElement = array_pop($path);\r\n\r\n if (in_array($lastElement, $fields)) {\r\n $this->updatePathFor18verAndOlder($conf, $realPath);\r\n }\r\n }\r\n\r\n // Change old config paths (ver >= 1.19.0)\r\n $pathLike = 'mageworx_orderspro/general/%';\r\n /** @var Mage_Core_Model_Resource_Config_Data_Collection $configCollection */\r\n $configCollection = Mage::getModel('core/config_data')->getCollection();\r\n $configCollection->getSelect()->where('path like ?', $pathLike);\r\n\r\n /** @var array $fields */\r\n $fields = $this->getModuleConfigFields();\r\n /** @var Mage_Core_Model_Config_Data $conf */\r\n foreach ($configCollection as $conf) {\r\n $realPath = $conf->getPath();\r\n $path = explode('/', $realPath);\r\n $lastElement = array_pop($path);\r\n\r\n if (in_array($lastElement, $fields)) {\r\n $this->updatePathFor19ver($conf, $realPath);\r\n }\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the color sky blue.
public static function SkyBlue() {return RgbColor::CreateRgbColor("SkyBlue");}
[ "public function getBlue();", "public function getBlue()\n {\n return (0.5 + $this->blue) | 0;\n }", "public static function DarkBlue()\r\n {return RgbColor::CreateRgbColor(\"DarkBlue\");}", "public static function DarkSlateBlue()\r\n {return RgbColor::CreateRgbColor(\"DarkSlateBlue\");}", "public function getBlue()\n {\n return $this->blue;\n }", "public function getBlue() {\n return $this->blue;\n }", "public static function Snow()\r\n {return RgbColor::CreateRgbColor(\"Snow\");}", "public function get_color()\n\t{\n\t\treturn $this->color;\n\t}", "public static function DarkGreen()\r\n {return RgbColor::CreateRgbColor(\"DarkGreen\");}", "public function getColor() {\n return $this->color;\n }", "public static function CadetBlue()\r\n {return RgbColor::CreateRgbColor(\"CadetBlue\");}", "public function getColor()\n\t{\n\t\treturn $this->color;\n\t}", "public function getColor() {\n\t\treturn $this->color;\n\t}", "public static function DarkSeaGreen()\r\n {return RgbColor::CreateRgbColor(\"DarkSeaGreen\");}", "public\tfunction\tgetColor()\t{\n\t\t\t\t\t\t\t\t\t\t\t\treturn\t$this->color;\n\t\t\t\t\t\t\t\t}", "public static function DarkOrange()\r\n {return RgbColor::CreateRgbColor(\"DarkOrange\");}", "public function blue()\n {\n return (int) round(bcmul($this->blue, self::MAX_RGB, self::$bcscale));\n }", "public static function MidnightBlue()\r\n {return RgbColor::CreateRgbColor(\"MidnightBlue\");}", "public function fg()\n {\n return $this->arr_colors[1];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation postUserPasswordWithHttpInfo Change a users password
public function postUserPasswordWithHttpInfo($userId, $body) { $returnType = ''; $request = $this->postUserPasswordRequest($userId, $body); 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()) { case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 413: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 415: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 503: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 504: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\PureCloudPlatform\Client\V2\Model\ErrorBody', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
[ "public function updateUser($user, $newPassword=null);", "public function changePassword( $user, $password );", "public function updatePassword(UserInterface $user);", "public function updateUserPassword($id,$password);", "public function changePasswordWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->changePasswordRequest($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 changePassword(ApiTester $I) {\n $I->am(\"Client Side Application\");\n // And\n $I->expectTo(\"get HTTP 200 response because we changed the password name successfully\");\n // Then\n $I->sendPOST(\"user/edit\", [\n \"password\" => \"password\",\n \"current_password\" => \"pass1234\"\n ]);\n // And\n $I->seeResponseCodeIs(\\Codeception\\Util\\HttpCode::OK);\n // And\n $I->seeResponseIsJson();\n // And\n $I->seeResponseContainsJson([\"success\" => [\n \"message\" => \"Account details edited\"\n ]]);\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function testUpdatePasswordActionWithToken()\n {\n // Get an authenticated client\n $client = $this->createAuthenticatedClient('test', '1GreatP@ssword');\n // Test the route with patch data\n $client->request(\n 'PATCH',\n '/api/users/password',\n [],\n [],\n ['CONTENT_TYPE' => 'application/json'],\n json_encode(\n [\n 'password' => 'AnotherGr3atP@ssword',\n ]\n )\n );\n // Check the response\n $this->assertSame(Response::HTTP_OK, $client->getResponse()->getStatusCode());\n }", "function updatePassword()\n\t{\n\t\t$sql = \"UPDATE USER SET password = :password WHERE user_id = :user_id AND password = :old_password\";\n\t\t$request = \\Slim\\Slim::getInstance()->request();\n\t\t$userInfo = json_decode($request->getBody());\n\n\t\ttry\n\t\t{\n\t\t\t$db = getConnection();\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->bindParam(\"password\", md5($userInfo->password));\n\t\t\t$stmt->bindParam(\"user_id\", $userInfo->userID);\n\t\t\t$stmt->bindParam(\"old_password\", md5($userInfo->old_password));\n\t\t\t$stmt->execute();\n\t\t\t$db = null;\n\t\t\techo '{\"success\": true}';\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\techo '{\"error\":{\"text\":' . \"\\\"\" . $e->getMessage() . \"\\\"\" . '}}';\n\t\t}\n\t}", "function updatePassword($userinfo, &$existinguser, &$status)\r\n {\r\n }", "public function userPasswordUpdate()\n {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "public function resetPasswordWithHttpInfo($body)\n {\n $request = $this->resetPasswordRequest($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() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 204:\n if ('\\TalonOne\\Client\\Model\\NewPassword' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\TalonOne\\Client\\Model\\NewPassword', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\TalonOne\\Client\\Model\\NewPassword';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 204:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\TalonOne\\Client\\Model\\NewPassword',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function updatePassword(string $password, int $id);", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "function terminus_api_user_password_set($user_uuid, $password) {\n $realm = 'user';\n $uuid = $user_uuid;\n $path = 'password';\n $method = 'PUT';\n $data = $password;\n\n return terminus_request($realm, $uuid, $path, $method, $data);\n}", "public function testUpdatePasswordActionWithoutToken()\n {\n // Create an un-authenticated client\n $client = static::createClient();\n // Test the route with patch data\n $client->request(\n 'PATCH',\n '/api/users/password',\n [],\n [],\n ['CONTENT_TYPE' => 'application/json'],\n json_encode(\n [\n 'password' => '1GreatPassword',\n ]\n )\n );\n // Check the response\n $this->assertSame(Response::HTTP_UNAUTHORIZED, $client->getResponse()->getStatusCode());\n }", "public function getV2ApiPassword();", "public function updatePassword()\n {\n $referer = $this->getReferer();\n $identity = $this->request->getAttribute('identity');\n $user = $this->Users->get($identity->id);\n $this->Authorization->authorize($user, 'edit');\n\n $allowedFields = ['password', 'current_password', 'confirm_password'];\n if ($this->request->is(['patch', 'post', 'put'])) {\n $user = $this->Users->patchEntity($user, $this->request->getData(), [\n 'fields' => $allowedFields,\n 'validate' => 'updatePassword',\n ]);\n if ($this->Users->save($user)) {\n $this->Flash->success(__('Your password has been updated.'));\n } else {\n $this->Flash->error(__('Your password was not updated. Please, try again.'));\n $errors = $this->flattenErrors($user->getErrors());\n $this->set('errors', $errors);\n }\n }\n $this->set(compact('user', 'referer'));\n }", "public function updatePassword($databaseId, $databaseUserId, $newPassword);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The function get_admin_notifications_selected_template shows selected template
function get_admin_notifications_selected_template($template_slug) { // Get email's templates $email_templates = the_admin_notifications_email_templates(); // Dropdown $dropdown = ''; // Verify if email's templates exists if ( $email_templates ) { // List email's templates foreach ( $email_templates as $email_template ) { // Get key $key = key($email_template); // Verify if this is the selected template if ( $template_slug !== $key ) { continue; } // Set selected template $dropdown = '<option value="' . $key . '" selected>' . $email_template[$key]['template_name'] . '</option>'; } } // Verify if $dropdown is empty if ( empty($dropdown) ) { // Set default dropdown $dropdown = '<option disabled selected>' . get_instance()->lang->line('notifications_select_template') . '</option>'; // Get all templates $get_templates = get_instance()->base_model->get_data_where('notifications_templates', '*'); // Set all templates $all_templates = !empty($get_templates)?array_column($get_templates, 'template_slug'):array(); // Verify if email's templates exists if ( $email_templates ) { // List email's templates foreach ( $email_templates as $email_template ) { // Get key $key = key($email_template); // Verify if array already exists if ( in_array($key, $all_templates ) ) { continue; } // Set dropdown $dropdown .= '<option value="' . $key . '">' . $email_template[$key]['template_name'] . '</option>'; } } } // Display dropdown echo '<div class="row">' . '<div class="col-lg-12">' . '<div class="panel panel-default notifications-email-templates">' . '<div class="panel-heading">' . get_instance()->lang->line('notifications_email_template') . '</div>' . '<div class="panel-body">' . '<div class="form-group">' . '<select class="form-control notifications-email-template-select">' . $dropdown . '</select>' . '</div>' . '</div>' . '</div>' . '</div>' . '</div>'; }
[ "function the_admin_notifications_selected_template_placeholders($template_slug) {\n\n // Get email's templates\n $email_templates = the_admin_notifications_email_templates();\n\n // Placeholders\n $placeholders = '';\n\n // Verify if email's templates exists\n if ( $email_templates ) {\n\n // List email's templates\n foreach ( $email_templates as $email_template ) {\n\n // Get key\n $key = key($email_template);\n\n // Verify if this is the selected template\n if ( $template_slug !== $key ) {\n continue;\n }\n \n // Verify if placeholders exists\n if ( !empty($email_template[$key]['template_placeholders']) ) {\n\n // List placeholders\n foreach ( $email_template[$key]['template_placeholders'] as $placeholder ) {\n\n // Set placeholder\n $placeholders .= '<li>'\n . '<p>'\n . '<span class=\"notifications-emails-template-placeholder\">'\n . $placeholder['code']\n . '</span>'\n . $placeholder['description']\n . '</p>'\n . '</li>';\n\n }\n\n }\n\n }\n\n }\n\n // Verify if $placeholders is empty\n if ( empty($placeholders) ) {\n\n // Set no placeholders message\n $placeholders = '<li>'\n . '<p>'\n . get_instance()->lang->line('notifications_no_placeholders_found')\n . '</p>'\n . '</li>';\n\n }\n\n // Return the placeholders\n return $placeholders;\n \n }", "public function select_template() {\n // $templates = $this->run_api_query('templates');\n // print_r($templates);\n print \"********** TEMP select_template() returning 283073 **********\\n\";\n\n return '283073';\n }", "public function activeTemplate ()\n\t{\n\t\t$settings = $this->configuration;\n\t\t$navigation = $this->navigation;\n\t\tif (! empty($navigation->navigation[$this->configuration['m']]['template_folder'])) {\n\t\t\treturn $navigation->navigation[$this->configuration['m']]['template_folder'];\n\t\t} else {\n\t\t\treturn $settings['default_template'];\n\t\t}\n\t}", "private function getSelectedTemplate()\r\n {\r\n $blockObject = $this->getBlockObject();\r\n\t\t\t\r\n if (is_object($blockObject)) {\r\n\t\t\t// A template has been selected before\r\n return $blockObject->getBlockFilename();\r\n }\r\n\r\n // The default template name\r\n return 'open.php';\r\n }", "public function getNotificationTemplateData();", "public function get_template_list() {\n\t\t\t$result_list = array(\n\t\t\t\t'' => esc_html__( '-- Select template --', 'Croco-school' ),\n\t\t\t);\n\n\t\t\t$templates = Elementor\\Plugin::$instance->templates_manager->get_source( 'local' )->get_items();\n\n\t\t\tif ( $templates ) {\n\t\t\t\tforeach ( $templates as $template ) {\n\t\t\t\t\t$result_list[ $template['template_id'] ] = sprintf( '%1$s (%2$s)', $template['title'], $template['type'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $result_list;\n\t\t}", "function gb_templates_selection_form() {\r\n\r\n\t$template_names = gb_get_template_list();\r\n\tif(is_array($template_names)) { ?>\r\n\t\t<p><label for=\"gb_template_selector\"><?php _e('Blog Template[Optional]:') ?></label>\r\n\t\tSelect a template to apply: \r\n\t\t<select name=\"gb_template\" id=\"gb_template_selector\">\r\n\t\t\t<option value=\"\"></option>\r\n\t\t\t<?php foreach($template_names as $name){ \r\n\t\t\t\t$selected = ($name == 'default') ? ('selected=\"selected\" ') : ('');\r\n\t\t\t\techo('<option '. $selected . 'value=\"'.$name.'\" >'.$name.'</option>');\r\n\t\t\t\t} ?>\r\n\t\t</select>\r\n\t\t</p>\r\n<?php }\t\r\n}", "protected function show_templates()\n {\n global $index_includes;\n $l_template = $this->m_userrequest->get_template();\n try\n {\n isys_auth_notifications::instance()\n ->check(isys_auth::VIEW, \"NOTIFICATIONS/MANAGE_TEMPLATES\");\n\n $l_result_set = $this->m_dao->get_templates(null, ['notification_type' => $this->m_type], true, true);\n $l_properties = $this->m_dao->get_properties('notification_templates');\n\n $l_columns = [\n 'id',\n 'locale',\n 'subject',\n 'text'\n ];\n\n $l_entity_id_field = $l_properties['id'][C__PROPERTY__DATA][C__PROPERTY__DATA__FIELD];\n\n $l_header = [];\n foreach ($l_columns as $l_column)\n {\n $l_header[$l_properties[$l_column][C__PROPERTY__DATA][C__PROPERTY__DATA__FIELD]] = $l_properties[$l_column][C__PROPERTY__INFO][C__PROPERTY__INFO__TITLE];\n } //foreach\n\n $l_list = $this->create_list($l_result_set, $l_entity_id_field, $l_header, 'modify_template_rows');\n\n $l_template->smarty_tom_add_rule(\"tom.content.navbar.cRecStatus.p_bInvisible=1\");\n $l_template->assign('g_list', $l_list);\n }\n catch (isys_exception_general $e)\n {\n throw $e;\n }\n catch (isys_exception_auth $e)\n {\n $l_template->assign(\"exception\", $e->write_log());\n $index_includes['contentbottomcontent'] = \"exception-auth.tpl\";\n }\n }", "function templateSelect()\n {\n $key = $this->key;\n $secret = $this->secret;\n $data = array(\n \"key\" => $key,\n \"secret\" => $secret\n );\n $path = \"template/select\";\n return json_decode($this->call($path, $data, 'POST'));\n }", "public function getNotificationTemplateDetails() {\n $this->db->select('notification.*,lang.lang_name');\n $this->db->from('mst_notification_templates as notification');\n $this->db->join('mst_languages as lang', 'lang.lang_id= notification.lang_id', 'inner');\n $result = $this->db->get();\n\n $error = $this->db->_error_message();\n $error_number = $this->db->_error_number();\n return $result->result_array();\n }", "public function getTemplateSelector()\n {\n $result = [];\n \n $result[] = [\n 'text' => $this->__('Only item titles'),\n 'value' => 'itemlist_display.html.twig'\n ];\n $result[] = [\n 'text' => $this->__('With description'),\n 'value' => 'itemlist_display_description.html.twig'\n ];\n $result[] = [\n 'text' => $this->__('Custom template'),\n 'value' => 'custom'\n ];\n \n return $result;\n }", "public function get_template() {\n if (!$this->template) {\n $this->template = 'default';\n }\n\n return apply_filters('i4_lms_email_template', $this->template);\n }", "function bbp_get_single_user_edit_template()\n{\n}", "function template_checklist_select($template_name){\n\t\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . \"custom_checklist_template\"; \n\t$template_checklists = $wpdb->get_row(\"SELECT * FROM {$table_name} WHERE checklist_template = '$template_name'\");\t\n\tif($template_checklists != null){\n\t\t$unserialized = unserialize($template_checklists->checklist_items);\n\t\t$checked_item_array = array();\n\t\tif($unserialized != null){\t\t\t\n\t\t\tforeach($unserialized as $category_name => $checklist_items){\n\t\t\t\tforeach($checklist_items as $checklist_item){\n\t\t\t\t\t$checked_item_array[] = $checklist_item .\"_\". $category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $checked_item_array;\n}", "public function get_template_setting() {\n\t\t$template = 'event';\n\t\t$default_value = 'default';\n\t\t$setting = tribe_get_option( 'tribeEventsTemplate', $default_value );\n\n\t\tif ( $default_value === $setting ) {\n\t\t\t$template = 'page';\n\t\t}\n\n\t\treturn $template;\n\t}", "public function getNotificationTemplateDetailsById($notification_template_id = '') {\n $this->db->select('notification.*,lang.lang_name');\n $this->db->from('mst_notification_templates as notification');\n $this->db->join('mst_languages as lang', 'lang.lang_id= notification.lang_id', 'inner');\n $this->db->where('notification.notification_template_id', $notification_template_id);\n $result = $this->db->get();\n \n $error = $this->db->_error_message();\n $error_number = $this->db->_error_number();\n return $result->result_array();\n }", "public function view_email_template(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_ENC_URL);\n\t\t}else {\n\t\t if ($this->lang->line('admin_menu_view_email_temp') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_menu_view_email_temp')); \n\t\t else $this->data['heading'] = 'View Email Template';\n\t\t\t$template_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('_id' => MongoID($template_id));\n\t\t\t$this->data['template_details'] = $this->templates_model->get_all_details(NEWSLETTER,$condition);\n\t\t\tif ($this->data['template_details']->num_rows() == 1){\n\t\t\t\t$this->load->view(ADMIN_ENC_URL.'/newsletter/view_email_template',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect(ADMIN_ENC_URL);\n\t\t\t}\n\t\t}\n\t}", "public function getCurrentTemplate()\n\t{\n\t\t// Set the state and tell plugins.\n\t\t$this->setState('GETTING_ACTIVE_TEMPLATE');\n\t\t$this->notifyObservers();\n\t\t\n\t\t//Open the page file\n\t\t$data = $this->openFile(\"data/config/active_design.dat\");\n\n\t\t//Return the collected data\n\t\treturn $data;\n\t}", "function template_select($content, $num_rows, $z=NULL, $table=NULL, $popup_id=NULL, $proposal_hash=NULL, $hash2=NULL) {\n\t\tif ($content == 'invoice_print')\n\t\t\t$invoice_hash = $hash2;\n\t\telse \n\t\t\t$po_hash = $hash2;\n\t\t\n\t\t$print_pref = fetch_user_data($content);\n\t\t$print_pref = __unserialize(stripslashes($print_pref));\n\t\t$show_delete = false; \n\t\t\n\t\t// Fetch saved templates and print preferences \n\t\t$result = $this->db->query(\"SELECT *\n\t\t\t\t\t\t\t\t\tFROM templates t\n\t\t\t\t\t\t\t\t\tWHERE `key` = '$content' AND (`public` = '1' OR `owner_hash` = '\".$this->current_hash.\"') AND `active` = '1'\");\n\t\twhile ($row = $this->db->fetch_assoc($result)) {\n\t\t\t// Only show the delete icon if one of more of the saved templates is owned by the current user\n\t\t\tif ($this->current_hash == $row['owner_hash'])\n\t\t\t\t$show_delete = true;\n\t\t\tif (!$row['prefs_only']) {\n\t\t\t\t$templates_in[] = $row['template_hash'];\n\t\t\t\t$templates_out[] = stripslashes($row['template_name']);\n\t\t\t}\n\t\t\tif ($row['default']) \n\t\t\t\t$templates_default = $row['template_hash'];\n\t\t\t\n\t\t\tif ($row['print_prefs']) {\n\t\t\t\t$prefs_in[] = $row['template_hash'];\n\t\t\t\t$prefs_out[] = stripslashes($row['template_name']);\n\t\t\t\tif ($row['default']) \n\t\t\t\t\t$prefs_default = $row['template_hash'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\tif ($print_pref['default_template']) {\n\t\t\t$templates_default = $print_pref['default_template']; \n\t\t}\n\t\tif ($print_pref['default_prefs']) {\n\t\t\t$prefs_default = $print_pref['default_prefs'];\n\t\t}\n\n\t\t// Find out which permissions class to use\n\t\tswitch ($content) {\n\t\t\tcase 'proposal_print':\n\t\t\t$this->perm_class = \"proposals\";\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'proforma_invoice':\n\t\t\tcase 'invoice_print':\n\t\t\t$this->perm_class = \"customer_invoice\";\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'purchase_order':\n\t\t\tcase 'delivery_ticket_print':\n\t\t\t$this->perm_class = \"purchase_order\";\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t\t// Add custom print preferences if user has permissions or if no saved prefs exist.\t\n\t\tif ($this->p->ck($this->perm_class,'P') || !$prefs_in) {\n\t\t\tif (is_array($prefs_in)) {\n\t\t\t\t$custom_in = array(\"custom\");\n\t\t\t\t$custom_out = array(\"Select my print options\".($num_rows > 0 ? \" below\" : NULL));\n\t\t\t\t$prefs_in = array_merge($custom_in,$prefs_in);\n\t\t\t\t$prefs_out = array_merge($custom_out,$prefs_out);\n\t\t\t} else {\n\t\t\t\t$prefs_in = array(\"custom\");\n\t\t\t\t$prefs_out = array(\"Select my print options\".($num_rows > 0 ? \" below\" : NULL));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Create the toggle display statements for each print pref\n\t\tfor($i=0;$i<$num_rows;$i++) {\n\t\t\t$block .= \"toggle_display('print_pref\".($i+1).\"','block');\";\n\t\t\t$none .= \"toggle_display('print_pref\".($i+1).\"','none');\";\n\t\t}\n\t\t\n\t\tif ($num_rows > 0) {\n\t\t\t$block .= \"toggle_display('save_prefs','block');\";\n\t\t\t$none .= \"toggle_display('save_prefs','none');\";\n\t\t}\n\t\t\n\t\t// Show templates drop down if more than 1 saved template exists\n\t\tif (count($templates_in) > 1) {\r\n\t\t\tif ($table)\r\n $select = array($this->form->select(\"use_template$z\",\r\n\t\t $templates_out, \r\n\t\t $templates_default, \r\n\t\t $templates_in, \r\n\t\t \"blank=1\"));\t\t\t \r\n\t\t\telse\n\t\t\t\t$select = \"\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\\\"smallfont\\\" style=\\\"text-align:right;background-color:#efefef;vertical-align:top;padding-top:10px;\\\">Print Template:</td>\n\t\t\t\t\t<td style=\\\"background-color:#ffffff;padding-top:10px;\\\">\n\t\t\t\t\t\t\".$this->form->select(\"use_template$z\",\r\n\t\t\t\t $templates_out, \r\n\t\t\t\t $templates_default, \r\n\t\t\t\t $templates_in, \r\n\t\t\t\t \"blank=1\").\"\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\";\n\t\t}\n\t\t\n\t\t// Show saved print prefs drop down\r\n\t\tif ($table)\r\n $select[] = $this->form->select(\"use_prefs$z\", \r\n $prefs_out, \r\n $prefs_default, \r\n $prefs_in,\r\n \"blank=1\",\r\n \"style=width:\".($num_rows > 0 ? \"215px;\" : \"175px;\"),\r\n \"onChange=if(this.options[this.selectedIndex].value=='custom'){\".$block.\"}else{\".$none.\"}\"); \t\t \r\n\t\telse\n\t\t\t$select .= \"\n\t\t\t<tr>\n\t\t\t\t<td class=\\\"smallfont\\\" style=\\\"text-align:right;background-color:#efefef;vertical-align:top;padding-top:10px;\\\">Print Prefs:</td>\n\t\t\t\t<td style=\\\"background-color:#ffffff;padding-top:10px;\\\" nowrap>\n\t\t\t\t\t\".$this->form->select(\"use_prefs$z\", \r\n\t\t\t $prefs_out, \r\n\t\t\t $prefs_default, \r\n\t\t\t $prefs_in,\r\n\t\t\t \"blank=1\",\r\n\t\t\t \"style=width:\".($num_rows > 0 ? \"215px;\" : \"175px;\"),\r\n\t\t\t \"onChange=if(this.options[this.selectedIndex].value=='custom'){\".$block.\"}else{\".$none.\"}\").($show_delete ? \"\t\n\t\t\t\t\t\t&nbsp;<a href=\\\"javascript:void(0);\\\" class=\\\"link_standard\\\" onClick=\\\"submit_form(\\$('use_prefs$z').form,'templates','exec_post','refresh_form','action=doit_delete_template','template_hash='+\\$('use_prefs$z').options[\\$('use_prefs$z').selectedIndex].value,'popup_id=$popup_id','proposal_hash=$proposal_hash'\".($invoice_hash ? \",'invoice_hash=$invoice_hash'\" : NULL).($po_hash ? \",'po_hash=$po_hash'\" : NULL).\");\\\"><img src=\\\"images/rm_lineitem.gif\\\" border=\\\"0\\\" title=\\\"Delete this saved template.\\\" /></a>\" : NULL).\"\n\t\t\t\t</td>\n\t\t\t</tr>\";\r\n\t\t\t \n\t\treturn $select;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Function to get front page news from DB Parameters: Return: Query array of front page news
function get_frontpage_news() { global $db; $query = "SELECT * FROM news WHERE frontpage=1 ORDER BY date"; $statement = $db->prepare($query); try { $statement->execute(); } catch (Exception $ex) { //redirect to an error page passing the error message header("location:../view/error.php?msg=" . $ex->getMessage()); exit(); } $frontpage = $statement->fetchAll(); $statement->closeCursor(); return $frontpage; }
[ "public function get_news() {\n\t\t\n\t\t$all_news = array();\n\t\t$data = $this->fetch(\"SELECT * FROM `\" . $this->prefix . \"news` ORDER BY id DESC\");\n\t\tif( $data ) {\n\t\t\tforeach( $data as $item ) {\n\t\t\t\t$news['id'] \t\t= $item['id'];\n\t\t\t\t$news['title'] \t= $item['title'];\n\t\t\t\t$news['body']\t\t= $item['body'];\n\t\t\t\t$news['author']\t\t= $item['author'];\n\t\t\t\t$news['cat']\t\t= explode( ',', $item['category'] );\n\t\t\t\t$news['date']\t\t= $item['created'];\n\t\t\t\t$news['game']\t\t= $item['game'];\n\t\t\t\t$news['published'] = $item['published'];\n\t\t\t\tarray_push( $all_news, $news );\n\t\t\t}\n\t\t\treturn $all_news;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\t\n\t}", "function news_getNewsList ( $query_info=0 ) { \n \n /* Define an array of column names we'll accept \n to ORDER BY in our query */ \n $order_fields = array ( \"author\", \"title\" ); \n \n /* Now check to see if $query_info['order'] has \n an acceptable value and assign the correct value \n to the $order variable */ \n if ( ISSET ( $query_info['order'] ) && \n in_array ( $query_info['order'], $order_fields ) ) { \n $order = \"ORDER BY \" . $query_info['order'] . \", date DESC \"; \n } else { \n $order = \"ORDER BY date DESC \"; \n } \n \n /* Now check for $query_info['limit'] to specify \n the number of news items we want returned, \n and assign the correct value to $limit */ \n if ( ISSET ( $query_info['limit'] ) && $query_info['limit'] < 20 ) { \n $limit = \"LIMIT 0, \" . $query_info['limit'] . \" \"; \n } else { \n $limit = \"LIMIT 0, 5 \"; \n } \n \n /* Now build the query */ \n $query = \"SELECT * FROM kd_xmlrpc_news \" . $order . $limit; \n $sql = mysql_query ( $query ); \n if ( $sql ) { \n $news_items = array(); \n while ( $result = mysql_fetch_array ( $sql ) ) { \n \n /* Extract the variables we want from the row */ \n $news_item['news_id'] = $result['news_id']; \n $news_item['date'] = XMLRPC_convert_timestamp_to_iso8601( \n mysql_datetime_to_timestamp( $result['date'] ) \n ); \n $news_item['title'] = $result['title']; \n $news_item['short_desc'] = $result['short_desc']; \n $news_item['author'] = $result['author']; \n \n /* Add to the $news_items array */ \n $news_items[] = $news_item; \n } \n \n /* Convert the $news_items array to a set \n of XML-RPC parameters then respond with the XML. */ \n XMLRPC_response(XMLRPC_prepare($news_items), \n KD_XMLRPC_USERAGENT); \n } else { \n \n /* If there was an error, respond with an \n error message */ \n XMLRPC_error(\"1\", \"news_getNewsList() error: Unable \n to read news:\" \n . mysql_error() . \"\\nQuery was: \" . $query, \nKD_XMLRPC_USERAGENT); \n } \n}", "public function findFrontpagePosts()\n {\n $qb = $this->createQueryBuilder('a');\n\n $qb->orderBy('a.createdAt', 'desc');\n\n return $qb->getQuery()->getResult();\n }", "private function news() {\n//\t\t$thearray [2] = \"news_list.php?tag={$this->_tag}&theid={$this->_newsobj['sort']}\";\n//\t\treturn $thearray;\n\t\t//$this->_tpl->assign ( \"news\", bll_news::getlist( 14 , 20 ) ); //首页新闻动态\n\t\t$news = bll_news::getlist( 14 , 20 );\n\t\treturn $news;\n\t\tprint_r($news);\n\t}", "function get_news_headlines($ref=\"\",$recent=\"\")\n\t{\n\t$sql=\"news n \";\n\t\n\tif ($ref!=\"\"){\n\t\t$sql.=\" where ref='$ref'\";\n\t}\n\t\t\t\t\t\n\t$sql.=\" order by date desc, ref desc\";\n\tif ($recent!=\"\"){$sql.=\" limit 0,$recent\";}\t\n\n\treturn sql_query (\"select distinct ref, date, title, body from $sql\");\n\t}", "public function getLatestNews()\n {\n\n $map['is_show'] = 1;\n $data = $this->article_handle->field(\"aid,title,update_time\")->where($map)->order(\"update_time DESC,ord DESC,clicks DESC\")->select();\n //query($sql);\n return $data;\n\n }", "function cah_news_query($params, $advanced=false, $embed=true) {\r\n $base_url = CAH_NEWS_REST_BASE . '/news?';\r\n $query = ''; \r\n\r\n foreach($params as $key => $value) {\r\n if (is_array($value)) {\r\n $value = implode(',', $value); \r\n }\r\n if ($value != '') {\r\n $query .= sprintf('%s=%s&', $key, $value); \r\n }\r\n }\r\n if ($embed) {\r\n $query .= '_embed';\r\n }\r\n\r\n $request_url = $base_url . $query;\r\n $response = wp_remote_get($request_url, array('timeout'=>20));\r\n if (is_wp_error($response)) {\r\n return null;\r\n }\r\n\r\n $body = json_decode(wp_remote_retrieve_body($response));\r\n if (!$advanced) {\r\n return $body;\r\n }\r\n $max_pages = $response['headers']['X-WP-TotalPages'];\r\n\r\n $result = array(\r\n 'posts' => $body,\r\n 'max_pages' => $max_pages,\r\n );\r\n return $result;\r\n}", "public function getNewsListings () {\n\n $sql = 'SELECT * FROM news\n ORDER BY position ASC';\n $this->stm = $this->prepare($sql);\n\n $this->stm->execute();\n $this->rows= $this->stm->fetchAll(PDO::FETCH_ASSOC);\n $this->count = $this->stm->rowCount();\n $this->rowIdx = 0;\n\n // set row to first\n $this->row=$this->rows[$this->rowIdx++];\n\n }", "public function getNewsfeeds()\r\r\n\t{\r\r\n\t\t$objFeed = $this->Database->execute(\"SELECT id, title FROM tl_news_archive WHERE makeFeed=1\");\r\r\n\r\r\n\t\tif ($objFeed->numRows < 1)\r\r\n\t\t{\r\r\n\t\t\treturn array();\r\r\n\t\t}\r\r\n\r\r\n\t\t$return = array();\r\r\n\r\r\n\t\twhile ($objFeed->next())\r\r\n\t\t{\r\r\n\t\t\t$return[$objFeed->id] = $objFeed->title;\r\r\n\t\t}\r\r\n\r\r\n\t\treturn $return;\r\r\n\t}", "public function frontPageArticles() {\n\t\t\t$db = new DatabaseModule();\n\n\t\t\t$getArticles = $db->Handle->prepare('SELECT id FROM ms_articles ORDER BY articleDate DESC LIMIT 5');\n\t\t\t$getArticles->execute();\n\t\t\t$articles = $getArticles->fetchAll();\n\n\t\t\t$first = true;\n\n\t\t\tforeach($articles as $articleID) {\n\t\t\t\t$article = new Article($articleID['id']);\n\n\t\t\t\t$Link = \"blog/blog.php?do=read&article=\" . $article->ID;\n\n\t\t\t\tif($article->Comments < 10) {\n\t\t\t\t\t$cBox = \"<div class=\\\"cBox\\\"> <span style=\\\"position: relative; left: 3px;\\\">\". $article->Comments . \"</span> </div>\";\n\t\t\t\t} else {\n\t\t\t\t\t$cBox = \"<div class=\\\"cBox\\\"> <span>\". $article->Comments . \"</span> </div>\";\n\t\t\t\t}\n\n\t\t\t\tif($first) {\n\t\t\t\t\techo <<<FIRST\n\t\t\t\t\t\t<a class=\"latestArticle\" href=\"{$Link}\">\n\t\t\t\t\t\t\t<img src=\"Resources/Images/Covers/BlogPosts/{$article->Cover}.png\" alt=\"{$article->Title}\" title=\"{$article->Title}\" />\n\n\t\t\t\t\t\t\t{$cBox}\n\n\t\t\t\t\t\t\t<div class=\"headline\">\n\t\t\t\t\t\t\t\t{$article->Title}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\nFIRST;\n\n\t\t\t\t\t$first = false;\n\t\t\t\t} else {\n\t\t\t\t\techo <<<ARTICLE\n\t\t\t\t\t\t<a class=\"article\" href=\"{$Link}\">\n\t\t\t\t\t\t\t<img src=\"Resources/Images/Covers/BlogPosts/{$article->Cover}.png\" />\n\n\t\t\t\t\t\t\t{$cBox}\n\n\t\t\t\t\t\t\t<div class=\"headline\">{$article->Title}</div>\n\t\t\t\t\t\t</a>\nARTICLE;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static function frontPage()\n {\n\n // loads story photo if story->type == header\n // gets story if it has relationship with a section and section's publication_id column matches the publication id of The Maneater from the Publications table\n // story->front_page_webfront_priority cannot equal null\n // results orderedBy front_page_webfront_priority asc\n // loads corresponding section row from Sections table\n // sets result's key to front_page_webfront_priority\n return Story::with('headerPhotos')->whereHas('section', function($query){\n $publication = Publication::findByString('The Maneater');\n $query->where('publication_id', $publication->id);\n })->whereNotNull('front_page_webfront_priority')\n ->orderBy('front_page_webfront_priority')\n ->get()\n ->load(['section'])\n ->keyBy('front_page_webfront_priority');\n }", "public function get_news(){\n\t\t// return $result=$this->db->query('');\n\t\t// return $this->db->get('t_article', 6) -> result();\n\t\t$limit=9;\n\t $this -> db -> select(\"*\");\n $this -> db -> from('t_article');\n $this -> db -> limit($limit);\n\t $this->db->order_by(\"date\",\"desc\");\n // $this->db->orderd(\"desc\");\n return $this -> db -> get() -> result();\n\t}", "function getCFLPosts() {\n $result = pg_query($GLOBALS['cfldb_conn'], \"SELECT\t(SELECT MIN(date_start) FROM games WHERE games.season = ppp.season AND games.week = ppp.week) AS \\\"post_date\\\",\n\t\t\t\t\t\t\t\t\t\tCAST(season AS text) || ' Week ' || CAST(week AS text) || ' CFL Player Projections' AS \\\"title\\\",\n\t\t\t\t\t\t\t\t\t\tppp.season,\n\t\t\t\t\t\t\t\t\t\tppp.week\n\t\t\t\t\t\t\t\t\tFROM player_proj_points ppp\n\t\t\t\t\t\t\t\t\tGROUP BY ppp.season, ppp.week\");\n\n while ($row = pg_fetch_row($result)) {\n // Key: Title, Values: post_date, URL params\n $recent_posts[$row[1]] = array($row[0], \"projections.php?league=CFL&season=$row[2]&week=$row[3]\");\n }\n\n return $recent_posts;\n}", "public function getArticleList() {\n //build the sql query\n $sql = \"SELECT id, title, description FROM pages ORDER BY title\";\n\n //try to fetch all records\n try {\n $stmt = $this->conn->query($sql);\n $articles = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $data = array(\n 'error' => false,\n 'items' => $articles\n );\n } catch (PDOException $ex) {\n $data = array(\n 'error' => true,\n 'message' => $ex->getMessage()\n );\n }\n\n //return the data array \n return $data;\n }", "public static function frontpage() \n\t{\n\t\t\n\t\t//iniate the database\n $database = DatabaseFactory::getFactory()->getConnection();\n\t\t\n\t\t//sql to run\n\t\t$sql = \"SELECT * FROM products \n\t\t\t\tWHERE product_enddate > Now() \n\t\t\t\tAND product_quantity > 0 \n\t\t\t\tAND product_enabled = 1 \n\t\t\t\tGROUP BY product_id \n\t\t\t\tORDER BY product_id DESC LIMIT 16\";\n\t\t\n\t\t//run the sql\n $product = $database->prepare($sql);\n $product->execute();\n\t\t\n\t\t//return the results\n return $product->fetchAll();\n }", "public function getcartoonTopNews(){\n\t \t $query = \"SELECT * FROM tbl_cartoon WHERE status = '1' AND top_news = '1' AND category_id = '32' ORDER BY category_id DESC LIMIT 1\";\n\t \t$result = $this->db->select($query);\n\t \treturn $result;\n\t }", "private function searchNews() {\n\n $arrWhere = array(\n \"news_image LIKE ?\",\n \"news_intro LIKE ?\",\n \"news_text LIKE ?\",\n \"news_title LIKE ?\"\n );\n $arrParams = array(\n \"%\".$this->strSearchterm.\"%\",\n \"%\".$this->strSearchterm.\"%\",\n \"%\".$this->strSearchterm.\"%\",\n \"%\".$this->strSearchterm.\"%\"\n );\n\n $strWhere = \"( \".implode(\" OR \", $arrWhere).\" ) \";\n\n //Query bauen\n $strQuery = \"SELECT system_id\n FROM \"._dbprefix_.\"news,\n \"._dbprefix_.\"system\n WHERE \".$strWhere.\"\n AND system_id = news_id\n AND system_status = 1\";\n\n $arrNews = $this->objDB->getPArray($strQuery, $arrParams);\n\n\n if(count($arrNews) > 0) {\n\n foreach($arrNews as $arrOneNews) {\n\n $objNews = new class_module_news_news($arrOneNews[\"system_id\"]);\n $arrDetails = $this->getElementData($objNews);\n\n foreach($arrDetails as $arrOnePage) {\n\n //check, if the post is available on a page using the current language\n if(!isset($arrOnePage[\"news_detailspage\"]) || $arrOnePage[\"news_detailspage\"] == \"\" || !$objNews->rightView())\n continue;\n\n $objDetails = class_module_pages_page::getPageByName($arrOnePage[\"news_detailspage\"]);\n\n if($objDetails == null)\n continue;\n\n if(isset($this->arrHits[$objNews->getSystemid().$objDetails->getSystemid()])) {\n $objResult = $this->arrHits[$objNews->getSystemid().$objDetails->getSystemid()];\n $objResult->setIntHits($objResult->getIntHits() + 1);\n }\n else {\n\n //TODO: PV position\n\n $objResult = new class_search_result();\n $objResult->setStrResultId($objNews->getSystemid().$objDetails->getSystemid());\n $objResult->setStrSystemid($objNews->getSystemid());\n $objResult->setStrPagelink(getLinkPortal($arrOnePage[\"news_detailspage\"], \"\", \"_self\", $arrOnePage[\"news_detailspage\"], \"newsDetail\", \"&highlight=\".urlencode(html_entity_decode($this->strSearchterm, ENT_QUOTES, \"UTF-8\")), $objNews->getSystemid()));\n $objResult->setStrPagename($arrOnePage[\"news_detailspage\"]);\n $objResult->setStrDescription($objNews->getStrTitle());\n\n $this->arrHits[$objNews->getSystemid().$objDetails->getSystemid()] = $objResult;\n }\n }\n }\n }\n }", "function getActiveNewsItems($iPage=0, $iType=0) {\n \n // set sql filter\n $sFilter = \"\";\n if ($iType) $sFilter = \" AND news_type_id=\".$iType;\n \n $sDate = date(\"Y-m-d\");\n \n $sql = \"SELECT \n n.news_id, \n n.news_title, \n n.news_article, \n n.news_release_dt, \n COUNT(c.news_comment_id) AS cmt_cnt \n FROM \n \".PREFIX.\"_news n \n LEFT JOIN \".PREFIX.\"_news_comments c ON (c.news_id=n.news_id)\n WHERE \n deleted=0 \n and status=1 \n and news_release_dt <= '\".$sDate.\"' \n and news_expire_dt > '\".$sDate.\"'\".$sFilter.\" \n GROUP BY \n n.news_id \n ORDER BY \n news_release_dt desc \n LIMIT \".$iPage.\", \".ROWCOUNT;\n \n if (DB::isError($rsTmp = $this->_oConn->query($sql))) {\n \n catchExc($rsTmp->getMessage());\n return false;\n }\n \n // build return array\n $i = 0;\n while ($aRow = $rsTmp->fetchRow(DB_FETCHMODE_ASSOC)) {\n \n $return[$i][\"News Id\"] = $aRow[\"news_id\"];\n $return[$i][\"Title\"] = $aRow[\"news_title\"];\n $return[$i][\"Article\"] = $aRow[\"news_article\"];\n $return[$i][\"Comment Count\"] = $aRow[\"cmt_cnt\"];\n $return[$i][\"Release Date\"] = strtotime($aRow[\"news_release_dt\"]);\n ++$i;\n }\n return $return;\n }", "public static function getFirstPage() {\n // get all the articles\n $articles = htmlqp('http://9gag.com', 'article');\n\n $nodes = array();\n\n // loop the entries\n foreach ($articles as $id => $article) {\n // get information about entries\n $nodes['article'][$id] = self::getArticle($article->attr('data-entry-id'));\n }\n\n // return articles\n return $nodes;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a FE User has requested buddylist approval of a target FE User.
public static function hasUserRequestedBuddyApproval($requestor_uid, $feuser_uid) { $res = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_buddylist_approval WHERE NOT deleted = 1 AND NOT hidden = 1 AND requestor_uid = '.intval($requestor_uid).' AND target_uid = '.intval($feuser_uid).';'); if (is_array($res[0])) { return true; } return false; }
[ "public function needsApproval($user)\n {\n if ($GLOBALS['prefs']->isLocked('friends_approval')) {\n return (boolean)$GLOBALS['prefs']->getValue('friends_approval');\n }\n\n $prefs = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Prefs')->create('folks', array(\n 'cache' => false,\n 'user' => $GLOBALS['registry']->convertUsername($user, true)\n ));\n\n return (boolean)$prefs->getValue('friends_approval');\n }", "public function canApproveUsers()\n {\n\n if ($this->isAdmin())\n return true;\n\n $user = $this->loadUser(Yii::app()->user->id);\n\n $adminGroups = GroupAdmin::model()->countByAttributes(array('user_id' => $user->id));\n if ($adminGroups != 0) {\n return true;\n }\n\n return false;\n }", "public function didIRequest($user_id,$target_id) {\n $sql = \"SELECT * FROM friendship WHERE fk_user_id_1 = '\".$user_id.\"' AND fk_user_id_2 = '\".$target_id.\"' AND friendship_status = 'pending';\";\n\n $record_count = $this->queryForEntryCount($sql);\n\n if ($record_count > 0) {\n return true;\n } else {\n return false;\n }\n }", "function canApprove() {\n\n return ((($this->fields[\"users_id_recipient\"] === Session::getLoginUserID())\n && Session::haveRight('ticket', Ticket::SURVEY))\n || $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || (isset($_SESSION[\"glpigroups\"])\n && $this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"])));\n }", "public function isRequestorApprover($requestor){\n\n $groups = explode(',', $this->user_approvers);\n\n foreach ($groups as $group){\n $user_group = new user_group($group);\n\n $users = $user_group->getApprovers();\n foreach ($users as $user){\n if ($user->getUser_id() == $requestor->getUser_id()){\n return true;\n }\n }\n }\n\n return false;\n\n }", "public function has_pending_friend_request_sent_to($user_id){\n\tif(in_array($user_id, $this->pending_friend_requests_sent_ids())){\n\t return 1;\n\t}else{\n\t return 0;\n\t}\n }", "public static function is_eligible()\n {\n // Look through all subgroups in umbrella group $_eligible_group\n $umbrella = true;\n //Yii::log(\"User is in \". self::is_in_which_LDAP_group(self::$_eligible_group, $umbrella), \"info\", \"system.debug\");\n return self::is_in_which_LDAP_group(self::$_eligible_group, $umbrella);\n }", "public function sentFriendRequestTo($otherUserId)\n\t{\n\t\t$friendRequestedByCurrentUser = DB::table('friend_requests')->where('requester_id', $this->id)->pluck('user_id')->all();\n\n\t\treturn in_array($otherUserId, $friendRequestedByCurrentUser);\n\t}", "public static function isBuddylistNotificationEnabled() {\r\n \t$conf = tx_cwtcommunity_lib_common::getConfArray();\r\n \tif ($conf['buddylist.']['approval_message'] == '1') {\r\n \t\treturn true;\t\r\n \t}\r\n \treturn false; \t\r\n }", "protected function userMayAmend()\n\t{\n\t\treturn $this->access->mayAmendGradeUser();\n\t}", "function agt_has_user_approved($user_id, $post_id) { \n\t\t$approval_status = get_post_meta($post_id, 'agt_approval_status_'.$user_id); \n\n\t\tif($approval_status[0] == \"approved\") { \n\t\t\treturn true; \n\t\t} else { \n\t\t\treturn false; \n\t\t}\n\t}", "public function canDecline()\n {\n $user = $this->getUser();\n\n return ($this->getData('receiver_id') == $user['id'] &&\n $this->getData('status') == self::STATUS_PENDING) ? true : false;\n }", "public function IsValidForCurrentUser()\n {\n $bIsValidForUser = false;\n $bIsValidGroup = false;\n\n $shippingGroupDataAccess = $this->getShippingGroupDataAccess();\n $aUserGroups = $shippingGroupDataAccess->getPermittedUserGroupIds($this->id);\n if (!is_array($aUserGroups) || count($aUserGroups) < 1) {\n $bIsValidGroup = true;\n } else {\n $oUser = TdbDataExtranetUser::GetInstance();\n $bIsValidGroup = $oUser->InUserGroups($aUserGroups);\n }\n\n // now check user id\n if ($bIsValidGroup) {\n $aUserList = $shippingGroupDataAccess->getPermittedUserIds($this->id);\n if (!is_array($aUserList) || count($aUserList) < 1) {\n $bIsValidForUser = true;\n } else {\n $oUser = TdbDataExtranetUser::GetInstance();\n $bIsValidForUser = in_array($oUser->id, $aUserList);\n }\n }\n\n return $bIsValidForUser && $bIsValidGroup;\n }", "protected function isAllowed() : bool\n {\n return in_array($this->request->get('referral'), $this->allowedReferral);\n }", "private function isAssignedToApprovalLevel(): bool\n {\n return !empty($this->user->getApprovalLevelId());\n }", "protected function isAllowed() : bool\n {\n return $this->request->has('referral')\n && in_array($this->request->get('referral'), $this->allowedReferral);\n }", "public function hasFriendRequestPending(User $user){ //Here we pass in a user. We use this to find out does the signed in user have a friend request pending from this user.\n return (bool) $this->friendRequestsPending()->count(); //The bool property returns this function result as a booleon value.\n //This function checks if this user we are looking at has a friend request from the signed in user and returns it as a booleon value.\n //Originall was $this->friendRequestsPending()->where('id', $user->id)->count();\n }", "public function testBookingsNeedingApprovalAreListed(): void\n {\n $this->approvalIsRequired();\n\n $approver = User::factory()->create();\n\n $group = Group::factory()->hasAttached($approver, [], 'approvers')->create();\n\n $booking = Booking::factory()\n ->for(User::factory()->hasAttached($group))\n ->create();\n\n $this->actingAs($approver)->get('approvals')\n ->assertOk()\n ->assertSeeText($booking->user->name);\n }", "public function isApplicableToUser($user) {\r\n\r\n /**\r\n * No license restriction (e.g. 'unlicensed' license)\r\n * => Every user fulfill license requirements\r\n */\r\n if (!isset($this->description['grantedCountries']) && !isset($this->description['grantedOrganizationCountries']) && !isset($this->description['grantedFlags'])) {\r\n return true;\r\n }\r\n\r\n /**\r\n * User profile should match at least one of the license granted flags \r\n */\r\n if (isset($this->description['grantedFlags'])) {\r\n\r\n /*\r\n * Registered user has automatically the REGISTERED flag\r\n * (see 'unlicensedwithregistration' license)\r\n */\r\n $userFlags = !empty($user->profile['flags']) ? array_map('trim', explode(',', $user->profile['flags'])) : array();\r\n if ($user->profile['userid'] !== -1) {\r\n $userFlags[] = 'REGISTERED';\r\n }\r\n\r\n /*\r\n * No match => no fulfill\r\n */\r\n if (!$this->matches($userFlags, array_map('trim', explode(',', $this->description['grantedFlags'])))) {\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * User profile should match either one of the license granted countries or organization countries\r\n */\r\n if (isset($this->description['grantedCountries']) || isset($this->description['grantedOrganizationCountries'])) {\r\n $fulfill = false;\r\n if (isset($this->description['grantedCountries']) && isset($user->profile['country'])) {\r\n $fulfill = $fulfill || $this->matches(array_map('trim', explode(',', $user->profile['country'])), array_map('trim', explode(',', $this->description['grantedCountries'])));\r\n }\r\n if (isset($this->description['grantedOrganizationCountries']) && isset($user->profile['organizationcountry'])) {\r\n $fulfill = $fulfill || $this->matches(array_map('trim', explode(',', $user->profile['organizationcountry'])), array_map('trim', explode(',', $this->description['grantedOrganizationCountries'])));\r\n }\r\n return $fulfill;\r\n }\r\n return true;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////////////////////////////////////////////////////////////////////////////// / updateModelWithJunctionTable ////////////////////////////////////////////////////////////////////////////// ATTENTION: Model must be validated before executing this method.
public function updateModelWithJunctionTable() { $tab = '{{%template_location}}'; $transaction = Yii::$app->db->beginTransaction(); try { $this->save(false); if ($this->scenario == static::SCENARIO_MAINSECTION) { $this->compareSectionAndTagAttributes('mainSectionIds', static::LOCATION_MAINSECTION); } else { $this->compareSectionAndTagAttributes('sectionIds', static::LOCATION_SECTION); $this->compareSectionAndTagAttributes('tagIds', static::LOCATION_TAG); } if ($this->scenario == static::SCENARIO_ADVERT) { $this->compareAdvertAttribute(); } if (count($this->deleteCondition) > 1) { Yii::$app->db->createCommand()->delete($tab, $this->deleteCondition)->execute(); } if (!empty($this->arrayToBatchInsert)) { Yii::$app->db->createCommand()->batchInsert($tab, [ 'location_id', 'location_key', 'template_id', 'advert_key' ], $this->arrayToBatchInsert)->execute(); } $transaction->commit(); return true; } catch (\Exception $e) { $transaction->rollBack(); $this->addError('items_amount', $e->getMessage()); } catch (\Throwable $e) { $transaction->rollBack(); $this->addError('items_amount', $e->getMessage()); } return false; }
[ "abstract protected function updateModel();", "public static function handleUpdateSingleModel(Model $model)\n {\n $singleModelsList = array_merge(\n config('mongez.database.onModel.update.' . static::class, []),\n !empty(static::ON_MODEL_UPDATE) ? static::ON_MODEL_UPDATE : [],\n !empty(static::MODEL_LINKS) ? static::MODEL_LINKS : [],\n );\n\n // the model options is can be an string or array\n // the array can have up to 3 elements: search-column, updating field and shared info method\n // if the model options is set to string, then it will be converted to\n // $modelOptions.id, $modelOptions, sharedInfo\n\n collect($singleModelsList)->each(function ($modelOptions, $modelClass) use ($model) {\n static::$modelClass = $modelClass;\n\n static::setModelOptions($modelOptions);\n\n collect(static::$modelOptions)->each(function ($options) use ($model) {\n $records = static::getRelatedModels($model, $options);\n\n foreach ($records as $record) {\n $record->{$options['foreignColumn']} = $model->{$options['sharedInfoMethod']}();\n\n $record->save();\n }\n });\n });\n }", "private function _afterUpdate() {\n\n\t if (count($this->_relations)>0) {\n\n\t foreach ($this->_relations as $relation) {\n\n\t $type = $relation[\"type\"];\n\t $propName = $relation[\"table\"];\n \t\t $updateMethod = $relation[\"update\"];\n\n \t\t if ($updateMethod==\"restrict\") {\n \t\t continue;\n \t\t }\n\n \t\t if ($updateMethod==\"cascade\") {\n \t\t if (is_array($this->$propName)) {\n \t\t if (count($this->$propName)>0) {\n \t\t foreach ($this->$propName as $object) {\n \t\t if ( ($type==\"has_one\") || ($type==\"has_many\") ) {\n \t\t $column = $relation[\"dstColumn\"];\n \t\t $srcColumn = $relation[\"srcColumn\"];\n \t\t $object->$column = $this->$srcColumn;\n \t\t $object->save();\n \t\t }\n \t\t if ($type==\"has_many_and_belongs_to\") {\n \t\t $oldSrcValue = $object->$srcColumn;\n \t\t $srcTable = $relation[\"srcTable\"];\n \t\t $srcColumn = $relation[\"srcColumn\"];\n \t\t $dstTable = $relation[\"dstTable\"];\n \t\t $dstColumn = $relation[\"dstColumn\"];\n \t\t $throughTable = $relation[\"throughTable\"];\n \t\t $throughTableSrcColumn = $relation[\"throughTableSrcColumn\"];\n \t\t $throughTableDstColumn = $relation[\"throughTableDstColumn\"];\n \t\t $dstColumnValue = $object->$dstColumn;\n \t\t $srcColumnValue = $this->$srcColumn;\n \t\t $this->_updateHABTM($srcTable,$srcColumn,$dstTable,$dstColumn,$throughTable,$throughTableSrcColumn,$throughTableDstColumn,$dstColumnValue,$srcColumnValue,$oldSrcValue);\n \t\t }\n \t\t }\n \t\t }\n \t\t }\n \t\t }\n\n \t\t if ($updateMethod==\"set null\") {\n\n \t\t if (is_array($this->$propName)) {\n \t\t if (count($this->$propName)>0) {\n \t\t foreach ($this->$propName as $object) {\n \t\t if ( ($type==\"has_one\") || ($type==\"has_many\") ) {\n \t\t $column = $relation[\"dstColumn\"];\n \t\t $object->$column = \"NULL\";\n \t\t $object->save();\n \t\t }\n \t\t if ($type==\"has_many_and_belongs_to\") {\n \t\t $srcTable = $relation[\"srcTable\"];\n \t\t $srcColumn = $relation[\"srcColumn\"];\n \t\t $dstTable = $relation[\"dstTable\"];\n \t\t $dstColumn = $relation[\"dstColumn\"];\n \t\t $throughTable = $relation[\"throughTable\"];\n \t\t $throughTableSrcColumn = $relation[\"throughTableSrcColumn\"];\n \t\t $throughTableDstColumn = $relation[\"throughTableDstColumn\"];\n \t\t $dstColumnValue = $object->$dstColumn;\n \t\t $srcColumnValue = $this->$srcColumn;\n \t\t $this->_updateHABTM($srcTable,$srcColumn,$dstTable,$dstColumn,$throughTable,$throughTableSrcColumn,$throughTableDstColumn,$dstColumnValue,$srcColumnValue,\"NULL\");\n \t\t }\n \t\t }\n \t\t }\n \t\t }\n \t\t }\n \t\t }\n\t\t }\n\t}", "public function testUpdateCreateUsingRelationViaTable()\n {\n $test = $this->findTestModel(2);\n $test = $this->useRelationViaTable($test);\n $this->testUpdateCreate($test);\n }", "public function Update (Model\\DomainModelAbstract $pModel);", "public function testUpdateNotFilledUsingRelationViaTable()\n {\n $additionalConfig = ['autoFill' => false];\n $test = $this->findTestModel(1, $additionalConfig);\n $test = $this->useRelationViaTable($test, $additionalConfig);\n $this->testUpdateNotFilled($test);\n }", "private function updateLinkModels() {\n foreach ($this->models as $model) {\n $this->registerLinkModels($model);\n }\n }", "public function updateAssociatedRecords()\n\t{\n\t\t$obj = $this->getContext()->getSourceRecord();\n\t\t$fkObjects = &$obj->{$this->getContext()->getProperty()};\n\t\t$success=true;\n\t\tif(($total = count($fkObjects))> 0)\n\t\t{\n\t\t\t$source = $this->getSourceRecord();\n\t\t\t$fkeys = $this->findForeignKeys($fkObjects[0], $source);\n\t\t\tfor($i=0;$i<$total;$i++)\n\t\t\t{\n\t\t\t\tforeach($fkeys as $fKey => $srcKey)\n\t\t\t\t\t$fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey));\n\t\t\t\t$success = $fkObjects[$i]->save() && $success;\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}", "function update($model, $id);", "public function update(\\Maleficarum\\Data\\Model\\Persistable\\AbstractModel $model): \\Maleficarum\\Storage\\Repository\\ModelInterface;", "protected function associateExisting($model)\n {\n // Get existing embedded documents.\n $records = $this->getEmbedded();\n\n $primaryKey = $this->related->getKeyName();\n\n $key = $model->getKey();\n\n // Replace the document in the parent model.\n foreach ($records as &$record)\n {\n if ($record[$primaryKey] == $key)\n {\n $record = $model->getAttributes();\n break;\n }\n }\n\n $this->setEmbedded($records);\n }", "public function fillOnUpdate($model)\n {\n //\n }", "public function afterSaveUpdateRelatedModels() {\n $model_fret = FretRefType::model()->findAll();\n foreach($model_fret as $fret){\n $criteria = new CDbCriteria();\n $criteria->compare($fret->fret_model_fixr_id_field,$this->fixr_id);\n $ref_model = new $fret->fret_model;\n foreach($ref_model->findAll($criteria) as $ref){\n $ref->save();\n }\n }\n \n }", "private function ormCascadeUpdate()\n {\n foreach ($this->orm['relations'] as $class => $relDetail)\n {\t \n\t // Make sure the related object is available. It should always be.\n\t if (!isset($this->$class))\n\t {\n\t continue;\n\t }\n\t \n\t // $ref will be a pointer to the related object.\t \n\t $ref = $this->$class;\n\n\t if ($ref->isDirty())\n\t {\n\t $ref->ormUpdate(); \n\t }\n }\n }", "public function updateModelSync($model)\n {\n\t$this->query('update [tables] set [hash] = %s where [name] = %s',\n\t$model->getHash(),\n\t$model->getTableName()\n\t);\n }", "public function updateModel() {\n $path = $this->model->getApiPath();\n $response = $this->patch($path, $this->model->toArray());\n\n return $this->handleResponse($response);\n }", "public function syncModel($model, $dto);", "public function batchUpdate() {\n\t\t\n\t\t$data = $this->_data;\n\t\t$this->withData();\n\t\t\n\t\t$parent_model = $this->_model;\n\t\t$this->forModel();\n\t\t\n\t\t$passed_conditions = $this->_passed_conditions;\n\t\t$this->withPassedConditions();\n\t\t\n\t\t$field_exceptions = $this->_field_exceptions;\n\t\t$this->withFieldExceptions();\n\t\t\n\t\t// Cannot Update Multiple Models\n\t\tif (count(array_keys($data)) > 1) {\n\t\t\t$this->setResponseCode(4015);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Data Should Not Be Indexed\n\t\tif (Hash::numeric(array_keys($data[$parent_model]))) {\n\t\t\t$this->setResponseCode(4008);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Cannot Pass ID\n\t\tif (!empty($data[$parent_model]['id'])) {\n\t\t\t$this->setResponseCode(4001);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Field Map Based Off Read for Querying\n\t\t$field_map = $this\n\t\t\t->withParentModel()\n\t\t\t->forModel($parent_model)\n\t\t\t->returnsFieldMap('read');\n\t\t\n\t\t$modelObject = $this->Controller->{$parent_model};\n\t\t\n\t\t$fields = array();\n\t\tif (!empty($field_map)) {\n\t\t\t\n\t\t\t$fields = $this\n\t\t\t\t->forModel($parent_model)\n\t\t\t\t->withFieldMap($field_map)\n\t\t\t\t->withDataFields($data[$parent_model])\n\t\t\t\t->withFieldExceptions($field_exceptions)\n\t\t\t\t->returnsFilteredDataFields();\n\t\t\t\n\t\t}\n\t\t\n\t\t$field_names = $modelObject->getFieldNames($field_map);\n\t\t\n\t\tif (empty($passed_conditions)) {\n\t\t\t$passed_conditions = $this->Query\n\t\t\t\t->withFieldMap($field_map)\n\t\t\t\t->rendersConditions();\n\t\t}\n\n\t\tif (empty($passed_conditions)) {\n\t\t\t$this->setResponseCode(4017);\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t$conditions = $this\n\t\t\t->withParentModel()\n\t\t\t->forModel($parent_model)\n\t\t\t->withFields($field_names)\n\t\t\t->withPassedConditions($passed_conditions)\n\t\t\t->on('update')\n\t\t\t->rendersConditions();\n\t\t\n\t\tif (empty($conditions)) {\n\t\t\t$this->setResponseCode(4017);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Find IDs of Records to Update\n\t\t$ids = $modelObject->find('list', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'fields' => array(\n\t\t\t\t$parent_model . '.id'\n\t\t\t),\n\t\t\t'contain' => false\n\t\t));\n\t\t\n\t\tif (empty($ids)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// ID `0` Could Come from Special Cases like FormRecordFolder `Uncategorized`\n\t\tif (false !== $key = array_search(0, $ids)) {\n\t\t\tunset($ids[$key]);\n\t\t}\n\t\t\n\t\tif (empty($ids)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$modelObject->begin();\n\t\t\n\t\tforeach ($ids as $id) {\n\t\t\t\n\t\t\t$modelObject->create(false);\n\t\t\t$modelObject->id = $id;\n\t\t\t$modelObject->set(array($parent_model => $fields));\n\t\t\t\n\t\t\t// Validation\n\t\t\tif (!$modelObject->validates() ||\n\t\t\t\t!is_null($this->getIndexValidationErrors())) {\n\t\t\t\t\n\t\t\t\t$validationErrors = $modelObject->validationErrors;\n\t\t\t\t\n\t\t\t\t$modelObject->rollback();\n\t\t\t\t$this->setResponseCode(4012);\n\t\t\t\t\n\t\t\t\tif (!empty($validationErrors)) {\n\t\t\t\t\t$this->forModel($parent_model)\n\t\t\t\t\t\t ->withFieldMap($field_map)\n\t\t\t\t\t\t ->setValidationErrors($validationErrors);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Can Update\n\t\t\tif (!$this->Permissions\n\t\t\t\t->forModel($parent_model)\n\t\t\t\t->canUpdate($id, $fields)) {\n\t\t\t\t$this->setResponseCode(4013);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$fieldList = array_keys($field_map);\t\n\t\t\tif (!empty($field_exceptions)) {\n\t\t\t\t$fieldList = array_merge($fieldList, $field_exceptions);\n\t\t\t}\n\t\t\n\t\t\t// Save Data\n\t\t\tif (!$modelObject->save(array(\n\t\t\t\t\t$data\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'fieldList' => $fieldList,\n\t\t\t\t\t'validate' => false\n\t\t\t\t)\n\t\t\t)) {\n\t\t\t\t$modelObject->rollback();\n\t\t\t\t$this->setResponseCode(5001);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$modelObject->commit();\n\t\t\n\t\t$this->Controller->request->params['paging'][$parent_model]['count'] = count($ids);\n\t\t\n\t\treturn true;\n\t\t\t\t\n\t}", "public function update($modelId, $properties);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the customizedLabel property value. Title/label override for customization.
public function setCustomizedLabel(?string $value): void { $this->getBackingStore()->set('customizedLabel', $value); }
[ "public function setLabel($value) { $this->_label = $value; }", "public function setLabel() {\n }", "public function setLabel($label);", "public function setGenericLabel($generic_label);", "function setLabel($label){\r\n\t\t$this->label = $label;\r\n\t}", "public function getCustomLabel()\n {\n return $this->customLabel;\n }", "function setLabel();", "private function setLabel($label) {\n $this->properties->setWidgetProperty(self::SETTING_LABEL . $this->locale, $label);\n }", "protected function setDefaultLabel(): void\n {\n $this->defaultOptions['label'] = __($this->renderName());\n }", "public function setLabel($label) {\r\n $this->label = $label;\r\n }", "protected function getCustomLabel(){\r\n\t\treturn $this->custom_label;\r\n\t}", "function setValueLabel($valueLabel = \"\") {\n $this->valueLabel = $valueLabel;\n }", "public function setLabel($label) {\n\t\t$this->label = $label;\n\t}", "function setLabel($label=\"\"){\n\t\t\t$this->obj->label = $label;\t\n\t\t}", "public function setLabel( string $label ) : \\Aimeos\\MShop\\Popup\\Item\\Iface;", "public function setLabel( string $label ) {\n $this->labels ['singular_name'] = $label;\n }", "public function setLabel($text) {\n $this->label = '<label for=\"'.$this->id.'\">'.$text.'</label>';\n }", "public function setLabelAttribute($value)\n {\n $this->attributes['label'] = strtolower($value);\n }", "public function setOtherLabel($val)\n {\n $this->_propDict[\"otherLabel\"] = $val;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isset productRecommendations This field is deprecated.
public function issetProductRecommendations($index) { return isset($this->productRecommendations[$index]); }
[ "public function getProductRecommendations()\n {\n return $this->productRecommendations;\n }", "public function setProductRecommendations(array $productRecommendations)\n {\n $this->productRecommendations = $productRecommendations;\n return $this;\n }", "public function getRecommendations()\n {\n \n }", "public function getIsRecommend()\n {\n return $this->is_recommend;\n }", "public function getRecommendations();", "public static function GetRecommendations()\r\n {\r\n \t\r\n \t$cartId = self::GetCartId();\r\n \t\r\n // Build the SQL query\r\n //$sql = 'CALL shopping_cart_get_recommendations(:cart_id, :short_product_description_length)';\r\n \r\n $sql = \"SELECT od1.product_id, od1.product_name,\r\n IF(LENGTH(p.description) <= '150', p.description,\r\n CONCAT(LEFT(p.description,'150'), '...')) AS description\r\n FROM order_detail od1\r\n JOIN order_detail od2\r\n ON od1.order_id = od2.order_id\r\n JOIN product p\r\n ON od1.product_id = p.product_id\r\n JOIN shopping_cart\r\n ON od2.product_id = shopping_cart.product_id\r\n WHERE shopping_cart.cart_id = '$cartId'\r\n \r\n AND od1.product_id NOT IN\r\n (-- Returns the products in the specified\r\n -- shopping cart\r\n SELECT product_id\r\n FROM shopping_cart\r\n WHERE cart_id = '$cartId')\r\n \r\n GROUP BY od1.product_id\r\n -- Order descending by rank\r\n ORDER BY COUNT(od1.product_id) DESC\r\n LIMIT 5\";\r\n\r\n\r\n // Build the parameters array\r\n //$params = array (':cart_id' => self::GetCartId(),':short_product_description_length' =>SHORT_PRODUCT_DESCRIPTION_LENGTH);\r\n\r\n // Execute the query and return the results\r\n return DatabaseHandler::ObtenerTodo($sql);\r\n }", "public function getRecommendations()\n {\n return $this->recommendations;\n }", "public function setRecommendedProducts($recommended_products)\n {\n $this->recommended_products = $this->arrayToString($recommended_products);\n\n return $this;\n }", "public function getRecommendedProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table WHERE recommended = 'yes' LIMIT 4;\";\n $product = $this->db->executeFetchAll($sql);\n return $product;\n }", "public function getProductReviews()\n {\n if (self::CONFIG_ENABLE_TRUE == $this->config->get('EkomiFeedback.product_reviews')) {\n return self::VALUE_1;\n }\n\n return self::VALUE_NO;\n }", "public function getSuggestedProducts()\n {\n return $this->suggestedProducts;\n }", "public function show_recommended_products() {\n\n\t\t\t$submission_id = isset( $_GET['fitts_submission'] ) ? $_GET['fitts_submission'] : '';\n\t\t\tif ( $submission_id ) {\n\n\t\t\t\t$product_ids = get_post_meta( $submission_id, 'linked_products', true );\n\t\t\t\tinclude FQ_PLUGIN_DIR . '/template/fitts-recommended-products.php';\n\n\t\t\t}\n\n\t\t}", "function setRecommendations($recommendations) {\n\t\t// @todo \tUnset recommendations first\n\t\tforeach((array) $recommendations as $recommendation) {\n\t\t\t$this->addRecommendation($recommendation);\n\t\t}\n\t}", "function isRecommended($withDescription = false)\n\t{\n\t\tif($this->getVar('product_recommended') != '0000-00-00') {\n\t\t\treturn $withDescription ? _YES : true;\n\t\t} else {\n\t\t\treturn $withDescription ? _NO : false;\n\t\t}\n\t}", "public function setProductIsFree($productIsFree){\n $this->productIsFree = $productIsFree;\n}", "public function isRecommend(){\n\t\tif($this->model->isRecommend())$this->redirect->success('','?a=goods');\n\t}", "public function getRecommendation()\n {\n return $this->recommendation;\n }", "public function getRecommended()\n {\n return $this->recommended;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magento_ProductRecommendationsAdmin::product_recommendations');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Object Function: Return the start article for this category
function getStartArticle() { return OOArticle::getCategoryStartArticle($this->_id); }
[ "function getStartArticle()\n {\n return OOArticle :: getCategoryStartArticle($this->_id, $this->_clang);\n }", "function getCategoryStartArticle($a_category_id, $clang = false) {\r\n\t\tglobal $REX;\r\n\t\tif($clang === false) $clang = $GLOBALS[REX][CUR_CLANG];\r\n\t\treturn OOArticle::getArticleById($a_category_id,$clang);\r\n\t}", "public static function getSiteStartArticleId()\n {\n return rex_addon::get('structure')->getProperty('start_article_id', 1);\n }", "public function getStartDate()\n {\n $topic = BaseManager::build('FelixOnline\\Core\\Topic', 'article_topic', 'topic')\n ->filter('topic = \"%s\"', array($this->getSlug()));\n\n $article = BaseManager::build('FelixOnline\\Core\\Article', 'article', 'id')\n ->join($topic, 'LEFT', 'id', 'article')\n ->filter('published > 0')\n ->order('published', 'ASC')\n ->limit(0, 1)\n ->values();\n\n if (!$article) {\n throw new \\FelixOnline\\Exceptions\\InternalException('No articles posted in this topic');\n }\n\n return($article[0]->getPublished());\n }", "public function getFirstArticle()\n {\n $oArtList = oxNew('oxarticlelist');\n $oArtList->setSqlLimit(0, 1);\n $oArtList->loadRecommArticles($this->getId(), $this->_sArticlesFilter);\n $oArtList->rewind();\n\n return $oArtList->current();\n }", "private function get_start_record() {\n\t\treturn ( $this->current_page - 1 ) * $this->posts_per_page;\n\t}", "function isSiteStartArticle()\n {\n global $REX;\n return $this->_id == $REX['START_ARTICLE_ID'];\n }", "public static function getSiteStartArticle($clang = null)\n {\n return self::get(self::getSiteStartArticleId(), $clang);\n }", "private function get_start(){\n\t\treturn ($this->_page * $this->_perPage) - $this->_perPage;\n\t}", "public function getStartBeginning();", "protected function getStartpart()\n {\n return $this->_startpart;\n }", "function get_first_category_ID() {\n\t$category = get_the_category();\n\treturn $category[0]->cat_ID;\n}", "function bp_docs_get_current_docs_start() {\n\tglobal $wp_query;\n\n\t$paged = !empty( $wp_query->query_vars['paged'] ) ? $wp_query->query_vars['paged'] : 1;\n\n\t$posts_per_page = !empty( $wp_query->query_vars['posts_per_page'] ) ? $wp_query->query_vars['posts_per_page'] : 10;\n\n\t$start = ( ( $paged - 1 ) * $posts_per_page ) + 1;\n\n\treturn apply_filters( 'bp_docs_get_current_docs_start', $start );\n}", "function get_first_category_ID() {\r\n\t$category = get_the_category();\r\n\treturn $category[0]->cat_ID;\r\n}", "public function getDefaultStart() {\r\n return $this->defaultStart;\r\n }", "public static function getFirstPage() {\n // get all the articles\n $articles = htmlqp('http://9gag.com', 'article');\n\n $nodes = array();\n\n // loop the entries\n foreach ($articles as $id => $article) {\n // get information about entries\n $nodes['article'][$id] = self::getArticle($article->attr('data-entry-id'));\n }\n\n // return articles\n return $nodes;\n }", "public function get_start() {\n\t\treturn ( $this->get_wpsolr_paged() === 0 || $this->get_wpsolr_paged() === 1 ) ? 0 : ( ( $this->get_wpsolr_paged() - 1 ) * $this->get_nb_results_by_page() );\n\t}", "public function getStartNode();", "function get_start_number() {\n\t\t$start = ( ( $this->get_paged - 1 ) * $this->get_per_page ) + 1;\n\n\t\treturn $start;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a img tag for a particular binary. Unlike shopImageBinary if you do not specify a dimension, that dimension will be scaled according to the aspect ratio of the original image and in relation to the other dimension. If no dimensions are provided the image will be shown at original size. This should be used when you have a fixed height or width and the images you have are different aspect ratios. Images shouldnt be distored or stretched using this method. Original Image: 100px(w) x 50px(h) New Image: 50px(w) x .....px(h) Result: 50px / aspect ratio(100 / 50) = 25px(h) Original Image: 300px(w) x 200px(h) New image: ....px(w) x 150px(h) Result: 150px aspect ration(300 / 200) = 225px(W)
function showScaledImageBinary($binary, $alt = null, $width = null, $height = null, $class = null, $crop = true, $watermark = false) { $dimensions = $this->getImageDimensions($binary); $aspectRatio = $dimensions["width"] / $dimensions["height"]; if ($width != null && $height == null) { $height = ceil($width / $aspectRatio); } else if ($width == null && $height != null) { $width = ceil($height * $aspectRatio); } return $this->showImageBinary($binary, $alt, $width, $height, $class, $crop, $watermark); }
[ "abstract protected function createVirtualImage($width, $height);", "protected function renderImg() {\n $originalProcessingConfiguration = $this->defaultProcessConfiguration;\n $originalProcessingConfiguration['width'] = isset($this->settings['sourceCollection']['default']['width']) ? $this->settings['sourceCollection']['default']['width'] : 600;\n\n if ($this->additionalConfig['image_format']) {\n $originalProcessingConfiguration['height'] = round(intval($originalProcessingConfiguration['width']) / $this->additionalConfig['image_format']);\n }\n\n $processedFile = $this->imageFile->process(\n ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, $originalProcessingConfiguration\n );\n $src = $processedFile->getPublicUrl();\n $this->tagBuilder->reset();\n $this->tagBuilder->setTagName('img');\n $this->tagBuilder->addAttribute('src', $src);\n $this->tagBuilder->addAttribute('alt', $this->altText);\n $this->tagBuilder->addAttribute('width', $processedFile->getProperty('width'));\n $this->tagBuilder->addAttribute('height', $processedFile->getProperty('height'));\n\n if ($this->imageFile->getProperty('title')) {\n $this->tagBuilder->addAttribute('title', $this->imageFile->getProperty('title'));\n }\n if ($this->settings['cssClasses']['img']) {\n $this->tagBuilder->addAttribute('class', $this->settings['cssClasses']['img']);\n }\n\n if (!empty($this->srcset)) {\n $this->tagBuilder->addAttribute('srcset', implode(', ', $this->srcset));\n $this->tagBuilder->addAttribute('sizes', $this->formatSizes());\n }\n\n // add additionalAttributes\n if (is_array($this->additionalAttributes)) {\n foreach ($this->additionalAttributes as $key => $value) {\n $this->tagBuilder->addAttribute($key, $value);\n }\n }\n\n return $this->tagBuilder->render();\n }", "abstract protected function createImage();", "function ShowFixedSizedImage($source, $width = 100, $height = 100) {\n\n $source_path = $source;\n\n list( $source_width, $source_height, $source_type ) = getimagesize($source_path);\n\n switch ($source_type) {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $source_aspect_ratio = $source_width / $source_height;\n $desired_aspect_ratio = $width / $height;\n\n if ($source_aspect_ratio > $desired_aspect_ratio) {\n //\n // Triggered when source image is wider\n //\n $temp_height = $height;\n $temp_width = (int) ( $height * $source_aspect_ratio );\n } else {\n //\n // Triggered otherwise (i.e. source image is similar or taller)\n //\n $temp_width = $width;\n $temp_height = (int) ( $width / $source_aspect_ratio );\n }\n\n //\n // Resize the image into a temporary GD image\n //\n\n $temp_gdim = imagecreatetruecolor($temp_width, $temp_height);\n imagecopyresampled(\n $temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height\n );\n\n //\n // Copy cropped region from temporary image into the desired GD image\n //\n\n $x0 = ( $temp_width - $width ) / 2;\n $y0 = ( $temp_height - $height ) / 2;\n\n $desired_gdim = imagecreatetruecolor($width, $height);\n imagecopy(\n $desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $width, $height\n );\n\n //\n // Render the image\n // Alternatively, you can save the image in file-system or database\n //\n\n header('Content-type: image/jpeg');\n imagejpeg($desired_gdim);\n\n //\n // Add clean-up code here\n//\n}", "function create_image($input,$output,$width,$height,$aspect_ratio=false){\n\n\t$image = new EasyImage($input);\n\n\t$image->resize($width,$height,(!$aspect_ratio?EasyImage::RESIZE_NONE:EasyImage::RESIZE_WIDTH));\n\t\n\t$image->save($output);\n\n\treturn $output;\n}", "function html_image_resize($src, $width = '', $height = '') \n{\n if ( empty($src)) {\n return false;\n }\n\t// alt is added to the img tag even if it is null to prevent browsers from outputting\n\t// the image filename as default\n $image = '<img src=\"' . $src . '\" border=\"0\"'; \n \n if ((empty($width) || empty($height)) ) \n\t{\n\t\t if ($image_size = @getimagesize($src)) \n\t\t {\n\t\t\tif (empty($width) && $height) \n\t\t\t{\n\t\t\t $ratio = $height / $image_size[1];\n\t\t\t $width = $image_size[0] * $ratio;\n\t\t\t} \n\t\t\telseif ($width && empty($height)) \n\t\t\t{\n\t\t\t $ratio = $width / $image_size[0];\n\t\t\t $height = $image_size[1] * $ratio;\n\t\t\t} \n\t\t\telseif (empty($width) && empty($height)) \n\t\t\t{\n\t\t\t $width = $image_size[0];\n\t\t\t $height = $image_size[1];\n\t\t\t}\n\t\t\t$image.=' width=\"'.$width.'\" height=\"'.$height.'\">';\n\t\t\treturn $image;\n\t\t } \n\t\t else \n\t\t {\n\t\t\treturn false;\n\t\t }\n\t\t \n }\n else\n {\n\t\t$image.=' width=\"'.$width.'\" height=\"'.$height.'\">';\n\t\treturn $image;\n }\t\n}", "public function createImgTag() {\n\t\t$this->imgNeko = '<img src=\"';\n\t\t$this->imgNeko .= $this->imgUri;\n\t\t$this->imgNeko .= '\" width=\"';\n\t\t$this->imgNeko .= $this->imgSize[0];\n\t\t$this->imgNeko .= '\" height=\"';\n\t\t$this->imgNeko .= $this->imgSize[1];\n\t\t$this->imgNeko .= '\" alt=\"';\n\t\t$this->imgNeko .= $this->creditInfo;\n\t\t$this->imgNeko .= '\">';\n\t}", "function create() {\n\t $output= $this->renderCached();\n\t $size= @getimagesize($output);\n\t \n\t $this->image_dimensions= $size[3];\n\t $this->image_name= $output;\n }", "public function createImage() {\n\n $this->image = ImageCreate($this->width, $this->height);\n }", "function zen_image_OLD($src, $alt = '', $width = '', $height = '', $parameters = '') {\n global $template_dir;\n\n//auto replace with defined missing image\n if ($src == DIR_WS_IMAGES and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {\n $src = DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE;\n }\n\n if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {\n return false;\n }\n\n // if not in current template switch to template_default\n if (!file_exists($src)) {\n $src = str_replace(DIR_WS_TEMPLATES . $template_dir, DIR_WS_TEMPLATES . 'template_default', $src);\n }\n\n// alt is added to the img tag even if it is null to prevent browsers from outputting\n// the image filename as default\n $image = '<img src=\"' . zen_output_string($src) . '\" alt=\"' . zen_output_string($alt) . '\"';\n\n if (zen_not_null($alt)) {\n $image .= ' title=\" ' . zen_output_string($alt) . ' \"';\n }\n\n if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {\n if ($image_size = @getimagesize($src)) {\n if (empty($width) && zen_not_null($height)) {\n $ratio = $height / $image_size[1];\n $width = $image_size[0] * $ratio;\n } elseif (zen_not_null($width) && empty($height)) {\n $ratio = $width / $image_size[0];\n $height = $image_size[1] * $ratio;\n } elseif (empty($width) && empty($height)) {\n $width = $image_size[0];\n $height = $image_size[1];\n }\n } elseif (IMAGE_REQUIRED == 'false') {\n return false;\n }\n }\n\n if (zen_not_null($width) && zen_not_null($height)) {\n $image .= ' width=\"' . zen_output_string($width) . '\" height=\"' . zen_output_string($height) . '\"';\n }\n\n if (zen_not_null($parameters)) $image .= ' ' . $parameters;\n\n $image .= ' />';\n\n return $image;\n }", "public function generateImg($image, $width = 0, $height = 0){\r\n\t\tif(is_file($image)){\r\n\r\n\t\t\tif($width == 0 && $height == 0){\r\n\t\t\t\t$size_output = '';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$size = getimagesize($image);\r\n\t\t\t\t$size_output = $size[3];\r\n\t\t\t}\r\n\r\n\t\t\treturn '<img src=\"' . $image . '\" ' . $size_output . ' border=\"0\">';\r\n\t\t}\r\n\t}", "function wb_create_image($width = 0, $height = 0, $dibbmi = null, $dibbits = null) {}", "function imageTag($image, $sizes = '', $classes = '', $loading = 'auto', $defaultSize = 'large') {\n $attrs = [];\n $attrs['src'] = $image['sizes'][$defaultSize];\n $attrs['alt'] = htmlentities($image['alt']);\n $attrs['class'] = $classes;\n\n if ($image['mime_type'] === 'image/svg+xml' || $image['mime_type'] === 'svg') {\n ?>\n <img <?php foreach ($attrs as $key => $value) { echo $key.'=\"'.$value.'\" '; }?> />\n <?php\n } else {\n $attrs['srcset'] = getSrcset($image);\n $attrs['sizes'] = $sizes;\n\n if ($sizes) {\n $attrs['sizes'] = preg_replace('/\\s+/', ' ', trim(preg_replace(\"/\\r|\\n/\", '', $sizes)));\n }\n\n $attrs['width'] = $image['sizes'][$defaultSize.'-width'];\n $attrs['height'] = $image['sizes'][$defaultSize.'-height'];\n $attrs['loading'] = $loading;\n\n if (!$sizes) {\n $attr['sizes'] = $attrs['width'];\n }\n\n ?>\n <img <?php foreach ($attrs as $key => $value) { echo $key . '=\"' . $value . '\" '; }?> />\n <?php\n }\n}", "function createImg()\n {\n // imagem de origem\n if ($this->ext == \"png\")\n $img_origem= imagecreatefrompng($this->origem);\n\t\telseif ($this->ext == \"gif\")\n $img_origem= imagecreatefromgif($this->origem);\n elseif ($this->ext == \"jpg\" || $this->ext == \"jpeg\")\n $img_origem= imagecreatefromjpeg($this->origem);\n\t\t\telseif ($this->ext == \"jpg\" || $this->ext == \"jpeg\")\n $img_origem= imagecreatefromwbmp($this->origem);\n return $img_origem;\n }", "protected function createImage()\n {\n $resource = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n imagecopyresampled($resource, $this->image, 0, 0, 0, 0,\n $this->newWidth, $this->newHeight, $this->oldWidth, $this->oldHeight);\n imagejpeg($resource, $this->originalFilePath, 80);\n }", "public function generateThumbnail() {\n \n // checks supported formats\n if(!in_array($this->extension, $this->supported_files)) {\n return;\n }\n \n // checks if library is installed\n if (!function_exists(\"gd_info\")) {\n return;\n }\n \n // exists if image is too big\n if($this->sourceImageTooBig()) {\n return;\n }\n \n // gets image dimensions\n \n $new_height = $this->height;\n $new_width = $this->width;\n \n $width = $this->source_info[0];\n $height = $this->source_info[1];\n \n // checks image is smaller than desired dimensions\n if($width < $this->width && $height < $this->height) {\n \n return;\n \n }\n \n // gets image ratio\n $img_ratio = $height / $width;\n \n if($img_ratio > $this->ratio) {\n \n $x = intval($width * $new_height / $height);\n \n if($x < $new_width) {\n \n $new_height = intval($height * $new_width / $width);\n \n }\n \n else {\n \n $new_width = $x;\n \n }\n \n }\n \n else {\n \n $x = intval($height * $new_width / $width);\n \n if ($x < $new_height)\n {\n \n $new_width = intval($width * $new_height / $height);\n \n } \n \n else\n {\n \n $new_height = $x;\n \n }\n \n }\n \n // gets image object\n $img_object = $this->getImageObject();\n \n // creates target image object\n $img_object_target = imagecreatetruecolor($this->width, $this->height);\n \n // holds resized image object\n $resized_image = imagecreatetruecolor($new_width, $new_height);\n \n switch ($this->extension) {\n \n \n // jpg\n case 'jpg':\n case 'jpeg':\n \n break;\n \n // png\n case 'png':\n \n imagealphablending($img_object_target, false );\n imagesavealpha($img_object_target, true );\n \n imagealphablending($resized_image, false );\n imagesavealpha($resized_image, true );\n \n break;\n \n // gif\n case 'gif':\n \n break;\n \n }\n \n \n // resize image\n imagecopyresampled($resized_image, $img_object, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n \n // makes the final cropped thumbnail\n imagecopy($img_object_target, $resized_image, 0, 0, 0, 0, $new_width, $new_height);\n \n // saves image\n $this->saveThumbnail($img_object_target);\n \n // destroys image object\n imagedestroy($img_object);\n imagedestroy($img_object_target);\n imagedestroy($resized_image);\n \n // sets thumbnail created status\n $this->created = true;\n \n }", "abstract protected function getBlankImage($width, $height);", "function wp_img_tag_add_width_and_height_attr( $image, $context, $attachment_id ) {\n\t$image_src = preg_match( '/src=\"([^\"]+)\"/', $image, $match_src ) ? $match_src[1] : '';\n\tlist( $image_src ) = explode( '?', $image_src );\n\n\t// Return early if we couldn't get the image source.\n\tif ( ! $image_src ) {\n\t\treturn $image;\n\t}\n\n\t/**\n\t * Filters whether to add the missing `width` and `height` HTML attributes to the img tag. Default `true`.\n\t *\n\t * Returning anything else than `true` will not add the attributes.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool $value The filtered value, defaults to `true`.\n\t * @param string $image The HTML `img` tag where the attribute should be added.\n\t * @param string $context Additional context about how the function was called or where the img tag is.\n\t * @param int $attachment_id The image attachment ID.\n\t */\n\t$add = apply_filters( 'wp_img_tag_add_width_and_height_attr', true, $image, $context, $attachment_id );\n\n\tif ( true === $add ) {\n\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t\t$size_array = wp_image_src_get_dimensions( $image_src, $image_meta, $attachment_id );\n\n\t\tif ( $size_array ) {\n\t\t\t$hw = trim( image_hwstring( $size_array[0], $size_array[1] ) );\n\t\t\treturn str_replace( '<img', \"<img {$hw}\", $image );\n\t\t}\n\t}\n\n\treturn $image;\n}", "protected function _createImage() {\n $this->_height = $this->scale * 60;\n $this->_width = 1.8 * $this->_height;\n\n $this->_image = imagecreate($this->_width, $this->_height);\n imagecolorallocate($this->_image, 0xFF, 0xFF, 0xFF);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send_vb_data_to_atomv2, take the VB data stored and send it to AtomV2
public function send_vb_data_to_atomv2 ($vars = array()) { $brands_list = $this->get_pb_dao()->get_vb_brands_xml($vars["task_id"], $vars["init_read_datetime"]); if ($brands_list !== FALSE) { $xml = array(); $xml[] = '<?xml version="1.0" encoding="UTF-8"?>'; $xml[] = '<brands task_id="' . $vars["task_id"] . '">'; $current_id = ''; foreach ($brands_list as $brand) { if ($current_id != '') { $xml[] = '</brand>'; } $xml[] = '<brand>'; $xml[] = '<id>' . $brand['id'] . '</id>'; $xml[] = '<brand_name><![CDATA[' . $this->replace_special_chars($brand['brand_name']) . ']]></brand_name>'; $xml[] = '<description><![CDATA[' . $this->replace_special_chars($brand['description']) . ']]></description>'; $xml[] = '<accelerator>' . $brand['accelerator'] . '</accelerator>'; $xml[] = '<customer_code>' . $brand['customer_code'] . '</customer_code>'; $xml[] = '<status>' . $brand['status'] . '</status>'; $xml[] = '<is_error>' . $brand['is_error'] . '</is_error>'; $current_id = $brand['id']; } if ($current_id != '') { $xml[] = '</brand>'; } $xml[] = '</brands>'; $feed = implode("", $xml); // header('Content-type: text/xml'); // print $feed; // exit; $feed = $this->send_vb_data_post($feed, $vars["task_type"], $vars["task_id"]); return $feed; } return FALSE; }
[ "public function send_vb_data_to_atomv2 ($vars = array())\r\n\t{\r\n\t\t$products_list = $this->get_pp_dao()->get_vb_products_xml($vars[\"task_id\"], $vars[\"task_type\"], $vars[\"init_read_datetime\"], \"sku\", \"product_keyword\", FALSE);\r\n\t\t\r\n\t\tif ($products_list !== FALSE)\r\n\t\t{\r\n\t\t\t$xml = array();\r\n\t\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\r\n\t\t\t$xml[] = '<products task_id=\"' . $vars[\"task_id\"] . '\">';\r\n\t\t\t\r\n\t\t\t$current_sku = '';\r\n\t\t\t$c = 1;\r\n\t\t\tforeach ($products_list as $pc)\r\n\t\t\t{\r\n\t\t\t\tif ($current_sku != '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$xml[] = '</product>';\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$xml[] = '<product>';\r\n\t\t\t\t$xml[] = '<sku>' . $pc['sku'] . '</sku>';\r\n\t\t\t\t$xml[] = '<master_sku>' . $pc['master_sku'] . '</master_sku>';\r\n\t\t\t\t$xml[] = '<lang_id>' . $pc['lang_id'] . '</lang_id>';\r\n\t\t\t\t$xml[] = '<keyword>' . $this->replace_special_chars($pc['keyword']) . '</keyword>'; \r\n\t\t\t\t$xml[] = '<type>' . $pc['type'] . '</type>';\t\r\n\t\t\t\t$xml[] = '<is_error>' . $pc['is_error'] . '</is_error>';\t\r\n\t\t\t\t\r\n\t\t\t\t$current_sku = $pc['sku'];\r\n\t\t\t}\r\n\t\t\tif ($current_sku != '')\r\n\t\t\t{\r\n\t\t\t\t$xml[] = '</product>';\r\n\t\t\t}\r\n\r\n\t\t\t$xml[] = '</products>';\r\n\t\t\t\r\n\t\t\t$feed = implode(\"\", $xml);\t\r\n\t\t\t\r\n\t\t\t// header('Content-type: text/xml');\r\n\t\t\t// print $feed;\r\n\t\t\t// exit;\r\n\t\t\t\r\n\t\t\t$feed = $this->send_vb_data_post($feed, $vars[\"task_type\"], $vars[\"task_id\"]);\r\n\t\t\t\t\t\t\r\n\t\t\treturn $feed;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function send_vb_data_to_atomv2 ($vars = array())\r\n\t{\r\n\t\t$prices_list = $this->get_pp_dao()->get_vb_prices_xml($vars[\"task_id\"], $vars[\"init_read_datetime\"]);\r\n\r\n\t\tif ($prices_list !== FALSE)\r\n\t\t{\r\n\t\t\t$xml = array();\r\n\t\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\r\n\t\t\t$xml[] = '<prices task_id=\"' . $vars[\"task_id\"] . '\">';\r\n\r\n\t\t\tforeach ($prices_list as $pc) {\r\n\t\t\t\tif ($pc['sync_status'] === 0) {\r\n\t\t\t\t\t$pc['listing_status'] = ''; // Not Sync Listing Status\r\n\t\t\t\t}\r\n\t\t\t\t$xml[] = '<price>';\r\n\t\t\t\t$xml[] = '<sku>' . $pc['sku'] . '</sku>';\r\n\t\t\t\t$xml[] = '<master_sku>' . $pc['master_sku'] . '</master_sku>';\r\n\t\t\t\t$xml[] = '<platform_id>' . $pc['platform_id'] . '</platform_id>';\r\n\t\t\t\t$xml[] = '<prod_price>' . $pc['price'] . '</prod_price>';\r\n\t\t\t\t$xml[] = '<listing_status>' . $pc['listing_status'] . '</listing_status>';\r\n\t\t\t\t$xml[] = '<max_order_qty>' . $pc['max_order_qty'] . '</max_order_qty>';\r\n\t\t\t\t$xml[] = '<auto_price>' . $pc['auto_price'] . '</auto_price>';\r\n\t\t\t\t$xml[] = '</price>';\r\n\t\t\t}\r\n\r\n\t\t\t$xml[] = '</prices>';\r\n\t\t\t$feed = implode(\"\", $xml);\r\n\t\t\t$feed = $this->send_vb_data_post($feed, $vars[\"task_type\"], $vars[\"task_id\"]);\r\n\r\n\t\t\treturn $feed;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function send_vb_data_to_atomv2 ($vars = array())\r\n\t{\r\n\t\t$products_list = $this->get_pp_dao()->get_vb_products_xml($vars[\"task_id\"], $vars[\"task_type\"], $vars[\"init_read_datetime\"], \"prod_sku\", \"product_content\", \"lang_id\", TRUE);\r\n\r\n\t\tif ($products_list !== FALSE)\r\n\t\t{\r\n\t\t\t$xml = array();\r\n\t\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\r\n\t\t\t$xml[] = '<products task_id=\"' . $vars[\"task_id\"] . '\">';\r\n\r\n\t\t\t$current_sku = '';\r\n\t\t\t$c = 1;\r\n\t\t\tforeach ($products_list as $pc)\r\n\t\t\t{\r\n\t\t\t\tif ($current_sku != '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$xml[] = '</product>';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$xml[] = '<product>';\r\n\t\t\t\t$xml[] = '<prod_sku>' . $pc['prod_sku'] . '</prod_sku>';\r\n\t\t\t\t$xml[] = '<master_sku>' . $pc['master_sku'] . '</master_sku>';\r\n\t\t\t\t$xml[] = '<lang_id>' . $pc['lang_id'] . '</lang_id>';\r\n\t\t\t\t$xml[] = '<prod_name>' . $this->replace_special_chars($pc['prod_name']) . '</prod_name>';\r\n\t\t\t\t$xml[] = '<prod_name_original>' . $this->replace_special_chars( $pc['prod_name_original']) . '</prod_name_original>';\r\n\t\t\t\t$xml[] = '<short_desc>' . $this->replace_special_chars($pc['short_desc']) . '</short_desc>';\r\n\t\t\t\t$xml[] = '<contents>' . $this->replace_special_chars($pc['contents']) . '</contents>';\r\n\t\t\t\t$xml[] = '<contents_original>' . $this->replace_special_chars($pc['contents_original']) . '</contents_original>';\r\n\t\t\t\t//$xml[] = '<series>' . $this->replace_special_chars($pc['series']) . '</series>';\r\n\t\t\t\t$xml[] = '<keywords>' . $this->replace_special_chars($pc['keywords']) . '</keywords>';\r\n\t\t\t\t$xml[] = '<keywords_original>' . $this->replace_special_chars($pc['keywords_original']) . '</keywords_original>';\r\n\t\t\t\t//$xml[] = '<model_1>' . $this->replace_special_chars($pc['model_1']) . '</model_1>';\r\n\t\t\t\t//$xml[] = '<model_2>' . $this->replace_special_chars($pc['model_2']) . '</model_2>';\r\n\t\t\t\t//$xml[] = '<model_3>' . $this->replace_special_chars($pc['model_3']) . '</model_3>';\r\n\t\t\t\t//$xml[] = '<model_4>' . $this->replace_special_chars($pc['model_4']) . '</model_4>';\r\n\t\t\t\t//$xml[] = '<model_5>' . $this->replace_special_chars($pc['model_5']) . '</model_5>';\r\n\t\t\t\t$xml[] = '<detail_desc><![CDATA[' . $this->replace_special_chars( $pc['detail_desc']) . ']]></detail_desc>';\r\n\t\t\t\t$xml[] = '<detail_desc_original>' . $this->replace_special_chars( $pc['detail_desc_original']) . '</detail_desc_original>';\r\n\t\t\t\t$xml[] = '<extra_info>' .$this->replace_special_chars( $pc['extra_info']) . '</extra_info>';\r\n\t\t\t\t$xml[] = '<website_status_long_text>' . $this->replace_special_chars($pc['website_status_long_text']) . '</website_status_long_text>';\r\n\t\t\t\t$xml[] = '<website_status_short_text>' . $this->replace_special_chars($pc['website_status_short_text']) . '</website_status_short_text>';\r\n\t\t\t\t//$xml[] = '<youtube_id_1>' . $this->replace_special_chars($pc['youtube_id_1']) . '</youtube_id_1>';\r\n\t\t\t\t//$xml[] = '<youtube_id_2>' . $this->replace_special_chars($pc['youtube_id_2']) . '</youtube_id_2>';\r\n\t\t\t\t//$xml[] = '<youtube_caption_1>' . $this->replace_special_chars($pc['youtube_caption_1']) . '</youtube_caption_1>';\r\n\t\t\t\t//$xml[] = '<youtube_caption_2>' . $this->replace_special_chars($pc['youtube_caption_2']) . '</youtube_caption_2>';\r\n\t\t\t\t$xml[] = '<is_error>' . $pc['is_error'] . '</is_error>';\r\n\r\n\t\t\t\t$current_sku = $pc['prod_sku'];\r\n\t\t\t}\r\n\t\t\tif ($current_sku != '')\r\n\t\t\t{\r\n\t\t\t\t$xml[] = '</product>';\r\n\t\t\t}\r\n\r\n\t\t\t$xml[] = '</products>';\r\n\r\n\t\t\t$feed = implode(\"\", $xml);\r\n\r\n\t\t\t// header('Content-type: text/xml');\r\n\t\t\t// print $feed;\r\n\t\t\t// exit;\r\n\r\n\t\t\t$feed = $this->send_vb_data_post($feed, $vars[\"task_type\"], $vars[\"task_id\"]);\r\n\r\n\t\t\treturn $feed;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function send_vb_data_to_atomv2 ($vars = array())\r\n\t{\r\n\t\t$products_list = $this->get_pp_dao()->get_vb_products_xml($vars[\"task_id\"], $vars[\"task_type\"], $vars[\"init_read_datetime\"], \"sku\", \"product\");\r\n\r\n\t\tif ($products_list !== FALSE)\r\n\t\t{\r\n\t\t\t$xml = array();\r\n\t\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\r\n\t\t\t$xml[] = '<products task_id=\"' . $vars[\"task_id\"] . '\">';\r\n\t\t\t$current_sku = '';\r\n\t\t\tforeach ($products_list as $pc)\r\n\t\t\t{\r\n\t\t\t\tif ($current_sku != '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$xml[] = '</product>';\r\n\t\t\t\t}\r\n\t\t\t\t$xml[] = '<product>';\r\n\t\t\t\t$xml[] = '<sku>' . $pc['sku'] . '</sku>';\r\n\t\t\t\t$xml[] = '<master_sku>' . $pc['master_sku'] . '</master_sku>';\r\n\t\t\t\t$xml[] = '<prod_grp_cd>' . $pc['prod_grp_cd'] . '</prod_grp_cd>';\r\n\t\t\t\t$xml[] = '<colour_id>' . $pc['colour_id'] . '</colour_id>';\r\n\t\t\t\t$xml[] = '<version_id>' . $pc['version_id'] . '</version_id>';\r\n\t\t\t\t$xml[] = '<name>' . str_replace('&', '&amp;', $pc['name']) . '</name>';\r\n\t\t\t\t$xml[] = '<freight_cat_id>' . $pc['freight_cat_id'] . '</freight_cat_id>';\r\n\t\t\t\t$xml[] = '<cat_id>' . $pc['cat_id'] . '</cat_id>';\r\n\t\t\t\t$xml[] = '<sub_cat_id>' . $pc['sub_cat_id'] . '</sub_cat_id>';\r\n\t\t\t\t$xml[] = '<sub_sub_cat_id>' . $pc['sub_sub_cat_id'] . '</sub_sub_cat_id>';\r\n\t\t\t\t$xml[] = '<brand_id>' . $pc['brand_id'] . '</brand_id>';\r\n\t\t\t\t$xml[] = '<clearance>' . $pc['clearance'] . '</clearance>';\r\n\t\t\t\t$xml[] = '<china_oem>' . $pc['china_oem'] . '</china_oem>';\r\n\t\t\t\t$xml[] = '<image>' . $pc['image'] . '</image>';\r\n\t\t\t\t$xml[] = '<ean>' . $pc['ean'] . '</ean>';\r\n\t\t\t\t$xml[] = '<mpn>' . $pc['mpn'] . '</mpn>';\r\n\t\t\t\t$xml[] = '<upc>' . $pc['upc'] . '</upc>';\r\n\t\t\t\t//$xml[] = '<discount>' . $pc['discount'] . '</discount>';\r\n\t\t\t\t$xml[] = '<proc_status>' . $pc['proc_status'] . '</proc_status>';\r\n\t\t\t\t$xml[] = '<website_status>' . $pc['website_status'] . '</website_status>';\r\n\t\t\t\t//$xml[] = '<sourcing_status>' . $pc['sourcing_status'] . '</sourcing_status>';\r\n\t\t\t\t$xml[] = '<expected_delivery_date>' . $pc['expected_delivery_date'] . '</expected_delivery_date>';\r\n\t\t\t\t$xml[] = '<lang_restricted>' . $pc['lang_restricted'] . '</lang_restricted>';\r\n\t\t\t\t$xml[] = '<shipment_restricted_type>' . $pc['shipment_restricted_type'] . '</shipment_restricted_type>';\r\n\t\t\t\t$xml[] = '<comments>' . str_replace('&', '&amp;', $pc['comments']) . '</comments>';\r\n\t\t\t\t$xml[] = '<product_warranty_type>' . $pc['product_warranty_type'] . '</product_warranty_type>';\r\n\t\t\t\t$xml[] = '<accelerator>' . $pc['accelerator'] . '</accelerator>';\r\n\t\t\t\t$xml[] = '<status>' . $pc['status'] . '</status>';\r\n\t\t\t\t$xml[] = '<is_error>' . $pc['is_error'] . '</is_error>';\r\n\r\n\r\n\t\t\t\t$current_sku = $pc['sku'];\r\n\t\t\t}\r\n\t\t\tif ($current_sku != '')\r\n\t\t\t{\r\n\t\t\t\t$xml[] = '</product>';\r\n\t\t\t}\r\n\r\n\t\t\t$xml[] = '</products>';\r\n\r\n\t\t\t$feed = implode(\"\", $xml);\r\n\r\n\t\t\t// header('Content-type: text/xml');\r\n\t\t\t// print $feed;\r\n\t\t\t// exit;\r\n\r\n\t\t\t$feed = $this->send_vb_data_post($feed, $vars[\"task_type\"], $vars[\"task_id\"]);\r\n\r\n\t\t\treturn $feed;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function processVbData ($feed)\n {\n //Read the data sent from VB\n $xml_vb = simplexml_load_string($feed);\n unset($feed);\n\n $task_id = $xml_vb->attributes()->task_id;\n //Create return xml string\n $xml = array();\n $xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $xml[] = '<products task_id=\"' . $task_id . '\">';\n\n $error_message = '';\n foreach($xml_vb->product as $pc)\n {\n try\n {\n //Get the master sku to search the corresponding sku in atomv2 database\n $master_sku = (string)$pc->master_sku;\n $sku = $this->getService('SkuMapping')->getLocalSku($master_sku);\n\n if (empty($sku)) {\n $xml[] = '<product>';\n $xml[] = '<sku>' . $pc->prod_sku . '</sku>';\n $xml[] = '<platform_id>' . $pc->lang_id . '</platform_id>';\n $xml[] = '<master_sku>' . $pc->master_sku . '</master_sku>';\n $xml[] = '<status>2</status>'; // no mapping in panther\n $xml[] = '<is_error>' . $pc->is_error . '</is_error>';\n $xml[] = '<reason>No SKU mapping</reason>';\n $xml[] = '</product>';\n continue;\n }\n\n $pc_obj = $this->getService('Product')->getDao('ProductContent')->get(['prod_sku' => $sku, 'lang_id' => $pc->lang_id]);\n\n if ($pc_obj) {\n //0 NA / 1 = prod_name / 2 = contents / 3 = keyworks / 4 = detail_desc\n $stop_sync_array = array_reverse(str_split(base_convert($pc_obj->getStopSync(), 10, 2)));\n $pc->addChild('stop_sync', $pc_obj->getStopSync());\n\n foreach($stop_sync_array as $k => $v) {\n if ($k == 1 && $v) {\n $pc->prod_name = $pc_obj->getProdName();\n }\n if ($k == 2 && $v) {\n $pc->contents = $pc_obj->getContents();\n }\n if ($k == 3 && $v) {\n $pc->keywords = $pc_obj->getKeywords();\n }\n if ($k == 4 && $v) {\n $pc->detail_desc = $pc_obj->getDetailDesc();\n }\n }\n\n // update\n $reason = \"update\";\n $this->getService('Product')->updateProductContent($pc_obj, $pc);\n if ($this->getService('Product')->getDao('ProductContent')->update($pc_obj)) {\n $process_status = 5; // update success\n } else {\n $process_status = 3; // update failure\n }\n } else {\n // insert\n $reason = \"insert\";\n $pc->addChild('stop_sync', 1);\n\n $pc_obj = $this->getService('Product')->createNewProductContent($sku, $pc);\n if (!$pc_obj)\n $reason = $reason . ' ' . $pc_obj;\n if ($this->getService('Product')->getDao('ProductContent')->insert($pc_obj)) {\n $process_status = 5; // insert success\n } else {\n $process_status = 3; // insert failure\n }\n }\n\n $xml[] = '<product>';\n $xml[] = '<sku>' . $pc->prod_sku . '</sku>';\n $xml[] = '<platform_id>' . $pc->lang_id . '</platform_id>';\n $xml[] = '<master_sku>' . $pc->master_sku . '</master_sku>';\n $xml[] = '<status>' . $process_status . '</status>';\n $xml[] = '<is_error>' . $pc->is_error . '</is_error>';\n $xml[] = '<reason>' . $reason . '</reason>';\n $xml[] = '</product>';\n }\n catch(Exception $e)\n {\n $xml[] = '<product>';\n $xml[] = '<sku>' . $pc->prod_sku . '</sku>';\n $xml[] = '<platform_id>' . $pc->lang_id . '</platform_id>';\n $xml[] = '<master_sku>' . $pc->master_sku . '</master_sku>';\n $xml[] = '<status>4</status>'; //error\n $xml[] = '<is_error>' . $pc->is_error . '</is_error>';\n $xml[] = '<reason>' . $e->getMessage() . '</reason>';\n $xml[] = '</product>';\n\n $error_message .= $pc->prod_sku .'-'. $pc->lang_id .'-'. $pc->master_sku .'-'. $pc->is_error .'-'. $e->getMessage().\"\\r\\n\";\n }\n }\n $xml[] = '</products>';\n $return_feed = implode(\"\", $xml);\n if ($error_message) {\n mail('data_transfer@eservicesgroup.com', 'Product Content Transfer Failed', \"Error Message :\".$error_message);\n }\n unset($xml);\n unset($xml_vb);\n return $return_feed;\n }", "function do_send($data)\n\t {\n\t //todo:\n\t echo \"send engine starting:\";\n\t print_r($data['send_data']);\n\t $this->Send_process->do_send($data);\n\t }", "public function sendBin()\n {\n foreach ($this->parts as $index => $vals) {\n $vals->sendPart();\n }\n }", "public function processVbData($feed)\n {\n //Read the data sent from VB\n $xml_vb = simplexml_load_string($feed);\n unset($feed);\n $task_id = $xml_vb->attributes()->task_id;\n\n //Create return xml string\n $xml = array();\n $xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $xml[] = '<brands task_id=\"'.$task_id.'\">';\n\n $error_message = '';\n foreach ($xml_vb->brand as $brand) {\n $id = $brand->id;\n try {\n if ($brand_obj = $this->getDao('Brand')->get(['id' => $brand->id])) {\n $this->getService('Brand')->updateBrand($brand_obj, $brand);\n $this->getDao('Brand')->update($brand_obj);\n } else {\n $brand_obj = $this->getService('Brand')->createNewBrand($id, $brand);\n $this->getDao('Brand')->insert($brand_obj);\n }\n $xml[] = '<brand>';\n $xml[] = '<id>'.$brand->id.'</id>';\n $xml[] = '<status>5</status>'; //updated\n $xml[] = '<is_error>'.$brand->is_error.'</is_error>';\n $xml[] = '<reason>insert_or_update</reason>';\n $xml[] = '</brand>';\n } catch (Exception $e) {\n $xml[] = '<brand>';\n $xml[] = '<id>'.$brand->id.'</id>';\n $xml[] = '<status>4</status>'; //error\n $xml[] = '<is_error>'.$brand->is_error.'</is_error>';\n $xml[] = '<reason>'.$e->getMessage().'</reason>';\n $xml[] = '</brand>';\n $error_message .= $brand->id .'-'. $brand->is_error .'-'. $e->getMessage().\"\\r\\n\";\n }\n }\n\n $xml[] = '</brands>';\n\n $return_feed = implode(\"\", $xml);\n\n if ($error_message) {\n mail('data_transfer@eservicesgroup.com', 'Brand Transfer Failed', \"Error Message :\".$error_message);\n }\n unset($xml);\n unset($xml_vb);\n return $return_feed;\n }", "public function get_result_data_from_atomv2 ($feed)\r\n\t{\r\n\t\t$bOK = TRUE;\r\n\r\n\t\t//read the data sent from vb\r\n\t\t$xml_vb = simplexml_load_string($feed);\r\n\t\t$task_id = $xml_vb->attributes()->task_id;\r\n\t\t//$prod_table = $xml_vb->attributes()->prod_table;\r\n\t\t$platform_id = \"\";\r\n\r\n\t\t$c = count($xml_vb->product);\r\n\t\tforeach($xml_vb->product as $product)\r\n\t\t{\r\n\t\t\t$c--;\r\n\r\n\t\t\t$sku = $product->sku;\r\n\t\t\t$master_sku = $product->master_sku;\r\n\t\t\t$status = $product->status;\r\n\t\t\t$is_error = $product->is_error;\r\n\t\t\t$reason = $product->reason;\r\n\r\n\t\t\tif ($sku == \"\" || $sku == null) $fail_reason .= \"sku not specified, \";\r\n\r\n\t\t\tif ($fail_reason == \"\")\r\n\t\t\t{\r\n\t\t\t\t$commit = false;\r\n\t\t\t\t// we only commit at the last update\r\n\t\t\t\tif ($c <= 0) $commit = true;\r\n\r\n\r\n\t\t\t\t$affected = $this->get_pp_dao()->update_sku_status($task_id , $sku, $platform_id, $status, $commit);\r\n\r\n\t\t\t\t$error_status = array(pending_products_dao::STATUS_NOT_UPDATED, pending_products_dao::STATUS_ERROR);\r\n\t\t\t\tif ($is_error && in_array($status, $error_status))\r\n\t\t\t\t{\r\n\t\t\t\t\t$title = \"VB to AtomV2 data transfer error\";\r\n\t\t\t\t\t$message = \"Error in task: \" . $task_id . \"\\n\";\r\n\t\t\t\t\t$message .= \"SKU: \" . $sku . \"\\n\";\r\n\t\t\t\t\t$message .= \"Status: \" . $status . \"\\n\";\r\n\t\t\t\t\t$message .= \"Reason: \" . $reason . \"\\n\";\r\n\t\t\t\t\t$this->send_error_email($title, $message, \"data_transfer@eservicesgroup.com\");\r\n\t\t\t\t}\r\n\t\t\t\telseif ($status == pending_products_dao::STATUS_MAPPING_ERROR)\r\n\t\t\t\t{\r\n\t\t\t\t\t$title = \"VB to AtomV2 data transfer - Mapping error\";\r\n\t\t\t\t\t$message = \"Error in task: \" . $task_id . \"\\n\";\r\n\t\t\t\t\t$message .= \"SKU: \" . $sku . \"\\n\";\r\n\t\t\t\t\t$message .= \"Master SKU: \" . $master_sku . \"\\n\";\r\n\t\t\t\t\t$message .= \"Reason: \" . $reason . \"\\n\";\r\n\t\t\t\t\t$this->send_error_email($title, $message, \"data_transfer@eservicesgroup.com\");\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$bok = false;\r\n\t\t\t}\r\n\t\t }\r\n\t\treturn $bOK;\r\n\t}", "public function process_vb_data ($feed)\n\t{\t\t\n\t\t\n\t\t//Read the data sent from VB\n\t\t$xml_vb = simplexml_load_string($feed);\n\t\t\n\t\t$task_sku = $xml_vb->attributes()->task_sku;\n\t\t\t\t\n\t\t//Create return xml string\n\t\t$xml = array();\n\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n\t\t$xml[] = '<ra_products task_sku=\"' . $task_sku . '\">';\n\t\t\t\t\t\n\t\t$c = count($xml_vb->ra_product);\n\t\tforeach($xml_vb->ra_product as $ra_product)\n\t\t{\n\t\t\t$c--;\t\t\t\n\t\t\t\t\n\t\t\t//Get the master sku to search the corresponding sku in atomv2 database\n\t\t\t$master_sku = $ra_product->master_sku;\n\t\t\t\t\t\t\n\t\t\t$master_sku = strtoupper($master_sku);\n\t\t\t$sku = $this->sku_mapping_service->get_local_sku($master_sku);\n\t\t\t\n\t\t\t$fail_reason = \"\";\n if ($master_sku == \"\" || $master_sku == null) $fail_reason .= \"No master SKU mapped, \";\n if ($sku == \"\" || $sku == null) $fail_reason .= \"SKU not specified, \";\n\t\t\t\n\t\t\ttry\n\t\t\t{\tif ($fail_reason == \"\")\n\t\t\t\t{\t\t\n\t\t\t\t\tif($this->get_dao()->get(array(\"sku\"=>$sku)))\n\t\t\t\t\t{\n\t\t\t\t\t\t//update\t\t\t\t\t\n\t\t\t\t\t\t$where = array(\"sku\"=>$sku);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$new_ra_product_obj = array();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_1\"] = $ra_product->rcm_group_id_1;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_1\"] = $ra_product->bundle_use_1;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_2\"] = $ra_product->rcm_group_id_2;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_2\"] = $ra_product->bundle_use_2;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_3\"] = $ra_product->rcm_group_id_3;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_3\"] = $ra_product->bundle_use_3;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_4\"] = $ra_product->rcm_group_id_4;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_4\"] = $ra_product->bundle_use_4;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_5\"] = $ra_product->rcm_group_id_5;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_5\"] = $ra_product->bundle_use_5;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_6\"] = $ra_product->rcm_group_id_6;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_6\"] = $ra_product->bundle_use_6;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_7\"] = $ra_product->rcm_group_id_7;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_7\"] = $ra_product->bundle_use_7;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_8\"] = $ra_product->rcm_group_id_8;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_8\"] = $ra_product->bundle_use_8;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_9\"] = $ra_product->rcm_group_id_9;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_9\"] = $ra_product->bundle_use_9;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_10\"] = $ra_product->rcm_group_id_10;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_10\"] = $ra_product->bundle_use_10;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_11\"] = $ra_product->rcm_group_id_11;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_11\"] = $ra_product->bundle_use_11;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_12\"] = $ra_product->rcm_group_id_12;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_12\"] = $ra_product->bundle_use_12;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_13\"] = $ra_product->rcm_group_id_13;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_13\"] = $ra_product->bundle_use_13;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_14\"] = $ra_product->rcm_group_id_14;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_14\"] = $ra_product->bundle_use_14;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_15\"] = $ra_product->rcm_group_id_15;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_15\"] = $ra_product->bundle_use_15;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_16\"] = $ra_product->rcm_group_id_16;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_16\"] = $ra_product->bundle_use_16;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_17\"] = $ra_product->rcm_group_id_17;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_17\"] = $ra_product->bundle_use_17;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_18\"] = $ra_product->rcm_group_id_18;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_18\"] = $ra_product->bundle_use_18;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_19\"] = $ra_product->rcm_group_id_19;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_19\"] = $ra_product->bundle_use_19;\n\t\t\t\t\t\t$new_ra_product_obj[\"rcm_group_id_20\"] = $ra_product->rcm_group_id_20;\n\t\t\t\t\t\t$new_ra_product_obj[\"bundle_use_20\"] = $ra_product->bundle_use_20;\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->get_dao()->q_update($where, $new_ra_product_obj);\n\n\t\t\t\t\t\t$xml[] = '<ra_product>';\n\t\t\t\t\t\t$xml[] = '<sku>' . $ra_product->sku . '</sku>';\t\t\n\t\t\t\t\t\t$xml[] = '<master_sku>' . $ra_product->master_sku . '</master_sku>';\t\t\n\t\t\t\t\t\t$xml[] = '<status>5</status>'; //updated\n\t\t\t\t\t\t$xml[] = '<is_error>' . $ra_product->is_error . '</is_error>';\n\t\t\t\t\t\t$xml[] = '</ra_product>';\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$new_ra_product_obj = $this->get_dao()->get();\n\t\t\t\t\t\t$new_ra_product_obj->set_sku($sku);\t\t\t\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_1($ra_product->rcm_group_id_1);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_1($ra_product->bundle_use_1);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_2($ra_product->rcm_group_id_2);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_2($ra_product->bundle_use_2);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_3($ra_product->rcm_group_id_3);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_3($ra_product->bundle_use_3);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_4($ra_product->rcm_group_id_4);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_4($ra_product->bundle_use_4);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_5($ra_product->rcm_group_id_5);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_5($ra_product->bundle_use_5);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_6($ra_product->rcm_group_id_6);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_6($ra_product->bundle_use_6);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_7($ra_product->rcm_group_id_7);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_7($ra_product->bundle_use_7);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_8($ra_product->rcm_group_id_8);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_8($ra_product->bundle_use_8);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_9($ra_product->rcm_group_id_9);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_9($ra_product->bundle_use_9);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_10($ra_product->rcm_group_id_10);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_10($ra_product->bundle_use_10);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_11($ra_product->rcm_group_id_11);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_11($ra_product->bundle_use_11);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_12($ra_product->rcm_group_id_12);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_12($ra_product->bundle_use_12);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_13($ra_product->rcm_group_id_13);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_13($ra_product->bundle_use_13);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_14($ra_product->rcm_group_id_14);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_14($ra_product->bundle_use_14);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_15($ra_product->rcm_group_id_15);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_15($ra_product->bundle_use_15);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_16($ra_product->rcm_group_id_16);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_16($ra_product->bundle_use_16);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_17($ra_product->rcm_group_id_17);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_17($ra_product->bundle_use_17);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_18($ra_product->rcm_group_id_18);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_18($ra_product->bundle_use_18);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_19($ra_product->rcm_group_id_19);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_19($ra_product->bundle_use_19);\n\t\t\t\t\t\t$new_ra_product_obj->set_rcm_group_id_20($ra_product->rcm_group_id_20);\n\t\t\t\t\t\t$new_ra_product_obj->set_bundle_use_20($ra_product->bundle_use_20);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->get_dao()->insert($new_ra_product_obj);\n\n\t\t\t\t\t\t$xml[] = '<ra_product>';\n\t\t\t\t\t\t$xml[] = '<sku>' . $ra_product->sku . '</sku>';\t\t\n\t\t\t\t\t\t$xml[] = '<master_sku>' . $ra_product->master_sku . '</master_sku>';\t\t\n\t\t\t\t\t\t$xml[] = '<status>5</status>'; //updated\n\t\t\t\t\t\t$xml[] = '<is_error>' . $ra_product->is_error . '</is_error>';\n\t\t\t\t\t\t$xml[] = '</ra_product>';\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\telseif ($sku == \"\" || $sku == null)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//if the master_sku is not found in atomv2, we have to store that sku in an xml string to send it to VB\n\t\t\t\t\t$xml[] = '<ra_product>';\n\t\t\t\t\t$xml[] = '<sku>' . $ra_product->sku . '</sku>';\t\t\n\t\t\t\t\t$xml[] = '<master_sku>' . $ra_product->master_sku . '</master_sku>';\t\t\n\t\t\t\t\t$xml[] = '<status>2</status>'; //not found\n\t\t\t\t\t$xml[] = '<is_error>' . $ra_product->is_error . '</is_error>';\n\t\t\t\t\t$xml[] = '</ra_product>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$xml[] = '<ra_product>';\n\t\t\t\t\t$xml[] = '<sku>' . $ra_product->sku . '</sku>';\t\t\n\t\t\t\t\t$xml[] = '<master_sku>' . $ra_product->master_sku . '</master_sku>';\t\t\n\t\t\t\t\t$xml[] = '<status>3</status>'; //not updated\n\t\t\t\t\t$xml[] = '<is_error>' . $ra_product->is_error . '</is_error>';\n\t\t\t\t\t$xml[] = '</ra_product>';\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$xml[] = '<ra_product>';\n\t\t\t\t$xml[] = '<sku>' . $ra_product->sku . '</sku>';\t\t\n\t\t\t\t$xml[] = '<master_sku>' . $ra_product->master_sku . '</master_sku>';\t\t\n\t\t\t\t$xml[] = '<status>4</status>'; //error\n\t\t\t\t$xml[] = '<is_error>' . $ra_product->is_error . '</is_error>';\n\t\t\t\t$xml[] = '</ra_product>';\n\t\t\t} \n\t\t }\n\t\t \n\t\t$xml[] = '</ra_products>';\n\t\t\n\t\t\n\t\t$return_feed = implode(\"\\n\", $xml);\t\n\t\t\t\n\t\treturn $return_feed;\n\t}", "public function processVbData($feed)\n {\n //Read the data sent from VB\n $xml_vb = simplexml_load_string($feed);\n unset($feed);\n\n $task_id = $xml_vb->attributes()->task_id;\n $is_error_task = $xml_vb->attributes()->is_error_task;\n\n //Create return xml string\n $xml = array();\n $xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $xml[] = '<products task_id=\"'.$task_id.'\" is_error_task=\"'.$is_error_task.'\">';\n\n $error_message = '';\n foreach ($xml_vb->product as $product) {\n try {\n $master_sku = (string) $product->master_sku;\n $vb_sku = (string) $product->sku;\n\n\n $mapping_sku = $this->getService('SkuMapping')->getDao('SkuMapping')->get(['ext_sku' => $master_sku]);\n if ($mapping_sku && $mapping_sku->getVbSku() != $vb_sku){ //exists mapping but not for the same vb_sku\n $mapping_sku->setExtSku($master_sku);\n $mapping_sku->setVbSku($vb_sku);\n $this->getService('SkuMapping')->getDao('SkuMapping')->update($mapping_sku);\n }\n\n $mapping = $this->getService('SkuMapping')->getDao('SkuMapping')->get(['vb_sku' => $vb_sku]);\n\n if ($mapping) {\n // mapping changed in VB, update mapping in panther\n if ($mapping->getExtSku() != $master_sku) {\n $mapping->setExtSku($master_sku);\n $this->getService('SkuMapping')->getDao('SkuMapping')->update($mapping);\n }\n\n $product_obj = $this->getService('Product')->getDao('Product')->get(['sku' => $mapping->getSku()]);\n $this->getService('Product')->updateProduct($product_obj, $product);\n if ($this->getService('Product')->getDao('Product')->update($product_obj)) {\n $process_status = 5; // update success\n } else {\n $process_status = 3; // update failure\n }\n } else {\n // mapping doesn't exists, as a new product\n $product_obj = $this->getService('Product')->createNewProduct($product);\n if ($this->getService('Product')->getDao('Product')->insert($product_obj)) {\n $sku_mpaping_obj = $this->getService('SkuMapping')->createNewSkuMapping($product_obj->getSku(), $master_sku, $vb_sku);\n $this->getService('SkuMapping')->getDao('SkuMapping')->insert($sku_mpaping_obj);\n $process_status = 5; // insert product success\n } else {\n $process_status = 3; // inset failure\n }\n }\n\n if ($product_obj) {\n $this->getService('ProductWarranty')->autoCreateProductWarranty($product_obj);\n }\n\n $xml[] = '<product>';\n $xml[] = '<sku>'.$vb_sku.'</sku>';\n $xml[] = '<master_sku>'.$master_sku.'</master_sku>';\n $xml[] = '<status>'.$process_status.'</status>';\n $xml[] = '<is_error>'.$product->is_error.'</is_error>';\n $xml[] = '<reason>'.$reason.'</reason>';\n $xml[] = '</product>';\n } catch (Exception $e) {\n $xml[] = '<product>';\n $xml[] = '<sku>'.$vb_sku.'</sku>';\n $xml[] = '<master_sku>'.$master_sku.'</master_sku>';\n $xml[] = '<status>4</status>'; //error\n $xml[] = '<is_error>'.$product->is_error.'</is_error>';\n $xml[] = '<reason>'.$e->getMessage().'</reason>';\n $xml[] = '</product>';\n $error_message .= $vb_sku .'-'. $master_sku .'-'. $product->is_error .'-'. $e->getMessage() .\"\\r\\n\";\n }\n }\n\n $xml[] = '</products>';\n $return_feed = implode(\"\", $xml);\n if ($error_message) {\n mail('data_transfer@eservicesgroup.com', 'Product Transfer Failed', \"Error Message :\".$error_message);\n }\n unset($xml);\n unset($xml_vb);\n return $return_feed;\n }", "public function sendData($data);", "public function processVbData ($feed)\n {\n //Read the data sent from VB\n $xml_vb = simplexml_load_string($feed);\n unset($feed);\n $task_id = $xml_vb->attributes()->task_id;\n\n //Create return xml string\n $xml = array();\n $xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $xml[] = '<product_images task_id=\"' . $task_id . '\">';\n\n $current_sku = \"\";\n\n $error_message = '';\n foreach($xml_vb->product_image as $pc)\n {\n try\n {\n //Get the master sku to search the corresponding sku in atomv2 database\n $master_sku = (string) $pc->master_sku;\n $sku = $this->getService('SkuMapping')->getLocalSku($master_sku);\n\n if (empty($sku)) {\n $xml[] = '<product_image>';\n $xml[] = '<id>' . $pc->id . '</id>';\n $xml[] = '<sku>' . $pc->sku . '</sku>';\n $xml[] = '<master_sku>' . $master_sku. '</master_sku>';\n $xml[] = '<status>2</status>';\n $xml[] = '<is_error>' . $pc->is_error . '</is_error>';\n $xml[] = '<reason>No SKU mapping</reason>';\n $xml[] = '</product_image>';\n continue;\n }\n\n $vb_image = (string) $pc->sku.'_'.(string) $pc->id.'.'.(string) $pc->image;\n\n $pi_obj = $this->getService('Product')->getDao('ProductImage')->get(['vb_image' => $vb_image]);\n\n $reason = 'insert_or_update';\n if ($pi_obj) {\n //we need to check the stop_sync_image value to stop the update when needed (only for update)\n $stop_sync_image = $pi_obj->getStopSyncImage();\n\n if ($stop_sync_image != 1)\n {\n $this->getService('ProductImage')->updateProductImage($pi_obj, $pc);\n $pi_obj->setImageSaved(0);\n if ($this->getService('ProductImage')->getDao('ProductImage')->update($pi_obj)) {\n $process_status = 5;\n } else {\n $process_status = 3;\n }\n }\n else\n {\n $reason = 'stop_sync_image';\n }\n } else {\n $pi_obj = $this->getService('ProductImage')->createNewProductImage($sku, $pc);\n $pi_obj->setImageSaved(0);\n if ($this->getService('ProductImage')->getDao('ProductImage')->insert($pi_obj)) {\n $process_status = 5;\n } else {\n $process_status = 3;\n }\n }\n\n $xml[] = '<product_image>';\n $xml[] = '<id>' . $pc->id . '</id>';\n $xml[] = '<sku>' . $pc->sku . '</sku>';\n $xml[] = '<master_sku>' . $master_sku. '</master_sku>';\n $xml[] = '<status>' . $process_status . '</status>'; //updated\n $xml[] = '<is_error>' . $pc->is_error . '</is_error>';\n $xml[] = '<reason>'.$reason.'</reason>';\n $xml[] = '</product_image>';\n } catch(Exception $e) {\n $xml[] = '<product_image>';\n $xml[] = '<id>' . $pc->id . '</id>';\n $xml[] = '<sku>' . $pc->sku . '</sku>';\n $xml[] = '<master_sku>' . $master_sku . '</master_sku>';\n $xml[] = '<status>4</status>';\n $xml[] = '<is_error>' . $pc->is_error . '</is_error>';\n $xml[] = '<reason>' . $e->getMessage() . '</reason>';\n $xml[] = '</product_image>';\n $error_message .= $pc->sku .'-'. $master_sku .'-'. $pc->is_error .'-'. $e->getMessage() .\"\\r\\n\";\n }\n }\n\n $xml[] = '</product_images>';\n $return_feed = implode(\"\", $xml);\n if ($error_message) {\n mail('data_transfer@eservicesgroup.com', 'Product Identifier Transfer Failed', \"Error Message :\".$error_message);\n }\n unset($xml);\n unset($xml_vb);\n return $return_feed;\n }", "public abstract function sendData($data);", "public function process_vb_data ($feed)\n\t{\t\t\n\t\t//print $feed; exit;\n\t\t//Read the data sent from VB\n\t\t$xml_vb = simplexml_load_string($feed);\n\t\t\n\t\t$task_id = $xml_vb->attributes()->task_id;\n\t\t\t\t\n\t\t//Create return xml string\n\t\t$xml = array();\n\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n\t\t$xml[] = '<ra_groups task_id=\"' . $task_id . '\">';\n\t\t\t\t\t\n\t\t$c = count($xml_vb->ra_group);\n\t\tforeach($xml_vb->ra_group as $ra_group)\n\t\t{\n\t\t\t$c--;\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif($this->get_dao()->get(array(\"group_id\"=>$ra_group->group_id)))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//Update the AtomV2 ra_group data \t\t\t\t\t\n\t\t\t\t\t$where = array(\"group_id\"=>$ra_group->group_id);\n\t\t\t\t\t\n\t\t\t\t\t$new_ra_group_obj = array();\n\t\t\t\t\t\n\t\t\t\t\t$new_ra_group_obj[\"group_name\"] = $ra_group->group_name;\t\t\t\t\t\n\t\t\t\t\t$new_ra_group_obj[\"status\"] = $ra_group->status;\t\t\t\t\t\t\n\t\t\t\t\t$new_ra_group_obj[\"warranty\"] = $ra_group->warranty;\t\t\t\t\t\t\n\t\t\t\t\t$new_ra_group_obj[\"ignore_qty_bundle\"] = $ra_group->ignore_qty_bundle;\t\n\t\t\t\t\t\n\t\t\t\t\t$this->get_dao()->q_update($where, $new_ra_group_obj);\t\n\n\t\t\t\t\t$xml[] = '<ra_group>';\n\t\t\t\t\t$xml[] = '<group_id>' . $ra_group->group_id . '</group_id>';\t\t\t\t\n\t\t\t\t\t$xml[] = '<status>5</status>'; //updated\n\t\t\t\t\t$xml[] = '<is_error>' . $ra_group->is_error . '</is_error>';\n\t\t\t\t\t$xml[] = '</ra_group>';\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//insert ra_group\n\t\t\t\t\t$new_ra_group_obj = array();\n\t\t\t\t\t\n\t\t\t\t\t$new_ra_group_obj = $this->get_dao()->get();\n\t\t\t\t\t$new_ra_group_obj->set_group_id($ra_group->group_id);\n\t\t\t\t\t$new_ra_group_obj->set_group_name($ra_group->group_name);\n\t\t\t\t\t$new_ra_group_obj->set_status($ra_group->status);\n\t\t\t\t\t$new_ra_group_obj->set_warranty($ra_group->warranty);\n\t\t\t\t\t$new_ra_group_obj->set_ignore_qty_bundle($ra_group->ignore_qty_bundle);\n\t\t\t\t\t\n\t\t\t\t\t$this->get_dao()->insert($new_ra_group_obj);\t\n\n\t\t\t\t\t$xml[] = '<ra_group>';\n\t\t\t\t\t$xml[] = '<group_id>' . $ra_group->group_id . '</group_id>';\t\t\t\t\n\t\t\t\t\t$xml[] = '<status>5</status>'; //updated\n\t\t\t\t\t$xml[] = '<is_error>' . $ra_group->is_error . '</is_error>';\n\t\t\t\t\t$xml[] = '</ra_group>';\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$xml[] = '<ra_group>';\n\t\t\t\t$xml[] = '<group_id>' . $ra_group->group_id . '</group_id>';\t\t\t\t\n\t\t\t\t$xml[] = '<status>4</status>'; //error\n\t\t\t\t$xml[] = '<is_error>' . $ra_group->is_error . '</is_error>';\n\t\t\t\t$xml[] = '</ra_group>';\n\t\t\t}\n\t\t }\n\t\t \n\t\t$xml[] = '</ra_groups>';\n\t\t\n\t\t\n\t\t$return_feed = implode(\"\\n\", $xml);\t\n\t\t\t\n\t\treturn $return_feed;\n\t}", "public function sendForVetting()\n\t{\n\t\t$this->status = self::STATUS_VETTING;\n\t\t$this->editable = false;\n\t\t$this->recallable = false;\n\t\t$this->save();\n\t}", "public function getSendData();", "public function sendDataAction()\n\t{\n\n // Create the contentDock Utility\n $contentdock = new \\edit\\Contentdock\\Utility\\ContentdockUtility();\n\n // Create Your custom Data\n $myData = new \\edit\\Contentdock\\Utility\\MyDataUtility();\n\n // Build Request Records\n $requestRecords = $myData->getRequestRecords('Insert-Update');\n\n // Get T3 Table name for Logging\n $tableT3 = $myData->getT3TableName();\n\n // Get Data Container ID\n $dataContainerID = $myData->getDataContainerID();\n\n // Send to contentDock\n $operations = $contentdock->pushToDataContainerTable($requestRecords, $dataContainerID, $tableT3);\n\n $this->view->assign('operations', $operations);\n }", "function testEncodeForVBScript_01() {\n $instance = ESAPI::getEncoder();\n $this->assertEquals(null, $instance->encodeForVBScript(null));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If $alias_record is false, then $single_part must be a path.
protected static function determinePathOrAlias($manager, $alias_record, $alias_path, $single_part) { if ($alias_record === false) { return new HostPath($manager->getSelf(), $alias_path, $single_part); } // Otherwise, we have a alias record without a path. // In this instance, the alias record _must_ have a root. if (!$alias_record->hasRoot()) { throw new \Exception("$alias_path does not define a path."); } return new HostPath($alias_record, $alias_path); }
[ "function _drush_sitealias_set_record_element(&$alias_record, $key, $value) {\n if ((substr($key,0,1) == '%') || (substr($key,0,1) == '!')) {\n $alias_record['path-aliases'][$key] = $value;\n }\n elseif (!empty($key)) {\n $alias_record[$key] = $value;\n }\n}", "abstract protected function validateAlias(string $alias): string;", "public function createFullAlias() {\n// if (strlen($this->full_alias) == 0) {\n static::findTreeModel(static::$treeCurrent);\n static::fillinTree(static::$treeCurrent);\n\n if ($this->parent > 0) {\n $path = static::getPathById($this->parent);\n $alias = array();\n foreach ($path as $m) {\n $alias[] = $m->alias;\n }\n $alias[] = $this->alias;\n\n $this->full_alias = implode($this->delimiterFullAlias, $alias);\n } else {\n $this->full_alias = $this->alias;\n }\n// }\n }", "function drush_sitealias_cache_alias_by_path($alias_record) {\n if (!isset($alias_record['remote-host']) && isset($alias_record['root']) && isset($alias_record['uri']) && isset($alias_record['#name']) && isset($alias_record['#file'])) {\n $path = drush_sitealias_local_site_path($alias_record);\n if ($path) {\n $cid = drush_get_cid('alias-path-', array(), array($path));\n $alias_path_data = array(\n '#name' => $alias_record['#name'],\n '#file' => $alias_record['#file'],\n );\n drush_cache_set($cid, $alias_path_data);\n }\n }\n}", "static function resolveAliasWithSubpage( $alias ) {\n\t\t$bits = explode( '/', $alias, 2 );\n\t\t$name = self::resolveAlias( $bits[0] );\n\t\tif( !isset( $bits[1] ) ) { // bug 2087\n\t\t\t$par = NULL;\n\t\t} else {\n\t\t\t$par = $bits[1];\n\t\t}\n\t\treturn array( $name, $par );\n\t}", "function drush_sitealias_get_path_option($site_alias_record, $option, $default = NULL) {\n if (isset($site_alias_record) && array_key_exists($option, $site_alias_record)) {\n return $site_alias_record[$option];\n }\n if (isset($site_alias_record) && array_key_exists('path-aliases', $site_alias_record) && array_key_exists(\"%$option\", $site_alias_record['path-aliases'])) {\n return $site_alias_record['path-aliases'][\"%$option\"];\n }\n else {\n return drush_get_option($option, $default);\n }\n}", "function middleNameMissingOnAlias(array $aliases2s, string $recordFirst, string $recordMiddle, string $recordLast): bool\n{\n if (empty($aliases2s))\n return false;\n\n if (empty($recordMiddle))\n return false;\n\n foreach ($aliases2s as $alias) {\n [$first, $last] = $alias;\n // for aliases: last name must match, and first name can be either first or middle of record\n if (in_array($first, [$recordFirst, $recordMiddle]) && $last === $recordLast) {\n return true;\n }\n }\n\n return false;\n}", "function\t\t\tneedPathSlash($needSlash);", "public function testUrlAlias() {\n $path_alias = $this->loadPathAliasByConditions([\n 'path' => '/taxonomy/term/4',\n 'alias' => '/term33',\n 'langcode' => 'und',\n ]);\n $this->assertSame('/taxonomy/term/4', $path_alias->getPath());\n $this->assertSame('/term33', $path_alias->getAlias());\n $this->assertSame('und', $path_alias->language()->getId());\n\n // Alias with no slash.\n $path_alias = $this->loadPathAliasByConditions(['alias' => '/source-noSlash']);\n $this->assertSame('/admin', $path_alias->getPath());\n $this->assertSame('und', $path_alias->language()->getId());\n }", "function fixup_check_node_by_alias($alias) {\n\n // strip off one leading slash\n if (strpos($alias, '/') == 0) {\n $alias = substr($alias, 1);\n }\n\n // Lookup an alias to get a path like '/node/44'\n if ($path = drupal_get_normal_path($alias)) {\n debugme(\"got normal path $path for $alias\");\n\n // Load that node \n if ($node = menu_get_object('node', 1, $path)) {\n\n debugme(\"got node \".$node->nid.\" for normal path\");\n\n // check the node body\n fixup_check_node($node);\n }\n }\n // the 'alias' might already by like '/node/44'\n elseif ($node = menu_get_object('node', 1, $alias)) {\n\n debugme(\"got node \".$node->nid.\" for $alias\");\n\n // check the node body\n fixup_check_node($node);\n }\n}", "public function isRecordPath()\n {\n $parts = $this->_getPathParts();\n return (count($parts) > 2 && $parts[2] === self::RECORDS_PART);\n }", "private function validateAlias($alias)\n {\n return (is_string($alias) && !empty($alias));\n }", "private function validateAlias() {\n\n\t\t//make sure it's a string\n\t\tValidate::string($this->settings['alias'], $this->errorPrefix.'alias');\n\t}", "public function hasPathAlias()\n {\n $pathAlias = $this->getPathAlias();\n return !empty($pathAlias);\n }", "function find_alias_reference_by_path($section, $field, $origname, &$is_alias_referenced, &$referenced_by) {\n\tif (!$origname) {\n\t\treturn;\n\t}\n\n\t$items = config_get_path($section, []);\n\n\tforeach ($items as $id => $item) {\n\t\tif (array_get_path($item, $field) == $origname) {\n\t\t\t$is_alias_referenced = true;\n\t\t\t/* This is a bad hack to make rule descriptions more verbose,\n\t\t\t * ideally the object should be providing its own text presentation,\n\t\t\t * but our values are arrays at this time\n\t\t\t */\n\t\t\tif (basename($section) == 'rule') {\n\t\t\t\t$descr = str_replace('/', ' ', $section) . ' ';\n\t\t\t} else {\n\t\t\t\t$descr = basename($section) . ' ';\n\t\t\t}\n\t\t\tif (!empty($item['descr'])) {\n\t\t\t\t$descr .= \"'{$item['descr']}'\";\n\t\t\t} elseif (!empty($item['description'])) {\n\t\t\t\t$descr .= \"'{$item['description']}'\";\n\t\t\t} elseif (!empty($item['name'])) {\n\t\t\t\t$descr .= \"'{$item['name']}'\";\n\t\t\t} else {\n\t\t\t\t$descr .= \"id {$id}\";\n\t\t\t}\n\n\t\t\t$referenced_by[] = $descr;\n\t\t}\n\t}\n}", "function _drush_sitealias_load_alias($alias, $alias_path_context = NULL) {\n $all_site_aliases = drush_get_context('site-aliases');\n $result = array();\n\n // Check to see if this is a relative alias ('@site/@peer')\n $relative_alias_pos = strpos($alias, '/@');\n if ($relative_alias_pos !== false) {\n $primary_alias = substr($alias,0,$relative_alias_pos);\n $relative_alias = substr($alias,$relative_alias_pos + 1);\n $primary_record = drush_sitealias_get_record($primary_alias);\n _drush_sitealias_find_and_load_alias(substr($relative_alias,1), $primary_record);\n $result = drush_sitealias_get_record($relative_alias);\n if (!empty($result)) {\n if (array_key_exists('inherited', $result)) {\n $result = array_merge($primary_record, $result);\n }\n $result['#name'] = $relative_alias;\n _drush_sitealias_add_inherited_values_to_record($result);\n _drush_sitealias_cache_alias($alias, $result);\n }\n }\n else {\n // Only aliases--those named entities that begin with '@'--can be loaded this way.\n // We also skip any alias that has already been loaded.\n if ((substr($alias,0,1) == '@') && !array_key_exists($alias,$all_site_aliases)) {\n $aliasname = substr($alias,1);\n $result = _drush_sitealias_find_and_load_alias($aliasname, $alias_path_context);\n if (!empty($result)) {\n $alias_options = array('site-aliases' => array($aliasname => $result));\n _drush_sitealias_add_inherited_values($alias_options['site-aliases']);\n drush_set_config_special_contexts($alias_options);\n if (array_key_exists('#file', $result)) {\n drush_log(dt('Loaded alias !alias from file !file', array('!alias' => $alias, '!file' => $result['#file'])));\n }\n }\n }\n }\n\n return $result;\n}", "function spMarker($subpartMarker) {\n\n\t\t$sPBody = substr($subpartMarker, 3, -3);\n\t\t$altSPM = '';\n\t\tif (isset($this->conf['altMainMarkers.'])) {\n\t\t\t$altSPM = trim($this->cObj->stdWrap($this->conf['altMainMarkers.'][$sPBody], $this->conf['altMainMarkers.'][$sPBody . '.']));\n\t\t\t$GLOBALS['TT']->setTSlogMessage('Using alternative subpart marker for \\'' . $subpartMarker . '\\': ' . $altSPM, 1);\n\t\t}\n\n\n\t\treturn $altSPM?$altSPM:$subpartMarker;\n\t}", "public function setAlias($alias, $path);", "public function hasAlias() {\n return ($this->alias !== '');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Same as alpha_dash, but includes periods
public function alpha_dash_period($str) { if (!array_key_exists('alpha_dash_period', $this->_error_messages)) { $this->set_message('alpha_dash_period', lang('fv_alpha_dash_period_field')); } return (!preg_match("/^([\.-a-z0-9_])+$/i", $str)) ? false : true; }
[ "function dasherize($word)\n{\n return CString::underscore($word, '-');\n}", "function _alpha_dash_dot($field)\r\n\t{\r\n\t\treturn ( ! preg_match('/^([\\.-a-z0-9_-])+$/i', $this->{$field})) ? FALSE : TRUE;\r\n\t}", "public static function refineDashInUrl($url)\r\n\t{\r\n\t\t$url = preg_replace('/[-]+/', '-', $url);\r\n\t\tif($url[0] == '-')\r\n\t\t\t$url = substr($url, 1);\r\n\t\t\r\n\t\tif($url[strlen($url)-1] == '-')\r\n\t\t\t$url = substr($url,0, strlen($url)-1);\r\n\t\t\t\r\n\t\treturn $url;\r\n\t}", "function doubleDash()\n {\n return $this->createWikiTag(\"doubleDash\", \"span\", \" &mdash; \");\n }", "function latex_periods($s, $except_last = false) // {{{\n{\n $s = trim($s);\n $out_s = preg_replace(\"/\\\\./\", \".\\\\ \", $s);\n if ($except_last === true)\n {\n $out_s = substr($out_s, 0, strlen($out_s) - 2);\n }\n return $out_s;\n}", "function dasherize($underscore_word)\n{\n return preg_replace('/_/', '-', $underscore_word);\n}", "function dash($text) {\n $dash_finder = \"/(\\s|&nbsp;|&thinsp;)*(&mdash;|&ndash;|&#x2013;|&#8211;|&#x2014;|&#8212;)(\\s|&nbsp;|&thinsp;)*/\";\n return preg_replace($dash_finder, '&thinsp;\\\\2&thinsp;', $text);\n}", "public static function toDashSeparated($input)\r\n {\r\n \t// Convert spaces and underscores to dashes.\r\n \t$input = preg_replace('#[ \\-_]+#', '-', $input);\r\n \r\n \treturn $input;\r\n }", "function setDash($pattern, $phase){}", "function _papi_dashify( $str ) {\n\tif ( ! is_string( $str ) ) {\n\t\treturn '';\n\t}\n\n\treturn str_replace( ' ', '-', str_replace( '_', '-', $str ) );\n}", "public function setDashPattern($pattern) {}", "function isAlphaNumericDash($field): bool\n{\n if (isNullOrEmpty($field)) {\n return false;\n }\n return preg_match('/^([a-z0-9ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïñðòóôõöùúûüýÿ\\-_])+$/iu', $field) === 1;\n}", "private static function alphaDashMessage($field)\n {\n return \"$field field requires only alphanumeric characters with dashes, underscores and spaces.\";\n }", "public static function toDashSeparated($input)\r\n\t{\r\n\t\t// Convert spaces and underscores to dashes.\r\n\t\t$input = preg_replace('#[ \\-_]+#', '-', $input);\r\n\r\n\t\treturn $input;\r\n\t}", "public function testAlphaDashValidationSuccess()\n {\n $validator = new Validator();\n\n $validator->addValidation('test-test', 'alpha_dash')\n ->validate();\n\n $this->assertEquals([], $validator->getFailed());\n }", "protected function reorderDash()\n\t{\n\t\t$dashIndex = array_search('-', $this->chars, true);\n\t\tif ($dashIndex === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Look for a single dash and move it to the start of the character class\n\t\t$k = array_search([$dashIndex, $dashIndex], $this->ranges, true);\n\t\tif ($k > 0)\n\t\t{\n\t\t\tunset($this->ranges[$k]);\n\t\t\tarray_unshift($this->ranges, [$dashIndex, $dashIndex]);\n\t\t}\n\n\t\t// Look for a comma-dash (0x2C..0x2D) range\n\t\t$commaIndex = array_search(',', $this->chars);\n\t\t$range = [$commaIndex, $dashIndex];\n\t\t$k = array_search($range, $this->ranges, true);\n\t\tif ($k !== false)\n\t\t{\n\t\t\t// Replace with a single comma and prepend a single dash\n\t\t\t$this->ranges[$k] = [$commaIndex, $commaIndex];\n\t\t\tarray_unshift($this->ranges, [$dashIndex, $dashIndex]);\n\t\t}\n\t}", "function alpha_numeric_dash_space($str)\n \t{\n\t\t$this->CI->form_validation->set_message('alpha_numeric_dash_space', 'The %s must be a valid Characters.'); \t \n\t\treturn ( ! preg_match(\"/^([-a-z0-9_ ])+$/i\", $str)) ? FALSE : TRUE;\n \t}", "public function getDashLength();", "function removeMultiDash($product_alias)\n{\n\treturn preg_replace(\"![^a-z0-9]+!i\", \"-\", $product_alias);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the relation on which the key attributes are defined.
public function getRelation() { return $this->attributes[0]->getRelation(); }
[ "public function getRelation($key);", "public function getRelationKey()\n {\n return $this->translationForeignKey ?: $this->getForeignKey();\n }", "public function getKeyAttributes()\n {\n return $this->getSchema()->getRelationKeyAttributes( $this->getName() );\n }", "public function isRelationAttribute($key);", "public function getRelationKey()\n {\n return config('pxlcms.translatable.translation_foreign_key') ?: $this->getForeignKey();\n }", "public function getRelated($key);", "public function getRelation()\n {\n return $this->relation;\n }", "public function getRelationFromArray($key);", "public function relations()\n\t{\n\t\treturn array(\n\t\t\t'apis' => array(self::HAS_MANY, 'Api', 'owner_id'),\n 'keyCount' => array(self::STAT, 'Key', 'user_id'),\n\t\t\t'keyRequests' => array(self::HAS_MANY, 'KeyRequest', 'user_id'),\n\t\t\t'keyRequestsProcessed' => array(self::HAS_MANY, 'KeyRequest', 'processed_by'),\n\t\t\t'keys' => array(self::HAS_MANY, 'Key', 'user_id'),\n\t\t);\n\t}", "public function getTableRelation(){\n\t\treturn $this->table_relation;\n\t}", "public static function getRelationsDefinition();", "abstract protected function relationName(): string;", "public function getForeignPartionKey()\n {\n return $this->parent->getAttribute($this->localKey[0]);\n }", "public function getRelationName()\n {\n return $this->relation;\n }", "public function isRelation($key);", "public function getPlainForeignKey()\n {\n return $this->relation;\n }", "public function getQualifiedRelatedKeyName()\n {\n return $this->table.$this->relatedKey;\n }", "public function getForeignRelation()\n {\n return $this->foreignRelation;\n }", "function Relation(){\n\t\tforeach($this->keys as $key=>$value){\n\t\t\tforeach($value as $index=>$clau){\n\t\t\t\t$this->rels[$clau] = array();\n\t\t\t\tarray_push($this->rels[$clau], $key);\t\n\t\t\t\tforeach($this->keys as $taula=>$claus){\n\t\t\t\t\tif($taula!=$key){\n\t\t\t\t\t\tforeach($claus as $indexx=>$clau2){\n\t\t\t\t\t\t\tif($clau==$clau2){\n\t\t\t\t\t\t\t\tarray_push($this->rels[$clau], $taula);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sign the passed resource with the OAuth params. This essentially generates a signature for the passed URL and returns a string with the OAuth parameters and signature appended. This is very useful for allowing people to display images that are not set to allow external view within the gallery's settings on SmugMug. This is a bit of a hack at the moment as I use the Mock handler to fake making the requests so I can grab the final URL. I may need to find a better way of doing this, possibly by creating my own middleware.
public function signResource($url) { $oauth = new \GuzzleHttp\Subscriber\Oauth\Oauth1([ 'request_method' => 'query', 'consumer_key' => $this->APIKey, 'consumer_secret' => $this->OAuthSecret, 'token' => $this->oauth_token, 'token_secret' => $this->oauth_token_secret, ]); $mock = new \GuzzleHttp\Handler\MockHandler([ new \GuzzleHttp\Psr7\Response(200), ]); $container = []; $handler = HandlerStack::create($mock); // Add OAuth to the stack $handler->push($oauth); // Add history to the stack $history = \GuzzleHttp\Middleware::history($container); $handler->push($history); $client = new GuzzleClient(['handler' => $handler, 'auth' => 'oauth']); $client->get($url); foreach ($container as $transaction) { $url = $transaction['request']->getUri(); } return (string) $url; }
[ "function sign_request( $method, $url, $params = array() ) {\n global $settings;\n\n $parts = parse_url( $url );\n\n // We need to normalize the endpoint URL\n $scheme = isset( $parts['scheme'] ) ? $parts['scheme'] : 'http';\n $host = isset( $parts['host'] ) ? $parts['host'] : '';\n $port = isset( $parts['port'] ) ? $parts['port'] : ( $scheme == 'https' ? '443' : '80' );\n $path = isset( $parts['path'] ) ? $parts['path'] : '';\n if ( ( $scheme == 'https' && $port != '443' ) ||\n ( $scheme == 'http' && $port != '80' )\n ) {\n // Only include the port if it's not the default\n $host = \"$host:$port\";\n }\n\n // Also the parameters\n $pairs = array();\n parse_str( isset( $parts['query'] ) ? $parts['query'] : '', $query );\n $query += $params;\n unset( $query['oauth_signature'] );\n if ( $query ) {\n $query = array_combine(\n // rawurlencode follows RFC 3986 since PHP 5.3\n array_map( 'rawurlencode', array_keys( $query ) ),\n array_map( 'rawurlencode', array_values( $query ) )\n );\n ksort( $query, SORT_STRING );\n foreach ( $query as $k => $v ) {\n $pairs[] = \"$k=$v\";\n }\n }\n\n $toSign = rawurlencode( strtoupper( $method ) ) . '&' .\n rawurlencode( \"$scheme://$host$path\" ) . '&' .\n rawurlencode( join( '&', $pairs ) );\n $key = rawurlencode( $settings['gConsumerSecret'] ) . '&' . rawurlencode( $settings['gTokenSecret'] );\n return base64_encode( hash_hmac( 'sha1', $toSign, $key, true ) );\n}", "public function sign_url( $url ) {\n\t\tif ( ! function_exists( 'hash_hmac' ) ) {\n\t\t\treturn $url;\n\t\t}\n\n\t\t$url = add_query_arg( 'client', $this->options['geo_client_id'], $url );\n\n\t\t$url = esc_url( $url );\n\n\t\t$parsed_url = parse_url( $url );\n\t\t$url_to_sign = $parsed_url['path'] . '?' . $parsed_url['query'];\n\n\t\t// Decode the private key into its binary format\n\t\t$decoded_key = base64_decode( str_replace( array( '-', '_' ), array( '+', '/' ), $this->options['geo_private_key'] ) );\n\n\t\t// Create a signature using the private key and the URL-encoded\n\t\t// string using HMAC SHA1. This signature will be binary.\n\t\t$signature = hash_hmac( 'sha1', $url_to_sign, $decoded_key, true );\n\t\t$encoded_signature = str_replace( array( '+', '/' ), array( '-', '_' ), base64_encode( $signature ) );\n\n\t\t// Note: add_query_arg() malformed signature\n\t\treturn $url . '&signature=' . $encoded_signature;\n\t}", "public function sign()\r\n\t{\r\n\t\t// :TODO: Only add timestamp+nonce if the signature method requires it.\r\n\t\t$this->params_oauth['oauth_timestamp'] = time();\r\n\t\t$this->params_oauth['oauth_nonce'] = OAuthShared::generateNonce();\r\n\r\n\t\t$this->params_oauth['oauth_signature_method'] = $this->client->getSignatureMethod()->getName();\r\n\t\t$this->params_oauth['oauth_signature'] =\r\n\t\t\t$this->client->getSignatureMethod()->buildSignature($this, $this->client->getConsumer(), $this->token);\r\n\r\n\t\tif(empty($this->params_oauth['oauth_signature']))\r\n\t\t{\r\n\t\t\tthrow new OAuthException('Signing the request completely and utterly failed.');\r\n\t\t}\r\n\r\n // Add the OAuth params to the POST params in case we need them there. \r\n // Won't affect GET call.\r\n $this->params_post += $this->params_oauth;\r\n\r\n\t\t$this->signed = true;\r\n\t}", "public function getSignedUrl(): string\n {\n $query = base64_encode(json_encode($this->buildQuery()));\n $signature = hash_hmac('sha256', $this->templateId . $query, $this->token);\n\n return $this->signedUrlBase . $this->templateId . '.png?' . http_build_query(['s' => $signature, 'v' => $query]);\n }", "function sign_request( $method, $url, $params = [] ) {\n//\t\tglobal $gConsumerSecret, $gTokenSecret;\n\n\t\t$parts = parse_url( $url );\n\n\t\t// We need to normalize the endpoint URL\n\t\t$scheme = isset( $parts['scheme'] ) ? $parts['scheme'] : 'http';\n\t\t$host = isset( $parts['host'] ) ? $parts['host'] : '';\n\t\t$port = isset( $parts['port'] ) ? $parts['port'] : ( $scheme == 'https' ? '443' : '80' );\n\t\t$path = isset( $parts['path'] ) ? $parts['path'] : '';\n\t\tif ( ( $scheme == 'https' && $port != '443' ) ||\n\t\t\t( $scheme == 'http' && $port != '80' )\n\t\t) {\n\t\t\t// Only include the port if it's not the default\n\t\t\t$host = \"$host:$port\";\n\t\t}\n\n\t\t// Also the parameters\n\t\t$pairs = [];\n\t\tparse_str( isset( $parts['query'] ) ? $parts['query'] : '', $query );\n\t\t$query += $params;\n\t\tunset( $query['oauth_signature'] );\n\t\tif ( $query ) {\n\t\t\t$query = array_combine(\n\t\t\t\t// rawurlencode follows RFC 3986 since PHP 5.3\n\t\t\t\tarray_map( 'rawurlencode', array_keys( $query ) ),\n\t\t\t\tarray_map( 'rawurlencode', array_values( $query ) )\n\t\t\t);\n\t\t\tksort( $query, SORT_STRING );\n\t\t\tforeach ( $query as $k => $v ) {\n\t\t\t\t$pairs[] = \"$k=$v\";\n\t\t\t}\n\t\t}\n\n\t\t$toSign = rawurlencode( strtoupper( $method ) ) . '&' .\n\t\t\trawurlencode( \"$scheme://$host$path\" ) . '&' .\n\t\t\trawurlencode( join( '&', $pairs ) );\n\t\t$key = rawurlencode( $this->gConsumerSecret ) . '&' . rawurlencode( $this->gTokenSecret );\n\t\treturn base64_encode( hash_hmac( 'sha1', $toSign, $key, true ) );\n\t}", "protected function getSignedUrl()\n\t{\n\t\tif(empty($this->execUrl) || empty($this->params) || empty($this->sigs))\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t\t$oAuthObj = new OAuthSimple();\n\t\t$this->oAuth = $oAuthObj->sign(array(\n\t\t\t'path' => $this->execUrl,\n\t\t\t'parameters' => $this->params,\n\t\t\t'signatures' => $this->sigs,\n\t\t));\n\t}", "private function sign($request)\r\n\t{\r\n\t\t$timestamp = gmdate(\"Y-m-d\\TH:i:s\\Z\"); \r\n\t\t$timestamp = str_replace(':', '%3A', $timestamp);\r\n\t\t\r\n\t\t$request['Timestamp'] = $timestamp;\r\n\t\t$request['Version'] = $this->apiversion;\r\n\t\t\r\n\t\tksort($request, SORT_STRING);\r\n\t\t\r\n\t\t$prepend = \"GET\\n{$this->baseurl}\\n{$this->urlpath}\\n\";\r\n\t\t\r\n\t\t$requestStr = $this->build_query($request);\r\n\r\n\t\t$prependStr = $prepend . $requestStr;\r\n\t\t\r\n\t\t$signature = hash_hmac($this->hashalgo, $prependStr, $this->secretKey, true);\r\n\t\t$signature = base64_encode($signature);\r\n\t\t$signature = str_replace('+', '%2B', $signature);\r\n\t\t$signature = str_replace('=', '%3D', $signature);\r\n\t\t\r\n\t\t$requestStr .= \"&Signature=$signature\";\r\n\t\t\r\n\t\treturn $requestStr;\r\n\t}", "function generateOAuthSignature($clientId, $clientSecret, $params, $requestUrl, $token = \"\", $method = \"POST\", $signatureMethod = \"HMAC-SHA1\", $version = \"1.0\") {\n\n $nonce = $this->generateToken(16);\n $timestamp = time();\n $method = strtoupper($method);\n $requestUrl = strtolower($requestUrl);\n \n $oauthFields = array();\n \n // Gather all of the oauth parameters together, then add the oauth_token if one will be present.\n // These will then be copied into the parameters array, yet maintained separately so that we can\n // return these fields in the end (as they will need to be sent with the request)\n // The oauth_signature field will be added to this array as soon as the signature is generated.\n $oauth_params = array(\n 'oauth_consumer_key' => $clientId,\n 'oauth_version' => $version,\n 'oauth_timestamp' => $timestamp,\n 'oauth_nonce' => $nonce,\n 'oauth_signature_method' => $signatureMethod\n );\n \n // add the token to the $oauth_params if present\n if ($token != \"\") {\n $oauth_params['oauth_token'] = $token;\n }\n \n // copy these into the $params array (but keep a separate copy of oauth_params)\n $paramBase = array_merge($params, $oauth_params);\n \n // Generate the string to be signed\n // https://oauth1.wp-api.org/docs/basics/Signing.html\n // https://tools.ietf.org/html/rfc5849#section-3.4.1.1\n // https://oauth.net/core/1.0a/\n // Concatenate the Method (uppercase POST or GET) + Request URL (no query string) + Parameters\n // METHOD: Uppercase HTTP Method\n // URL: Lowercase scheme and host, port excluded if 80 for HTTP or 443 for SSL\n // GET or POST parameters (those passed in $param) are form encoded (a=b&c=d not JSON). Encode the name and value for each, sort by name (and value for duplicate keys). Combine key and value with a =, then concatenate with & into a string\n // NOTE: since this implementation expects unique keys, we are only sorting by the keys, not values.\n $paramString = \"\";\n ksort($paramBase);\n foreach ($paramBase as $key => $value) {\n $paramString .= $this->oauth_encode($key) . \"=\" . $this->oauth_encode($value) . \"&\";\n }\n $paramString = substr($paramString, 0, -1); // remove trailing &\n \n // Encode and concatenate with &: method & request URL & parameter string. Yes, parameter string key and values will be double encoded\n // Example result: POST&http%3A%2F%2Fexample.com%2Fwp-json%2Fwp%2Fv2%2Fposts&oauth_consumer_key%3Dkey%26oauth_nonce%3Dnonce%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D123456789%26oauth_token%3Dtoken\n // Note: RFC 5849 (OAuth 1.0) allows for a custom method, but requires it to be encoded\n $oauthBaseString = $this->oauth_encode($method) . \"&\" . $this->oauth_encode($requestUrl) . \"&\" . $this->oauth_encode($paramString);\n \n // Create the signing key\n // The signature key for HMAC-SHA1 is created by taking the client/consumer secret and the token secret, URL-encoding each, then concatenating them with & into a string.\n // This process is always the same, even if you don't have a token.\n // For example, if your client secret is abcd and your token secret is 1234, the key is abcd&1234. If your client secret is abcd, and you don't have a token yet, the key is abcd&\n $oauthSigningKey = $this->oauth_encode($clientSecret) . \"&\" . $this->oauth_encode($token);\n \n // Using the Base String and Signing Key, generate a base 64 encoded signature using sha1\n $oauthSignature = base64_encode(hash_hmac(\"sha1\", $oauthBaseString, $oauthSigningKey, true));\n \n // now that we have a signature, we can add it to both parameter arrays\n $oauth_params['oauth_signature'] = $oauthSignature; // add signature to oauth field set\n \n // for loop to add all OAuth parameters (including signature) for authorization header \n $authorizationString = \"OAuth \";\n foreach ($oauth_params as $key => $value) {\n $authorizationString .= $this->oauth_encode($key) . \"=\\\"\" . $this->oauth_encode($value) . \"\\\", \";\n }\n $authorizationString = substr($authorizationString, 0, -2); // remove trailing , and space\n\n $oauthFields['authorization'] = $authorizationString;\n $oauthFields['fields'] = $oauth_params;\n\n return $oauthFields;\n }", "function getClientAuthSignature($method, $url, $date, $user, $secret) {\n\n $request_url = parse_url($url);\n $query_string = $request_url['query'];\n\n parse_str($query_string,$params);\n // sort the parameters\n ksort($params);\n\n // create the canonicalized query\n $canonicalized_query = array();\n foreach ($params as $param=>$value)\n {\n $param = str_replace(\"%7E\", \"~\", rawurlencode($param));\n $value = str_replace(\"%7E\", \"~\", rawurlencode($value));\n $canonicalized_query[] = $param.\"=\".$value;\n }\n $canonicalized_query = implode(\"&\", $canonicalized_query);\n\n // create the string to sign\n $string_to_sign = $method.\"\\n\".$canonicalized_query.\"\\n\".$date;\n\n // calculate HMAC with SHA256 and base64-encoding\n $signature = base64_encode(hash_hmac(\"sha256\", $string_to_sign, $secret, True));\n\n // encode the signature for the request\n $signature = str_replace(\"%7E\", \"~\", rawurlencode($signature));\n\n return $signature;\n }", "function signUrl($myUrlToSign, $privateKey)\n{\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "private function signature(){\n $this->params['api_sig'] = StileroFlickrSignature::getSignature($this->params, $this->Api);\n }", "function signUrl($myUrlToSign, $privateKey) {\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "public function signUrl($url)\n {\n $url .= sprintf('&client=gme-%s', $this->clientId);\n\n if ($this->hasChannel()) {\n $url .= sprintf('&channel=%s', $this->channel);\n }\n\n $urlParts = parse_url($url);\n $data = sprintf('%s?%s', $urlParts['path'], $urlParts['query']);\n $key = base64_decode(str_replace(array('-', '_'), array('+', '/'), $this->secret));\n $signature = base64_encode(hash_hmac('sha1', $data, $key, true));\n\n $url .= sprintf('&signature=%s', str_replace(array('+', '/'), array('-', '_'), $signature));\n\n return $url;\n }", "function signUrl($originalURL, $privateKey)\n {\n $url_components = parse_url($originalURL);\n \n $urlPartToSign = $url_components['path'].'?'.$url_components['query'];\n \n // Decode the private key into its binary format\n $decodedKey = $this->decodeBase64UrlSafe($privateKey);\n \n // Create a signature using the private key and the URL-encoded string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\", $urlPartToSign, $decodedKey, true);\n \n $encodedSignature = $this->encodeBase64UrlSafe($signature);\n \n return $originalURL.\"&signature=\".$encodedSignature.(isset($url_components['fragment']) ? '#'.$url_components['fragment'] : '');\n }", "abstract public function build_signature( $request, $consumer, $token );", "public static function sign ($params) {\n return self::signData(self::buildDataToSign($params), self::SECRET_KEY);\n }", "private function signRequest($reguest) {\n $signature = null;\n openssl_sign($reguest, $signature, $this->private_key, \"SHA256\");\n $signature = rtrim(strtr(base64_encode($signature), '+/', '-_'), '=');\n return $signature;\n }", "public function testSignRequestUrl()\n {\n $credentials = new SharedAccessSignature('myaccount', '', false);\n $queryString = $credentials->createSignedQueryString('pictures/blob.txt', '', 'b', 'r', '2009-02-09', '2009-02-10');\n\n $credentials->setPermissionSet(array(\n 'http://blob.core.windows.net/myaccount/pictures/blob.txt?' . $queryString\n ));\n\n $requestUrl = 'http://blob.core.windows.net/myaccount/pictures/blob.txt?comp=metadata';\n $result = $credentials->signRequestUrl($requestUrl, Storage::RESOURCE_BLOB);\n\n $this->assertEquals('http://blob.core.windows.net/myaccount/pictures/blob.txt?comp=metadata&' . $queryString, $result);\n }", "public static function signParams($params){\n uksort($params, 'strcmp');\n foreach ($params as $key => $value) {\n $key = OauthHelper::safeEncode($key);\n $value = OauthHelper::safeEncode($value);\n $keyValues[] = \"{$key}={$value}\";\n }\n $signature = implode('&', $keyValues);\n return $signature;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates status for coursebackup record
public static function user_update_status($coursebackup, $status) { global $DB; $statuses = self::get_statuses(); $noactionstatuses = self::get_noaction_statuses(); // Check if a new status exists. if (!array_key_exists($status, $statuses)) { coursebank_logging::log_status_update( "Failed updating: status code \"$status\" does not exist." ); return false; } // Check if record exists. if (!$DB->record_exists('tool_coursebank', array('id' => $coursebackup->id))) { coursebank_logging::log_status_update( "Failed updating: course bank record with ID: " . "\"$coursebackup->id\" does not exist" ); return false; } // If status is a "no action" status we can't update it. // This prevents us from changing the status mid-way through a transfer. if (in_array($coursebackup->status, $noactionstatuses)) { coursebank_logging::log_status_update( "Failed updating: current status is " . "$coursebackup->status for course bank backup with " . "ID $coursebackup->id. This status is in the " . "\"no action\" list." ); return false; } // Delete the copied backup - just in case. But, don't stop if the file doesn't exist. self::delete_backup($coursebackup, false); // Finally update. $oldstatus = $coursebackup->status; $coursebackup->status = $status; $coursebackup->isbackedup = 0; $DB->update_record('tool_coursebank', $coursebackup); coursebank_logging::log_status_update( "Updating status: successfully " . "updated status from $oldstatus to $status for backup with" . " ID $coursebackup->id.", true ); return true; }
[ "public function updateStatus()\n {\n $query = $this->db->getQuery(true);\n\n $query\n ->update($this->db->quoteName(\"#__crowdf_transactions\"))\n ->set($this->db->quoteName(\"txn_status\") . \" = \" . $this->db->quote($this->txn_status))\n ->where($this->db->quoteName(\"id\") . \" = \" . (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n }", "public function testUpdateActivityStatus()\n {\n\n }", "public function syncstatusAction() {\r\n\t\t$model = Mage::getModel('lastmile/lastmile');\r\n\t\t//$apiurl = Mage::getStoreConfig('carriers/dlastmile/gateway_url');\r\n\t\t$apiurl = Mage::helper('lastmile')->getApiUrl('syncAWB');\r\n\t\t$token = Mage::getStoreConfig('carriers/dlastmile/licensekey');\t\t\r\n\t\tif($apiurl && $token)\r\n\t\t{\r\n\t\t\t$waybills = $model->findAwbToUpdate();\r\n\t\t\tif(count($waybills)){ //No update to perform if count is zero\r\n\t\t\t\t$awbs = '';\r\n\t\t\t\tforeach($waybills as $waybill){\r\n\t\t\t\t\tif(is_array($waybill)){\r\n\t\t\t\t\t $awbs .= $waybill['awb'].',';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$path = $apiurl.'json/?verbose=0&token='.$token.'&waybill='.$awbs;\t\r\n\t\t\t\t$retValue = Mage::helper('lastmile')->Executecurl($path,'','');\r\n\t\t\t\t$statusupdates = json_decode($retValue);\r\n\t\t\t\t\r\n\t\t\t\tforeach ($statusupdates->ShipmentData as $item) {\t\t\t \t\t \r\n\t\t\t\t $lmawb = Mage::getModel('lastmile/lastmile')->loadByAwb($item->Shipment->AWB);\r\n\t\t\t\t $model = Mage::getModel('lastmile/lastmile');\r\n\t\t\t\t $data = array();\r\n\t\t\t\t $data['awb'] = $item->Shipment->AWB;\r\n\t\t\t\t $data['status'] = preg_replace('/\\s+/', '', $item->Shipment->Status->Status);\r\n\t\t\t\t $data['status_type'] = $item->Shipment->Status->StatusType;\r\n\t\t\t\t $model->setData($data)->setId($lmawb)->save();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('lastmile')->__(count($waybills).' Waybill(s) Updated Successfully'));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('lastmile')->__('Please add valid License Key and Gateway URL in plugin configuration'));\r\n\t\t}\t\t\r\n\t\t$this->_redirect('*/*/');\r\n }", "public function syncstatusAction() {\r\n\t\t$model = Mage::getModel('lastmile/lastmile');\r\n\t\t$apiurl = Mage::getStoreConfig('carriers/dlastmile/gateway_url');\r\n\t\t$token = Mage::getStoreConfig('carriers/dlastmile/licensekey');\t\t\r\n\t\tif($apiurl && $token)\r\n\t\t{\r\n\t\t\t$waybills = $model->findAwbToUpdate();\r\n\t\t\tif(count($waybills)){ //No update to perform if count is zero\r\n\t\t\t\t$awbs = '';\r\n\t\t\t\tforeach($waybills as $waybill){\r\n\t\t\t\t\tif(is_array($waybill)){\r\n\t\t\t\t\t $awbs .= $waybill['awb'].','; \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tmage::log(\"Status Updated for these waybills $awbs\");\r\n\t\t\t\t$path = $apiurl.'api/packages/json/?verbose=0&token='.$token.'&waybill='.$awbs;\t\r\n\t\t\t\t$retValue = Mage::helper('lastmile')->Executecurl($path,'','');\r\n\t\t\t\t$statusupdates = json_decode($retValue);\r\n\t\t\t\tforeach ($statusupdates->ShipmentData as $item) {\t\t\t \t\t \r\n\t\t\t\t $lmawb = Mage::getModel('lastmile/lastmile')->loadByAwb($item->Shipment->AWB);\r\n\t\t\t\t $model = Mage::getModel('lastmile/lastmile');\r\n\t\t\t\t $data = array();\r\n\t\t\t\t $data['awb'] = $item->Shipment->AWB;\r\n\t\t\t\t $data['status'] = preg_replace('/\\s+/', '', $item->Shipment->Status->Status);\t\t \r\n\t\t\t\t $model->setData($data)->setId($lmawb)->save();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('lastmile')->__(count($waybills).' Waybill(s) Updated Successfully'));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('lastmile')->__('Please add valid License Key and Gateway URL in plugin configuration'));\r\n\t\t}\t\t\r\n\t\t$this->_redirect('*/*/');\r\n }", "public function updateStatus()\n {\n if ($this->is_canceled)\n {\n $this->UllCourseStatus = $this->findStatus('canceled');\n \n return;\n } \n \n if (date('Y-m-d') > $this->end_date)\n {\n $this->UllCourseStatus = $this->findStatus('finished');\n \n return;\n } \n\n if ($this->is_active && $this->proxy_number_of_participants_applied < $this->min_number_of_participants)\n {\n $this->UllCourseStatus = $this->findStatus('spots-available');\n \n return;\n } \n \n if ($this->is_active && $this->proxy_number_of_participants_applied > $this->max_number_of_participants)\n {\n $this->UllCourseStatus = $this->findStatus('overbooked');\n \n return;\n } \n \n if (!$this->is_active && date('Y-m-d') < $this->begin_date)\n {\n $this->UllCourseStatus = $this->findStatus('planned');\n }\n elseif ($this->is_active && date('Y-m-d') < $this->begin_date)\n {\n $this->UllCourseStatus = $this->findStatus('fully-booked');\n }\n elseif ($this->is_active && date('Y-m-d') >= $this->begin_date && date('Y-m-d') <= $this->end_date)\n {\n $this->UllCourseStatus = $this->findStatus('active');\n } \n \n }", "public function updateStatus()\n {\n }", "function changestatus($recid=null,$status=null){\r\r\n\t\tif($status == 2 )\r\r\n\t\t$status = 0;\r\r\n ##check user session live or not\r\r\n\t\t\t$this->session_check_admin();\r\r\n \r\r\n\t\t\t##import dynamic model for processing\r\r\n\t\t\t App::import(\"Model\", \"SystemVersion\");\r\r\n $this->SystemVersion = & new SystemVersion();\r\r\n\t\t \r\r\n\t\t\t$this->SystemVersion->updateAll(array('SystemVersion.active_status'=> $status), array('SystemVersion.id' => $recid));\r\r\n\t\t\t\r\r\n\t\t\t$this->Session->setFlash('Database updated successfully.','default', array('class' => 'successmsg'));\r\r\n\t\t\t\r\r\n\t\t\t$this->redirect(array(\"controller\"=>\"versions\",\"action\"=>\"system_version_list\"));\r\r\n\r\r\n }", "function updateStatus() {\n \n }", "public function updateCourseStatus($params) {\n $ac = new db('alloc_course');\n $ac->select('employee_id = :eid AND course_id = :cid', false, false, array('eid' => $params->employee_id, 'cid' => $params->course_id));\n $ac->getRow();\n $attempt = $ac->attempts+1;\n $q = new db('questions');\n $q->select('course_id = :cid AND deleted != :del',false, false, array('cid' => $params->course_id, 'del'=>1));\n $a = new db('submitted_answers');\n $a->select('employee_id = :eid AND course_id = :cid AND attempt = :a', false, false, array('eid' => $params->employee_id, 'cid' => $params->course_id, 'a' => $attempt));\n // All questions answered\n if ($q->numRows == $a->numRows) {\n $c = new db('submitted_answers');\n $c->select('employee_id = :eid AND course_id = :cid AND is_correct = :c AND attempt = :a', false, false, array('eid' => $params->employee_id, 'cid' => $params->course_id, 'c' => 1, 'a' => $attempt));\n // If number correct equals total number of questions - passed course\n if ($c->numRows == $a->numRows) {\n $ac = new db('alloc_course');\n //update by Alex-cobra -20-05-16\n //for failed\n if (floatval($params->percentageScore) < 70 ) {\n $flds = array('status' => 5, 'completed_date' => null );\n $data = array('status' => 5, 'completed_date' => date('Y-m-d H:i:s'), 'cid' => $params->course_id, 'eid' => $params->employee_id);\n }\n else {\n $flds = array('status' => 1, 'completed_date' => date('Y-m-d H:i:s'));\n $data = array('status' => 1, 'completed_date' => date('Y-m-d H:i:s'), 'cid' => $params->course_id, 'eid' => $params->employee_id);\n }\n //update by Alex-cobra -20-05-16\n $ac->update($flds,'course_id = :cid AND employee_id = :eid', 1, $data);\n // add system log\n $alloc_course_id = $params->course_id;\n $account_id = '';\n $log_type = 'completed_course';\n $employee_id = $params->employee_id;\n $this->addCourseLog($account_id, $alloc_course_id, $log_type, $employee_id);\n } else {\n //\n }\n // Update the attempts\n $ac = new db('alloc_course');\n $ac->update(array('attempts' => 1), 'course_id = :cid AND employee_id = :eid', 1, array('attempts' => $attempt, 'cid' => $params->course_id, 'eid' => $params->employee_id));\n }\n }", "public function syncPaystackStatus()\n {\n $transaction = $this->asPaystackTransaction();\n\n $this->status = $transaction->status;\n\n $this->save();\n }", "function update_course_status($data){\n\t\t$chkclassid = $this->db->escape_like_str($data->classid);\n\t\t$chkcourseid = $this->db->escape_like_str($data->courseid);\n\t\t$statusdata=array(\n\t\t\t\t \"active_flag\"=>$this->db->escape_like_str($data->activeflag)\n\t\t\t\t);\n\t\t$array = array('class_id' => $chkclassid,'course_id' => $chkcourseid);\n\t\t$this->db->where($array);\n\t\t// return $this->db->delete('course_class');\n\n\t\treturn $this->db->update(\"course_class\",$statusdata);\n\t}", "public function testUpdateStatus()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function twe_set_banner_status($banners_id, $status) {\n global $db;\n if ($status == '1') {\n $db->Execute(\"update \" . TABLE_BANNERS . \" set status = '1', date_status_change = now(), date_scheduled = NULL where banners_id = '\" . $banners_id . \"'\");\n } elseif ($status == '0') {\n $db->Execute(\"update \" . TABLE_BANNERS . \" set status = '0', date_status_change = now() where banners_id = '\" . $banners_id . \"'\");\n } else {\n return -1;\n }\n }", "public function updateStatus($status)\n {\n }", "public function updated(Backup $backup)\n {\n //\n }", "public function testUpdateUserInventoryStatus()\n {\n }", "function set_recovery_file_status($correlation_id, $status) {\n\t\n $db = db_connect();\n \n // Get ZULU time for timestamp\n \n $timestr = date('c', time());\n\t\n\t$db->exec(\"update dpn_recovery_file set status = '$status' where correlation_id = '$correlation_id'\");\n\n $db->close();\n unset($db);\n\n}", "protected function _saveStatus()\n {\n try {\n\n /**\n * update task statuses with completion days\n */\n foreach( $this->_status as $key => $val ) {\n\n if ( in_array( $key, $this->_tasks ) ) {\n $task = Mage::getModel('jirafe_analytics/install')\n ->getCollection()\n ->addFieldToFilter( 'task', $key )\n ->getFirstItem();\n\n $task->setCompletedDt( $val );\n $task->save();\n }\n }\n\n /**\n * refresh status values in cache\n *\n */\n $this->_saveStatusToCache();\n\n return true;\n\n } catch (Exception $e) {\n Mage::helper('jirafe_analytics')->log('ERROR', 'Jirafe_Analytics_Model_Installer::_saveStatus()', $e->getMessage(), $e);\n return false;\n }\n }", "public function statusUpdate()\n {\n try {\n $status = $this->paynow->processStatusUpdate();\n\n if ($status->paid()) {\n // Find the transaction which has been paid for\n $transaction = Transaction::find($status->reference());\n\n // Update the transaction of the transaction\n $transaction->paid = true;\n\n // Persist the new status\n $transaction->save();\n\n $this->runPaidTransactionActions($transaction);\n }\n } catch (HashMismatchException $e) {\n logger()->error(\"Hash mismatch exception when trying to process status update\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to instantiate a new TemporaryAccessBooking from given params.
public function create( Carbon $start, Carbon $end, User $user, ?BookableArea $bookableArea = null, int $guests = 0, ?string $color = null, ?string $notes = null, bool $approved = false, ?User $approvedBy = null ) { $_temporaryAccessBooking = new TemporaryAccessBooking(); $_temporaryAccessBooking->setStart($start); $_temporaryAccessBooking->setEnd($end); $_temporaryAccessBooking->setUser($user); $_temporaryAccessBooking->setBookableArea($bookableArea); $_temporaryAccessBooking->setGuests($guests); $_temporaryAccessBooking->setColor($color); $_temporaryAccessBooking->setNotes($notes); $_temporaryAccessBooking->setApproved($approved); $_temporaryAccessBooking->setApprovedBy($approvedBy); return $_temporaryAccessBooking; }
[ "public function createBooking();", "static function &create($params) {\n \n if (empty($params)) {\n return;\n }\n \n $need = new CRM_Volunteer_DAO_Need();\n \n $need->copyValues($params);\n $need->save();\n \n return $need;\n }", "public function fakebooking($bookingFields = [])\n {\n return new booking($this->fakebookingData($bookingFields));\n }", "public function prepare_insertNewBooking($params)\n\t{\n\t\t$xml_string = \"p_Token=\".$params['p_Token'].\"&p_UserID=\".$params['p_UserID'].\"&p_VillaID=\".$params['p_VillaID'].\"&p_CIDate=\".$params['p_CIDate'].\"&p_CODate=\".$params['p_CODate'].\"&p_GuestFirstName=\".$params['p_GuestFirstName'].\"&p_GuestLastName=\".$params['p_GuestLastName'].\"&p_Email=\".$params['p_Email'].\"&p_CountryOfResidence=\".$params['p_CountryOfResidence'].\"&p_MobileNo=\".$params['p_MobileNo'].\"&p_TelNo=\".$params['p_TelNo'].\"&p_BookingSourceID=\".$params['p_BookingSourceID'].\"&p_TotalPax=\".$params['p_TotalPax'].\"&p_TotalChild=\".$params['p_TotalChild'].\"&p_TotalInfant=\".$params['p_TotalInfant'].\"&p_SpecialRequest=\".$params['p_SpecialRequest'].\"&p_MarketingMediaID=\".$params['p_MarketingMediaID'].\"&p_AffID=\".$params['p_AffID'].\"\";\n\t\treturn $xml_string;\n\t}", "public function createBooking($booking)\n {\n if (isset($booking, $booking->service->id, $booking->date, $booking->time, $booking->clientName)) {\n $service = $this->entityManager->getRepository(Service::class)\n ->find($booking->service->id);\n $date = new \\DateTime($booking->date);\n $time = new \\DateTime($booking->time);\n $serviceSchedule = $this->entityManager->getRepository(ServiceSchedule::class)\n ->findBy(\n [\n 'service' => $service,\n 'date' => new $date,\n 'serviceStart' => $time\n ]\n );\n $registeredBooking = $this->entityManager->getRepository(Booking::class)\n ->findBy(\n [\n 'date' => $date,\n 'time' => $time,\n 'service' => $service\n ]\n );\n\n if (count($serviceSchedule) == 0 && count($registeredBooking) == 0) {\n $newBooking = new Booking();\n $newBooking->setService($service);\n if (isset($booking->comment)) {\n $newBooking->setComment($booking->comment);\n }\n $newBooking->setClientName($booking->clientName);\n $newBooking->setDate($date);\n $newBooking->setTime($time);\n $newBooking->setPrice($booking->price);\n $this->entityManager->persist($newBooking);\n $this->entityManager->flush();\n } else {\n throw new \\Exception('Day and hours reserved');\n }\n } else {\n throw new \\Exception('Invalid JSON');\n }\n\n return $newBooking;\n\n }", "public function __construct(array $linkedBooking = array())\n {\n $this\n ->setLinkedBooking($linkedBooking);\n }", "public static function init(): self\n {\n return new self(new PaymentBalanceActivityReserveReleaseDetail());\n }", "public static function createAction($params);", "public function testNewInvalidBooking()\n {\n \\tabs\\api\\client\\ApiClient::factory('http://bad.url/');\n $booking = \\tabs\\api\\booking\\Booking::create(\n \"mousecott\",\n \"SS\",\n strtotime(\"2012-07-01\"),\n strtotime(\"2012-07-08\"),\n 2,\n 1,\n 0,\n 1\n );\n }", "private function _getBooking()\r\n {\r\n \\tabs\\api\\client\\ApiClient::factory('http://private-7871e-carltonsoftware.apiary-mock.com/');\r\n \\tabs\\api\\client\\ApiClient::getApi()->setTestMode(true);\r\n return \\tabs\\api\\booking\\TabsBooking::getBooking(299463);\r\n }", "public function createPassholder(CultureFeed_Uitpas_Passholder $passholder);", "public function create_booking($booking) {\n\t\t$sql = 'INSERT INTO tblBooking (GuestID, RoomID, CheckInDate, CheckOutDate, ItemCount) \n\t\t\tVALUES (:guest_id, :room_id, :check_in_date, :check_out_date, :item_count);';\n\n\t\t// Connect to the database.\n\t\t$database = new Database();\n\t\t$connection = $database->connect();\n \t$statement = $connection->prepare($sql);\n\n \t// Bind parameters.\n \t$statement->bindParam(':guest_id', $booking->get_guest()->get_id(), PDO::PARAM_INT);\n \t$statement->bindParam(':room_id', $booking->get_room()->get_id(), PDO::PARAM_INT);\n \t$statement->bindParam(':check_in_date', $booking->get_check_in_date()->format('Y-m-d'), PDO::PARAM_STR);\n \t$statement->bindParam(':check_out_date', $booking->get_check_out_date()->format('Y-m-d'), PDO::PARAM_STR);\n \t$statement->bindParam(':item_count', $booking->get_item_count(), PDO::PARAM_INT);\n\n \t// Execute query.\n \t$statement->execute();\n\t}", "public function createBook($params);", "public function __construct(SharedTempStoreFactory $tempstore) {\n $this->tempstore = $tempstore;\n }", "public static function _get_temp_object() {\n\t\t$obj = new static();\n\t\t$obj->_valid_model = False;\n\t\treturn $obj;\n\t}", "public function createAccessObject()\n {\n $access = new Access();\n $access->setUserId( $this->getUserId() );\n return $access;\n }", "public function createForTemporaryCredentials();", "public function create_temporary_object()\n {\n if ($this->object === null)\n {\n $this->object = $_MIDCOM->tmp->create_object();\n }\n }", "public function createBooking($fields=array()){\n $dateTime = date(\"Y-m-d H:i:s\");\n $fields[\"CreatedTs\"]= $dateTime;\n\n if(!$this->db->insert(\"booking\",$fields)){\n throw new Exception('creating Booking failed');\n }\n\n $query = $this->db->get(\"booking\",array(\"CreatedTS\",\"=\",$dateTime));\n $result = $query->first();\n $this->setup($result->BookingId); \n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of propertyLazyLoaded.
public function setPropertyLazyLoaded($propertyLazyLoaded) { $this->propertyLazyLoaded = $propertyLazyLoaded; return $this; }
[ "protected function loadProperties()\n\t{\n\t\tif ($this->hasId() && $this->lazyLoad && !$this->loaded) {\n\t\t\t$this->loaded = true;\n\t\t\t$this->load();\n\t\t}\n\t}", "abstract protected function load_lazy_property( $property );", "public function setLazyLoading($lazyLoading)\n {\n $this->lazyLoading = $lazyLoading;\n }", "public function setLoader(LazyLoaderInterface $lazyLoader);", "public function getPropertyLazyLoaded()\n {\n return $this->propertyLazyLoaded;\n }", "public function isLazy()\n {\n $this->procedure = 'http_lazy';\n }", "public function forceLoaded() {\n $this->loaded = 1;\n }", "public function setLazyDb(LazyDB $obj_lazy_db);", "public function isLazy();", "abstract protected function get_lazy_properties();", "public function setProxyValue($property, $value)\n {\n $reflectionProperty = new ReflectionProperty($this->lazyObject, $property);\n $initializer = $this->lazyObject->__getInitializer();\n\n // disabling initializer since setting `publicPersistentField` triggers `__set`/`__get`\n $this->lazyObject->__setInitializer(null);\n $reflectionProperty->setValue($this->lazyObject, $value);\n $this->lazyObject->__setInitializer($initializer);\n }", "public function setIsLoaded($loaded) {\n\t\t$this->loaded = $loaded ? true : false;\n\t}", "public function isLazy()\n {\n return $this->_Lazy;\n }", "abstract public function lazyLoad();", "function setLazy($bool) {\n\n $this->isLazy = (bool) $bool;\n return $this;\n\n }", "public function getLazy(): bool\n {\n return $this->lazy;\n }", "public function testWritingLazy()\n {\n $this->testName = 'Writing lazy' . $this->getCacheSuffix();\n $this->objectRepository->setConfigOption('eagerLoadToOne', false);\n $this->objectRepository->setConfigOption('eagerLoadToMany', false);\n $this->doTests();\n }", "public function testReadingLazy()\n {\n $this->testName = 'Reading lazy' . $this->getCacheSuffix();\n $this->objectRepository->setConfigOption('eagerLoadToOne', false);\n $this->objectRepository->setConfigOption('eagerLoadToMany', false);\n $this->doTests();\n }", "public function testReadingLazy()\n {\n $this->testName = 'Criteria Reading Lazy' . $this->getCacheSuffix();\n $this->objectRepository->setConfigOption('eagerLoadToOne', false);\n $this->objectRepository->setConfigOption('eagerLoadToMany', false);\n\n $this->doTests();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A user can have multiple payouts
public function payouts() { return $this->hasMany(Payout::class); }
[ "public function payouts() : R {\n $url = $this->build([ 'user', 'payouts' ]);\n $resp = R::from($this->call($url, [], true));\n if($resp->status) {\n $resp->payouts = array_map(function($p) {\n return Payout::from($p);\n }, $resp->payouts);\n }\n return $resp;\n }", "public function payouts()\n {\n return $this->hasMany(Payment::class);\n }", "public function payouts()\n {\n return $this->morphMany(Payout::class, 'payoutable');\n }", "public function payouts() {\n\t\treturn $this->belongsTo('App\\Models\\Payouts', 'id', 'reservation_id');\n\t}", "public function a_user_check_out_more_than_one_book_at_time()\n {\n $book1 = factory(Book::class)->create();\n $book2 = factory(Book::class)->create();\n $user = factory(User::class)->create();\n\n $book1->checkout($user);\n $book2->checkout($user);\n\n $this->assertCount(2, Reservation::all());\n\n $this->assertEquals($book1->id, Reservation::find(1)->book_id);\n $this->assertEquals($user->id, Reservation::find(1)->user_id);\n $this->assertEquals($book2->id, Reservation::find(2)->book_id);\n $this->assertEquals($user->id, Reservation::find(2)->user_id);\n }", "public function actionCreatePayout() {\n\t\t$this->_processName = 'create_payout';\n\t\t$this->makeLockFile();\n\n\t\t$userService = $this->getService('User');\n\t\t$mnxService = $this->getService('Minexcoin');\n\t\t$payoutTxService = $this->getService('PayoutTransaction');\n\t\t$parkingService = $this->getService('Parking');\n\t\t$payoutService = $this->getService('Payout');\n\n\t\t$fatalError = false;\n\t\t$fatalErrorLock = 5;\n\t\t$usersCache = [];\n\t\t$cacheSize = 50;\n\n\t\t// Wait adjustment\n\t\t$minWaitTime = 1;\n\t\t$maxWaitTime = 10;\n\t\t$waitStep = 0.1;\n\t\t$waitIn = $minWaitTime;\n\n\t\twhile (!$fatalError) {\n\t\t\t$this->checkRunning();\n\n\t\t\t// Get parking with prepared transaction.\n\t\t\t/** @var \\app\\models\\Parking[] $parkings */\n\t\t\t$parkings = $parkingService->getActiveParkingsWithPreparedPayoutTx(1);\n\n\t\t\tif (count($parkings) == 0) {\n\t\t\t\t$waitIn=$maxWaitTime;\n\t\t\t\t$this->wait($waitIn);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($parkings as $parking) {\n\t\t\t\tif ($parking->expired > time()+($maxWaitTime+$minWaitTime)) {\n\t\t\t\t\t$this->wait($waitIn=$maxWaitTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ($parking->expired > time()) {\n\t\t\t\t\t$this->wait($waitIn=$minWaitTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\n\t\t\t\t// Control the cache size.\n\t\t\t\tif (count($usersCache) > $cacheSize)\n\t\t\t\t\tarray_shift($usersCache);\n\n\t\t\t\t// Find user.\n\t\t\t\tif (!isset($usersCache[$parking->user_id])) {\n\t\t\t\t\t$user = $userService->find('id = :uid', [':uid'=>$parking->user_id]);\n\t\t\t\t\tif ($user == null) continue;\n\t\t\t\t\t$usersCache[$parking->user_id] = $user;\n\t\t\t\t} else\n\t\t\t\t\t$user = $usersCache[$parking->user_id];\n\n\t\t\t\tif (!$this->isUserBalanceValid($user, $this->_payoutErrorLog)) {\n\t\t\t\t\t$parking->status = 0;\n\t\t\t\t\t$parking->save();\n\t\t\t\t\t$this->log($this->_payoutErrorLog, 'Parking was canceled: '.$parking->id);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$transaction = $payoutTxService->find('parking_id = :pid', [':pid'=>$parking->id]);\n\t\t\t\tif (!$transaction) {\n\t\t\t\t\t$this->logError($this->_payoutErrorLog, 'Prepared transaction not found [Parking id: '.$parking->id.']');\n\t\t\t\t\tif (--$fatalErrorLock < 1) $fatalError = true;\n\t\t\t\t\t$this->wait($waitIn=$minWaitTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$dbTransaction = Yii::$app->db->beginTransaction();\n\n\t\t\t\t// ----------------------------------------- Send transaction\n\t\t\t\t$txid = $mnxService->sendTransactionRemote($transaction->txid, $usersCache[$parking->user_id]->address);\n\t\t\t\tif ($txid['status'] == 0) {\n\t\t\t\t\t$this->logError($this->_payoutErrorLog, $this->getErrorFromResponse($txid, 'Cant send remote transaction'));\n\t\t\t\t\tif ($fatalErrorLock-- < 1) $fatalError = true;\n\t\t\t\t\t$dbTransaction->rollback();\n\t\t\t\t\t$this->wait($waitIn=$minWaitTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// ----------------------------------------- Create payout\n\t\t\t\t$payout = $payoutService->add($parking->id, $txid['data'], $parking->user_id, $parking->return_amount);\n\t\t\t\tif (!$payout) {\n\t\t\t\t\t$this->logError($this->_payoutErrorLog, 'Payout cant be added');\n\t\t\t\t\tif (--$fatalErrorLock < 1) $fatalError = true;\n\t\t\t\t\t$dbTransaction->rollback();\n\t\t\t\t\t$this->wait($waitIn=$minWaitTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// ----------------------------------------- Update parking\n\t\t\t\t$parking->status = 2;\n\t\t\t\tif (!$parking->save()) {\n\t\t\t\t\t$this->logError($this->_payoutErrorLog, 'Parking cant be updated: '.$parking->id);\n\t\t\t\t\tif (--$fatalErrorLock < 1) $fatalError = true;\n\t\t\t\t\t$dbTransaction->rollback();\n\t\t\t\t\t$this->wait($waitIn=$minWaitTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$dbTransaction->commit();\n\n\t\t\t\tprint(\"Transaction sent\\n\");\n\t\t\t\t$waitIn=$minWaitTime;\n\t\t\t}\n\t\t\t$fatalErrorLock = 5;\n\t\t}\n\n\t\tprint('Payout creator finished job'.\"\\n\");\n\t}", "public function payouts()\n {\n if (!isset($this->payouts)) {\n $this->payouts = new Services\\PayoutsService($this->http_client);\n }\n return $this->payouts;\n }", "function payout() {\r\n\r\n\t// Some globals needed.\r\n\tglobal $DB;\r\n\tglobal $TIMEMARK;\r\n\tglobal $MySelf;\r\n\tglobal $IGB;\r\n\tglobal $IGB_VISUAL;\r\n\r\n\t// Are we allowed to do this?\r\n\tif (!$MySelf->isAccountant()) {\r\n\t\tmakeNotice(\"You are not an accountant to your corporation. Access denied.\", \"error\", \"Access denied\");\r\n\t}\r\n\r\n\t/*\r\n\t * Amount of ISK owned.\r\n\t */\r\n\t$iskOwned = new table(2, true);\r\n\t$iskOwned->addHeader(\">> Outstanding ISK\");\r\n\r\n\t// Load all unique members from the database.\r\n\t$uniqeMembers = $DB->query(\"SELECT DISTINCT id FROM users WHERE deleted='0' ORDER BY username ASC\");\r\n\r\n\t// Create a row for each member.\r\n\twhile ($id = $uniqeMembers->fetchRow()) {\r\n\t\t$playerCreds = getCredits($id[id]);\r\n\r\n\t\t// We need this later on...\r\n\t\t$allPeeps[$id[id]] = ucfirst(idToUsername($id[id]));\r\n\r\n\t\t// if the member has more or less than zero isk, list him.\r\n\t\tif ($playerCreds != 0) {\r\n\t\t\t$iskOwned->addRow();\r\n\t\t\t$iskOwned->addCol(\"<a href=\\\"index.php?action=showTransactions&id=\" . $id[id] . \"\\\">\" . $allPeeps[$id[id]] . \"</a>\");\r\n\t\t\t$iskOwned->addCol(number_format($playerCreds, 2) . \" ISK\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Show the total isk owned.\r\n\t$outstanding = totalIskOwned();\r\n\t$iskOwned->addRow(\"#060622\");\r\n\t$iskOwned->addCol(\">> Total Outstanding ISK:\");\r\n\t$iskOwned->addCol(totalIskOwned() . \" ISK\");\r\n\r\n\t/*\r\n\t * Show a drop down menu to create a menu to see everyones transaction log.\r\n\t */\r\n\t$freeSelect = new table(2, true);\r\n\t$freeSelect->addHeader(\">> Lookup specific transaction log\");\r\n\r\n\t// Create a PDM for all the peoples.\t \r\n\tforeach ($allPeeps as $peep) {\r\n\t\t$pdm .= \"<option value=\\\"\" . array_search($peep, $allPeeps) . \"\\\">$peep</option>\";\r\n\t}\r\n\r\n\t$freeSelect->addRow();\r\n\t$freeSelect->addCol(\"Show log of \", array (\r\n\t\t\"align\" => \"right\"\r\n\t));\r\n\t$freeSelect->addCol(\"<select name=\\\"id\\\">$pdm</select>\");\r\n\t$freeSelect->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"Lookup log in Database\\\">\");\r\n\tunset ($pdm);\r\n\r\n\t/*\r\n\t * Show current requests\r\n\t */\r\n\r\n\t$requests = $DB->query(\"SELECT * FROM payoutRequests WHERE payoutTime IS NULL ORDER BY time DESC\");\r\n\r\n\tif ($IGB && $IGB_VISUAL) {\r\n\t\t$table = new table(6, true);\r\n\t} else {\r\n\t\t$table = new table(5, true);\r\n\t}\r\n\t$table->addHeader(\">> Pending payout requests\");\r\n\r\n\t$table->addRow(\"#060622\");\r\n\t$table->addCol(\"request\");\r\n\t$table->addCol(\"applicant\");\r\n\tif ($IGB && $IGB_VISUAL) {\r\n\t\t$table->addCol(\"right click menu\");\r\n\t}\r\n\t$table->addCol(\"time\");\r\n\t$table->addCol(\"amount\");\r\n\t$table->addCol(\"Payout\");\r\n\r\n\twhile ($request = $requests->fetchRow()) {\r\n\r\n\t\tif ($IGB && $IGB_VISUAL) {\r\n\t\t\t$api = new api($request[applicant]);\r\n//\t\t\t$profile = new profile($request[applicant]);\r\n\t\t\tif ($api->valid() && ($IGB && $IGB_VISUAL)) {\r\n\t\t\t\t$rcm = \" [<a href=\\\"showinfo:1378//\" . $api->getCharacterID() . \"\\\">RCM</a>]\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$table->addRow();\r\n\t\t$table->addCol(\"#\" . str_pad($request[request], \"5\", \"0\", STR_PAD_LEFT));\r\n\t\t$table->addCol(\"<a href=\\\"index.php?action=showTransactions&id=$request[applicant]\\\">\" . ucfirst(idToUsername($request[applicant])) . \"</a>\");\r\n\t\tif ($IGB && $IGB_VISUAL) {\r\n\t\t\t$table->addCol($rcm);\r\n\t\t}\r\n\t\t$table->addCol(date(\"d.m.y H:i:s\", $request[time]));\r\n\t\tif ($IGB && $IGB_VISUAL) {\r\n\t\t\t$table->addCol(\"<input type=\\\"text\\\" name=\\\"dumb\\\" readonly value=\\\"\" . number_format($request[amount], 2) . \"\\\"> ISK\");\r\n\t\t} else {\r\n\t\t\t$table->addCol(number_format($request[amount], 2) . \" ISK\");\r\n\t\t}\r\n\r\n\t\t// Can the user still cover his request with cash?\r\n\t\tif (getCredits($request[applicant]) >= $request[amount]) {\r\n\t\t\t$table->addCol(\"<input type=\\\"checkbox\\\" name=\\\"\" . $request[request] . \"\\\" value=\\\"true\\\">\");\r\n\t\t\t$haveRequest = true;\r\n\t\t} else {\r\n\t\t\t$table->addCol(\"<i>not enough ISK</i>\");\r\n\t\t}\r\n\t}\r\n\t$table->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"Mark as paid\\\">\");\r\n\r\n\t$funnyForm = \"<form action=\\\"index.php\\\" method=\\\"POST\\\">\";\r\n\t$funnyForm .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"true\\\">\";\r\n\t$funnyForm .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"payout\\\">\";\r\n\t$funnyForm .= $table->flush();\r\n\t$funnyForm .= \"</form>\";\r\n\r\n\t/*\r\n\t * Show fulfilled requests\r\n\t */\r\n\tif (is_numeric($_GET[page]) && $_GET[page] > 0) {\r\n\t\t$page = \"LIMIT \" . ($_GET[page] * 20) . \", 20\";\r\n\t}\r\n\telseif ($_GET[page] == \"all\") {\r\n\t\t$page = \"\";\r\n\t} else {\r\n\t\t$page = \"LIMIT 20\";\r\n\t}\r\n\r\n\t$requests = $DB->query(\"SELECT * FROM payoutRequests WHERE payoutTime IS NOT NULL ORDER BY time DESC $page\");\r\n\t$table_done = new table(6, true);\r\n\t$table_done->addHeader(\">> Fulfilled payout requests\");\r\n\r\n\t$table_done->addRow(\"#060622\");\r\n\t$table_done->addCol(\"request\");\r\n\t$table_done->addCol(\"applicant\");\r\n\t$table_done->addCol(\"time\");\r\n\t$table_done->addCol(\"amount\");\r\n\t$table_done->addCol(\"Payout time\");\r\n\t$table_done->addCol(\"Authorized by\");\r\n\r\n\twhile ($request = $requests->fetchRow()) {\r\n\t\t$table_done->addRow();\r\n\t\t$table_done->addCol(\"#\" . str_pad($request[request], \"5\", \"0\", STR_PAD_LEFT));\r\n\t\t$table_done->addCol(\"<a href=\\\"index.php?action=showTransactions&id=$request[applicant]\\\">\" . ucfirst(idToUsername($request[applicant])) . \"</a>\");\r\n\t\t$table_done->addCol(date(\"d.m.y H:i:s\", $request[time]));\r\n\t\t$table_done->addCol(number_format($request[amount], 2) . \" ISK\");\r\n\t\t$table_done->addCol(date(\"d.m.y H:i:s\", $request[payoutTime]));\r\n\t\t$table_done->addCol(ucfirst(idToUsername($request[banker])));\r\n\t\t$haveOldRequests = true;\r\n\t}\r\n\r\n\t// The \"show this many payouts\"-part.\r\n\t$count = $DB->getCol(\"SELECT COUNT(request) FROM payoutRequests WHERE payoutTime IS NOT NULL\");\r\n\t$countSteps = floor($count[0] / 20);\r\n\t$showMore = \"Switch to page >> \";\r\n\tfor ($i = 1; $i <= $countSteps; $i++) {\r\n\t\t$thisStep = str_pad($i, 2, \"0\", STR_PAD_LEFT);\r\n\t\t$showMore .= \"[<a href=\\\"index.php?action=payout&page=\" . $thisStep . \"\\\">\" . $thisStep . \"</a>] \";\r\n\t}\r\n\t$showMore .= \"[<a href=\\\"index.php?action=payout&page=all\\\">All</a>] \";\r\n\t$table_done->addHeader($showMore);\r\n\r\n\t$html = \"<h2>Manage Payouts</h2>\" . $iskOwned->flush() . \"<br><br>\";\r\n\t$html .= \"<form action=\\\"index.php\\\" method=\\\"GET\\\">\" . $freeSelect->flush() . \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"showTransactions\\\"></form><br>\";\r\n\r\n\tif ($haveRequest) {\r\n\t\t$html .= $funnyForm . \"<br>\";\r\n\t} else {\r\n\t\t$html .= \"<i>No open requests.</i><br><br>\";\r\n\t}\r\n\r\n\tif ($haveOldRequests) {\r\n\t\t$html .= $table_done->flush();\r\n\t} else {\r\n\t\t$html .= \"<br><i>No payouts at all.</i>\";\r\n\t}\r\n\r\n\treturn ($html);\r\n}", "public function checkouts()\n {\n return $this->belongsToMany(Checkout::class);\n }", "protected function _payOut($amount, $userId, $walletId, $banckAccountId) {\n $response = array(\n 'status' => FALSE,\n 'message' => trans('messages.common_error'),\n 'data' => '',\n 'mangopay_error' => ''\n );\n try {\n $amount = round($amount * Config::get('appConstants.poundToPence'),2);\n $payOut = new \\MangoPay\\PayOut();\n $payOut->AuthorId = $userId;\n $payOut->DebitedWalletID = $walletId;\n $payOut->DebitedFunds = new \\MangoPay\\Money();\n $payOut->DebitedFunds->Currency = \\Config::get('appConstants.currency');\n $payOut->DebitedFunds->Amount = $amount;\n $payOut->Fees = new \\MangoPay\\Money();\n $payOut->Fees->Currency = \\Config::get('appConstants.currency');\n $payOut->Fees->Amount = \\Config::get('appConstants.fee');\n $payOut->PaymentType = \\MangoPay\\PayOutPaymentType::BankWire;\n $payOut->MeanOfPaymentDetails = new \\MangoPay\\PayOutPaymentDetailsBankWire();\n $payOut->MeanOfPaymentDetails->BankAccountId = $banckAccountId;\n $payOut = $this->mangopay->PayOuts->Create($payOut);\n //Log::info('payOut:: payout Created Successfully');\n $response['status'] = TRUE;\n $response['message'] = trans('messages.success');\n $response['data'] = $payOut;\n } catch (\\MangoPay\\Libraries\\ResponseException $e) {\n //Log::error('_payOut:: Error' . $e->getMessage());\n $response['message'] = $e->getMessage();\n $response['mangopay_error'] = $e->GetErrorDetails();\n $errMsgLog = trans('messages.exception_manogopay') . __METHOD__. \"|\". $response['message'];\n CommonHelper::event($errMsgLog, CommonHelper::PAYMENT_PAYOUT_LOG_FILE, CommonHelper::DAILY);\n CommonHelper::event($e->GetErrorDetails(), CommonHelper::PAYMENT_PAYOUT_LOG_FILE, CommonHelper::DAILY);\n } catch (Exception $ex) {\n $response['message'] = $ex->getMessage();\n $errMsgLog = trans('messages.exception') . __METHOD__. \"|\". $ex->getMessage() . \"|\" . $ex->getFile() . \"|\" . $ex->getLine();\n CommonHelper::event($errMsgLog, CommonHelper::PAYMENT_PAYOUT_LOG_FILE, CommonHelper::DAILY);\n }\n return $response;\n }", "public function payoutAction()\n {\n $view = $this->getView();\n\n $prTable = $this->getModel()->get('PayoutRequests');\n\n // Grab stripe info\n Stripe::setApiKey($this->getConfig()['stripe_secret_key']);\n\n // Get our balance\n $balance = Balance::retrieve();\n\n $availableBalance = 0;\n $pendingBalance = 0;\n\n foreach($balance['available'] as $avail) {\n $availableBalance += $avail['amount'];\n }\n\n $view->availableBalance = $availableBalance / 100;\n\n foreach($balance['pending'] as $avail) {\n $pendingBalance += $avail['amount'];\n }\n\n $view->pendingBalance = $pendingBalance / 100;\n\n // Fetch all outstanding\n $prTable->setOrderBy('sd_payout_requests.id desc');\n\n $view->payouts = $prTable->fetchOutstandingRequests();\n\n // fetch all owed\n $view->owed = $this->getModel()->get('BalanceSheet')\n ->fetchOwedMoney();\n return $view;\n }", "public function checkouts()\n {\n return $this->hasMany('App\\Models\\Checkout');\n }", "public function getPayouts()\n {\n \t$latestPayouts = $this->helpers->getPayouts();\n \treturn view('admin.payouts', compact(['latestPayouts'])); \t\n }", "public function payout()\r\n\t{\r\n\t\t// Require valid user\r\n\t\t$this->management_model->require_valid_user();\r\n\r\n\t\tif ($this->_user->user_type != 4)\r\n\t\t{\r\n\t\t\t// Only administrators can see this page\r\n\t\t\tredirect('management');\r\n\t\t}\r\n\r\n\t\t// Initialize Dwolla model\r\n\t\t$this->dwolla_model->initialize();\r\n\r\n\t\t// Set validation error delimiters\r\n\t\t$this->form_validation->set_error_delimiters('', '');\r\n\r\n\t\t// Set validation rules\r\n\t\t$this->form_validation->set_rules('payout_models[]', 'Model Checkbox', 'required');\r\n\r\n\t\t// Data array to be used in views\r\n\t\t$data = array();\r\n\r\n\t\t// Run validation\r\n\t\tif ($this->form_validation->run() == TRUE)\r\n\t\t{\r\n\t\t\t$data['success'] = TRUE;\r\n\t\t\t$this->management_model->process_payout();\r\n\t\t}\r\n\r\n\t\t// Data array to be used in views\r\n\t\t$data['model_payout'] = $this->management_model->model_payout();\r\n\t\t$data['funds_available'] = $this->dwolla_model->balance();\r\n\r\n\t\t// Load views\r\n\t\t$this->load->view('templates/management/header', $data);\r\n\t\t$this->load->view('pages/management/manage/payout', $data);\r\n\t\t$this->load->view('templates/management/footer', $data);\r\n\t}", "final public function payoutCollection(): Contracts\\Collection\\Payout\n {\n return $this->uses('Collection.Payout', 'v4');\n }", "public function process_bulk_paypal_payout() {\n\n\t\tif( ! current_user_can( 'manage_referrals' ) ) {\n\t\t\twp_die( __( 'You do not have permission to process payments', 'affwp-paypal-payouts' ) );\n\t\t}\n\n\t\tif( ! affiliate_wp_paypal()->has_api_credentials() ) {\n\t\t\twp_die( __( 'Please enter your API credentials in Affiliates > Settings > PayPal Payouts before attempting to process payments', 'affwp-paypal-payouts' ) );\n\t\t}\n\n\t\t$start = ! empty( $_POST['from'] ) ? sanitize_text_field( $_POST['from'] ) : false;\n\t\t$end = ! empty( $_POST['to'] ) ? sanitize_text_field( $_POST['to'] ) : false;\n\n\t\t$args = array(\n\t\t\t'status' => 'unpaid',\n\t\t\t'date' => array(\n\t\t\t\t'start' => $start,\n\t\t\t\t'end' => $end\n\t\t\t),\n\t\t\t'number' => -1\n\t\t);\n\n\t\t//print_r( $args ); exit;\n\n\t\t// Final affiliate / referral data to be paid out\n\t\t$data = array();\n\n\t\t// The affiliates that have earnings to be paid\n\t\t$affiliates = array();\n\n\t\t// Retrieve the referrals from the database\n\t\t$referrals = affiliate_wp()->referrals->get_referrals( $args );\n\n\t\t// The minimum payout amount\n\t\t$minimum = ! empty( $_POST['minimum'] ) ? sanitize_text_field( affwp_sanitize_amount( $_POST['minimum'] ) ) : 0;\n\n\t\tif( $referrals ) {\n\n\t\t\tforeach( $referrals as $referral ) {\n\n\t\t\t\tif( in_array( $referral->affiliate_id, $affiliates ) ) {\n\n\t\t\t\t\t// Add the amount to an affiliate that already has a referral in the export\n\n\t\t\t\t\t$amount = $data[ $referral->affiliate_id ]['amount'] + $referral->amount;\n\n\t\t\t\t\t$data[ $referral->affiliate_id ]['amount'] = $amount;\n\t\t\t\t\t$data[ $referral->affiliate_id ]['referrals'][] = $referral->referral_id;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$email = affwp_get_affiliate_payment_email( $referral->affiliate_id );\n\n\t\t\t\t\t$data[ $referral->affiliate_id ] = array(\n\t\t\t\t\t\t'email' => $email,\n\t\t\t\t\t\t'amount' => $referral->amount,\n\t\t\t\t\t\t'currency' => ! empty( $referral->currency ) ? $referral->currency : affwp_get_currency(),\n\t\t\t\t\t\t'referrals' => array( $referral->referral_id ),\n\t\t\t\t\t);\n\n\t\t\t\t\t$affiliates[] = $referral->affiliate_id;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t$payouts = array();\n\n\t\t\t$i = 0;\n\t\t\tforeach( $data as $affiliate_id => $payout ) {\n\n\t\t\t\tif ( $minimum > 0 && $payout['amount'] < $minimum ) {\n\n\t\t\t\t\t// Ensure the minimum amount was reached\n\n\t\t\t\t\tunset( $data[ $affiliate_id ] );\n\n\t\t\t\t\t// Skip to the next affiliate\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\t$payouts[ $affiliate_id ] = array(\n\t\t\t\t\t'email' => $payout['email'],\n\t\t\t\t\t'amount' => $payout['amount'],\n\t\t\t\t\t'description' => sprintf( __( 'Payment for referrals between %s and %s from %s', 'affwp-paypal-payouts' ), $start, $end, home_url() ),\n\t\t\t\t\t'referrals' => $payout['referrals'],\n\t\t\t\t);\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$redirect = admin_url( 'admin.php?page=affiliate-wp-referrals&affwp_notice=paypal_bulk_pay_success' );\n\t\t\t$success = $this->api->send_bulk_payment( $payouts );\n\n\t\t\tif( is_wp_error( $success ) ) {\n\n\t\t\t\t$redirect .= '&affwp_notice=paypal_error&message=' . $success->get_error_message() . '&code=' . $success->get_error_code();\n\n\t\t\t} else {\n\n\t\t\t\t// We now know which referrals should be marked as paid\n\t\t\t\tforeach ( $payouts as $affiliate_id => $payout ) {\n\t\t\t\t\tif ( function_exists( 'affwp_add_payout' ) ) {\n\t\t\t\t\t\taffwp_add_payout( array(\n\t\t\t\t\t\t\t'affiliate_id' => $affiliate_id,\n\t\t\t\t\t\t\t'referrals' => $payout['referrals'],\n\t\t\t\t\t\t\t'amount' => $payout['amount'],\n\t\t\t\t\t\t\t'payout_method' => 'PayPal'\n\t\t\t\t\t\t) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach ( $payout['referrals'] as $referral ) {\n\t\t\t\t\t\t\taffwp_set_referral_status( $referral, 'paid' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// A header is used here instead of wp_redirect() due to the esc_url() bug that removes [] from URLs\n\t\t\theader( 'Location:' . $redirect ); exit;\n\n\t\t}\n\n\t}", "public function getCheckouts()\n {\n return $this->hasMany(Checkout::className(), ['order_id' => 'id']);\n }", "public function vendor_payouts() {\n\t\t$wp_list_table = _get_list_table('WP_Posts_List_Table');\n\t\t$action = $wp_list_table->current_action();\n\t\tif( 'mp_payout' != $action )\n\t\t\treturn;\n\t\n\t\tif( !isset($_REQUEST['id']) || !$_REQUEST['id'] || !is_array($_REQUEST['id']) )\n\t\t\treturn;\n\t\n\t\t/** Failed payouts can only be retried once **/\n\t\tif( !empty( $_REQUEST['mp_initial_transaction'] ) ) {\n\t\t\t$ressource_id = $_REQUEST['mp_initial_transaction'];\n\t\t\t$mp_ignored_failed_po = get_option( 'mp_ignored_failed_po', array() );\n\t\t\tif( in_array( $ressource_id, $mp_ignored_failed_po ) ) {\n\t\t\t\techo '<div class=\"error\">';\n\t\t\t\techo '<p>' . __( '-Error: this commission payout has already been retried:', 'mangopay' ) . ' ' .\n\t\t\t\t\t\t'#' . $ressource_id . '.</p>';\n\t\t\t\techo '</div>';\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\n\t\techo '<div class=\"updated\">';\n\t\techo '<p>' . __( 'Paying selected vendors...', 'mangopay' ) . '</p>';\n\t\techo '</div>';\n\t\n\t\t$commission_ids = $_REQUEST['id'];\n\t\tforeach( $commission_ids as $pv_commission_id ) {\n\t\n\t\t\t/**\n\t\t\t * The bulk action id parameter refers to an entry of WV's\n\t\t\t * custom pv_commission table.\n\t\t\t * We must query this table to get order and vendor info\n\t\t\t * @see /plugins/wc-vendors/classes/class-commission.php\n\t\t\t *\n\t\t\t */\n\t\t\tglobal $wpdb;\n\t\t\t$table_name = $wpdb->prefix . mangopayWCConfig::WV_TABLE_NAME;\n\t\t\t$query = \"\n\t\t\tSELECT product_id, order_id, vendor_id, status, total_due\n\t\t\tFROM `{$table_name}`\n\t\t\tWHERE id = %d;\n\t\t\t\";\n\t\t\t$query = $wpdb->prepare( $query, $pv_commission_id );\n\t\t\tif( $row = $wpdb->get_row( $query ) ) {\n\t\t\t$wp_user_id = $row->vendor_id;\n\t\t\t} else {\n\t\t\techo '<div class=\"error\">';\n\t\t\t\techo '<p>' . __( '-Error: bad wc-vendors commission ID:', 'mangopay' ) . ' ' .\n\t\t\t\t\t\t\t'#' . $pv_commission_id . '.</p>';\n\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$vendor_info\t= get_userdata( $wp_user_id );\n\t\t\t$pv_shop_name\t= get_user_meta( $wp_user_id, 'pv_shop_name', true );\n\t\t\t\t\tif( !$pv_shop_name )\n\t\t\t\t$pv_shop_name = $vendor_info->display_name;\n\t\t\t\t$admin_link\t\t= 'user-edit.php?user_id=' . $wp_user_id;\n\t\t\t\t\t\n\t\t\t\tif(\n\t\t\t'due' != $row->status &&\n\t\t\tempty( $_REQUEST['mp_initial_transaction'] )\n\t\t\t) {\n\t\t\t\t//TODO: translation string to convert as sprintf %s...\n\t\t\t\t\techo '<div class=\"updated\">';\n\t\t\t\techo '<p>' . __( '-Commission of', 'mangopay' ) . ' ' . $pv_shop_name . ' ' .\n\t\t\t\t\t__( 'on order', 'mangopay' ) . ' ' . $row->order_id . ' ' .\n\t\t\t\t\t\t\t__( 'is already marked as', 'mangopay' ) . ' ' . $row->status . '. ' .\n\t\t\t\t\t\t\t\t\t__( 'Skipping.', 'mangopay' ) . '</p>';\n\t\t\t\techo '</div>';\n\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t/** We store a different mp_account_id for production and sandbox environments **/\n\t\t\t$umeta_key = 'mp_account_id';\n\t\t\tif( !$this->mp->is_production() )\n\t\t\t$umeta_key .= '_sandbox';\n\t\t\tif( !$mp_account_id = get_user_meta( $wp_user_id, $umeta_key, true ) ) {\n\t\t\t//TODO: translation string to convert as sprintf %s...\n\t\t\t\techo '<div class=\"error\">';\n\t\t\t\techo '<p>' . __( '-Warning: vendor', 'mangopay' ) . ' ' .\n\t\t\t\t\t'<a href=\"' . $admin_link . '\">&laquo;' . $pv_shop_name . '&raquo;</a> ' .\n\t\t\t\t\t\t'(#' . $wp_user_id . ') ' .\n\t\t\t\t\t\t__( 'does not have a MANGOPAY bank account', 'mangopay' ) . '</p>';\n\t\t\t\t\t\t\t\techo '</div>';\n\t\n\t\t\t} else {\n\t\n\t\t\t\t/**\n\t\t\t\t * Initiate MP payout transaction\n\t\t\t \t * @see: https://github.com/Mangopay/mangopay2-php-sdk/blob/master/demos/workflow/scripts/payout.php\n\t\t\t \t *\n\t\t\t \t */\n\t\t\t \t$order_id\t= $row->order_id;\n\t\t\t \t$currency\t= get_woocommerce_currency();\n\t\t\t \t$total_due\t= $row->total_due;\n\t\t\t \t$fees\t\t= 0;\n\t\t\t \t$result = $this->mp->payout( $wp_user_id, $mp_account_id, $order_id, $currency, $total_due, $fees );\n\n\t\t\t \tif(\n\t\t \t\t\tisset( $result->Status ) &&\n\t\t \t\t\t( 'SUCCEEDED' == $result->Status || 'CREATED' == $result->Status )\n\t\t \t\t) {\n\t\t\t \t\t//TODO: translation string to convert as sprintf %s...\n\t\t\t \t\t$this->mangopayWCMain->set_commission_paid( $pv_commission_id );\n\t\t\t \t\techo '<div class=\"updated\">';\n\t\t\t\t\techo '<p>' . __( '-Success: commission paid to vendor', 'mangopay' ) . ' ' .\n\t\t\t\t\t'<a href=\"' . $admin_link . '\">&laquo;' . $pv_shop_name . '&raquo;</a> ' .\n\t\t\t\t\t'</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\n\t\t\t\t } else {\n\t\t\t\t \t//TODO: translation string to convert as sprintf %s...\n\t\t\t\t \techo '<div class=\"error\">';\n\t\t\t\t\techo '<p>' . __( '-Error: vendor', 'mangopay' ) . ' ' .\n\t\t\t\t\t\t\t'<a href=\"' . $admin_link . '\">&laquo;' . $pv_shop_name . '&raquo;</a> ' .\n\t \t\t\t\t\t\t'(#' . $wp_user_id . ') ' .\n\t \t\t\t\t\t\t__( 'MANGOPAY payout transaction failed', 'mangopay' ) . '</p>';\n\t\t\t\t\tif( $result->ResultMessage )\n\t\t\t\t\t\techo '<p>' . $result->ResultMessage . '</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\n \t\t\t\t} //endif\n\n \t\t\t\t/**\n \t\t\t\t * If this is a failed payout retry from the dashboard widget,\n \t\t\t\t * hide the original transaction\n \t\t\t\t *\n \t\t\t\t */\n\t\t\t\tif( !empty( $_REQUEST['mp_initial_transaction'] ) ) {\n\t\t\t\t\t$ressource_id = $_REQUEST['mp_initial_transaction'];\n\t\t\t\t\t$mp_ignored_failed_po = get_option( 'mp_ignored_failed_po', array() );\n\t\t\t\t\tif( $ressource_id && !in_array( $ressource_id, $mp_ignored_failed_po ) ) {\n\t\t\t\t\t\t$mp_ignored_failed_po[] = $ressource_id;\n\t\t\t\t\t\tupdate_option( 'mp_ignored_failed_po', $mp_ignored_failed_po );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} //endif\n\t\t\n\t\t} //endforeach\n\n\t}", "public function testPayoutsMatchesExpectedResult()\n {\n $map = $this->spin->getPayouts();\n\n $this->assertEquals(count($map), 2);\n\n $this->assertArrayHasKey('paylines', $map);\n $this->assertArrayHasKey('total_win', $map);\n\n $this->assertEquals(count($map['paylines']), 2);\n $this->assertArrayHasKey('0,3,6,9,12', $map['paylines']);\n $this->assertArrayHasKey('0,4,8,10,12', $map['paylines']);\n\n $this->assertEquals($map['paylines']['0,3,6,9,12'], 3);\n $this->assertEquals($map['paylines']['0,4,8,10,12'], 3);\n $this->assertEquals($map['total_win'], 40);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set request's module, controller and action to the values provided, and set the request as not dispatched if any of them differ from the existing values.
public function apply(Zend_Controller_Request_Abstract $request) { $changed = false; if (($action = $this->getAction()) && ($action != $request->getActionName())) { $request->setActionName($action); $changed = true; } if (($controller = $this->getController()) && ($controller != $request->getControllerName())) { $request->setControllerName($controller); $changed = true; } if (($module = $this->getModule()) && ($module != $request->getModuleName())) { $request->setModuleName($module); $changed = true; } if ($changed) { $request->setDispatched(false); } }
[ "public function testOtherActionDetectors(): void\n {\n $actions = ['add', 'edit', 'view', 'index', 'delete'];\n foreach ($actions as $currentAction) {\n $this->Request = $this->Request->withParam('action', $currentAction);\n $this->Request->clearDetectorCache();\n $this->assertTrue($this->Request->is($currentAction));\n\n //With right controller\n $this->Request->clearDetectorCache();\n $this->assertTrue($this->Request->is($currentAction, 'myController'));\n\n //With bad controller\n $this->Request->clearDetectorCache();\n $this->assertFalse($this->Request->is($currentAction, 'notMyController'));\n\n $otherActions = array_diff($actions, [$currentAction]);\n foreach ($otherActions as $otherAction) {\n $this->Request->clearDetectorCache();\n $this->Request = $this->Request->withParam('action', $otherAction);\n $this->assertFalse($this->Request->is($currentAction));\n }\n }\n }", "public function forward($request, $action, $controller = null, $module = null, array $params = null)\n {\n if ($params !== null)\n {\n $request->setParams($params);\n }\n if ($controller !== null)\n {\n $request->setControllerName($controller);\n if ($module !== null)\n {\n $request->setModuleName($module);\n }\n }\n\n $request->setActionName($action)->setDispatched(false);\n }", "protected function _setRequestKeys()\n {\n if (null !== $this->_request) {\n $this->_moduleKey = $this->_request->getModuleKey();\n $this->_controllerKey = $this->_request->getControllerKey();\n $this->_actionKey = $this->_request->getActionKey();\n }\n\n if (null !== $this->_dispatcher) {\n $this->_defaults += array(\n $this->_controllerKey => $this->_dispatcher->getDefaultControllerName(),\n $this->_actionKey => $this->_dispatcher->getDefaultAction(),\n $this->_moduleKey => $this->_dispatcher->getDefaultModule()\n );\n }\n\n $this->_keysSet = true;\n }", "public function testInvokeActionMissingRequest()\n {\n $this->action->request = null;\n $this->action->invokeAction();\n }", "public function setRequestaction($action) {\r\n\t\t$this->requestaction = $action;\r\n\t}", "public static function setRequestComponents($data = array())\n {\n if (isset($data['controller'])) self::$controller = $data['controller'];\n if (isset($data['action'])) self::$action = $data['action'];\n if (isset($data['module'])) self::$module = $data['module'];\n }", "protected function setRequestAction($value)\n {\n $this->requestAction = $value;\n }", "public static function setRequest($request){}", "private function ensureRequestSet()\n {\n if (null === $this->request) {\n $request = $this->requestStack->getMainRequest();\n if (null !== $request) {\n $this->requestRoute = $request->get('_route');\n $this->helpAnnotation = null;\n $this->request = $request;\n }\n }\n }", "public function testBeforeDispatchSetsParameters()\n {\n Router::connect('/:controller/:action/*');\n $filter = new RoutingFilter();\n\n $request = new Request(\"/testcontroller/testaction/params1/params2/params3\");\n $event = new Event(__CLASS__, $this, compact('request'));\n $filter->beforeDispatch($event);\n\n $this->assertSame($request->params['controller'], 'testcontroller');\n $this->assertSame($request->params['action'], 'testaction');\n $this->assertSame($request->params['pass'][0], 'params1');\n $this->assertSame($request->params['pass'][1], 'params2');\n $this->assertSame($request->params['pass'][2], 'params3');\n $this->assertFalse(!empty($request['form']));\n }", "protected function setRequestVariables()\n {\n $this->action = filter_input(INPUT_POST, 'action');\n \n if(isset($this->uri[1]))\n $this->urlAction = $this->uri[1];\n else\n $this->urlAction = '';\n \n $this->message = filter_input(INPUT_POST, 'message');\n }", "private function setControllerAction () {\n \n // Parse url. 2 cases:\n // a) Default controller\n // b) Module controller \n\n \n // Get all modules\n $mod_path = conf::pathBase() . \"/\" . $this->modules;\n $mods = file::getDirsGlob($mod_path, array ('basename' => true));\n $base = direct::fragment(0);\n \n if (!in_array($base, $mods)) {\n \n // Could not find a controller / module \n $this->controller = $this->default;\n $action = direct::fragment(0);\n if ($action) {\n $this->action = $action; \n }\n \n } else {\n \n // Found a controller / module\n $this->controller = $base;\n $action = direct::fragment(1);\n if ($action) {\n $this->action = $action;\n }\n }\n \n \n }", "private function setAction()\n {\n $action = $this->request->getGetParameter ( TMConfig::get(\"action\", \"key\") );\n $this->actionName = strtolower ( $action );\n }", "protected static function set_current_request($request) {\n\t\t\t\n\t\t\tif(isset($request['action']) and is_string($request['action']) and isset($request['method']) and is_string($request['method']) and isset($request['params']) and is_array($request['params'])) {\n\t\t\t\n\t\t\t\tself::$current_request = $request;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "protected static function set_current_request_action($request_action) {\n\t\t\t\n\t\t\tif(is_string($request_action)) {\n\t\t\t\t\n\t\t\t\tself::$current_request['action'] = $request_action;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function setRequest($request);", "private function analyseRequestAndSetVars() {\n $this->extractControllerName();\n $this->extractControllerPathAndMethod();\n }", "public function notRequireAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get form id\r\n \t\t */\r\n \t\t$form_id = $this->getAttribute('form_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * get set_id\r\n \t\t */\r\n \t\t$set_id = $this->getAttribute('set_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * get form entry id\r\n \t\t */\r\n \t\t$form_entry_id = $this->getAttribute('form_entry_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * set as non display\r\n \t\t */\r\n \t\t$this->wpcms->requireChange($form_entry_id, 0, 'form_entry_tab');\t\t\r\n \t\t\r\n \t\t/**\r\n \t\t * page redirect list\r\n \t\t */\r\n \t\t$url_array = array(\r\n \t\t\t'form_set', 'index',\r\n \t\t\t'form_id',\tmake_id($form_id),\r\n \t\t\t//'set_id',\tmake_id($set_id),\r\n \t\t);\r\n \t\t$url = $this->makeUrl($url_array);\r\n \t\t$this->redirect($url);\r\n \t\t\r\n \t}", "public function denyAccess()\n {\n $this->_request->setModuleName($this->_errorPage['module']);\n $this->_request->setControllerName($this->_errorPage['controller']);\n $this->_request->setActionName($this->_errorPage['action']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hydrate a category from a stdClass, intended to be used for instancing a category from json_decode()
public static function fromStdClass(\stdClass $stdClass) { $category = new Category(); $category->id = $stdClass->id; $category->name = $stdClass->name; $category->dataProviderId = (int)$stdClass->dataProviderId; // might not be set in JSON if (isset($stdClass->parentId)) { $category->parentId = (int)$stdClass->parentId; } $category->updatedAt = new \DateTime($stdClass->updatedAt); $category->createdAt = new \DateTime($stdClass->createdAt); return $category; }
[ "private function getCategoryDataObject($category)\n {\n $obj = $this->objectFactory->create();\n if (isset($category['Id'])) {\n $obj->setData($category);\n }\n return $obj;\n }", "static function categoryToObject(SimpleXMLElement $category){\n $childs = array();\n $object = new SocietyCategory();\n $object->setFormerId(self::convertXmlDataToSpunqType($category->id));\n $object->setName(self::convertXmlDataToSpunqType($category->name));\n if($category->childrens){\n $childrens = $category->childrens->children();\n foreach($childrens as $child){\n $childs[] = self::categoryToObject($child);\n }\n }\n if($childs){\n $object->setChildrens($childs);\n }\n return $object;\n }", "protected function buildDomainObject($row) {\n $category = new Category();\n $category->setId($row['cat_id']);\n $category->setName($row['cat_name']);\n return $category;\n }", "public static final function GetPornCategoryObj($data) {\n\t\tif ($data instanceof stdClass ) {\n\t\t\t$data = (array)$data;\n\t\t}\n\t\treturn new porncategoryObj(array($data['id'], $data['name']));\n\t}", "public function prepareCategory($request, $object = null) {\n\n $prepare = $this->entity;\n if($object != null) {\n $prepare = $object;\n }\n\n return $prepare->setName($request['zing_category_name'])\n ->setStatus($request['zing_category_status'])\n ->setDateModified(time());\n\n }", "protected function buildDomainObject($row) {\n $categorie = new Categorie();\n $categorie->setId($row['id_categories']);\n $categorie->setName($row['nom_categories']);\n $categorie->setStatut($row['status']);\n return $categorie;\n }", "function _make_cat_compat(&$category)\n{\n}", "private function _prepareCategory($category) {\n\n\t\tif (isset($this->_categories[$category->getId()]))\n\t\t{\n\t\t\treturn $this->_categories[$category->getId()];\n\t\t}\n\n\t\t$arrCategory = $category->getData();\n\n\t\tif ( ! ($category->getId() > 1 && isset($arrCategory['name']) && isset($arrCategory['level'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$arrCategory['count'] = 1;\n\t\t$arrCategory['name'] = str_repeat('- ', max(0, $arrCategory['level'] - 1)) . $arrCategory['name'];\n\t\t$arrCategory['cat_ID'] = $category->getId();\n\t\t$arrCategory['term_id'] = $category->getId();\n\t\t$arrCategory['url'] = $category->getUrl($category);\n\n\t\t$this->_categories[$category->getId()] = $arrCategory;\n\n\t\treturn $arrCategory;\n\t}", "public static function\n// \t\tconv_DB_2_Category($row) {\n\t\tconv_DB_2_Category($smarty, $row) {\n\n\t\t\t$category = new Category();\n\n\t\t\t$category\n\t\t\t\t\t->set_db_Id($row[0])\n\t\t\t\t\t->set_created_at($row[1])\n\t\t\t\t\t->set_updated_at($row[2])\n\t\t\t\t\t->set_name($row[3])\n\t\t\t\t\t\n\t\t\t\t\t->set_genre_id($row[4])\n\t\t\t\t\t->set_original_id($row[5])\n\t\t\t;\n\t\t\t\t\n\t\t\t/*******************************\n\t\t\t\treturn\n\t\t\t*******************************/\n\t\t\treturn $category;\n\t\t\t\n\t\t}", "public function getCategoryById($id);", "function category_metadata(&$category){\n\n\t# We already decoded this. Nothing to do here!\n\tif(is_array($category->description)) return $category->description;\n\n\n\t# Description didn't appear to be JSON; assign the description string to a value and return an associative array.\n\tif(!($json = @json_decode($category->description, TRUE)))\n\t\treturn array('description' => $category->description);\n\n\n\t# Replace each attachment ID with an actual, interactive image object.\n\tif(is_array($images = $json['images'])){\n\n\t\tforeach($images as $key => $value)\n\t\t\tif(is_numeric($value)){\n\t\t\t\t$images[$key] = array_merge(\n\t\t\t\t\tarray('ID' => $value),\n\t\t\t\t\twp_get_attachment_metadata($value)\n\t\t\t\t);\n\t\t\t}\n\n\t\t$json['images'] = $images;\n\t}\n\n\t# Store the decoded result on the category object.\n\t$category->description =& $json;\n\treturn $json;\n}", "protected static function convertRowToObject($databaseRow) {\r\n return new Category($databaseRow['categorieID'], $databaseRow['naam']);\r\n }", "public function create()\n {\n /**\n * @var Category $category\n */\n $classNamespace = $this->getEntityNamespace();\n $category = new $classNamespace();\n $category\n ->setSubcategories(new ArrayCollection())\n ->setRoot(true)\n ->setPosition(0)\n ->setEnabled(true)\n ->setCreatedAt($this->now());\n\n return $category;\n }", "public function getCategoria (int $id){\n\n $this->conexao = Conexao::getConexao();\n $sql= \"select * from categoria where id_categoria=\".$id;\n $result = $this->conexao-> query($sql);\n $categoria = $result->fetch(PDO::FETCH_ASSOC);\n $objCat = new Categoria($categoria['id_categoria'], $categoria['nome_categoria'], $categoria['descricao_categoria'] );\n return $objCat;\n }", "function prepareCategory($products) {\n foreach($products as $key => $product) {\n $categories = [];\n foreach($product['categories'] as $catCode)\n $categories[] = $this->find($catCode);\n $products[$key]['categories'] = $categories;\n }\n return $products;\n}", "private function setCategory()\n {\n /** @var xPDOSimpleObject $category */\n $category = $this->modx->newObject('modCategory');\n $category->set('id', 1);\n $category->set('category', $this->config['PKG_NAME']);\n return $category;\n }", "public function testGenerateResponseForCertainCategory() {\n\n\t\t// TODO: make helper function for this 4 lines:\n\t\t$jao = new kwd_jsonapi_test();\n\t\t$jao->setApiQueryString('api=categories/3');\n\t\t$response = $jao->buildResponse();\n\t\t$json = json_decode($response);\n\n\t\t$this->assertSame($json->name,'Referenzen');\n\t\t$this->assertSame($json->id,3);\n\t\t// ! categories now contains sub catgeories of category 3\n\t\t$this->assertTrue(isset($json->categories),'No entry \"categories\"');\n\t\t$this->assertTrue(is_array($json->categories),'\"categories\" is not an array');\n\t\t$definedKids = 3;\n\t\t$this->assertEquals($definedKids,count($json->categories),\"defined $definedKids sub cats online (cat id == 3)\");\n\n\t\t// sample: 3rd kid\n\t\t$cat1 = $json->categories[2];\n\t\t$this->assertEquals($cat1->name,'Moldt Events','Name of 3rd sub category'); // ! now name, not title\n\t\t$this->assertEquals($cat1->id,13,'id of 3rd sub category');\n\t\t$this->assertTrue(!isset($cat1->prior),'!isset: we want NOT prior defined because categories always given by prio');\n\n\t\t// // article of 2nd cat must NOT be present\n\t\t$this->assertFalse(isset($cat1->articles),'field \"articles\" must NOT be in this repsonse');\n\t}", "private function recreateCategory(): void\n {\n $this->category = $this->categoryFactory->create();\n $this->category->load(2);\n }", "public function getApiObject($category, $locale)\n {\n if ($category instanceof CategoryWrapper) {\n $category = $category->getEntity();\n }\n if (!$category instanceof CategoryInterface) {\n return;\n }\n\n return new CategoryWrapper($category, $locale);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper method used to retrieve the name of a permission based on the id
public function getPermission($id){ $permissionName = Permission::whereId($id)->firstOrFail()->name; return $permissionName; }
[ "public function getPermissionName();", "public function getPermissionForId($id);", "public function getPermissionName()\n {\n if (array_key_exists(\"permissionName\", $this->_propDict)) {\n return $this->_propDict[\"permissionName\"];\n } else {\n return null;\n }\n }", "public function permissionGetNameById($permid)\r\n {\r\n foreach($this->permissionList() as $name => $perm)\r\n {\r\n if($perm[\"permid\"] == $permid) return new TeamSpeak3_Helper_String($name);\r\n }\r\n\r\n throw new TeamSpeak3_Adapter_ServerQuery_Exception(\"invalid permission ID\", 0xA02);\r\n }", "private function getPermissionById($id)\n {\n return $this->permissions()->getRelated()->where('id', $id)->first();\n }", "public function __toString()\n {\n return $this->getPermissionName();\n }", "public function getPermission($name);", "protected function getPermissionName()\n {\n $permission = 'ull_tabletool_ull_clone_user';\n \n return $permission;\n }", "function fetch_permission_name($variable = '')\n{\n global $ilance, $myapi;\n \n $result = '';\n $query = $ilance->db->query(\"\n SELECT accesstext_\" . $_SESSION['ilancedata']['user']['slng'] . \" AS text, accessdescription_\" . $_SESSION['ilancedata']['user']['slng'] . \" AS description\n FROM \" . DB_PREFIX . \"subscription_permissions\n WHERE accessname = '\" . $ilance->db->escape_string($variable) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($query) > 0)\n {\n $result = $ilance->db->fetch_array($query, DB_ASSOC);\n }\n \n return $result;\n}", "public function getAccessName();", "function get_role_name($role_id = 1) {\n if ($role_id > 0) {\n return 'admin'; //should come from database\n }\n return '';\n }", "public static function find_role_name($id){\n return self::$_role[$id];\n }", "public function name($id) {\r\n $result = $this->db->select(\"SELECT `role` FROM `as_user_roles` WHERE `role_id` = :id\", array( 'id' => $id ));\r\n if ( count ( $result ) > 0 )\r\n return $result[0]['role_id'];\r\n else\r\n return null;\r\n }", "function redaxo_addon_permission_name(string $permission = ''): string\n {\n return app('redaxo.addon.name') . '[' . $permission . ']';\n }", "public function permissionFetchById($permission_id);", "function getMyPermissionWithID( $id = false )\r\n {\r\n if ( $id === false )\r\n {\r\n throw new Exception( __METHOD__.\" error, invalid parameter given!\" );\r\n }\r\n \r\n if ( is_numeric( $id ) )\r\n { \r\n foreach( $this->permissions as $permObj )\r\n { \r\n if ( is_object($permObj) && $permObj->getId() == $id )\r\n {\r\n return $permObj;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n foreach( $this->permissions as $permObj )\r\n { \r\n if ( $permObj->getName() == $id )\r\n {\r\n return $permObj;\r\n }\r\n } \r\n }\r\n \r\n return false;\r\n }", "function permissionName($action, $nodename=\"\", $modulename=\"\")\n {\n $keys = array(\n 'permission_'.$modulename.'_'.$nodename.'_'.$action,\n 'action_'.$modulename.'_'.$nodename.'_'.$action,\n 'permission_'.$nodename.'_'.$action,\n 'action_'.$nodename.'_'.$action,\n 'permission_'.$action,\n 'action_'.$action,\n $action\n );\n \n $label = $this->text($keys);\n return $label;\n }", "function get_role_name($role_id)\n{\n\tglobal $conn;\n\t$stmt = $conn->prepare('SELECT description FROM tbl_role WHERE role_id = :role');\n\t$stmt->bindValue(':role', $role_id);\n\treturn execute_fetch_param($stmt, 'description');\n}", "public function getPermissionId($permissionName);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get PanelA, which includes panel title and content only.
private function getPanelA($panelTitle, $panelContent) { /* * Panel Head */ $panelHead = ''; $panelHead = $panelHead . '<div class="panel panel-default">' . "\r\n"; $panelHead = $panelHead . ' <div class="panel-heading">' . "\r\n"; $panelHead = $panelHead . ' <h3 class="panel-title">' . $panelTitle . '</h3>' . "\r\n"; $panelHead = $panelHead . ' </div>' . "\r\n"; /* * Panel Body */ $panelBody = ''; $panelBody = $panelBody . ' <div class="panel-body bg-info">' . $panelContent . '</div>' . "\r\n"; /* * Panel Foot */ $panelFoot = ''; $panelFoot = $panelFoot . '</div>' . "\r\n"; /* * Return PanelB full HTML content. */ return $panelHead . $panelBody . $panelFoot; }
[ "public function getPanel()\n\t{\n\t\t$panel = new Panels($this->tab, $this->tab_id, $this->forms);\n\n\t\treturn $panel;\n\t}", "public function getPanel()\n {\n return $this->panel;\n }", "public function getPanel() {\n\t\treturn $this->panel;\n\t}", "public function getPanelContent()\n {\n return null;\n }", "public function addPanel():Panel {\r\n\t\t$panel = new Panel();\r\n\t\t$this->addElement($panel);\r\n\t\treturn $panel;\r\n\t}", "private function getPanelD($panelTitle, $panelContents) {\r\n\t\t/*\r\n\t\t * Panel Head\r\n\t\t */\r\n\t\t$panelHead = '';\r\n\t\t$panelHead = $panelHead . '<div class=\"panel panel-default\">' . \"\\r\\n\";\r\n\t\t$panelHead = $panelHead . ' <div class=\"panel-heading\">' . \"\\r\\n\";\r\n\t\t$panelHead = $panelHead . ' <h3 class=\"panel-title\">' . $panelTitle . '</h3>' . \"\\r\\n\";\r\n\t\t$panelHead = $panelHead . ' </div>' . \"\\r\\n\";\r\n\t\t\r\n\t\t/*\r\n\t\t * Panel Foot\r\n\t\t */\r\n\t\t$panelFoot = '';\r\n\t\t$panelFoot = $panelFoot . '</div>' . \"\\r\\n\";\r\n\t\t\r\n\t\t/*\r\n\t\t * Panel Body\r\n\t\t * Open PanelBody div tag\r\n\t\t */\r\n\t\t$panelBody = '';\r\n\t\t$panelBody = $panelBody . '<div class=\"panel-body\">' . \"\\r\\n\";\r\n\t\t\r\n\t\tif (is_array ( $panelContents )) {\r\n\t\t\t\r\n\t\t\t$rowCountNumber = count ( $panelContents, COUNT_NORMAL );\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rowCountNumber; $i ++) {\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * Open row div tag\r\n\t\t\t\t */\r\n\t\t\t\t$panelBody = $panelBody . '<div class=\"row\">' . \"\\r\\n\";\r\n\t\t\t\t\r\n\t\t\t\tif (is_array ( $panelContents [$i] )) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$columnCountNumber = count ( $panelContents [$i], COUNT_NORMAL );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($columnCountNumber != 4) {\r\n\t\t\t\t\t\t// not four-columns\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$column0Content = $panelContents [$i] [0];\r\n\t\t\t\t\t\t$column1Content = $panelContents [$i] [1];\r\n\t\t\t\t\t\t$column2Content = $panelContents [$i] [2];\r\n\t\t\t\t\t\t$column3Content = $panelContents [$i] [3];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-2 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . ' <label class=\"control-label\" for=\"countryName\">' . $column0Content . '</label>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-4 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '\t <div class=\"input-group\">' . $column1Content . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-2 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . ' <label class=\"control-label\" for=\"countryName\">' . $column2Content . '</label>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-4 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '\t <div class=\"input-group\">' . $column3Content . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// $panelContents [i] is not an array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * Close row div tag\r\n\t\t\t\t */\r\n\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// $panelContents is not an array\r\n\t\t\t$panelBody = $panelBody . '<div class=\"row\">' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . ' <div class=\"col-md-12 form-group\">' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . ' <label class=\"control-label\" for=\"countryName\">There is not any content</label>' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . ' </div>' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Close PanelBody div tag\r\n\t\t */\r\n\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\r\n\t\t/*\r\n\t\t * Return PanelD full HTML content.\r\n\t\t */\r\n\t\treturn $panelHead . $panelBody . $panelFoot;\r\n\t}", "public function newPanel() {\n $panel = new Panel();\n return $panel;\n }", "public function getPanel ()\n {\n ob_start();\n if (is_file(BOOTSTRAP_DIR . '/tracy/assets/Bar/smarty.panel.phtml')) {\n $smarty = $this->smarty;\n require BOOTSTRAP_DIR . '/tracy/assets/Bar/smarty.panel.phtml';\n }\n\n return ob_get_clean();\n }", "public function getPanelContent()\n {\n $rows = array();\n\n foreach ($this->_templates as $template) {\n $rows[] = $this->arrayToHTML($template['template'], $template['vars']);\n }\n\n return implode(' ', $rows);\n }", "function kss_get_panel( $name = null ) {\n\tget_template_part( './template-parts/panels/panel', $name );\n}", "public static function panel($title, $content, $size)\n {\n $self = new Panel();\n\n $self->setSize($size);\n $self->setTitle($title);\n $self->addContent($content);\n\n $html = $self->getHTML();\n\n return $html;\n\n }", "function df_customizer_get_panel(){\n\t$panels = array(\n\t\t'header' => array( 'header_panel', 'Header', 10, 'sections' => array(\n\t\t\t\t\t// Panel: Header\n\t\t\t\t\t/* Section : Topbar */\n\t\t\t\t\t'topbar' => array( 'topbar_section', _x('Topbar', 'backend customizer', 'backend_dahztheme'), 5),\n\t\t\t\t\t/* Section : Logo Setting */\n\t\t\t\t\t'logo' => array( 'logo_section', _x('Logo', 'backend customizer', 'backend_dahztheme'), 10),\n\t\t\t\t\t/* Section : Navbar */\n\t\t\t\t\t'navbar' => array( 'navbar_section', _x('Navbar', 'backend customizer', 'backend_dahztheme'), 15),\n\t\t\t\t\t/* Section : Navbar Transparency */\n\t\t\t\t\t'navbar_transparency' => array( 'navbar_transparency_section', _x('Transparency', 'backend customizer', 'backend_dahztheme'), 20),\n\t\t\t\t\t/* Section : Sticky */\n\t\t\t\t\t'navbar_sticky' => array( 'navbar_sticky_section', _x('Sticky', 'backend customizer', 'backend_dahztheme'), 25),\n\t\t\t\t\t/* Section : Miscellaneous */\n\t\t\t\t\t'navbar_miscellaneous_section' => array( 'navbar_miscellaneous_section', _x('Miscellaneous', 'backend customizer', 'backend_dahztheme'), 30),\n\t\t\t\t\t/* Section : Page Title */\n\t\t\t\t\t'pagetitle' => array( 'pagetitle_section', _x('Page Title', 'backend customizer', 'backend_dahztheme'), 35)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Header is first impression of your website here you can customize the whole part of header area.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'content' => array( 'content_panel', 'Content', 20, 'sections' => array(\n\t\t\t\t\t// Panel: Content\n\t\t\t\t\t/* Section : Outer Area */\n\t\t\t\t\t'outer_area' => array( 'outer_area_section', _x('Outer Area', 'backend customizer','backend_dahztheme'), 0),\n\t\t\t\t\t/* Section : Content Area */\n\t\t\t\t\t'content_area' => array( 'content_area_section', _x('Content Area', 'backend customizer','backend_dahztheme'), 10),\n\t\t\t\t\t/* Section : Typography */\n\t\t\t\t\t'typo' => array( 'typo_section', _x('Typography', 'backend customizer','backend_dahztheme'), 20)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Customize your typography and the outer & content area which includes background image, color, and sidebar layout.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'footer' => array( 'footer_panel', 'Footer', 30, 'sections' => array(\n\t\t\t\t\t// Panel: Footer\n\t\t\t\t\t/* Section : Widget Footer */\n\t\t\t\t\t'primary' => array( 'primary_section', _x('Primary Footer', 'backend customizer', 'backend_dahztheme'), 5),\n\t\t\t\t\t/* Section : Copyright Footer */\n\t\t\t\t\t'copyright' => array( 'copyright_section', _x('Copyright Footer', 'backend customizer', 'backend_dahztheme'), 10)\n\t\t\t\t\t),\n\t\t\t\t _x( 'Footer refers to the bottom section that contains information copyright notices, links to privacy policy, credits and widgetized area with multiple columns that you can use to add widgets.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'blog' => array( 'blog_panel', 'Blog', 50, 'sections' => array(\n\t\t\t\t\t// Panel: Blog\n\t\t\t\t\t/* Section : Featured Slider */\n\t\t\t\t\t'featslider' => array( 'featslider_section', _x('Featured Slider', 'backend customizer', 'backend_dahztheme'), 0),\n\t\t\t\t\t/* Section : Layout */\n\t\t\t\t\t'layout' => array( 'layout_section', _x('Layout', 'backend customizer', 'backend_dahztheme'), 10),\n\t\t\t\t\t/* Section : Single Blog */\n\t\t\t\t\t'singleblog' => array( 'singleblog_section', _x('Single Blog', 'backend customizer', 'backend_dahztheme'), 20),\n\t\t\t\t\t/* Section : Archive */\n\t\t\t\t\t'archive' => array( 'archive_section', _x('Archive', 'backend customizer', 'backend_dahztheme'), 30),\n\t\t\t\t\t/* Section : Share */\n\t\t\t\t\t'share' => array( 'share_section', _x('Share', 'backend customizer', 'backend_dahztheme'), 40)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Customize your blog appearance, including layout, pagination style, featured slider, archive and sharing options.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'misc' => array( 'misc_panel', 'Misc', 60, 'sections' => array(\n\t\t\t\t\t// Panel: Misc\n\t\t\t\t\t/* Favicon */\n\t\t\t\t\t'site_icon' => array( 'site_icon_section', _x('Site Icon', 'backend customizer', 'backend_dahztheme'), 5),\n\t\t\t\t\t/* Google Analytics */\n\t\t\t\t\t'google_analytics' => array( 'google_analytics_section', _x('Google Analytics', 'backend customizer', 'backend_dahztheme'), 10),\n\t\t\t\t\t/* Social Connects */\n\t\t\t\t\t'social_connect' => array( 'social_connect_section', _x('Social Connect', 'backend customizer', 'backend_dahztheme'), 15),\n\t\t\t\t\t/* 404 */\n\t\t\t\t\t'404' => array( '404_section', _x('404', 'backend customizer', 'backend_dahztheme'), 20),\n\t\t\t\t\t/* Page Loader */\n\t\t\t\t\t'page_loader' => array( 'page_loader_section', _x('Page Loader', 'backend customizer', 'backend_dahztheme'), 25),\n\t\t\t\t\t/* Font Subsets */\n\t\t\t\t\t'font_subset' => array( 'font_subset_section', _x('Font Subset', 'backend customizer', 'backend_dahztheme'), 30)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Misc is additional configuration which includes site icon, google analytics, social media URLs, 404 page, page loader and font subset.', 'backend customizer', 'backend_dahztheme' )\n\t\t)\n\t);\n\n\treturn apply_filters( 'create_customizer_panels', $panels );\n}", "public function getPanelSettings() {\n return $this->panelSetting->findBy(['panel_id'=>$this->id]);\n }", "public function getSinglePanelByName($p) {\n\t\t$stmt = $this->con->prepare ( \"SELECT panel_nr, name, filename FROM sampi_panels WHERE filename=?\" );\n\t\t$stmt->bind_param ( 's', $p );\n\t\t$stmt->execute ();\n\t\t$stmt->bind_result ( $panel_nr, $name, $filename );\n\t\t$stmt->fetch ();\n\t\treturn new AdminPanel ( $panel_nr, $name, $filename );\n\t}", "public function getPanels()\r\r\n\t{\r\r\n\t\treturn $this->_panels;\r\r\n\t}", "function getPanelList()\n\t{\n\t\tstatic $lab_panel_list = [];\n\n\t\tif (empty($lab_panel_list)) {\n\t\t\t$res = $qbc->get('/api/v1/panel');\n\t\t\tforeach ($res['data'] as $x) {\n\t\t\t\t$x['@id'] = sprintf('qbench:%d', $x['id']);\n\t\t\t\t$lab_panel_list[$x['@id']] = $x;\n\t\t\t\t// printf(\"Panel: %s / '%s'\\n\", $x['@id'], $x['title']);\n\t\t\t}\n\t\t}\n\n\t\treturn $lab_panel_list;\n\t}", "public function buildPanel()\n {\n $this->updateTabPaths();\n\n $leftTab = $this->leftTab;\n unset($this->leftTab);\n\n $leftTab->panels->add($this);\n\n return $leftTab;\n }", "public function addInfoPanel():PanelInfo {\r\n\t\t$panel = new PanelInfo();\r\n\t\t$this->addElement($panel);\r\n\t\treturn $panel;\r\n\t}", "public function getPanelName()\n {\n return $this->m_panelName;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getting the asset from asset or assetId
private static function _getAsset($assetOrAssetId) { if($assetOrAssetId instanceof Asset) return $assetOrAssetId; if(is_string($assetOrAssetId) && ($asset = Asset::getAsset(trim($assetOrAssetId))) instanceof Asset) return $asset; return null; }
[ "public function getAsset();", "public function getAssetById($id)\n {\n return Asset::find($id);\n }", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }", "public function getAssetById( $assetId ) {\n\n $url = \"/assets/\" . $assetId; \n\n return $this->HttpRequest( \"GET\", $url );\n }", "public function getAsset($id)\n\t{\n\t\treturn $this->getResourceChildObject('assets', $id);\n\t}", "public function getAssetId()\n {\n return $this->asset_id;\n }", "public function getAsset()\n {\n return $this->asset;\n }", "public function assetAction() {\r\n $id = $this->getParam(\"id\");\r\n $success = false;\r\n\r\n try {\r\n if ($this->isGet()) {\r\n $asset = Asset::getById($id);\r\n if (!$asset) {\r\n $this->encoder->encode(array( \"success\" => false,\r\n \"msg\" => \"Asset does not exist\",\r\n \"code\" => self::ELEMENT_DOES_NOT_EXIST));\r\n return;\r\n }\r\n\r\n $this->checkPermission($asset, \"get\");\r\n\r\n if ($asset instanceof Asset\\Folder) {\r\n $object = $this->service->getAssetFolderById($id);\r\n } else {\r\n $light = $this->getParam(\"light\");\r\n $options = array(\"LIGHT\" => $light ? 1 : 0);\r\n $object = $this->service->getAssetFileById($id, $options);\r\n $algo = \"sha1\";\r\n\r\n $thumbnailConfig = $this->getParam(\"thumbnail\");\r\n if ($thumbnailConfig && $asset->getType() == \"image\") {\r\n $checksum = $asset->getThumbnail($thumbnailConfig)->getChecksum($algo);\r\n $object->thumbnail = (string) $asset->getThumbnail($thumbnailConfig);\r\n } else {\r\n $checksum = $asset->getChecksum($algo);\r\n }\r\n\r\n $object->checksum = array(\r\n \"algo\" => $algo,\r\n \"value\" => $checksum\r\n );\r\n\r\n if ($light) {\r\n unset($object->data);\r\n }\r\n }\r\n $this->encoder->encode(array(\"success\" => true, \"data\" => $object));\r\n return;\r\n } else if ($this->isDelete()) {\r\n $asset = Asset::getById($id);\r\n if ($asset) {\r\n $this->checkPermission($asset, \"delete\");\r\n }\r\n\r\n $success = $this->service->deleteAsset($id);\r\n $this->encoder->encode(array(\"success\" => $success));\r\n return;\r\n } else if ($this->isPost() || $this->isPut()) {\r\n $data = file_get_contents(\"php://input\");\r\n $data = \\Zend_Json::decode($data);\r\n\r\n $type = $data[\"type\"];\r\n $id = null;\r\n\r\n if ($data[\"id\"]) {\r\n\r\n $asset = Asset::getById($data[\"id\"]);\r\n if ($asset) {\r\n $this->checkPermission($asset, \"update\");\r\n }\r\n\r\n $isUpdate = true;\r\n if ($type == \"folder\") {\r\n $wsData = self::fillWebserviceData(\"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Asset\\\\Folder\\\\In\", $data);\r\n $success = $this->service->updateAssetFolder($wsData);\r\n } else {\r\n $wsData = self::fillWebserviceData(\"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Asset\\\\File\\\\In\", $data);\r\n $success = $this->service->updateAssetFile($wsData);\r\n }\r\n } else {\r\n\r\n if ($type == \"folder\") {\r\n $class = \"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Asset\\\\Folder\\\\In\";\r\n $method = \"createAssetFolder\";\r\n } else {\r\n $class = \"\\\\Pimcore\\\\Model\\\\Webservice\\\\Data\\\\Asset\\\\File\\\\In\";\r\n $method = \"createAssetFile\";\r\n }\r\n\r\n $wsData = self::fillWebserviceData($class, $data);\r\n\r\n $asset = new Asset();\r\n $asset->setId($wsData->parentId);\r\n $this->checkPermission($asset, \"create\");\r\n\r\n $id = $this->service->$method($wsData);\r\n }\r\n\r\n if (!$isUpdate) {\r\n $success = $id != null;\r\n }\r\n\r\n if ($success && !$isUpdate) {\r\n $this->encoder->encode(array(\"success\" => $success, \"data\" => array(\"id\" => $id)));\r\n } else {\r\n $this->encoder->encode(array(\"success\" => $success));\r\n }\r\n return;\r\n\r\n }\r\n } catch (\\Exception $e) {\r\n \\Logger::error($e);\r\n $this->encoder->encode(array(\"success\" => false, \"msg\" => (string) $e));\r\n }\r\n $this->encoder->encode(array(\"success\" => false));\r\n }", "public function getAssetByIdentifier($identifier)\n {\n $asset = $this->client->get(\n 'api/assets/getbyidentifier',\n array(\n 'asset_identifier' => $identifier\n )\n )->json();\n return $this->checkPropertyAndReturn($asset, 'asset');\n }", "private function get_asset( string $type = '', string $asset_name = '' ) {\n if ( ! in_array( $type, array( 'css', 'js' ) ) || empty( $asset_name ) ) {\n return null;\n }\n\n $registered_type = ( 'css' === $type ) ? $this->registered_css : $this->registered_js;\n\n foreach ( $registered_type as &$asset ) {\n if ( $asset_name === $asset['name'] ) {\n return $asset;\n }\n }\n\n return null;\n }", "public function findById($identifier) {\n\t\t$asset = $this->fileRepository->findByIdentifier($identifier);\n\t\treturn $asset;\n\t}", "public function findById($identifier) {\n\t\t$asset = $this->linkRepository->findByIdentifier($identifier);\n\t\treturn $asset;\n\t}", "public function getAssetByUid($assetUid)\n {\n foreach ($assets = $this->getAssets() as $asset) {\n /** @var $asset File|FileReference */\n if ((int)$assetUid === (int)$asset->getUid()) {\n return $asset;\n }\n }\n return null;\n }", "public function getAssetSetAsset()\n {\n return $this->asset_set_asset;\n }", "public function get($name)\n {\n return $this->has($name) ? $this->assets[$name] : null;\n }", "function get_asset_id_from_name($asset) \n{\n\tglobal $found_assets;\t\n\t\n\tif ($asset_id = array_search($asset, $found_assets))\n\t{\n\t\t//it is already in the array, had already been queried previously\n\t\treturn $asset_id;\n\t}\n\t$sql \t= \"SELECT asset_id FROM assetlist WHERE asset='$asset'\";\n\t$query \t= mysql_query($sql);\n\t$set \t= mysql_fetch_row($query);\n\t$asset_id = $set[0];\n\t\n\t//store in the array\n\t$found_assets[$asset_id] = $asset;\n\treturn $asset_id;\n}", "public function getAsset($symbol)\n {\n return $this->_request(\"assets/{$symbol}\");\n }", "public function getAssetStorageAccount($asset);", "public function assetObject()\n {\n return $this->belongsTo('App\\Asset', 'assetID');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that no exception if thrown when challenge is disabled for authenticator
public function testAuthenticateWithChallengeDisabled() { $request = ServerRequestFactory::fromGlobals([ 'SERVER_NAME' => 'example.com', 'REQUEST_URI' => '/testpath', 'PHP_AUTH_USER' => 'admad', 'PHP_AUTH_PW' => 'WRONG', ]); $service = new AuthenticationService([ 'identifiers' => [ 'Authentication.Password', ], 'authenticators' => [ 'Authentication.HttpBasic' => [ 'skipChallenge' => true, ], ], ]); $result = $service->authenticate($request); $this->assertFalse($result->isValid()); }
[ "public function testAuthenticateMissingCredentials(): void\n {\n $authenticator = new AlbAuthenticator(\n new CallbackIdentifier(['callback' => function (): void {\n static::fail('Unexpected call to identifier');\n }]),\n ['region' => 'eu-south-1', 'guzzleClient' => ['handler' => $this->handler]]\n );\n\n $result = $authenticator->authenticate(\n new ServerRequest(['environment' => []])\n );\n\n static::assertSame(ResultInterface::FAILURE_CREDENTIALS_MISSING, $result->getStatus());\n static::assertFalse($result->isValid());\n static::assertEmpty($result->getErrors());\n\n static::assertCount(0, $this->history);\n\n static::assertNull($authenticator->getPayload());\n }", "public function testAuthenticateFalseKEY()\n {\n $api = new \\App\\Services\\Api('3RkTSJ', 'KjdTEANlw6YPxKdededdRINgmMKzQBTJtDt', $this->user);\n $result = $api->authenticate();\n $this->assertFalse($result);\n }", "public function testValidationCaseForInvalidTypeOfAuthenticationMode()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->setAuthenticationMode(-1000);\n } else {\n $hasThrown = null;\n\n try {\n $protocol->setAuthenticationMode(-1000);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testErrorOnInvalidCredentialsWithoutKey()\n {\n $request = [\n 'method' => 'GET',\n 'url' => '/resource/4?filter=a',\n 'host' => 'example.com',\n 'port' => 8080,\n 'authorization' => 'Hawk id=\"123\", ts=\"1353788437\", nonce=\"k3j4h2\", mac=\"/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=\", ext=\"hello\"'\n ];\n\n $credentialsFunc = function ($id, $callback) {\n $credentials = [\n 'key' => '23434d3q4d5345d',\n 'user' => 'steve'\n ];\n return $callback(null, $credentials);\n };\n\n $options = [\n 'localtime_offset_msec' => 1353788437000 - Utils::getTimeNowMs()\n ];\n\n Server::authenticate($request, $credentialsFunc, $options, function ($err, $credentials = null, $artifacts = null) {\n $this->assertNotNull($err);\n $this->assertEquals('Invalid credentials', $err->getMessage());\n $this->assertEquals('HTTP/1.1 500 Internal Server Error', $err->getHeader(0));\n });\n }", "public function testErrorOnInvalidAuthenticationHeaderWithNoScheme()\n {\n $request = [\n 'method' => 'GET',\n 'url' => '/resource/4?filter=a',\n 'host' => 'example.com',\n 'port' => 8080,\n 'authorization' => '!@#'\n ];\n\n $options = [\n 'localtime_offset_msec' => 1353788437000 - Utils::getTimeNowMs()\n ];\n\n Server::authenticate($request, $this->credentialsFunc, $options, function ($err, $credentials = null, $artifacts = null) {\n $this->assertNotNull($err);\n $this->assertEquals('Invalid header syntax', $err->getMessage());\n });\n }", "public function testUnsetTokenCredentialReturnsFalse()\n {\n /** @var ICredential|\\PHPUnit_Framework_MockObject_MockObject $credential */\n $credential = $this->createMock(ICredential::class);\n $credential->expects($this->any())\n ->method('getValue')\n ->with('token')\n ->willReturn(null);\n $subject = null;\n $error = null;\n $this->assertFalse($this->authenticator->authenticate($credential, $subject, $error));\n $this->assertEquals(AuthenticatorErrorTypes::CREDENTIAL_MISSING, $error);\n }", "public function testRejectLoginRequest()\n {\n }", "public function testValidationCaseForInvalidTypeOfSymmetricEncryptionServicePassedOnInitialization()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\RuntimeException::class);\n\n $protocol = new AuthenticatedEncryption(null, null);\n } else {\n $hasThrown = null;\n\n try {\n $protocol = new AuthenticatedEncryption(null, null);\n } catch (\\RuntimeException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testOnAuthenticationFailure()\n {\n $auth = new JWTAuthenticator(new TensideJsonConfig(new JsonFile($this->getTempDir() . DIRECTORY_SEPARATOR . 'tenside.json')));\n\n $response = $auth->onAuthenticationFailure(new Request(), new AuthenticationException('Cows can\\'t fly!'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertContains('Cows can\\'t fly!', $response->getContent());\n $this->assertEquals(Response::HTTP_UNAUTHORIZED, $response->getStatusCode());\n }", "public function testExceptionThrownWithNoAuthenticatorForCredential()\n {\n $this->expectException(InvalidArgumentException::class);\n /** @var ICredential|\\PHPUnit_Framework_MockObject_MockObject $credential */\n $credential = $this->createMock(ICredential::class);\n $credential->expects($this->once())\n ->method('getType')\n ->willReturn('foo');\n $subject = null;\n $this->authenticatorRegistry->expects($this->once())\n ->method('getAuthenticators')\n ->with('foo')\n ->willThrowException(new InvalidArgumentException);\n $this->authenticator->authenticate($credential, $subject);\n }", "public function testAuthenticateTokenWithoutSecretFails()\n {\n $auth = new JWTAuthenticator(new TensideJsonConfig(new JsonFile($this->getTempDir() . DIRECTORY_SEPARATOR . 'tenside.json')));\n $auth->authenticateToken(\n $this->getMockForAbstractClass(TokenInterface::class),\n $this->getMockForAbstractClass(UserProviderInterface::class),\n 'provider-key'\n );\n }", "public function test_encoding_with_none_algorithm(): void\n {\n $this->expectException(InsecureTokenException::class);\n \n $key = ']V@IaC1%fU,DrVI';\n \n $tokenDecoded = new TokenDecoded(['alg' => 'none']);\n $tokenDecoded->encode($key, 'none');\n }", "public function testAuthenticateFalseID()\n {\n $api = new \\App\\Services\\Api('3RkTSe', 'KjdTEANlw6YPxKIPORINgmMKzQBTJtDt', $this->user);\n $result = $api->authenticate();\n $this->assertFalse($result);\n }", "public function testChallengeCreate()\n {\n }", "public function testOauthAuthenticateWithoutCode()\n {\n\t\t$meta = new TiresiasOAuthClientMetaData();\n\t\t$client = new TiresiasOAuthClient($meta);\n\n\t\t$this->specify('failed oauth authenticate', function() use ($client) {\n\t\t\t$this->setExpectedException('TiresiasException');\n\t\t\t$client->authenticate('');\n\t\t});\n }", "public function testGetCredentialsWithWrongHTTPMethod()\n {\n $encoder = new JWTCoder('secret');\n $translator = new Translator('en');\n $authenticator = new UsernamePasswordAuthenticator($this->mockContaoFramework(), $encoder, $translator);\n\n $request = new Request();\n $request->setMethod(Request::METHOD_GET);\n\n try {\n $authenticator->getCredentials($request);\n } catch (AuthenticationException $e) {\n $this->assertEquals('huh.api.exception.auth.post_method_only', $e->getMessage());\n }\n }", "public function testAuthenticateMissingSub(): void\n {\n $authenticator = new AlbAuthenticator(\n new CallbackIdentifier(['callback' => function (): void {\n static::fail('Unexpected call to identifier');\n }]),\n ['region' => 'eu-south-1', 'guzzleClient' => ['handler' => $this->handler]]\n );\n\n $token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))\n ->issuedAt(FrozenTime::now())\n ->canOnlyBeUsedAfter(FrozenTime::now())\n ->expiresAt(FrozenTime::now()->addMinute())\n ->withHeader('kid', $this->keyId)\n ->getToken(Sha256::create(), $this->privateKey)\n ->toString();\n\n $result = $authenticator->authenticate(\n new ServerRequest(['environment' => ['HTTP_X_AMZN_OIDC_DATA' => $token]])\n );\n\n static::assertSame(ResultInterface::FAILURE_CREDENTIALS_MISSING, $result->getStatus());\n static::assertFalse($result->isValid());\n static::assertEmpty($result->getErrors());\n\n static::assertCount(1, $this->history);\n static::assertSame('GET', $this->history[0]['request']->getMethod());\n $expectedRequestUrl = sprintf('https://public-keys.auth.elb.eu-south-1.amazonaws.com/%s', $this->keyId);\n static::assertSame($expectedRequestUrl, (string)$this->history[0]['request']->getUri());\n }", "public function testConsultWithInvalidCredentials()\n\t{\n\t\t$response = $this->call('GET', '/api/consult/es/123', [], [], [], ['HTTP_user' => 'blabla', 'HTTP_key' => 'blabla']);\n\n\t\t$this->assertEquals(401, $response->getStatusCode());\n\t}", "public function testValidationCaseForInvalidTypeOfUserStringPassedForAuthentication()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->authenticateEntity('', ['none']);\n } else {\n $hasThrown = null;\n\n try {\n $protocol->authenticateEntity('', ['none']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is this a copy colour?
function is_copy() { if($this->r == -2 && $this->g == -2 && $this->b == -2) { return true; } else { return false; } }
[ "public function hasColour(): bool;", "public function hasColorSupport();", "public function isColor()\n {\n return $this->_type === self::TYPE_COLOR;\n }", "public function in_color() {\n }", "public function isTrueColor() {\r\n //return 0 if number too high\r\n $numberOfColors = imagecolorstotal($this->img); \r\n return $numberOfColors == 0 OR $numberOfColors > 256;\r\n }", "public function hasColor()\n {\n return ($this->color != '') ? true : false;\n }", "public function isRealColour()\n {\n return $this->red >= 0 && $this->green >= 0 && $this->blue >= 0;\n }", "function gd_is_true_color ($image)\n{\n return imageistruecolor($image);\n}", "public function supportsRGBColors(): bool;", "public function isRed()\n {\n return $this->getType() == 2;\n }", "public function supports256Colors(): bool;", "public function hasColors()\n {\n return $this->countColors() >= 1;\n }", "public function testColorProfilesCopy()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function _check_true_color()\n {\n if (FALSE == @imageCreateTrueColor(1, 1)) \n { \n $this->_gdtruecolor = FALSE;\n }\n else\n {\n $this->_gdtruecolor = TRUE;\n } \n }", "#[Pure]\nfunction imageistruecolor(GdImage $image): bool {}", "public function hasTransparentColor()\n {\n if ($this->graphicsControlExtension) {\n $byte = substr($this->graphicsControlExtension, 1, 1);\n $byte = unpack('C', $byte)[1];\n $bit = $byte & bindec('00000001');\n\n return (bool) $bit;\n }\n\n return false;\n }", "public function hasColour() : bool\n {\n return isset($this->colour);\n }", "public function can_change_color() {\n return ncurses_can_change_color();\n }", "function imagepalettetotruecolor(&$src) {\n if (imageistruecolor($src)) {\n return(true);\n }\n\n $dst = imagecreatetruecolor(imagesx($src), imagesy($src));\n\n imagecopy($dst, $src, 0, 0, 0, 0, imagesx($src), imagesy($src));\n imagedestroy($src);\n\n $src = $dst;\n\n return(true);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup yiiStrap, works even if YiiBooster is used in main app.
public function initYiiStrap() { // check that we are in a web application if (!(Yii::app() instanceof CWebApplication)) return; // and in this module $route = explode('/', Yii::app()->urlManager->parseUrl(Yii::app()->request)); if ($route[0] != $this->id) return; // and yiiStrap is not configured if (Yii::getPathOfAlias('bootstrap') && file_exists(Yii::getPathOfAlias('bootstrap.helpers') . '/TbHtml.php')) return; // try to guess yiiStrapPath if ($this->yiiStrapPath === null) $this->yiiStrapPath = Yii::getPathOfAlias('vendor.crisu83.yiistrap'); // check for valid path if (!realpath($this->yiiStrapPath)) return; // setup yiiStrap components Yii::setPathOfAlias('bootstrap', realpath($this->yiiStrapPath)); Yii::import('bootstrap.helpers.*'); Yii::import('bootstrap.widgets.*'); Yii::import('bootstrap.behaviors.*'); Yii::import('bootstrap.form.*'); Yii::app()->setComponents(array( 'bootstrap' => array( 'class' => 'bootstrap.components.TbApi', ), ), false); }
[ "public function bootstrap($app)\n {\n \n if ($app instanceof \\yii\\console\\Application) {\n $app->controllerMap['mailqueue'] = 'xeois\\mailqueue\\commands\\MailQueueController';\n }\n \n }", "private function __setUpBoostrap() {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'\n );\n }", "function app()\n{\n return Yii::app();\n}", "function app()\r\n{\r\n return Yii::app();\r\n}", "public function bootstrap();", "public function bootstrap(): void\n {\n /**\n * Include app's bootstrap file\n */\n if (file_exists($this->configDir . 'bootstrap.php')) {\n //require_once $this->configDir . 'bootstrap.php';\n parent::bootstrap();\n }\n\n /**\n * Run common cake application bootstrap tasks\n * - setup paths\n * - bootstrap cake core\n * - setup default config engine\n * - load app config\n * - load plugins config\n * - load local configurations\n * - setup full base url in configuration\n * - configure: timezone, encoding, locale, error handler\n * - configure: request detectors, database types, debugmode\n * - consume configurations: ConnectionManager, Cache, Email, Log, Security\n */\n try {\n $bootstrapper = Bootstrapper::init($this->configDir);\n $bootstrapper->run();\n } catch (Exception $ex) {\n echo $ex->getMessage();\n throw $ex;\n }\n\n /**\n * Load core plugins and user plugins\n */\n if (file_exists(CONFIG . 'plugins.php')) {\n Configure::load('plugins');\n }\n $this->addPlugin('Cupcake');\n $this->addPlugin((array)Configure::read('Plugin')/*, ['bootstrap' => true, 'routes' => true]*/);\n\n /**\n * CakePHP DebugKit support\n */\n if (Configure::read('DebugKit.enabled')) {\n $this->addOptionalPlugin('DebugKit');\n }\n\n /**\n * CLI\n * Register common cli plugins.\n * These optional plugins are automatically available if fm-labs/cakephp-devtools package is installed.\n */\n if (PHP_SAPI == 'cli') {\n $this->addOptionalPlugin('Bake');\n $this->addOptionalPlugin('Migrate');\n $this->addOptionalPlugin('Reply');\n }\n\n /*\n * Add cupcake templates path as fallback template search path\n */\n $templatePaths = Configure::read('App.paths.templates', []);\n $templatePaths[] = Plugin::templatePath('Cupcake');\n Configure::write('App.paths.templates', $templatePaths);\n\n /*\n * Init Cupcake\n */\n Cupcake::setApplication($this);\n }", "protected function setUpBoostrap()\n {\n // Set configuration files\n $config = array(APPLICATION_PATH . '/configs/application.ini');\n if (file_exists(APPLICATION_PATH . '/configs/application.local.ini')) {\n $config[] = APPLICATION_PATH . '/configs/application.local.ini';\n }\n $this->bootstrap = new Zend_Application(APPLICATION_ENV, array('config' => $config));\n }", "public function bootstrap($bootstrap){}", "function app()\n{\n return Yii::$app;\n}", "public function runBootstrap();", "public function bootstrap()\n {\n parent::bootstrap();\n\n // Only register the reset command on the local environment\n if ($this->app->environment('local')) {\n $this->commands[] = \\Fixhub\\Console\\Commands\\ResetApp::class;\n }\n }", "public function customBootstrap();", "protected function includeAndStartCoreBootstrap() {}", "public function execBootstrap()\n {\n $package = strtr($this->path.'/bootstrap', '/', '.');\n \n // FIXME: el BS a ejecutar debe depender del modo de ejecucion\n YuppLoader::getInstance()->loadScript($package, 'Bootstrap');\n }", "private static function getYiiApplication()\n {\n if (!is_file(YII_PATH.'/yii.php'))\n {\n return null;\n }\n\n require_once(YII_PATH . '/yii.php');\n spl_autoload_register(array('YiiBase', 'autoload'));\n\n if (\\Yii::app() === null) {\n if (is_file(CONSOLE_CONFIG)) {\n $app = \\Yii::createConsoleApplication(CONSOLE_CONFIG);\n } else {\n throw new \\Exception(\"File from CONSOLE_CONFIG not found\"); \n } \n } else {\n $app = \\Yii::app();\n }\n return $app;\n }", "protected function before_bootstrap() {}", "public function setUp()\n {\n $application = require $this->bootstrap;\n $this->application = $application;\n $this->sm = $application->getServiceManager();\n }", "private static function _runBootstrap()\n {\n include ROOT.D.'app'.D.'core'.D.'base'.D.'Bootstrap.php';\n new Bootstrap();\n }", "private function setup_bootstrap_hooks() {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return's the repository to access store websites.
public function getStoreWebsiteRepository();
[ "private function sites_repository()\r\n {\r\n return $this->m_sites_repository;\r\n }", "protected function getPageRepository()\n {\n return $GLOBALS['TSFE']->sys_page;\n }", "public function getRepository() : Repository {\n return $this->page_info->getContext()->getRepository();\n }", "public function getPageRepository()\n {\n return $this->pageRepository;\n }", "public function getUrlRewriteRepository()\n {\n return $this->urlRewriteRepository;\n }", "function getRepository();", "public function repo()\n\t{\n\t\trequire_once __DIR__ . DS . 'repo.php';\n\t\tif (!isset($this->_repo))\n\t\t{\n\t\t\t$this->_repo = new Repo($this, 'local');\n\t\t}\n\n\t\treturn $this->_repo;\n\t}", "public static function store(): Repository\n {\n return Cache::store(app()->isProduction() ? 'octane' : config('cache.default'));\n }", "public function getRepository();", "public function repository()\n {\n return $this->repository;\n }", "public function getLocalRepository() {\n\t\treturn $this->localRepository;\n\t}", "public function getWebsite()\n {\n return $this->get('Website');\n }", "public function getStoreWebsites();", "abstract public function getRepository();", "public function getRepository()\n {\n return $this->_repository;\n }", "final public function getRepoUrl()\n {\n return $this->repositoryUrl;\n }", "public function getUrlRewriteRepository() : UrlRewriteRepositoryInterface\n {\n return $this->urlRewriteRepository;\n }", "public function repo()\n {\n if ($this->getGuard() == 'admin') {\n return $this->adminRepo;\n }\n\n return $this->userRepo;\n }", "protected function repository()\n {\n return FileRepository::makeRepository();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the Workday_Common_Header SoapHeader param
public function setSoapHeaderWorkday_Common_Header(\WorkdayWsdl\\StructType\Workday_Common_HeaderType $workday_Common_Header, $nameSpace = 'urn:com.workday/bsvc', $mustUnderstand = false, $actor = null) { return $this->setSoapHeader($nameSpace, 'Workday_Common_Header', $workday_Common_Header, $mustUnderstand, $actor); }
[ "public function __setSoapHeader($header_sdo, $ns, $name)\n {\n $xmldas = $this->handler->getXmlDas();\n $doc = $xmldas->createDocument($ns, $name, $header_sdo);\n $header_xml_doc = $xmldas->saveString($doc);\n $tmpxml = explode(\"\\n\", $header_xml_doc);\n if (array_key_exists(1, $tmpxml)) {\n $header_body = new SoapVar($tmpxml[1], XSD_ANYXML);\n $this->soap_headers = array(new SOAPHeader($ns, $name, $header_body));\n }\n\n }", "public function setHeader(PoHeader $header) {\n }", "public function __setSoapHeaders($soapheaders){}", "protected function setSoapHeaders()\n {\n $this->headers = [];\n }", "public function setHeader($header){\n\t\t$this->attributes['header'] = $header;\n\t}", "public function setHeader(PoHeader $header) {\n $this->header = $header;\n }", "private function generateSoapHeader()\r\n {\r\n $authParams = [\r\n 'eWAYCustomerID' => $this->getCustomerId(),\r\n 'Username' => $this->getUsername(),\r\n 'Password' => $this->getPassword()\r\n ];\r\n $header = new \\SoapHeader($this->namespace, \"eWAYHeader\", $authParams);\r\n return $header;\r\n }", "public function __setSoapHeaders($soapheaders = NULL)\n {\n }", "private function commonSheetHeader( &$objSheet ) {\n $objSheet->setCellValue( 'A1', 'TR Number' );\n $objSheet->setCellValue( 'B1', 'TR Status' );\n $objSheet->setCellValue( 'C1', 'Category' );\n// $objSheet->setCellValue( 'D1', 'Asset Group' );\n// $objSheet->setCellValue( 'E1', 'Asset Number' );\n $objSheet->setCellValue( 'D1', 'TR Class' );\n $objSheet->setCellValue( 'E1', 'Site' );\n $objSheet->setCellValue( 'F1', 'SC' );\n $objSheet->setCellValue( 'G1', 'Region' );\n $objSheet->setCellValue( 'H1', 'TR Created by' );\n $objSheet->setCellValue( 'I1', 'TR Closed by' );\n $objSheet->setCellValue( 'J1', 'TR validate by' );\n $objSheet->setCellValue( 'K1', 'TR Creation date' );\n $objSheet->setCellValue( 'L1', 'Recv Supp date' );\n $objSheet->setCellValue( 'M1', 'Proposed Com date' );\n $objSheet->setCellValue( 'N1', 'TR Closing date' );\n $objSheet->setCellValue( 'O1', 'TR Validation date' );\n $objSheet->setCellValue( 'P1', 'Supplier' );\n }", "public function initHeader(){}", "abstract public function alterHeaders();", "public function setCustomHeader($customHeader)\n {\n $this->_customHeader=$customHeader;\n }", "function setBodyHeader($header_content = null) {\n $this->header_content = $header_content;\n }", "function setCustomHeader($name, $value);", "function get_soapheader(){\n\t\treturn $this->soapheader;\n\t}", "public function setHeader($header) {\n parent::addHeader($header);\n \n //Get the index of the row used by DataTable columns.\n end($this->header);\n \n $this->active_header_index = key($this->header);\n \n reset($this->header);\n }", "public function setHeader(array $header)\n {\n $this->header = array_merge($header, $this->header);\n }", "public function setHeader($header, $value);", "function addHeader(&$soap_value)\n {\n # add a new header to the message\n if (is_a($soap_value,'soap_header')) {\n $this->headersOut[] =& $soap_value;\n } else if (gettype($soap_value) == 'array') {\n // name, value, namespace, mustunderstand, actor\n $this->headersOut[] = new SOAP_Header($soap_value[0], null, $soap_value[1], $soap_value[2], $soap_value[3]);;\n } else {\n $this->_raiseSoapFault(\"Don't understand the header info you provided. Must be array or SOAP_Header.\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register the make:respository command.
protected function registerRepositoryMakeCommand() { $this->app->singleton('command.repository.make', function ($app) { return new RepositoryMakeCommand($app['files']); }); }
[ "protected function registerMakeRepositoryCommand()\n {\n // Make repository command.\n $this->app['command.repository.make'] = $this->app->share(\n function($app)\n {\n return new MakeRepositoryCommand($app['RepositoryCreator'], $app['Composer']);\n }\n );\n }", "protected function registerMakeRepositoryCommand()\n {\n // Make repository command.\n $this->app['command.repository.make'] = $this->app->share(\n function($app) {\n return new MakeRepositoryCommand($app['RepositoryGenerator'], $app['Composer']);\n }\n );\n }", "protected function registerMakeCommand()\n {\n $this->app->singleton('pluggables.make', function ($app) {\n $handler = new Handlers\\PluggableMakeHandler($app['pluggables'], $app['files']);\n\n return new Console\\PluggableMakeCommand($handler);\n });\n }", "private function registerCrudGeneratorCommand()\n {\n $this->app['support:make:crud'] = $this->app->share(function () {\n return new CrudGenerate();\n });\n\n $this->commands('support:make:crud');\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "protected function registerMakePackageCommand()\n {\n // Make package command.\n $this->app->singleton('command.package.make', function ($app) {\n return new MakePackageCommand($app['PackageCreator'], $app['Composer']);\n });\n\n $this->commands('command.package.make');\n }", "protected function registerCommand()\n {\n $this->app->singleton('rockid.generate', function (){\n return new RockidGenerateCommand();\n });\n $this->commands('rockid.generate');\n }", "protected function registerRepo() {\n\t\t$this->app['snowman.repo'] = $this->app->share(function($app) {\n\t\t\t$generator = $this->app->make('Yhbyun\\Snowman\\Generator');\n\n\t\t\treturn new RepoGeneratorCommand($generator);\n\t\t});\n\n\t\t$this->commands('snowman.repo');\n\t}", "protected function registerMakeCommand()\n {\n $this->registerCommand('make', function($app) {\n return new MakeCommand(\n new ModuleMakeHandler($app['arcanedev.moduly'], $app['files'])\n );\n });\n }", "private function registerMakeControllerCommand()\n {\n $this->app->singleton('command.make.module.controller', function ($app) {\n return $app[MakeControllerCommand::class];\n });\n\n $this->commands('command.make.module.controller');\n }", "protected function createRepository()\n {\n if ($this->option('repository')) {\n $model = ucwords($this->getNameInput());\n\n $this->call('starter:repository', ['name' => $model . 'Repository']);\n }\n }", "protected function registerMakeModuleCommand()\n {\n // Make module command.\n $this->app->singleton('command.module.make', function ($app) {\n return new MakeModuleCommand();\n });\n\n $this->commands('command.module.make');\n }", "protected function registerMakeRequestCommand()\n {\n $this->registerCommand('make-request', function($app) {\n return new MakeRequestCommand(\n new ModuleMakeRequestHandler($app['arcanedev.moduly'], $app['files'])\n );\n });\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function ($app) {\n return $app[MakeModuleCommand::class];\n });\n\n $this->commands('command.make.module');\n }", "public function registerMakeTypeCommand()\n {\n $this->app->singleton('command.graphql.make.type', function ($app) {\n return new \\Folklore\\GraphQL\\Console\\TypeMakeCommand($app['files']);\n });\n }", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "public function registerCommand()\n {\n // app()->singleton('scaffold.generator', function(){\n // return Maker\\ScaffoldCommand::class;\n // });\n app()->singleton('scaffold.maker', function(){\n return new Maker\\MakerCommand;\n });\n app()->singleton('scaffold.remover', function(){\n return new Remover\\RemoverCommand;\n });\n\n $this->commands([\n // 'scaffold.generator',\n Maker\\ScaffoldCommand::class,\n 'scaffold.maker',\n 'scaffold.remover'\n ]);\n }", "protected function registerRepository()\n {\n $this->app['snowman.repository'] = $this->app->share(function ($app) {\n $generator = $app->make('Yhbyun\\Snowman\\Generator');\n\n return new RepositoryGeneratorCommand($generator);\n });\n\n $this->commands('snowman.repository');\n }", "private function registerMakeModelCommand()\n {\n $this->app->singleton('command.make.module.model', function ($app) {\n return $app[MakeModelCommand::class];\n });\n\n $this->commands('command.make.module.model');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Gets the public 'DiContainerBenchmarks\Fixture\B\FixtureB337' shared autowired service.
protected function getFixtureB337Service() { return $this->services['DiContainerBenchmarks\\Fixture\\B\\FixtureB337'] = new \DiContainerBenchmarks\Fixture\B\FixtureB337(); }
[ "protected function getFixtureB321Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB321'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB321();\n }", "protected function getFixtureB679Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB679'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB679();\n }", "protected function getFixtureB747Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB747'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB747();\n }", "protected function getFixtureB329Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB329'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB329();\n }", "protected function getFixtureB327Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB327'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB327();\n }", "protected function getFixtureB783Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB783'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB783();\n }", "protected function getFixtureB241Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB241'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB241();\n }", "protected function getFixtureB433Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB433'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB433();\n }", "protected function getFixtureB121Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB121'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB121();\n }", "protected function getFixtureB781Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB781'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB781();\n }", "protected function getFixtureB788Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB788'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB788();\n }", "protected function getFixtureB319Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB319'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB319();\n }", "protected function getFixtureB320Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB320'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB320();\n }", "protected function getFixtureB242Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB242'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB242();\n }", "protected function getFixtureB326Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB326'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB326();\n }", "protected function getFixtureB32Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB32'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB32();\n }", "protected function getFixtureB837Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB837'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB837();\n }", "protected function getFixtureB786Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB786'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB786();\n }", "protected function getFixtureB332Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB332'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB332();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Sets headers and reads file to output. Headers set: LastModified ContentLength ETag Expires Vary ContentEncoding(if needed) CacheControl Unsets Pragma
public function readToOutput(){ clearstatcache(); $modTime=filemtime($this->uri); header('Cache-Control: public,max-age='.$this->ttl,true); header('Pragma:',true); header('Last-Modified: '. gmdate('D, d M Y H:i:s',$modTime).' GMT' ,true); header('Content-Length: '.filesize($this->uri),true); header('ETag: "'.$this->etag.'"'); header('Vary: Accept-Encoding'); if(self::$gz && str_ends_with($this->uri, '.gz')){ header('Content-Encoding: gzip',true); } header('Expires: '.gmdate('D, d M Y H:i:s',$modTime+$this->ttl) .' GMT',true); return readfile($this->uri); }
[ "protected function updateFileHeaders() {\n $this->addHeader('Accept-Ranges', 'bytes');\n $this->addHeader('Content-type', $this->_file->getMimetype() ?? 'application/octet-stream');\n $this->addHeader(\"Pragma\", \"no-cache\");\n $this->addHeader('Cache-Control', 'public, must-revalidate, max-age=0');\n $this->addHeader(\"Content-Length\", $this->_downloadSize);\n }", "public function outputIfExists()\n {\n if (\n (isset($_GET['nocache']) && $_GET['nocache']) ||\n (isset($_GET['noresponsecache']) && $_GET['noresponsecache'])\n ) {\n return;\n }\n\n // Look for cached file\n if ($this->has()) {\n\n $headers = true;\n $handle = fopen($this->getPath(), 'r');\n\n $resHeaders = [\n 'X-Image-From-Cache' => 'true',\n 'X-Response-From-Cache' => 'true'\n ];\n\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n if ($headers) {\n if ($line === \"\\n\") {\n $headers = false;\n foreach ($resHeaders as $k => $v) {\n header($k . ': ' . $v);\n }\n continue;\n } else {\n $parts = explode('=', $line);\n $headerName = array_shift($parts);\n $headerValue = implode('=', $parts);\n $resHeaders[$headerName] = $headerValue;\n\n // Check if this is the expire header\n if (strtolower($headerName) === 'expires') {\n $expireDate = new DateTime($headerValue);\n if ((new DateTime()) > $expireDate) {\n $this->remove();\n }\n }\n }\n } else {\n echo $line;\n }\n }\n fclose($handle);\n exit;\n } else {\n // error opening the file.\n return;\n }\n }\n }", "private function setHeader() {\n\t\t@ob_get_clean();\n\t\theader(\"Content-Type: \".$this -> mimeType);\n\t\theader(\"Cache-Control: max-age=2592000, public\");\n\t\theader(\"Expires: \" . gmdate('D, d M Y H:i:s', time() + 2592000) . ' GMT');\n\t\theader(\"Last-Modified: \" . gmdate('D, d M Y H:i:s', $this -> mTime) . ' GMT');\n\n\t\t$this -> iStart = 0;\n\t\t$this -> iEnd = $this -> iSize - 1;\n\t\t\n\t\theader(\"Accept-Ranges: 0-\" . $this -> iEnd);\n\t\t\n\t\tif (isset($_SERVER['HTTP_RANGE'])) {\n\t\t\t$c_start = $this -> iStart;\n\t\t\t$c_end = $this -> iEnd;\n\t\t\t$this->isStream = true;\n\t\t\n\t\t\tlist(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);\n\t\t\t\n\t\t\tif (strpos($range, ',') !== false) {\n\t\t\t\theader('HTTP/1.1 416 Requested Range Not Satisfiable');\n\t\t\t\theader(\"Content-Range: bytes \".$this->iStart.\"-\".$this->iEnd.\"/\".$this->iSize);\n\t\t\t\texit ;\n\t\t\t}\n\t\t\tif ($range == '-') {\n\t\t\t\t$c_start = $this -> iSize - substr($range, 1);\n\t\t\t} else {\n\t\t\t\t$range = explode('-', $range);\n\t\t\t\t$c_start = $range[0];\n\t\t\t\t$c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $c_end;\n\t\t\t}\n\t\t\t$c_end = ($c_end > $this -> iEnd) ? $this -> iEnd : $c_end;\n\t\t\tif ($c_start > $c_end || $c_start > $this -> iSize - 1 || $c_end >= $this -> iSize) {\n\t\t\t\theader('HTTP/1.1 416 Requested Range Not Satisfiable');\n\t\t\t\theader(\"Content-Range: bytes \".$this->iStart.\"-\".$this->iEnd.\"/\".$this->iSize);\n\t\t\t\texit ;\n\t\t\t}\n\t\t\t$this -> iStart = $c_start;\n\t\t\t$this -> iEnd = $c_end;\n\t\t\t$length = $this -> iEnd - $this -> iStart + 1;\n\t\t\tif($this -> iStart > 0){\n\t\t\t\tfseek($this -> stream, $this -> iStart);\n\t\t\t}\n\t\t\theader('HTTP/1.1 206 Partial Content');\n\t\t\theader(\"Content-Length: \" . $length);\n\t\t\theader(\"Content-Range: bytes \".$this->iStart.\"-\".$this->iEnd.\"/\".$this->iSize);\n\t\t\t//\\OCP\\Util::writeLog('audioplayer','SEQ:'.$this->iStart.\"-\".$this->iEnd.\"/\".$this->iSize.'length:'.$length,\\OCP\\Util::DEBUG);\n\t\t} else {\n\t\t\theader(\"Content-Length: \" . $this -> iSize);\n\t\t\t$this->isStream = false;\n\t\t\t\n\t\t}\n\t}", "private function fileHeaders()\n {\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Content-Description: File Transfer');\n header('Content-type: text/csv');\n header('Content-Disposition: attachment; filename='.$this->filename);\n header('Expires: 0');\n header('Pragma: public');\n }", "private function setHeader()\n {\n ob_get_clean();\n header(\"Content-Type: audio/wav\");\n header(\"Cache-Control: max-age=2592000, public\");\n header(\"Expires: \".gmdate('D, d M Y H:i:s', time()+2592000) . ' GMT');\n header(\"Last-Modified: \".gmdate('D, d M Y H:i:s', filemtime($this->path)) . ' GMT' );\n $this->start = 0;\n $this->size = \\filesize($this->path);\n $this->end = $this->size - 1;\n \\header(\"Accept-Ranges: 0-\".$this->end);\n\n if (isset($_SERVER['HTTP_RANGE'])) {\n\n $c_start = $this->start;\n $c_end = $this->end;\n\n list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);\n if (strpos($range, ',') !== false) {\n header('HTTP/1.1 416 Requested Range Not Satisfiable');\n header(\"Content-Range: bytes $this->start-$this->end/$this->size\");\n exit;\n }\n if ($range == '-') {\n $c_start = $this->size - substr($range, 1);\n }else{\n $range = explode('-', $range);\n $c_start = $range[0];\n\n $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $c_end;\n }\n $c_end = ($c_end > $this->end) ? $this->end : $c_end;\n if ($c_start > $c_end || $c_start > $this->size - 1 || $c_end >= $this->size) {\n header('HTTP/1.1 416 Requested Range Not Satisfiable');\n header(\"Content-Range: bytes $this->start-$this->end/$this->size\");\n exit;\n }\n $this->start = $c_start;\n $this->end = $c_end;\n $length = $this->end - $this->start + 1;\n fseek($this->stream, $this->start);\n header('HTTP/1.1 206 Partial Content');\n header(\"Content-Length: \".$length);\n header(\"Content-Range: bytes $this->start-$this->end/\".$this->size);\n }\n else\n {\n header(\"Content-Length: \".$this->size);\n } \n\n }", "private function setHeaders()\n {\n // Set content file transfer\n header('Content-Description: File Transfer');\n // Set type file\n header('Content-Type: application/octet-stream');\n // Set name for the file\n header('Content-Disposition: attachment; filename=' . basename($this->name . '.' . $this->type));\n // Set encoding\n header('Content-Transfer-Encoding: binary');\n // Set expires\n header('Expires: 0');\n // Set cache control\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n // Set public\n header('Pragma: public');\n // Set file itself\n header('Content-Length: ' . filesize($this->file));\n // Clean ob\n echo $this->file;\n ob_clean();\n // Flush\n flush();\n // Read file for download\n readfile($this->file);\n // Exit\n exit;\n }", "private function setHeader()\n {\n ob_get_clean();\n header(\"Content-Type: video/mp4\");\n header(\"Cache-Control: max-age=2592000, public\");\n header(\"Expires: \".gmdate('D, d M Y H:i:s', time()+2592000) . ' GMT');\n header(\"Last-Modified: \".gmdate('D, d M Y H:i:s', @filemtime($this->path)) . ' GMT' );\n $this->start = 0;\n $this->size = filesize($this->path);\n $this->end = $this->size - 1;\n header(\"Accept-Ranges: 0-\".$this->end);\n \n if (isset($_SERVER['HTTP_RANGE'])) {\n \n $c_start = $this->start;\n $c_end = $this->end;\n \n list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);\n if (strpos($range, ',') !== false) {\n header('HTTP/1.1 416 Requested Range Not Satisfiable');\n header(\"Content-Range: bytes $this->start-$this->end/$this->size\");\n exit;\n }\n if ($range == '-') {\n $c_start = $this->size - substr($range, 1);\n }else{\n $range = explode('-', $range);\n $c_start = $range[0];\n \n $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $c_end;\n }\n $c_end = ($c_end > $this->end) ? $this->end : $c_end;\n if ($c_start > $c_end || $c_start > $this->size - 1 || $c_end >= $this->size) {\n header('HTTP/1.1 416 Requested Range Not Satisfiable');\n header(\"Content-Range: bytes $this->start-$this->end/$this->size\");\n exit;\n }\n $this->start = $c_start;\n $this->end = $c_end;\n $length = $this->end - $this->start + 1;\n fseek($this->stream, $this->start);\n header('HTTP/1.1 206 Partial Content');\n header(\"Content-Length: \".$length);\n header(\"Content-Range: bytes $this->start-$this->end/\".$this->size);\n }\n else\n {\n header(\"Content-Length: \".$this->size);\n } \n \n }", "private function setHeader()\n\t{\n\t\tob_get_clean();\n\t\theader(\"Content-Type: \" . $this->mime);\n\t\theader(\"Cache-Control: max-age=2592000, public\");\n\t\t//header(\"Cache-Control: max-age=1, public\");\n\t\theader(\"Expires: \" . gmdate('D, d M Y H:i:s', time()+1) . ' GMT');\n\t\theader(\"Last-Modified: \" . gmdate('D, d M Y H:i:s', @filemtime($this->video)) . ' GMT' );\n\n\t\t$this->start = 0;\n\t\t$this->size = filesize($this->video);\n\t\t$this->end = $this->size - 1;\n\t\theader(\"Accept-Ranges: 0-\" . $this->end);\n\n\t\tif (isset($_SERVER['HTTP_RANGE']))\n\t\t{\n\t\t\t$c_start = $this->start;\n\t\t\t$c_end = $this->end;\n\n\t\t\tlist(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);\n\n\t\t\tif (strpos($range, ',') !== false)\n\t\t\t{\n\t\t\t\theader('HTTP/1.1 416 Requested Range Not Satisfiable');\n\t\t\t\theader(\"Content-Range: bytes $this->start-$this->end/$this->size\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif ($range == '-')\n\t\t\t{\n\t\t\t\t$c_start = $this->size - substr($range, 1);\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t$range = explode('-', $range);\n\t\t\t\t$c_start = $range[0];\n\n\t\t\t\t$c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $c_end;\n\t\t\t}\n\n\t\t\t$c_end = ($c_end > $this->end) ? $this->end : $c_end;\n\n\t\t\tif ($c_start > $c_end || $c_start > $this->size - 1 || $c_end >= $this->size)\n\t\t\t{\n\t\t\t\theader('HTTP/1.1 416 Requested Range Not Satisfiable');\n\t\t\t\theader(\"Content-Range: bytes $this->start-$this->end/$this->size\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$this->start = $c_start;\n\t\t\t$this->end = $c_end;\n\t\t\t$length = $this->end - $this->start + 1;\n\n\t\t\tfseek($this->stream, $this->start);\n\t\t\theader('HTTP/1.1 206 Partial Content');\n\t\t\theader(\"Content-Length: \".$length);\n\t\t\theader(\"Content-Range: bytes $this->start-$this->end/\".$this->size);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Content-Length: \".$this->size);\n\t\t}\n\n\t}", "private function _setHeader()\n {\n ob_get_clean();\n header(\"Content-Type: video/mp4\");\n header(\"Content-Type: \".($this->_videoFormats[strtolower(pathinfo($this->_path, PATHINFO_EXTENSION))]));\n header(\"Cache-Control: max-age=2592000, public\");\n header(\"Expires: \".gmdate('D, d M Y H:i:s', time()+2592000) . ' GMT');\n header(\"Last-Modified: \".gmdate('D, d M Y H:i:s', @filemtime($this->_path)) . ' GMT');\n $this->_start = 0;\n $this->_size = filesize($this->_path);\n $this->_end = $this->_size - 1;\n header(\"Accept-Ranges: 0-\".$this->_end);\n \n if (isset($_SERVER['HTTP_RANGE'])) {\n \n $c_start = $this->_start;\n $c_end = $this->_end;\n \n list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);\n if (strpos($range, ',') !== false) {\n header('HTTP/1.1 416 Requested Range Not Satisfiable');\n header(\"Content-Range: bytes $this->_start-$this->_end/$this->_size\");\n exit;\n }\n if ($range == '-') {\n $c_start = $this->_size - substr($range, 1);\n } else {\n $range = explode('-', $range);\n $c_start = $range[0];\n \n $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $c_end;\n }\n $c_end = ($c_end > $this->_end) ? $this->_end : $c_end;\n if ($c_start > $c_end || $c_start > $this->_size - 1 || $c_end >= $this->_size) {\n header('HTTP/1.1 416 Requested Range Not Satisfiable');\n header(\"Content-Range: bytes $this->_start-$this->_end/$this->_size\");\n exit;\n }\n $this->_start = $c_start;\n $this->_end = $c_end;\n $length = $this->_end - $this->_start + 1;\n fseek($this->_stream, $this->_start);\n header('HTTP/1.1 206 Partial Content');\n header(\"Content-Length: \".$length);\n header(\"Content-Range: bytes $this->_start-$this->_end/\".$this->_size);\n } else {\n header(\"Content-Length: \".$this->_size);\n }\n }", "protected function setFileProperties() {\n date_default_timezone_set('UTC');\n $this->filesize = filesize($this->path);\n $this->timestamp = filemtime($this->path);\n $this->lastmod = preg_replace('/\\+0000$/', 'GMT', date('r', $this->timestamp));\n $inode = fileinode($this->path);\n // The f4a24ef etc strings - my understand in that\n // because of caching proxies, the Etag needs to be\n // different for different types of transfer encoding\n // (e.g. brotli, gzip, deflate) or content could be\n // delivered to a client that the client can not\n // decompress.\n // This class assumes only text files will potentially\n // be further compressed when serving.\n $etagEnd = 'f4a24ef';\n if($this->istext) {\n if(ini_get('zlib.output_compression')) {\n $accept = 'identity';\n if($this->minify) {\n $etagEnd = '3d';\n } else {\n $etagEnd = '4c';\n }\n if(isset($this->REQHEADERS['accept-encoding'])) {\n $T = trim(strtolower($this->REQHEADERS['accept-encoding']));\n if(strpos($T, 'gzip') !== FALSE) {\n $accept = 'gzip';\n } elseif(strpos($T, 'deflate') !== FALSE) {\n $accept = 'deflate';\n }\n }\n switch($accept) {\n case 'gzip':\n $etagEnd .= '7aa23';\n break;\n case 'deflate':\n $etagEnd .= '98db4';\n break;\n default:\n $etagEnd .= 'c41ca';\n }\n }\n }\n $this->etag = sprintf(\"%x-%x-%x-%s\", $inode, $this->filesize, $this->timestamp, $etagEnd);\n $this->checkFullFile();\n }", "protected function outputHeaders() {\n $controlFlags = [];\n if (!$this->cacheable) {\n $controlFlags[] = 'no-store';\n $controlFlags[] = 'no-cache';\n } else {\n if ($this->revalidate) {\n $controlFlags[] = 'no-cache';\n $controlFlags[] = 'must-revalidate';\n }\n $controlFlags[] = $this->private ? 'private' : 'public';\n if ($this->age > 0) {\n $controlFlags[] = 'max-age=' . (int)round($this->age);\n }\n if (!empty($this->ETag)) {\n $this->setHeader('ETag', $this->ETag);\n }\n if (!is_null($this->modifiedDate)) {\n $this->setHeader('Last-Modified', $this->httpUtils->formatDateTime($this->modifiedDate));\n }\n }\n if (!empty($controlFlags)) {\n $this->setHeader('Cache-Control', implode(', ', $controlFlags));\n }\n parent::outputHeaders();\n }", "function file_get_content_headers($file) {\n $type = mime_header_encode($file->filemime);\n\n return array(\n 'Content-Type' => $type,\n 'Content-Length' => $file->filesize,\n 'Cache-Control' => 'private',\n );\n}", "function cacheControl ($file, $timestamp) {\r\n if (!isset($_SESSION['isLogged'])) {\r\n if (!headers_sent()) {\r\n $gmt_mtime = gmdate('r', $timestamp);\r\n header('ETag: \"'.md5($timestamp.$file).'\"');\r\n header('Last-Modified: '.$gmt_mtime);\r\n header('Cache-Control: public');\r\n\r\n if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {\r\n if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $gmt_mtime || str_replace('\"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == md5($timestamp.$file)) {\r\n header('HTTP/1.1 304 Not Modified');\r\n }\r\n }\r\n }\r\n }\r\n}", "public static function cacheControl() {\n header(\"HTTP/1.1 304 Not Modified\");\n }", "private function setCacheHeaders($fileName)\n {\n // Determine last change of file\n $fileLastModified = gmdate('r', filemtime($fileName));\n\n // Generate E-Tag\n $fileEtag = hash('sha256', $fileLastModified.$fileName);\n\n\n // Set header\n $this->response->addHeader(\"Last-Modified: \".$fileLastModified);\n $this->response->addHeader(\"Etag: \".$fileEtag);\n // HTTP-status\n $headerModifiedSince = $this->request->getServerParam('HTTP_IF_MODIFIED_SINCE');\n $headerNoneMatch = $this->request->getServerParam('HTTP_IF_NONE_MATCH');\n if(\n !is_null($headerModifiedSince) && strtotime($fileLastModified) <= strtotime($headerModifiedSince) &&\n !is_null($headerNoneMatch) && $headerNoneMatch == $fileEtag\n ) {\n $this->response->setExit(true);\n $this->response->addHeader(\\nre\\core\\WebUtils::getHttpHeader(304));\n\n return true;\n }\n\n\n return false;\n }", "function smartReadFile($location, $filename, $mimeType = 'application/octet-stream'){\n if (!file_exists($location)){\n header (\"HTTP/1.1 404 Not Found\");\n return;\n }\n\n $size\t= filesize($location);\n $time\t= date('r', filemtime($location));\n\n $fm\t\t= @fopen($location, 'rb');\n if(!$fm){\n header (\"HTTP/1.1 505 Internal server error\");\n return;\n }\n\n $begin\t= 0;\n $end\t= $size - 1;\n\n if (isset($_SERVER['HTTP_RANGE'])){\n if (preg_match('/bytes=\\h*(\\d+)-(\\d*)[\\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)){\n $begin\t= intval($matches[1]);\n if (!empty($matches[2])){\n $end\t= intval($matches[2]);\n }\n }\n }\n\n if (isset($_SERVER['HTTP_RANGE'])) {\n header('HTTP/1.1 206 Partial Content');\n }else{\n header('HTTP/1.1 200 OK');\n }\n\n header(\"Content-Type: $mimeType\");\n header('Cache-Control: public, must-revalidate, max-age=0');\n header('Pragma: no-cache');\n header('Accept-Ranges: bytes');\n header('Content-Length:' . (($end - $begin) + 1));\n if (isset($_SERVER['HTTP_RANGE'])){\n header(\"Content-Range: bytes $begin-$end/$size\");\n }\n header(\"Content-Disposition: inline; filename=$filename\");\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Last-Modified: $time\");\n\n $cur\t= $begin;\n fseek($fm, $begin, 0);\n\n while(!feof($fm) && $cur <= $end && (connection_status() == 0)){\n print fread($fm, min(1024 * 16, ($end - $cur) + 1));\n $cur += 1024 * 16;\n }\n}", "function print_headers() \r\n{\r\n\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\r\n\theader(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\").\" GMT\");\r\n\theader(\"Cache-Control: no-cache, must-revalidate\");\r\n\theader(\"Pragma: no-cache\");\r\n}", "protected abstract function readFileHeader();", "private function _serveFile($file = NULL)\n {\n if (!is_file($file)) {\n show_404('requested url is invalid');\n }\n $Modified = filemtime($file);\n $gmdate_mod = gmdate('D, d M Y H:i:s', $Modified) . \" GMT\";\n\n if ($this->_usecache) {\n if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {\n $if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']);\n if ($if_modified_since >= $gmdate_mod) //Browser have the data\n {\n $this->CI->output->set_header('HTTP/1.1 304 Not Modified'); // HTTP/1.1\n //header('HTTP/1.1 304 Not Modified');\n $this->CI->we_are_done = TRUE;\n exit();\n }\n } //no cache found, so we serve original file\n } else {\n $this->CI->output->set_header(\"Cache-Control: no-cache, must-revalidate\"); //Cache-Controle\n //header(\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1\n $this->CI->output->set_header(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\"); //Date in the past\n // header(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\"); // Date in the past\n }\n\n $mime = get_mime_by_extension($file);\n\n $this->CI->output->set_header(\"HTTP/1.0 200 OK\")\n ->set_header(\"HTTP/1.1 200 OK\")\n ->set_content_type($mime)\n ->set_header('Last-Modified: ' . $gmdate_mod) //Last modified\n ->set_header('Content-Length: ' . filesize($file)) //Size of content help browser to monitor progress\n ->set_output(file_get_contents($file));\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enqueue CSS for frontend notice Use the 'migration_notice_disable_css' filter to disable, in case you styled it in your theme.
public function frontend_notice_style() { if( apply_filters( 'migration_notice_disable_css', false ) ) return; wp_enqueue_style( 'migration-notice', plugins_url( 'lib/css/migration-notice.css', __FILE__ ) ); }
[ "public function iwp_hide_notice_css() {\n $custom_css = \"\n body.wp-admin #wpbody .updated[style*=\\\"text-align: center; display:block !important;\\\"] {visibility:hidden}\n body.wp-admin #wpbody .updated[style*=\\\"text-align: center; display:block !important;\\\"] * {display:none !important}\n \";\n wp_add_inline_style( 'common', $custom_css );\n }", "public function disallowed_notice_css() {\n\t\tglobal $wp_registered_sidebars;\n\n\t\t$css = '';\n\t\tforeach ( $wp_registered_sidebars as $sidebar ) {\n\t\t\t// Generate CSS to toggle the notice visibility.\n\t\t\t$css .= $this->generate_sidebar_notice_css( $sidebar );\n\t\t}\n\t\t?>\n\n\t\t<style type=\"text/css\">\n\t\t.<?php echo $this->notice_identifier(); ?> {\n\t\t\tbackground: #c43;\n\t\t\tcolor: #fff;\n\t\t\tdisplay: none;\n\t\t\tfont-weight: bold;\n\t\t\tmargin: 14px 0 15px 0;\n\t\t\tpadding: 2px 15px;\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t<?php echo $css; ?>\n\t\t</style>\n\t\t<?php\n\t}", "public function print_beta_notice_css() {\n\t\t?>\n\t\t<style>\n\t\t\t.update-message .rank-math-beta-update-notice {\n\t\t\t\tfont-weight: bold;\n\t\t\t\tmargin-top: 20px;\n\t\t\t}\n\t\t\t.update-message p.rank-math-beta-update-notice:before {\n\t\t\t\tcontent: \"\\f534\";\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "function custom_admin_css() {\n echo '<style type=\"text/css\" media=\"screen\">\n #wpseo-dismiss-about, #wcml_translations_message, #ga_analyticator_global_notification { display: none !important; }\n </style>';\n}", "function aa_disable_notice_cust_integration()\n{\n\techo \"<style>.updated.redux-message.notice.is-dismissable{display: none;}</style>\";\n}", "public function show_vc_notice() {\r\n echo '<div class=\"updated\"><p>'.__('<strong>This theme</strong> requires <strong><a href=\"http://bit.ly/vcomposer\" target=\"_blank\">Visual Composer</a></strong> plugin to be installed and activated on your site.', 'Wyde').'</p></div>';\r\n }", "public function inLiveEditorRenderCSS()\n {\n if (defined('OP_LIVEEDITOR')) {\n wp_enqueue_style(OP_SN . '-flexslider', OPPP_BASE_URL . 'css/elements/flexslider' . OP_SCRIPT_DEBUG . '.css', array(), OPPP_VERSION, 'all');\n wp_enqueue_style(OP_SN . '-flexslider-custom-testimonials', OPPP_BASE_URL . 'css/elements/flexslider-custom' . OP_SCRIPT_DEBUG . '.css', array(), OPPP_VERSION, 'all');\n wp_enqueue_style(OP_SN . '-addon-testimonial-slider-admin', OPPP_BASE_URL . 'css/elements/op_testimonial_slider_admin' . OP_SCRIPT_DEBUG . '.css', array(), OPPP_VERSION, 'all');\n }\n }", "public function show_vc_notice() {\n echo '<div class=\"updated\"><p>'.__('<strong>This theme</strong> requires <strong><a href=\"http://bit.ly/vcomposer\" target=\"_blank\">Visual Composer</a></strong> plugin to be installed and activated on your site.', 'Vela').'</p></div>';\n }", "protected function add_admin_css() {\n\t\tif ($this->auto_render) {\n\t\t\t$this->template->styles['css/admin.css'] = NULL;\n\t\t}\n\t}", "function my_customizer_styles() {\n\t$css = '\n\t\t.no-widget-areas-rendered-notice p:nth-of-type(1) {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t.no-widget-areas-rendered-notice p:nth-of-type(2) {\n\t\t\tmargin-top: 0 !important;\n\t\t}\n\t';\n\tprintf( '<style>%s</style>', studio_minify_css( $css ) );\n}", "function dew_style_admin_bar_warning() {\n?>\n<style>\n#wpadminbar .dev-warning > div {\n color: red;\n font-size: 1.1em;\n font-weight: bold;\n cursor: default;\n}\n</style>\n<?php\n}", "function jacqueline_vc_frontend_scripts() {\n\t\tif (file_exists(jacqueline_get_file_dir('css/plugin.visual-composer.css')))\n\t\t\tjacqueline_enqueue_style( 'jacqueline-plugin.visual-composer-style', jacqueline_get_file_url('css/plugin.visual-composer.css'), array(), null );\n\t}", "public function inline_critical_css() {\n\t\tif ( $this->critical_css ) {\n\t\t\techo '<style>' . \"\\n\\t\\t\";\n\t\t\techo '/* STYLE HERE FOR GOOGLE BEST PRACTICES */' . \"\\n\\t\\t\";\n\t\t\techo $this->critical_css . \"\\n\\t\\t\"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\techo '</style>' . \"\\n\";\n\t\t}\n\t}", "public function admin_css() {\n\n\t\t$screen = get_current_screen();\n\n\t\tif ( ! isset( $screen->id ) || 'users' !== $screen->id ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t?>\n\t\t<style type=\"text/css\">\n\t\t.fixed .column-bdpass {\n\t\t\twidth: 150px;\n\t\t}\n\t\t@media screen and (max-width: 782px) {\n\t\t\t.fixed .column-bdpass {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t\t.bdpass-is-expired {\n\t\t\tcolor: #a00;\n\t\t}\n\t\t</style>\n\t\t<?php\n\n\t}", "function theme_admin_notices() {\n\n\t// Gutenberg Notice\n\t$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );\n\t$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );\n\tif( !$gutenberg && !$block_editor ) {\n\t\t$class = 'notice notice-error gutenberg';\n\t\t$message = __( '<strong>No block editor!</strong> Please contact tech support immediately to resolve the issue.', 'tu-boilerplate-gutenberg' );\n\t\tprintf( '<div class=\"%1$s\"><p>%2$s</p></div>', $class, $message ); \n\t}\n\n\t// ACF Notice\n if( !class_exists('acf') ) {\n \t$class = 'notice notice-error acf';\n \t$message = __( '<strong>ACF is missing!</strong> Please contact tech support immediately to resolve the issue.', 'tu-boilerplate-gutenberg' );\n \tprintf( '<div class=\"%1$s\"><p>%2$s</p></div>', $class, $message ); \n\t}\n\n\t// Core Functions Notice\n if( !function_exists('get_tulane_attribution_map') ) {\n \t$class = 'notice notice-error core-functions';\n \t$message = __( '<strong>Core Tulane Network functions are missing!</strong> Please contact tech support immediately to resolve the issue.', 'tu-boilerplate-gutenberg' );\n \tprintf( '<div class=\"%1$s\"><p>%2$s</p></div>', $class, $message ); \n\t}\n\n}", "public function wooconnector_admin_style()\n\t\t{\n\t\t\tif (is_admin()) {\n\t\t\t\twp_register_style('wooconnector-admin-style', plugins_url('assets/css/wooconnector-admin-style.css', WOOCONNECTOR_PLUGIN_FILE), array(), WOOCONNECTOR_VERSION, 'all');\n\t\t\t\twp_enqueue_style('wooconnector-admin-style');\n\t\t\t}\t\t\n\t\t\t//Script of post push notice\n\t\t\tif (is_admin() && isset($_GET['action']) && $_GET['action'] == 'edit' || is_admin() && isset($_GET['post_type']) && $_GET['post_type'] == 'product') {\n\t\t\t\twp_register_script('wooconnector_postpushnotice_script', plugins_url('assets/js/postpushnotice.js', WOOCONNECTOR_PLUGIN_FILE), array('jquery'), WOOCONNECTOR_VERSION);\n\t\t\t\t$remove = array(\n\t\t\t\t\t'base_url' => ABSPATH\n\t\t\t\t);\n\t\t\t\twp_localize_script('wooconnector_postpushnotice_script', 'wooconnector_postpushnotice_params', $remove);\n\t\t\t\twp_enqueue_script('wooconnector_postpushnotice_script');\n\t\t\t}\n\t\n\t\t\t// Enable Media popup\n\t\t\tif (is_admin() && isset($_GET['page']) && ($_GET['page'] == 'woo-notifications' || $_GET['page'] == 'wooconnector')) {\n\t\t\t\twp_enqueue_media();\n\t\t\t}\n\t\t}", "function jardiwinery_vc_frontend_scripts() {\n\t\tif (file_exists(jardiwinery_get_file_dir('css/plugin.visual-composer.css')))\n\t\t\twp_enqueue_style( 'jardiwinery-plugin.visual-composer-style', jardiwinery_get_file_url('css/plugin.visual-composer.css'), array(), null );\n\t}", "public function customization_notice() {\n\t\t?><div class=\"notice notice-warning is-dismissible\">\n\t\t\t<p>\n\t\t\t\t<strong><?php _e( 'Thank you for updating EDD Enhanced eCommerce Tracking.', 'edd-enhanced-ecommerce-tracking' ); ?></strong><br/>\n\t\t\t\t<?php _e( 'It appears you might be using a customization with regards to page tracking. With the new update this customization will need to be updated.', 'edd-enhanced-ecommerce-tracking' ); ?>\n\t\t\t</p>\n\t\t</div><?php\n\t}", "function cf_admin_style()\n{\n wp_enqueue_style('cf-admin-styles', get_template_directory_uri() . '/app/carbon-fields/cf-admin.css');\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes this Choreo. Execution object provides access to results appropriate for this ListAccountAliases Choreo.
public function execute($inputs = array(), $async = false, $store_results = true) { return new Amazon_IAM_ListAccountAliases_Execution($this->session, $this, $inputs, $async, $store_results); }
[ "public function setAliases($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->aliases = $arr;\n\n return $this;\n }", "public function getAliases();", "public function listGroupsAliases($groupKey, $optParams = [])\n {\n $params = ['groupKey' => $groupKey];\n $params = array_merge($params, $optParams);\n return $this->call('list', [$params], Aliases::class);\n }", "public function setAliasIpRanges($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Compute\\V1\\AliasIpRange::class);\n $this->alias_ip_ranges = $arr;\n\n return $this;\n }", "public function getAliasList();", "private function setAliases() {\n $path = sprintf('users/%s/drush_aliases', $this->id);\n $options = ['method' => 'get',];\n $response = $this->request->request($path, $options);\n\n $this->aliases = $response['data']->drush_aliases;\n }", "protected function wrapResults($outputs)\n {\n return new Amazon_IAM_ListAccountAliases_Results($outputs);\n }", "static public function getAliases()\n {\n return afsConsoleCommandHelper::create()->getAliases();\n }", "public function getEntitiesListAliases()\n {\n $entities = [];\n\n $mappingConfig = $this->getMappingConfig();\n foreach ($mappingConfig as $class => $mappingEntity) {\n $entities[$class] = isset($mappingEntity['alias']) ? $mappingEntity['alias'] : '';\n }\n\n return $entities;\n }", "public function getAliases(): array;", "public function aliases()\n {\n return collect($this->getManifest())->flatMap(function ($configuration) {\n return (array) ($configuration['aliases'] ?? []);\n })->filter()->all();\n }", "public function setUseIpAliases($var)\n {\n GPBUtil::checkBool($var);\n $this->use_ip_aliases = $var;\n\n return $this;\n }", "protected function deleteAliases()\n {\n return Alias::deleteAll(['entity' => parent::className(), 'entity_id' => $this->primaryKey]);\n }", "public function getAliases() : array;", "public function definingAliasesAction()\n {\n $this->createExampleDisplayTemplate(\"Defining Aliases\", \"_aliases\");\n\n return $this->view();\n }", "private function getAliasesIDs()\n {\n return $this->migration->getAliasesIDs();\n }", "public function getAccountAlias(){\n\t\t\n\t\tif(!$this->hasAccount())\n\t\t\treturn false;\n\t\t\n\t\treturn $this->_alias;\n\t}", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Amazon_IAM_DeleteAccountAlias_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "protected function getAliases()\n {\n return AliasLoader::getInstance()->getAliases();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a form to edit an existing DataCentrohipico entity.
public function editAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('CentrohipicoBundle:DataCentrohipico')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find DataCentrohipico entity.'); } $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id); return $this->render('CentrohipicoBundle:DataCentrohipico:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
[ "private function editar()\n {\n //Verifica se o formulário foi postado\n if ($_SERVER['REQUEST_METHOD'] == \"POST\")\n {\n //Solicita o cadastramento do Contato\n $resultado = $this->Delegator('ConcreteContatos', 'EditaContatos', $this->getPost());\n }\n else\n {\n //Localiza o Contato\n $dados_contatos = $this->Delegator('ConcreteContatos', 'SelectContatosEditar', $this->getParam());\n\n //Busca os estados\n $this->getEstados();\n\n foreach($dados_contatos as $key => $cidades)\n {\n $dados_cidade = $this->buscaCidadesEditar($cidades['cod_estado']);\n $dados_contatos[$key]['cidades'] = $dados_cidade;\n }\n\n //Dados do Contato\n $this->View()->assign('dados_contatos', $dados_contatos);\n\n //envia o cod_relacao_idioma para a view\n $this->View()->assign('cod_relacao_idioma', $this->getParam('cod_relacao_idioma'));\n\n //Exibe a view\n $this->View()->display('editar.php');\n }\n }", "private function editar()\n {\n //Verifica se o formulário foi postado\n if($_SERVER['REQUEST_METHOD'] == \"POST\")\n {\n //Solicita o cadastramento do Conteudo\n $this->Delegator('ConcreteDicas', 'EditaDica', $this->getPost());\n }\n else\n {\n //Valida o id do Conteudo\n if ($this->getParam('cod_id') !== false && is_numeric($this->getParam('cod_id')))\n {\n //Localiza o Conteudo\n $dados_dica = $this->Delegator('ConcreteDicas', 'SelectDicaRelacaoIdEditar', $this->getParam());\n \n //Busca os idiomas\n $this->getIdiomas();\n \n //Dados do Conteudo\n $this->View()->assign('dados_dica', $dados_dica);\n $this->View()->assign('altura_crop', $this->altura_crop);\n $this->View()->assign('largura_crop', $this->largura_crop);\n $this->View()->assign('altura_cropada', $this->altura_cropada);\n $this->View()->assign('largura_cropada', $this->largura_cropada);\n }\n\n //Exibe a view\n $this->View()->display('editar.php');\n }\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('QQiRecordappBundle:Ciclo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Ciclo entity.');\n }\n\n $editForm = $this->createForm(new CicloType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('QQiRecordappBundle:Ciclo:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Costo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Costo entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BackendBundle:Costo:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('OsBundle:Tecnico')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Tecnico entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('OsBundle:Tecnico:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('DistribucionBundle:Operador')->find($id);\n \n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Operador entity.');\n }\n\n $editForm = $this->createForm(new OperadorType($entity->getPais()->getId()), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n $representante = $em->getRepository('DistribucionBundle:Representante')->RepresentanteOperador($id);\n\n\n $verifica=null;\n return $this->render('DistribucionBundle:Operador:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n 'representante' => $representante,\n 'verifica'=>$verifica\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('GicsdrArmatucanastaBundle:Cocina')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Cocina entity.');\n }\n\n $editForm = $this->createForm(new CocinaType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('GicsdrArmatucanastaBundle:Cocina:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id) {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entity = $em->getRepository('GestionEmploisBundle:Emploi')->find($id);\r\n $tD = $entity->getHeureDeb()->format('H:i');\r\n $tF = $entity->getHeureFin()->format('H:i');\r\n\r\n\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Emploi entity.');\r\n }\r\n\r\n $editForm = $this->createForm(new EmploiModifType($tD, $tF), $entity);\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('GestionEmploisBundle:Emploi:edit.html.twig', array(\r\n 'entity' => $entity,\r\n 'edit_form' => $editForm->createView(),\r\n 'delete_form' => $deleteForm->createView(),\r\n ));\r\n }", "public function editAction($id)\n { \n $request = $this->getRequest();\n $locale = $request->getLocale();\n\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('FrontendBundle:Comercio')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Comercio entity.');\n }\n\n $editForm = $this->createEditForm($entity); \n\n return $this->render('FrontendBundle:Comercio:edit.html.twig', array(\n 'entity_comercio' => $entity,\n 'edit_form' => $editForm->createView(),\n 'lenguaje' => $locale \n ));\n }", "public function editAction($id)\n {\n $request = $this->getRequest();\n $locale = $request->getLocale(); \n\n $usuario = $this->get('security.context')->getToken()->getUser();\n $id_usuario=$usuario->getId();\n\n $em = $this->getDoctrine()->getManager();\n $entity_comerciohor = $em->getRepository('FrontendBundle:Comerciohor')->find($id);\n\n if (!$entity_comerciohor) {\n throw $this->createNotFoundException('Unable to find Comerciohor entity.');\n }\n \n $entity_comercio = $em->getRepository('FrontendBundle:Comercio')->find($id_usuario); \n\n if( $id_usuario == $entity_comerciohor->getComercio()->getId() )\n {\n $editForm = $this->createEditForm($entity_comerciohor);\n $deleteForm = $this->createDeleteForm($id);\n \n return $this->render('FrontendBundle:Comerciohor:edit.html.twig', array( \n 'entity_comerciohor' => $entity_comerciohor,\n 'entity_comercio' => $entity_comercio, \n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(), \n 'lenguaje' => $locale \n ));\n }\n else\n {\n return $this->redirect($this->generateUrl('comerciohor'));\n }\n }", "public function editAction($id)\n {\n $idForm = $this->getRequest()->get(\"idForm\");\n// $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n// $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"home_page\"));\n// $breadcrumbs->addItem(\"Infraccion\", $this->get(\"router\")->generate(\"infraccion\"));\n// $breadcrumbs->addItem(\"Editar\");\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('InfraccionBundle:Infraccion')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Infraccion entity.');\n }\n\n $editForm = $this->createForm(new InfraccionType(), $entity);\n\n return $this->render('InfraccionBundle:Infraccion:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'idForm' => $idForm,\n 'error' => \"\",\n ));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AppBundle:Compania')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Compania entity.');\n }\n\n $editForm = $this->createForm(CompaniaType::class, $entity);\n\n return $this->render('AppBundle:Compania:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $editForm->createView()\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Contenedor')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Contenedor entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n\n return $this->render('BackendBundle:Contenedor:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ChoferesBundle:ChoferCurso')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find ChoferCurso entity.');\n }\n\n $editForm = $this->createForm(new ChoferCursoType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ChoferesBundle:ChoferCurso:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('i52LTPVFrontendBundle:Socio')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Socio entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('i52LTPVBackendBundle:Socio:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AppBundle:Sucursal')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No existe la Sucursal.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AppBundle:Sucursal:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('FocalAppBundle:DatosdFamilia')->find($id);\n \n if (!$entity) {\n throw $this->createNotFoundException('Unable to find DatosdFamilia entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('FocalAppBundle:DatosdFamilia:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n //'delete_form' => $deleteForm->createView(),\n 'idenc' => $entity->getIdEnc(),\n 'parsel' => $entity->getIdParentesco(),\n 'etniasel' => $entity->getIdEtnia(),\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('DistribucionBundle:Objetocomodato')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Objetocomodato entity.');\n }\n\n $editForm = $this->createForm(new ObjetocomodatoType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('DistribucionBundle:Objetocomodato:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('TechTBundle:Tbreltecnicoproyecto')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Tbreltecnicoproyecto entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('TechTBundle:Tbreltecnicoproyecto:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation itemMineGet List owned items
public function itemMineGet($context_id = null, $offset = null, $limit = null) { list($response) = $this->itemMineGetWithHttpInfo($context_id, $offset, $limit); return $response; }
[ "public function listOwnItems(){\n $userId = $_SESSION['userID'];\n $item = new Item();\n $data=$item->listOwnItems($userId);\n }", "public static function getMySharedItems() {\n\t\t$query = OC_DB::prepare(\"SELECT uid_shared_with, source, permissions FROM *PREFIX*sharing WHERE uid_owner = ?\");\n\t\treturn $query->execute(array(OCP\\USER::getUser()))->fetchAll();\n\t}", "public function item()\n {\n return $this->hasMany(\n Item::class,\n 'user_id',\n 'id'\n );\n }", "public function getItmitem() {\n\t\treturn ItemMasterItemQuery::create()->findOneByItemid($this->itemid);\n\t}", "public static function checkOwnItem\n\t(\n\t\t$uniID\t\t\t// <int> The Uni-Account to check the item for.\n\t,\t$itemID\t\t\t// <int> The item to check if you own.\n\t)\t\t\t\t\t// RETURNS <bool> TRUE on success, or FALSE if failed.\n\t\n\t// AppAvatar::checkOwnItem($uniID, $itemID);\n\t{\n\t\treturn (Database::selectValue(\"SELECT item_id FROM user_items WHERE uni_id=? AND item_id=? LIMIT 1\", array($uniID, $itemID))) ? true : false;\n\t}", "public function getItemsBorrowedByUser()\n {\n $id = $this->request->id;\n $user = new BorrowerService();\n try {\n $result = $user->getItemsBorrowedByuserId($id);\n if (count($result) > 0) {\n return response()->json([\n 'Success' => true,\n 'Items' => $result\n ], 200);\n }\n return response()->json([\n 'Success' => false,\n 'Items' => \"no items found for user with ID $id\"\n ], 404);\n\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'your request could not be completed'\n ], 500);\n }\n }", "public function getItems()\r\n {\r\n return $this->user->wishlistItems;\r\n }", "public function addOwnItem(string $item_id, int $created_by)\n\t{\n\t\tif ($this->app->user->id == $created_by) {\n\t\t\t$this->own_item_ids[] = $item_id;\n\t\t}\n\n\t\treturn $this;\n\t}", "function take_items($member_id)\n{\n list($realm, ,) = get_loc_details($member_id);\n $realm_troll = -$realm - 1;\n\n while ($GLOBALS['SITE_DB']->query_select_value('w_inventory', 'COUNT(*)', array('item_owner' => $member_id)) > 0) {\n $item_name = $GLOBALS['SITE_DB']->query_select_value('w_inventory', 'item_name', array('item_owner' => $member_id));\n\n remove_item_person($member_id, $item_name);\n add_item_person($realm_troll, $item_name);\n }\n}", "public function getItems()\n {\n return $this->profile_items;\n }", "public function findOpenItems ( )\n {\n return $this->executeRequest('openitems','GET');\n }", "public function getOwnItemList($uid){\n\t\treturn $this->select(\"item\", \"*\", \"parent_id='Root_$uid'\", \"time ASC\");\n\t}", "public function findOpenItems()\n {\n return $this->executeRequest('openitems', 'GET');\n }", "public function showMine(){\n return response()->api(Item::where('parent_id', null)->with('type','categories', 'style', 'indicator','children')->get());\n\n\n }", "public static function getItemsSharedWith() {\n\t\t$query = OC_DB::prepare(\"SELECT * FROM *PREFIX*sharing WHERE uid_shared_with = ?\");\n\t\treturn $query->execute(array($_SESSION['user_id']))->fetchAll();\n\t}", "public function getOwners();", "function getItems(){\n\t$result = pg_query(getConn(), \"\n\tselect * from crime_db.item_involved\");\n\t// $a = trim('1'); \n\t// $query = \"select * from crime_db.item_involved where marker_id = '\" . \"2\" . \"';\"; \n\t// $result = pg_query(getConn(), $query); \n\tif (!$result) {\n\t\t\techo \"An error occurred.\\n\";\n\t\t\texit;\n\t}\n\telse{\n\t\twhile($row = pg_fetch_array($result)){\n\t\t\t\t\t\t\t$account[] = $row;\n\t\t\t\t\t\t}\n\t} \n\treturn $account;\n\t}", "public function returnedItems()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = item_id, localKey = item_id)\n return $this->hasMany('App\\ReturnedItem','item_id','item_id');\n }", "public function items() {\n return $this->hasManyThrough(\\Restaurant\\Api\\V1\\Models\\Item::class, \\Restaurant\\Api\\V1\\Models\\OrderItem::class, 'order_id', 'id');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation crceGroupAdministrationLeaveWithHttpInfo leaves the Community group
public function crceGroupAdministrationLeaveWithHttpInfo($customer_account_id, $subscription_id, $correlation_id = null, $transaction_id = null, $user = null) { // verify the required parameter 'customer_account_id' is set if ($customer_account_id === null) { throw new \InvalidArgumentException('Missing the required parameter $customer_account_id when calling crceGroupAdministrationLeave'); } // verify the required parameter 'subscription_id' is set if ($subscription_id === null) { throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling crceGroupAdministrationLeave'); } // parse inputs $resourcePath = "/customers/{customerAccountId}/subscriptions/{subscriptionId}/group/leave"; $httpBody = ''; $queryParams = []; $headerParams = []; $formParams = []; $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); // header params if ($correlation_id !== null) { $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id); } // header params if ($transaction_id !== null) { $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id); } // header params if ($user !== null) { $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user); } // path params if ($customer_account_id !== null) { $resourcePath = str_replace( "{" . "customerAccountId" . "}", $this->apiClient->getSerializer()->toPathValue($customer_account_id), $resourcePath ); } // path params if ($subscription_id !== null) { $resourcePath = str_replace( "{" . "subscriptionId" . "}", $this->apiClient->getSerializer()->toPathValue($subscription_id), $resourcePath ); } // default format to json $resourcePath = str_replace("{format}", "json", $resourcePath); // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey'); if (strlen($apiKey) !== 0) { $headerParams['accessKey'] = $apiKey; } // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'DELETE', $queryParams, $httpBody, $headerParams, '\iNew\Rest6_1\Model\GroupResponseWrapper', '/customers/{customerAccountId}/subscriptions/{subscriptionId}/group/leave' ); return [$this->apiClient->getSerializer()->deserialize($response, '\iNew\Rest6_1\Model\GroupResponseWrapper', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\iNew\Rest6_1\Model\GroupResponseWrapper', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 400: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\iNew\Rest6_1\Model\RestError', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\iNew\Rest6_1\Model\RestError', $e->getResponseHeaders()); $e->setResponseObject($data); break; } throw $e; } }
[ "public function crceGroupAdministrationLeaveSubscriptionWithHttpInfo($subscription_id, $correlation_id = null, $transaction_id = null, $user = null)\n {\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling crceGroupAdministrationLeaveSubscription');\n }\n // parse inputs\n $resourcePath = \"/subscriptions/{subscriptionId}/group/leave\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\GroupResponseWrapper',\n '/subscriptions/{subscriptionId}/group/leave'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\GroupResponseWrapper', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\GroupResponseWrapper', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "function leaveGroup()\n\t{\n\t\t$groupId\t= JRequest::getVar('groupid' , '' , 'POST');\n\t\tCError::assert( $groupId , '' , '!empty' , __FILE__ , __LINE__ );\n\n\t\t$model\t\t=& $this->getModel('groups');\n\t\t$my\t\t\t= CFactory::getUser();\n\n\t\tif( $my->id == 0 )\n\t\t{\n\t\t\treturn $this->blockUnregister();\n\t\t}\n\t\t\n\t\t$data\t\t= new stdClass();\n\t\t$data->groupid\t= $groupId;\n\t\t$data->memberid\t= $my->id;\n\n\t\t$model->removeMember($data);\n\t\t\n\t\t//add user points\n\t\tCFactory::load( 'libraries' , 'userpoints' );\t\t\n\t\tCUserPoints::assignPoint('group.leave');\t\t\n\n\t\t$model->substractMembersCount( $groupId );\n\n\t\t$mainframe =& JFactory::getApplication();\n\t\t\n\t\t//trigger for onGroupLeave\n\t\t$group = $model->getGroup($groupId);\n\t\t$this->triggerGroupEvents( 'onGroupLeave' , $group , $my->id);\n\t\t\n\t\t$mainframe->redirect( CRoute::_('index.php?option=com_community&view=groups' , false) , JText::_('CC SUCCESS LEFT GROUP') );\n\t}", "public function testLeaveGroupFailure()\n\t{\n\t\t$group_id = '12345';\n\n\t\t$path = '/v1/people/~/group-memberships/' . $group_id;\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 401;\n\t\t$returnData->body = 'unauthorized';\n\n\t\t$this->client->expects($this->once())\n\t\t\t->method('delete')\n\t\t\t->with($path)\n\t\t\t->will($this->returnValue($returnData));\n\n\t\t$this->object->leaveGroup($group_id);\n\t}", "function cv_leave_group($event, $type, $params)\r\n{\r\n $cv_group = $params['group'];\r\n if (!$cv_group->cvcohort)\r\n {\r\n return;\r\n }\r\n $cv_course = $cv_group->getContainerEntity();\r\n $cv_user = $params['user'];\r\n remove_user_from_access_collection($cv_user->guid, $cv_course->cv_acl);\r\n system_message($cv_user->name . \" is no longer in the cohort: \" . $cv_group->name);\r\n}", "function leaveGroup()\n\t{\n\t\tglobal $rbacadmin, $rbacreview;\n\n\t\t$member_ids = $this->getGroupMemberIds();\n\n\t\tif (count($member_ids) <= 1 || !in_array($this->ilias->account->getId(), $member_ids))\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!$this->isAdmin($this->ilias->account->getId()))\n\t\t\t{\n\t\t\t\t$this->leave($this->ilias->account->getId());\n\t\t\t\t$member = new ilObjUser($this->ilias->account->getId());\n\t\t\t\t$member->dropDesktopItem($this->getRefId(), \"grp\");\n\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse if (count($this->getGroupAdminIds()) == 1)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}", "public function leave(\\App\\Group $group){\n return view('groups.leave', ['group'=>$group]);\n }", "protected function actionLeaveCluster(){\n\t\t$response = $this->server->leaveCluster();\n\t\t$this->sendResponse($response);\n\t}", "function setup_leavemessage($name, $email, $group_id, $info, $referrer)\n{\n $data = prepare_chat_app_data();\n\n // Create some empty arrays\n $data['leaveMessage'] = array();\n\n $group = group_by_id($group_id);\n $group_name = '';\n if ($group) {\n $group_name = get_group_name($group);\n }\n\n $data['leaveMessage']['leaveMessageForm'] = array(\n 'name' => $name,\n 'email' => $email,\n 'groupId' => $group_id,\n 'groupName' => $group_name,\n 'info' => $info,\n 'referrer' => $referrer,\n 'showCaptcha' => (bool) (Settings::get(\"enablecaptcha\") == \"1\" && can_show_captcha()),\n );\n\n $data['page.title'] = (empty($group_name) ? '' : $group_name . ': ')\n . getlocal('Leave your message');\n $data['leaveMessage']['page'] = array(\n 'title' => $data['page.title']\n );\n\n // Set privacy policy link (if needed)\n if (Settings::get('enableprivacypolicy')\n && strcmp('', Settings::get('privacypolicy'))) {\n $data['leaveMessage']['leaveMessageForm']['privacyPolicyUrl'] = Settings::get('privacypolicy');\n }\n\n if (Settings::get('enablegroups') == '1') {\n $data['leaveMessage']['leaveMessageForm']['groups']\n = prepare_groups_select($group_id);\n }\n\n $data['startFrom'] = 'leaveMessage';\n\n return $data;\n}", "public function leaveGroups() {\n if (permission::permitted('formdata-leavetypes')=='fail'){\n\t\t return view('errors.permission-denied');\n }\n\n $lt = table::leavetypes()->get();\n $lg = table::leavegroup()->get();\n\n return view('admin.fields.leave-groups', compact('lt', 'lg'));\n }", "public function managerLeaveRequestOverlappingLeaveAsyncWithHttpInfo($from_date, $to_date, $business_id, string $contentType = self::contentTypes['managerLeaveRequestOverlappingLeave'][0])\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ManagerLeaveRequestModel[]';\n $request = $this->managerLeaveRequestOverlappingLeaveRequest($from_date, $to_date, $business_id, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n 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 (string) $response->getBody()\n );\n }\n );\n }", "public function leave_request() {\n if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'erp-leave-req-new' ) ) {\n die( __( 'Something went wrong!', 'wp-erp' ) );\n }\n\n $employee_id = isset( $_POST['employee_id'] ) ? intval( $_POST['employee_id'] ) : 0;\n $leave_policy = isset( $_POST['leave_policy'] ) ? intval( $_POST['leave_policy'] ) : 0;\n $start_date = isset( $_POST['leave_from'] ) ? sanitize_text_field( $_POST['leave_from'] ) : date_i18n( 'Y-m-d' );\n $end_date = isset( $_POST['leave_to'] ) ? sanitize_text_field( $_POST['leave_to'] ) : date_i18n( 'Y-m-d' );\n $leave_reason = isset( $_POST['leave_reason'] ) ? strip_tags( $_POST['leave_reason'] ) : '';\n\n $insert = erp_hr_leave_insert_request( array(\n 'user_id' => $employee_id,\n 'leave_policy' => $leave_policy,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'reason' => $leave_reason\n ) );\n\n if ( ! is_wp_error( $insert ) ) {\n $redirect_to = admin_url( 'admin.php?page=erp-leave&view=new&msg=submitted' );\n } else {\n $redirect_to = admin_url( 'admin.php?page=erp-leave&view=new&msg=error' );\n }\n\n wp_redirect( $redirect_to );\n exit;\n }", "public function managerEmployeeLeaveRequestEstimateWithHttpInfo($employee_id, $from_date, $to_date, $leave_category_id, $business_id, string $contentType = self::contentTypes['managerEmployeeLeaveRequestEstimate'][0])\n {\n $request = $this->managerEmployeeLeaveRequestEstimateRequest($employee_id, $from_date, $to_date, $leave_category_id, $business_id, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\ManagerLeaveEstimate' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\ManagerLeaveEstimate' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ManagerLeaveEstimate', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\ManagerLeaveEstimate';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ManagerLeaveEstimate',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function auPayRunBulkApplyLeaveRequestsWithHttpInfo($pay_run_id, $business_id, $bulk_apply_leave_request_model, string $contentType = self::contentTypes['auPayRunBulkApplyLeaveRequests'][0])\n {\n $request = $this->auPayRunBulkApplyLeaveRequestsRequest($pay_run_id, $business_id, $bulk_apply_leave_request_model, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\ApplyLeaveRequestResult' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\ApplyLeaveRequestResult' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ApplyLeaveRequestResult', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\ApplyLeaveRequestResult';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ApplyLeaveRequestResult',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function leave(){\n try{\n $postdata=$this->input->post();\n $user=$this->user;\n $group_user_id=$postdata[\"group_user_id\"];\n //validate the group user id submitted\n $group_user_data=MedicalGroupUsers::find_by_id($group_user_id);\n $response=array(\"status\"=>FALSE,\"message\"=>\"Something went wrong. Please try again later.\");\n if(!empty($group_user_data) && $group_user_data->user_id==$user->id){\n $group_user_data->active=0;\n $group_user_data->note=$postdata[\"note\"];\n $group_user_data->save();\n $response=array(\"status\"=>TRUE,\"message\"=>\"Success\");\n }\n echo json_encode($response);\n }\n catch(Exception $ex){\n echo json_encode(array(\"status\"=>FALSE,\"message\"=>\"Invalid Data submitted.\".$ex->getMessage()));\n }\n }", "public function leaveCluster(){\n\t\t$this->clusterManager->leaveCluster();\n\n\t\t$response = new Ric_Server_Response();\n\t\t$response->setResult(['status' => 'OK']);\n\t\treturn $response;\n\t}", "public function crceGroupAdministrationLeaveSubscription($subscription_id, $correlation_id = null, $transaction_id = null, $user = null)\n {\n list($response) = $this->crceGroupAdministrationLeaveSubscriptionWithHttpInfo($subscription_id, $correlation_id, $transaction_id, $user);\n return $response;\n }", "public function managerEmployeeLeaveRequestUpdateLeaveWithHttpInfo($employee_id, $leave_request_id, $business_id, $leave_application, string $contentType = self::contentTypes['managerEmployeeLeaveRequestUpdateLeave'][0])\n {\n $request = $this->managerEmployeeLeaveRequestUpdateLeaveRequest($employee_id, $leave_request_id, $business_id, $leave_application, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\ManagerLeaveRequestModel' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\ManagerLeaveRequestModel' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ManagerLeaveRequestModel', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\ManagerLeaveRequestModel';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ManagerLeaveRequestModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function setup_leavemessage($name, $email, $group_id, $info, $referrer) {\n\t$data = prepare_chat_app_data();\n\n\t// Load JavaScript plugins and JavaScripts, CSS files required by them\n\t$data = array_merge_recursive($data, get_plugins_data('client_chat_window'));\n\n\t// Create some empty arrays\n\t$data['leaveMessage'] = array();\n\n\t$group = group_by_id($group_id);\n\t$group_name = '';\n\tif ($group) {\n\t\t$group_name = get_group_name($group);\n\t}\n\n\t$data['leaveMessage']['leaveMessageForm'] = array(\n\t\t'name' => topage($name),\n\t\t'email' => topage($email),\n\t\t'groupId' => $group_id,\n\t\t'groupName' => $group_name,\n\t\t'info' => topage($info),\n\t\t'referrer' => topage($referrer),\n\t\t'showCaptcha' => (bool)(Settings::get(\"enablecaptcha\") == \"1\"\n\t\t\t&& can_show_captcha())\n\t);\n\n\t$data['page.title'] = (empty($group_name)?'':$group_name.': ')\n\t\t. getlocal('leavemessage.title');\n\t$data['leaveMessage']['page'] = array(\n\t\t'title' => $data['page.title']\n\t);\n\n\tif (Settings::get('enablegroups') == '1') {\n\t\t$data['leaveMessage']['leaveMessageForm']['groups']\n\t\t\t= prepare_groups_select($group_id);\n\t}\n\n\t$data['startFrom'] = 'leaveMessage';\n\n\treturn $data;\n}", "public function actionLeave()\n {\n $this->forcePostRequest();\n\n $id = Yii::$app->request->get('id');\n $message = $this->getMessage($id);\n\n if ($message == null) {\n throw new HttpException(404, 'Could not find message!');\n }\n\n $message->leave(Yii::$app->user->id);\n\n if (Yii::$app->request->isAjax) {\n return $this->htmlRedirect(['index']);\n } else {\n return $this->redirect(['index']);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test passing a string to the echoArray() method, this should throw a RemoteException.
#[@test, @expect('remote.RemoteException')] public function incorrectArgumentsToArrayMethod() { $this->instance->echoArray('A STRING, MAN!'); }
[ "public function testNormalizeArrayStringFailure()\n {\n $data = uniqid('string-');\n $subject = $this->createInstance();\n $_subject = $this->reflect($subject);\n\n $this->setExpectedException('InvalidArgumentException');\n $_subject->_normalizeArray($data);\n }", "public function testFromString_WithArray() {\n $this->expectException(InvalidDataTypeException::class);\n $this->csv->fromString(array());\n\t}", "public function testIfIsArrayOfStringsThrows() : void\n {\n\n $this->expectException(TypeHintingFailException::class);\n\n $array = [ 'string1', 3, true ];\n\n $this->assertFalse(TypeHinting::isArrayOfStrings($array));\n }", "public function testIfIsArrayOfStringsRfof() : void\n {\n\n $array = [ 'string1', 3, true ];\n\n $this->assertFalse(TypeHinting::isArrayOfStrings($array, false, false));\n }", "public function dataForTestAddThrowsExceptionIfParameterIsNotString()\n {\n return array(\n array(1),\n array(2),\n array(true),\n array(array()),\n array(new \\StdClass()),\n array(null),\n );\n }", "public function testInvalidArrayValue()\n {\n $this->assertFalse($this->array->execute('badvalue'));\n }", "public function testWithArrayAccessAndUTF8Strings()\n {\n $this->specify(\n \"Translator with array access and UTF8 strings\",\n function () {\n $language = $this->config['ru'];\n $translator = new NativeArray(['content' => $language]);\n\n $vars = [\n 'fname' => 'John',\n 'lname' => 'Doe',\n 'mname' => 'D.',\n ];\n\n expect($translator->_('Hello %fname% %mname% %lname%!', $vars))->equals('Привет, John D. Doe!');\n }\n );\n }", "public function testArrayFilterWithSingleValue() {\n $this->setExpectedException(TamperException::class, 'Input should be an array.');\n $this->plugin->tamper('foo');\n }", "public function testToArrayByString(): void\n {\n $this->assertSame(['a', 'b', 'c', 'd'], Arr::toArray('a.b.c.d'));\n }", "public function testFetchArray()\n {\n $this->todo('stub');\n }", "#[@test]\n public function decodeStringArray() {\n $this->assertEquals(\n array('foo', 'bar'),\n $this->decoder->decode('[ \"foo\" , \"bar\" ]')\n );\n }", "public function testArrayAccessUnsetCharacter() {\n\t\t$this->setExpectedException(\"\\Scrivo\\SystemException\");\n\t\t$str = new ByteArray(self::testStr);\n\t\tunset($str[1]);\n\t}", "public function testFromResource_WithArray() {\n $this->expectException(InvalidResourceException::class);\n $this->csv->fromResource(array());\n\t}", "public function testEchoMultiArray() {\n $this->doEcho(array('a' => 'b', 'c' => array('d', 'e')));\n }", "public function testMagicCall()\n {\n $client = new Client($this->options);\n $emails = $client->emails();\n\n $this->assertTrue(is_array($emails));\n }", "public function testAdapterQuoteArray()\n {\n $array = array(\"it's\", 'all', 'right!');\n $value = $this->_db->quote($array);\n $this->assertEquals(\"'it''s', 'all', 'right!'\", $value);\n }", "public function testAdapterQuoteArray()\n {\n $array = [\"it's\", 'all', 'right!'];\n $value = $this->_db->quote($array);\n $this->assertEquals(\"'it''s', 'all', 'right!'\", $value);\n }", "private function assertStringOrArray(&$value, bool $throw = false, string $nameParam = ''): bool\n {\n if (false === ($this->isString($value) || $this->isIterable($value))) {\n if ($throw) {\n throw new InvalidArgumentException(\n sprintf(\n 'Expected parameter \"%s\" a string or string[]! Got: \"%s\".',\n $nameParam,\n $this->getReceivedType($value)\n )\n );\n }\n\n return true;\n }\n\n return false;\n }", "public function testSendString()\n {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function is_ios For detecting ANY iOS/Apple device
function is_ios() { global $mobble_detect; return($mobble_detect->isiOS()); }
[ "function is_ios()\n {\n return dev::isIOS();\n }", "private static function checkIOS() {\n\t\tif ( stripos(Browser::getUserAgent(), 'CPU OS') !== false || stripos(Browser::getUserAgent(), 'iPhone OS') !== false && stripos(Browser::getUserAgent(), 'OS X')) {\n\t\t\tself::$name = self::IOS;\n\t\t\tif (preg_match('/CPU( iPhone)? OS ([\\d_]*)/i', Browser::getUserAgent(), $matches)) {\n\t\t\t\tself::$version = str_replace('_', '.', $matches[2]);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isiOS()\n {\n return $this->mobile->isiOS();\n }", "function is_iphone()\n {\n return dev::isIphone();\n }", "public function getIsIOSRequest ()\n\t\t{\n\n\t\t\treturn isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(iPad|iPhone|iPod)/i', $_SERVER['HTTP_USER_AGENT']) !== 0;\n\t\t}", "private function compatibility_check_for_ios() {\n $reges = '/ip(?:hone|[ao]d); cpu os \\K[\\d_]+/i';\n preg_match($reges, $_SERVER['HTTP_USER_AGENT'], $matches, PREG_OFFSET_CAPTURE, 0);\n\n if (empty($matches))\n return true;\n\n $ios_version = $matches[0][0];\n $ios_version = (int)explode('_', $ios_version)[0];\n\n if ($ios_version === 0)\n return true;\n\n return $ios_version > 9;\n }", "function is_iphone() {\n $cn_is_iphone = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPhone');\n if ($cn_is_iphone)\n return true;\n else return false;\n}", "function isIphone()\n{\n if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false)\n return(true);\n else\n return(false);\n}", "static function is_wordpress_for_ios( ) {\n\t\tif ( empty( $_SERVER['HTTP_USER_AGENT'] ) )\n\t\t\treturn false;\n\n\t\t$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );\n\t\tif ( false !== strpos( $ua, 'wp-iphone' ) )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function is_ipod() {\n $cn_is_iphone = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPod');\n if ($cn_is_iphone)\n return true;\n else return false;\n}", "function isIphone(){\n return (stripos($this->useragent, $this->devices['iphone']) > 0);\n }", "function is_ipod() {\n\t$cn_is_iphone = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPod');\n\tif ($cn_is_iphone)\n\t\treturn true;\n\telse return false;\n}", "static function is_facebook_for_iphone( ) {\n\t\tif ( empty( $_SERVER['HTTP_USER_AGENT'] ) )\n\t\t\treturn false;\n\n\t\t$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );\n\n\t\tif( false === strpos( $ua, 'iphone' ) )\n\t\t\treturn false;\n\n\t\tif ( false !== strpos( $ua, 'facebook' ) && false === strpos( $ua, 'ipad' ) )\n\t\t\treturn true;\n\t\telse if ( false !== strpos( $ua, 'fbforiphone' ) && false === strpos( $ua, 'tablet' ) )\n\t\t\treturn true;\n\t\telse if ( false !== strpos( $ua, 'fban/fbios;' ) && false === strpos( $ua, 'tablet' ) ) //FB app v5.0 or higher\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "static function is_iphone_or_ipod( $type = 'iphone-any' ) {\n\n\t\tif ( empty( $_SERVER['HTTP_USER_AGENT'] ) )\n\t\t\treturn false;\n\n\t\t$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );\n\t\t$is_iphone = ( strpos( $ua, 'iphone' ) !== false ) || ( strpos( $ua,'ipod' ) !== false );\n\t\t$is_safari = ( false !== strpos( $ua, 'safari' ) );\n\n\t\tif ( 'iphone-safari' == $type )\n\t\t\treturn $is_iphone && $is_safari;\n\t\telseif ( 'iphone-not-safari' == $type )\n\t\t\treturn $is_iphone && !$is_safari;\n\t\telse\n\t\t\treturn $is_iphone;\n\t}", "function _xls_is_idevice() {\n\tif (_xls_is_ipad() || _xls_is_iphone()) return true;\n\telse return false;\n}", "function DetectIphone()\n {\n if ($this->initCompleted == $this->true ||\n $this->isIphone == $this->true)\n return $this->isIphone;\n \n if (stripos($this->useragent, $this->deviceIphone) > -1)\n {\n //The iPad and iPod Touch say they're an iPhone. So let's disambiguate.\n if ($this->DetectIpad() == $this->true ||\n $this->DetectIpod() == $this->true)\n return $this->false;\n //Yay! It's an iPhone!\n else\n return $this->true; \n }\n else\n return $this->false; \n }", "function isIphone($user_agent=NULL) {\n\t\tif(!isset($user_agent)) {\n\t\t\t$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';\n\t\t}\n\t\treturn (strpos($user_agent, 'iPhone') !== FALSE);\n\t}", "function isChromeForIOS()\n\t{\n\n\t\tif (false == $this->userAgent)\n\t\t\treturn false;\n\n\t\treturn ($this->isIPhoneOrIPod() && strpos($this->userAgent, 'crios/') > -1);\n\t}", "public function test_IphoneIpodIpad_called_returnTrue($userAgent)\r\n\t{\r\n\t\t$_SERVER['HTTP_USER_AGENT'] = $userAgent;\r\n\t\t$actual = $this->service->isIOSPortalDeviceCompatible();\r\n\t\t$this->assertTrue($actual);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deleting a record from oxm_pagedetails table
function delete($page_id) { $this->db->where( 'pageid', $page_id); $this->db->delete('oxm_pagedetails'); }
[ "function DeleteDetailRecordByID($id) \r\n {\r\n $this->db\r\n ->where('id_page', $id)\r\n ->delete('pages_detail');\r\n }", "public function delete() {\n \t\n\t\t$this->deletePage();\n \tparent::delete();\n \t\n }", "public function deleting(Page $page)\n {\n //\n }", "public function remove(){\n\t\t$this->typeObject->remove();\n\t\t\n\t\t$this->db->reset();\n\t\t$this->db->where('page_id', $this->id);\n\t\t$this->db->delete('OPC_Page_components');\n\n\t\t$this->db->reset();\n\t\t$this->db->where('id', $this->id);\n\t\t$this->db->delete('OPC_Pages');\n\t}", "public function delete(Page $page) {\n\t\t$database = $this->wire('database');\n\t\t$query = $database->prepare(\"DELETE FROM pages_sortfields WHERE pages_id=:page_id\"); // QA\n\t\t$query->bindValue(\":page_id\", $page->id, \\PDO::PARAM_INT); \n\t\t$result = $query->execute();\n\t\treturn $result;\n\t}", "function qa_db_page_delete($pageid)\n{\n\tqa_db_ordered_delete('pages', 'pageid', $pageid);\n}", "abstract public function deletePage($p);", "public function deleting(Page $Page)\n {\n //code...\n }", "public function delete() {\r\n $contentTable = Engine_Api::_()->getDbtable('content', 'core');\r\n $contentTable->delete(array('page_id = ?' => $this->page_id)); \r\n // excute delete this object\r\n parent::delete();\r\n }", "public function ___deleted(Page $page) { }", "function removepageAction()\n {\n \t$delete_id = $this->_request->getParam('delete');\n \n \t\n \tif($delete_id != \"\")\n \t{\n \t\t$fitnessWebsitePages = new FitnessWebsitePages();\n \t\t\n \t\t\n $fitnessWebsitePages->find($delete_id)->current()->delete();\n $this->_redirect('/admin/listpages');\n \n \n \t}\n }", "function _delete( $page_id ){\n return;\n }", "public function delete_page() { \n \n if( wp_delete_post( $this->page_id, true ) ) :\n \n $this->page_id = null;\n \n endif;\n \n }", "public function deletePage($id) {\n \n $this->db->query(\"DELETE FROM confy_\" . $this->url . \"_pages \n WHERE id = '\" . $id . \"'\");\n \n }", "function delete(){\n $pm = $this->page_mapper;\n $id = Registry::get('Request')->get_param('id');\n $pm->delete( $id );\n header(\"Location: /pages/index\");\n }", "function DeletePage($page){}", "function searchresult_deleteData($vPageID) {\n}", "public function deleted(Page $page)\n {\n //\n }", "public function deleteRecord() {\n\t\tif (!GlideUtil::isValidSysID($this->__get(\"sys_id\"))) {\n\t\t\tthrow new GlideRecordException(\"Cannot delete this record (no sys_id - is it a valid record?\");\n\t\t}\n\t\t\n\t\t// Build URL\n\t\t$url = \"table/\".$this->_table_name.\"/\".$this->__get(\"sys_id\");\n\t\t\n\t\t// Use GlideAccess to run the DELETE command \n\t\t// Throw a GlideAccessException or a GlideAuthenticationException on error \n\t\t$result = $this->_access->delete($url);\n\t\t\t\n\t\t// Unset this record from the current result set\n\t\t$this->offsetUnset($this->_data_position);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for add user hive
public function addUserHive() { $arrayResponse = array(); try { if($this->tokenData) { //--Get param $hiveData['pst_cat_id'] = isset($this->requestData->catId)?$this->requestData->catId:""; $hiveData['pst_usr_id'] = $this->tokenData['usr_id']; $hiveData['pst_title'] = isset($this->requestData->ttl)?$this->requestData->ttl:""; $hiveData['pst_description'] = isset($this->requestData->dscptn)?$this->requestData->dscptn:""; $hiveData['pst_grp_id'] = isset($this->requestData->grpId)?$this->requestData->grpId:""; $hiveData['pst_completed'] = 'NO'; $hiveData['pst_createdate'] = strtotime(gmdate('Y-m-d h:i:s a').' UTC'); $hiveData['pst_updatedate'] = strtotime(gmdate('Y-m-d h:i:s a').' UTC'); $hiveTags = isset($this->requestData->tags)?$this->requestData->tags:array(); if(empty($hiveData['pst_cat_id'])) { $arrayResponse = array('success' => false, 'message' => 'Category id is required.'); } elseif (empty($hiveData['pst_grp_id'])) { $arrayResponse = array('success' => false, 'message' => 'Group id is required.'); } else { //--Call model function for add hive post $response = $this->UserModel->addUserHive($hiveData,$hiveTags); if ($response) { $userActivity['usr_lastActivity'] = strtotime(gmdate('Y-m-d h:i:s a').' UTC'); $this->UserModel->updateData('comm_users', array('usr_id' => $this->tokenData['usr_id']), $userActivity); $arrayResponse = array('success' => true, 'data' => $response, 'message' => 'You Hive post has been successfully created.'); } else { $arrayResponse = array('success' => false, 'message' => 'Oops! Error in adding data, Please try again.'); } } } else { $arrayResponse = array("success" => false, "message" => "Token is expired,please login in again."); } if(empty($arrayResponse)) { throw new Exception('Server Error, please try again.'); } } catch (Exception $e) { $arrayResponse = array('success' => false, 'message' => $e->getMessage()); } //--Convert Response to json $this->getJsonData($arrayResponse); }
[ "private function adduser()\n {\n $name = $this->getParameter('name');\n $password = $this->getParameter('password');\n $realname = $this->getParameter('realname');\n $email = $this->getParameter('email');\n\n $success = vpAutocreateUsers::addToDatabase($name, $password, $realname, $email);\n\n $apiResult = $this->getResult();\n if( $success )\n $apiResult->addValue( array(), 'success', array() );\n else\n $apiResult->addValue( array(), 'error', array('title' => 'username null or user already exists') );\n }", "private function _createUser(){\r\n\r\n }", "function addUser($accessKey, $secret)\n\t{ \n\t\t$output = shell_exec(\"../min/mc admin user add {$this->alias}/ {$accessKey} {$secret} 2>&1\"); \n\t\techo $output;\n\t}", "function Add() {\n $values = array(\n 'username' => $this->username,\n 'first_Name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'mail' => $this->mail,\n 'password' => $this->password,\n 'gender' => $this->gender,\n 'birth_date' => $this->birth_date,\n 'weight' => $this->weight,\n 'fb_uid' => $this->fb_uid\n );\n //Adds to the databank\n $this->user_id = PublicApp::getDB()->insert('users', $values);\n return $this->user_id;\n }", "private function add_user() {\n\t\t//add entry in login table\n\t\t$sql = \"insert into login(email,password,created_date) values('$this->user_id','$this->password', 'NOW()')\";\n\t\tif(!executeSql($sql, $this->conn)) {\n\t\t\treturn 'error';\n\t\t}\n\n\t\t//Note:- when ever new user is inserted, its pk should be added in register table\n\t\t//this is done by trigger refer db/triggers.txt\n\t\treturn true;\n\t}", "public function addRemoteAccessUser()\n {\n $input = $this->climate->lightBlue()->input(\"What is the IP address of the remote server that will be accessing the database?\");\n $ipAddress = null;\n while ($ipAddress == null || filter_var($ipAddress, FILTER_VALIDATE_IP) === false)\n {\n $ipAddress = $input->prompt();\n if ($ipAddress == null)\n {\n $this->climate->shout(\"You must input an IP address.\");\n }\n elseif (filter_var($ipAddress, FILTER_VALIDATE_IP) === false)\n {\n $this->climate->shout(\"That IP address is not valid.\");\n }\n }\n\n $characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n $username = '';\n for ($i = 0; $i < 16; $i++) {\n $username .= $characters[rand(0, strlen($characters) - 1)];\n }\n\n $password = '';\n for ($i = 0; $i < 16; $i++) {\n $password .= $characters[rand(0, strlen($characters) - 1)];\n }\n\n $sth = $this->dbh->prepare(\"GRANT ALL ON radius.* TO ?@? IDENTIFIED BY ?\");\n if ($sth->execute([$username, $ipAddress, $password]))\n {\n $sth = $this->dbh->prepare(\"FLUSH PRIVILEGES\");\n $sth->execute();\n $this->climate->lightMagenta(\"Added a user with the username $username and the password $password. Copy this username and password, you'll need it!\");\n }\n else\n {\n $this->climate->shout(\"Failed to create the user!\");\n }\n }", "function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}", "protected function createUser() {\n\t\t$this->u_key = null;\n\t\t$this->u_key = $this->u_obj->create();\n\t}", "function _add_user() {\n if (!$this->has_arg('pid')) $this->_error('No project id specified');\n if (!$this->has_arg('user')) $this->_error('No user specified');\n \n $proj = $this->db->pq(\"SELECT p.projectid FROM ispyb4a_db.project p WHERE p.owner LIKE :1 AND p.projectid=:2\", array(phpCAS::getUser(),$this->arg('pid')));\n \n if (!sizeof($proj)) $this->_error('No such project');\n $proj = $proj[0];\n \n $this->db->pq(\"INSERT INTO ispyb4a_db.project_has_user (projecthasuserid, projectid, username) VALUES (s_project_has_user.nextval, :1, :2) RETURNING projecthasuserid INTO :id\", array($this->arg('pid'), $this->arg('user')));\n \n $this->_output($this->db->id());\n }", "function _timian_service_create_user($data)\n{\n $user = user_load_by_name($data['name']);\n\n if ($user) {\n if (!$user->status) {\n $user->status = \"1\";\n user_save($user);\n header(\"HTTP/1.0 201\");\n return [\n \"result\" => \"User {$data['name']} activated\",\n ];\n\n } else {\n header(\"HTTP/1.0 409\");\n return [\n \"result\" => \"User {$data['name']} already exists\",\n ];\n }\n\n } else {\n\n $supplier_value = get_node_nid($data['birgi']); //get_node_nid_by_acronym($data['birgi']);\n\n $new_user = [\n 'name' => $data['name'],\n 'pass' => drupal_random_key(), // random password, user will be login trough sso\n 'mail' => $data['email'],\n 'status' => 1,\n 'init' => $data['email'],\n 'roles' => [\n DRUPAL_AUTHENTICATED_RID => 'authenticated user',\n 12 => 'suppliers',\n ],\n 'field_user_fullname' => [\n 'und' => [\n 0 => [\n 'value' => $data['name'],\n ],\n ],\n ],\n 'field_user_supplier' => [\n 'und' => [\n 0 => [\n 'value' => $supplier_value,\n ],\n ],\n ],\n ];\n user_save('', $new_user);\n\n header(\"HTTP/1.0 201\");\n return [\n \"result\" => \"User {$data['name']} created\",\n ];\n }\n}", "function addNewUser($username, $password, $email, $fname, $sname, $phone, $dob, $address, $city, $state_region, $country, $comment) {\r\n $time = time();\r\n /* If admin sign up, give admin user level */\r\n if (strcasecmp($username, ADMIN_NAME) == 0) {\r\n $ulevel = ADMIN_LEVEL;\r\n } else {\r\n $ulevel = MASTER_LEVEL;\r\n }\r\n $q = \"INSERT INTO \" . TBL_USERS . \" VALUES ('$username', '$password', '0', '$ulevel', '$email', '$time', '$fname', '$sname', '$phone', '$dob', '$address', '$city', '$state_region', '$country', '$comment')\";\r\n return mysqli_query($this->connection, $q);\r\n }", "function _add_visit_user()\n {\n $this->haltIfLackingPermission('manage_vusers');\n\n if (!$this->has_arg('PERSONID'))\n $this->_error('No person specified');\n if (!$this->has_arg('SESSIONID'))\n $this->_error('No visit specified');\n\n $user = $this->db->pq(\"SELECT personid FROM person where personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($user))\n $this->_error('The specified person doesnt exist');\n\n $visit = $this->db->pq(\"SELECT sessionid FROM blsession WHERE sessionid=:1\", array($this->arg('SESSIONID')));\n if (!sizeof($user))\n $this->_error('The specified visit doesnt exist');\n\n $chk = $this->db->pq(\"SELECT shp.role\n FROM session_has_person shp \n WHERE sessionid=:1 and personid=:2\", array($this->arg('SESSIONID'), $this->arg('PERSONID')));\n\n if (sizeof($chk)) {\n $this->_error('That user is already registered on the specified visit');\n }\n\n $role = $this->has_arg(\"ROLE\") ? $this->arg(\"ROLE\") : 'Team Member';\n $remote = $this->has_arg(\"REMOTE\") ? $this->arg(\"REMOTE\") : 0;\n\n $this->db->pq(\"INSERT INTO session_has_person (sessionid, personid, role, remote) \n VALUES (:1, :2, :3, :4)\", array($this->arg(\"SESSIONID\"), $this->arg(\"PERSONID\"), $role, $remote));\n\n $this->_output(array(\n 'SHPKEY' => $this->arg(\"SESSIONID\") . '-' . $this->arg(\"PERSONID\"),\n ));\n }", "public function add($username, $password);", "public function addUser() \n {\n $data = array(\n 'email' => $this->_email,\n 'password' => $this->_password,\n 'title' => $this->_title,\n 'first_name' => $this->_fname,\n 'last_name' => $this->_lname,\n 'initials' => $this->_initials,\n 'bday' => $this->_bday,\n 'tel_no' => $this->_telno,\n 'address1' => $this->_address1,\n 'address2' => $this->_address2,\n 'city' => $this->_city,\n 'country' => $this->_country,\n 'role_id' => $this->_roleId,\n 'create_on' => $this->_createOn,\n 'create_by' => $this->_createBy,\n 'change_on' => $this->_changeOn,\n 'change_by' => $this->_changeBy\n );\n\n return $this->insert($data);\n }", "public function addUser(array $userInfo);", "public function addUser() {\r\n\r\n\t\t$userData = array (\r\n\t\t\t\"last_login\"=>date('Y-m-d'),\r\n\t\t\t\"sid\" => $this->sid,\r\n\t\t\t\"fname\" => $this->fname,\r\n\t\t\t\"lname\" => $this->lname,\r\n\t\t\t\"email\" => $this->email,\r\n\t\t\t\"phone\" => $this->telephone,\r\n\t\t\t\"pwd\" => $this->pwd,\r\n\t\t\t\"middle_name\" => $this ->middle_name,\r\n\t\t\t\"is_activated\" => $this->is_activated,\r\n\t\t\t\"u_type\" => 1\r\n\t\t);\r\n\t\tif (Database::obtain()->insert(\"users\", $userData)) {\r\n\t\t\t$ret_user = User::searchBy($userData);\r\n\t\t\tif ($ret_user) $this->uid = $ret_user->getUid();\r\n\t\t}\r\n\t\treturn $this->uid;\r\n\t}", "function acsauth_createuser_and_mapping($spuserdata) {\n $username = $spuserdata->{'Title'};\n $query = \"SELECT uid FROM {users} WHERE name = :name\";\n $uid = db_query($query, array(\n ':name' => $username\n ))->fetchField();\n $i = 0;\n while ($uid) {\n $i++;\n $uid = db_query($query, array(\n ':name' => ($username . '_' . $i)\n ))->fetchField();\n }\n if ($i > 0) {\n $username = $username . '_' . $i;\n }\n \n //This will generate a random password, you could set your own here\n $password = user_password(8);\n $newuser = array(\n 'name' => $username,\n 'mail' => $spuserdata->{'Email'},\n 'pass' => $password,\n 'init' => 'email address',\n 'status' => 1,\n 'timezone' => variable_get('date_default_timezone'),\n 'roles' => array(\n DRUPAL_AUTHENTICATED_RID => 'authenticated user'\n )\n );\n \n $account = user_save(NULL, $newuser);\n \n $id = db_insert('acsauth_users')->fields(array(\n 'uid' => $account->uid,\n 'acsid' => hexdec($spuserdata->{'UserId'}->{'NameId'})\n ))->execute();\n return $account;\n}", "private static function create_user($user_data){\r\n\r\n }", "public function save_user_basic()\r\n\t{\r\n\t\t\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ function which will return product tag array form given template
public function product_tag($template_id, $section, $template_data) { $db = JFactory::getDbo(); $q = "SELECT field_name from " . $this->_table_prefix . "fields where field_section = " . $db->quote($section); $this->_db->setQuery($q); $fields = $this->_db->loadResultArray(); $tmp1 = explode("{", $template_data); $str = array(); for ($h = 0; $h < count($tmp1); $h++) { $word = explode("}", $tmp1[$h]); if (in_array($word[0], $fields)) $str[] = $word[0]; } return $str; }
[ "public function getProductsForTemplate() {\r\n\t\t$dbr = wfGetDB(DB_SLAVE);\r\n\t\t$product = PonyDocsProduct::GetProducts();\r\n\t\t$productAry = array();\r\n\r\n\t\tforeach ($product as $p) {\r\n\r\n\t\t\t// Only add product to list if it has versions visible to this user\r\n\t\t\t$valid = FALSE;\r\n\t\t\t$versions = PonyDocsProductVersion::LoadVersionsForProduct($p->getShortName());\r\n\t\t\tif (!empty($versions)) {\r\n\t\t\t\t$valid = TRUE;\r\n\t\t\t} elseif (empty($versions)) {\r\n\t\t\t\t// Check for children with visibile versions\r\n\t\t\t\tforeach (PonyDocsProduct::getChildProducts($p->getShortName()) as $childProductName) {\r\n\t\t\t\t\t$childVersions = PonyDocsProductVersion::LoadVersionsForProduct($childProductName);\r\n\t\t\t\t\tif (!empty($childVersions)) {\r\n\t\t\t\t\t\t$valid = TRUE;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($valid) {\r\n\t\t\t\t$productAry[$p->getShortname()] = array(\r\n\t\t\t\t\t'name' => $p->getShortName(),\r\n\t\t\t\t\t'label' => $p->getLongName(),\r\n\t\t\t\t\t'description' => $p->getDescription(),\r\n\t\t\t\t\t'parent' => $p->getParent(),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $productAry;\r\n\t}", "public function generateTags(): array;", "function get_products(){\n\n\t$username = $GLOBALS['imonggo_api_key'];\n\t$pw = 'x';\n\t$response = get_file($GLOBALS['imonggo_URL'].'/api/products.xml', $username, $pw);\n\n\t$tags = array();\n\tforeach($response->product as $product){\n\t\t//Stores each unique tag to an array\n\t\tif($product->tag_list != \"\"){\n\t\t\t$tags_per_product = explode(\",\",preg_replace('/\\s+/','', strtolower($product->tag_list)));\n\t\t\t$tags = array_unique(array_merge($tags, $tags_per_product));\n\t\t}\n\t}\n\n $return = array();\n array_push($return, $response, $tags);\n return $return; \n}", "function parseTags($template) {\n\t\t$result = array();\n\t\t$suchmuster = '/\\$\\{(\\w*):(\\w*\\|?\\w+)\\}/i';\n\t\t$temp = array();\n\t\tpreg_match_all($suchmuster, $template, $temp, PREG_SET_ORDER);\n\t\tforeach ($temp as $item) {\n\t\t\t$result[$item[1] . ':' . $item[2]] = array('type' => $item[1], 'value' => $item[2]);\n\t\t}\n\t\t$this->tags = $result;\n\t}", "public function getTemplateTags()\n {\n $tags = fetch_all(\"SELECT `id`, `label`, `key`, `description`\n FROM `pmt_template_tag`\n WHERE `key` != ''\");\n\n return $tags;\n }", "public function getMetaTagsArray()\n {\n $returnArray = [];\n $route = \\Route::current();\n if (is_null($route)){\n return $returnArray;\n }\n\n if (!in_array(\"GET\", $route->methods))\n {\n return $returnArray;\n }\n\n $seoManager = $this->getSeoManagerByUri($route->uri());\n if(is_null($seoManager)){\n return $returnArray;\n }\n\n $modelItem = $this->getModelItem($route->parameters, $seoManager->model);\n $seoManager = $seoManager->toArray();\n $modelMap = $this->mappingModel($modelItem);\n\n $tags = $this->getMetaTags();\n //echo \"<pre>\"; print_r($tags->toArray()); echo \"</pre>\";\n foreach ($tags as $group)\n {\n $groupArray = [\n 'name' => $group->name,\n 'tags' => []\n ];\n foreach ($group->tags as $tag)\n {\n $value = $tag->default_value;\n if ($tag->editable)\n {\n if ($fillTag = $this->getFillTagArray($seoManager['tags'], $tag->id))\n {\n $value = str_replace(array_keys($modelMap), array_values($modelMap), $fillTag['pivot']['value']);\n }\n }\n $groupArray['tags'][] = str_replace('{value}', $value, $tag->template);\n }\n $returnArray[] = $groupArray;\n }\n return $returnArray;\n }", "private function analyzeProductTemplate()\n {\n list($result, $template) = $this->parserHelper->extractAttributeCalls($this->params['product_pattern']);\n $this->template = $template;\n $this->_requiresConfigurable = false;\n $this->_requiresBundle = false;\n $this->_requiresGrouped = false;\n // check needed parent types & needed product attributes\n foreach ($result as $infos) {\n foreach ($infos as $info) {\n // check needed parent types\n switch ($info['object']) {\n case 'parent':\n $this->_requiresConfigurable = true;\n $this->_requiresBundle = true;\n $this->_requiresGrouped = true;\n break;\n case 'configurable':\n $this->_requiresConfigurable = true;\n break;\n case 'bundle':\n $this->_requiresBundle = true;\n break;\n case 'grouped':\n $this->_requiresGrouped = true;\n break;\n case 'custom_options':\n $this->_loadOptions = true;\n break;\n }\n // check if statements\n if (isset($info['parameters']['if'])) {\n foreach ($info['parameters']['if'] as $if) {\n if (isset($if['object'])) {\n switch ($if['object']) {\n case 'parent':\n $this->_requiresConfigurable = true;\n $this->_requiresBundle = true;\n $this->_requiresGrouped = true;\n break;\n case 'configurable':\n $this->_requiresConfigurable = true;\n break;\n case 'bundle':\n $this->_requiresBundle = true;\n break;\n case 'grouped':\n $this->_requiresGrouped = true;\n break;\n }\n }\n if (isset($if['property'])) {\n array_push($this->_attributesRequired, $if['property']);\n }\n }\n }\n // check product attributes\n switch ($info['property']) {\n case 'tier_price':\n case 'tier_price_qty':\n $this->_loadTierPrices = true;\n break;\n case 'url':\n array_push($this->_attributesRequired, 'url_key');\n break;\n case 'uri':\n array_push($this->_attributesRequired, 'url_key');\n break;\n case 'item_group_id':\n $this->_requiresConfigurable = true;\n break;\n case 'description':\n array_push($this->_attributesRequired, 'short_description');\n array_push($this->_attributesRequired, 'description');\n break;\n case 'image_link':\n array_push($this->_attributesRequired, 'image');\n array_push($this->_attributesRequired, 'small_image');\n array_push($this->_attributesRequired, 'thumbnail');\n $this->_loadImages = true;\n break;\n case 'review_count':\n case 'review_average':\n $this->_loadReviews = true;\n break;\n case 'availability':\n case 'is_in_stock':\n case 'qty':\n if ($info['object'] == \"configurable\" || $this->params['type_ids'] == '*' || strpos($this->params['type_ids'], 'configurable') !== false) {\n $this->_loadConfigurableQty = true;\n }\n break;\n case 'categories_url':\n $this->_loadCategoriesUrl = true;\n break;\n case 'relation_ship':\n $this->_loadRelationShip = true;\n break;\n case 'sc_images':\n array_push($this->_attributesRequired, 'image');\n array_push($this->_attributesRequired, 'small_image');\n array_push($this->_attributesRequired, 'thumbnail');\n break;\n case 'sc_description':\n array_push($this->_attributesRequired, 'description');\n array_push($this->_attributesRequired, 'short_description');\n array_push($this->_attributesRequired, 'manufacturer');\n array_push($this->_attributesRequired, 'name');\n array_push($this->_attributesRequired, 'sku');\n break;\n case 'sc_ean':\n array_push($this->_attributesRequired, 'ean');\n break;\n case 'sc_url':\n array_push($this->_attributesRequired, 'url_key');\n array_push($this->_attributesRequired, 'url');\n break;\n default:\n array_push($this->_attributesRequired, $info['property']);\n }\n }\n }\n $this->_attributesRequired = array_unique($this->_attributesRequired);\n return $result;\n }", "public function generateTags(): array\n {\n // TODO: Implement generateTags() method.\n }", "function get_template_array( $name = null ) {\n\n\t\t$ar = array();\n\t\tif( $name ) {\n\t\t\t$data[$name] = $this->data[$name];\n\t\t} else {\n\t\t\t$data = $this->data;\n\t\t}\n\t\t\n\t\tforeach ($data as $key => $data) {\n\t\t\t$box = $this->html->box();\n\t\t\t$box->label = $this->get_label($data);\n\t\t\t$box->content = $this->get_htmlobject_object($data);\n\t\t\t$ar = array_merge($ar, array($key => $box->get_string()));\n\t\t}\n\t\treturn $ar;\n\n\t}", "function toNumericArray($template) {\n return array(\n $template['Repository'], # 1\n $template['Author'], # 2\n $template['Name'], # 3\n $template['DockerHubName'], # 4\n $template['Beta'], # 5\n $template['Changes'], # 6\n $template['Date'], # 7\n $template['RepoName'], # 8\n $template['Project'], # 9\n $template['ID'], #10\n $template['Base'], #11\n $template['BaseImage'], #12\n $template['SortAuthor'], #13\n $template['SortName'], #14\n $template['Licence'], #15\n $template['Plugin'], #16\n $template['PluginURL'], #17\n $template['PluginAuthor'], #18\n $template['MinVer'], #19\n $template['MaxVer'], #20\n $template['Category'], #21\n $template['Description'], #22\n $template['Overview'], #23\n $template['Downloads'], #24\n $template['Stars'], #25\n $template['Announcement'], #26\n $template['Support'], #27\n $template['IconWeb'], #28\n $template['DonateText'], #29\n $template['DonateImg'], #30 - Deprecated Tag Do Not Use\n $template['DonateLink'], #31\n $template['PopUpDescription'], #32 - No longer implemented\n $template['ModeratorComment'], #33\n $template['Compatible'], #34\n $template['display_DonateLink'], #35\n $template['display_Project'], #36\n $template['display_Support'], #37\n $template['display_UpdateAvailable'], #38\n $template['display_ModeratorComment'],#39\n $template['display_Repository'], #40\n $template['display_Stars'], #41\n $template['display_Downloads'], #42\n $template['display_pinButton'], #43\n $template['display_Uninstall'], #44\n $template['display_removable'], #45\n $template['display_newIcon'], #46 # Do not use -> no longer implemented\n $template['display_changes'], #47 # Do not use -> no longer implemented\n $template['display_webPage'], #48\n $template['display_humanDate'], #49\n $template['display_pluginSettings'], #50 # do not use -> no longer implemented\n $template['display_pluginInstall'], #51 # do not use -> no longer implemented\n $template['display_dockerDefault'], #52 # do not use -> no longer implemented\n $template['display_dockerEdit'], #53 # do not use -> no longer implemented\n $template['display_dockerReinstall'], #54 # do not use -> no longer implemented\n $template['display_dockerInstall'], #55 # do not use -> no longer implemented\n $template['display_dockerDisable'], #56 # do not use -> no longer implemented\n $template['display_compatible'], #57\n $template['display_compatibleShort'], #58\n $template['display_author'], #59\n $template['display_iconSmall'], #60\n $template['display_iconSelectable'], #61\n $template['display_popupDesc'], #62 # Do not use -> no longer implemented\n $template['display_updateAvail'], #63 *** NO LONGER USED - USE #38 instead\n $template['display_dateUpdated'], #64\n $template['display_iconClickable'], #65\n str_replace(\"-\",\" \",$template['display_dockerName']), #66\n $template['Path'], #67\n $template['display_pluginInstallIcon'],#68\n $template['display_dockerDefaultIcon'],#69\n $template['display_dockerEditIcon'], #70\n $template['display_dockerReinstallIcon'], #71\n $template['display_dockerInstallIcon'], #72\n $template['display_pluginSettingsIcon'], #73\n $template['dockerWebIcon'], #74\n $template['display_multi_install'], #75\n $template['display_DonateImage'], #76\n $template['display_dockerBeta'], #77\n\"<span class='ca_applicationName'>\".str_replace(\"-\",\" \",$template['display_dockerName']).\"</span>{$template['display_Private']}<br><span class='ca_author'>{$template['display_author']}</span><br><span class='ca_categories'>{$template['Category']}</span>\", #78\n $template['display_faSupport'], #79\n $template['display_faProject'], #80\n $template['display_iconOnly'], #81\n $template['display_infoIcon'], #82\n\t\t$template['display_faWarning']\t\t#83\n );\n}", "function ConvertToProductsArray($array) {\r\n //Initialize return array to null\r\n $retArr = null;\r\n \r\n //loop through all of the items in the parameter array (excluding the first entry which is an example format)\r\n for ($i = 0; $i < sizeOf($array); $i++) {\r\n $retArr[$i]['type'] = $array[$i][0];\r\n $retArr[$i]['name'] = $array[$i][1];\r\n $retArr[$i]['image'] = 'resources/media/'.$array[$i][2].'.jpg';\r\n $retArr[$i]['description'] = $array[$i][3];\r\n $retArr[$i]['price'] = (int) $array[$i][4];\r\n }\r\n \r\n return $retArr;\r\n }", "public function build_product_array()\n {\n $building_array = array();\n $building_array_2 = array();\n $fpath = pathinfo(__FILE__);\n $this->hook_path = $fpath['dirname'].\"\\\\\".$this->hook_path;\n $file = fopen($this->hook_path,'a+');\n $file_size = filesize($this->hook_path);\n $this->flat_string = fread($file,$file_size);\n $building_array = explode('~~',$this->flat_string);\n foreach($building_array as $key=>$value)\n {\n $building_array_2 = explode('|||',$value);\n if($building_array_2[0])\n {\n $this->products[$building_array_2[0]] = $building_array_2[1]; \n }\n }\n ksort($this->products);\n }", "function ConvertToProductsArray($array) {\n //Initialize return array to null\n $retArr = null;\n \n //loop through all of the items in the parameter array (excluding the first entry which is an example format)\n for ($i = 0; $i < sizeOf($array); $i++) {\n $retArr[$i]['type'] = $array[$i][0];\n $retArr[$i]['name'] = $array[$i][1];\n $retArr[$i]['image'] = 'resources/media/'.$array[$i][2].'.jpg';\n $retArr[$i]['description'] = $array[$i][3];\n $retArr[$i]['price'] = (int) $array[$i][4];\n }\n \n return $retArr;\n }", "public function listPdfTemplateElements()\n {\n $templateElements = array();\n $templateElements['page-'.$this->_applicationPage->getPage()->getId() . '-element-0'] = $this->_applicationPage->getTitle() . ': ' . substr($this->_applicationPage->getPage()->getVar('branchingElementLabel'), 0, 64);\n foreach($this->_applicationPage->getPage()->getChildren() as $child){\n foreach($child->getElements() as $element){\n $templateElements['page-'.$this->_applicationPage->getPage()->getId() . '-element-' . $element->getId()] = $this->_applicationPage->getTitle() . ': ' . $child->getTitle() . ': ' . substr($element->getTitle(), 0, 64);\n }\n }\n\n return $templateElements;\n }", "public function getProductsTemplates() {\n return $this->getTemplateGroup('dse_products_');\n }", "private function _getPartsFromContent() {\n $foundParts = array();\n\n //available templates\n $productIdPatterns = array(\n '<!--pid=\"([0-9]+)\"-->',\n 'data-productId=\"([0-9]+)\"',\n 'data-pid=\"([0-9]+)\"'\n );\n\n foreach($productIdPatterns as $pattern) {\n if(preg_match_all('~' . $pattern . '~u', $this->_spaceContent, $foundParts)) {\n break;\n }\n }\n\n if(!empty($foundParts) && isset($foundParts[1])) {\n return $foundParts[1];\n }\n return $foundParts;\n }", "public function processTemplateArray($args) {\n\t\t\n\t\t\\Q\\Utils::validateProperties(array(\n\t\t\t'validatedEntity' => $args,\n\t\t\t'source' => __file__,\n\t\t\t'propertyList' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'sourceData',\n\t\t\t\t\t'requiredType' => 'array'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'itemTemplate',\n\t\t\t\t\t'requiredType' => 'string'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'blockTemplate',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'offset',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'count',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'transformations',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'referenceData',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t)\n\t\t\t)\n\t\t));\n\t\tif (!isset($args['debug'])) {$debug = false;} else {$debug=$args['debug'];}\n\n//Remember: $sourceData is an numeric array of associative arrays, ie, [{}, {}]\n\t\t\n\t\t$sourceData = \\Q\\Utils::makeArrayNumericIndexed($args['sourceData']);\t\n\t\t$itemTemplate = $args['itemTemplate'];\n\t\tif (!isset($args['blockTemplate'])) {\n\t\t\t$args['blockTemplate'] = '<!productList!>';\n\t\t\t$blockTemplate = $args['blockTemplate'];\n\t\t} else {\n\t\t\t$blockTemplate = $args['blockTemplate'];\n\t\t}\n\t\tif (!isset($args['offset'])) {\n\t\t\t$args['offset'] = 0;\n\t\t\t$offset = $args['offset'];\n\t\t} else {\n\t\t\t$offset = $args['offset'];\n\t\t}\n\t\tif (!isset($args['count'])) {\n\t\t\t$args['count'] = 0;\n\t\t\t$count = $args['count'];\n\t\t} else {\n\t\t\t$count = $args['count'];\n\t\t}\n\t\tif (!isset($args['transformations'])) {\n\t\t\t$args['transformations'] = array();\n\t\t\t$transformations = $args['transformations'];\n\t\t} else {\n\t\t\t$transformations = $args['transformations'];\n\t\t}\n\t\tif (!isset($args['referenceData'])) {\n\t\t\t$args['referenceData'] = array();\n\t\t\t$referenceData = $args['referenceData'];\n\t\t} else {\n\t\t\t$referenceData = $args['referenceData'];\n\t\t}\n\t\t\t\n\t\t$itemString = '';\n\t\t$internalGoodies = array();\n\t\t\n\t\t//for ($i=$offset, $len=min($offset+$count, count($sourceData)); $i<$len; $i++){\n\t\t\n\t\t$referenceDataTagList = $this->prepareReferenceData($referenceData);\n\n\n\t\t\t\n\t\tfor ($i = 0, $len = count($sourceData); $i < $len; $i++) {\n\t\t\t$itemRec = $sourceData[$i];\nif ($debug &&!is_array($itemRec)){\necho \"===\";\n\t\\Q\\Utils::dumpCli($itemRec, \"itemRec\");\n\techo htmlentities($itemTemplate);\necho \"===\";\n\t}\t\t\t\n\t\t\t$transformationResult = $this->executeTransformations($transformations, array_merge($itemRec, $referenceDataTagList), $referenceDataTagList);\n\t\t\t\n\t\t\t$enhancedItemRec = array_merge($itemRec, $transformationResult, $referenceDataTagList);\n\t\t\t\n\t\t\t$itemString .= $this->replaceItem($itemTemplate, $enhancedItemRec);\n\t\t}\n\t\t\n\t\t$blockData = array_merge($internalGoodies, $referenceDataTagList, array('productList' => $itemString));\n\t\t$transformationResult = $this->executeTransformations($transformations, $blockData, $referenceDataTagList);\n\t\t$blockData = array_merge($blockData, $transformationResult);\n\t\t$outString = $this->replaceItem($blockTemplate, $blockData);\n\t\t\n\t\t$outArray['outString'] = $outString;\n\t\t$outArray['referenceDataTagList'] = $outString;\n\t\treturn $outArray;\n\t\t\n\t}", "public function getTagsForDisplay() {\n\t\t$tags = $this->getTags();\n\t\t$list = array();\n\t\tforeach($tags as $group => $values) {\n\t\t\tforeach($values as $key => $value) {\n\t\t\t\t$list[ucfirst($group)][ $this->tagPrefix. ($group.'.'.$key) .$this->tagSuffix ] = $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $list;\n\t}", "public function get_tag_array() {\n\t\tglobal $database;\n\t\tif(!isset($this->tag_array)) {\n\t\t\t$this->tag_array = $database->get_col(\"SELECT tag FROM image_tags JOIN tags ON image_tags.tag_id = tags.id WHERE image_id=:id ORDER BY tag\", array(\"id\"=>$this->id));\n\t\t}\n\t\treturn $this->tag_array;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an object factory based on the SessionParameter::OBJECT_FACTORY_CLASS. If not set it returns an instance of ObjectFactory.
protected function createObjectFactory() { try { if (isset($this->parameters[SessionParameter::OBJECT_FACTORY_CLASS])) { $objectFactoryClass = new $this->parameters[SessionParameter::OBJECT_FACTORY_CLASS]; } else { $objectFactoryClass = $this->createDefaultObjectFactoryInstance(); } if (!($objectFactoryClass instanceof ObjectFactoryInterface)) { throw new \RuntimeException('Class does not implement ObjectFactoryInterface!', 1408354119); } $objectFactoryClass->initialize($this, $this->parameters); return $objectFactoryClass; } catch (\Exception $exception) { throw new \RuntimeException( 'Unable to create object factory: ' . $exception, 1408354120 ); } }
[ "public static function getFactory()\n\t{\n\t\tif (!isset(self::$factory))\n\t\t{\n\t\t\t$factory_class = self::getConfig()->default_factory; \n\t\t\tself::$factory = new $factory_class;\n\t\t}\n\t\treturn self::$factory;\n\t}", "public static function getFactory(){\n if(!self::$_instance)\n self::$_instance = new self;\n\n return self::$_instance;\n }", "public function getFactory()\n {\n return new Factory($this);\n }", "public static function getFactory()\n\t{\n\tif(!self::$_instance)\n\tself::$_instance = new self;\n\t \n\treturn self::$_instance;\n\t}", "public function getFactory();", "public function initializeObjectWithFactory();", "public function getFactoryObject($sName) \n {\n return oxNew($sName);\n }", "private static function _getFactory()\n\t{\n\t\tself::_init();\n\t\treturn self::$factory;\n\t}", "public static function getFactory() {\n if(!self::$factory) {\n self::$factory = new ConnectionFactory();\n }\n\n return self::$factory;\n }", "public static function factory() {\n return new self(Session::factory());\n }", "protected static function newFactory()\n {\n $factory_classname = str_replace(\n '\\\\Models\\\\',\n '\\\\Database\\\\Factories\\\\',\n get_called_class()\n ).'Factory';\n\n return call_user_func($factory_classname.'::new');\n }", "protected function getOroSecurity_Acl_ObjectIdentityFactoryService()\n {\n return $this->services['oro_security.acl.object_identity_factory'] = new \\Oro\\Bundle\\SecurityBundle\\Acl\\Domain\\ObjectIdentityFactory($this->get('oro_security.acl.extension_selector'));\n }", "public static function getInstance(): ClassFactory\n {\n if (!isset(self::$factory)) {\n self::$factory = new self();\n }\n return self::$factory;\n }", "protected function createFactory()\n {\n $factory = $this->getMock( 'pdepend\\reflection\\interfaces\\ReflectionClassFactory' );\n $factory->expects( $this->any() )\n ->method( 'createClass' )\n ->will( $this->returnCallback( array( $this, 'getClassByName' ) ) );\n\n return $factory;\n }", "private function getPaymentMethodInstanceFactory()\n {\n if ($this->paymentMethodInstanceFactory === null) {\n $this->paymentMethodInstanceFactory = ObjectManager::getInstance()->get(\n InstanceFactory::class\n );\n }\n return $this->paymentMethodInstanceFactory;\n }", "public function testCreatedObjectFactoryInstanceWillBeInitialized()\n {\n $objectFactory = $this->getMock('\\\\Dkd\\\\PhpCmis\\\\ObjectFactory');\n $objectFactory->expects($this->once())->method('initialize');\n\n $sessionClassName = '\\\\Dkd\\\\PhpCmis\\\\Session';\n\n // Get mock, without the constructor being called\n $mock = $this->getMockBuilder($sessionClassName)\n ->disableOriginalConstructor()\n ->setMethods(['createDefaultObjectFactoryInstance'])\n ->getMock();\n\n // set createDefaultObjectFactoryInstance to return our object factory spy\n $mock->expects($this->once())\n ->method('createDefaultObjectFactoryInstance')\n ->willReturn($objectFactory);\n\n // now call the constructor\n $reflectedClass = new \\ReflectionClass(get_class($mock));\n $constructor = $reflectedClass->getConstructor();\n $constructor->invoke(\n $mock,\n [SessionParameter::REPOSITORY_ID => 'foo'],\n null,\n null,\n null,\n null,\n $this->getBindingsHelperMock()\n );\n }", "public static function getFactory()\n {\n if (is_null(static::$factory)) {\n static::$factory = new GatewayFactory;\n }\n\n return static::$factory;\n }", "private function getStreamFactory()\n {\n if ($this->streamFactory === null) {\n $this->streamFactory = StreamFactoryDiscovery::find();\n }\n\n return $this->streamFactory;\n }", "private function _getFactory() {\n\t\tif(is_null(self::$_factory)) {\n\t\t\tself::$_factory = new \\CryptLib\\Random\\Factory;\n\t\t}\n\n\t\treturn self::$_factory;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generated from protobuf field bytes nextKey = 4;
public function getNextKey() { return $this->nextKey; }
[ "public function nextKey()\n\t{\n\t\treturn $this->getValue('nextKey');\n\t}", "public function getKeyNext()\n {\n return $this->key_next;\n }", "function nextKey() {\n foreach (publicProperties($this) as $key => $value) {\n if (!is_int($key) or $key < 0 or $key >= $this->_nextKey) {\n throw new \\RuntimeException('Hash must have only non-negative integer keys.');\n }\n }\n return $this->_nextKey;\n }", "public function getNextRowKey()\n {\n if ($this->continuationToken == null) {\n return null;\n }\n return $this->continuationToken->getNextRowKey();\n }", "public function getAutoNextStateKey();", "public function setKeyNext($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->key_next !== $v) {\n $this->key_next = $v;\n $this->modifiedColumns[ApConfigTableMap::COL_KEY_NEXT] = true;\n }\n\n return $this;\n }", "public function getNextIdentifier()\n {\n $this->identifierToSend = (($this->identifierToSend + 1) % 256);\n return $this->identifierToSend;\n }", "public function nextSequentialKey() {\n\t\t// since 0 is a special case, test for it specifically\n\t\tif ($this->hasValueForKey(0)) {\n\t\t\treturn max(array_keys($this->store)) + 1;\n\t\t}\n\t\treturn 0;\n\t}", "public function getNewKey();", "public function getLastKey()\n {\n }", "public function setNextLastKey($value)\n {\n $this->_nextLastKey = $value;\n }", "function\tnewKey() {\n\t\tFDbg::begin( 1, basename( __FILE__), __CLASS__, __METHOD__.\"( $_digits, '$_nsStart', '$_nsEnd')\") ;\n\t\t$keyCol\t=\t$this->keyCol ;\n\t\t$myQuery\t=\t$this->getQueryObj( \"Select\") ;\n\t\t$myQuery->addWhere( $this->keyCol . \" LIKE 'A.%'\") ;\n\t\t$myQuery->addOrder( $this->keyCol . \" DESC\") ;\n\t\t$myQuery->addLimit( new FSqlLimit( 0, 1)) ;\n\t\t$myRow\t=\tFDb::queryRow( $myQuery, self::$db[$this->className]) ;\n\t\t$this->_assignFromRow( $myRow) ;\n\t\tFDbg::trace( 2, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"( $_digits, '$_nsStart', '$_nsEnd')\", \"Last Key := '\".$this->$keyCol.\"'\") ;\n\t\t$this->$keyCol\t=\t\"A.\" . sprintf( \"%06d\", intval( substr( $this->$keyCol, 2)) + 1) ;\n\t\tFDbg::end() ;\n\t}", "final protected function nextId()\n {\n return $this->packet_id++;\n }", "public function next()\n {\n next($this->keys);\n }", "public function getBufferKey();", "abstract protected function _keySize(): int;", "function _generateNextId()\n\t{\n\t\treturn $this->db->nextId(\"Hit\", true);\n\t}", "public function getNextStartPrimaryKeyList()\n {\n return $this->next_start_primary_key;\n }", "public function next_id();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation deleteOrphanrecordingAsync Deletes a single orphan recording
public function deleteOrphanrecordingAsync($orphanId) { return $this->deleteOrphanrecordingAsyncWithHttpInfo($orphanId) ->then( function ($response) { return $response[0]; } ); }
[ "public function deleteOrphanrecording($orphanId)\n {\n list($response) = $this->deleteOrphanrecordingWithHttpInfo($orphanId);\n return $response;\n }", "public function deleteOrphanrecordingAsyncWithHttpInfo($orphanId)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\OrphanRecording';\n $request = $this->deleteOrphanrecordingRequest($orphanId);\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 testDeleteOrphanrecording()\n {\n }", "public function delete($RecordingSid,$file_name){\n\t\t// Find your Account Sid and Auth Token at twilio.com/console\n\t\t$sid = getenv('ACCOUNT_SID');\n\t\t$token = getenv('TWILIO_TOKEN');\n\t\t$twilio = new Client($sid, $token);\n\t\t$twilio->recordings($RecordingSid)\n\t\t ->delete();\n\t\tunlink($file_name) or die(\"Couldn't delete file\");\n\t}", "public function delete($record);", "protected function deleteRecordingFile($filepath)\n {\n if (file_exists($filepath))\n {\n $deleted= unlink($filepath);\n\n if ($deleted)\n {\n echo \"The file has been successfully deleted\";\n }\n else\n {\n echo \"The file has not been successfully deleted\";\n }\n }\n else\n {\n echo \"The original file that you want to delete doesn't exist\";\n }\n }", "public function deleteJob($filename);", "public function deleteRecordedCall(array $opts = array())\n {\n $this->action('findme.delete_recorded_call');\n return $this->request($opts);\n }", "public function delete($identifier);", "public function deleted(Job $job);", "public function deleteActivityRecord(ActivityRecord $activity_record);", "public function DeleteRecord(GeoRecord $record) {\n\t\treturn $this->SendRequest('DELETE', '0.1/records/' . $record->Layer . '/' . $record->ID . '.json');\n\t}", "public function deleteResource(PersistentResource $resource);", "protected function deleteARecordingRequest($account_id, $recording_id)\n {\n // verify the required parameter 'account_id' is set\n if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $account_id when calling deleteARecording'\n );\n }\n // verify the required parameter 'recording_id' is set\n if ($recording_id === null || (is_array($recording_id) && count($recording_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $recording_id when calling deleteARecording'\n );\n }\n\n $resourcePath = '/Accounts/{accountId}/Recordings/{recordingId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($account_id !== null) {\n $resourcePath = str_replace(\n '{' . 'accountId' . '}',\n ObjectSerializer::toPathValue($account_id),\n $resourcePath\n );\n }\n // path params\n if ($recording_id !== null) {\n $resourcePath = str_replace(\n '{' . 'recordingId' . '}',\n ObjectSerializer::toPathValue($recording_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $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 HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function delete()\n {\n $this->_record->delete();\n }", "function deleteRecord($id) {\n\t\tif($this->noop) return;\n\t\t$this->_exec(\"harvestctxo_delete_by_recordid\", array($id));\n\t\t$this->_exec(\"harvestrecord_delete_by_id\", array($id));\n\t}", "public function deleteTrack(): void\n\t{\n\t\tif ($this->track_short_path === null) {\n\t\t\treturn;\n\t\t}\n\t\tStorage::delete($this->track_short_path);\n\t\t$this->track_short_path = null;\n\t\t$this->save();\n\t}", "public function deleteAsync(array $options = []): PromiseInterface;", "public function deleted(TrialRequest $trial_request)\n {\n //\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete all question of a parent id
public function delete_quest ($p_id) { $this->db->where(array('quiz_id'=>$p_id)); $this->db->delete($this->_table_name); }
[ "public function deleteChildren()\n {\n \tstatic::deleteAll(['parent' => $this->id]);\n }", "function deleteQuestionsRelatedByCorrectAnswerId(Query $q = null) {\n\t\tif (null === $this->getid()) {\n\t\t\treturn 0;\n\t\t}\n\t\t$this->QuestionsRelatedByCorrectAnswerId_c = array();\n\t\treturn Question::doDelete($this->getQuestionsRelatedByCorrectAnswerIdQuery($q));\n\t}", "public function DeleteAllFormQuestions() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\tthrow new QUndefinedPrimaryKeyException('Unable to call UnassociateFormQuestion on this unsaved SignupForm.');\n\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = SignupForm::GetDatabase();\n\n\t\t\t// Journaling\n\t\t\tif ($objDatabase->JournalingDatabase) {\n\t\t\t\tforeach (FormQuestion::LoadArrayBySignupFormId($this->intId) as $objFormQuestion) {\n\t\t\t\t\t$objFormQuestion->Journal('DELETE');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform the SQL Query\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`form_question`\n\t\t\t\tWHERE\n\t\t\t\t\t`signup_form_id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t');\n\t\t}", "public function destroy() {\r\n $this->deleted = true;\r\n $id = mysql_real_escape_string($this->id);\r\n mysql_query(\"UPDATE `content` SET `deleted` = true WHERE `id` = '{$id}' LIMIT 1;\");\r\n foreach($this->get_children() as $child) {\r\n $child->parent = $this->parent;\r\n $child->save();\r\n }\r\n }", "abstract public function removeQuestionSetRelatedData();", "static function deleteChildrenByParent(ProjectObjectTemplate $parent) {\n\t\t $type = ucfirst(strtolower($parent->getType()));\n\n\t\t if ($type == \"Milestone\" || $type == \"Task\") {\n\t\t\t try {\n\t\t\t\t DB::beginWork('Deleting '.$type.' @ ' . __CLASS__);\n\n\t\t\t\t switch($type) {\n\t\t\t\t\t case \"Milestone\":\n\t\t\t\t\t\t // remember task templates we have to delete\n\t\t\t\t\t\t $task_ids = DB::executeFirstColumn(\"SELECT id FROM \" . TABLE_PREFIX . \"project_object_templates WHERE parent_id = ? AND type = ?\", $parent->getId(), \"Task\");\n\n\t\t\t\t\t\t // find all subtask templates\n\t\t\t\t\t\t $subtask_ids = DB::executeFirstColumn(\"SELECT id FROM \" . TABLE_PREFIX . \"project_object_templates WHERE parent_id IN (?) AND type = ?\", $task_ids, \"Subtask\");\n\n\t\t\t\t\t\t // delete subtask templates\n\t\t\t\t\t\t DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"project_object_templates WHERE id IN (?)\", $subtask_ids);\n\n\t\t\t\t\t\t // delete task templates themselves\n\t\t\t\t\t\t DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"project_object_templates WHERE id IN (?)\", $task_ids);\n\t\t\t\t\t\t break;\n\t\t\t\t\t case \"Task\":\n\t\t\t\t\t\t // delete subtask templates\n\t\t\t\t\t\t DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"project_object_templates WHERE parent_id = ? AND type = ?\", $parent->getId(), \"Subtask\");\n\t\t\t\t\t\t break;\n\t\t\t\t } // switch\n\n\t\t\t\t DB::commit($type.' deleted @ ' . __CLASS__);\n\t\t\t } catch (Exception $e) {\n\t\t\t\t DB::rollback('Failed to delete '.$type.' @ ' . __CLASS__);\n\n\t\t\t\t throw $e;\n\t\t\t } // try\n\t\t } //if\n\n\t\t return true;\n\t }", "public function delete_question_delete()\n {\n $id = (int) $this->get('id');\n\t\t//delete the selected question from database for the input question id.\n $data=$this->Model->delete_row($id,\"q_data\");\n if ($data)\n {\n\t\t\t$this->set_response(['status' => $data,'error' => 'Record deleted'], REST_Controller::HTTP_OK); \n }\n else\n {\n $this->set_response(['status' => FALSE,'error' => 'Record could not be found'], REST_Controller::HTTP_OK); \n }\n\t}", "function deleteListChildContent($id){\n $child = TableContentDetails::where('parent_id', $id)->get();\n if($child):\n foreach ($child as $value) {\n deleteListChildContent($value->id);\n $value->delete();\n }\n endif;\n}", "function clear_questions($exam_id){\n\t$data = array();\n\t$result = mysql_query(\"SELECT * FROM `mock_exam_questions` WHERE `quiz_id` = '$exam_id'\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\tforeach($data as $d){\n\t\tclear_answers($d['question_id']);\n\t}\n\t$id = (int)$exam_id;\n\t// Delete the question to update\n\tmysql_query(\"DELETE FROM `mock_exam_questions` WHERE `quiz_id` = '$id'\");\n}", "public function cleanQuestions(){\n $questions = Question::with('exercise')->get();\n\n foreach($questions as $question){\n if(empty($question['exercise'])){\n $question->delete();\n }\n }\n return redirect()->route('admin.db-clean')->with('success_message', 'Questions table was successfully cleaned!');\n }", "function removeQuestions(&$temp_dom)\n\t{\n\t\t// Get question IDs\n\t\t$path = \"//Question\";\n\t\t$xpc = xpath_new_context($temp_dom);\n\t\t$res = & xpath_eval($xpc, $path);\n\t\tfor ($i = 0; $i < count ($res->nodeset); $i++)\n\t\t{\n\t\t\t$parent_node = $res->nodeset[$i]->parent_node();\n\t\t\t$parent_node->unlink_node($parent_node);\n\t\t}\n\t}", "function deleteAnswer(){\r\n\t\tforeach ($_POST[\"answer\"] as $answerId){\r\n\t\t\t$query = \"DELETE FROM {$this->main->databaseTablePrefix}poll_answers WHERE poll_answers_id ={$answerId}\";\r\n\t\r\n\t\t\t$recordSet = $this->main->databaseConnection->Execute($query);\r\n\t\t\t\t\t\t\r\n\t\t\t//Check for error, if an error occured then report that error\r\n\t\t\tif (!$recordSet) {\r\n\t\t\t\ttrigger_error(\"Unable to delete answer '{$answerId}'\\nreason is : \".$this->main->databaseConnection->ErrorMsg());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function deleteChilds(){\n\t\t$this->db->query('SELECT ID FROM ' . NEWSLETTER_TABLE . ' WHERE ParentID=' . intval($this->ID));\n\t\t$ids = $this->db->getAll(true);\n\t\tforeach($ids as $id){\n\t\t\t$child = new self($id);\n\t\t\t$child->delete();\n\t\t\t$child = new self();\n\t\t}\n\t}", "public function DeleteAnswerFromQuestionID(int $question_id)\n {\n $this->model->where('question_id',$question_id)->delete();\n }", "function quiz_delete($node) {\n // Delete quiz results.\n $res = db_query('SELECT result_id FROM {quiz_node_results}\n WHERE nid = :nid', array(':nid' => $node->nid));\n $result_ids = array();\n while ($result_id = $res->fetchField()) {\n $result_ids[] = $result_id;\n }\n entity_delete_multiple('quiz_result', $result_ids);\n\n // Delete quiz entities.\n $res = db_query('SELECT qnp_id FROM {quiz_node_properties}\n WHERE nid = :nid', array(':nid' => $node->nid));\n $qnp_ids = array();\n while ($qnp_id = $res->fetchField()) {\n $qnp_ids[] = $qnp_id;\n }\n entity_delete_multiple('quiz', $qnp_ids);\n\n // Remove quiz node records from table quiz_node_relationship\n db_delete('quiz_node_relationship')\n ->condition('parent_nid', $node->nid)\n ->execute();\n // Remove quiz node records from table quiz_node_result_options\n db_delete('quiz_node_result_options')\n ->condition('nid', $node->nid)\n ->execute();\n}", "public function deleteGroupQuestionsConnectionWithAnswer(){\n //Yii::app()->db->createCommand('DELETE FROM `tbl_link_group_questions_answers` WHERE `group_questions_id`=:group')->bindParam(\":group\",$this->id)->execute();\n Yii::app()->db->createCommand()->delete('tbl_link_group_questions_answers', 'group_questions_id=:id', array(':id'=>$this->id));\n }", "public function unset_on_parent() {\n\t\t$this->parent->delete_by_key( $this->key );\n\t}", "public function delete() {\n\t\tif(!$this->hasChildren())\n\t\t\tparent::delete();\n\t}", "public function deletequery(){\n\t\t$id = Input::get('queryId');\n\t\t$deleteQuestionwillingtohelp = Questionwillingtohelp::where('question_id', '=',$id)->delete();\n\t\t$deleteGroupQuestion = Groupquestion::where('question_id', '=',$id)->delete();\n\t\t$deleteQuestion = Question::where('id', '=',$id)->delete();\n\t\t$deleteKarmafeed = Karmafeed::where('id_type', '=',$id)->whereIn('message_type',array('KarmaQuery','OfferHelpTo'))->delete(); \n\t\t$deleteMykarma = Mykarma::where('entry_id', '=',$id)->whereIn('users_role',array('PostedQuery','OfferedHelp'))->delete();\n echo \"Question \".$id.\" deleted\";\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load ajax status with payment type otp
public function mp_hook_otp_ajax(){ return $this->mp_hook_payment_ajax('otp'); }
[ "function wpbs_action_ajax_booking_bt_update_status()\n{\n // Nonce\n check_ajax_referer('wpbs_change_payment_status', 'wpbs_token');\n\n if (!isset($_POST['id'])) {\n return false;\n }\n\n $payment_id = absint($_POST['id']);\n\n $payment = wpbs_get_payment($payment_id);\n\n echo wpbs_booking_details_order_information_bt_actions($payment);\n\n wp_die();\n}", "function _check_status() {\n global $platnoscipl_config;\n global $database;\n\n $order_id=$database->sql_select(\"order_id\",\"order_register\",\"session_id=$this->_session_id\");\n \n $sig=md5($this->_pos_id.$this->_session_id.$this->_ts.$platnoscipl_config->pl_md5_one);\n\n //$this->_save_error(\"\",$this->_session_id.\"::\".$order_id);\n\n // pobierz status transakcji\n $http =& new HTTP_Client;\n $res=$http->post(\"https://www.platnosci.pl/paygw/ISO/Payment/get/txt\",array(\n \"pos_id\"=>$this->_pos_id,\n \"session_id\"=>$this->_session_id,\n \"ts\"=>$this->_ts,\n \"sig\"=>$sig,\n )\n );\n\n $result=$http->_responses[0]['body'];\n\n if(preg_match(\"/trans_status: 1/\",$result)) {\n // ustaw kwadracik pomaranczowy\n /*$database->sql_update(\"order_register\",\"order_id=\".$order_id,array(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pay_status\"=>'000'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);*/\n $this->_save_error('status 1');\n $result=\"transakcja nowa\";\n }\n if(preg_match(\"/trans_status: 2/\",$result)) {\n $result=\"transakcja anulowana\";\n $this->_save_error('status 2');\n }\n if(preg_match(\"/trans_status: 3/\",$result)) {\n $result=\"transakcja odrzucona\";\n $this->_save_error('status 3');\n }\n if(preg_match(\"/trans_status: 4/\",$result)) {\n /*$database->sql_update(\"order_register\",\"order_id=\".$order_id,array(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pay_status\"=>'000'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);*/\n $this->_save_error('status 4');\n $result=\"transakcja rozpoczeta\";\n }\n if(preg_match(\"/trans_status: 5/\",$result)) {\n $result=\"oczekuje na odbior\";\n $this->_save_error('status 5');\n }\n if(preg_match(\"/trans_status: 6/\",$result)) {\n $result=\"autoryzacja odmowna\";\n $this->_save_error('status 6');\n }\n if(preg_match(\"/trans_status: 99/\",$result)) {\n $database->sql_update(\"order_register\",\"order_id=\".$order_id,array(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\"confirm_online\"=>\"1\",\n \"pay_status\"=>\"001\",\n \"confirm\"=>\"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t$this->_save_error(\"status 99 [ $order_id ]\");\n $result=\"płatnosc odebrana\";\n }\n if(preg_match(\"/trans_status: 888/\",$result)) {\n $result=\"bledny status\";\n $this->_save_error('status 888');\n }\n $res=serialize($res);\n $this->_save_error('',$res);\n $this->_save_error(\"\",$result);\n return true;\n }", "public function\n\t\tget_checkout_status_div()\n\t{\n\t\t// accounts >> shipping-details >> payment-options\n\t\n\t\t$checkout_status = $this->get_checkout_status();\n\t\t\n\t\t#echo $checkout_status; exit;\n\t\t\n\t\t$checkout_status_div = new HTMLTags_Div();\n\t\t$checkout_status_div->set_attribute_str('id', 'checkout_status_div');\n\n\t\t$checkout_status_ul = new HTMLTags_UL();\n\t\t\n\t\tswitch ($checkout_status) {\n\t\t\tcase 'accounts':\n\t\t\t\t$status_step_one_li = new HTMLTags_LI();\n\t\t\t\t$status_step_one_li->append_tag_to_content(new HTMLTags_Em('Log In'));\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_one_li);\n\t\t\t\t\n\t\t\t\t$status_step_two_li = new HTMLTags_LI();\n\t\t\t\t$status_step_two_li->append_str_to_content('Shipping Details');\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_two_li);\n\t\t\t\t\n\t\t\t\t$status_step_three_li = new HTMLTags_LI();\n\t\t\t\t$status_step_three_li->append_str_to_content('Go to Secure Server');\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_three_li);\n\t\t\t\t\n\t\t\t\t$p_text = <<<TXT\nPlease complete this form and create an account with us.\nAlternatively, log in with your existing email address and password.\nTXT;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'shipping-details':\n\t\t\t\t$status_step_one_li = new HTMLTags_LI();\n\t\t\t\t$status_step_one_li->append_str_to_content('Log In');\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_one_li);\n\t\t\t\t\n\t\t\t\t$status_step_two_li = new HTMLTags_LI();\n\t\t\t\t$status_step_two_li->append_tag_to_content(new HTMLTags_Em('Shipping Details'));\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_two_li);\n\t\t\t\t\n\t\t\t\t$status_step_three_li = new HTMLTags_LI();\n\t\t\t\t$status_step_three_li->append_str_to_content('Go to Secure Server');\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_three_li);\n\t\t\t\t\n\t\t\t\t$p_text = <<<TXT\nPlease enter or confirm your shipping address, this must be the same as your billing address. \nTXT;\n\n\t\t\t\tbreak;\n\t\t\tcase 'payment-options':\n\t\t\t\t$status_step_one_li = new HTMLTags_LI();\n\t\t\t\t$status_step_one_li->append_str_to_content('Log In');\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_one_li);\n\t\t\t\t\n\t\t\t\t$status_step_two_li = new HTMLTags_LI();\n\t\t\t\t$status_step_two_li->append_str_to_content('Shipping Details');\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_two_li);\n\t\t\t\t\n\t\t\t\t$status_step_three_li = new HTMLTags_LI();\n\t\t\t\t$status_step_three_li->append_tag_to_content(new HTMLTags_Em('Go to Secure Server'));\n\t\t\t\t$checkout_status_ul->append_tag_to_content($status_step_three_li);\n\t\t\t\t\n\t\t\t\t$p_text = <<<TXT\nCheck your shipping details and shopping basket.\nTXT;\n\n\t\t\t\t$p2_text = <<<TXT\nWhen you're happy, click the button below to be \ntransfered to a secure server where you \ncan enter your credit card details to complete the payment.\nTXT;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$checkout_status_div->append_tag_to_content($checkout_status_ul);\n\t\t\n\t\t$checkout_status_div->append_tag_to_content(new HTMLTags_P($p_text));\n\t\t\n\t\tif (isset($p2_text)) {\n\t\t\t$checkout_status_div->append_tag_to_content(new HTMLTags_P($p2_text));\n\t\t}\n\n\t\treturn $checkout_status_div;\n\t}", "function checkStatusPayment($url)\n\t\t{\n\t\t\t$str = file_get_contents($url); \n\n\t\t\t$resultJson = json_decode($str, true);\n\t\t\t\n\t\t\treturn $resultJson;\n\t\t}", "public function ajaxProcessUpdatePaymentMode()\n {\n Configuration::updateValue('PS_CHECKOUT_MODE', Tools::getValue('paymentMode'));\n }", "public function otpmodalAction()\r\n {\r\n $ravePaymentService = $this->ravePaymentService;\r\n $generalSession = $this->clientGeneralService->getGeneralSession();\r\n\r\n $request = $this->getRequest();\r\n if ($request->isPost()) {\r\n $post = $this->params()->fromRoute();\r\n $otp = $post['otp'];\r\n try {\r\n $ravePaymentService->setOtp($otp);\r\n $res = $ravePaymentService->validateCardPayment();\r\n\r\n if ($res == TRUE) {\r\n // Verify the transaction\r\n // And Redirect\r\n $verRes = $ravePaymentService->verifyCardPayment();\r\n if ($generalSession->savecc == TRUE) { // save the card if customer decides to save card\r\n $ravePaymentService->saveCard($this->identity());\r\n }\r\n\r\n if ($verRes == TRUE) { // meaning the verification was successful\r\n // redirect to the payment page\r\n $this->flashmessenger()->addSuccessMessage(\"Transaction Successful\");\r\n $redirect = new Redirect($this->url()->fromRoute(\"board/default\", array(\r\n \"action\" => \"payment\"\r\n )));\r\n $response = new Response();\r\n $response->add($redirect);\r\n\r\n return $this->getResponse()->setContent($response);\r\n }\r\n }\r\n } catch (\\Exception $e) {\r\n $this->flashmessenger()->addErrorMessage($e->getMessage());\r\n $redirect = new Redirect($this->url()->fromRoute(\"board/default\", array(\r\n \"action\" => \"payment\"\r\n )));\r\n $response = new Response();\r\n $response->add($redirect);\r\n return $this->getResponse()->setContent($response);\r\n }\r\n }\r\n $status = \"\";\r\n $response = new Response();\r\n $response->add($status);\r\n\r\n return $this->getResponse()->setContent($response);\r\n }", "public function getPaymentStatusAction()\n {\n $orderStatus = $this->getRepository()->getPaymentStatusQuery()->getArrayResult();\n\n $this->View()->assign([\n 'success' => true,\n 'data' => $orderStatus,\n ]);\n }", "public function payment_response()\r\n\t{\r\n\t\t$this->checkout_model->process_payment_status_in_general($_POST, $_GET);\r\n\t}", "function payfort_preload_checkout() {\n ?>\n <script src=\"https://beautiful.start.payfort.com/checkout.js\"></script>\n <script>\n StartCheckout.config({\n key: \"<?php echo $this->test_mode == 'yes'? $this->test_open_key : $this->live_open_key ?>\",\n form_label: 'OK',\n complete: function(params) {\n submitFormWithToken(params); // params.token.id, params.email\n }\n });\n </script>\n <?php\n }", "public function getAjaxStatus() {}", "public function check_status() {\n\n if ($this->isCompleted()){\n //do not check if it is already completed\n //also a workaround for manual old payments without transaction_id\n return true;\n }\n\n //todo: put this sensitive data in a secure place\n $url = 'http://argentina.dineromail.com/Vender/Consulta_IPN.asp';\n $tmpl = 'DATA=<REPORTE><NROCTA>%s</NROCTA><DETALLE><CONSULTA><CLAVE>%s</CLAVE><TIPO>1</TIPO><OPERACIONES><ID>%s</ID></OPERACIONES></CONSULTA></DETALLE></REPORTE>';\n $cuenta = '2790688';\n $clave = 'Ipn123Ahorra';\n $data = sprintf($tmpl,$cuenta,$clave,$this->getId());\n\n $ch = curl_init($url);\n \n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n $doc = new SimpleXMLElement($response);\n\n\n $values = array();\n\n\n if ($doc->ESTADOREPORTE==1){\n $op = $doc->DETALLE->OPERACIONES->OPERACION;\n\n if ($this->getId() == (int)$op->ID){\n $values = array_merge($values, array(\n 'dm_id' => (string)$op->NUMTRANSACCION,\n 'dm_bought_on' => date('Y-m-d H:i:s', strtotime($op->FECHA)),\n 'dm_amount' => (float)$op->MONTO,\n 'dm_net_amount' => (float)$op->MONTONETO,\n 'dm_method' => (int)$op->METODOPAGO,\n 'dm_medium' => (string)$op->MEDIOPAGO,\n 'dm_installments' => (int)$op->CUOTAS,\n 'dm_buyer_email' => (string)$op->COMPRADOR->EMAIL,\n 'dm_buyer_address' => (string)$op->COMPRADOR->DIRECCION,\n 'dm_buyer_comment' => (string)$op->COMPRADOR->COMENTARIO,\n 'dm_buyer_name' => (string)$op->COMPRADOR->NOMBRE,\n 'dm_buyer_phone' => (string)$op->COMPRADOR->TELEFONO,\n 'dm_buyer_tipodoc' => (string)$op->COMPRADOR->TIPODOC,\n 'dm_buyer_numdoc' => (string)$op->COMPRADOR->NUMERODOC,\n ));\n \n switch ((int)$op->ESTADO) {\n case 1:\n //PENDIENTE DE PAGO\n $values['status'] = 'P';\n break;\n case 2:\n //ACREDITADO\n $values['status'] = 'A';\n $this->getDeal()->increaseBought();\n break;\n case 3:\n //CANCELADO\n $values['status'] = 'C';\n break;\n }\n \n }else{\n $values['status'] = 'E';\n }\n\n }elseif($doc->ESTADOREPORTE==8){\n $values['status'] = 'E';\n }\n \n $this->fromArray($values);\n $this->save();\n return $this->isCompleted();\n \n }", "public function fetchModeOfPayments()\n {\n echo json_encode($this->oPaymentModel->fetchModeOfPayments());\n }", "function _prePayment( $data )\n {\n // prepare the payment form\n Tienda::load( 'TiendaHelperBase', 'helpers._base' );\n $helper = TiendaHelperBase::getInstance();\n \n $params = $this->get('params', array());\n \n $vars = new JObject();\n $vars->action = $params->get('action', '1');\n $vars->track_id = $data['order_id'];\n $vars->orderpayment_id = $data['orderpayment_id'];\n $vars->total = number_format($data['orderpayment_amount'], 2, \".\", \"\");\n $vars->email = JFactory::getUser()->email;\n \n $vars->response_url = JURI::base().'plugins/tienda/'.$this->_element.'/tmpl/response.php';\n $vars->error_url = JURI::base().'plugins/tienda/'.$this->_element.'/tmpl/error.php';\n \n \n // Is Demo or production?\n if($this->params->get('demo', '0') == 0){\n \t$vars->url = 'https://www.constriv.com/cg/servlet/PaymentInitHTTPServlet';\n \t$vars->account_id = $params->get('account_id', '');\n \t$vars->password = $params->get('password', '');\n } else{\n \t$vars->url = 'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet';\n \t$vars->account_id = $params->get('account_id_demo', '');\n \t$vars->password = $params->get('password_demo', '');\n }\n \n $vars->currency = $params->get('currency', '978');\n \n \n // Language\n \t\tif ($this->params->get('language', 'auto') == 'auto')\n \t\t{\n \t// automatic language from joomla\n \t\t\tjimport('joomla.language.helper');\n \t\t\t$lang = JLanguageHelper::detectLanguage();\n // TODO Use JFactory::getLanguage(); \n // and explode the language's code by the '-' to get the var->lang for 2CO\n \t\t\tswitch($lang)\n \t\t\t{\n \t\t\t\tcase \"es-ES\":\n \t\t\t\t\t$vars->language = \"ESP\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"en-US\":\n \t\t\t\t\t$vars->language = \"USA\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"de-DE\":\n \t\t\t\t\t$vars->language = \"DEU\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"fr-FR\":\n \t\t\t\t\t$vars->language = \"FRA\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"it-IT\":\n \t\t\t\t\t$vars->language = \"ITA\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"en-GB\":\n \t\t\t\tdefault: \t \n \t\t\t\t\t$vars->language = 'ENG';\n \t\t\t\t\tbreak;\n \t\t\t}\n \t\t\t\n } else{\n \t$vars->language = $this->params->get('language', 'ENG');\n }\n \n $data = new JObject();\n \n // Check the parameters!!\n\t\t //Apro la connessione\n\t\t $ch=curl_init($vars->url);\n\n\t\t $DataToSend =\"id=$vars->account_id&password=$vars->password&action=$vars->action&amt=\".$vars->total.\"&amp;currencycode=$vars->currency&langid=\".$vars->language.\"&responseURL=$vars->response_url&errorURL=$vars->error_url&trackid=$vars->track_id&udf3=EMAILADDR:\".$vars->email.\"&udf1=\".$vars->orderpayment_id;\n\t\t \n\t\t //Imposto gli headers HTTP\n\t\t //imposto curl per protocollo https\n\t\t curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t curl_setopt($ch,CURLOPT_POST,1);\n\t\t \n\t\t //Invio i dati\n\t\t curl_setopt($ch,CURLOPT_POSTFIELDS,$DataToSend);\n\t\t \n\t\t //imposta la variabile PHP \n\t\t curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1); \n\t\t \n\t\t //Ricevo la risposta dal server\n\t\t $varResponse=curl_exec($ch); \n\t\t \n\t\t //chiudo la connessione \n\t\t curl_close($ch); \n\t\t \n\t\t if (substr($varResponse,0,7) == '!ERROR!') {\n\t\t \n\t\t \t\t$data->error = 1;\n\t\t \t\t$data->message = $varResponse;\n\t\t \n\t\t } else {\n\t\t \n\t\t \t\t//Separo il contenuto della stringa ricevuta (PaymentID:RedirectURL)\n\t\t \t\t \t\t\n\t\t \t\t$varPosiz= strpos($varResponse, ':http');\n\t\t \t\t$varPaymentId= substr($varResponse,0,$varPosiz);\n\t\t \t\t$nc=strlen($varResponse);\n\t\t \t\t$nc=($nc-17);\n\t\t \t\t$varRedirectURL=substr($varResponse,$varPosiz+1);\n\t\t \n\t\t\t\t//Creo l'URL di redirezione\n\t\t \t\t$varRedirectURL =\"$varRedirectURL?PaymentID=$varPaymentId\";\n\t\t \t\t//echo $varRedirectURL;\n\t\t\t\t\n\t\t\t\t//Redirezione finale del browser sulla HPP\n\t\t \t\t$data->error = 0;\n\t\t \t\t$data->redirect = $varRedirectURL;\n\t\t}\n \n\t\t\n $html = $this->_getLayout('prepayment', $data);\n //$html = \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$varRedirectURL\\\">\";\n return $html;\n }", "public static function changePaymentCodAjax()\n {\n $result = self::changePaymentCod();\n if ($result)\n {\n echo 'ok';\n }\n else\n {\n echo '';\n }\n }", "function ajax_full_status() {\n\t\t\t$status = $this->get_status();\n\t\t\t$text = $this->status_text( $status );\n\n\t\t\techo json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'text' => $text,\n\t\t\t\t\t'status' => $status,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tdie();\n\t\t}", "function ajaxQueryServiceStatusDetails()\n {\n $serviceId = $_POST[\"serviceStatusId\"];\n\n if (!empty($serviceId)) {\n if (!is_numeric($serviceId)) {\n echo \"{}\";\n return;\n }\n\n $no = $this->NetworkOutage_model->getNetworkOutageById($serviceId);\n //header('Content-Type: text/javascript');\n $expNO = $this->exportNetworkOutageDetail($no->next());\n\n $exptNOResp = json_encode($expNO);\n if (is_null($_GET['callback'])) {\n echo $exptNOResp;\n } else {\n echo $_GET['callback']. '('. $exptNOResp .');';\n }\n } else {\n // return empty object\n echo \"{}\";\n }\n }", "public function ajaxProcessRefreshPaypalAccountStatus()\n {\n /** @var \\PrestaShop\\Module\\PrestashopCheckout\\Repository\\PaypalAccountRepository $paypalAccount */\n $paypalAccount = $this->module->getService('ps_checkout.repository.paypal.account');\n /** @var \\PrestaShop\\Module\\PrestashopCheckout\\Repository\\PsAccountRepository $psAccount */\n $psAccount = $this->module->getService('ps_checkout.repository.prestashop.account');\n\n // update merchant status only if the merchant onBoarding is completed\n if ($paypalAccount->onBoardingIsCompleted() && $psAccount->onBoardingIsCompleted()\n ) {\n /** @var \\PrestaShop\\Module\\PrestashopCheckout\\Updater\\PaypalAccountUpdater $updater */\n $updater = $this->module->getService('ps_checkout.updater.paypal.account');\n $updater->update($paypalAccount->getOnboardedAccount());\n }\n\n /** @var \\PrestaShop\\Module\\PrestashopCheckout\\Presenter\\Store\\Modules\\PaypalModule $paypalModule */\n $paypalModule = $this->module->getService('ps_checkout.store.module.paypal');\n $this->ajaxDie(\n json_encode($paypalModule->present())\n );\n }", "public function ajaxProcessUpdatePaymentMode()\n {\n /** @var PrestaShop\\Module\\PrestashopCheckout\\PayPal\\PayPalConfiguration $paypalConfiguration */\n $paypalConfiguration = $this->module->getService('ps_checkout.paypal.configuration');\n $paypalConfiguration->setPaymentMode(Tools::getValue('paymentMode'));\n\n $this->ajaxDie(json_encode(true));\n }", "public function changePaymentMode()\n\t{\n\t\tif($this->request->is('ajax'))\n\t\t{\n\t\t\tif($this->request->is('get'))\n\t\t\t{\n\t\t\t\t$query_data = $this->request->query;\n\t\t\t\t$patient_id = $query_data['id-patient'];\n\n\n\t\t\t\tswitch ($query_data['type']) \n\t\t\t\t{\n\t\t\t\t\tcase 'insurance':\n\t\t\t\t\t\t\t$actual_date = new \\DateTime();\n\t\t\t\t\t\t\t$now = $actual_date->format('Y-m-d');\n\t\t\t\t\t\t\t$this->loadModel('PatientInsurances');\n\t\t\t\t\t\t\t$insurances = $this->PatientInsurances->find()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->contain(['PatientInsurers'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->where(['patient_id'=>$patient_id])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->andWhere(function($exp,$q){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\treturn $exp->isNull('deleted');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->andWhere(['PatientInsurances.state'=>1,'PatientInsurances.expired_insurance_date > '=>$now]);\n\n\n\t\t\t\t\t\t\tif($insurances)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->set(compact('insurances'));\n\t\t\t\t\t\t\t\t$this->render('change_payment_mode_insurance');\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo 'down';\n\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'cash':\n\t\t\t\t\t\t $this->render('change_payment_mode_cash');\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'cb':\n\t\t\t\t\t\t $this->render('change_payment_mode_cb');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif($this->request->is('post'))\n\t\t\t{\n\t\t\t\t$data = $this->request->data;\n\t\t\t\t$this->loadModel('Visits');\n\t\t\t\t$this->loadModel('VisitStates');\n\t\t\t\t$visit = $this->Visits->get($data['id-bill'],['contain'=>['VisitSpecialities','VisitInterventionDoctors.Doctors.People','VisitStates']]);\n\t\t\t\t$data['state_visit'] = 'change_payment_mode_booking';\n\t\t\t\t$visit->visit_states[0]->state_end = new \\DateTime('NOW');\n\t\t\t\t//setting a new state\n\n //change the state from reservation to consultation\n $data_state=[\n \t'state_begin'=> new \\DateTime('NOW'),\n 'visit_level_id' => 1,\n 'visit_kind_transport_id' =>1,\n 'visit_authorized' => true,\n 'visit_state_type_id' => 1\n ];\n $visit_state = $this->VisitStates->newEntity($data_state);\n\n array_push($visit->visit_states,$visit_state);\n\n\t\t\t\t$data['manager_operator_id'] = $this->Auth->user('id');\n\n\t\t\t\tswitch($data['type'])\n\t\t\t\t{\n\t\t\t\t\tcase 'insurance':\n\t\t\t\t\t\t$data['kind_solvment']='insurance';\n\t\t\t\t\t\t$visit->perc_insurance = $data['perc_insurance_change_mode'];\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'cash':\n\t\t\t\t\t\t$data['kind_solvment']='cash';\n\t\t\t\t\t\t$visit->montant = $data['amount_cash_booking_mode'];\n\t\t\t\t\tbreak;\n\n\n\t\t\t\t\tcase 'cb':\n\t\t\t\t\t\t$data['kind_solvment']='cb';\n\t\t\t\t\t\t$visit->bank_reference = $data['bank_reference_change_mode'];\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$visit = $this->Visits->patchEntity($visit,$data,['associated'=>'VisitInvoices.VisitInvoicePayments.VisitInvoicePaymentSchedules','VisitStates']);\n\t\t\t\t$visit->dirty('visit_invoices',true);\n\t\t\t\t$visit->dirty('visit_invoices.visit_invoice_payments',true);\n\t\t\t\t$visit->dirty('visit_states',true);\n\n\t\t\t\tif($this->Visits->save($visit))\n\t\t\t\t{\n\t\t\t\t\t$this->loadModel('VisitInterventionDoctors');\n\t\t\t\t\t\t\t$visit_intervention_doctor = $this->VisitInterventionDoctors->get($visit->visit_intervention_doctors[0]->id);\n\t\t\t\t\t\t\t$visit_intervention_doctor->visit_invoice_id = $visit->visit_invoices[0]->id;\n\n\t\t\t\t\t\t\tif($this->VisitInterventionDoctors->save($visit_intervention_doctor))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->loadModel('Institutions');\n\t\t\t\t\t\t\t\t$this->loadModel('Patients');\n\t\t\t\t\t\t\t\t$institution = $this->Institutions->find()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->contain(['InstitutionAdresses','CountryTownships.CountryCities'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where(['Institutions.id'=>$this->Auth->user('institution_id')])->first();\n\t\t\t\t\t\t\t\t$patient = $this->Patients->find()->contain('People')->where(['Patients.id'=>$data['id-patient']])->first();\n\t\t\t\t\t\t\t\t$operator = $this->Auth->user();\n\t\t\t\t\t\t\t\t$visit->search_doctor = $visit->visit_intervention_doctors[0]->doctor->person->lastname.' '.$visit->visit_intervention_doctors[0]->doctor->person->firstname;\n\t\t\t\t\t\t\t\t$visit->search_speciality=$visit->visit_speciality->libelle;\n\t\t\t\t\t\t\t\t$visit->visit_type_id = 1;\n\t\t\t\t\t\t\t\t$visit->visit_invoice_payment_way_id=$visit->visit_invoices[0]->visit_invoice_payment_way_id;\n\t\t\t\t\t\t\t\t$this->set(compact('visit','institution','patient','operator'));\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->render('add_visit');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo 'ko';\n\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo 'ko';\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ MiningBuddy ( $Header: /usr/home/mining/cvs/mining/functions/usermngt/changeEmail.php,v 1.1 2008/01/03 14:55:10 mining Exp $ Copyright (c) 20052008 Christian Reiss. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. / Change eMail.
function changeEmail() { global $SALT; global $DB; global $MySelf; // Are we allowed to change our email? if (!$MySelf->canChangeEmail()) { makeNotice("You are not allowed to change your email. Ask your CEO to re-enable this feature for your account.", "error", "Forbidden"); } /* * At this point we know that the user who submited the * email change form is both legit and the form was not tampered * with. Proceed with the email-change. */ // its easier on the eyes. $email = sanitize($_POST[email]); $username = $MySelf->getUsername(); // Update the Database. global $IS_DEMO; if (!$IS_DEMO) { $DB->query("update users set email = '$email', emailvalid = '0' where username = '$username'"); makeNotice("Your email information has been updated. Thank you for keeping your records straight!", "notice", "Information updated"); } else { makeNotice("Your email would have been changed. (Operation canceled due to demo site restrictions.)", "notice", "Email change confirmed"); } }
[ "public function editUserEmail() {\n \n \n if (!empty($_POST['user_email']) && $_POST['user_email'] == $_SESSION[\"user_email\"]) {\n \n $this->errors[] = \"Sorry, that email address is the same as your current one. Please choose another one.\";\n \n } \n // user mail cannot be empty and must be in email format\n elseif (!empty($_POST['user_email']) && filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n \n // escapin' this\n $this->user_email = htmlentities($_POST['user_email'], ENT_QUOTES);\n // prevent database flooding\n $this->user_email = substr($this->user_email, 0, 64);\n // not really necessary, but just in case...\n $this->user_id = $_SESSION['user_id'];\n\n $sth = $this->db->prepare(\"UPDATE users SET user_email = :user_email WHERE user_id = :user_id ;\");\n $sth->execute(array(':user_email' => $this->user_email, ':user_id' => $this->user_id)); \n \n $count = $sth->rowCount();\n \n if ($count == 1) {\n\n Session::set('user_email', $this->user_email);\n \n // call the setGravatarImageUrl() method which writes gravatar urls into the session\n $this->setGravatarImageUrl($this->user_email); \n \n $this->errors[] = \"Your email address has been changed successfully. New email address is \" . $this->user_email . \".\";\n\n } else {\n\n $this->errors[] = \"Sorry, your email changing failed.\";\n\n }\n \n } else {\n \n $this->errors[] = \"Sorry, your chosen email does not fit into the naming pattern.\";\n \n } \n \n }", "private function _activate_change_email()\n\t{\n\t\tglobal $modSettings, $txt;\n\n\t\tif (isset($this->_req->post->new_email, $this->_req->post->passwd)\n\t\t\t&& validateLoginPassword($this->_req->post->passwd, $this->_row['passwd'], $this->_row['member_name'], true)\n\t\t\t&& ($this->_row['is_activated'] == 0 || $this->_row['is_activated'] == 2))\n\t\t{\n\t\t\tif (empty($modSettings['registration_method']) || $modSettings['registration_method'] == 3)\n\t\t\t{\n\t\t\t\tthrow new Exception('no_access', false);\n\t\t\t}\n\n\t\t\t// @todo Separate the sprintf?\n\t\t\tif (!DataValidator::is_valid($this->_req->post, array('new_email' => 'valid_email|required|max_length[255]'), array('new_email' => 'trim')))\n\t\t\t{\n\t\t\t\tthrow new Exception(sprintf($txt['valid_email_needed'], htmlspecialchars($this->_req->post->new_email, ENT_COMPAT, 'UTF-8')), false);\n\t\t\t}\n\n\t\t\t// Make sure their email isn't banned.\n\t\t\tisBannedEmail($this->_req->post->new_email, 'cannot_register', $txt['ban_register_prohibited']);\n\n\t\t\t// Ummm... don't take someone else's email during the change\n\t\t\t// @todo Separate the sprintf?\n\t\t\tif (userByEmail($this->_req->post->new_email) === false)\n\t\t\t{\n\t\t\t\tthrow new Exception('email_in_use', false, array(htmlspecialchars($this->_req->post->new_email, ENT_COMPAT, 'UTF-8')));\n\t\t\t}\n\n\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\t\t\tupdateMemberData($this->_row['id_member'], array('email_address' => $this->_req->post->new_email));\n\t\t\t$this->_row['email_address'] = $this->_req->post->new_email;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function editUserEmail()\n {\n if (!empty($_POST['email']) && $_POST['email'] == $_SESSION[\"email\"]) {\n\n $this->errors[] = \"Sorry, that email address is the same as your current one. Please choose another one.\";\n\n // user mail cannot be empty and must be in email format\n } elseif (!empty($_POST['email']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {\n\n // if database connection opened\n if ($this->databaseConnection()) {\n\n // prevent database flooding\n $this->email = substr(trim($_POST['email']), 0, 64);\n // not really necessary, but just in case...\n $this->id = intval($_SESSION['id']);\n\n // write users new data into database\n $query_edit_email = $this->db_connection->prepare('UPDATE users SET email = :email WHERE id = :id');\n $query_edit_email->bindValue(':email', $this->email, PDO::PARAM_STR);\n $query_edit_email->bindValue(':id', $this->id, PDO::PARAM_INT);\n $query_edit_email->execute();\n\n if ($query_edit_email->rowCount()) {\n\n $_SESSION['email'] = $this->email;\n $this->messages[] = \"Your email address has been changed successfully. New email address is \" . $this->email . \".\";\n\n } else {\n\n $this->errors[] = \"Sorry, your email changing failed.\";\n\n }\n\n }\n\n } else {\n\n $this->errors[] = \"Sorry, your chosen email does not fit into the naming pattern.\";\n\n }\n\n }", "public function ChangeMail()\r\n\t{\r\n\t\tswitch($_GET['do'])\r\n\t\t{\r\n\t\t\tcase \"send_code\" :\r\n\t\t\t\t$currentId = $this->DB->GetCurrentId(\"CTM_ChangeMail\") + 1;\r\n\t\t\t\t$dechex = create_function(\"\\$integer\", \"return str_pad(dechex(\\$integer >= 255 ? 255 : \\$integer), 2, 0, STR_PAD_LEFT);\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$confirmCode = $dechex($currentId);\r\n\t\t\t\t$confirmCode .= \":\".$dechex(0xBB - strlen($this->userData['memb___id']) + mt_rand(0, 50));\r\n\t\t\t\t$confirmCode .= \":\".$dechex(strlen($this->userData['mail_addr']) + mt_rand(0, 50));\r\n\t\t\t\t$confirmCode .= \":\".$dechex(mt_rand(0, 70));\r\n\t\t\t\t$confirmCode .= \":\".$dechex(mt_rand(71, 170));\r\n\t\t\t\t$confirmCode .= \":\".$dechex(0xBB / intval(date(\"d\")) + intval(date(\"H\")) + intval(date(\"m\")) + intval(date(\"s\")) + mt_rand(0, 50));\r\n\t\t\t\t$confirmCode .= \":\".$dechex(0xBB / intval(date(\"m\")) + intval(date(\"H\")) + intval(date(\"m\")) + intval(date(\"s\")) + mt_rand(0, 50));\r\n\t\t\t\t$confirmCode .= \":\".$dechex(intval(date(\"Y\")) / 0xBB + intval(date(\"H\")) + intval(date(\"m\")) + intval(date(\"s\")) + mt_rand(0, 50));\r\n\t\t\t\t\t\t\r\n\t\t\t\t$confirmCode = strtoupper($confirmCode);\r\n\t\t\t\t$link = gerateFullLink(\"?/userpanel/changeMail\");\r\n\t\t\t\t\r\n\t\t\t\t$this->DB->Insert(\"CTM_ChangeMail\", array\r\n\t\t\t\t(\r\n\t\t\t\t\t\"Account\" => $this->userData['info']['memb___id'],\r\n\t\t\t\t\t\"ConfirmCode\" => $confirmCode,\r\n\t\t\t\t\t\"Expiration\" => strtotime(\"+ 24 hours\")\r\n\t\t\t\t));\r\n\t\t\t\t\t\r\n\t\t\t\t$this->email->arguments = array\r\n\t\t\t\t(\r\n\t\t\t\t\t\"NAME\" => htmlEncode($this->userData['info']['memb_name']),\r\n\t\t\t\t\t\"CONFIRM_CODE\" => $confirmCode,\r\n\t\t\t\t\t\"SYSTEM_LINK\" => $link\r\n\t\t\t\t);\r\n\t\t\t\t$this->email->LoadTemplate(\"ChangeMemberMail\");\r\n\t\t\t\t$this->email->GetMailContent($mail);\r\n\t\t\t\t\r\n\t\t\t\t$this->mailer->AddAddress($this->userData['info']['mail_addr'], $this->userData['info']['memb_name']);\r\n\t\t\t\t$this->mailer->SetSubject($mail['subject']);\r\n\t\t\t\t$this->mailer->SetBody($mail['content']);\r\n\t\t\t\t\r\n\t\t\t\tif($this->mailer->SendMail() == true)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->WriteLog(array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t\"option\" => \"Change Mail\",\r\n\t\t\t\t\t\t\"data\" => array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"Process: Send Confirm Code\",\r\n\t\t\t\t\t\t\t\"Result: Success\"\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t));\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['SendCode']['Success'], 3));\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->WriteLog(array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t\"option\" => \"Change Mail\",\r\n\t\t\t\t\t\t\"data\" => array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"Process: Send Confirm Code\",\r\n\t\t\t\t\t\t\t\"Result: Error\"\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t));\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->lang->setArguments(\"UserPanel,ChangeMail,Messages,Error_SendMail\", CoreVariables::ErrorsCode()->SendMailError);\r\n\t\t\t\t\treturn setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['SendCode']['Error_SendMail'], 2));\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"process\" :\r\n\t\t\t\tif(empty($_POST['NewMail']) || empty($_POST['ConfirmCode']))\r\n\t\t\t\t\treturn setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['Void'], 1));\r\n\t\t\t\t\t\r\n\t\t\t\tif(!CTM_Text::CheckMail($_POST['NewMail']))\r\n\t\t\t\t\treturn setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['MailInvalid'], 2));\r\n\t\t\t\t\t\r\n\t\t\t\t$this->DB->Arguments($_POST['ConfirmCode'], USER_ACCOUNT);\r\n\t\t\t\t$findConfirmCodeQ = $this->DB->Select(\"Expiration\", \"CTM_ChangeMail\", \"ConfirmCode = '%s' AND Account = '%s'\");\r\n\t\t\t\t\r\n\t\t\t\tif($this->DB->CountRows($findConfirmCodeQ) < 1)\r\n\t\t\t\t\treturn setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['CodeInvalid'], 2));\r\n\t\t\t\t\t\r\n\t\t\t\t$findConfirmCode = $this->DB->FetchRow($findConfirmCodeQ);\r\n\t\t\t\t\r\n\t\t\t\tif(time() >= $findConfirmCode[0])\r\n\t\t\t\t\treturn setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['CodeExpired'], 2));\r\n\t\t\t\t\t\r\n\t\t\t\t$this->MuLib('Member')->UpdateAccount(USER_ACCOUNT, array(\"info\" => array(\"mail_addr\" => $_POST['NewMail'])));\r\n\t\t\t\t$this->DB->Arguments(USER_ACCOUNT, $_POST['ConfirmCode']);\r\n\t\t\t\t$this->DB->Delete(\"CTM_ChangeMail\", \"Account = '%s' AND ConfirmCode = '%s'\");\r\n\t\t\t\t\r\n\t\t\t\t$this->WriteLog(array\r\n\t\t\t\t(\r\n\t\t\t\t\t\"option\" => \"Change Mail\",\r\n\t\t\t\t\t\"data\" => array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t\"Process: Change Mail\",\r\n\t\t\t\t\t\t\"New Mail: \".$_POST['NewMail']\r\n\t\t\t\t\t),\r\n\t\t\t\t));\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\treturn setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['Success'], 3));\r\n\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\tif(loadIsAjax() == true && LOADING_PAGE_AJAX == false)\r\n\t\t\t\t\texit();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function email_link(){\n global $user, $mysqli;\n \n $email = $_POST['email'];\n $id = $this->id;\n\n if ($user->get_rank()<1 && $id!=$_SESSION['user'])\n {\n $stmt = $mysqli->prepare(\"UPDATE users SET email = ? WHERE id=?\");\n $stmt->bind_param(\"sd\", $email, $id);\n $stmt->execute();\n $stmt->get_result();\n header(\"Location: \".WEB_URL.\"/admin/?do=user&id=\".$id);\n return;\n }\n\n $time = strtotime('+1 day', time());\n\n $token = Token::add($id, 'email;$email', $time);\n\n $link = WEB_URL.\"/admin/?do=change-email&id=$id&token=$token\";\n $to = $email;\n $subject = _('Email change').' - '.NAME;\n $msg = sprintf(_( \"Hi %s!<br>Below you will find link to change your email. The link is valid for 24hrs. If you didn't request this, feel free to ignore it. <br><br><a href=\\\"%s\\\">CHANGE EMAIL</a><br><br>If the link doesn't work, copy &amp; paste it into your browser: <br>%s\"), $user->get_name(), $link, $link);\n $headers = \"Content-Type: text/html; charset=utf-8 \".PHP_EOL;\n $headers .= \"MIME-Version: 1.0 \".PHP_EOL;\n $headers .= \"From: \".MAILER_NAME.' <'.MAILER_ADDRESS.'>'.PHP_EOL;\n $headers .= \"Reply-To: \".MAILER_NAME.' <'.MAILER_ADDRESS.'>'.PHP_EOL; \n\n mail($to, $subject, $msg, $headers);\n return _('Confirmation email sent!');\n }", "public function userUpdateEmail(){\n\t return $this->controller->update(\n\t \t\"UPDATE user_tbl SET email = ? WHERE user_id = ?\",\n\t \t[\n\t\t \t'email' => $this->email,\n\t\t \t'user_id' => $_SESSION['userID']\n\t\t ]\n\t );\n\t}", "function change_email_by_capability($Qreq) {\n global $Conf, $Me;\n $capmgr = $Conf->capability_manager();\n $capdata = $capmgr->check($Qreq->changeemail);\n if (!$capdata\n || $capdata->capabilityType != CAPTYPE_CHANGEEMAIL\n || !($capdata->data = json_decode($capdata->data))\n || !get($capdata->data, \"uemail\"))\n error_go(false, \"That email change code has expired, or you didn’t enter it correctly.\");\n\n if ($capdata->contactId)\n $Acct = $Conf->user_by_id($capdata->contactId);\n else\n error_go(false, \"That email change code was created improperly due to a server error. Please create another email change code, or sign out of your current account and create a new account using your preferred email address.\");\n\n if (!$Acct)\n error_go(false, \"No such account.\");\n else if (isset($capdata->data->oldemail)\n && strcasecmp($Acct->email, $capdata->data->oldemail))\n error_go(false, \"You have changed your email address since creating that email change code.\");\n\n $email = $capdata->data->uemail;\n if ($Conf->user_id_by_email($email))\n error_go(false, \"Email address “\" . htmlspecialchars($email) . \"” is already in use. You may want to <a href=\\\"\" . hoturl(\"mergeaccounts\") . \"\\\">merge these accounts</a>.\");\n\n $Acct->change_email($email);\n $capmgr->delete($capdata);\n\n $Conf->confirmMsg(\"Your email address has been changed.\");\n if (!$Me->has_database_account() || $Me->contactId == $Acct->contactId)\n $Me = $Acct->activate($Qreq);\n}", "function change_email($email)\n\t{\n\t\t$user_id = $this->ci->session->userdata('user_id');\n\n\t\tif (!is_null($user = $this->ci->users->get_user_by_id($user_id, FALSE))) {\n\n\t\t\t$data = array(\n\t\t\t\t'user_id'\t=> $user_id,\n\t\t\t\t'username'\t=> $user->username,\n\t\t\t\t'email'\t\t=> $email,\n\t\t\t);\n\t\t\tif (strtolower($user->email) == strtolower($email)) {\t\t// leave activation key as is\n\t\t\t\t$data['new_email_key'] = $user->new_email_key;\n\t\t\t\treturn $data;\n\n\t\t\t} elseif ($this->ci->users->is_email_available($email)) {\n\t\t\t\t$data['new_email_key'] = md5(rand().microtime());\n\t\t\t\t$this->ci->users->set_new_email($user_id, $email, $data['new_email_key'], FALSE);\n\t\t\t\treturn $data;\n\n\t\t\t} else {\n\t\t\t\t$this->error = array('email' => 'auth_email_in_use');\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "public function changeEmail()\n {\n $breadCrumb = $this->userEngine\n ->breadcrumbGenerate('change-email');\n\n $recentEmail = $this->userEngine\n ->getChangeRequestedEmail();\n \n JavaScript::put(['newEmail' => __ifIsset($recentEmail['data'], $recentEmail['data']['new_email'], false)]);\n\n $breadCrumb['data']['hideSidebar'] = true;\n $breadCrumb['data']['showFilterSidebar'] = false;\n \n return $this->loadPublicView('user.change-email', $breadCrumb['data']);\n }", "public function changeEmail(){\n\t\t$title = 'Paramètres';\n\t\t$lang = 1 ;\n\t\tif(isset($_SESSION['neozorus']['u_language'])){\n\t\t\t$lang = $_SESSION['neozorus']['u_language'];\n\t\t}\n\t\t/* Vérification des entrées du fomulaire */\n\t\tif(!empty($this->data)){\t\t\n\t\t\t$check = $this->checkEmailValidity();\n\t\t\tif ($check !== true) {\n\t\t\t\t$error = $check;\n\t\t\t}elseif(empty($this->data['confirmNewEmail']) || $this->data['confirmNewEmail'] != $this->data['newEmail']){\n\t\t\t\t$error = 'Erreur de confirmation';\n\t\t\t}else{\n\t\t\t\t$check = $this->checkPassword();\n\t\t\t\tif ($check !== true) {\n\t\t\t\t\t$error = $check;\n\t\t\t\t}else{\n\t\t\t\t\t$model = new UserModel();\n\t\t\t\t\tif($model->updateEmail($_SESSION['neozorus']['u_id'], $this->data['newEmail'])){\n\t\t\t\t\t\t$success = 'Changement effectué avec succès';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$error = 'Erreur d\\'écriture dans la base de données';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tob_start();\n\t\trequire(VIEWS_PATH . DS . 'Parameters' . DS . 'ChangeEmail.php');\n\t\t$view = ob_get_contents();\n\t\tob_clean();\n\t\trequire(VIEWS_PATH . DS . 'Home' . DS . 'Layout_CardsAndRules.php');\n\t}", "function on_email_change($id, $new_email)\n\t{\n\t\tglobal $DB, $std, $ibforums;\n\t\t\n\t\t//---- START\n\t\t\n\t\t\n\t\t//---- END\n\t}", "function sync_email($new_email, $uid) {\n\tglobal $user;\n\n\t$db = new db();\n\t$query = \"UPDATE phpbb_users SET user_email='$new_email' WHERE user_id='$uid' LIMIT 1\";\n\t$db->db_query($query);\n\t$db->db_close();\n\n\t$db = new db('room_reservations');\n\t$query = \"UPDATE login SET email='$new_email' WHERE memberid ='$uid' LIMIT 1\";\n\t$db->db_query($query);\n\t$db->db_close();\n\n\t//if ($user->is_auth('project_management'))\n\t//{\n\t//\t$db = new db('phpcollab');\n\t//\t$query = \"UPDATE phpcollab_members SET email_work='$new_email' WHERE id='$uid' LIMIT 1\";\n\t//\t$db->db_query($query);\n\t//\t$db->db_close();\n\t//}\n}", "public function editUserEmail_action() {\r\n Auth::checkAuthentication();\r\n $user_id = Session::get('user_id');\r\n $passwordNew = Request::post('password1');\r\n $passwordRetyped = Request::post('password2');\r\n if (isset($user_id) && isset($passwordNew) && isset($passwordRetyped)) {\r\n if (($passwordNew == $passwordRetyped) && (strlen($passwordNew) >= 6 && strlen($passwordRetyped) >= 6)) {\r\n if(PasswordResetModel::setNewPassword($user_id, $passwordNew, $passwordRetyped)){\r\n $this->View->render('login/index');\r\n }else{\r\n Session::add('feedback_negative', Text::get('FEEDBACK_PASSWORD_CHANGE_FAILED'));\r\n $this->View->render('login/requestEmailChange');\r\n }\r\n } else {\r\n Session::add('feedback_negative', Text::get('FEEDBACK_PASSWORD_CHANGE_FAILED'));\r\n $this->View->render('login/requestEmailChange');\r\n }\r\n } else {\r\n $this->View->render('error/index');\r\n }\r\n }", "public function actionChangeemail() {\r\n $data = $_POST;\r\n $currentUser = Yii::app()->user->userModel;\r\n if (!CPasswordHelper::verifyPassword($data['password'], $currentUser->password)) {\r\n die('Password is not correct.');\r\n }\r\n $checkingUser = User::model()->findByAttributes(array('email' => $data['email']));\r\n if (isset($checkingUser) && $checkingUser->id != $currentUser->id) {\r\n die('This email address is being used by another user.');\r\n }\r\n $user = User::model()->findByPK($currentUser->id);\r\n $user->email = $data['email'];\r\n $user->save();\r\n die('TRUE');\r\n }", "public function editEmail()\n {\n $query = 'UPDATE ' . $this->table . '\n SET email = :email\n WHERE uid = :uid';\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean data\n $this->uid = htmlspecialchars(strip_tags($this->uid));\n $this->email = htmlspecialchars(strip_tags($this->email));\n\n // Bind data\n $stmt->bindParam(':uid', $this->uid);\n $stmt->bindParam(':email', $this->email);\n\n\n // Execute query\n if ($stmt->execute()) {\n return true;\n }\n\n // Print error if something goes wrong\n printf(\"Error: %s.\\n\", $stmt->error);\n\n return false;\n }", "public function updateEmailAddress()\n\t{\n\t\t$newEmail = $this->getDataOption('email_new', null);\n\t\tif(!is_null($newEmail))\n\t\t{\n\t\t\tzbase_db_transaction_start();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$oldEmail = $this->email();\n\t\t\t\t$oldEmails = $this->getDataOption('email_old', []);\n\t\t\t\t$oldEmails[] = [\n\t\t\t\t\t'old' => $this->email(),\n\t\t\t\t\t'date' => zbase_date_now(),\n\t\t\t\t\t'ip' => zbase_ip(),\n\t\t\t\t\t'new' => $newEmail\n\t\t\t\t];\n\t\t\t\t//$this->setDataOption('email_old', $oldEmails);\n\t\t\t\t$emailVerificationEnabled = zbase_config_get('auth.emailverify.enable', true);\n\t\t\t\t$this->email = $newEmail;\n\t\t\t\t$this->email_verified = $emailVerificationEnabled ? 0 : 1;\n\t\t\t\t$this->email_verified_at = null;\n\t\t\t\tif(!empty($emailVerificationEnabled))\n\t\t\t\t{\n\t\t\t\t\t$code = zbase_generate_code();\n\t\t\t\t\t$this->setDataOption('email_verification_code', $code);\n\t\t\t\t\tzbase_alert('info', _zt('Successfully updated your email address. We sent an email to <strong>%email%</strong> to verify your new email address.', ['%email%' => $newEmail]));\n\t\t\t\t\tzbase_messenger_email($this->email(), 'account-noreply', _zt('Email address verification code'), zbase_view_file_contents('email.account.newEmailAddressVerification'), ['entity' => $this, 'code' => $code, 'newEmailAddress' => $newEmail]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tzbase_alert('info', _zt('Successfully updated your email address to <strong>' . $newEmail . '</strong>', ['%email%' => $newEmail]));\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * Remove options on updating email address\n\t\t\t\t */\n\t\t\t\t$this->unsetDataOption('email_new');\n\t\t\t\t$this->unsetDataOption('email_new_request_date');\n\t\t\t\t$this->save();\n\t\t\t\t$this->log('user::updateEmailAddress', null, ['old_email' => $oldEmail]);\n\t\t\t\tzbase_db_transaction_commit();\n\t\t\t\treturn true;\n\t\t\t} catch (\\Zbase\\Exceptions\\RuntimeException $e)\n\t\t\t{\n\t\t\t\tzbase_db_transaction_rollback();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function changeEmail()\n {\n $breadCrumb = $this->userEngine\n ->breadcrumbGenerate('change-email');\n\n $recentEmail = $this->userEngine\n ->getChangeRequestedEmail();\n \n JavaScript::put(['newEmail' => __ifIsset($recentEmail['data'], $recentEmail['data']['new_email'], false)]);\n\n return $this->loadPublicView('user.change-email', $breadCrumb['data']);\n }", "public function change_email_form() {\n if ($this->checkLogin('D') == '') {\n redirect('driver');\n } else {\n\n if ($this->lang->line('dash_change_email_address') != '')\n $dash_change_email_address = stripslashes($this->lang->line('dash_change_email_address'));\n else\n $dash_change_email_address = 'Change Email Address';\n\t\t\t$this->data['sideMenu'] = 'email';\n $this->data['heading'] = $dash_change_email_address;\n $this->load->view('driver/driversettings/change_email', $this->data);\n }\n }", "function change_from_email( $original ) {\n\treturn get_option('admin_email');;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Nov 18 retrieve plaque inspection record look for match on plaque id and year should be one plaque restoration record for each year
function getInspectionByPlqIdYear($fkplaque_id, $year) { $sql = "Select * from tblplaqueinspection where fkplaque_id='" .$fkplaque_id ."' and year(plqinsp_date)='" .$year ."'"; $result = getConn($sql); // execute sql statement return $result; // return what was retrieved }
[ "function get_by_year_now_year() {\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM evs_database.evs_pattern_and_year\n\t\t\t\tORDER BY pay_id DESC LIMIT 1\";\n\t\t\t\t\n\t\t$query = $this->db->query($sql);\n\t\treturn $query;\n\t\t\t\t\n\t}", "public function check_valid_year() {\n\t\t\tif ( ( $this -> db_results['year_code'] == $this -> latest_year_code ) \n\t\t\t\tand ( ! $this -> first_time ) \n\t\t\t\tand ($this -> valid_team > 0) ) {\n\t\t\t\t// $this -> insert_form_vars_to_db();\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$rewRecord = $wpdb -> query( 'SELECT * FROM indicators ORDER BY id DESC LIMIT 1');\n\t\t\t\t$this -> id = $new_record['id'];\n\t\t\t}\n\t\t\t// $this -> id = $this -> db_team['id'];\n\t\t\t$this -> id = $this -> db_record['id'];\n\n\t\t}", "static function getAllActiveClients_SR_UR_who_did_production($fields,$company_id,$year){\n// $query = \"SELECT $fields FROM clients JOIN projects ON projects.id= clients.event_id WHERE (inactive= 0 AND clients.company_id= $company_id) AND (YEAR(STR_TO_DATE(projects.event_date, '%m/%d/%Y'))=$year OR clients.event_id in ( 1, 2, 3 ))\";\n $query = \"SELECT $fields FROM clients JOIN projects ON projects.id= clients.event_id JOIN production ON clients.id= production.client_id WHERE (inactive= 0 AND clients.company_id= $company_id ) AND YEAR(production.prem_paid_month) = $year AND clients.event_id in ( 1, 2, 3 ) GROUP BY clients.id\";\n $clients = Client::find_by_sql($query);\n return $clients;\n }", "function get_detail_by_jobcode($jobcode) {\r\n // from the production_scheduling_period and the coressponding\r\n //production_output_period\r\n echo \"enter function of get_detail_by_jobcode <br>\";\r\n $branch = substr($jobcode, 0, 2);\r\n $co_code = substr($jobcode, 3, 3);\r\n $yearmonth = '20' . substr($jobcode, 7, 2) . '-' . substr($jobcode, 9, 2);\r\n $runningno = (int) substr($jobcode, 12, 4);\r\n $jobno = (int) substr($jobcode, 17, 2);\r\n $periodQuono = substr($jobcode, 7, 4);\r\n $objPeriod = new Period();\r\n $period = $objPeriod->getcurrentPeriod();\r\n echo \"\\$branch = $branch , \\$co_code = $co_code, \\$yearmonth = $yearmonth, \\$runningno = $runningno, \\$jobno = $jobno<br>\";\r\n echo \"\\$period = $period<br>\";\r\n $proschtab = 'production_scheduling_' . $period;\r\n echo \"$proschtab = $proschtab <br>\";\r\n $qr = \"SELECT * FROM $proschtab \"\r\n . \"WHERE jlfor = '$branch' \"\r\n . \"AND quono LIKE '$co_code%' \"\r\n . \"AND date_issue LIKE '$yearmonth%' \"\r\n . \"AND runningno = $runningno \"\r\n . \"AND status = 'active' \"\r\n . \"AND jobno = $jobno\";\r\n echo \"\\$qr = $qr <br>\";\r\n echo \"<br>###########################################################################<br>\";\r\n $objSQL = new SQL($qr);\r\n $result = $objSQL->getResultOneRowArray();\r\n //print_r($result);\r\n if (!empty($result)) {\r\n return $result;\r\n } else {//if current period table cant see any reudlt check last period table\r\n //return 'empty';\r\n $lastperiod = $objPeriod->getlastPeriod();\r\n $proschtab = 'production_scheduling_' . $lastperiod;\r\n echo \"check last period ,$proschtab <br>\";\r\n $qr = \"SELECT * FROM $proschtab \"\r\n . \"WHERE jlfor = '$branch' \"\r\n . \"AND quono LIKE '$co_code%' \"\r\n . \"AND date_issue LIKE '$yearmonth%' \"\r\n . \"AND runningno = $runningno \"\r\n . \"AND status = 'active' \"\r\n . \"AND jobno = $jobno\";\r\n echo \"\\$qr = $qr <br>\";\r\n $objSQL = new SQL($qr);\r\n $result = $objSQL->getResultOneRowArray();\r\n if (!empty($result)) {\r\n return $result;\r\n } else {\r\n return 'empty';\r\n }\r\n }\r\n}", "public static function findByYear($year, $fields = \"*\", $retarray = false) {\r\n $dq = Doctrine_Query::create ()\r\n ->select ( $fields )\r\n ->from ( 'InvoicesSettings is' )\r\n ->where ( 'is.year = ?'.$year )\r\n ->andWhere('is.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n ->limit ( 1 );\r\n \r\n $retarray = $retarray ? Doctrine_Core::HYDRATE_ARRAY : null;\r\n $record = $dq->execute ( array (), $retarray );\r\n return $record;\r\n }", "function donations_by_department_overview($year)\n\t{\n\t\t$query=$this->db->query(\"CALL sp_report_donations_by_department($year)\");\n\n\t\treturn $query->result_array(); \n\t\t$this->db->reconnect();\n\t}", "function woolman_camp_get_rates($year) {\n static $rates = array();\n if (!isset($rates[$year])) {\n $db = db_query('SELECT * FROM {woolman_camp_rates} WHERE year = %d', $year);\n $rates[$year] = db_fetch_array($db);\n unset($rates[$year]['year']);\n }\n return $rates[$year];\n}", "public static function getDataByYear($year) {\n $query = 'SELECT Year(SUPPLD_DATE) AS SupplyYear, Sum(IfNull(FO,0)) AS SHIPYEAR_FO, Sum(IfNull(DO,0)) AS SHIPYEAR_DO,\n Sum(IfNull(LO,0)) AS SHIPYEAR_LO, tb_ship_register.shipName_Cn\n FROM (SELECT\n sum(case Tbl_ShipSupply.AC_ITEM when \"FO\" then Tbl_ShipSupply.QTY else 0 end) as FO,\n sum(case Tbl_ShipSupply.AC_ITEM when \"DO\" then Tbl_ShipSupply.QTY else 0 end) as DO,\n sum(case Tbl_ShipSupply.AC_ITEM when \"LO\" then Tbl_ShipSupply.QTY else 0 end) as LO,\n Tbl_ShipSupply.SUPPLD_DATE, Tbl_INVOICE.ShipID\n FROM Tbl_INVOICE\n INNER JOIN Tbl_ShipSupply ON Tbl_INVOICE.Ref_No=Tbl_ShipSupply.INVOICE_ID\n WHERE (Tbl_ShipSupply.AC_ITEM=\"FO\" Or Tbl_ShipSupply.AC_ITEM=\"DO\" Or Tbl_ShipSupply.AC_ITEM=\"LO\")\n GROUP BY Tbl_ShipSupply.SUPPLD_DATE, Tbl_INVOICE.ShipID\n ORDER BY Tbl_ShipSupply.SUPPLD_DATE) as Qry_BunkerSupply\n JOIN tb_ship_register on tb_ship_register.RegNo = Qry_BunkerSupply.ShipID\n WHERE Year(SUPPLD_DATE) = \"'.$year.'\"\n GROUP BY Year(SUPPLD_DATE), tb_ship_register.RegNo';\n $result = DB::select($query);\n return $result;\n }", "function get_all_by_key_by_year() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_mbo\n\t\t\t\tWHERE sfm_pos_id = ? AND sfm_pay_id = ?\";\n\t\t$query = $this->db->query($sql, array($this->sfm_pos_id, $this->sfm_pay_id));\n\t\treturn $query;\n\t}", "function find_sid_by_jobcode($period, $jobcode) {\r\n // production_output_period\r\n //\r\n $branch = substr($jobcode, 0, 2);\r\n $co_code = substr($jobcode, 3, 3);\r\n $yearmonth = '20' . substr($jobcode, 7, 2) . '-' . substr($jobcode, 9, 2);\r\n $runningno = (int) substr($jobcode, 12, 4);\r\n $jobno = (int) substr($jobcode, 17, 2);\r\n $proschtab = 'production_scheduling_' . $period;\r\n $qr = \"SELECT * FROM $proschtab \"\r\n . \"WHERE jlfor = '$branch' \"\r\n . \"AND quono LIKE '$co_code%' \"\r\n . \"AND date_issue LIKE '$yearmonth%' \"\r\n . \"AND runningno = $runningno \"\r\n . \"AND status = 'active' \"\r\n . \"AND jobno = $jobno\";\r\n $objSQL = new SQL($qr);\r\n $result = $objSQL->getResultOneRowArray();\r\n #print_r($result);\r\n if (!empty($result)) {\r\n return $result;\r\n } else {\r\n return 'no sid can be found in $proschtab <br>';\r\n }\r\n}", "public function checkIfDefined($year) {\n $ym1 = intval($year) - 1;\n $y = intval($year);\n $yp1 = intval($year) + 1;\n $this->load->model('contracts_model');\n $contracts = $this->contracts_model->getContracts();\n $result = array();\n foreach ($contracts as $contract) {\n $result[] = array (\n 'contract' => $contract['id'],\n 'name' => $contract['name'],\n 'ym1' => $this->countDaysOff($contract['id'], $ym1),\n 'y' => $this->countDaysOff($contract['id'], $y),\n 'yp1' => $this->countDaysOff($contract['id'], $yp1)\n );\n }\n return $result;\n }", "public static function publc_by_year($year = \"\"){\n global $database;\n $returned_arr = [];\n if($year == \"\") {\n $publications = static::find_all(0, 0);\n if (!$publications) {\n return false;\n }\n $start_year = 2000;\n $end_year = date(\"Y\", time());\n $count = 0;\n for ($i = $start_year; $i <= $end_year; $i++) {\n foreach ($publications as $key => $value) {\n if ($publications[$key]->year == $i) {\n $count++;\n }\n }\n if($count > 0){ $returned_arr[$i] = $count; }\n }\n return count($returned_arr) > 0 ? $returned_arr : false ;\n }else{\n $publications = static::find_by_sql(\"SELECT * FROM publications WHERE year=\" . $year);\n return count($publications) > 0 ? $publications : false ;\n }\n }", "public function getAdminDividedLastYear(){\n try { \n $select = $this->select()\n \n ->from($this,array(\"alreadydivided\"=>\"SUM(with_satisfaction)\"))\n ->where('payment_status=?',1)\n ->where('YEAR(pay_date)=?',date('Y', strtotime('-1 year')));\n \n $res = $this->getAdapter()->fetchRow($select);\n if ($res){\n return $res;\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n } \n \n }", "static function getReceiptsForYear($year){\n\t\tglobal $db;\n\n\t\t$r = $db->query(\"SELECT * FROM `receipts` WHERE YEAR(dateOfSubmission)=\" . intval($year) . \" AND status=\" . Receipt::STATUS_CONFIRMED);\n\t\t\n\t\tif($db->error){\n\t\t\tdie(\"db-error \" . $db->error);\n\t\t}\n\n\t\tif($r == null){\n\t\t\treturn array();;\n\t\t}\n\n\t\t$output = array();\n\t\tfor($i = 0; $i < $r->num_rows; $i++)\n\t\t\t$output[] = new Receipt($r->fetch_assoc());\n\n\t\treturn $output;\n\t}", "public function findRetencionJudicial(){\r\n /*-----------------LOGICA PARA SELECT REGISTRO A EDITAR-----------------*/\r\n $query = \"call sp_pnllaRetencionJudicialConsultas(:flag,:criterio);\";\r\n \r\n $parms = array(\r\n \":flag\" => 6,\r\n \":criterio\" => $this->_idRetencionJudicial\r\n );\r\n $data = $this->queryOne($query,$parms);\r\n return $data;\r\n }", "function getCommissionWiseProjectSummary($sector_division)\n {\n $current_fiscal_year = getCurrentFiscalYear();\n $fiscal_year_date = getFiscalYearDats($current_fiscal_year);\n \n //dumpVar($fiscal_year_date['end_date']);\n \n $info['table'] = PROJECT_TBL . ' AS PT LEFT JOIN ' . \n MINISTRY_LOOKUP_TBL . ' AS MLT ON (PT.ministry_id = MLT.id) LEFT JOIN ' . \n AGENCY_LOOKUP_TBL . ' AS ALT ON (ALT.id=PT.agency_id) LEFT JOIN ' . \n VIEW_PROJECT_GRAND_TOTAL . ' AS VPGT ON (PT.id = VPGT.pid)';\n $info['debug'] = false;\n $info['where'] = 'PT.status = ' . q('Approved') . \n ' AND PT.sector_division = ' . $sector_division . \n ' AND ' . q($fiscal_year_date['end_date']) . ' <= PT.date_of_completion' .\n ' GROUP BY PT.ministry_id, PT.agency_id';\n $info['fields'] = array('COUNT(PT.id) AS project_count', 'MLT.name AS ministry_name', 'ALT.name AS agency_name', 'PT.date_of_completion', \n 'PT.ministry_id', 'PT.agency_id', 'PT.status', 'SUM(VPGT.total_cost)', 'SUM(VPGT.gob_cost)', 'SUM(VPGT.pa_through_gob_cost)', \n 'SUM(VPGT.pa_spc_acnt_cost)', 'SUM(VPGT.pa_dpa_cost)', 'SUM(VPGT.own_fund_cost)', 'SUM(VPGT.other_cost)');\n \n $result = select($info);\n //dumpvar($result);\n if ($result)\n {\n foreach($result AS $value)\n {\n $retData[$value->ministry_name][$value->agency_name] = $value;\n }\n }\n \n return $retData;\n }", "public function get_draft_results_year($league_id,$year){\r\n\t\t\r\n\t\t$return_array = array();\r\n\t\t\r\n\t\t//COMMON DRAFTS\r\n\t\t\r\n\t\t//get all the draft ids for the given year(s)\r\n\t\t\r\n\t\t$this->db->where('year',$year);\r\n\t\t$this->db->where('league_id',$league_id);\r\n\t\t$this->db->where('type','Common');\r\n\t\t$this->db->order_by('year','DESC');\r\n\t\t$this->db->order_by('start_time','ASC');\r\n\t\t$this->db->order_by('draft_id','ASC'); //for the old drafts that don't have start times\r\n\t\t$query = $this->db->get('Drafts');\r\n\t\t\r\n\t\t//create results for each draft\r\n\t\t$key=0;\r\n\t\tforeach ($query->result() as $draft)\r\n\t\t{\r\n\t\t\t$return_array['Common'][$draft->draft_id]['start_time'] = $draft->start_time;\r\n\t\t\t\r\n\t\t\t//get the picks for that draft\r\n\t\t\t$conditions = 'draft_id='.$draft->draft_id;\r\n\t\t\t$picks_query = $this->db->select('pick_id,original_owner, current_owner, round, pick_number,fffl_player_id')\r\n\t\t\t\t\t\t->where($conditions)\r\n\t\t\t\t\t\t->order_by('pick_number')\r\n\t\t\t\t\t\t->get('Draft_Picks');\r\n\t\t\t\r\n\t\t\t//add the picks to the array for that year key\r\n\t\t\tforeach($picks_query->result() as $picks){\r\n\t\t\t\t\r\n\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['original_owner'] = $picks->original_owner;\r\n\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['team_id'] = $picks->current_owner;\r\n\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['round'] = $picks->round;\r\n\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['fffl_player_id'] = $picks->fffl_player_id;\r\n\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['pick_id'] = $picks->pick_id;\r\n\t\t\t\tif($picks->fffl_player_id>0){\r\n\t\t\t\t\t$position = $this->Players->get_player_info(array($picks->fffl_player_id),\"fffl_player_id\",\"first_name last_name position\");\r\n \r\n\t\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['position'] = $position['position'];\r\n\t\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['name']=$position['first_name'].' '.$position['last_name'];\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['position'] = '';\r\n\t\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['name']='';\r\n\t\t\t\t}\r\n\t\t\t\t$return_array['Common'][$draft->draft_id]['picks'][$picks->pick_number]['team_name'] = $this->Teams->get_team_name_first_nickname($picks->current_owner);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//SUPPLEMENTAL\r\n\t\t//create an array with keys of year => 'id' 'pick' 'player' 'original owner'\r\n\t\t//get all the draft ids for the given year(s)\r\n\t\t$this->db->where('year',$year);\r\n\t\t$this->db->where('league_id',$league_id);\r\n\t\t$this->db->where('type','Supplemental');\r\n\t\t$this->db->order_by('year','DESC');\r\n\t\t$this->db->order_by('start_time','ASC');\r\n\t\t$this->db->order_by('draft_id','ASC'); //for the old drafts that don't have start times\r\n\t\t$query = $this->db->get('Drafts');\r\n\t\t\r\n\t\t//create results for each draft\r\n\t\tforeach ($query->result() as $draft)\r\n\t\t{\t\r\n\t\t\t$return_array['Supplemental'][$draft->draft_id]['start_time'] = $draft->start_time;\r\n\t\t\t//get the picks for that draft\r\n\t\t\t$conditions = 'draft_id='.$draft->draft_id;\r\n\t\t\t$picks_query = $this->db->select('pick_id,original_owner, current_owner, round, pick_number,fffl_player_id')\r\n\t\t\t\t\t\t->where($conditions)\r\n\t\t\t\t\t\t->order_by('pick_number')\r\n\t\t\t\t\t\t->get('Draft_Picks');\r\n\t\t\t//add the picks to the array for that year key\r\n\t\t\tforeach($picks_query->result() as $picks){\r\n\t\t\t\t\r\n\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['original_owner'] = $picks->original_owner;\r\n\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['team_id'] = $picks->current_owner;\r\n\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['round'] = $picks->round;\r\n\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['fffl_player_id'] = $picks->fffl_player_id;\r\n\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['pick_id'] = $picks->pick_id;\r\n\t\t\t\tif($picks->fffl_player_id>0){\r\n\t\t\t\t\t$position = $this->Players->get_player_info(array($picks->fffl_player_id),\"fffl_player_id\",\"first_name last_name position\");\r\n\t\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['position'] = $position['position'];\r\n\t\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['name']=$position['first_name'].' '.$position['last_name'];\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['position'] = '';\r\n\t\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['name']='';\r\n\t\t\t\t}\r\n\t\t\t\t$return_array['Supplemental'][$draft->draft_id]['picks'][$picks->pick_number]['team_name'] = $this->Teams->get_team_name_first_nickname($picks->current_owner);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(count($return_array)>0){\r\n\t\t\treturn $return_array;\r\n\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "public function loadBudgetDetailByGlCode($glcodeid, $year)\r\n {\r\n \r\n //define variables\r\n $isSuccess = FALSE;\r\n $message = \"\";\r\n $data = array();\r\n $code = SuccessClass::$CODE_SUCCESSFUL;\r\n\r\n try\r\n { \r\n \r\n $selectedyear=$year;\r\n $year= explode('-', $year);\r\n $FromYearMonth=$year[0];\r\n $ToYearMonth=$year[1];\r\n\r\n \r\n $isSuccess = ( $message == \"\" ); \r\n\r\n //initialize an instance from success class\r\n $success = SuccessClass::initialize($isSuccess);\r\n \r\n\r\n if( $isSuccess )\r\n {\r\n $budgetData = $this->budgetclass->getGlCodeBudgetDetail($glcodeid, $FromYearMonth, $ToYearMonth);\r\n \r\n $data = array();\r\n foreach($budgetData as $row){\r\n\r\n $date=$row['yearno'].'-'.$row['monthno']. '-01';\r\n $date= strtotime($date);\r\n $yearmonth=date('Ym', $date);\r\n\r\n $monthname=date('M Y', $date);\r\n if(count($this->data['budget_setting'])>0){ \r\n if($this->data['budget_setting']['ismonthly']==1){\r\n $monthname=date('M Y', $date);\r\n } elseif($this->data['budget_setting']['isquarterly'] == 1){ \r\n $todate=strtotime(\"+3 month\", $date);\r\n $todate=strtotime(\"-1 Days\", $todate);\r\n $monthname=date('M Y', $date).' to '.date('M Y', $todate);\r\n }elseif($this->data['budget_setting']['isannual']==1){ \r\n $todate=strtotime(\"+1 Years\", $date);\r\n $todate=strtotime(\"-1 Days\", $todate);\r\n $monthname=date('M Y', $date).' to '.date('M Y', $todate);\r\n } \r\n } \r\n $data[] = array(\r\n 'month' => $monthname,\r\n 'id' => $row['id'],\r\n 'amount' => $row['amount']\r\n );\r\n \r\n }\r\n \r\n $success -> setData($data);\r\n }\r\n }\r\n catch( Exception $e )\r\n {\r\n $success = SuccessClass::initialize(FALSE);\r\n $message = $e->getMessage();\r\n $message = $message . \" - \" . $e->getTraceAsString(); \r\n //log the exception\r\n $this->logClass->log(\"exception : \", $message);\r\n $code = SuccessClass::$CODE_EXCEPTION_OCCURED;\r\n }\r\n\r\n //set the variables\r\n $success -> setMessage($message);\r\n $success -> setCode($code);\r\n $success -> setData($data);\r\n \r\n //convert result data to json and set output\r\n $this->output\r\n ->set_content_type('application/json')\r\n ->set_output(json_encode($success));\r\n \r\n }", "public static function porAspiracion($aspiracion_id, $year_id)\n\t{\n\t\t$consulta = 'SELECT c.id as candidato_id, c.plancha, c.numero, usus.persona_id, \n\t\t\t\t\tusus.nombres, usus.apellidos, usus.user_id, usus.username, usus.tipo, usus.imagen_id, usus.imagen_nombre, usus.nombre_grupo, usus.abrev_grupo, \n\t\t\t\t\tusus.foto_id, usus.foto_nombre, usus.imagen_id, usus.imagen_nombre\n\t\t\t\tFROM vt_candidatos c \n\t\t\t\tINNER JOIN users u ON u.id=c.user_id and c.aspiracion_id=:aspiracion_id\n\t\t\t\tinner join (\n\t\t\t\t\t\n\t\t\t\tSELECT a.id as persona_id, a.nombres, a.apellidos, a.user_id, u.username, \n\t\t\t\t\t\t(\"Al\") as tipo, a.sexo, \n\t\t\t\t\t\tu.imagen_id, IFNULL(i.nombre, IF(a.sexo=\"F\",\"default_female.png\", \"default_male.png\")) as imagen_nombre, \n\t\t\t\t\t\ta.foto_id, IFNULL(i2.nombre, IF(a.sexo=\"F\",\"default_female.png\", \"default_male.png\")) as foto_nombre, \n\t\t\t\t\t\tg.id as grupo_id, g.nombre as nombre_grupo, g.abrev as abrev_grupo, g.year_id\n\t\t\t\t\tfrom alumnos a \n\t\t\t\t\tinner join users u on a.user_id=u.id\n\t\t\t\t\tinner join matriculas m on m.alumno_id=a.id and (m.estado=\"MATR\" or m.estado=\"ASIS\" or m.estado=\"PREM\")\n\t\t\t\t\tinner join grupos g on g.id=m.grupo_id\n\t\t\t\t\tleft join images i on i.id=u.imagen_id\n\t\t\t\t\tleft join images i2 on i2.id=a.foto_id\n\t\t\t\t\twhere a.deleted_at is null\n\t\t\t\t ) usus\n\t\t\t\t\ton usus.user_id=c.user_id\n\t\t\t\twhere c.deleted_at is null and usus.year_id=:year_id order by c.plancha';\n\t\t\t\t\n\t\t$datos = array(\n\t\t\t':aspiracion_id'\t=> $aspiracion_id,\n\t\t\t':year_id'\t\t\t=> $year_id);\n\n\t\t$candidatos = DB::select($consulta, $datos);\n\n\t\treturn $candidatos;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the streams relation.
public function streams() { return $this->hasMany(StreamModel::class, 'namespace', 'slug'); }
[ "public function streams() {\n return $this->belongsto('streams', 'id', 'streams_id');\n }", "public function stream()\n {\n return $this->belongsTo('Streams\\Model\\StreamModel', 'stream_id');\n }", "public function getStreams()\n {\n if (!isset($this->data['referencesMany']['streams'])) {\n if (!$this->isNew()) {\n $this->addReferenceCache('streams');\n }\n $this->data['referencesMany']['streams'] = new \\Mandango\\Group\\ReferenceGroup('Application\\Entity\\Stream', $this, 'streams_reference_field');\n }\n\n return $this->data['referencesMany']['streams'];\n }", "public function getStreams_reference_field()\n {\n if (!isset($this->data['fields']['streams_reference_field'])) {\n if ($this->isNew()) {\n $this->data['fields']['streams_reference_field'] = null;\n } elseif (!isset($this->data['fields']) || !array_key_exists('streams_reference_field', $this->data['fields'])) {\n $this->addFieldCache('streams');\n $data = $this->getRepository()->getCollection()->findOne(array('_id' => $this->getId()), array('streams' => 1));\n if (isset($data['streams'])) {\n $this->data['fields']['streams_reference_field'] = $data['streams'];\n } else {\n $this->data['fields']['streams_reference_field'] = null;\n }\n }\n }\n\n return $this->data['fields']['streams_reference_field'];\n }", "public function getStreams()\n {\n return $this->streams;\n }", "public function getStreamURL()\n\t{\n\t\treturn $this->pathname->rootAdapter()->getStreamURL($this->pathname);\n\t}", "public function getStreamLink()\n {\n $provider = $this->getContentProvider();\n if ($provider != null) {\n if ($provider->isStreamable() && $this->hash != null) {\n return Url::to(['/content/stream', 'hash' => $this->hash], true);\n }\n }\n\n return null;\n }", "public static function GetAllStreams()\n {\n return self::GetAllRecordsFromTable(\"streams\"); \n }", "public function getStreamBindings(): array\n {\n return $this->streams;\n }", "public function getRelation()\n {\n return $this->relation;\n }", "public function getStreamResource();", "public function getRelation()\n {\n return $this->attributes[0]->getRelation();\n }", "public function getStreamName()\n {\n return $this->stream_name;\n }", "public function getResource()\n {\n return $this->stream;\n }", "public function streamPath()\n {\n return '/files/stream/' . $this->object->path();\n }", "public function getStreamName()\n {\n return $this->streamName;\n }", "public function getStream()\n {\n return $this->stream;\n }", "private function getAuthLogRelation()\n {\n return $this->owner->getRelation($this->authLogRelation);\n }", "public function getRel()\n {\n return $this->rel;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'createWorkExperiences'
protected function createWorkExperiencesRequest($body, $id) { // 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 createWorkExperiences' ); } // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling createWorkExperiences' ); } $resourcePath = '/candidate/{id}/workexperiences'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($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); } } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $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( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "public function actionCreate()\n {\n $model = new ResumeExperiences();\n $enumMonth = EnumHelper::getMonthsList();\n $model->idResume = Yii::$app->session->get('Resume')->IdResume;\n $model->idUsers = Yii::$app->user->getIdentity()->IdUsers;\n \n if(Yii::$app->request->isPost){\n $fullPostData = Yii::$app->request->post()['ResumeExperiences'];\n $model->StartDate = (isset($fullPostData['startYear']) && isset($enumMonth[$fullPostData['startMonth']])) ? date('Y-m-d H:i:s', strtotime($fullPostData['startYear'] . '-' . $enumMonth[$fullPostData['startMonth']] . '-' . '01')) : NULL;\n $model->EndDate = (isset($fullPostData['endYear']) && isset($enumMonth[$fullPostData['endMonth']])) ? date('Y-m-d H:i:s', strtotime($fullPostData['endYear'] . '-' . $enumMonth[$fullPostData['endMonth']] . '-' . '01')) : NULL;\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->actionView(RequestComponent::LIST_VIEW);\n }\n \n $optionModelSearch = Options::find()\n ->where(\"OptionType in ('employment', 'discipline', 'career_level', 'legal_form', 'employee')\")\n ->all();\n \n $optionsLists = StaticHelper::groupArrayByColumn($optionModelSearch, \n ['groupBy'=>'OptionType', 'key'=>'IdOptions'],\n function($item){\n return $item->Name;\n });\n \n $industry = \\app\\models\\OptionsIntustry::find()->all();\n $m_IndustryList = ArrayHelper::map($industry, 'IdOptionsIntustry', 'Name');\n \n $m_SegmentList = [];\n if($model->idIndustries){\n $segments = \\app\\models\\OptionsSegment::find(['idOptionsIndustry'=>$model->idIndustries])->all();\n $m_SegmentList = ArrayHelper::map($segments, 'IdOptionSegment', 'Name'); \n }\n \n return $this->renderPartial('create', [\n 'model' => $model,\n 'monthList' => $enumMonth,\n 'yearList' => EnumHelper::getYearsList(),\n 'optionsLists' => $optionsLists,\n 'm_IndustryList'=> $m_IndustryList,\n 'm_SegmentList' => $m_SegmentList\n ], TRUE, FALSE);\n }", "protected function addWorkExperienceRequest($body, $id)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addWorkExperience'\n );\n }\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling addWorkExperience'\n );\n }\n\n $resourcePath = '/candidate/{id}/workexperiences';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function actionCreate() {\n $model = new Work();\n\n $dataRequest['Work'] = Yii::$app->request->getBodyParams();\n\n if ($model->load($dataRequest)) {\n $model->doc_date = date('Y-m-d');\n $model->doc_time = date('H:i');\n $model->user_id = Yii::$app->user->identity->id;\n $model->status = 0;\n\n// print_r(Yii::$app->user->identity->username);\n//\n// print_r($model->attributes);\n// exit();\n if ($model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n return $this->apiCreated($model);\n }\n }\n\n return $this->apiValidate($model->errors);\n }", "protected function getCandidateWorkExperiencesRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling getCandidateWorkExperiences'\n );\n }\n\n $resourcePath = '/candidate/{id}/workexperiences';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['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 createAction()\n {\n $request = $this->getRequest();\n $entity = new Experience();\n $entity->setCandidat($this->getCurrentCandidat());\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_hub_candidat_show'));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public static function createExperience($data)\n {\n $userExperience = new self();\n $userExperience->setScenario(self::SCENARIO_CREATE);\n\n $userExperience->setAttributes([\n 'user_id' => $data['user_id']->getAttribute('id'),\n 'job_title' => !empty($data['job_title']) ? $data['job_title'] : '',\n 'employer' => !empty($data['employer']) ? $data['employer'] : '',\n 'country' => !empty($data['country']) ? $data['country'] : '',\n 'location' => !empty($data['location']) ? $data['location'] : '',\n 'from_month' => !empty($data['from_month']) ? $data['from_month'] : '',\n 'from_year' => !empty($data['from_year']) ? $data['from_year'] : '',\n 'to_month' => !empty($data['to_month']) ? $data['to_month'] : '',\n 'to_year' => !empty($data['to_year']) ? $data['to_year'] : '',\n 'achievements' => !empty($data['achievements']) ? $data['achievements'] : '',\n 'current_place' => !empty($data['current_place']) ? $data['current_place'] : 0\n ]);\n\n return ($userExperience->save(false)) ? true : false;\n }", "public function store(CreateExperienceRequest $request)\n {\n $input = $request->all();\n\n $input['candidate_id'] = Sentinel::getUser()->candidate->id;\n\n $experience = $this->experienceRepository->create($input);\n\n Flash::success('Experience saved successfully.');\n\n return redirect(route('admin.experiences.index'));\n }", "public function store(CreateUserExperienceRequest $request)\n {\n $input = array_remove_null($request->all());\n\n $userExperience = $this->userExperienceRepository->create($input);\n\n Flash::success('User Experience saved successfully.');\n\n return redirect(route('userExperiences.index'));\n }", "public function create($data)\n {\n \n \t\n \t$data = ['url' => 'Employers','method'=>'POST','data'=>$data];\n \treturn $this->payRunObject->call($data);\n }", "public function workExperiences()\n {\n return $this->hasMany(WorkExperience::class);\n }", "public function createViaRequest();", "public function createEducation(Request $request)\n {\n try\n {\n //validate form by calling validateCreateForm\n $this->validateCreateForm($request);\n \n //Get posted form data\n $school = $request->input('school');\n $degree = $request->input('degree');\n $field = $request->input('field');\n $graduationyear = $request->input('graduationyear');\n $user_id = $request->input('user_id');\n \n // Save posted data to Education object model\n $education = new Education(0, $school, $degree, $field, $graduationyear, $user_id);\n \n $jhbs = new JobHistoryBusinessService();\n $sbs = new SkillBusinessService();\n $eds = new EducationBusinessService();\n $gbs = new GroupBusinessService();\n \n // if addEducation sucesses call findGroupsByUserId,\n // findJobHistoryByUserId, findSkillByUserId and findEducationByUserId\n // to return user portfolio with jobhistorys, skills, educations, groups objects\n if($result = $eds->addEducation($education))\n {\n $groups = $gbs->findGroupsByUserId($user_id);\n $jobhistorys = $jhbs->findJobHistoryByUserId($user_id);\n $skills = $sbs->findSkillByUserId($user_id);\n $educations = $eds->findEducationByUserId($user_id);\n \n //pass groups user is apart of to portfolio\n if($groups)\n {\n for ($i = 0; $i < count($groups); $i++) {\n $groupNames[$i] = $gbs->findById($groups[$i]->getId());\n }\n }\n else\n {\n $groupNames = array();\n }\n \n // return to userPortfolio Form with jobhistorys, skills, educations, groups objects\n return view(('userPortfolio'),compact(['jobhistorys'],['skills'], ['educations'], ['groupNames']));\n }\n }catch(ValidationException $e1){\n throw ($e1);\n }catch(Exception $e2){\n $this->logger->error(\"Exception \". array(\"message\" => $e2->getMessage()));\n //Display Global Namespace Handler Page\n return view('SystemException');\n }\n }", "public function createExemption() {\n\t\t\t\t//Build create exemption json.\n $jsonString = '{\n\t\t\t\t \"Exemption\": {\n\t\t\t\t\t\"CustomerReference\": \"Sample Customer 45\",\n\t\t\t\t\t\"ExemptionReference\": \"Sample Exemption 45\",\n\t\t\t\t\t\"StartDate\": \"2014-01-13T00:00:00\",\n\t\t\t\t\t\"EndDate\": \"2015-01-13T00:00:00\",\n\t\t\t\t\t\"ExemptedStateCodes\": {\n\t\t\t\t\t \"StateCode\": [\n\t\t\t\t\t\t\"CA\",\n\t\t\t\t\t\t\"CO\"\n\t\t\t\t\t ]\n\t\t\t\t\t},\n\t\t\t\t\t\"ExemptionRate\": \"0.5\",\n\t\t\t\t\t\"SKUCode\": \"genMerch\",\n\t\t\t\t\t\"BusinessType\": \"Construction\",\n\t\t\t\t\t\"ExemptionReason\": \"other\"\n\t\t\t\t }\n\t\t\t\t}';\n \n\t\t\t\t//Replace ENTITY_ID placeholder with your actual entity id below. \n $curl = curl_init($this->URL.'entity/STX-02199-00/exemption/create');\n \n\t\t\t\t//Set other options for the call.\n curl_setopt($curl, CURLOPT_HTTPHEADER, $this->multiHeaders);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonString);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n \n\t\t\t\t//Make the call and then close the connection\n $response = curl_exec($curl);\n\t\t\t\tprint \"\\n\\nCreate Exemption Response::\\n\".$response;\n curl_close($curl);\n }", "public function actionCreate()\n {\n $model = new Resume();\n $post = Yii::$app->request->post();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if($post['Resume']['category']){\n foreach ($post['Resume']['category'] as $category){\n $resume_category = new ResumeCategory();\n $resume_category->resume_id = $model->id;\n $resume_category->category_id = $category;\n $resume_category->save();\n }\n }\n if($post['Resume']['skills']){\n foreach ($post['Resume']['skills'] as $skill){\n $resume_skill = new ResumeSkill();\n $resume_skill->resume_id = $model->id;\n $resume_skill->skill_id = $skill;\n $resume_skill->save();\n }\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create(array $data)\n {\n if (isset($data['prefectureNew'])) {\n $prefecture = Prefecture::create(['name'=>$data['prefectureNew']]);\n $data['prefecture_id'] = $prefecture->id;\n }\n\n $work = Work::create($data);\n $users = User::where('id','<>', Auth::user()->id)->where('privilege','<>', self::ownerPrivilege)->get();\n foreach ($users as $user) {\n Permission::create(['work_id'=>$work->id, 'user_id'=>$user->id, 'type'=> self::noPermission]);\n }\n if (Auth::user()->privilege != self::ownerPrivilege)\n Permission::create(['work_id'=>$work->id, 'user_id'=>Auth::user()->id, 'type'=>self::permissionEdit]);\n return $work;\n }", "public function store(CreateTypeExperienceRequest $request)\n {\n $input = $request->all();\n\n $typeExperience = $this->typeExperienceRepository->create($input);\n\n Flash::success('Type Experience saved successfully.');\n\n return redirect(route('typeExperiences.index'));\n }", "public function create()\n {\n return view('type_experiences.create');\n }", "protected function addExperienceRequirements(): void\n {\n if (!$this->job->getExperience()) {\n return;\n }\n\n $this->json['experienceRequirements'] = $this->job->getExperience();\n }", "public function create()\n {\n return view('admin.experiences.create');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
extends objects by adding new unused types
public function testExtendsObjectsByAddingNewUnusedTypes() { $extendedSchema = $this->extendTestSchema(dedent(' type Unused { someField: String } ')); $this->assertNotEquals($this->testSchema, $extendedSchema); // TODO: Assert printed schemas }
[ "function uopz_extend($class, $parent) {}", "protected function _getExtends()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'ThemeHouse_Objects_Model_Class' => 'ThemeHouse_ExtendClass_Extend_ThemeHouse_Objects_Model_Class',\r\n\t\t);\r\n\t}", "protected function migrateIncludedObjects() {\n\t\tif ( ! isset( $this->oldOptions['modules']['aiosp_video_sitemap_options']['aiosp_video_sitemap_posttypes'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$publicPostTypes = aioseo()->helpers->getPublicPostTypes( true );\n\n\t\tif ( in_array( 'all', $this->oldOptions['modules']['aiosp_video_sitemap_options']['aiosp_video_sitemap_posttypes'], true ) ) {\n\t\t\taioseo()->options->sitemap->video->postTypes->all = true;\n\t\t\taioseo()->options->sitemap->video->postTypes->included = array_values( $publicPostTypes );\n\t\t} else {\n\t\t\taioseo()->options->sitemap->video->postTypes->all = false;\n\t\t\taioseo()->options->sitemap->video->postTypes->included =\n\t\t\t\tarray_values( array_intersect( $publicPostTypes, $this->oldOptions['modules']['aiosp_video_sitemap_options']['aiosp_video_sitemap_posttypes'] ) );\n\t\t}\n\t}", "function uopz_extend(string $class, string $parent) {}", "public function get_object_subtypes()\n {\n }", "public function removeExtends() {\n $this->extends = '';\n }", "public function getExtend(){}", "protected function extend(&$object) {\n //type is singular of table name -> remove ending 's'\n $type = preg_replace('!s$!', '', $this->tableName());\n $fields = Extend::fields($type, $object->id);\n foreach ($fields as $field) {\n //custom field value is in $field->value->{$field->field}, if is set\n $v = $field->value;\n $f = $field->field;\n $object->{$field->key} = isset($v->$f)? $v->$f : '';\n }\n }", "public function oeag_set_subclasses() {\n\t\trequire_once PUN_ROOT.'OnEnAGros/Trophy.php';\n\t\trequire_once PUN_ROOT.'OnEnAGros/Stats.php';\n\t\t$this->trophy = new Trophy();\n\t\t$this->stats = new Decorator(new Stats());\n\t}", "public static function extend() {\n\t\t\n\t\t// pass given arguments searching for \"false\" items who're not\n\t\t// compatible with WHILE cycle of this method\n\t\t// \"false\" params will reset arguments list to a single false item!!!\n\t\t$args = array();\n\t\tforeach (func_get_args() as $arg) {\n\t\t\tif ($arg === false && count($args)) {\n\t\t\t\t$args = array(false);\n\t\t\t} else {\n\t\t\t\t$args[] = $arg;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$a = current($args);\n\t\twhile (($b = next($args)) !== false) {\n\t\t\t\n\t\t\t// skip empty extension objects\n\t\t\tif (empty($b)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// scalar values overrides array and array overrides scalar values!\n\t\t\tif (!is_array($a) || !is_array($b)) {\n\t\t\t\t$a = $b;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// both scalar array are merged preventing duplication of values!\n\t\t\tif (self::isVector($a) && self::isVector($b)) {\n\t\t\t\tforeach ($b as $tmp) {\n\t\t\t\t\t// remove value operator\n\t\t\t\t\tif (is_string($tmp) && substr($tmp, 0, 3) == '$--') {\n\t\t\t\t\t\t$atmp = substr($tmp, 3);\n\t\t\t\t\t\tif (in_array($atmp, $a)) {\n\t\t\t\t\t\t\t$a = array_values(array_diff($a, array($atmp)));\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t// prevent values duplication\n\t\t\t\t\t} elseif (!in_array($tmp, $a)) {\n\t\t\t\t\t\t$a[] = $tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// $__overrides__$\n\t\t\t// use reset array filled with keys to be resetted before the \n\t\t\t// extension action. \n\t\t\tif (array_key_exists('$__overrides__$', $b)) {\n\t\t\t\tif (!is_array($b['$__overrides__$'])) {\n\t\t\t\t\t$b['$__overrides__$'] = array($b['$__overrides__$']);\n\t\t\t\t}\n\t\t\t\tforeach ($b['$__overrides__$'] as $ovKey) {\n\t\t\t\t\t// try to preserve key position if possible!\n\t\t\t\t\tif (array_key_exists($ovKey, $b)) {\n\t\t\t\t\t\t$a[$ovKey] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunset($a[$ovKey]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($b['$__overrides__$']);\n\t\t\t}\n\t\t\t\n\t\t\t\n\n\t\t\t// deep extends key by key\n\t\t\tforeach (array_keys($b) as $key) {\n\t\t\t\t\n\t\t\t\t// reset key in $a\n\t\t\t\t// ignore $__key__$ keys!\n\t\t\t\tif (substr($key, 0, 3) == '$__' && substr($key, strlen($key)-3, 3) != '__$') {\n\t\t\t\t\t$akey = substr($key, 3);\n\t\t\t\t\t$a[$akey] = $b[$key];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// append strings or sum integers\n\t\t\t\tif (substr($key, 0, 3) == '$++') {\n\t\t\t\t\t$akey = substr($key, 3);\n\t\t\t\t\tif (!array_key_exists($akey, $a)) {\n\t\t\t\t\t\t$a[$akey] = $b[$key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (is_array($a[$akey])) {\n\t\t\t\t\t\t\t$a[$akey] = BB::extend($a[$akey], $b[$key]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$a[$akey].= $b[$key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// remove key from $a array\n\t\t\t\tif ($b[$key] === '$__remove__$') {\n\t\t\t\t\tunset($a[$key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// add non existing keys\n\t\t\t\tif (!array_key_exists($key, $a) || empty($a[$key]) || $b[$key] === false) {\n\t\t\t\t\t$a[$key] = $b[$key];\n\n\t\t\t\t// recursive extends keys\n\t\t\t\t} else {\n\t\t\t\t\t$a[$key] = self::extend($a[$key], $b[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $a;\n\t}", "public function shouldBeReplacedBySpecificTypes(): bool\n {\n // Could check for final classes such as stdClass here, but not much of a reason to.\n return true;\n }", "private function migrateDefaultObjectTypes() {\n\t\tforeach ( aioseo()->helpers->getPublicPostTypes( true ) as $postType ) {\n\t\t\t$settingName = \"aiosp_opengraph_{$postType}_fb_object_type\";\n\t\t\tif ( ! in_array( $settingName, array_keys( $this->oldOptions['modules']['aiosp_opengraph_options'] ), true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$options = aioseo()->options->noConflict();\n\t\t\tif ( $options->social->facebook->general->dynamic->postTypes->has( $postType ) ) {\n\t\t\t\taioseo()->options->social->facebook->general->dynamic->postTypes->$postType->objectType =\n\t\t\t\t\taioseo()->helpers->sanitizeOption( $this->oldOptions['modules']['aiosp_opengraph_options'][ $settingName ] );\n\t\t\t}\n\n\t\t\tif ( 'post' === $postType ) {\n\t\t\t\taioseo()->options->social->facebook->homePage->objectType =\n\t\t\t\t\taioseo()->helpers->sanitizeOption( $this->oldOptions['modules']['aiosp_opengraph_options'][ $settingName ] );\n\t\t\t}\n\t\t}\n\t}", "private function registerInternalTypes()\n {\n $this->addType($this->id(), 'id');\n $this->addType($this->int(), 'int');\n $this->addType($this->float(), 'float');\n $this->addType($this->string(), 'string');\n $this->addType($this->boolean(), 'boolean');\n }", "public function testNamedAddExtended() {\n $object = new ExampleObject1Extended();\n $collection = new ExampleObject1Collection();\n $collection->add($object);\n $result = $collection->getAll();\n $first = reset($result);\n self::assertSame($object, $first);\n }", "private function inherit(Schema $to, Schema $from): void\n {\n if ($to->allOf === Generator::UNDEFINED) {\n // Move all properties into an `allOf` entry except the `schema` property.\n $clone = new Schema(['_context' => new Context(['generated' => true], $to->_context)]);\n $clone->mergeProperties($to);\n $hasProperties = false;\n $defaultValues = get_class_vars(Schema::class);\n foreach (array_keys(get_object_vars($clone)) as $property) {\n if (in_array($property, ['schema', 'title', 'description'])) {\n $clone->$property = Generator::UNDEFINED;\n continue;\n }\n if ($to->$property !== $defaultValues[$property]) {\n $hasProperties = true;\n }\n $to->$property = $defaultValues[$property];\n }\n $to->allOf = [];\n if ($hasProperties) {\n $to->allOf[] = $clone;\n }\n }\n $append = true;\n foreach ($to->allOf as $entry) {\n if ($entry->ref !== Generator::UNDEFINED && $entry->ref === Components::SCHEMA_REF . Util::refEncode($from->schema)) {\n $append = false; // ref was already specified manually\n }\n }\n if ($append) {\n array_unshift($to->allOf, new Schema([\n 'ref' => Components::SCHEMA_REF . Util::refEncode($from->schema),\n '_context' => new Context(['generated' => true], $from->_context),\n ]));\n }\n }", "private function parseOpenGraphObjects()\n {\n foreach ($this->getOpenGraphObjectTypes() as $objectType => $objectTypeClass) {\n /** @var \\Illuminate\\Support\\Collection $tags */\n $tags = $this->getAllByNamespace($objectType);\n if ($tags->isEmpty()) {\n continue;\n }\n\n $this->openGraph['objects'][$objectType] = new $objectTypeClass($tags);\n }\n }", "protected function setUpTypes()\n {\n foreach (array_keys($this->usedTypes) as $typeName) {\n if (!isset(static::$addedTypes[$typeName]) && !Type::hasType($typeName)) {\n Type::addType($typeName, static::$types[$typeName]);\n\n $type = Type::getType($typeName);\n\n // Since doctrineTypeComments may already be initialized check if added type requires comment\n $platform = $this->getPlatform();\n if ($type->requiresSQLCommentHint($platform) && !$platform->isCommentedDoctrineType($type)) {\n $this->getPlatform()->markDoctrineTypeCommented(Type::getType($typeName));\n }\n\n static::$addedTypes[$typeName] = true;\n }\n }\n }", "public function addDataObjectAndExtensionInfo()\n {\n $extensions = ClassInfo::subclassesFor('DataExtension');\n array_shift($extensions);\n $classes = [\n 'DataObjects' => ClassInfo::dataClassesFor('DataObject'),\n 'DataExtensions' => $extensions\n ];\n foreach ($classes as $label => $dataClasses) {\n ksort($dataClasses);\n $this->addDatabaseInfo($dataClasses, $label);\n }\n }", "public function __clone()\n {\n $this->types = clone $this->types;\n $this->valueProcessor = new DtoPropertyValueProcessor($this);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the route resolver callback.
public function setRouteResolver(Closure $callback) { $this->routeResolver = $callback; return $this; }
[ "public function set_route_resolver( Closure $callback ) {\n\t\t$this->route_resolver = $callback;\n\n\t\treturn $this;\n\t}", "public function setRouteResolver(Closure $callback)\n {\n $this->routeResolver = $callback;\n return $this;\n }", "public static function setRouteResolver($callback)\n {\n /** @var \\Illuminate\\Http\\Request $instance */\n return $instance->setRouteResolver($callback);\n }", "public function setRoutesResolver(callable $routesResolver = null)\n {\n $this->routesResolver = $routesResolver;\n }", "public function setCallback(\\Closure $callback) : IRoute\n {\n $this->callback = $callback;\n return $this;\n }", "public function set_resolver(Resolver $resolver);", "public function blueprintResolver(Closure $resolver)\n {\n $this->resolver = $resolver;\n }", "public function getRouteResolver(): Closure\n {\n return $this->routeResolver ?: function () {\n //\n };\n }", "public static function setQueueResolver(callable $resolver)\n {\n }", "public function setResponseResolver(Closure $callback)\n {\n $this->responseResolver = $callback;\n\n return $this;\n }", "public function setUserResolver(Closure $callback): self\n {\n $this->userResolver = $callback;\n\n return $this;\n }", "public function setResolver(Resolver $resolver)\n {\n Provider::getServices()->set('ViewResolver', $resolver);\n }", "public function getRouteResolver()\n {\n return $this->routeResolver ?: function () {\n //\n };\n }", "public function setUserResolver(Closure $callback)\n {\n $this->userResolver = $callback;\n\n return $this;\n }", "public function setCallableResolver(CallableResolverInterface $resolver)\n {\n $this->callableResolver = $resolver;\n }", "public static function setConnectionResolver($resolver)\n\t{\n\t\tstatic::$resolver = $resolver;\n\t}", "public function setResolver(LoaderResolverInterface $resolver)\n {\n $this->resolver = $resolver;\n }", "public function dataprintResolver(Closure $resolver): void\n {\n $this->resolver = $resolver;\n }", "public function setResolver(LoaderResolver $resolver)\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new isDifferentCity
public function setIsDifferentCity($isDifferentCity) { $this->isDifferentCity = $isDifferentCity; return $this; }
[ "public function setCity($city) { $this->city = $city ; }", "public function testSetOldCity(): void {\n\n $obj = new Adresse();\n\n $obj->setOldCity(\"oldCity\");\n $this->assertEquals(\"oldCity\", $obj->getOldCity());\n }", "public function setCity( $city );", "public function setCity($city) { $this->city = $city; }", "public function testSetCity(): void {\n\n $obj = new Adresse();\n\n $obj->setCity(\"city\");\n $this->assertEquals(\"city\", $obj->getCity());\n }", "public function testCanSetAndGetCity()\n {\n $mockCity = 'Corpus Christi';\n\n $this->nationalDataCenter->setCity($mockCity);\n\n $this->assertEquals($mockCity, $this->nationalDataCenter->getCity());\n }", "public function test_set_address_city(){\n $this->address->setCity('Vantaa');\n $this->assertEquals($this->address->getCity(), 'Vantaa');\n }", "function setCity($city)\n {\n $this->__city = $city ;\n }", "public function set_city($city) {\r\n $this->city = $city;\r\n }", "function setCity($city) {\n\t\t$this->m_city = $city;\n\t}", "public function __setGameCity($gameCity){\n\t$this->gameCity = $gameCity;\n }", "public function setCity($city)\n {\n $this->city = $city;\n }", "public function testCanSetAndGetCity()\n {\n $mockCity = 'Corpus Christi';\n\n $this->dataCenter->setCity($mockCity);\n\n $this->assertEquals($mockCity, $this->dataCenter->getCity());\n }", "public function setCity($city)\n {\n $this->city = $city;\n }", "public function setCity( string $city )\n\t{\n\t\t$this->city = $city;\n\t}", "public function testSetCity()\n {\n $this->testAddress= new Address($this->id, $this->testHAN, $this->testStName, $this->testCity, $this->testProv, $this->testPostalC);\n\n $this->assertEquals($this->testCity, $this->testAddress->getCity());\n $this->testAddress->setCity(\"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\"); //boundary case where set word is 50 chars long\n $this->assertEquals(\"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\", $this->testAddress->getCity());\n\n $this->expectException(\\InvalidArgumentException::class);\n $this->testAddress->setCity(\"Hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\"); //exception case where set name is over 50 characters (amount allowed)\n\n $this->expectException(\\InvalidArgumentException::class);\n $this->testAddress->setCity(48957497); //exception case where set name is only numeric (should be a string)\n\n }", "public function useCity()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_USE_CITY);\n }", "function setCity($s)\n\t{\n\t\t$this->Info['City'] = $s;\n\t\tupdateTableByClient('ClientContact', 'City', $s, $this->Clientname);\n\t}", "function setCity($inCity) {\n\t\tif ( $inCity !== $this->_City ) {\n\t\t\t$this->_City = $inCity;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generated from protobuf field sint64 right = 2;
public function setRight($var) { GPBUtil::checkInt64($var); $this->right = $var; return $this; }
[ "public function getRightValue()\n {\n return $this->right_value;\n }", "public function getValueRight()\n {\n return $this->valueRight;\n }", "public function getRight();", "public function getRight() {\n\t\treturn $this->__right;\n\t}", "public function getRight()\n {\n return $this->right;\n }", "public function getFieldRight();", "public function getRightOperandType();", "public static function _right()\n\t{\n\t}", "public function getSint64()\n {\n return $this->readOneof(8);\n }", "public function getRightOperand() {\r\n\t\treturn $this->rightOperand;\r\n\t}", "public function getRightExpr()\n {\n return $this->rightExpr;\n }", "public function setRight($var)\n {\n GPBUtil::checkFloat($var);\n $this->right = $var;\n\n return $this;\n }", "public function getRight() {\n return $this->getAttribute($this->getRightColumnName());\n }", "public function getRightId()\n {\n return $this->rightId;\n }", "public function getRightAnswer()\n {\n return $this->rightAnswer;\n }", "public function setRight($right)\n {\n $this->right = $right;\n }", "public static function getRightSide(int $side) : int {\n\t\tif($side >= 0 and $side <= 5) {\n\t\t\treturn $side ^ 0x03; // TODO: right now it gives the opposite side...\n\t\t}\n\t\tthrow new \\InvalidArgumentException(\"Invalid side $side given to getRightSide\");\n\t}", "public function getRightOperand(): ExpressionInterface\n {\n return $this->rightOperand;\n }", "public function getRightid()\r\n {\r\n return $this->rightId;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the move training process "deleted" event.
public function deleted(MoveTrainingProcess $moveTrainingProcess) { $student_old = ProfileView::find($moveTrainingProcess->employee_old)->full_name; $student_new = ProfileView::find($moveTrainingProcess->employee_new)->full_name; $action = "Xóa chuyển quá trình đào tạo nhân viên ".$student_old." sang ".$student_new; parent::saveHistory($moveTrainingProcess,'Delete',$action,'Xóa chuyển quá trình đào tạo'); }
[ "public function forceDeleted(MoveTrainingProcess $moveTrainingProcess)\n {\n //\n }", "public function deleted(TrainingProcessLogs $trainingProcessLogs)\n {\n //\n }", "protected function afterDeletion() {}", "public function deleted()\n {\n // Delete related images when model is deleted\n $this->deleteImages();\n }", "public function handlerAfterDelete($event)\n {\n $deletedModel = $event->sender;\n // do not want to be interpreted as NewRecord\n $deletedModel->setOldAttributes(false);\n $parent = null;\n if ($this->moveChildrenWnenDeletingParent) {\n $parent = $deletedModel->parent();\n } \n foreach ($deletedModel->children() as $child) {\n if ($parent) {\n //moveToParent\n $child->appendTo($parent);\n } else {\n // deleting\n if ($scenario = $this->modelScenarioForChildrenNodesWhenTheyDeletedAfterParent) {\n $child->scenario = $scenario;\n }\n $child->delete();\n } \n }\n // return it is to be NewRecord (that is framework behavior)\n $deletedModel->setOldAttributes(null);\n }", "public function deleted()\n {\n // do something after delete\n }", "abstract public function handleDelete($event);", "public function deleted(Event $event)\n {\n //\n }", "public function deleted(Step $step)\n {\n //\n }", "protected function afterDelete()\n {\n $this->fireMapperEvent(static::EVENT_DELETED, false);\n }", "public function postDeleteEvent()\n {\n $this->elementPostDelete();\n }", "protected function afterDelete () {}", "public function after_delete() {}", "public static function deleted($event)\r\n {\r\n // vars\r\n $app = self::app();\r\n $item = $event->getSubject();\r\n $itemType = $item->getType()->id;\r\n\r\n // check index table\r\n $tableName = $app->jbtables->getIndexTable($itemType);\r\n if (!$app->jbtables->isTableExists($tableName)) {\r\n $app->jbtables->createIndexTable($itemType);\r\n }\r\n\r\n // update index data\r\n JBModelSku::model()->removeByItem($item);\r\n JBModelSearchindex::model()->removeById($item);\r\n\r\n // execute item trigger\r\n $jbimageElements = $item->getElements();\r\n foreach ($jbimageElements as $element) {\r\n if (method_exists($element, 'triggerItemDeleted')) {\r\n $element->triggerItemDeleted();\r\n }\r\n }\r\n }", "private function handleMovieDeleteRequest() {\r\n $movieid = $_REQUEST['movie_id'];\r\n //and call the corresponding model function to delete the cars\r\n $result = $this->model->deleteMoviesById($movieid);\r\n if ($result == null) {\r\n $error = $this->model->getError();\r\n if ($error != null)\r\n $this->view->showError($error);\r\n } else\r\n $this->notifyClient(ERR_SUCCESS);\r\n\t}", "public function onFileDeleted($event) {\n\t\t$this->raiseEvent('onFileDeleted', $event);\n\t}", "public static function course_deleted_observer(\\core\\event\\course_deleted $event) {\n global $DB;\n $DB->delete_records('tool_kholland', ['courseid' => $event->objectid]);\n }", "public function process_delete() {\r\n\t\t// Delete videos settings.\r\n\t\tif ( isset( $_POST['delete_videos'], $_POST['wpmudev_vids_custom_wpnonce'] ) && ! empty( $_POST['videos'] ) ) {\r\n\t\t\t// Only after security check.\r\n\t\t\tif ( wp_verify_nonce( $_POST['wpmudev_vids_custom_wpnonce'], 'wpmudev_vids_custom_videos' ) ) {\r\n\r\n\t\t\t\t// Only when capable.\r\n\t\t\t\tif ( current_user_can( 'wpmudev_videos_manage_settings' ) ) {\r\n\r\n\t\t\t\t\t// Delete videos.\r\n\t\t\t\t\t$ids = (array) $this->delete_videos( $_POST['videos'], false );\r\n\r\n\t\t\t\t\t// Create Undo link.\r\n\t\t\t\t\t$undo_url = wp_nonce_url(\r\n\t\t\t\t\t\tadd_query_arg(\r\n\t\t\t\t\t\t\t'restore_videos', // Action.\r\n\t\t\t\t\t\t\timplode( ',', $ids ), // Video IDs.\r\n\t\t\t\t\t\t\tHelper::get()->admin_page() // Settings page.\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'wpmudev_vids_custom_videos_restore',\r\n\t\t\t\t\t\t'video_nonce'\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t// Deleted count.\r\n\t\t\t\t\t$count = count( $ids );\r\n\r\n\t\t\t\t\t// Show admin notice.\r\n\t\t\t\t\tadd_action( 'wpmudev_vids_custom_videos_notice', function () use ( $count, $undo_url ) {\r\n\t\t\t\t\t\techo '<div class=\"notice updated inline is-dismissible\"><p>';\r\n\t\t\t\t\t\tprintf( _n( '%s video removed successfully. <a href=\"%s\">Undo</a>', '%s videos removed successfully. <a href=\"%s\">Undo</a>', $count, 'wpmudev_vids' ), number_format_i18n( $count ), $undo_url );\r\n\t\t\t\t\t\techo '</p></div>';\r\n\t\t\t\t\t} );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function category_deleted_handler($eventdata){\n\t\tglobal $CFG;\n\t\t$isinteresting = false; //we assume that this is not relevant - check!\n\t\t//if there is no class with an instance of mumiemodule in the parent category, then we can be sure that this event is not interesting\n\t\t//but if there is at least one, we can not be sure - so we better try to send all information\n\t\tif($cat_classes = get_courses($semester->parent, 'c.id')){\n\t\t\tforeach($cat_classes as $cat_class){\n\t\t\t\tif(record_exists('mumiemodule', 'course', $cat_class->id)){\n\t\t\t\t\t$isinteresting = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t if($isinteresting){\n\t\t\tevent_logoutput(\"category_deleted_handler called \\n\", $eventdata);\n\t\t\t$js = new JapsSynchronise();\n\t\t\t$deletedsem = new object();\n\t\t\t$deletedsem->syncid = 'moodle-'.$CFG->prefix.'course_categories-'.$eventdata->id;\n\t\t\t$deletedsem->parent = 'moodle-'.$CFG->prefix.'course_categories-'.$eventdata->parent;\n\t\t\t\n\t\t\t//we try to insert the parent-category as a new semester into MUMIE\n\t\t\t$cat = get_record('course_categories', 'id', $eventdata->parent, '', '', '', '', 'name');\n\t\t\t$newsemester = new object();\n\t\t\t$newsemester->syncid = $deletedsem->parent;\n\t\t\t$newsemester->name = $cat->name;\n\t\t\t$newsemester->description = 'a Moodle-category as semester';\n\t\t\tinsert_semester_for_mumie($newsemester, $js);\n\t\t\t\n\t\t\t//the courses were moved from the deleted category into the parent category\n\t\t\t//so we have to change them before deleting the category\n\t\t\tif($cat_classes = get_courses($semester->parent, $fields='c.id')){ //TODO: isn't this deprecated???\n\t\t\t \tforeach($cat_classes as $cat_class){\n\t\t\t \t\tif(record_exists('mumiemodule', 'course', $cat_class->id)){\n\t\t\t \t\t\t$classtochange = new object();\n\t\t\t \t\t\t$classtochange->syncid = 'moodle-'.$CFG->prefix.'course-'.$cat_class->id;;\n\t\t\t \t\t\t$classtochange->semester = $deletedsem->parent;\n\t\t\t \t\t\tchange_class_for_mumie($classtochange, $js);\n\t\t\t \t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t\t\n\t\t\t//delete_semester_for_mumie($deletedsem);\n\t }\n\t\treturn true;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Subscribes a user to a given blog
public static function set_user_subscribed($blog_id, $user_id) { // Init $tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER); $tbl_user_permissions = Database::get_course_table(TABLE_PERMISSION_USER); $course_id = api_get_course_int_id(); // Subscribe the user $sql = "INSERT INTO $tbl_blogs_rel_user (c_id, blog_id, user_id ) VALUES ($course_id, '".(int)$blog_id."', '".(int)$user_id."');"; Database::query($sql); // Give this user basic rights $sql = "INSERT INTO $tbl_user_permissions (c_id, user_id,tool,action) VALUES ($course_id, '".(int)$user_id."','BLOG_" . (int)$blog_id."','article_add')"; Database::query($sql); $id = Database::insert_id(); if ($id) { $sql = "UPDATE $tbl_user_permissions SET id = iid WHERE iid = $id"; Database::query($sql); } $sql = "INSERT INTO $tbl_user_permissions (c_id, user_id,tool,action) VALUES ($course_id, '".(int)$user_id."','BLOG_" . (int)$blog_id."','article_comments_add')"; Database::query($sql); $id = Database::insert_id(); if ($id) { $sql = "UPDATE $tbl_user_permissions SET id = iid WHERE iid = $id"; Database::query($sql); } }
[ "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "private function subscribe()\n {\n\t\tif(isset($this->data['Comment']['subscription']) && !empty($this->data['Comment']['subscription']))\n\t\t{\n\t\t\t//did the user subscribe to the post before?\n\t\t\t$comment = $this->Comment->hasAny(array(\n\t\t\t\t'post_id' => $this->data['Comment']['post_id'],\n\t\t\t\t'email' => $this->data['Comment']['email'],\n\t\t\t\t'subscription <>' => ''\n\t\t\t));\n\t\t\t\n\t\t\tif($comment) {\n\t\t\t\t//the user had already subscribed to the post, thus we don't need to do it again\n\t\t\t\t$this->data['Comment']['subscription'] = '';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//the user either hadn't left a comment, or had left a comment but hadn't subscribe to the post\n\t\t\t\t//we need to do the subscription\n\t\t\t\t$this->data['Comment']['subscription'] = $this->getSubscriptionHash();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->data['Comment']['subscription'] = '';\n\t\t}\n }", "private function subscribe()\n {\n $this->botman->hears('subscribe', function (BotMan $bot) {\n $userId = $bot->getUser()->getId();\n $user = Subscriber::where('telegram_user_id', $userId)->first();\n $userMsg = 'You are already subscribed';\n\n if(is_null($user))\n {\n Subscriber::create(['telegram_user_id' => $userId]);\n $userMsg = 'You have just subscribed to our updates!';\n }\n\n $bot->reply($userMsg);\n });\n }", "public function subscribe()\n {\n if ($this->isSubscribed) {\n return;\n }\n\n $this->thread->subscribers()->attach($this->user->id);\n $this->isSubscribed = !$this->isSubscribed;\n }", "private function subscribeUser()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['subscribed_to']) || $request['subscribed_to']==\"\" )\n throw_error_msg(\"subscribed to not provided\");\n\n if( !is_numeric($request['subscribed_to']) )\n throw_error_msg(\"invalid subscribed to\");\n\n global $userquery;\n $userquery->subscribe_user($request['subscribed_to']);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'subscribed successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function subscribe() {\n if(!$this->active_object->canSubscribe($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());\n } // if\n \n $user_id = $this->request->getId('user_id');\n if($user_id) {\n $user = Users::findById($user_id);\n if(!instance_of($user, 'User')) {\n $this->httpError(HTTP_ERR_NOT_FOUND); // user ID provided, but no user found\n } // if\n } else {\n $user = $this->logged_user;\n } // if\n \n if(isset($_GET['async']) && $_GET['async']) {\n if($this->request->isSubmitted()) {\n db_begin_work();\n $action = $this->active_object->subscribe($user);\n if($action && !is_error($action)) {\n db_commit();\n } else {\n db_rollback();\n } // if\n } // if\n \n require_once RESOURCES_MODULE_PATH . '/helpers/function.object_subscription.php';\n print smarty_function_object_subscription(array(\n 'object' => $this->active_object,\n 'user' => $user,\n 'render_wrapper' => false\n ), $this->smarty);\n die();\n } else {\n $this->executeOnActiveObject('subscribe', array($user), \n lang('You are subscribed to \":name\" :type now', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName())), \n lang('Failed to subscribe you to \":name\" :type', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName()))\n );\n } // if\n }", "function subscribe() {\n if($this->request->isSubmitted() && ($this->request->isAsyncCall() || $this->request->isApiCall())) {\n\t if($this->active_object->subscriptions()->canSubscribe($this->logged_user)) {\n try {\n $this->active_object->subscriptions()->subscribe($this->active_user);\n\n $this->response->respondWithData($this->active_object, array(\n 'as' => $this->active_object->getBaseTypeName(),\n 'detailed' => true,\n ));\n } catch(Exception $e) {\n $this->response->exception($e);\n } // try\n } else {\n\t $this->response->forbidden();\n\t } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "function focus_groups_simplenews_subscribe_action($account, $context) {\n\tif($group_id = focus_groups_get_group_id()) {\n\t\t$group = node_load($group_id);\n\n\t\t$term = taxonomy_get_term_by_name('Newsletter ' . $group->title);\n\t\tif(!$term){\n\t\t\t//creating a new term\n\t\t\t$term = array('name' => 'Newsletter ' . $group->title, 'vid' => 7);\n\t\t\ttaxonomy_save_term($term);\n\t\t\t$term = taxonomy_get_term_by_name('Newsletter ' . $group->title);\n\t\t}\n\t\t$term = array_pop($term);\n\t\tsimplenews_subscribe_user($account->mail, $term->tid, false);\n\t\twatchdog('focus_groups', 'Subscribed user id %id to newsletter %newsletter.', array('%id' => $account->uid, '%newsletter' => $group->title));\n\t}\n}", "function pp_activation_on_new_mu_blog( $blog_id, $user_id ) {\n\tif ( is_plugin_active_for_network( 'profilepress/profilepress.php' ) ) {\n\t\tswitch_to_blog( $blog_id );\n\t\tProfilePress_Plugin_On_Activate::plugin_settings_activation();\n\t\trestore_current_blog();\n\t}\n}", "function subscribe($username, $channel_name) {\n $db = Database::instance()->db();\n\n $stmt = $db->prepare('INSERT INTO subscription (user_id, channel_id)\n SELECT user.id, channel.id\n FROM channel, user \n WHERE channel.name = ? AND user.username = ?');\n\n $stmt->execute(array($channel_name, $username));\n }", "function propagate_users() {\n $this->mongo_connect();\n $m_users = Db::find(\"wp_user\",array(), array());\n for($blog_id = 2; $blog_id <= count($this->sites_array); $blog_id++) {\n printf(\"Starting site %d\\n\", $blog_id);\n switch_to_blog($blog_id);\n wp_cache_flush();\n foreach($m_users as $m_user) {\n $role = $m_user[\"true_user\"] == 1 ? \"subscriber\" : \"author\";\n add_user_to_blog($blog_id, $m_user[\"wp_id\"], $role);\n }\n }\n }", "function target_add_forum_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'forum_notify (user_id, forum_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['forum_id'] .')');\n}", "public function subscribe()\n {\n $url = 'https://api.instagram.com/v1/subscriptions/';\n $params = [\n 'client_id' => $this->getClientId(),\n 'client_secret' => $this->getClientSecret(),\n 'object' => 'user',\n 'aspect' => 'media',\n 'verify_token' => '592180',\n 'callback_url' => $this->_url->sessionUrlVar(\n $this->_url->getUrl($this->subscribe_redirect)\n )\n ];\n $this->_httpRequest($url, 'POST', $params);\n }", "public function onCreated($blog)\n {\n $blog->notify(new ArticlePublished());\n }", "public function createSubscriptions($user)\n {\n }", "function bbp_form_topic_subscribed()\n{\n}", "function focus_groups_subscribe_user_action($account, $context) {\n\tif($group_id = focus_groups_get_group_id()) {\n\t\tif($focus_group_id = focus_groups_get_parent($group_id)) {\n\t\t\tog_save_subscription($focus_group_id, $user->uid, array('is_active' => 1));\n\t\t\twatchdog('focus_groups', 'Subscribed user id %id to focus group %fg.', array('%id' => $account->uid, '%fg' => $focus_group_id));\n\t\t}\n\t}\n}", "public function subscribeToTag()\n\t\t\t{\n\t\t\t\tif($this->chkIsUserPreviouslySubscribedToTag())\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['subscription'].\n\t\t\t\t\t\t\t ' SET '.\n\t\t\t\t\t\t\t ' tag_name = '.$this->dbObj->Param('tag').','.\n\t\t\t\t\t\t\t ' subscriber_id = '.$this->dbObj->Param('subscriber_id').','.\n\t\t\t\t\t\t\t ' module = '.$this->dbObj->Param('module').','.\n\t\t\t\t\t\t\t ' subscription_type='.$this->dbObj->Param('sub_type').','.\n\t\t\t\t\t\t\t ' date_subscribed=NOW()';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, array($this->fields_arr['tag'], $this->fields_arr['subscriber_id'], $this->fields_arr['sub_module'], $this->fields_arr['sub_type']));\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t trigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['subscription'].\n\t\t\t\t\t\t\t\t' SET status=\\'Yes\\''.\n\t\t\t\t\t\t\t\t' WHERE tag_name='.$this->dbObj->Param('tag').\n\t\t\t\t\t\t\t\t' AND subscriber_id='.$this->dbObj->Param('subscriber_id').\n\t\t\t\t\t\t\t ' AND subscription_type='.$this->dbObj->Param('sub_type').\n\t\t\t\t\t\t\t\t' AND module='.$this->dbObj->Param('module');\n\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, array($this->fields_arr['tag'], $this->fields_arr['subscriber_id'], $this->fields_arr['sub_type'], $this->fields_arr['sub_module']));\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t trigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t}", "public function subscribe() {\n $accessory_id = $this->params['id'];\n $created = AccessoryNotification::tie_up_user_and_accessory(\n $this->current_user->id,\n $accessory_id\n );\n\n if ($created) {\n $flash = ['info' => \"You'll receive updates when ads about this accessory are published\"];\n } else {\n $flash = ['info' => \"You're already subscribed to this accessory\"];\n }\n\n redirect('/accessories', $flash);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format a list of labs
function formatted_labs($labs) { $lab_strs = array(); foreach ($labs as $row) { $lab_strs[] = $row['room'] . ' ' . $row['building']; } return join(', ', $lab_strs); }
[ "function transformCohortes($listecohortes) {\n $retour = '';\n $arr_cohortes = explode(',',$listecohortes);\n\tfor ($i=0;$i<count($arr_cohortes);$i++) {\n $retour .= '<a title=\"'.getNameCohorte($arr_cohortes[$i]).'\">'.$arr_cohortes[$i].'</a> ,';\n\t}\n return $retour;\n}", "private function _createLabels(){ \n \n $content='';\n \n foreach($this->dayLabels as $index=>$label){\n \n $content.='<li class=\"'.($label==6?'end title':'start title').' title\">'.$label.'</li>';\n \n }\n \n return $content;\n }", "public function formatRecordList($records, $human_labels = array());", "function _fmt_organization($a)\n{\n if (!is_array($a)) {\n return FALSE;\n }\n $out = '';\n while(list($k,$v)=each($a)) {\n $out .= _wrap($v,'span',array('class'=>$k)) . PHP_EOL;\n }\n return $out;\n}", "function make_labels($items, $leyenda, $class)\n {\n $resultado = '';\n for ($i = 0; $i < count($items); $i++) {\n $contenido = make_label($items[$i]['etiqueta'], $items[$i]['input']) . '\n\t\t';\n $resultado = $resultado . make_fieldset($contenido, $leyenda, $class);\n }\n return $resultado;\n }", "function formatLinkList(array $listData,\n $listFmt='<ul class=\"link_list\">%s</ul>',\n $listItemFmt='<li>%s</li>',\n $linkFmt='<a href=\"%s\" target=\"_blank\">&rarr; %s</a>')\n{\n $listHTMLArr = array();\n\n // create list data from individual items\n foreach ($listData as $link) {\n $linkStr = sprintf($linkFmt, htmlentities($link[0]), htmlentities($link[1]));\n $itemStr = sprintf($listItemFmt, $linkStr);\n\n array_push($listHTMLArr, $itemStr);\n }\n\n $listStr = implode($listHTMLArr);\n\n return sprintf($listFmt, $listStr);\n}", "function makeList() {\n global $wgTitle, $wgContLang, $wgCanonicalNamespaceNames;\n global $wgResourcesAddInfos;\n $catPage = new CategoryViewer($wgTitle, $this->getContext());\n ksort($this->resourceList);\n\n // this emulates CategoryViewer::getHTML():\n $catPage->clearCategoryState();\n // populate:\n foreach ($this->resourceList as $sortkey=>$value) {\n $catPage->articles_start_char[] = $wgContLang->convert($wgContLang->firstChar($sortkey));\n if ($wgResourcesAddInfos) {\n $catPage->articles[] = $value[0] . $value[1];\n } else {\n $catPage->articles[] = $value[0];\n }\n }\n\n $result = '';\n if(count($catPage->articles) > 0)\n $result = $catPage->formatList($catPage->articles, $catPage->articles_start_char);\n\n return $result;\n }", "public function formattedList() {\n\t\t$output = \"\";\n\t\tforeach($this->substituteList($this->produceList()) as $elem) {\n\t\t\t$output .= $elem . PHP_EOL;\n\t\t}\n\t\treturn $output;\n\t}", "function makePretty($time_list){\r\n\t\tglobal $pretty_days, $pretty_times;\r\n\t\t$formatted_times = array();\r\n\t\tforeach($time_list as $t){\r\n\t\t\t$day = $pretty_days[(int)substr($t,0,1)];\r\n\t\t\t$time = $pretty_times[(int)substr($t,1)];\r\n\t\t\tarray_push($formatted_times,$day.$time);\r\n\t\t}\r\n\t\treturn $formatted_times;\r\n\t}", "public function formatLabels()\n {\n return Collection::make($this->labels)\n ->map(function ($label) {\n return ['label' => $label];\n })\n ->toJson();\n }", "public function createLabels()\n {\n // default labels\n $labels = [\n 'name' => $this->plural,\n 'singular_name' => $this->singular,\n 'menu_name' => $this->plural,\n 'all_items' => \"All {$this->plural}\",\n 'edit_item' => \"Edit {$this->singular}\",\n 'view_item' => \"View {$this->singular}\",\n 'update_item' => \"Update {$this->singular}\",\n 'add_new_item' => \"Add New {$this->singular}\",\n 'new_item_name' => \"New {$this->singular} Name\",\n 'parent_item' => \"Parent {$this->plural}\",\n 'parent_item_colon' => \"Parent {$this->plural}:\",\n 'search_items' => \"Search {$this->plural}\",\n 'popular_items' => \"Popular {$this->plural}\",\n 'separate_items_with_commas' => \"Seperate {$this->plural} with commas\",\n 'add_or_remove_items' => \"Add or remove {$this->plural}\",\n 'choose_from_most_used' => \"Choose from most used {$this->plural}\",\n 'not_found' => \"No {$this->plural} found\",\n ];\n\n return array_replace($labels, $this->labels);\n }", "public static function formatArrayToText(array $list)\n\t{\n\t\t$result = array();\n\t\t$num = 0;\n\t\t$count = count($list);\n\n\t\tforeach ($list as $item)\n\t\t{\n\t\t\t$num++;\n\t\t\t$isLast = $num >= $count;\n\t\t\t$result[] = '- ' . $item . ($isLast ? '.': ';');\n\t\t}\n\n\t\treturn implode(\"\\n\", $result);\n\t}", "function make_listgroup($title, $list, $style='primary') {\n\t\n\t$content = '<ul class=\"list-group list-group-flush\">';\n\tforeach ($list as $url => $name) {\n\t\t$content .= '<a class=\"list-group-item\" href=\"'.$url.'\">'.$name.'</a>';\n\t}\n\t$content .= '</ul>';\n\t\n\treturn '\n\t\t<div class=\"card bg-'.$style.'\">\n\t\t\t<h5 class=\"card-header text-light\">'.$title.'</h5>\n\t\t\t\t'.$content.'\n\t\t</div>';\n}", "function make_listgroup($title, $list, $style='primary') {\n\t\n\t$content = '';\n\tforeach ($list as $url => $name) {\n\t\t$content .= '<a class=\"list-group-item\" href=\"'.$url.'\">'.$name.'</a>';\n\t}\n\t\n\treturn '\n\t\t<div class=\"card bg-'.$style.'\">\n\t\t\t<h5 class=\"card-header text-light\">'.$title.'</h5>\n\t\t\t<ul class=\"list-group list-group-flush\">\n\t\t\t\t'.$content.'\n\t\t\t</ul>\n\t\t</div>';\n}", "function Checklistify($string, $sep, $list_name, $title){\n\t\t\t\t\techo '<div class=\"panel panel-default\">\n\t\t\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t\t\t<div class=\"panel-title\">' . $title . '</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"panel-body\">\n\t\t\t\t\t\t\t<div class=\"list-group\">';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t$pieces = explode($sep, $string);\n\t\t\t\t\tforeach($pieces as $piece){\n\t\t\t\t\t\techo '<li class=\"list-group-item\">\n\t\t\t\t\t\t\t<label class=\"form-check-label\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\">' . $piece . '\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t}\n\t\t\t\t\techo '</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\n\t\t\t\t}", "private static function formatLanguages() {\n\t\t$langs = self::getSupportedLanguages();\n\t\t$list = array();\n\t\tif( count( $langs ) > 0 ) {\n\t\t\tforeach( $langs as $lang ) {\n\t\t\t\t$list[] = '<samp>' . htmlspecialchars( $lang ) . '</samp>';\n\t\t\t}\n\t\t\treturn '<p class=\"mw-collapsible mw-collapsed\" style=\"padding: 0em 1em;\">' . implode( ', ', $list ) . '</p><br style=\"clear: all\"/>';\n\t\t} else {\n\t\t\treturn '<p>' . wfMessage( 'syntaxhighlight-err-loading' )->inContentLanguage()->escaped() . '</p>';\n\t\t}\n\t}", "public function render(Tx_Oelib_List $list)\n {\n $titles = [];\n\n /** @var Tx_Seminars_Interface_Titled $element */\n foreach ($list as $element) {\n if (!$element instanceof Tx_Seminars_Interface_Titled) {\n throw new InvalidArgumentException(\n 'All elements in $list must implement the interface Tx_Seminars_Interface_Titled.', 1333658899\n );\n }\n\n $titles[] = htmlspecialchars($element->getTitle());\n }\n\n return implode(', ', $titles);\n }", "private function _createLabels(){ \n \n $content='';\n \n foreach($this->dayLabels as $index=>$label){\n \n $content.='<td width=\"14%\" class=\"'.($label==6?'end title':'start title').' title\">'.$label.'</td>';\n \n }\n \n return $content;\n }", "function displayAvailableLabels() {\n $db = dbConnect();\n $travelLabels = dbGetTravelsTitle($db); // Récupération des titres de voyages\n\n // Création d'une ligne par titre avec comme value le code ISO et comme texte le nom du pays\n foreach($travelLabels as $travel) {\n echo \"<option value='\" . $travel->getTitle() . \"'>\" . $travel->getTitle() . \"</option>\";\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of star5
public function getStar5() { return $this->star5; }
[ "public function getStar()\n {\n return $this->star;\n }", "public function getStar4()\n {\n return $this->star4;\n }", "function calc_stars_from_rating($rating) {\n return $rating / 5 * 80;\n}", "public function getData5()\n {\n return $this->data5;\n }", "public function getstars()\n {\n return $this->stars;\n }", "public function getRcodeStar()\n {\n return $this->rcode_star;\n }", "public function getQ5()\r\n {\r\n return $this->_q5;\r\n }", "public function getStar2()\n {\n return $this->star2;\n }", "public function getRatingValue();", "public function getFive()\n\t{\n\t\treturn $this->five;\n\t}", "public function rating_value_to_star( $rating ) {\n\t\tif ( $rating < 1 || $rating > 5 ) {\n\t\t\treturn;\n\t\t}\n\t\t$int = intval( $rating );\n\t\t$blank = 5 - $int;\n\t\t$html = str_repeat( $this->star( '#d56e0c' ), $int );\n\t\tif ( is_float( $rating ) ) {\n\t\t\t$html .= $this->star( '#d56e0c', 0.5 );\n\t\t\t$blank--;\n\t\t}\n\t\tif ( $blank > 0 ) {\n\t\t\t$html .= str_repeat( $this->star(), $blank );\n\t\t}\n\t\treturn $html;\n\t}", "private function get_image_rating_value()\n\t{\n\t\t/*if (phpbb_ext_gallery_core_contest::$mode == phpbb_ext_gallery_core_contest::MODE_SUM)\n\t\t{\n\t\t\treturn $this->image_data('image_rate_points');\n\t\t}\n\t\telse\n\t\t{*/\n\t\t\treturn ($this->image_data('image_rate_avg') / 100);\n\t\t//}\n\t}", "public function getMontantBPlaf5() {\n return $this->montantBPlaf5;\n }", "public function getStarCount()\n {\n return $this->star_count;\n }", "public function getC5()\r\n {\r\n return $this->C5;\r\n }", "public function getFullStar()\n {\n return $this->fullStar;\n }", "public function getMontantSommeIsolPlaf5() {\n return $this->montantSommeIsolPlaf5;\n }", "public function getPhoto5()\n\t{\n\t\treturn $this->photo5;\n\t}", "function ratingStar($starNumber, $idItem, $conn) {\n $stars = \"\";\n\n if($starNumber == null) return \"<span class=\\\"noRatingText\\\">Cet objet n'a pas d'évaluation pour le moment </span>\";\n\n for($i = 0; $i < 5; $i++) {\n if($starNumber > 0) {\n $stars .= \"<span class=\\\"glyphicon glyphicon-star\\\" style='color:#FFBD03'></span>\";\n $starNumber--;\n } \n else $stars .= \"<span class=\\\"glyphicon glyphicon-star-empty\\\"></span>\";\n }\n return \"<span class='ratings'>Total Évaluations:</span><div>\".$stars. getRatingCount($idItem, $conn) . \"</div>\";\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the indemn versee apprenti.
public function setIndemnVerseeApprenti($indemnVerseeApprenti) { $this->indemnVerseeApprenti = $indemnVerseeApprenti; return $this; }
[ "public function setVatIdNo($vatin);", "public function setNbVente($_nbvente) { $this->nbvente = $_nbvente; }", "private function settInn() {\n\n // SQL-spørring med parametre for bruk i prepared statement.\n $sql = \"INSERT INTO idrett (navn) VALUES (?);\";\n\n // Kobler til databasen og utfører spørringen.\n $con = new Database();\n $res = $con->spørring($sql, [$this->navn]);\n\n // Henter idrettskode fra nyinnsatt rad.\n $this->idrettskode = $res->insert_id;\n }", "function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}", "public function setIdVeterinaria($idVeterinaria){\n $this->idVeterinaria = $idVeterinaria;\n }", "protected function assignVatNumber()\n {\n }", "public function testSetIndiceAff() {\n\n $obj = new Materiels();\n\n $obj->setIndiceAff(10);\n $this->assertEquals(10, $obj->getIndiceAff());\n }", "public function setOnenote(?Onenote $value): void {\n $this->getBackingStore()->set('onenote', $value);\n }", "public function testSetNumVoie() {\n\n $obj = new Intervenants();\n\n $obj->setNumVoie(\"numVoie\");\n $this->assertEquals(\"numVoie\", $obj->getNumVoie());\n }", "function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}", "function setNum_asistentes($inum_asistentes = '')\n {\n $this->inum_asistentes = $inum_asistentes;\n }", "public function setNumero($numero){\n $this->numero=$numero;\n }", "function setDia_num($idia_num = '')\n {\n $this->idia_num = $idia_num;\n }", "public function setIdproducto($idproducto){\n $this->idproducto = $idproducto;\n }", "public function testSetAdIntNumVoie() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setAdIntNumVoie(\"adIntNumVoie\");\n $this->assertEquals(\"adIntNumVoie\", $obj->getAdIntNumVoie());\n }", "public function setAtaqueProgramador($valor){\n $this->ataqueProgramador=$valor;\n }", "function setIncidencia_id($incidencia_id) {\r\n\t$this->incidencia_id = $incidencia_id;\r\n }", "public function setNumero($numero)\n {\n $this->numero = $numero;\n }", "public function testSetNumeroAvenant() {\n\n $obj = new AbsEmpRemplacants();\n\n $obj->setNumeroAvenant(10);\n $this->assertEquals(10, $obj->getNumeroAvenant());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a request with an optional given proxy and returns the http response
public function sendRequest( RequestInterface $request, ProxyInterface $proxy = null, CookieJarInterface $cookieJar = null );
[ "public function proxyExecute($proxy) {\n $request = array('#request' => (array)$this->_request);\r\n foreach ($this->_subRequests as $tag => $subRequest) {\r\n $request[$tag] = $subRequest->getRequest();\r\n }\n try {\n return $proxy->api($this->_url, $request, false);\n }\n catch (\\Exception $e) {\n throw new RLWException(\r\n sprintf(\"API %s : %s (%d)\",\r\n get_class($e),\r\n $e->getMessage(),\r\n $e->getCode()),\r\n RLWException::API_EXCEPTION);\n }\n return $ret;\n }", "public function getHttpProxy();", "public function testWithProxy() {\n\t\t$request = new Request(['proxy' => 'tcp://proxy.example.com:5100']);\n\t\t$expected = ['http' => [\n\t\t\t'content' => '',\n\t\t\t'method' => 'GET',\n\t\t\t'header' => ['Host: localhost', 'Connection: Close', 'User-Agent: Mozilla/5.0'],\n\t\t\t'protocol_version' => '1.1',\n\t\t\t'ignore_errors' => true,\n\t\t\t'follow_location' => true,\n\t\t\t'request_fulluri' => true,\n\t\t\t'proxy' => 'tcp://proxy.example.com:5100'\n\t\t]];\n\t\t$this->assertEqual($expected, $request->to('context'));\n\t}", "function cas_server_proxy_page() {\n $targetService = urldecode($_GET['targetService']);\n $pgt = $_GET['pgt'];\n \n $response = array('proxy' => TRUE);\n if (!$targetService || !$pgt) {\n $response['code'] = 'INVALID_REQUEST';\n $response['error'] = '\"pgt\" and \"targetService\" parameters are both required';\n }\n elseif (!$pgt_ticket = cas_server_load_proxy_granting_ticket($pgt)) {\n $response['code'] = 'INVALID_TICKET';\n $response['error'] = 'Ticket '. $pgt .'is not recognized';\n }\n else if ($pgt_ticket->service_url != $targetService) {\n watchdog('cas_server', 'PROXY request invalid. The given proxy granting ticket (@pgt) does not belong to the target service (@service).', array('@pgt' => $$pgt, '@service' => $targetService), WATCHDOG_WARNING);\n $response['code'] = 'INVALID_TICKET';\n $response['error'] = 'Ticket '. $pgt .' does not match with '. $targetService;\n }\n else {\n if ($proxy_ticket = cas_server_new_proxy_ticket($pgt, $targetService)) {\n $response['success'] = $proxy_ticket->proxy_ticket;\n }\n else {\n $response['code'] = 'INTERNAL_ERROR';\n $response['error'] = 'An internal error occurred while granting proxy ticket';\n }\n }\n \n _cas_server_validate_response('2.0', $response);\n}", "public function setHttpProxy($http_proxy);", "public function proxy(Request $request)\n {\n $url = parse_url($request->get('url'));\n\n if(!$url)\n {\n throw new \\RuntimeException('No URL passed in proxy request.');\n }\n\n $baseUrl = $request->get('url');\n\n foreach($request->query->all() as $key => $value)\n {\n if($key === \"url\")\n continue;\n $baseUrl .= \"&$key=\" . urlencode($value);\n }\n\n // Only allow proxing HTTP and HTTPS\n if(!isset($url['scheme']))\n {\n throw new HttpException(500, 'This proxy only allow HTTP and '\n . 'HTTPS urls.');\n }\n if(!$url['scheme'] == 'http' && !$url['scheme'] == 'https')\n {\n throw new HttpException(500, 'This proxy only allow HTTP and '\n . 'HTTPS urls.');\n }\n\n // Init cUrl\n $ch = curl_init($baseUrl);\n\n // Add POST data if neccessary\n if($request->getMethod() == 'POST')\n {\n curl_setopt($ch, CURLOPT_POST, true);\n $contentType = explode(';', $request->headers->get('Content-Type'));\n\n if($contentType[0] == 'application/xml')\n {\n// curl_setopt($ch, CURLOPT_HTTPHEADER, $request->headers\n// ->get('Content-Type'));\n $content = $request->getContent();\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: ' . $contentType[0]));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getContent());\n /*\n $xml = file_get_contents('php://input');\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-type: application/xml'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);\n */\n } else\n {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getParameters());\n //curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);\n }\n }\n\n $user_agent = array_key_exists('HTTP_USER_AGENT', $_SERVER) ?\n $_SERVER['HTTP_USER_AGENT'] : 'Mapbender3';\n\n $curl_config = array(\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HEADER => false,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_USERAGENT => $user_agent);\n\n // Set params + proxy params if not noproxy\n if(!in_array($url['host'], $this->noproxy))\n {\n $curl_config += $this->proxy_conf;\n }\n\n curl_setopt_array($ch, $curl_config);\n\n // Get response from server\n $content = curl_exec($ch);\n\n $status = curl_getinfo($ch);\n\n if($content === false)\n {\n throw new \\RuntimeException('Proxying failed: ' . curl_error($ch)\n . ' [' . curl_errno($ch) . ']', curl_errno($ch));\n }\n curl_close($ch);\n // convert into content-type charset\n try\n {\n $contentType = $request->headers->get(\"content-type\");\n if($contentType !== null && strlen($contentType) > 0)\n {\n $tmp = explode(\";\", $contentType);\n foreach($tmp as $value)\n {\n if(stripos($value, \"charset\") !== false\n && stripos($value, \"charset\") == 0)\n {\n $charset = explode(\"=\", $value);\n }\n }\n if(isset($charset) && isset($charset[1])\n && !mb_check_encoding($content, $charset[1]))\n {\n $content = mb_convert_encoding($content, $charset[1]);\n }\n }\n } catch(\\Exception $e)\n {\n \n }\n // Return server response\n return new Response($content, $status['http_code'], array(\n 'Content-Type' => $status['content_type']));\n }", "function drupal_http_request($url, array $options = array()) {\n // Allow an alternate HTTP client library to replace Drupal's default\n // implementation.\n $override_function = variable_get('drupal_http_request_function', FALSE);\n if (!empty($override_function) && function_exists($override_function)) {\n return $override_function($url, $options);\n }\n\n $result = new stdClass();\n\n // Parse the URL and make sure we can handle the schema.\n $uri = @parse_url($url);\n\n if ($uri == FALSE) {\n $result->error = 'unable to parse URL';\n $result->code = -1001;\n return $result;\n }\n\n if (!isset($uri['scheme'])) {\n $result->error = 'missing schema';\n $result->code = -1002;\n return $result;\n }\n\n timer_start(__FUNCTION__);\n\n // Merge the default options.\n $options += array(\n 'headers' => array(),\n 'method' => 'GET',\n 'data' => NULL,\n 'max_redirects' => 3,\n 'timeout' => 30.0,\n 'context' => NULL,\n );\n\n // Merge the default headers.\n $options['headers'] += array(\n 'User-Agent' => 'Drupal (+http://drupal.org/)',\n );\n\n // stream_socket_client() requires timeout to be a float.\n $options['timeout'] = (float) $options['timeout'];\n\n // Use a proxy if one is defined and the host is not on the excluded list.\n $proxy_server = variable_get('proxy_server', '');\n if ($proxy_server && _drupal_http_use_proxy($uri['host'])) {\n // Set the scheme so we open a socket to the proxy server.\n $uri['scheme'] = 'proxy';\n // Set the path to be the full URL.\n $uri['path'] = $url;\n // Since the URL is passed as the path, we won't use the parsed query.\n unset($uri['query']);\n\n // Add in username and password to Proxy-Authorization header if needed.\n if ($proxy_username = variable_get('proxy_username', '')) {\n $proxy_password = variable_get('proxy_password', '');\n $options['headers']['Proxy-Authorization'] = 'Basic ' . base64_encode($proxy_username . (!empty($proxy_password) ? \":\" . $proxy_password : ''));\n }\n // Some proxies reject requests with any User-Agent headers, while others\n // require a specific one.\n $proxy_user_agent = variable_get('proxy_user_agent', '');\n // The default value matches neither condition.\n if ($proxy_user_agent === NULL) {\n unset($options['headers']['User-Agent']);\n }\n elseif ($proxy_user_agent) {\n $options['headers']['User-Agent'] = $proxy_user_agent;\n }\n }\n\n switch ($uri['scheme']) {\n case 'proxy':\n // Make the socket connection to a proxy server.\n $socket = 'tcp://' . $proxy_server . ':' . variable_get('proxy_port', 8080);\n // The Host header still needs to match the real request.\n $options['headers']['Host'] = $uri['host'];\n $options['headers']['Host'] .= isset($uri['port']) && $uri['port'] != 80 ? ':' . $uri['port'] : '';\n break;\n\n case 'http':\n case 'feed':\n $port = isset($uri['port']) ? $uri['port'] : 80;\n $socket = 'tcp://' . $uri['host'] . ':' . $port;\n // RFC 2616: \"non-standard ports MUST, default ports MAY be included\".\n // We don't add the standard port to prevent from breaking rewrite rules\n // checking the host that do not take into account the port number.\n $options['headers']['Host'] = $uri['host'] . ($port != 80 ? ':' . $port : '');\n break;\n\n case 'https':\n // Note: Only works when PHP is compiled with OpenSSL support.\n $port = isset($uri['port']) ? $uri['port'] : 443;\n $socket = 'ssl://' . $uri['host'] . ':' . $port;\n $options['headers']['Host'] = $uri['host'] . ($port != 443 ? ':' . $port : '');\n break;\n\n default:\n $result->error = 'invalid schema ' . $uri['scheme'];\n $result->code = -1003;\n return $result;\n }\n\n if (empty($options['context'])) {\n $fp = @stream_socket_client($socket, $errno, $errstr, $options['timeout']);\n }\n else {\n // Create a stream with context. Allows verification of a SSL certificate.\n $fp = @stream_socket_client($socket, $errno, $errstr, $options['timeout'], STREAM_CLIENT_CONNECT, $options['context']);\n }\n\n // Make sure the socket opened properly.\n if (!$fp) {\n // When a network error occurs, we use a negative number so it does not\n // clash with the HTTP status codes.\n $result->code = -$errno;\n $result->error = trim($errstr) ? trim($errstr) : t('Error opening socket @socket', array('@socket' => $socket));\n\n // Mark that this request failed. This will trigger a check of the web\n // server's ability to make outgoing HTTP requests the next time that\n // requirements checking is performed.\n // See system_requirements().\n variable_set('drupal_http_request_fails', TRUE);\n\n return $result;\n }\n\n // Construct the path to act on.\n $path = isset($uri['path']) ? $uri['path'] : '/';\n if (isset($uri['query'])) {\n $path .= '?' . $uri['query'];\n }\n\n // Only add Content-Length if we actually have any content or if it is a POST\n // or PUT request. Some non-standard servers get confused by Content-Length in\n // at least HEAD/GET requests, and Squid always requires Content-Length in\n // POST/PUT requests.\n $content_length = strlen($options['data']);\n if ($content_length > 0 || $options['method'] == 'POST' || $options['method'] == 'PUT') {\n $options['headers']['Content-Length'] = $content_length;\n }\n\n // If the server URL has a user then attempt to use basic authentication.\n if (isset($uri['user'])) {\n $options['headers']['Authorization'] = 'Basic ' . base64_encode($uri['user'] . (isset($uri['pass']) ? ':' . $uri['pass'] : ':'));\n }\n\n // If the database prefix is being used by SimpleTest to run the tests in a copied\n // database then set the user-agent header to the database prefix so that any\n // calls to other Drupal pages will run the SimpleTest prefixed database. The\n // user-agent is used to ensure that multiple testing sessions running at the\n // same time won't interfere with each other as they would if the database\n // prefix were stored statically in a file or database variable.\n $test_info = &$GLOBALS['drupal_test_info'];\n if (!empty($test_info['test_run_id'])) {\n $options['headers']['User-Agent'] = drupal_generate_test_ua($test_info['test_run_id']);\n }\n\n $request = $options['method'] . ' ' . $path . \" HTTP/1.0\\r\\n\";\n foreach ($options['headers'] as $name => $value) {\n $request .= $name . ': ' . trim($value) . \"\\r\\n\";\n }\n $request .= \"\\r\\n\" . $options['data'];\n $result->request = $request;\n // Calculate how much time is left of the original timeout value.\n $timeout = $options['timeout'] - timer_read(__FUNCTION__) / 1000;\n if ($timeout > 0) {\n stream_set_timeout($fp, floor($timeout), floor(1000000 * fmod($timeout, 1)));\n fwrite($fp, $request);\n }\n\n // Fetch response. Due to PHP bugs like http://bugs.php.net/bug.php?id=43782\n // and http://bugs.php.net/bug.php?id=46049 we can't rely on feof(), but\n // instead must invoke stream_get_meta_data() each iteration.\n $info = stream_get_meta_data($fp);\n $alive = !$info['eof'] && !$info['timed_out'];\n $response = '';\n\n while ($alive) {\n // Calculate how much time is left of the original timeout value.\n $timeout = $options['timeout'] - timer_read(__FUNCTION__) / 1000;\n if ($timeout <= 0) {\n $info['timed_out'] = TRUE;\n break;\n }\n stream_set_timeout($fp, floor($timeout), floor(1000000 * fmod($timeout, 1)));\n $chunk = fread($fp, 1024);\n $response .= $chunk;\n $info = stream_get_meta_data($fp);\n $alive = !$info['eof'] && !$info['timed_out'] && $chunk;\n }\n fclose($fp);\n\n if ($info['timed_out']) {\n $result->code = HTTP_REQUEST_TIMEOUT;\n $result->error = 'request timed out';\n return $result;\n }\n // Parse response headers from the response body.\n // Be tolerant of malformed HTTP responses that separate header and body with\n // \\n\\n or \\r\\r instead of \\r\\n\\r\\n.\n list($response, $result->data) = preg_split(\"/\\r\\n\\r\\n|\\n\\n|\\r\\r/\", $response, 2);\n $response = preg_split(\"/\\r\\n|\\n|\\r/\", $response);\n\n // Parse the response status line.\n $response_status_array = _drupal_parse_response_status(trim(array_shift($response)));\n $result->protocol = $response_status_array['http_version'];\n $result->status_message = $response_status_array['reason_phrase'];\n $code = $response_status_array['response_code'];\n\n $result->headers = array();\n\n // Parse the response headers.\n while ($line = trim(array_shift($response))) {\n list($name, $value) = explode(':', $line, 2);\n $name = strtolower($name);\n if (isset($result->headers[$name]) && $name == 'set-cookie') {\n // RFC 2109: the Set-Cookie response header comprises the token Set-\n // Cookie:, followed by a comma-separated list of one or more cookies.\n $result->headers[$name] .= ',' . trim($value);\n }\n else {\n $result->headers[$name] = trim($value);\n }\n }\n\n $responses = array(\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Large',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range not satisfiable',\n 417 => 'Expectation Failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 505 => 'HTTP Version not supported',\n );\n // RFC 2616 states that all unknown HTTP codes must be treated the same as the\n // base code in their class.\n if (!isset($responses[$code])) {\n $code = floor($code / 100) * 100;\n }\n $result->code = $code;\n\n switch ($code) {\n case 200: // OK\n case 201: // Created\n case 202: // Accepted\n case 203: // Non-Authoritative Information\n case 204: // No Content\n case 205: // Reset Content\n case 206: // Partial Content\n case 304: // Not modified\n break;\n case 301: // Moved permanently\n case 302: // Moved temporarily\n case 307: // Moved temporarily\n $location = $result->headers['location'];\n $options['timeout'] -= timer_read(__FUNCTION__) / 1000;\n if ($options['timeout'] <= 0) {\n $result->code = HTTP_REQUEST_TIMEOUT;\n $result->error = 'request timed out';\n }\n elseif ($options['max_redirects']) {\n // Redirect to the new location.\n $options['max_redirects']--;\n $result = drupal_http_request($location, $options);\n $result->redirect_code = $code;\n }\n if (!isset($result->redirect_url)) {\n $result->redirect_url = $location;\n }\n break;\n default:\n $result->error = $result->status_message;\n }\n\n return $result;\n}", "public static function http_request($opt)\n {\n\n # create http client\n $client = new \\GuzzleHttp\\Client([\n 'base_uri' => 'https://' . $opt->hostname,\n 'timeout' => 5.0\n ]);\n\n # create request options\n $options = [\n 'headers' => $opt->headers,\n 'query' => $opt->params,\n ];\n\n # local proxy debugging\n if ($opt->chs_debug) {\n $options['proxy'] = [\n 'https' => 'tcp://127.0.0.1:8888'\n ];\n $options['verify'] = false;\n }\n\n # now add options and send request\n $response = $client->request($opt->method, $opt->path, $options);\n\n # check if an error is thrown\n $status = $response->getStatusCode();\n # get data from response and cast to string\n $data = (string)$response->getBody();\n\n if ($status >= 400) {\n $msg = \"$status $response->getReasonPhrase\";\n $body = json_decode($data);\n Utils::debug($body, 'ERROR');\n throw new \\Exception($msg);\n # is it fatal? \n # exit();\n }\n # assuming response is JSON\n return json_decode($data);\n }", "public function test_configure_client_proxy_with_proxied_request() {\n global $CFG;\n // Set default proxy settings.\n $CFG->proxyhost = 'proxyhost';\n $CFG->proxyport = 3128;\n $CFG->proxytype = 'HTTP';\n $CFG->proxybypass = '';\n\n // Create client with mock response.\n $mockhandler = new MockHandler([\n new Response(200, [], 'Mock response'),\n ]);\n $stack = HandlerStack::create($mockhandler);\n $client = guzzle_helper::configure_client_proxy(new Client(['handler' => $stack]));\n\n // Check what Middleware is called.\n $client->request('get', 'http://example.com');\n $lastrequestoptions = $mockhandler->getLastOptions();\n $this->assertArrayHasKey('proxy', $lastrequestoptions);\n $this->assertEquals(aws_helper::get_proxy_string(), $lastrequestoptions['proxy']);\n }", "function http_request( \n\t\t$verb = 'GET', /* HTTP Request Method (GET and POST supported) */ \n\t\t$ip, /* Target IP/proxy */ \n\t\t$host,\t\t\t\t\t /* Target IP/site */\n\t\t$port = 80, /* Target TCP port */ \n\t\t$uri = '/', /* Target URI */ \n\t\t$getdata = array(), /* HTTP GET Data ie. array('var1' => 'val1', 'var2' => 'val2') */ \n\t\t$postdata = array(), /* HTTP POST Data ie. array('var1' => 'val1', 'var2' => 'val2') */ \n\t\t$cookie = array(), /* HTTP Cookie Data ie. array('var1' => 'val1', 'var2' => 'val2') */ \n\t\t$files = array(),\n\t\t$custom_headers = array(), /* Custom HTTP headers ie. array('Referer: http://localhost/ */ \n\t\t$timeout = 20000, /* Socket timeout in milliseconds */ \n\t\t$req_hdr = false, /* Include HTTP request headers */ \n\t\t$res_hdr = false /* Include HTTP response headers */ \n\t\t) \n\t{ \n\t\tglobal $settings;\n\t\n\t\t$ret = ''; \n\t\t$verb = strtoupper($verb); \n\t\t$cookie_str = ''; \n\t\t$getdata_str = count($getdata) ? '?' : ''; \n\t\t$postdata_str = '';\n\t\t$boundary = (string)abs(rand());\n\t\t$crlf = \"\\r\\n\"; \n\n\t\tforeach ($getdata as $k => $v) \n\t\t\t$getdata_str .= urlencode($k) .'='. $v .'&'; \n\n\t\tif(count($files) == 0) {\n\t\t\tforeach ($postdata as $k => $v) \n\t\t\t\t$postdata_str .= urlencode($k) .'='. $v .'&'; \n\t\t} else {\n\t\t\tforeach ($postdata as $k => $v) {\n\t\t\t\t$postdata_str .= '--' . $boundary . $crlf;\n\t\t\t\t$postdata_str .= 'Content-Disposition: form-data; name=\"'.urlencode($k).'\"' . $crlf;\n\t\t\t\t$postdata_str .= $crlf;\n\t\t\t\t$postdata_str .= $v . $crlf;\n\t\t\t}\n\t\t\tforeach ($files as $v) {\n\t\t\t\t$postdata_str .= '--' . $boundary . $crlf;\n\t\t\t\t$postdata_str .= 'Content-Disposition: form-data; name=\"'.urlencode($v['key']).'\"; filename=\"'.$v['filename'].'\"' . $crlf;\n\t\t\t\t$postdata_str .= 'Content-Type: ' . $v['content-type'] . $crlf;\n\t\t\t\t$postdata_str .= $crlf;\n\t\t\t\t$postdata_str .= $v['value'] . $crlf;\n\t\t\t}\n\t\t\t$postdata_str .= '--' . $boundary . '--' . $crlf;\n\t\t}\n\t\t\n\t\tforeach ($cookie as $k => $v) \n\t\t\t$cookie_str .= urlencode($k) .'='. $v .'; '; \n\n\t\t$req = $verb .' '. $uri . $getdata_str .' HTTP/1.1' . $crlf; \n\t\t$req .= 'Host: '. $host . $crlf; \n\t\t$req .= 'User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16' . $crlf; \n\t\t$req .= 'Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1' . $crlf; \n\t\t$req .= 'Accept-Language: ru-RU,ru;q=0.9,en;q=0.8' . $crlf; \n\t\t$req .= 'Accept-Encoding: deflate' . $crlf; \n\t\t$req .= 'Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1' . $crlf; \n\t\tforeach ($custom_headers as $k => $v) \n\t\t\t$req .= $k .': '. $v . $crlf; \n\t\t\t\n\t\tif (!empty($cookie_str)) \n\t\t\t$req .= 'Cookie: '. substr($cookie_str, 0, -2) . $crlf;\n\t\t\t\n\t\t$req .= 'Cookie2: $Version=1' . $crlf; \n\t\t$req .= 'Connection: Close' . $crlf; \t\n\t\t\n\t\t\t\n\t\tif ($verb == 'POST' && !empty($postdata_str)) \n\t\t{ \n\t\t\tif(count($files) == 0) {\n\t\t\t\t$postdata_str = substr($postdata_str, 0, -1); \n\t\t\t\t$req .= 'Content-Type: application/x-www-form-urlencoded' . $crlf; \n\t\t\t\t$req .= 'Content-Length: '. strlen($postdata_str) . $crlf . $crlf; \n\t\t\t\t$req .= $postdata_str; \n\t\t\t} else {\n\t\t\t\t$postdata_str = substr($postdata_str, 0, -1); \n\t\t\t\t$req .= 'Content-Type: multipart/form-data; boundary=\"'.$boundary.'\"' . $crlf; \n\t\t\t\t$req .= 'Content-Length: '. strlen($postdata_str) . $crlf . $crlf; \n\t\t\t\t$req .= $postdata_str; \n\t\t\t}\n\t\t} \n\t\telse $req .= $crlf.$crlf; \n\t\t\n\t\tif ($req_hdr) \n\t\t\t$ret .= $req; \n\t\t\n\t\twhile(!($fp = @fsockopen($ip, $port, $errno, $errstr,7))) {\n\t\t\techo \"Error in connection, sleep \".$settings['sleepPerError'].PHP_EOL;\n\t\t\tsleep($settings['sleepPerError']);\n\t\t}\n\t\t\n\t\tstream_set_timeout($fp, 0, $timeout * 1000); \n\t\t@fwrite($fp, $req); \n\t\t\n\t\twhile ($line = fgets($fp)) $ret .= $line; \n\t\tfclose($fp);\n\t\tif (!$res_hdr and strpos($ret, \"\\r\\n\\r\\n\") !== FALSE) \n\t\t\t$ret = substr($ret, strpos($ret, \"\\r\\n\\r\\n\") + 4); \n\t\t\t\n\t\tif($settings['sleepPerQuery'] !== 0)\n\t\t\tsleep($settings['sleepPerQuery']);\n\n\t\treturn $ret; \n\t}", "function proxy ($url) {\n\n // init response array\n $response = array();\n\n // init curl & set options\n $ch = curl_init();\n $curl_options = array (\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],\n CURLOPT_COOKIE => getClientCookies(),\n\n // required for cookies bridging\n CURLOPT_VERBOSE => true,\n CURLOPT_HEADER => true,\n );\n curl_setopt_array($ch, $curl_options);\n\n // catch a POST request and forward it along with query\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST, '', '&'));\n }\n\n // stop session so curl can use the same session without conflicts\n session_write_close();\n\n // execute curl request\n $output = curl_exec($ch);\n\n /*****************************/\n /* This happens after the request has been made */\n\n // get response content-type and send to the client\n $response['content_type'] = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n\n // get effective (final) URL to determine if redirection is needed\n $response['eff_url'] = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n\n // Separate header and body\n $header_len = curl_getinfo($ch, CURLINFO_HEADER_SIZE);\n $header = substr($output, 0, $header_len);\n $response['body'] = substr($output, $header_len);\n\n curl_close($ch);\n\n // restart session\n session_start();\n\n // set cookies to client using a separate function\n setClientCookies($header, $url);\n\n // return the response to the client\n return $response;\n}", "public function setHttpProxy($proxy)\n {\n $this->httpProxy = $proxy;\n }", "function getProxy() {\r\n\t$proxy = array();\r\n\t\r\n\tif(isset($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t$proxy = array_merge($proxy, explode(',', $_SERVER['HTTP_CLIENT_IP']));\r\n\t\r\n\tif(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t$proxy = array_merge($proxy, explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']));\r\n\t\r\n\tif (!count($proxy) > 0) {\r\n\t\tif (isset($_SERVER[\"HTTP_PROXY_CONNECTION\"]) || isset($_SERVER[\"HTTP_VIA\"])) {\r\n\t\t\treturn \"::Proxy Detected\";\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\t$proxy = implode('::', $proxy);\r\n\treturn '::' . $proxy;\r\n}", "function connect_http_proxy($proxy,$port,$user = null,$password = null)\n {\n $this->sock = fsockopen($proxy,$port,$en,$es,$this->timeout);\n if(!$this->sock) {\n return false;\n } else {\n if($user && $password)\n $au = \"Proxy-Authorization: basic \".base64_encode($user.\":\".$password).\"\\r\\n\";\n else\n $au = '';\n fputs($this->sock,\"CONNECT \".$this->server.\":\".$this->port.\" HTTP/1.0\\r\\nHost: \".$this->server.\":\".$this->port.\"\\r\\nUser-Agent: MRIM.php/3.0 (PRO; \".PHP_OS.\"; Proxy)\\r\\n\".$au.\"\\r\\n\");\n $code = intval(substr(trim(fgets($this->sock,1024)),9,3));\n if($code != 200) {\n fclose($this->sock);\n return false;\n }\n while(($a = trim(fgets($this->sock,1024)) != ''))\n ;\n $answ = fread($this->sock,20);\n fclose($this->sock);\n list($hostc,$portc) = explode(':',$answ);\n unset($this->sock);\n $this->sock = fsockopen($proxy,$port,$en,$es,$this->timeout);\n fputs($this->sock,\"CONNECT \".$hostc.\":\".intval($portc).\" HTTP/1.0\\r\\nHost: \".$hostc.\":\".intval($portc).\"\\r\\nUser-Agent: MRIM.php/3.0 (PRO; \".PHP_OS.\"; Proxy)\\r\\n\".$au.\"\\r\\n\");\n if(!$this->sock)\n return false;\n $code = intval(substr(trim(fgets($this->sock,1024)),9,3));\n if($code != 200) {\n fclose($this->sock);\n return false;\n }\n while(($a = trim(fgets($this->sock,1024)) != ''))\n ;\n unset($answ);\n $this->mnumb = 0;\n fwrite($this->sock,$this->make_packet($this->MRIM_CS_HELLO));\n $answ = fread($this->sock,48);\n list(,$magic,$proto,$seq,$msg,$dlen,$from,$fromport,$r1,$r2,$r3,$r4,$data) = unpack('L*',$answ);\n $this->ping_time = $data;\n return true;\n }\n }", "protected function sendRequest()\n {\n // Return a Guzzle Response object from something like $client->post()\n // or $client->get(). The default is just a simple GET with params.\n return $this->client->get($this->url(), ['query' => $this->getParams()]);\n }", "function sendRequest($url,$data='',$method='GET'){\n $this->start = $this->_time();\n $this->error = '';\n $this->status = 0;\n\n // parse URL into bits\n $uri = parse_url($url);\n $server = $uri['host'];\n $path = $uri['path'];\n if(empty($path)) $path = '/';\n if(!empty($uri['query'])) $path .= '?'.$uri['query'];\n $port = $uri['port'];\n if($uri['user']) $this->user = $uri['user'];\n if($uri['pass']) $this->pass = $uri['pass'];\n\n // proxy setup\n if($this->proxy_host){\n $request_url = $url;\n $server = $this->proxy_host;\n $port = $this->proxy_port;\n if (empty($port)) $port = 8080;\n }else{\n $request_url = $path;\n $server = $server;\n if (empty($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;\n }\n\n // add SSL stream prefix if needed - needs SSL support in PHP\n if($port == 443 || $this->proxy_ssl) $server = 'ssl://'.$server;\n\n // prepare headers\n $headers = $this->headers;\n $headers['Host'] = $uri['host'];\n $headers['User-Agent'] = $this->agent;\n $headers['Referer'] = $this->referer;\n $headers['Connection'] = 'Close';\n if($method == 'POST'){\n if(is_array($data)){\n $headers['Content-Type'] = 'application/x-www-form-urlencoded';\n $data = $this->_postEncode($data);\n }\n $headers['Content-Length'] = strlen($data);\n $rmethod = 'POST';\n }elseif($method == 'GET'){\n $data = ''; //no data allowed on GET requests\n }\n if($this->user) {\n $headers['Authorization'] = 'Basic '.base64_encode($this->user.':'.$this->pass);\n }\n if($this->proxy_user) {\n $headers['Proxy-Authorization'] = 'Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass);\n }\n\n // stop time\n $start = time();\n\n // open socket\n $socket = @fsockopen($server,$port,$errno, $errstr, $this->timeout);\n if (!$socket){\n $resp->status = '-100';\n $this->error = \"Could not connect to $server:$port\\n$errstr ($errno)\";\n return false;\n }\n //set non blocking\n stream_set_blocking($socket,0);\n\n // build request\n $request = \"$method $request_url HTTP/\".$this->http.HTTP_NL;\n $request .= $this->_buildHeaders($headers);\n $request .= $this->_getCookies();\n $request .= HTTP_NL;\n $request .= $data;\n\n $this->_debug('request',$request);\n\n // send request\n $towrite = strlen($request);\n $written = 0;\n while($written < $towrite){\n $ret = fwrite($socket, substr($request,$written));\n if($ret === false){\n $this->status = -100;\n $this->error = 'Failed writing to socket';\n return false;\n }\n $written += $ret;\n }\n\n\n // read headers from socket\n $r_headers = '';\n do{\n if(time()-$start > $this->timeout){\n $this->status = -100;\n $this->error = sprintf('Timeout while reading headers (%.3fs)',$this->_time() - $this->start);\n return false;\n }\n if(feof($socket)){\n $this->error = 'Premature End of File (socket)';\n return false;\n }\n $r_headers .= fgets($socket,1024);\n }while(!preg_match('/\\r?\\n\\r?\\n$/',$r_headers));\n\n $this->_debug('response headers',$r_headers);\n\n // check if expected body size exceeds allowance\n if($this->max_bodysize && preg_match('/\\r?\\nContent-Length:\\s*(\\d+)\\r?\\n/i',$r_headers,$match)){\n if($match[1] > $this->max_bodysize){\n $this->error = 'Reported content length exceeds allowed response size';\n if ($this->max_bodysize_abort)\n return false;\n }\n }\n\n // get Status\n if (!preg_match('/^HTTP\\/(\\d\\.\\d)\\s*(\\d+).*?\\n/', $r_headers, $m)) {\n $this->error = 'Server returned bad answer';\n return false;\n }\n $this->status = $m[2];\n\n // handle headers and cookies\n $this->resp_headers = $this->_parseHeaders($r_headers);\n if(isset($this->resp_headers['set-cookie'])){\n foreach ((array) $this->resp_headers['set-cookie'] as $c){\n list($key, $value, $foo) = explode('=', $cookie);\n $this->cookies[$key] = $value;\n }\n }\n\n $this->_debug('Object headers',$this->resp_headers);\n\n // check server status code to follow redirect\n if($this->status == 301 || $this->status == 302 ){\n if (empty($this->resp_headers['location'])){\n $this->error = 'Redirect but no Location Header found';\n return false;\n }elseif($this->redirect_count == $this->max_redirect){\n $this->error = 'Maximum number of redirects exceeded';\n return false;\n }else{\n $this->redirect_count++;\n $this->referer = $url;\n if (!preg_match('/^http/i', $this->resp_headers['location'])){\n $this->resp_headers['location'] = $uri['scheme'].'://'.$uri['host'].\n $this->resp_headers['location'];\n }\n // perform redirected request, always via GET (required by RFC)\n return $this->sendRequest($this->resp_headers['location'],array(),'GET');\n }\n }\n\n // check if headers are as expected\n if($this->header_regexp && !preg_match($this->header_regexp,$r_headers)){\n $this->error = 'The received headers did not match the given regexp';\n return false;\n }\n\n $lastsay = 0;\n\n //read body (with chunked encoding if needed)\n $r_body = '';\n if(preg_match('/transfer\\-(en)?coding:\\s*chunked\\r\\n/i',$r_header)){\n do {\n unset($chunk_size);\n do {\n if(feof($socket)){\n $this->error = 'Premature End of File (socket)';\n return false;\n }\n if(time()-$start > $this->timeout){\n $this->status = -100;\n $this->error = sprintf('Timeout while reading chunk (%.3fs)',$this->_time() - $this->start);\n return false;\n }\n $byte = fread($socket,1);\n $chunk_size .= $byte;\n } while (preg_match('/[a-zA-Z0-9]/',$byte)); // read chunksize including \\r\n\n $byte = fread($socket,1); // readtrailing \\n\n $chunk_size = hexdec($chunk_size);\n $this_chunk = fread($socket,$chunk_size);\n $r_body .= $this_chunk;\n if ($chunk_size) $byte = fread($socket,2); // read trailing \\r\\n\n\n if($this->max_bodysize && strlen($r_body) > $this->max_bodysize){\n $this->error = 'Allowed response size exceeded';\n if ($this->max_bodysize_abort)\n return false;\n else\n break;\n }\n\n $this->_status(strlen($r_body));\n } while ($chunk_size);\n }else{\n // read entire socket\n while (!feof($socket)) {\n if(time()-$start > $this->timeout){\n $this->status = -100;\n $this->error = sprintf('Timeout while reading response (%.3fs)',$this->_time() - $this->start);\n return false;\n }\n $r_body .= fread($socket,4096);\n $r_size = strlen($r_body);\n if($this->max_bodysize && $r_size > $this->max_bodysize){\n $this->error = 'Allowed response size exceeded';\n if ($this->max_bodysize_abort)\n return false;\n else\n break;\n }\n if($this->resp_headers['content-length'] && !$this->resp_headers['transfer-encoding'] &&\n $this->resp_headers['content-length'] == $r_size){\n // we read the content-length, finish here\n break;\n }\n $this->_status(strlen($r_body));\n }\n }\n\n // close socket\n $status = socket_get_status($socket);\n fclose($socket);\n\n say(strlen($r_body).' bytes read');\n\n // decode gzip if needed\n if($this->resp_headers['content-encoding'] == 'gzip'){\n $this->resp_body = gzinflate(substr($r_body, 10));\n }else{\n $this->resp_body = $r_body;\n }\n\n $this->_debug('response body',$this->resp_body);\n $this->redirect_count = 0;\n return true;\n }", "function bangpound_drupal_http_request($url, array $options = array())\n{\n $result = new stdClass();\n\n // Parse the URL and make sure we can handle the schema.\n $uri = @parse_url($url);\n\n if ($uri == FALSE) {\n $result->error = 'unable to parse URL';\n $result->code = -1001;\n\n return $result;\n }\n\n if (!isset($uri['scheme'])) {\n $result->error = 'missing schema';\n $result->code = -1002;\n\n return $result;\n }\n\n timer_start(__FUNCTION__);\n\n // Merge the default options.\n $options += array(\n 'headers' => array(),\n 'method' => 'GET',\n 'data' => NULL,\n 'max_redirects' => 3,\n 'timeout' => 30.0,\n 'context' => NULL,\n );\n\n // Merge the default headers.\n $options['headers'] += array(\n 'User-Agent' => 'Drupal (+http://drupal.org/)',\n );\n\n // Concessions to Guzzle.\n if (isset($options['data'])) {\n $options['body'] = $options['data'];\n }\n if (!$options['max_redirects']) {\n $options['allow_redirects'] = FALSE;\n }\n\n // Use a proxy if one is defined and the host is not on the excluded list.\n $proxy_server = variable_get('proxy_server', '');\n if ($proxy_server && _drupal_http_use_proxy($uri['host'])) {\n // Set the scheme so we open a socket to the proxy server.\n $uri['scheme'] = 'proxy';\n // Set the path to be the full URL.\n $uri['path'] = $url;\n // Since the URL is passed as the path, we won't use the parsed query.\n unset($uri['query']);\n\n // Add in username and password to Proxy-Authorization header if needed.\n if ($proxy_username = variable_get('proxy_username', '')) {\n $proxy_password = variable_get('proxy_password', '');\n $options['headers']['Proxy-Authorization'] = 'Basic ' . base64_encode($proxy_username . (!empty($proxy_password) ? \":\" . $proxy_password : ''));\n }\n // Some proxies reject requests with any User-Agent headers, while others\n // require a specific one.\n $proxy_user_agent = variable_get('proxy_user_agent', '');\n // The default value matches neither condition.\n if ($proxy_user_agent === NULL) {\n unset($options['headers']['User-Agent']);\n } elseif ($proxy_user_agent) {\n $options['headers']['User-Agent'] = $proxy_user_agent;\n }\n }\n\n // Make sure the socket opened properly.\n // @todo Migrate error checking.\n\n // If the server URL has a user then attempt to use basic authentication.\n // @todo Migrate authentication.\n\n // If the database prefix is being used by SimpleTest to run the tests in a copied\n // database then set the user-agent header to the database prefix so that any\n // calls to other Drupal pages will run the SimpleTest prefixed database. The\n // user-agent is used to ensure that multiple testing sessions running at the\n // same time won't interfere with each other as they would if the database\n // prefix were stored statically in a file or database variable.\n $test_info = &$GLOBALS['drupal_test_info'];\n if (!empty($test_info['test_run_id'])) {\n $options['headers']['User-Agent'] = drupal_generate_test_ua($test_info['test_run_id']);\n }\n\n // Calculate how much time is left of the original timeout value.\n $timeout = $options['timeout'] - timer_read(__FUNCTION__) / 1000;\n if ($timeout > 0) {\n /** @see \\Guzzle\\Http\\StaticClient::request() */\n static $client;\n if (!$client) {\n $client = new \\Guzzle\\Http\\Client();\n }\n\n $request = $client->createRequest($options['method'], $url, null, null, $options);\n\n if ($options['max_redirects']) {\n $client->getConfig()->set('redirect.max', $options['max_redirects']);\n }\n\n if (isset($options['stream'])) {\n if ($options['stream'] instanceof \\Guzzle\\Stream\\StreamRequestFactoryInterface) {\n $response = $options['stream']->fromRequest($request);\n } elseif ($options['stream'] == true) {\n $streamFactory = new \\Guzzle\\Stream\\PhpStreamRequestFactory();\n $response = $streamFactory->fromRequest($request);\n }\n } else {\n $response = $request->send();\n }\n\n $result->request = $request->__toString();\n } else {\n $result->code = HTTP_REQUEST_TIMEOUT;\n $result->error = 'request timed out';\n\n return $result;\n }\n\n if (isset($response)) {\n // Parse response headers from the response body.\n // Be tolerant of malformed HTTP responses that separate header and body with\n // \\n\\n or \\r\\r instead of \\r\\n\\r\\n.\n $result->data = $response->getBody(true);\n\n // Parse the response status line.\n $result->protocol = $response->getProtocol() .'/'. $response->getProtocolVersion();\n $result->status_message = $response->getReasonPhrase();\n $result->headers = array_map(function ($input) { return (string) $input; }, $response->getHeaders()->getAll());\n $result->code = $response->getStatusCode();\n\n switch ($result->code) {\n case 200: // OK\n case 304: // Not modified\n break;\n case 301: // Moved permanently\n case 302: // Moved temporarily\n case 307: // Moved temporarily\n // $result->redirect_code = $code;\n // $result->redirect_url = $location;\n break;\n default:\n $result->error = $response->getReasonPhrase();\n }\n }\n\n return $result;\n}", "public function setProxy($proxy)\n {\n curl_setopt($this->ch, CURLOPT_PROXY, $proxy);\n }", "public function retrieveProxy( $proxyName );" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if one of the roles the user is in has a given right for a given application we read all right for the given user at once and cache them in the internal class cache
public function hasRight($_application, $_accountId, $_right) { $isCacheable = (Tinebase_Core::get(Tinebase_Core::CUSTOMEXPIRABLECACHE) && (Tinebase_Core::get(Tinebase_Core::SERVER_CLASS_NAME) == 'ActiveSync_Server_Http')); if ($isCacheable) { $params = array(__FUNCTION__, $_application, $_accountId, $_right); $cacheId = Tinebase_Helper::arrayToCacheId($params); $cache = Tinebase_Core::getCache(); if ($cache->test($cacheId)) { return $cache->load($cacheId); } } try { $roleMemberships = $this->getRoleMemberships($_accountId); } catch (Tinebase_Exception_NotFound $tenf) { $roleMemberships = array(); } if (empty($roleMemberships)) { Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' ' . $_accountId . ' has no role/group memberships.'); if (is_object(Tinebase_Core::getUser()) && Tinebase_Core::getUser()->getId() === $_accountId) { // @todo throw exception in this case? Tinebase_Session::destroyAndRemoveCookie(); } return FALSE; } try { $application = Tinebase_Application::getInstance()->getApplicationById($_application); } catch (Tinebase_Exception_NotFound $tenf) { Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' ' . $tenf->getMessage()); return false; } if ($application->status !== Tinebase_Application::ENABLED) { return false; } $classCacheId = Tinebase_Helper::convertClassCacheId(implode('', $roleMemberships)); if (!isset($this->_classCache[__FUNCTION__][$classCacheId])) { $select = $this->_db->select() ->distinct() ->from(array('role_rights' => SQL_TABLE_PREFIX . 'role_rights'), array('application_id', 'right')) ->where($this->_db->quoteIdentifier('role_id') . ' IN (?)', $roleMemberships); Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . $select->__toString()); $stmt = $this->_db->query($select); $rows = $stmt->fetchAll(Zend_Db::FETCH_ASSOC); $rights = array(); foreach ($rows as $row) { $rights[$row['application_id']][$row['right']] = true; } $this->_classCache[__FUNCTION__][$classCacheId] = $rights; } else { $rights = $this->_classCache[__FUNCTION__][$classCacheId]; } $applicationId = $application->getId(); $result = isset($rights[$applicationId]) && (isset($rights[$applicationId][$_right]) || isset($rights[$applicationId][Tinebase_Acl_Rights::ADMIN])); if ($isCacheable) { $cache->save($result, $cacheId, array('AShasRight', $_accountId)); } return $result; }
[ "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 }", "private static function cacheUserRoles()\n\t{\n\t\t$roles = ORM::for_table( _table_user_roles)\n\t\t\t\t\t->distinct()->select('role_id')\n\t\t\t\t\t->select('name')\n\t\t\t\t\t->join( _table_roles, array( _table_user_roles.'.role_id','=', _table_roles.'.id'))\n\t\t\t\t\t->where('user_id',$_SESSION[session_key]['user_id'])\n\t\t\t\t\t->find_many();\n\n\t\tif(!$roles)\n\t\t{\n\t\t\t$_SESSION[session_key]['has_roles'] = null;\n\t\t\tunset($_SESSION[session_key]['has_roles']);\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach($roles as $role)\n\t\t{\n\t\t\t$_SESSION[session_key]['has_roles'][$role->role_id] = $role->name;\n\t\t}\n\n\t\treturn $_SESSION[session_key]['has_roles'];\n\t}", "function readRights()\n {\n $this->right_ids = array();\n $result = $this->readUserRights($this->perm_user_id);\n if ($result === false) {\n return false;\n }\n $this->right_ids = $result;\n return $this->right_ids;\n }", "function readRights()\n {\n $query = '\n SELECT\n R.right_id AS rightid, ' . LIVEUSER_MAX_LEVEL . '\n FROM\n ' . $this->prefix . 'userrights UR\n INNER JOIN\n ' . $this->prefix . 'rights R\n ON\n UR.right_id=R.right_id\n WHERE\n UR.perm_user_id=' . $this->permUserId . '\n AND\n UR.right_level > 0';\n $result = $this->dbc->getAssoc($query);\n\n if (DB::isError($result)) {\n return $result;\n } // if\n\n $this->rights = $result;\n }", "function HasRight($user_info, $right_info, $org_info = -1)\r\n\t{\r\n\t\t$oRights = rights::GetInstance();\r\n\t\t\r\n\t\t$rightId = GetRightID($right_info);\r\n\t\t$orgId = -1;\r\n\t\t$oUserContainer = cUserContainer::GetInstance();\r\n\t\t\r\n\t\t$oUser = $oUserContainer->GetUser($user_info);\r\n\r\n\t\tif(!isset($oUser))\r\n\t\t{\r\n\t\t\treturn $this->results->Set('false', \"Unable to load user account.\");\r\n\t\t}\r\n\t\t\r\n\t\tif(!$oUser->IsValid())\r\n\t\t{\r\n\t\t\treturn $this->results->Set('false', \"Account is disabled or guest and may not use rights system.\");\r\n\t\t}\r\n\t\t \r\n\t\t$userId = $oUser->GetID();\r\n\r\n\t\tif($rightId < 0)\r\n\t\t{\r\n\t\t\treturn $this->results->Set('false', \"No access. Right does not exist.\");\r\n\t\t}\r\n\r\n\t\tif($oRights->RequiresOrg($rightId))\r\n\t\t{\r\n\t\t\tif(($org_info <> -1) && (strlen($org_info) > 0))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$orgId = GetOrgID($org_info);\r\n\t\t\t\tif($orgId == -1)\r\n \t \t{\r\n \t\t\t\treturn $this->results->Set('false', \"No access. Organization does not exist.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t $oRightGroups = rightGroup::GetInstance();\r\n\t $oOrganization = organization::GetInstance();\r\n\r\n\t\t/*\r\n\t\t\tIf the user has the global admin right then don't check for the next right.\r\n\t\t*/\r\n\t\t\r\n\t\t$sql = \"SELECT\r\n\t\t\t\t\t$this->field_AccessOrg\r\n\t\t\t\tFROM\r\n\t\t\t\t\t $this->table_Name\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t$this->field_Account = $userId\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t\t$this->field_AccountType = $this->accountTypeUser\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t\t$this->field_Access = $oRights->SYSTEM_GlobalAdmin\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t\t$this->field_AccessType = $this->accessTypeRight\";\r\n\t\t\r\n\t\t$records = $this->db->Select($sql);\r\n\t\t\r\n\t\tif(sizeof($records) == 1)\r\n\t\t{\r\n\t\t\treturn $this->results->Set('true', \"Access granted via global admin right.\");\r\n\t\t}\r\n\t\t\r\n\t\tunset($records);\r\n\t\t\r\n\t\t/*\r\n\t\t\tCheck against the user's individual rights first.\r\n\t\t\t$this->field_AccessType = 0\tis individual rights\r\n\t\t\t$this->field_AccessType = 1\tmeans a group\r\n\t\t*/\r\n\t\t\r\n\t\t$sql = \"SELECT\r\n\t\t\t\t\t$this->field_AccessOrg\r\n\t\t\t\tFROM\r\n\t\t\t\t\t$this->table_Name\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t$this->field_Account = $userId\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t\t$this->field_AccountType = $this->accountTypeUser\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t\t$this->field_Access = $rightId\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t\t$this->field_AccessType = $this->accessTypeRight\";\r\n\t\t\r\n\t\t$records = $this->db->Select($sql);\r\n\t\t\r\n\t\tif($orgId == -1)\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\t\tThe organization is supposed to be ignored, which means we need to check that\r\n\t\t\t\tthe user has the right, which means there is an explicit, user/right combination\r\n\t\t\t\tand we don't care what organization if any is assigned\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\tif(sizeof($records) > 0)\r\n\t\t\t{\r\n\t\t\t\treturn $this->results->Set('true', \"Access granted. (Not checking against organizations).\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\t\t-\tNow gather the list of rights which match this request.\r\n\t\t\t\t-\tWe're looking for username/right combinations.\r\n\t\t\t\t-\tFrom there we look through all of the organziations which may match this combination.\r\n\t\t\t\t-\tOne reason we're doing it this way is because someone could be assigned\r\n\t\t\t\t\tthe right from the parent and could be assigned from the child.\r\n\t\t\t\t\tIf the child is checked first and then the parent is not checked\r\n\t\t\t\t\twe could erroniously say the user doesn't have the right.\r\n\t\t\t\t-\tIf there's one record then the user has the right.\r\n\t\t\t\t\tIf no record is found, then the user does not have the right.\r\n\t\t\t*/\r\n\t\t\tfor($iOrgs = 0; $iOrgs < sizeof($records); $iOrgs++)\r\n\t\t\t{\r\n\t\t\t\tif($oOrganization->InChain($records[$iOrgs][$this->field_AccessOrg], $orgId))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn $this->results->Set('true', \"Access granted. Checking against organizations.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*\r\n\t\t\tNow check the user's groups.\r\n\t\t\tWe don't care about what the right id is for this, because\r\n\t\t\tthe right_id as it's used in the table now represents\r\n\t\t\ta group. Therefore, we look for all groups this\r\n\t\t\tuser has assigned to them, and then look in each group\r\n\t\t\tfor the rights assigned to that group.\r\n\t\t\tIf the right/org combo is found in the group, we return true.\r\n\t\t*/\r\n\t\tunset($records);\r\n\t\t\r\n\t\t$sql = \"SELECT\r\n\t\t\t\t\t$this->field_Access\r\n\t\t\t\tFROM\r\n\t\t\t\t\t$this->table_Name\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t$this->field_Account = $userId\r\n\t\t\t\t\tAND\r\n\t\t\t\t\t\t$this->field_AccessType = $this->accessTypeGroup\";\r\n\t\t\r\n\t\t$records = $this->db->Select($sql);\r\n\r\n\t\tfor($iGroup = 0; $iGroup < sizeof($records); $iGroup++)\r\n\t\t{\r\n\t\t\tif($oRightGroups->HasRight($records[$iGroup][$this->field_Access], $rightId, $orgId))\r\n\t\t\t{\r\n\t\t\t\treturn $this->results->Set('true', \"Access granted via right group.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t\tNow go through the user's organizations\r\n\t\t*/\r\n\t\r\n\t\tif($this->OrgHasRight($oUser->GetOrganization(), $rightId, $orgId))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$org = $oUser->GetOrganization();\r\n\t\t\r\n\t\tif(!is_numeric($right_info))\r\n\t\t{\r\n\t\t\t$rightName = $oRights->GetName($rightId);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$rightName = $right_info;\r\n\t\t}\r\n\t\t\r\n\t\t$userName = $oUser->GetName();\r\n\t\t\r\n\t\t$strReturnMessage = \"'$userName' is not assigned '$rightName'\";\r\n\t\t\r\n\t\tif($orgId > -1)\r\n\t\t{\r\n\t\t\t$strOrgName = $oOrganization->GetName($orgId);\r\n\t\t\t$strReturnMessage.=\" for '$strOrgName'\";\r\n\t\t}\r\n\r\n\t\t$strReturnMessage .= \".\";\r\n\t\t\r\n\t\treturn $this->results->Set('false', $strReturnMessage);\r\n\t}", "private function load_rights()\r\n {\r\n $this->rights[VIEW_RIGHT] = true;\r\n $this->rights[EDIT_RIGHT] = true;\r\n $this->rights[ADD_RIGHT] = true;\r\n $this->rights[DELETE_RIGHT] = true;\r\n //\t\t$user = $this->user;\r\n //\t\tif ($user != null)\r\n //\t\t{\r\n //\t\t\tif($user->is_platform_admin())\r\n //\t\t\t{\r\n //\t\t\t\t$this->rights[EDIT_RIGHT] = true;\r\n //\t\t\t\t$this->rights[ADD_RIGHT] = true;\r\n //\t\t\t\t$this->rights[DELETE_RIGHT] = true;\r\n //\t\t\t}\r\n //\t\t}\r\n return;\r\n }", "private function loadRoles()\r\n {\r\n $db = Sweia::getInstance()->getDB();\r\n\r\n $roles = $db->query(\"SELECT ur.rid, r.role FROM \" . SystemTables::DB_TBL_USER_ROLE . \" ur LEFT JOIN role r ON (r.rid = ur.rid) WHERE uid='$this->uid'\");\r\n while ($role = $db->fetchObject($roles))\r\n {\r\n $this->roles[$role->rid] = $role->role;\r\n }\r\n\r\n /* If the currently logged in user is this user, add the authenticated user role to this user */\r\n if (Session::loggedInUid() == $this->uid)\r\n {\r\n $this->roles[2] = \"authenticated\";\r\n }\r\n \r\n return $this->roles;\r\n }", "private function updateRolesCache() {\n\t\tif (is_null($this->userRolesArr))\n\t\t\t$this->userRolesArr = $this->SQL->getAllUserRoles();\n\t}", "function IsRead($module=NULL){\n if( empty($module)) $module = $this->module;\n //echo '<br> $this->userAccessRights['.$module.'][r]='. $this->userAccessRights[$module]['r'];\n if( isset($this->userAccessRights[$module]['r'])) return $this->userAccessRights[$module]['r'];\n else return false;\n }", "public static function & dynamicUserRights() {\r\n\t\tSecurity::readUserPermissions();\r\n\t\treturn Security::userRightsStorage();\r\n\t}", "function hasRight($db,$action,$col)\n {\n return $db->find(\"SELECT * FROM rights WHERE uid='\".$_SESSION['id'].\"' AND action='\".$action.\"' AND col= '\".$col.\"'\");\n }", "function get_rights($roleID) {\n global $ROLES;\n if (array_key_exists($roleID, $ROLES)) {\n return $ROLES[$roleID]['rights'];\n } else {\n return array();\n }\n}", "public function cachedRoles()\n {\n $userPrimaryKey = $this->primaryKey;\n $cacheKey = 'entrust_roles_for_user_' . $this->$userPrimaryKey;\n\n return Cache::rememberForever($cacheKey, function () {\n return $this->roles()->get();\n });\n }", "public function getUserRights(){\n\t\treturn $GLOBALS['db']->select(\"select * from user_rights order by id\");\t\n\t}", "protected function _initPermissions () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aPermissionListing = $oAclCache->load(self::CACHE_IDENTIFIER_PERMISSIONS)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Privileges from the Database\r\n\t\t\t$oDaoRoleResourcePrivilege = Kwgl_Db_Table::factory('System_Role_Resource_Privilege');\r\n\t\t\t//$aPermissionListing = $oDaoRoleResource->fetchAll();\r\n\t\t\t$aPermissionListing = $oDaoRoleResourcePrivilege->getPermissions();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aPermissionListing, self::CACHE_IDENTIFIER_PERMISSIONS);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aPermissionListing as $aPermissionDetail) {\r\n\t\t\t$sRoleName = $aPermissionDetail['role_name'];\r\n\t\t\t$sResourceName = $aPermissionDetail['resource_name'];\r\n\t\t\t$sPrivilegeName = null;\r\n\t\t\tif (!is_null($aPermissionDetail['privilege_name'])) {\r\n\t\t\t\t$sPrivilegeName = $aPermissionDetail['privilege_name'];\r\n\t\t\t}\r\n\t\t\t$sPermissionType = $aPermissionDetail['permission'];\r\n\r\n\t\t\t// Check the Permission to see if you should allow or deny the Resource/Privilege to the Role\r\n\t\t\tswitch ($sPermissionType) {\r\n\t\t\t\tcase self::PERMISSION_TYPE_ALLOW:\r\n\t\t\t\t\t$this->allow($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::PERMISSION_TYPE_DENY:\r\n\t\t\t\t\t$this->deny($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getRightForUser($user_id, $right);", "public function hasRightAny()\n{\n\tglobal $_SYSHCVOL;\n\t\n\t// Test if in the session cache it is allready said that the member has no right\n\tif ((isset($_SESSION['Param'])) and ($_SESSION['Param']->ReloadRightsAndFlags == 'Yes') and \n\t (isset($_SESSION['hasRightAny'])) and \n\t\t ($_SESSION['hasRightAny']=='no') ){\n\t\t \n\t\t return(false) ;\t\t \n\t} \n\n $A = new MOD_bw_user_Auth();\n if (!$A->isBWLoggedIn()) {\n return false;\n }\n \n $query = '\nSELECT SQL_CACHE Level\nFROM '.$this->nomtablevolunteer.'\nWHERE IdMember=' . $_SESSION['IdMember'];\n $qry = $this->dao->query($query);\n $row = $qry->fetch(PDB::FETCH_OBJ);\n if (!isset ($row->Level)) {\n\t \t $_SESSION[\"hasRightAny\"]=\"no\" ; // Put is session the info that the member has no right\n return false;\n }\n \n return true;\n}", "function getUsersWithUserRights() {\n\n $userRightsUsers = array();\n $allUsers = REDCap::getUsers();\n foreach($allUsers as $cnt => $user) {\n $rights = REDCap::getUserRights($user);\n if ($rights[$user][\"user_rights\"] == 1) {\n $userRightsUsers[] = $user;\n }\n }\n\n return $userRightsUsers;\n\n}", "function readAccessRights($module_id)\n\t\t{\n\t\t\tif(isset($this->mUserIdentity) && !empty($this->mUserIdentity))\n\t\t\t{\n\t\t\t\t$privileges = $this->mUserIdentity->getPrivileges();\n\t\t\t\t//echo \"<PRE>\";\n\t\t\t\t//print_r($privileges);\n\t\t\t\t//echo \"</PRE>\";\n\t\t\t\tforeach($privileges as $priv => $data_item)\n\t\t\t\t{\n\t\t\t\t\t//echo \"<PRE>\";\n\t\t\t\t\t//print_r($data_item);\n\t\t\t\t\t//echo \"</PRE>\";\n\t\t\t\t\t//echo \"<br>Priv = \".$priv.\" Module_id = \".$module_id;\n\t\t\t\t\tif($priv == $module_id) {\n\t\t\t\t\t\tif($data_item[\"read\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//echo\"<br>Sama -> read = \".$data_item[\"read\"];exit;\n\t\t\t\t\t\t\t$_SESSION['last_module'] =$module_id;\n\t\t\t\t\t\t\t//print_r($_SESSION['last_module']);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the [a_bot] column value.
public function getABot() { return $this->a_bot; }
[ "protected function get_db_column() {\r\n\t\treturn $this->get_column();\r\n\t}", "public function getBannedAtColumnName();", "public static function getAboutOurAim()\n {\n return self::where('setting', 'about_our_aim')->first()->value;\n }", "public function getColumn(): ?string\n {\n return $this->getHistoryUidsColumnName('bbn_active');\n }", "protected function getMetaValueColumn(Builder $builder)\n {\n if (count($builder->getQuery()->joins) > 0)\n return $builder->getModel()->getQualifiedMetaValueColumn();\n\n return $builder->getModel()->getMetaValueColumn();\n }", "function get_boton($boton_id)\r\n {\r\n $boton = $this->db->query(\"\r\n SELECT\r\n *\r\n\r\n FROM\r\n `boton`\r\n\r\n WHERE\r\n `boton_id` = ?\r\n \",array($boton_id))->row_array();\r\n\r\n return $boton;\r\n }", "public function get_column_value()\n {\n if ( isset( $this->properties['admin-column']['callback'] ) )\n {\n $id = \"{$this->namespace}-{$this->properties['slug']}\";\n $value = call_user_func( $this->properties['admin-column']['callback'], $id, $this->get_value() );\n }\n else\n {\n $value = $this->get_value();\n }\n return $value;\n }", "public function getTarget()\n\t{\n\t\t$column = self::COL_TARGET;\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}", "protected function getBotCommand() {\n return $this->_bot_command;\n }", "public function get_column_value()\n {\n return $this->properties['options'][$this->get_value()];\n }", "public function getBigb() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(1, $this->_result)) return (string) $this->_result[1];\n\t\t\telse parent::throwGetColException('Not set Nato3mcatItemsModel::getBigb', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From Nato3mcatItemsModel::getBigb', __LINE__, __FILE__);\n\t}", "public function getBotName()\n\t\t{\n\t\t\treturn $this->xmlItems[\"botName\"];\n\t\t}", "public function getBotName()\n {\n return $this->_botName;\n }", "public function getActiveColumn()\n {\n return defined('static::ACTIVE') ? static::ACTIVE : 'active';\n }", "public function getBoleta()\r\n {\r\n return $this->Boleta;\r\n }", "public function getAccess()\n\t{\n\t\t$column = self::COL_ACCESS;\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 getAchievement(): ?string\n {\n return $this->achievement;\n }", "public function getBot()\n {\n return $this->bot;\n }", "private function getBotName()\r\n\t\t{\r\n\r\n\t\t\t$crawlagent = \"\";\r\n\t\t\t#if(preg_match(\"/msnbot/i\", $_SERVER['HTTP_USER_AGENT']) == 1){\r\n\t\t\tif(preg_match(\"/bingbot/i\", $_SERVER['HTTP_USER_AGENT']) == 1){\r\n\t\t\t\t$crawlagent=\"msn\";\r\n\t\t\t}\r\n\t\t\tif(preg_match(\"/slurp/i\", $_SERVER['HTTP_USER_AGENT']) == 1){\r\n\t\t\t\t$crawlagent=\"yahoo\";\r\n\t\t\t}\r\n\t\t\tif(preg_match(\"/googlebot/i\", $_SERVER['HTTP_USER_AGENT']) == 1){\r\n\t\t\t\t$crawlagent=\"google\";\r\n\t\t\t}\r\n\t\t\tif(preg_match(\"/technoratibot/i\", $_SERVER['HTTP_USER_AGENT']) == 1){\r\n\t\t\t\t$crawlagent=\"technorati\";\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t\t//If not match, return empty\r\n\t\t\t\tif(!stristr($_SERVER['SCRIPT_NAME'], 'wp-admin'))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn 'google';\r\n\t\t\t\t}\r\n\t\t\t*/\r\n\r\n\t\t\treturn $crawlagent;\r\n\r\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a selector and a declaration list, creates the corresponding ruleset.
private static function to_ruleset( $selector, $declarations ) { if ( empty( $declarations ) ) { return ''; } $declaration_block = array_reduce( $declarations, function ( $carry, $element ) { return $carry .= $element['name'] . ': ' . $element['value'] . ';'; }, '' ); return $selector . '{' . $declaration_block . '}'; }
[ "protected static function to_ruleset($selector, $declarations)\n {\n }", "abstract public function buildFeedRuleSet() : RuleSet;", "public function compile(float $density): CssRulesetInterface\n {\n ($this->sourceSizeList instanceof SourceSizeListInterface) ?\n $this->compileForSourceSizes($density) :\n $this->compileForImageCandidates($density);\n\n return $this->cssRuleset;\n }", "public function makeRules()\n {\n $this->rules = [];\n preg_match_all(\"/([.#a-z0-9-]*)\\s?({[^}]*})/i\", $this->contents(), $comands);\n foreach ($comands[1] as $k => $selector) {\n preg_match_all(\"/([a-z0-9-]*):([^;]*);/i\", $comands[2][$k], $declarations);\n $this->rules[$selector] = [];\n foreach ($declarations[1] as $i => $property) {\n $this->rules[$selector][$property] = $declarations[2][$i];\n }\n }\n }", "private function PrepareRuleset( $env ) {\n\t\t// NOTE: Preserve distinction between null and empty array when compiling\n\t\t// $this->selectors to $selectors\n\t\t$thisSelectors = $this->selectors;\n\t\t$selectors = null;\n\t\t$hasOnePassingSelector = false;\n\n\t\tif ( $thisSelectors ) {\n\t\t\tLess_Tree_DefaultFunc::error( \"it is currently only allowed in parametric mixin guards,\" );\n\n\t\t\t$selectors = [];\n\t\t\tforeach ( $thisSelectors as $s ) {\n\t\t\t\t$selector = $s->compile( $env );\n\t\t\t\t$selectors[] = $selector;\n\t\t\t\tif ( $selector->evaldCondition ) {\n\t\t\t\t\t$hasOnePassingSelector = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tLess_Tree_DefaultFunc::reset();\n\t\t} else {\n\t\t\t$hasOnePassingSelector = true;\n\t\t}\n\n\t\tif ( $this->rules && $hasOnePassingSelector ) {\n\t\t\t// Copy the array (no need for slice in PHP)\n\t\t\t$rules = $this->rules;\n\t\t} else {\n\t\t\t$rules = [];\n\t\t}\n\n\t\t$ruleset = new self( $selectors, $rules, $this->strictImports );\n\n\t\t$ruleset->originalRuleset = $this->ruleset_id;\n\t\t$ruleset->root = $this->root;\n\t\t$ruleset->firstRoot = $this->firstRoot;\n\t\t$ruleset->allowImports = $this->allowImports;\n\n\t\t// push the current ruleset to the frames stack\n\t\t$env->unshiftFrame( $ruleset );\n\n\t\t// Evaluate imports\n\t\tif ( $ruleset->root || $ruleset->allowImports || !$ruleset->strictImports ) {\n\t\t\t$ruleset->evalImports( $env );\n\t\t}\n\n\t\treturn $ruleset;\n\t}", "public function create()\n {\n $args = func_get_args();\n $argno = func_num_args();\n switch (true) {\n case ($argno == 1 && is_array($args[0])):\n return $this->createSelectorFrom($args[0]);\n break;\n case ($argno == 2 && is_string($args[0]) && is_string($args[1])):\n return $this->createSelector($args[0], $argno[1]);\n break;\n default:\n throw new InvalidSelectorDeclarationException(\"Invalid SelectorFactory::create call, expected array or string.\");\n }\n }", "public function buildRuleSet(array $data)\n {\n $ruleSet = new RuleSet;\n\n if (isset($data['identifier'])) {\n $ruleSet->setIdentifier($data['identifier']);\n }\n\n // Build the rule\n if (isset($data['rule'])) {\n $ruleSet->setRule($this->buildRule($data['rule']));\n }\n\n // Loop over each result and build that too\n if (isset($data['result'])) {\n foreach ($data['result'] as $result) {\n $ruleSet->addResult($this->buildResult($result));\n }\n }\n\n return $ruleSet;\n }", "abstract protected function setRuleList():void;", "function smd_ebook_style_rules($ruleset, $prepend = '')\n{\n $result = array();\n\n foreach ($ruleset[0] as $i => $x) {\n $selector = trim($ruleset[1][$i]);\n $rules_arr = array();\n $rules = explode(';', trim($ruleset[2][$i]));\n\n foreach ($rules as $strRule) {\n if (!empty($strRule)) {\n $rule = explode(':', $strRule);\n $rules_arr[trim($rule[0])] = trim($rule[1]);\n }\n }\n\n $selectors = explode(',', trim($selector));\n\n foreach ($selectors as $strSel) {\n $combined = $prepend.$strSel;\n $result[$combined] = $rules_arr;\n }\n }\n\n return $result;\n}", "public function create($selector, array $styles) {\n global $USER;\n $this->id = null;\n $this->selector = $selector;\n $this->timemodified = time();\n $this->userid = $USER->id;\n $this->styles = css_theme_tool_style::create_for_rule($this, $styles);\n }", "public function create($strategy, $selector, array $rules = [ ], array $options = [ ]);", "public function filter($selector)\n {\n if (is_string($selector)) {\n $selector = new Selector($selector);\n }\n\n $list = new NodeList($this->_node);\n\n foreach ($this as $node) {\n if ($node->matches($selector)) {\n $list->add($node);\n }\n }\n return $list;\n }", "public function addRuleset($set);", "protected function createRule()\n {\n foreach ($this->rules as $controller => $rule) {\n foreach ($rule as $singleRule) {\n if (is_array($singleRule)) {\n $option = [\n 'controllers' => [ $controller ],\n 'class' => 'yii\\filters\\AccessRule',\n ];\n $this->ruleList[] = Yii::createObject(array_merge($option, $singleRule));\n }\n }\n }\n }", "public function testCreateRuleSetWithSpecifiedPrioritiesOnlyContainsMatchingRules()\n {\n self::changeWorkingDirectory();\n\n $factory = new RuleSetFactory();\n $factory->setMinimumPriority(2);\n $factory->setMaximumPriority(2);\n\n $ruleSet = $factory->createSingleRuleSet('set1');\n $this->assertCount(0, $ruleSet->getRules());\n }", "function Xtest_RuleSet2() {\r\n\r\n\t\t// Later date. NamespaceAware not yet implemented\r\n\r\n\t\t#$digester\t\t= $this->digester;\r\n\t\t#$this->xmlFile\t= 'Test1.xml';\r\n\t\t#\r\n\t\t#// XML parser case folding - False leaves case unchanged\r\n\t\t#$digester->parserSetOption(XML_OPTION_CASE_FOLDING, \r\n\t\t#\t\t\t\t\t\t\t\t\t\t$this->parserCaseFolding);\r\n\t\t#\r\n\t\t#// Configure the digester as required\r\n\t\t#$digester->setNamespaceAware(True);\r\n\t\t#$rs = new TestRuleSet(NULL, \"http://jakarta.apache.org/digester/Foo\");\r\n\t\t#$digester->addRuleSet($rs);\r\n\r\n\t}", "public function addSelectors($selector) {\n\t\t$this->selectors[] = $selector;\n\t}", "public function organise_rules_by_selectors() {\n $optimised = array();\n $beforecount = count($this->rules);\n foreach ($this->rules as $rule) {\n $hash = $rule->get_style_hash();\n if (!array_key_exists($hash, $optimised)) {\n $optimised[$hash] = clone($rule);\n } else {\n foreach ($rule->get_selectors() as $selector) {\n $optimised[$hash]->add_selector($selector);\n }\n }\n }\n $this->rules = $optimised;\n $aftercount = count($this->rules);\n return ($beforecount < $aftercount);\n }", "public function testBuildPatternListByStatement()\n {\n $statement = new StatementImpl(\n new NamedNodeImpl(new RdfHelpers(), 'http://a'),\n new NamedNodeImpl(new RdfHelpers(), 'http://b'),\n new NamedNodeImpl(new RdfHelpers(), 'http://c')\n );\n\n $this->assertEquals(\n array(\n\n // graphUri_*_*_*\n 'http://localhost/Saft/TestGraph/'. $this->separator .'*'. $this->separator .'*'. $this->separator .'*',\n\n /**\n * 1 place set: graphUri_http://a_*_*\n */\n 'http://localhost/Saft/TestGraph/'. $this->separator .'http://a'. $this->separator .\n '*'. $this->separator .'*',\n 'http://localhost/Saft/TestGraph/'. $this->separator .'*'. $this->separator .'http://b'.\n $this->separator .'*',\n 'http://localhost/Saft/TestGraph/'. $this->separator .'*'. $this->separator .'*'.\n $this->separator .'http://c',\n\n /**\n * 2 places set: graphUri_http://a_http://b_*\n */\n 'http://localhost/Saft/TestGraph/'. $this->separator .'http://a'. $this->separator .'http://b'.\n $this->separator .'*',\n 'http://localhost/Saft/TestGraph/'. $this->separator .'http://a'. $this->separator .'*'.\n $this->separator .'http://c',\n 'http://localhost/Saft/TestGraph/'. $this->separator .'*'. $this->separator .'http://b'.\n $this->separator .'http://c',\n\n /**\n * all 3 places set\n */\n 'http://localhost/Saft/TestGraph/'. $this->separator .'http://a'. $this->separator .'http://b'.\n $this->separator .'http://c',\n ),\n $this->fixture->buildPatternListByStatement($statement, $this->testGraph->getUri())\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns count of '_heroes' list
public function getHeroesCount() { return $this->count(self::_HEROES); }
[ "public function getHeroesCount()\r\n {\r\n return $this->count(self::_HEROES);\r\n }", "public function getHeroesCount()\n {\n return $this->count(self::HEROES);\n }", "public function getHeroCount()\n {\n return $this->count(self::HERO);\n }", "public function getOppoHeroesCount()\r\n {\r\n return $this->count(self::_OPPO_HEROES);\r\n }", "public function getOppoHeroesCount()\n {\n return $this->count(self::_OPPO_HEROES);\n }", "public function getStHeroIdListCount()\n {\n return $this->count(self::STHEROIDLIST);\n }", "public function getSelfHeroesCount()\r\n {\r\n return $this->count(self::_SELF_HEROES);\r\n }", "public function getSelfGvgHeroesCount()\r\n {\r\n return $this->count(self::_SELF_GVG_HEROES);\r\n }", "public function getSelfHeroesCount()\n {\n return $this->count(self::_SELF_HEROES);\n }", "public function getHeroBasesCount()\n {\n return $this->count(self::_HERO_BASES);\n }", "public function getHeroDynasCount()\n {\n return $this->count(self::_HERO_DYNAS);\n }", "public function count()\n {\n return count($this->houses);\n }", "public function getStHeroFormInfosCount()\n {\n return $this->count(self::STHEROFORMINFOS);\n }", "public function getAgentsCount()\n {\n return $this->count(self::AGENTS);\n }", "public function getStCashPurpleHeroRecordCount()\n {\n return $this->count(self::STCASHPURPLEHERORECORD);\n }", "public function count() {\n return $this->m_nBots;\n }", "public static function countShots(): int\n {\n return self::getGrid()->getShotsFired();\n }", "public function getCount(){\r\n return count($this->players);\r\n }", "public function count()\n {\n return count($this->players);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that when no style is passed in, the interpolator will correctly interpolate a string using the default style.
public function it_should_be_able_to_interpolate_a_string_using_the_default_style() { $input = '/system/:class/:attachment/:id/:style/:filename'; $interpolatedString = $this->interpolator->interpolate($input, $this->attachment); $this->assertEquals('/system/TestModel/photos/1/original/test.jpg', $interpolatedString); }
[ "public function testInterpolateString($input, $expectedOutput, $style)\n {\n $this->testModel->id = 1;\n $this->testModel->testing_file_name = 'test.jpg';\n $method = $this->makeMethodPublic('interpolate_string');\n $actualOutput = $method->invokeArgs($this->testModel, ['testing', $input, $style]);\n\n $this->assertEquals($expectedOutput, $actualOutput);\n }", "public function interpolate($interpolate){}", "public function supportHelperHelperStrInterpolateInvoke(UnitTester $I, Example $example)\n {\n $I->wantToTest('Support\\Helper\\Str\\Interpolate - invoke - ' . $example[0]);\n\n $expected = $example[1];\n $format = $example[2];\n $context = $example[3];\n $actual = (new Interpolate())($format, $context);\n $I->assertSame($expected, $actual);\n }", "public function loggerFormatterLineInterpolateEmpty(UnitTester $I)\n {\n $I->wantToTest('Logger\\Formatter\\Line - interpolate() - empty');\n $formatter = new Line();\n\n $message = 'The sky is {color}';\n $context = [];\n\n $expected = 'The sky is {color}';\n $actual = $formatter->interpolate($message, $context);\n $I->assertEquals($expected, $actual);\n }", "public function testInterpolateString()\n {\n $raw_message = '{key} is a key';\n $replacements = ['key' => 'value',];\n $expected_message = 'value is a key';\n $exception = new TerminusException($raw_message, $replacements);\n\n $out = $exception->getMessage();\n $this->assertEquals($out, $expected_message);\n }", "public function format($string, Style $style = null);", "abstract protected function styleRuleSelector(): Interpolation;", "public function interpolate($factory){}", "protected function interpolate($message, $context = array()) {}", "public function testEmptyTranslationString(): void\n {\n I18n::setDefaultFormatter('sprintf');\n $result = __('No translation needed');\n $this->assertSame('No translation needed', $result);\n }", "function interpolate($magicstr, $vars = array()) {\n if($GLOBALS[\"_I18n_isDebug\"]) print(\"interpolate($magicstr, $vars)\\n\");\n if($GLOBALS[\"_I18n_isStub\"]) return \"I18n interpolate stub\";\n\n return i18n_interpolate($this->handle, $magicstr, $vars);\n }", "public function it_should_be_able_to_interpolate_a_string_using_an_id_partition()\n {\n $input = '/system/:class/:attachment/:id_partition/:style/:filename';\n \n $interpolatedString = $this->interpolator->interpolate($input, $this->attachment, 'thumbnail');\n\n $this->assertEquals('/system/TestModel/photos/000/000/001/thumbnail/test.jpg', $interpolatedString);\n }", "public function it_should_be_able_to_accept_a_string_value()\n {\n $styleValue = '50x50';\n\n $styleOjbect = new Style('foo', $styleValue);\n\n $this->assertEquals('50x50', $styleOjbect->dimensions);\n }", "public function testStringInterpolationNotNamed(): void\n {\n $query = new LoggedQuery();\n $query->setContext([\n 'driver' => $this->driver,\n 'query' => 'SELECT a FROM b where a = ? AND b = ? AND c = ? AND d = ? AND e = ? AND f = ?',\n 'params' => ['string', '3', null, true, false, 0],\n ]);\n\n $expected = \"SELECT a FROM b where a = 'string' AND b = '3' AND c = NULL AND d = $this->true AND e = $this->false AND f = 0\";\n $this->assertSame($expected, (string)$query);\n }", "public function testGetStyle()\n\t{\n\t\t$this->assertThat(\n\t\t\t$this->instance->getStyle(),\n\t\t\t$this->equalTo('31;47;5')\n\t\t);\n\t}", "public function testUnknownFormatter()\n {\n $this->registry->get('hello');\n }", "public function testFormattingMissingStyleName(): void\n {\n $this->output->expects($this->once())->method('_write')\n ->with('<not_there>Error:</not_there> Something bad');\n\n $this->output->write('<not_there>Error:</not_there> Something bad', 0);\n }", "#[@test]\n function formatWithOneArgument() {\n $this->invoke('format', array('Needs no formatting'));\n }", "function interpolate($message, array $context = array()) {\n\t// build a replacement array with braces around the context keys\n\t$replace = array();\n\tforeach ($context as $key => $val) {\n\t\t$replace['{' . $key . '}'] = $val;\n\t}\n\t// interpolate replacement values into the message and return\n\treturn strtr($message, $replace);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
///////////////////// PROTECTED METHODS // ///////////////////// Create the offset account based on this account
protected function createOffsetAccount(Account $account) { return (new static) ->forUser($account->user_id) ->ofType($this->getOffsetAccountType($account)) ->named($account->name) ->create(false); }
[ "public function create($shouldCreateOffsetAccount = false)\n {\n // Localize Account Class\n $AccountClass = $this->AccountClass;\n\n // Create the account\n $account = $AccountClass::create($this->attributes);\n\n // Record the opening balance\n $this->recordOpeningBalance($account);\n\n // Just return the account if we shouldn't\n // create the offset account\n if (! $shouldCreateOffsetAccount ) {\n return $account;\n }\n\n // Create the offset account\n $offsetAccount = $this->createOffsetAccount($account);\n\n // Associate the new account with its offset account\n $this->associateAccounts($account, $offsetAccount);\n\n // Return the account\n return $account;\n }", "public function createWallet($account);", "public function createAccount()\n {\n try {\n [\n 'privateKey' => $this->secret,\n 'address' => $this->address\n ] = $this->tron->createAccount(); //destructing the result into variables\n \n self::create([\n 'address' => $this->address,\n 'secret' => $this->secret\n ]);\n } catch (\\IEXBase\\TronAPI\\Exception\\TronException $e) {\n throw $e;\n }\n\n return $this;\n }", "public function createNewAccount()\n {\n return new Account($this->generateUniquePaymentRef());\n }", "public function create(): Account;", "public function newAccount()\n {\n return new Account();\n }", "function buildAccountFromOffice(AbstractAccount $account, Office $office);", "protected function generateAccount(): Account\n\t{\n\t\t// Generate a random UID\n\t\t$uid = $this->generateUid();\n\n\t\t// Start the entity\n\t\t$account = new Account(get_class(self::$faker), $uid);\n\t\t\n\t\t// Populate the fields\n\t\t$account->id = $uid;\n\t\t$account->name = self::$faker->name;\n\t\t$account->username = self::$faker->userName;\n\t\t$account->email = self::$faker->email;\n\t\t$account->phone = self::$faker->e164PhoneNumber;\n\t\t\n\t\treturn $account;\n\t}", "public function account() \n\t{\n\t\tif (!isset($this->account)) {\n\t\t\t$this->account = new \\Zamzar\\Account($this->getConfig());\n\t\t}\n\t\treturn $this->account;\t\t\n\t}", "protected function _createAccount() {\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_password)) return;\n\t\tif(!check($this->_email)) return;\n\t\t\n\t\t$lastAccountId = $this->_getLastAccountId();\n\t\tif(!$lastAccountId) return;\n\t\t\n\t\t$accountId = $lastAccountId+1;\n\t\t\n\t\t$passwordHash = $this->_encryptPassword($this->_password);\n\t\tif(!check($passwordHash)) return;\n\t\t\n\t\t$registrationDate = round(microtime(true) * 1000);\n\t\t\n\t\t$newAccountData = array(\n\t\t\t'_id' => $accountId,\n\t\t\t'accountName' => $this->_username,\n\t\t\t'email' => $this->_email,\n\t\t\t'password' => $passwordHash,\n\t\t\t'pin' => '000001',\n\t\t\t'family' => '',\n\t\t\t'accessLvl' => 0,\n\t\t\t'characterSlots' => 0,\n\t\t\t'cash' => 0,\n\t\t\t'confirmationHash' => '',\n\t\t\t'changePasswordHash' => '',\n\t\t\t'registrationDate' => $registrationDate,\n\t\t);\n\t\t\n\t\ttry {\n\t\t\t$this->db->loginserver->accounts->insertOne($newAccountData);\n\t\t\treturn true;\n\t\t} catch(Exception $ex) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function generate_account_no();", "private function createAccountWithBalance()\n {\n if ($this->managedAccount === null) {\n self::authorizeFromEnv();\n $account = self::createTestManagedAccount();\n\n $charge = \\Stripe\\Charge::create(array(\n 'currency' => 'usd',\n 'amount' => '10000',\n 'source' => 'tok_bypassPending',\n 'destination' => array(\n 'account' => $account->id\n )\n ));\n\n $this->managedAccount = $account;\n }\n\n return $this->managedAccount;\n }", "private function _createAccountFromObj($accountObj) {\n\t\t$account = new Account();\n\t\t$account->fromDatabaseObj($accountObj);\n\t\treturn $account;\n\t}", "public function getAccount(): Account {\n static::$accounts[] = $account = Account::create(\"Dummy\", \"Dummy\");\n return $account;\n }", "public function createErcAddress() {\n\n // Get new wallet address\n $wallet = $this->request('node/wallet/store', ['type' => 'erc']);\n\n // If new wallet created return wallet\n return $wallet;\n }", "public function createAccount($number)\n {\n return parent::createAccount($number);\n }", "public function account()\n {\n return new Resources\\Account($this->request, $this->settings);\n }", "function newAccount(){\n\t\t\t\tglobal $driver;\n\t\t\t\t$sql = \"SELECT acnumber FROM clients ORDER BY id DESC LIMIT 0,1\"; //Retrieve the latest account number from clients table\n\t\t\t\tif($results\t= $driver->perform_request($sql)):\n\t\t\t\t\t$row\t\t=\t$driver->load_data($results,MYSQL_ASSOC);\n\t\t\t\t\t$account\t=\t$row['acnumber'];\n\t\t\t\t\t$newac\t\t=\t$account+1;\n\t\t\t\t\t\tswitch($newac):\n\t\t\t\t\t\t\tCASE $newac < 10:\n\t\t\t\t\t\t\t$newac\t=\t'000'.$newac;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tCASE $newac>=10 && $newac<100:\n\t\t\t\t\t\t\t$newac\t=\t'00'.$newac;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tCASE $newac>=100 && $newac<1000:\n\t\t\t\t\t\t\t$newac\t=\t'0'.$newac;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$newac\t=\t$newac+1;\n\t\t\t\t\t\tendswitch;\n\t\t\t\t\telse: \n\t\t\t\t\t\tdie('<p class=\"error\">Failed to generate New ACC/No: <br/>'.mysql_error().'</p>');\n\t\t\t\t\tendif;\n\t\t\treturn $newac; //The generated account number\n}", "public static function generateAccountN0(){\n $year = '20'.date('y');\n $accounts = User::count();\n return $year.($accounts + 1 ) ;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Test an existing asset can be permanently deleted
public function test_an_asset_can_be_permanently_deleted() { $school = factory(School::class)->create(); $category = factory(Category::class)->create(); $type = factory(Type::class)->create(); $asset = factory(Asset::class)->create([ 'school_id' => $school->id, 'tag' => '98765', 'name' => 'Test Asset Deleted' ]); $asset->forceDelete($asset->id); $this->assertDatabaseMissing('assets', [ 'id' => $asset->id, 'tag' => '98765', 'name' => 'Test Asset Deleted' ]); }
[ "public function testDeleteAsset()\n {\n }", "public function test_an_asset_can_be_soft_deleted()\n\t{\n\t\t$school = factory(School::class)->create();\n\t\t$category = factory(Category::class)->create();\n\t\t$type = factory(Type::class)->create();\n\t\t$asset = factory(Asset::class)->create([\n\t\t\t'school_id' => $school->id,\n\t\t\t'tag' => '98765',\n\t\t\t'name' => 'Test Asset Deleted'\n\t\t]);\n\n\t\t$asset->destroy($asset->id);\n\n\t\t$this->assertSoftDeleted($asset);\n\t}", "public function testDestroyAsset()\n {\n // 1. Create mock\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->delete(route('asset.destroy', $this->asset));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_NO_CONTENT);\n }", "public function testAssetServerDeleteSecurityEntry()\r\n {\r\n\r\n }", "public function testDeleteAsset()\n {\n $service = $this->getMockedService($this->getMockedQueue(new ContentfulDeleteAssetJob('some ID')));\n $service->deleteAsset('some ID');\n }", "public function testResourcesCanBeDeleted()\n {\n $admin = factory(User::class)->states('admin')->create();\n $resource = factory(Resource::class)->create();\n\n $response = $this->actingAs($admin)->delete('resources/'.$resource->id);\n\n $response->assertRedirect('/resources');\n $this->assertDatabaseMissing('resources', [\n 'name' => $resource->name,\n ]);\n }", "public function testDeleteBundleItem()\n {\n }", "public function deleteAssets()\n {\n \n }", "public function test_a_finance_record_can_be_permanently_deleted()\n\t{\n\t\t$school = factory(School::class)->create();\n\t\t$category = factory(Category::class)->create();\n\t\t$type = factory(Type::class)->create();\n\t\t$asset = factory(Asset::class)->create();\n\t\t$finance = factory(Finance::class)->create(['asset_id' => $asset->id]);\n\n\t\t$finance->forceDelete($finance->id);\n\n\t\t$this->assertDatabaseMissing('finances', [\n\t\t\t'id' => $finance->id,\n\t\t\t'asset_id' => $finance->asset_id,\n\t\t]);\n\t}", "public function testInventoryItemDelete()\n {\n $user = User::all()->random();\n\n $this->actingAs($user, 'api')\n ->delete(\"api/inventoryitem/2\");\n $this->seeStatusCode(200);\n }", "public function testInventoryItemDeleteNotExisting()\n {\n $user = User::all()->random();\n\n $this->actingAs($user, 'api')\n ->delete(\"api/inventoryitem/999999\");\n $this->seeStatusCode(404);\n }", "public function testDeleteExternal1()\n {\n }", "public function testSavedDeleteItem()\n {\n \n }", "public function testDeleteQuickAdjustmentFile()\n {\n }", "public function testDeleteProductionModelFile()\n {\n }", "public function preDeleteAsset(Asset $asset)\n {\n\n }", "public function testDeleteOfDeleted()\n {\n $file = new P4_File;\n $file->setFilespec('//depot/foo')\n ->setLocalContents('one')\n ->add()\n ->submit('one');\n\n $file->edit()\n ->setLocalContents('two')\n ->submit('two');\n\n $file->delete()\n ->submit('three');\n\n $file = P4_File::fetch('//depot/foo#1');\n\n // should throw.\n $file->sync()->delete();\n }", "abstract public function supportsDeleting();", "public function testDeleteRemovesStorages()\n {\n file_put_contents(self::$temp . DS . 'file1.txt', 'Hello World');\n\n Storage::delete(self::$temp . DS . 'file1.txt');\n $this->assertTrue(!is_file(self::$temp . DS . 'file1.txt'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
\brief return true for xs:boolean
private function xs_true($xs_bool) { return ($xs_bool == '1' || strtoupper($xs_bool) == 'TRUE'); }
[ "public static function booleans()\n {\n return self::elements(false, true);\n }", "public function getBool_valid_type()\n {\n $data = array(\n 'success' => true,\n );\n\n $xPathArray = new XPathArray('/', $data);\n\n /** @var string $value */\n $value = $xPathArray->getBool('success');\n\n $this->assertInternalType(\"bool\", $value);\n }", "public function toBoolean(): bool;", "function pseudoTypeTrue(): true {}", "public function getBoolean( $attr );", "public function is_boolean()\n\t{\n\t\treturn ($this->get_type()=='tinyint') AND ($this->get_size()==1);\n\t}", "function is_bool ($var) {}", "function isTrue($value): bool\n{\n return is_bool($value) && $value === true;\n}", "function is_bool($var) {}", "public function isBool(): bool\n {\n return $this->type == self::ST_BOOL;\n }", "public function toBoolean(): \\PHPStan\\Type\\BooleanType\n\t{\n\t}", "public function isBoolean(): bool\n {\n return \\is_bool($this->value);\n }", "public function boolean(): BooleanType\n {\n return Type::boolean();\n }", "function isBool(): Predicate\n{\n return isOfType('bool');\n}", "#[@test]\n public function toTrue() {\n $this->assertTrue($this->newInstance('{ public bool $flag= true; }')->flag);\n }", "public function isBool()\n {\n \n return ($this instanceof BoolWrapper);\n \n }", "function is_true($value) {\r\n\treturn (($value === true) || ($value === 1) || ($value === \"1\") || ($value === \"true\"));\r\n}", "public function shortcode_atts_boolean( $att ) {\n\n if ( $att === 'true' || absint( $att ) ) {\n $att_val = 1;\n } else {\n $att_val = 0;\n }\n\n return $att_val;\n }", "public function readBool(): bool;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created TransferM in storage.
public function store(CreateTransferMRequest $request) { $input = $request->all(); $transferM = $this->transferMRepository->create($input); Flash::success('El Traslado/Movimiento se ha guardado exitosamente.'); return redirect(route('transferMs.index')); }
[ "public function store(CreateTransferMAPIRequest $request)\n {\n $input = $request->all();\n\n $transferM = $this->transferMRepository->create($input);\n\n return $this->sendResponse($transferM->toArray(), 'Transfer M saved successfully');\n }", "public function store()\n\t{\n\t\t$this->transaction->save(Input::all());\n\t}", "public function store(StoreTransfersRequest $request)\n {\n if (! Gate::allows('transfer_create')) {\n return prepareBlockUserMessage();\n }\n \n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n }\n $transfer = Transfer::create($request->all());\n\n \\App\\Account::find($request->from_id)->decrement('initial_balance', $request->amount);\n \\App\\Account::find( $request->to_id )->increment('initial_balance', $request->amount);\n\n flashMessage( 'success', 'create', trans('custom.transfers.amount-transfered'));\n\n return redirect()->route('admin.transfers.index');\n }", "private function store()\n {\n $settings = [];\n foreach ($this->settings as $key => $value) {\n $settings[$key] = serialize($value);\n }\n $this->files->put($this->filepath, json_encode($settings));\n }", "public function persist();", "public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}", "function store(){\r\n\t\t//store to file\r\n\t}", "protected function persist()\n\t{\n\t\t$saveData = [];\n\t\t// remove id\n\t\tforeach ($this->neonData as $key=>$value) {\n\t\t\tif (isset($this->neonData[$key][\"id\"])) {\n\t\t\t\t$id = $this->neonData[$key][\"id\"];\n\t\t\t\tunset($value[\"id\"]);\n\t\t\t} else {\n\t\t\t\t$id = Uuid::generate(4);\n\t\t\t}\n\n\t\t\t$saveData[$id] = $value;\n\t\t}\n\t\t$data = $this->neon->encode($saveData, Nette\\Neon\\Encoder::BLOCK);\n\t\tfile_put_contents($this->neonFile, $data);\n\t}", "public function createStorage();", "public function saveTransaction()\n {\n $transaction = new Transaction();\n $transaction->request_type = 'transaction';\n $transaction->unique_id = $this->id;\n $transaction->orderid = $this->uatPrefix . $this->reference;\n $transaction->response_format = $this->responseFormat;\n $transaction->request_payload = $this->list()->toJson();\n $transaction->save();\n }", "public function store(UploadDescriptor $descriptor);", "public function persist()\n {\n $this->state = $this->newState;\n }", "public function saveTransaction()\n {\n $transaction = Transaction::where('request_type', 'mandate_token')->where(['unique_id' => $this->id])->firstOrNew();\n\n $transaction->request_type = 'mandate_token';\n $transaction->unique_id = $this->id;\n $transaction->orderid = $this->subscription_reference;\n $transaction->response_format = $this->responseFormat ?? 'HTML';\n $transaction->request_payload = $this->list()->toJson();\n\n if (isset($this->response)) {\n $transaction->request_payload = collect($this->response)->toJson();\n }\n\n $transaction->save();\n }", "public function save() {\n $transaction = $this->transaction;\n $transaction->changed = REQUEST_TIME;\n\n $transaction_array = array(\n 'transaction_id' => $transaction->transactionId,\n 'uid' => $transaction->uid,\n 'cashier' => $transaction->cashier,\n 'order_id' => $transaction->orderId,\n 'type' => $transaction->type,\n 'data' => $transaction->data,\n 'register_id' => $transaction->registerId,\n 'changed' => $transaction->changed,\n 'created' => $transaction->created,\n 'completed' => $transaction->completed,\n );\n\n if ($transaction->transactionId) {\n $primary_keys = 'transaction_id';\n }\n else {\n $primary_keys = array();\n }\n\n drupal_write_record($transaction::TABLE_NAME, $transaction_array, $primary_keys);\n $transaction->transactionId = $transaction_array['transaction_id'];\n unset($transaction_array);\n }", "private function store() {\n\n\t\tforeach ($this->filesToStore as $fileToStore) {\n\t\t\t$storedFile = null;\n\n\t\t\t$title = strtoupper($fileToStore['type']) . \"-\" . $fileToStore['host'] . \"-\" . $fileToStore['file_name'];\n\t\t\t$name = strtoupper($fileToStore['type']) . \"-\" . $fileToStore['host'] . \"-\" . $fileToStore['backup_name'];\n\t\t\t$description = strtoupper($fileToStore['type']) . \" on \" . $fileToStore['host'] . \" backup file\";\n\n\t\t\t//store files to remote storage or local\n\t\t\tforeach ($this->storages as $storage) {\n\n\t\t\t\t//store it to google drive\n\t\t\t\tif (isset($storage['type']) && $storage['type'] == strtolower('gdrive')) {\n\n\t\t\t\t\t$drive = new MaratusGoogleDrive($storage);\n\n\t\t\t\t\t$storedFile = $drive->store($fileToStore['file_path'], $title, $description);\n\n\t\t\t\t}\n\t\t\t\t//store it to dropbox\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('dropbox')) {\n\n\t\t\t\t\t$dBox = new MaratusDropbox($storage);\n\n\t\t\t\t\t$storedFile = $dBox->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it to copy.com\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('copy')) {\n\n\t\t\t\t\t$copy = new MaratusCopy($storage);\n\n\t\t\t\t\t$storedFile = $copy->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it to local place\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('local')) {\n\n\t\t\t\t\t$localStorage = new MaratusLocalStorage($storage);\n\n\t\t\t\t\t$storedFile = $localStorage->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it on ftp server\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('ftp')) {\n\n\t\t\t\t\t$localStorage = new MaratusFtp($storage);\n\n\t\t\t\t\t$storedFile = $localStorage->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\n\t\t\t\t//add result\n\t\t\t\t$this->filesStored[] = array(\n\t\t\t\t\t'type' => $storage['type'],\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'file_name' => $title,\n\t\t\t\t\t'description' => $description,\n\t\t\t\t\t'storege_result' => is_object($storedFile) ? (array) $storedFile : $storedFile,\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Remove backup file from disk\n\t\t\t */\n\t\t\t$filesystem = new Filesystem();\n\t\t\t$filesystem->remove($fileToStore['file_path']);\n\t\t}\n\t}", "public function store(Createtipo_mantenimientoRequest $request)\n {\n $input = $request->all();\n\n $tipoMantenimiento = $this->tipoMantenimientoRepository->create($input);\n\n Flash::success('El tipo de mantenimiento se guardo correctamente .');\n\n return redirect(route('tipoMantenimientos.index'));\n }", "public function store(CreatetrimestreRequest $request)\n {\n $input = $request->all();\n\n $trimestre = $this->trimestreRepository->create($input);\n\n Flash::success('Trimestre saved successfully.');\n\n return redirect(route('trimestres.index'));\n }", "private function saveData()\n {\n $this->storageAdapter->save($this->serviceName, json_encode($this->toArray()));\n }", "protected function persist() {\n file_put_contents($this->file, json_encode($this->progress));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update user last activity time
function update_last_activity() { $update = new ElUser; $update->update_last_activity(); }
[ "public function updateLastActivityTime(){\n\t\t$data = array(\n\t\t\t'last_activity_time' => $this->getCurrentTime()\n );\n\t\t$this->db->where('username', $this->session->userdata('username'));\n\t\t$this->db->update('users', $data); \n\t}", "public static function UpdateLastActivity()\n {\n if (!self::$user) {\n return;\n }\n\n $q = DB()->prepare(\"\n\t\t\tUPDATE \" . setting('db_prefix') . \"users\n\n\t\t\tSET\n\t\t\tlast_activity=?,\n\t\t\tlast_ip=?\n\n\t\t\tWHERE\n\t\t\tuid=?\n\t\t\t;\n\t\t\");\n\n $q->execute([\n time(),\n $_SERVER['REMOTE_ADDR'],\n self::$user->uid\n ]);\n }", "function lastActivityRightNow()\n{\n\tglobal $globals, $time, $user;\n\t\n\t$now = round($time->start);\n\t\n\t$q = \"UPDATE `users` SET `last_activity`= $now WHERE `uid` = $user[uid]\";\n\t$updateLastActivity = db_query($q);\n}", "private function setActivity()\n {\n $this->db->query(\"\n UPDATE\n `public_users`\n SET\n `last_activity` = NOW(),\n `online` = '1'\n WHERE\n `id` = '\" . $this->user['data']['id'] . \"'\n \");\n }", "public function updateLastLoggedAt()\n {\n $user = Auth::user();\n $user->last_logged_at = Carbon::now();\n $user->save();\n }", "public function updateLastActivity() {\n\t\tif ( !$this->stat ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->stat->last_activity = date('Y-m-d H:i:s');\n\t\t$this->stat->save();\n\t}", "public function updateUserLastAccess()\n {\n $user = Doctrine::getTable('User')->find($this->getUserId());\n if ($user)\n {\n // not using the date formatter because this method can be called before the formatter exists\n $user->setLastAccessAt(date('Y-m-d H:i:s'));\n $user->save();\n }\n }", "private function lastVisit()\n {\n $lastVisit = User::model()->notsafe()->findByPk(Yii::app()->user->id);\n $lastVisit->lastvisit_at = time();\n $lastVisit->save();\n }", "function updateLastAccessedTime() {\n\tif(empty( $_SESSION ))\n\t\treturn;\n\t$userId = getSessionUserId();\n\tif(isset($userId) && $userId != '') {\n\t\t$_SESSION['last_accessed_time'] = time();\n\t}\n}", "public function updateLastSeen()\n {\n if (authCheck()) {\n $this->builder->where('id', user()->id)->update(['last_seen' => date('Y-m-d H:i:s')]);\n }\n }", "public function updateLastSignIn()\n\t{\n\t\tglobal $mysqli,$db_table_prefix;\n\t\t$time = time();\n\t\t$query=mysqli_query($mysqli,\"UPDATE \".$db_table_prefix.\"users\n\t\t\tSET\n\t\t\tlast_sign_in_stamp = $time\n\t\t\tWHERE\n\t\t\tid = \".$this->user_id);\n\t}", "public function updateLastActionTime()\n {\n \n $currentTime = time();\n $affectedRows = 0;\n \n $command = Yii::app()->db->createCommand('\n SELECT id \n FROM user_login \n WHERE user_id=?\n ');\n $rowId = $command->queryScalar(array(1=>$this->id));\n if ( $rowId ) {\n $command = Yii::app()->db->createCommand('\n UPDATE user_login \n SET last_action_time= :currentTime, user_agent= :userAgent\n WHERE user_id= :userId\n ');\n $affectedRows = $command->execute(array(\n 'userId' => $this->id,\n 'currentTime' => $currentTime,\n 'userAgent' => $_SERVER['HTTP_USER_AGENT'],\n ));\n } else {\n\n $command = Yii::app()->db->createCommand('\n INSERT INTO user_login (user_id,last_action_time,user_agent) \n VALUE (:userId, :currentTime, :userAgent)\n ');\n $affectedRows = $command->execute(array(\n 'userId' => $this->id,\n 'currentTime' => $currentTime,\n 'userAgent' => $_SERVER['HTTP_USER_AGENT'],\n ));\n }\n\n return $affectedRows;\n }", "public function updateTime(){\r\n\t\t$date = new DateTime();\r\n\t\t$this->_lastUpdate = date_timestamp_get($date);\t\t\r\n\t}", "public function updateTime() {\n // Nur aktualisieren wenn die Seite nicht per F5 Refreshed wurde\n if(!Obj::isPageRefreshed()) {\n $_SESSION[SysConstants::sysLoggedInTime] = DateTimeUtil::currentDateTime();\n \n // Update also Table\n //$UO = new UserOnline(Obj::user()->fldRecId[FLDVALUE]);\n $UO = UserOnline::find();\n $UO->ttsbegin();\n $UO->fldModifiedDateTime[FLDVALUE] = DateTimeUtil::currentDateTime(DateTimeUtil::dateTimePattern);\n $UO->update();\n $UO->ttscommit();\n }\n }", "public function updateLastVist()\n {\n $data = new \\DateTime;\n $this->lastvisit_at = $data->format('Y-m-d H:i:s');\n $this->save();\n }", "protected function writeLastActivityTime()\n {\n $this->lastActivityTime = new \\DateTime(\"now\");\n $em = self::getEntityManager();\n $em->persist($this);\n $em->flush();\n }", "public function updateLastSignIn()\n\t{\n\t\tglobal $mysqli,$db_table_prefix;\n\t\t$time = time();\n\t\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"users\n\t\t\tSET\n\t\t\tlast_sign_in_stamp = ?\n\t\t\tWHERE\n\t\t\tid = ?\");\n\t\t$stmt->bind_param(\"ii\", $time, $this->user_id);\n\t\t$stmt->execute();\n\t\t$stmt->close();\t\n\t}", "function wc_set_user_last_update_time($user_id)\n {\n }", "public function updateLastActive() {\n\t\t$this -> setData(\"lastActive\", date(\"Y-m-d H:i:s\"));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation apiV11ProductsPostWithHttpInfo Adds a product.
public function apiV11ProductsPostWithHttpInfo($product = null) { $returnType = '\Swagger\Client\Model\Product'; $request = $this->apiV11ProductsPostRequest($product); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $request->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\Product', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\BadRequestResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\UnauthorizedResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\ForbiddenResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\NotFoundResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\ConflictResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Swagger\Client\Model\InternalServerErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
[ "public function productSizesIdProductsPostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling productSizesIdProductsPost');\n }\n // parse inputs\n $resourcePath = \"/ProductSizes/{id}/products\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Product',\n '/ProductSizes/{id}/products'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Product', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Product', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function importProductsWithHttpInfo($body = null)\n {\n // parse inputs\n $resourcePath = \"/products/import\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json; charset=utf-8']);\n\n // header params\n $authToken = $this->apiClient->getApiKeyWithPrefix('Authorization');\n $headerParams['Authorization'] = $this->apiClient->getSerializer()->toHeaderValue($authToken);\n // header params\n $accessToken = $this->apiClient->getConfig()->getAccessToken();\n $headerParams['x-api-key'] = $this->apiClient->getSerializer()->toHeaderValue($accessToken);\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\VoloCommerce\\Api\\v1\\Model\\ImportProductsResponse',\n '/products/import'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\VoloCommerce\\Api\\v1\\Model\\ImportProductsResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\VoloCommerce\\Api\\v1\\Model\\ImportProductsResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\VoloCommerce\\Api\\v1\\Model\\VoloAPIErrorResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function apiV11ProductsGetWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\Product[]';\n $request = $this->apiV11ProductsGetRequest();\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\\Product[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\BadRequestResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\UnauthorizedResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ForbiddenResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\NotFoundResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ConflictResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InternalServerErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function productMaterialsPostWithHttpInfo($data = null)\n {\n // parse inputs\n $resourcePath = \"/ProductMaterials\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductMaterial',\n '/ProductMaterials'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductMaterial', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductMaterial', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function productGroupsPostWithHttpInfo($data = null)\n {\n // parse inputs\n $resourcePath = \"/ProductGroups\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductGroup',\n '/ProductGroups'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductGroup', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductGroup', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "protected static function createProductAsyncWithHttpInfo($product) \n {\n $returnType = '\\Tradenity\\SDK\\Resources\\Product'; \n $request = self::createProductRequest($product); \n\n return self::getHttpClient()\n ->sendAsync($request, self::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 storeProductsDraftWithHttpInfo($body)\n {\n $returnType = '\\RackbeatApp\\Client\\Model\\Product';\n $request = $this->storeProductsDraftRequest($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()->getBody()->getContents()\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 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\RackbeatApp\\Client\\Model\\Product',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function tagsIdProductsDeleteWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling tagsIdProductsDelete');\n }\n // parse inputs\n $resourcePath = \"/Tags/{id}/products\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/Tags/{id}/products'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }", "public function indexProductWithHttpInfo()\n {\n $returnType = '\\RackbeatApp\\Client\\Model\\InlineResponse206';\n $request = $this->indexProductRequest();\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()->getBody()->getContents()\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 206:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\RackbeatApp\\Client\\Model\\InlineResponse206',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function apiV11ProductsByIdPutWithHttpInfo($id, $product = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Product';\n $request = $this->apiV11ProductsByIdPutRequest($id, $product);\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\\Product',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\BadRequestResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\UnauthorizedResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ForbiddenResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\NotFoundResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ConflictResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InternalServerErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function createProductAction(){\n $reponse = array(\n 'status' => \\Helpers\\Language::$postStatusFailure,\n 'message' => \\Helpers\\Language::$errorPostParameters\n );\n // must be a POST request\n if ($this->request->isPost() == true) {\n $params = $this->request->get();\n $product = new \\Multiple\\Models\\Product();\n foreach($params as $key => $value){\n \\Helpers\\Model::setCreateProperty($product,$key,$value);\n }\n $auth = $this->session->get('auth');\n $user = \\Multiple\\Models\\User::findFirst(array(\n \"username = :username:\",\n \"bind\" => array(\n \"username\" => $auth['username']\n )\n ));\n $product->created = 'NOW()';\n $product->created_by = $user->username;\n $response['message'] = 'Failed to create product';\n if($product->create()){\n $response['status'] = \\Helpers\\Language::$postStatusSuccess;\n $response['message'] = 'Product created successfully';\n $response['id'] = $product->id;\n }\n }\n \\Helpers\\Controller::jsonify($response);\n $this->view->disable();\n }", "public function tagsIdProductsGetWithHttpInfo($id, $filter = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling tagsIdProductsGet');\n }\n // parse inputs\n $resourcePath = \"/Tags/{id}/products\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // query params\n if ($filter !== null) {\n $queryParams['filter'] = $this->apiClient->getSerializer()->toQueryValue($filter);\n }\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Product[]',\n '/Tags/{id}/products'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Product[]', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Product[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function apiV11ProductsPostAsync($product = null)\n {\n return $this->apiV11ProductsPostAsyncWithHttpInfo($product)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function apiV11ProductsByIdMatchesPost($id, $match = null)\n {\n list($response) = $this->apiV11ProductsByIdMatchesPostWithHttpInfo($id, $match);\n return $response;\n }", "public function procurementTypesPostWithHttpInfo($product_types)\n {\n // verify the required parameter 'product_types' is set\n if ($product_types === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $product_types when calling procurementTypesPost');\n }\n // parse inputs\n $resourcePath = \"/procurement/types\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($product_types)) {\n $_tempBody = $product_types;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires HTTP basic authentication\n if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {\n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Spinen\\ConnectWise\\Clients\\Procurement\\Model\\ProductType',\n '/procurement/types'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\Spinen\\ConnectWise\\Clients\\Procurement\\Model\\ProductType', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Procurement\\Model\\ProductType', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Procurement\\Model\\Error', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function saveProductWithHttpInfo($client_id, $access_token, $body)\n {\n // verify the required parameter 'client_id' is set\n if ($client_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $client_id when calling saveProduct');\n }\n // verify the required parameter 'access_token' is set\n if ($access_token === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $access_token when calling saveProduct');\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling saveProduct');\n }\n // parse inputs\n $resourcePath = \"/products\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($client_id !== null) {\n $headerParams['client_id'] = $this->apiClient->getSerializer()->toHeaderValue($client_id);\n }\n // header params\n if ($access_token !== null) {\n $headerParams['access_token'] = $this->apiClient->getSerializer()->toHeaderValue($access_token);\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $headerParams['access_token'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('client_id');\n if (strlen($apiKey) !== 0) {\n $headerParams['client_id'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/products'\n );\n\n return [null, $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }", "public function addProduct($name, AddProductToProductSetRequest $postBody, $optParams = [])\n {\n $params = ['name' => $name, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('addProduct', [$params], VisionEmpty::class);\n }", "public function insertProduct() {\n $path = '/api/products';\n\n $product = [\n 'name' => 'Testing Product Deletion',\n 'brand' => 'Testing',\n 'price' => 10.20,\n 'stock' => 50\n ];\n\n $response = $this->json('POST', $path, $product);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true\n ]);\n }", "public function storeProductCategoryWithHttpInfo($body)\n {\n $returnType = '\\RackbeatApp\\Client\\Model\\ProductCategory';\n $request = $this->storeProductCategoryRequest($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()->getBody()->getContents()\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 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\RackbeatApp\\Client\\Model\\ProductCategory',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an array of photo tag information
public function getPhotoTags() { $tags = array(); $annotations = elgg_get_annotations(array( 'guid' => $this->getGUID(), 'annotation_name' => 'phototag', )); foreach ($annotations as $annotation) { $tag = unserialize($annotation->value); $tag->annotation_id = $annotation->id; $tags[] = $tag; } return $tags; }
[ "function photos_photo_tag_list( $photo_id = NULL ) {\n\t\tif( $photo_id == NULL ) { $photo_id = $GLOBALS['photo_id']; }\n // Get $photo ...\n\t\tglobal $f;\n\t\t$photo = $f->photos_getInfo($photo_id);\n\n\t\tif( $photo['tags'] ) {\n // $my_tags = $photo['tags']['tag'];\n\t\t\t// foreach( $my_tags as &$my_tag ) {\n // $my_tag = $my_tag['raw'];\n // }\n // return $my_tags;\n\t\t\treturn $photo['tags']['tag'];\n\t\t} else {\n return(False);\n }\n\t}", "public function get_tag_array() {\n\t\tglobal $database;\n\t\tif(!isset($this->tag_array)) {\n\t\t\t$this->tag_array = $database->get_col(\"SELECT tag FROM image_tags JOIN tags ON image_tags.tag_id = tags.id WHERE image_id=:id ORDER BY tag\", array(\"id\"=>$this->id));\n\t\t}\n\t\treturn $this->tag_array;\n\t}", "public function getTagsOfThisPhoto($tag='')\n\t\t{\n\t\t\t$tags_arr = explode(' ',$this->fields_arr['photo_tags']);\n\t\t\tforeach($tags_arr as $tags)\n\t\t\t\t{\n\t\t\t\t\t?>\n\t\t\t\t\t<span>\n\t\t\t\t\t<a id=\"photo_tag_<?php echo $tags; ?>\"\n\t\t\t\t\t<?php\n\t\t\t\t\t\tif (isMember() and chkIsSubscriptionEnabled() and chkIsSubscriptionEnabledForModule())\n\t\t\t\t\t\t\techo 'onmouseover=\"getSubscriptionOption(\\''.addslashes($tags).'\\', \\''.$this->CFG['site']['is_module_page'].'\\', \\'Tag\\', \\'pos_'.$this->changeTitle($tags).'\\')\"';\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\thref=\"<?php echo getUrl('photolist','?pg=photonew&amp;tags='.$tags, 'photonew/?tags='.$tags,'','photo');?>\"><?php echo $tags;?></a>\n\t\t\t\t\t<span id=\"pos_<?php echo $this->changeTitle($tags); ?>\">&nbsp;</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t}", "public function photos_getTags($pids) {\n return $this->call_method('facebook.photos.getTags', \n array('pids' => $pids));\n }", "function getTagsByPhotoId($photo_id)\n {\n $sql = \"SELECT * FROM t_tag, t_tagging WHERE t_tagging.f_photo_id = :photo_id and t_tag.f_id = t_tagging.f_tag_id\";\n\t\t$stmt = $this->sqlite->prepare($sql);\n\t\t$stmt->bindValue(\":photo_id\", $photo_id);\n $result = $stmt->execute();\n $all = array();\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n $tag = new Tag();\n $tag->id = $row[\"f_id\"];\n $tag->name = $row[\"f_name\"];\n array_push($all, $tag);\n }\n return $all;\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function getTaggedPhotos()\n {\n // api: https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN\n $tags = $this->_client->getTags();\n\n foreach ($tags as $tag) {\n\n /** Get min ID (get photos after this Min Id) */\n $minTagId = $this->_taggedPhotoFactory->create()\n ->getCollection()\n ->addFieldToFilter('tag_name', $tag)\n ->getLastItem()\n ->getMinTagId();\n\n if (!empty($minTagId)) {\n $param = ['min_tag_id' => $minTagId];\n } else {\n $param = ['count' => 20];\n }\n\n $handle = sprintf('/tags/%s/media/recent', $tag);\n $photos = $this->_client->api($handle, 'GET', $param);\n\n if (isset($photos['pagination']['min_tag_id']) && isset($photos['data']) && count($photos['data'])) {\n $minTagId = $photos['pagination']['min_tag_id'];\n $photos = array_reverse($photos['data']);\n foreach ($photos as $photo) {\n if ($photo['type'] == 'image' || $photo['type'] == 'carousel') {\n $this->savePhoto($photo, $tag, $minTagId);\n }\n }\n }\n }\n }", "public function getPhotoTags($username = \"me\") {\r\n\t\tif ($this->session) { \r\n\t\t try { \r\n\t\t if ($username != \"me\")\r\n\t\t \treturn $this->fb_api->api('/' . $username . '/photos');\r\n\t\t else\r\n\t\t \t$this->fbphototags = $this->fb_api->api('/' . $username . '/photos');\r\n\t\t } catch (FacebookApiException $e) {\r\n\t\t error_log($e);\r\n\t\t } \r\n\t\t}\r\n\t\treturn $this->fbphototags;\r\n\t}", "public function get_tag_photos($search_tag,$count){\n //call the API and decode the response\n $url = \"https://www.instagram.com/explore/tags/\".$search_tag.\"/?__a=1\";\n\n $transient_name = 'revslider_' . md5($url);\n\n $rsp = json_decode($this->_framework->wp_remote_fopen($url));\n\n for($i=0;$i<$count;$i++) {\n $return[] = $rsp->tag->media->nodes[$i];\n }\n\n if(isset($rsp->tag->media->nodes)){\n $rsp->tag->media->nodes = $return;\n $this->_framework->set_transient( $transient_name, $rsp->tag->media->nodes, $this->transient_sec );\n return $rsp->tag->media->nodes;\n }\n else return '';\n }", "public function getImgTags():int;", "public function getPhotosByTagName($tagName){\n $photo = new Photo;\n return $photo->getPhotosByTagName($tagName);\n }", "function getImageTags($html) {\n //Thanks to the following blog post for the inspiration for this regex:\n //http://kev.coolcavemen.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/\n preg_match_all(\"/<\\/?(\\w+)((\\s+\\w+(\\s*=\\s*(?:\\\".*?\\\"|'.*?'|[^'\\\">\\s]+))?)+\\s*|\\s*)\\/?>/i\", $html, $m, PREG_OFFSET_CAPTURE);\n $tags = array('types' => $m[1], 'attrs' => $m[2], 'wholetags' => $m[0]);\n\n //At this stage $tags['attrs'] is just an unparsed string\n\n $imgTags = array();\n for ($i=0; $i<count($tags['attrs']); $i++) {\n if ($tags['types'][$i][0] == 'img') {\n $parsedAttrs = $this->parseAttrs($tags['attrs'][$i][0]);\n if (isset($parsedAttrs['src'])) {\n $parsedAttrs['_offset'] = $tags['wholetags'][$i][1];\n $parsedAttrs['_length'] = strlen($tags['wholetags'][$i][0]);\n $imgTags[] = $parsedAttrs;\n }\n }\n }\n\n return $imgTags;\n }", "function getTagInfos($idPhotoTag){\r\n\t\t$infos = $this->dao->getTagInfos($idPhotoTag);\r\n\t\tif($infos == null){\r\n\t\t\techo \"{error:\\\"Pas d'info\\\"}\";\r\n\t\t}\r\n\t\t$json=sprintf(\"{\\\"date\\\":\\\"%s\\\",\\\"type\\\":\\\"%s\\\",\\\"commentaire\\\":\\\"%s\\\",\\\"personnes\\\":\\\"%s\\\",\\\"motos\\\":\\\"%s\\\",\\\"motsCles\\\":\\\"%s\\\",\\\"lieux\\\":\\\"%s\\\"\",\r\n\t\t\t$infos->getInfo(\"date\"),$infos->getInfo(\"type\"),$infos->getInfo(\"commentaire\"),\r\n\t\t\t$infos->getInfo(\"personnes\"),$infos->getInfo(\"motos\"),$infos->getInfo(\"motsCles\"),\r\n\t\t\t$infos->getInfo(\"lieux\"));\r\n\t\t$json.=\"}\";\r\n\t\techo $json;\r\n\t}", "public function getPictureAttributes();", "public function getGeoTaggedImages() {\n\t\t$georef = Array();\n\t\t$i = 0;\n\n\t\t//loop through, test if georeffed\n\t\tforeach ($this->images as $key =>$image) {\n\t\t\tif ($image->isGeoref()){\n\t\t\t\t$georef[$i] = $image;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t//return\n\t\treturn $georef;\n\t}", "function get_photo_tags( $photo, $limit=null, $cond=null, $order='date_added ASC' ) {\n global $db;\n \n if ( is_array ($photo) ) {\n $params = $photo;\n } else {\n $params['pid'] = $photo;\n $params['limit'] = $limit;\n $params['order'] = $order;\n\n if ( !is_null($cond) ) {\n $params['extra'] = $cond;\n }\n }\n \n $results = $this->get_tags($params);\n \n //$results = $db->select( tbl('photo_tags'),'*', \" photo_id = '\".$photo.\"' \".$cond.\" \", $limit, $order );\n if ( $results ) {\n return $results;\n } else {\n return false;\n }\n }", "function getImagesByTag($tag){\n\tglobal $server;\n\tglobal $userid;\n\tglobal $password;\n\tglobal $database;\n\tglobal $pager_options;\n\t$db = &NewADOConnection('mysql');\n\t$db->Connect($server, $userid, $password, $database);\n\t$sql = \"\tSELECT pic.*\n\t\t\t\tFROM tbl_pics pic\n\t\t\t\tINNER JOIN tbl_pics_tags pt\n\t\t\t\tON pic.id = pt.pic\n\t\t\t\tINNER JOIN tbl_tags tag\n\t\t\t\tON tag.id = pt.tag\n\t\t\t\tWHERE tag.tag = '$tag'\n\t\t\t\tAND pic.display = 1\n\t\t\t\tORDER BY pic.added DESC, pic.id DESC\";\n\t$getPics = Pager_Wrapper_ADODB($db, $sql, $pager_options);\n\tif($db->ErrorMsg()){\n\t\t//DB-ERROR\n\t\t$getPics = -1;\n\t}\n\t$db->Close();\n\treturn $getPics;\n}", "public function fetch_tags() {\n $getID3 = new \\getID3;\n $fileInfo = $getID3->analyze($this->path);\n\n // Get all the common tags\n /* if (isset($fileInfo['tags_html'])) {\n $this->tags = $fileInfo['tags_html']['id3v2'];\n }*/\n // Adding the cover art if it is available\n if (isset($fileInfo['comments']['picture'])) {\n $this->tags['image'] = $fileInfo['comments']['picture'][0];\n }\n }", "public function listMediaTags() {\n\t\t$conn\t\t= $this->connect();\n\t\t$collection\t= $conn->snapstate->tags;\n\t\t$query\t\t= array('tag_status' => '1');\n\t\t$sort\t\t= array('tag_name' => 1);\n\t\t$cursor\t\t= $collection->find($query)->sort($sort);\n\t\t$resultArray= array();\n\t\t\n\t\twhile($cursor->hasNext())\n\t\t{\n\t\t\t$resultArray[]\t= $cursor->getNext();\n\t\t}\n\t\treturn $resultArray;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test crypto asset info endpoint
public function test_crypto_asset_info(){ $response = $this->get('/api/crypto/asset/info/btc'); $response->assertStatus(200); assert($response->json()['data']['name'] == "Bitcoin"); $response = $this->get('/api/crypto/asset/info/xxx'); $response->assertStatus(404); $response->assertExactJson(array("message" => "Coin xxx is not supported")); }
[ "public function testShowAsset()\n {\n // 1. Create mock\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->get(route('asset.show', $this->asset));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testAssetServerGet()\r\n {\r\n\r\n }", "public function testAssetServerGetSecurityEntries()\r\n {\r\n\r\n }", "public function test_all_time_asset(){\n $response = $this->get('/api/crypto/historical/asset/all_time/btc');\n $response->assertStatus(200);\n\n $response = $this->get('/api/crypto/historical/asset/all_time/xxx');\n $response->assertStatus(404);\n $response->assertExactJson(array(\"message\" => \"Coin xxx is not supported\"));\n }", "public function testAssetsSharev1assetsidAssetdetails()\n {\n\n }", "public function test_library_asset() {\n\t\t$path = route('v2_library_asset',[],false);\n\n\t\t$this->log(\"\\nTesting: \" . route('v2_library_asset', $this->params),'light_cyan',true);\n\t\t$response = $this->get(route('v2_library_asset'), $this->params);\n\t\t$response->assertSuccessful();\n\t\t$response->assertJsonStructure([$this->getSchemaKeys('v2_library_asset')]);\n\t\t$this->compareToOriginal($path,[$this->getSchemaKeys('v2_library_asset')]);\n\t}", "public function testAssetsGet()\n {\n }", "public function testInventoryLinksStatsEndpoint()\n {\n }", "public function testAssetDatabaseGetSecurity()\r\n {\r\n\r\n }", "public function testStoreAsset()\n {\n // 1. Create mock\n $admin = $this->admin;\n\n $data = [\n 'name' => 'Jabar Command Center',\n 'status' => 'active',\n 'description' => 'JDS Team',\n 'capacity' => 100,\n 'resource_type' => 'online'\n ];\n\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->post(route('asset.store'), $data);\n\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_CREATED);\n }", "public function testAssetServerGetSecurityIdentitiesForUser()\r\n {\r\n\r\n }", "public function testGetClientAssetSizeUsingGet()\n {\n }", "public function testAssetServerGetByPath()\r\n {\r\n\r\n }", "public function testProductAPIGetProductInfoV2()\n {\n\n }", "public function testProductAPIGetProductInfoPrices()\n {\n\n }", "public function testDownloadCertificateImage()\n {\n }", "public function testAssetsSharev1assetsidAsset()\n {\n\n }", "public function testIndexAssetSearchByStatus()\n {\n // 1. Mock data\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->get(route('asset.index', ['status' => 'active']));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testProductAPIGetProductInfo2()\n {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks contents_css property as a string.
public function testContentsCssAsString() { $form = $this->factory->create('ckeditor', null, array( 'contents_css' => '/css/ckeditor/contents.css', )); $view = $form->createView(); $contentsCss = $view->vars['contents_css']; $this->assertEquals($contentsCss, '/css/ckeditor/contents.css'); }
[ "public function checkInlineCSS(){\n\t\tpreg_match_all('@style[\\s+]?=[\\s+]?[\\'|\"].*?[\\'|\"]i', $this->parser->dom, $matches);\n\t\treturn $matches[0];\n\t}", "public static function is_filterable_string( $css_property ) {\n\t\t\treturn strpos( $css_property, self::FILTER_SEPARATOR ) > 0;\n\t\t}", "public function getStylesCss()\n\t{\n\t\t$dir = $this->getFieldFolderPath();\n\t\t$fieldFile = \"{$dir}/style.css\";\n\t\tif(file_exists($fieldFile))\n\t\t\treturn file_get_contents($fieldFile);\n\t\treturn false;\n\t}", "private function getCSS() \n\t{\t\t\n\t\t$file_content .= EOL._AC(\"css_validation_result\").': '.$this->error_nr_css.DELIM.strip_tags(_AC(\"css_validator_provided_by\")).EOL;\t\t\n\t\t\n\t\tif ($this->css_error == '' && $this->error_nr_css == -1) {\n\t\t\t// css validator is disabled\n\t\t\t$file_content .= _AC(\"css_validator_disabled\").EOL;\n\t\t}\n\t\t\n\t\tif ($this->css_error != '') {\n\t\t\t// css validator is only available at validating url, not at validating a uploaded file or pasted html\n\t\t\t$file_content .= $this->css_error.EOL;\n\t\t} else if ($this->error_nr_css == 0) {\n\t\t\t\t// show congratulations if no errors found\n\t\t\t\t$file_content .= _AC(\"congrats_css_validation\").EOL;\n\t\t} else {\t\n\t\t\t$file_content .= $this->prepareStr(_AC('line')).DELIM.$this->prepareStr(_AC('html_tag')).DELIM.$this->prepareStr(_AC('error')).EOL;\n\t\t\tforeach($this->css as $uri => $group) {\n\t\t\t\t\t// uri\n\t\t\t\t\t$file_content .= \"URI: \".$uri.EOL;\n\t\t\t\t\tforeach($group as $error) {\n\t\t\t\t\t\t// line\n\t\t\t\t\t\t$file_content .= $error['line'];\t\n\n\t\t\t\t\t\t// code\n\t\t\t\t\t\tif ($error['code'] != '') $file_content .= DELIM.$this->prepareStr($error['code']);\n\t\t\t\t\t\telse $file_content .= DELIM.\"\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// parse\n\t\t\t\t\t\tif ($error['parse'] != '') {\n\t\t\t\t\t\t\t$str = str_replace(\"\\n\", \"\", strip_tags(html_entity_decode($error['parse'])));\n\t\t\t\t\t\t\t$str = str_replace(\"\\r\", \"\", strip_tags(html_entity_decode($error['parse'])));\n\t\t\t\t\t\t\t$str = preg_replace(\"/ {2,}/\", \" \", $str);\n\t\t\t\t\t\t\t$file_content .= DELIM.$this->prepareStr($str).EOL;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $file_content .= DELIM.\"\".EOL;\n\t\t\t\t\t\t\n\t\t\t\t\t} // end foreach error\n\t\t\t\t} // end foreach group\t\n\t\t}\t\n\t\treturn $file_content;\n\t}", "protected function isPlainCss(): bool\n {\n return false;\n }", "public function getContentStreamAllowed()\n {\n $def = eZCMISTypeHandler::getTypeDefinition( $this->getObjectTypeId() );\n\n return isset( $def[0]['contentStreamAllowed'] ) ? $def[0]['contentStreamAllowed'] : '';\n }", "private function has_custom_css() {\n\t\t$query = new \\WP_Query(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'custom_css',\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'numberposts' => 1,\n\t\t\t\t'update_post_meta_cache' => false,\n\t\t\t\t'update_post_term_cache' => false,\n\t\t\t)\n\t\t);\n\n\t\tif ( $query->have_posts() ) {\n\t\t\t$query->the_post();\n\t\t\t$content = get_the_content();\n\n\t\t\t// if the content contains a colon, a CSS rule has been added.\n\t\t\treturn strpos( $content, ':' ) === false ? false : true;\n\t\t}\n\n\t\treturn false;\n\t}", "function hasContent()\n\t{\n\t\tif(version_compare(phpversion(), \"5.0.0\", \"<\"))\n\t\t{\n\t\t\t$content = ereg_replace('&#([0-9]*);', '', $this->nodeData->content);\n\t\t\t$content = html_entity_decode($content);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($this->nodeData->nodeType === XML_TEXT_NODE)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\treturn false;\n\t\t\t//$content = ereg_replace('&#([0-9]*);', '', $this->nodeData->textContent);\n\t\t\t//$content = html_entity_decode($content);\n\t\t}\n\t\t\n//\t\tvar_dump($content);\n\t\t\n\t\t//$content = trim(str_replace('&#160;', '', $this->nodeData->content));\n\t\t//$content = trim(str_replace('&#160;', '', $this->nodeData->content));\n\n\t\treturn $content ? 1 : 0;\n\t}", "public function get_critical_css_content() {\n\t\t$filename = $this->get_current_page_critical_css();\n\n\t\tif ( empty( $filename ) ) {\n\t\t\treturn $this->options->get( 'critical_css', '' );\n\t\t}\n\n\t\treturn $this->filesystem->get_contents( $filename );\n\t}", "public static function contentIsValid($content) {\r\n \r\n return ( is_string($content) && (strlen($content) < 1000) && !empty($content) );\r\n }", "function pdfjs_viewer_valid_css_length( string $str ) {\n\tif('' === $str) {\n\t\treturn false;\n\t}\n\treturn preg_match( '/^[+-]?[0-9]+.?([0-9]+)?(px|em|ex|%|in|cm|mm|pt|pc)$/', $str );\n}", "static function checkCss($value)\n {\n $value = self :: decodeCharReferences($value);\n \n // Remove any comments; IE gets token splitting wrong\n $value = MediawikiStringUtils :: delimiterReplace('/*', '*/', ' ', $value);\n \n // Decode escape sequences and line continuation\n // See the grammar in the CSS 2 spec, appendix D.\n static $decodeRegex, $reencodeTable;\n if (! $decodeRegex)\n {\n $space = '[\\\\x20\\\\t\\\\r\\\\n\\\\f]';\n $nl = '(?:\\\\n|\\\\r\\\\n|\\\\r|\\\\f)';\n $backslash = '\\\\\\\\';\n $decodeRegex = \"/ $backslash\n\t\t\t\t(?:\n\t\t\t\t\t($nl) | # 1. Line continuation\n\t\t\t\t\t([0-9A-Fa-f]{1,6})$space? | # 2. character number\n\t\t\t\t\t(.) | # 3. backslash cancelling special meaning\n\t\t\t\t\t() | # 4. backslash at end of string\n\t\t\t\t)/xu\";\n }\n $value = preg_replace_callback($decodeRegex, array(__CLASS__, 'cssDecodeCallback'), $value);\n \n // Reject problematic keywords and control characters\n if (preg_match('/[\\000-\\010\\016-\\037\\177]/', $value))\n {\n return '/* invalid control char */';\n }\n elseif (preg_match('! expression | filter\\s*: | accelerator\\s*: | url\\s*\\( !ix', $value))\n {\n return '/* insecure input */';\n }\n return $value;\n }", "function getStyleSheet($content = true)\n {\n if ($content) {\n $styles = file_get_contents($this->css);\n } else {\n $styles = $this->css;\n }\n return $styles;\n }", "public function isValidCss()\n \t\t{\n\t\t\t if(!isset($this->fields_arr['css_arr']))\n\t\t\t \t\t{\n \treturn false;\n }\n if(!isset($this->fields_arr['temp_arr']))\n \t{\n \treturn false;\n }\n $temp_array = $this->fields_arr['temp_arr'];\n $css_array = $this->fields_arr['css_arr'];\n\n foreach($css_array as $cssfile)\n \t{\n \t$template_name = explode('__', $cssfile);\n if(!in_array($template_name[0], $this->fields_arr['temp_arr']))\n \t{\n\t\t\t\t\t\t\t\t$this->setCommonErrorMsg($this->LANG['error_msg_template_not_selected']);\n return false;\n }\n }\n return true;\n }", "function _getCSSFromFile()\n {\n if ($this->useCSS) {\n $cssFound = '';\n /* Primeira tentativa de procura do estilo CSS */\n if (preg_match(':<style.*?>(.*?)</style>:is', $this->_htmlString, $matches)) {\n $cssFound = $matches[1];\n /* Substitua com o nada se não encontrar o CSS no HTML */\n $this->_htmlString = preg_replace(':<style.*?>.*?</style>:is', '', $this->_htmlString);\n }\n elseif (preg_match(':<link .*? href=[\"\\'](.*?)[\"\\'].*?text/css.*?>:i', $this->_htmlString, $matches)) {\n $cssFound = preg_replace(':(^(?!http\\://).*):i', 'http://'.$this->defaultDomain.'/\\\\1', $matches[1]);\n $cssFound = implode('', file($cssFound));\n }\n\n /* Somente atributo das tomadas a:link */\n $cssFound = preg_replace(':a +{:i', 'a:link {', $cssFound);\n\n /* Tamanho da font */\n $cssFound = preg_replace(':font-size\\: *(\\w*);:ie', '$this->_convertFontSize(\"\\\\1\")', $cssFound);\n\n return $cssFound;\n }\n else {\n return '';\n }\n }", "function _is_css( $path ) {\n\t\treturn preg_match( '~[a-zA-Z0-9\\-_]*(\\.include\\.[0-9]+)?\\.css$~',\n\t\t\t$path );\n\t}", "abstract protected function getContentsProperty();", "function is_css($path)\n{\n\treturn (extension($path) == 'css') ? true : false;\n}", "function property_is_valid($property) {\n\t\t $all_properties =& $GLOBALS['csstidy']['all_properties'];\n\t\t return (isset($all_properties[$property]) && strpos($all_properties[$property],strtoupper($this->get_cfg('css_level'))) !== false );\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of difficulty_recipes
public function getDifficulty_recipe() { return $this->difficulty_recipe; }
[ "public function getRecipe()\n {\n return $this->recipe;\n }", "public function getRecipeNo() {\n return $this->recipeNo;\n }", "public function getRecipesNum():int\n {\n return $this->recipes_num;\n }", "public function difficultyValue()\n {\n //$strainPeaks.Sort((a, b) => b.CompareTo(a)); // Sort from highest to lowest strain.\n\n $difficulty = 0;\n $weight = 1;\n\n // Difficulty is the weighted sum of the highest strains from every section.\n foreach ($strainPeaks as $strain) {\n $difficulty += $strain * $weight;\n $weight *= $decayWeight;\n }\n\n return $difficulty;\n }", "public static function getDifficulty() {\n\t\t//return $difficulties[array_rand($difficulties)];\n\t\treturn 'Medium';\n\t}", "public function getId_recipe()\r\n {\r\n return $this->id_recipe;\r\n }", "public function getRecipe_id()\n {\n return $this->recipe_id;\n }", "public function get_recipe_count() {\n\t\treturn count( $this->get_recipes() );\n\t}", "public function getDifficulty()\r\n {\r\n return $this->_difficulty;\r\n }", "public function getDifficultyText()\n {\n return $this->difficulties[(int) $this->difficulty];\n }", "public function getDifficulty()\n {\n return $this->difficulty;\n }", "function get_recipe_category(){\n return $this->recipeCategory->value;\n }", "public function getIdRecipe()\n {\n return $this->idRecipe;\n }", "public function getNumber_person_recipe()\r\n {\r\n return $this->number_person_recipe;\r\n }", "public static function getRecipe(){\n return Cache::get(self::CACHEKEY);\n }", "public function getRecipes()\n {\n return $this->recipes;\n }", "public function getRecipes(){\n\t\treturn $this->getIngredient()->getRecipes();\n\t}", "public function recipe($recipeID){\n $recette = $this->connect()->prepare('SELECT * FROM recette WHERE id_recette='.$recipeID.'');\n $recette->execute();\n $result = $recette->fetch(PDO::FETCH_ASSOC);\n return $result;\n }", "public function getRecipeSteps() {\n return $this->recipeSteps;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method should only return events where ALL of their instances are in the past. The array should contain Event objects
public static function inPast(): array { return [new Event(getEventFromData('Matilda'))]; }
[ "public function pastEvents()\n {\n return $this->events()->where('date', '<', Carbon::today());\n }", "public static function past_events()\n {\n $events = PublicEvent::get()\n ->filter(array(\n 'StartDateTime:LessThan' => date('Y-m-d', time())\n )\n );\n\n return $events;\n }", "public function getPastEvents(){\n $this->loadMissing('groups.past_events');\n $collection = collect($this->groups->pluck('past_events'))->collapse()->unique();\n return $collection;\n }", "public function pastMatches()\n {\n return $this->matches()->whereHas('event', function ($query) {\n $query->where('date', '<', Carbon::today());\n });\n }", "function obj_remove_future_events( $events = null ) {\n\t$time = current_time( 'timestamp' );\n\n\tforeach ( $events as $starttime => $post_id ) {\n\t\tif ( $starttime > $time ) {\n\t\t\tunset( $events[ $starttime ] );\n\t\t}\n\t}\n\tkrsort( $events );\n\treturn $events;\n\n}", "public function getPastTalks(): array\n {\n $now = new DateTimeImmutable('00:00:00');\n\n return array_filter($this->getTalks(), static function (Talk $talk) use ($now) {\n return $talk->date() < $now;\n });\n }", "function retrievePastEvents() {\n $query = \"SELECT DISTINCT vol_day\n FROM volunteer_audit\n WHERE Year(vol_day) < Year(now()) \";\n\n return $this->connection->runQuery($query);\n }", "function eventHomeFilter($events)\n{\n $validEvents = [];\n foreach ($events as $event) {\n $hoy = explode(\"T\", $event['date']);\n $time = $hoy[0];\n if (!timeHasPassed($time)) {\n $time = transFecha($time);\n arrowify($time);\n $event['time'] = $time;\n $validEvents[] = $event;\n }\n }\n return $validEvents;\n}", "public function getAllFutureEvents() {\n\n\t\t$language = Functions::getUserLanguage();\n\n\t\t$today = date('Y-m-d');\n\t\t$events = self::where(function($query) use ($today) {\n\t\t\t$query->whereDate('date_start', '>=', $today)->orWhereDate('date_end', '>=', $today);\n\t\t})->where(function($query) use ($language) {\n\t\t\t$query->where('language', '=', $language);\n\t\t})->orderBy('date_start', 'asc')->get()->toArray();\n\t\treturn $events;\n\t}", "public static function checkEvents()\n {\n $maxDate = Carbon::today()->addDays(14);\n \n $newEvents = Auth::user()->events()->where('start_date', '>', Carbon::today()->toDateTimeString())->get();\n \n if(!$newEvents->isEmpty() && $newEvents->last()->start_date->gte($maxDate))\n {\n return $newEvents->first();\n }\n \n $newestDate = !$newEvents->isEmpty() ? $newEvents->last()->start_date->copy()->addDays(1) : Carbon::now();\n $datediff = $maxDate->diffInDays($newestDate->startOfDay());\n EventHelper::generateEvents($datediff, $newestDate);\n \n return $newEvents->first();\n \n }", "private function fetchUpcomingEvents()\n {\n $today = Carbon::now();\n $upcomingEvents = Events::where('date', '>', $today)\n ->orderBy('date', 'asc')\n ->limit(8)\n ->get();\n return $upcomingEvents;\n }", "private function fetchUpcomingEvents()\n {\n $today = Carbon::now();\n $events = Events::where('date', '>=', $today )\n ->orderBy('date', 'asc')\n ->get();\n return $events;\n }", "function obj_get_kb_events() {\n\t$events = sc_get_all_events();\n\t$future_events = obj_remove_past_events( $events );\n\n\tif ( ! empty( $future_events ) ) {\n\n\t\t// Remove events that are not KB events\n\t\tforeach ( $future_events as $starttime => $event_array ) {\n\t\t\tforeach ( $event_array as $event_key => $event_id ) {\n\t\t\t\t$is_kb_event = get_field( 'kb_co_workshop', $event_id );\n\t\t\t\tif ( ! $is_kb_event ) {\n\t\t\t\t\tunset( $future_events[ $starttime ][ $event_key ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove event times that no longer have events\n\t\tforeach ( $future_events as $starttime => $event_array ) {\n\t\t\tif ( empty( $event_array ) ) {\n\t\t\t\tunset( $future_events[ $starttime ] );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $future_events;\n}", "public function test_get_events_no_current_events() {\n $this->factory->post->create([\n 'post_type' => 'greg_event',\n 'post_title' => 'My Old Event',\n 'meta_input' => [\n 'start' => date_create_immutable('now')->modify('-6 weeks')->format('Y-m-d 00:00:00'),\n 'end' => date_create_immutable('now')->modify('+5 weeks')->format('Y-m-d 00:00:00'),\n ],\n ]);\n $this->factory->post->create([\n 'post_type' => 'greg_event',\n 'post_title' => 'My Upcoming Event',\n 'meta_input' => [\n 'start' => date_create_immutable('now')->modify('+5 weeks')->format('Y-m-d 00:00:00'),\n 'end' => date_create_immutable('now')->modify('+6 weeks')->format('Y-m-d 00:00:00'),\n ],\n ]);\n\n $this->assertEmpty(Greg\\get_events());\n }", "public static function removeEvents()\n {\n $events = Event::where('user_fk','=', Auth::user()->id)\n ->where('start_date', '>=', Carbon::now()->toDateTimeString())\n ->where('completed', '=', FALSE)\n ->where('isSkipped', '=', FALSE)\n ->withTrashed()->forceDelete();\n \n return $events;\n }", "function inPast($event){\n $today = date('d.m.Y');\n $eventDate = $event->date->format('d.m.Y');\n\n if((strtotime($today) - strtotime($eventDate)) > 0)\n return true;\n else\n return false;\n}", "function get_past_events($currentDate, $startIdx, $limit) { \n // Fetch past event records\n $query = db_select('node', 'n');\n $query->join('field_data_field_event_end_date', 'd', 'd.entity_id = n.nid');\n $query->fields('n', array('nid'));\n $query->condition('n.type', 'event', '=');\n $query->condition('d.field_event_end_date_value', $currentDate, '<');\n $query->orderBy('d.field_event_end_date_value', 'DESC');\n $query->range($startIdx, $limit);\n $result = $query->execute();\n \n return buildEventList($result);\n}", "protected function fetchUpcomingEvents() {\n $startDateMin = strtotime('tomorrow 0:00:00');\n $startdateMax = strtotime('tomorrow 23:59:59');\n $result = $this->db->fetchAll('SELECT * FROM ' . $this->eventTable . ' WHERE publish_social = 1 AND startDate > ? AND startDate <= ?', array($startDateMin, $startdateMax));\n\n return $result;\n }", "public function getEventsNotFinished();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return whether we're previewing the front page and it's a static page.
function twentyseventeen_is_static_front_page() { return ( is_front_page() && ! is_home() ); }
[ "public function is_home_static_page() {\n return ( is_front_page() && 'page' == get_option( 'show_on_front' ) && is_page( get_option( 'page_on_front' ) ) );\n }", "function llorix_one_lite_is_not_static_front_page() {\n\n\tif ( get_option( 'show_on_front' ) === 'page' ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function isStaticPage() {\n\t\treturn $this->isStaticHomePage() || $this->isStaticPostsPage() || $this->isWooCommerceShopPage();\n\t}", "public function isFrontPage() {\n return $this->pathMatcher->isFrontPage();\n }", "private function is_front_page() {\n\t\tif ( $this->show_on_front === 'page' && is_front_page() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $this->show_on_front === 'posts' && is_home() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function canFrontPage()\n\t{\n\t\treturn true;\n\t}", "public function has_page_on_front() {\n\t\treturn 'page' === \\get_option( 'show_on_front' );\n\t}", "private function checkFrontPage() {\r\r\n return is_page() && get_option('show_on_front') == 'page' && isset($this->post->ID) && $this->post->ID == get_option('page_on_front');\r\r\n }", "function is_static_front_page_set( array $reading_settings ) {\n\treturn $reading_settings['show_on_front'] === 'page' &&\n\t $reading_settings['page_on_front'] > 0;\n}", "public function is_static_posts_page()\n {\n }", "public function isStaticPostsPage() {\n\t\treturn is_home() && ( 0 !== (int) get_option( 'page_for_posts' ) );\n\t}", "private function is_static_posts_page() {\n\t\tif ( is_home() && 0 !== (int) get_option( 'page_for_posts' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function is_front_page()\n {\n }", "public function is_page_on_front() {\n\t\treturn $this->has_event_archive_option() && $this->is_virtual_page_on_front();\n\t}", "public function is_on_frontpage() {\n return ($this->page->pagelayout == 'frontpage');\n }", "public function isFrontpage()\n\t{\n\t\treturn ($this->frontpage()->row()->get('content_id', 0) > 0);\n\t}", "function is_landing_page() {\n\treturn is_front_page() ||\n\t\t'landing-page' === get_post_type() ||\n\t\t'homepage' === get_query_var( 'dispatch' );\n}", "public static function is_posts_page() {\n\t\treturn ( \\is_home() && 'page' === get_option( 'show_on_front' ) );\n\t}", "public function is_static_posts_page() {\n\t\t$wp_query = $this->wp_query_wrapper->get_main_query();\n\n\t\t$page_for_posts = (int) \\get_option( 'page_for_posts' );\n\n\t\treturn ( $page_for_posts > 0 && $page_for_posts === $wp_query->get_queried_object_id() );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the refitemid column Example usage: $query>filterByRefitemid('fooValue'); // WHERE refitemid = 'fooValue' $query>filterByRefitemid('%fooValue%', Criteria::LIKE); // WHERE refitemid LIKE '%fooValue%'
public function filterByRefitemid($refitemid = null, $comparison = null) { if (null === $comparison) { if (is_array($refitemid)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(ItemsearchTableMap::COL_REFITEMID, $refitemid, $comparison); }
[ "public function filterByRef($ref = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($ref)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $ref)) {\n\t\t\t\t$ref = str_replace('*', '%', $ref);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(LpItemPeer::REF, $ref, $comparison);\n\t}", "public function searchRefItems( \\Aimeos\\MW\\Criteria\\Iface $search, array $ref = [], &$total = null );", "public function filterByRef($ref = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ref)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $ref)) {\n $ref = str_replace('*', '%', $ref);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(CreditNoteTableMap::REF, $ref, $comparison);\n }", "public function filterByRef($ref = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($ref)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $ref)) {\n\t\t\t\t$ref = str_replace('*', '%', $ref);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(LpPeer::REF, $ref, $comparison);\n\t}", "public function lookupItem($item_id);", "public function testRqlSelectOnItem()\n {\n $client = static::createRestClient();\n $client->request('GET', '/core/module/admin-AdminRef?select(app%2E$ref,name,path)');\n\n $results = $client->getResults();\n\n // is extref rendered as expected?\n $this->assertEquals('http://localhost/core/app/admin', $results->app->{'$ref'});\n\n // what about translatable?\n $this->assertEquals('Admin Ref Module', $results->name->en);\n\n // we didn't select 'key', make sure it's not there..\n $this->assertFalse(isset($results->key));\n }", "function fetchItemInfo($itemid){\n\t\t\n\t\t\tif(isset($itemid) && $this->FURY->validation->is_numeric($itemid)):\n\t\t\t\n\t\t\t\treturn $this->FURY->db->query(\"SELECT items.*,item_categories.name as cat_name FROM items\n\t\t\t\t LEFT JOIN item_categories \n\t\t\t\t ON item_categories.id=items.type\n\t\t\t\t WHERE items.id='$itemid'\")->as_assoc();\n\t\t\t\t \n\t\t\tendif;\n\t\t\t\n\t\t\treturn false;\n\t\t}", "public function filterByItemid($itemid = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($itemid)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(BookingdTableMap::COL_ITEMID, $itemid, $comparison);\n }", "public function filterByMfgitemid($mfgitemid = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($mfgitemid)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(OrdrdetTableMap::COL_MFGITEMID, $mfgitemid, $comparison);\n }", "public function getItemsCriteria() {}", "public function filterByXrefKey(array $key = [], $comparison = null) {\n\t\t$cols = [\n\t\t\t$this->tablemap_column(ItemXrefVendor::get_aliasproperty('vendorid')),\n\t\t\t$this->tablemap_column(ItemXrefVendor::get_aliasproperty('vendoritemid')),\n\t\t\t$this->tablemap_column(ItemXrefVendor::get_aliasproperty('itemid'))\n\t\t];\n\t\treturn $this->where(\"CONCAT(\".implode(\",'-',\", $cols).\") $comparison ?\", implode('-', $key));\n\t}", "public function filterByInvRef($invRef = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($invRef)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliOstockhTableMap::COL_INV_REF, $invRef, $comparison);\n }", "public function setItemref($sItemref) {\r\n\t\t$this->setAtributo(\"itemref\", $sItemref);\r\n\t}", "public function filterByInvRef($invRef = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($invRef)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliStockcardETableMap::COL_INV_REF, $invRef, $comparison);\n }", "public function filterByCustitemid($custitemid = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($custitemid)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(OrdrdetTableMap::COL_CUSTITEMID, $custitemid, $comparison);\n }", "public function filterByRef($ref = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ref)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliHoldheadTableMap::COL_REF, $ref, $comparison);\n }", "public function filterByItemid($itemid = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($itemid)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PackSalesOrderDetailTableMap::COL_ITEMID, $itemid, $comparison);\n }", "public function filterByRefno($refno = null, $comparison = null)\n\t{\n\t\tif (is_array($refno) && null === $comparison) {\n\t\t\t$comparison = Criteria::IN;\n\t\t}\n\t\treturn $this->addUsingAlias(SalesPeer::REFNO, $refno, $comparison);\n\t}", "public function filterByInvRef($invRef = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($invRef)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliStockcardSTableMap::COL_INV_REF, $invRef, $comparison);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively descends and calls free() on child structs.
protected function _free($value) { if (is_array($value)) { // recursively process array values foreach ($value as $key => $val) { $this->_free($val); } } elseif ($value instanceof Solar_Struct) { // recursively free child Solar_Struct objects $value->free(); } }
[ "public function free()\n {\n unset($this->_parent);\n parent::free();\n }", "public function __destruct()\n {\n if ($this->node) {\n librdf_free_node($this->node);\n }\n }", "public function detachChildren(): void\n {\n foreach ($this->children() as $children) {\n $children->setParent(null);\n }\n\n $this->firstChild = $this->lastChild = null;\n }", "function DeleteChildren()\n {\n //Loop through all child tags\n for($x = 0; $x < count($this->tagChildren); $x ++)\n {\n //Do this recursively\n $this->tagChildren[$x]->DeleteChildren();\n \n //Delete the name and value\n $this->tagChildren[$x] = null;\n unset($this->tagChildren[$x]);\n }\n }", "public function free()\n {\n $this->_removeReferenceToPackage();\n $this->_removeReferencesToMethods();\n $this->_removeReferencesToNodes();\n $this->_removeReferencesToReferences();\n }", "public function clearChildren()\n {\n $this->children = null;\n $this->children = array();\n }", "function __destruct(){\n\t\tunset($this->propertyChangeListeners);\n\t\tunset($this->cache);\n\t\tunset($this->pouch);\n\t\tunset($this->vetoFields);\n\t\tunset($this->_delegate);\n\t\tunset($this->_metaDataValues);\n\t\tunset($this->_transientValues);\n\t\tunset($this->_oldValues);\n\t\n\t\tif ( isset($this->_parentRecord) ){\n\t\t\t$this->_parentRecord->__destruct();\n\t\t\tunset($this->_parentRecord);\n\t\t}\n\t\t\n\t\t\n\t}", "function clear_childs() {\n $this->childs = NULL;\n }", "public function clearChildren()\n {\n $this->children = array();\n }", "public function __destruct() {\n\t\tparent::__destruct();\n\t\t$this->free();\n\t}", "public static function freeAll()\n {\n $identifiers = array_keys(self::$managedObjects);\n foreach ($identifiers as $identifier) {\n self::free($identifier);\n }\n self::$managedObjects = [];\n self::cleanup();\n }", "private function deleteChildren()\n {\n foreach ($this->yieldSingle(RecursiveEvent::get()->filter('ParentID', $this->ID)) as $child) {\n $child->doUnpublish();\n $child->doArchive();\n }\n }", "function destroy(&$xmlTree) {\n if (isset($xmlTree) && is_object($xmlTree)) {\n if (method_exists($xmlTree, 'free')) {\n $xmlTree->free();\n }\n unset($xmlTree);\n }\n }", "protected function initChildren() {\n foreach ($this->datas as $name => $data) {\n $fields = $data->getDefinition()->getFieldNames();\n foreach ($fields as $field) {\n if ($data->getDefinition()->getType($field) == 'reference') {\n $this->datas[$data->getDefinition()->getSubTypeField($field, 'reference', 'entity')]->getDefinition()->addChild($data->getDefinition()->getTable(), $field, $name);\n }\n }\n }\n }", "public function invalidate()\n {\n $this->depth = -1;\n \n // invalidate if possible children.\n $children = $this->getChildren();\n foreach ($children as $child) {\n if ($child instanceof Node) {\n $child->invalidate();\n }\n }\n }", "public function removeChildren();", "private function purgeChildren(object $document): void\n {\n if ($document instanceof Proxy && !$document->__isInitialized()) {\n return;\n }\n\n $class = $this->dm->getClassMetadata(get_class($document));\n foreach ($class->childMappings as $fieldName) {\n $child = $class->getFieldValue($document, $fieldName);\n if (null !== $child) {\n $this->purgeChildren($child);\n $this->unregisterDocument($child);\n }\n }\n }", "function dispose(){\n if ($this->_parent) {\n $this->_parent->removeChild($this);\n }\n }", "private function destroy_transactions(): void\n {\n //try to destroy all child transactions\n// foreach ($this->children as $Transaction) {\n// $Transaction->ParentTransaction = NULL;\n// $Transaction = NULL;\n// }\n// $this->children = [];\n $Function = static function ($Transaction) use (&$Function): void {\n foreach ($Transaction->children as $ChildTransaction) {\n $Function($ChildTransaction);\n $ChildTransaction->ParentTransaction = null;//remove a reference\n $ChildTransaction = null;\n }\n $Transaction->children = [];\n };\n $Function($this);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the form for Upload an Image route('auction.image');
public function imageUpload() { $auction = Auth::user()->auctions()->latest()->first(); return view('auction.imageUpload', compact('auction')); }
[ "public function showImagePage(){\n return view('pages.image_upload');\n }", "public function employeeImageUpload()\n {\n \treturn view('employeeImageUpload');\n }", "public function uploadForm(){\n\t \n\t\treturn view('lieu.show');\n \n\t}", "public function uploadForm()\n {\n return view('upload');\n }", "public function uploadForm()\n\t{\n\t\treturn View::template('admin/upload');\n\t}", "public function renderUploadForm() {}", "public function ajaxImageUpload() {\n \n return view('ajaxImageUpload');\n }", "public function getUploadImage() {\n $folders = ImageFolder::orderBy('name', 'asc')->get();\n\n return view('admin.image.image_upload', [\n 'folders' => $folders\n ]);\n }", "public function ajaxImageUpload()\n {\n \treturn view('ajaxImageUpload');\n }", "public function upload()\n\t{\n\t\t$this->template\n\t\t\t->set_layout('modal')\n\t\t\t->build('upload');\n\t}", "public function addPicture()\n {\n return view('Flooflix_websiteManagement.forms.pictures.createPicture');\n }", "public function offerUpload() {\n\t\treturn view(\"sprite/upload\");\n\t}", "function showUploadPhoto() {\n\t\t$this->setCacheLevelNone();\n\t\t$event = $this->getModel()->getEvent();\n\t\t$source = $this->getModel()->getSource();\n\t\t\n\t\tif ( $event->getID() == $source->getEventID() ) {\n\t\t\t$this->getEngine()->assign('event', utilityOutputWrapper::wrap($event));\n\t\t\t$this->getEngine()->assign('source', utilityOutputWrapper::wrap($source));\n\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('multifile', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.MultiFile.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('photoupload', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/mofilmphotoupload.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('blockui', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.blockUI.js'));\n\t\t\t$this->getEngine()->assign('error', FALSE);\n\t\t} else {\n\t\t\t$this->getEngine()->assign('error', TRUE);\n\t\t}\n\t\t\n\t\t$this->render($this->getTpl('uploadPhoto', '/account'));\n\t}", "public function create()\n {\n return View('add_image');\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "public function upload()\n {\n //Returns upload training material view\n return view('pages.training_material.upload'); \n }", "public function showNewPhotographForm()\n {\n return view('page.new-photo');\n }", "public function uploadImage()\n {\n }", "public function avatarUpdateForm()\n {\n return view(\"auth.avatarUpdate\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }