query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
sets the cardHand property
|
public function setCardHand(Deck $deck) {
$this->cardHand = $deck;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCardHand() {\n\t\treturn $this->cardHand;\n\t}",
"public function setHand(Deck $deck, $startingHandSize)\r\n {\r\n for ($i = 0; $i < $startingHandSize; $i++) {\r\n $card = array_pop($deck->cards);\r\n $this->hand[] = $card;\r\n }\r\n }",
"public function hit($card) {\n\t\t\t$this->_hand[] = $card;\n\t\t}",
"public function getHand() {\n\t\t\treturn $this->_hand;\n\t\t}",
"function setHandbook(array $handbooks): void\n {\n }",
"function drawHand(&$deck, &$hand) {\n\t$cardOne = drawACard($deck);\n\t$hand[] = $cardOne;\n\t$cardTwo = drawACard($deck);\n\t$hand[] = $cardTwo;\n\treturn $hand;\n}",
"public function removeHand() {\n\t\t\t$this->_hand[] = array();\n\t\t}",
"public function setCard(?bool $card): void\n {\n $this->card = $card;\n }",
"public function dealCardToHand(Player $player, HandBetPair $hand);",
"public function giveCard(Card $card)\n\t{\n\t\t$card->setGiven(true);\n\t\t$this->save($card, false);\n\t}",
"public function setDeck($cards=''){\n\t\tif (is_array($cards)){\n\t\t\t$this->deck=$cards;\n\t\t}\n\t}",
"public function setCardAux(Deck $deck) {\n\t\t$this->cardAux = $deck;\n\t}",
"public function drawHand(array $hands) {\n\n\t\t$hand = collect($hands)->random();\n\t\t$handClassName = $this->handPath.$hand;\n\t\t$this->hand = new $handClassName();\n\n\t\t$this->output($this->name.' has: '.$hand);\n\t}",
"public function testSetHandicape() {\n\n $obj = new Employes();\n\n $obj->setHandicape(true);\n $this->assertEquals(true, $obj->getHandicape());\n }",
"public function set_card(INT $_card){\n $this->_card = $_card;\n\n return $this;\n }",
"protected function get_hands() {\n return $this->hands;\n }",
"public function setCard(?string $card): self\n {\n $this->card = $card;\n\n return $this;\n }",
"public function initCard()\n {\n $baseCard = $this->getBaseCard();\n /*\n * fix return;\n */\n if(!$baseCard)\n return false;\n $this->current_hp = $this->hp;\n $this->current_name = $baseCard->name;\n $this->current_defense = $this->defense;\n $this->current_dmg_min = $this->dmg_min;\n $this->current_dmg_max = $this->dmg_max;\n $this->current_dmg_critical = $this->dmg_critical;\n $this->current_critical_chance = $this->critical_chance;\n $this->update();\n }",
"protected function setCards($cards)\n {\n $this->cards = $cards;\n\n return $this;\n }",
"public function setCardHiddenStand(Deck $deck) {\n\t\t$this->cardHiddenStand = $deck;\n\t}",
"public function setDeviceInHand($deviceInHand)\n {\n $this->deviceInHand = $deviceInHand;\n return $this;\n }",
"public function __construct() {\n\t\t$this->cardHand = new Deck();\n\t\t$this->cardHand->setName(\"Hand\");\n\t\t$this->cardHand->setState(Card::STATE_FACEDOWN);\n\n\t\t$this->cardPublicStand = new Deck();\n\t\t$this->cardPublicStand->setName(\"Market stand\");\n\t\t$this->cardPublicStand->setState(Card::STATE_FACEUP);\n\n\t\t$this->cardHiddenStand = new Deck();\n\t\t$this->cardHiddenStand->setName(\"Contraband Stash\");\n\t\t$this->cardHiddenStand->setState(Card::STATE_FACEDOWN);\n\n\t\t$this->cardAux = new Deck();\n\t\t$this->cardAux->setName(\"Aux Deck\");\n\t\t$this->cardAux->setState(Card::STATE_FACEDOWN);\n\t}",
"public function GetHandArray(){\r\n\t \r\n\t\treturn $this -> handArray;\r\n\t }",
"public function __construct($card)\n {\n $this->card = $card;\n }",
"function generateHand($deck) {\n shuffle($deck);\n $hand = array(); \n \n for ($i = 0; $i < 3; $i++) {\n $cardNum = array_pop($deck);\n $card = mapNumberToCard($cardNum); \n array_push($hand, $card); \n }\n \n return $hand; \n }",
"public function setCardPublicStand(Deck $deck) {\n\t\t$this->cardPublicStand = $deck;\n\t}",
"public function GetHands(){\r\n\t \r\n\t\treturn $this -> hands;\r\n\t }",
"public function __construct(GameBlackjack $game, int $hand)\n {\n $this->game = $game;\n $this->hand = $hand;\n }",
"public function get_card(){ return $this->_card;}",
"public function AddToHandArray($hand, $points ){\r\n\t \r\n\t\t$myHandArray = $this-> handArray;\r\n\t \r\n\t\tforeach($myHandArray as $hand){\r\n\t\t\t\r\n\t\t\t$handArray[$hand] = $points ;\r\n\t\t}\r\n\t\r\n\t }"
] |
[
"0.733613",
"0.68689877",
"0.6596367",
"0.65647614",
"0.64141387",
"0.6364075",
"0.6350349",
"0.6313771",
"0.61930555",
"0.6133168",
"0.6100967",
"0.59175795",
"0.58518934",
"0.58263254",
"0.58029276",
"0.5752071",
"0.5739936",
"0.57264936",
"0.56635404",
"0.5634038",
"0.56333894",
"0.5577658",
"0.5575507",
"0.55166507",
"0.5459947",
"0.5374898",
"0.5354196",
"0.5340786",
"0.53307736",
"0.5327721"
] |
0.8046725
|
0
|
gets the cardHand property
|
public function getCardHand() {
return $this->cardHand;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getHand() {\n\t\t\treturn $this->_hand;\n\t\t}",
"protected function get_hands() {\n return $this->hands;\n }",
"public function GetHandArray(){\r\n\t \r\n\t\treturn $this -> handArray;\r\n\t }",
"public function getCard() {\n return $this->card;\n }",
"public function getCard()\n {\n return $this->card;\n }",
"public function get_card(){ return $this->_card;}",
"public function GetHands(){\r\n\t \r\n\t\treturn $this -> hands;\r\n\t }",
"public function getCardholder()\n {\n return $this->cardholder;\n }",
"public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\n }",
"public function setCardHand(Deck $deck) {\n\t\t$this->cardHand = $deck;\n\t}",
"public function getCard(): Model\\CardSetting\n {\n return $this->card;\n }",
"public function displayHand() {\n\t\t\t$out = array();\n\t\t\tforeach ($this->_hand as $card) {\n\t\t\t\t$out[] = $card->name();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn implode(',',$out);\n\t\t}",
"public function getDeck()\n {\n return $this->deck;\n }",
"public static function getHand(): array\n {\n return array_slice(self::getShuffledDeck(), 0, 10);\n }",
"public function getCardAux() {\n\t\treturn $this->cardAux;\n\t}",
"public function getCard()\n {\n return $this->vaultHelper->getQuoteCard($this->getSubscription()->getQuote());\n }",
"public function getCard(): ?bool\n {\n return $this->card;\n }",
"public function get_background_card(){ return $this->_background_card;}",
"public function getCard(): ?string\n {\n return $this->card;\n }",
"function drawHand(&$deck, &$hand) {\n\t$cardOne = drawACard($deck);\n\t$hand[] = $cardOne;\n\t$cardTwo = drawACard($deck);\n\t$hand[] = $cardTwo;\n\treturn $hand;\n}",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function getCards()\n {\n return $this->cards;\n }",
"public function getCards()\n {\n return $this->cards;\n }",
"public function getCards()\n {\n return $this->cards;\n }",
"public function get_hp(){ return $this->_hp;}",
"public function getHandName($playerHand){\n $result = 'Scissor';\n\n if($playerHand == 1){\n $result = 'Rock';\n }elseif($playerHand == 2) {\n $result = 'Paper';\n }\n return $result;\n\n}",
"public function getIdCard()\n {\n return $this->id_card;\n }",
"public function getCardHiddenStand() {\n\t\treturn $this->cardHiddenStand;\n\t}",
"abstract public function getPlayerHand($player_id): array;"
] |
[
"0.8138414",
"0.7373564",
"0.71289414",
"0.71237665",
"0.7109974",
"0.70017254",
"0.68530434",
"0.6390686",
"0.6388169",
"0.63332355",
"0.6276845",
"0.62548023",
"0.623527",
"0.62267244",
"0.6201424",
"0.6170761",
"0.6156193",
"0.6149236",
"0.6070398",
"0.6068012",
"0.6044841",
"0.6044841",
"0.60288185",
"0.60288185",
"0.60288185",
"0.5999417",
"0.58442295",
"0.5842773",
"0.5821635",
"0.58179426"
] |
0.87864685
|
0
|
sets the cardPublicStand property
|
public function setCardPublicStand(Deck $deck) {
$this->cardPublicStand = $deck;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCardPublicStand() {\n\t\treturn $this->cardPublicStand;\n\t}",
"public function setCard(?bool $card): void\n {\n $this->card = $card;\n }",
"public function setPublic($public)\n {\n $this->_public = $public;\n }",
"public function setCardHiddenStand(Deck $deck) {\n\t\t$this->cardHiddenStand = $deck;\n\t}",
"public function setPublic( $public = true ){\n\t\t$this->public = $public;\n\t}",
"public function setAbstand($abstand)\n {\n $this->abstand = $abstand;\n return $this;\n }",
"public function setPublic()\n {\n $this->private = false;\n }",
"public function initCard()\n {\n $baseCard = $this->getBaseCard();\n /*\n * fix return;\n */\n if(!$baseCard)\n return false;\n $this->current_hp = $this->hp;\n $this->current_name = $baseCard->name;\n $this->current_defense = $this->defense;\n $this->current_dmg_min = $this->dmg_min;\n $this->current_dmg_max = $this->dmg_max;\n $this->current_dmg_critical = $this->dmg_critical;\n $this->current_critical_chance = $this->critical_chance;\n $this->update();\n }",
"public function getCardHiddenStand() {\n\t\treturn $this->cardHiddenStand;\n\t}",
"public function set_public($value) {\r\n $this->public = $value;\r\n data::add(\"public\", $this->public == \"\" ? 1 : $this->public, $this->table_fields);\r\n }",
"function setScad($scad)\n {\n $this->scad = $scad;\n }",
"public function set_card(INT $_card){\n $this->_card = $_card;\n\n return $this;\n }",
"public function stand(){\n $_SESSION['score'] = $this ->score;\n $this ->endturn = false;\n }",
"public function setCard(?string $card): self\n {\n $this->card = $card;\n\n return $this;\n }",
"public function setDefaultCard(?string $defaultCard): self\n {\n $this->defaultCard = $defaultCard;\n\n return $this;\n }",
"public function setPublic($value)\n {\n return $this->set('Public', $value);\n }",
"public function setPublic($value)\n {\n return $this->set('Public', $value);\n }",
"public function testSetHandicape() {\n\n $obj = new Employes();\n\n $obj->setHandicape(true);\n $this->assertEquals(true, $obj->getHandicape());\n }",
"function apply_public(&$sid, &$character, $public)\n {\n $character->public = $public ? 'y' : 'n';\n return $character->Save($sid);\n }",
"public function setCardInfo($dat,$key = false){\n if($key){\n $this->_cardinfo[$key] = $dat;\n }else{\n $this->_cardinfo = $dat;\n }\n }",
"public function setPublic($public) {\n $params = array(\"userid={$this->id}\",\n \"publickey={$this->publickey}\");\n switch ($public) {\n case true:\n $params[] = \"ispublic=1\";\n break;\n case false:\n $params[] = \"ispublic=0\";\n break;\n default:\n throw new validationErrorWbsException(\"Public should be set to true or false\");\n break;\n }\n $this->callWbs('user', 'update', $params);\n return true;\n }",
"public function stand()\n {\n return $this->hasOne('App\\Stand');\n }",
"public function setCardHand(Deck $deck) {\n\t\t$this->cardHand = $deck;\n\t}",
"public function updatePublic() {\n $this->Industry->updateSystemIndices();\n $this->Markets->updatePublic();\n $this->Usage->sendUsageStats();\n }",
"public function setIsFreeStanding($isFreeStanding)\n {\n $this->isFreeStanding = $isFreeStanding;\n }",
"public function setDisplay($display) {\n\t\t$this->display = $display;\n\t}",
"public function setDisplay($display) {\n\t\tparent::setDisplay($display);\n\t}",
"public function setCard($parameters = NULL) {\n\n if ($parameters === NULL) {\n $this->card = $parameters;\n return;\n }\n\n if (is_array($parameters)) {\n $this->card = (empty($parameters) ? NULL : new CreditCard($parameters));\n }\n }",
"public function setPublicShareKeyIDAndMasterKeyId() {\n\t\t$this->publicShareKeyId = $this->config->getAppValue('encryption',\n\t\t\t'publicShareKeyId');\n\t\tif (is_null($this->publicShareKeyId) || ($this->publicShareKeyId === '')) {\n\t\t\t$this->publicShareKeyId = 'pubShare_' . substr(md5(time()), 0, 8);\n\t\t\t$this->config->setAppValue('encryption', 'publicShareKeyId', $this->publicShareKeyId);\n\t\t}\n\n\t\t$this->masterKeyId = $this->config->getAppValue('encryption',\n\t\t\t'masterKeyId');\n\t\tif (is_null($this->masterKeyId) || ($this->masterKeyId === '')) {\n\t\t\t$this->masterKeyId = 'master_' . substr(md5(time()), 0, 8);\n\t\t\t$this->config->setAppValue('encryption', 'masterKeyId', $this->masterKeyId);\n\t\t}\n \t}",
"public function setSandbox($value);"
] |
[
"0.7326646",
"0.5868149",
"0.5834864",
"0.5825007",
"0.55942845",
"0.54274434",
"0.5426828",
"0.53833663",
"0.535373",
"0.5255028",
"0.52513903",
"0.5212412",
"0.5143107",
"0.5110338",
"0.5090328",
"0.5088997",
"0.5088997",
"0.5081407",
"0.50765204",
"0.504525",
"0.5013296",
"0.49786118",
"0.4978098",
"0.49565262",
"0.49536276",
"0.4947156",
"0.48949593",
"0.4861319",
"0.48361015",
"0.48297322"
] |
0.7957531
|
0
|
gets the cardPublicStand property
|
public function getCardPublicStand() {
return $this->cardPublicStand;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCardHiddenStand() {\n\t\treturn $this->cardHiddenStand;\n\t}",
"public function setCardPublicStand(Deck $deck) {\n\t\t$this->cardPublicStand = $deck;\n\t}",
"public function getCard() {\n return $this->card;\n }",
"public function getCard()\n {\n return $this->card;\n }",
"public function get_card(){ return $this->_card;}",
"public function stand()\n {\n return $this->hasOne('App\\Stand');\n }",
"public function getCard(): Model\\CardSetting\n {\n return $this->card;\n }",
"public function getStandard() {\n \n return Mage::getSingleton('CardstreamHosted/standard');\n \n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function getCardsn()\n {\n return $this->cardsn;\n }",
"public function getCardHand() {\n\t\treturn $this->cardHand;\n\t}",
"public function getCard(): ?string\n {\n return $this->card;\n }",
"public function getCardholder()\n {\n return $this->cardholder;\n }",
"public function getCard(): ?bool\n {\n return $this->card;\n }",
"public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\n }",
"public function get_background_card(){ return $this->_background_card;}",
"function getScad()\n {\n return $this->scad;\n }",
"public function getIsFreeStanding()\n {\n return $this->isFreeStanding;\n }",
"public function getCardanoSpecific()\n {\n return $this->cardano_specific;\n }",
"public function getCardcode()\n {\n return $this->cardcode;\n }",
"public function getIdCard()\n {\n return $this->id_card;\n }",
"function getDisplay() {\n return $this->display;\n }",
"public function getBlacksmithSeasonHardcore()\n {\n return $this->getData(__FUNCTION__, 0);\n }",
"public function getSeason(){\n if ($this->season == NULL){\n $rss = selectQueryGetAll($this->dsseason->select_query());\n $this->season = $this->dsseason->rdisplay($rss[0]['KOID']);\n }\n return $this->season;\n }",
"public function getDefaultCard(): ?string\n {\n return $this->defaultCard;\n }",
"public function getScorecard()\n {\n return $this->readOneof(3);\n }",
"function game()\r\n {\r\n return $this->Game;\r\n }",
"public function game()\n {\n return $this->game;\n }",
"public function getRaithSeinar()\n {\n \tif (null === $this->raithSeinar)\n \t{\n \t $path = __DIR__ . '/vcards/RaithSeinar.vcf';\n \n $parser = new VCardParser();\n $vcards = $parser->importFromFile($path);\n \n $this->assertCount(1, $vcards);\n\t $this->raithSeinar = $vcards[0];\n \t}\n\treturn $this->raithSeinar;\n }"
] |
[
"0.70460093",
"0.65770745",
"0.6432672",
"0.6374546",
"0.63014483",
"0.6193678",
"0.6096655",
"0.59466505",
"0.5854303",
"0.5854303",
"0.58394647",
"0.5747855",
"0.5709174",
"0.5707868",
"0.5692901",
"0.5686399",
"0.5610167",
"0.5552336",
"0.5457683",
"0.5440377",
"0.5437477",
"0.5434705",
"0.5389204",
"0.5386082",
"0.53220457",
"0.53143984",
"0.5302405",
"0.5249726",
"0.52154666",
"0.521207"
] |
0.8813287
|
0
|
sets the cardHiddenStand property
|
public function setCardHiddenStand(Deck $deck) {
$this->cardHiddenStand = $deck;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCardHiddenStand() {\n\t\treturn $this->cardHiddenStand;\n\t}",
"public function setHidden(){\n $this->_hidden = true;\n }",
"public function setCardPublicStand(Deck $deck) {\n\t\t$this->cardPublicStand = $deck;\n\t}",
"public function setHidden($hidden) {\n\t\t$this->hidden = $hidden;\n\t}",
"public function setHidden($hidden) {\n\t\t$this->hidden = $hidden;\n\t}",
"public function setHiddenFlag($hidden = true) {}",
"function hide()\n {\n $this->_hidden = true;\n }",
"public function setCard(?bool $card): void\n {\n $this->card = $card;\n }",
"public function setHidden($value = TRUE);",
"public function setCardHand(Deck $deck) {\n\t\t$this->cardHand = $deck;\n\t}",
"public function setIsHidden($flag)\n {\n $this->_isHidden = (bool) $flag;\n }",
"public function setConditionallyHidden($flag)\n {\n $this->_isConditionallyHidden = $flag;\n }",
"public function setIsNeutral(?bool $isNeutral): Card {\n $this->isNeutral = $isNeutral;\n return $this;\n }",
"public function setVisibility() {}",
"public function getCardPublicStand() {\n\t\treturn $this->cardPublicStand;\n\t}",
"public function setHidden($value)\n {\n return $this->set('Hidden', $value);\n }",
"function setScad($scad)\n {\n $this->scad = $scad;\n }",
"public function putInDeck()\n {\n $this->inPlay = false;\n $this->dealt = false;\n\n return $this;\n }",
"function setTypeAsHidden() {\n\t\t$this->type = \"hidden\";\n\t}",
"public function setIsFreeStanding($isFreeStanding)\n {\n $this->isFreeStanding = $isFreeStanding;\n }",
"public function setInvisibleFlag($invisible = true) {}",
"public function setHidden($var)\n {\n GPBUtil::checkBool($var);\n $this->hidden = $var;\n\n return $this;\n }",
"public function hidden(bool $hidden = true)\n {\n $this->hidden = $hidden;\n\n return $this;\n }",
"public function setHidden($hidden)\n {\n $this->AddAnnotation('hidden', $hidden);\n return $this;\n }",
"function hideExhibit(){\n\t\t$this->setVisible('0');\n\t\t$res = requete_sql(\"UPDATE exhibit SET visible = '\".$this->visible.\"' WHERE id = '\".$this->id.\"' \");\n\t\tif ($res) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function start() {\r\n\r\n $this->stepTick = $this->getMain()->getServer()->getTick();\r\n\r\n $count = count($this->players);\r\n\r\n $this->step = self::STEP_HIDE;\r\n\r\n $this->seekersCount = ceil($count * ($this->getSeekersPercentage() / 100)); // Minimum $this->getSeekersPercentage() percents of the players (inimum because if there are less than $this->getSeekersPercentage(), then there could be no seeker)\r\n\r\n $this->hidersLeft = count($this->players) - $this->seekersCount;\r\n\r\n\r\n\r\n shuffle($this->players);\r\n\r\n $i = 0;\r\n\r\n foreach($this->players as $p) {\r\n\r\n if($i < $this->seekersCount) {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_SEEK;\r\n\r\n $this->players[$i]->sendTip(\"§4You're a seeker.\");\r\n\r\n } else {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_HIDE;\r\n\r\n $this->players[$i]->sendTip(\"§4You're an hider.\");\r\n\r\n }\r\n\r\n $i++;\r\n\r\n }\r\n\r\n }",
"public function setHidden(array $hidden)\n {\n $this->hidden = $hidden;\n\n return $this;\n }",
"public function setHidden(array $hidden)\n {\n $this->hidden = $hidden;\n\n return $this;\n }",
"public function hide() {\n\t\treturn true;\n\t}",
"public function hide() {\n\t\treturn true;\n\t}"
] |
[
"0.7393",
"0.62217224",
"0.6155269",
"0.59672123",
"0.59672123",
"0.5929089",
"0.576504",
"0.5703067",
"0.5634171",
"0.5596449",
"0.55069166",
"0.5465975",
"0.5432022",
"0.52958405",
"0.52573097",
"0.5240549",
"0.51665354",
"0.51603115",
"0.51486665",
"0.51213497",
"0.5087043",
"0.5042904",
"0.50375426",
"0.5015348",
"0.50150603",
"0.49838746",
"0.49599493",
"0.49599493",
"0.49320313",
"0.49320313"
] |
0.8119788
|
0
|
gets the cardHiddenStand property
|
public function getCardHiddenStand() {
return $this->cardHiddenStand;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCardPublicStand() {\n\t\treturn $this->cardPublicStand;\n\t}",
"public function setCardHiddenStand(Deck $deck) {\n\t\t$this->cardHiddenStand = $deck;\n\t}",
"protected function getHidden()\n {\n return $this->hidden;\n }",
"public function getHidden()\n {\n return $this->hidden;\n }",
"public function getHidden()\n {\n return $this->hidden;\n }",
"public function getHidden()\n {\n return $this->hidden;\n }",
"public function getHidden()\n {\n return $this->hidden;\n }",
"public function getHidden()\n\t{\n\t\treturn $this->hidden;\n\t}",
"public function getHidden(){\n return $this->_hidden;\n }",
"public function getHidden() {\n\t\treturn $this->hidden;\n\t}",
"public function getHidden() {\n\t\treturn $this->hidden;\n\t}",
"public function get_dealedcardnr() {\n return $this->dealed_cards;\n }",
"public function getHidden()\n {\n return isset($this->hidden) ? $this->hidden : false;\n }",
"public function getCardHand() {\n\t\treturn $this->cardHand;\n\t}",
"public function getDeck()\n {\n return $this->deck;\n }",
"public function getCard() {\n return $this->card;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function getHiddenFlag() {}",
"public function getCard()\n {\n return $this->card;\n }",
"public function getIsFreeStanding()\n {\n return $this->isFreeStanding;\n }",
"public function getHidden(): bool;",
"public function getCard(): ?bool\n {\n return $this->card;\n }",
"public function getBlacksmithSeasonHardcore()\n {\n return $this->getData(__FUNCTION__, 0);\n }",
"public function getCardholder()\n {\n return $this->cardholder;\n }",
"public function getOpac_hide()\n {\n return $this->opac_hide;\n }",
"public function getCard(): Model\\CardSetting\n {\n return $this->card;\n }",
"function is_hidden() {\n return $this->hidden;\n }",
"function is_hidden() {\n return $this->hidden;\n }",
"function is_hidden() {\n return $this->hidden;\n }"
] |
[
"0.6972929",
"0.6887469",
"0.6433971",
"0.63276243",
"0.63276243",
"0.63276243",
"0.63276243",
"0.62242395",
"0.62220734",
"0.6197236",
"0.6197236",
"0.61143446",
"0.608994",
"0.6032849",
"0.59027445",
"0.58987993",
"0.58865905",
"0.58865905",
"0.5873006",
"0.58670604",
"0.5770395",
"0.56787014",
"0.5664093",
"0.5654698",
"0.56455296",
"0.56432116",
"0.55908287",
"0.5583355",
"0.5583355",
"0.5583355"
] |
0.9026521
|
0
|
sets the cardAux property
|
public function setCardAux(Deck $deck) {
$this->cardAux = $deck;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCardAux() {\n\t\treturn $this->cardAux;\n\t}",
"public function initCard()\n {\n $baseCard = $this->getBaseCard();\n /*\n * fix return;\n */\n if(!$baseCard)\n return false;\n $this->current_hp = $this->hp;\n $this->current_name = $baseCard->name;\n $this->current_defense = $this->defense;\n $this->current_dmg_min = $this->dmg_min;\n $this->current_dmg_max = $this->dmg_max;\n $this->current_dmg_critical = $this->dmg_critical;\n $this->current_critical_chance = $this->critical_chance;\n $this->update();\n }",
"public function get_card(){ return $this->_card;}",
"public function setCard(?bool $card): void\n {\n $this->card = $card;\n }",
"public function get_background_card(){ return $this->_background_card;}",
"public function setCardInfo($dat,$key = false){\n if($key){\n $this->_cardinfo[$key] = $dat;\n }else{\n $this->_cardinfo = $dat;\n }\n }",
"public function __construct($card)\n {\n $this->card = $card;\n }",
"function __construct(Deck $deck){\n\n $this->cards = [];\n array_push($this->cards, $deck->drawCard(), $deck->drawCard()); // twice because 2 cards\n }",
"function CardInfo(){\r\n }",
"public function set_card(INT $_card){\n $this->_card = $_card;\n\n return $this;\n }",
"public function addCard()\n {\n }",
"public function getCard() {\n return $this->card;\n }",
"public function card();",
"public function __construct() //card is our node value\n\t{\n\t\t$this->head = null; // starts here...\n\t}",
"public function unsetCustomerCardId(): void\n {\n $this->customerCardId = [];\n }",
"public function __construct() {\n\t\t$this->cardHand = new Deck();\n\t\t$this->cardHand->setName(\"Hand\");\n\t\t$this->cardHand->setState(Card::STATE_FACEDOWN);\n\n\t\t$this->cardPublicStand = new Deck();\n\t\t$this->cardPublicStand->setName(\"Market stand\");\n\t\t$this->cardPublicStand->setState(Card::STATE_FACEUP);\n\n\t\t$this->cardHiddenStand = new Deck();\n\t\t$this->cardHiddenStand->setName(\"Contraband Stash\");\n\t\t$this->cardHiddenStand->setState(Card::STATE_FACEDOWN);\n\n\t\t$this->cardAux = new Deck();\n\t\t$this->cardAux->setName(\"Aux Deck\");\n\t\t$this->cardAux->setState(Card::STATE_FACEDOWN);\n\t}",
"public function initializeCards()\n {\n\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $this->deckofCards[$i][$j] = $this->rank[$j].\" \".$this->suits[$i];\n }\n }\n return $this->deckofCards;\n }",
"public function getCard()\n {\n return $this->card;\n }",
"public function setCard($parameters = NULL) {\n\n if ($parameters === NULL) {\n $this->card = $parameters;\n return;\n }\n\n if (is_array($parameters)) {\n $this->card = (empty($parameters) ? NULL : new CreditCard($parameters));\n }\n }",
"protected function init()\n\t{\n\t\t$this->upVector = array();\n\t\t$this->downVector = array();\n\t\t$this->modifiedA = array();\n\t\t$this->modifiedB = array();\n\t}",
"public function resetDeck(){\n $this->startCard = new Card(14);\n\n for ($i = 1; $i <= 13; $i++) {\n if ($i == 6 or $i == 9) {\n continue;\n }\n else {\n if ($i == 1) {\n for ($j = 0; $j < 5; $j++) {\n $card = new Card($i);\n $this->cards[] = $card;\n }\n }\n else {\n for ($j = 0; $j < 4; $j++) {\n $card = new Card($i);\n $this->cards[] = $card;\n }\n }\n }\n }\n\n //Shuffle deck\n shuffle($this->cards);\n\n\n // card back\n $this->cardDrawn = new Card(14);\n }",
"public function setCard($index,Card $val) :void\n {\n if($index>=0 && $index<=47)\n $this->cards[$index]=$val;\n }",
"public function prepareCard()\r\n\t\t{\r\n\t\t\t$mysqli = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);\r\n\t\t\t$query = 'SELECT * FROM card WHERE id_votes =\"'.$this->voteId.'\" and gtv=\"'.$this->cardId.'\" ORDER BY id_option ASC ';\r\n\t\t\t\r\n\t\t\tif ($result = $mysqli->query($query))\r\n\t\t\t{\r\n\t\t\t\twhile($obj = $result->fetch_object())\r\n\t\t\t\t{\r\n\t\t\t\t\t$card = new Card($obj->id,$this->voteId,$obj->id_option,$obj->gtv,$obj->Pog,$obj->gyv,$obj->sig);\r\n\t\t\t\t\tarray_push($this->cardList,$card);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t$mysqli->close(); \r\n\t\t}",
"public function __construct()\n {\n parent::__construct();\n $this->redCardsJSON = $this->encodeCards($this->redCards);\n $this->greenCardsJSON = $this->encodeCards($this->greenCards);\n }",
"public function setDeck($cards=''){\n\t\tif (is_array($cards)){\n\t\t\t$this->deck=$cards;\n\t\t}\n\t}",
"public function setCard(?string $card): self\n {\n $this->card = $card;\n\n return $this;\n }",
"public function init()\r\n {\r\n parent::init();\r\n $this->visible = true;\r\n $this->descriptionashint = true;\r\n $this->active = false;\r\n }",
"public function __construct()\n {\n $this->suits = \\Config::get('enums.card_suits');\n $this->values = \\Config::get('enums.card_values');\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function inCard()\n {\n return $this->inCard;\n }"
] |
[
"0.73438436",
"0.60229087",
"0.573659",
"0.5676237",
"0.5575835",
"0.5557925",
"0.55552787",
"0.5421963",
"0.52842766",
"0.5218932",
"0.5191987",
"0.5138346",
"0.50953895",
"0.5093687",
"0.5025966",
"0.49885222",
"0.49221224",
"0.48993692",
"0.48910022",
"0.4843302",
"0.4826425",
"0.47907528",
"0.4738439",
"0.47345355",
"0.4715976",
"0.4686481",
"0.46599814",
"0.46269676",
"0.46186286",
"0.46186286"
] |
0.79387164
|
0
|
gets the cardAux property
|
public function getCardAux() {
return $this->cardAux;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function get_card(){ return $this->_card;}",
"public function getCard() {\n return $this->card;\n }",
"public function get_background_card(){ return $this->_background_card;}",
"public function getCard()\n {\n return $this->card;\n }",
"public function setCardAux(Deck $deck) {\n\t\t$this->cardAux = $deck;\n\t}",
"public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\n }",
"public function getIdCard()\n {\n return $this->id_card;\n }",
"public function getCard(): Model\\CardSetting\n {\n return $this->card;\n }",
"public function getCardholder()\n {\n return $this->cardholder;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"function CardInfo(){\r\n }",
"public function getCard(): ?string\n {\n return $this->card;\n }",
"public function getCard(): ?bool\n {\n return $this->card;\n }",
"public function getCardanoSpecific()\n {\n return $this->cardano_specific;\n }",
"public function initCard()\n {\n $baseCard = $this->getBaseCard();\n /*\n * fix return;\n */\n if(!$baseCard)\n return false;\n $this->current_hp = $this->hp;\n $this->current_name = $baseCard->name;\n $this->current_defense = $this->defense;\n $this->current_dmg_min = $this->dmg_min;\n $this->current_dmg_max = $this->dmg_max;\n $this->current_dmg_critical = $this->dmg_critical;\n $this->current_critical_chance = $this->critical_chance;\n $this->update();\n }",
"public function getCidCard()\n {\n return $this->cid_card;\n }",
"public function getCardnumber()\n {\n return $this->cardnumber;\n }",
"public function getCard()\n {\n return $this->vaultHelper->getQuoteCard($this->getSubscription()->getQuote());\n }",
"public function getIdCardImg()\n {\n return $this->id_card_img;\n }",
"public function getNameCard()\n {\n return $this->get(self::_NAME_CARD);\n }",
"public function getNameOnCard()\n {\n return $this->name_on_card;\n }",
"public function get_url_background_card(){ return $this->_url_background_card;}",
"public function getCreditCard()\n {\n return $this->creditCard;\n }",
"public function getCardVueIdAttribute ()\n {\n $this->card_vue_id = $this->card_type . '_' . $this->tweet_id;\n return( $this->card_vue_id );\n }",
"public function cardName()\n {\n return $this->bean->card()->name;\n }",
"public function get_dealedcardnr() {\n return $this->dealed_cards;\n }",
"public function getCardHand() {\n\t\treturn $this->cardHand;\n\t}",
"public function getCardReference()\n {\n return $this->data->creditCard->token;\n }",
"public function getCreditCard()\n\t{\n\t\treturn $this->credit_card;\n\t}"
] |
[
"0.7158485",
"0.6853645",
"0.6795238",
"0.6763302",
"0.62864697",
"0.62478215",
"0.60203975",
"0.60121685",
"0.6001583",
"0.60014176",
"0.60014176",
"0.5978636",
"0.58844763",
"0.57352734",
"0.5727707",
"0.57038575",
"0.56774026",
"0.56569505",
"0.55954164",
"0.55781686",
"0.55703694",
"0.55636793",
"0.55494267",
"0.5513252",
"0.551092",
"0.55009764",
"0.5468437",
"0.54532933",
"0.54446816",
"0.54444605"
] |
0.8726073
|
0
|
sets the doneTurn property
|
public function setDoneTurn($bool) {
$this->doneTurn = $bool;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getDoneTurn() {\n\t\treturn $this->doneTurn;\t\n\t}",
"private function changeTurn()\n {\n $this->_turn = 1 - $this->_turn; // 1-0 = 1, 1-1 = 0\n }",
"public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}",
"public function turn()\n {\n }",
"public function done(){\n\t\t$this->done=true;\n\t}",
"public function tick(){\n\t\tif($this->status !== self::NORMAL){\n\t\t\t$this->remaining_turns--;\n\t\t\tif($this->remaining_turns <= 0){\n\t\t\t\t$this->status = self::NORMAL;\n\t\t\t}\n\t\t}\n\t}",
"public function done()\n {\n $this->setStatus(self::STATUS_DONE);\n }",
"public function tourSuivant() {\n\t\t\t$this -> turn = ($this-> turn == $this -> j1) ? $this -> j2 : $this -> j1 ;\n\t\t}",
"public function nextTurn(){\n $games = new Games($this->site);\n $games->nextTurn($this->game->getGameId());\n $this->game->update_turn();\n }",
"function stInterPlayerTurn() {\n \n // Give him extra time for his actions to come\n self::giveExtraTime(self::getActivePlayerId());\n \n // Does he plays again?\n if (self::getGameStateValue('first_player_with_only_one_action')) {\n // First turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('first_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('second_player_with_only_one_action')) {\n // 4 players at least and this is the second turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('second_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('has_second_action')) {\n // The player took his first action and has another one\n $next_player = false;\n self::setGameStateValue('has_second_action', 0);\n }\n else {\n // The player took his second action\n $next_player = true;\n self::setGameStateValue('has_second_action', 1);\n }\n if ($next_player) { // The turn for the current player is over\n // Reset the flags for Monument special achievement\n self::resetFlagsForMonument();\n \n // Activate the next player in turn\n $this->activeNextPlayer();\n $player_id = self::getActivePlayerId();\n self::setGameStateValue('active_player', $player_id);\n }\n self::notifyGeneralInfo('<!--empty-->');\n self::trace('interPlayerTurn->playerTurn');\n $this->gamestate->nextState();\n }",
"public function stand(){\n $_SESSION['score'] = $this ->score;\n $this ->endturn = false;\n }",
"public function doneAction()\n\t{\n\t\n\t}",
"private function endGame()\n {\n $this->hasWon = true;\n $this->calculatePoints();\n $this->setMessageToPlayer();\n }",
"public function completeTour()\n {\n $userOnBoarding = auth()->user()->userOnBoarding;\n $userOnBoarding->completed_tour = true;\n $userOnBoarding->save();\n Session::forget('first_login');\n }",
"protected function done()\n {\n }",
"private function fight() {\n while(!$this->winner) {\n // Check current field conditions\n // Check abilities\n $this->playTurn();\n // End turn\n if($this->getNextFighter()->health <= 0) {\n $this->winner_fighter = $this->fighter_current;\n $this->winner = true;\n break;\n }\n $this->nextFighter();\n\n // $this->winner_fighter = $this->fighter_current;\n // $this->winner = true;\n }\n }",
"public function endTurn($clearSerie = true) : void\n {\n if ($clearSerie) {\n $this->player->clearSerie();\n }\n\n $this->player->endTurn();\n $this->cpu->toss(); // automatically ends turn\n }",
"public function markAsDone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 1\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}",
"public function testStartNextTurn()\n {\n $this->game->startNextTurn();\n $gamestate = $this->game->getGamestate();\n\n $exp = 1;\n $res = $gamestate[\"turnCounter\"];\n $this->assertEquals($exp, $res);\n\n $exp = 0;\n $res = $gamestate[\"currentPoints\"];\n $this->assertEquals($exp, $res);\n\n $exp = false;\n $res = $gamestate[\"turnIsOver\"];\n $this->assertEquals($exp, $res);\n\n $exp = $this->game->getPlayer($gamestate[\"turnCounter\"]);\n $res = $gamestate[\"active\"];\n $this->assertEquals($exp, $res);\n\n $this->game->startNextTurn();\n $gamestate = $this->game->getGamestate();\n\n $exp = 0;\n $res = $gamestate[\"turnCounter\"];\n $this->assertEquals($exp, $res);\n }",
"public function hasGameFinished()\n {\n return $this->hasWon;\n }",
"public function doneAction()\n {\n \n }",
"public function setTaskDone()\n {\n // Simply unlink our task file.\n unlink($this->taskFilePath);\n }",
"public function setGoal()\n {\n }",
"public function setFinished($value)\t\r\n\t{\r\n\t\tif ( is_bool($value) )\r\n\t\t{\r\n\t\t\t$this->finished = $value;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new \\InvalidArgumentException(\"param 1 must be of type bool\");\r\n\t\t}\r\n\t}",
"function done() {\n return $this->currentState === self::DONE;\n }",
"public function getTurn() {\n\t\t\treturn $this -> turn;\n\t\t}",
"private function _pass()\n\t{\n\t\t// Save move\n\t\t$this->Move->create();\n\t\t$this->Move->set('game_id', $this->id);\n\t\t$this->Move->set('player_id', $this->data['Game']['active_player']);\n\t\t$this->Move->set('notation', 'pass');\n\t\t$this->Move->save();\n\t\t\n\t\t// Change active player\n\t\t$this->_changeActivePlayer();\n\t\t\n\t\t// Success\n\t\treturn true;\n\t}",
"public function setDone($done)\n {\n $this->done = $done;\n\n return $this;\n }",
"public function turnRight();",
"public function turn()\n {\n $this->setError('The SMTP TURN command is not implemented');\n $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);\n return false;\n }"
] |
[
"0.7139929",
"0.69734335",
"0.66704863",
"0.6387826",
"0.6152552",
"0.5994157",
"0.5900429",
"0.5856282",
"0.5693773",
"0.56543535",
"0.5653999",
"0.5563116",
"0.55257314",
"0.55206513",
"0.5467925",
"0.54368305",
"0.5297161",
"0.5286131",
"0.5274658",
"0.52740514",
"0.522601",
"0.5205254",
"0.5172185",
"0.51638997",
"0.5126562",
"0.50974363",
"0.50967675",
"0.50956094",
"0.5069118",
"0.5011202"
] |
0.80285144
|
0
|
gets the doneTurn property
|
public function getDoneTurn() {
return $this->doneTurn;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getTurn() {\n\t\t\treturn $this -> turn;\n\t\t}",
"public function setDoneTurn($bool) {\n\t\t$this->doneTurn = $bool;\n\t}",
"public function hasGameFinished()\n {\n return $this->hasWon;\n }",
"public function getTurnover()\n {\n return $this->_turnover;\n }",
"public function getDone()\n {\n return $this->done;\n }",
"public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}",
"private function changeTurn()\n {\n $this->_turn = 1 - $this->_turn; // 1-0 = 1, 1-1 = 0\n }",
"public function getDoneFlag()\r\n {\r\n return $this->doneFlag;\r\n }",
"public function getTurn()\n {\n if (is_null($this->turn)) {\n throw new Exception('É necessário abrir o turn antes de recuperá-lo');\n }\n return $this->turn;\n }",
"private function determineWhoseTurn()\n {\n $query = \"SELECT player, event_value FROM events\n WHERE game_id = ? AND event_type = 'shot' ORDER BY id DESC LIMIT 1\";\n $result = $this->oDB->getFirst($query, array($this->oData->getIdGames()));\n\n if (empty($result)) {\n $whoseTurn = 1;\n } elseif ($result['player'] == $this->oData->getPlayerNumber()) {\n $whoseTurn = in_array($result['event_value'], $this->oData->getOtherShips())\n ? $this->oData->getPlayerNumber() : $this->oData->getOtherNumber();\n } else {\n $whoseTurn = in_array($result['event_value'], $this->oData->getPlayerShips())\n ? $this->oData->getOtherNumber() : $this->oData->getPlayerNumber();\n }\n\n $this->oData->setWhoseTurn($whoseTurn);\n }",
"public function getFinished()\n {\n return $this->Finished;\n }",
"public function getCheckDone()\n {\n return $this->checkDone;\n }",
"public function passed(){\n return $this->_passed; //return boolean\n }",
"public function done()\r\n {\r\n return $this->done;\r\n }",
"public function getDefender()\n {\n return $this->_turn === 0 ? $this->_army2 : $this->_army1;\n }",
"public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }",
"public function passed() {\n\t\treturn $this->pass;\n\t}",
"public function isDone(){\n\t\treturn $this->done;\n\t}",
"public function get_goal() {\r\n\t\tif ( ! isset( $this->goal ) ) {\r\n\t\t\t$this->goal = $this->has_goal() ? $this->get( 'goal' ) : false;\r\n\t\t}\r\n\r\n\t\treturn $this->goal;\r\n\t}",
"public function passed()\n {\n return $this->passed;\n }",
"public function passed() {\n return $this->_passed;\n }",
"public function getFinished()\n {\n return $this->finished;\n }",
"function getEnded() \n {\n return $this->instance->getEnded();\n }",
"public function getCompleted() {\n\t\treturn $this->_completed;\n\t}",
"function done() {\n return $this->currentState === self::DONE;\n }",
"public function getWon()\n {\n return $this->won;\n }",
"public function battleFinished()\n {\n return ($this->_army1->isDefeated() or $this->_army2->isDefeated());\n }",
"public function isFinished()\n {\n return $this->isWinner('X') || $this->isWinner('O') || $this->isDraw();\n }",
"public function tourSuivant() {\n\t\t\t$this -> turn = ($this-> turn == $this -> j1) ? $this -> j2 : $this -> j1 ;\n\t\t}",
"public function getTurnsLeft()\n {\n return $this->turnsLeft;\n }"
] |
[
"0.72615784",
"0.6948088",
"0.6380359",
"0.6176513",
"0.61196864",
"0.60699415",
"0.60566384",
"0.59699273",
"0.5931806",
"0.59226954",
"0.5894798",
"0.5887663",
"0.5829694",
"0.5816089",
"0.5784963",
"0.5779195",
"0.56541973",
"0.5651403",
"0.56309295",
"0.5630488",
"0.5610841",
"0.55875343",
"0.5561012",
"0.55423194",
"0.5515856",
"0.55077356",
"0.5500327",
"0.548695",
"0.54864144",
"0.54804826"
] |
0.87266946
|
0
|
Add a URI to the TRACE route
|
public function trace($uri, $action)
{
$asArray = (strpos($uri, '#') !== false);
$params = $this->getUriParams($uri);
$uri = $this->getUri($uri);
$this->routes['trace'][$uri] = array(
'action' => $action,
'params' => $params,
'asArray' => $asArray
);
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function trace($uri = NULL, $vars = NULL) {\n\t\tif (! empty ( $uri ))\n\t\t\t$this->uri = $uri;\n\t\tif (! empty ( $vars ) && is_array ( $vars ))\n\t\t\t$vars = http_build_query ( $vars );\n\t\tif (empty ( $this->query ))\n\t\t\t$this->query = $vars;\n\t\telse if (! empty ( $vars ))\n\t\t\t$this->query .= \"&\" . $vars;\n\t\tif (! empty ( $this->query ))\n\t\t\t$this->uri .= \"?\" . $this->query;\n\t\t$this->method = \"TRACE\";\n\t\t$this->request_body = NULL;\n\t\tforeach ( $this->request_headers as $k => $v ) {\n\t\t\tif (in_array ( $k, $this->entity_headers ))\n\t\t\t\tunset ( $this->request_headers [$k] );\n\t\t}\n\t\t$this->send ();\n\t\treturn $this->status_code;\n\t}",
"public static function trace($url, $headers = [], $options = [])\n {\n }",
"protected function routeToURI(){\n\t\t$args = func_get_args();\n\t\treturn call_user_func_array(array('Router', 'routeToURI'), $args);\n\t}",
"public function trace($message)\n {\n }",
"public function route()\n {\n $args = func_get_args();\n\n return route($this->config('route_name_prefix', 'logviewer.') . array_shift($args), ...$args);\n }",
"public function addUriToFilter($uri)\n\t{\n\t\t$blacklistFilename = $this->getBlacklistFilename();\n\t\t$fh = @fopen($blacklistFilename, 'a+');\n\t\tif(empty($fh))\n\t\t{\n\t\t\tthrow new Exception(\"Could not append to the blacklist file: $blacklistFilename (in \".getcwd().\")\");\n\t\t}\n\t\tfwrite($fh, \"$uri\\n\"); //appending new line to the file\n\t\tfclose($fh);\n\t\tchmod($blacklistFilename, 0664);\n\t}",
"public function addAuthorization($uri) {\n\t\t$this->routes[$uri] = $uri;\n\t}",
"function _trace($message) {\n if ($trace = TRUE) {\n _log($message);\n } \n}",
"public function trace( $sURL )\n\t\t{\n\t\t\treturn $this->request( \"trace\", $sURL );\n\t\t}",
"function hook_uuid_menu_path_to_uri_alter($path, &$uri) {\n\n}",
"public function trace()\n {\n if (!$this->cfg['collect']) {\n return;\n }\n $args = \\func_get_args();\n $meta = $this->internal->getMetaVals(\n $args,\n array(\n 'caption' => 'trace',\n 'channel' => $this->cfg['channelName'],\n 'columns' => array('file','line','function'),\n )\n );\n $backtrace = $this->errorHandler->backtrace();\n // toss \"internal\" frames\n for ($i = 1, $count = \\count($backtrace)-1; $i < $count; $i++) {\n $frame = $backtrace[$i];\n $function = isset($frame['function']) ? $frame['function'] : '';\n if (!\\preg_match('/^'.\\preg_quote(__CLASS__).'(::|->)/', $function)) {\n break;\n }\n }\n $backtrace = \\array_slice($backtrace, $i-1);\n // keep the calling file & line, but toss ->trace or ::_trace\n unset($backtrace[0]['function']);\n $this->appendLog('trace', array($backtrace), $meta);\n }",
"private static function addRoute($method, $uri, $controller)\n {\n $route = array(\n 'method' => $method,\n 'uri' => $uri,\n 'controller' => $controller\n );\n array_push(self::$RoutingTable, $route);\n }",
"public static function to($uri)\n {\n header(\"location: $uri\");\n }",
"public function isTrace()\n {\n return $this->getMethod() === 'TRACE';\n }",
"public function isTrace()\n\t{\n\t\treturn $this->httpMethod() == self::MethodTrace;\n\t}",
"protected function location($uri) {\n location($uri);\n }",
"final public function getTraceAsString()\n {\n return 'trace';\n }",
"final function getTrace();",
"public static function setUri(string $uri): void {\r\n $_SERVER['REQUEST_URI'] = $uri;\r\n }",
"public function setUri($uri) {}",
"public function trace($no = false) {\n\t\t$no = $no !== false ? $no : $this->pointer;\n\n\t\tif($no < 0) {\n\t\t\t$no = $no / -1;\t// invert sign\n\t\t\t$no = $this->pointer - $no;\n\t\t}\n\n\t\t$path = '/';\n\t\tforeach($this->segments as $key => $val) {\n\t\t\tif($key >= $no) { break; } else {\n\t\t\t\t$path .= $val.'/';\n\t\t\t}\n\t\t}\n\t\treturn $path;\n\t}",
"public function register_route($route_namespace, $route, $route_args, $override = \\false)\n {\n }",
"public function route(string $requestUri, string $requestMethod);",
"public function send_through_proxy($uri)\n {\n }",
"public function setUri($uri);",
"function trace( $message )\n{\n\t$registry = Registry::getInstance();\n\tif ( $registry->keyExists( 'trace_messages' ) )\n\t{\n\t\t$trace_messages = $registry->get( 'trace_messages' );\n\t}\n\t$trace_messages[] = $message;\n\t$registry->set( \"trace_messages\", $trace_messages );\n}",
"function add_rewrite_endpoint($name, $places, $query_var = \\true)\n {\n }",
"public function isTrace()\n {\n return $this->method === self::METHOD_TRACE;\n }",
"public function add(UriInterface $uri);",
"public function setURI($uri) {\n $this->uri = $uri;\n }"
] |
[
"0.6136281",
"0.5443085",
"0.5188549",
"0.5139992",
"0.5084456",
"0.50726724",
"0.5026108",
"0.50160164",
"0.4927971",
"0.48765275",
"0.48758873",
"0.4856754",
"0.48061505",
"0.47663236",
"0.4724584",
"0.47089067",
"0.46667516",
"0.4656588",
"0.46543708",
"0.4625508",
"0.46139687",
"0.46084884",
"0.45993665",
"0.45821872",
"0.45738232",
"0.45669034",
"0.45651862",
"0.45588243",
"0.45466292",
"0.4545995"
] |
0.61729103
|
0
|
Add a URI to the CONNECT route
|
public function connect($uri, $action)
{
$asArray = (strpos($uri, '#') !== false);
$params = $this->getUriParams($uri);
$uri = $this->getUri($uri);
$this->routes['connect'][$uri] = array(
'action' => $action,
'params' => $params,
'asArray' => $asArray
);
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function connect($route, $args = array())\n\t\t{\n\t\t\t$route_bits = explode(\"/\", trim($route, \"/\"));\n\t\t\t\n\t\t\t$new_route['path'] = $route_bits;\n\t\t\t$new_route['args'] = $args;\n\t\t\t\n\t\t\tarray_push($this->_routes, $new_route);\n\t\t}",
"function connect($route, $default = null) {\r\n\t\t$parsed = $names = array();\r\n\r\n\t\tif (defined('CAKE_ADMIN') && $default == null) {\r\n\t\t\tif ($route == CAKE_ADMIN) {\r\n\t\t\t\t$this->routes[] = $this->__admin;\r\n\t\t\t\t$this->__admin = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$r = null;\r\n\t\tif (($route == '') || ($route == '/')) {\r\n\t\t\t$regexp='/^[\\/]*$/';\r\n\t\t\t$this->routes[] = array($route, $regexp, array(), $default);\r\n\t\t} else {\r\n\t\t\t$elements = array();\r\n\r\n\t\t\tforeach(explode('/', $route)as $element) {\r\n\t\t\t\tif (trim($element))\r\n\t\t\t\t$elements[] = $element;\r\n\t\t\t}\r\n\r\n\t\t\tif (!count($elements)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tforeach($elements as $element) {\r\n\r\n\t\t\t\tif (preg_match('/^:(.+)$/', $element, $r)) {\r\n\t\t\t\t\t$parsed[]='(?:\\/([^\\/]+))?';\r\n\t\t\t\t\t$names[] =$r[1];\r\n\t\t\t\t} elseif(preg_match('/^\\*$/', $element, $r)) {\r\n\t\t\t\t\t$parsed[] = '(?:\\/(.*))?';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$parsed[] = '/' . $element;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$regexp='#^' . join('', $parsed) . '[\\/]*$#';\r\n\t\t\t$this->routes[] = array($route, $regexp, $names, $default);\r\n\t\t}\r\n\t\treturn $this->routes;\r\n\t}",
"public function addAuthorization($uri) {\n\t\t$this->routes[$uri] = $uri;\n\t}",
"abstract public function addRoute($url, $ctrl, $mth);",
"public function testConnectShortStringSyntax(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/articles/view', 'Admin/Articles::view');\n $result = Router::parseRequest($this->makeRequest('/admin/articles/view', 'GET'));\n unset($result['_route']);\n $expected = [\n 'pass' => [],\n 'prefix' => 'Admin',\n 'controller' => 'Articles',\n 'action' => 'view',\n 'plugin' => null,\n '_matchedRoute' => '/admin/articles/view',\n\n ];\n $this->assertEquals($result, $expected);\n }",
"abstract function connect ();",
"public function connect(Request $request, string $provider): RedirectResponse\n {\n return $this->handleProviderRedirect($request, 'connect', $provider);\n }",
"public abstract function connect();",
"function add_rewrite_endpoint($name, $places, $query_var = \\true)\n {\n }",
"public static function connect($route, $defaults = [], $options = [])\n {\n static::$initialized = true;\n static::scope('/', function ($routes) use ($route, $defaults, $options) {\n $routes->connect($route, $defaults, $options);\n });\n }",
"public function testUrlWritingWithPrefixesAndCustomRoutes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/admin/login',\n ['controller' => 'Users', 'action' => 'login', 'prefix' => 'Admin']\n );\n $request = new ServerRequest([\n 'url' => '/',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Posts',\n 'action' => 'index',\n 'prefix' => 'Admin',\n ],\n 'webroot' => '/',\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n }",
"abstract function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"public function add($scheme, $port = null);",
"function add_urls() {\n\tadd_rewrite_rule( '^sso-login/?', 'index.php?sso-login=sso-login', 'top' );\n add_rewrite_endpoint( 'sso-login', EP_PERMALINK);\n\n\t// URLs for step 2 of webserver oauth flow\n\tadd_rewrite_rule( '^sso-callback/?', 'index.php?sso-callback=sso-callback', 'top' );\n add_rewrite_endpoint( 'sso-callback', EP_PERMALINK);\n}",
"public function addRedirectRoute(String $uri, String $redirect, Int $httpCode): void\n {\n $uri = $this->resolveRouterUri($uri);\n\n $this->routes[\"REDIRECT\"][$uri] = $this->redirectRouterData($redirect, $httpCode);\n }",
"function setRedirectUri($uri, $code = Codes::HTTP_FOUND);",
"public function createUri($uri = '');",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();"
] |
[
"0.6147501",
"0.5567933",
"0.5496231",
"0.5270669",
"0.52252775",
"0.5096683",
"0.5082784",
"0.5049274",
"0.5039328",
"0.5032605",
"0.50283253",
"0.5014876",
"0.500005",
"0.500005",
"0.500005",
"0.500005",
"0.500005",
"0.500005",
"0.500005",
"0.49929017",
"0.49708328",
"0.49595386",
"0.495501",
"0.49544197",
"0.49348104",
"0.49348104",
"0.49348104",
"0.49348104",
"0.49348104",
"0.49348104"
] |
0.5933597
|
1
|
Set the value of family
|
public function setFamily($family)
{
$this->family = $family;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setFamily($family)\n {\n $this->family = $family;\n $this->setAttributes(\"Family\");\n }",
"abstract public function set();",
"public function __set($name, $value)\n\t{\n\t\tswitch($name) {\n\t\t\tcase 'APPLICANTS_FAMILY_DATA_SIBLINGS_ID':\n\t\t\t\t//if the id isn't null, you shouldn't update it!\n\t\t\t\tif( !is_null($this->APPLICANTS_FAMILY_DATA_SIBLINGS_ID) ) {\n\t\t\t\t\tthrow new Exception('Cannot update APPLICANTS_FAMILY_DATA_SIBLINGS_ID!');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\t//set the attribute with the value\n\t\t$this->$name = $value;\n\t}",
"function getFamily() { return $this->_family; }",
"abstract public function setValue($value);",
"private function setFamilyGraph(FamilyGraph $familyGraph)\n {\n $this->familyGraph = $familyGraph;\n }",
"private function setFamilyGraph(FamilyGraph $familyGraph)\n {\n $this->familyGraph = $familyGraph;\n }",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function getFamily()\n {\n return $this->family;\n }",
"public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}",
"private function setGenderValue()\n {\n $value = $this->getData(self::$genderAttributeCode);\n \n if (!$value) {\n $this->setCustomAttribute(self::$genderAttributeCode, 'N/A');\n return;\n }\n\n try {\n $attributeMetadata = $this->customerMetadata->getAttributeMetadata(self::$genderAttributeCode);\n $option = $attributeMetadata->getOptions()[$value];\n $this->setCustomAttribute(self::$genderAttributeCode, $option->getLabel());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$genderAttributeCode, 'N/A');\n }\n }",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);"
] |
[
"0.7327666",
"0.6324755",
"0.6131918",
"0.61023253",
"0.5861777",
"0.5856018",
"0.5856018",
"0.58284324",
"0.58284324",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.5827895",
"0.58174443",
"0.5760021",
"0.57466394",
"0.5744617",
"0.5744617",
"0.5744617",
"0.5744617",
"0.5744617",
"0.5744617",
"0.5744617"
] |
0.67137975
|
1
|
Get the value of animal
|
public function getAnimal()
{
return $this->animal;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAnimal(): Animal\n {\n return $this->animal;\n }",
"abstract public function getValue();",
"abstract public function getValue();",
"abstract public function getValue();",
"public function getAnimalID()\n {\n return $this->animalID;\n }",
"public function getValue(): mixed;",
"public function getValue(): mixed;",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getNomAnimal()\n {\n return $this->nomAnimal;\n }",
"public function getValue() {}"
] |
[
"0.6747964",
"0.6493592",
"0.6493592",
"0.64931655",
"0.64874357",
"0.6468136",
"0.6468136",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.63512945",
"0.6342344",
"0.631019"
] |
0.72058266
|
0
|
Set the value of animal
|
public function setAnimal($animal)
{
$this->animal = $animal;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract public function setValue($value);",
"abstract public function set();",
"public function __construct($animal)\n {\n $this->animal = $animal;\n }",
"public function set(string $name, mixed $value): void;",
"abstract public function set($in): void;",
"function __set($name,$value){\r\n switch ($name){\r\n case 'gas': // daca aveam in loc de case, return numai trebuia sa pun break\r\n if(is_numeric($value)) $this->gas = $value;\r\n break; // la return nu se pune break!!\r\n case new Exception(\"Gas tre sa fie numeric\"); //arunca o eroare\r\n break;\r\n }\r\n }",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function set($name, $value){}",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);"
] |
[
"0.62561697",
"0.62536937",
"0.60497373",
"0.5984087",
"0.58797747",
"0.5863981",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5847186",
"0.5846974",
"0.5846974",
"0.57818025",
"0.57762724",
"0.57762724",
"0.57762724",
"0.57762724",
"0.57762724",
"0.57762724",
"0.57762724",
"0.57762724",
"0.57762724",
"0.57762724"
] |
0.65603185
|
0
|
Check whether reviewers are from the same (parent) organisation
|
protected function sameOrganisation(string $handle, array $otherHandles, array $reviewerData): bool
{
foreach ($otherHandles as $otherHandle) {
if (
($reviewerData[$handle]['organisation'] === $reviewerData[$otherHandle]['organisation'])
|| (
($reviewerData[$handle]['parent'] !== null)
&& ($reviewerData[$handle]['parent'] === $reviewerData[$otherHandle]['parent'])
)
) {
return true;
}
}
return false;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function test_that_a_parent_enrollment_only_appears_once_in_students_lists()\n {\n }",
"public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}",
"public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }",
"public function isParent(): bool // need to move method to services\n {\n $match = User::join('account_user_permission', 'account_user_permission.user_id','=','users.id')\n ->join('accounts', 'accounts.id','=','account_user_permission.account_id')\n ->join('permissions','permissions.id','=','account_user_permission.permission_id')\n ->where('permissions.name','=','permissions.parents')\n ->where('users.id','=',$this->id)\n ->count();\n if($match>0) {\n return true;\n }\n return false;\n }",
"public function belongsToCurrent()\n {\n return Auth::id() == $this->user_id;\n }",
"public function isParent();",
"public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }",
"protected function validateOwner()\r\n {\r\n $rule = clone $this->getConfig();\r\n foreach ($this->owner->getRecursiveIterator(RecursiveIteratorIterator::LEAVES_ONLY) as $child) {\r\n try {\r\n $rule->setOwner($child);\r\n if (!$rule->validateOwner()) {\r\n return false;\r\n }\r\n } catch (HTML_QuickForm2_InvalidArgumentException $e) {}\r\n }\r\n return true;\r\n }",
"public function isSelf()\n {\n return $this->auth->isAssociate() && $this->auth->info('id') == $this->associate->getId();\n }",
"public function isOwner();",
"function email_have_asociated_folders($userid) {\n\tglobal $CFG, $USER;\n\n\tif ( empty($userid) ) {\n\t\t$userid = $USER->id;\n\t}\n\n\tif ( $CFG->email_marriedfolders2courses ) {\n\t\tif ( $preferences = get_record('email_preference', 'userid', $userid) ) {\n\t\t\tif ($preferences->marriedfolders2courses) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}",
"public function isResearcher(){\n\t\t$member = Member::CurrentUser();\n\t\t$group = SiteConfig::current_site_config()->ResearchGroup();\n\t\tif($group && $member){\n\t\t\treturn $member->inGroup($group->Code);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\n\t}",
"function salmon_parent_is($atom, $parent, $breadcrumbs) {\n\treturn ($breadcrumbs[$atom['level'] - 1] == $parent); \n}",
"public function isProposition()\n {\n $u = $this->user()->first();\n\n return auth()->user()->id != $u->id;\n }",
"function isOrgEditor($wpUser){\n for($i = 0; $i < count($wpUser->roles); $i++){\n if(strpos($wpUser->roles[$i], SARON_ROLE_PREFIX . SARON_ROLE_ORG) !== FALSE){ // CHECK IF THE USER IS A MEMBER OF THE GROUP (test)saron_edit\n return true;\n }\n } \n return false; \n }",
"public function validateReviewer(): bool\n {\n $review = self::find()\n ->select(['shop_feedback.id', 'shop_feedback.shop_id', 'shop_feedback.created_by'])\n ->where(['shop_feedback.shop_id' => $this->shop_id, 'shop_feedback.created_by' => $this->created_by])\n ->asArray()\n ->one();\n if(!empty($review)){\n $this->addError('created_by',\n Yii::t('app', 'Вы уже добавляли отзыв об этом магазине, но Вы можете его изменить'));\n return false;\n } else {\n return true;\n }\n }",
"public function hasAncestors();",
"public function hasParent();",
"public function hasParent();",
"public function hasParent();",
"public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}",
"public function hasParent() {}",
"abstract public function is_for_parent_node(Jquarry_Node $parent);",
"public function isOwner()\n {\n return $this->affiliation == self::AFFILIATION_OWNER;\n }",
"public function hasSameOrganization(User $user)\n {\n return $this->getOrganization()\n && $user->getOrganization()\n && $this->getOrganization()->getId() === $user->getOrganization()->getId();\n }",
"public function isOwner()\n {\n return (\\Auth::check() and \\Auth::user()->id == $this->id);\n }",
"public function isOwner(): bool {\n $f3 = \\Base::instance();\n\n return $f3->get('CURRENT_USER') && !is_null($this->owner) && $f3->get('CURRENT_USER') === $this->owner->id;\n }",
"public function isReviewer()\n {\n return $this->hasRole(HakAkses::REVIEWER);\n }",
"public function isOwner($item)\n {\n $roles = Session::get('roles');\n $userId = Auth::user()->externalId;\n\n $result = !empty(array_intersect($roles, ['Administrator','Accounting','Developer']));\n if ($result || in_array($userId,['34',\"55\",'155'])) { // allow mikker to see all forms\n return true;\n }\n\n //remove the user role. we don't care about it\n $roles = array_diff($roles, array('User'));\n $roles = array_values($roles);\n\n switch ($roles[0]){\n case \"Client Manager\":\n return $item->ClientAlias->Client->ClientManager_Id == null? true: $userId ? true:false;\n break;\n case \"Adwords\":\n case \"SEO\":\n // loop through all contracts and find if he has a contract assigned to him\n $owner = false;\n if(is_array($item->Contract)){\n foreach ($item->Contract as $contract){\n if($contract->Manager_Id == $userId){\n $owner = true;\n break;\n }\n }\n }\n return $owner;\n break;\n case \"Sales\":\n return $item->ClientAlias->User_Id == $userId ? true:false;\n break;\n default :\n break;\n }\n //default, we deny.\n return false;\n }",
"public function isOwnerOf( $attr )\n {\n // SOL TICKET #2\n // Dependiendo del tipo de relacion se si un objeto es duenio de otro:\n // - 1) Si la relacion es A (1)->(1) B entonces se necesita belongsTo explicito para no salvar en cascada relaciones que en realidad son blandas (p.e. modelado de *->1 donde el lado * en realidad es blando). (desde el modelo, esto es igual a (*)->(1))\n // - 2) Si la relacion es A (1)<->(1) B entonces se necesita belongsTo para saber cual es el lado fuerte.\n // - 3) Si la relacion es A (1)->(*) B entonces B belongsTo A.\n // - 4) Si la relacion es A (1)<->(*) B entonces B belongsTo A.\n // - 5) Si la relacion es A (*)->(*) B entonces B belongsTo A. (desde el modelo, es lo mismo que (1)->(*))\n // - 6) Si la relacion es A (*)<->(*) B entonces se necesita belongsTo en algun lado.\n //\n // La clase actual es A, el obj es de clase B.\n\n $_thisClass = get_class($this); //self::$thisClass; // get_class da PO, deberia usar otro valor y no la clase...\n\n // Verifico si tengo el atributo y esta en una relacion (hasMany o hasOne).\n //\n if (array_key_exists( $attr, $this->hasOne ))\n {\n $obj = new $this->hasOne[$attr]();\n\n // Si la relacion es unidireccional, se es duenio del otro solo si el otro declara belongsTo mi clase.\n if ($obj->hasOneOfThis( $_thisClass )) // 2) bidireccional 1..1\n {\n return $obj->belonsToClass( $_thisClass ); // Si el objeto que quiero saber si soy duenio pertenece a mi => si soy duenio de el.\n }\n else // 1) unidireccional 1..1\n {\n //return true;\n return $obj->belonsToClass( $_thisClass ); // Ahora se pide belongsTo obligatorio para 1..1 unidireccional (esto evita que se salven en cascada links que realmente son blandos)\n }\n }\n else if (array_key_exists( $attr, $this->hasMany ))\n {\n // Si tengo una relacion hasMany con migo mismo, tengo 1->* o *->*, para ambos casos debería devolver true.\n if ($this->hasMany[$attr] == $_thisClass) return true;\n \n $obj = new $this->hasMany[$attr]();\n\n if ($obj->hasOneOfThis( $_thisClass )) // 4) bidireccional 1..*\n {\n return true;\n }\n else\n {\n // 6) bidireccional *..*\n if ($obj->hasManyOfThis( $_thisClass ))\n {\n return $obj->belonsToClass( $_thisClass ); // problema: get_class(this) tira PO...\n }\n else // casos 3 o 5, como es unidireccional, toma el control la clase del lado que no es visto de la otra.\n {\n return true;\n }\n }\n }\n\n // Si llega aca deberia tirar un warning xq el atributo que me pasaron no es de una relacion...\n return false;\n \n }"
] |
[
"0.56345505",
"0.5584114",
"0.5574045",
"0.5476789",
"0.5464728",
"0.53918666",
"0.5359871",
"0.5333151",
"0.53221625",
"0.5307108",
"0.52864474",
"0.52756506",
"0.52589744",
"0.5250948",
"0.52456963",
"0.5224588",
"0.52001256",
"0.5193593",
"0.5193593",
"0.5193593",
"0.518388",
"0.51707983",
"0.51684374",
"0.51339537",
"0.51243985",
"0.51140547",
"0.5105333",
"0.50257254",
"0.50251216",
"0.5018817"
] |
0.60055536
|
0
|
Init assignment data based on the project reviewer scores array wiping out all boosts keeping the ignores
|
protected function initProjectAssignments(): array
{
$projectAssignments = $this->projectReviewerScores;
foreach ($projectAssignments as &$assignmentsProjectData) {
foreach ($assignmentsProjectData['scores'] as &$assignmentScore) {
if ($assignmentScore > 0) {
$assignmentScore = ReviewRosterService::REVIEWER_UNASSIGNED;
}
}
}
return $projectAssignments;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function resetAll(){\n $this->score = ['heritage'=> 0,'relax'=> 0,'sightseeing'=> 0,'weather'=> 0,'populated'=> 0];\n $this->answeredQuestions = [];\n $this->answersId = [];\n }",
"private function assignBestMatch(array &$assignment, array $sortedProjectScores): void\n {\n $projectCount = count($this->projectReviewerScores);\n foreach ($sortedProjectScores as $handle => $score) {\n if ($score >= ReviewRosterService::REVIEWER_UNASSIGNED) {\n $sortedProjectScores[$handle] = ($projectCount - $this->reviewerLoad[$handle]) * $score;\n }\n }\n arsort($sortedProjectScores);\n\n foreach (array_keys($sortedProjectScores) as $handle) {\n // Add reviewers with low load and not from the same organisation as reviewers already assigned\n if (\n ($assignment['scores'][$handle] === ReviewRosterService::REVIEWER_UNASSIGNED)\n && ! $this->sameOrganisation($handle, $this->reviewersAssigned, $this->reviewerData)\n ) {\n $this->reviewersAssigned[] = $handle;\n $this->reviewerLoad[$handle]++;\n $assignment['scores'][$handle] = ReviewRosterService::REVIEWER_ASSIGNED;\n $this->logger->log(\n __LINE__,\n sprintf(\n '%s: %s assigned based on reviewer history (%d) and workload (%d)',\n $assignment['data']['number'] . ' ' . $assignment['data']['name'],\n $handle,\n $sortedProjectScores[$handle],\n $this->reviewerLoad[$handle]\n )\n );\n break 1;\n }\n }\n }",
"function __construct(Array $high_risk, Array $low_risk, $high_risk_score = 2, $low_risk_score = 1) {\n\t\t$high_risk = array_unique(array_map( array($this, \"_cleanUp\"), $high_risk));\n\n\t\t$low_risk = array_unique(array_map( array($this, \"_cleanUp\"), $low_risk));\n\t\t\n\t\t$this->low_risk_phrases = $low_risk;\n\n\t\t$this->high_risk_phrases = $high_risk;\n\n\t\t$this->high_risk_score = $high_risk_score;\n\n\t\t$this->low_risk_score = $low_risk_score;\n\n\t}",
"protected function _resetPreVariables()\n\t{\n\t\t$this->_nuked = false;\n\t\t$this->_oldPre = array();\n\t\t$this->_curPre =\n\t\t\tarray(\n\t\t\t\t'title' => '',\n\t\t\t\t'size' => '',\n\t\t\t\t'predate' => '',\n\t\t\t\t'category' => '',\n\t\t\t\t'source' => '',\n\t\t\t\t'group_id' => '',\n\t\t\t\t'reqid' => '',\n\t\t\t\t'nuked' => '',\n\t\t\t\t'reason' => '',\n\t\t\t\t'files' => '',\n\t\t\t\t'filename' => ''\n\t\t\t);\n\t}",
"public function assign($grid) \n\t{\n\t\t$this->grid\t= $grid;\n\t\t//$this->display_grid($grid);\n\t\t\n\t\t// Initalize new array for processing\n\t\t$this->clonedGrid\t= array();\n\t\t\n\t\t// Set array to track the Column Min\n\t\t$this->colMin = array();\n\t\t\n\t\t// Get the higest SS score possible\n\t\t$maxValue\t= max(array_map(\"max\", $grid));\n\t\t// Negate all numbers then add back Max \"Because the objective is to maximize the total cost we negate all elements\"\n\t\t$this->preprocess($maxValue);\n\t\t\n\t\t// Make the Grid Square so we have the same number of rows and columns\n\t\t$this->pad_grid($this->clonedGrid);\n\t\t\n\t\t//$this->display_grid($this->clonedGrid);\n\t\t// Subtract the min numbers from Rows\n\t\t$this->subtract_min_rows();\n\t\t\n\t\t// Subtract the min numbers from Cols\n\t\t$this->subtract_min_cols();\n\t\t\n\t\t// Add lines to cover all zeros\n\t\t$this->cover_zeros();\n\t\t//$this->display_grid($this->clonedGrid);\n\t\t\n\t\t// TODO: Figure out why it's count + 1 in this loop\n\t\t// Until we are at more lines (+ one for some reason keep adding lines and covering zeros with lines\n\t\twhile ( $this->numLines < count($this->clonedGrid) + 1) {\n\t\t\t$this->create_additional_zeros();\n\t\t\t$this->cover_zeros();\n\t\t\t//$this->display_grid($this->clonedGrid);\n\t\t\t//$this->display_grid($this->lines) ;\n\t\t\t\n\t\t}\n\t\t\n\t\t// Return Vars\n\t\t$reservedColumns =array();\n\t\t$this->rows =array();\n\t\t\n\t\t$this->build_output(0, $reservedColumns); \n\t\t\n\t\treturn array($this->rows, count($this->rows));\n\t\t\n\t\n\t\t\n\t}",
"public function __construct($redscores, $pascores, $prelimgrades, $grades, $noncomplpenalties) {\n $this->redscores = $redscores;\n $this->pascores = $pascores;\n $this->prelimgrades = $prelimgrades;\n $this->grades = $grades;\n $this->noncomplpenalties = $noncomplpenalties;\n }",
"public function initGearReviews()\n\t{\n\t\t$this->collGearReviews = array();\n\t}",
"public static function init_score()\n {\n // and set them to zero if not exist\n self::$score = Settings::where('name', 'score')->first();\n self::$score_total = Settings::where('name', 'score_total')->first();\n\n if (empty(self::$score))\n {\n self::$score = Settings::create(['name' => 'score', 'value' => 0]);\n }\n if (empty(self::$score_total))\n {\n self::$score_total = Settings::create(['name' => 'score_total', 'value' => 0]);\n }\n\n // set current score to zero at the beginning of the game\n self::$score->value = 0;\n self::$score->save();\n }",
"public function __construct($leaderboardId)\n {\n $this->scoreArr = array();\n parent :: __construct($leaderboardId) ;\n }",
"private function createGemScores()\n {\n $gemScores = [];\n\n if (empty($this->filterObj->getSetWeights()))\n return [];\n\n if (!empty($this->filter['gm']))\n {\n $this->sharedLV['computeDataFunc'] = '$fi_scoreSockets';\n\n $q = intVal($this->filter['gm']);\n $mask = 14;\n $cnd = [10, ['class', ITEM_CLASS_GEM], ['gemColorMask', &$mask, '&'], ['quality', &$q]];\n if (!isset($this->filter['jc']))\n $cnd[] = ['itemLimitCategory', 0]; // Jeweler's Gems\n\n If ($this->filterObj->wtCnd)\n $cnd[] = $this->filterObj->wtCnd;\n\n $anyColor = new ItemList($cnd, ['extraOpts' => $this->filterObj->extraOpts]);\n if (!$anyColor->error)\n {\n $this->extendGlobalData($anyColor->getJSGlobals());\n $gemScores[0] = array_values($anyColor->getListviewData(ITEMINFO_GEM));\n }\n\n for ($i = 0; $i < 4; $i++)\n {\n $mask = 1 << $i;\n $q = !$i ? 3 : intVal($this->filter['gm']); // meta gems are always included.. ($q is backReferenced)\n $byColor = new ItemList($cnd, ['extraOpts' => $this->filterObj->extraOpts]);\n if (!$byColor->error)\n {\n $this->extendGlobalData($byColor->getJSGlobals());\n $gemScores[$mask] = array_values($byColor->getListviewData(ITEMINFO_GEM));\n }\n }\n }\n\n $this->sharedLV['onBeforeCreate'] = '$fi_initWeightedListview';\n $this->sharedLV['onAfterCreate'] = '$fi_addUpgradeIndicator';\n $this->sharedLV['sort'] = ['-score', 'name'];\n\n array_push($this->sharedLV['hiddenCols'], 'type', 'source');\n\n return $gemScores;\n }",
"public function __construct() {\n\t\t\t$this->highscores = array();\n\t\t\tif (($file = fopen(\"scores.csv\", \"r\")) !== FALSE) {\n\t\t\t while (($data = fgetcsv($file, 1000, \",\")) !== FALSE) {\n\t\t\t for ($i=0; $i < sizeof($data); $i++) {\n\t\t\t array_push($this->highscores, $data[$i]);\n\t\t\t }\n\t\t\t }\n\t\t\t fclose($file);\n\t\t\t}\n\t\t}",
"protected function makeRanking () : void\n {\n $this->_Result = $this->createResult($this->_PossibleRanking[ \\array_search(needle: \\max($this->_RankingScore), haystack: $this->_RankingScore, strict: true) ]);\n }",
"public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }",
"function _setDefaults()\n {\n $this->subtask_id = $this->rs['subtask_id'] = 0;\n $this->student_id = $this->rs['student_id'] = 0;\n $this->assignment_id = $this->rs['assignment_id'] = 0;\n $this->file_id = $this->rs['file_id'] = 0;\n }",
"public function __construct()\n {\n $this->postules = new ArrayCollection();\n $this->competences = new ArrayCollection();\n $this->habilitations = new ArrayCollection();\n }",
"public function __construct() { $this->_competitions = [new Competition(0, 'unknow', 0)]; }",
"private function setUpSampleRanks()\n {\n $ranks = [\n [\n 'title' => 'Level 1',\n 'description' => 'New forum user',\n 'minimumCount' => 1,\n 'maximumCount' => 9,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'zerostar.gif', ],\n [\n 'title' => 'Level 2',\n 'description' => 'Basic forum user',\n 'minimumCount' => 10,\n 'maximumCount' => 49,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'onestar.gif', ],\n [\n 'title' => 'Level 3',\n 'description' => 'Moderate forum user',\n 'minimumCount' => 50,\n 'maximumCount' => 99,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'twostars.gif', ],\n [\n 'title' => 'Level 4',\n 'description' => 'Advanced forum user',\n 'minimumCount' => 100,\n 'maximumCount' => 199,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'threestars.gif', ],\n [\n 'title' => 'Level 5',\n 'description' => 'Expert forum user',\n 'minimumCount' => 200,\n 'maximumCount' => 499,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'fourstars.gif', ],\n [\n 'title' => 'Level 6',\n 'description' => 'Superior forum user',\n 'minimumCount' => 500,\n 'maximumCount' => 999,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'fivestars.gif', ],\n [\n 'title' => 'Level 7',\n 'description' => 'Senior forum user',\n 'minimumCount' => 1000,\n 'maximumCount' => 4999,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'spezstars.gif', ],\n [\n 'title' => 'Legend',\n 'description' => 'Legend forum user',\n 'minimumCount' => 5000,\n 'maximumCount' => 1000000,\n 'type' => RankEntity::TYPE_POSTCOUNT,\n 'image' => 'adminstars.gif', ], ];\n foreach ($ranks as $rank) {\n $r = new RankEntity();\n $r->merge($rank);\n $this->entityManager->persist($r);\n }\n $this->entityManager->flush();\n }",
"public function data_preprocessing(&$default_values) {\r\n global $DB;\r\n $context = $this->assignment->get_context();\r\n $course = $this->assignment->get_course();\r\n\r\n $drafttestinputid = file_get_submitted_draft_itemid('assignsubmission_codehandin_testinput');\r\n $drafttestoutputid = file_get_submitted_draft_itemid('assignsubmission_codehandin_testoutput');\r\n $draftteststderr = file_get_submitted_draft_itemid('assignsubmission_codehandin_teststderr');\r\n\r\n if ($context) {\r\n // existing submission\r\n\r\n $assignmentid = $this->assignment->get_instance()->id;\r\n\r\n file_prepare_draft_area($drafttestinputid, $context->id, 'assignsubmission_codehandin', ASSIGNSUBMISSION_CODEHANDIN_FILEAREA, (ASSIGNSUBMISSION_CODEHANDIN_INPUTFILES_START + $assignmentid), array(\r\n 'subdirs' => 0,\r\n 'maxbytes' => $course->maxbytes,\r\n 'maxfiles' => 1,\r\n 'accepted_types' => '*'\r\n ));\r\n file_prepare_draft_area($drafttestoutputid, $context->id, 'assignsubmission_codehandin', ASSIGNSUBMISSION_CODEHANDIN_FILEAREA, (ASSIGNSUBMISSION_CODEHANDIN_OUTPUTFILES_START + $assignmentid), array(\r\n 'subdirs' => 0,\r\n 'maxbytes' => $course->maxbytes,\r\n 'maxfiles' => 1\r\n ));\r\n file_prepare_draft_area($draftteststderr, $context->id, 'assignsubmission_codehandin', ASSIGNSUBMISSION_CODEHANDIN_FILEAREA, (ASSIGNSUBMISSION_CODEHANDIN_OUTPUTERRFILES_START + $assignmentid), array(\r\n 'subdirs' => 0,\r\n 'maxbytes' => $course->maxbytes,\r\n 'maxfiles' => 1\r\n ));\r\n\r\n\r\n //$assignment = $DB->get_records('codehandin', array('id' => $assignmentid));\r\n $checkpoints = $DB->get_records('codehandin_checkpoint', array('assignmentid' => $assignmentid), $sort = 'ordering ASC');\r\n\r\n echo '<pre>';\r\n print_r($checkpoints);\r\n echo '</pre>';\r\n\r\n// echo '<pre>';\r\n// echo $assignmentid;\r\n// echo '</pre>';\r\n//\r\n// echo '<pre>';\r\n// print_r($checkpoints);\r\n// echo '</pre>';\r\n// $assignment = (array) $assignment;\r\n// //$assignment->checkpoints = $checkpoints;\r\n// $assignment['checkpoints'] = $checkpoints;\r\n// $assignment = (object) $assignment;\r\n\r\n foreach ($checkpoints as $cp) {\r\n\r\n $tests = $DB->get_records('codehandin_test', array('checkpointid' => $cp->id));\r\n// $cp = (array) $cp;\r\n// $cp['tests'] = $tests;\r\n// $cp = (object) $cp;\r\n// \r\n// echo '<pre>';\r\n// print_r($tests);\r\n// echo '</pre>';\r\n }\r\n\r\n// echo '<pre>';\r\n// print_r($checkpoints);\r\n// echo '</pre>';\r\n// echo '<pre>';\r\n// print_r($cpids);\r\n// echo '</pre>';\r\n// echo '<pre>';\r\n// print_r($tests);\r\n// echo '</pre>';\r\n // assignment is now fancy packed\r\n\r\n\r\n\r\n foreach ($checkpoints as $cp) {\r\n $default_values['assignsubmission_codehandin_cpname'] = $cp->name;\r\n $default_values['assignsubmission_codehandin_cpdescription'] = $cp->description;\r\n $default_values['assignsubmission_codehandin_cpruntimeargs'] = $cp->runtimeargs;\r\n $default_values['assignsubmission_codehandin_cpordering'] = $cp->ordering;\r\n foreach ($tests as $test) {\r\n $default_values['assignsubmission_codehandin_testassessment'] = $test->assessment;\r\n $default_values['assignsubmission_codehandin_testdescription'] = $test->description;\r\n $default_values['assignsubmission_codehandin_testretval'] = $test->retval;\r\n }\r\n }\r\n } else {\r\n file_prepare_draft_area($drafttestinputid, null, 'assignsubmission_codehandin', ASSIGNSUBMISSION_CODEHANDIN_FILEAREA, 0, array(\r\n 'subdirs' => 0,\r\n 'maxbytes' => $course->maxbytes,\r\n 'maxfiles' => 1,\r\n 'accepted_types' => '*'\r\n ));\r\n }\r\n\r\n // $DB->update_record($table, $dataobject, $bulk=false)\r\n\r\n $default_values['assignsubmission_codehandin_testinput'] = $drafttestinputid;\r\n $default_values['assignsubmission_codehandin_testoutput'] = $drafttestoutputid;\r\n $default_values['assignsubmission_codehandin_teststderr'] = $draftteststderr;\r\n }",
"public function reset()\n {\n $this->values[self::_STAGE_ID] = null;\n $this->values[self::_DPS_RANK] = array();\n $this->values[self::_FIRST_PASS] = null;\n $this->values[self::_FAST_PASS] = null;\n }",
"public function initItemRatings()\n\t{\n\t\t$this->collItemRatings = array();\n\t}",
"private function resetVariables()\n {\n $this->score = 0;\n $this->savedScore = 0;\n $this->playerMessage = null;\n $this->hasWon = false;\n }",
"public function initData()\n {\n $this->appliedNumberingData = array();\n $this->currHyperlink = null;\n }",
"function __construct( $data = array() )\r\n\t{\r\n\t\tif (isset($data['orderno'])) $this->orderno = $data['orderno'];\r\n\t\tif (isset($data['question'])) $this->question = $data['question'];\r\n\t\tif (isset($data['type'])) $this->type = $data['type'];\r\n\t\tif (isset($data['maxscore'])) $this->maxscore = $data['maxscore'];\r\n\t\tif (isset($data['answers'])) \r\n\t\t{\r\n\t\t\tforeach ($data['answers'] as $key => $answer)\r\n\t\t\t{\r\n\t\t\t\t$this->answers[$key]->answer = $answer;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($data['scorepercentages'])) \r\n\t\t{\r\n\t\t\tforeach ($data['scorepercentages'] as $key => $scorepercentage)\r\n\t\t\t{\r\n\t\t\t\t$this->answers[$key]->scorepercentage = $scorepercentage;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->type == \"shortanswer\")\r\n\t\t{\r\n\t\t\t$this->typeshort = \"SA\";\r\n\t\t}\r\n\t\tif ($this->type == \"multichoice\")\r\n\t\t{\r\n\t\t\t$this->typeshort = \"MC\";\r\n\t\t}\r\n\t\t\r\n\t}",
"function benefits_scoring($queried_comp_ids)\n {\n $user_benefits_array = $this->input->post('users_benefits'); \n\n //get all the companies (that meet the previous criteria) and their associated benefits\n $sql2 = 'SELECT company_id,benefits_id FROM company_benefits WHERE company_id IN ('.$queried_comp_ids.')';\n $query2 = $this->db->query($sql2);\n \n //build an array with a specific format to be used in the upcoming scoring process\n $company_set = array();\n foreach ($query2->result_array() as $row) {\n $company_set[$row['company_id']][]=$row['benefits_id'];\n }\n\n $scores = array();\n // For every company, we will assign it a score based on what benefits it has\n // and how the user ranked that benefit. Higher ranks are more valuable, so the highest\n // total score wins.\n foreach($company_set as $company_id => $array_row)\n { \n $score = 0;\n foreach ($array_row as $key=>$benefit_id)\n {\n //this line grabs the user's ranking for the benefit_id that this particular company has\n //and assigns it to the score variable. this will be added to the scores matrix\n //and a tally will be kept for each company. \n //KEY POINT: The benefit that is most desired has the highest rank value. For example,\n // if there are 10 options, the user's most desired benefit has a rank of 10. The least\n // desired has a rank of 1.\n \n $score += $user_benefits_array[$benefit_id]['rank'];\n }\n $scores[$company_id] = $score;\n\n }\n \n arsort($scores);\n /*echo \"<br><br>benefits scores: <br>\";\n echo \"<pre>\";\n print_r($scores);\n echo \"</pre>\";*/\n \n return $scores;\n }",
"public function __construct()\n {\n $this->reviews = new ArrayCollection();\n }",
"public function resetVariables()\n {\n $this->score = 0;\n $this->savedScore = 0;\n $this->points = 0;\n $this->playerMessage = null;\n $this->hasWon = false;\n }",
"public function run()\n {\n DB::table('predictions')->delete();\n\n DB::table('predictions')->insert([\n [\"user_id\"=>1,\"fixture_id\"=>1,\"home_score\"=>1,\"away_score\"=>0,\"grade\"=>0],\n [\"user_id\"=>1,\"fixture_id\"=>2,\"home_score\"=>1,\"away_score\"=>1,\"grade\"=>0],\n [\"user_id\"=>1,\"fixture_id\"=>3,\"home_score\"=>0,\"away_score\"=>1,\"grade\"=>0],\n [\"user_id\"=>1,\"fixture_id\"=>4,\"home_score\"=>2,\"away_score\"=>0,\"grade\"=>0],\n [\"user_id\"=>1,\"fixture_id\"=>5,\"home_score\"=>1,\"away_score\"=>3,\"grade\"=>0],\n\n [\"user_id\"=>2,\"fixture_id\"=>1,\"home_score\"=>2,\"away_score\"=>0,\"grade\"=>0],\n [\"user_id\"=>2,\"fixture_id\"=>2,\"home_score\"=>1,\"away_score\"=>1,\"grade\"=>0],\n [\"user_id\"=>2,\"fixture_id\"=>3,\"home_score\"=>2,\"away_score\"=>2,\"grade\"=>0],\n [\"user_id\"=>2,\"fixture_id\"=>4,\"home_score\"=>2,\"away_score\"=>0,\"grade\"=>0],\n\n [\"user_id\"=>3,\"fixture_id\"=>3,\"home_score\"=>0,\"away_score\"=>0,\"grade\"=>0],\n [\"user_id\"=>3,\"fixture_id\"=>4,\"home_score\"=>1,\"away_score\"=>2,\"grade\"=>0],\n [\"user_id\"=>3,\"fixture_id\"=>5,\"home_score\"=>3,\"away_score\"=>1,\"grade\"=>0],\n\n [\"user_id\"=>4,\"fixture_id\"=>4,\"home_score\"=>2,\"away_score\"=>1,\"grade\"=>0],\n [\"user_id\"=>4,\"fixture_id\"=>5,\"home_score\"=>3,\"away_score\"=>2,\"grade\"=>0],\n\n ]);\n\n }",
"public function getScoreBoardData() {\n $participations = $this->participations;\n foreach ($participations as $p) {\n $p->final_points = $p->user->score($this);\n $p->final_latest_submit = $p->user->getLatestSubmitTime($this);\n }\n // $participations = $participations\n // ->sortBy('final_latest_submit')\n // ->sortByDesc('final_points');\n\n\n $participations = $participations->sort(function($a, $b) {\n if($a->final_points === $b->final_points) {\n if($a->final_latest_submit === $b->final_latest_submit) {\n return 0;\n }\n return $a->final_latest_submit < $b->final_latest_submit ? -1 : 1;\n } \n return $a->final_points < $b->final_points ? 1 : -1;\n });\n\n $i = 1;\n foreach ($participations as $p) {\n $p->final_position = $i++;\n }\n\n return $participations;\n }",
"public function score(){\r\n\t\t$scores=array();\r\n\t\t\r\n\t\tif($this->gina){\r\n\t\t\t$scores['current_health_status']=array($this->score_current_health_status(),.09);\r\n\t\t\t//$scores['family_health']=array($this->score_family_health(),\t\t\t\t0);\r\n\t\t\t$scores['preventative_health']=array($this->score_preventative_health(),\t.06);\r\n\t\t\t$scores['weight_nutrition']=array($this->score_weight_nutrition(),\t\t\t.18);\r\n\t\t\t$scores['physical_activity']=array($this->score_physical_activity(),\t\t.18);\r\n\t\t\t$scores['stress_management']=array($this->score_stress_management(),\t\t.07);\r\n\t\t\t$scores['mental_health']=array($this->score_mental_health(),\t\t\t\t.045);\r\n\t\t\t$scores['alcohol_use'] = array($this->score_alcohol_use(), .045);\r\n\t\t\t$scores['self_care']=array($this->score_self_care(),\t\t\t\t\t\t.08);\r\n\t\t\t$scores['tobaco_use']=array($this->score_tobaco_use(),\t\t\t\t\t\t.18);\r\n\t\t\t$scores['readiness_to_change']=array($this->score_readiness_to_change(),\t0);\r\n\t\t\t$scores['biometric_data']=array($this->score_biometric_data(),\t\t\t\t0);\r\n\t\t}else{\r\n\t\t\t$scores['current_health_status']=array($this->score_current_health_status(),.09);\r\n\t\t\t$scores['family_health']=array($this->score_family_health(),\t\t\t\t0);\r\n\t\t\t$scores['preventative_health']=array($this->score_preventative_health(),\t.06);\r\n\t\t\t$scores['weight_nutrition']=array($this->score_weight_nutrition(),\t\t\t.18);\r\n\t\t\t$scores['physical_activity']=array($this->score_physical_activity(),\t\t.18);\r\n\t\t\t$scores['stress_management']=array($this->score_stress_management(),\t\t.07);\r\n\t\t\t$scores['mental_health']=array($this->score_mental_health(),\t\t\t\t.045);\r\n\t\t\t$scores['alcohol_use'] = array($this->score_alcohol_use(), .045);\r\n\t\t\t$scores['self_care']=array($this->score_self_care(),\t\t\t\t\t\t.08);\r\n\t\t\t$scores['tobaco_use']=array($this->score_tobaco_use(),\t\t\t\t\t\t.18);\r\n\t\t\t$scores['readiness_to_change']=array($this->score_readiness_to_change(),\t0);\r\n\t\t\t$scores['biometric_data']=array($this->score_biometric_data(),\t\t\t\t0);\r\n\t\t}\r\n\r\n\t\t$total=0;\r\n\t\tforeach($scores as &$score){\r\n\t\t\t$score[2]=$score[0]->total*$score[1];\r\n\t\t\t$total+=$score[2];\r\n\t\t}\r\n\t\t\r\n\t\t$scores['total']=$total*20;\r\n\t\treturn $scores;\t\t\r\n\t}",
"public function __construct($data = [])\n {\n $this->massAssign($data);\n }"
] |
[
"0.5823124",
"0.57646924",
"0.53550535",
"0.53445566",
"0.53117466",
"0.5302252",
"0.5233697",
"0.52336407",
"0.5204734",
"0.51870614",
"0.5179137",
"0.5131669",
"0.511003",
"0.50773406",
"0.507714",
"0.5073887",
"0.50568885",
"0.5051923",
"0.49761036",
"0.4955722",
"0.495408",
"0.4908648",
"0.4897907",
"0.48838842",
"0.4864226",
"0.48574805",
"0.484284",
"0.48273203",
"0.48259592",
"0.4816465"
] |
0.6413475
|
0
|
Get all of the problems for a given user.
|
public function forUser(User $user)
{
return Problem::where('user_id', $user->id)
->orderBy('created_at', 'asc')
->get();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function show(User $user)\n\t{\n\t\t$OKSolutions = Solution::solved($user->id)\n\t\t ->orderBy('id', 'desc')\n\t\t ->groupBy('problem_id')\n\t\t ->paginate(10);\n\n\t\t$notOKSolutions = Solution::unsolved($user->id)\n\t\t ->orderBy('id', 'desc')\n\t\t\t ->groupBy('problem_id')\n\t\t ->whereNotIn('problem_id', $OKSolutions\n\t\t ->lists('problem_id'))\n\t\t ->paginate(10);\n\t\treturn view('users.show', compact('user',\n\t\t 'OKSolutions',\n\t\t 'notOKSolutions'));\n\t}",
"public function getProblems(): array;",
"abstract public function GetProblems();",
"public static function get_tickets ($user_id)\r\n\t{\r\n\t\t$db_manager = new database_manager ();\r\n\t\t$tickets \t= $db_manager -> select (\r\n\t\t\t'tickets',\r\n\t\t\tnull,\r\n\t\t\t\"user_id='$user_id'\"\r\n\t\t);\r\n\r\n\t\treturn ($tickets);\r\n\t}",
"public function getAllAssociated(User $user)\n {\n $role = $user->getRole();\n $id = $user->getId();\n\n if($role == User::ADMIN || $role == User::MENTOR) {\n $sql = <<<SQL\nselect * from $this->tableName \nwhere enabled = 1\nSQL;\n $stmt = $this->pdo()->prepare($sql);\n $stmt->execute();\n } else {\n $sql = <<<SQL\nselect * from $this->tableName \nwhere enabled = 1 and victimid = ? or reporterid = ?\nSQL;\n $stmt = $this->pdo()->prepare($sql);\n $stmt->execute([\n $id,\n $id\n ]);\n }\n\n if($stmt->rowCount() < 1) {\n return null;\n }\n\n $reports = [];\n $rows = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach($rows as $row) {\n $reports[] = new Injury($row);\n }\n\n return $reports;\n }",
"public function findOther($user): array\n {\n return $this->createQueryBuilder('c')\n ->where('c.creator != :user')\n ->andWhere('c.private = false')\n ->setParameter('user', $user )\n ->setMaxResults(4)\n ->getQuery()\n ->getResult();\n }",
"public function getUserNotices(User $user) {\n \n return $this->createQueryBuilder('n')\n ->select('n, g, i, l, v, t')\n ->where('n.user = :user')\n ->andWhere('n.draft = :draft')\n ->join('n.gallery', 'g')\n ->join('n.location', 'l')\n ->join('n.type', 't')\n ->leftJoin('n.values', 'v')\n ->leftJoin('g.images', 'i')\n ->setParameter('user', $user)\n ->setParameter('draft', 'FALSE')\n ->orderBy('n.created_at', 'DESC')\n ->getQuery()\n ->getResult();\n }",
"public function forUser(User $user)\n\t{\n\t\treturn Ticket::where('assignee_id', $user->id)\n\t\t\t->orderBy('priority', 'asc')\n\t\t\t->get();\n\t}",
"public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}",
"function dialogue_get_user_entries($dialogue, $user) {\n global $DB, $CFG;\n $sqlparams = array('dialogueid' => $dialogue->id, 'userid' => $user->id);\n return $DB->get_records_select('dialogue_entries', \"dialogueid = :dialogueid AND userid = :userid\",\n 'timecreated DESC', $sqlparams);\n}",
"public function getByUser(User $user)\n {\n $report = Report::with([\n 'user',\n ])\n ->where('user_id', $user->id)\n ->get();\n\n return $users;\n }",
"public function index(User $user)\n {\n return $user->responsibilities;\n }",
"function getQuestionListByAssignedExpert($user_id) {\n\t$html = \"\";\n\n\tif (isUserExpert($user_id)){\n\t\t// User is expert, do query\n\n\t\t// We have to check the question_has_experts table contains this user_id\n\t\t$assigned_questions = getAssignedQuestions($user_id);\n\n\t\t// TODO Next step is to look up the project_ids for\n\t\t// every corresponding question in the assigned question list\n\t\t// Should return associative array with\n\t\t// TODO This is going to take time to make\n\n\t} else{\n\t\t// User is not an expert, return false or something.\n\t\texit();\n\t}\n\n\treturn $html;\n\n}",
"public function getResultsOfUser($user_id);",
"public function getEntries($user) {\n\t\t$db = $this->db;\n\t\t$user = $db->quote($user);\n\t\t$query = \"SELECT value FROM entries WHERE user=$user\";\n\t\t$result = $db->query($query);\n\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t}",
"public function get_lista_mis_permisos_mayor($idUser)\n {\n $listar = $this->pdo->prepare(\"SELECT ep.id, ep.idusuario, us.empleado, ep.idusuario_registra, ep.fecha_solicitud, ep.detalle, ep.doc_adjunto, ep.flag_out, ep.num_resolucion, ep.observaciones, ep.estado FROM empleado_permiso_mayor ep INNER JOIN pa_usuario us ON ep.idusuario = us.id WHERE ep.id > 0 AND ep.idUsuario = '\".$idUser.\"' ORDER BY ep.id DESC\");\n $listar->execute();\n return $listar;\n }",
"function getAssignedQuestions($user_id){\n\n\t$results = DB::query(\"SELECT question_id \n\t\t\t\t\t\t\tFROM question_has_experts \n\t\t\t\t\t\t\tWHERE user_id = \" . $user_id . \" \");\n\n\n\tif (DB::count() === 0){\n\t\techo 'Query returned no results';\n\t}\n\n\treturn $results;\n\n\n}",
"public function getMyNoticesUsers()\n {\n\t\t// Get my related departments\n\t\t$related_departments = [];\n\n $c_related = $this->getRelatedDepartments();\n\n if (!$c_related) return [];\n\n foreach ($c_related as $rel){\n\t\t\t$related_departments [] = $rel->id;\n\t\t}\n\n\n\t\t/*\n\t\t *\tGet related Departamental users from my related departments\n\t\t *\n\t\t * Conditions:\n\t\t * - agent ticketit_department in related_departments\n\t\t * - agent person in related_departments\n\t\t*/\n\t\t$related_users = \\PanicHDMember::where('id','!=',$this->id)\n\t\t\t->whereIn('ticketit_department', $related_departments);\n\n\t\t// Get users that are visible by all departments\n\t\t$all_dept_users = \\PanicHDMember::where('ticketit_department','0');\n\n\t\tif (version_compare(app()->version(), '5.3.0', '>=')) {\n\t\t\t$related_users = $related_users->pluck('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->pluck('id')->toArray()));\n\t\t}else{\n\t\t\t$related_users = $related_users->lists('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->lists('id')->toArray()));\n\t\t}\n\n\t\treturn $related_users;\n\t}",
"public function index()\n {\n return \\App\\Http\\Resources\\Problem::collection(Problem::all());\n }",
"public static function retrieveProjectsFromUser($usr) {\n $projects = R::find('project', 'username = \"' . $usr . '\"');\n\n if (empty($projects)) {\n throw new Exception(\"User '$usr' has no units assigned.\");\n }\n\n return $projects;\n }",
"public function queryExpertsByUser($user) {\n $result = $this->query(\"SELECT word FROM Expert WHERE user='$user'\");\n \n // No pages with the specified id, return null.\n if ($result->num_rows == 0) {\n return null;\n }\n \n return $result->fetch_all();\n }",
"public function findAllByUser($userId)\n {\n $sql = \"select * from wave_request where id_user =? limit 10\";\n $request = $this->getDb()->fetchAll($sql, array($userId));\n\n $requests = array();\n foreach ($request as $row) {\n $requestId = $row['id'];\n $requests[$requestId] = $this->buildDomainObject($row);\n }\n\n return $requests;\n }",
"function getUserIssues( $userid , $recent) {\r\n\t\tif( $this->userCanGetUserIssues( $userid ) ) {\r\n\r\n\t\t $query = \"select i.ID from issues i, contacts c, `contacts-users` us\r\n where us.userid = '$userid'\r\n\t\t\t and us.contactid = c.id\r\n\t\t\t and c.issue = i.id\r\n order by i.DateCreated desc\";\r\n\r\n if($recent){\r\n //$now = date('Y-m-d H:i:s');\r\n $past = date('Y-m-d H:i:s', time() - (30*24*60*60)); // a month ago\r\n\t\t\t $query = \"select i.ID from issues i, contacts c, `contacts-users` us\r\n\t\t\t\t where c.datecreated >= '$past'\r\n and us.userid = '$userid'\r\n\t\t\t\t and us.contactid = c.id\r\n\t\t\t\t and c.issue = i.id\r\n order by i.DateCreated desc\";\r\n }\r\n\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t$return = array();\r\n\t\t\twhile( $row = mysql_fetch_assoc($result) ) {\r\n\t\t\t\tif( $this->userCanViewIssue('',$row['ID']) ) {\r\n\t\t\t\t\tarray_push( $return, $this->viewIssue('',$row['ID']) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t\t}\r\n\t}",
"private function getNonUserQuestion($userId)\n {\n //phalcon does not seem to support subqueries, so we gotta break it up and do it in 2\n \n //get all ids for questions that the user has already answered\n $subquery = $this->modelsManager->createQuery(\"\n SELECT answer.question_id \n FROM answer \n LEFT JOIN user_answer ON user_answer.answer_id = answer.id \n WHERE user_answer.user_id = :userid:\n \");\n\n $subResultSet = $subquery->execute(\n [\n \"userid\" => $userId\n ]\n );\n\n //get all answered question ids into an array for a future step\n $userQuestions = [];\n foreach ($subResultSet as $subResult) {\n $userQuestions[] = $subResult->question_id;\n }\n\n //get al questions that do not belong to the user\n $resultSet = Question::find(\n [\n \"user_id != :userid: OR user_id IS NULL AND id NOT IN (:userquestions:)\",\n \"bind\" => [\n \"userid\" => $userId,\n \"userquestions\" => implode(\", \", $userQuestions)\n ]\n ]\n );\n\n //get all valid questions (don't belong to the user and ones that the user hasn't answered)\n $questions = [];\n foreach ($resultSet as $question) {\n if (!in_array($question->id, $userQuestions)) {\n $questions[] = $question;\n }\n }\n \n //choose a random valid question to return\n $offset = mt_rand(0, count($questions)-1);\n \n return $questions[$offset];\n }",
"public function getUserMessagesAll(User $user)\n {\n }",
"public function queryAll($userId){\r\n\t\t$sql = 'SELECT * FROM notifications WHERE user_id = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($userId);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"public function getAllByUserId($user_id)\n\t{\n\t\t$sql = sprintf('SELECT *\n\t\t\t\t\t\tFROM ats_jobs\n\t\t\t\t\t\tWHERE created_by = %d\n\t\t\t\t\t\tAND deleted = 0\n\t\t\t\t\t\tORDER BY modified_ts DESC',\n\t\t\t\t\t\t$user_id);\n\n\t\treturn $this->_db->query($sql)->fetchAll();\n\t}",
"public static function get_all( WP_User $user ) {\n\n\t\tglobal $wpdb;\n\n\t\t$mids = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\"SELECT `umeta_id` FROM {$wpdb->usermeta} WHERE `meta_key` = %s AND `user_id` = %d\",\n\t\t\tself::META_KEY,\n\t\t\t$user->ID\n\t\t) );\n\n\t\t$sessions = array();\n\n\t\tforeach ( $mids as $meta_id ) {\n\t\t\tif ( ! is_wp_error( $session = self::get( $meta_id ) ) ) {\n\t\t\t\t$sessions[] = $session;\n\t\t\t}\n\t\t}\n\n\t\treturn $sessions;\n\t}",
"function afficherReclamation($user){\r\n\t\t$sql=\"SELECT * From reclamation where user='$user'\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n \t}",
"public function forUser(User $user)\r\n {\r\n return tasks::where('user_id', $user->id)\r\n ->orderBy('created_date', 'asc')\r\n ->get();\r\n }"
] |
[
"0.6092309",
"0.6013841",
"0.5944246",
"0.57211334",
"0.5710609",
"0.5670315",
"0.56171143",
"0.5535722",
"0.5535089",
"0.5532402",
"0.5530777",
"0.5481376",
"0.54808253",
"0.54417425",
"0.5432956",
"0.54254186",
"0.5422889",
"0.5402075",
"0.53854114",
"0.53817",
"0.5377716",
"0.5352598",
"0.53409785",
"0.5336407",
"0.532925",
"0.5301838",
"0.5278291",
"0.5269921",
"0.5269676",
"0.5269437"
] |
0.7818366
|
0
|
Disable the DataTables search filter
|
function disable_gravityview_datatables_search( $dt_config, $view_id, $post ) {
$return_config = $dt_config;
$return_config['searching'] = false;
return $return_config;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function resetFilterSearch() {\n\t\t$this->table->resetOffset();\n\t\t$this->table->resetFilter();\n\t\t$this->ctrl->redirect($this, self::CMD_SEARCH);\n\t}",
"function ks_disable_search($query, $error = true) {\n if (is_search() && !is_admin()) {\n $query->is_search = false;\n $query->query_vars['s'] = false;\n $query->query['s'] = false;\n\n if ($error == true) {\n $query->is_404 = true;\n }\n }\n}",
"public function setSearchEnabled($search) {}",
"public function searchable()\n {\n return false;\n }",
"private function filter() {\r\n $globalSearch = array();\r\n $columnSearch = array();\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n\r\n if (isset($this->resource->requestData['search']) && $this->resource->requestData['search']['value'] != '') {\r\n\r\n $str = $this->resource->requestData['search']['value'];\r\n\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['searchable'] == 'true') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Individual column filtering\r\n if (isset($this->resource->requestData['columns'])) {\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n $str = $requestColumn['search']['value'];\r\n if ($requestColumn['searchable'] == 'true' &&\r\n $str != '') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Combine the filters into a single string\r\n $where = '';\r\n if (count($globalSearch)) {\r\n $where = '(' . implode(' OR ', $globalSearch) . ')';\r\n }\r\n if (count($columnSearch)) {\r\n $where = $where === '' ?\r\n implode(' AND ', $columnSearch) :\r\n $where . ' AND ' . implode(' AND ', $columnSearch);\r\n }\r\n\r\n return $where;\r\n }",
"public function Filter_Not() {\r\n\t\treturn array(\r\n\t\t\t'where' => '0'\r\n\t\t);\r\n\t}",
"public function disableAutoSearch($field) {\r\n $this->_disableAutoSearch[$field]=true;\r\n }",
"public function applyFilterSearch() {\n\t\t$this->table->writeFilterToSession();\n\t\t$this->table->resetOffset();\n\t\t$this->search();\n\t}",
"public function isSearchable()\n {\n return false;\n }",
"public function disableBufferedResults();",
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t\n\t}",
"private function setSearchFilters()\n\t{\n\t\tif(sizeof($this->searchFilters) > 0)\n\t\t{\n\t\t\t$this->taskSearchHelperDA->setSearchFilters($this->searchFilters);\n\t\t}\n\t}",
"public function dtPerformGlobalFilter($columns, $search = '');",
"function query_datatables() \n{\n /** Paging */\n $sqlMax = \"1000\";\n $sLimit = \"\";\n if ( isset( $_POST['iDisplayStart'] ) && $_POST['iDisplayLength'] != '-1' )\n {\n $sLimit = \"LIMIT \".intval( $_POST['iDisplayStart'] ).\", \".\n intval( $_POST['iDisplayLength'] );\n }\n \n /** Ordering */\n $sOrder = \"\";\n if ( isset( $_GET['iSortCol_0'] ) )\n {\n $sOrder = \"ORDER BY \";\n for ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n {\n if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n {\n $sOrder .= \"`\".$this->aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\"` \".\n ($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n }\n }\n\n $sOrder = substr_replace( $sOrder, \"\", -2 );\n if ( $sOrder == \"ORDER BY\" )\n {\n $sOrder = \"\";\n }\n }\n \n \n /** Filtering\n * NOTE this does not match the built-in DataTables filtering which does it\n * word by word on any field. It's possible to do here, but concerned about efficiency\n * on very large tables, and MySQL's regex functionality is very limited\n */\n // Retira acentos da pesquisa\n $normalizeChars = array(\n 'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A',\n 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I',\n 'Ï'=>'I', 'Ñ'=>'N', 'Ń'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U',\n 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a',\n 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i',\n 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ń'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u',\n 'ú'=>'u', 'û'=>'u', 'ü'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'ƒ'=>'f',\n 'ă'=>'a', 'î'=>'i', 'â'=>'a', 'ș'=>'s', 'ț'=>'t', 'Ă'=>'A', 'Î'=>'I', 'Â'=>'A', 'Ș'=>'S', 'Ț'=>'T', \"'\" => \"\",\n ); \n $_POST['search']['value'] = strtr($_POST['search']['value'], $normalizeChars);\n \n \n $sWhere = \"\";\n if ( str_replace(' ', '', $_POST['search']['value']) != \"\" )\n {\n $sWhere = \"WHERE \".$this->db['table'].\" MATCH '\". $_POST['search']['value'].\"'\";\n \n \n /** CORE SQL queries * Get data to display */\n $sQuery = \" SELECT `\".str_replace(\" , \", \" \", implode(\"`, `\", $this->aColumns)).\"`\n FROM \".$this->db['table'].\"\n $sWhere\n $sLimit\n LIMIT $sqlMax\n \";}\n else\n {$sQuery = \" SELECT `\".str_replace(\" , \", \" \", implode(\"`, `\", $this->aColumns)).\"`\n FROM \".$this->db['table'].\"\n WHERE \".$this->db['table'].\" MATCH 'PATOS' LIMIT 50;\n \";}\n \n try { \n \n $aResult = $this->query_array($sQuery);\n \n } catch (PDOException $e) {\n print \"SQL DAtabase Error!: \" . $e->getMessage() . \"<br/>\";\n die();\n}\n \n /* Data set length after filtering */\n //TODO : improve efficiency currently does 2X query to count total records in query\n $sQuery = \"SELECT cargos_tot_registros FROM dados_download LIMIT 1\";\n \n $aResultTotal = $this->query_array($sQuery);\n $aResultTotal = substr(implode(\"\",$aResultTotal[0]), 0);\n $iTotal = (int)$aResultTotal;\n \n\n $sQuery = \"SELECT * FROM dados_download LIMIT 1\";\n $bdDetalhes = $this->query_array($sQuery);\n $bdDetalhes = substr(implode(\"\",$bdDetalhes[0]), 0);\n \n //$iTotal = 1000;\n //$iFilteredTotal= $aResultFilterTotal[0]['totalqry'];\n //print_r($aResult);\n $iFilteredTotal= count($aResult);\n \n\n /* Total data set length */\n //$sQuery = 100;\n //$sQuery = \"SELECT municipio_tot_registros FROM dados_download LIMIT 1\";\n \n //$aResultTotal = $this->query_array($sQuery);\n //$aResultTotal = substr(implode(\"|\",$aResultTotal[0]), 25);\n //$iTotal = (int)$aResultTotal;\n /*\n * Output\n */\n date_default_timezone_set('America/Recife');\n $output = array(\n \"draw\" => intval($_POST['draw']),\n \"iTotalRecords\" => $iTotal,\n \"iTime\" => date('d/m/Y G:i:s ', time()),\n \"iTotalDisplayRecords\" => $iFilteredTotal,\n \"aaData\" => array(),\n \"bdDetalhes\" => $bdDetalhes\n );\n \n /* Take the Query Result and resturn JSON encoded String */\n \n foreach ($aResult as $key => $aRow)\n {\n $row = array();\n for ( $i=0 ; $i<count($this->aColumns) ; $i++ )\n $row[] = $aRow[ $this->aColumns[$i] ];\n\n $output['aaData'][] = $row;\n }\n \n return json_encode( $output );\n \n}",
"function acf_disable_filter($name = '')\n{\n}",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t}",
"function idg_base_theme_disable_native_search( $query, $error = true ) { //phpcs:ignore -- $error never used.\n\t\t// Allow native search to be performed in the Admin and via REST.\n\t\tif ( is_admin() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_search() ) {\n\t\t\theader( 'HTTP/1.0 404 Not Found' );\n\n\t\t\t$query->is_search = false;\n\t\t\t$query->query_vars['s'] = false;\n\t\t\t$query->query['s'] = false;\n\n\t\t\t$query->is_404 = true;\n\t\t}\n\t}",
"public function setSearchOrNoSearch($status){\n $this->searchOrNoSearch = (int)$status;\n }",
"public static function action_before_query() {\n\t\t\tif ( function_exists( 'pmpro_search_filter' ) ) {\n\t\t\t\tremove_filter( 'pre_get_posts', 'pmpro_search_filter' );\n\t\t\t}\n\t\t}",
"function nscm_exclude_cpts_search() {\n\tglobal $wp_post_types;\n\tif( post_type_exists( 'ucf_section' ) )\n\t\t$wp_post_types['ucf_section']->exclude_from_search = true;\n}",
"function acf_disable_filters()\n{\n}",
"public function setExcludSearch($exclude = false ){\n\t\t$this->excludeSearch = $exclude;\n\t}",
"public function searchWithoutFilter($params)\n {\n\t\t$query = Evidence::find()->joinWith(['evidencetype','evidencecategory','evidenceunit','evidencecompunit','evidenceattachments'])\n ->orderBy(['tbl_evidence.id'=>SORT_DESC]);\n \t$dataProvider = new ActiveDataProvider([\n \t\t\t'query' => $query,\n \t\t\t'pagination'=>['pageSize'=>25]\n \t]);\n\n\n \t$this->load($params);\n\t\t/* if (!$this->validate()) {\n \t\t// uncomment the following line if you do not want to return any records when validation fails\n \t\t// $query->where('0=1');\n \t\treturn $dataProvider;\n \t} */\n\n \treturn $dataProvider;\n }",
"function accouk_exclude_pages_from_search_results($query) {\n\n if ($query->is_search) {\n $query->set('post_type', 'post');\n }\n\n return $query;\n\n}",
"public function getExcludeHideFromSearch()\n {\n return $this->excludeHideFromSearch;\n }",
"public function filtering();",
"public function negate()\n\t{\n\t\tif($this->sWhere == '')\n\t\t{\n\t\t\t$this->sWhere = 'FALSE';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->sWhere = 'NOT (' . $this->sWhere . ')';\n\t\t}\n\t}",
"protected function tweakTaskSearch() {\n\t\tparent::setProjectsInTaskSearchForCommercial(false);\n\t}",
"function culturefeed_search_ui_set_noindex_metatag() {\n\n // Default noindex should be shown.\n $noindex = TRUE;\n\n $query = drupal_get_query_parameters(NULL, array('q'));\n // Start page should be indexed.\n if (empty($query)) {\n $noindex = FALSE;\n }\n else {\n\n // No index is FALSE, if user is filtering on entity type actor.\n if (isset($query['facet']['type'])) {\n\n $facets = $query['facet'];\n if ($query['facet']['type'][0] == 'actor') {\n unset($facets['type']);\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n }\n\n // If type=actor is the only parameter with flandersregion, set noindex to false.\n if (count($facets) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n // No index is FALSE, if user is filtering on actor type.\n if (isset($query['facet']['category_actortype_id'])) {\n\n $facets = $query['facet'];\n unset($facets['category_actortype_id']);\n unset($facets['type']);\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n\n unset($query['location']);\n unset($query['regId']);\n unset($query['actors']);\n unset($query['facet']);\n\n // If type, flandersregion, location and/or regId was the only extra facet / parameters, set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n // No index is FALSE, if user is filtering on event type.\n elseif (isset($query['facet']['category_eventtype_id'])) {\n\n if (count($query['facet']['category_eventtype_id']) == 1) {\n\n $facets = $query['facet'];\n unset($facets['category_eventtype_id']);\n\n if (isset($query['facet']['category_theme_id'])) {\n if (count($query['facet']['category_theme_id']) <= 1) {\n unset($facets['category_theme_id']);\n }\n }\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n\n unset($query['location']);\n unset($query['regId']);\n unset($query['facet']);\n unset($query['voor-kinderen']);\n\n // If theme_id, flandersregion and/or regId was the only extra facet / parameters, set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on umv category and/or region.\n elseif (isset($query['facet']['category_umv_id'])) {\n\n if (count($query['facet']['category_umv_id']) == 1) {\n\n $facets = $query['facet'];\n unset($facets['category_umv_id']);\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n\n unset($query['location']);\n unset($query['regId']);\n unset($query['facet']);\n\n // If flandersregion or regId was the only extra facet / parameters, set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on datetype today and max 1 flandersregion Id.\n elseif (isset($query['facet']['datetype'])) {\n\n if ($query['facet']['datetype'][0] == 'today') {\n\n $facets = $query['facet'];\n unset($facets['datetype']);\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n\n if(count($query['facet']['category_flandersregion_id']) == 1) {\n unset($facets['category_flandersregion_id']);\n }\n\n }\n \n unset($query['facet']);\n\n // If datetype today was the only filter with max 1 flandersregion Id set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on flandersregion Id.\n elseif (isset($query['facet']['category_flandersregion_id'])) {\n\n if (count($query['facet']['category_flandersregion_id']) == 1) {\n\n $facets = $query['facet'];\n unset($facets['category_flandersregion_id']);\n unset($query['facet']);\n\n // If flandersregion Id was the only filter set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on location or region Id without additional facets.\n elseif (isset($query['regId']) || isset($query['location'])) {\n\n unset($query['location']);\n unset($query['regId']);\n\n // If location or regId was the only filter set noindex to false.\n if (count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // Add the \"noindex, follow\" meta tag if needed.\n if ($noindex) {\n culturefeed_search_set_noindex_metatag();\n }\n\n}",
"public function noWildcardSearching()\n {\n $this->wildcardSearching = false;\n\n return $this;\n }"
] |
[
"0.6523719",
"0.6319493",
"0.62253064",
"0.6224475",
"0.61818004",
"0.6135331",
"0.60477525",
"0.6033651",
"0.59845036",
"0.5884777",
"0.58787864",
"0.5849319",
"0.58472914",
"0.57764995",
"0.57526904",
"0.5717378",
"0.56791455",
"0.5662878",
"0.56064045",
"0.5603792",
"0.5596134",
"0.55794626",
"0.5545397",
"0.5517601",
"0.5509674",
"0.550297",
"0.54993206",
"0.54953504",
"0.5475644",
"0.54435956"
] |
0.7059569
|
0
|
Builds the URI of the index.
|
public function buildIndexUri(): string;
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function get_index_url()\n {\n }",
"public function buildBackendUri() {}",
"public function buildFrontendUri() {}",
"private function _buildUri(): string {\n return !empty($this->query) ? $this->uri.'?'.http_build_query($this->query) : $this->uri;\n }",
"public function getIndexUrl()\n {\n return [\n 'path' => $this->request->get('_route'),\n 'params' => ['folderId' => $this->folder->getId()],\n ];\n }",
"public function buildIndex();",
"public function uri()\n {\n return $this->factory->getUri($this->handle);\n }",
"public function uri();",
"public function uri();",
"public function uri();",
"abstract public function buildUri($options);",
"public function buildIndexCreator()\n {\n $indexCreator = $this->createIndexCreator();\n $indexCreator->setPath($this->path);\n $indexCreator->setFileName($this->filenamePrefix);\n $indexCreator->setLimit($this->limit);\n $indexCreator->setSitemapsCount($this->sitemapsCount);\n $indexCreator->useFormatCustom($this->format, $this->extension);\n\n return $indexCreator;\n }",
"public function page_uri_index()\n {\n }",
"private function getSearchURI()\n {\n $q = $this->getInput('q');\n $hide_expired = $this->getInput('hide_expired');\n $hide_local = $this->getInput('hide_local');\n $priceFrom = $this->getInput('priceFrom');\n $priceTo = $this->getInput('priceTo');\n $url = $this->i8n('bridge-uri')\n . 'search/advanced?q='\n . urlencode($q)\n . '&hide_expired=' . $hide_expired\n . '&hide_local=' . $hide_local\n . '&priceFrom=' . $priceFrom\n . '&priceTo=' . $priceTo\n /* Some default parameters\n * search_fields : Search in Titres & Descriptions & Codes\n * sort_by : Sort the search by new deals\n * time_frame : Search will not be on a limited timeframe\n */\n . '&search_fields[]=1&search_fields[]=2&search_fields[]=3&sort_by=new&time_frame=0';\n return $url;\n }",
"function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}",
"private function _buildUrl() {\n $url = OPENDIGI_API_ENDPOINT;\n $url .= '?Vcollection=' . implode('+', $this->_collections);\n if ($this->_languages)\n $url .= '&Vlanguages=' . implode('+', $this->_languages);\n if ($this->_subjectIds)\n $url .= '&Vsubjectids=' . implode('+', $this->_subjectIds);\n\n return $url;\n }",
"private function buildBaseUrl()\n {\n return $this->scheme() . $this->host;\n }",
"private function createIndexs()\n {\n if(is_array($this->queryIndex) && count($this->queryIndex) > 0){\n $queryIndex = implode(', ', $this->queryIndex);\n return \", {$queryIndex}\";\n }\n }",
"abstract protected function buildSpecificRequestUri();",
"public function uri()\n {\n return sprintf('products/%s', $this->id);\n }",
"private function _getContentURI(){\r\n $uri = substr($_SERVER['REQUEST_URI'], strlen(WEBROOT));\r\n if (strstr($uri, '?')) $uri = substr($uri, 0, strpos($uri, '?'));\r\n $uri = str_replace('index.php', '', $uri);\r\n $uri = trim($uri, '/');\r\n\r\n if($uri == ''){\r\n $uri = 'index';\r\n }\r\n\r\n return $uri;\r\n }",
"public function get_uri()\n {\n }",
"public function uri()\n {\n return '/foo/bar';\n }",
"private function buildClientUrl() {\n // protocol\n $s = &$_SERVER;\n $ssl = (array_key_exists('HTTPS', $s) && !empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;\n $sp = array_key_exists('SERVER_PROTOCOL', $s) ? strtolower($s['SERVER_PROTOCOL']) : 'http';\n $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');\n\n // port\n $port = array_key_exists('SERVER_PORT', $s) ? $s['SERVER_PORT'] : '';\n $port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port;\n\n // host\n $host = array_key_exists('HTTP_X_FORWARDED_HOST', $s) && isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (array_key_exists('HTTP_HOST', $s) && isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);\n $host = isset($host) ? $host : (array_key_exists('SERVER_NAME', $s) ? $s['SERVER_NAME'] : $s['USER']) . $port;\n\n // build the uri\n return $protocol . '://' . $host . (array_key_exists('REQUEST_URI', $s) ? $s['REQUEST_URI'] : 'localhost');\n }",
"protected function get_uri()\n {\n }",
"static function getURI() {\n return '/';\n }",
"private function base_uri( $localizable = TRUE ) {\r\n\t\treturn implode ( '/', array (\r\n\t\t\t\t$this->host,\r\n\t\t\t\tself::API_VERSION \r\n\t\t) );\r\n\t}",
"protected function _build_url() {\n\n $params = array_filter([\n 'name' => $this->_names,\n 'country_id' => $this->_country_id,\n 'language_id' => $this->_language_id,\n ], function($v) {\n if (!is_array($v)) {\n return strlen(trim($v)) > 0;\n } else {\n return $v;\n }\n });\n //Only pass apikey if there is one set\n if ($api_key = $this->get_api_key()) {\n $params['apikey'] = trim($api_key);\n }\n\n return self::BASE . '?' . http_build_query($params);\n }",
"protected function buildUri($uri)\n {\n // Prepare any existing options\n if (array_key_exists('options', $this->config)) {\n $options = [];\n foreach ($this->config['options'] as $option) {\n $options[$option] = '1';\n }\n\n // Append options as querystring\n $query = http_build_query($options);\n $uri = $uri.'?'.$query;\n }\n\n if (isset($this->config['base_uri'])) {\n return $this->config['base_uri'].$uri;\n }\n\n return $uri;\n }",
"private static function getURI()\n {\n $uri = $_SERVER['REQUEST_URI']; // get URI\n\n $uri = str_replace('../', '', $uri); // security reasons\n\n if (substr($uri, strlen($uri)-1,1)=='/') // strip ending '/'\n $uri = substr($uri, 0, strlen($uri)-1);\n\n if ($uri=='') // if it's index page\n $uri = '/index';\n\n return $uri;\n }"
] |
[
"0.6956857",
"0.6793137",
"0.6791243",
"0.67232627",
"0.66196686",
"0.64982927",
"0.606921",
"0.6053853",
"0.6053853",
"0.6053853",
"0.6011646",
"0.6001522",
"0.5963693",
"0.59589106",
"0.5958212",
"0.59474504",
"0.59390473",
"0.58789235",
"0.58540934",
"0.5852988",
"0.58111805",
"0.5796645",
"0.5787037",
"0.57810056",
"0.5775735",
"0.57695204",
"0.57692933",
"0.57464916",
"0.5739743",
"0.572981"
] |
0.89603347
|
0
|
Builds the URI of the password.
|
public function buildPasswordUri(): string;
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function generateString()\n\t{\n\t\t// start with the scheme\n\t\t$url = $this->scheme . '://';\n\t\t\n\t\t// user and password\n\t\tif( !empty( $this->user ) )\n\t\t{\n\t\t\t$url .= $this->user;\n\t\t\tif( !empty( $this->pass ) ) $url .= ':'.$this->pass.'@';\n\t\t\telse $url .= '@';\n\t\t}\n\t\t\n\t\t// add the host and path\n\t\t$url .= $this->host . '/';\n\t\t$url .= $this->path;\n\t\t\n\t\t// add the URL-encoded parameters\n\t\tif( !empty( $this->params ) )\n\t\t{\n\t\t\t$url .= '?';\n\t\t\tforeach( $this->params as $f => $v ) $url .= $f . '=' . urlencode( $v ) . '&';\n\t\t\t$url = rtrim( $url, '&' );\n\t\t}\n\t\t\n\t\t// add the anchor if any\n\t\tif( !empty( $this->anchor ) ) $url .= '#' . $this->anchor;\n\t\t\n\t\t$this->url = $url;\n\t\t$this->modified = false;\n\t\treturn $url;\n\t}",
"private function buildUrl() : string\n {\n $redirectUri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $params = http_build_query([\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'checkid_setup',\n 'openid.return_to' => (string) $redirectUri,\n 'openid.realm' => (string) $redirectUri,\n 'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',\n 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',\n ]);\n\n return (string) (new Uri($this->getOpenIdUrl().'/login'))->withQuery($params);\n }",
"private function _buildUri(): string {\n return !empty($this->query) ? $this->uri.'?'.http_build_query($this->query) : $this->uri;\n }",
"public function getBaseUri()\n {\n if ($this->valid() === false) {\n require_once 'Zend/Uri/Exception.php';\n throw new Zend_Uri_Exception('One or more parts of the URI are invalid');\n }\n\n $password = strlen($this->_password) > 0 ? \":$this->_password\" : '';\n $auth = strlen($this->_username) > 0 ? \"$this->_username$password@\" : '';\n $port = strlen($this->_port) > 0 ? \":$this->_port\" : '';\n\n return $this->_scheme\n . '://'\n . $auth\n . $this->_host\n . $port\n . $this->_path;\n }",
"public function buildBackendUri() {}",
"function getEditPasswordUrl() {\n return assemble_url('people_company_user_edit_password', array(\n 'company_id' => $this->getCompanyId(),\n 'user_id' => $this->getId(),\n ));\n }",
"public function getChangePasswordUrl()\n {\n $url = sprintf(\"%s/change-password?client_id=%s&state=%s\",\n $this->client->getBaseUrl(),\n $this->client->getConfig('client_id'),\n md5(uniqid())\n );\n\n return $url;\n }",
"function change_password_url() {\n return new moodle_url($this->config->changepasswordurl);\n }",
"public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}",
"abstract public function getAuthUri(): string;",
"function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}",
"private function buildClientUrl() {\n // protocol\n $s = &$_SERVER;\n $ssl = (array_key_exists('HTTPS', $s) && !empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;\n $sp = array_key_exists('SERVER_PROTOCOL', $s) ? strtolower($s['SERVER_PROTOCOL']) : 'http';\n $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');\n\n // port\n $port = array_key_exists('SERVER_PORT', $s) ? $s['SERVER_PORT'] : '';\n $port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port;\n\n // host\n $host = array_key_exists('HTTP_X_FORWARDED_HOST', $s) && isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (array_key_exists('HTTP_HOST', $s) && isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);\n $host = isset($host) ? $host : (array_key_exists('SERVER_NAME', $s) ? $s['SERVER_NAME'] : $s['USER']) . $port;\n\n // build the uri\n return $protocol . '://' . $host . (array_key_exists('REQUEST_URI', $s) ? $s['REQUEST_URI'] : 'localhost');\n }",
"function generate_api_url(){\n\t\t$parameters = array(\n\t\t\t'uid' \t\t => $this->uid,\n\t\t\t'pswd' \t\t => $this->pswd,\n\t\t\t'api' \t\t => $this->api,\n\t\t\t'apiversion' => $this->apiversion\t\t\t\n\t\t);\n\t\t\n\t\tif(!empty($this->sid) && !empty($this->encrypted_pswd)){\n\t\t\t$parameters['sid'] = $this->sid;\n\t\t\t$parameters['pswd'] = $this->encrypted_pswd;\n\t\t}\n\t\t\n\t\t//var_dump($parameters);\n\t\t\n\t\treturn self::api_end_point . '?' . http_build_query($parameters);\n\t}",
"public function getExternalChangePasswordUrl();",
"function getResetPasswordUrl() {\n \treturn assemble_url('reset_password', array(\n \t 'user_id' => $this->getId(),\n \t 'code' => $this->getPasswordResetKey(),\n \t));\n }",
"public function getUri()\n {\n return 'https://'.$this->getAuth().'@'.self::BASE_URI.'/v1/';\n }",
"private function _getLoginUrl(){\r\n\t\t\r\n\t\t$settings = $this->getConnectionSettings();\r\n\t\t\r\n\t\t$base = $this->_loginInstance['production'];\r\n\t\tif ($settings['type'] !== 'production')\r\n\t\t\t$base = $this->_loginInstance['sandbox'];\r\n\t\t\r\n\t\treturn $base . $this->_authUri;\r\n\t}",
"private function buildBaseUrl()\n {\n return $this->scheme() . $this->host;\n }",
"public function __toString() {\n\n $uri = ($this->getScheme()) ? $this->getScheme() . '://' : '';\n\n // If the authority URI part is present, we add it. authority includes the user\n // information, host, and port. Otherwise, we just append host and port\n if ($this->getAuthority()) {\n $uri .= $this->getAuthority();\n }\n else {\n $uri .= ($this->getHost()) ? $this->getHost() : '';\n $uri .= ($this->getPort()) ? ':' . $this->getPort() : '';\n }\n $path = $this->getPath();\n\n // Before adding path, we first check whether the first character is '/'. If not, we add it.\n if ($path) {\n if ($path[0] != '/') {\n $uri .= '/' . $path;\n }\n else {\n $uri .= $path;\n }\n }\n\n // ...We then add query and fragment, if present!\n $uri .= ($this->getQuery()) ? '?' . $this->getQuery() : '';\n $uri .= ($this->getFragment()) ? '#' . $this->getFragment() : '';\n return $uri;\n }",
"public function password() {\n if ($this->proxy_pass)\n return $this->proxy_pass;\n\n return '';\n }",
"public function getGetUrl()\n {\n $scheme = empty($this->rowUrl[\"scheme\"]) ? \"http://\" : $this->rowUrl[\"scheme\"] . \"://\";\n\n $user = empty($this->rowUrl[\"user\"]) ? \"\" : $this->rowUrl[\"user\"];\n $pass = empty($this->rowUrl[\"pass\"]) ? \"\" : $this->rowUrl[\"pass\"];\n\n if (!empty($pass)) $user .= \":\";\n if (!empty($user) || !empty($pass)) $pass .= \"@\";\n\n $host = $this->rowUrl[\"host\"];\n $port = empty($this->rowUrl[\"port\"]) ? \"\" : \":\" . $this->rowUrl[\"port\"];\n\n $path = empty($this->rowUrl[\"path\"]) ? \"\" : $this->rowUrl[\"path\"];\n\n $urlquery = \"\";\n if (count($this->getParams) > 0)\n {\n $urlquery = \"?\" . http_build_query($this->getParams);\n }\n return $scheme . $user . $pass . $host . $port . $path . $urlquery;\n }",
"function _http_build_url($parts) { \n return implode(\"\", array(\n isset($parts['scheme']) ? $parts['scheme'] . '://' : '',\n isset($parts['user']) ? $parts['user'] : '',\n isset($parts['pass']) ? ':' . $parts['pass'] : '',\n (isset($parts['user']) || isset($parts['pass'])) ? \"@\" : '',\n isset($parts['host']) ? $parts['host'] : '',\n isset($parts['port']) ? ':' . intval($parts['port']) : '',\n isset($parts['path']) ? $parts['path'] : '',\n isset($parts['query']) ? '?' . $parts['query'] : '',\n isset($parts['fragment']) ? '#' . $parts['fragment'] : ''\n ));\n}",
"public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }",
"protected function buildUri($resourceUri) {\n\t\t$userId = $this->getRequestContext()->getUserId();\n\t\t$userGroupIds = $this->getRequestContext()->getUserGroupIds();\n\t\t$validityPeriod = $this->calculateLinkLifetime();\n\t\t$hash = $this->getHash($resourceUri, $userId, $userGroupIds, $validityPeriod);\n\n\t\t$linkFormat = $this->configurationManager->getValue('linkFormat');\n\t\t// Parsing the link format, and return this instead (an flexible link format is useful for mod_rewrite tricks ;)\n\t\tif (is_null($linkFormat) || strpos($linkFormat, '###FEGROUPS###') === FALSE) {\n\t\t\t$linkFormat = 'index.php?eID=tx_nawsecuredl&u=###FEUSER###&g=###FEGROUPS###&t=###TIMEOUT###&hash=###HASH###&file=###FILE###';\n\t\t}\n\t\t$tokens = array('###FEUSER###', '###FEGROUPS###', '###FILE###', '###TIMEOUT###', '###HASH###');\n\t\t$replacements = array($userId, rawurlencode(implode(',', $userGroupIds)), GeneralUtility::rawUrlEncodeFP($resourceUri), $validityPeriod, $hash);\n\t\t$downloadUri = str_replace($tokens, $replacements, $linkFormat);\n\t\treturn $downloadUri;\n\t}",
"function build_url($parts)\n{\n return ( isset($parts['scheme']) ? \"{$parts['scheme']}:\" : '' ) .\n ( ( isset($parts['user']) || isset($parts['host']) ) ? '//' : '' ) .\n ( isset($parts['user']) ? \"{$parts['user']}\" : '' ) .\n ( isset($parts['pass']) ? \":{$parts['pass']}\" : '' ) .\n ( isset($parts['user']) ? '@' : '' ) .\n ( isset($parts['host']) ? \"{$parts['host']}\" : '' ) .\n ( isset($parts['port']) ? \":{$parts['port']}\" : '' ) .\n ( isset($parts['path']) ? \"{$parts['path']}\" : '' ) .\n ( isset($parts['query']) ? \"?{$parts['query']}\" : '' ) .\n ( isset($parts['fragment']) ? \"#{$parts['fragment']}\" : '' );\n}",
"public function generatePassword() {\n $generator = new UriSafeTokenGenerator();\n $token = $generator->generateToken();\n return substr($token, 0, 6);\n }",
"public function getForgetPasswordUrl() {\n\t\treturn $this->getEmailActionLink('email/changePassword');\n\t}",
"public function getPassword() : string\n {\n return explode(':', $this->uri->getUserInfo() ?: '')[1] ?? '';\n }",
"private function _password_itoa64() {\n return './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n }",
"public function authenticateUri()\n {\n $args = array(\n 'client_id' => $this->_clientId,\n 'client_secret' => $this->_clientSecret,\n 'response_type' => 'code',\n 'redirect_url' => $this->_redirectUri,\n );\n\n return 'https://untappd.com/oauth/authenticate/?' . http_build_query($args);\n }"
] |
[
"0.7153289",
"0.66182363",
"0.65636295",
"0.6330628",
"0.62709427",
"0.6178287",
"0.6174496",
"0.612365",
"0.60921836",
"0.60723734",
"0.6055364",
"0.60109",
"0.6010225",
"0.5991526",
"0.5970183",
"0.59670275",
"0.59447473",
"0.5938947",
"0.5915427",
"0.58831275",
"0.58585364",
"0.58446467",
"0.583376",
"0.5828256",
"0.58260494",
"0.58153635",
"0.5804719",
"0.58040786",
"0.5802947",
"0.57793856"
] |
0.874558
|
0
|
Get store Total sales with currency.
|
public function todaysSalesTotal()
{
//get todays Date
$fromDate = Mage::helper('magemobapp')->getTodaysDate();
$storeId = Mage::getModel('magemobapp/storeinfo')->getStoreId();
$collection = Mage::getResourceModel('sales/order_collection')->addAttributeToFilter('created_at', array(
'from' => $fromDate
));
if ($storeId != 0) {
$collection->addAttributeToFilter('store_id', $storeId); //fill store
}
//$collection;
$collection->addAttributeToSelect('base_grand_total')->addAttributeToSelect('base_total_refunded')->addAttributeToSelect('base_total_paid');
$data = $collection->getData();
$total = 0;
foreach ($data as $eachData) {
if (isset($eachData['status']) && $eachData['status'] == 'complete') {
if ($eachData['base_total_refunded'] == '') {
$total += (float) $eachData['base_total_paid'];
} else {
$total += (float) $eachData['base_total_paid'] - (float) $eachData['base_total_refunded'];
}
} else {
$total += (float) $eachData['base_grand_total'];
}
}
return Mage::helper('core')->currency($total, true, false);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function totalSale()\r\n {\r\n //$strSQLQuery = \"SELECT SUM(TotalPrice) as OrderTotal FROM e_orders WHERE PaymentStatus=1 AND OrderStatus='Completed'\";\r\n $strSQLQuery = \"SELECT SUM((CASE when Currency='USD' then TotalPrice \r\n \t\telse TotalPrice/CurrencyValue\r\n\tEND )) as OrderTotal FROM e_orders WHERE (PaymentStatus='1' OR OrderType in('Amazon','Ebay')) AND OrderStatus in ('Completed', 'Shipped','Unshipped') \";\r\n $arrayRow = $this->query($strSQLQuery, 1);\r\n return $arrayRow[0]['OrderTotal'];\r\n }",
"public function getTotalPrice()\n {\n // use format_currency to get correct decimals and avoid rounding errors\n return $this->getQuantity() * format_currency($this->getProductPrice(),null, true);\n// return $this->getQuantity() * format_currency($this->getNetPrice(),null, true);\n }",
"function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}",
"public function getStoreCurrencyCode();",
"public function TotalSale() {\n\treturn $this->nTotSale;\n }",
"function get_cart_total() {\n\t\t\tif (!$this->prices_include_tax) :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total);\n\t\t\telse :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total + $this->tax_total);\n\t\t\tendif;\n\t\t}",
"public function gettotal()\n {\n $query = $this->db->query(\"SELECT SUM(`price`) as total FROM `sales` WHERE DATE(`date`)=CURDATE()\");\n return $query->result();\n\n }",
"public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }",
"public function getTotal()\n {\n return $this->totalCalculator->getCartTotal($this->cart);\n }",
"function getPriceTotal()\n{\n\t$total = \\Cart::instance('shopping')->total();\n\n return $total;\n}",
"public function getTotalPrice()\n {\n $stat = $this->getAllStat();\n return $stat['totalPrice'];\r\n }",
"protected function _getTotal()\n {\n return $this->formatPriceWithComma($this->_getOrder()->getGrandTotal());\n }",
"public function getTotals($login,$crncy,$status,$sales=NULL){\n $type = $sales ? \"author\" : \"buyer\";\n $what = $crncy == \"czk\" ? \"SUM(czk_price)\" : \"SUM(final_price)\";\n $arg = array($type => $login);\n $status ? $arg[\"status\"] = $status : TRUE;\n return $this->slc($what, \"orders\", $arg);\n }",
"protected function getStoreProductAmount(): float\n\t{\n\t\treturn (float)($this->getStoreProductRow()['AMOUNT'] ?? 0.0);\n\t}",
"public function getTotal(): float\n {\n $total = 0;\n foreach ($this->itemsVolume as $code => $volume) {\n $total += $this->store->calculatePrice($code, $volume);\n }\n return $total;\n }",
"public function gettotalbuy()\n {\n $query = $this->db->query(\"SELECT SUM(`price`) as total FROM `purchase` WHERE DATE(`date`)=CURDATE()\");\n return $query->result();\n\n }",
"public function getTotal()\n {\n return ($this->amount + $this->tax_amount)* $this->currency_converter;\n }",
"public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }",
"public function total(): float\n {\n return $this->itemsPrice()->sum(fn (array $item) => $item['price']);\n }",
"public function totalMoney($provider)\n {\n $total = 0;\n foreach ($provider->data as $item)\n $total += $item->value;\n return $total;\n }",
"public function getTotalGrossPrice()\n {\n // use format_currency to get correct decimals and avoid rounding errors\n return $this->getQuantity() * format_currency($this->getGrossPrice(),null, true);\n }",
"public static function getCartTotal(){\n $totalAmount=0;\n $cart = self::getCartContent();\n foreach ($cart as $key => $value) {\n if(is_numeric($value['amount']))\n $totalAmount += $value['amount'];\n }\n return $totalAmount;\n }",
"public function get_xendit_amount( $total, $currency = 'IDR' ) {\n\t\tif ( ! $currency ) {\n\t\t\t$currency = get_woocommerce_currency();\n\t\t}\n\t\t$total = $total;\n\n\t\techo '<script>var total = '.$total.'</script>';\n\t\treturn $total;\n\t}",
"public function getCurrency();",
"public function getCurrency();",
"function getTotalPrice(){\n \treturn $this->myCart->total();\n }",
"function getCartTotal(){\n\t\t$totalCost = 0;\n\t\t$cartInfo = $this->getCart();\n\t\t$cartInfoSize = sizeof($cartInfo);\n\t\t$cartInfoSize--;\n\t\tfor($i=0; $i<=$cartInfoSize; $i++) {\n\t\t\t$totalCost = $totalCost + $cartInfo[$i][\"price\"];\n\t\t}\n\n\t\treturn $totalCost;\t\n\t}",
"static public function ctrShowSumSales(){\n\n\t\t\t$tabla = \"productos\";\n\n\t\t\t$respuesta = ModelProducts::mdlShowSumSales($tabla);\n\n\t\t\treturn $respuesta;\n\n\n\t\t}",
"public function getTotalAmount();",
"public function getCurrency()\r\n\t{\r\n\t\treturn $this->getTransaction()->getCurrency();\r\n\t}"
] |
[
"0.7206213",
"0.66518694",
"0.6614605",
"0.649589",
"0.6476405",
"0.6429748",
"0.6403048",
"0.6402986",
"0.63874066",
"0.63866514",
"0.623594",
"0.62295353",
"0.61892766",
"0.6158977",
"0.61530596",
"0.6141016",
"0.6123033",
"0.61169326",
"0.61142814",
"0.6102398",
"0.6098066",
"0.6090009",
"0.6078961",
"0.6066533",
"0.6066533",
"0.60634804",
"0.60535395",
"0.60515565",
"0.6025014",
"0.60111207"
] |
0.722228
|
0
|
Get all entry type files from the register directories.
|
function papi_get_all_core_type_files() {
return papi()->once( __FUNCTION__, function() {
$directories = papi_filter_settings_directories();
$result = [];
foreach ( $directories as $directory ) {
$result = array_merge( $result, papi_get_all_files_in_directory( $directory ) );
}
// Get the last file path from directories.
$result = array_map( 'papi_get_core_type_file_path', $result );
// Only unique path, no duplicated path is allowed.
return array_unique( $result );
} );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function getAll()\r\n {\r\n return self::$typeRegistry;\r\n }",
"public static function GetExportFileTypeList()\n\t{\n\t\t$files = scandir(TYPE_ROOT);\n\n\t\t$types = array();\n\n\t\tforeach($files as $file) {\n\t\t\tif(!is_file(TYPE_ROOT . $file) || isc_substr($file, -3) != \"php\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trequire_once TYPE_ROOT . $file;\n\n\t\t\t$file = isc_substr($file, 0, isc_strlen($file) - 4);\n\t\t\t/*\n\t\t\t$pos = isc_strrpos($file, \".\");\n\t\t\t$typeName = isc_strtoupper(isc_substr($file, $pos + 1));\n\t\t\t*/\n\t\t\t$className = \"ISC_ADMIN_EXPORTFILETYPE_\" . strtoupper($file); //$typeName;\n\t\t\tif(!class_exists($className)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$obj = new $className;\n\t\t\tif (!$obj->ignore) {\n\t\t\t\t$types[$file] = $obj->GetTypeDetails();\n\t\t\t}\n\t\t}\n\n\t\treturn $types;\n\t}",
"public static function get_all() {\n global $CFG;\n // Get directory listing (excluding simpletest, CVS, etc)\n $list = core_component::get_plugin_list('forumngtype');\n\n $results = array();\n foreach ($list as $name => $location) {\n $results[] = self::get_new(str_replace('forumngtype_', '', $name));\n }\n return $results;\n }",
"public static function get_all_types() {\t\t$types = scandir(str_replace(\"/\", \"\\\\\", dirname(plugin_dir_path( __FILE__ )) . \"\\\\ESWP\\\\MyTypes\"));\r\n\t\t$size = count($types);\r\n\t\t$_types = array();\r\n\t\t\r\n\t\t//Feed in the extra types\r\n\t\t$extra_types = array();\r\n\t\tif(has_filter(\"es_include_types\")) {\r\n\t\t\t$extra_types = apply_filters(\"es_include_types\", $extra_types);\r\n\t\t\t\r\n\t\t\t$size += count($extra_types);\r\n\t\t\t\r\n\t\t\tforeach ($extra_types as $type) {\r\n\t\t\t\t$order = $size;\r\n\t\t\t\t\r\n\t\t\t\tif (method_exists($type, \"get_order\")) {\r\n\t\t\t\t\t$order = $type->get_order();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tarray_push($_types, array(\r\n\t\t\t\t\t\"order\" => $order,\r\n\t\t\t\t\t\"type\" => $type\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Add the included types\r\n\t\tforeach ($types as $type) {\r\n\t\t\tif ($type !== \"BaseType.php\" && trim($type, \".\") !== \"\") {\r\n\t\t\t\t$order = $size + 10;\r\n\t\t\t\t$_type = \"\\\\ESWP\\\\MyTypes\\\\\". explode(\".\", $type)[0];\r\n\t\t\t\t\r\n\t\t\t\tif (class_exists($_type)) {\r\n\t\t\t\t\t$_type_obj = new $_type();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (method_exists($_type, \"get_order\")) {\r\n\t\t\t\t\t\t$order = $_type_obj->get_order();\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\tarray_push($_types, array(\r\n\t\t\t\t\t\t\"order\" => $order,\r\n\t\t\t\t\t\t\"type\" => $_type_obj\r\n\t\t\t\t\t));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $_types;\r\n\t}",
"private function readTypes() {\n $files = $this->path->read();\n\n foreach ($files as $file) {\n if ($file->isDirectory()) {\n continue;\n }\n\n $this->readType($file->getName());\n }\n }",
"public static function get_type_registry()\n {\n }",
"function cextras_types_formulaires(){\r\n\t$types = array();\r\n\r\n\tforeach(_chemin() as $dir) {\r\n\t\tif (@is_dir($s = $dir.'extra-saisies/')) {\r\n\t\t\tforeach(preg_files($s, '.*.html$') as $saisie) {\r\n\t\t\t\t$type = basename($saisie,'.html');\r\n\t\t\t\t$types[$type] = array(\r\n\t\t\t\t\t'nom' => _T('cextras:type', array('type' => $type))\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $types;\r\n}",
"function mimetypes()\n {\n return json_decode(file_get_contents(__DIR__.'/../../resources/data/mimetypes.json'), true);\n }",
"public static function getTypes();",
"public static function getAllMimeTypes():array;",
"public function all()\n\t{\n\t\t$extensions = array();\n\n\t\t// Loop through extensions directories\n\t\tforeach ($this->extensions_directories() as $directory)\n\t\t{\n\t\t\t// Get our extension slug - always\n\t\t\t// matches the folder name.\n\t\t\t$slug = basename($directory);\n\n\t\t\t// Read extension info. Always do this even\n\t\t\t// if no details are required as this will\n\t\t\t// validate the extension.\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$extensions[$slug] = $this->get($slug);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tksort($extensions);\n\t\treturn array_values($extensions);\n\t}",
"function getFiles($dir)\r\n{\r\n\tglobal $types, $debug, $globalGetFiles;\r\n\tif ( !isset($globalGetFiles[$dir]) )\r\n\t{\r\n\t\t$dir = cleanPath($dir);\r\n\t\t$files = array();\r\n\t\t$list = array();\r\n\t\t\r\n\t\t// Loop through each of the files in this directory\r\n\t\t$files = glob($dir.'/*');\r\n\t\tforeach ( $files as $file )\r\n\t\t{\r\n\t\t\tif ( !empty($debug) && empty($log) )\r\n\t\t\t{\r\n\t\t\t\t$log = \"getFiles(\".$dir.\")\\n----------\\n\";\r\n\t\t\t}\r\n\t\t\t// Check each file against the list of types in config.php\r\n\t\t\tforeach ( $types as $type )\r\n\t\t\t{\r\n\t\t\t\t// Lower case the file extension to be sure\r\n\t\t\t\tif ( substr(strtolower($file),-3) == $type )\r\n\t\t\t\t{\r\n\t\t\t\t\t$list[] = $file;\r\n\t\t\t\t\tif ( !empty($debug) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$log .= \"list[] = \".$file.\"\\n\";\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\tunset($files);\r\n\t\t// Alphabetize files in case insensitive order\r\n\t\tnatcasesort($list);\r\n\t\tif ( !empty($debug) )\r\n\t\t{\r\n\t\t\t$log .= \"\\n\";\r\n\t\t\tdebugLog($log);\r\n\t\t}\r\n\t\t$globalGetFiles[$dir] = $list;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$list = $globalGetFiles[$dir];\r\n\t}\r\n\treturn $list;\r\n}",
"public static function getCustomMimeTypeList()\n {\n # Returns the system MIME type mapping of extensions to MIME types.\n $out = array();\n $file = fopen( Configuration::mimeTypeList, 'r' );\n while ( ( $line = fgets( $file ) ) !== false ) {\n $line = trim( preg_replace( '/#.*/', '', $line ) );\n if ( ! $line )\n continue;\n $parts = preg_split( '/\\s+/', $line );\n if ( count( $parts ) == 1 )\n continue;\n $type = array_shift( $parts );\n foreach( $parts as $part )\n $out[$part] = $type;\n }\n fclose( $file );\n return $out;\n }",
"protected function getRegisteredClasses() {}",
"public function getRegisteredResources()\n {\n $result = array();\n foreach ($this->getResourcesTypes() as $type) {\n $result[$type] = $this->getRegisteredResourcesByType($type);\n }\n\n return $result;\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/google_search.php',\n 'lang_custom/EN/google_search.ini',\n 'sources_custom/blocks/side_google_search.php',\n 'sources_custom/blocks/main_google_results.php',\n 'themes/default/templates_custom/BLOCK_SIDE_GOOGLE_SEARCH.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_GOOGLE_SEARCH_RESULTS.tpl',\n 'themes/default/css_custom/google_search.css',\n 'pages/comcode_custom/EN/_google_search.txt',\n );\n }",
"public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}",
"protected function getTypes() {}",
"public function scan($type, $include_tests = NULL) {\n\n // Search the legacy sites/all directory.\n $searchdirs[static::PDB_SITES_ALL] = 'modules/pdb';\n\n $files = array();\n foreach ($searchdirs as $dir) {\n // Discover all extensions in the directory, unless we did already.\n if (!isset(static::$files[$dir][$include_tests])) {\n static::$files[$dir][$include_tests] = $this->scanDirectory($dir, $include_tests);\n }\n // Only return extensions of the requested type.\n if (isset(static::$files[$dir][$include_tests][$type])) {\n $files += static::$files[$dir][$include_tests][$type];\n }\n }\n\n // Sort the discovered extensions by their originating directories.\n $origin_weights = array_flip($searchdirs);\n $files = $this->sort($files, $origin_weights);\n\n // Process and return the list of extensions keyed by extension name.\n return $this->process($files);\n }",
"function loadMimeTypes() {\n\t\tif( empty( $this->mMimeTypes )) {\n\t\t\t// use bitweavers mime.types file to ensure everyone has our set unless user forces his own.\n\t\t\tif( defined( 'MIME_TYPES' ) && is_file( MIME_TYPES )) {\n\t\t\t\t$mimeFile = MIME_TYPES;\n\t\t\t} else {\n\t\t\t\t$mimeFile = KERNEL_PKG_PATH.'admin/mime.types';\n\t\t\t}\n\n\t\t\t$this->mMimeTypes = array();\n\t\t\tif( $fp = fopen( $mimeFile,\"r\" ) ) {\n\t\t\t\twhile( FALSE != ( $line = fgets( $fp, 4096 ) ) ) {\n\t\t\t\t\tif( !preg_match( \"/^\\s*(?!#)\\s*(\\S+)\\s+(?=\\S)(.+)/\", $line, $match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = preg_split( \"/\\s/\",trim( $match[2] ) );\n\t\t\t\t\tforeach( $tmp as $type ) {\n\t\t\t\t\t\t$this->mMimeTypes[strtolower( $type )] = $match[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose( $fp );\n\t\t\t}\n\t\t}\n\t}",
"public function getTypeLoaders(): array\n {\n return $this->typeLoaders;\n }",
"private function _discover() {\n\n $dir = new DirectoryIterator($this->dirname);\n\n foreach ($dir as $file) {\n\n if ($file->isFile() && !$file->isDot()) {\n\n $filename = $file->getFilename();\n $pathname = $file->getPathname();\n\n if (preg_match('/^(\\d+\\W*)?(\\w+)\\.php$/', $filename, $matches)) {\n require_once($pathname);\n $class = \"{$matches[2]}_{$this->suffix}\";\n $files[$filename] = new $class();\n }\n\n }\n\n }\n\n ksort($files);\n $plugins = array_values($files);\n\n return $plugins;\n\n }",
"public function getRegisteredResourcesByType($type)\n {\n $result = array();\n foreach ($this->getPreparedResources() as $subresources) {\n if (!empty($subresources[$type])) {\n foreach ($subresources[$type] as $path => $file) {\n if (isset($result[$path])) {\n unset($result[$path]);\n }\n $result[$path] = $file;\n }\n }\n }\n\n return $result;\n }",
"public static function getTypes(): array\n {\n return self::getRelevancyTypes();\n }",
"public function getContents()\n {\n $list = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($this->_root)\n );\n $elements = array();\n foreach ($list as $element) {\n if ($this->_include->isIncluded($element)\n && !$this->_ignore->isIgnored($element)) {\n $file = substr($element->getPathname(), strlen($this->_root));\n $elements[$file] = array(\n 'role' => $this->_role->getRole($file),\n 'as' => $this->_install_as->getInstallAs($file, 'Horde_' . basename($this->_root))\n );\n }\n }\n return $elements;\n }",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();"
] |
[
"0.6557053",
"0.6500607",
"0.64096427",
"0.6295222",
"0.62182826",
"0.61614853",
"0.61492985",
"0.6012318",
"0.5962611",
"0.5946225",
"0.5894969",
"0.58928925",
"0.5859755",
"0.5852471",
"0.58245873",
"0.57742643",
"0.5763665",
"0.57474506",
"0.5727999",
"0.57188195",
"0.57173234",
"0.57094264",
"0.5689849",
"0.5687503",
"0.5681547",
"0.5677737",
"0.5668012",
"0.5668012",
"0.5668012",
"0.5668012"
] |
0.6548937
|
1
|
Simple Cube function Return the cube of the input value
|
function cubeIt($val) {
return $val*$val*$val;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function cube($value)\n {\n return (float) $value - floor($value / $this->cube_size) * $this->cube_size;\n }",
"function cube_encode($value)\n{\n return bin_encode($value);\n}",
"public function getTotalCube()\n {\n $cube = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $cube = $cube + $basketProduct->getProduct()->getCube() * $basketProduct->getQuantity();\n }\n }\n \n return $cube;\n }",
"public function createCube($size);",
"public function getVolume(){ // calcolo il volume del cubo che è area del quadrato * lato (lato * lato * lato)\n return parent::getArea() * $this -> side; \n }",
"function cubize($name, $texture_top, $texture_side, $texture_bottom, $useMapColorTop = false, $debug = false){\n\n\truncmd('convert'\n\t.'( '.$texture_top.' -alpha set -virtual-pixel transparent '\n\t.($useMapColorTop ? '-size 1x1 xc:Green -fx \"u*v.p{0,0}\" ' : ' ')\n\t\t.'+distort Affine \"0,256 0,0 0,0 -87,-50 256,256 87,-50\" ) '\n\t.'( '.$texture_side.' -alpha set -virtual-pixel transparent -fill black -colorize 25% '\n\t\t.'+distort Affine \"256,0 0,0 0,0 -87,-50 256,256 0,100\" ) '\n\t.'( '.$texture_side.' -alpha set -virtual-pixel transparent -fill black -colorize 50% '\n\t\t.'+distort Affine \" 0,0 0,0 0,256 0,100 256,0 87,-50\" ) '\n\t.'-background none -compose plus -layers merge +repage -compose over cubes/'.$name.'.png',$debug);\n\n\t\n\t/*runcmd(\"convert \\\\\n \\\\( $texture_top -alpha set -virtual-pixel transparent \\\\\n +distort Affine '0,512 0,0 0,0 -87,-50 512,512 87,-50' \\\\) \\\\\n \\\\( $texture_side -alpha set -virtual-pixel transparent \\\\\n +distort Affine '512,0 0,0 0,0 -87,-50 512,512 0,100' \\\\) \\\\\n \\\\( $texture_side -alpha set -virtual-pixel transparent \\\\\n +distort Affine ' 0,0 0,0 0,320 0,100 320,0 87,-50' \\\\) \\\\\n \\\\\n -background none -compose plus -layers merge +repage \\\\\n -bordercolor black -compose over -border 5x2 isometric_cube.png\",$debug);*/\n\n # Create some square images for the cube\n //system('convert '.$texture_top.' -resize 256x256 top.png');\n //runcmd('convert '.$texture_top.' -resize 256x256^ -gravity center -extent 256x256 top.png',$debug);\n //runcmd('convert '.$texture_side.' -resize 256x256 side.png',$debug);\n //system('convert '.$texture_side.' -resize 256x256 right.jpg');\n\n # top image shear.\n //system('convert top.png -resize 256x256! -alpha set -background none -shear 0x30 -rotate -60 -gravity center top_shear.png');\n //runcmd('convert top.png -resize 260x301! -alpha set -background none -shear 0x30 top_shear0.png',$debug);\n //runcmd('convert top_shear0.png -alpha set -background none -rotate -60 -gravity center -crop 520x301+0+0 top_shear3.png',$debug);\n # left image shear\n //system('convert side.png -resize 256x256! -alpha set -background none -shear 0x30 left_shear.png');\n\t//runcmd('convert side.png -resize 260x301! -alpha set -background none -shear 0x30 left_shear.png',$debug);\n # right image shear\n //system('convert side.png -resize 256x256! -alpha set -background none -shear 0x-30 right_shear.png');\n\t//runcmd('convert side.png -resize 260x301! -alpha set -background none -shear 0x-30 right_shear.png',$debug);\n\n # combine them.\n //system('convert left_shear.png right_shear.png +append ( top_shear.png -repage +33-220 ) -background none -layers merge +repage cubes/'.$name.'.png');\n //runcmd('convert left_shear.png right_shear.png +append \\\\( top_shear.png -repage +0-149 \\\\) -background none -layers merge +repage -resize 30% isometric_shears7.png 2>&1',$debug);\n\n # cleanup\n //rm -f top.jpg left.jpg right.jpg\n //rm -f top_shear.png left_shear.png right_shear.png\n \n\n}",
"public function multiplyBy3($value)\n {\n return $value * 3;\n }",
"function get_cubes() {\r\n\r\n$xml=buildxml(); \r\n \r\nforeach($xml->Cube as $cube)\r\n{\r\n $cubename[]=$cube['name']; \r\n}\r\nreturn $cubename;\r\n}",
"public function factor();",
"public function getSquare();",
"function scalarProduct($scal)\n\t\t{\n\t\t\t$res = new Vector(array('dest' => new Vertex(array(\n\t\t\t\t'x' => $this->_x * $scal,\n\t\t\t\t'y' => $this->_y * $scal,\n\t\t\t\t'z' => $this->_z * $scal\n\t\t\t))));\n\t\t\treturn ($res);\n\t\t}",
"function testCreateCubeDimensionMeasures()\r\n\t{\r\n\t\t$olap = new Olap($this->dbh);\r\n\t\t$olap->deleteCube($this->testCubeName); // Purge cube if already exists\r\n\r\n\t\t// Get new cube\r\n\t\t$cube = $olap->getCube($this->testCubeName);\r\n\r\n\t\t// Now dynamically create dimension\r\n\t\t$dim = $cube->getDimension(\"country\");\r\n\t\t$this->assertTrue($dim->id > 0);\r\n\t\t$this->assertTrue($this->dbh->ColumnExists(\"facts_\".$cube->id, \"dim_\".$dim->id));\r\n\r\n\t\t// Now dynamically create measure\r\n\t\t$meas = $cube->getMeasure(\"count\");\r\n\t\t$this->assertTrue($meas->id > 0);\r\n\t\t$this->assertTrue($this->dbh->ColumnExists(\"facts_\".$cube->id, \"m_\".$meas->id));\r\n\r\n\t\t// Unload data just to make sure nothing is cached\r\n\t\tunset($cube);\r\n\t\t$cube = $olap->getCube($this->testCubeName);\r\n $dim = $cube->getDimension(\"country\", null, false);\r\n\t\t$this->assertTrue($dim->id > 0); // do not create it if it does not exist (second param)\r\n \r\n $meas = $cube->getMeasure(\"count\", false);\r\n\t\t$this->assertTrue($meas->id > 0); // do not create it if it does not exist (second param)\r\n\r\n\t\t$cube->remove();\r\n\t}",
"function calculerSurfaceMurs ($largeur, $longueur, $hauteur)\n {\n // $surface = ($largeur * $hauteur + $longueur * $hauteur) * 2;\n $surface = 2 * $hauteur * ($largeur + $longueur);\n\n return $surface; \n }",
"public function square();",
"public function mul($n)\n {\n $v = clone $this;\n\n for($i = 0; $i < $this->dim(); $i++)\n {\n $v->vector[$i] = $this->cube($this->vector[$i] * $n);\n }\n\n return $v;\n }",
"public function show( $cubiculo)\n { return $cubiculo=Cubiculo::where('cubiculo',$cubiculo)->first();\n \n \n }",
"public function getCubex()\n {\n if(!$this->isCubexAvailable())\n {\n throw new \\RuntimeException(\n \"The cubex application has not been set\",\n 404\n );\n }\n return $this->_cubex;\n }",
"function calculerSurface ($longueur, $largeur, $hauteur)\r\n{\r\n $surfaceGrandMur = $longueur * $hauteur;\r\n $surfacePetitMur = $largeur * $hauteur;\r\n $surfaceTotale = ($surfaceGrandMur + $surfacePetitMur) * 2;\r\n \r\n return $surfaceTotale;\r\n // return 2 * $hauteur * ($longueur + $largeur);\r\n}",
"public function volumeSphere()\n { // 4/3 PI R3\n return number_format(((pow(parent::getDiametre()/2,3)*pi()*4)/3),2);\n }",
"public function testCreateCubeForUiTest()\r\n\t{\r\n\t\t$olap = new Olap($this->dbh);\r\n\r\n\t\t// Get new cube\r\n\t\t$cube = $olap->getCube(\"tests/report\");\r\n\r\n\t\t// Record an entry for each quarter\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/index.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => date(\"m/d/Y\", strtotime(\"-4 months\")),\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 100);\r\n\t\t$cube->writeData($measures, $data);\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/about.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => date(\"m/d/Y\", strtotime(\"-3 months\")),\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 75);\r\n\t\t$cube->writeData($measures, $data);\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/about.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => date(\"m/d/Y\", strtotime(\"-2 months\")),\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 50);\r\n\t\t$cube->writeData($measures, $data);\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/about.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => date(\"m/d/Y\", strtotime(\"-1 months\")),\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 25);\r\n\t\t$cube->writeData($measures, $data);\r\n\t}",
"function elevaralcubo($num1){\n \n $res=pow($num1,3);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"public function scalarProduct($k)\n {\n if (is_int($k) || is_float($k) || is_double($k))\n {\n $x = $this->_x * $k;\n $y = $this->_y * $k;\n $z = $this->_z * $k;\n return (new Vector( array ( \"dest\" => new Vertex(array('x' => $x, 'y' => $y, 'z' => $z)))));\n }\n else\n {\n echo \"Please, pass 'scalarProduct' int, float or double\" . PHP_EOL;\n return ;\n }\n }",
"function collatzConjecture(int $num) { \n if($num === 1) {\n echo $num . \"\\n\";\n return;\n }\n\n if($num % 2 === 0) {\n echo $num . \"\\n\"; \n return collatzConjecture($num / 2);\n }\n \n else {\n echo $num . \"\\n\";\n return collatzConjecture($num * 3 + 1);\n }\n }",
"public function mul_to($n)\n {\n for($i = 0; $i < $this->dim(); $i++)\n {\n $this->vector[$i] = $this->cube($this->vector[$i] * $n);\n }\n }",
"public function testCosh()\n {\n $cosh = Trigonometry::cosh(1.5);\n $this->assertEquals(2.3524096152432, $cosh, '', 1E-8);\n }",
"public function get_cat_three()\n {\n $select = $this->db->get('category_three');\n $cat_three = $select->result();\n return $cat_three;\n }",
"public function getCofactors(): Matrix\n {\n $this->validateDimensions($this, self::SQUARE);\n\n return $this->map(function ($cell, $x, $y) {\n return pow(-1, $x + $y) * $this->getMinors($x, $y)->determinant();\n });\n }",
"function armstrong_number(int $num){\n $temp = $num; // store the number in a temporary variable\n $result = 0; // variable to store the result\n\n // loop till the the temporary variable is not equal to zero\n while($temp != 0){\n $remainder = $temp%10; // get the remainder of temp variable divided by 10\n $result = $result + $remainder*$remainder*$remainder; // add the result with cube of the remainder\n\n $temp = $temp/10; // change the temp variable by dividing it by 10\n }\n\n return $result; // return result\n }",
"function square($num){\n $square = $num * $num;\n return $square;\n \n\n}",
"public function calculateSurface() {\n $semiPerimeter = ($this->sideA + $this->sideB + $this->sideC) / 2;\n $surface = sqrt(\n $semiPerimeter\n * ($semiPerimeter - $this->sideA)\n * ($semiPerimeter - $this->sideB)\n * ($semiPerimeter - $this->sideC)\n );\n return $surface;\n }"
] |
[
"0.77840984",
"0.6184692",
"0.6116731",
"0.583512",
"0.55219173",
"0.5478989",
"0.5246979",
"0.5226943",
"0.51188713",
"0.51110965",
"0.5064169",
"0.50256264",
"0.481387",
"0.4752041",
"0.47487283",
"0.4727762",
"0.4688322",
"0.46528623",
"0.46328196",
"0.46177",
"0.45943767",
"0.4554278",
"0.45473525",
"0.44949868",
"0.44904578",
"0.4487712",
"0.44777107",
"0.44656315",
"0.44511038",
"0.44438654"
] |
0.79724497
|
0
|
print empty tracks arg 1 (int): heat position arg 2 (int): up to this position arg 3 (int): column span returns next position
|
function printEmptyTracks($position, $last, $span)
{
require('./lib/common.lib.php');
include('./config.inc.php');
global $content_list;
while($position <= $last)
{
$content_list .= "<tr class=''>";
$content_list .= "<td class='pos'>".$position."</td>";
$content_list .= "<td class='bib'> </td>";
$content_list .= "<td class='name' colspan='".$span."'><span id='empty'>" . $GLOBALS['strEmpty'] ."</span></td>";
$content_list .= "</tr>";
$position++;
}
return $position;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }",
"function displayChessboard ($pieces)\r\n{\r\n\r\n\t$alphaIndex = array ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h');\r\n\t\r\n\tprint (\"<table border=\\\"1\\\" cellpadding=\\\"10\\\">\");\r\n\tprint (\"<tr>\");\r\n\tprint (\"<td> </td>\");\r\n\tforeach ($alphaIndex as $aI)\r\n\t{\r\n\t\tprint (\"<td> $aI </td>\");\r\n\t} \r\n\tprint (\"<td> </td>\");\r\n\tprint (\"</tr>\");\r\n\t\r\n\tfor ($j = 8; $j > 0; $j--)\r\n\t{\r\n\t\tprint (\"<tr>\");\r\n\t\tprint (\"<td>$j</td>\");\r\n\t\tforeach ($alphaIndex as $aI)\r\n\t\t{\r\n\t\t\tif (!empty($pieces[$j][$aI]))\r\n\t\t\t{\r\n\t\t\t\t$abbrev \t= $pieces[$j][$aI]->getTypeAbbrev();\r\n\t\t\t\t$colorNote = $pieces[$j][$aI]->getColorAbbrev();\r\n\t\t\t\tprint (\"<td>\" . $colorNote . $abbrev . \"</td>\"); \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<td> </td>\");\r\n\t\t}\r\n\t\tprint (\"<td>$j</td>\");\t\t\r\n\t}\t\r\n\r\n\tprint (\"<tr>\");\r\n\tprint (\"<td> </td>\");\r\n\tforeach ($alphaIndex as $aI)\r\n\t{\r\n\t\tprint (\"<td> $aI </td>\");\r\n\t} \r\n\tprint (\"<td> </td>\");\r\n\tprint (\"</tr>\");\r\n\t\r\n\tprint (\"</table>\");\r\n\r\n}",
"function show_cell($which) {\r\n $token = $this->position[$which];\r\n if ($token <> '-') {\r\n $player_board = str_split($this->board); \r\n return '<td style=\"text-align:center;' . ($token != $player_board[$which] ? ' background-color: #FFA500;' : '' ) . '\"><div style=\"padding: 1em;\">' . $token . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n }\r\n $this->newposition = $this->position; \r\n $this->newposition[$which] = 'x'; \r\n $move = implode($this->newposition); \r\n $link = '?size=' . $this->grid_size . '&board=' . $move . ($this->debug ? '&debug' : ''); \r\n return '<td style=\"text-align:center;\"><a href = \"' . $link . '\" style = \"text-decoration: none;\"><div style=\"padding: 1em;\">-' . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></a></td>';\r\n }",
"private function writeGuts(): void\n {\n $record = 0x0080; // Record identifier\n $length = 0x0008; // Bytes to follow\n\n $dxRwGut = 0x0000; // Size of row gutter\n $dxColGut = 0x0000; // Size of col gutter\n\n // determine maximum row outline level\n $maxRowOutlineLevel = 0;\n foreach ($this->phpSheet->getRowDimensions() as $rowDimension) {\n $maxRowOutlineLevel = max($maxRowOutlineLevel, $rowDimension->getOutlineLevel());\n }\n\n $col_level = 0;\n\n // Calculate the maximum column outline level. The equivalent calculation\n // for the row outline level is carried out in writeRow().\n $colcount = count($this->columnInfo);\n for ($i = 0; $i < $colcount; ++$i) {\n $col_level = max($this->columnInfo[$i][5], $col_level);\n }\n\n // Set the limits for the outline levels (0 <= x <= 7).\n $col_level = max(0, min($col_level, 7));\n\n // The displayed level is one greater than the max outline levels\n if ($maxRowOutlineLevel) {\n ++$maxRowOutlineLevel;\n }\n if ($col_level) {\n ++$col_level;\n }\n\n $header = pack('vv', $record, $length);\n $data = pack('vvvv', $dxRwGut, $dxColGut, $maxRowOutlineLevel, $col_level);\n\n $this->append($header . $data);\n }",
"private function cover_zeros(){\n\t\t$this->numLines = 0;\n\t\t$this->lines = array();\n\t\t\n\t\t\n\t\t\n\t\tforeach ($this->clonedGrid as $row => $cols)\n\t\t{\n\t\t\tforeach ( $cols as $col => $value){\n\t\t\t\t$this->lines[$row][$col] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($this->clonedGrid as $row => $cols)\n\t\t{\n\t\t\tforeach ( $cols as $col => $value){\n\t\t\t\t\n\t\t\t\tif($value == 0) {\n\t\t\t\t\t\n\t\t\t\t\t$this->strike_nieghbors($row, $col, $this->max_vh($row, $col));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function game_play($link) {\r\n echo '<br />'; \r\n if ($this->grid_size > 3) {\r\n \r\n }\r\n echo '<font face = \"courier\" size = \"5\">';\r\n echo '<table cols = \"' . ($this->debug ? $this->grid_size + 2 : $this->grid_size) . '\" border = \"1\" style = \"font-weight:bold; border-collapse: collapse\">';\r\n if ($this->debug) {\r\n echo '<thead><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th style=\"padding: 5px;\"> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></thead>';\r\n echo '<tfoot><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></tfoot>';\r\n }\r\n echo '<tbody><tr>';\r\n $row = 1; \r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n for ($pos = 0; $pos < pow($this->grid_size, 2); $pos++) {\r\n if ($link) {\r\n echo $this->show_cell($pos);\r\n } else {\r\n\t\t\t\t\r\n\t\t\t\t\t echo '<td style=\"text-align:center;' . (in_array($pos, $this->winning_line[0]) ? ' background-color: #90EE90;' : ' opacity: 0.5;' ) . '\"><div style=\"padding: 1em;\">' . $this->position[$pos] . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $pos . ':(' . $row . ',' . (($pos % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n\t\t\t\t\t\r\n\t\t\t}\r\n if (($pos + 1) % $this->grid_size == 0) {\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row++ . '</th>';\r\n }\r\n if (($pos + 1) != pow($this->grid_size, 2)) {\r\n echo '</tr><tr>';\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n }\r\n }\r\n }\r\n echo '</tr></tbody>';\r\n echo '</table>';\r\n echo '</font>';\r\n echo '<br /><hr />';\r\n }",
"function displaypaintings($row, &$flag, $cnt)\n{\n if($flag) // do it one time and set it back to false\n {\n echo '<div class=\"ui centered grid\">';\n echo '<div class=\"twelve wide column\"><h2 class=\"ui header\">Paintings</h2><div class=\"ui divider\"></div></div>';\n $flag = false;\n }\n if($cnt % 6 == 0)\n {\n if($cnt != 0) echo '</div>'; // close previous tag\n echo '<div class=\"ui six column row\">';\n }\n echo '<div class=\"two wide column\"><a href=\"single-painting.php?id=' . $row['PaintingID'] . '\">\n <img class=\"thumbnail\" src=\"images/art/works/square-medium/' . $row['ImageFileName'] . '.jpg\" alt=\"' . utf8_encode($row['Title']) . '\">\n </a></div>';\n}",
"function display() {\n echo'<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\n echo'<tr>'; //first row\n for ($pos = 0; $pos < 9; $pos++) {\n echo $this->show_cell($pos);\n if ($pos % 3 == 2)\n echo '</tr><tr>'; //next square is in a new row\n }\n echo'</tr>';\n echo'</table>';\n }",
"function display_graphic($piece)\n{\n}",
"public function printGridlines() {\n\t}",
"function part1() {\n $this->fabric = array_fill($this->minY, $this->spanY,\n array_fill($this->minX, $this->spanX, 0)\n );\n // Fill fabric with smaller areas:\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n\n while ($w > 0) {\n while ($h > 0) {\n// echo \"($x,$y)\\n\";\n // Place area id in empty cell:\n if ($this->fabric[$y][$x] === 0) {\n $this->fabric[$y][$x] = $id;\n }\n // Place '@' where areas overlap:\n else if ($this->fabric[$y][$x] !== '@' && $this->fabric[$y][$x] !== 0) {\n $this->fabric[$y][$x] = '@';\n }\n $y++;\n $h--;\n }\n $y = $a['y'];\n $h = $a['h'];\n $x++;\n $w--;\n }\n }\n //$this->printGrid($fabric);\n $charCounts = $this->charCounter('@', $this->fabric);\n echo \"Overlap: $charCounts\\n\";\n }",
"protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }",
"public function getBlankPositions()\r\n {\r\n// example\r\n $blanks = [\r\n [0, 0],\r\n [0, 1],\r\n [0, 2],\r\n ];\r\n\r\n// todo...\r\n\r\n for($i=0;$i<self::ROWS;$i++)\r\n\t{\r\n\t\tfor($j=0;$j<self::COLUMNS;$j++)\r\n\t\t{\r\n\t\t\tif($this->pieces[$i][$j] == '')\r\n\t\t\t{\r\n\t\t\t\t array_push($blanks, [$i,$j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n return $blanks;\r\n }",
"function section_null () {echo \"top\"; asdf();}",
"function render($world, $initial_data) {\n $rendering = '';\n for ($y = 0; $y <= $initial_data->numberOfCells -1; $y++) {\n $rendering .= $y;\n if($y <= 9){ $rendering .= \" \";}\n for ($x = 0; $x <= $initial_data->numberOfCells -1; $x++) {\n $cells = $world->getState();\n $rendering .= '|' . (isset($cells[$x][$y]) ? $cells[$x][$y]->to_char() : '|');\n }\n $rendering .= \"\\n\";\n }\n return $rendering;\n}",
"function papan_catur($angka) {\n for($row=1;$row<=$angka;$row++){\n for($col=1;$col<$angka*2;$col++){\n if(($row+$col)%2==0){\n echo \"#\";\n } else {\n echo \" \";\n }\n }\n echo \"<br>\";\n }\n}",
"function blank_cell($num=1, $css='', $extras='') {\n $this->end_cell();\n\n if (!is_numeric($num)) {\n $num = 1;\n }\n\n for($i=1;$i<=$num;$i++) {\n $this->new_cell($css,$extras);\n echo ' ';\n }\n }",
"public function printPath(): void\n {\n [$row, $column] = $this->last;\n [\"--show-grid\" => $gridType] = $this->args;\n for ($r = 0; $r < count($this->grid_array); $r++) {\n echo \"[\";\n for ($c = 0; $c < count($this->grid_array[$r]); $c++) {\n $grid = ($gridType == \"symbol\")\n ? $this->resolve($this->grid_array[$r][$c])[\"symbol\"]\n : $this->grid_array[$r][$c];\n echo ($c == 0) ? \"\" : \"[\";\n echo ($r == $row && $c == $column)\n ? \"(\" . $grid . \")\"\n : \" \" . $grid . \" \";\n echo ($c == count($this->grid_array[$r]) - 1) ? \"\" : \"]\";\n }\n echo \"] \\n\";\n }\n }",
"function getStart($tab, $nbLigne, $nbChar){\n\n \n $z = 0;//check 0\n $u = 0;//check 1\n $add = 0;\n $err4 = \"Il manque un point de départ ou d'arrivée!\".PHP_EOL;\n\n $xd = 0;\n $yd = 0; //coord du point de départ\n\n $xa = 0;\n $ya = 0; //coord du point d'arrivée \n\n for ($j=0; $j<$nbLigne; $j++){ \n for ($i=0; $i<$nbChar; $i++){ \n \n if ($tab[$j][$i] === '0'){\n $z++;\n $z = $z++; // echo $z.' check 0'.PHP_EOL; \n //RECHERCHE DE COORDONNEES\n $xd = $i;// \n echo \"xd=\".($xd).\" \";\n $yd = $j;// \n echo \"yd=\".($yd).PHP_EOL;\n }\n if ($tab[$j][$i] === '1'){\n $u++;\n $u = $u++; // echo $u .' check 1'.PHP_EOL;\n //RECHERCHE DE COORDONNEES\n $xa = $i;//\n echo \"xa=\".($xa).\" \";\n $ya = $j;//\n echo \"ya=\".($ya).PHP_EOL; \n } \n }\n }\n\n if ($z === 1 && $u === 1){\n play($tab, $nbLigne, $nbChar, $xd, $yd, $xa, $ya); //echo \"the play can beggin\".PHP_EOL;\n }\n else\n exit($err4);\n}",
"public function print($trackingNo);",
"function part2() {\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n $area = $this->charCounter($id, $this->fabric);\n echo \"$id: $area\\n\";\n if ($area == $w * $h) {\n die(\"$id fills $area cells and is not overlapped.\\n\");\n }\n }\n echo \"No region found.\\n\";\n }",
"function printN()\r\n{\r\n for($i=0;$i<8;$i++){\r\n for($j=0;$j<6;$j++){\r\n if($j==0 || $j==5||$i==$j+1){\r\n echo \"*\";\r\n } else {\r\n echo \" \";\r\n }\r\n }\r\n echo \"\\n\";\r\n }\r\n echo \"\\n\";\r\n}",
"protected function createEmpty(Game $game, $row, $col)\n {\n }",
"function display() {\r\n echo '<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\r\n echo '<tr>'; \r\n for ($pos = 0; $pos < 9; $pos++) { \r\n echo $this->show_cell($pos); \r\n if ($pos % 3 == 2) {\r\n echo '</tr><tr>';\r\n } \r\n }\r\n echo '</tr>';\r\n echo '</table>';\r\n }",
"function blankMiddleBox($header,$subline,$body){\n\t\techo \"<div class='side-body-bg'>\\n\";\n\t\techo \"<span class='scapmain'>$header</span>\\n\";\n\t\techo \"<br />\\n\";\n\t\techo \"<span class='poster'>$subline</span>\\n\";\n\t\techo \"</div>\\n\";\n\t\techo \"<div class='tbl'>$body</div>\\n\";\n\t\techo \"<br />\\n\";\n\t}",
"function show_cell($which) {\r\n $token = $this->position[$which];\r\n if ($token <> '-') {\r\n return '<td>' . $token . '</td>';\r\n }\r\n $this->newposition = $this->position;\r\n $this->newposition[$which] = 'o';\r\n $move = implode($this->newposition);\r\n $link = '?board=' .$move;\r\n return '<td><a href=' . $link . '>-</a></td>';\r\n }",
"function f_blank_columnist(){\n\treturn '/images/pixel_transp.gif';\n\t}",
"function printNeighbors(){\n\t\tforeach($vertexList as $v){\n\t\t\tif(count($v->neighbors) > 0){\n\t\t\t\tprint($word . \": \");\n\t\t\t\tforeach($v->neighbors as $vertex){\n\t\t\t\t\tprint($vertex->word.\", \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function expandTrack($track,$topLevel){\n global $groupData;\n\n //Store groups so we can print them after the courses\n $groups = array();\n\n echo '<div>';\n $check = False;\n if(strcmp($track[0], \"all\") != 0 ) {\n $check = True;\n echo '<h3>Choose '.intval($track[0]).\" of the following options</h3>\\n\";\n }\n for($i=1; $i<count($track); $i++){ \n //Don't print if it's a group.\n if(array_key_exists($track[$i], $groupData)){\n $groups[] = $track[$i];\n } else {\n\n printCourse($track[$i],$check,$topLevel);\n\n }\n //echo '<br>';\n }\n\n foreach($groups as $group){\n populate($group,1);\n }\n echo '</div>';\n }",
"public function displayGridlines() {\n\t}"
] |
[
"0.5756331",
"0.5414057",
"0.52481335",
"0.5087289",
"0.4967454",
"0.49493054",
"0.49477232",
"0.49064204",
"0.48000473",
"0.47351345",
"0.4734095",
"0.47205347",
"0.46945283",
"0.4674949",
"0.4661803",
"0.46586233",
"0.46486333",
"0.46414474",
"0.4629038",
"0.4617592",
"0.46147525",
"0.4600817",
"0.4596984",
"0.45400786",
"0.44883144",
"0.4468411",
"0.4443656",
"0.4433518",
"0.44331005",
"0.44248453"
] |
0.69792956
|
0
|
$PAR_CONTENU contient l'identifiant du widget
|
protected function _parse($PAR_CONTENU)
{
include_once CLASS_DIR . 'class.db_webotheque.php';
include_once CLASS_DIR . 'class.Link.php';
Link::delete($this->mode . 'PARAGRAPHE', $this->getID());
$oWebo = new Webo_WIDGET($PAR_CONTENU);
if ($oWebo->checkAuthorized(false) || $oWebo->checkShareAuthorized(false)) {
Link::insertWebotheque($this->mode . 'PARAGRAPHE', $this->getID(), $PAR_CONTENU);
return $oWebo->getField('WEB_DESCRIPTIONACC');
}
return '';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function wp_render_widget_control($id)\n {\n }",
"public function getWidget();",
"public function get_widget_control($args)\n {\n }",
"private function initializeWidgetIdentifier() {}",
"public function MyWidget() {\n\t\t// Instantiate the parent object\n\t\t\n\t\tparent::__construct(\n\t\t\t'show_base_value', // Base ID\n\t\t\t__( 'Visualizza info base', 'Widget che visualizza informazioni base dell\\'azienda' ), // Name\n\t\t\tarray( 'description' => __( 'Visualizza info base', 'Una bella descrizione del mio piccolo widget' ), ) // Args\n\t\t);\n\t\n\t}",
"function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}",
"function ftagementor_description_Widget() {\r\r\n register_widget( 'ftagementor_description_Widget' );\r\r\n}",
"function frmContinut() {\n\t\t$out = '';\n\t\t$out .= '\n\t\t<div id=\"div_info_produs\" style=\" font-weight:bold;color:red;\"> </div>\n\t\t'. $this -> continut_id() .'\n\t\t'. $this -> produs_id() .'\n\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t<tr>\n\t\t\t<td>Cantitate</td>\n\t\t\t<td align=\"left\" >'. $this -> cantitate() .' </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align=\"left\" >UM:</td>\n\t\t\t<td align=\"left\" >\n\t\t\t<span id=\"div_frm_unitate_masura\"></span>\n\t\t\t</td>\n\t\t</tr>\t \t \n\t\t</table>\n\t\t<div align=\"right\">\n<input type=\"button\" name=\"btnSalveaza\" id=\"btnSalveazaComp\" value=\"Salveaza\" onClick=\"xajax_saveComponenta(xajax.getFormValues(\\'frm_bonuri_consum_continut\\'), $(\\'#bon_consum_id\\').val())\">\n\t\t<input type=\"button\" name=\"btnAnuleaza\" id=\"btnAnuleaza\" value=\"Anuleaza\" onClick=\"xajax_frmComponenta(0, $(\\'#bon_consum_id\\').val())\">\t\t</div>\n\t\t';\n\t\treturn $this -> frmInnerHtml($out);\n\t}",
"abstract public function getWidget() : string;",
"public function form( $instace ){\n echo '<p><strong>Widget ini belum bisa diubag secara Manual!</strong><br> Hubungi developer untuk melakukan perubahan</p>'; \n }",
"function parques_widget_init()\n{\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'progress-bar',\n\t\t\t'name'\t\t\t=> 'Barra de progreso',\n\t\t\t'description'\t=> 'Barra de progreso que indica el avance del proyecto',\n\t\t\t'before_widget' => '<div>',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-footer',\n\t\t\t'name'\t\t\t=> \"footer\",\n\t\t\t'description'\t=> 'footer con la infomacion del contacto en todas las pag',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"col-sm-4\">',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-social',\n\t\t\t'name'\t\t\t=> \"widget-social\",\n\t\t\t'description'\t=> 'Contenido para las redes sociales',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-social\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-gallery',\n\t\t\t'name'\t\t\t=> \"widget-gallery\",\n\t\t\t'description'\t=> 'widget para el plugin de galerias',\n\t\t\t'before_widget' => '<div class=\"widget-gallery\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-banner',\n\t\t\t'name'\t\t\t=> \"widget-banner\",\n\t\t\t'description'\t=> 'Banner para parques del rio.',\n\t\t\t'before_widget' => '<div id=\"widget-banner\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-home',\n\t\t\t'name'\t\t\t=> \"widget-home\",\n\t\t\t'description'\t=> 'Contenido relacionado con articulos del sitio.',\n\t\t\t'before_widget' => '<div id=\"widget-home\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-progreso',\n\t\t\t'name'\t\t\t=> \"widget-progreso\",\n\t\t\t'description'\t=> 'Widget con barra de progreso del proyecto.',\n\t\t\t'before_widget' => '<div id=\"widget-progreso\" class=\"hidden-xs\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-categorias',\n\t\t\t'name'\t\t\t=> \"widget-categorias\",\n\t\t\t'description'\t=> 'Widget con categorías del proyecto.',\n\t\t\t'before_widget' => '<div id=\"widget-categorias\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'sidebar',\n\t\t\t'name'\t\t\t=> \"sidebar\",\n\t\t\t'description'\t=> 'Sidebar',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-%1$s\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'nav-menu-narrativa',\n\t\t\t'name'\t\t\t=> \"nav-menu-narrativa\",\n\t\t\t'description'\t=> 'Sidebar',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-%1$s\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n}",
"function SetWidget() {\n\t\t\n\t\t\tif ( !function_exists('register_sidebar_widget') ) \n\t\t\treturn;\n\t\t\t\n\t\t\t// This registers our widget so it appears with the other available\n\t\t\t// widgets and can be dragged and dropped into any active sidebars.\n\t\t\tregister_sidebar_widget(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteo'));\n\t\t\n\t\t\t// This registers our optional widget control form.\n\t\t\tregister_widget_control(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteoControl'), 450, 325);\n\t\t}",
"function widget($args, $inst)\n {\n// $title = apply_filters( 'widget_title', $instance['title'] );\n// $title_color = apply_filters( 'widget_title', $instance['title_color'] );\n $image_about = $this->getVal( $inst, 'image_about' );\n $title_color = $this->getVal( $inst, 'title_color' );\n $title = $this->getVal( $inst, 'title' );\n $desc = $this->getVal( $inst, 'desc' );\n ?>\n <section class=\"ftco-section services-section\" id=\"about\">\n <div class=\"container\">\n <div class=\"row no-gutters\">\n <div class=\"col-md-6 p-md-5 img img-2 d-flex justify-content-center align-items-center\" style=\"background-image: url(<?php echo $image_about; ?>);\">\n </div>\n <div class=\"col-md-6 wrap-about py-md-5 ftco-animate\">\n <div class=\"heading-section mb-5 pl-md-5\">\n <span class=\"subheading\"><?php echo $title_color; ?></span>\n <h2 class=\"mb-4\"><?php echo $title; ?></h2>\n <p><?php echo $desc; ?></p>\n </div>\n </div>\n </div>\n </div>\n </section>\n<?php\n }",
"function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}",
"function seleccionInicio($idP){\r\n }",
"function ApontadorWidget() {\n $widget_ops = array('classname' => 'apontador_widget', 'description' => __( \"Display your reviews from Apontador\", \"wp-apontador\") );\n $control_ops = array('width' => 300, 'height' => 300);\n $this->WP_Widget('apontador', __('Apontador Reviews', \"wp-apontador\"), $widget_ops, $control_ops);\n\n }",
"function frmEstimacionesShow($sender, $params)\n {\n $items[\"uno\"]=\"ADICIONAL\";\n $items[\"dos\"]=\"ADITIVA/DEDUCTIVA\";\n $items[\"tres\"]=\"EXTRAORDINARIA\";\n $items[\"cuatro\"]=\"NORMAL\";\n $this->cboTipo->setItems($items);\n $this->txtMoneda->Text=\"MONEDA NACIONAL\";\n }",
"public function addWidget()\r\n {\r\n }",
"function parquesWidgets()\n{\n\t//add classes\n\tinclude_once(TEMPLATEPATH.'/widgets/widgettexto.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-social.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-home.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-progreso.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-categorias.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-banner.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-timelines.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-flickr.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/nav-menu-narrativas.php');\n\n\t//add widget\n \tregister_widget( 'Widget_Texto' );\n \tregister_widget( 'Widget_Social' );\n \tregister_widget( 'Widget_Home' );\n \tregister_widget( 'Widget_Progreso' );\n \tregister_widget( 'Widget_Categorias' );\n \tregister_widget( 'Widget_Banner' );\n \tregister_widget( 'Widget_Timelines' );\n \tregister_widget( 'Widget_Flickr' );\n \tregister_widget( 'Widget_Narrativas' );\n\n\n}",
"function wp_list_widget_controls_dynamic_sidebar($params)\n {\n }",
"static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}",
"function wp_list_widget_controls($sidebar, $sidebar_name = '')\n {\n }",
"function cm_load_widget_r() {\n\tregister_widget( 'cm_widget_r' );\n}",
"function wp_widget_description($id)\n {\n }",
"public function Add_Extra_Widget() {\n\t\t//wp_add_dashboard_widget('dash_amar_site', per_number('آمار سیستم'), array( $this, 'dashboard_amar' ));\n\t}",
"function wp_widget_control($sidebar_args)\n {\n }",
"public static function getClientWidget()\n {\n return \"cool/workflow/taskEditor\";\n }",
"protected function getWidgetId()\n {\n return !empty($_GET['wid']) ? $_GET['wid'] : 'rrf';\n }",
"function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}",
"private static function getControle() {\n\n\t\t$classe = \"Index\";\n\t\t\n\t\tif( !empty( self::$rota[1] ) && self::$rota[1] != \"index.php\" ){\n\t\t\t$classe = ucfirst( self::$rota[1] );\n\t\t\tif( !class_exists( $classe ))\n\t\t\t\t$classe = \"QuatroZeroQuatro\";\n\t\t}\n\n\t\ttry {\n\t\t\n\t\t\tself::$pagina = new $classe( self::$rota );\n\t\t\tself::$pagina->init();\n\t\t\tself::$pagina->render();\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\tvar_dump( $e );\n\t\t}\n\t}"
] |
[
"0.5852604",
"0.5746245",
"0.56888926",
"0.56834185",
"0.5591662",
"0.5513303",
"0.55056447",
"0.54921204",
"0.54840267",
"0.5419243",
"0.5402017",
"0.54000115",
"0.5397466",
"0.53826517",
"0.5376785",
"0.536824",
"0.5366439",
"0.53526664",
"0.5340664",
"0.5317228",
"0.5308284",
"0.5302132",
"0.52976054",
"0.52836674",
"0.5271974",
"0.52691203",
"0.52663976",
"0.52656686",
"0.5205662",
"0.5197509"
] |
0.61285967
|
0
|
user can only have one profile (relationship)
|
public function profile(){
return $this->hasOne('App\Profile');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function profile()\n {\n return $this->hasOne('App\\Profile');\n }",
"public function profile()\n {\n return $this->hasOne('App\\Profile');\n }",
"public function getProfile()\n {\n return $this->hasOne(Profile::className(), ['id' => 'profile_id']);\n }",
"public function profile()\n\t{\n\t\treturn $this->hasOne('Profile');\n\t}",
"public function getProfile()\n {\n return $this->hasOne(Profile::className(), ['user_id' => 'id']);\n }",
"public function profile()\n {\n return $this->hasOne('Profile');\n }",
"public function profile()\n {\n return $this->belongsTo(Profile::class);\n }",
"public function profile()\n {\n return $this->belongsTo(UserProfile::class);\n }",
"public function belongsToProfile($profile);",
"public function profile() {\n return $this->belongsTo('App\\Profile');\n }",
"public function profile()\n {\n return $this->belongsTo('App\\Profile');\n }",
"public function profile()\n {\n return $this->morphOne('App\\Profile', 'profileable');\n }",
"public function profile() {\n return $this->hasOne(Profile::class);\n }",
"public function userProfile()\n {\n return $this->hasOne(config('aggregator.namespace').'UserProfile');\n }",
"public function profile()\n {\n return $this->hasOne(Profile::class);\n }",
"public function profile()\n {\n return $this->hasOne(Profile::class);\n }",
"public function profile()\n {\n return $this->hasOne(Profile::class);\n }",
"public function profile()\n\t{\n\t\treturn $this->hasOne('App\\Models\\UserProfile', 'user_id', 'id');\n\t}",
"public function userprofile()\n {\n return $this -> hasOne(user_profile::class);\n }",
"public function profile()\n {\n return $this->hasOne(Profiles::class);\n }",
"function a_user_has_a_profile()\n {\n $user = create('App\\User');\n\n $this->get(\"/profiles/{$user->name}\")\n ->assertSee($user->name);\n }",
"public function profile() //minuscula_modeloforeano\n {\n return $this->hasOne('App\\Profile'); //direccion del modelo foreano\n }",
"public function show(User $user)\n {\n /*\n Condition is failing due the relationship returns STRING instead of INTEGER\n if ($user->profile->created_by !== auth()->id() )\n\n Options to solve the problem,\n - Cast the returned value when required\n - Cast the auth()->id() as STRING or $user->profile->created_by as INTEGER\n - Modify the Model using $casts[] array and cast the field to INTEGER\n */\n // dd($theProfile->id); // returns integer\n // dd($user->profile->created_by); // returns string\n // $theProfile = $user->profile;\n\n // dd($user->id); // automatic conversion \n // dd(auth()->id()); // automatic conversion\n\n /*\n * Authorization\n */\n // dd($user->id);\n // dd($user->profile->user_id);\n // dd($user->profile->created_by);\n /*\n * Using Policies\\ProfilePolicy.php\n * These calls are not standard, In this case calling an authorization using other Model class.\n * \n */\n // $this->authorize('viewAny',Profile::class); // Call to the ProfilePolicy.php even if it is not registered in Providers\\AuthServiceProvider.php\n // $this->authorize('view',[Profile::class,$user->profile]); // Call to the ProfilePolicy.php even if it is not registered in Providers\\AuthServiceProvider.php\n\n /*\n * Gate Test\n * Note: Any Authorizable model can be used in the Gate call\n */\n/*\n //\n // Test sending the User RECORD as the main object\n //\n // if( Gate::forUser(auth()->user())->allows('test-gate', $user->id)) {\n if( Gate::forUser($user->profile)->allows('test-gate', $user->id)) {\n if( Gate::forUser($user->profile)->allows('test-gate', $user->profile->id)) {\n dd('ok');\n } else {\n dd('fail');\n } \n } else {\n abort(403,'fail - not logged in OR No Profile defined');\n }\n\n //\n // Test sending the Auth user as the main object\n //\n if( auth()->check() && (! is_Null(auth()->user()->profile) )) {\n if( Gate::forUser(auth()->user()->profile)->allows('test-gate', $user->profile->id)) {\n dd('ok');\n } else {\n dd('fail');\n } \n } else {\n abort(403,'fail - not logged in OR No Profile defined');\n }\n\n*/\n /*\n * Using Policies\\UserPolicy.php\n * Basic Validation: if ($user->profile->created_by !== auth()->id() )\n * \n */\n // dd($user->can('browse')); // Returns false\n // dd($user->profile->can('browse')); // Returns true\n\n // $this->authorize('view',$user); // Uses UserPolicy\n $this->authorize('view',$user->profile); // Uses ProfilePolicy\n\n /*\n Same validation in the controller.\n - Profile record existance validation required\n */\n if (is_null($user->profile)){\n if ( auth()->id() !== $user->id ) {\n abort(403,__('Record not owned'));\n } \n } else {\n if ($user->profile->created_by !== strval(auth()->id()) ) {\n abort(403,__('Record not owned'));\n } \n }\n // laravel helper\n // abort_if($user->profile->created_by !== auth()->id(), 403);\n // Via Policy control, creating the logic in the Policies/UserPolicy.php with the command:\n // php artisan make:policy ProfilePolicy –model=Profile\n // It requires to update the Providers/AuthServiceProvider.php\n // $this->authorize('view',$user->profile);\n // dd($user->profile);\n\n dd('return the User View');\n }",
"public static function profile($profile){\n $pro = Profile::where('user_id',Auth::id())->first();\n if ($pro){\n $pro->update($profile);\n }else{\n Profile::create($profile);\n }\n }",
"public function profile() {\n $this->restrictToRoleId(2);\n \n // Exécute la view\n $this->show('user/profile');\n }",
"public function checkForProfile()\n\t\t{\n\t\t\treturn (!Auth::user()->profiles) ? false : true;\n\t\t}",
"public function create()\n\t{\n\t\t//\n\t\t$user = Auth::user();\n\t\tif($user->profiles()->first()){\n\t\treturn Redirect::to('/profiles/');\n\t\t}else{\n\t\treturn View::make('profiles.create');\t\n\t\t}\n\t\t\n\t}",
"private function generateProfile()\n {\n \t$profile = new Profile();\n \t$profile->firstname = $this->user_name_prefix . '_' . $this->faker->firstName;\n \t$profile->lastname = $this->faker->lastName;\n \t$profile->user_id = $this->userId;\n \t$profile->save(false);\n \treturn true;\n }",
"public function actionProfile()\r\n\t{\r\n\t\t//disable jquery autoload\r\n\t\tYii::app()->clientScript->scriptMap=array(\r\n\t\t\t'jquery.js'=>false,\r\n\t\t);\r\n\t\t$model = $this->loadUser();\r\n\t $this->render('profile',array(\r\n\t \t'model'=>$model,\r\n\t\t\t'profile'=>$model->profile,\r\n\t ));\r\n\t}",
"public function profile()\n { \n $user = Auth::user();\n $profile = $user->student;\n return $user;\n \n }"
] |
[
"0.68275756",
"0.68275756",
"0.6803194",
"0.67811567",
"0.6766525",
"0.67440075",
"0.67305547",
"0.6721651",
"0.66672134",
"0.66336215",
"0.6631145",
"0.66299564",
"0.6625673",
"0.6624737",
"0.6617465",
"0.6617465",
"0.6617465",
"0.6607544",
"0.6519978",
"0.65091616",
"0.64899886",
"0.6481801",
"0.63818735",
"0.6318591",
"0.62767684",
"0.6145142",
"0.61388963",
"0.6090745",
"0.598144",
"0.5967089"
] |
0.71112466
|
0
|
Other relationships can be define here user can have as many message as possible
|
public function message(){
return $this->hasMany('App\Message');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function messages(){\n return $this->hasMany('App\\Message', 'user_id');\n }",
"public function relatedMessages(){\n return $this->hasMany(Message::class,'messages_resources','resource','message');\n }",
"public function messageTo(){\n \treturn $this->belongsTo('App\\User', 'to');\n }",
"public function messages(){\n return $this->hasMany('App\\Message');\n }",
"public function message()\n {\n return $this->hasMany(Message::class);\n }",
"public function messages()\n {\n return $this->hasMany(\"App\\Message\");\n }",
"public function messageFrom(){\n \treturn $this->belongsTo('App\\User', 'from');\n }",
"public function messages()\n {\n return $this->hasMany('App\\Message');\n }",
"public function messages()\n {\n return $this->hasMany('App\\Message');\n }",
"public function messages()\n {\n return $this->hasMany('App\\Models\\Message');\n }",
"public function messages()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Message');\n\t}",
"public function messages(){\n return $this->hasMany('App\\Models\\Message', 'client_id', 'client_id');\n }",
"public function messages()\n {\n return $this->hasMany(Message::class);\n }",
"public function messages() {\n return $this->hasMany(Message::class);\n }",
"public function destinationMessages()\n\t{\n\t\treturn $this->hasMany('App\\Message', 'to_currency_id');\n\t}",
"public function fetchMessages()\n{\n return chat::with('user')->get();\n}",
"public function messages(){\n\n return $this->hasMany('App\\CN\\CNMessages\\Messages', 'foreign_key', 'local_key');\n\n }",
"public function createMessage(){\n $users = $this->User->find('all');\n $this->set('users', $users);\n }",
"public function originMessages()\n\t{\n\t\treturn $this->hasMany('App\\Message', 'from_currency_id');\n\t}",
"public function messages(): HasMany\n {\n return $this->hasMany(Message::class)\n ->orderByDesc('created_at');\n }",
"public function messages()\n {\n return $this->hasMany(Message::class, 'sender_id', 'id');\n }",
"public function messages()\n {\n return $this->hasMany('LaravelVue\\Talk\\Messages\\Message', 'conversation_id')\n ->with('sender');\n }",
"public function messages()\n {\n return $this->hasMany('ConversationMessage', 'conversation_id', 'id');\n }",
"public function isUser1InConvo()\n {\n return $this->hasMany(Conversation::class, 'user_1_id', 'id');\n }",
"public function message_receiver(){\n return $this->belongsToMany(\n 'App\\Message',\n 'receivers',\n 'receiver_id',\n 'message_id')\n ->orderBy('receivers.id','DESC')\n ->whereNull('receivers.deleted_at')\n ->withPivot(['id','read_at']);\n }",
"public function messages()\n {\n return $this->hasMany('App\\Message')\n ->orderBy('created_at','desc');\n }",
"public function messages() {\n\t\treturn $this->has_many('Message');\n\t}",
"public function messages()\n {\n return $this->morphMany('App\\Message', 'messageable');\n }",
"public function messages()\n {\n return $this->morphMany('App\\Message', 'messageable');\n }",
"public function replies()\r\n {\r\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = message_id, localKey = id)\r\n \treturn $this->hasMany(Reply::class);\r\n }"
] |
[
"0.7126971",
"0.7033994",
"0.6969394",
"0.6942888",
"0.6857078",
"0.66738844",
"0.6667327",
"0.66268945",
"0.66268945",
"0.66165495",
"0.66001296",
"0.65040714",
"0.6431403",
"0.6328694",
"0.6323701",
"0.6254503",
"0.6151802",
"0.6147244",
"0.61277056",
"0.6107002",
"0.60684216",
"0.6045405",
"0.6039795",
"0.6039442",
"0.6022008",
"0.6011845",
"0.6011131",
"0.60075945",
"0.60075945",
"0.6006104"
] |
0.7219047
|
0
|
Convert phpinfo HTML table into array
|
function phpinfo_array()
{
ob_start();
phpinfo();
$info_arr = array();
$info_lines = explode("\n", strip_tags(ob_get_clean(), "<tr><td><h2>"));
$cat = "General";
foreach($info_lines as $line)
{
// new cat?
preg_match("~<h2>(.*)</h2>~", $line, $title) ? $cat = $title[1] : null;
if(preg_match("~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~", $line, $val))
{
$info_arr[trim($cat)][trim($val[1])] = trim($val[2]);
}
elseif(preg_match("~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~", $line, $val))
{
$info_arr[trim($cat)][trim($val[1])] = array("local" => trim($val[2]), "master" => trim($val[3]));
}
}
return $info_arr;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function phpinfo2array()\n {\n $entitiesToUtf8 = function ($input) {\n // http://php.net/manual/en/function.html-entity-decode.php#104617\n return preg_replace_callback(\"/(&#[0-9]+;)/\", function ($m) {\n return mb_convert_encoding($m[1], \"UTF-8\", \"HTML-ENTITIES\");\n }, $input);\n };\n $plainText = function ($input) use ($entitiesToUtf8) {\n return trim(html_entity_decode($entitiesToUtf8(strip_tags($input))));\n };\n $titlePlainText = function ($input) use ($plainText) {\n return $plainText($input);\n };\n \n ob_start();\n phpinfo(-1);\n \n $phpinfo = array();\n \n // Strip everything after the <h1>Configuration</h1> tag (other h1's)\n if (!preg_match('#(.*<h1[^>]*>\\s*Configuration.*)<h1#s', ob_get_clean(), $matches)) {\n return array();\n }\n \n $input = $matches[1];\n $matches = array();\n \n if (preg_match_all(\n '#(?:<h2.*?>(?:<a.*?>)?(.*?)(?:<\\/a>)?<\\/h2>)|'.\n '(?:<tr.*?><t[hd].*?>(.*?)\\s*</t[hd]>(?:<t[hd].*?>(.*?)\\s*</t[hd]>(?:<t[hd].*?>(.*?)\\s*</t[hd]>)?)?</tr>)#s',\n $input,\n $matches,\n PREG_SET_ORDER\n )) {\n foreach ($matches as $match) {\n $fn = strpos($match[0], '<th') === false ? $plainText : $titlePlainText;\n if (strlen($match[1])) {\n $phpinfo[$match[1]] = array();\n } elseif (isset($match[3])) {\n $keys1 = array_keys($phpinfo);\n $phpinfo[end($keys1)][$fn($match[2])] = isset($match[4]) ? array($fn($match[3]), $fn($match[4])) : $fn($match[3]);\n } else {\n $keys1 = array_keys($phpinfo);\n $phpinfo[end($keys1)][] = $fn($match[2]);\n }\n }\n }\n \n return $phpinfo;\n }",
"function parsePHPInfo() {\n ob_start();\n phpinfo();\n $s = ob_get_contents();\n ob_end_clean();\n\n $s = strip_tags($s,'<h2><th><td>');\n $s = preg_replace('/<th[^>]*>([^<]+)<\\/th>/',\"<info>\\\\1</info>\",$s);\n $s = preg_replace('/<td[^>]*>([^<]+)<\\/td>/',\"<info>\\\\1</info>\",$s);\n $vTmp = preg_split('/(<h2[^>]*>[^<]+<\\/h2>)/',$s,-1,PREG_SPLIT_DELIM_CAPTURE);\n $vModules = array();\n for ($i=1;$i<count($vTmp);$i++) {\n if(preg_match('/<h2[^>]*>([^<]+)<\\/h2>/',$vTmp[$i],$vMat)) {\n $vName = trim($vMat[1]);\n $vTmp2 = explode(\"\\n\",$vTmp[$i+1]);\n foreach ($vTmp2 AS $vOne) {\n $vPat = '<info>([^<]+)<\\/info>';\n $vPat3 = \"/$vPat\\s*$vPat\\s*$vPat/\";\n $vPat2 = \"/$vPat\\s*$vPat/\";\n\n if(preg_match($vPat3,$vOne,$vMat))\n $vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]),trim($vMat[3]));\n else if(preg_match($vPat2,$vOne,$vMat))\n $vModules[$vName][trim($vMat[1])] = trim($vMat[2]);\n }\n }\n }\n\n return $vModules;\n}",
"function parsePHPInfo()\r\n{\r\n\t/*\tnotwendig für die PHP/MySQL Supportinfos\r\n\t\r\n\t\tvon http://www.php.net/manual/en/function.phpinfo.php#70306 - parse php modules from phpinfo\r\n\t\r\n\t\talternativen:\r\n\t\t\r\n\t\tget a module setting\r\n\t\tfunction getModuleSetting($pModuleName,$pSetting)\r\n\t\t{\r\n\t\t\t$vModules = parsePHPModules();\r\n\t\t\t\r\n\t\t\treturn $vModules[$pModuleName][$pSetting];\r\n\t\t}\r\n\t\r\n\t\t// Sample Usage\r\n\t\tdebug(getModuleSetting('apache2handler','Apache Version')); // returns \"bundled (2.0.28 compatible)\"\r\n\t\tdebug(getModuleSetting('Core','register_globals'));\r\n\t\r\n\t\tob_start () ;\r\n\t\tphpinfo () ;\r\n\t\t$pinfo = ob_get_contents () ;\r\n\t\tob_end_clean () ;\r\n\t\t\r\n\t\t// the name attribute \"module_Zend Optimizer\" of an anker-tag is not xhtml valide, so replace it with \"module_Zend_Optimizer\"\r\n\t\techo '<div id=\"phpinfo\">' . ( str_replace ( \"module_Zend Optimizer\", \"module_Zend_Optimizer\", preg_replace ( '%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo ) ) ) . '</div>';\r\n\t\r\n\t\thttp://www.php.net/manual/en/function.phpinfo.php#106862\r\n\t\r\n\t\tfunction phpinfo_array()\r\n\t\t{\r\n\t\t\tob_start();\r\n\t\t\tphpinfo();\r\n\t\t\t$info_arr = array();\r\n\t\t\t$info_lines = explode(\"\\n\", strip_tags(ob_get_clean(), \"<tr><td><h2>\"));\r\n\t\t\t$cat = \"General\";\r\n\t\t\tforeach($info_lines as $line)\r\n\t\t\t{\r\n\t\t\t\t// new cat?\r\n\t\t\t\tpreg_match(\"~<h2>(.*)</h2>~\", $line, $title) ? $cat = $title[1] : null;\r\n\t\t\t\tif(preg_match(\"~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~\", $line, $val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$info_arr[$cat][$val[1]] = $val[2];\r\n\t\t\t\t}\r\n\t\t\t\telseif(preg_match(\"~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~\", $line, $val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$info_arr[$cat][$val[1]] = array(\"local\" => $val[2], \"master\" => $val[3]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $info_arr;\r\n\t\t}\r\n\t\t\r\n\t\techo \"<pre>\".print_r(phpinfo_array(), 1).\"</pre>\";\r\n\t*/\r\n\t\r\n\tob_start();\r\n\tphpinfo();\r\n\t$s = ob_get_contents();\r\n\tob_end_clean();\r\n\t\r\n\t$s = strip_tags($s,'<h2><th><td>');\r\n\t$s = preg_replace('/<th[^>]*>([^<]+)<\\/th>/',\"<info>\\\\1</info>\",$s);\r\n\t$s = preg_replace('/<td[^>]*>([^<]+)<\\/td>/',\"<info>\\\\1</info>\",$s);\r\n\t$vTmp = preg_split('/(<h2>[^<]+<\\/h2>)/',$s,-1,PREG_SPLIT_DELIM_CAPTURE);\r\n\t\r\n\t$vModules = array();\r\n\t\r\n\tfor ( $i = 1; $i < count($vTmp); $i++ )\r\n\t{\r\n\t\tif ( preg_match('/<h2>([^<]+)<\\/h2>/',$vTmp[$i],$vMat) )\r\n\t\t{\r\n\t\t\t$vName = trim($vMat[1]);\r\n\t\t\t$vTmp2 = explode(\"\\n\",$vTmp[$i+1]);\r\n\t\t\t\r\n\t\t\tforeach ( $vTmp2 AS $vOne )\r\n\t\t\t{\r\n\t\t\t\t$vPat = '<info>([^<]+)<\\/info>';\r\n\t\t\t\t$vPat3 = \"/$vPat\\s*$vPat\\s*$vPat/\";\r\n\t\t\t\t$vPat2 = \"/$vPat\\s*$vPat/\";\r\n\t\t\t\t\r\n\t\t\t\tif ( preg_match($vPat3,$vOne,$vMat) )\r\n\t\t\t\t{\r\n\t\t\t\t\t// 3cols\r\n\t\t\t\t\t$vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]),trim($vMat[3]));\r\n\t\t\t\t}\r\n\t\t\t\telse if ( preg_match($vPat2,$vOne,$vMat) )\r\n\t\t\t\t{\r\n\t\t\t\t\t// 2cols\r\n\t\t\t\t\t$vModules[$vName][trim($vMat[1])] = trim($vMat[2]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $vModules;\r\n}",
"function getArray($rawhtml, $table_no=1){\n $html = str_get_html(clean_html($rawhtml));\n\n $tables = $html->find('table');\n //$table_no is valid\n if(is_numeric($table_no) && count($tables) >= $table_no){\n //empty existing contents of array\n unset($this->arr);\n $this->arr = array();\n\n $verifier = $table_no - 1;\n $table = $tables[$table_no - 1];\n $table->id = $verifier;\n $trCt = 0;\n //Loop through the rows\n foreach($table->find(\"tr\") as $tr){\n //check if parent table or grandparent table (in case of thead, tbody etc) is same table\n //this is to prevent nested table <tr>'s to be extracted together\n if($tr->parent()->id === $verifier || $tr->parent()->parent()->id === $verifier){\n $tdCt = 0;\n //Loop through the columns\n foreach($tr->find(\"td, th\") as $td){\n //replace all <hr> tags with <br/>\n foreach ($td->find(\"hr\") as $hr){\n $hr->outertext = \"<br/>\";\n }\n $this->arr[$trCt][$tdCt] = trim(strip_tags(preg_replace(\"/\\s+/\", \" \", $td->innertext), \"<br>\"));\n $tdCt++;\n }\n $trCt++;\n }\n }\n } else {\n echo \"Error in table number\";\n }\n return $this->arr;\n }",
"public function parseHtml($html)\n {\n // So as a quick fix, we'll str_replace those ahead of time\n // and then keep the Xpath parser consistent.\n $html = str_replace(\n [\n '<td>Vendor:</td>',\n '<td>Reference Number:</td>',\n '<td>Contract Date:</td>',\n '<td>Description of Work:</td>',\n '<td>Contract Period :</td>',\n '<td>Contract Period:</td>',\n '<td>Delivery Date:</td>',\n '<td>Contract Value:</td>',\n '<td>Comments:</td>',\n // Fixes for eg.\n // https://www.statcan.gc.ca/eng/about/contract/2004/62700-04-0035\n '<th class=\"row-stub\" scope=\"row\">Nom du vendeur:</th>',\n '<th class=\"row-stub\" scope=\"row\">Numéro de référence :</th>',\n '<th class=\"row-stub\" scope=\"row\">Description of Work:</th>',\n ],\n [\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Contract Date:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Delivery Date:</th>',\n '<th scope=\"row\">Contract Value:</th>',\n '<th scope=\"row\">Comments:</th>',\n // Replacements per above\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n\n ],\n $html\n );\n\n $keyArray = [\n 'vendorName' => 'Vendor',\n 'referenceNumber' => 'Reference Number',\n 'contractDate' => 'Contract Date',\n 'description' => 'Description of work',\n 'extraDescription' => 'Detailed Description',\n 'contractPeriodStart' => '',\n 'contractPeriodEnd' => '',\n 'contractPeriodRange' => 'Contract Period',\n 'deliveryDate' => 'Delivery Date',\n 'originalValue' => 'Original Contract Value',\n 'contractValue' => 'Contract Value',\n 'comments' => 'Comments',\n ];\n\n return Parsers::extractContractDataViaGenericXpathParser($html, \"//table//th[@scope='row']\", \"//table//td\", ' to ', $keyArray);\n }",
"protected function _parseTagTable() {}",
"public function getPhpinfoHtml()\r\n {\r\n ob_start();\r\n phpinfo();\r\n $info = ob_get_contents();\r\n ob_end_clean();\r\n if($this->fromConsole)\r\n return \"<pre>\" . $info . \"</pre>\";\r\n else\r\n return $info;\r\n }",
"public function getTableLayout()\n {\n return [\n 'headRows' => [0],\n 'table' => ['<table class=\"table table-striped table-hover table-condensed\">', '</table><br/>'],\n '0' => [ // Format für 1. Zeile\n 'tr' => ['<tr class=\"\">', '</tr>'],\n // Format für jede Spalte in der 1. Zeile\n 'defCol' => ['<td>', '</td>'],\n ],\n 'defRow' => [ // Formate für alle Zeilen\n 'tr' => ['<tr class=\"\">', '</tr>'],\n 'defCol' => ['<td>', '</td>'], // Format für jede Spalte in jeder Zeile\n ],\n 'defRowEven' => [ // Formate für alle geraden Zeilen\n 'tr' => ['<tr class=\"\">', '</tr>'],\n // Format für jede Spalte in jeder Zeile\n 'defCol' => ['<td>', '</td>'],\n ],\n ];\n }",
"public function getphpinfoclean()\n {\n ob_start();\n phpinfo();\n // $matches [1]; # Style information\n // $matches [2]; # Body information\n preg_match('%<style type=\"text/css\">(.*?)</style>.*?<body>(.*?)</body>%s', ob_get_clean(), $matches);\n\n ob_start();\n echo \"<div class='phpinfodisplay'><style type='text/css'>\\n\",\n implode(\"\\n\",\n array_map(create_function('$i', 'return \".phpinfodisplay \" . preg_replace( \"/,/\", \",.phpinfodisplay \", $i );'),\n preg_split('/\\n/', trim(preg_replace(\"/\\nbody/\", \"\\n\", $matches[1]))))\n ),\n \".phpinfodisplay .center table { margin-left: 0; max-width: 600px; } .phpinfodisplay td { padding: 4px; }\\n</style>\\n\",\n $matches[2],\n \"\\n</div>\\n\";\n\n return ob_get_clean();\n }",
"static public function extract()\n {\n try {\n $result = [];\n $document = @new Document(self::$url, true);\n $lines = $document\n ->find('tbody')[0]\n ->find('tr');\n foreach ($lines as $line) {\n $columns = $line->find('td');\n $current = [];\n foreach ($columns as $column) {\n $index = count($current);\n $current[self::$map[$index]] = $column->text();\n }\n $result[] = $current;\n }\n return $result;\n } catch (\\Exception $e) {\n return [\n 'error' => true,\n 'code' => $e->getCode(),\n 'message' => $e->getMessage()\n ];\n }\n }",
"function tableInfo($table) {\r\n\t\t$res = $this->db->Execute($this->db->metaColumnsSQL);\r\n\t\t$info = $res->FetchRow();\r\n\t\t$newInfo = array('Typ' => $info['Engine'],\r\n\t\t\t\t\t\t 'Kodowanie' => $info['Collation'],\r\n\t\t\t\t\t\t 'Ilość rekordów' => $info['Rows'],\r\n\t\t\t\t\t\t 'Data utworzenia' => $info['Create_time'],\r\n\t\t\t\t\t\t 'Data ostatniej modyfikacji' => $info['Update_time'],\r\n\t\t\t\t\t\t 'Następny numer' => empty($info['Auto_increment']) ? 1 : $info['Auto_increment']\r\n\t\t\t\t\t\t);\r\n\t\treturn $newInfo;\r\n\t}",
"function parse_tablumps($data) {\n\n\t$data = str_replace(dAmnPHP::$tablumps['a1'], dAmnPHP::$tablumps['a2'], $data);\n\t$data = preg_replace(dAmnPHP::$tablumps['b1'], dAmnPHP::$tablumps['b2'], $data);\n\treturn preg_replace(\"/<([^>]+) (width|height|title|alt)=\\\"\\\"([^>]*?)>/\", \"<\\\\1\\\\3>\", $data);\n\n}",
"public function describe(string $table): array;",
"public function getTOC()\n {\n // Return empty array if we have no table of contents:\n $fields = $this->marcRecord->getFields('505');\n if (!$fields) {\n return [];\n }\n\n // If we got this far, we have a table -- collect it as a string:\n $toc = [];\n foreach ($fields as $field) {\n $subfields = $field->getSubfields();\n foreach ($subfields as $subfield) {\n // Break the string into appropriate chunks, and merge them into\n // return array:\n $toc = array_merge($toc, explode('--', $subfield->getData()));\n }\n }\n return $toc;\n }",
"public function getTableOfContents();",
"public static function parse()\n {\n if (PHP_SAPI != 'cli') {\n throw new \\RuntimeException('PhpInfoCliParser can only run in command line environment.');\n }\n\n ob_start();\n phpinfo();\n $buf = ob_get_contents();\n ob_end_clean();\n\n $lines = explode(\"\\n\", $buf);\n $lines = array_slice($lines, 3);\n\n $parses = []; //type: blank, value, title, text, hr\n\n foreach ($lines as $row) {\n $li = count($parses) - 1;\n $lii = $li - 1;\n $pre = isset($parses[$li]) ? $parses[$li][0] : 'blank';\n\n if (trim($row) == '') {\n if ($pre == 'blank') {\n //连续多个空行则忽略,最多只保留一个空行\n $parses[$lii]['j'] = 1; //对上一个内容标记已跳过一个空行,主要用于多段内容连接时保持分段\n continue;\n } else {\n $parses[] = ['blank'];\n }\n } elseif (substr($row, 0, 1) != ' ' && strpos($row, ' => ') !== false) {\n $values = explode(' => ', $row, 3);\n\n //remove break line of values.\n if ($pre == 'blank' && isset($parses[$lii]) && $parses[$lii][0] == 'value' && substr($row, 0, 10) != 'Directive ') {\n array_pop($parses);\n }\n\n $values = array_map(function($v) {\n if ($v == 'no value') {\n return \"<i>$v</i>\";\n } else {\n return $v;\n }\n }, $values);\n\n $parses[] = array_merge(['value'], $values);\n } elseif ($pre == 'value') {\n //紧跟在值后的文本其实是上一个值的换行内容\n $parses[$li][count($parses[$li])-1] .= \"\\n$row\";\n } elseif ($pre == 'blank' && strlen($row) < 29) {\n //一些特殊的标题设为 h1 等级\n $level = ($row == 'Configuration' || $row == 'PHP Credits') ? 1 : 2;\n $parses[] = ['title', $row, $level];\n } elseif (preg_match('/^_+$/', trim($row))) { //多个连续的下划线是 hr\n $parses[] = ['hr'];\n } elseif (preg_match('/^\\s{15,}/', $row)) { //开头连续多个空格的文本其实是表头单行标题,这里只作 h3,因为处理有点麻烦\n $parses[] = ['title', trim($row), 3];\n } else {\n //将每行开头的连续空格替换为可显示空格,否则开头的空格会不显示(无缩进)\n if (preg_match('/^(\\s+)/', $row, $matchs)) {\n $row = str_replace(' ', ' ', $matchs[1]).ltrim($row);\n }\n if ($pre == 'text') {\n $parses[$li][1] .= \"<br/>$row\";\n } elseif ($pre == 'blank' && isset($parses[$lii]) && $parses[$lii][0] == 'text') {\n //对于 文本,空行,文本 的情况,这些文本实际要作为多个段落连接到一格中\n if (!is_array($parses[$lii][1])) {\n $parses[$lii][1] = [str_replace('<br/>', '', $parses[$lii][1])];\n $parses[$lii][1][] = $row;\n } elseif (isset($parses[$lii]['j'])) {\n //在已经是多个段落的文本中,如果上一次跳过了一个换行,则开始分段\n //主要处理“PHP License”中有多个段落,每具段落又使用换行的方式输出的问题\n $parses[$lii][1][] = $row;\n unset($parses[$lii]['j']);\n } else {\n //在已经是多个段落的文本中连续文本换行将作为单行字符串连在一起\n $parses[$lii][1][count($parses[$lii][1])-1] .= $row;\n }\n } else {\n $parses[] = ['text', $row];\n }\n }\n }\n\n return $parses;\n }",
"function detail_list_output(String $table): Array {\n\n // Query result of the detail table\n $result = $this->toggle_detail_list_query($table);\n \n // Selected column of the detail table\n $keys = $this->toggle_detail_list_select_columns($table);\n \n // Check if the detail table has also other detail tables. \n // It makes its track number a link in the view if true\n $has_details = $this->CI->grants->check_if_table_has_detail_table($table);\n \n // It check if the detail table is approveable so as to show the approval links in the status action\n $is_approveable_item = $this->CI->grants->approveable_item($table);\n \n // Check if the add button is allowed to be shown\n $show_add_button = $this->CI->grants->show_add_button($table);\n \n // Checks if the detail table has a detail table to it\n $has_details_listing = $this->CI->grants->check_if_table_has_detail_listing($table);\n \n $converted_result = [];\n\n foreach($result as $row){\n $converted_result[] = $this->currency_conversion($row,$table);\n }\n\n return array(\n 'keys'=> $keys,\n 'table_body'=>$converted_result,\n 'table_name'=> $table,\n 'has_details_table' => $has_details,\n 'has_details_listing' => $has_details_listing,\n 'is_approveable_item' => $is_approveable_item,\n 'show_add_button'=>$show_add_button\n );\n }",
"function infoarray()\n\t\t{\n\t\t$a = array();\n\t\tforeach(explode(\"\\n\", $this->me['info']) as $line)\n\t\t\t{\n\t\t\tpreg_match('/(^[^=]*) = (.*$)/', trim($line), $matches);\n\t\t\tif(count($matches) > 2)\n\t\t\t\t{\n\t\t\t\t$a[$matches[1]] = $matches[2];\n\t\t\t\t}\n\t\t\t}\n\t\treturn $a;\n\t\t}",
"private function get_usage($html)\n {\n $rec = array();\n if(preg_match(\"/<div class\\=\\\"field\\-label\\\">Usage\\:\\ \\;<\\/div>(.*?)<\\/div>/ims\", $html, $arr)) $rec['Usage'] = strip_tags($arr[1]);\n if(preg_match(\"/<div class=\\\"field-label\\\">Unacceptability Reason: <\\/div>(.*?)<\\/div>/ims\", $html, $arr)) $rec['Unacceptability Reason'] = strip_tags($arr[1]);\n // print_r($rec); //exit;\n return $rec;\n }",
"public function _GetCacheTableInfos()\n {\n $aTableInfo = parent::_GetCacheTableInfos();\n $activePage = $this->getActivePageService()->getActivePage();\n $aTableInfo[] = array('table' => 'cms_tpl_page', 'id' => $activePage->id);\n $aTableInfo[] = array('table' => 'cms_portal', 'id' => '');\n $aTableInfo[] = array('table' => 'cms_division', 'id' => '');\n\n return $aTableInfo;\n }",
"public function describeTable($table)\r\n {\r\n $columns = $this->connection->expr('SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = []', [$table])->get();\r\n\r\n if (!$columns) {\r\n return []; // no such table\r\n }\r\n\r\n $result = [];\r\n\r\n foreach ($columns as $row) {\r\n $row2 = [];\r\n $row2['name'] = $row['column_name'];\r\n $row2['pk'] = $row['is_identity'] == 'YES';\r\n $row2['type'] = preg_replace('/\\(.*/', '', $row['udt_name']); // $row['data_type'], but it's PgSQL specific type\r\n\r\n $result[] = $row2;\r\n }\r\n\r\n return $result;\r\n }",
"function PMA_analyzeTableFieldsArray($field, $comments_map, $timestamp_seen)\n{\n $field['Field_html'] = htmlspecialchars($field['Field']);\n $field['Field_md5'] = md5($field['Field']);\n // True_Type contains only the type (stops at first bracket)\n $field['True_Type'] = preg_replace('@\\(.*@s', '', $field['Type']);\n PMA_getDefaultForDatetime($field);\n $field['len'] = preg_match('@float|double@', $field['Type']) ? 100 : -1;\n $field['Field_title'] = PMA_getFieldTitle($field, $comments_map);\n $field['is_binary'] = PMA_isTableFieldBinary($field);\n $field['is_blob'] = PMA_istableFieldBlob($field);\n $field['is_char'] = PMA_isTablefieldChar($field);\n list($field['pma_type'], $field['wrap'], $field['first_timestamp']) =\n PMA_getEnumSetAndTimestampTableFields($field, $timestamp_seen);\n\n return $field;\n}",
"protected function renderInfo() {\n\t\t$ret = '';\n\t\t$ret .= $this->start( 'table' );\n\t\t$ret .= $this->element( 'caption', 'Elements ($info)' );\n\t\tksort( $this->def->info );\n\t\t$ret .= $this->heavyHeader( 'Allowed tags', 2 );\n\t\t$ret .= $this->start( 'tr' );\n\t\t$ret .= $this->element( 'td', $this->listifyTagLookup( $this->def->info ), array( 'colspan' => 2 ) );\n\t\t$ret .= $this->end( 'tr' );\n\t\tforeach ( $this->def->info as $name => $def ) {\n\t\t\t$ret .= $this->start( 'tr' );\n\t\t\t$ret .= $this->element( 'th', \"<$name>\", array( 'class' => 'heavy', 'colspan' => 2 ) );\n\t\t\t$ret .= $this->end( 'tr' );\n\t\t\t$ret .= $this->start( 'tr' );\n\t\t\t$ret .= $this->element( 'th', 'Inline content' );\n\t\t\t$ret .= $this->element( 'td', $def->descendants_are_inline ? 'Yes' : 'No' );\n\t\t\t$ret .= $this->end( 'tr' );\n\t\t\tif ( ! empty( $def->excludes ) ) {\n\t\t\t\t$ret .= $this->start( 'tr' );\n\t\t\t\t$ret .= $this->element( 'th', 'Excludes' );\n\t\t\t\t$ret .= $this->element( 'td', $this->listifyTagLookup( $def->excludes ) );\n\t\t\t\t$ret .= $this->end( 'tr' );\n\t\t\t}\n\t\t\tif ( ! empty( $def->attr_transform_pre ) ) {\n\t\t\t\t$ret .= $this->start( 'tr' );\n\t\t\t\t$ret .= $this->element( 'th', 'Pre-AttrTransform' );\n\t\t\t\t$ret .= $this->element( 'td', $this->listifyObjectList( $def->attr_transform_pre ) );\n\t\t\t\t$ret .= $this->end( 'tr' );\n\t\t\t}\n\t\t\tif ( ! empty( $def->attr_transform_post ) ) {\n\t\t\t\t$ret .= $this->start( 'tr' );\n\t\t\t\t$ret .= $this->element( 'th', 'Post-AttrTransform' );\n\t\t\t\t$ret .= $this->element( 'td', $this->listifyObjectList( $def->attr_transform_post ) );\n\t\t\t\t$ret .= $this->end( 'tr' );\n\t\t\t}\n\t\t\tif ( ! empty( $def->auto_close ) ) {\n\t\t\t\t$ret .= $this->start( 'tr' );\n\t\t\t\t$ret .= $this->element( 'th', 'Auto closed by' );\n\t\t\t\t$ret .= $this->element( 'td', $this->listifyTagLookup( $def->auto_close ) );\n\t\t\t\t$ret .= $this->end( 'tr' );\n\t\t\t}\n\t\t\t$ret .= $this->start( 'tr' );\n\t\t\t$ret .= $this->element( 'th', 'Allowed attributes' );\n\t\t\t$ret .= $this->element( 'td', $this->listifyAttr( $def->attr ), array(), 0 );\n\t\t\t$ret .= $this->end( 'tr' );\n\n\t\t\tif ( ! empty( $def->required_attr ) ) {\n\t\t\t\t$ret .= $this->row( 'Required attributes', $this->listify( $def->required_attr ) );\n\t\t\t}\n\n\t\t\t$ret .= $this->renderChildren( $def->child );\n\t\t}\n\t\t$ret .= $this->end( 'table' );\n\n\t\treturn $ret;\n\t}",
"function SQL2HTML($query, $title=\"Table Summary\")\n{\n \n if (!$result = pp_run_query($query)) {\n $sRetVal = mysql_error();\n } else {\n $sRetVal = \"<table border='1'>\\n\";\n $sRetVal .= \"<tr><th colspan='\" . count($result[0]) . \"'>\";\n $sRetVal .= $title . \"</th></tr>\";\n $sRetVal .= \"<tr>\";\n $i=0;\n //while ($i < count($result[0])) {\n foreach(array_keys($result[0]) as $key){\n $sRetVal .= \"<th>\" . $key . \"</th>\";\n $i++;\n }\n $sRetVal .= \"</tr>\";\n foreach($result as $line){\n $sRetVal .= \"\\t<tr>\\n\";\n foreach($line as $col_value) {\n $sRetVal .= \"\\t\\t<td>$col_value</td>\\n\";\n }\n $sRetVal .= \"\\t</tr>\\n\";\n }\n $sRetVal .= \"</table>\\n\";\n }\n \n return($sRetVal);\n}",
"function getPhpInfo($level=-1) {\n\t/**\tName (constant)\t\tValue\tDescription\n\t\tINFO_GENERAL\t\t1\t\tThe configuration line, php.ini location, build date, Web Server, System and more.\n\t\tINFO_CREDITS\t\t2\t\tPHP Credits. See also phpcredits().\n\t\tINFO_CONFIGURATION\t4\t\tCurrent Local and Master values for PHP directives. See also ini_get().\n\t\tINFO_MODULES\t\t8\t\tLoaded modules and their respective settings. See also get_loaded_extensions().\n\t\tINFO_ENVIRONMENT\t16\t\tEnvironment Variable information that's also available in $_ENV.\n\t\tINFO_VARIABLES\t\t32\t\tShows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).\n\t\tINFO_LICENSE\t\t64\t\tPHP License information. See also the license FAQ.\n\t\tINFO_ALL\t\t\t-1\t\tShows all of the above. This is the default value.\n\t */\n\tob_start();\n\tphpinfo($level);\n\t$phpinfo = ob_get_contents();\n\tob_end_clean();\n\n\t$phpinfo\t= strip_tags($phpinfo,'<h1><h2><th><td>');\n\t$phpinfo\t= preg_replace('/<th[^>]*>([^<]+)<\\/th>/',\"<info>\\\\1</info>\",$phpinfo);\n\t$phpinfo\t= preg_replace('/<td[^>]*>([^<]+)<\\/td>/',\"<info>\\\\1</info>\",$phpinfo);\n\t$parsedInfo\t= preg_split('/(<h.?>[^<]+<\\/h.>)/', $phpinfo, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t$match\t\t= '';\n\t$version\t= '';\n\t$returnInfo\t= array();\n\n\tif(preg_match('/<h1 class\\=\\\"p\\\">PHP Version ([^<]+)<\\/h1>/', $phpinfo, $version)) {\n\t\t$returnInfo['PHP Version'] = $version[1];\n\t}\n\n\n\tfor ($i=1; $i<count($parsedInfo); $i++) {\n\t\tif (preg_match('/<h.>([^<]+)<\\/h.>/', $parsedInfo[$i], $match)) {\n\t\t\t$vName = trim($match[1]);\n\t\t\t$parsedInfo2 = explode(\"\\n\",$parsedInfo[$i+1]);\n\n\t\t\tforeach ($parsedInfo2 AS $vOne) {\n\t\t\t\t$vPat\t= '<info>([^<]+)<\\/info>';\n\t\t\t\t$vPat3\t= \"/$vPat\\s*$vPat\\s*$vPat/\";\n\t\t\t\t$vPat2\t= \"/$vPat\\s*$vPat/\";\n\n\t\t\t\tif (preg_match($vPat3,$vOne,$match)) { // 3cols\n\t\t\t\t\t$returnInfo[$vName][trim($match[1])] = array(trim($match[2]),trim($match[3]));\n\t\t\t\t} elseif (preg_match($vPat2,$vOne,$match)) { // 2cols\n\t\t\t\t\t$returnInfo[$vName][trim($match[1])] = trim($match[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(true) {\n\n\t\t}\n\t}\n\n\treturn $returnInfo;\n}",
"public function getPageInfo(){\n\n $content = array();\n\n return $content;\n }",
"function parseInspections($html){\n $iArray = array();\n $iCount = 0;\n $allOptUrl = ALL_BUSINESS_OPT_URL;\n $newInspection = null;\n $newViolation = null;\n $iDate = null;\n $iType = null;\n $iAction = null;\n $trCount = 0;\n $tblCount = 0;\n\n /*\n * More complicated html. Find the table then loop through the tr and td tags respectively\n */\n foreach ($html->find('table[class=tableBorderThin]') as $iTable) {\n //there can be two of these tables but we only ever want the first one\n if($tblCount == 0){\n foreach ($iTable->find('tr') as $tr) {\n $iCount = 0;\n foreach ($tr->find('td') as $td) {\n $iCount++;\n //always in the same order: date, type, action\n switch($iCount){\n case 1:\n //the page looks different depending on the number of inspections so\n //we check to see which one we have\n if($trCount == 1){\n foreach ($td->find('font') as $f) {\n $td = $f;\n }\n }elseif($trCount > 1){\n foreach ($td->find('a') as $a) {\n $td = $a;\n }\n }\n $iDate = $td->innertext;\n strip_tags($iDate);\n break;\n case 2:\n $iType = $td->innertext;\n break;\n case 3:\n $iAction = $td->innertext;\n break;\n }\n }\n // >0 if we actually got something\n if($iCount > 0){\n $newInspection = new Inspection($iDate, $iType, $iAction);\n array_push($iArray, $newInspection);\n }\n $trCount++;\n }\n }\n $tblCount++;\n }\n return $iArray;\n }",
"public function getTokenTableStructure()\n {\n $tableName = $this->_getTokenTableName();\n\n $table = new \\Zend_DB_Table(array('name' => $tableName, 'db' => $this->lsDb));\n $info = $table->info();\n $metaData = $info['metadata'];\n\n return $metaData;\n }",
"function get_table_fields($r) {\r\n\t$user_fields=$r->get_elements_by_tagname(\"user-field-get\");\r\n\t$out=array();\r\n\tfor($i=0;$i<count($user_fields);$i++) {\r\n\t\tlist($attr)=$user_fields[$i]->attributes();\r\n\t\t$str=$attr->value();\r\n\t\tlist($table,$fields)=explode(\".\",$str);\r\n\t\tif (array_key_exists($table,$out)) {\r\n\t\t\tif (!in_array($fields,$out[$table])) array_push($out[$table],$fields);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$tmp=array($fields);\r\n\t\t\t$out[$table]=$tmp;\r\n\t\t}\r\n\t}\r\n\treturn $out;\r\n}",
"function describe($table){\n\t\treturn(array());\n\t}"
] |
[
"0.71756226",
"0.6688063",
"0.5952701",
"0.5911593",
"0.5894885",
"0.5740901",
"0.5707391",
"0.5688057",
"0.56346804",
"0.56071883",
"0.5555996",
"0.55057037",
"0.5479396",
"0.5475107",
"0.5427085",
"0.54121447",
"0.54060185",
"0.5403795",
"0.540186",
"0.5357528",
"0.5331372",
"0.53277856",
"0.5316735",
"0.530115",
"0.529578",
"0.5235549",
"0.5229403",
"0.52202797",
"0.5214898",
"0.5186704"
] |
0.6982651
|
1
|
Use various methods to get path of PHP executable
|
function getPhpExecutable()
{
global $isWindowsServer;
// Set filename of actual php executable file
$phpexe = "php" . ($isWindowsServer ? ".exe" : "");
// LINUX ONLY (use "exec")
if (!$isWindowsServer)
{
// Use "which php"
$php_executable = @exec("which php");
if (isFile($php_executable)) return $php_executable;
// Gets the PID of the current executable
if (function_exists('posix_getpid')) {
$pid = @posix_getpid();
$php_executable = @exec("readlink -f /proc/$pid/exe");
if (isFile($php_executable)) return $php_executable;
}
}
// Try paths found in PATH
foreach (explode(PATH_SEPARATOR, getenv('PATH')) as $path) {
$path = trim($path);
if (substr($path, -1) == DS) $path = substr($path, 0, -1);
$php_executable = $path . DS . $phpexe;
if (isFile($php_executable)) return $php_executable;
}
// Use extension directory location to find it
$php_executable = str_replace(DS . 'ext', '', ini_get('extension_dir')) . DS . $phpexe;
if (isFile($php_executable)) return $php_executable;
// Search directory containing PHP.INI (use "loaded config file" location from phpinfo())
$phpinfo_array = phpinfo_array();
if (isset($phpinfo_array['General']['Loaded Configuration File'])) {
// First try in this same directory
$php_executable = dirname($phpinfo_array['General']['Loaded Configuration File']) . DS . $phpexe;
if (isFile($php_executable)) return $php_executable;
// Now try all subdirectories
$php_ini_dir = dirname($phpinfo_array['General']['Loaded Configuration File']);
$php_executable = searchForFile($php_ini_dir, $phpexe) . $phpexe;
if ($php_executable !== false && $php_executable !== null && isFile($php_executable)) return $php_executable;
}
// Try ALL paths listed in phpinfo that contain "/php"
$pathsPhpInfo = array();
foreach ($phpinfo_array as $array) {
foreach ($array as $val) {
// If we found a match for "/php"
if (!is_array($val) && strpos($val, DS."php") !== false) {
// Trim the value
$val = trim(label_decode($val));
// Check if value is a file
if (isFile($val)) {
$pathsPhpInfo[] = dirname($val);
}
// Check if a directory
elseif (is_dir($val)) {
$pathsPhpInfo[] = $val;
}
}
}
}
// Loop through all directories collected that are listed in phpinfo that contain "/php" and search ALL their subdirectories for PHP executable file
$pathsParentPhpInfo = array();
foreach (array_unique($pathsPhpInfo) as $path)
{
$php_executable = searchForFile($path, $phpexe) . $phpexe;
if ($php_executable !== false && $php_executable !== null && isFile($php_executable)) return $php_executable;
$pathsParentPhpInfo[] = dirname($path);
}
// If didn't find it in $pathsPhpInfo, now try parent folders of each in $pathsPhpInfo
foreach (array_unique($pathsParentPhpInfo) as $path)
{
$php_executable = searchForFile($path, $phpexe) . $phpexe;
if ($php_executable !== false && $php_executable !== null && isFile($php_executable)) return $php_executable;
}
// Couldn't find it
return false;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getPhpExecutable(): string\n {\n return (new PhpExecutableFinder)->find();\n }",
"protected static function getPhp() : string\n\t{\n\t\t$phpFinder = new PhpExecutableFinder;\n\n\t\tif( !( $phpPath = $phpFinder->find() ) ) {\n\t\t\tthrow new \\RuntimeException( 'The php executable could not be found, add it to your PATH environment variable and try again' );\n\t\t}\n\n\t\treturn $phpPath;\n\t}",
"public static function getPHPBinary()\n {\n if (defined('HHVM_VERSION')) return (false !== ($hhvm = getenv('PHP_BINARY')) ? $hhvm : PHP_BINARY) . ' --php';\n if (defined('PHP_BINARY') && PHP_BINARY && (PHP_SAPI === 'cli' || PHP_SAPI == 'cli-server') && is_file(PHP_BINARY)) return PHP_BINARY;\n if ($php = getenv('PHP_PATH'))\n {\n if (!is_executable($php)) return false;\n return $php;\n }\n if ($php = getenv('PHP_PEAR_PHP_BIN'))\n {\n if (is_executable($php)) return $php;\n }\n if (ini_get('open_basedir')) \n {\n $dirs = [];\n $paths = explode(PATH_SEPARATOR, ini_get('open_basedir'));\n foreach ($paths as $path)\n {\n if (is_dir($path)) $dirs[] = $path;\n else if (basename($path) == 'php' && is_executable($path)) return $path;\n }\n }\n else\n {\n $dirs = [PHP_BINDIR];\n if (defined('PHP_WINDOWS_VERSION_BUILD')) $dirs[] = 'C:\\xampp\\php\\\\';\n $dirs = array_merge(explode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), $dirs);\n }\n $php = defined('PHP_WINDOWS_VERSION_BUILD') ? 'php.exe' : 'php';\n foreach ($dirs as $dir)\n {\n if (is_file($file = $dir . DIRECTORY_SEPARATOR . $php) && (defined('PHP_WINDOWS_VERSION_BUILD') || is_executable($file))) return $file;\n }\n return false;\n }",
"protected function phpBinary()\n {\n return (new PhpExecutableFinder())->find(false) ?: 'php';\n }",
"protected function getPhpBinary()\n {\n return (new PhpExecutableFinder())->find(false);\n }",
"public function getExecutableCode(): string;",
"function path()\n { return 'C:\\php\\php-cgi.exe';\n }",
"public function getExecutable()\n {\n return $this->executable;\n }",
"protected static function getPathThisScriptNonCli() {}",
"private function _getFullPathToCommand() {\n\t\treturn realpath($this->getCommandPath() . DIRECTORY_SEPARATOR . $this->getCommand());\n\t}",
"protected static function getPathThisScriptCli() {}",
"private function getPhpBinary()\n {\n $runtime = new Runtime();\n\n return $runtime->getBinary();\n }",
"function php_path ($filename, $dir=\"/php/\") {\n return $dir . $filename;\n}",
"private function _getPath():string {\n\n # Declare result\n $result = self::PATH;\n\n # check constant\n if(Env::has(\"phpunit_test\") && Env::get(\"phpunit_test\"))\n\n # Set result\n $result = self::PATH_TEST;\n\n # Strange reaction... Allow to debug next command... ¯\\_(ツ)_/¯\n Env::get(\"crazyphp_root\");\n\n # Process result\n $result = File::path($result);\n\n # Return result\n return $result;\n\n }",
"protected function _findComposer()\n {\n if (file_exists(getcwd() . '/composer.phar')) {\n return '\"' . PHP_BINARY . '\" ' . getcwd() . '/composer.phar';\n }\n\n return 'composer';\n }",
"protected function detectExecutable()\n\t{\n\t\tforeach (self::$executables as $exec) {\n\t\t\tif (proc_close($this->openProcess(\"$exec -v\", $tmp)) === 1) {\n\t\t\t\treturn $exec;\n\t\t\t}\n\t\t}\n\t}",
"function getCodeFile()\r\n\t{\r\n\t\t$haveServer= isset( $_SERVER );\r\n\t\tif ($haveServer && array_key_exists( \"PATH_TRANSLATED\", $_SERVER ) ) {\r\n\t\t\t$codefile = $_SERVER[\"PATH_TRANSLATED\"];\r\n\t\t}\r\n\t\telse if ( $haveServer && array_key_exists( \"ORIG_PATH_TRANSLATED\", $_SERVER ) ) {\r\n\t\t\t$codefile = $_SERVER[\"ORIG_PATH_TRANSLATED\"];\r\n\t\t}\r\n\t\telse if ( $haveServer && array_key_exists( \"SCRIPT_FILENAME\", $_SERVER ) ) {\r\n\t\t\t$codefile = $_SERVER[\"SCRIPT_FILENAME\"];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$codefile = getcwd() . \"/\" . $_SERVER[ \"argv\" ][0];\r\n\t\t}\r\n\t\treturn( $codefile );\r\n\t}",
"public function getProgramPath()\n {\n return trim(`which sfk`);\n }",
"protected function findComposer()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" '.getcwd().'/composer.phar';\n }\n\n return 'composer';\n }",
"protected function findComposer()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" '.getcwd().'/composer.phar';\n }\n\n return 'composer';\n }",
"protected function getBinPath()\n {\n $phantomjs = $this->getPhantomPath();\n $converter = $this->getConverterPath();\n\n return escapeshellarg($phantomjs) . ' ' . escapeshellarg($converter);\n }",
"protected function findComposer()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" composer.phar';\n }\n\n return 'composer';\n }",
"protected function findComposer()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" composer.phar';\n }\n\n return 'composer';\n }",
"function resolve_extension_dir() {\n\t\t// proper extension_dir is available in php.ini or passed via\n\t\t// cmd-line, explicitly or automagically inside run-tests.php\n\t\t$extension_dir = ini_get(\"extension_dir\");\n\n\t\t// may make life easier while testing at development stage for php\n\t\t// built from sources, but rather not on end-user machines\n\t\tif (!strlen($extension_dir)) {\n\t\t\t// while building for win modules (like php_mysql_xdevapi.dll) are\n\t\t\t// located in the same dir as php binary\n\t\t\t$extension_dir = pathinfo(PHP_BINARY, PATHINFO_DIRNAME);\n\t\t\tif (!is_running_on_windows()) {\n\t\t\t\t// for Linux\n\t\t\t\t// php binary located in\n\t\t\t\t//\t\tconnector-php/sapi/cli or connector-php/sapi/cgi\n\t\t\t\t// while mysql_xdevapi.so in\n\t\t\t\t//\t\tconnector-php/modules\n\t\t\t\t$extension_dir .= \"/../../modules\";\n\t\t\t}\n\t\t}\n\n\t\treturn $extension_dir;\n\t}",
"public function executableFinder()\n {\n return $this->executableFinder;\n }",
"public static function getExepath()\n\t{\n\t\treturn MHTTPD::$config['Paths']['exepath'];\n\t}",
"protected function findComposer()\n {\n if (file_exists(getcwd() . '/composer.phar')) {\n return '\"' . PHP_BINARY . '\" composer.phar';\n }\n\n return 'composer';\n }",
"protected static function getPhpUnitExe()\r\n\t{\r\n\t\t$phpUnitExe = self::findExe('phpunit');\t// on Windows, this should be 'phpunit.bat' but since both exist,\r\n\t\t\t\t\t\t\t\t\t\t\t\t// and Windows runs .bat without extension, it's all good.\r\n\t\tif (!$phpUnitExe)\r\n\t\t{\r\n\t\t\t// Can't find phpunit. Use our own runner (which is a copy of phpunit's short code.).\r\n\t\t\t// ...but we still have to find the PHP executable.\r\n\t\t\t$phpExeName = 'php';\r\n\t\t\tif (strpos(PHP_OS, 'Windows') == 0)\r\n\t\t\t\t$phpExeName = 'php.exe';\r\n\t\t\t\t\r\n\t\t\t$phpExe = self::findExe($phpExeName);\r\n\t\t\tif (!$phpExe and isset($_SERVER['PHPRC']))\r\n\t\t\t{\r\n\t\t\t\t$tentative = $_SERVER['PHPRC'] . DIRECTORY_SEPARATOR . $phpExeName;\r\n\t\t\t\tif (file_exists($tentative))\r\n\t\t\t\t\t$phpExe = $tentative;\r\n\t\t\t}\r\n\t\t\tif (!$phpExe and strpos(PHP_OS, 'Windows') === false)\r\n\t\t\t{\r\n\t\t\t\t$tentative = '/usr/bin/php';\r\n\t\t\t\tif (file_exists($tentative))\r\n\t\t\t\t\t$phpExe = $tentative;\r\n\t\t\t}\r\n\t\t\tif (!$phpExe)\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(\"Can't find the PHP executable anywhere!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t$runnerCode = '<?php'.PHP_EOL.\r\n\t\t\t\t\t'set_include_path(\"'.addcslashes(get_include_path(), '\\\\\"').'\");'.PHP_EOL.\r\n<<<'EOD'\r\nif (strpos('/usr/bin/php', '@php_bin') === 0) {\r\n set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());\r\n}\r\n\r\nrequire 'PHPUnit/Autoload.php';\r\n\r\nPHPUnit_TextUI_Command::main();\r\nEOD;\r\n\t\t\t\t$phpUnitExe = tempnam(sys_get_temp_dir(), 'phpunit');\r\n\t\t\t\tfile_put_contents($phpUnitExe, $runnerCode);\r\n\t\t\t\t$phpUnitExe = '\"'.$phpExe .'\" \"'.$phpUnitExe.'\"';\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e)\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(\"Couldn't find PHPUnit executable \".PHPUNIT.\" and failed to create our own: \".$e->getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $phpUnitExe;\r\n\t}",
"public function find(bool $includeArgs = true)\n {\n if ($php = getenv('PHP_BINARY'))\n {\n if (!is_executable($php))\n {\n $command = '\\\\' === DIRECTORY_SEPARATOR ? 'where' : 'command -v';\n if ($php = strtok(exec($command.' '.escapeshellarg($php)), PHP_EOL))\n {\n if (!is_executable($php))\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }\n\n return $php;\n }\n\n $args = $this->findArguments();\n $args = $includeArgs && $args ? ' '.implode(' ', $args) : '';\n\n // PHP_BINARY return the current sapi executable\n if (PHP_BINARY && in_array(PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true))\n {\n return PHP_BINARY.$args;\n }\n\n if ($php = getenv('PHP_PATH'))\n {\n if (!@is_executable($php))\n {\n return false;\n }\n\n return $php;\n }\n\n if ($php = getenv('PHP_PEAR_PHP_BIN'))\n {\n if (@is_executable($php))\n {\n return $php;\n }\n }\n\n if (@is_executable($php = PHP_BINDIR.('\\\\' === DIRECTORY_SEPARATOR ? '\\\\php.exe' : '/php')))\n {\n return $php;\n }\n\n $dirs = [PHP_BINDIR];\n\n if ('\\\\' === DIRECTORY_SEPARATOR)\n {\n $dirs[] = 'C:\\xampp\\php\\\\';\n }\n\n return $this->executableFinder->find('php', false, $dirs);\n }",
"public function which(string $binaryName): string\n {\n if ($binaryName == 'php') {\n $output = dirname(PHP_BINARY) . '/php';\n\n if (false === strpos($output, '/Cellar/php')) {\n return $output;\n }\n }\n\n exec('which ' . $binaryName, $result);\n\n if (empty($result)) {\n exec('type ' . $binaryName, $result);\n\n if (empty($result)) {\n return $binaryName;\n }\n\n $result = trim($result[0]);\n\n if (!preg_match('/^[^ ]+ is (.*)$/', $result, $matches)) {\n return $binaryName;\n }\n\n return $matches[1];\n } else {\n $result = trim($result[0]);\n }\n\n return $result;\n }"
] |
[
"0.84373724",
"0.7493478",
"0.7377553",
"0.72301537",
"0.7141929",
"0.69003457",
"0.68386567",
"0.6798896",
"0.657233",
"0.6560656",
"0.6555107",
"0.6529256",
"0.6390641",
"0.6389945",
"0.63857096",
"0.6349222",
"0.6328783",
"0.6269922",
"0.6269294",
"0.6269294",
"0.6242348",
"0.6232186",
"0.6232186",
"0.62252337",
"0.6218347",
"0.61846274",
"0.6164659",
"0.6065599",
"0.6043436",
"0.6020827"
] |
0.7792363
|
1
|
Returns HTML name of control.
|
public function getHtmlName(): string {
return parent::getHtmlName() . ( $this->control->multiple ? '[]' : '' );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function controlName($name)\n {\n return sprintf(\n '%s_%s',\n $this->slug,\n $name\n );\n }",
"public function getControl($name);",
"public function getControlNames();",
"public function getName(): string\n {\n if ($this->name === null) {\n $cl = get_class($this);\n $count = 1;\n $name = str_replace('Html', '', substr($cl, strrpos($cl, '\\\\') + 1), $count);\n $this->setName(strtolower($name));\n }\n\n return $this->name;\n }",
"private function auto_name(){\n\n // the name starts from the class name Tbutton1 etc\n // toString inherits method from Tcontrol\n // which inherits from Object\n \n $prefix=toString($this);\n // get current count\n $counter=count($this->names);\n // create name\n $name=$prefix.'_'.$counter;\n \n return $name;\n }",
"public function FormName()\n {\n return $this->getTemplateHelper()->generateFormID($this);\n }",
"public function getFormName();",
"public function getFormName();",
"public function getControlTemplateUID()\n {\n return $this->name.'_TPL_UID';\n }",
"public function getName()\n {\n return ($this->_widgetEditor->getForm() ? $this->_widgetEditor->getForm()->getName() : null);\n }",
"protected function _getButtonName()\n\t{\n\t\treturn $this->buttonPrefix . '-' . $this->renderOrder;\n\t}",
"function name( $html = true )\r\n {\r\n return htmlspecialchars( $this->Name );\r\n }",
"public function name() {\n\t\treturn esc_html__( 'Login Form', 'thrive-cb' );\n\t}",
"function name( $html = true )\r\n {\r\n if ( $html )\r\n return htmlspecialchars( $this->Name );\r\n else\r\n return $this->Name;\r\n }",
"public function getControl(): Nette\\Utils\\Html\n\t{\n\t\treturn parent::getControl()\n\t\t\t->setText((string) $this->getRenderedValue());\n\t}",
"public function get_name() {\r\n\t\treturn $this->options['name'];\r\n\t}",
"final public function getFormName(): string\n {\n\n return str_replace('.', '__', $this->getName());\n }",
"public function getHTMLName() {\n\t\treturn 'Custom Cloud';\n\t}",
"function name()\r\n {\r\n return htmlspecialchars( $this->Name );\r\n }",
"function name()\r\n {\r\n return htmlspecialchars( $this->Name );\r\n }",
"function name()\r\n {\r\n return htmlspecialchars( $this->Name );\r\n }",
"function getName()\n {\n return $this->getAttribute(\"name\");\n }",
"abstract protected function getFormName();",
"public function getTemplate() {\n return 'controlTemplate';\n }",
"public function get_control($name)\n\t{\n\t\tif (!array_key_exists($name, $this->controls)) throw new Exception(\"Control '$name' not found\");\n\t\treturn $this->controls[$name];\n\t}",
"public function getUiElementName()\n {\n if (array_key_exists(\"uiElementName\", $this->_propDict)) {\n return $this->_propDict[\"uiElementName\"];\n } else {\n return null;\n }\n }",
"public function getName ()\n {\n return $this->getLabel();\n }",
"public function get_name() {\n\t\treturn parent::get_widget_slug( 'Team_Member' );\n\t}",
"public function validateControlName($name);",
"protected function getInputName(){\n if($this->_name===null)\n $this->defineNameId();\n return $this->_name;\n }"
] |
[
"0.7049157",
"0.7004115",
"0.67884785",
"0.6783255",
"0.6730914",
"0.6703545",
"0.6586949",
"0.6586949",
"0.65142393",
"0.649944",
"0.6444555",
"0.6427395",
"0.6356329",
"0.6351972",
"0.634694",
"0.63457245",
"0.63212806",
"0.6314539",
"0.628876",
"0.628876",
"0.628876",
"0.6269669",
"0.62397206",
"0.62235844",
"0.6219056",
"0.61860484",
"0.6174436",
"0.6159913",
"0.6153026",
"0.61501175"
] |
0.7598421
|
0
|
Allows throttling dispatch of tasks from this queue Generated from protobuf field .google.protobuf.DoubleValue max_tasks_per_second = 1;
|
public function getMaxTasksPerSecond()
{
return $this->max_tasks_per_second;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setMaxTasksPerSecond($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\DoubleValue::class);\n $this->max_tasks_per_second = $var;\n\n return $this;\n }",
"public function getMaxTasksPerSecondUnwrapped()\n {\n return $this->readWrapperValue(\"max_tasks_per_second\");\n }",
"public function setMaxTasksPerSecondUnwrapped($var)\n {\n $this->writeWrapperValue(\"max_tasks_per_second\", $var);\n return $this;}",
"public function setMaxDispatchInterval(int $max_interval, int $max_callbacks, int $min_priority): void {}",
"public static function getDelayedQueueScheduleSize()\n\t{\n\t\treturn (int)Resque::redis()->zcard(self::SET_KEY);\n\t}",
"protected function limitCallRate()\n {\n if (!$this->callRateLimit) {\n return;\n }\n $now = microtime(true);\n $callIntervalActual = $now - $this->callTimeLast;\n $callIntervalNeeded = 1 / $this->callRateLimit;\n $callDelayNeeded = $callIntervalNeeded - $callIntervalActual;\n if ($callDelayNeeded > 0) {\n usleep($callDelayNeeded * 1000000); // Seconds to microseconds\n }\n $this->callTimeLast = $now;\n }",
"public function getQueuedPendingCount()\n {\n return $this->queuedPendingCount;\n }",
"public function getMaxInstanceRequestConcurrency()\n {\n return $this->max_instance_request_concurrency;\n }",
"function ratelimit(array $data);",
"public static function getThrottleDelay() {}",
"public function getQueued()\n {\n return $this->Queued;\n }",
"public function getNextQueuedJob() {\n \t}",
"public function getPoolSize();",
"protected function _balanceQueues(){\n// $this->RUNNING = false;\n }",
"private function limitCalls()\n {\n if ($this->lastCallTimestamp > 0) {\n $callsLimit = $this->shopifyClient->callLimit();\n $callsMade = $this->shopifyClient->callsMade();\n $callsLeft = $this->shopifyClient->callsLeft();\n\n Log::debug(\"ShopifyApi.limitCalls: callsLimit=$callsLimit, callsMade=$callsMade, callsLeft=$callsLeft\");\n $currentTimestamp = microtime(true);\n $deltaTimestamp = ($this->lastCallTimestamp > 0) ? $currentTimestamp - $this->lastCallTimestamp : 0;\n Log::debug(\"ShopifyApi.limitCalls: deltaTimestamp=$deltaTimestamp\");\n\n if ($callsLeft < 10) {\n Log::debug(\"ShopifyApi.limitCalls: DELTA < 10: wait 0.5 seconds\");\n usleep(500000);\n }\n } else {\n Log::debug(\"ShopifyApi.limitCalls: first call\");\n }\n $this->lastCallTimestamp = microtime(true);\n }",
"public function getMaximumTransferable();",
"protected function messageThrottle()\n {\n if ($this->isThrottled($this->conn, 'onMessage')) {\n echo \"Message throttled: {$this->conn->resourceId} \\n\";\n\n $this->log->info(\"Message throttled: {$this->conn->resourceId} \");\n\n $this->conn->close();\n }\n }",
"public function setMaxQueryTime($max)\n\t{\n\t\t$this->maxquerytime = $max;\n\t}",
"public function testThrottledTaskCancelledWhenWrappedTaskCancelled() {\n $wrapped = new TaskStub();\n \n $throttled = new \\Async\\Task\\ThrottledTask($wrapped, 0.5);\n \n // Check that the task is not complete\n $this->assertFalse($throttled->isComplete());\n \n // Cancel the wrapped task and check that the the throttled task is cancelled\n $wrapped->cancel();\n $this->assertTrue($throttled->isComplete());\n $this->assertTrue($throttled->isCancelled());\n }",
"public function allowProcessItemsQueue()\n {\n if (Configuration::get('DF_UPDATE_ON_SAVE_DELAY')) {\n $last_exec = Configuration::get('DF_UPDATE_ON_SAVE_LAST_EXEC', null, null, null, 0);\n $delay = (int) Configuration::get('DF_UPDATE_ON_SAVE_DELAY', null, null, null, 30);\n\n if (is_int($delay)) {\n $last_exec_ts = strtotime($last_exec);\n\n $diff_min = (time() - $last_exec_ts) / 60;\n\n if ($diff_min > $delay) {\n return true;\n }\n }\n }\n\n return false;\n }",
"public function work(QueueManager $queueManager, $queue, $sleepTime, $maxjobs = 0);",
"function getNumberOfJobsToQueue(): int\n{\n global $backoffThreshold,\n $doubleBackoffPreventionIntervalFraction,\n $enableLoadHandler,\n $intervalDurationSeconds,\n $jobsToAddPerSecond,\n $lastBackoff,\n $lastRun,\n $localDB,\n $logger,\n $maxJobsForSingleRun,\n $minSafeJobs,\n $multiplicativeDecreaseFraction,\n $target;\n\n // Allow for disabling of the load handler.\n if (!$enableLoadHandler) {\n $logger->info('[AIMD] Load handler not enabled, scheduling max jobs.', ['maxJobsForSingleRun' => $maxJobsForSingleRun]);\n\n return $maxJobsForSingleRun;\n }\n $now = microtime(true);\n\n // Following line is only for testing.\n // $secondElapsed = (intval($now) === intval($lastRun)) ? 0 : intval($now);\n\n // Get timing info for the last two intervals.\n $timeSinceLastRun = $now - $lastRun;\n $lastRun = $now;\n $oneIntervalAgo = $now - $intervalDurationSeconds;\n $twoIntervalsAgo = $oneIntervalAgo - $intervalDurationSeconds;\n\n // Look up how many jobs are currently in progress.\n $numActive = intval($localDB->read('SELECT COUNT(*) FROM localJobs WHERE ended IS NULL;')[0]);\n\n // Look up how many jobs we've finished recently.\n $lastIntervalData = $localDB->read('SELECT COUNT(*), AVG(ended - started) FROM localJobs WHERE ended IS NOT NULL AND ended > '.$oneIntervalAgo.';');\n $lastIntervalCount = $lastIntervalData[0];\n $lastIntervalAverage = floatval($lastIntervalData[1]);\n\n $previousIntervalData = $localDB->read('SELECT COUNT(*), AVG(ended - started) FROM localJobs WHERE ended IS NOT NULL AND ended > '.$twoIntervalsAgo.' AND ended < '.$oneIntervalAgo.';');\n $previousIntervalCount = $previousIntervalData[0];\n $previousIntervalAverage = floatval($previousIntervalData[1]);\n\n // Following block is only for testing.\n // if ($secondElapsed) {\n // echo \"$secondElapsed, $numActive, $target, $lastIntervalAverage\\n\";\n // }\n\n // Delete old stuff.\n $localDB->write('DELETE FROM localJobs WHERE ended IS NOT NULL AND ended < '.$twoIntervalsAgo.';');\n\n // If we don't have enough data, we'll return a value based on the current target and active job count.\n if ($lastIntervalCount === 0) {\n $logger->info('[AIMD] No jobs finished this interval, returning default value.', ['minSafeJobs' => $minSafeJobs, 'returnValue' => max($target - $numActive, 0)]);\n\n return intval(max($target - $numActive, 0));\n } elseif ($previousIntervalCount === 0) {\n $logger->info('[AIMD] No jobs finished previous interval, returning default value.', ['minSafeJobs' => $minSafeJobs, 'returnValue' => max($target - $numActive, 0)]);\n\n return intval(max($target - $numActive, 0));\n }\n\n // Update our target. If the last interval average run time exceeds the previous one by too much, back off.\n // Options:\n // 1. Make intervalDurationSeconds longer for more data to average.\n // 2. Make backoffThreshold higher (this seems riskier)\n // 3. Back off by less (increase multiplicativeDecreaseFraction closer to 1).\n //\n // Possibly helpful ideas:\n // Log the count and type of jobs used to calculate lastIntervalData and previousIntervalData.\n // Also log the times for each type of job.\n //\n // Just knowing the count of completed jobs in the previous intervals is interesting. If it's a very small number\n // of jobs, a high degree of variability is expected.\n if ($lastIntervalAverage > ($previousIntervalAverage * $backoffThreshold)) {\n // Skip backoff if we've done so too recently in the past. (within 10 seconds by default)\n if ($lastBackoff < $now - ($intervalDurationSeconds * $doubleBackoffPreventionIntervalFraction)) {\n $target = max($target * $multiplicativeDecreaseFraction, $minSafeJobs);\n $lastBackoff = $now;\n $logger->info('[AIMD] Backing off jobs target.', [\n 'target' => $target,\n 'lastIntervalAverage' => $lastIntervalAverage,\n 'previousIntervalAverage' => $previousIntervalAverage,\n 'backoffThreshold' => $backoffThreshold,\n ]);\n }\n } else {\n // Otherwise, slowly ramp up. Increase by $jobsToAddPerSecond every second, except don't increase past 2x the\n // number of currently running jobs.\n if (($target + $timeSinceLastRun * $jobsToAddPerSecond) < $numActive * 2) {\n // Ok, we're running at least half this many jobs, we can increment.\n $target += $timeSinceLastRun * $jobsToAddPerSecond;\n }\n $logger->info('[AIMD] Congestion Avoidance, incrementing target', ['target' => $target]);\n }\n\n // Now we know how many jobs we want to be running, and how many are running, so we can return the difference.\n $numJobsToRun = intval(max($target - $numActive, 0));\n $logger->info('[AIMD] Found number of jobs to run.', [\n 'numJobsToRun' => $numJobsToRun,\n 'target' => $target,\n 'numActive' => $numActive,\n 'lastIntervalAverage' => $lastIntervalAverage,\n 'previousIntervalAverage' => $previousIntervalAverage,\n 'lastIntervalCount' => $lastIntervalCount,\n 'previousIntervalCount' => $previousIntervalCount,\n 'timeSinceLastRun' => $timeSinceLastRun,\n ]);\n\n return $numJobsToRun;\n}",
"protected function get_maximum_execution_time() {\n\t\t_deprecated_function( __METHOD__, '2.1.1', 'ActionScheduler_Abstract_QueueRunner::get_time_limit()' );\n\n\t\t$maximum_execution_time = 30;\n\n\t\t// Apply deprecated filter\n\t\tif ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {\n\t\t\t_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );\n\t\t\t$maximum_execution_time = apply_filters( 'action_scheduler_maximum_execution_time', $maximum_execution_time );\n\t\t}\n\n\t\treturn absint( $maximum_execution_time );\n\t}",
"static public function vUpdateTimeoutQueue(){\n\t\t$oDB = self::oDB(self::$sDBName);\n\n\t\t$sTimeout = date('Y-m-d H:i:s',time()-15*60);\n\n\t\t$sSql = \"SELECT `project_schedule_uuid`,`queue_uuid` FROM project_schedule_queue WHERE `queue_time`<'$sTimeout' AND `result_status_code`='0'\";\n\t\t$iDbq = $oDB->iQuery($sSql);\n\t\twhile($aRow = $oDB->aFetchAssoc($iDbq)){\n\t\t\t$sQueueUuid = $aRow['queue_uuid'];\n\t\t\t$sScheduleUuid = $aRow['project_schedule_uuid'];\n\t\t\tCMisc::vPrintR($aRow);\n\t\t\ttry{\n\t\t\t\t//use schedule_uuid get BeautySchedule object\n\t\t\t\t$oSchedule = CBeautySchedule::oGetSchedule($sScheduleUuid);\n\t\t\t\t//use queue_uuid and failed code run vQueueReturn($sQueueUuid, $iFailed)\n\t\t\t\t$oSchedule->vQueueReturn($sQueueUuid,2);\n\t\t\t\t//if it's a monitor schedule\n\t\t\t\tif($oSchedule->iTypeNo == 4){\n\t\t\t\t\t//get last url and add monitor(catch) queue again\n\t\t\t\t\t$sTargetUrl = '';\n\t\t\t\t\tforeach ($oSchedule->aQueueStat() as $oQueueStat) {\n\t\t\t\t\t\tif($oQueueStat->sResultUrl != '')\n\t\t\t\t\t\t\t$sTargetUrl = $oQueueStat->sResultUrl;\n\t\t\t\t\t}\n\t\t\t\t\t$oSchedule->vAddMonitor($sTargetUrl);\n\t\t\t\t}\n\n\t\t\t}catch(exception $e){\n\t\t\t\t//CMisc::vPrintR($e->getMessage());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}",
"function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}",
"function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}",
"public function getDelayedExecutionTaskQueue()\n {\n return $this->delayedExecutionTaskQueue;\n }",
"public function getMaxThreadPerThread(CommentInterface $comment);",
"public function getQueue();",
"public function getQueue();"
] |
[
"0.65150684",
"0.62096906",
"0.55871946",
"0.5307226",
"0.51530147",
"0.5073584",
"0.4984395",
"0.4950801",
"0.48422763",
"0.4801289",
"0.4787359",
"0.478449",
"0.47479883",
"0.47240484",
"0.47085476",
"0.46776593",
"0.46282777",
"0.462546",
"0.46167013",
"0.4611105",
"0.45870543",
"0.4531845",
"0.45276436",
"0.45184904",
"0.44972813",
"0.44972813",
"0.44965476",
"0.4490924",
"0.44812736",
"0.44812736"
] |
0.6957924
|
0
|
Returns the unboxed value from getMaxTasksPerSecond() Allows throttling dispatch of tasks from this queue Generated from protobuf field .google.protobuf.DoubleValue max_tasks_per_second = 1;
|
public function getMaxTasksPerSecondUnwrapped()
{
return $this->readWrapperValue("max_tasks_per_second");
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getMaxTasksPerSecond()\n {\n return $this->max_tasks_per_second;\n }",
"public function setMaxTasksPerSecond($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\DoubleValue::class);\n $this->max_tasks_per_second = $var;\n\n return $this;\n }",
"public function setMaxTasksPerSecondUnwrapped($var)\n {\n $this->writeWrapperValue(\"max_tasks_per_second\", $var);\n return $this;}",
"public function getQueuedPendingCount()\n {\n return $this->queuedPendingCount;\n }",
"public static function getDelayedQueueScheduleSize()\n\t{\n\t\treturn (int)Resque::redis()->zcard(self::SET_KEY);\n\t}",
"public static function getThrottleDelay() {}",
"public function getMaxInstanceRequestConcurrency()\n {\n return $this->max_instance_request_concurrency;\n }",
"public function getQueued()\n {\n return $this->Queued;\n }",
"protected function get_maximum_execution_time() {\n\t\t_deprecated_function( __METHOD__, '2.1.1', 'ActionScheduler_Abstract_QueueRunner::get_time_limit()' );\n\n\t\t$maximum_execution_time = 30;\n\n\t\t// Apply deprecated filter\n\t\tif ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {\n\t\t\t_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );\n\t\t\t$maximum_execution_time = apply_filters( 'action_scheduler_maximum_execution_time', $maximum_execution_time );\n\t\t}\n\n\t\treturn absint( $maximum_execution_time );\n\t}",
"public function getMaximumTransferable();",
"public function getMaxExecutionTime()\n\t{\n\t\tif(!isset($this->_maxExecutionTime)){\n\t\t\t$this->_maxExecutionTime = $this->dontHardcodeService->searchDontHardcodeByParamNameAndFilterName(__CLASS__,'maxExecutionTime',true);\n\t\t}\n\n\t\tif(is_numeric($this->_maxExecutionTime) && $this->_maxExecutionTime > 44){\n\t\t\treturn $this->_maxExecutionTime;\n\t\t}\n\t\telse{\n\t\t\treturn 120;\n\t\t}\n\t}",
"public function getMaxSpeed()\n {\n return $this->maxSpeed;\n }",
"protected function limitCallRate()\n {\n if (!$this->callRateLimit) {\n return;\n }\n $now = microtime(true);\n $callIntervalActual = $now - $this->callTimeLast;\n $callIntervalNeeded = 1 / $this->callRateLimit;\n $callDelayNeeded = $callIntervalNeeded - $callIntervalActual;\n if ($callDelayNeeded > 0) {\n usleep($callDelayNeeded * 1000000); // Seconds to microseconds\n }\n $this->callTimeLast = $now;\n }",
"public function getMaxWorkingTime(): float\n {\n return $this->usableTime * $this->capacity;\n }",
"public function GetDuration_Max()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_max_duration;\n }",
"public function get_request_timeout(): float {\n $duration = get_config('realtimeplugin_phppoll', 'requesttimeout');\n return (isset($duration) && $duration !== false) ? (float)$duration : 30;\n }",
"public function getMaxSpeed(){\n return $this->maxSpeed;\n }",
"public function getItemsMax() {\n\t\treturn \\Services::get('submission')->getMax($this->_getItemsParams());\n\t}",
"function getMaxValue() { return $this->readMaxValue(); }",
"public function getRateLimitLimit(): int\n {\n return $this->httpClient->getRateLimitLimit();\n }",
"public function getRateLimit(){\n\t\treturn $this->rateLimit;\n\t}",
"function getMaxValue() { return $this->readMaxValue(); }",
"public function setMaxDispatchInterval(int $max_interval, int $max_callbacks, int $min_priority): void {}",
"public function getNotificationCounterMax()\n {\n return self::NOTIFICATIONS_COUNTER_MAX;\n }",
"public function getMaxRoundTripTime()\n {\n if (array_key_exists(\"maxRoundTripTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"maxRoundTripTime\"], \"\\DateInterval\") || is_null($this->_propDict[\"maxRoundTripTime\"])) {\n return $this->_propDict[\"maxRoundTripTime\"];\n } else {\n $this->_propDict[\"maxRoundTripTime\"] = new \\DateInterval($this->_propDict[\"maxRoundTripTime\"]);\n return $this->_propDict[\"maxRoundTripTime\"];\n }\n }\n return null;\n }",
"public function getMaxLimit()\n {\n return $this->max_limit;\n }",
"public function getMaxBatchSize() \n {\n return $this->_fields['MaxBatchSize']['FieldValue'];\n }",
"public function getMaxValue();",
"public function getMaxValue();",
"public function getQueryPlansPerMinuteValue()\n {\n return $this->readWrapperValue(\"query_plans_per_minute\");\n }"
] |
[
"0.80226105",
"0.70193106",
"0.5869693",
"0.5482305",
"0.5387316",
"0.5326887",
"0.53045464",
"0.52943796",
"0.5232154",
"0.5205731",
"0.5084888",
"0.5040158",
"0.50071186",
"0.5002314",
"0.4958851",
"0.49507353",
"0.49411938",
"0.4933974",
"0.49309337",
"0.4902182",
"0.4901075",
"0.48929664",
"0.48694777",
"0.48684925",
"0.48658925",
"0.48469603",
"0.4834106",
"0.48040053",
"0.48040053",
"0.48026612"
] |
0.75825316
|
1
|
Allows throttling dispatch of tasks from this queue Generated from protobuf field .google.protobuf.DoubleValue max_tasks_per_second = 1;
|
public function setMaxTasksPerSecond($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class);
$this->max_tasks_per_second = $var;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getMaxTasksPerSecond()\n {\n return $this->max_tasks_per_second;\n }",
"public function getMaxTasksPerSecondUnwrapped()\n {\n return $this->readWrapperValue(\"max_tasks_per_second\");\n }",
"public function setMaxTasksPerSecondUnwrapped($var)\n {\n $this->writeWrapperValue(\"max_tasks_per_second\", $var);\n return $this;}",
"public function setMaxDispatchInterval(int $max_interval, int $max_callbacks, int $min_priority): void {}",
"public static function getDelayedQueueScheduleSize()\n\t{\n\t\treturn (int)Resque::redis()->zcard(self::SET_KEY);\n\t}",
"protected function limitCallRate()\n {\n if (!$this->callRateLimit) {\n return;\n }\n $now = microtime(true);\n $callIntervalActual = $now - $this->callTimeLast;\n $callIntervalNeeded = 1 / $this->callRateLimit;\n $callDelayNeeded = $callIntervalNeeded - $callIntervalActual;\n if ($callDelayNeeded > 0) {\n usleep($callDelayNeeded * 1000000); // Seconds to microseconds\n }\n $this->callTimeLast = $now;\n }",
"public function getQueuedPendingCount()\n {\n return $this->queuedPendingCount;\n }",
"public function getMaxInstanceRequestConcurrency()\n {\n return $this->max_instance_request_concurrency;\n }",
"function ratelimit(array $data);",
"public static function getThrottleDelay() {}",
"public function getQueued()\n {\n return $this->Queued;\n }",
"public function getNextQueuedJob() {\n \t}",
"public function getPoolSize();",
"protected function _balanceQueues(){\n// $this->RUNNING = false;\n }",
"private function limitCalls()\n {\n if ($this->lastCallTimestamp > 0) {\n $callsLimit = $this->shopifyClient->callLimit();\n $callsMade = $this->shopifyClient->callsMade();\n $callsLeft = $this->shopifyClient->callsLeft();\n\n Log::debug(\"ShopifyApi.limitCalls: callsLimit=$callsLimit, callsMade=$callsMade, callsLeft=$callsLeft\");\n $currentTimestamp = microtime(true);\n $deltaTimestamp = ($this->lastCallTimestamp > 0) ? $currentTimestamp - $this->lastCallTimestamp : 0;\n Log::debug(\"ShopifyApi.limitCalls: deltaTimestamp=$deltaTimestamp\");\n\n if ($callsLeft < 10) {\n Log::debug(\"ShopifyApi.limitCalls: DELTA < 10: wait 0.5 seconds\");\n usleep(500000);\n }\n } else {\n Log::debug(\"ShopifyApi.limitCalls: first call\");\n }\n $this->lastCallTimestamp = microtime(true);\n }",
"public function getMaximumTransferable();",
"public function setMaxQueryTime($max)\n\t{\n\t\t$this->maxquerytime = $max;\n\t}",
"protected function messageThrottle()\n {\n if ($this->isThrottled($this->conn, 'onMessage')) {\n echo \"Message throttled: {$this->conn->resourceId} \\n\";\n\n $this->log->info(\"Message throttled: {$this->conn->resourceId} \");\n\n $this->conn->close();\n }\n }",
"public function testThrottledTaskCancelledWhenWrappedTaskCancelled() {\n $wrapped = new TaskStub();\n \n $throttled = new \\Async\\Task\\ThrottledTask($wrapped, 0.5);\n \n // Check that the task is not complete\n $this->assertFalse($throttled->isComplete());\n \n // Cancel the wrapped task and check that the the throttled task is cancelled\n $wrapped->cancel();\n $this->assertTrue($throttled->isComplete());\n $this->assertTrue($throttled->isCancelled());\n }",
"public function allowProcessItemsQueue()\n {\n if (Configuration::get('DF_UPDATE_ON_SAVE_DELAY')) {\n $last_exec = Configuration::get('DF_UPDATE_ON_SAVE_LAST_EXEC', null, null, null, 0);\n $delay = (int) Configuration::get('DF_UPDATE_ON_SAVE_DELAY', null, null, null, 30);\n\n if (is_int($delay)) {\n $last_exec_ts = strtotime($last_exec);\n\n $diff_min = (time() - $last_exec_ts) / 60;\n\n if ($diff_min > $delay) {\n return true;\n }\n }\n }\n\n return false;\n }",
"public function work(QueueManager $queueManager, $queue, $sleepTime, $maxjobs = 0);",
"protected function get_maximum_execution_time() {\n\t\t_deprecated_function( __METHOD__, '2.1.1', 'ActionScheduler_Abstract_QueueRunner::get_time_limit()' );\n\n\t\t$maximum_execution_time = 30;\n\n\t\t// Apply deprecated filter\n\t\tif ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {\n\t\t\t_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );\n\t\t\t$maximum_execution_time = apply_filters( 'action_scheduler_maximum_execution_time', $maximum_execution_time );\n\t\t}\n\n\t\treturn absint( $maximum_execution_time );\n\t}",
"function getNumberOfJobsToQueue(): int\n{\n global $backoffThreshold,\n $doubleBackoffPreventionIntervalFraction,\n $enableLoadHandler,\n $intervalDurationSeconds,\n $jobsToAddPerSecond,\n $lastBackoff,\n $lastRun,\n $localDB,\n $logger,\n $maxJobsForSingleRun,\n $minSafeJobs,\n $multiplicativeDecreaseFraction,\n $target;\n\n // Allow for disabling of the load handler.\n if (!$enableLoadHandler) {\n $logger->info('[AIMD] Load handler not enabled, scheduling max jobs.', ['maxJobsForSingleRun' => $maxJobsForSingleRun]);\n\n return $maxJobsForSingleRun;\n }\n $now = microtime(true);\n\n // Following line is only for testing.\n // $secondElapsed = (intval($now) === intval($lastRun)) ? 0 : intval($now);\n\n // Get timing info for the last two intervals.\n $timeSinceLastRun = $now - $lastRun;\n $lastRun = $now;\n $oneIntervalAgo = $now - $intervalDurationSeconds;\n $twoIntervalsAgo = $oneIntervalAgo - $intervalDurationSeconds;\n\n // Look up how many jobs are currently in progress.\n $numActive = intval($localDB->read('SELECT COUNT(*) FROM localJobs WHERE ended IS NULL;')[0]);\n\n // Look up how many jobs we've finished recently.\n $lastIntervalData = $localDB->read('SELECT COUNT(*), AVG(ended - started) FROM localJobs WHERE ended IS NOT NULL AND ended > '.$oneIntervalAgo.';');\n $lastIntervalCount = $lastIntervalData[0];\n $lastIntervalAverage = floatval($lastIntervalData[1]);\n\n $previousIntervalData = $localDB->read('SELECT COUNT(*), AVG(ended - started) FROM localJobs WHERE ended IS NOT NULL AND ended > '.$twoIntervalsAgo.' AND ended < '.$oneIntervalAgo.';');\n $previousIntervalCount = $previousIntervalData[0];\n $previousIntervalAverage = floatval($previousIntervalData[1]);\n\n // Following block is only for testing.\n // if ($secondElapsed) {\n // echo \"$secondElapsed, $numActive, $target, $lastIntervalAverage\\n\";\n // }\n\n // Delete old stuff.\n $localDB->write('DELETE FROM localJobs WHERE ended IS NOT NULL AND ended < '.$twoIntervalsAgo.';');\n\n // If we don't have enough data, we'll return a value based on the current target and active job count.\n if ($lastIntervalCount === 0) {\n $logger->info('[AIMD] No jobs finished this interval, returning default value.', ['minSafeJobs' => $minSafeJobs, 'returnValue' => max($target - $numActive, 0)]);\n\n return intval(max($target - $numActive, 0));\n } elseif ($previousIntervalCount === 0) {\n $logger->info('[AIMD] No jobs finished previous interval, returning default value.', ['minSafeJobs' => $minSafeJobs, 'returnValue' => max($target - $numActive, 0)]);\n\n return intval(max($target - $numActive, 0));\n }\n\n // Update our target. If the last interval average run time exceeds the previous one by too much, back off.\n // Options:\n // 1. Make intervalDurationSeconds longer for more data to average.\n // 2. Make backoffThreshold higher (this seems riskier)\n // 3. Back off by less (increase multiplicativeDecreaseFraction closer to 1).\n //\n // Possibly helpful ideas:\n // Log the count and type of jobs used to calculate lastIntervalData and previousIntervalData.\n // Also log the times for each type of job.\n //\n // Just knowing the count of completed jobs in the previous intervals is interesting. If it's a very small number\n // of jobs, a high degree of variability is expected.\n if ($lastIntervalAverage > ($previousIntervalAverage * $backoffThreshold)) {\n // Skip backoff if we've done so too recently in the past. (within 10 seconds by default)\n if ($lastBackoff < $now - ($intervalDurationSeconds * $doubleBackoffPreventionIntervalFraction)) {\n $target = max($target * $multiplicativeDecreaseFraction, $minSafeJobs);\n $lastBackoff = $now;\n $logger->info('[AIMD] Backing off jobs target.', [\n 'target' => $target,\n 'lastIntervalAverage' => $lastIntervalAverage,\n 'previousIntervalAverage' => $previousIntervalAverage,\n 'backoffThreshold' => $backoffThreshold,\n ]);\n }\n } else {\n // Otherwise, slowly ramp up. Increase by $jobsToAddPerSecond every second, except don't increase past 2x the\n // number of currently running jobs.\n if (($target + $timeSinceLastRun * $jobsToAddPerSecond) < $numActive * 2) {\n // Ok, we're running at least half this many jobs, we can increment.\n $target += $timeSinceLastRun * $jobsToAddPerSecond;\n }\n $logger->info('[AIMD] Congestion Avoidance, incrementing target', ['target' => $target]);\n }\n\n // Now we know how many jobs we want to be running, and how many are running, so we can return the difference.\n $numJobsToRun = intval(max($target - $numActive, 0));\n $logger->info('[AIMD] Found number of jobs to run.', [\n 'numJobsToRun' => $numJobsToRun,\n 'target' => $target,\n 'numActive' => $numActive,\n 'lastIntervalAverage' => $lastIntervalAverage,\n 'previousIntervalAverage' => $previousIntervalAverage,\n 'lastIntervalCount' => $lastIntervalCount,\n 'previousIntervalCount' => $previousIntervalCount,\n 'timeSinceLastRun' => $timeSinceLastRun,\n ]);\n\n return $numJobsToRun;\n}",
"static public function vUpdateTimeoutQueue(){\n\t\t$oDB = self::oDB(self::$sDBName);\n\n\t\t$sTimeout = date('Y-m-d H:i:s',time()-15*60);\n\n\t\t$sSql = \"SELECT `project_schedule_uuid`,`queue_uuid` FROM project_schedule_queue WHERE `queue_time`<'$sTimeout' AND `result_status_code`='0'\";\n\t\t$iDbq = $oDB->iQuery($sSql);\n\t\twhile($aRow = $oDB->aFetchAssoc($iDbq)){\n\t\t\t$sQueueUuid = $aRow['queue_uuid'];\n\t\t\t$sScheduleUuid = $aRow['project_schedule_uuid'];\n\t\t\tCMisc::vPrintR($aRow);\n\t\t\ttry{\n\t\t\t\t//use schedule_uuid get BeautySchedule object\n\t\t\t\t$oSchedule = CBeautySchedule::oGetSchedule($sScheduleUuid);\n\t\t\t\t//use queue_uuid and failed code run vQueueReturn($sQueueUuid, $iFailed)\n\t\t\t\t$oSchedule->vQueueReturn($sQueueUuid,2);\n\t\t\t\t//if it's a monitor schedule\n\t\t\t\tif($oSchedule->iTypeNo == 4){\n\t\t\t\t\t//get last url and add monitor(catch) queue again\n\t\t\t\t\t$sTargetUrl = '';\n\t\t\t\t\tforeach ($oSchedule->aQueueStat() as $oQueueStat) {\n\t\t\t\t\t\tif($oQueueStat->sResultUrl != '')\n\t\t\t\t\t\t\t$sTargetUrl = $oQueueStat->sResultUrl;\n\t\t\t\t\t}\n\t\t\t\t\t$oSchedule->vAddMonitor($sTargetUrl);\n\t\t\t\t}\n\n\t\t\t}catch(exception $e){\n\t\t\t\t//CMisc::vPrintR($e->getMessage());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}",
"function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}",
"function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}",
"public function getDelayedExecutionTaskQueue()\n {\n return $this->delayedExecutionTaskQueue;\n }",
"public function getMaxThreadPerThread(CommentInterface $comment);",
"public function getQueue();",
"public function getQueue();"
] |
[
"0.6959245",
"0.6210349",
"0.55869573",
"0.53114784",
"0.5154047",
"0.5073045",
"0.49843886",
"0.4953264",
"0.4841465",
"0.48010874",
"0.47864994",
"0.47837675",
"0.47476366",
"0.47221848",
"0.4709191",
"0.46786988",
"0.46283987",
"0.46277684",
"0.46146277",
"0.4610833",
"0.45862547",
"0.45313168",
"0.45312455",
"0.45180443",
"0.44980752",
"0.44980752",
"0.44954935",
"0.44925603",
"0.44784313",
"0.44784313"
] |
0.65163314
|
1
|
Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. Allows throttling dispatch of tasks from this queue Generated from protobuf field .google.protobuf.DoubleValue max_tasks_per_second = 1;
|
public function setMaxTasksPerSecondUnwrapped($var)
{
$this->writeWrapperValue("max_tasks_per_second", $var);
return $this;}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setMaxTasksPerSecond($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\DoubleValue::class);\n $this->max_tasks_per_second = $var;\n\n return $this;\n }",
"public function getMaxTasksPerSecondUnwrapped()\n {\n return $this->readWrapperValue(\"max_tasks_per_second\");\n }",
"public function setDoubleField($value)\n {\n return $this->set(self::DOUBLE_FIELD, $value);\n }",
"public function getDoubleField()\n {\n $value = $this->get(self::DOUBLE_FIELD);\n return $value === null ? (double)$value : $value;\n }",
"public function getMaxTasksPerSecond()\n {\n return $this->max_tasks_per_second;\n }",
"public function setValue($var)\n {\n GPBUtil::checkDouble($var);\n $this->value = $var;\n\n return $this;\n }",
"public function useMilliseconds() {\n $this->type = self::MILLISECONDS;\n }",
"public function setFDouble($var)\n {\n GPBUtil::checkDouble($var);\n $this->f_double = $var;\n\n return $this;\n }",
"public function getFDouble()\n {\n return $this->f_double;\n }",
"public function setPDouble($var)\n {\n GPBUtil::checkDouble($var);\n $this->p_double = $var;\n\n return $this;\n }",
"public function __construct($value)\n {\n $this->type = self::XMLRPC_TYPE_DOUBLE;\n $precision = (int) ini_get('precision');\n $formatString = '%1.' . $precision . 'F';\n $this->value = rtrim(sprintf($formatString, (float) $value), '0');\n }",
"public function writeDouble($num){ }",
"public function toDouble() {\r\n }",
"public function updateDouble( Inx_Api_Recipient_Attribute $attr, $fValue );",
"public function set($value = null)\r\n {\r\n return parent::set((float)$value);\r\n }",
"public function setBounds($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::DOUBLE);\n $this->bounds = $arr;\n\n return $this;\n }",
"public function getFloatField()\n {\n $value = $this->get(self::FLOAT_FIELD);\n return $value === null ? (double)$value : $value;\n }",
"public function getDouble($i);",
"public static function double() {}",
"public static function double()\n {\n return self::builtinType('double');\n }",
"public function getDouble(bool $isNullable): IPrimitiveTypeReference\n {\n return new EdmPrimitiveTypeReference($this->getCoreModelPrimitiveType(PrimitiveTypeKind::Double()), $isNullable);\n }",
"public function getPDouble()\n {\n return isset($this->p_double) ? $this->p_double : 0.0;\n }",
"public function double($value)\n {\n $bytes = pack('d*', $value);\n if ($this->isBigEndian()) {\n $bytes = strrev($bytes);\n }\n $this->write($bytes, 8);\n }",
"public function doubleValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"public function getInternalDataType()\n {\n return 'double';\n }",
"public function setMaxRoundTripTime($val)\n {\n $this->_propDict[\"maxRoundTripTime\"] = $val;\n return $this;\n }",
"public function get_meter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::METER_INVALID;\n }\n }\n $res = $this->_meter;\n return $res;\n }",
"public static function setThrottleDelay($seconds) {}",
"public static function doubleval($double, ORM $object = NULL)\n {\n return doubleval($double);\n }",
"public function setValue($var)\n {\n GPBUtil::checkFloat($var);\n $this->value = $var;\n\n return $this;\n }"
] |
[
"0.6907195",
"0.585133",
"0.5455005",
"0.52645826",
"0.49953064",
"0.48769715",
"0.4846842",
"0.4695058",
"0.46341312",
"0.45762718",
"0.45498997",
"0.4537746",
"0.4520443",
"0.44876286",
"0.44631982",
"0.44116765",
"0.4367251",
"0.4355059",
"0.43409067",
"0.43382588",
"0.43146747",
"0.43107185",
"0.42958394",
"0.42954567",
"0.4294776",
"0.42130178",
"0.42066383",
"0.4194444",
"0.41942704",
"0.41927245"
] |
0.5960018
|
1
|
$Id: i18n_path.admin.inc,v 1.1.2.2 2011/02/19 17:50:42 jareyero Exp $
|
function i18n_path_admin_overview() {
$default = language_default('language');
$result = db_select('i18n_path', 'p')->fields('p')->execute();
foreach ($result as $path) {
$paths[$path->tsid][$path->language] = $path->path;
}
if (!empty($paths)) {
$build['paths'] = array(
'#theme' => 'table',
'#header' => array(t('Paths'), t('Operations')),
);
foreach ($paths as $tpid => $set) {
$items = array();
foreach ($set as $lang => $path) {
// We'll see the path alias if any on the link
$items[] = l($path, $path, array('language' => i18n_language($lang)));
}
$build['paths']['#rows'][] = array(
theme('item_list', array('items' => $items)),
l(t('Edit'), 'admin/config/regional/i18n_translation/path/edit/' . $tpid),
);
}
}
else {
$build['message']['#markup'] = t('No path translations.');
}
return $build;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function admin_l10n($l10n)\n {\n }",
"function input_admin_l10n($l10n)\n {\n }",
"function _thickbox_path_admin_subfolder()\n {\n }",
"static function adminSubMenuProjecten()\n {\n // include the view for this submenu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/pp_admin_projecten.php';\n }",
"function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}",
"function admin_url($path = false) {\n return site_url(config_item('admin_path') . '/' . $path);\n}",
"function mmf_admin() {\n\t\tinclude('mmf_admin_page.php');\n\t}",
"function admin_load()\n {\n }",
"function admin_configuration()\n{\n global $app;\n\n $app->render('admin_configuration.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 2),\n 'mailers' => mkMailers(),\n 'ttss' => mkTitleTimeSortOptions(),\n 'isadmin' => is_admin()]);\n}",
"function cacheplugin_admin_menu_old() {\r\n \t\t\t echo '<h3><a href=\"#\">Cache Plugin</a></h3>\r\n \t\t\t\t <ul>\r\n \t\t\t <li><a href=\"' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/conf.php') . '\">» ' . __('Settings', 'cacheplugin') . '</a></li>\r\n \t\t <li><a href=\"' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/help.php') . '\">» ' . __('Help', 'cacheplugin') . '</a></li>\r\n \t\t\t </ul>';\r\n \t\t }",
"protected function get_admin_url()\n {\n }",
"function anuncios_admin() {\n\t\tinclude('anuncios_admin.php');\n\t}",
"function path_admin_edit($pid = 0) {\n if ($pid) {\n $alias = path_load($pid);\n drupal_set_title(check_plain($alias['dst']));\n $output = drupal_get_form('path_admin_form', $alias);\n }\n else {\n $output = drupal_get_form('path_admin_form');\n }\n\n return $output;\n}",
"public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\n\t}",
"function path_admin_overview($keys = NULL) {\n // Add the filter form above the overview table.\n $output = drupal_get_form('path_admin_filter_form', $keys);\n // Enable language column if locale is enabled or if we have any alias with language\n $count = db_result(db_query(\"SELECT COUNT(*) FROM {url_alias} WHERE language != ''\"));\n $multilanguage = (module_exists('locale') || $count);\n\n if ($keys) {\n // Replace wildcards with MySQL/PostgreSQL wildcards.\n $keys = preg_replace('!\\*+!', '%', $keys);\n $sql = \"SELECT * FROM {url_alias} WHERE dst LIKE '%%%s%%'\";\n }\n else {\n $sql = 'SELECT * FROM {url_alias}';\n }\n $header = array(\n array('data' => t('Alias'), 'field' => 'dst', 'sort' => 'asc'),\n array('data' => t('System'), 'field' => 'src'),\n array('data' => t('Operations'), 'colspan' => '2')\n );\n if ($multilanguage) {\n $header[3] = $header[2];\n $header[2] = array('data' => t('Language'), 'field' => 'language');\n }\n $sql .= tablesort_sql($header);\n $result = pager_query($sql, 50, 0 , NULL, $keys);\n\n $rows = array();\n $destination = drupal_get_destination();\n while ($data = db_fetch_object($result)) {\n $row = array(check_plain($data->dst), check_plain($data->src), l(t('edit'), \"admin/build/path/edit/$data->pid\", array('query' => $destination)), l(t('delete'), \"admin/build/path/delete/$data->pid\", array('query' => $destination)));\n if ($multilanguage) {\n $row[4] = $row[3];\n $row[3] = $row[2];\n $row[2] = module_invoke('locale', 'language_name', $data->language);\n }\n $rows[] = $row;\n }\n\n if (empty($rows)) {\n $empty_message = $keys ? t('No URL aliases found.') : t('No URL aliases available.') ;\n $rows[] = array(array('data' => $empty_message, 'colspan' => ($multilanguage ? 5 : 4)));\n }\n\n $output .= theme('table', $header, $rows);\n $output .= theme('pager', NULL, 50, 0);\n\n return $output;\n}",
"function property_management_admin(){\n\tinclude('manage-property-admin.php');\t\n\t\n}",
"function jpa_menu_administrator()\n{\n add_menu_page(JPA_NOMBRE,JPA_NOMBRE,'manage_options',JPA_RUTA . '/admin/jpa-configuration.php');\n add_submenu_page(JPA_RUTA . '/admin/jpa-configuration.php','Add resource','Add resource','manage_options',JPA_RUTA . '/admin/jpa-add_resource.php');\n}",
"function admin_load() {\n\n\t}",
"function url_admin_post(): string\n{\n return \\admin_url('admin-post.php');\n}",
"function translatePath($path) {\n global $synAdminPath;\n if (strpos($path,\"§syntaxRelativePath§\")!==false) $path=str_replace(\"§syntaxRelativePath§\",$synAdminPath,$path);\n return $path;\n }",
"public function adminLink($path)\r\n {\r\n return $this->link($this->adminPath . '/' . ltrim($path, '/'));\r\n }",
"public function getAdminUrl($path='', $param=array()){\n\t\t$p = ltrim($path, '/');\n\t\t$p = '/' . $this->_router->getAdminRoute() . '/' . $p;\n\t\treturn $this->getUrl($p, $param);\n\t}",
"static function adminMenuPage()\n {\n // Include the view for this menu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/admin_main.php';\n }",
"function dreams_load_admin_textdomain_in_front() {\r\n\tif (!is_admin()) {\r\n\t\tload_textdomain('default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo');\r\n\t}\r\n}",
"function admin_menu()\n {\n }",
"function admin_menu()\n {\n }",
"function admin_menu()\n {\n }",
"public static function _options_page(){\n\t\tif( isset($_POST['urls']) ){\n\t\t\tself::updateUrls($_POST['urls']);\n\t\t}\n\t\t\n\t\t$vars = (object) array();\n\t\t$vars->messages = implode( \"\\n\", self::$messages );\n\t\t$vars->path = self::$path;\n\t\t$vars->urls = self::getUrls();\n\t\tself::render( 'admin', $vars );\n\t}",
"function add_admin_pages () {\n define( \"CLRANGER_PATHS\", ['clarity-ranger'] );\n add_menu_page( 'Marc Moeller Clarity Ranger', 'Clarity Ranger', 'manage_options', 'clarity-ranger', array($this, 'clranger_internal_links_page') , CLARITY_URL . '/images/icon2.png' , 6 );\n\t\t\n\t\tadd_submenu_page( 'clarity-ranger', 'Reverse Silo', 'Reverse Silo','manage_options', 'clarity-reverse-silo' ,array($this, 'clranger_reverse_silo_page') );\n }",
"function GetAdminDescription()\n {\n return $this->Lang('moddescription');\n }"
] |
[
"0.67441016",
"0.659892",
"0.633938",
"0.6083028",
"0.6040193",
"0.60013115",
"0.5976449",
"0.59671897",
"0.59594846",
"0.5951477",
"0.59476817",
"0.59202087",
"0.5906972",
"0.58807856",
"0.5868975",
"0.58511937",
"0.5822166",
"0.5802144",
"0.57746017",
"0.57728386",
"0.5766021",
"0.57622623",
"0.5758265",
"0.5745984",
"0.5727601",
"0.5727601",
"0.5727601",
"0.57268256",
"0.5726297",
"0.566159"
] |
0.7090359
|
0
|
Check event exists in FormEvents
|
protected static function isEventExists($event)
{
static $events;
if (!$events) {
$ref = new \ReflectionClass('Symfony\Component\Form\FormEvents');
$events = $ref->getConstants();
}
return in_array($event, $events);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function hasEventListeners($event);",
"private function checkEventExists(){\n $event = Event::find($this->id);\n\n return(!is_null($event));\n }",
"public function hasEventQueue(/*# string */ $eventName)/*# : bool */;",
"static protected function eventExists($uid) {\n return array_key_exists($uid, self::$events);\n }",
"function isRegistered($event) {\n return Event::isRegistered($event);\n }",
"public function hasEventHandler($name)\r\n\t{\r\n\t\t$name=strtolower($name);\r\n\t\treturn isset($this->_e[$name]) && $this->_e[$name]->getCount()>0;\r\n\t}",
"public function eventExists()\n {\n return $this->getTalk()->getSpeaker()->exists();\n }",
"function getHasEvent() {\n\t\treturn $this->_HasEvent;\n\t}",
"public function eventExists(Event $event){\r\n //echo $event->getType();\r\n $stmt = $this->db->prepare(\"SELECT COUNT(*) as count FROM event WHERE type = ? AND name = ? AND date = ? AND observations = ? AND guests = ?\");\r\n $stmt->execute(array($event->getType(), $event->getName(), $event->getDate(), $event->getObservations(), $event->getGuests()));\r\n $data = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n if($data['count'] == 0){\r\n $exists = false;\r\n }else{\r\n $exists = true;\r\n }\r\n return $exists;\r\n }",
"public function isValidFor(Event $event)\n {\n return $this->getEventName() === $event->getName();\n }",
"public function matchesEvent($event);",
"public function hasListeners($event): bool;",
"function hasCallbacks($event) {\n return Event::hasCallbacks($event);\n }",
"public function matchEvent(Mage_Index_Model_Event $event)\n {\n return false;\n }",
"public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }",
"function isCustomEvent($event_id){\n\t$data = M('customevent');\n\tif((int)$event_id>=1){\n\t\t$condition = Array('event_id' => $event_id);\n\t\tif($event = $data->where($condition)->find()){\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n}",
"public function hasEvents()\n {\n return count($this->events) > 0 ? true : false;\n }",
"Public function isEvent( $cat ) {\r\n\t\treturn isset( $this->events[ $cat ] );\r\n\t}",
"function isEvent($var){\n\tif ($this->calEvents){\n\t\t$checkTime=$this->mkActiveTime(0,0,1,$this->actmonth,$var,$this->actyear);\n\t\t$selectedTime=$this->mkActiveTime(0,0,1,$this->selectedmonth,$this->selectedday,$this->selectedyear);\n\t\t$todayTime=$this->mkActiveTime(0,0,1,$this->monthtoday,$this->daytoday,$this->yeartoday);\n\t\tforeach($this->calEvents as $eventTime => $eventID){\n\t\t\tif ($eventTime==$checkTime){\n\t\t\t\tif ($eventTime==$selectedTime) $this->eventID=$this->cssPrefixSelecEvent.$eventID;\n\t\t\t\telseif ($eventTime==$todayTime) $this->eventID=$this->cssPrefixTodayEvent.$eventID;\n\t\t\t\telse $this->eventID=$eventID;\n\t\t\t\tif ($this->calEventsUrl[$eventTime]) $this->eventUrl=$this->calEventsUrl[$eventTime];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\treturn false;\n\t}\n}",
"private function eventExists($id) {\n $exists = new RecordExists( [ 'table' => $this->_events, 'field' => 'id', 'adapter' => $this->db, ]);\n return $exists->isValid( $id ); \n }",
"public function hasListeners($eventName): bool;",
"public static function event_method()\n {\n return true;\n }",
"public function has($name)\r\n {\r\n return isset($this->_events[$name]);\r\n }",
"public static function listeners($event) {\n return isset(static::$events[$event]);\n }",
"public function hasListeners($eventName);",
"protected function isListenerFired($event)\n {\n // Do not apply to the same or newer versions\n if (version_compare(static::VERSION, $event->old, '<=')) {\n return true;\n }\n\n return false;\n }",
"public static function has_event_json()\n {\n global $wpdb;\n\n $event_id = isset($_POST['event_id']) ? (int) $_POST['event_id'] : 0;\n if (isset($_GET['event_id'])) {\n $event_id = (int) $_GET['event_id'];\n }\n $response = new stdClass();\n $response->success = false;\n if ($post_id = $wpdb->get_var(\"select post_id from \" . EM_EVENTS_TABLE . \" where event_id='\" . $event_id . \"' limit 1\")) {\n if ($event_key = $wpdb->get_var(\"SELECT event_key FROM \" . EM_SEATSIO_EVENT . \" WHERE post_id='\" . $post_id . \"' LIMIT 1\")) {\n $response->success = true;\n $response->event_key = $event_key;\n $response->post_id = $post_id;\n $response->event_id = $event_id;\n }\n }\n wp_send_json($response);\n }",
"private function event_exists($slug) {\n return (isset($this->events[$slug]));\n }",
"protected function _hasTrigger($event) {\n\t\t$eventClass = new ReflectionClass(get_class($this->EventClass));\n\t\t$parentMethods = $eventClass->getParentClass()->getMethods(ReflectionMethod::IS_PUBLIC);\n\n\t\tforeach ($parentMethods as $parentMethod) {\n\t\t\t$declaringClass = $eventClass->getMethod($parentMethod->getName())->getDeclaringClass()->getName();\n\t\t\tif ($declaringClass === $eventClass->getName() && $parentMethod->getName() == 'on' . ucfirst($event)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function is_event($p = null) {\n\tglobal $post;\n\t$p = ($p == null) ? $post : $p;\n\t$cat = get_the_category($p->ID);\n\t$option_category = get_it_option('event_category');\n\t\n\treturn $cat[0]->cat_ID == $option_category ||\n\t\t\tget_top_parent_cat_ID($cat[0]) == $option_category;\n}"
] |
[
"0.7169488",
"0.70932585",
"0.6956594",
"0.6628984",
"0.6564281",
"0.65567",
"0.6543992",
"0.64950377",
"0.64793307",
"0.64631337",
"0.6420489",
"0.64184576",
"0.6389724",
"0.637995",
"0.636178",
"0.6283273",
"0.6275799",
"0.62393355",
"0.6235809",
"0.6206788",
"0.6168576",
"0.6156902",
"0.6132529",
"0.60872126",
"0.6078721",
"0.6055154",
"0.60251826",
"0.5993094",
"0.5988481",
"0.59498"
] |
0.71003026
|
1
|
Utility method used to retrieve the class of a particular instance. This is here to allow extending classes to override how class names are resolved
|
protected function getClass($instance)
{
return get_class($instance);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function getClass()\n {\n $type = explode('\\\\', get_called_class());\n\n return $type[count($type) - 1];\n }",
"public function get_class()\n {\n return $this->class;\n }",
"function get_class() {\n\t\t$args = func_get_args();\n\t\treturn strtolower(call_user_func_array(\"get_class\", $args));\n\t}",
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }",
"public function get_class() {\n\t\tif ( ! $this->is_class_set ) {\n\t\t\t$this->set_class( $this->derive_class() );\n\t\t}\n\t\treturn $this->class;\n\t}",
"public static function getClass()\n {\n return get_class(new static);\n }",
"public function getClass()\n {\n return get_class($this);\n }",
"public function getClass() {\n\t\t$this->checkDomain();\n\t\treturn $this->domain->class;\n\t}",
"public static function get_class(){\n return self::class;}",
"final public static function getClass(){\n return get_called_class();\n }",
"public function getClass()\n {\n return $this->_className;\n }",
"public function getClass()\n\t{\n\t\treturn $this->_class;\n\t}",
"public function getClass()\n\t{\n\t\treturn $this->_class;\n\t}",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"protected function getClass()\n {\n return __CLASS__;\n }",
"public function getClass() {}",
"public function getClass() {}"
] |
[
"0.7674665",
"0.7548244",
"0.7498692",
"0.74614376",
"0.7436205",
"0.7325923",
"0.7293488",
"0.7250701",
"0.7249875",
"0.7244451",
"0.7207013",
"0.7185139",
"0.7155813",
"0.7155813",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.713727",
"0.7134324",
"0.71281695",
"0.71281695"
] |
0.76272494
|
1
|
Factory method to create a new Coordinate
|
public static function create($x, $y){
return new Coordinate($x, $y);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"static public function createFromXml(\\SimpleXMLElement $xml)\n {\n $coordinate = new Coordinate();\n $coordinate->type = (string) $xml['type'];\n $coordinate->x = self::intToFloat((string) $xml['x']);\n $coordinate->y = self::intToFloat((string) $xml['y']);\n\n return $coordinate;\n }",
"public function test_make_coordinates_2()\n {\n $coord = \"-120,\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], null);\n $this->assertEquals($dd[1], null);\n }",
"abstract public function coordinates();",
"public function test_make_coordinates_1()\n {\n $coord = \"-120\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], null);\n $this->assertEquals($dd[1], null);\n }",
"public function setCoordinate()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof Coordinate)) {\n $this->coordinate = $args[0];\n } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) {\n if (!$this->hasCoordinate()) {\n $this->coordinate = new Coordinate();\n }\n\n $this->coordinate->setLatitude($args[0]);\n $this->coordinate->setLongitude($args[1]);\n\n if (isset($args[2]) && is_bool($args[2])) {\n $this->coordinate->setNoWrap($args[2]);\n }\n } elseif (!isset($args[0])) {\n $this->coordinate = null;\n } else {\n throw GeocodingException::invalidGeocoderRequestCoordinate();\n }\n\n return $this;\n }",
"protected static function newFactory()\n {\n return new LocationFactory();\n }",
"public function test_make_coordinates_3()\n {\n $coord = \"52° 32' 25\\\" N, 89° 40' 31\\\" W\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], 52.540277777778);\n $this->assertEquals($dd[1], -89.675277777778);\n }",
"public function test_make_coordinates_0()\n {\n $coord = \"52° 32' 25\\\" N,\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], null);\n $this->assertEquals($dd[1], null);\n }",
"public static function createWithCoordinates(Coordinates $coordinates)\n {\n return new static($coordinates);\n }",
"public function test_make_coordinates_4()\n {\n $coord = \"52° 32' 25\\\" N; 89° 40' 31\\\" W\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], 52.540277777778);\n $this->assertEquals($dd[1], -89.675277777778);\n }",
"public function testCreateWithCoordinates()\n {\n $coordinates = new Coordinates(40.0, 50.0);\n\n $options = Search::coordinates($coordinates);\n\n $this->assertInstanceOf(Search::class, $options);\n $this->assertCount(1, $options->parametrise());\n $this->assertSame($coordinates, $options->parametrise()['ll']);\n }",
"public function addCoordinate()\n {\n $args = func_get_args();\n \n if(isset($args[0]) && is_int($args[0]) && isset($args[1]) && is_int($args[1]))\n {\n if(isset($args[2]) && is_bool($args[2]))\n $this->coordinates[] = new Coordinate($args[0], $args[1], $args[2]);\n else\n $this->coordinates[] = new Coordinate($args[0], $args[1]);\n }\n else if(isset($args[0]) && ($args[0] instanceof Coordinate))\n $this->coordinates[] = $args[0];\n else\n throw new \\InvalidArgumentException();\n }",
"static function fromCoords(float $lat, float $lon): Locator\n {\n\n $lat = Convertor::roundUp($lat, Convertor::ROUND_PRECISION);\n $lon = Convertor::roundUp($lon, Convertor::ROUND_PRECISION);\n\n if ($lat < -90.0 || $lat > 90.0) {\n throw new \\InvalidArgumentException(\"The value of variable '\\$lat' must be in the range from -90.0 to 90.0\");\n }\n\n if ($lon < -180.0 || $lon > 180.0) {\n throw new \\InvalidArgumentException(\"The value of variable '\\$lon' must be in the range from -180.0 to 180.0\");\n }\n\n $instance = new static(new Convertor());\n $instance->setCoords($lat, $lon);\n $instance->setQth($instance->convertor->coordsToQth($lat, $lon));\n\n return $instance;\n }",
"public abstract function getOrigin(): Point;",
"public function setPositions(int $x, int $y): Creator\n {\n $this->xPosition = $x;\n $this->yPosition = $y;\n return $this;\n }",
"public static function invalidMarkerShapePolyCoordinates()\n {\n return new static(sprintf(\n '%s'.PHP_EOL.'%s',\n 'The coordinates setter arguments is invalid if the marker shape type is poly.',\n 'The available prototype is : function setCoordinates('.\n 'array(double $x1, double $y1, '.\n '..., '.\n 'double $xn, double $yn'.\n ')'\n ));\n }",
"protected function createAndPersistGISCoordinate($node, $type)\n {\n $lat = floatval($node['lat']);\n $lon = floatval($node['lon']);\n $coordinate = new GISCoordinate($lat, $lon, $type);\n $this->em->persist($coordinate);\n\n return $coordinate;\n }",
"public function createAddress()\n {\n $class = $this->getClass();\n\n return new $class;\n }",
"public function __construct()\n {\n $args = func_get_args();\n if (count($args) == 2) {\n if (is_numeric($args[0]) && is_numeric($args[1])) {\n $this->SWEREF99Position($args[0], $args[1]);\n } elseif ($args[0] instanceof WGS84Position && is_int($args[1])) {\n $this->SWEREF99PositionPositionProjection($args[0], $args[1]);\n }\n } elseif (count($args) == 3) {\n $this->SWEREF99PositionProjection($args[0], $args[1], $args[2]);\n }\n }",
"public static function invalidPolygonCoordinate()\n {\n return new static(sprintf(\n '%s'.PHP_EOL.'%s'.PHP_EOL.'%s'.PHP_EOL.'%s',\n 'The coordinate adder arguments is invalid.',\n 'The available prototypes are :',\n ' - function addCoordinate(Fungio\\GoogleMap\\Base\\Coordinate $coordinate)',\n ' - function addCoordinate(double $latitude, double $longitude, boolean $noWrap = true)'\n ));\n }",
"public function getCoordinates();",
"public static function invalidPolylineCoordinate()\n {\n return new static(sprintf(\n '%s'.PHP_EOL.'%s'.PHP_EOL.'%s'.PHP_EOL.'%s',\n 'The coordinate adder arguments is invalid.',\n 'The available prototypes are :',\n ' - function addCoordinate(Fungio\\GoogleMap\\Base\\Coordinate $coordinate)',\n ' - function addCoordinate(double $latitude, double $longitude, boolean $noWrap = true)'\n ));\n }",
"public function newCoordinateForOrientation(Orientation $orientation): Coordinate\n {\n return new Coordinate($this->x + $orientation->getStepSizeX(), $this->y + $orientation->getStepSizeY());\n }",
"function __construct($x = 0, $y = 0/*, $z = 0*/) {\n $this->x = $x;\n $this->y = $y;\n //$this->z = $z;\n return $this; \n }",
"public function generateNew() {\n return new Position($this->oTableGateway->getAdapter());\n }",
"public function __construct( $x, $y )\n\t{\n\t\t$this->setX( $x );\n\t\t$this->setY( $y );\n\t}",
"private function newPositionObject() {\n return new PhabricatorProjectColumnPosition();\n }",
"public function getMarkerFactory();",
"public static function invalidMarkerShapeCoordinates()\n {\n return new static('A marker shape must have coordinates.');\n }",
"public static function from_userid($userid)\n {\n $point = new point;\n $point->userid = $userid;\n return $point;\n }"
] |
[
"0.6669382",
"0.65018266",
"0.6392287",
"0.63756716",
"0.6167057",
"0.6148345",
"0.6069502",
"0.6058542",
"0.6028035",
"0.60138613",
"0.5941452",
"0.5878433",
"0.5875494",
"0.5849214",
"0.58384734",
"0.57901937",
"0.5757661",
"0.5710518",
"0.56853056",
"0.5658569",
"0.56554747",
"0.56479657",
"0.5644276",
"0.56182593",
"0.5602522",
"0.5581174",
"0.55796033",
"0.55753237",
"0.55531824",
"0.55316705"
] |
0.8057508
|
0
|
"openid" MUST be the first scope in the list.
|
protected function getDefaultScopes(): string
{
return 'openid email profile';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function auth_openid_dist ($login, $pass, $serveur='') {\n\n\t// il faut un login non vide ET un pass vide (sinon cela ne concerne pas OpenID)\n\tif (!strlen($login) OR strlen($pass)) return false;\n\t$auteur = false;\n\n\tif (!$l = auth_openid_retrouver_login($login)){\n\t\tif (is_openid($login)\n\t\t\tAND $idurl = nettoyer_openid($login)\n\t\t\tAND verifier_openid($idurl))\n\t\t\treturn _T(\"openid:form_login_openid_inconnu\");\n\t\treturn false;\n\t}\n\t$login = $l;\n\n\n\t// retrouver le login\n\tif (!$auteur = sql_fetsel(\"openid,statut\", \"spip_auteurs\", \"login=\" . sql_quote($login),\"\",\"\",\"\",\"\",$serveur) )\n\t\treturn false;\n\n\tif (!$idurl = $auteur['openid'])\n\t\treturn false;\n\n\tif ($auteur['statut']=='nouveau')\n\t\treturn _T('openid:form_login_statut_nouveau');\n\t\n\t// * Si l'openid existe, la procedure continue en redirigeant\n\t// vers le fournisseur d'identite. En cas d'erreur, il y a une redirection de faite\n\t// sur la page login, en cas de reussite, sur l'action controler_openid\n\t// * S'il l'openid n'existe pas, on est de retour ici, et on continue\n\t// pour d'autres methodes d'identification\n\tinclude_spip('inc/openid');\n\t$retour = auth_url_retour_login('openid', $login, url_absolue(self()));\n\t$erreurs_openid = demander_authentification_openid($idurl, $retour);\n\t// potentiellement, on arrive ici avec une erreur si l'openid donne n'existe pas\n\t// on la renvoie\n\treturn $erreurs_openid;\n}",
"public function getScope(): Oauth2ScopeInterface;",
"function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}",
"public function getOpenid()\n {\n return $this->openid;\n }",
"public function getOpenid()\n {\n return $this->openid;\n }",
"protected function getDefaultScopes()\n {\n return ['openid', 'profile', 'email', 'address', 'phone', 'offline_access'];\n }",
"function doregisterwithopenid($data, $form) {\n\t\t$openid = trim($data['OpenIDURL']);\n\t\tSession::set(\"FormInfo.Form_RegistrationWithOpenIDForm.data\", $data);\n\n \tif(strlen($openid) == 0) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"Please enter your OpenID or your i-name.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('processopenidresponse');\n\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\n\t\t// No auth request means we can't begin OpenID\n\t\t$auth_request = $consumer->begin($openid);\n\t\tif(!$auth_request) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That doesn't seem to be a valid OpenID or i-name identifier. \" .\n\t\t\t\t\t\"Please try again.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\t\t$SQL_identity = Convert::raw2sql($auth_request->endpoint->claimed_id);\n\t\tif($member = Member::get()->filter('IdentityURL', $SQL_identity)->first()) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That OpenID or i-name is already registered. Use another one.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t// Add the fields for which we wish to get the profile data\n \t$sreg_request = Auth_OpenID_SRegRequest::build(null,\n \tarray('nickname', 'fullname', 'email', 'country'));\n\n \tif($sreg_request) {\n\t\t\t$auth_request->addExtension($sreg_request);\n \t}\n\n\n\t\tif($auth_request->shouldSendRedirect()) {\n\t\t\t// For OpenID 1, send a redirect.\n\t\t\t$redirect_url = $auth_request->redirectURL($trust_root, $return_to_url);\n\n\t\t\tif(Auth_OpenID::isFailure($redirect_url)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .\n\t\t\t\t\t\t\t\t\t\t $redirect_url->message);\n\t\t\t} else {\n\t\t\t\treturn $this->redirect($redirect_url);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// For OpenID 2, use a javascript form to send a POST request to the\n\t\t\t// server.\n\t\t\t$form_id = 'openid_message';\n\t\t\t$form_html = $auth_request->formMarkup($trust_root, $return_to_url,\tfalse, array('id' => $form_id));\n\n\t\t\tif(Auth_OpenID::isFailure($form_html)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .$form_html->message);\n\t\t\t} else {\n\t\t\t\t$page_contents = array(\n\t\t\t\t\t \"<html><head><title>\",\n\t\t\t\t\t \"OpenID transaction in progress\",\n\t\t\t\t\t \"</title></head>\",\n\t\t\t\t\t \"<body onload='document.getElementById(\\\"\". $form_id .\n\t\t\t\t\t \"\\\").submit()'>\",\n\t\t\t\t\t $form_html,\n\t\t\t\t\t \"<p>Click "Continue" to login. You are only seeing \" .\n\t\t\t\t\t \"this because you appear to have JavaScript disabled.</p>\",\n\t\t\t\t\t \"</body></html>\");\n\n\t\t\t\tprint implode(\"\\n\", $page_contents);\n\t\t\t}\n\t\t}\n\t}",
"public function getOpenId()\n {\n }",
"public function setOpenid($openid)\n {\n $this->openid = $openid;\n }",
"public function needsIdToken($request_scope)\n {\n // see if the \"openid\" scope exists in the requested scope\n return $this->scopeUtil->checkScope('openid', $request_scope);\n }",
"public function getUserIDByOpenID($openid_identifier);",
"public static function autoLogin($openid)\n\t{\n\t\t//Cookie::set('auth_id', $openid, PHP_INT_MAX);\n\t}",
"function auth($proxy=NULL,$attr=[],array $reqd=NULL) {\n\t\t$fw=\\Base::instance();\n\t\t$root=$fw->SCHEME.'://'.$fw->HOST;\n\t\tif (empty($this->args['trust_root']))\n\t\t\t$this->args['trust_root']=$root.$fw->BASE.'/';\n\t\tif (empty($this->args['return_to']))\n\t\t\t$this->args['return_to']=$root.$_SERVER['REQUEST_URI'];\n\t\t$this->args['mode']='checkid_setup';\n\t\tif ($this->url=$this->discover($proxy)) {\n\t\t\tif ($attr) {\n\t\t\t\t$this->args['ns.ax']='http://openid.net/srv/ax/1.0';\n\t\t\t\t$this->args['ax.mode']='fetch_request';\n\t\t\t\tforeach ($attr as $key=>$val)\n\t\t\t\t\t$this->args['ax.type.'.$key]=$val;\n\t\t\t\t$this->args['ax.required']=is_string($reqd)?\n\t\t\t\t\t$reqd:implode(',',$reqd);\n\t\t\t}\n\t\t\t$var=[];\n\t\t\tforeach ($this->args as $key=>$val)\n\t\t\t\t$var['openid.'.$key]=$val;\n\t\t\t$fw->reroute($this->url.'?'.http_build_query($var));\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function bindOpenID($uid, $openid_identifier);",
"function simpleid_checkid_approval_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else {\n $request['openid.mode'] = 'checkid_setup';\n $message = array(\n 'openid.mode' => 'id_res', \n 'openid.user_setup_url' => simpleid_url('continue', 's=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}",
"public function getAccessTokenScope(): ?array;",
"function auth_openid_retrouver_login($login, $serveur=''){\n\tinclude_spip('inc/openid');\n\n\t// regarder si l'utilisateur figure deja dans la base\n\t// il faut au moins que ca ressemble un peu a un openid !\n\tif (is_openid($login)\n\t AND $idurl = nettoyer_openid($login) \t\t// si pas de protocole, mettre http://\n\t\tAND $r = sql_getfetsel(\"login\", \"spip_auteurs\", array(\"statut!=\".sql_quote(\"5poubelle\") , \"openid=\" . sql_quote($idurl)),'','','','',$serveur)) {\n\n\t\treturn $r;\n\t}\n\n\t// encore plus fort :\n\t// si le login est un login spip mais qu'on arrive la,\n\t// et qu'il a pas fournit de pass\n\t// dans ce cas, si l'utilisateur a un openid on peut tenter de la loger avec !\n\tif ($r = sql_getfetsel(\"login\", \"spip_auteurs\", array(\"statut!=\".sql_quote(\"5poubelle\") , \"login=\" . sql_quote($login). \" AND openid>''\"),'','','','',$serveur)){\n\t\treturn $r;\n\t}\n\n\t// ou par email\n\tif ($r = sql_getfetsel(\"login\", \"spip_auteurs\", array(\"statut!=\".sql_quote(\"5poubelle\") , \"email=\" . sql_quote($login). \" AND openid>''\"),'','','','',$serveur)){\n\t\treturn $r;\n\t}\n\n\n\treturn false;\n}",
"function simpleid_associate($request) {\n global $version;\n \n log_info('OpenID association request: ' . log_array($request));\n \n $assoc_types = openid_association_types();\n $session_types = openid_session_types(is_https(), $version);\n\n // Common Request Parameters [8.1.1]\n if (($version == OPENID_VERSION_1_1) && !isset($request['openid.session_type'])) $request['openid.session_type'] = '';\n $assoc_type = $request['openid.assoc_type'];\n $session_type = $request['openid.session_type'];\n \n // Diffie-Hellman Request Parameters [8.1.2]\n $dh_modulus = (isset($request['openid.dh_modulus'])) ? $request['openid.dh_modulus'] : NULL;\n $dh_gen = (isset($request['openid.dh_gen'])) ? $request['openid.dh_gen'] : NULL;\n $dh_consumer_public = $request['openid.dh_consumer_public'];\n \n if (!isset($request['openid.session_type']) || !isset($request['openid.assoc_type'])) {\n log_error('Association failed: openid.session_type or openid.assoc_type not set');\n openid_direct_error('openid.session_type or openid.assoc_type not set');\n return;\n }\n \n // Check if the assoc_type is supported\n if (!array_key_exists($assoc_type, $assoc_types)) {\n $error = array(\n 'error_code' => 'unsupported-type',\n 'session_type' => 'DH-SHA1',\n 'assoc_type' => 'HMAC-SHA1'\n );\n log_error('Association failed: The association type is not supported by SimpleID.');\n openid_direct_error('The association type is not supported by SimpleID.', $error, $version);\n return;\n }\n // Check if the session_type is supported\n if (!array_key_exists($session_type, $session_types)) {\n $error = array(\n 'error_code' => 'unsupported-type',\n 'session_type' => 'DH-SHA1',\n 'assoc_type' => 'HMAC-SHA1'\n );\n log_error('Association failed: The session type is not supported by SimpleID.');\n openid_direct_error('The session type is not supported by SimpleID.', $error, $version);\n return;\n }\n \n if ($session_type == 'DH-SHA1' || $session_type == 'DH-SHA256') {\n if (!$dh_consumer_public) {\n log_error('Association failed: openid.dh_consumer_public not set');\n openid_direct_error('openid.dh_consumer_public not set');\n return;\n }\n }\n\n $response = _simpleid_create_association(ASSOCIATION_SHARED, $assoc_type, $session_type, $dh_modulus, $dh_gen, $dh_consumer_public);\n \n openid_direct_response(openid_direct_message($response, $version));\n}",
"function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}",
"function simpleid_checkid_login_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else { \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.user_setup_url' => simpleid_url('login', 'destination=continue&s=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}",
"protected function getDefaultScopes()\n {\n return [\n 'profile',\n ];\n }",
"public function setScope(Oauth2ScopeInterface $scope);",
"function hook_openid_connect_post_authorize(UserInterface $account, array $context) {\n}",
"protected function authOpenId($client)\n {\n $request = Yii::$app->getRequest();\n $mode = $request->get('openid_mode', $request->post('openid_mode'));\n\n if (empty($mode)) {\n $url = $client->buildAuthUrl();\n return Yii::$app->getResponse()->redirect($url);\n }\n\n switch ($mode) {\n case 'id_res':\n if ($client->validate()) {\n return $this->authSuccess($client);\n }\n throw new HttpException(400, 'Unable to complete the authentication because the required data was not received.');\n case 'cancel':\n return $this->authCancel($client);\n default:\n throw new HttpException(400);\n }\n }",
"public function setOpenid($openid)\n {\n $this->openid = $openid;\n\n return $this;\n }",
"public function getAppScopeId()\n {\n if (array_key_exists(\"appScopeId\", $this->_propDict)) {\n return $this->_propDict[\"appScopeId\"];\n } else {\n return null;\n }\n }",
"function simpleid_checkid_identity(&$request, $immediate) {\n global $user, $version;\n \n $realm = openid_get_realm($request, $version);\n \n // Check 1: Is the user logged into SimpleID as any user?\n if ($user == NULL) {\n return CHECKID_LOGIN_REQUIRED;\n } else {\n $uid = $user['uid'];\n }\n \n // Check 2: Is the user logged in as the same identity as the identity requested?\n // Choose the identity URL for the user automatically\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $test_user = user_load($uid);\n $identity = $test_user['identity'];\n \n log_info('OpenID identifier selection: Selected ' . $uid . ' [' . $identity . ']');\n } else {\n $identity = $request['openid.identity'];\n $test_user = user_load_from_identity($identity);\n }\n if ($test_user == NULL) return CHECKID_IDENTITY_NOT_EXIST;\n if ($test_user['uid'] != $user['uid']) {\n log_notice('Requested user ' . $test_user['uid'] . ' does not match logged in user ' . $user['uid']);\n return CHECKID_IDENTITIES_NOT_MATCHING;\n }\n \n // Pass the assertion to extensions\n $assertion_results = extension_invoke_all('checkid_identity', $request, $identity, $immediate);\n $assertion_results = array_merge(array_diff($assertion_results, array(NULL)));\n \n // Populate the request with the selected identity\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $request['openid.claimed_id'] = $identity;\n $request['openid.identity'] = $identity;\n }\n \n // Check 3: Discover the realm and match its return_to\n $user_rp = (isset($user['rp'][$realm])) ? $user['rp'][$realm] : NULL;\n\n if (($version >= OPENID_VERSION_2) && SIMPLEID_VERIFY_RETURN_URL_USING_REALM) {\n $verified = FALSE;\n \n $rp_info = simpleid_get_rp_info($realm);\n $services = discovery_get_service_by_type($rp_info['services'], OPENID_RETURN_TO);\n \n log_info('OpenID 2 discovery: ' . count($services) . ' matching services');\n \n if ($services) {\n $return_to_uris = array();\n \n foreach ($services as $service) {\n $return_to_uris = array_merge($return_to_uris, $service['uri']);\n }\n foreach ($return_to_uris as $return_to) {\n if (openid_url_matches_realm($request['openid.return_to'], $return_to)) {\n log_info('OpenID 2 discovery: verified');\n $verified = TRUE;\n break;\n }\n }\n }\n \n $rp_info['return_to_verified'] = $verified;\n simpleid_set_rp_info($realm, $rp_info);\n \n if (!$verified) {\n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_notice('OpenID 2 discovery: not verified, but overridden by user preference');\n } else {\n log_notice('OpenID 2 discovery: not verified');\n $assertion_results[] = CHECKID_RETURN_TO_SUSPECT;\n }\n }\n }\n \n // Check 4: For checkid_immediate, the user must already have given\n // permission to log in automatically. \n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_info('Automatic set for realm ' . $realm);\n $assertion_results[] = CHECKID_OK;\n return min($assertion_results);\n } else {\n $assertion_results[] = CHECKID_APPROVAL_REQUIRED;\n return min($assertion_results);\n }\n}",
"private function scopes() {\n\n \t global $cfg;\n\n if (is_array($cfg->scopes) && sizeof($cfg->scopes) > 0) {\n $this->scope = implode(',', $cfg->scopes);\n } else {\n\n $scopes = array(\n 'incoming-webhook',\n 'commands',\n 'bot',\n 'channels:read',\n 'channels:history',\n 'channels:write',\n 'chat:write:bot',\n 'chat:write:user',\n 'emoji:read',\n 'im:write',\n 'im:history',\n 'reactions:read',\n 'reactions:write',\n 'team:read',\n 'users:read',\n 'users.profile:read',\n );\n\n $this->scope = implode(',', $scopes);\n }\n }",
"public function getScopes(): array;",
"public function getScopes(): array;"
] |
[
"0.6110963",
"0.5922985",
"0.5920421",
"0.5881422",
"0.5881422",
"0.58268595",
"0.56724024",
"0.5583925",
"0.5516555",
"0.5497231",
"0.54753315",
"0.5474321",
"0.52932775",
"0.52913755",
"0.5255287",
"0.5193157",
"0.51378596",
"0.51342046",
"0.50950724",
"0.50854886",
"0.50826013",
"0.50756943",
"0.5072788",
"0.5040562",
"0.50258255",
"0.50021344",
"0.49983236",
"0.49809107",
"0.49654436",
"0.49654436"
] |
0.6590169
|
0
|
Requests and returns the resource owner of given access token.
|
public function getResourceOwner(AccessTokenInterface $token): GoogleUser
{
$response = $this->fetchResourceOwnerDetails($token);
return $this->createResourceOwner($response, $token);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getResourceOwner()\n {\n // guard\n if (!$this->access_token) {\n return;\n }\n\n try {\n // get the provider\n $provider = $this->getShopifyOauth2Provider();\n\n // set resource owner\n $resource_owner = $provider->getResourceOwner($this->access_token);\n } catch (\\Exception $e) {\n throw new ShopifyOauthCallbackException('Something went wrong: '. $e->getMessage());\n }\n\n // return the resource owner\n return $resource_owner;\n }",
"protected function getAccessTokenResourceOwnerId()\n {\n return 'id_token';\n }",
"public function getOwnerRequestedBy()\n {\n return $this->http->get('/users/%s/requested-by', 'self');\n }",
"function getOwner() {\n \n return $this->principalInfo['uri'];\n \n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n return 'https://api.accounting.sage.com/v3.1/user';\n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n return $this->domain() . '/oauth/userinfo';\n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n return $this->getHost().'/api/v2/users/me';\n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n // not yet implemented by provider\n return '';\n }",
"public function resource(){\n\t\tif (!$this->server->verifyResourceRequest(OAuth2\\Request::createFromGlobals())) {\n\t\t $this->server->getResponse()->send();\n\t\t echo json_encode(array('status' => false, 'message' => 'NO ACCESS TOKEN'));\n\t\t die;\n\t\t}\t\t\n }",
"public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}",
"public function getResourceOwnerDetailsUrl(AccessToken $token): string\n {\n return $this->apiDomain . '/epic/oauth/v1/userInfo';\n }",
"public function getOwner()\n {\n return $this->get(self::_OWNER);\n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n // 暂不使用\n }",
"protected function createResourceOwner(array $response, AccessToken $token)\n {\n return new EBResourceOwner($response);\n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n return 'https://api.intercom.io/me';\n }",
"public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }",
"public function getOwner()\n {\n return $this->data['owner'];\n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n // TODO: Implement getResourceOwnerDetailsUrl() method.\n }",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n $authorizedUser = $this->getAuthorizedUser($token);\n\n $params = [\n 'token' => $token->getToken(),\n 'user' => $authorizedUser->getId()\n ];\n\n return 'https://redbooth.com/oauth2/users.info?' . http_build_query($params);\n }",
"public function getAccessToken($access_token);",
"public function getResourceOwnerId() {\n\t\treturn $this->getClaims()['sub'];\n\t}",
"public function createResourceOwner(array $response, AccessToken $token)\n {\n return new SchibstedResourceOwner($response);\n }",
"function getAccessToken($token = NULL) {\n\t\t$r = $this->oAuthRequest ( $this->accessTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n return $this->apiUrl . '/profile';\n }",
"public function getAuthOauth()\n {\n if (!$this->session->hasAttribute(AccessControl\\Session::SESSION_ATTRIBUTE_OAUTH_DATA)) {\n return null;\n }\n\n $data = $this->session->getAttribute(AccessControl\\Session::SESSION_ATTRIBUTE_OAUTH_DATA);\n if (isset($data['resourceOwner']) && $data['resourceOwner'] instanceof ResourceOwnerInterface) {\n return $data['resourceOwner'];\n }\n\n return null;\n }",
"public function fetchAccessToken() {\n if (!isset($_SESSION['ACCESS_TOKEN'])) {\n if (!empty($_GET) && isset($_SESSION['REQUEST_TOKEN'])) {\n return parent::getAccessToken(\n $_GET, unserialize($_SESSION['REQUEST_TOKEN']));\n }\n }\n return null;\n }",
"protected function getUserFromAccessToken()\n {\n try {\n return $this->api('GET', '/v1/people/~:(id,firstName,lastName,headline)');\n } catch (LinkedInApiException $e) {\n return;\n }\n }",
"public function getAccessToken()\n\t{\n\t\tif ($this->makeRequest())\n\t\t{\n\t\t\tif ($token = isset($this->getJson()->access_token) ? $this->getJson()->access_token : null) {\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t}\n\t}",
"protected function createResourceOwner(array $response, AccessToken $token)\n {\n return new DialpadResourceOwner($response);\n }",
"public function getOwner()\n {\n return $this->owner;\n }"
] |
[
"0.74998707",
"0.638391",
"0.63328636",
"0.627025",
"0.6220117",
"0.6082757",
"0.60801226",
"0.60227597",
"0.60131866",
"0.6006589",
"0.6004503",
"0.59703326",
"0.5967811",
"0.59219",
"0.59132534",
"0.5878352",
"0.58738405",
"0.58699363",
"0.58662343",
"0.58343273",
"0.5824358",
"0.58109593",
"0.5804986",
"0.574578",
"0.57421213",
"0.5718601",
"0.5686563",
"0.5679239",
"0.56601864",
"0.56586653"
] |
0.681261
|
1
|
Get the standard installpage header
|
function get_header(){
global $FANNIE_ROOT;
ob_start();
$page_title = $this->title;
$header = $this->header;
include($FANNIE_ROOT.'src/header_install.html');
return ob_get_clean();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function get_header() {\n $this->do_header();\n return $this->c_header;\n }",
"function get_html_header();",
"public function getPageHeader()\n\t{\n\t\treturn $this->_pageHeader;\n\t}",
"public function print_header() {\n return $this->header();\n }",
"function get_header()\n\t{\n\t\treturn $this->header;\n\t}",
"function getHeader()\n {\n $header = '';\n $header .= \"<head>\\n\";\n $header .= \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=$this->documentCharset\\\">\\n\";\n $header .= \"<meta name=\\\"ProgId\\\" content=\\\"Word.Document\\\">\\n\";\n $header .= \"<meta name=\\\"Generator\\\" content=\\\"$this->appName $this->appVersion\\\">\\n\";\n $header .= \"<meta name=\\\"Originator\\\" content=\\\"$this->appName $this->appVersion\\\">\\n\";\n $header .= \"<!--[if !mso]>\\n\";\n $header .= \"<style>\\n\";\n $header .= \"v\\:* {behavior:url(#default#VML);}\\n\";\n $header .= \"o\\:* {behavior:url(#default#VML);}\\n\";\n $header .= \"w\\:* {behavior:url(#default#VML);}\\n\";\n $header .= \".shape {behavior:url(#default#VML);}\\n\";\n $header .= \"</style>\\n\";\n $header .= \"<![endif]-->\\n\";\n \n $header .= \"<style>\\n\";\n $header .= \"<!--\\n\";\n $header .= \"/* Style Definitions */\\n\";\n \n $this->prepareDefaultHeader();\n \n $header .= $this->formatBuffer . \"\\n\";\n \n $header .= \"-->\\n\";\n $header .= \"</style>\\n\";\n $header .= \"</head>\\n\";\n \n return $header;\n }",
"public function get_header_html()\n\t{\n\t return '';\n\t}",
"public function getHeader()\n {\n $p = $this->path . '/HEADER.html';\n if (is_file($p))\n return file_get_contents($p);\n return '';\n }",
"public function get_header() {\n\t\tif (!isset($this->header)) {\n\t\t\t$this->get_array();\n\t\t}\n\t\treturn $this->header;\n\t}",
"function get_custom_header()\n {\n }",
"protected function _getExportHeaders()\n {\n return Mage::helper('storelocator')->getHeaderFile();\n }",
"function get_css_header();",
"public function getPageHeader() {\n\n\t\t//this is a single call function\n\t\tif (!$this->isFirstCall(__FUNCTION__))\n\t\treturn;\n\n\t\treturn $this->renderView('page-header',array(\n\t\t\t'data' => $this->getCurrentProductDetails(),\n\t\t\t));\n\t}",
"private function pageheader_print() {\n\t\tif (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t# HTML prepage requirements.\n\t\tforeach ($this->_pageheader as $line)\n\t\t\techo $line.\"\\n\";\n\n\t\t# Page Title\n\t\techo '<head>';\n\t\tprintf('<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />');\n\n\t\t$DNs = get_request('dn','REQUEST');\n\t\tif (is_array($DNs))\n\t\t\t$DNs = '';\n\n\t\tif (isset($_SESSION[APPCONFIG]))\n\t\t\tprintf('<title>%s (%s) - %s%s</title>',\n\t\t\t\t$this->_app['title'],\n\t\t\t\tapp_version(),\n\t\t\t\t$DNs ? htmlspecialchars($DNs).' ' : '',\n\t\t\t\t$_SESSION[APPCONFIG]->getValue('appearance','page_title'));\n\t\telse\n\t\t\tprintf('<title>%s - %s</title>',$this->_app['title'],app_version());\n\n\t\techo '<link rel=\"shortcut icon\" href=\"images/favicon.ico\" type=\"image/vnd.microsoft.icon\" />';\n\t\t# Style sheet.\n\t\tprintf('<link type=\"text/css\" rel=\"stylesheet\" href=\"%s\" />',$this->_app['urlcss']);\n\n\t\tif (defined('JSDIR')) {\n\t\t\tprintf('<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"%sjscalendar/calendar-blue.css\" title=\"blue\" />',JSDIR);\n\t\t\techo \"\\n\";\n\t\t\tprintf('<script type=\"text/javascript\" src=\"%sajax_functions.js\"></script>',JSDIR);\n\t\t\tprintf('<script type=\"text/javascript\" src=\"%sjscalendar/calendar.js\"></script>',JSDIR);\n\t\t\techo \"\\n\";\n\t\t}\n\n\t\t# HTML head requirements.\n\t\tif (is_array($this->_head) && count($this->_head))\n\t\t\tforeach ($this->_head as $line)\n\t\t\t\techo $line.\"\\n\";\n\n\t\techo '</head>';\n\t\techo \"\\n\";\n\t}",
"public function getCustomHead() {\n return $this->_customHead;\n }",
"protected function getDefaultHeader() {\n\t\treturn CWidgetConfig::getKnownWidgetTypes()[$this->type];\n\t}",
"public function presentHeader() {\r\n $html = parent::presentHeader();\r\n\r\n return $html;\r\n }",
"function get_page_heading()\n {\n return $this->object->get_page_title();\n }",
"public function getFullHeader()\n {\n }",
"public function getHeaderText()\n {\n $session = Mage::getSingleton('admin/session');\n $storeConfig = $session->getNnStoreConfig();\n\n $headerText = $this->getConfigPage('header_text');\n $text = Mage::helper('novalnet_payment')->__($headerText . ' for ' . $storeConfig);\n $session->unsNnStoreConfig();\n return $text;\n }",
"function getHead() {\n return '';\n // return $this->document->getHead();\n }",
"function getLinuxHeader()\n\t\t{\n\t\t\t$return = <<<EOH\n\t\t\t <html xmlns:v=\"urn:schemas-microsoft-com:vml\"\n\t\t\txmlns:o=\"urn:schemas-microsoft-com:office:office\"\n\t\t\txmlns:w=\"urn:schemas-microsoft-com:office:word\"\n\t\t\txmlns=\"http://www.w3.org/TR/REC-html40\">\n\t\t\t\n\t\t\t<head>\n\t\t\t<meta http-equiv=Content-Type content=\"text/html; charset=Windows-1252\">\n\t\t\t<meta name=ProgId content=Word.Document>\n\t\t\t<meta name=Generator content=\"Microsoft Word 9\">\n\t\t\t<meta name=Originator content=\"Microsoft Word 9\">\n\t\t\t<!--[if !mso]>\n\t\t\t<style>\n\t\t\tv\\:* {behavior:url(#default#VML);}\n\t\t\to\\:* {behavior:url(#default#VML);}\n\t\t\tw\\:* {behavior:url(#default#VML);}\n\t\t\t.shape {behavior:url(#default#VML);}\n\t\t\t</style>\n\t\t\t<![endif]-->\n\t\t\t<title>$this->title</title>\n\t\t\t<!--[if gte mso 9]><xml>\n\t\t\t <w:WordDocument>\n\t\t\t <w:View>Print</w:View>\n\t\t\t <w:DoNotHyphenateCaps/>\n\t\t\t <w:PunctuationKerning/>\n\t\t\t <w:DrawingGridHorizontalSpacing>9.35 pt</w:DrawingGridHorizontalSpacing>\n\t\t\t <w:DrawingGridVerticalSpacing>9.35 pt</w:DrawingGridVerticalSpacing>\n\t\t\t </w:WordDocument>\n\t\t\t</xml><![endif]-->\n\t\t\t<style>\n\t\t\t<!--\n\t\t\t /* Font Definitions */\n\t\t\t@font-face\n\t\t\t\t{font-family:Verdana;\n\t\t\t\tpanose-1:2 11 6 4 3 5 4 4 2 4;\n\t\t\t\tmso-font-charset:0;\n\t\t\t\tmso-generic-font-family:swiss;\n\t\t\t\tmso-font-pitch:variable;\n\t\t\t\tmso-font-signature:536871559 0 0 0 415 0;}\n\t\t\t /* Style Definitions */\n\t\t\tp.MsoNormal, li.MsoNormal, div.MsoNormal\n\t\t\t\t{mso-style-parent:\"\";\n\t\t\t\tmargin:0in;\n\t\t\t\tmargin-bottom:.0001pt;\n\t\t\t\tmso-pagination:widow-orphan;\n\t\t\t\tfont-size:7.5pt;\n\t\t\t mso-bidi-font-size:8.0pt;\n\t\t\t\tfont-family:\"Verdana\";\n\t\t\t\tmso-fareast-font-family:\"Verdana\";}\n\t\t\tp.small\n\t\t\t\t{mso-style-parent:\"\";\n\t\t\t\tmargin:0in;\n\t\t\t\tmargin-bottom:.0001pt;\n\t\t\t\tmso-pagination:widow-orphan;\n\t\t\t\tfont-size:1.0pt;\n\t\t\t mso-bidi-font-size:1.0pt;\n\t\t\t\tfont-family:\"Verdana\";\n\t\t\t\tmso-fareast-font-family:\"Verdana\";}\n\t\t\t@page Section1\n\t\t\t\t{size:8.5in 11.0in;\n\t\t\t\tmargin:1.0in 1.25in 1.0in 1.25in;\n\t\t\t\tmso-header-margin:.5in;\n\t\t\t\tmso-footer-margin:.5in;\n\t\t\t\tmso-paper-source:0;}\n\t\t\tdiv.Section1\n\t\t\t\t{page:Section1;}\n\t\t\t-->\n\t\t\t</style>\n\t\t\t<!--[if gte mso 9]><xml>\n\t\t\t <o:shapedefaults v:ext=\"edit\" spidmax=\"1032\">\n\t\t\t <o:colormenu v:ext=\"edit\" strokecolor=\"none\"/>\n\t\t\t </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml>\n\t\t\t <o:shapelayout v:ext=\"edit\">\n\t\t\t <o:idmap v:ext=\"edit\" data=\"1\"/>\n\t\t\t </o:shapelayout></xml><![endif]-->\n\t\t\t $this->htmlHead\n\t\t\t</head>\n\t\t\t<body>\nEOH;\n\t\treturn $return;\n\t\t}",
"function get_header($args = null){\n\trequire_once(GENERAL_DIR.'header.php');\n}",
"function GetHeader() {\n return ($this->ses['response']['header']);\n }",
"public function getHeader() {\n return (isset($this->header)) ? $this->header : '';\n }",
"private function getXMLHeader() {\n\t\treturn '<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>' . \"\\n\";\n\t}",
"function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }",
"function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}",
"function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}",
"public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }"
] |
[
"0.6623594",
"0.6609625",
"0.6459005",
"0.6431005",
"0.638366",
"0.63192356",
"0.6268992",
"0.61815596",
"0.61727613",
"0.615776",
"0.614493",
"0.6062141",
"0.6054568",
"0.6054126",
"0.60496956",
"0.60441923",
"0.60300934",
"0.5992656",
"0.5966664",
"0.5939472",
"0.5935634",
"0.59248704",
"0.5921337",
"0.5907832",
"0.5897686",
"0.5895855",
"0.58668894",
"0.5847616",
"0.5825426",
"0.5820621"
] |
0.7540402
|
0
|
Get the standard installpage footer
|
function get_footer(){
global $FANNIE_ROOT, $FANNIE_AUTH_ENABLED, $FANNIE_URL;
ob_start();
include($FANNIE_ROOT.'src/footer_install.html');
return ob_get_clean();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getFooter()\n{\n global $rAdminSettings, $rPermissions, $rSettings, $rRelease, $rEarlyAccess, $_;\n if ($rPermissions[\"is_admin\"]) {\n $version = \"Version : \" . $rRelease . \" Based On Xtream UI 22F\";\n if ($rAdminSettings['show_version'] == 0) {\n $version = \" Based On Xtream UI 22F\";\n }\n return $_[\"copyright\"] . \" © \" . date(\"Y\") . \" - \" . $rAdminSettings['site_title'] . \" - \" . $version;\n } else {\n return $rSettings[\"copyrights_text\"];\n }\n}",
"public function getFooter();",
"public function getFooter();",
"private function getFooter() {\n\t\t$this->data['oxfooter']\t= \"\\n\"\n\t\t. '<!-- Module ' . ucfirst( $this->_name )\n\t\t.' v.'. $this->_version . ' by http://osworx.net (c) '\n\t\t. date('Y')\n\t\t. ' -->' . \"\\n\";\n\t}",
"function get_footer() {\r\n\t\trequire_once('theme_parts/footer.php');\r\n\t}",
"public function get_footer()\n {\n return <<<EOD\n<div id=\"siteftr\">\n Sitewide Footer\n</div>\n\nEOD;\n }",
"public static function getFooter()\n {\n ?>\n <p>Content in the front end's footer. This code comes from <?php echo __METHOD__; ?></p>\n <?php\n }",
"function Get_Standard_Bottom_Section_HTML()\n{\n $html = \"\";\n //$html .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $html .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $html .= \"</div>\";\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/standard_footer.html\");\n return $html;\n}",
"public function pfoot() {\n include(dirname(dirname(__FILE__)) . '/ui/footer.php');\n }",
"public function getFooter()\n {\n return <<<EOF\n\n<info>\nFinished. \n</info>\n\n\nEOF;\n\n}",
"abstract protected function footer();",
"abstract protected function footer();",
"public function footer()\n\t\t{\t\t\t\n\t\t\treturn $this->render('incs/footer');\n\t\t}",
"protected function generatePageFooter() \r\n {\r\n echo <<<HTML\r\n </article>\r\n <script src=\"CityWok.js\"> </script>\r\n </body>\r\n</html>\r\nHTML;\r\n }",
"private function PH_SiteFooter(){\n $res =<<<EOF\n <a href=\"#\">Lorem</a> |\n <a href=\"#\">Ipsum</a> |\n <a href=\"#\">Dolor</a> |\n <a href=\"#\">Sit amet</a> |\n <a href=\"#\">Aliquip</a> \nEOF;\n return $res;\n }",
"public static function footer()\n {\n $version ='<strong style=\"color: green;\">'.EcrHtml::getVersionFromCHANGELOG('com_easycreator').'</strong>';\n ?>\n<div class=\"ecrFooter\">\n<span class=\"img icon-16-easycreator\">EasyCreator</span> <?php echo $version; ?> runs best on\n<a href=\"http://www.mozilla-europe.org/firefox/\" title=\"FireFox\" class=\"external\">\n<span class=\"img icon-16-firefox\">Firefox</span></a>\nand <a href=\"http://opensuse.org\" title=\"openSUSE\" class=\"external\">\n<span class=\"img icon-16-opensuse\">openSUSE</span></a> <br />\nMade and partially Copyright © 2008 - 2012 by <a\nhref=\"https://github.com/elkuku\"\n class=\"external\">El KuKu</a><br />\n<small> <em style=\"color: silver;\"><span class=\"img icon-16-joomla\"></span>\nEasyCreator is not affiliated with or endorsed by the <a\n href=\"http://joomla.org\" class=\"external\">Joomla! Project</a>. It is\nnot supported or warranted by the <a href=\"http://joomla.org\"\n class=\"external\">Joomla! Project</a> or <a\n href=\"http://opensourcematters.org/\" class=\"external\">Open Source\nMatters</a>.<br />\n <a\n href=\"http://www.joomla.org/about-joomla/the-project/conditional-use-logos.html\"\n class=\"external\">The Joomla! logo</a> is used under a limited license\ngranted by <a href=\"http://opensourcematters.org/\" class=\"external\">Open\nSource Matters</a> the trademark holder in the United States and other\ncountries.</em></small>\n</div>\n <?php\n\n if(defined('ECR_DEBUG') && ECR_DEBUG )\n {\n EcrDebugger::printSysVars('get');\n EcrDebugger::printSysVars('post');\n }\n\n echo NL.'<!-- EasyCreator END -->'.NL;\n }",
"private function getFooter(){\n\t$out = <<<EOT\n </body>\n </text>\n</TEI>\nEOT;\n\treturn $out;\t\n}",
"function adminFooter()\n {\n return \"\";\n }",
"public function my_footer_version()\n {\n return '';\n }",
"public function getFooter()\n {\n return $this->getValue('nb_catalog_item_lang_footer');\n }",
"private function printFooter()\n {\n // Nothing to do at the moment\n }",
"function display_portal_footer()\r\n {\r\n Display :: footer();\r\n }",
"function get_footer($content = null, $args = null){\n\trequire_once(GENERAL_DIR.'footer.php');\n}",
"function Get_Standard_Bottom_Section_HTML()\n {\n $HTML = \"\";\n //$HTML .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $HTML .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $HTML .= \"</div>\";\n $HTML .= Get_File_Contents(__DIR__.\"/../../static_html/standard_footer.html\");\n return $HTML;\n }",
"public static function getFooter()\n {\n return self::$_footer;\n }",
"public function get_foot()\n\t{\n\t\treturn $this->footer_item;\n\t}",
"function display_analyzer_footer() {\n $mysql_version = mysql_get_server_info();\n $php_os = PHP_OS;\n $p_blog_version = P_BLOG_VERSION;\n $analyzer_footer =<<<EOD\n\n</div>\n<!-- Begin #footer -->\n<div id=\"footer\">\n<address>\nPowered by {$_SERVER['SERVER_SOFTWARE']} & MySQL-{$mysql_version} running on {$php_os}<br />\nPowered by P_BLOG ver.{$p_blog_version}\n</address>\n</div><!-- End #footer -->\n</div><!-- End #wrapper -->\n</body>\n</html>\nEOD;\n return $analyzer_footer;\n}",
"function opinionstage_settings_load_footer(){\n}",
"function footer() {\n\t?>\n\t\t\t\t<div class=\"headfoot\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t"Remember The Cow is nice, but it's a total copy of another site." - PCWorld<br />\n\t\t\t\t\t\tAll pages and content © Copyright CowPie Inc.\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<div id=\"w3c\">\n\t\t\t\t\t\t<a href=\"https://webster.cs.washington.edu/validate-html.php\">\n\t\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/w3c-html.png\" alt=\"Valid HTML\" /></a>\n\t\t\t\t\t\t<a href=\"https://webster.cs.washington.edu/validate-css.php\">\n\t\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/w3c-css.png\" alt=\"Valid CSS\" /></a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</body>\n\t\t</html>\n\t<?php\n\t}",
"protected function generatePageFooter() \n {\n\t\t\n\t\techo \"</body>\\n\";\n\t\techo \"</html>\\n\";\n // to do: output common end of HTML code\n }"
] |
[
"0.749995",
"0.7425179",
"0.7425179",
"0.7322055",
"0.7295061",
"0.70357466",
"0.6983772",
"0.6900347",
"0.6876386",
"0.6876259",
"0.68665236",
"0.68665236",
"0.6859025",
"0.6838987",
"0.6832419",
"0.68166435",
"0.68113494",
"0.6807563",
"0.6787819",
"0.673798",
"0.67307687",
"0.6729171",
"0.67276984",
"0.6720067",
"0.67189264",
"0.6716208",
"0.6685652",
"0.66635936",
"0.66587913",
"0.6624585"
] |
0.80267286
|
0
|
Get the URI template expander used by the client. A default UriTemplate object will be created if one does not exist.
|
public function getUriTemplate()
{
if (!$this->uriTemplate) {
$this->uriTemplate = new UriTemplate();
}
return $this->uriTemplate;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function uriKey()\n {\n return 'temply-pages-templates';\n }",
"public function getTemplate();",
"public function getTemplate();",
"public function getTemplate();",
"public function getTemplate();",
"public function getTemplate();",
"public function getTemplate();",
"public function getTemplate() {}",
"public function getRemoteCallUrlTemplate() {\n\t\tif (is_null($this->remoteCallUrlTemplate)) {\n\t\t\t$this->remoteCallUrlTemplate = Mage::getStoreConfig('dev/aoe_templatehints/remoteCallUrlTemplate');\n\t\t}\n\t\treturn $this->remoteCallUrlTemplate;\n\t}",
"function astra_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound\n\t_deprecated_function( __FUNCTION__, '3.6.2', 'astra_addon_get_template()' );\n\treturn astra_addon_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' );\n}",
"public function getBaseUrl($expand = true)\n {\n return $expand ? $this->expandTemplate($this->baseUrl) : $this->baseUrl;\n }",
"private function getBaseUri(): UriInterface\n {\n return $this->uriFactory->createUri($this->getEndpoint());\n }",
"public function getUriFactory(): UriFactory;",
"function getTemplate();",
"protected function getTemplate_Twig_Extensions_RoutingService()\n {\n return $this->services['template.twig.extensions.routing'] = new \\phpbb\\template\\twig\\extension\\routing(${($_ = isset($this->services['routing.helper']) ? $this->services['routing.helper'] : $this->getRouting_HelperService()) && false ?: '_'});\n }",
"public function getTemplateHelper(){\n if( $this->_flexryTemplateHelper === null ){\n $templateHandle = $this->currentTemplateHandle();\n if( empty($templateHandle) ){\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup(self::TEMPLATE_DEFAULT_HANDLE, self::templateDefaultPath(), $this->parsedTemplateData() );\n }else{\n $templatesList = $this->templateAndDirectoryList();\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup($templateHandle, $templatesList[$templateHandle], $this->parsedTemplateData() );\n }\n }\n return $this->_flexryTemplateHelper;\n }",
"public function expand(array $params = []) : string\n {\n return $this->getUriTemplate()->expand($this->template, $params);\n }",
"public function getTemplateUrl()\n {\n return WP::applyFilters('wpmvc_template_url', $this->templateUrl);\n }",
"abstract public function getTemplate();",
"public function uri()\n {\n return $this->factory->getUri($this->handle);\n }",
"public function getTemplatePath()\n {\n return $this->document->documentURI;\n }",
"public function getTemplate(): string;",
"public function getTemplate(): string;",
"public function getTemplate(): string;",
"public function getTemplate(): string;",
"public function expandTemplate($template, array $variables = null)\n {\n $expansionVars = $this->getConfig()->getAll();\n if ($variables) {\n $expansionVars = array_merge($expansionVars, $variables);\n }\n\n return $this->getUriTemplate()\n ->setTemplate($template)\n ->expand($expansionVars);\n }",
"public function getGetTemplateResourceURLResult()\n {\n return isset($this->GetTemplateResourceURLResult) ? $this->GetTemplateResourceURLResult : null;\n }",
"protected function makeDefaultTemplatePath()\n {\n $urlRole = \\Bs\\Uri::create()->getRoleType($this->getConfig()->getAvailableUserRoleTypes());\n if (!$urlRole) $urlRole = 'public';\n return $this->getConfig()->getSitePath() . $this->getConfig()->get('template.'.$urlRole);\n }",
"public function template()\n {\n return $this->getView('flagrow.download.templates::image-preview');\n }",
"function get_template()\n {\n }"
] |
[
"0.5726032",
"0.52961725",
"0.52961725",
"0.52961725",
"0.52961725",
"0.52961725",
"0.52961725",
"0.5271927",
"0.52608323",
"0.5205318",
"0.5191102",
"0.51728976",
"0.5155659",
"0.5110591",
"0.50490195",
"0.5043915",
"0.50390244",
"0.5038304",
"0.5030683",
"0.5030447",
"0.5030058",
"0.5024997",
"0.5024997",
"0.5024997",
"0.5024997",
"0.50128764",
"0.5012291",
"0.4990957",
"0.49578115",
"0.49265847"
] |
0.702943
|
0
|
Set a curl multi object to be used internally by the client for transferring requests.
|
public function setCurlMulti(CurlMultiInterface $curlMulti)
{
$this->curlMulti = $curlMulti;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function __construct($multi = null)\n {\n $this->_multi = $multi ? $multi : new \\Bronto\\StandardResource\\Proxy('curl_multi_');\n $this->_multi->addExcluded('getcontent');\n $this->_multi->init();\n }",
"private function openMultiChannel(&$multiChannel)\n\t{\n\t\t$multiChannel = curl_multi_init();\n\t}",
"public function getCurlMulti()\n {\n if (!$this->curlMulti) {\n $this->curlMulti = CurlMulti::getInstance();\n }\n\n return $this->curlMulti;\n }",
"private function createMutliHandle()\n {\n if ($this->multiHandle && is_resource($this->multiHandle)) {\n curl_multi_close($this->multiHandle);\n }\n\n $this->multiHandle = curl_multi_init();\n\n // @codeCoverageIgnoreStart\n if ($this->multiHandle === false) {\n throw new CurlException('Unable to create multi handle');\n }\n // @codeCoverageIgnoreEnd\n }",
"protected function initCurlMultiHandle()\n {\n $this->multiHandle = curl_multi_init();\n // @codeCoverageIgnoreStart\n if ($this->multiHandle === false) {\n throw new CurlException('Unable to create multi handle');\n }\n // @codeCoverageIgnoreEnd\n }",
"private function initCurl()\n {\n $this->curlObj = curl_init();\n curl_setopt_array($this->curlObj, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_FORBID_REUSE => true,\n CURLOPT_HEADER => false,\n CURLOPT_TIMEOUT => 120,\n CURLOPT_CONNECTTIMEOUT => 2,\n CURLOPT_HTTPHEADER => [\"Connection: Keep-Alive\", \"Keep-Alive: 120\"]\n ));\n }",
"function __construct($urls) {\n\t\t$mh = curl_multi_init();\n\t\tforeach ($urls as $i => $url) {\n\t\t\t$ch[$i] = curl_init($url);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_HEADER, TRUE);\n\t\t\tcurl_multi_add_handle($mh, $ch[$i]);\n\t\t}\n\n\t\t$active = NULL;\n\t\t// Start performing the request\n\t\tdo {\n\t\t\t$mrc = curl_multi_exec($mh, $active);\n\t\t} while ($mrc == CURLM_CALL_MULTI_PERFORM);\n\n\t\t// Loop and continue processing the request\n\t\twhile ($active && $mrc == CURLM_OK) {\n\t\t\t// Wait forever for network\n\n\t\t\tif (curl_multi_select($mh) == -1) {\n\t\t\t\tusleep(1);\n\t\t\t}\n\t\t\tdo {\n\t\t\t\t$mrc = curl_multi_exec($mh, $active);\n\t\t\t} while ($mrc == CURLM_CALL_MULTI_PERFORM);\n\t\t}\n\n\t\t// Check for any errors\n\t\tif ($mrc != CURLM_OK) {\n\t\t\ttrigger_error(\"Curl multi read error $mrc\\n\", E_USER_WARNING);\n\t\t}\n\n\t\t// Extract the content\n\t\tforeach ($urls as $i => $url) {\n\t\t\t// Check for errors\n\t\t\t$curlError = curl_error($ch[$i]);\n\t\t\tif ($curlError == '') {\n\t\t\t\t$response[$i] = curl_multi_getcontent($ch[$i]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$message = \"Curl error on handle $i: $curlError\";\n\t\t\t\twatchdog('mendeley', $message, NULL, WATCHDOG_ERROR);\n\t\t\t\t$response[$i] = 'error';\n\t\t\t}\n\t\t\t// Remove and close the handle\n\t\t\tcurl_multi_remove_handle($mh, $ch[$i]);\n\t\t\tcurl_close($ch[$i]);\n\t\t}\n\t\t// Clean up the curl_multi handle\n\t\tcurl_multi_close($mh);\n\n\t\t// Return the response data.\n\t\t$this->response = $response;\n\t}",
"public function __construct()\n {\n $this->mc_handle = curl_multi_init();\n\n $this->node_storage = new \\SplObjectStorage;\n\n $this->request_queue = new \\SplQueue;\n $this->request_queue->setIteratorMode(\\SplDoublyLinkedList::IT_MODE_DELETE);\n\n $this->result_queue = new \\SplQueue;\n $this->result_queue->setIteratorMode(\\SplDoublyLinkedList::IT_MODE_DELETE);\n }",
"static private function setHTTPClient() {\n self::$handler = new \\GuzzleHttp\\Handler\\CurlMultiHandler();\n self::$http = new \\GuzzleHttp\\Client(array(\n 'handler' => \\GuzzleHttp\\HandlerStack::create(self::$handler)\n ));\n }",
"private function getDataMulti($url, $multi, $debug = false) {\n // look for parralel cURLing http://php.net/manual/en/function.curl-multi-exec.php\n $max = self::ajaxMulti;\n $_useragent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';\n $this->adata = array();\n $_chunks = array_chunk($multi, $max, true);\n foreach($_chunks as $_k => $_chunk) {\n $this->mhandle = curl_multi_init();\n $this->debug('Curl: start parallel with chunk-' . ($_k + 1) .'/'.count($_chunks).' of ' . count($multi) . '/' . $max . ' requests!');\n $_handles = array();\n foreach($_chunk as $key => $data) {\n $_handles[$key] = curl_init($key);\n curl_setopt($_handles[$key], CURLOPT_USERAGENT, $_useragent);\n curl_setopt($_handles[$key], CURLOPT_URL, $url);\n curl_setopt($_handles[$key], CURLOPT_CONNECTTIMEOUT, self::ajaxTimeout); // Timeout if it takes too long\n curl_setopt($_handles[$key], CURLOPT_VERBOSE, $debug);\n curl_setopt($_handles[$key], CURLOPT_RETURNTRANSFER, true); // Don't echo output\n curl_setopt($_handles[$key], CURLOPT_HTTPHEADER, array (\"Accept-Encoding: gzip,deflate\", \"Content-Type: application/json; charset=utf-8\", \"Cache-Control: no-cache\", \"Pragma: no-cache\", \"X-Qooxdoo-Response-Type: application/json\")); // Make it an ajax request\n curl_setopt($_handles[$key], CURLOPT_POST, true); // Make it post, not get.\n curl_setopt($_handles[$key], CURLOPT_POSTFIELDS, json_encode($data)); // Encode JS stuff.\n curl_setopt($_handles[$key], CURLOPT_COOKIEFILE, PERM_DATA.'cookies.txt');\n curl_setopt($_handles[$key], CURLOPT_COOKIEJAR, PERM_DATA.'cookies.txt');\n curl_multi_add_handle($this->mhandle, $_handles[$key]);\n }\n $active = null; \n //execute the handles\n do {\n $status = curl_multi_exec($this->mhandle, $active);\n } while ($status === CURLM_CALL_MULTI_PERFORM || $active);\n foreach ($_handles as $key => $_handle) {\n $this->adata[$key] = curl_multi_getcontent($_handle);\n curl_multi_remove_handle($this->mhandle, $_handle);\n curl_close($_handle); \n }\n curl_multi_close($this->mhandle);\n }\n return $this->adata;\n }",
"protected function _setCurlOpts() {\n $this->_setCurlOptArray($this->_getCurlOpts());\n }",
"function __construct($urls)\r\n\t\t\t\t {\r\n\t\t\t\t\t$mh = curl_multi_init();\r\n\t\t\t\t\tforeach($urls as $i => $url)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t $ch[$i] = curl_init($url);\r\n\r\n\t\t\t\t\t curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\r\n\t\t\t\t\t curl_setopt($ch[$i], CURLOPT_TIMEOUT, 120);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t curl_multi_add_handle($mh, $ch[$i]);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Start performing the request\r\n\t\t\t\t\tdo {\r\n\t\t\t\t\t\t$execReturnValue = curl_multi_exec($mh, $runningHandles);\r\n\t\t\t\t\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\r\n\t\t\t\t\t// Loop and continue processing the request\r\n\t\t\t\t\twhile ($runningHandles && $execReturnValue == CURLM_OK) {\r\n\t\t\t\t\t // Wait forever for network\r\n\t\t\t\t\t $numberReady = curl_multi_select($mh);\r\n\t\t\t\t\t if ($numberReady != -1) {\r\n\t\t\t\t\t\t// Pull in any new data, or at least handle timeouts\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t $execReturnValue = curl_multi_exec($mh, $runningHandles);\r\n\t\t\t\t\t\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Check for any errors\r\n\t\t\t\t\tif ($execReturnValue != CURLM_OK) {\r\n\t\t\t\t\t trigger_error(\"Curl multi read error $execReturnValue\\n\", E_USER_WARNING);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Extract the content\r\n\t\t\t\t\tforeach($urls as $i => $url)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t // Check for errors\r\n\t\t\t\t\t $curlError = curl_error($ch[$i]);\r\n\t\t\t\t\t if($curlError == \"\") {\r\n\t\t\t\t\t\t$res[$i] = curl_multi_getcontent($ch[$i]);\r\n\t\t\t\t\t } else {\r\n\t\t\t\t\t\tprint \"Curl error on handle $i: $curlError\\n\";\r\n\t\t\t\t\t }\r\n\t\t\t\t\t // Remove and close the handle\r\n\t\t\t\t\t curl_multi_remove_handle($mh, $ch[$i]);\r\n\t\t\t\t\t curl_close($ch[$i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Clean up the curl_multi handle\r\n\t\t\t\t\tcurl_multi_close($mh);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Print the response data\r\n\t\t\t\t\t//print_r($res);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//echo \"<pre><div style='text-align: left'><br>Res:<br>\"; print_r(json_decode($res[0])); echo \"</div></pre>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->output = $res;\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t//return $res;\r\n\t\t\t\t\t\r\n\t\t\t\t }",
"public function setCurlOptions($option, $curlArray = [])\n {\n $this->curlOptions[$option] = $curlArray;\n }",
"function __construct($urls)\n {\n\t$mh = curl_multi_init();\n\tforeach( $urls as $i => $url ){\n\t $ch[$i] = curl_init($url);\n\t curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\n\t curl_multi_add_handle($mh, $ch[$i]);\n\t}\n\n\t// Start performing the request\n\tdo {\n\t\t$execReturnValue = curl_multi_exec($mh, $runningHandles);\n\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\n\t// Loop and continue processing the request\n\twhile ($runningHandles && $execReturnValue == CURLM_OK) {\n\t // Wait forever for network\n\t $numberReady = curl_multi_select($mh);\n\t if ($numberReady != -1) {\n\t\t// Pull in any new data, or at least handle timeouts\n\t\tdo {\n\t\t $execReturnValue = curl_multi_exec($mh, $runningHandles);\n\t\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\n\t }\n\t}\n\n\t// Check for any errors\n\tif ($execReturnValue != CURLM_OK) {\n\t trigger_error(\"Curl multi read error $execReturnValue\\n\", E_USER_WARNING);\n\t}\n\n\t// Extract the content\n\tforeach( $urls as $i => $url ) {\n\t // Check for errors\n\t $curlError = curl_error($ch[$i]);\n\t if( $curlError == \"\" ) {\n\t\t$res[$i] = curl_multi_getcontent($ch[$i]);\n\t } else {\n\t \treturn false\n\t }\n\t // Remove and close the handle\n\t curl_multi_remove_handle($mh, $ch[$i]);\n\t curl_close($ch[$i]);\n\t}\n\t// Clean up the curl_multi handle\n\tcurl_multi_close($mh);\n }",
"private function setCurlOptions(&$ch, $headers = array())\n {\n curl_setopt($ch, CURLOPT_USERPWD, $this->authentication);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_BUFFERSIZE, 4096);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n }",
"public function setupCurlOptArray(array $ary){\n if($this->isCurlSet()){\n curl_setopt_array($this->curl, $ary);\n } else {\n throw new SdkException(\"cURL instance is not set when calling setup curl Option from array.\");\n }\n }",
"function __construct($urls){\n\t\t$mh = curl_multi_init();\n\t\tforeach($urls as $i => $url)\n\t\t{\t\t\t\n\t\t\t$ch[$i] = curl_init($url);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch[$i], CURLINFO_HEADER_OUT, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_HEADER, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_NOBODY, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_FOLLOWLOCATION, 1);\n\t\t\tcurl_multi_add_handle($mh, $ch[$i]);\n\t\t}\n\t\t\n\t\t// execute all queries simultaneously, and continue when all are complete\n\t\t$running = null;\n\t\tdo {\n\t\t\t$execReturnValue = curl_multi_exec($mh, $running);\n\t\t} while ($running);\n\t\t\n\t\t\n\t\t// Check for any errors\n\t\tif ($execReturnValue != CURLM_OK) {\n\t\t trigger_error(\"Curl multi read error $execReturnValue\\n\", E_USER_WARNING);\n\t\t}\n\t\t\n\t\t// Extract the content\n\t\tforeach($urls as $i => $url)\n\t\t{\n\t\t\t// Check for errors\n\t\t\t$curlError = curl_error($ch[$i]);\n\t\t\t\n\t\t\tif($curlError == \"\") {\n\t\t\t\t// If no errors, response header info is stored in array\n\t\t\t\t\n\t\t\t\t$this->urlResults[] = $this->parseURL($url, curl_getinfo($ch[$i]));\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Store cURL errors in array\n\t\t\t\t$this->errors[$url] = \"Curl error on handle $i: $curlError\";\n\t\t\t}\n\t\t\t\n\t\t\t// Remove and close the handle\n\t\t\tcurl_multi_remove_handle($mh, $ch[$i]);\n\t\t\tcurl_close($ch[$i]);\n\t\t}\n\t\t\n\t\t// Clean up the curl_multi handle\n\t\tcurl_multi_close($mh);\n\t\n\t}",
"public function set_curl_options(array $curl_options = array())\n {\n }",
"public function useCurl($useCurl)\n {\n $this->request->useCurl($useCurl);\n }",
"private function __setData($ch, $data = array())\n {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n }",
"private function fetch() {\n if ($this->curl instanceof MultiCurl) {\n $this->curl->complete(function($instance) {\n if ($instance->error) {\n $this->errors[] = [\n 'errorCode' => $instance->getErrorCode(),\n 'errorMessage' => $instance->getErrorMessage()\n ];\n } else {\n $this->headers[] = $instance->getResponseHeaders();\n $this->body[] = $instance->getResponse();\n }\n });\n } else {\n if ($this->curl->error) {\n $this->errors[] = [\n 'errorCode' => $this->curl->getErrorCode(),\n 'errorMessage' => $this->curl->getErrorMessage()\n ];\n } else {\n $this->headers = $this->curl->getResponseHeaders();\n $this->body = $this->curl->getResponse();\n }\n }\n\n return $this;\n }",
"function multiRequest($data, $options = array()) \n{\n\t$data = (array) $data;\n\n\t// array of curl handles\n\t$curly = array();\n\t// data to be returned\n\t$result = array();\n\n\t// multi handle\n\t$mh = curl_multi_init();\n\n\t// loop through $data and create curl handles\n\t// then add them to the multi-handle\n\tforeach ($data as $id => $d) {\n\n\t$curly[$id] = curl_init();\n\n\t$url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d;\n\tcurl_setopt($curly[$id], CURLOPT_URL, $url);\n\tcurl_setopt($curly[$id], CURLOPT_HEADER, 0);\n\tcurl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curly[$id], CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($curly[$id], CURLOPT_CONNECTTIMEOUT, 10);\n\n\t// post?\n\tif (is_array($d)) {\n\t if (!empty($d['post'])) {\n\t\tcurl_setopt($curly[$id], CURLOPT_POST, 1);\n\t\tcurl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']);\n\t }\n\t}\n\n\t// extra options?\n\tif (!empty($options)) {\n\t curl_setopt_array($curly[$id], $options);\n\t}\n\n\tcurl_multi_add_handle($mh, $curly[$id]);\n\t}\n\n\t// execute the handles\n\t$running = null;\n\tdo {\n\tcurl_multi_exec($mh, $running);\n\t} while($running > 0);\n\n\n\t// get content and remove handles\n\tforeach($curly as $id => $c) {\n\t$result[$id] = curl_multi_getcontent($c);\n\tcurl_multi_remove_handle($mh, $c);\n\t}\n\n\t// all done\n\tcurl_multi_close($mh);\n\n\treturn $result;\n}",
"public function setCurlOptions(array $options)\n {\n $this->curl_options = $options;\n\n // We need to reinitialize the SOAP client.\n $this->soap = null;\n }",
"private function init() {\n $this->_cm = curl_init();\n curl_setopt($this->_cm, CURLOPT_PROXY, $config['curl']['proxy']);\n curl_setopt($this->_cm, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_DIGEST);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($this->_cm, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($this->_cm, CURLOPT_TIMEOUT, $config['curl']['timeout']);\n curl_setopt($this->_cm, CURLOPT_POST, true); \n }",
"function multiRequest($data, $options = array()) {\n $curly = array();\n // data to be returned\n $result = array();\n // multi handle\n $mh = curl_multi_init();\n // loop through $data and create curl handles\n // then add them to the multi-handle\n foreach ($data as $id => $d) {\n $curly[$id] = curl_init();\n $url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d;\n curl_setopt($curly[$id], CURLOPT_URL,$url);\n curl_setopt($curly[$id], CURLOPT_HEADER,0);\n curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curly[$id], CURLOPT_SSL_VERIFYPEER,false);\n // Will return the response, if false it print the response\n curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER,true);\n // post?\n if (is_array($d)) {\n if (!empty($d['post'])) {\n curl_setopt($curly[$id], CURLOPT_POST,1);\n curl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']);\n }\n }\n // extra options?\n if (!empty($options)) {\n curl_setopt_array($curly[$id], $options);\n }\n curl_multi_add_handle($mh, $curly[$id]);\n }\n // execute the handles\n $running = null;\n $count=0;\n do {\n //echo $count++.\"\\n\";\n curl_multi_exec($mh, $running);\n } while($running > 0);\n\n // get content and remove handles\n foreach($curly as $id => $c) {\n $result[$id] = curl_multi_getcontent($c);\n curl_multi_remove_handle($mh, $c);\n }\n // all done\n curl_multi_close($mh);\n return $result;\n}",
"public function __construct() {\n $this->eventManager = new EventManager;\n $this->mh = curl_multi_init();\n }",
"public function setCurl(Curl $curl)\n {\n $this->curl = $curl;\n\n return $this;\n }",
"private function setUpCurl()\n {\n $this->curl = $this->get('app.curl.connector');\n $this->curl->setEndPointBaseUrl($this->getParameter('themoviedb_endpoint_url'));\n $this->curl->setExtraHeaders([\n CURLOPT_HEADER => false,\n CURLOPT_HTTPHEADER => [\"Accept: application/json\"],\n CURLOPT_SSL_VERIFYPEER => false\n ]);\n }",
"private function configureCurl ()\n {\n curl_setopt_array($this->cURL, [\n CURLOPT_URL => $this->url,\n CURLOPT_RETURNTRANSFER => true\n ]);\n }",
"public function curlMultiRequest($urls, $options = array()) {\r\n\t\t$ch = array();\r\n\t\t$results = array();\r\n\t\t$mh = curl_multi_init();\r\n\t\tforeach($urls as $key => $val) {\r\n\t\t\t$ch[$key] = curl_init();\r\n\t\t\tif ($options) {\r\n\t\t\t\tcurl_setopt_array($ch[$key], $options);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurl_setopt($ch[$key], CURLOPT_URL, $val);\r\n\t\t\tcurl_setopt($ch[$key], CURLOPT_RETURNTRANSFER, true);\r\n\t\t\t\r\n\t\t\tcurl_multi_add_handle($mh, $ch[$key]);\r\n\t\t}\r\n\t\t$running = null;\r\n\t\tdo {\r\n\t\t\tcurl_multi_exec($mh, $running);\r\n\t\t}\r\n\t\twhile ($running > 0);\r\n\t\t\r\n\t\t// Get content and remove handles.\r\n\t\tforeach ($ch as $key => $val) {\r\n\t\t\t$results[$key] = curl_multi_getcontent($val);\r\n\t\t\tcurl_multi_remove_handle($mh, $val);\r\n\t\t}\r\n\t\t\r\n\t\tcurl_multi_close($mh);\r\n\t\treturn $results;\r\n\t}"
] |
[
"0.69294846",
"0.6387808",
"0.628514",
"0.6220106",
"0.6140815",
"0.61172974",
"0.60815644",
"0.6019608",
"0.59868836",
"0.5969088",
"0.5963483",
"0.5911366",
"0.5864237",
"0.57684094",
"0.56982136",
"0.5677888",
"0.56300133",
"0.5629641",
"0.56283",
"0.5587437",
"0.55803484",
"0.55770063",
"0.5561662",
"0.5483492",
"0.5480504",
"0.5442496",
"0.5412751",
"0.54089797",
"0.5370706",
"0.5364401"
] |
0.7078626
|
0
|
Get the curl multi object used with the client
|
public function getCurlMulti()
{
if (!$this->curlMulti) {
$this->curlMulti = CurlMulti::getInstance();
}
return $this->curlMulti;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function multiRequest($data, $options = array()) \n{\n\t$data = (array) $data;\n\n\t// array of curl handles\n\t$curly = array();\n\t// data to be returned\n\t$result = array();\n\n\t// multi handle\n\t$mh = curl_multi_init();\n\n\t// loop through $data and create curl handles\n\t// then add them to the multi-handle\n\tforeach ($data as $id => $d) {\n\n\t$curly[$id] = curl_init();\n\n\t$url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d;\n\tcurl_setopt($curly[$id], CURLOPT_URL, $url);\n\tcurl_setopt($curly[$id], CURLOPT_HEADER, 0);\n\tcurl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curly[$id], CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($curly[$id], CURLOPT_CONNECTTIMEOUT, 10);\n\n\t// post?\n\tif (is_array($d)) {\n\t if (!empty($d['post'])) {\n\t\tcurl_setopt($curly[$id], CURLOPT_POST, 1);\n\t\tcurl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']);\n\t }\n\t}\n\n\t// extra options?\n\tif (!empty($options)) {\n\t curl_setopt_array($curly[$id], $options);\n\t}\n\n\tcurl_multi_add_handle($mh, $curly[$id]);\n\t}\n\n\t// execute the handles\n\t$running = null;\n\tdo {\n\tcurl_multi_exec($mh, $running);\n\t} while($running > 0);\n\n\n\t// get content and remove handles\n\tforeach($curly as $id => $c) {\n\t$result[$id] = curl_multi_getcontent($c);\n\tcurl_multi_remove_handle($mh, $c);\n\t}\n\n\t// all done\n\tcurl_multi_close($mh);\n\n\treturn $result;\n}",
"function multiRequest($data, $options = array()) {\n $curly = array();\n // data to be returned\n $result = array();\n // multi handle\n $mh = curl_multi_init();\n // loop through $data and create curl handles\n // then add them to the multi-handle\n foreach ($data as $id => $d) {\n $curly[$id] = curl_init();\n $url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d;\n curl_setopt($curly[$id], CURLOPT_URL,$url);\n curl_setopt($curly[$id], CURLOPT_HEADER,0);\n curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curly[$id], CURLOPT_SSL_VERIFYPEER,false);\n // Will return the response, if false it print the response\n curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER,true);\n // post?\n if (is_array($d)) {\n if (!empty($d['post'])) {\n curl_setopt($curly[$id], CURLOPT_POST,1);\n curl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']);\n }\n }\n // extra options?\n if (!empty($options)) {\n curl_setopt_array($curly[$id], $options);\n }\n curl_multi_add_handle($mh, $curly[$id]);\n }\n // execute the handles\n $running = null;\n $count=0;\n do {\n //echo $count++.\"\\n\";\n curl_multi_exec($mh, $running);\n } while($running > 0);\n\n // get content and remove handles\n foreach($curly as $id => $c) {\n $result[$id] = curl_multi_getcontent($c);\n curl_multi_remove_handle($mh, $c);\n }\n // all done\n curl_multi_close($mh);\n return $result;\n}",
"function curl_fetch_multi($urlArr=array(), $options=array()) {\n\t// 创建curl_multi句柄\n\t$mh = curl_multi_init();\n\t\n\t$res = array();\n\t$handleArr = array();\n\t\n\tforeach ($urlArr as $k => $url) {\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt_array($ch, $options);\n\t\tcurl_multi_add_handle($mh, $ch);\n\t\t$handleArr[$k] = $ch;\n\t}\n\t\n\tdo {\n\t\t$mrc = curl_multi_exec($mh, $active);\n\t} while($mrc == CURLM_CALL_MULTI_PERFORM);\n\t\n\twhile($active && $mrc == CURLM_OK) {\n\t\tif(curl_multi_select($mh) != -1) usleep(100);\n\t\tdo {\n\t\t\t$mrc = curl_multi_exec($mh, $active);\n\t\t} while($mrc == CURLM_CALL_MULTI_PERFORM);\n\t}\n\t\n\tforeach($handleArr as $k => $ch) {\n\t\t$res[$k] = curl_multi_getcontent($ch);\n\t\tcurl_multi_remove_handle($mh, $ch);\n\t\tcurl_close($ch);\n\t}\n\t\n\tcurl_multi_close($mh);\n\t\n\treturn $res;\n}",
"private function fetch() {\n if ($this->curl instanceof MultiCurl) {\n $this->curl->complete(function($instance) {\n if ($instance->error) {\n $this->errors[] = [\n 'errorCode' => $instance->getErrorCode(),\n 'errorMessage' => $instance->getErrorMessage()\n ];\n } else {\n $this->headers[] = $instance->getResponseHeaders();\n $this->body[] = $instance->getResponse();\n }\n });\n } else {\n if ($this->curl->error) {\n $this->errors[] = [\n 'errorCode' => $this->curl->getErrorCode(),\n 'errorMessage' => $this->curl->getErrorMessage()\n ];\n } else {\n $this->headers = $this->curl->getResponseHeaders();\n $this->body = $this->curl->getResponse();\n }\n }\n\n return $this;\n }",
"public function select()\n {\n return curl_multi_select( $this->mh );\n }",
"function __construct($urls) {\n\t\t$mh = curl_multi_init();\n\t\tforeach ($urls as $i => $url) {\n\t\t\t$ch[$i] = curl_init($url);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_HEADER, TRUE);\n\t\t\tcurl_multi_add_handle($mh, $ch[$i]);\n\t\t}\n\n\t\t$active = NULL;\n\t\t// Start performing the request\n\t\tdo {\n\t\t\t$mrc = curl_multi_exec($mh, $active);\n\t\t} while ($mrc == CURLM_CALL_MULTI_PERFORM);\n\n\t\t// Loop and continue processing the request\n\t\twhile ($active && $mrc == CURLM_OK) {\n\t\t\t// Wait forever for network\n\n\t\t\tif (curl_multi_select($mh) == -1) {\n\t\t\t\tusleep(1);\n\t\t\t}\n\t\t\tdo {\n\t\t\t\t$mrc = curl_multi_exec($mh, $active);\n\t\t\t} while ($mrc == CURLM_CALL_MULTI_PERFORM);\n\t\t}\n\n\t\t// Check for any errors\n\t\tif ($mrc != CURLM_OK) {\n\t\t\ttrigger_error(\"Curl multi read error $mrc\\n\", E_USER_WARNING);\n\t\t}\n\n\t\t// Extract the content\n\t\tforeach ($urls as $i => $url) {\n\t\t\t// Check for errors\n\t\t\t$curlError = curl_error($ch[$i]);\n\t\t\tif ($curlError == '') {\n\t\t\t\t$response[$i] = curl_multi_getcontent($ch[$i]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$message = \"Curl error on handle $i: $curlError\";\n\t\t\t\twatchdog('mendeley', $message, NULL, WATCHDOG_ERROR);\n\t\t\t\t$response[$i] = 'error';\n\t\t\t}\n\t\t\t// Remove and close the handle\n\t\t\tcurl_multi_remove_handle($mh, $ch[$i]);\n\t\t\tcurl_close($ch[$i]);\n\t\t}\n\t\t// Clean up the curl_multi handle\n\t\tcurl_multi_close($mh);\n\n\t\t// Return the response data.\n\t\t$this->response = $response;\n\t}",
"private function getDataMulti($url, $multi, $debug = false) {\n // look for parralel cURLing http://php.net/manual/en/function.curl-multi-exec.php\n $max = self::ajaxMulti;\n $_useragent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';\n $this->adata = array();\n $_chunks = array_chunk($multi, $max, true);\n foreach($_chunks as $_k => $_chunk) {\n $this->mhandle = curl_multi_init();\n $this->debug('Curl: start parallel with chunk-' . ($_k + 1) .'/'.count($_chunks).' of ' . count($multi) . '/' . $max . ' requests!');\n $_handles = array();\n foreach($_chunk as $key => $data) {\n $_handles[$key] = curl_init($key);\n curl_setopt($_handles[$key], CURLOPT_USERAGENT, $_useragent);\n curl_setopt($_handles[$key], CURLOPT_URL, $url);\n curl_setopt($_handles[$key], CURLOPT_CONNECTTIMEOUT, self::ajaxTimeout); // Timeout if it takes too long\n curl_setopt($_handles[$key], CURLOPT_VERBOSE, $debug);\n curl_setopt($_handles[$key], CURLOPT_RETURNTRANSFER, true); // Don't echo output\n curl_setopt($_handles[$key], CURLOPT_HTTPHEADER, array (\"Accept-Encoding: gzip,deflate\", \"Content-Type: application/json; charset=utf-8\", \"Cache-Control: no-cache\", \"Pragma: no-cache\", \"X-Qooxdoo-Response-Type: application/json\")); // Make it an ajax request\n curl_setopt($_handles[$key], CURLOPT_POST, true); // Make it post, not get.\n curl_setopt($_handles[$key], CURLOPT_POSTFIELDS, json_encode($data)); // Encode JS stuff.\n curl_setopt($_handles[$key], CURLOPT_COOKIEFILE, PERM_DATA.'cookies.txt');\n curl_setopt($_handles[$key], CURLOPT_COOKIEJAR, PERM_DATA.'cookies.txt');\n curl_multi_add_handle($this->mhandle, $_handles[$key]);\n }\n $active = null; \n //execute the handles\n do {\n $status = curl_multi_exec($this->mhandle, $active);\n } while ($status === CURLM_CALL_MULTI_PERFORM || $active);\n foreach ($_handles as $key => $_handle) {\n $this->adata[$key] = curl_multi_getcontent($_handle);\n curl_multi_remove_handle($this->mhandle, $_handle);\n curl_close($_handle); \n }\n curl_multi_close($this->mhandle);\n }\n return $this->adata;\n }",
"function __construct($urls)\r\n\t\t\t\t {\r\n\t\t\t\t\t$mh = curl_multi_init();\r\n\t\t\t\t\tforeach($urls as $i => $url)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t $ch[$i] = curl_init($url);\r\n\r\n\t\t\t\t\t curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\r\n\t\t\t\t\t curl_setopt($ch[$i], CURLOPT_TIMEOUT, 120);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t curl_multi_add_handle($mh, $ch[$i]);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Start performing the request\r\n\t\t\t\t\tdo {\r\n\t\t\t\t\t\t$execReturnValue = curl_multi_exec($mh, $runningHandles);\r\n\t\t\t\t\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\r\n\t\t\t\t\t// Loop and continue processing the request\r\n\t\t\t\t\twhile ($runningHandles && $execReturnValue == CURLM_OK) {\r\n\t\t\t\t\t // Wait forever for network\r\n\t\t\t\t\t $numberReady = curl_multi_select($mh);\r\n\t\t\t\t\t if ($numberReady != -1) {\r\n\t\t\t\t\t\t// Pull in any new data, or at least handle timeouts\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t $execReturnValue = curl_multi_exec($mh, $runningHandles);\r\n\t\t\t\t\t\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Check for any errors\r\n\t\t\t\t\tif ($execReturnValue != CURLM_OK) {\r\n\t\t\t\t\t trigger_error(\"Curl multi read error $execReturnValue\\n\", E_USER_WARNING);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Extract the content\r\n\t\t\t\t\tforeach($urls as $i => $url)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t // Check for errors\r\n\t\t\t\t\t $curlError = curl_error($ch[$i]);\r\n\t\t\t\t\t if($curlError == \"\") {\r\n\t\t\t\t\t\t$res[$i] = curl_multi_getcontent($ch[$i]);\r\n\t\t\t\t\t } else {\r\n\t\t\t\t\t\tprint \"Curl error on handle $i: $curlError\\n\";\r\n\t\t\t\t\t }\r\n\t\t\t\t\t // Remove and close the handle\r\n\t\t\t\t\t curl_multi_remove_handle($mh, $ch[$i]);\r\n\t\t\t\t\t curl_close($ch[$i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Clean up the curl_multi handle\r\n\t\t\t\t\tcurl_multi_close($mh);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Print the response data\r\n\t\t\t\t\t//print_r($res);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//echo \"<pre><div style='text-align: left'><br>Res:<br>\"; print_r(json_decode($res[0])); echo \"</div></pre>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->output = $res;\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t//return $res;\r\n\t\t\t\t\t\r\n\t\t\t\t }",
"public function getCurl()\n {\n return $this->curl;\n }",
"function __construct($urls)\n {\n\t$mh = curl_multi_init();\n\tforeach( $urls as $i => $url ){\n\t $ch[$i] = curl_init($url);\n\t curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\n\t curl_multi_add_handle($mh, $ch[$i]);\n\t}\n\n\t// Start performing the request\n\tdo {\n\t\t$execReturnValue = curl_multi_exec($mh, $runningHandles);\n\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\n\t// Loop and continue processing the request\n\twhile ($runningHandles && $execReturnValue == CURLM_OK) {\n\t // Wait forever for network\n\t $numberReady = curl_multi_select($mh);\n\t if ($numberReady != -1) {\n\t\t// Pull in any new data, or at least handle timeouts\n\t\tdo {\n\t\t $execReturnValue = curl_multi_exec($mh, $runningHandles);\n\t\t} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\n\t }\n\t}\n\n\t// Check for any errors\n\tif ($execReturnValue != CURLM_OK) {\n\t trigger_error(\"Curl multi read error $execReturnValue\\n\", E_USER_WARNING);\n\t}\n\n\t// Extract the content\n\tforeach( $urls as $i => $url ) {\n\t // Check for errors\n\t $curlError = curl_error($ch[$i]);\n\t if( $curlError == \"\" ) {\n\t\t$res[$i] = curl_multi_getcontent($ch[$i]);\n\t } else {\n\t \treturn false\n\t }\n\t // Remove and close the handle\n\t curl_multi_remove_handle($mh, $ch[$i]);\n\t curl_close($ch[$i]);\n\t}\n\t// Clean up the curl_multi handle\n\tcurl_multi_close($mh);\n }",
"function get_url_async($data, $options = array()) {\r\n\t $curly = array();\r\n\t // data to be returned\r\n\t $result = array();\r\n\r\n\t // multi handle\r\n\t $mh = curl_multi_init();\r\n\r\n\t // loop through $data and create curl handles\r\n\t // then add them to the multi-handle\r\n\t foreach ($data as $id => $d) {\r\n\r\n\t\t$curly[$id] = curl_init();\r\n\r\n\t\t$url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d;\r\n\t\tcurl_setopt($curly[$id], CURLOPT_URL, $url);\r\n\t\tcurl_setopt($curly[$id], CURLOPT_HEADER, 0);\r\n\t\tcurl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, 1);\r\n\r\n\t\t// post?\r\n\t\tif (is_array($d)) {\r\n\t\t if (!empty($d['post'])) {\r\n\t\t\tcurl_setopt($curly[$id], CURLOPT_POST, 1);\r\n\t\t\tcurl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']);\r\n\t\t }\r\n\t\t}\r\n\r\n\t\t// extra options?\r\n\t\tif (!empty($options)) {\r\n\t\t curl_setopt_array($curly[$id], $options);\r\n\t\t}\r\n\r\n\t\tcurl_multi_add_handle($mh, $curly[$id]);\r\n\t }\r\n\r\n\t // execute the handles\r\n\t $running = null;\r\n\t do {\r\n\t\tcurl_multi_exec($mh, $running);\r\n\t } while($running > 0);\r\n\r\n\t // get content and remove handles\r\n\t foreach($curly as $id => $c) {\r\n\t\t$result[$id] = curl_multi_getcontent($c);\r\n\t\tcurl_multi_remove_handle($mh, $c);\r\n\t }\r\n\r\n\t // all done\r\n\t curl_multi_close($mh);\r\n\r\n\t return $result;\r\n\t}",
"public function curlMultiRequest($urls, $options = array()) {\r\n\t\t$ch = array();\r\n\t\t$results = array();\r\n\t\t$mh = curl_multi_init();\r\n\t\tforeach($urls as $key => $val) {\r\n\t\t\t$ch[$key] = curl_init();\r\n\t\t\tif ($options) {\r\n\t\t\t\tcurl_setopt_array($ch[$key], $options);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurl_setopt($ch[$key], CURLOPT_URL, $val);\r\n\t\t\tcurl_setopt($ch[$key], CURLOPT_RETURNTRANSFER, true);\r\n\t\t\t\r\n\t\t\tcurl_multi_add_handle($mh, $ch[$key]);\r\n\t\t}\r\n\t\t$running = null;\r\n\t\tdo {\r\n\t\t\tcurl_multi_exec($mh, $running);\r\n\t\t}\r\n\t\twhile ($running > 0);\r\n\t\t\r\n\t\t// Get content and remove handles.\r\n\t\tforeach ($ch as $key => $val) {\r\n\t\t\t$results[$key] = curl_multi_getcontent($val);\r\n\t\t\tcurl_multi_remove_handle($mh, $val);\r\n\t\t}\r\n\t\t\r\n\t\tcurl_multi_close($mh);\r\n\t\treturn $results;\r\n\t}",
"public function __construct($multi = null)\n {\n $this->_multi = $multi ? $multi : new \\Bronto\\StandardResource\\Proxy('curl_multi_');\n $this->_multi->addExcluded('getcontent');\n $this->_multi->init();\n }",
"public function getCurlOptions()\n {\n return $this->curlOptions;\n }",
"public function setCurlMulti(CurlMultiInterface $curlMulti)\n {\n $this->curlMulti = $curlMulti;\n\n return $this;\n }",
"function __construct($urls){\n\t\t$mh = curl_multi_init();\n\t\tforeach($urls as $i => $url)\n\t\t{\t\t\t\n\t\t\t$ch[$i] = curl_init($url);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch[$i], CURLINFO_HEADER_OUT, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_HEADER, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_NOBODY, 1);\n\t\t\tcurl_setopt($ch[$i], CURLOPT_FOLLOWLOCATION, 1);\n\t\t\tcurl_multi_add_handle($mh, $ch[$i]);\n\t\t}\n\t\t\n\t\t// execute all queries simultaneously, and continue when all are complete\n\t\t$running = null;\n\t\tdo {\n\t\t\t$execReturnValue = curl_multi_exec($mh, $running);\n\t\t} while ($running);\n\t\t\n\t\t\n\t\t// Check for any errors\n\t\tif ($execReturnValue != CURLM_OK) {\n\t\t trigger_error(\"Curl multi read error $execReturnValue\\n\", E_USER_WARNING);\n\t\t}\n\t\t\n\t\t// Extract the content\n\t\tforeach($urls as $i => $url)\n\t\t{\n\t\t\t// Check for errors\n\t\t\t$curlError = curl_error($ch[$i]);\n\t\t\t\n\t\t\tif($curlError == \"\") {\n\t\t\t\t// If no errors, response header info is stored in array\n\t\t\t\t\n\t\t\t\t$this->urlResults[] = $this->parseURL($url, curl_getinfo($ch[$i]));\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Store cURL errors in array\n\t\t\t\t$this->errors[$url] = \"Curl error on handle $i: $curlError\";\n\t\t\t}\n\t\t\t\n\t\t\t// Remove and close the handle\n\t\t\tcurl_multi_remove_handle($mh, $ch[$i]);\n\t\t\tcurl_close($ch[$i]);\n\t\t}\n\t\t\n\t\t// Clean up the curl_multi handle\n\t\tcurl_multi_close($mh);\n\t\n\t}",
"public function get_curl_object() {\n if (!is_null($this->curl)) {\n return $this->curl;\n }\n\n // Connection to Solr is allowed to use 'localhost' and other potentially blocked hosts/ports.\n $this->curl = new \\curl(['ignoresecurity' => true]);\n\n $options = array();\n // Build the SSL options. Based on pecl-solr and general testing.\n if (!empty($this->config->secure)) {\n if (!empty($this->config->ssl_cert)) {\n $options['CURLOPT_SSLCERT'] = $this->config->ssl_cert;\n $options['CURLOPT_SSLCERTTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_key)) {\n $options['CURLOPT_SSLKEY'] = $this->config->ssl_key;\n $options['CURLOPT_SSLKEYTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_keypassword)) {\n $options['CURLOPT_KEYPASSWD'] = $this->config->ssl_keypassword;\n }\n\n if (!empty($this->config->ssl_cainfo)) {\n $options['CURLOPT_CAINFO'] = $this->config->ssl_cainfo;\n }\n\n if (!empty($this->config->ssl_capath)) {\n $options['CURLOPT_CAPATH'] = $this->config->ssl_capath;\n }\n }\n\n // Set timeout as for Solr client.\n $options['CURLOPT_TIMEOUT'] = !empty($this->config->server_timeout) ? $this->config->server_timeout : '30';\n\n $this->curl->setopt($options);\n\n if (!empty($this->config->server_username) && !empty($this->config->server_password)) {\n $authorization = $this->config->server_username . ':' . $this->config->server_password;\n $this->curl->setHeader('Authorization: Basic ' . base64_encode($authorization));\n }\n\n return $this->curl;\n }",
"public function getCurl() {\r\n $curl = new Curl();\r\n $curl->setOption(CURLOPT_HTTPHEADER, array(\r\n 'Content-Type:application/json',\r\n 'Authorization:' . $this->passcode,\r\n 'X-Forwarded-Host:' . $_SERVER['HTTP_HOST'],\r\n 'X-Forwarded-For:' . $_SERVER['SERVER_ADDR'],\r\n 'Referer:' . NetHelper::getCurrentURL(),\r\n ));\r\n $curl->setOption(CURLOPT_TIMEOUT, 200);\r\n $curl->setOption(CURLOPT_CONNECTTIMEOUT, 200);\r\n // temporarily disables SSL verifying\r\n $curl->setOption(CURLOPT_SSL_VERIFYPEER, false);\r\n return $curl;\r\n }",
"private function initCurl() {\r\n\t\tif (isset($this->curl)) { return $this->curl; }\r\n\r\n\t\t$this->curl = curl_init();\r\n\r\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($this->curl, CURLOPT_TIMEOUT, $this->request_timeout);\r\n\r\n\t\tif (isset($this->cookie_jar)) {\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_COOKIEJAR, $this->cookie_jar);\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_COOKIEFILE, $this->cookie_jar);\r\n\t\t}\r\n\r\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, $this->is_multiple);\r\n\r\n\t\t# If a User Agent has been set, set the curl option\r\n\t\tif (isset($this->user_agent)) {\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\r\n\t\t}\r\n\r\n\t\t# We are not too concerned about the strictness of SSL when finding redirects\r\n\t\t# Without these, some SSL links just fail to return anything\r\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0); \r\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0); \r\n\r\n\t\t# We want the headers returned to us to follow redirects\r\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, true); \r\n\t\t$this->code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);\r\n\t\treturn $this->curl;\r\n\t}",
"public function ExecuteRequests()\n {\n $this->multiThreadHandler = curl_multi_init();\n \n $running = null;\n \n foreach ($this->curlSessions as &$curlSession)\n {\n $current = $curlSession->CurlResource;\n curl_multi_add_handle($this->multiThreadHandler, $current);\n }\n \n do\n {\n while(($execrun = curl_multi_exec($this->multiThreadHandler, $running)) == CURLM_CALL_MULTI_PERFORM);\n \n if ($execrun != CURLM_OK) throw new EasyCurlExecuterException(\"Check your internet connection\");\n \n while($done = curl_multi_info_read($this->multiThreadHandler))\n {\n foreach ($this->curlSessions as &$curlSession)\n {\n if ($curlSession->CurlResource === $done['handle'])\n {\n $response = curl_multi_getcontent($done['handle']);\n \n $resultResponse = new EasyCurlExecuterResult();\n \n if ($response != null && $response != FALSE && $response != \"\")\n {\n $resultResponse->Response = new EasyCurlResponse($done['handle'], $response);\n }\n else\n {\n $resultResponse->Response = new EasyCurlError($done['handle']);\n }\n \n $resultResponse->Url = $curlSession->Url;\n $resultResponse->UserState = $curlSession->UserObject;\n \n if ($curlSession->Callback != null)\n {\n $curlSession->Callback->Call($resultResponse);\n }\n \n if ($this->recordResults)\n $this->Results[] = $resultResponse;\n \n curl_multi_remove_handle($this->multiThreadHandler, $done['handle']);\n }\n }\n }\n\n if (!$running) break;\n \n while (($res = curl_multi_select($this->multiThreadHandler)) === 0);\n if ($res === false) throw new EasyCurlExecuterException(\"Encountered error while curl_multi_select\");\n }\n while (true);\n \n curl_multi_close($this->multiThreadHandler);\n \n array_splice($this->curlSessions, 0);\n }",
"private function curl($urls) {\n $chs = array();\n // for storing the reponses strings\n $contents = array();\n // loop through an array of URLs to initiate\n // one cUrl handler for each URL (request)\n foreach ($urls as $url) {\n $ch = curl_init($url);\n // tell cUrl option to return the response\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);\n $chs[] = $ch;\n }\n // initiate a multi handler\n $mh = curl_multi_init();\n // add all the single handler to a multi handler\n foreach($chs as $key => $ch){\n curl_multi_add_handle($mh,$ch);\n }\n // execute the multi cUrl handler\n do {\n $mrc = curl_multi_exec($mh, $active);\n } while ($mrc == CURLM_CALL_MULTI_PERFORM || $active);\n // retrieve the reponse from each single handler\n foreach($chs as $key => $ch){\n if(curl_errno($ch) == CURLE_OK){\n $contents[] = curl_multi_getcontent($ch);\n } else{\n echo \"Err>>> \".curl_error($ch).\"\\n\";\n }\n }\n curl_multi_close($mh);\n return $contents;\n }",
"public function access_curl(){\n\t\t$type = $this->_type;\n\n\t\tif($type == false){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tswitch($type) {\n\t\t\t\tcase 'domain':\n\t\t\t\t\treturn $this->_checkDomainCURL();\n\t\t\t\tbreak;\n\t\t\t\tcase 'data':\n\t\t\t\t\treturn $this->_ProcessDataCurl();\n\t\t\t\tbreak;\n\t\t\t\tcase 'slice':\n\t\t\t\t\treturn $this->_sliceCurlData();\n\t\t\t\tbreak;\n\t\t\t\tcase 'favicon':\n\t\t\t\t\treturn $this->_getFavicon();\n\t\t\t\tbreak;\n\t\t\t\tcase 'loop-favicon':\n\t\t\t\t\treturn $this->_loopFavicon();\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->_ProcessDataCurl();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"function execute()\n {\n if (count($this->calls)) {\n // kick off the requests\n\n do {\n\n $multi_exec_handle = curl_multi_exec($this->curl_parent, $active);\n } while ($active > 0);\n\n // after all requests finish, set errors and repsonses in $this->calls\n\n foreach ($this->calls as $key => $call) {\n\n $error = curl_error($this->calls[$key][\"curl\"]);\n if (!empty($error)) {\n $this->calls[$key][\"error\"] = $error;\n }\n $this->calls[$key][\"response\"] = curl_multi_getcontent($this->calls[$key][\"curl\"]);\n curl_multi_remove_handle($this->curl_parent, $this->calls[$key][\"curl\"]);\n }\n curl_multi_close($this->curl_parent);\n }\n\n return $this->calls;\n }",
"private function _multi_request( $rows, $options ) {\n\t\t$mh = curl_multi_init();\n\t\t$curls = array();\n\t\tforeach ( $rows as $row ) {\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'B' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'N' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$curls[ $row[ 'id' ] ] = curl_init();\n\n\t\t\t// Append URL\n\t\t\t$url = $row[ 'url' ];\n\t\t\tif ( $this->conf( Base::O_CRAWLER_DROP_DOMAIN ) ) {\n\t\t\t\t$url = $this->_crawler_conf[ 'base' ] . $row[ 'url' ];\n\t\t\t}\n\t\t\tcurl_setopt( $curls[ $row[ 'id' ] ], CURLOPT_URL, $url );\n\t\t\tDebug2::debug( '🐞 Crawling [url] ' . $url . ( $url == $row[ 'url' ] ? '' : ' [ori] ' . $row[ 'url' ] ) );\n\n\t\t\tcurl_setopt_array( $curls[ $row[ 'id' ] ], $options );\n\n\t\t\tcurl_multi_add_handle( $mh, $curls[ $row[ 'id' ] ] );\n\t\t}\n\n\t\t// execute curl\n\t\tif ( $curls ) {\n\t\t\t$last_start_time = null;\n\t\t\tdo {\n\t\t\t\tcurl_multi_exec( $mh, $last_start_time );\n\t\t\t\tif ( curl_multi_select( $mh ) == -1 ) {\n\t\t\t\t\tusleep( 1 );\n\t\t\t\t}\n\t\t\t} while ( $last_start_time > 0 );\n\t\t}\n\n\t\t// curl done\n\t\t$ret = array();\n\t\tforeach ( $rows as $row ) {\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'B' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'N' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$ch = $curls[ $row[ 'id' ] ];\n\n\t\t\t// Parse header\n\t\t\t$header_size = curl_getinfo( $ch, CURLINFO_HEADER_SIZE );\n\t\t\t$content = curl_multi_getcontent( $ch );\n\t\t\t$header = substr( $content, 0, $header_size );\n\n\t\t\t$ret[ $row[ 'id' ] ] = array(\n\t\t\t\t'header' => $header,\n\t\t\t\t'code'\t=> curl_getinfo( $ch, CURLINFO_HTTP_CODE ),\n\t\t\t);\n\n\t\t\tcurl_multi_remove_handle( $mh, $ch );\n\t\t\tcurl_close( $ch );\n\t\t}\n\t\tcurl_multi_close( $mh );\n\n\t\treturn $ret;\n\t}",
"private function sendMultiRequest($urls, $additionalCurlOptions)\n {\n $results = array();\n\n // array of curl handles\n $channels = array();\n\n // initialize the multihandler\n $mh = curl_multi_init();\n\n $active = 0;\n $urlIndex = 0;\n\n // Process Loop\n do {\n // Add to the in flight requests\n $numToAdd = $this->totalConcurrentRequests - $active;\n\n while ($numToAdd-- && $urlIndex < count($urls)) {\n $url = $urls[$urlIndex];\n // initiate individual channel\n $channel = curl_init($url);\n\n curl_setopt_array($channel, ($this->defaultCurlOptions() + $additionalCurlOptions));\n\n // add channel to multihandler\n curl_multi_add_handle($mh, $channel);\n\n $channels[$url] = $channel;\n $urlIndex++;\n }\n\n do {\n $mrc = curl_multi_exec($mh, $active);\n } while ($mrc === CURLM_CALL_MULTI_PERFORM);\n\n // This waits for more activity on the multi connection\n curl_multi_select($mh);\n\n // Check for responses\n while ($multiInfo = curl_multi_info_read($mh)) {\n $channel = $multiInfo['handle'];\n\n $content = curl_multi_getcontent($channel);\n if ($content) {\n $response = new \\StdClass;\n $response->status = curl_getinfo($channel, CURLINFO_HTTP_CODE);\n $response->body = curl_multi_getcontent($channel);\n\n $results[] = $response;\n }\n curl_multi_remove_handle($mh, $channel);\n curl_close($channel);\n }\n } while ($active > 0 || $urlIndex < count($urls));\n\n // close the multihandler\n curl_multi_close($mh);\n return $results;\n }",
"public function getCurlHandle()\n {\n return $this->mh;\n }",
"public function runAllRequests(): array\n {\n $running = null;\n do {\n $status = curl_multi_exec($this->multiHandle, $running);\n usleep(250000); // 0.25s\n } while ($status === CURLM_CALL_MULTI_PERFORM || $running);\n\n for($i=0, $iMax = count($this->handles); $i < $iMax; $i++) {\n $out = curl_multi_getcontent($this->handles[$i]);\n $data[$i] = $out; // json_decode($out, true);\n curl_multi_remove_handle($this->multiHandle, $this->handles[$i]);\n }\n// foreach ($this->handles as $i => $c) {\n// $out = curl_multi_getcontent($this->handles[$i]);\n// $data[$i] = json_decode($out, true);\n// curl_multi_remove_handle($this->multiHandle, $this->handles[$i]);\n// }\n curl_multi_close($this->multiHandle);\n return $data;\n }",
"public function setupCurl()\n {\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL,\"https://jsonplaceholder.typicode.com/posts\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n return $ch;\n }",
"private function initCurl()\n {\n $this->curlObj = curl_init();\n curl_setopt_array($this->curlObj, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_FORBID_REUSE => true,\n CURLOPT_HEADER => false,\n CURLOPT_TIMEOUT => 120,\n CURLOPT_CONNECTTIMEOUT => 2,\n CURLOPT_HTTPHEADER => [\"Connection: Keep-Alive\", \"Keep-Alive: 120\"]\n ));\n }",
"public function next()\n {\n if ($this->mc_count === 0) {\n return;\n }\n $execing = CURLM_CALL_MULTI_PERFORM;\n\n $running = 0;\n while (curl_multi_exec($this->mc_handle, $running) === $execing);\n\n if ($running > 0) {\n $was_running = $running;\n while ($was_running === $running) {\n curl_multi_select($this->mc_handle);\n while (curl_multi_exec($this->mc_handle, $running) === $execing);\n }\n }\n\n while ($msg = curl_multi_info_read($this->mc_handle)) {\n $ch = $msg['handle'];\n $result = $this->parseResponse($ch);\n\n $this->result_queue->enqueue($result);\n\n curl_multi_remove_handle($this->mc_handle, $ch);\n $this->mc_count--;\n\n if ($this->close_curl_handles) {\n curl_close($ch);\n }\n }\n\n // At least 1 request finished, so load more.\n if ($this->transferQueueToMulticurl()) {\n // and start them\n while (curl_multi_exec($this->mc_handle, $running) === $execing);\n }\n }"
] |
[
"0.6682251",
"0.6650737",
"0.64217716",
"0.6339052",
"0.6114879",
"0.6101976",
"0.6074952",
"0.6068205",
"0.5996279",
"0.59122795",
"0.57772523",
"0.5731051",
"0.57226634",
"0.5675175",
"0.56502235",
"0.56407255",
"0.5630532",
"0.5628347",
"0.55857766",
"0.55730176",
"0.55497134",
"0.5541524",
"0.55244625",
"0.55133396",
"0.5483362",
"0.5477087",
"0.5456298",
"0.54297596",
"0.54092455",
"0.53942364"
] |
0.76411784
|
0
|
Display a listing of pitches
|
public function index()
{
$pitches = Pitch::all();
return View::make('pitches.index', compact('pitches'));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function actionPitches()\n { \n\n $searchModel = new PitchSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination = [\n 'pageSize' => 10,\n ];\n\n return $this->render('pitches', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'keyword' => $searchModel->keyword,\n ]);\n }",
"public function show($id)\n\t{\n\t\t// \t\n\t\t$pitch=Pitch::find($id);\n\t\tif(!$pitch) {\n\t\t\tApp::abort(404);\n\t\t}\n\n\t\treturn View::make('pitches.show', compact('pitch'));\n\t}",
"public function listModesAction() {\n $this -> view -> assignMultiple([\n 'modes' => $GLOBALS['TYPO3_CONF_VARS'][\"EXTENSIONS\"][\"bw_tetris\"][\"modes\"],\n 'gamesleft' => $this -> highscoreRepository -> gamesLeft($GLOBALS['TSFE']->fe_user->user[\"uid\"] ?? 0),\n 'nextgame' => $this -> highscoreRepository -> nextGame($GLOBALS['TSFE']->fe_user->user[\"uid\"] ?? 0)\n ]);\n }",
"public function showpollsAction()\n {\n $polls = $this->getDoctrine()->getRepository('PollPollBundle:PollImpl')->findAll();\n return $this->render('PollPollBundle:Poll:show_polls.html.twig', array(\"polls\" => array_reverse($polls)));\n }",
"public function printlist(){\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\r\n\t\t$this->title = 'Media list';\t\t\r\n\t\treturn $this->renderWith(array('Media_printresults','Print'));\r\n\t}",
"private function listSpots() {\n $db = DB::getInstance();\n $tpl = new Template('poker');\n\n $spots = PokerSpot::getAll();\n\n foreach ($spots as $spot) {\n \tforeach ($spot->ranges as $key => $value) {\n\t \tif (is_array($value))\n\t \t\t$spot->ranges[$key] = implode(', ', $value);\n\t \telse\n\t \t\t$spot->ranges[$key] = '';\n\t }\n\t foreach ($spot->actions as $key => $value) {\n\t \t$value->player = $value->player+1;\n\t }\n\t $spot->button = $spot->button + 1; \n }\n \n $tpl->assign('spots', $spots);\n $tpl->assign('user', $this->s->user);\n\t\t$tpl->assign('call', $this->s->post['call']);\n $tpl->assign('permissions', array(\n \t'create' => $this->s->user->hasRights(\"poker:poker_spot-create\"), \n \t'delete' => $this->s->user->hasRights(\"poker:poker_spot-delete\"), \n \t'update' => $this->s->user->hasRights(\"poker:poker_spot-update\"), \n \t'update_own' => $this->s->user->hasRights(\"poker:poker_spot-own\")\n ));\n return $tpl->fetch('spots_table.html');\n }",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function getIndex()\n\t{\n\t\treturn View::make('pitch')->with('pitch', $this->pitch);\n\t}",
"protected function render() {\n\t\t$args = $this->get_settings_for_display();\n\t\t$args['url'] = $args['url']['url'];\n\t\t$args['disabled'] = $args['disabled'] == 'yes' ? true : false;\n\t\t$args['top_border'] = $args['top_border'] == 'yes' ? true : false;\n\n\t\techo list_item_shortcode($args);\n\t}",
"public function listing()\n {\n\t$special_abilities = SpecialAbility::all()->sortBy('name'); \n\t\n return view('special_abilities.list', ['special_abilities' => $special_abilities]);\n }",
"protected function render() {\r\n $settings = $this->get_settings_for_display(); \r\n\r\n if ( $settings['list'] ) { ?>\r\n\r\n <div class=\"DSMCA__slide swiper-container\">\r\n <div class=\"swiper-wrapper\"> \r\n <?php foreach ( $settings['list'] as $item ) : ?>\r\n <div class=\"DSMCA__item_slide swiper-slide\">\r\n <img class=\"DSMCA__item-image\" src=\" <?php echo $item['imagen']['url'] ?> \">\r\n <h5 class=\"DSMCA__item-title\"><?php echo $item['titulo'] ?></h5>\r\n </div>\r\n <?php endforeach; ?> \r\n </div>\r\n <div class=\"swiper-button-prev\"></div>\r\n <div class=\"swiper-button-next\"></div>\r\n </div>\r\n\r\n\r\n <?php }\r\n\t}",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionLst()\n {\n return $this->render('lst',\n [\n 'name'=>'王聪',\n 'age'=>18,\n ]);\n }",
"public function listing();",
"function showListing ($listType,$sort,$alevel){\n\t\tif($alevel == 0){$aonly = \"AND aonly='0'\";}\n\t\telse if ($alevel == 3){$aonly = \"AND aonly<='1'\";}\n\t\telse{$aonly = '';}\n\t\tif($sort == NULL)\n\t\t{\n\t\t\t$sql = \"SELECT UPPER(SUBSTRING(seriesName,1,1)) AS letter, id, fullSeriesName FROM series WHERE seriesList='$listType' \".$aonly.\"ORDER BY fullSeriesName\";\n\t\t}\n\t\telse {\n\t\t\t$sql = \"SELECT UPPER(SUBSTRING(seriesName,1,1)) AS letter, id, fullSeriesName FROM series WHERE seriesList='$listType' \".$aonly.\"AND category LIKE '%\".mysqli_real_escape_string($conn, $sort).\"%' ORDER BY seriesName\";\n\t\t}\n\t\t$query = mysqli_query ($sql) or die (mysqli_error());\n\t\t$total_rows = mysqli_num_rows($query) or die(\"Error: \". mysqli_error(). \" with query \". $query);\n\t\twhile ($records = @mysqli_fetch_array ($query)) {\n\t\t\t$alpha[$records['letter']] += 1;\n\t\t\t${$records['letter']}[$records['id']] = $records['fullSeriesName'];\n\t\t}\n\t\techo '<div align=\"center\">';\n\t\tforeach(range('A','Z') as $i) {\n\t\t\techo (array_key_exists (\"$i\", $alpha)) ? '<a href=\"#'.$i.'\" title=\"'.$alpha[\"$i\"].' results\">'.$i.'</a>' : \"$i\";\n\t\t\techo ($i != 'Z') ? ' | ':'';\n\t\t}\n\t\techo '</div><br />';\n\t\t// Create Data Listing\n\t\t$countup = 1;\n\t\t$columncount = 1; \n\t\t$col = 2;\n\t\techo \"<div id=\\\"col1\\\">\\n\";\n\t\tfloor($total_rows/3);\n\t\tforeach(range('A','Z') as $i) {\n\t\t\tif (array_key_exists (\"$i\", $alpha)) {\n\t\t\t\techo '\t\t<a name=\"'.$i.'\"></a><h2>'.$i.\"</h2>\\n\";\n\t\t\t\tforeach ($$i as $key=>$value) {\n\t\t\t\t\techo \"\t\t<div>\".checkSeriesWIconsV2($key).\"</div>\\n\";\n\t\t\t\t\t$countup++;\n\t\t\t\t\tif($countup == (floor($total_rows/3)) || $countup == (floor(($total_rows/3)*2)) || $countup == (floor(($total_rows/3)*3)) || $countup == floor(($total_rows/3)*4))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($columncount == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\techo \"\t\t\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\techo \"\t\t</div>\\n\";\n\t\t\t\t\t\t\tif($columncount == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo \"\t\t<div id=\\\"col2outer\\\">\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo \"\t\t<div id=\\\"col$col\\\">\\n\";\n\t\t\t\t\t\t\t$columncount++;\n\t\t\t\t\t\t\t$col++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo \"\t\t<br />\\n\";\n\t\t\t}\n\t\t}\n\t\techo '</div></div></div>';\n\t}",
"function listing() {\r\n\r\n }",
"function show_list()\n\t{\n\t\t$out = $this->get_value_list();\n\t\treturn $out;\n\t}",
"function wpsight_sylt_listings_slider( $listings = array(), $args = array() ) {\n\techo wpsight_sylt_get_listings_slider( $listings, $args );\n}",
"function lists()\n {\n $data[\"data\"] = $this->RapatModel->get();\n $this->load->view('rapat/lists', $data);\n }",
"public function adminIndexListPlat()\n {\n $plat = Plat::paginate(10);\n return view('admin.list.plat', compact('plat'));\n }",
"public function show_slider_detail()\n\t{\n\t\t$sql=\"select * from slider\";\n\t\t$result=$this->db->query($sql);\n\t\twhile($data=$result->fetch_array())\n\t\t{\n\t\t\techo \"<li><h3>$data[title]</h3><p>$data[description]</p></li>\";\n\t\t}\n\t}",
"public function index()\n {\n $plates=Plate::all()->sortBy('ptype_id');\n $ptypes=Ptype::pluck('name','id')->all();\n $pstates=Pstate::pluck('name','id')->all();\n return view('Manager.Plates.index',compact('plates','ptypes','pstates'));\n }",
"public function show(Plates $plates){\n }",
"function poll_list()\n\t{\n\t \t\t $where =\"1 = 1 order by id desc \";\n\t\t\t $rs = safe_rows_start('*' , 'txp_poll' , $where);\t\n\t echo n.'<div style=\"margin: .3em auto auto auto; text-align: center;\">';\n\t\techo n.'<h3>Select a poll to edit or delete. </h3><p><a href=\"?event=poll_prefs&step=new_select\" >'.poll_gTxt('add_new_poll').'</a>.</p><br />'; \n\t\techo n.n.startTable('list');\n\n\t\tif ($rs and numRows($rs) > 0)\n\t\t{\n\t\t\techo assHead('id', 'name', poll_gTxt('poll_prompt') , 'edit', 'delete', '', '');\n\n\t\t\twhile ($a = nextRow($rs))\n\t\t\t{\n\t\t\t\tforeach ($a as $key => $value) {\n\t\t\t\t\t$$key = htmlspecialchars($value);\n\t\t\t\t}\n\t\t\t\techo tr(\n\n\t\t\t\t\tn.td($id).\n\t\t\t\t\ttd($name).\n\t\t\t\t\ttd($prompt).\n\n\t\t\t\t\ttd(\n\t\t\t\t\teLink('poll_prefs', 'edit_select', 'poll_id', $id, gTxt('edit').' › '.$name)\n\t\t\t\t\t).\n\n\t\t\t\t\ttd(\n\t\t\t\t dLink('poll_prefs', 'delete_select', 'poll_id', $id)\n\t\t\t\t\t,30)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\techo endTable();\n\t echo '</div>';\n\t}",
"public function index()\n {\n $portInfo = SwitchportInformation::with('networkdevice')->paginate(25);\n\n return view('switchport_informations.index', compact('portInfo'));\n }",
"public function index()\n {\n $tests = $this->getAllTests();\n return view('poll.index', ['tests' => $tests]);\n }",
"public function viewPreferenceList($sender, $param)\n\t{\n\t\t$html = '';\n\t\ttry{\n\t\t\t//get the add preference panel\n\t\t\t$html .= \"<table class='ResultDataList'>\";\n\t\t\t$html .= \"<thead>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<th>Name</th>\";\n\t\t\t$html .= \"<th>View Preferences</th>\";\n\t\t\t$html .= \"<th> </th>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</thead>\";\n\t\t\t$html .= \"<tbody>\";\n\t\t\t$rowNo = 0;\n\t\t\tforeach($this->_getUPGroups() as $key => $items)\n\t\t\t{\n\t\t\t\t$html .= \"<tr class='\" . ((($rowNo++) % 2) === 0 ? \"ResultDataListAlterItem\" : \"ResultDataListItem\") . \"'>\";\n\t\t\t\t$html .= \"<td>$key</td>\";\n\t\t\t\t$html .= \"<td>\";\n\t\t\t\tforeach($items as $k => $item)\n\t\t\t\t{\n\t\t\t\t\t$html .= \"<div><b>$k: </b>\";\n\t\t\t\t\tif(is_array($item))\n\t\t\t\t\t{\n\t\t\t\t\t\t$funcName = (ucfirst($k) === 'WorkType' ? \"getLongName\" : \"getName\");\n\t\t\t\t\t\t$html .= \"<ul style='margin-left: 20px;'><li>\" . implode(\"</li><li>\", $this->_transIdToName($item, ucfirst($k), $funcName)) . \"</li></ul>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$html .= \"$item\";\n\n\t\t\t\t\t$html .= \"</div>\";\n\t\t\t\t}\n\t\t\t\t$html .= \"</td>\";\n\t\t\t\t$html .= \"<td>\";\n\t\t\t\t$html .= \"<input type='image' src='/themes/images/delete.png' onclick=\\\"return pageJs.delPreference('\" . $this->addOrDelPreferenceBtn->getUniqueID() . \"', '\" . $this->preferencesList->getClientId() . \"', this);\\\" value='$key' />\";\n\t\t\t\t$html .= \"</td>\";\n\t\t\t\t$html .= \"</tr>\";\n\t\t\t}\n\t\t\t$html .= \"</tbody>\";\n\t\t\t$html .= \"</table>\";\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$html = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\t\t$this->responseLabel->Text = $html;\n\t}",
"public function index()\n {\n $polls = $this->pollRepo->getAvailablePolls();\n\n return view('home', ['polls' => $polls]);\n }",
"public function listing() {\r\n $options = get_option( 'myhome_redux' );\r\n $show_advanced = is_null( $options['mh-listing-show_advanced'] ) ? true : intval( $options['mh-listing-show_advanced'] );\r\n $show_clear = is_null( $options['mh-listing-show_clear'] ) ? true : intval( $options['mh-listing-show_clear'] );\r\n $show_sort_by = is_null( $options['mh-listing-show_sort_by'] ) ? true : intval( $options['mh-listing-show_sort_by'] );\r\n $show_view_types = is_null( $options['mh-listing-show_view_types'] ) ? true : intval( $options['mh-listing-show_view_types'] );\r\n $advanced_number = is_null( $options['mh-listing-search_form_advanced_number'] ) ? 3 : intval( $options['mh-listing-search_form_advanced_number'] );\r\n // settings from Listing options page\r\n $atts = array(\r\n 'lazy_loading' => $options['mh-listing-lazy_loading'] ? 'true' : 'false',\r\n 'lazy_loading_limit' => intval( $options['mh-listing-load_more_button_number'] ),\r\n 'load_more_button' => $options['mh-listing-load_more_button_label'],\r\n 'load_prev_button' => $options['mh-listing-load_prev_button_label'],\r\n 'listing_default_view' => $options['mh-listing-default_view'],\r\n 'estates_per_page' => $options['mh-listing-estates_limit'],\r\n 'search_form_position' => $options['mh-listing-search_form_position'],\r\n 'label' => $options['mh-listing-label'],\r\n 'search_form_advanced_number' => $advanced_number,\r\n 'show_advanced' => $show_advanced ? 'true' : 'false',\r\n 'show_clear' => $show_clear ? 'true' : 'false',\r\n 'show_sort_by' => $show_sort_by ? 'true' : 'false',\r\n 'show_view_types' => $show_view_types ? 'true' : 'false',\r\n 'agent_id' => $this->id, // get estates only from this agent\r\n 'map' => false\r\n );\r\n\r\n // prepare attributes\r\n foreach ( My_Home_Attribute::get_attributes() as $attr ) {\r\n $value = $options['mh-listing-' . $attr->get_slug() . '_show'];\r\n $atts[$attr->get_slug() . '_show'] = $value ? 'true' : 'false';\r\n }\r\n\r\n // initiate listing\r\n $listing = new My_Home_Listing( $atts );\r\n ?>\r\n <div class=\"mh-listing--full-width mh-listing--horizontal-boxed\">\r\n <?php $listing->listing(); ?>\r\n </div>\r\n <?php\r\n }",
"function showhands($hands, $all=false)\n//$all flag determines if dealer's first card is shown or not\n{\n\tforeach ($hands as $hand => $cards) \n\t{\n\t\techo \"{$hand}'s hand is \";//shows 'Computer's hand is...' and 'Player's hand is...'\n\t\tforeach ($cards as $card=>$value) \n\t\t{\t\n\t\t\tif ($hand == \"Computer\") //Computer\n\t\t\t{\n\t\t\t\tswitch ($card) \n\t\t\t\t{\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tif ($all) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"({$value})\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"(?-?)\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\techo \"({$value})\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //Player\n\t\t\t{\n\t\t\t\techo \"({$value})\";\n\t\t\t}\n\t\t}\n\t\techo PHP_EOL;\n\t}\nreturn $hands;\n}"
] |
[
"0.78780216",
"0.57972914",
"0.5782517",
"0.57452047",
"0.568238",
"0.5665907",
"0.554359",
"0.5521052",
"0.5493955",
"0.54106253",
"0.54102165",
"0.5406764",
"0.5370672",
"0.5350275",
"0.5344742",
"0.5339448",
"0.5324487",
"0.53175706",
"0.53132993",
"0.5310677",
"0.52985597",
"0.52974254",
"0.5294232",
"0.5281041",
"0.5271766",
"0.5268289",
"0.52641016",
"0.5252873",
"0.5228169",
"0.52240944"
] |
0.70986474
|
1
|
Show the form for creating a new pitch
|
public function create()
{
return View::make('pitches.create');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"public function create()\n {\n return view('admin.speaker.create');\n }",
"public function create()\n {\n return view('Samples.create', [\n 'create' => new FormBuilder(\n [\n 'title'=>'text',\n 'slug'=>'text',\n 'type_id'=>'hidden',\n 'id'=>'hidden' \n ],\n ['samples.store'],\n 'POST',\n 'Create'\n ) \n ]);\n }",
"public function create()\n {\n return view('player.create');\n }",
"public function create()\n {\n //\n return view('player.create');\n }",
"public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n return view('study.create');\n return \"Aquí formulario de crear estudios\";\n }",
"public function create()\n {\n return view('admins.speaker.create');\n }",
"public function create()\n {\n return view ('content.pots.create');\n }",
"public function create()\n {\n return view('backend.chi_tiet_phongs.create');\n }",
"public function create()\n {\n return view('backend.song.create');\n }",
"public function actionCreate($sub_pitch_id)\n { \n\n $subPitch = $this->findSubPitchModel($sub_pitch_id);\n $pitch = $subPitch->getPitch()->one();\n $model = new Booking();\n $model->sub_pitch_id = $sub_pitch_id;\n $model->user_id = Yii::$app->user->identity->user_id;\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save())\n return $this->redirect(['view', 'id' => $model->booking_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'subPitch' => $subPitch,\n 'pitch' => $pitch,\n ]);\n }",
"public function create()\n {\n return view('admin.scenery.create');\n }",
"public function create()\n {\n return view('players.create');\n }",
"public function create()\n {\n return view('admin.pages.forms.pengirim');\n }",
"public function create()\n {\n return view('song.create');\n }",
"public function create()\n {\n return view(\"footballers.create\");\n }",
"public function create()\n {\n //Capitulo\n $capitulo = Capitulo::findOrFail(Session::get('capitulo_id'));\n //libro\n $libro = Libro::findOrFail($capitulo->libro_id);\n\n \n return view('audio.formTable', compact('capitulo','libro'));\n }",
"public function create()\n {\n return view('pendamping.create');\n }",
"public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create()\n\t{\n\t\treturn view('speakers.create', ['speakers' => new Speaker]);\n\t}",
"public function create()\n {\n return View::make('polys.create');\n }",
"public function create()\n {\n return view('admin.song.create', ['singers' => Singer::selectList()]);\n }",
"public function create()\n {\n return view('audio.create');\n }",
"public function create()\n {\n return view('party.create');\n }",
"public function create()\n {\n return view('pasok.create');\n }",
"public function create()\n {\n return view('admin.pictureRoom.create');\n }",
"public function create()\n {\n return view(\"pages.admin.specification.camera.create-camera\",$this->data);\n }",
"public function create()\n {\n return view('prospectos.create');\n }",
"public function create()\n {\n return View('admin.part.add_part')->with('skills', Skill::all());\n }"
] |
[
"0.64811754",
"0.64021564",
"0.6344791",
"0.6305638",
"0.62902755",
"0.6272448",
"0.624497",
"0.61690754",
"0.61617386",
"0.61601853",
"0.61397135",
"0.61171985",
"0.6092876",
"0.60848266",
"0.6079335",
"0.6070275",
"0.60534704",
"0.6051795",
"0.6037409",
"0.6032939",
"0.6030137",
"0.60290116",
"0.6025671",
"0.6019945",
"0.60195535",
"0.6015715",
"0.60156757",
"0.6015655",
"0.5998463",
"0.59953976"
] |
0.6781933
|
0
|
Store a newly created pitch in storage.
|
public function store()
{
$data = Input::all();
$data['user_id'] = Auth::id();
$validator = Validator::make($data , Pitch::$rules);
if ( $validator->fails() )
{
return Response::json( $validator->messages() );
}
Pitch::create($data);
return Response::json( ['good job' => 'wooot'] );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setPitch($var)\n {\n GPBUtil::checkDouble($var);\n $this->pitch = $var;\n\n return $this;\n }",
"public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTableName) => [\n $uid => $this->getPersistableDataArray()\n ]\n ];\n // New records always must have a pid\n if ($this->getIdentifier() == 0) {\n $data[trim(static::$storageTableName)][$uid]['pid'] = 0;\n }\n /** @var \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $tce */\n $tce = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->start($data, []);\n $tce->process_datamap();\n }",
"public function store();",
"public function store();",
"public function store();",
"public function store()\n\t {\n\t //\n\t }",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }",
"public function store()\n {\n $this->storeKeys();\n }",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] |
[
"0.5869879",
"0.55510974",
"0.53568083",
"0.53568083",
"0.53568083",
"0.5355727",
"0.53406554",
"0.53406554",
"0.53406554",
"0.53351176",
"0.53207225",
"0.53077173",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755",
"0.5286755"
] |
0.6264184
|
0
|
Display the specified pitch.
|
public function show($id)
{
//
$pitch=Pitch::find($id);
if(!$pitch) {
App::abort(404);
}
return View::make('pitches.show', compact('pitch'));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setPitch($var)\n {\n GPBUtil::checkDouble($var);\n $this->pitch = $var;\n\n return $this;\n }",
"public function getPitch()\n {\n return $this->pitch;\n }",
"public function getIndex()\n\t{\n\t\treturn View::make('pitch')->with('pitch', $this->pitch);\n\t}",
"public function isFixedPitch() {}",
"public function show(Speaker $speaker)\n {\n //\n }",
"public static function getPitch()\n {\n $element = new Lib_Form_Element_Location_Angle_Pitch();\n return $element;\n }",
"public static function getPitch()\n {\n $element = new Lib_Form_Element_Location_Angle_Pitch();\n return $element;\n }",
"public function display() {\n return $this->out(call_user_func_array([$this, 'render'], func_get_args()));\n }",
"public function show(Surface $surface)\n {\n //\n }",
"public function actionView($id)\n { \n $model = $this->findModel($id);\n $user = $model->getUser()->one();\n $subPitch = $this->findSubPitchModel($model->sub_pitch_id);\n $pitch = $subPitch->getPitch()->one();\n\n $render_str_infos = '';\n $additional_infos = explode('<br>', $model->additional_info);\n\n foreach ($additional_infos as $value) {\n if (trim($value) !== '')\n $render_str_infos = $render_str_infos . '<p>' . $value . '</p>';\n }\n\n return $this->render('view.twig', [\n 'model' => $model,\n 'render_str_infos' => $render_str_infos,\n 'user' => $user,\n 'pitch' => $pitch,\n 'subPitch' => $subPitch,\n ]);\n }",
"public function display()\n {\n echo \"temperature:{$this->_subject->getTemperature()},humidity:{$this->_subject->getHumidity()},pressure:{$this->_subject->getPressure()}\" . PHP_EOL;\n }",
"public function postIndex()\n\t{\n\t\t$pitch = $this->pitch->fill(Input::all());\n\t\tif ($pitch->validate()) {\n\t\t\t$author = Author::where('email', $pitch->email)->first();\n\t\t\tif ($author) {\n\t\t\t\t$pitch->author_id = $author->id;\n\t\t\t}\n\t\t\t$pitch->save();\n\t\t\tQueue::push('PitchNotify', ['pitch' => $pitch->id]);\n\t\t\treturn View::make('gotpitch')->with('pitch', $pitch);\n\t\t}\n\t\tSession::flashInput(Input::all());\n\t\treturn Redirect::to('pitch')->with('error', $pitch->errors);\n\t}",
"public function edit($id)\n\t{\n\t\t$pitch = Pitch::find($id);\n\n\t\treturn View::make('pitches.edit', compact('pitch'));\n\t}",
"public abstract function display();",
"public function display(){}",
"abstract function display();",
"abstract function display();",
"public function show(Spk $spk)\n {\n //\n }",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function show(BotSpeak $botSpeak)\n {\n //\n }",
"public function show($pid)\n {\n //\n }",
"function show($pos)\r\n\t{\r\n\t\techo $this->get($pos);\r\n\t}",
"abstract public function display($renderer, $attempt);",
"public function actionPitches()\n { \n\n $searchModel = new PitchSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination = [\n 'pageSize' => 10,\n ];\n\n return $this->render('pitches', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'keyword' => $searchModel->keyword,\n ]);\n }",
"public function display()\n\t{\n\t\tprint_r(\"<br/>RedheadDuck looks like this!<br/>\");\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }"
] |
[
"0.65164596",
"0.6018151",
"0.56365925",
"0.5613768",
"0.55249906",
"0.54229486",
"0.54229486",
"0.5303747",
"0.52294916",
"0.51390094",
"0.5120168",
"0.50453454",
"0.5031117",
"0.49970594",
"0.497328",
"0.4949104",
"0.4949104",
"0.4890109",
"0.4875497",
"0.4875497",
"0.487515",
"0.487515",
"0.48705834",
"0.48681822",
"0.48524514",
"0.48299375",
"0.48231867",
"0.48077816",
"0.48035038",
"0.48026186"
] |
0.63103384
|
1
|
Show the form for editing the specified pitch.
|
public function edit($id)
{
$pitch = Pitch::find($id);
return View::make('pitches.edit', compact('pitch'));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function edit()\n\t{\n\t\tJRequest::setVar( 'view', 'player' );\n\t\tJRequest::setVar( 'layout', 'form' );\n\t\tJRequest::setVar('hidemainmenu', 1);\n\t \t \n\t\tparent::display();\n\t}",
"public function edit(Speaker $speaker)\n {\n //\n }",
"public function show($id)\n\t{\n\t\t// \t\n\t\t$pitch=Pitch::find($id);\n\t\tif(!$pitch) {\n\t\t\tApp::abort(404);\n\t\t}\n\n\t\treturn View::make('pitches.show', compact('pitch'));\n\t}",
"public function edit($id){\n $row = WhSequencer::find($id);\n return view('system.sequencer_form',[\n 'mode' => 'edit',\n 'doctype' => WhDocType::all(),\n 'row' => $row,\n ]);\n }",
"public function edit($id)\n {\n $speaker = Speakers::find($id);\n return view('admins.speaker.edit' , compact('speaker'));\n }",
"function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}",
"public function edit(BotSpeak $botSpeak)\n {\n //\n }",
"public function edit($id)\n\t{\n\t\treturn view('speakers.edit', ['speaker' => Speaker::findOrFail($id)]);\n\t}",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n {\n return view('admin.SpeakerEdit')->with(['speaker'=> speaker::find($id),'spekaers'=>speaker::all()]);\n }",
"public function edit()\r\n\t{\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\r\n\t}",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function showEdit()\n {\n\n }",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $render = new RenderController;\n $form_render = $render->index(3,$id);\n $candidate = candidate::find($id);\n return view('exploration/editar',['candidate'=>$candidate,'form_render'=>$form_render]);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function editpoll(){\n SiteController::loggedInCheck();\n\n //retrieve the poll\n\t\t$pollid = $_POST['edit'];\n\t\t$poll = Poll::loadById($pollid);\n\n //retrieve poll author's username\n\t\t$authorid = $poll->get('userId');\n\t\t$user = User::loadById($authorid);\n\t\t$username = $user->get('username');\n\n\t\t//check if author of the poll is the logged in user\n\t\tif($_SESSION['username'] != $username){\n\t\t\t$_SESSION['info'] = \"You can only edit polls of which you are the author of.\";\n\t\t\theader('Location: '.BASE_URL);\n\t\t\texit();\n\t\t} else {\n\t\t\t//allow access to edit poll\n\t\t\t$title = $poll->get('title');\n $options = $poll->getPollOptions();\n\t\t\tinclude_once SYSTEM_PATH.'/view/editpoll.tpl'; //TODO: check tpl is correct\n\t\t}\n\t}",
"public function edit($id)\n\t{\n\t\t$iWomenPostAudio = $this->iWomenPostAudioRepository->find($id);\n\n\t\tif(empty($iWomenPostAudio))\n\t\t{\n\t\t\tFlash::error('IWomenPostAudio not found');\n\n\t\t\treturn redirect(route('iWomenPostAudios.index'));\n\t\t}\n\n\t\treturn view('iWomenPostAudios.edit')->with('iWomenPostAudio', $iWomenPostAudio);\n\t}",
"public function edit($id)\n {\n //\n //find record of given id\n $edit_form = Assignatory::find($id);\n\n if($edit_form->kind == 'R'){\n $records = Assignatory::all()->where('kind', '=', 'R');\n }elseif ($edit_form->kind == 'AA') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'AA');\n }elseif ($edit_form->kind == 'C') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'C');\n }elseif ($edit_form->kind == 'A') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'A');\n }\n \n $dept = Office::all();\n \n\n //show edit form and pass the info to it\n return View('signatory.editsignatory', compact('edit_form','records','dept')); \n }",
"public function edit($id)\n {\n //\n $player = Player::find($id);\n \n return view('player.edit', compact('player','id')); \n }",
"public function edit($id)\n\t{\n\t\t$produkter = Produkter::find($id);\n\t \n\t \n\t\treturn view('admin.produkter.edit', compact('produkter'));\n\t}",
"public function edit($id)\n {\n return view('pulse-surveys.edit');\n }",
"public function edit($id)\n {\n $userpaper = Paper::where(\"id\",$id)->first();\n \n \n return view('company.paper.edit', compact('userpaper'));\n }",
"public function edit()\n {\n return view('policy.edit')->withPage(Policy::first());\n }",
"public function edit($id)\n {\n $this->authorize('update', [$this->player_repository, $id]);\n $player = $this->player_workflow->edit($id);\n return view('player_edit', compact('player')); //ayto DEN tha to exw sto restful_crud code generation\n }",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function editView() {\n $this->template()->addTplFile('edit.phtml');\n $this->setTinyMCE($this->formEdit->text, 'advanced');\n $this->setTinyMCE($this->formEdit->textPanel, 'advanced', array('height' => 300));\n if(isset($this->formEdit->textFooter)){\n $this->setTinyMCE($this->formEdit->textFooter, 'advanced', array('height' => 300));\n }\n Template_Module::setEdit(true);\n }",
"public function profile_edit() {\n $this->template->content = View::instance('v_users_profile_edit');\n $this->template->title = \"Edit Profile\";\n\n // Render the view\n echo $this->template;\n\n }"
] |
[
"0.6676512",
"0.6441654",
"0.6010675",
"0.59815794",
"0.5938378",
"0.59298986",
"0.58987445",
"0.58912796",
"0.5821772",
"0.57867056",
"0.5778019",
"0.5755491",
"0.573077",
"0.57296056",
"0.5716647",
"0.571075",
"0.56987494",
"0.5687955",
"0.5668982",
"0.5639",
"0.563447",
"0.56204134",
"0.5610623",
"0.56072295",
"0.5600153",
"0.5597423",
"0.55930096",
"0.5589455",
"0.55838096",
"0.558224"
] |
0.70002025
|
0
|
Create a paginator based on Lastfm parameters.
|
public static function useLastfmParams($params, $urlPattern)
{
if (!isset($params['total'])) return null;
if (!isset($params['page'])) return null;
if (!isset($params['perPage'])) return null;
$total = $params['total'];
$page = $params['page'];
$perPage = $params['perPage'];
return new Paginator($total, $perPage, $page, $urlPattern);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function buildPagination() {}",
"protected function buildPagination() {}",
"public function pagination( $params = array() )\n\t{\n\t\t$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n\t\t$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n\n\n\t\t$limit = $params['limit'];\n\t\t$page = ( $params['page'] <= 0 ) ? 1 : $params['page'];\n\n\t\t$total_pages = ceil( $params['total'] / $limit );\n\n\t\t$start_page = ( ( $page - 5 ) < 1 ) ? 1 : $page - 5;\n\t\t$end_page = ( ( $start_page + 10 ) > $total_pages ) ? $total_pages : $start_page + 10;\n\n\t\t$next_page = ( $page < $total_pages ) ? $page + 1 : $total_pages;\n\t\t$back_page = ( $page > 1 ) ? $page - 1 : $start_page;\n\n\t\t$current_page = $start_page;\n\n\t\t$get_params = isset( $params['getParams'] ) ? $params['getParams'] : null;\n\n\t\tif ( defined( 'TWITTER_BOOTSTRAP' ) ) {\n\t\t\t$output = '<div class=\"pagination pagination-centered\"><ul>';\n\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => 1 ), null, TRUE ) . \"$get_params' title='Primeiro'>«</a></li>\";\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $back_page ), null, TRUE ) . \"$get_params' title='Anterior'><</a></li>\";\n\t\t\t} else {\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>«</a></li>\";\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'><</a></li>\";\n\t\t\t}\n\n\t\t\twhile ( $current_page <= $end_page ) {\n\t\t\t\tif ( $current_page != $page ) {\n\t\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $current_page ), null, TRUE ) . \"$get_params'>$current_page</a></li>\";\n\t\t\t\t} else {\n\t\t\t\t\t$output .= \"<li class='active'><a href='#'>$current_page</a></li>\";\n\t\t\t\t}\n\t\t\t\t$current_page++;\n\t\t\t}\n\n\t\t\tif ( $page != $total_pages ) {\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $next_page ), null, TRUE ) . \"$get_params' title='Próximo'>></a></li>\";\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $total_pages ), null, TRUE ) . \"$get_params' title='Último'>»</a></li>\";\n\t\t\t} else {\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>></a></li>\";\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>»</a></li>\";\n\t\t\t}\n\n\t\t\t$output .= '</ul></div>';\n\t\t} else {\n\t\t\t$output = '<div id=\"pagination\">';\n\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => 1 ), null, TRUE ) . \"$get_params' title='Primeiro'><img width='14' src='\" . INCLUDE_PATH . \"/img/first.png'/></a>\" . \" \";\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $back_page ), null, TRUE ) . \"$get_params' title='Anterior'><img width='16' src='\" . INCLUDE_PATH . \"/img/previous.png'/></a>\" . \" \";\n\t\t\t}\n\n\t\t\twhile ( $current_page <= $end_page ) {\n\t\t\t\tif ( $current_page != $page ) {\n\t\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $current_page ), null, TRUE ) . \"$get_params'>$current_page</a>\" . \" \";\n\t\t\t\t} else {\n\t\t\t\t\t$output .= \"<strong>[\" . $page . \"]</strong> \";\n\t\t\t\t}\n\n\t\t\t\t$current_page++;\n\t\t\t}\n\n\t\t\tif ( $page != $total_pages ) {\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $next_page ), null, TRUE ) . \"$get_params' title='Próximo'><img width='16' src='\" . INCLUDE_PATH . \"/img/next.png'/></a>\" . \" \";\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $total_pages ), null, TRUE ) . \"$get_params' title='Último'><img width='14' src='\" . INCLUDE_PATH . \"/img/last.png'/></a>\" . \" \";\n\t\t\t}\n\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\treturn $output;\n\t}",
"abstract public function preparePagination();",
"function pagination(){}",
"function pagination($title, $start, $start_name, $max, $max_name, $max_rows, $keep_post = false, $max_page_links = 5, $_selectors = null, $hash = '')\n{\n inform_non_canonical_parameter($max_name);\n inform_non_canonical_parameter($start_name);\n\n if (get_page_name() == 'members') {\n // Don't allow guest bots to probe too deep into the forum index, it gets very slow; the XML Sitemap is for guiding to topics like this\n if (($start > $max * 5) && (is_guest()) && (!is_null(get_bot_type()))) {\n access_denied('NOT_AS_GUEST');\n }\n }\n\n $post_array = array();\n if ($keep_post) {\n foreach ($_POST as $key => $val) {\n if (is_array($val)) {\n continue;\n }\n if (get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n $post_array[$key] = $val;\n }\n }\n\n $get_url = get_self_url(true);\n\n // How many to show per page\n if (is_null($_selectors)) {\n $_selectors = array(10, 25, 50, 80);\n }\n if (has_privilege(get_member(), 'remove_page_split')) {\n if (get_param_integer('keep_avoid_memory_limit', 0) == 1) {\n $_selectors[] = $max_rows;\n }\n }\n $_selectors[] = $max;\n sort($_selectors);\n $_selectors = array_unique($_selectors);\n $selectors = new Tempcode();\n foreach ($_selectors as $selector_value) {\n if ($selector_value > $max_rows) {\n $selector_value = $max_rows;\n }\n $selected = ($max == $selector_value);\n $selectors->attach(do_template('PAGINATION_PER_PAGE_OPTION', array('_GUID' => '1a0583bab42257c60289459ce1ac1e05', 'SELECTED' => $selected, 'VALUE' => strval($selector_value), 'NAME' => integer_format($selector_value))));\n\n if ($selector_value == $max_rows) {\n break;\n }\n }\n $hidden = build_keep_form_fields('_SELF', true, array($max_name, $start_name));\n $per_page = do_template('PAGINATION_PER_PAGE', array('_GUID' => '1993243727e58347d1544279c5eba496', 'HASH' => ($hash == '') ? null : $hash, 'HIDDEN' => $hidden, 'URL' => $get_url, 'MAX_NAME' => $max_name, 'SELECTORS' => $selectors));\n $GLOBALS['INCREMENTAL_ID_GENERATOR']++;\n\n if ($max < $max_rows) { // If they don't all fit on one page\n $parts = new Tempcode();\n $num_pages = ($max == 0) ? 1 : intval(ceil(floatval($max_rows) / floatval($max)));\n\n // Link to first\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => running_script('index') ? null : 0);\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $first = do_template('PAGINATION_CONTINUE_FIRST', array('_GUID' => 'f5e510da318af9b37c3a4b23face5ae3', 'TITLE' => $title, 'P' => strval(1), 'FIRST_URL' => $cat_url));\n } else {\n $first = new Tempcode();\n }\n\n // Link to previous\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => strval(max($start - $max, 0)));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $previous = do_template('PAGINATION_PREVIOUS_LINK', array('_GUID' => 'ec4d4da9677b5b9c8cea08676337c6eb', 'TITLE' => $title, 'P' => integer_format(intval($start / $max)), 'URL' => $cat_url));\n } else {\n $previous = do_template('PAGINATION_PREVIOUS');\n }\n\n // CALCULATIONS FOR CROPPING OF SEQUENCE\n // $from is the index number (one less than written page number) we start showing page-links from\n // $to is the index number (one less than written page number) we stop showing page-links from\n if ($max != 0) {\n $max_dispersal = $max_page_links / 2;\n $from = max(0, intval(floatval($start) / floatval($max) - $max_dispersal));\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal)));\n $dif = (floatval($start) / floatval($max) - $max_dispersal);\n if ($dif < 0.0) { // We have more forward range than max dispersal as we're near the start\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal - $dif)));\n }\n } else {\n $from = 0;\n $to = 0;\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($from > 0) {\n $continues_left = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_left = new Tempcode();\n }\n\n $bot = (is_guest()) && (!is_null(get_bot_type()));\n\n // Show the page number jump links\n for ($x = $from; $x < $to; $x++) {\n $url_array = array('page' => '_SELF', $start_name => ($x == 0) ? null : strval($x * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n if ($x * $max == $start) {\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER', array('_GUID' => '13cdaf548d5486fb8d8ae0d23b6a08ec', 'P' => strval($x + 1))));\n } else {\n $rel = null;\n if ($x == 0) {\n $rel = 'first';\n }\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER_LINK', array('_GUID' => 'a6d1a0ba93e3b7deb6fe6f8f1c117c0f', 'NOFOLLOW' => ($x * $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'URL' => $cat_url, 'P' => strval($x + 1))));\n }\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($to < $num_pages) {\n $continues_right = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_right = new Tempcode();\n }\n\n // Link to next\n if (($start + $max) < $max_rows) {\n $url_array = array('page' => '_SELF', $start_name => strval($start + $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $p = ($max == 0) ? 1.0 : ($start / $max + 2);\n $rel = null;\n if (($start + $max * 2) > $max_rows) {\n $rel = 'last';\n }\n $next = do_template('PAGINATION_NEXT_LINK', array('_GUID' => '6da9b396bdd46b7ee18c05b5a7eb4d10', 'NOFOLLOW' => ($start + $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'NUM_PAGES' => integer_format($num_pages), 'P' => integer_format(intval($p)), 'URL' => $cat_url));\n } else {\n $next = do_template('PAGINATION_NEXT');\n }\n\n // Link to last\n if ($start + $max < $max_rows) {\n $url_array = array('page' => '_SELF', ($num_pages - 1 == 0) ? null : $start_name => strval(($num_pages - 1) * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $last = do_template('PAGINATION_CONTINUE_LAST', array('_GUID' => '2934936df4ba90989e949a8ebe905522', 'TITLE' => $title, 'P' => strval($num_pages), 'LAST_URL' => $cat_url));\n } else {\n $last = new Tempcode();\n }\n\n // Page jump dropdown, if we had to crop\n if ($num_pages > $max_page_links) {\n $list = new Tempcode();\n $pg_start = 0;\n $pg_to = $num_pages;\n $pg_at = intval(floatval($start) / floatval($max));\n if ($pg_to > 100) {\n $pg_start = max($pg_at - 50, 0);\n $pg_to = $pg_start + 100;\n }\n if ($pg_start != 0) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n for ($i = $pg_start; $i < $pg_to; $i++) {\n $list->attach(form_input_list_entry(strval($i * $max), ($i * $max == $start), strval($i + 1)));\n }\n if ($pg_to != $num_pages) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n $dont_auto_keep = array();\n $hidden = build_keep_form_fields('_SELF', true, $dont_auto_keep);\n $pages_list = do_template('PAGINATION_LIST_PAGES', array('_GUID' => '9e1b394763619433f23b8ed95f5ac134', 'URL' => $get_url, 'HIDDEN' => $hidden, 'START_NAME' => $start_name, 'LIST' => $list));\n } else {\n $pages_list = new Tempcode();\n }\n\n // Put it all together\n return do_template('PAGINATION_WRAP', array(\n '_GUID' => '2c3fc957d4d8ab9103ef26458e18aed1',\n 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => $first,\n 'PREVIOUS' => $previous,\n 'CONTINUES_LEFT' => $continues_left,\n 'PARTS' => $parts,\n 'CONTINUES_RIGHT' => $continues_right,\n 'NEXT' => $next,\n 'LAST' => $last,\n 'PAGES_LIST' => $pages_list,\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval($num_pages),\n ));\n }\n\n if (get_value('pagination_when_not_needed') === '1') {\n return do_template('PAGINATION_WRAP', array('_GUID' => '451167645e67c7beabcafe11c78680db', 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => '',\n 'PREVIOUS' => '',\n 'CONTINUES_LEFT' => '',\n 'PARTS' => '',\n 'CONTINUES_RIGHT' => '',\n 'NEXT' => '',\n 'LAST' => '',\n 'PAGES_LIST' => '',\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval(1),\n ));\n }\n\n return new Tempcode();\n}",
"function mft_pager($variables) {\n $tags = $variables['tags'];\n $element = $variables['element'];\n $parameters = $variables['parameters'];\n $quantity = $variables['quantity'];\n global $pager_page_array, $pager_total;\n\n // Calculate various markers within this pager piece:\n // Middle is used to \"center\" pages around the current page.\n $pager_middle = ceil($quantity / 2);\n // current is the page we are currently paged to\n $pager_current = $pager_page_array[$element] + 1;\n // first is the first page listed by this pager piece (re quantity)\n $pager_first = $pager_current - $pager_middle + 1;\n // last is the last page listed by this pager piece (re quantity)\n $pager_last = $pager_current + $quantity - $pager_middle;\n // max is the maximum page number\n $pager_max = $pager_total[$element];\n // End of marker calculations.\n\n // Prepare for generation loop.\n $i = $pager_first;\n if ($pager_last > $pager_max) {\n // Adjust \"center\" if at end of query.\n $i = $i + ($pager_max - $pager_last);\n $pager_last = $pager_max;\n }\n if ($i <= 0) {\n // Adjust \"center\" if at start of query.\n $pager_last = $pager_last + (1 - $i);\n $i = 1;\n }\n // End of generation loop preparation.\n\n $li_first = theme('pager_first', array('text' => (isset($tags[0]) ? $tags[0] : t('« first')), 'element' => $element, 'parameters' => $parameters));\n $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('‹ previous')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n $li_next = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('next ›')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n $li_last = theme('pager_last', array('text' => (isset($tags[4]) ? $tags[4] : t('last »')), 'element' => $element, 'parameters' => $parameters));\n\n if ($pager_total[$element] > 1) {\n if ($li_first) {\n $items[] = array(\n 'class' => array('pager-first'),\n 'data' => $li_first,\n );\n }\n if ($li_previous) {\n $items[] = array(\n 'class' => array('pager-previous'),\n 'data' => $li_previous,\n );\n }\n\n // When there is more than one page, create the pager list.\n if ($i != $pager_max) {\n if ($i > 1) {\n $items[] = array(\n 'class' => array('pager-ellipsis'),\n 'data' => '…',\n );\n }\n // Now generate the actual pager piece.\n for (; $i <= $pager_last && $i <= $pager_max; $i++) {\n if ($i < $pager_current) {\n $items[] = array(\n 'class' => array('pager-item'),\n 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($pager_current - $i), 'parameters' => $parameters)),\n );\n }\n if ($i == $pager_current) {\n $items[] = array(\n 'class' => array('pager-current'),\n 'data' => $i,\n );\n }\n if ($i > $pager_current) {\n $items[] = array(\n 'class' => array('pager-item'),\n 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $pager_current), 'parameters' => $parameters)),\n );\n }\n }\n if ($i < $pager_max) {\n $items[] = array(\n 'class' => array('pager-ellipsis'),\n 'data' => '…',\n );\n }\n }\n // End generation.\n if ($li_next) {\n $items[] = array(\n 'class' => array('pager-next'),\n 'data' => $li_next,\n );\n }\n if ($li_last) {\n $items[] = array(\n 'class' => array('pager-last'),\n 'data' => $li_last,\n );\n }\n return theme('item_list', array(\n 'items' => $items,\n 'attributes' => array('class' => array('pager')),\n ));\n }\n}",
"function AdvancedPagination($total, $current, $last) {\n $pages = [];\n if ($current < 1) {\n $current = 1;\n } elseif ($current > $last) {\n $current = $last;\n }\n $pages['current'] = $current;\n $pages['previous'] = ($current == 1) ? $current : $current - 1;\n $pages['next'] = ($current == $last) ? $last : $current + 1;\n $pages['last'] = $last;\n $pages['pages'] = [];\n $show = 5; # Number of page links to show\n #\n # At the beginning\n #\n if ($current == 1) {\n if ($pages['next'] == $current) {\n return $pages; # if one page only\n }\n for ($i = 0; $i < $show; $i++) {\n if ($i == $last) {\n break;\n }\n array_push($pages['pages'], $i + 1);\n }\n return $pages;\n }\n #\n # At the end\n #\n if ($current == $last) {\n $start = $last - $show;\n if ($start < 1) {\n $start = 0;\n }\n for ($i = $start; $i < $last; $i++) {\n array_push($pages['pages'], $i + 1);\n }\n return $pages;\n }\n #\n # In the middle\n #\n $start = $current - $show;\n if (($total > 5) && ($current > 3)) $start = $current - 3;\n if (($last - $current) < 2) $start = $current - 4;\n if ($start < 1) $start = 0;\n for ($i = $start; $i < $current; $i++) {\n array_push($pages['pages'], $i + 1);\n }\n for ($i = ($current + 1); $i < ($current + $show); $i++) {\n if ($i == ($last + 1)) {\n break;\n }\n array_push($pages['pages'], $i);\n }\n return $pages;\n}",
"function paginator($params, $count) {\n $limit = $params->getLimit();\n if ($count > $limit && $count!=0){\n $page = $params->getPage(); \n $controllerName = strtolower(Zend_Controller_Front::getInstance()->getRequest()->getControllerName()); \n $pagination = ($page != 1)?'<span><a href=\"\"onclick=\"Grid.page('.($page-1).'); return false\"><<</a></span>':''; \n if ($page > 10){ \n $pagination .= '<a href=\"\" onclick=\"Grid.page(1); return false;\">1</a>';\n $pagination .= '<span>...</span>';\n }\n $pageSpliter = ($page - 5 >= 1 ? $page - 4 : 1);\n for ($i = $pageSpliter; ($count + $limit) / ($i*$limit) > 1 && $i < $pageSpliter + 10; $i++) {\n $pagination .= '<a href=\"\" onclick=\"Grid.page('.$i.'); return false;\" class=\"'. ($page == $i ? \"active\":\"\") .'\">'.$i.'</a>';\n } \n $lastPage = floor(($count + $limit -1) / $limit);\n if ($page < $lastPage - 10){\n $pagination .= '<span>...</span>'; \n $pagination .= '<a href=\"\" onclick=\"Grid.page('. $lastPage .'); return false;\">'.$lastPage .'</a>';\n }\n $pagination .= ($page < ($count/$limit))?'<span><a href=\"\"onclick=\"Grid.page('.($page+1).'); return false\">>></a></span>':''; \n echo '<div class=\"pagination\">'; \n echo $pagination; \n echo '</div>';\n } \n }",
"public function paginate($params = [])\n {\n return (new Paginator($this->album))->with('artist')->orderBy('release_date')->paginate($params);\n }",
"function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }",
"function horizon_theme_pagination( $mid = 2, $end = 1, $show = false, $query = null ) {\n\n\t// Prevent show pagination number if Infinite Scroll of JetPack is active.\n\tif ( ! isset( $_GET[ 'infinity' ] ) ) {\n\n\t\tglobal $wp_query, $wp_rewrite;\n\n\t\t$total_pages = $wp_query->max_num_pages;\n\n\t\tif ( is_object( $query ) && null != $query ) {\n\t\t\t$total_pages = $query->max_num_pages;\n\t\t}\n\n\t\tif ( $total_pages > 1 ) {\n\t\t\t$url_base = $wp_rewrite->pagination_base;\n\t\t\t$big = 999999999;\n\n\t\t\t// Sets the paginate_links arguments.\n\t\t\t$arguments = apply_filters( 'horizon_theme_pagination_args', array(\n\t\t\t\t\t'base' => esc_url_raw( str_replace( $big, '%#%', get_pagenum_link( $big, false ) ) ),\n\t\t\t\t\t'format' => '',\n\t\t\t\t\t'current' => max( 1, get_query_var( 'paged' ) ),\n\t\t\t\t\t'total' => $total_pages,\n\t\t\t\t\t'show_all' => $show,\n\t\t\t\t\t'end_size' => $end,\n\t\t\t\t\t'mid_size' => $mid,\n\t\t\t\t\t'type' => 'list',\n\t\t\t\t\t'prev_text' => __( '« Previous', 'horizon-theme' ),\n\t\t\t\t\t'next_text' => __( 'Next »', 'horizon-theme' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$pagination = '<div class=\"pagination-wrap\">' . paginate_links( $arguments ) . '</div>';\n\n\t\t\t// Prevents duplicate bars in the middle of the url.\n\t\t\tif ( $url_base ) {\n\t\t\t\t$pagination = str_replace( '//' . $url_base . '/', '/' . $url_base . '/', $pagination );\n\t\t\t}\n\n\t\t\treturn $pagination;\n\t\t}\n\t}\n}",
"public static function pagination()\n {\n $limit = (int) self::set(\"limit\");\n $offset = (int) self::set(\"offset\");\n\n $limit = Validator::intType()->notEmpty()->positive()->validate($limit)? $limit: false;\n $offset = Validator::intType()->notEmpty()->positive()->validate($offset)? $offset: 0;\n\n $pagination = \"\";\n $pagination .= $limit? \" LIMIT {$limit}\": null;\n $pagination .= ($limit && $offset)? \" OFFSET {$offset}\": null;\n\n return (object) [\n \"limit\" => $limit,\n \"offset\" => $offset,\n \"query\" => $pagination\n ];\n }",
"protected function buildPagination()\n {\n $this->calculateDisplayRange();\n $pages = [];\n for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {\n $pages[] = [\n 'number' => $i,\n 'offset' => ($i - 1) * $this->itemsPerPage,\n 'isCurrent' => $i === $this->currentPage\n ];\n }\n $pagination = [\n 'linkConfiguration' => $this->linkConfiguration,\n 'pages' => $pages,\n 'current' => $this->currentPage,\n 'numberOfPages' => $this->numberOfPages,\n 'lastPageOffset' => ($this->numberOfPages - 1) * $this->itemsPerPage,\n 'displayRangeStart' => $this->displayRangeStart,\n 'displayRangeEnd' => $this->displayRangeEnd,\n 'hasLessPages' => $this->displayRangeStart > 2,\n 'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages\n ];\n if ($this->currentPage < $this->numberOfPages) {\n $pagination['nextPage'] = $this->currentPage + 1;\n $pagination['nextPageOffset'] = $this->currentPage * $this->itemsPerPage;\n }\n if ($this->currentPage > 1) {\n $pagination['previousPage'] = $this->currentPage - 1;\n $pagination['previousPageOffset'] = ($this->currentPage - 2) * $this->itemsPerPage;\n }\n return $pagination;\n }",
"function get_page_params($count) {\n\n\tglobal $ROWS_PER_PAGE;\n\t\n\tif ($ROWS_PER_PAGE == '') $ROWS_PER_PAGE=10;\n\n\t$page_arr=array();\n\n\t$firstpage = 1;\n\t$lastpage = intval($count / $ROWS_PER_PAGE);\n\t$page=(int)get_arg($_GET,\"page\");\n\n\n\tif ( $page == \"\" || $page < $firstpage ) { $page = 1; }\t// no page no\n\tif ( $page > $lastpage ) {$page = $lastpage+1;}\t\t\t// page greater than last page\n\t//echo \"<pre>first=$firstpage last=$lastpage current=$page</pre>\";\n\n\tif ($count % $ROWS_PER_PAGE != 0) {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE) + 1;\n\t} else {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE);\n\t}\n\t$startrec = $ROWS_PER_PAGE * ($page - 1);\n\t$reccount = min($ROWS_PER_PAGE * $page, $count);\n\n\t$currpage = ($startrec/$ROWS_PER_PAGE) + 1;\n\n\n\tif($lastpage==0) {\n\t\t$lastpage=null;\n\t} else {\n\t\t$lastpage=$lastpage+1;\n\t}\n\n\tif($startrec == 0) {\n\t\t$prevpage=null;\n\t\t$firstpage=null;\n\t\tif($count == 0) {$startrec=0;}\n\t} else {\n\t\t$prevpage=$currpage-1;\n\t}\n\t\n\tif($reccount < $count) {\n\t\t$nextpage=$currpage+1;\n\t} else {\n\t\t$nextpage=null;\n\t\t$lastpage=null;\n\t}\n\n\t$appstr=\"&page=\"; \n\n\t// Link to PREVIOUS page (and FIRST)\n\tif($prevpage == null) {\n\t\t$prev_href=\"#\";\n\t\t$first_href=\"#\";\n\t\t$prev_disabled=\"disabled\";\n\t} else {\n\t\t$prev_disabled=\"\";\n\t\t$prev_href=$appstr.$prevpage; \n\t\t$first_href=$appstr.$firstpage; \n\t}\n\n\t// Link to NEXT page\n\tif($nextpage == null) {\n\t\t$next_href = \"#\";\n\t\t$last_href = \"#\";\n\t\t$next_disabled=\"disabled\";\n\t} else {\n\t\t$next_disabled=\"\";\n\t\t$next_href=$appstr.$nextpage; \n\t\t$last_href=$appstr.$lastpage; \n\t}\n\n\tif ( $lastpage == null ) $lastpage=$currpage;\n\n\t$page_arr['page_start_row']=$startrec;\n\t$page_arr['page_row_count']=$reccount;\n\n\t$page_arr['page']=$page;\n\t$page_arr['no_of_pages']=$pagecount;\n\n\t$page_arr['curr_page']=$currpage;\n\t$page_arr['last_page']=$lastpage;\n\n\t$page_arr['prev_disabled']=$prev_disabled;\n\t$page_arr['next_disabled']=$next_disabled;\n\n\t$page_arr['first_href']=$first_href;\n\t$page_arr['prev_href']=$prev_href;\n\t$page_arr['next_href']=$next_href;\n\t$page_arr['last_href']=$last_href;\n\n\t//LOG_MSG('INFO',\"Page Array=\".print_r($page_arr,true));\n\treturn $page_arr;\n}",
"function get_pager()\n\t{\n\t\tinclude_once('Pager/Pager.php');\n\t\t$pager_options = array();\n\t\t$pager_options['mode'] = 'Sliding';\n\t\t$pager_options['urlVar'] = 'page';\n\t\t$pager_options['delta'] = 2;\n\t\t$pager_options['perPage'] = (int) $this->rows_per_page;\n\t\t$pager_options['separator'] = '|';\n\t\t$pager_options['prev'] = '«';\n\t\t$pager_options['next'] = '»';\n\t\t$pager_options['append'] = false;\n\t\t$pager_options['fileName'] = $this->pager_file_name;\n\t\t\n\t\t$pager_options['totalItems'] = $this->totalItems;\n\t\t\n\t\t$currentPage = common::arg($this->pager_arg_no);\n\t\t//$this->content->debug .= ' currentPage: '.$currentPage .' argno: '.$this->pager_arg_no .' a:'.(int)common::arg(3);\n\t\tif (! isset($currentPage) || ! $currentPage) { $currentPage = 1; }\n\t\tif ($currentPage > ceil($this->totalItems/$this->rows_per_page)) { $currentPage = 1; }\n\t\t\n\t\t$pager_options['currentPage'] = $currentPage;\n\t\t\n\t\t$pager =& Pager::factory($pager_options);\n\t\treturn $pager->links;\n\t}",
"function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}",
"function emm_paginate($args = null) {\n\n\t$defaults = array(\n\n\t\t'page' => null, 'pages' => null, \n\n\t\t'range' => 3, 'gap' => 3, 'anchor' => 1,\n\n\t\t'before' => '<div class=\"emm-paginate\">', 'after' => '</div>',\n\n\t\t'title' => __('Pages:'),\n\n\t\t'nextpage' => __('»'), 'previouspage' => __('«'),\n\n\t\t'echo' => 1\n\n\t);\n\n\n\n\t$r = wp_parse_args($args, $defaults);\n\n\textract($r, EXTR_SKIP);\n\n\n\n\tif (!$page && !$pages) {\n\n\t\tglobal $wp_query;\n\n\n\n\t\t$page = get_query_var('paged');\n\n\t\t$page = !empty($page) ? intval($page) : 1;\n\n\n\n\t\t$posts_per_page = intval(get_query_var('posts_per_page'));\n\n\t\t$pages = intval(ceil($wp_query->found_posts / $posts_per_page));\n\n\t}\n\n\t\n\n\t$output = \"\";\n\n\tif ($pages > 1) {\t\n\n\t\t$output .= \"$before<span class='emm-title'>$title</span>\";\n\n\t\t$ellipsis = \"<span class='emm-gap'>...</span>\";\n\n\n\n\t\tif ($page > 1 && !empty($previouspage)) {\n\n\t\t\t$output .= \"<a href='\" . get_pagenum_link($page - 1) . \"' class='emm-prev'>$previouspage</a>\";\n\n\t\t}\n\n\t\t\n\n\t\t$min_links = $range * 2 + 1;\n\n\t\t$block_min = min($page - $range, $pages - $min_links);\n\n\t\t$block_high = max($page + $range, $min_links);\n\n\t\t$left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;\n\n\t\t$right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;\n\n\n\n\t\tif ($left_gap && !$right_gap) {\n\n\t\t\t$output .= sprintf('%s%s%s', \n\n\t\t\t\temm_paginate_loop(1, $anchor), \n\n\t\t\t\t$ellipsis, \n\n\t\t\t\temm_paginate_loop($block_min, $pages, $page)\n\n\t\t\t);\n\n\t\t}\n\n\t\telse if ($left_gap && $right_gap) {\n\n\t\t\t$output .= sprintf('%s%s%s%s%s', \n\n\t\t\t\temm_paginate_loop(1, $anchor), \n\n\t\t\t\t$ellipsis, \n\n\t\t\t\temm_paginate_loop($block_min, $block_high, $page), \n\n\t\t\t\t$ellipsis, \n\n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\n\t\t\t);\n\n\t\t}\n\n\t\telse if ($right_gap && !$left_gap) {\n\n\t\t\t$output .= sprintf('%s%s%s', \n\n\t\t\t\temm_paginate_loop(1, $block_high, $page),\n\n\t\t\t\t$ellipsis,\n\n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\n\t\t\t);\n\n\t\t}\n\n\t\telse {\n\n\t\t\t$output .= emm_paginate_loop(1, $pages, $page);\n\n\t\t}\n\n\n\n\t\tif ($page < $pages && !empty($nextpage)) {\n\n\t\t\t$output .= \"<a href='\" . get_pagenum_link($page + 1) . \"' class='emm-next'>$nextpage</a>\";\n\n\t\t}\n\n\n\n\t\t$output .= $after;\n\n\t}\n\n\n\n\tif ($echo) {\n\n\t\techo $output;\n\n\t}\n\n\n\n\treturn $output;\n\n}",
"function emm_paginate($args = null) {\n\t$defaults = array(\n\t\t'page' => null, 'pages' => null, \n\t\t'range' => 3, 'gap' => 3, 'anchor' => 1,\n\t\t'before' => '<ul class=\"pagination\">', 'after' => '</ul>',\n\t\t'title' => __('<li class=\"unavailable\"></li>'),\n\t\t'nextpage' => __('»'), 'previouspage' => __('«'),\n\t\t'echo' => 1\n\t);\n\n\t$r = wp_parse_args($args, $defaults);\n\textract($r, EXTR_SKIP);\n\n\tif (!$page && !$pages) {\n\t\tglobal $wp_query;\n\n\t\t$page = get_query_var('paged');\n\t\t$page = !empty($page) ? intval($page) : 1;\n\n\t\t$posts_per_page = intval(get_query_var('posts_per_page'));\n\t\t$pages = intval(ceil($wp_query->found_posts / $posts_per_page));\n\t}\n\t\n\t$output = \"\";\n\tif ($pages > 1) {\t\n\t\t$output .= \"$before<li>$title</li>\";\n\t\t$ellipsis = \"<li class='unavailable'>...</li>\";\n\n\t\tif ($page > 1 && !empty($previouspage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page - 1) . \"'>$previouspage</a></li>\";\n\t\t}\n\t\t\n\t\t$min_links = $range * 2 + 1;\n\t\t$block_min = min($page - $range, $pages - $min_links);\n\t\t$block_high = max($page + $range, $min_links);\n\t\t$left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;\n\t\t$right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;\n\n\t\tif ($left_gap && !$right_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $pages, $page)\n\t\t\t);\n\t\t}\n\t\telse if ($left_gap && $right_gap) {\n\t\t\t$output .= sprintf('%s%s%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $block_high, $page), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse if ($right_gap && !$left_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $block_high, $page),\n\t\t\t\t$ellipsis,\n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t$output .= emm_paginate_loop(1, $pages, $page);\n\t\t}\n\n\t\tif ($page < $pages && !empty($nextpage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page + 1) . \"'>$nextpage</a></li>\";\n\t\t}\n\n\t\t$output .= $after;\n\t}\n\n\tif ($echo) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}",
"function emm_paginate($args = null) {\n\t$defaults = array(\n\t\t'page' => null, 'pages' => null, \n\t\t'range' => 3, 'gap' => 3, 'anchor' => 1,\n\t\t'before' => '<ul class=\"pagination\">', 'after' => '</ul>',\n\t\t'title' => __('<li class=\"unavailable\"></li>'),\n\t\t'nextpage' => __('»'), 'previouspage' => __('«'),\n\t\t'echo' => 1\n\t);\n\n\t$r = wp_parse_args($args, $defaults);\n\textract($r, EXTR_SKIP);\n\n\tif (!$page && !$pages) {\n\t\tglobal $wp_query;\n\n\t\t$page = get_query_var('paged');\n\t\t$page = !empty($page) ? intval($page) : 1;\n\n\t\t$posts_per_page = intval(get_query_var('posts_per_page'));\n\t\t$pages = intval(ceil($wp_query->found_posts / $posts_per_page));\n\t}\n\t\n\t$output = \"\";\n\tif ($pages > 1) {\t\n\t\t$output .= \"$before<li>$title</li>\";\n\t\t$ellipsis = \"<li class='unavailable'>...</li>\";\n\n\t\tif ($page > 1 && !empty($previouspage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page - 1) . \"'>$previouspage</a></li>\";\n\t\t}\n\t\t\n\t\t$min_links = $range * 2 + 1;\n\t\t$block_min = min($page - $range, $pages - $min_links);\n\t\t$block_high = max($page + $range, $min_links);\n\t\t$left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;\n\t\t$right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;\n\n\t\tif ($left_gap && !$right_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $pages, $page)\n\t\t\t);\n\t\t}\n\t\telse if ($left_gap && $right_gap) {\n\t\t\t$output .= sprintf('%s%s%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $block_high, $page), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse if ($right_gap && !$left_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $block_high, $page),\n\t\t\t\t$ellipsis,\n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t$output .= emm_paginate_loop(1, $pages, $page);\n\t\t}\n\n\t\tif ($page < $pages && !empty($nextpage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page + 1) . \"'>$nextpage</a></li>\";\n\t\t}\n\n\t\t$output .= $after;\n\t}\n\n\tif ($echo) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}",
"function paginationLinks($page = 1, $page_count, $query = \"\")\n{\n // base page url\n $url = \"collection\";\n\n // first page link, which doesn't have a page data in url (no page=1)\n $first_page = $url . $query;\n\n // checking if other variables exist in query and adding needed characters\n $query .= (strpos($query, \"=\") !== FALSE) ? \"&\" : \"?\";\n $query .= \"page=\";\n\n // last page is always a max = page_count\n $last_page = $url . $query . $page_count;\n\n // pages before and after current page\n $previous = $url . $query . ($page-1);\n $next = $url . $query . ($page+1);\n\n // setting the three buttons values, middle one is current\n $first = $previous;\n $second = $url . $query . $page;\n $third = $next;\n\n // changing page links in special circumstances\n if($page == 1){\n $first = $first_page;\n $second = $next;\n $third = $url . $query . ($page+2);\n }elseif($page == 2){\n $first = $first_page;\n $previous = $first_page;\n }elseif($page == $page_count){\n $first = $url . $query . ($page_count-2);\n $second = $url . $query . ($page_count-1);\n $third = $last_page;\n }\n\n return [\n 'first_page' => $first_page,\n 'last_page' => $last_page,\n 'previous' => $previous,\n 'next' => $next, \n 'first' => $first,\n 'second' => $second,\n 'third' => $third\n ];\n}",
"function generate_pagination($url, $items, $per_page, $start, $start_variable='start'){\r\n global $eqdkp_root_path, $user;\r\n\r\n $uri_symbol = ( strpos($url, '?') ) ? '&' : '?';\r\n\t\t//On what page we are?\r\n\t\t$recent_page = (int)floor($start / $per_page) + 1;\r\n\t\t//Calculate total pages\r\n\t\t$total_pages = ceil($items / $per_page);\r\n\t\t//Return if we don't have at least 2 Pages\r\n\t\tif (!$items || $total_pages < 2){\r\n return '';\r\n }\r\n\r\n\t\t//First Page\r\n $pagination = '<div class=\"pagination\">';\r\n\t\tif ($recent_page == 1){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">1</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol . $start_variable.'='.( ($recent_page - 2) * $per_page).'\" title=\"'.$user->lang['previous_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/left_arrow.png\" border=\"0\"></a> <a href=\"'.$url.'\" class=\"pagination\">1</a>';\r\n\t\t}\r\n\r\n\t\t//If total-pages < 4 show all page-links\r\n\t\tif ($total_pages < 4){\r\n\t\t\t\t$pagination .= ' ';\r\n\t\t\t\tfor ( $i = 2; $i < $total_pages; $i++ ){\r\n\t\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$pagination .= ' ';\r\n\t\t\t\t}\r\n\t\t//Don't show all page-links\r\n\t\t} else {\r\n\t\t\t$start_count = min(max(1, $recent_page - 5), $total_pages - 4);\r\n\t\t\t$end_count = max(min($total_pages, $recent_page + 5), 4);\r\n\r\n\t\t\t$pagination .= ( $start_count > 1 ) ? ' ... ' : ' ';\r\n\r\n\t\t\tfor ( $i = $start_count + 1; $i < $end_count; $i++ ){\r\n\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$pagination .= ($end_count < $total_pages ) ? ' ... ' : ' ';\r\n\t\t} //close else\r\n\r\n\r\n\t\t//Last Page\r\n\t\tif ($recent_page == $total_pages){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$recent_page.'</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.(($total_pages - 1) * $per_page) . '\" class=\"pagination\" title=\"'.$user->lang['page'].' '.$total_pages.'\">'.$total_pages.'</a> <a href=\"'.$base. $uri_symbol .$start_variable.'='.($recent_page * $per_page).'\" title=\"'.$user->lang['next_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/right_arrow.png\" border=\"0\"></a>';\r\n\t\t}\r\n\r\n\t$pagination .= '</div>';\r\n\treturn $pagination;\r\n}",
"function pagination( $query = '', $paged = '', $pages = '', $range = 2 ) {\n $showitems = ( $range * 2 ) + 1;\n\n if ( $query == '' ) {\n global $wp_query;\n $query = $wp_query;\n }\n\n if ( $paged == '' ) {\n $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;\n }\n\n if ( $pages == '' ) {\n $pages = $query->max_num_pages;\n if ( !$pages ) {\n $pages = 1;\n }\n }\n\n if ( $pages != 1 ) {\n echo '<ol class=\"pagination\">';\n if ( $paged > 1 ) echo '<li class=\"pagination__prev\"><a href=\"' . get_pagenum_link( $paged - 1 ) . '\" rel=\"prev\">Prev</a></li>';\n if ( $paged > 2 && $paged > ( $range + 1 ) && $showitems < $pages ) echo '<li><a href=\"' . get_pagenum_link(1) . '\">1</a></li><li class=\"pagination__more\"><span>…</span></li>';\n\n for ( $i = 1; $i <= $pages; $i++ ) {\n if ( 1 != $pages && ( !( $i >= ( $paged + $range + 1 ) || $i <= ( $paged - $range - 1 ) ) || $pages <= $showitems ) ) {\n echo ( $paged == $i ) ? '<li class=\"pagination__curr\"><span>' . $i . '</span></li>' : '<li><a href=\"' . get_pagenum_link( $i ) . '\">' . $i . '</a></li>'; // This line displays the page number links\n }\n }\n\n if ( $paged < ( $pages - 1 ) && ( $paged + $range - 1 ) < $pages && $showitems < $pages ) echo '<li class=\"pagination__more\"><span>…</span></li><li><a href=\"' . get_pagenum_link( $pages ) . '\">' . $pages . '</a></li>';\n if ( $paged < $pages ) echo '<li class=\"pagination__next\"><a href=\"' . get_pagenum_link( $paged + 1 ) . '\" rel=\"next\">Next</a></li>';\n echo '</ol>';\n }\n}",
"function displayPaging() \r\n {\r\n $self = $_SERVER['PHP_SELF'];\r\n if($this->openPage<=0) {\r\n $next = 2;\r\n }\r\n\r\n else {\r\n $next = $this->openPage+1;\r\n }\r\n $prev = $this->openPage-1;\r\n $last = $this->pages;\r\n\t\t$queryString = '';\r\n\t\t\r\n\t\tif ($_GET['keywords']!= '') {\r\n\t\t\t$queryString .= '&keywords='.$_GET['keywords'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['sort'] != '') {\r\n\t\t\t$queryString .= '&sort='.$_GET['sort'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['filters']!='') {\r\n\t\t\t$queryString .= '&filters='.$_GET['filters'];\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif ($_GET['cat']!='') {\r\n\t\t\t$queryString .= '&cat='.$_GET['cat'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['media']!='') {\r\n\t\t\t$queryString .= '&media='.$_GET['media'];\r\n\t\t}\r\n\t\tif ($_GET['content']!='') {\r\n\t\t\t$queryString .= '&content='.$_GET['content'];\r\n\t\t}\r\n\t\tif ($_GET['genre']!='') {\r\n\t\t\t$queryString .= '&genre='.$_GET['genre'];\r\n\t\t}\r\n\r\n if($this->openPage > 1) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=1\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\techo \"First</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n \techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$prev\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\techo \"Prev</a>] \";\r\n }\r\n else {\r\n echo \"[First<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Prev] \";\r\n }\r\n for($i=1;$i<=$this->pages;$i++) {\r\n if($i == $this->openPage) \r\n\t\t\t\tif ($i==1)\r\n \techo \"$i\";\r\n\t\t\t\telse \r\n\t\t\t\t\t echo \", $i\";\r\n else\r\n\t\t\tif ($i==1) {\r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n\t\t\t\t}else{ \r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n } }\r\n if($this->openPage < $this->pages) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$next\".$queryString.\"\\\">Next</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$last\".$queryString.\"\\\">Last</a>]\";\r\n }\r\n else {\r\n echo \" [Next<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Last]\";\r\n } \r\n }",
"function tw_get_pagination(){\n\t\tglobal $wp_query;\n\t\t\n\t\tif( $wp_query->max_num_pages <= 1 ){\n\t\t\treturn null;\n\t\t}\n\n\t\t$pagination_args = array(\n\n\t\t\t'prev_text' => __( '« Prev' ),\n\t\t\t'next_text' => __( 'Next »' ),\n\t\t\t'mid_size' \t=> __( '1' ),\n\n\t\t);\n\n\t\treturn paginate_links( $pagination_args );\n\n\t}",
"public function paginate($limit, array $params = null);",
"function getEventsPagination($count, $args) {\n\t \t$wp_args = array();\n\n\t \t$wp_args['base'] = preg_replace( '/(\\?.*)?$/', '', $_SERVER[\"REQUEST_URI\"] ).'%_%';\n\t \t$wp_args['format'] = '?wpcal-page=%#%';\n\n\t \t// Preserver other GET values\n\t \tforeach($_GET as $k => $v) {\n\t \t\tif (strtolower($k) != 'wpcal-page') {\n\t \t\t\tif (isset($wp_args['add_args']))\n\t \t\t\t$wp_args['add_args'] = array();\n\t \t\t\t$wp_args['add_args'][$k] = $v;\n\t \t\t}\n\t \t}\n\n\t \t$epp = 0;\n\t \tif (isset($args['number'])) {\n\t \t\t$epp = intval($args['number']);\n\t \t}\n\t \tif (empty($epp)) {\n\t \t\t$epp = intval(get_option('fse_number'));\n\t \t}\n\n\t \tif (isset($args['pagination_prev_text'])) {\n\t \t\t$wp_args['prev_text'] = $args['pagination_prev_text'];\n\t \t} else {\n\t \t\t$wp_args['prev_text'] = get_option('fse_pagination_prev_text');\n\t \t}\n\n\t \tif (isset($args['pagination_next_text'])) {\n\t \t\t$wp_args['next_text'] = $args['pagination_next_text'];\n\t \t} else {\n\t \t\t$wp_args['next_text'] = get_option('fse_pagination_next_text');\n\t \t}\n\n\t \tif (isset($args['pagination_end_size'])) {\n\t \t\t$wp_args['end_size'] = $args['pagination_end_size'];\n\t \t} else {\n\t \t\t$wp_args['end_size'] = get_option('fse_pagination_end_size');\n\t \t}\n\n\t \tif (isset($args['pagination_mid_size'])) {\n\t \t\t$wp_args['mid_size'] = $args['pagination_mid_size'];\n\t \t} else {\n\t \t\t$wp_args['mid_size'] = get_option('fse_pagination_mid_size');\n\t \t}\n\n\t \tif (isset($args['pagination_use_dots'])) {\n\t \t\t$wp_args['show_all'] = ($args['pagination_use_dots'] == true ? false : true);\n\t \t} else {\n\t \t\t$wp_args['show_all'] = get_option('fse_pagination_usedots') == true ? false : true;\n\t \t}\n\n\t \t$wp_args['prev_next'] = (!empty($wp_args['prev_text']) || !empty($wp_args['next_text']));\n\n\t \t// Calculate number of pages\n\t \t$wp_args['total'] = ceil($count / $epp);\n\n\t \tif ($args['page'] < 1)\n\t \t$wp_args['current'] = 1;\n\t \telseif ($args['page'] > $wp_args['total'])\n\t \t$wp_args['current'] = $wp_args['total'];\n\t \telse\n\t \t$wp_args['current'] = $args['page'];\n\n\t \treturn paginate_links($wp_args);\n\t }",
"public function generatePHPPaginator()\n {\n $sHTML = '';\n \n $iNumOfPages = ceil($this->iLength / $this->iNumOfPosAtPage);\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=1\"><</a></li>';\n \n for($i = 0;$i < $iNumOfPages;$i++)\n {\n if(($i + 1) == $this->iActualPage)\n {\n $sHTML .= '<li class=\"active\"><a href=\"?' . $this->sActualParams . '&p=' . $this->iActualPage . '\">' . ($i + 1) . '</a></li>';\n }\n else\n {\n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . ($i + 1) . '\">' . ($i + 1) . '</a></li>';\n }\n }\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . $iNumOfPages . '\">></a></li>';\n \n $this->oTemplate->assign['paginator'] = $sHTML;\n $this->oTemplate->assign['scripts-path'] = SCRIPTS_PATH;\n \n return $this->oTemplate->parse(INCLUDES_PATH . 'paginator.html');\n }",
"function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}",
"public function paginateQuery($query, $key='page', $max=5, $range=2, $url='', $delim='&page=$1', $display=array('first'=>'|<<', 'prev'=>'<', 'next'=>'>', 'last'=>'>>|')) {\n // initialisation\n $paginatedQuery = array();\n if(!isset($_GET[$key])) {\n $_GET[$key] = 1; // so if GET isn't set, it still shows the first page's results\n }\n \n // gets total pages and results\n $paginatedQuery['totalnum'] = count($query);\n $paginatedQuery['pages'] = ceil($paginatedQuery['totalnum']/$max);\n $paginatedQuery['results'] = array_slice($query, ($max*($_GET[$key]-1)), $max, true);\n $paginatedQuery['resultsnum'] = count($paginatedQuery['results']); \n \n // formats paginated links\n // current\n $current = $_GET[$key];\n \n // first\n $first = 1;\n \n // prev\n if ($current==1) $prev = 1; \n else $prev = $current-1;\n \n // next\n if ($paginatedQuery['totalnum']==1) $next = 1; \n else $next = $current+1;\n \n // last\n $last = $paginatedQuery['pages'];\n \n // display \n $paginatedQuery['links'] = ''; // initialisation\n \n // first, prev\n if($current!=$first) $paginatedQuery['links'] = '<a class=\"first\" href=\"'.$url.str_replace('$1', $first, $delim).'\">'.$display['first'].'</a>'.\"\\n\".'<a class=\"prev\" href=\"'.$url.str_replace('$1', $prev, $delim).'\">'.$display['prev'].'</a>'.\"\\n\";\n \n // numbers\n for ($i = ($current - $range); $i < ($current + $range + 1); $i++) {\n if ($i > 0 && $i <= $paginatedQuery['pages']) {\n // current\n if ($i==$current) {\n $paginatedQuery['links'] .= '<span class=\"current\">'.$i.'</span>'.\"\\n\";\n }\n // link\n else {\n $paginatedQuery['links'] .= '<a class=\"page\" href=\"'.$url.str_replace('$1', $i, $delim).'\">'.$i.'</a>'.\"\\n\";\n }\n }\n }\n \n // next, last\n if($current!=$last) $paginatedQuery['links'] .= '<a class=\"next\" href=\"'.$url.str_replace('$1', $next, $delim).'\">'.$display['next'].'</a>'.\"\\n\".'<a class=\"last\" href=\"'.$url.str_replace('$1', $last, $delim).'\">'.$display['last'].'</a>';\n \n // return array\n return $paginatedQuery;\n }"
] |
[
"0.645927",
"0.645927",
"0.6202034",
"0.6115987",
"0.60907644",
"0.59424365",
"0.5937636",
"0.59297305",
"0.5910109",
"0.5906797",
"0.5900793",
"0.5849206",
"0.584784",
"0.5809814",
"0.5803371",
"0.57997847",
"0.5799642",
"0.5786645",
"0.5760852",
"0.5760852",
"0.5741508",
"0.5739217",
"0.57079285",
"0.56562877",
"0.565475",
"0.56541324",
"0.56522757",
"0.56495863",
"0.5621933",
"0.5615244"
] |
0.6612463
|
0
|
Test retrieving an Order.
|
public function testRetrieve()
{
VCR::insertCassette('orders/retrieve.yml');
$order = Order::create(Fixture::basicOrder());
$retrievedOrder = Order::retrieve($order->id);
$this->assertInstanceOf('\EasyPost\Order', $retrievedOrder);
$this->assertEquals($order->id, $retrievedOrder->id);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testRetrive()\n {\n $json = <<<JSON\n{\n \"order_id\": \"f3392f8b-6116-4073-ab96-e330819e2c07\",\n \"order_amount\": 50000,\n \"order_tax_amount\": 5000\n}\nJSON;\n\n $this->mock->append(\n new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $json\n )\n );\n\n $order = new Orders($this->connector, 'auth-token-123456');\n $this->assertEquals('auth-token-123456', $order->getId());\n\n $order->retrieve();\n\n $this->assertEquals('f3392f8b-6116-4073-ab96-e330819e2c07', $order['order_id']);\n $this->assertEquals(50000, $order['order_amount']);\n\n $request = $this->mock->getLastRequest();\n $this->assertEquals(Method::GET, $request->getMethod());\n $this->assertEquals(\n '/instantshopping/v1/authorizations/auth-token-123456',\n $request->getUri()->getPath()\n );\n\n $this->assertAuthorization($request);\n }",
"public function test(Order $order);",
"public function testGetOrder()\n {\n $test = new JMOpenAPI('2492','c23e916542d81afe429d91d5856b730b','00abede2bae6ebe0c3047b83e5ad75b48a7c111a');\n $res = $test->post('/Order/GetOrder');\n $this->assertEquals(array('error' => 1,'message' => 'page error!'),$res);\n }",
"private function fetchOrder()\n {\n $this->oOrder = Mage::getSingleton('sales/order');\n try {\n $this->oOrder->load($this->getParameter('orderid',self::REGEX_INTEGER));\n } catch (Exception $e) {\n $this->returnMessage = self::MESSAGE_INVALID_ORDER_ID;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n\n if(!$this->oOrder->getPayment() || substr($this->oOrder->getPayment()->getMethod(),0,3) != 'mcp') {\n $this->returnMessage = self::MESSAGE_NOT_MICROPAYMENT_ORDER;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n }",
"public function testCreateOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertNotEmpty($order_exists, 'The new order has been created in the database.');\n }",
"public function testGetOrderDetail(){\n \t\n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \t\n \n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t\n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => $authorizationResponse->transactionResponse->orderId,\n \t);\n \t\n \t$response = PayUReports::getOrderDetail($parameters);\n \t\n \t$this->assertNotNull($response);\n \t$this->assertEquals($authorizationResponse->transactionResponse->orderId, $response->id);\n \t \n }",
"public function testViewOrder() {\n $uid = $this->loggedInUser->id();\n\n $order_item = OrderItem::create([\n 'type' => 'default',\n 'quantity' => 2,\n 'unit_price' => new Price('12.00', 'USD'),\n ]);\n $order_item->save();\n\n /** @var \\Drupal\\commerce_order\\Entity\\Order $order */\n $order = Order::create([\n 'type' => 'default',\n 'state' => 'draft',\n 'uid' => $uid,\n 'order_items' => [$order_item],\n 'mail' => '[email protected]',\n 'order_number' => '1',\n 'store_id' => $this->store->id(),\n ]);\n $order->save();\n\n // Check that we can view the orders page.\n $this->drupalGet('/user/' . $uid . '/orders/');\n $this->assertSession()->statusCodeEquals(200);\n\n // Check that the draft order is not available.\n $this->assertSession()->linkByHrefNotExists('/user/' . $uid . '/orders/' . $order->id());\n // Verify the order cannot be viewed, either.\n $this->drupalGet('/user/' . $uid . '/orders/' . $order->id());\n $this->assertSession()->statusCodeEquals(403);\n\n $order->getState()->applyTransitionById('place');\n $order->save();\n\n // Check that the order is available.\n $this->drupalGet('/user/' . $uid . '/orders/');\n $this->assertSession()->linkByHrefExists('/user/' . $uid . '/orders/' . $order->id());\n\n // Click order and make sure it works.\n $this->getSession()->getPage()->clickLink($order->id());\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains($order->getEmail());\n }",
"function getOrder($orderId) {\n\techo \"Getting Order: \" . $orderId . \"</br>\";\n\t$response = getRequest('/api/order/' . $orderId);\n\tprintInfo($response);\n}",
"public function testGetOrderById()\n {\n }",
"public function testRouteOrderDetail()\n {\n $order = Order::with('user', 'orderdetails')->first();\n $this->browse(function (Browser $browser) use ($order) {\n $browser->loginAs(User::find(1))\n ->visit('/admin/order/'.$order->id)\n ->assertSee(\n 'Show detail Order',\n 'User Infomation',\n 'Name', 'Address',\n 'List Product',\n 'Name Product',\n $order->user->name,\n $order->address,\n $order->user->userInfo->phone,\n $order->orderDetails->first()->name_product,\n $order->orderDetails->first()->price\n );\n });\n }",
"public function testGetOrders()\n {\n }",
"public function testExample()\n {\n\n $order = \\App\\Order::orderByRaw(\"RAND()\")->with('products')->first();\n\n $orders = \\App\\Order::getByState('complite')->paginate(10);\n\n// print_r($orders);\n $this->assertNotEmpty($order->amount);\n\n }",
"public function testCreateOrder()\n {\n $result = OrdersService::create([\n 'title' => 'Test Order',\n 'state' => 'INITIAL',\n 'res_id' => 1,\n 'foods' => [1, 2],\n ]);\n\n $this->assertInstanceOf(Model::class, $result);\n }",
"public function testCanRetrieveRelatedRecordset()\n {\n\n $oOrder = new Test_Order();\n $oOrder->retrieve($this->db, 1);\n\n $this->assertTrue($oOrder->hasData());\n\n// $oLineItems = $oOrder->retrieve_lineItems($this->db);\n// $this->assertTrue($oLineItems instanceof Datastore_Records);\n// $this->assertEquals(2, $oLineItems->getCount());\n\n $aLineItems = $oOrder->retrieve_lineItems($this->db);\n\n $this->assertTrue(is_array($aLineItems));\n $this->assertEquals(2, count($aLineItems));\n }",
"function getSelectedOrder($orderId) {\n try {\n // get DB connection\n $db = new DbOperation();\n $orders = $db->getSelectedOrder ($orderId);\n if ( $orders != null ) {\n echo '{\"gotOrder\":' . json_encode ( $orders ) . '}';\n } else {\n echo '{\"error\":{\"text\":' . \"Failed to get orders data\" . '}}';\n }\n } catch ( Exception $e ) {\n echo '{\"error\":{\"text\":' . $e->getMessage () . '}}';\n }\n}",
"public function retornoTeste()\r\n {\r\n $orderId = Mage::getSingleton(\"core/session\")->getPayOrderId();\r\n $this->log('orderId: '.$orderId);\r\n //$this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);\r\n $this->_order = Mage::getModel('sales/order')->load($orderId);\r\n \r\n //$this->log('_order_: '. var_dump($this->_order));\r\n $this->processEvo(Mage::getSingleton(\"core/session\")->getPayEvoOrderId());\r\n }",
"private function readAll()\n {\n $response = $this->createClient()->v1()->orders()->get();\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public function testCanRetrieveRelatedRecordWithView()\n {\n\n $oOrder = new Test_Order();\n $oOrder->retrieve($this->db, 1);\n\n $this->assertTrue($oOrder->hasData());\n\n // step 1: prove that, by default, we get information\n // that isn't in the view\n\n $oCustomer = $oOrder->retrieve_customer($this->db);\n $this->assertTrue($oCustomer instanceof Test_Customer);\n $this->assertEquals(1, $oCustomer->getUniqueId());\n $this->assertEquals('Stuart', $oCustomer->customerFirstName);\n $this->assertEquals('Herbert', $oCustomer->customerSurname);\n $this->assertTrue(isset($oCustomer->customerAddress1));\n\n // step 2: now prove that the view only has a subset of\n // the information\n\n $GLOBALS['VAR_DUMP'] = true;\n $oCustomer = $oOrder->retrieve_customer_name($this->db);\n $GLOBALS['VAR_DUMP'] = false;\n $this->assertTrue($oCustomer instanceof Test_Customer);\n $this->assertEquals(1, $oCustomer->getUniqueId());\n $this->assertEquals('Stuart', $oCustomer->customerFirstName);\n $this->assertEquals('Herbert', $oCustomer->customerSurname);\n $this->assertFalse(isset($oCustomer->customerAddress1));\n }",
"public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;",
"public function testMakeOrderAndGetArrayOfValue(){\r\n $sqlToDeleteOrder = \"delete from orders where orderNo=1000\";\r\n $sql = \"INSERT INTO `zqqzsvykt8d5j90x`.`orders` (`orderNo`, `accountNo`, `destination`, `pickUp`, `receiversName`, `receiversContact`, `status`) VALUES ('1000', '2', 'n', 'n', 'n', 'n', 'n');\";\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $deleted = $db->runASqlQuery($sqlToDeleteOrder);\r\n if($deleted){\r\n $success = $db->makeOrder($sql);\r\n $this->assertEquals(true,$success);\r\n $sql = \"select * from orders where orderNo=1000\";\r\n $orderResult = $db->getArrayOfValues($sql);\r\n $this->assertEquals(1,count($orderResult));\r\n }\r\n }",
"public function the_endpoint_should_return_all_orders()\n {\n $card = CreditCard::factory()->create();\n $orders = Order::factory()->create();\n \n $response = $this->get('/api/orders');\n\n dd($response->json());\n $response->assertStatus(200);\n $response->assertJsonStructure([\n 'orders' => [\n '*' => [\n 'id',\n 'credit_card_id',\n 'user_id',\n \n ]\n ]\n ]);\n $this->assertDatabaseCount('orders', 1);\n }",
"public function testOrdersPage()\n {\n $response = $this->get(route('orders.index'));\n $response->assertStatus(200);\n }",
"public function testDeleteOrder()\n {\n }",
"public function getOrderById($orderId)\n {\n }",
"public function getOrderById($order_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"orders/$order_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $order_data=json_decode($string);\n \n return $order_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos order save helper', [\"Get order error\"=>$e->getMessage()]);\n return false;\n }\n }",
"public function testDeleteOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n $order->delete();\n\n $order_exists = (bool) Order::load($order->id());\n $order_item_exists = (bool) OrderItem::load($order_item->id());\n $this->assertEmpty($order_exists, 'The new order has been deleted from the database.');\n $this->assertEmpty($order_item_exists, 'The matching order item has been deleted from the database.');\n }",
"abstract public function getOrderAble();",
"public function test_ShouldStorePurchaseOrder()\n {\n $response = $this->storePurchaseOrder();\n dump( json_decode($response->content(), JSON_PRETTY_PRINT) );\n $response->assertStatus(201)\n ->assertJson([\n 'status' => 'success',\n 'http_status_code' => 201,\n ])\n ->assertJsonStructure([\n 'status',\n 'http_status_code',\n 'purchase_order_id',\n ]);\n $obj = json_decode( $response->content() );\n\n return $obj->purchase_order_id;\n }",
"public function read($order_id) {\n\n global $user;\n\n //watchdog('musth_restws', 'W7D001 5DXS OrderResourceController start read (!i) (!p) ',\n // array('!i' => print_r($order_id, true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n $order_as_array = entity_load('commerce_order', array($order_id));\n $order = $order_as_array[$order_id];\n\n // The order total, which is in the field commerce_order_total, is calculated\n // automatically when the order is refreshed, which happens at least when we\n // call the line item api to get all the line items of an order\n\n // Refreshing the order in case any product changed its price or there are other\n // changes to take care of\n\n // Since we refresh the order here, there is no need to do it when we load\n // line items. Just call the order query api first and then the line item query api\n\n if ($order->status == 'cart')\n commerce_cart_order_refresh($order);\n\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n //watchdog('musth_restws', 'W7D001 71788 kkk OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n if (isset($order->commerce_customer_billing[LANGUAGE_NONE]))\n $customer_profile_id = $order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id'];\n else\n $customer_profile_id = 0;\n\n if ($user->uid) {\n // For logged-in users we can send back the email address\n\n $user_email = $order->mail;\n\n } else {\n // For anonymous users we can't\n\n $user_email = 'Cant send you the email address for privacy';\n }\n\n $order_to_return = new Order($order->order_id,\n $order->order_number,\n $order->uid,\n $user_email,\n $customer_profile_id,\n $order->status,\n $order_wrapper->commerce_order_total->amount->value(),\n $order_wrapper->commerce_order_total->currency_code->value(),\n $order->created,\n $order->changed\n );\n\n //watchdog('musth_restws', 'W7D001 7171 OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n // Sending back the Order object\n\n return $order_to_return;\n }",
"public function testFindByOrderId(): void\n {\n $order_callback = OrderCallback::findByOrderId(9);\n $this->assertIsObject($order_callback);\n\n $this->assertObjectHasAttribute('errors', $order_callback);\n $this->assertObjectHasAttribute('id', $order_callback);\n $this->assertObjectHasAttribute('order_id', $order_callback);\n $this->assertObjectHasAttribute('callback_url', $order_callback);\n $this->assertObjectHasAttribute('is_callback_sent', $order_callback);\n }"
] |
[
"0.81425124",
"0.736507",
"0.72479665",
"0.7115802",
"0.69687515",
"0.6968065",
"0.69535375",
"0.69217134",
"0.6880942",
"0.67449266",
"0.6727449",
"0.67012167",
"0.6696549",
"0.6664464",
"0.659774",
"0.6544686",
"0.650377",
"0.6492715",
"0.64852",
"0.6447323",
"0.64456445",
"0.6396538",
"0.6391087",
"0.63899505",
"0.636856",
"0.6337086",
"0.6316769",
"0.6299963",
"0.629969",
"0.6272156"
] |
0.81376964
|
1
|
Test retrieving rates for a order.
|
public function testGetRates()
{
VCR::insertCassette('orders/getRates.yml');
$order = Order::create(Fixture::basicOrder());
$rates = $order->get_rates();
$ratesArray = $rates['rates'];
$this->assertIsArray($ratesArray);
$this->assertContainsOnlyInstancesOf('\EasyPost\Rate', $ratesArray);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testGetRates()\n {\n $response = [\n 'disclaimer' => 'https://openexchangerates.org/terms/',\n 'license' => 'https://openexchangerates.org/license/',\n 'timestamp' => 1449877801,\n 'base' => 'USD',\n 'rates' => [\n 'EUR' => 0.935485,\n 'AFN' => 66.809999,\n 'ALL' => 125.716501,\n 'AMD' => 484.902502,\n 'ANG' => 1.788575,\n 'AOA' => 135.295998,\n 'ARS' => 9.750101,\n 'AUD' => 1.390866\n ]\n ];\n $response_json = json_encode($response);\n $mock = new MockHandler([\n new Response(200, [], $response_json)\n ]);\n $handler = HandlerStack::create($mock);\n $client = new Client(['handler' => $handler]);\n\n $driver = new OpenExchangeRatesDriver(\n $client,\n 'http://openexchangerates.org/api/latest.json'\n );\n $data = $driver->getRates();\n $this->assertEquals($data, $response['rates']);\n }",
"public function getRate($orderPrice, $orderWeight, Varien_Object $config ) \n { \n $code = $config->getSystemPath();\n Mage::log(\"destination coutnry {$config->getDestCountry()}\");\n if($config->getMultiprices()){\n $ratePath = sprintf('carriers/%s/price_%s',$code, $config->getDestCountry());\n }else{\n $ratePath = sprintf('carriers/%s/%s',$code, $config->getPriceCode());\n }\n \n $result = Mage::getStoreConfig($ratePath);\n if(!$result){\n Mage::log(\"no rate for code $code and path $ratePath\" );\n \n return FALSE;\n }\n $pickupShippingRates = unserialize($result); \n if (is_array($pickupShippingRates) && !empty($pickupShippingRates)) {\n foreach ($pickupShippingRates as $pickupShippingRate) {\n if( (float)$pickupShippingRate['orderminprice'] <= (float)$orderPrice\n && ( (float)$pickupShippingRate['ordermaxprice'] >= (float)$orderPrice || (float)$pickupShippingRate['ordermaxprice'] == 0)\n && (float)$pickupShippingRate['orderminweight'] <= (float)$orderWeight\n && ( (float)$pickupShippingRate['ordermaxweight'] >= (float)$orderWeight || (float)$pickupShippingRate['ordermaxweight'] == 0)\n ) {\n return $pickupShippingRate['price'];\n }\n }\n }\n }",
"public function getStoreToOrderRate();",
"public function testRetrieveExchangeRates()\n {\n\n // Set callback and perform API call\n $result = null;\n self::$controller->setHttpCallBack($this->httpResponse);\n try {\n $result = self::$controller->getExchangeRates();\n } catch (APIException $e) {\n }\n\n // Test response code\n $this->assertEquals(\n 200,\n $this->httpResponse->getResponse()->getStatusCode(),\n \"Status is not 200\"\n );\n\n // Test whether the captured response is as we expected\n $this->assertNotNull($result, \"Result does not exist\");\n\n $this->assertTrue(\n TestHelper::isJsonObjectProperSubsetOf(\n \"{\\n\t\\\"disclaimer\\\": \\\"Exchange rates are provided here for reference. They are updated at least once\" .\n \" a day and may have changed by time of order.\\\",\\n\t\\\"exchangeRates\\\": [{\\n\t\t\\\"lastModifiedDate\\\": \\\"\" .\n \"2018-04-19T13:00:14.291\\\",\\n\t\t\\\"rewardCurrency\\\": \\\"EUR\\\",\\n\t\t\\\"baseCurrency\\\": \\\"NZD\\\",\\n\t\t\\\"baseFx\" .\n \"\\\": 0.59120\\n\t}, {\\n\t\t\\\"lastModifiedDate\\\": \\\"2018-04-19T13:00:14.291\\\",\\n\t\t\\\"rewardCurrency\\\": \\\"US\" .\n \"D\\\",\\n\t\t\\\"baseCurrency\\\": \\\"NZD\\\",\\n\t\t\\\"baseFx\\\": 0.73130\\n\t}, {\\n\t\t\\\"lastModifiedDate\\\": \\\"2018-04-\" .\n \"19T13:00:14.230\\\",\\n\t\t\\\"rewardCurrency\\\": \\\"INR\\\",\\n\t\t\\\"baseCurrency\\\": \\\"AUD\\\",\\n\t\t\\\"baseFx\\\": 51.2\" .\n \"9066\\n\t}]\\n}\",\n $this->httpResponse->getResponse()->getRawBody(),\n false,\n true,\n false\n ),\n \"Response body does not match in keys\"\n );\n }",
"public function testGetExchangeRates()\n {\n $result = $this->currencyAPIService->getExchangeRates();\n $this->assertIsArray($result);\n $this->assertArrayHasKey('content', $result);\n $this->assertTrue($result['status']);\n $this->assertJson($result['content']);\n $content = json_decode($result['content'], true);\n $this->assertArrayHasKey('rates', $content);\n }",
"private function getOrders()\n {\n $OD = $this->dbclient->coins->OwnOrderBook;\n\n $ownOrders = $OD->find(\n array('$or'=>\n array(array('Status'=>'buying'), array('Status'=>'selling'))\n ));\n\n $output = ' {\n \"success\" : true,\n \"message\" : \"\",\n \"result\" : [';\n foreach ($ownOrders as $ownOrder) {\n\n if ($ownOrder) {\n if ($ownOrder->Status == 'buying' or $ownOrder->Status == 'selling') {\n $uri = $this->baseUrl . 'public/getorderbook';\n $params['market'] = $ownOrder->MarketName;\n if ($ownOrder->Status == 'buying') {\n $params['type'] = 'sell';\n $params['uuid'] = $ownOrder->BuyOrder->uuid;\n $limit = 'buy';\n } elseif ($ownOrder->Status == 'selling') {\n $params['type'] = 'buy';\n $params['uuid'] = $ownOrder->SellOrder->uuid;\n $limit = 'sell';\n }\n\n if (!empty($params)) {\n $uri .= '?' . http_build_query($params);\n }\n\n $sign = hash_hmac('sha512', $uri, $this->apiSecret);\n $ch = curl_init($uri);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign: ' . $sign));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n $answer = json_decode($result);\n $success = false;\n $quantity = 0;\n $rate = 0;\n\n if ($answer->success == true) {\n $closest_rate = $answer->result[0]->Rate;\n\n if ($ownOrder->Status == 'buying' && $ownOrder->BuyOrder->Rate >= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if ($ownOrder->Status == 'selling' && $ownOrder->SellOrder->Rate <= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if (!$success) {\n $output = $output.'{\n \"AccountId\" : null,\n \"OrderUuid\" : \"' . $params['uuid'] . '\",\n \"Exchange\" : \"' . $params['market'] . '\",\n \"Type\" : \"LIMIT_' . strtoupper($limit) . '\",\n \"Quantity\" : ' . $quantity . ',\n \"QuantityRemaining\" : 0.00000000,\n \"Limit\" : 0.00000001,\n \"Reserved\" : 0.00001000,\n \"ReserveRemaining\" : 0.00001000,\n \"CommissionReserved\" : 0.00000002,\n \"CommissionReserveRemaining\" : 0.00000002,\n \"CommissionPaid\" : 0.00000000,\n \"Price\" : ' . $rate . ',\n \"PricePerUnit\" : ' . $closest_rate . ',\n \"Opened\" : \"2014-07-13T07:45:46.27\",\n \"Closed\" : null,\n \"IsOpen\" : true,\n \"Sentinel\" : \"6c454604-22e2-4fb4-892e-179eede20972\",\n \"CancelInitiated\" : false,\n \"ImmediateOrCancel\" : false,\n \"IsConditional\" : false,\n \"Condition\" : \"NONE\",\n \"ConditionTarget\" : null\n },';\n\n }\n }\n }\n }\n }\n $output = rtrim($output, ',').']\n}';\n return $output;\n }",
"public function testRetrive()\n {\n $json = <<<JSON\n{\n \"order_id\": \"f3392f8b-6116-4073-ab96-e330819e2c07\",\n \"order_amount\": 50000,\n \"order_tax_amount\": 5000\n}\nJSON;\n\n $this->mock->append(\n new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $json\n )\n );\n\n $order = new Orders($this->connector, 'auth-token-123456');\n $this->assertEquals('auth-token-123456', $order->getId());\n\n $order->retrieve();\n\n $this->assertEquals('f3392f8b-6116-4073-ab96-e330819e2c07', $order['order_id']);\n $this->assertEquals(50000, $order['order_amount']);\n\n $request = $this->mock->getLastRequest();\n $this->assertEquals(Method::GET, $request->getMethod());\n $this->assertEquals(\n '/instantshopping/v1/authorizations/auth-token-123456',\n $request->getUri()->getPath()\n );\n\n $this->assertAuthorization($request);\n }",
"public function testCollectUnavailableRates(): void\n {\n //phpcs:ignore Magento2.Functions.DiscouragedFunction\n $responseBody = file_get_contents(__DIR__ .'/../Fixtures/response_rates.xml');\n $this->httpClient->nextResponses([new Response(200, [], $responseBody)]);\n /** @var RateRequest $request */\n $request = Bootstrap::getObjectManager()->create(\n RateRequest::class,\n [\n 'data' => [\n 'dest_country_id' => 'CA',\n 'dest_postcode' => 'M5V 3G5',\n 'dest_country_name' => 'Canada',\n 'package_value' => '3.2568',\n 'package_value_with_discount' => '5',\n 'package_weight' => '5',\n 'package_qty' => '1',\n 'package_physical_value' => '5',\n 'free_method_weight' => '5',\n 'store_id' => '1',\n 'website_id' => '1',\n 'free_shipping' => '0',\n 'limit_carrier' => 'null',\n 'base_subtotal_incl_tax' => '5',\n 'orig_country_id' => 'US',\n 'country_id' => 'US',\n 'region_id' => '12',\n 'city' => 'Culver City',\n 'postcode' => '90034',\n 'usps_userid' => '213MAGEN6752',\n 'usps_container' => 'VARIABLE',\n 'usps_size' => 'REGULAR',\n 'girth' => null,\n 'height' => null,\n 'length' => null,\n 'width' => null,\n ]\n ]\n );\n\n $rates = $this->carrier->collectRates($request);\n $this->assertCount(5, $rates->getAllRates());\n }",
"public function testGetUserRate()\n {\n// $rate = $this->em\n// ->getRepository('WidgetBundle:Users')\n// ->getUserRate(1);\n//\n// $this->assertEquals(23, $rate[0]['rate']);\n $this->assertEquals(23, 23);\n }",
"public function testBuyRateObject()\n {\n VCR::insertCassette('orders/buyRateObject.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy($order->rates[0]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"public function testGetRatesException()\n {\n $mock = new MockHandler([\n new Response(200, [])\n ]);\n $handler = HandlerStack::create($mock);\n $client = new Client(['handler' => $handler]);\n\n $driver = new OpenExchangeRatesDriver(\n $client,\n 'http://openexchangerates.org/api/latest.json'\n );\n $driver->getRates();\n }",
"public function getBaseToOrderRate();",
"public static function getRates() {\n $result = self::get(self::getPath('rates'));\n \n Return $result;\n }",
"public function hasRates()\n {\n return $this->getInvoker()->getNbRates() > 0;\n }",
"public function getRate(Currency $currency);",
"public function get_rates() {\n\t\t$rates = self::make_api_call( 'rates' );\n\t\tif ( 'ok' === $rates['error'] ) {\n\t\t\treturn $rates['result'];\n\t\t}\n\t\treturn array();\n\t}",
"public function testReturnsRateMethodWithEstablishedParamsForCollectRatesMethod()\n {\n $carrier = $this->expected()->getCarrier();\n $configTitle = $this->expected()->getConfigTitle();\n $method = $this->expected()->getMethodName();\n $price = $this->expected()->getPrice();\n\n $modelCarrierMock = $this->getModelMock('oggetto_shipping/carrier', ['getConfigData']);\n\n $modelCarrierMock->expects($this->once())\n ->method('getConfigData')\n ->with('title')\n ->willReturn($configTitle);\n\n $this->replaceByMock('model', 'oggetto_shipping/carrier', $modelCarrierMock);\n\n\n $modelRateMethodMock = $this->getModelMock('shipping/rate_result_method', [\n 'setCarrier', 'setCarrierTitle',\n 'setMethod', 'setMethodTitle',\n 'setPrice', 'setCost'\n ]);\n\n $modelRateMethodMock->expects($this->once())\n ->method('setCarrier')\n ->with($carrier);\n\n $modelRateMethodMock->expects($this->once())\n ->method('setCarrierTitle')\n ->with($configTitle);\n\n $modelRateMethodMock->expects($this->once())\n ->method('setMethod')\n ->with($method);\n\n $modelRateMethodMock->expects($this->once())\n ->method('setMethodTitle')\n ->with(ucfirst($method));\n\n $modelRateMethodMock->expects($this->once())\n ->method('setPrice')\n ->with($price);\n\n $modelRateMethodMock->expects($this->once())\n ->method('setCost')\n ->with($price);\n\n $this->replaceByMock('model', 'shipping/rate_result_method', $modelRateMethodMock);\n\n $this->assertEquals($modelRateMethodMock, $modelCarrierMock->getRateMethod($method, $price));\n }",
"function getExchangeRate($currency);",
"public function testScheduledUpdateCurrencyRates()\n {\n $url = str_replace('{{CURRENCY_FROM}}', 'USD',\n \\Magento\\Directory\\Model\\Currency\\Import\\Webservicex::CURRENCY_CONVERTER_URL);\n $url = str_replace('{{CURRENCY_TO}}', 'GBP', $url);\n try {\n file_get_contents($url);\n } catch (\\PHPUnit_Framework_Error_Warning $e) {\n $this->markTestSkipped('http://www.webservicex.net is unavailable ');\n }\n\n $allowedCurrencies = 'USD,GBP,EUR';\n $this->configResource->saveConfig(\n $this->allowedCurrenciesPath,\n $allowedCurrencies,\n ScopeInterface::SCOPE_STORE,\n 0\n );\n $this->observer->scheduledUpdateCurrencyRates(null);\n /** @var Currency $currencyResource */\n $currencyResource = $this->objectManager\n ->create('Magento\\Directory\\Model\\CurrencyFactory')\n ->create()\n ->getResource();\n $rates = $currencyResource->getCurrencyRates($this->baseCurrency, explode(',', $allowedCurrencies));\n $this->assertNotEmpty($rates);\n }",
"public function getRates()\n {\n $this->uri = \"/?section=shipping&action=getRates\";\n \n return $this->send();\n }",
"public function collectRates(RateRequest $requestData)\n {\n \t$shippingConfig = $this->_shippingCollection->loadOrderShipping($requestData->getVendorId());\n \tif (!$this->getConfigData(self::ACTIVE) && !$shippingConfig[self::ACTIVE]) {\n return false;\n }\n\n $shippingRates = $this->_shippingCollection->getRateRanger($shippingConfig[self::RATES]);\n $orderAmount = $this->getOrderAmount($requestData);\n $shippingPrice = false;\n\n \tif(empty($shippingRates)) {\n \t\treturn false;\n \t}\n\t foreach($shippingRates as $rateData) {\n\t \tif($orderAmount >= $rateData[self::MIN_AMOUNT] && $orderAmount <= $rateData[self::MAX_AMOUNT]) {\n\t \t\t$shippingPrice = $rateData[self::SHIPPING_PRICE_DATA];\n\t \t\tbreak;\n\t \t}\n\t }\n\t $rateResult = $this->_rateResultFactory->create();\n\t if ($shippingPrice !== false) {\n\t \t$rateMethod = $this->_rateMethodFactory->create();\n\t \t$rateMethod->setCarrier(self::VENDOR_ORDER_RATE);\n\t\t $rateMethod->setCarrierTitle($this->getConfigData(self::TITLE));\n\t\t /**\n\t\t * Displayed as shipping method under Carrier\n\t\t */\n\t\t $rateMethod->setMethod(self::ORDER_RATE);\n\t\t $rateMethod->setMethodTitle($this->getConfigData(self::SHIPPING_NAME));\n\t\t if ($requestData->getFreeShipping() === true || $requestData->getPackageQty() == $this->getFreeBoxes()) {\n $shippingPrice = self::SHIPPING_PRICE;\n }\n $rateMethod->setPrice($shippingPrice);\n\t\t $rateMethod->setCost($shippingPrice);\n\t\t $rateResult->append($rateMethod);\n\t }\n\t return $rateResult;\n }",
"public function testCollectRates(): void\n {\n $requestXml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><RateV4Request USERID=\"213MAGEN6752\">'\n .'<Revision>2</Revision><Package ID=\"0\"><Service>ALL</Service><ZipOrigination>90034</ZipOrigination>'\n .'<ZipDestination>90032</ZipDestination><Pounds>4</Pounds><Ounces>4.2512000000</Ounces>'\n .'<Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>true</Machinable></Package>'\n .'</RateV4Request>';\n $requestXml = (new \\SimpleXMLElement($requestXml))->asXml();\n //phpcs:ignore Magento2.Functions.DiscouragedFunction\n $responseBody = file_get_contents(__DIR__ .'/../Fixtures/success_usps_response_rates.xml');\n $this->httpClient->nextResponses([new Response(200, [], $responseBody)]);\n /** @var RateRequest $request */\n $request = Bootstrap::getObjectManager()->create(\n RateRequest::class,\n [\n 'data' => [\n 'dest_country_id' => 'US',\n 'dest_region_id' => '12',\n 'dest_region_code' => 'CA',\n 'dest_street' => 'main st1',\n 'dest_city' => 'Los Angeles',\n 'dest_postcode' => '90032',\n 'package_value' => '5',\n 'package_value_with_discount' => '5',\n 'package_weight' => '4.2657',\n 'package_qty' => '1',\n 'package_physical_value' => '5',\n 'free_method_weight' => '5',\n 'store_id' => '1',\n 'website_id' => '1',\n 'free_shipping' => '0',\n 'limit_carrier' => 'null',\n 'base_subtotal_incl_tax' => '5',\n 'orig_country_id' => 'US',\n 'country_id' => 'US',\n 'region_id' => '12',\n 'city' => 'Culver City',\n 'postcode' => '90034',\n 'usps_userid' => '213MAGEN6752',\n 'usps_container' => 'VARIABLE',\n 'usps_size' => 'REGULAR',\n 'girth' => null,\n 'height' => null,\n 'length' => null,\n 'width' => null,\n ]\n ]\n );\n\n $rates = $this->carrier->collectRates($request);\n $httpRequest = $this->httpClient->getLastRequest();\n $this->assertNotEmpty($httpRequest);\n //phpcs:ignore Magento2.Functions.DiscouragedFunction\n $uri = parse_url($httpRequest->getUrl(), PHP_URL_QUERY);\n $this->assertNotEmpty(preg_match('/API\\=([A-z0-9]+)/', $uri, $matches));\n $apiV = $matches[1];\n unset($matches);\n $this->assertEquals('RateV4', $apiV);\n $this->assertNotEmpty(preg_match('/XML\\=([^\\&]+)/', $uri, $matches));\n $xml = urldecode($matches[1]);\n $this->assertEquals($requestXml, $xml);\n $this->assertNotEmpty($rates->getAllRates());\n $this->assertEquals(5.6, $rates->getAllRates()[2]->getPrice());\n $this->assertEquals(\n \"Priority Mail 1-Day\\nSmall Flat Rate Envelope\",\n $rates->getAllRates()[2]->getMethodTitle()\n );\n }",
"public function getExchangeRate(Request $request)\n {\n try {\n $validator = Validator::make($request->all(), [\n 'base' => 'required',\n 'target' => 'required',\n 'date' => 'required|date'\n ]);\n\n if ($validator->fails()) {\n return response()->json([\n 'status' => false,\n 'message' => $validator->errors()\n ], 200);\n }\n\n if ($request->base == $request->target) {\n return response()->json([\n 'status' => true,\n 'rate' => 1\n ], 200);\n } else {\n $model = ForeignCurrencyTransactionSettings::query()\n ->whereIn('business_account_id', getDependentUserIds())\n ->where('base_currency', '=', $request->base)\n ->where('foreign_exchange_currency', '=', $request->target)\n ->first();\n\n if ($model) {\n $exchangeRates = ExchangeRates::query()->where('foreign_currency_id', '=', $model->id)\n ->where('date', '=', Carbon::parse($request->date)->format('Y-m-d'))\n ->first();\n if ($exchangeRates) {\n return response()->json([\n 'status' => true,\n 'rate' => $exchangeRates->rate\n ], 200);\n }\n } else {\n $model = ForeignCurrencyTransactionSettings::query()\n ->whereIn('business_account_id', getDependentUserIds())\n ->where('base_currency', '=', $request->target)\n ->where('foreign_exchange_currency', '=', $request->base)\n ->first();\n\n $exchangeRates = ExchangeRates::query()->where('foreign_currency_id', '=', $model->id)\n ->where('date', '=', Carbon::parse($request->date)->format('Y-m-d'))\n ->first();\n if ($exchangeRates) {\n return response()->json([\n 'status' => true,\n 'rate' => round(1/(float)$exchangeRates->rate, 2) //dividing by 1 as we have now changed the exchange rate\n ], 200);\n }\n }\n return response()->json([\n 'status' => true,\n 'rate' => 1\n ], 200);\n\n }\n } catch (\\Exception $e) {\n return response()->json([\n 'status' => false,\n 'message' => $e->getMessage()\n ], 200);\n }\n }",
"public function getUseExchangeRates();",
"private function readAll()\n {\n $response = $this->createClient()->v1()->orders()->get();\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public function getRates()\n {\n return $this->_rates;\n }",
"public function testShouldAllowToGetCryptocurrencyRating()\n {\n define(\"COINMARKETCAP_URL\", $this->host);\n\n $cryptorating = new CryptoRating();\n $rating = $cryptorating->get();\n//file_put_contents(__DIR__ . \"/expected.json\", json_encode($rating));\n $expected = json_decode(file_get_contents(__DIR__ . \"/expected.json\"), true);\n $this->assertEquals($expected, $rating);\n }",
"public function test_amount_less_than_rate_cost()\n {\n\n\n\n $data=[\"amount\"=> 100,\n \"unpaid_appliance_rates\"=> 2,\n \"appliance_rate_cost\"=> 200,\n \"tariff_fixed_costs\"=> 160,\n \"price_per_kwh\"=> 700\n ];\n\n $response = $this->post('/api/transactions', $data);\n // $response->assertStatus(200);\n $response->assertJson( [\"data\"=> [\n \"type\"=> \"transaction\",\n \"attributes\"=> [\n \"paid_for_appliance_rates\"=> 0,\n \"fully_covered_appliance_rate\"=> 0,\n \"paid_for_fixed_tariff\"=> 100,\n \"paid_for_energy\"=> 0,\n \"topup_for_energy\"=> 0,\n \"sold_energy\"=> 0\n ]\n ]]);\n }",
"public function fetchRates()\n {\n $res = $this->_fetch($this->_cfg['ratesUri']);\n\n return $res;\n }",
"public function getRates()\n {\n # Convert the rates to a key / value array:\n return json_decode( json_encode($this->rates), true );\n }"
] |
[
"0.66950476",
"0.6552656",
"0.6505562",
"0.6462803",
"0.6411631",
"0.624473",
"0.6161153",
"0.6067619",
"0.6064549",
"0.6054592",
"0.60326797",
"0.59568435",
"0.59221923",
"0.5867306",
"0.5833505",
"0.58219004",
"0.58121485",
"0.5807116",
"0.5738694",
"0.5731453",
"0.5718758",
"0.5717249",
"0.571665",
"0.570497",
"0.5692109",
"0.5672917",
"0.56664526",
"0.5654605",
"0.56474346",
"0.5605244"
] |
0.7613437
|
0
|
Test buying an Order.
|
public function testBuy()
{
VCR::insertCassette('orders/buy.yml');
$order = Order::create(Fixture::basicOrder());
$order->buy([
'carrier' => Fixture::usps(),
'service' => Fixture::uspsService(),
]);
$shipmentsArray = $order['shipments'];
foreach ($shipmentsArray as $shipment) {
$this->assertNotNull($shipment->postage_label);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testBuy()\n {\n VCR::insertCassette('pickups/buy.yml');\n\n $shipment = Shipment::create(Fixture::oneCallBuyShipment());\n\n $pickupData = Fixture::basicPickup();\n $pickupData['shipment'] = $shipment;\n\n $pickup = Pickup::create($pickupData);\n\n $boughtPickup = $pickup->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::pickupService(),\n ]);\n\n $this->assertInstanceOf('\\EasyPost\\Pickup', $boughtPickup);\n $this->assertStringMatchesFormat('pickup_%s', $boughtPickup->id);\n $this->assertNotNull($boughtPickup->confirmation);\n $this->assertEquals('scheduled', $boughtPickup->status);\n }",
"public function testPurchaseFlow()\n\t{\n\t\t// Prepare\n\n\t\t$user = factory('App\\User')->create(['password' => Hash::make('laravel-shop')]);\n\n\t\t$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);\n\n\t\t$cart = App\\Cart::current()\n\t\t\t->add(['sku' => '0001', 'price' => 1.99])\n\t\t\t->add(['sku' => '0002', 'price' => 2.99]);\n\n\t\tShop::setGateway('testPass');\n\n\t\tShop::checkout();\n\n\t\t$order = Shop::placeOrder();\n\n\t\t$this->assertNotNull($order);\n\n\t\t$this->assertNotEmpty($order->id);\n\n\t\t$this->assertTrue($order->isCompleted);\n\n\t\t$user->delete();\n\t}",
"public function purchaseTest()\n {\n\t $this->json('POST','/compraproducto', [\n 'user_id' => '15',\n 'product_id' => '31',\n 'quantity' => '9',\n 'payment'=>'2878.29',\n ]);\n\t $this->assertDatabaseHas('purchases', ['user_id' => '15']);\n }",
"public function testSuccessOrder()\n {\n $user = User::factory()->create([\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => 'asdqwe123'\n ]);\n $orderData = [\n 'product_id' => 1,\n 'quantity' => 1\n ];\n $this->actingAs($user,'api_user');\n\n $this->json('POST', 'api/order',$orderData, ['Accept' => 'application/json'])\n ->assertStatus(201)\n ->assertJson([\n 'message' => 'You have successfully ordered this product'\n ]);\n }",
"public function testCreatePurchase()\n {\n print \"testPurchase()\\n\";\n\n // TODO: Impl\n\n $this->fail();\n }",
"public function test(Order $order);",
"public function testBuyRateObject()\n {\n VCR::insertCassette('orders/buyRateObject.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy($order->rates[0]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"public function test_payOrder_called_withOrderNoSubscriptionShouldRechargeWallet()\n {\n $expected = Wallet::create(6200,0);\n $user = UserMother::aUserWith50Eur()->build();\n $order = OrderMother::aJustOrder()->buildANewWay();\n $entityManager_stub = $this->getEntityManagerDouble();\n $entityManager_stub->persist($user)->shouldBeCalled();\n $entityManager_stub->flush($user)->shouldBeCalled();\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $actual = $sut->payOrder($user,$order);\n $this->assertEquals($expected,$actual->getWallet());\n }",
"public function testCreateOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertNotEmpty($order_exists, 'The new order has been created in the database.');\n }",
"public function test_order_with_successful_response()\n {\n $token = $this->authenticate();\n\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $response = $this->post(\n '/api/order',\n [\n 'product_id' => $product->id,\n 'quantity' => 1,\n ],\n [\n 'Authorization' => sprintf('Bearer %s', $token),\n 'Accept' => 'application/json',\n ]\n );\n\n $response->assertStatus(201)\n ->assertExactJson(['message' => 'You have sucessfully ordered this product.']);\n }",
"public function testPaid()\n {\n $this->browse(function (Browser $browser) {\n $balance = Balance::factory()->create([\n 'tenant_id' => $this->tenant->id,\n 'type' => Balance::TYPE_DEBIT,\n 'status' => Balance::STATUS_DONE,\n 'amount' => 9000\n ]);\n\n $bill = Bill::factory()->create([\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'tenant_id' => $this->tenant->id,\n ]);\n $service = $bill->services()->save(Service::factory()->make([\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ]));\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->press('Оплатить')\n ->assertSee('Оплачен')\n ->visit('/tenants/'.$this->tenant->id.'?tab=balances#tab')\n ->assertSee('Кредит');\n });\n }",
"public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}",
"function xtestLive(){\n $this->clearAll();\n \n $seller = $this->createUser('seller');\n $evt = $this->createEvent('Quebec CES' , $seller->id, $this->createLocation()->id, date('Y-m-d', strtotime(\"+1 day\")) );\n $this->setEventId($evt, 'aaa');\n $cat = $this->createCategory('Verde', $evt->id, 10.00);\n \n \n \n //Transaction setup\n $foo = $this->createUser('foo');\n \n //let's buy\n $buyer = new \\WebUser($this->db);\n $buyer->login($foo->username);\n\n //let's pay\n Utils::clearLog();\n \n $buyer->addToCart($cat->id, 3); //cart in session\n \n $data = $this->getCCPurchaseData();\n //$data['street'] = 'N ' . $data['street']; //fail avs\n $data['cc_cvd'] = '666'; //fail cvd \n \n $payer = $this->createInstance('foo');\n $payer->setData($data);\n $payer->setCart($buyer->getCart());\n //$payer->amount_override = '0.25'; //hardcoded fail\n $payer->process();\n \n $this->assertFalse($payer->success()); \n }",
"public function test_OrderSuccess()\n {\n $productData = [\n \"product_id\" => 1,\n \"quantity\" => 2\n ];\n\n $this->json('POST', 'api/order', $productData, ['Accept' => 'application/json','Authorization'=> 'Bearer 9|DZ10PpjAHgx8Ez7kH9husUoQE5V3a6VMx86v1ZAa'])\n ->assertStatus(201)\n ->assertJson([\n \"message\" => \"You have successfully ordered this product\"\n ]);\n }",
"public function testExample()\n {\n $order = new PaymentOrder();\n $order->amount = 1;\n $order->payType = PaymentOrder::TYPE_QUOTE_ORDER;\n $order->masterId = Master::inRandomOrder()->first()->id;\n $order->userId = User::inRandomOrder()->first()->id;\n $order->orderId = Order::inRandomOrder()->first()->id;\n $order->status = PaymentOrder::STATUS_UNPAID;\n $order->save();\n request()['gateway'] = 'AopPage';\n $response = app(PaymentController::class)->aliPay($order);\n dd($response->getContent());\n $this->assertTrue(true);\n }",
"public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }",
"public function testSuccess(){ \n\n $buyableProduct = Product::where('price', '<', 70)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($buyableProduct, $this->testVisaPan);\n $response->assertSee(\"Payment successful\");\n\n\n //test card 2\n $response = $this->checkoutAction($buyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Payment successful\"); \n \n }",
"public function testCorrectCanBuyWithEqualMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(100);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}",
"public function test_ShouldStorePurchaseOrder()\n {\n $response = $this->storePurchaseOrder();\n dump( json_decode($response->content(), JSON_PRETTY_PRINT) );\n $response->assertStatus(201)\n ->assertJson([\n 'status' => 'success',\n 'http_status_code' => 201,\n ])\n ->assertJsonStructure([\n 'status',\n 'http_status_code',\n 'purchase_order_id',\n ]);\n $obj = json_decode( $response->content() );\n\n return $obj->purchase_order_id;\n }",
"public function testPurchasesIsShown()\n {\n // Create a user\n $user = User::create([\n 'password' => Hash::make('password'),\n 'email' => '[email protected]',\n 'name' => 'John Doe',\n ]);\n\n // Create room\n $room = Room::create([\n 'id' => 1,\n 'name' => 'Test room',\n ]);\n\n // Create sample product\n $product = Product::create([\n 'name' => 'Test product',\n 'color' => 'fff',\n 'quantity' => '1,2,5',\n 'price' => '1232.00',\n ]);\n\n $quantity = 2;\n\n // Buy something\n $beer = new Beer();\n $beer->room = $room->id;\n $beer->quantity = $quantity;\n $beer->product = $product->id;\n $beer->ipAddress = request()->ip();\n $beer->amount = -($product->price * $quantity);\n $beer->save();\n\n // Login that user in\n Auth::login($user);\n\n // Get the page\n $response = $this->get('/rooms/1');\n\n // Asser user is logged in\n $this->assertAuthenticatedAs($user);\n\n // And that we get the expected 200 OK\n $response->assertStatus(200);\n\n // And the purchase shows up, we only check if the price is shown\n $response->assertSee('-'.($product->price * 2).'.00');\n }",
"public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}",
"public function test_product_stocks_deduct_when_order_is_placed()\n {\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $product->orders()->create(['quantity' => 5]);\n\n $product->refresh();\n\n $this->assertTrue($product->available_stock === 45);\n }",
"public function testNotPaid()\n {\n $this->browse(function (Browser $browser) {\n $bill = Bill::factory()->create([\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'tenant_id' => $this->tenant->id,\n ]);\n $service = $bill->services()->save(Service::factory()->make([\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ]));\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->press('Оплатить')\n ->assertSee('Недостаточно средств');\n });\n }",
"public function testViewOrder() {\n $uid = $this->loggedInUser->id();\n\n $order_item = OrderItem::create([\n 'type' => 'default',\n 'quantity' => 2,\n 'unit_price' => new Price('12.00', 'USD'),\n ]);\n $order_item->save();\n\n /** @var \\Drupal\\commerce_order\\Entity\\Order $order */\n $order = Order::create([\n 'type' => 'default',\n 'state' => 'draft',\n 'uid' => $uid,\n 'order_items' => [$order_item],\n 'mail' => '[email protected]',\n 'order_number' => '1',\n 'store_id' => $this->store->id(),\n ]);\n $order->save();\n\n // Check that we can view the orders page.\n $this->drupalGet('/user/' . $uid . '/orders/');\n $this->assertSession()->statusCodeEquals(200);\n\n // Check that the draft order is not available.\n $this->assertSession()->linkByHrefNotExists('/user/' . $uid . '/orders/' . $order->id());\n // Verify the order cannot be viewed, either.\n $this->drupalGet('/user/' . $uid . '/orders/' . $order->id());\n $this->assertSession()->statusCodeEquals(403);\n\n $order->getState()->applyTransitionById('place');\n $order->save();\n\n // Check that the order is available.\n $this->drupalGet('/user/' . $uid . '/orders/');\n $this->assertSession()->linkByHrefExists('/user/' . $uid . '/orders/' . $order->id());\n\n // Click order and make sure it works.\n $this->getSession()->getPage()->clickLink($order->id());\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains($order->getEmail());\n }",
"public function test_payOrder_called_returnUserWithItsNewBalanceAdded()\n {\n $this->markTestSkipped('payOrder skipped');\n $user = UserMother::aUserWith50Eur()->build();\n $expected_wallet = Wallet::create(4750);\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n }",
"public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}",
"public function testFailPurchase()\n\t{\n\t\t// Prepare\n\n\t\t$user = factory('App\\User')->create(['password' => Hash::make('laravel-shop')]);\n\n\t\t$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);\n\n\t\t$cart = App\\Cart::current()\n\t\t\t->add(['sku' => '0001', 'price' => 1.99])\n\t\t\t->add(['sku' => '0002', 'price' => 2.99]);\n\n\t\tShop::setGateway('testFail');\n\n\t\t$this->assertFalse(Shop::checkout());\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Checkout failed.');\n\n\t\t$order = Shop::placeOrder();\n\n\t\t$this->assertNotNull($order);\n\n\t\t$this->assertNotEmpty($order->id);\n\n\t\t$this->assertTrue($order->hasFailed);\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Payment failed.');\n\n\t\t$user->delete();\n\t}",
"public function testBillingDownloadInvoice()\n {\n }",
"public function successAction() {\n\t\t\n\t\t//echo \"in b2b\";die;\n\t\t$session = Mage::getSingleton('checkout/session');\n\t\t\n\t\t$logFileName = 'magentoorder.log';\n\t\t\n\t\tMage::log('----------------- START ------------------------------- ', null, $logFileName);\t\n\t\t\n\t\t$quote = $session->getQuote();\n\t\t$quoteId = $quote->getEntityId();\n\t\t$privateId = $session->getPrivateId();\n\t\t\n\t\t\n\t\t\n\t\tif($privateId){\n\t\t\t$orderData = Mage::getModel('collectorbank/api')->getOrderResponse();\t\n\t\t\t\n\t\t\tif(isset($orderData['error'])){\n\t\t\t\t$session->addError($orderData['error']['message']);\n\t\t\t\t$this->_redirect('checkout/cart');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$orderDetails = $orderData['data'];\t\t\n\t\t\n\t\t\n\t\tif($orderDetails){\t\t\n\t\t\t$email = $orderDetails['customer']['email'];\n\t\t\t$mobile = $orderDetails['customer']['mobilePhoneNumber'];\n\t\t\t$firstName = $orderDetails['customer']['deliveryAddress']['firstName'];\n\t\t\t$lastName = $orderDetails['customer']['deliveryAddress']['lastName'];\n\t\t\t\n\t\t\t\n\t\t\t$store = Mage::app()->getStore();\n\t\t\t$website = Mage::app()->getWebsite();\n\t\t\t$customer = Mage::getModel('customer/customer')->setWebsiteId($website->getId())->loadByEmail($email);\n\t\t\t\t// if the customer is not already registered\n\t\t\t\tif (!$customer->getId()) {\n\t\t\t\t\t$customer = Mage::getModel('customer/customer');\t\t\t\n\t\t\t\t\t$customer->setWebsiteId($website->getId())\n\t\t\t\t\t\t\t ->setStore($store)\n\t\t\t\t\t\t\t ->setFirstname($firstName)\n\t\t\t\t\t\t\t ->setLastname($lastName)\n\t\t\t\t\t\t\t ->setEmail($email); \n\t\t\t\t\ttry {\n\t\t\t\t\t \n\t\t\t\t\t\t$password = $customer->generatePassword(); \n\t\t\t\t\t\t$customer->setPassword($password); \n\t\t\t\t\t\t// set the customer as confirmed\n\t\t\t\t\t\t$customer->setForceConfirmed(true); \n\t\t\t\t\t\t// save customer\n\t\t\t\t\t\t$customer->save(); \n\t\t\t\t\t\t$customer->setConfirmation(null);\n\t\t\t\t\t\t$customer->save();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set customer address\n\t\t\t\t\t\t$customerId = $customer->getId(); \n\t\t\t\t\t\t$customAddress = Mage::getModel('customer/address'); \n\t\t\t\t\t\t$customAddress->setData($billingAddress)\n\t\t\t\t\t\t\t\t\t ->setCustomerId($customerId)\n\t\t\t\t\t\t\t\t\t ->setIsDefaultBilling('1')\n\t\t\t\t\t\t\t\t\t ->setIsDefaultShipping('1')\n\t\t\t\t\t\t\t\t\t ->setSaveInAddressBook('1');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// save customer address\n\t\t\t\t\t\t$customAddress->save();\n\t\t\t\t\t\t// send new account email to customer \n\t\t\t\t\t\t\n\t\t\t\t\t\t$storeId = $customer->getSendemailStoreId();\n\t\t\t\t\t\t$customer->sendNewAccountEmail('registered', '', $storeId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Customer with email '.$email.' is successfully created.', null, $logFileName);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Mage_Core_Exception $e) {\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$e->getMessage(), null, $logFileName);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$email, null, $logFileName);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t// Assign Customer To Sales Order Quote\n\t\t\t$quote->assignCustomer($customer);\n\t\t\t\n\t\t\tif($orderDetails['customer']['deliveryAddress']['country'] == 'Sverige'){\t$scountry_id = \"SE\";\t}\n\t\t\tif($orderDetails['customer']['billingAddress']['country'] == 'Sverige'){ $bcountry_id = \"SE\";\t}\n\t\t\t\n\t\t\t$billingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['customer']['billingAddress']['coAddress'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['customer']['billingAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['customer']['billingAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['customer']['billingAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['customer']['billingAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\t$shippingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['customer']['deliveryAddress']['coAddress'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['customer']['deliveryAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['customer']['deliveryAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['customer']['deliveryAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['customer']['deliveryAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\n\t\t\t// Add billing address to quote\n\t\t\t$billingAddressData = $quote->getBillingAddress()->addData($billingAddress);\n\t\t \n\t\t\t// Add shipping address to quote\n\t\t\t$shippingAddressData = $quote->getShippingAddress()->addData($shippingAddress);\n\t\t\t\n\t\t\t//check for selected shipping method\n\t\t\t$shippingMethod = $session->getSelectedShippingmethod();\n\t\t\tif(empty($shippingMethod)){\n\t\t\t\t$allShippingData = Mage::getModel('collectorbank/config')->getActiveShppingMethods();\n\t\t\t\t$orderItems = $orderDetails['order']['items'];\n\t\t\t\tforeach($orderItems as $oitem){\n\t\t\t\t\t//echo \"<pre>\";print_r($oitem);\n\t\t\t\t\tif(in_array($oitem['id'], $allShippingData)) {\n\t\t\t\t\t\t$shippingMethod = $oitem['id'];\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}\n\n\t\t\t// Collect shipping rates on quote shipping address data\n\t\t\t$shippingAddressData->setCollectShippingRates(true)->collectShippingRates();\n\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setShippingMethod($shippingMethod);\t\t\t\n\t\t\t\n\t\t\t//$paymentMethod = 'collectorpay';\n\t\t\t$paymentMethod = 'collectorbank_invoice';\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setPaymentMethod($paymentMethod);\t\t\t\n\t\t\t\n\t\t\t$colpayment_method = $orderDetails['purchase']['paymentMethod'];\n\t\t\t$colpayment_details = json_encode($orderDetails['purchase']);\n\t\t\t\n\t\t\t// Set payment method for the quote\n\t\t\t$quote->getPayment()->importData(array('method' => $paymentMethod,'coll_payment_method' => $colpayment_method,'coll_payment_details' => $colpayment_details));\n\t\t\t\n\n\t\t\ttry{\n\t\t\t\t$orderReservedId = $session->getReference();\n\t\t\t\t$quote->setResponse($orderDetails);\n\t\t\t\t$quote->setCollCustomerType($orderDetails['customerType']);\n\t\t\t\t$quote->setCollBusinessCustomer($orderDetails['businessCustomer']);\n\t\t\t\t$quote->setCollStatus($orderDetails['status']);\n\t\t\t\t$quote->setCollPurchaseIdentifier($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t$quote->setCollTotalAmount($orderDetails['order']['totalAmount']);\n\t\t\t\tif($orderDetails['reference'] == $orderReservedId){\n\t\t\t\t\t$quote->setReservedOrderId($orderReservedId);\n\t\t\t\t} else {\n\t\t\t\t\t$quote->setReservedOrderId($orderDetails['reference']);\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t \t// Collect totals of the quote\n\t\t\t\t$quote->collectTotals();\n\t\t\t\t$quote->save();\n\t\t\t\t\n\t\t\t\t$service = Mage::getModel('sales/service_quote', $quote);\n\t\t\t\t$service->submitAll();\n\t\t\t\t$incrementId = $service->getOrder()->getRealOrderId();\n\t\t\t\t\n\t\t\t\tif($session->getIsSubscribed() == 1){\n\t\t\t\t\tMage::getModel('newsletter/subscriber')->subscribe($email);\n\t\t\t\t} \t\t\t\t\n\t\t\t\t\n\t\t\t\t$session->setLastQuoteId($quote->getId())\n\t\t\t\t\t->setLastSuccessQuoteId($quote->getId())\n\t\t\t\t\t->clearHelperData();\n\t\t\t\t\t\n\t\t\t\tMage::getSingleton('checkout/session')->clear();\n\t\t\t\tMage::getSingleton('checkout/cart')->truncate()->save();\n\t\t\t\t\n\t\t\t\t$session->unsPrivateId();\n\t\t\t\t$session->unsReference();\n\t\t\t\t\n\t\t\t\t // Log order created message\n\t\t\t\tMage::log('Order created with increment id: '.$incrementId, null, $logFileName);\t\t\t\t\t\t\n\t\t\t\t$result['success'] = true;\n\t\t\t\t$result['error'] = false;\n\t\t\t\t\n\t\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);\n\t\t\t\t\n\t\t\t\t$this->loadLayout();\n\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\tif ($block){//check if block actually exists\t\t\t\t\t\n\t\t\t\t\t\tif ($order->getId()) {\n\t\t\t\t\t\t\t$orderId = $order->getId();\n\t\t\t\t\t\t\t$isVisible = !in_array($order->getState(),Mage::getSingleton('sales/order_config')->getInvisibleOnFrontStates());\n\t\t\t\t\t\t\t$block->setOrderId($incrementId);\n\t\t\t\t\t\t\t$block->setIsOrderVisible($isVisible);\n\t\t\t\t\t\t\t$block->setViewOrderId($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setViewOrderUrl($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setPrintUrl($block->getUrl('sales/order/print', array('order_id'=> $orderId)));\n\t\t\t\t\t\t\t$block->setCanPrintOrder($isVisible);\n\t\t\t\t\t\t\t$block->setCanViewOrder(Mage::getSingleton('customer/session')->isLoggedIn() && $isVisible);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->renderLayout();\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (Mage_Core_Exception $e) {\n\t\t\t\t\t$result['success'] = false;\n\t\t\t\t\t$result['error'] = true;\n\t\t\t\t\t$result['error_messages'] = $e->getMessage(); \n\t\t\t\t\tMage::log('Order creation is failed for invoice no '.$orderDetails['purchase']['purchaseIdentifier'] .\"Error is --> \".Mage::helper('core')->jsonEncode($result), null, $logFileName);\t\t\n\t\t\t\t\t//Mage::app()->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n\t\t\t\t\t$this->loadLayout();\n\t\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\t\tif ($block){\n\t\t\t\t\t\tif($orderDetails['purchase']['purchaseIdentifier']){\n\t\t\t\t\t\t\t$block->setInvoiceNo($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$block->setCode(222);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->renderLayout();\t\t\t\t\t\n\t\t\t} \t\t\t\n\t\t} \n\t\t\n\t\t} else {\n\t\t\tMage::log('Order is already generated.', null, $logFileName);\t\t\n\t\t\t$this->loadLayout(); \n\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\tif ($block){\n\t\t\t\t$block->setCode(111);\n\t\t\t}\n\t\t\t$this->renderLayout();\n\t\t}\n\n\t\tMage::log('----------------- END ------------------------------- ', null, $logFileName);\t\t\n\t}",
"function validateOrder() {\n\techo \"Validating Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order/validate', $data);\n\tprintInfo($response);\n}"
] |
[
"0.72055554",
"0.70219594",
"0.695565",
"0.6839315",
"0.67963976",
"0.6740879",
"0.66172457",
"0.66018087",
"0.65744567",
"0.6544685",
"0.6526224",
"0.6513589",
"0.64417493",
"0.63723993",
"0.6364923",
"0.63576573",
"0.6357522",
"0.63084203",
"0.6299384",
"0.6232709",
"0.62138134",
"0.6196694",
"0.619089",
"0.6187159",
"0.61783606",
"0.61599815",
"0.61228865",
"0.61163527",
"0.6114589",
"0.61044145"
] |
0.760721
|
0
|
Test buying an Order with a Rate object.
|
public function testBuyRateObject()
{
VCR::insertCassette('orders/buyRateObject.yml');
$order = Order::create(Fixture::basicOrder());
$order->buy($order->rates[0]);
$shipmentsArray = $order['shipments'];
foreach ($shipmentsArray as $shipment) {
$this->assertNotNull($shipment->postage_label);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testBuy()\n {\n VCR::insertCassette('orders/buy.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::uspsService(),\n ]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}",
"public function test(Order $order);",
"public function test_payOrder_called_withOrderNoSubscriptionShouldRechargeWallet()\n {\n $expected = Wallet::create(6200,0);\n $user = UserMother::aUserWith50Eur()->build();\n $order = OrderMother::aJustOrder()->buildANewWay();\n $entityManager_stub = $this->getEntityManagerDouble();\n $entityManager_stub->persist($user)->shouldBeCalled();\n $entityManager_stub->flush($user)->shouldBeCalled();\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $actual = $sut->payOrder($user,$order);\n $this->assertEquals($expected,$actual->getWallet());\n }",
"public function test_amount_less_than_rate_cost()\n {\n\n\n\n $data=[\"amount\"=> 100,\n \"unpaid_appliance_rates\"=> 2,\n \"appliance_rate_cost\"=> 200,\n \"tariff_fixed_costs\"=> 160,\n \"price_per_kwh\"=> 700\n ];\n\n $response = $this->post('/api/transactions', $data);\n // $response->assertStatus(200);\n $response->assertJson( [\"data\"=> [\n \"type\"=> \"transaction\",\n \"attributes\"=> [\n \"paid_for_appliance_rates\"=> 0,\n \"fully_covered_appliance_rate\"=> 0,\n \"paid_for_fixed_tariff\"=> 100,\n \"paid_for_energy\"=> 0,\n \"topup_for_energy\"=> 0,\n \"sold_energy\"=> 0\n ]\n ]]);\n }",
"public function purchaseTest()\n {\n\t $this->json('POST','/compraproducto', [\n 'user_id' => '15',\n 'product_id' => '31',\n 'quantity' => '9',\n 'payment'=>'2878.29',\n ]);\n\t $this->assertDatabaseHas('purchases', ['user_id' => '15']);\n }",
"public function testExample()\n {\n $order = new PaymentOrder();\n $order->amount = 1;\n $order->payType = PaymentOrder::TYPE_QUOTE_ORDER;\n $order->masterId = Master::inRandomOrder()->first()->id;\n $order->userId = User::inRandomOrder()->first()->id;\n $order->orderId = Order::inRandomOrder()->first()->id;\n $order->status = PaymentOrder::STATUS_UNPAID;\n $order->save();\n request()['gateway'] = 'AopPage';\n $response = app(PaymentController::class)->aliPay($order);\n dd($response->getContent());\n $this->assertTrue(true);\n }",
"public function testGetRates()\n {\n VCR::insertCassette('orders/getRates.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $rates = $order->get_rates();\n\n $ratesArray = $rates['rates'];\n\n $this->assertIsArray($ratesArray);\n $this->assertContainsOnlyInstancesOf('\\EasyPost\\Rate', $ratesArray);\n }",
"public function testCorrectCanBuyWithEqualMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(100);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}",
"public function __construct(Order $order, int $rate)\n {\n $this->order = $order;\n $this->rate = $rate;\n }",
"public function testCreate()\n {\n VCR::insertCassette('orders/create.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $this->assertInstanceOf('\\EasyPost\\Order', $order);\n $this->assertStringMatchesFormat('order_%s', $order->id);\n $this->assertNotNull($order->rates);\n }",
"public function testBuy()\n {\n VCR::insertCassette('pickups/buy.yml');\n\n $shipment = Shipment::create(Fixture::oneCallBuyShipment());\n\n $pickupData = Fixture::basicPickup();\n $pickupData['shipment'] = $shipment;\n\n $pickup = Pickup::create($pickupData);\n\n $boughtPickup = $pickup->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::pickupService(),\n ]);\n\n $this->assertInstanceOf('\\EasyPost\\Pickup', $boughtPickup);\n $this->assertStringMatchesFormat('pickup_%s', $boughtPickup->id);\n $this->assertNotNull($boughtPickup->confirmation);\n $this->assertEquals('scheduled', $boughtPickup->status);\n }",
"public function payWayPurchase()\n\t{\n\t}",
"public function testGetUserRate()\n {\n// $rate = $this->em\n// ->getRepository('WidgetBundle:Users')\n// ->getUserRate(1);\n//\n// $this->assertEquals(23, $rate[0]['rate']);\n $this->assertEquals(23, 23);\n }",
"public function testCreatePayItem()\n {\n }",
"public function test_payOrder_called_returnUserWithItsNewBalanceAdded()\n {\n $this->markTestSkipped('payOrder skipped');\n $user = UserMother::aUserWith50Eur()->build();\n $expected_wallet = Wallet::create(4750);\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n }",
"public function testPaid()\n {\n $this->browse(function (Browser $browser) {\n $balance = Balance::factory()->create([\n 'tenant_id' => $this->tenant->id,\n 'type' => Balance::TYPE_DEBIT,\n 'status' => Balance::STATUS_DONE,\n 'amount' => 9000\n ]);\n\n $bill = Bill::factory()->create([\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'tenant_id' => $this->tenant->id,\n ]);\n $service = $bill->services()->save(Service::factory()->make([\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ]));\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->press('Оплатить')\n ->assertSee('Оплачен')\n ->visit('/tenants/'.$this->tenant->id.'?tab=balances#tab')\n ->assertSee('Кредит');\n });\n }",
"public function testPurchaseFlow()\n\t{\n\t\t// Prepare\n\n\t\t$user = factory('App\\User')->create(['password' => Hash::make('laravel-shop')]);\n\n\t\t$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);\n\n\t\t$cart = App\\Cart::current()\n\t\t\t->add(['sku' => '0001', 'price' => 1.99])\n\t\t\t->add(['sku' => '0002', 'price' => 2.99]);\n\n\t\tShop::setGateway('testPass');\n\n\t\tShop::checkout();\n\n\t\t$order = Shop::placeOrder();\n\n\t\t$this->assertNotNull($order);\n\n\t\t$this->assertNotEmpty($order->id);\n\n\t\t$this->assertTrue($order->isCompleted);\n\n\t\t$user->delete();\n\t}",
"function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }",
"public function setStoreToOrderRate($rate);",
"public function testCreatePurchase()\n {\n print \"testPurchase()\\n\";\n\n // TODO: Impl\n\n $this->fail();\n }",
"public function store(OrderDetails $orderDetail, PaymentGatewayContract $payment)\n {\n \t$order = $orderDetail->all();\n dd($payment->charge(2500));\n }",
"public function test_rechargeWithWallet_called_()\n {\n $this->markTestSkipped('This test don\\'t works anymore :( | Fix it? ');\n\n $user = UserMother::aUserWith50Eur()->build();\n $expected_wallet = Wallet::create(4750);\n $playConfig = PlayConfigMother::aPlayConfig()->build();\n $data = [\n 'lottery_id' => $playConfig->getLottery()->getId(),\n 'numBets' => $playConfig->getId(),\n 'user' => $user,\n 'now' => new \\DateTime(),\n 'walletBefore' => $user->getWallet(),\n 'walletAfter' => $user->getWallet(),\n ];\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $this->iDontCareAboutFlush();\n $sut->payWithWallet($user,$playConfig);\n $this->assertEquals($expected_wallet, $user->getWallet());\n }",
"public function testTransactionInsert()\n {\n $initialCount = ExchangeRate::count();\n $response = $this->postJson('/api/rates', [\n 'userId' => 134256,\n 'currencyFrom' => 'EUR',\n 'currencyTo' => 'GBP',\n 'amountSell' => 3000,\n 'amountBuy' => 2700,\n 'rate' => 0.7500,\n 'timePlaced' => '27-JAN-18 10:27:44',\n 'originatingCountry' => 'FR',\n ], ['Content-Type' => 'application/json', 'Accept' => 'application/json']);\n $newCount = ExchangeRate::count();\n $response->assertStatus(200);\n $this->assertEquals($initialCount + 1, $newCount);\n }",
"public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}",
"public function __construct(Money $rate)\n {\n $this->rate = $rate;\n }",
"public function testRetrive()\n {\n $json = <<<JSON\n{\n \"order_id\": \"f3392f8b-6116-4073-ab96-e330819e2c07\",\n \"order_amount\": 50000,\n \"order_tax_amount\": 5000\n}\nJSON;\n\n $this->mock->append(\n new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $json\n )\n );\n\n $order = new Orders($this->connector, 'auth-token-123456');\n $this->assertEquals('auth-token-123456', $order->getId());\n\n $order->retrieve();\n\n $this->assertEquals('f3392f8b-6116-4073-ab96-e330819e2c07', $order['order_id']);\n $this->assertEquals(50000, $order['order_amount']);\n\n $request = $this->mock->getLastRequest();\n $this->assertEquals(Method::GET, $request->getMethod());\n $this->assertEquals(\n '/instantshopping/v1/authorizations/auth-token-123456',\n $request->getUri()->getPath()\n );\n\n $this->assertAuthorization($request);\n }",
"abstract public function test( Payment $payment );",
"public function purchase($options);",
"public function testCreatePayrun()\n {\n }"
] |
[
"0.67488503",
"0.67389774",
"0.6650052",
"0.654416",
"0.6468276",
"0.6227071",
"0.6154428",
"0.61476827",
"0.6131153",
"0.6128471",
"0.6114831",
"0.6111936",
"0.60368687",
"0.60155356",
"0.60036355",
"0.59959424",
"0.59311277",
"0.5892743",
"0.5869987",
"0.5867194",
"0.58632267",
"0.57852197",
"0.57833135",
"0.5744796",
"0.5735234",
"0.57334894",
"0.57185477",
"0.5716912",
"0.5711895",
"0.5699228"
] |
0.80677617
|
0
|
Test various usage alterations of the lowest_rate method.
|
public function testLowestRate()
{
VCR::insertCassette('orders/lowestRate.yml');
$order = Order::create(Fixture::basicOrder());
// Test lowest rate with no filters
$lowestRate = $order->lowest_rate();
$this->assertEquals('First', $lowestRate['service']);
$this->assertEquals('5.57', $lowestRate['rate']);
$this->assertEquals('USPS', $lowestRate['carrier']);
// Test lowest rate with service filter (this rate is higher than the lowest but should filter)
$lowestRate = $order->lowest_rate([], ['Priority']);
$this->assertEquals('Priority', $lowestRate['service']);
$this->assertEquals('7.90', $lowestRate['rate']);
$this->assertEquals('USPS', $lowestRate['carrier']);
// Test lowest rate with carrier filter (should error due to bad carrier)
try {
$lowestRate = $order->lowest_rate(['BAD CARRIER'], []);
} catch (Error $error) {
$this->assertEquals('No rates found.', $error->getMessage());
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testLowestRate()\n {\n VCR::insertCassette('pickups/lowestRate.yml');\n\n $shipment = Shipment::create(Fixture::oneCallBuyShipment());\n\n $pickupData = Fixture::basicPickup();\n $pickupData['shipment'] = $shipment;\n\n $pickup = Pickup::create($pickupData);\n\n // Test lowest rate with no filters\n $lowestRate = $pickup->lowest_rate();\n $this->assertEquals('NextDay', $lowestRate['service']);\n $this->assertEquals('0.00', $lowestRate['rate']);\n $this->assertEquals('USPS', $lowestRate['carrier']);\n\n // Test lowest rate with service filter (should error due to bad service)\n try {\n $lowestRate = $pickup->lowest_rate([], ['BAD SERVICE']);\n } catch (Error $error) {\n $this->assertEquals('No rates found.', $error->getMessage());\n }\n\n // Test lowest rate with carrier filter (should error due to bad carrier)\n try {\n $lowestRate = $pickup->lowest_rate(['BAD CARRIER'], []);\n } catch (Error $error) {\n $this->assertEquals('No rates found.', $error->getMessage());\n }\n }",
"public function testGetRateLimits()\n {\n }",
"function it_finds_the_lowest_base_weekly_rate_in_the_absence_of_other_rates()\n {\n $baseRate = new Rate(null, Price::fromString('10', Currency::fromString('EUR')), 1);\n $equipment = new Equipment('Jack Hammer', $baseRate);\n $rentalPeriod = RentalPeriod::fromDateTime(new \\DateTime('2014-07-01'), new \\DateTime('2014-07-07'), 1);\n $rentalQuery = new RentalQuery($equipment, $rentalPeriod);\n\n $weekPrice = Price::fromString('65', Currency::fromString('EUR'));\n $equipment->addRate(null, $weekPrice, 7);\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($weekPrice);\n }",
"function it_finds_the_lowest_base_monthly_rate_in_the_absence_of_other_rates()\n {\n // daily rate - 10\n // daily rate - 10\n $baseRate = new Rate(null, Price::fromString('10', Currency::fromString('EUR')), 1);\n $equipment = new Equipment('Jack Hammer', $baseRate);\n $rentalPeriod = RentalPeriod::fromDateTime(new \\DateTime('2014-07-01'), new \\DateTime('2014-07-07'), 1);\n $rentalQuery = new RentalQuery($equipment, $rentalPeriod);\n\n // weekly rate - 60\n $weekPrice = Price::fromString('65', Currency::fromString('EUR'));\n $equipment->addRate(null, $weekPrice, 7);\n\n // 3 weekly + 5 daily = 250\n // monthly rate = 240\n $monthPrice = Price::fromString('240', Currency::fromString('EUR'));\n $equipment->addRate(null, $monthPrice, 30);\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($monthPrice);\n }",
"public function testMin()\n {\n $this->assertEquals(0, EggDropperCalculator::calculate(0, 0));\n $this->assertEquals(0, EggDropperCalculator::calculate(1, 0));\n $this->assertEquals(1, EggDropperCalculator::calculate(0, 1));\n $this->assertEquals(1, EggDropperCalculator::calculate(1, 1));\n $this->assertEquals(0, EggDropperCalculator::calculate(2, 0));\n $this->assertEquals(0, EggDropperCalculator::calculate(0, 2));\n $this->assertEquals(1, EggDropperCalculator::calculate(2, 1));\n $this->assertEquals(2, EggDropperCalculator::calculate(1, 2));\n }",
"public function testFilterMinimumPrice()\n {\n $this->visit('/properties')\n ->type('4500000', '#minPrice')\n ->press('Update results')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n $this->notSee('Shack in the desert');\n }",
"public function rate()\n {\n\n }",
"public function test_amount_less_than_rate_cost()\n {\n\n\n\n $data=[\"amount\"=> 100,\n \"unpaid_appliance_rates\"=> 2,\n \"appliance_rate_cost\"=> 200,\n \"tariff_fixed_costs\"=> 160,\n \"price_per_kwh\"=> 700\n ];\n\n $response = $this->post('/api/transactions', $data);\n // $response->assertStatus(200);\n $response->assertJson( [\"data\"=> [\n \"type\"=> \"transaction\",\n \"attributes\"=> [\n \"paid_for_appliance_rates\"=> 0,\n \"fully_covered_appliance_rate\"=> 0,\n \"paid_for_fixed_tariff\"=> 100,\n \"paid_for_energy\"=> 0,\n \"topup_for_energy\"=> 0,\n \"sold_energy\"=> 0\n ]\n ]]);\n }",
"public function testRateLimit()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }",
"function calculate_rate($rate, $type, $bits) {\n\n\t$output = 0;\n\n\tif ($type == \"overage\") {\n\t\tif ($bits > $rate[\"rate_overage\"][\"threshold\"]) {\n\t\t\t$bits = $bits - $rate[\"rate_overage\"][\"threshold\"];\n\t\t}else{\n\t\t\t$bits = 0;\n\t\t}\t\n\t\t$multi = unit_multi($rate[\"rate_overage\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate_overage\"][\"amount\"];\n\t} elseif ($type == \"committed\") {\n\t\tif ($bits > $rate[\"rate_overage\"][\"threshold\"]) {\n\t\t\t$bits = $rate[\"rate_overage\"][\"threshold\"];\n\t\t}\t\n\t\t$multi = unit_multi($rate[\"rate_committed\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate_committed\"][\"amount\"];\n\t\tif (isset($rate[\"rate_committed\"][\"minimum\"])) {\n\t\t\tif ($output < $rate[\"rate_committed\"][\"minimum\"]) {\n\t\t\t\t$output = $rate[\"rate_committed\"][\"minimum\"];\n\t\t\t}\n\t\t}\n\t} elseif ($type == \"regular\") {\n\t\t$multi = unit_multi($rate[\"rate\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate\"][\"amount\"];\n\t\tif (isset($rate[\"rate\"][\"minimum\"])) {\n\t\t\tif ($output < $rate[\"rate\"][\"minimum\"]) {\n\t\t\t\t$output = $rate[\"rate\"][\"minimum\"];\n\t\t\t}\n\t\t}\n\t} elseif ($type == \"fixed\") {\n\t\t$output = $rate[\"rate_fixed\"][\"amount\"];\n\t}\n\t\n\treturn round($output, 4);\n\n}",
"public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }",
"public function getMinPrice();",
"public function testGetLowStockByFilter()\n {\n }",
"public function shouldSample()\n {\n return lcg_value() <= $this->rate;\n }",
"function check_rate ($rate, $section = \"\", $required = false) {\n\n\t$issues = \"\";\n\t$space = \" \";\n\t$multiple_check = array();\n\n\tif ($section == \"graph\") {\n\t\t$space = \" \";\n\t}\n\n\t/* Regular rate check */\n\tif (isset($rate[\"rate\"])) {\n\t\tif (isset($rate[\"rate\"][\"amount\"])) {\n\t\t\tif (! is_numeric($rate[\"rate\"][\"amount\"])) {\n\t\t\t\t$issues .= $space . \"Rate amount is not numeric.\\n\";\n\t\t\t}\n\t\t}else{\n\t\t\t$issues .= $space . \"Rate has no defined amount.\\n\";\n\t\t}\n\t\tif (! ( ($rate[\"rate\"][\"unit\"] == \"Kb\") || ($rate[\"rate\"][\"unit\"] == \"Mb\") || ($rate[\"rate\"][\"unit\"] == \"Gb\") ) ) {\n\t\t\t$issues .= $space . \"Invalid unit on rate, allowed: Kb, Mb or Gb.\\n\";\n\t\t}\n\t\tif (isset($rate[\"rate\"][\"minimum\"])) {\n\t\t\tif (! is_numeric($rate[\"rate\"][\"minimum\"])) {\n\t\t\t\t$issues .= $space . \"Minimum defined for rate is not numeric.\\n\";\n\t\t\t}else{\n\t\t\t\tif ($rate[\"rate\"][\"minimum\"] < 0) {\n\t\t\t\t\t$issues .= $space . \"Minimum defined for rate is less than zero.\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$multiple_check[] = \"Regular\";\n\n\t}\n\n\t/* Overage/Committed rate check */\n\tif (isset($rate[\"rate_overage\"])) {\n\t\tif (isset($rate[\"rate_committed\"])) {\n\t\t\tif (isset($rate[\"rate_committed\"][\"amount\"])) {\n\t\t\t\tif (! is_numeric($rate[\"rate_committed\"][\"amount\"])) {\n\t\t\t\t\t$issues .= $space . \"Committed rate amount is not numeric.\\n\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$issues .= $space . \"Committed rate has no defined amount.\\n\";\n\t\t\t}\n\t\t\tif (isset($rate[\"rate_overage\"][\"amount\"])) {\n \t\t\t\tif (! is_numeric($rate[\"rate_overage\"][\"amount\"])) {\n\t\t\t\t\t$issues .= $space . \"Overage rate amount is not numeric.\\n\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$issues .= $space . \"Overage rate has no defined amount.\\n\";\n\t\t\t}\n\t\t\tif (! ( ($rate[\"rate_committed\"][\"unit\"] == \"Kb\") || ($rate[\"rate_committed\"][\"unit\"] == \"Mb\") || ($rate[\"rate_committed\"][\"unit\"] == \"Gb\") ) ) {\n\t\t\t\t$issues .= $space . \"Invalid unit on committed rate, allowed: Kb, Mb or Gb.\\n\";\n\t\t\t}\n\t\t\tif (! ( ($rate[\"rate_overage\"][\"unit\"] == \"Kb\") || ($rate[\"rate_overage\"][\"unit\"] == \"Mb\") || ($rate[\"rate_overage\"][\"unit\"] == \"Gb\") ) ) {\n\t\t\t\t$issues .= $space . \"Invalid unit on overage rate, allowed: Kb, Mb or Gb.\\n\";\n\t\t\t}\n\t\t\tif (isset($rate[\"rate_overage\"][\"threshold\"])) {\n\t\t\t\tif (! is_numeric($rate[\"rate_overage\"][\"threshold\"])) {\n\t\t\t\t\t$issues .= $space . \"Threshold defined for overage rate is not numeric.\\n\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$issues .= $space . \"No threshold defined for overage rate.\\n\";\n\t\t\t}\n\t\t\tif (isset($rate[\"rate_committed\"][\"minimum\"])) {\n\t\t\t\tif (! is_numeric($rate[\"rate_committed\"][\"minimum\"])) {\n\t\t\t\t\t$issues .= $space . \"Minimum defined for committed rate is not numeric.\\n\";\n\t\t\t\t}else{\n\t\t\t\t\tif ($rate[\"rate_committed\"][\"minimum\"] < 0) {\n\t\t\t\t\t\t$issues .= $space . \"Minimum defined for committed rate is less than zero.\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$multiple_check[] = \"Overage/Committed\";\n\t\t}else{\n\t\t\t$issues .= $space . \"No committed rate defined where overage rate defined.\\n\";\n\t\t}\n\t}\n\n\t/* Fixed rate check */\n\tif (isset($rate[\"rate_fixed\"])) {\n\t\tif (isset($rate[\"rate_fixed\"][\"amount\"])) {\n\t\t\tif (! is_numeric($rate[\"rate_fixed\"][\"amount\"])) {\n\t\t\t\t$issues .= $space . \"Fixed rate amount is not numeric.\\n\";\n\t\t\t}\n\t\t}else{\n\t\t\t$issues .= $space . \"Fixed rate has no defined amount.\\n\";\n\t\t}\n\t\t$multiple_check[] = \"Fixed\";\n\t}\n\n\t/* Check for Committed without Overage rate */\n\tif (! isset($rate[\"rate_overage\"])) {\t\n\t\tif (isset($rate[\"rate_committed\"])) {\n\t\t\t$issues .= $space . \"Found committed rate, but no overage rate. Use rate instead for no overage billing.\\n\";\n\t\t}\n\t}\t\n\n\t/* Check for multiple defined rates or no defined rates */\n\tif (sizeof($multiple_check) < 1) {\n\t\tif ($required) {\n\t\t\t$issues .= $space . \"No rates found in \" . $section . \" section.\\n\";\n\t\t}\n\t} elseif (sizeof($multiple_check) > 1) {\n\t\t$issues .= $space . \"Multiple rates (\" . implode(\",\", $multiple_check) . \") defined in \" . $section . \" section.\\n\";\n\t}\n\n\t$multiple_check = array();\n\n\treturn $issues;\n\n}",
"public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}",
"public static function getLowestQuality(): int\n {\n return static::$lowestQuality;\n }",
"public function unRate()\n {\n\n }",
"protected function setToLowestQuality(): void\n {\n $this->getItem()->quality = $this->getLowestQuality();\n }",
"abstract public function minMin(): int;",
"public function testGetUserRate()\n {\n// $rate = $this->em\n// ->getRepository('WidgetBundle:Users')\n// ->getUserRate(1);\n//\n// $this->assertEquals(23, $rate[0]['rate']);\n $this->assertEquals(23, 23);\n }",
"function testeffectiveRateException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::effectiveRate(0.40, -13);\n\t}",
"public function getMin(): float;",
"public function test_getLowStockByFilter() {\n\n }",
"function testNormalItem() {\n $items = array(new Item('Elixir of the Mongoose', 2, 5));\n $gildedRose = new GildedRose($items);\n \n // check that normal item degrades as expected\n $gildedRose->update_quality();\n $this->assertEquals(1, $items[0]->sell_in);\n $this->assertEquals(4, $items[0]->quality);\n\n // second iteration for assurance \n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(3, $items[0]->quality);\n\n // now that item is expired, it should degrade twice as fast \n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(1, $items[0]->quality);\n\n // ensure item does not degrade below a quality of 0\n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(0, $items[0]->quality);\n }",
"public function updateQuality() {\n\n if ($this->sellIn > 0) {\n //Not reached sellby date\n $this->quality -= 2;\n } else {\n //Passed sellby date, so decrease in quality twice as fast\n $this->quality -= 4;\n }\n\n //Quality cannot be less than zero\n if ($this->quality < 0){\n $this->quality = 0;\n }\n }",
"public function collectRates(Mage_Shipping_Model_Rate_Request $request) {\n\t\t// Check if this method is active\n\t\tif (!$this->getConfigFlag('active')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if this method is even applicable (must ship from Spain)\n\t\t$origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());\n\t\t$result = Mage::getModel('shipping/rate_result');\n\n\t\t$error = Mage::getModel('shipping/rate_result_error');\n\t\tif ($origCountry != \"ES\") {\n\t\t\tif($this->getConfigData('showmethod')){\n\t\t\t\t$error->setCarrier($this->_code)\n\t\t\t\t\t->setCarrierTitle($this->getConfigData('title'))\n\t\t\t\t\t->setErrorMessage($this->getConfigData('specificerrmsg'));\n\t\t\t\t$result->append($error);\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//check if cart order value falls between the minimum and maximum order amounts required\n\t\t$packagevalue = $request->getBaseCurrency()->convert($request->getPackageValue(), $request->getPackageCurrency());\n\t\t$minorderval = (int)$this->getConfigData('min_order_value');\n\t\t$maxorderval = (int)$this->getConfigData('max_order_value');\n\t\tif(\n\t\t\t/* EL PAQUETE ES MENOR O IGUAL AL MINIMO Y EL MINIMO ESTA HABILITADO*/\n\t\t\t($packagevalue <= $minorderval) && ($minorderval > 0) || \n\t\t\t/* EL PAQUETE ES MAYOR O IGUAL AL MAXIMO Y EL MAXIMO ESTA HABILITADO*/\n\t\t\t(($maxorderval != 0) && ($packagevalue >= $maxorderval))){\n\t\t\tif($this->getConfigData('showmethod')){\n\t\t\t\t$error->setCarrier($this->_code)\n\t\t\t\t\t->setCarrierTitle($this->getConfigData('title'));\n\t\t\t\t$currency\t=\tMage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE);\n\t\t\t\t/* SI EL MINIMO Y EL MAXIMO ESTA HABILITADO*/\n\t\t\t\tif($minorderval != 0 && $maxorderval != 0){\n\t\t\t\t\t$errorMsg=Mage::helper('nacex')->__('Package value must be between %s and %s',Mage::app()->getStore()->formatPrice($minorderval),Mage::app()->getStore()->formatPrice($maxorderval));\n\t\t\t\t/* SI EL MAXIMO ESTA HABILITADO*/\n\t\t\t\t}elseif($maxorderval != 0){\n\t\t\t\t\t$errorMsg=Mage::helper('nacex')->__('Package value must be less than %s',\n\t\t\t\t\t\tMage::app()->getStore()->formatPrice($maxorderval)\n\t\t\t\t\t);\n\t\t\t\t/* SI EL MINIMO ESTA HABILITADO*/\n\t\t\t\t}else{\n\t\t\t\t\t$errorMsg=Mage::helper('nacex')->__('Package value must be higher than %s',Mage::app()->getStore()->formatPrice($minorderval));\n\t\t\t\t}\n\t\t\t\t$error->setErrorMessage($errorMsg);\n\t\t\t\t$result->append($error);\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// CODIGO POSTAL DE LA TIENDA\n\t\t$this->_frompcode = Mage::getStoreConfig('shipping/origin/postcode', $this->getStore());\n\t\t// CODIGO POSTAL DEL COMPRADOR\n\t\t$this->_topcode = $request->getDestPostcode();\n\t\tif ($request->getDestCountryId()) {\n\t\t\t$destCountry = $request->getDestCountryId();\n\t\t} else {\n\t\t\t$destCountry = \"ES\";\n\t\t}\n\n\t\t$sweightunit = $this->getConfigData('weight_units');\n\t\t$this->_sweight = $request->getPackageWeight()*$sweightunit;\n\n\t\t// En el caso de que sea dentro de espaņa se muestra\n\t\t// en caso contrario no\n\t\tif($destCountry == \"ES\") {\n\t\t\ttry {\n\t\t\t\t$this->_servicio\t=\tMage::getSingleton('nacex/standard_data')->setServicio($this->_frompcode,$this->_topcode);\n\t\t\t\t$_params\t=\tarray('servicio'=>$this->_servicio,'sweight'=>$this->_sweight,'code'=>$this->_code);\n\t\t\t\t$datosPrecio\t=\tMage::getSingleton('nacex/standard_data')->getPrecio($_params);\n\t\t\t\t$shippingPrice\t=\t$datosPrecio['price'];\n\t\t\t\t// set the handling fee type....\n\t\t\t\t$calculateHandlingFee = $this->getConfigData('handling_type');\n\t\t\t\t$handlingFee = $this->getConfigData('handling_fee');\n\t\t\t\tif ($this->getConfigData('handling_type') == 'F') {\n\t\t\t\t\t$shippingPrice += $this->getConfigData('handling_fee');\n\t\t\t\t} else {\n\t\t\t\t\t$handlingFee = ($shippingPrice * $this->getConfigData('handling_fee'))/100;\n\t\t\t\t\t$shippingPrice += $handlingFee;\n\t\t\t\t}\n\n\t\t\t\t$rate = Mage::getModel('shipping/rate_result_method');\n\t\t\t\t$rate->setCarrier($this->_code);\n\t\t\t\t$rate->setCarrierTitle($this->getConfigData('title'));\n\t\t\t\t$rate->setMethod($this->_code);\n\t\t\t\t$rate->setMethodTitle($this->getConfigData('msg'));\n\t\t\t\t$rate->setCost($datosPrecio['price']);\n\t\t\t\t$rate->setPrice($shippingPrice);\n\t\t\t\t$result->append($rate);\n\t\t\t} catch(Exception $e){\n\t\t\t\tMage::logException($e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$error = Mage::getModel('shipping/rate_result_error');\n\t\t\t$error->setCarrier($this->_code);\n\t\t\t$error->setCarrierTitle($this->getConfigData('title'));\n\t\t\t$error->setErrorMessage($this->getConfigData('specificerrmsg'));\n\t\t\t$result->append($error);\n\t\t}\n\t\treturn $result;\n\t}",
"abstract public function getMinimumLevel()\n\t{\n\t\treturn 0.5;\n\t}",
"public function testMinScore()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->withMinScore(1));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(1.0, $elasticQuery['min_score']);\n }",
"public function test_it_should_decrease_quality_of_expired_ordinary_item_twice_as_fast()\r\n {\r\n $initialQuality = 13;\r\n $this->itemBuilder->expired()->ordinaryItem()->ofQuality($initialQuality);\r\n\r\n $this->updateQuality();\r\n\r\n $this->assertThatQualityIs(equalTo($initialQuality - 2));\r\n }"
] |
[
"0.7388441",
"0.6490028",
"0.6371687",
"0.6272564",
"0.6111259",
"0.59090626",
"0.5837534",
"0.5829769",
"0.5745592",
"0.5570338",
"0.55660564",
"0.55527645",
"0.55002",
"0.5496857",
"0.5484851",
"0.5482766",
"0.5482485",
"0.54745585",
"0.54445225",
"0.54182845",
"0.54148537",
"0.54055214",
"0.5398481",
"0.5335373",
"0.5320175",
"0.53198385",
"0.5319119",
"0.5309082",
"0.52949786",
"0.52908164"
] |
0.75311226
|
0
|
Display a listing of the resource. GET /condo
|
public function index()
{
$condo = $this->condoRepository->getAllForUser(Auth::user());
return $condo->toJson();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function index()\n {\n $data = Condo::all();\n return view('condos.index', compact('data'));\n }",
"public function index()\n {\n $conductores =Conductor::all();\n\n return $this->showAll($conductores);\n }",
"public function index()\n {\n $contatos = FaleConosco::orderByDesc('created_at')->paginate();\n\n return view('admin.fale-conosco.index', compact('contatos'));\n }",
"public function index()\n {\n return Contatos::orderBy('id', 'DESC')->get();\n }",
"public function index(){\n\n\t\t$model = new CursoModel();\n \n \n\t\t$data['cursos'] = $model->orderBy('id', 'DESC')->findAll();\n\n\t\treturn $this->respond($data);\n }",
"public function index()\n {\n $datos['Condominios']= Condominio::paginate();\n return view('condominio.index',$datos);\n }",
"public function index()\n {\n $cargos = Cargo::All();\n\t\t\n\t\treturn view('contable.cargo.listaCargos', ['cargos' => $cargos]);\n }",
"public function index()\n {\n $contatos = Contato::orderBy('nome')->paginate(10);\n\n return view ('contato.lista',['contatos'=>$contatos]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HffBlogBundle:Comentarios')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public static function index()\n {\n return Comida::all();\n }",
"public function index()\n {\n $convencoes = $this->convencoesRepository->paginate();\n return $this->item($convencoes, new ConvencoesTransformer());\n }",
"public function actionIndex()\n {\n $searchModel = new ConcursanteSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n { \n $consig=consignaciones::all();\n return view('TdoConsignaciones.conshow',compact('consig')); \n }",
"public function index()\n {\n $consortia = Consortium::orderby('name')->paginate(10); // limit to 10 at a time\n\n return view('consortia.index', compact('consortia'));\n }",
"public function index()\n {\n // Entrega las Comunas, Provincias y Regiones\n\n $comunas= ComunasModel::all();\n\n return $this->showAll($comunas);\n }",
"public function index()\n {\n $cobons = DiscountCobon::paginate(18);\n return view('admin.discountCobons.view', ['cobons' => $cobons]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $contabilizars = $em->getRepository('AmdPiperBundle:Contabilizar')->findAll();\n\n return $this->render('AmdPiperBundle:Contabilizar:index.html.twig', array(\n 'contabilizars' => $contabilizars,\n ));\n }",
"public function index()\n\t{\n\t\t$tc = TipoComunicacion::all();\n\t\t$comunicacion = Comunicaciones::Tipo_comunicacion_Disponibles();\n $this->layout->titulo = 'Listado de Comunicaciones';\n $this->layout->nest(\n 'content',\n 'comunicaciones.index',\n array(\n \t'tipoComunicaciones' => $tc,\n 'comunicaciones' => $comunicacion\n )\n );\n\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cancions = $em->getRepository('MusicaBundle:Cancion')->findAll();\n\n return $this->render('cancion/index.html.twig', array(\n 'cancions' => $cancions,\n ));\n }",
"public function index()\n {\n $contaBancaria = ContaBancaria::all();\n return $contaBancaria;\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MrsBlogBundle:Cidades')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $helpers = $this->get(\"app.helpers\");\n $em = $this->getDoctrine()->getManager();\n $casos = $em->getRepository('AppBundle:Caso')->findBy(\n array('estado' => 1)\n );\n $response = array(\n 'status' => 'success',\n 'code' => 200,\n 'msj' => \"listado casos\", \n 'data'=> $casos,\n );\n \n return $helpers->json($response);\n }",
"public function index()\n {\n $consommations=Consommation::get()->paginate(10);\n return view('consommations.index', compact('consommations'));\n }",
"public function index()\n {\n //\n $distritos = Distritos::get();\n return DistritoResource::collection($distritos);\n }",
"public function obtener_consultores()\n {\n \t$query = $this->query_consultores();\n\n\t\tif($query)\n\t\t{\n\t\t\treturn formatear_respuesta($query, 'Lista completa de consultores', 200);\n\n\t\t}else{\n\n\t\t\treturn formatear_respuesta('No se pudieron listar los consultores', 404);\n\t\t}\n }",
"public function index()\n {\n $convocatorias = Convocatorias::paginate(10);\n return view('convocatorias.index', compact('convocatorias'));\n }",
"public function index()\n {\n return MonitoreoResource::collection(Monitoreo::all());\n //return MonitoreoResource::collection(Conexione::orderBy('ipe_id', 'asc')->get());\n }",
"public function index() {\n $contratos = Contrato::all();\n return view('admin.contratos.main')->with('contratos', $contratos);\n }",
"public function index()\n {\n return CiudadesResources::collection(Ciudad::all()); \n }"
] |
[
"0.72475797",
"0.7083961",
"0.7009317",
"0.6949328",
"0.6929935",
"0.6927859",
"0.6899053",
"0.6878513",
"0.6847604",
"0.6835579",
"0.6807201",
"0.6805933",
"0.6668144",
"0.665811",
"0.66549796",
"0.66519517",
"0.6650529",
"0.6628398",
"0.66197395",
"0.6617652",
"0.66147316",
"0.66096824",
"0.6604395",
"0.65786445",
"0.65735",
"0.6564906",
"0.65512544",
"0.65378076",
"0.65353274",
"0.65345585"
] |
0.7573434
|
0
|
TODO: Implement confirmDelete() method.
|
protected function confirmDelete() {
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function confirmDelete( )\r\n {\r\n throw new KVDdom_RedactieException( 'Kan het verwijderen niet bevestigen van een object dat niet verwijderd is.' );\r\n }",
"function delete()\n\t{\n\t\t$model = $this->getModel();\n\t\t$viewType\t= JFactory::getDocument()->getType();\n\t\t$view = $this->getView($this->view_item, $viewType);\n\t\t$view->setLayout('confirmdelete');\n\t\tif (!JError::isError($model)) {\n\t\t\t$view->setModel($model, true);\n\t\t}\n\t\t//used to load in the confirm form fields\n\t\t$view->setModel($this->getModel('list'));\n\t\t$view->display();\n\t}",
"protected function markConfirmDelete( )\r\n {\r\n $this->_sessie->registerConfirmDelete( $this );\r\n }",
"public function confirmingDeletion()\n {\n $this->confirmingExpenseDeletion = true;\n }",
"public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }",
"public function confirmAction() {\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t$controller = Zend_Controller_Front::getInstance ()->getRequest ()->getControllerName ();\n\t\ttry {\n\t\t\tif (is_numeric ( $id )) {\n\t\t\t\t$this->view->back = \"/admin/$controller/edit/id/$id\";\n\t\t\t\t$this->view->goto = \"/admin/$controller/delete/id/$id\";\n\t\t\t\t$this->view->title = $this->translator->translate ( 'Are you sure you want to delete the invoice selected?' );\n\t\t\t\t$this->view->description = $this->translator->translate ( 'The invoice will not be longer available' );\n\t\t\t\t$record = $this->invoices->find ( $id );\n\t\t\t\t$this->view->recordselected = $record ['number'] . \" - \" . Shineisp_Commons_Utilities::formatDateOut ( $record ['invoice_date'] );\n\t\t\t} else {\n\t\t\t\t$this->_helper->redirector ( 'list', $controller, 'admin', array ('mex' => $this->translator->translate ( 'Unable to process the request at this time.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\techo $e->getMessage ();\n\t\t}\n\t\n\t}",
"public function confirmAction() {\r\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\r\n\t\t$controller = Zend_Controller_Front::getInstance ()->getRequest ()->getControllerName ();\r\n\t\ttry {\r\n\t\t\tif (is_numeric ( $id )) {\r\n\t\t\t\t$this->view->back = \"/admin/$controller/edit/id/$id\";\r\n\t\t\t\t$this->view->goto = \"/admin/$controller/delete/id/$id\";\r\n\t\t\t\t$this->view->title = $this->translator->translate ( 'Are you sure you want to delete the selected record?' );\r\n\t\t\t\t$this->view->description = $this->translator->translate ( 'If you delete the selected bank information, your customers will not be able to pay you with this method of payment' );\r\n\t\r\n\t\t\t\t$record = $this->productsattributes->find ( $id )->toArray();\r\n\t\t\t\t$this->view->recordselected = $record ['code'];\r\n\t\t\t} else {\r\n\t\t\t\t$this->_helper->redirector ( 'list', $controller, 'admin', array ('mex' => $this->translator->translate ( 'Unable to process the request at this time.' ), 'status' => 'danger' ) );\r\n\t\t\t}\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\techo $e->getMessage ();\r\n\t\t}\r\n\t}",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"protected function delete() {\n\t}",
"public function confirm_delete($id)\n\t{\n\t\treturn_view('view.confirm_delete.php', $id);\n\t}",
"public function confirmDeleteBook()\n\t{\n\t\t$this->delete_book_model->deleteBook($this->input->post('bookISBN'));\n\t\tredirect($this->config->base_url());\n\t}",
"function path_admin_delete_confirm_submit($form, &$form_state) {\n if ($form_state['values']['confirm']) {\n path_admin_delete($form_state['values']['pid']);\n $form_state['redirect'] = 'admin/build/path';\n return;\n }\n}",
"public function actionDelete() {}",
"public function actionDelete() {}",
"public function deleteBackupConfirm()\n {\n $delete_backups = $this->getPost('backups');\n $type = $this->getPost('type');\n $backups = $this->validateBackups($delete_backups, $type);\n $variables = array(\n 'settings' => $this->settings,\n 'backups' => $backups,\n 'backup_type' => $type,\n 'method' => $this->getPost('method'),\n 'errors' => $this->errors,\n 'view_helper' => $this->view_helper,\n 'url_base' => $this->url_base,\n 'menu_data' => $this->backup_lib->getDashboardViewMenu(),\n 'section' => 'db_backups',\n 'theme_folder_url' => plugin_dir_url(self::name)\n );\n \n //$template = 'backuppro/delete_confirm';\n \n //ee()->view->cp_page_title = $this->services['lang']->__('dashboard');\n $template = 'admin/views/delete_confirm';\n $this->renderTemplate($template, $variables);\n }",
"protected function deleteAction()\n {\n }",
"protected function _delete()\n\t{\n\t}",
"public function delete()\n\t{\n\t\t$this->plugin->setResponse('in delete');\n\t}",
"public function deleteAction() {\n \n }",
"public function deleting()\n {\n # code...\n }",
"public function onBeforeDelete();",
"public function deleteDance(){\n $data = [\n 'status' => ''\n ];\n if(isset($_GET['id'])) {\n $id = $_GET['id'];\n\n if (isset($_POST['confirm'])) {\n if ($_POST['confirm'] == 'Yes') {\n $this->adminModel->deleteDance($id);\n $data['status'] = 'Event has been deleted';\n $this->view('admins/homepage', $data);\n } else if ($_POST['confirm'] == 'No') {\n $data['status'] = 'Event could not be deleted please contact the administrator';\n $this->view('admins/homepage', $data);\n }\n }\n }\n $this->view('admins/deleteDance' , $data);\n\n }",
"function delete()\n {\n }",
"protected function onDeleting()\n {\n return true;\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"function deleteCompleted() {\n\n if ( isset( $_POST['confirm'] ) ) {\n\n // User has confirmed deletion: delete the to-dos\n if ( !checkAuthToken() ) return;\n Todo::deleteCompletedForUser( User::getLoggedInUser() );\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n\n } else {\n\n // User has not confirmed deletion yet: display the confirm dialog\n require( TEMPLATE_PATH . \"/deleteCompleted.php\" );\n }\n}",
"public function isDelete();",
"public function deleteAction()\n {\n \n }",
"public function delete()\r\n\t{\r\n\t}"
] |
[
"0.78655946",
"0.7663028",
"0.75194913",
"0.7358071",
"0.729978",
"0.72112894",
"0.7196454",
"0.71940494",
"0.7193515",
"0.7178524",
"0.7167773",
"0.7070306",
"0.7065883",
"0.7064906",
"0.7064906",
"0.7062711",
"0.70587164",
"0.7013489",
"0.69973856",
"0.699689",
"0.6992221",
"0.6991408",
"0.6978042",
"0.69433814",
"0.69203997",
"0.6905917",
"0.6900973",
"0.68932927",
"0.68431985",
"0.68368894"
] |
0.9050621
|
0
|
update the scanOut timestamp
|
function updateScanOut() {
//get a connection to the database
$connection = SQL::getConn();
//MySQL query to execute
mysqli_query($connection, "UPDATE scans SET scanOut = current_timestamp WHERE (scanIn > (NOW() - INTERVAL 1 HOUR) && (id='$_POST[id])')");
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updatePinTime()\n {\n /*Redis::command(\"sadd\", [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 2,5,6, \"j\", \"aaa\"]);\n $x = Redis::command('spop', [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 100]);*/\n $pin_id = [];\n $result = PinTimeUpdate::limit(100)->get();\n foreach ($result as $value) {\n $pin_id[] = CacheHelper::getCache(\"user_pin_id\", [\"user_id\" => $value->user_id]);\n $value->delete();\n }\n\n Pin::whereIn(\"id\", $pin_id)->update(['updated_at' => DB::raw('DATE_ADD(updated_at,INTERVAL 10 MINUTE)')]);\n }",
"public function updateMostRecentScan() {\n //finds the most recent scan\n $mostRecentScan = Scans::where('uid', '=', $this->id)->orderBy('scan_date', 'desc')->first();\n //if there isn't a scan, then the most recent scan doesn't exist\n if (is_null($mostRecentScan)) $this->last_scanned = '0000-00-00';\n //otherwise, it sets the date to the scan date of the scan\n else $this->last_scanned = $mostRecentScan->scan_date;\n //save the user\n $this->save();\n }",
"public function updateLastUsed()\n {\n if (\n $this->last_used_at === null ||\n $this->last_used_at < (new \\DateTime())->sub(new \\DateInterval('P1D'))\n ) {\n $this->last_used_at = new \\DateTime();\n $this->save();\n }\n }",
"public function refreshTimestamp();",
"public function seen(): void\n {\n $this->lastSeen = new DateTime();\n }",
"public function refreshUpDated()\n {\n $this->setUpdated(new \\DateTime());\n }",
"function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}",
"public function clockout(){\n\t\tdate_default_timezone_set('Asia/Jakarta');\n\t\t$employee_id=$this->input->post('employee_id', TRUE);\n\t\t$clock_in=$this->input->post('clock_in', TRUE);\n\t\t$long_out=$this->input->post('long_out', TRUE);\n $lat_out=$this->input->post('lat_out', TRUE);\n\n\t\t$clock_out=date(\"Y-m-d H:i:s\");\n\n\t\t$ci = new DateTime($clock_in);\n\t\t$co = new DateTime($clock_out);\n\n\t\t$interval = date_diff($ci,$co);\n\n\t\t$work_hour=$interval->format('%h:%i:%s');\n\n\t\ttry {\n\t\t\t$sql= \"UPDATE tb_r_attendance\n\t\t\t\t\tSET clock_out='$clock_out',\n\t\t\t\t\t\tlong_out='$long_out',\n\t\t\t\t\t\tlat_out='$lat_out',\n\t\t\t\t\t\twork_hour='$work_hour'\n\t\t\t\t\tWHERE employee_id = '$employee_id'\n\t\t\t\t\tand (cast(clock_in as date)=cast('$clock_in' as date) OR (cast(clock_in as date)=cast(DATE_SUB('$clock_in',interval 1 day) as date) AND (clock_out IS NULL OR clock_out=clock_in)))\";\n\t\t\t$this->db->query($sql);\n\t\t \treturn $this->output\n \t->set_content_type('application/json')\n \t->set_output(json_encode(array(\n 'msgType' => \"info\",\n 'msgText' => \"Hati2 di jalan keluarga menanti dirumah..\"\n )));\n\n\t\t} catch (Exception $e) {\n\t\t\treturn $this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode(array(\n\t 'msgType' => 'warning',\n\t 'msgText' => $e->getMessage()\n\t )));\n\t\t}\n\n\t\t\n\t}",
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}",
"public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}",
"public function markLastUpdate()\n {\n if (!$this->updatedAtOveridden) {\n $this->updatedAt = new \\DateTime();\n }\n }",
"public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}",
"public function refreshUpdateAt() {\n // Get session\n $securitySession = $this->getSecuritySession();\n if($securitySession != null) {\n $securitySession[self::SESS_UPDATED_AT] = time();\n $this->setSecuritySessionFromArray($securitySession);\n }\n }",
"public function in_today_out() {\r\n // header('Content-Type: text/plain');\r\n $general = $this->Dao_ot_hija_model->get_ots_times();\r\n $total_reg = count($general);\r\n\r\n $cont_total_in_otp = 0;\r\n $cont_total_out_otp = 0;\r\n $cont_total_hoy_otp = 0;\r\n $cont_total_otp = 0;\r\n\r\n $ingenieros = [];\r\n $x = 0;\r\n for ($i = 0; $i < $total_reg; $i++) {\r\n // CReamos el indice del ingeniero para otp si no existe\r\n if (!isset($ingenieros[$general[$i]->k_id_user])) {\r\n $ingenieros[$general[$i]->k_id_user] = [];\r\n $ingenieros[$general[$i]->k_id_user]['out'] = 0;\r\n $ingenieros[$general[$i]->k_id_user]['in'] = 0;\r\n $ingenieros[$general[$i]->k_id_user]['hoy'] = 0;\r\n }\r\n\r\n // validar si oth está fuera de times\r\n if ($general[$i]->tiempo > 0) {\r\n if (!array_key_exists($general[$i]->k_id_ot_padre, $ingenieros[$general[$i]->k_id_user])) {\r\n $ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre] = array('time' => 1, \"cliente\" => $general[$i]->n_nombre_cliente);\r\n $ingenieros[$general[$i]->k_id_user]['out'] ++;\r\n $cont_total_out_otp++;\r\n $cont_total_otp++;\r\n } else {\r\n switch ($ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre]['time']) {\r\n case '1':\r\n\r\n break;\r\n case '0':\r\n $ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre]['time'] = 1;\r\n $ingenieros[$general[$i]->k_id_user]['out'] ++;\r\n $ingenieros[$general[$i]->k_id_user]['hoy'] --;\r\n $cont_total_out_otp++;\r\n $cont_total_hoy_otp--;\r\n break;\r\n case '-1':\r\n $ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre]['time'] = 1;\r\n $ingenieros[$general[$i]->k_id_user]['out'] ++;\r\n $ingenieros[$general[$i]->k_id_user]['in'] --;\r\n $cont_total_out_otp++;\r\n $cont_total_in_otp--;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // validar si oth está para now\r\n if ($general[$i]->tiempo == 0) {\r\n if (!array_key_exists($general[$i]->k_id_ot_padre, $ingenieros[$general[$i]->k_id_user])) {\r\n $ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre] = array('time' => 0, \"cliente\" => $general[$i]->n_nombre_cliente);\r\n $ingenieros[$general[$i]->k_id_user]['hoy'] ++;\r\n $cont_total_otp++;\r\n $cont_total_hoy_otp++;\r\n } else if ($ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre]['time'] == -1) {\r\n\r\n $ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre]['time'] = 0;\r\n $ingenieros[$general[$i]->k_id_user]['hoy'] ++;\r\n $ingenieros[$general[$i]->k_id_user]['in'] --;\r\n $cont_total_hoy_otp++;\r\n $cont_total_in_otp--;\r\n }\r\n }\r\n\r\n if ($general[$i]->tiempo < 0) {\r\n if (!array_key_exists($general[$i]->k_id_ot_padre, $ingenieros[$general[$i]->k_id_user])) {\r\n $ingenieros[$general[$i]->k_id_user][$general[$i]->k_id_ot_padre] = array('time' => -1, \"cliente\" => $general[$i]->n_nombre_cliente);\r\n ;\r\n $ingenieros[$general[$i]->k_id_user]['in'] ++;\r\n $cont_total_in_otp++;\r\n $cont_total_otp++;\r\n }\r\n }\r\n\r\n $ingenieros[$general[$i]->k_id_user]['all'] = $ingenieros[$general[$i]->k_id_user]['in'] + $ingenieros[$general[$i]->k_id_user]['hoy'] + $ingenieros[$general[$i]->k_id_user]['out'];\r\n\r\n if ($ingenieros[$general[$i]->k_id_user]['out'] > 0) {\r\n $ingenieros[$general[$i]->k_id_user]['color'] = \"btn_red\";\r\n } else if ($ingenieros[$general[$i]->k_id_user]['hoy'] > 0) {\r\n $ingenieros[$general[$i]->k_id_user]['color'] = \"btn_orange\";\r\n } else {\r\n $ingenieros[$general[$i]->k_id_user]['color'] = \"btn_green\";\r\n }\r\n }\r\n\r\n\r\n // Seccion para el tratamiento de la grafica ppalo\r\n\r\n $grafics = [];\r\n\r\n $grafics['g_inges'] = [];\r\n $grafics['g_in'] = [];\r\n $grafics['g_hoy'] = [];\r\n $grafics['g_out'] = [];\r\n $grafics['g_all'] = [];\r\n $n_i = []; // nombre ingeniero\r\n // print_r($ingenieros);\r\n\r\n $array_list_inge = $this->Dao_user_model->get_eng_trabajanding();\r\n // print_r($array_list_inge);\r\n for ($i = 0; $i < count($array_list_inge); $i++) {\r\n $n_i[$array_list_inge[$i]->k_id_user] = $array_list_inge[$i]->nombre;\r\n }\r\n\r\n\r\n\r\n foreach ($ingenieros as $cc => $value) {\r\n array_push($grafics['g_inges'], $n_i[$cc]);\r\n array_push($grafics['g_in'], $value['in']);\r\n array_push($grafics['g_hoy'], $value['hoy']);\r\n array_push($grafics['g_out'], $value['out']);\r\n array_push($grafics['g_all'], $value['all']);\r\n }\r\n\r\n\r\n\r\n $retorno = array(\r\n 'cant_otp' => $cont_total_otp,\r\n 'cant_in' => $cont_total_in_otp,\r\n 'cant_hoy' => $cont_total_hoy_otp,\r\n 'cant_out' => $cont_total_out_otp,\r\n 'ing' => $ingenieros,\r\n 'grafics' => $grafics\r\n );\r\n\r\n echo json_encode($retorno);\r\n }",
"public function checkIn($regNr, $ssNr) {\n $historyQuery = \"UPDATE history SET checkInTime = CURRENT_TIMESTAMP WHERE regNr = :regNr AND ssNr = :ssNr ORDER BY checkOutTime DESC LIMIT 1\";\n $historyStatement = $this->db->prepare($historyQuery);\n $historyParameters = [\"regNr\" => $regNr, \"ssNr\" => $ssNr];\n $historyStatement->execute($historyParameters);\n if (!$historyStatement) die(\"Fatal Error.\");\n }",
"public function UpdateLastActivity()\n\t{\n\t\tif (isset($_SESSION['timestamp']) && $_SESSION['timestamp'] - time() > 60 * 10)\n\t\t{\n\t\t\t// If it's been enough time (say, 10 minutes), generate new session ID\n\t\t\t// to help prevent session hijacking\n\t\t\tsession_regenerate_id();\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\n\t\t$this->LastActivity = now();\n\t\t$this->Save();\n\t}",
"public function _update()\n {\n $this->updatedAt = new \\DateTime();\n }",
"public function updateLastPing()\n {\n $this->last_ping = Carbon::now();\n $this->save();\n }",
"public function refreshUpdated()\n {\n $this->setUpdated(new \\DateTime());\n }",
"protected function updateRequestTime()\n {\n $this->requestTimestamp = microtime(true);\n }",
"public function updateLastConnect()\n {\n $s = 'UPDATE `users` SET `last_connect`=now() WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n }",
"public function markAllAsSeen()\n {\n SystemLog::unseen()->update(['seen_at' => now()]);\n }",
"public function offsetsUpdated() {}",
"public function refreshUpdated(): void\n {\n $this->setUpdatedAt(new \\DateTime());\n }",
"public function updateUpdatedAt()\n {\n $this->setUpdatedAt(new \\Datetime());\n }",
"public function populateTimestamp()\n {\n $this->exists = true;\n $this->timestamp = 1;\n }",
"public function touch() {\n $this->updatedAt = new DateTime();\n }",
"public function UpdateClockOutTime(){\n\t\t $input_data \t\t= \t$this->GetDecryptedData(Input::get()['request']);\n\t\t $rules = array(\n\t\t 'user_id' \t\t\t=> 'required',\n\t\t //'device_id' \t\t=> 'required',\n\t\t 'platform_type' => 'required',\n\t\t 'latitude' \t\t=> 'required',\n\t\t 'longitude' \t\t=> 'required',\n\t\t 'clinic_id' \t\t=> 'required',\n\t\t );\n\t\t $validator = Validator::make($input_data,$rules);\n\t\t if ($validator->fails()){\n\t\t\t $messages = $validator->messages();\n\t\t\t return $this->encrypt(json_encode(array('status' => 'error', 'message' => $validator->errors()->all())));\n\t\t }else{\n\t\t\t$update = ClinicStatusModel::UpdateClockOut($input_data['clinic_id'],$input_data['user_id']);\n\t\t\tif($update){\n\t\t\t\t// process to insert provider timesheet record starts here//\n\t\t\t\t$clinic_data = ClinicsModel::where('id',$input_data['clinic_id'])->first();\n\t\t\t\t$clinic_date_time \t\t= $clinic_data->date.' '.$clinic_data->time;\n\t\t\t\t\n\t\t\t\t$clinics_status_record = ClinicStatusModel::where('clinic_id',$input_data['clinic_id'])->where('provider_id',$input_data['user_id'])->first();\n\n\t\t\t\t$user_current_time \t\t= date('Y-m-d H:i:s');\n\t\t\t\t$clockin_user_time \t\t= $clinics_status_record->clock_in;\n\t\t\t\t\n\t\t\t\t$user_record = DB::table('users')->select('hourly_rate')->where('id',$input_data['user_id'])->first();\n\t\t\t\t// saving user lat long geo location at clock_out time //\n\t\t\t\t$save_record = GeoLocationModel::insert(['user_id' \t=> $input_data['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'clinic_id' => $input_data['clinic_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'latitude' \t=> $input_data['latitude'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'longitude' => $input_data['longitude'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t]);\n\t\t\t\t\n\t\t\t\t$count = TimesheetRecords::where('clinic_id',$input_data['clinic_id'])->where('provider_id',$input_data['user_id'])->count();\n\t\t\t\tif($count == 0){\n\t\t\t\t\t$spend_time\t\t\t\t\t= round((strtotime($user_current_time)-strtotime($clockin_user_time))/60);\n\t\t\t\t\t$model\t\t\t \t\t\t= new TimesheetRecords;\n\t\t\t\t\t$model->clinic_id \t\t= $input_data['clinic_id'];\n\t\t\t\t\t$model->provider_id \t\t= $input_data['user_id'];\n\t\t\t\t\t$model->clinic_date \t\t= $clinic_date_time;\n\t\t\t\t\t$model->clinic_location \t= $clinic_data->location_name;\n\t\t\t\t\t$model->clinic_latitude \t= $clinic_data->latitude;\n\t\t\t\t\t$model->clinic_longitude \t= $clinic_data->longitude;\n\t\t\t\t\t$model->clock_in \t\t\t= $clockin_user_time;\n\t\t\t\t\t$model->clock_out \t\t= $user_current_time;\n\t\t\t\t\t$model->clinic_spend_time \t= $spend_time;\n\t\t\t\t\t$model->mileage \t\t\t= null;\n\t\t\t\t\t$model->drive_time \t\t= null;\n\t\t\t\t\t$model->hourly_rate \t\t= $user_record->hourly_rate;\n\t\t\t\t\t$model->income \t\t\t= ($spend_time/60)*$user_record->hourly_rate;\n\t\t\t\t\t$save_model = $model->save();\n\t\t\t\t}\n\n\t\t\t\t// process to insert provider timesheet record starts here//\n\t\t\t\n\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'success','message'=>'Successfully clocked out.')));\n\t\t\t}else{\n\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'success','message'=>'Technical error.')));\n\t\t\t}\n\t\t }\n\t }",
"public function setSyncTime(): void\n {\n }"
] |
[
"0.56477284",
"0.55609035",
"0.54990166",
"0.5381086",
"0.52230334",
"0.51041836",
"0.51040095",
"0.5083437",
"0.50754017",
"0.4992569",
"0.4992539",
"0.49881774",
"0.49811274",
"0.49432278",
"0.48798493",
"0.48736504",
"0.48499304",
"0.4841786",
"0.478418",
"0.4777841",
"0.47418723",
"0.4724121",
"0.47200763",
"0.47077063",
"0.4685039",
"0.4681015",
"0.46789",
"0.4662507",
"0.46613324",
"0.46576586"
] |
0.8180009
|
0
|
update the total count in the users table
|
function updateCount() {
$connection = SQL::getConn();
//MySQL query to execute
mysqli_query($connection, "UPDATE users SET total = total + 1 WHERE (id='$_POST[id]')");
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updateTotal() {\n //get the scans for this user\n $scans = $this->scans();\n //create running total\n $newTotal = 0; \n //for each scan, add the total pups and virus to the total\n foreach ($scans as $scan) {\n $newTotal += $scan->pups + $scan->troj_mal;\n }\n //sets and saves the new total for this user\n $this->total = $newTotal;\n $this->save();\n }",
"public function updateUserAgencyCount() {\n\t\t$dummyUserCount = array();\n\t\t$dummyUserCount['dummy_user_count'] = 1;\n $dummyUserCount['agency_size'] = 1;\n\t\n\t\t$conditions = array();\n\t\t$conditions['id'] = $this->id;\n\n\t\t$success = ConnectionFactory::updateTableRowRelativeBasic(\"users\", $dummyUserCount, $conditions);\n\t\tif ($success) {\n\t\t\t$this-> dummy_user_count = $this->dummy_user_count + 1;\n $this-> agency_size = $this-> agency_size + 1;\n\t\t}\n\t\treturn $success;\n\t}",
"public function updateCount() {\n $sql = \"UPDATE goCount SET count = count + 1 WHERE 1\";\n\n if (self::$conn->query($sql) === FALSE) {\n echo \"Error updating count record: \" . self::$conn->error;\n }\n }",
"public function updateUserCounterCache() {\n\t\t$list = $this->User->find('list');\n\t\t$users = array_keys($list);\n\t\t$this->out('<warning>Updating ' . count($users) . ' user project counts...</warning>', 0);\n\t\tif (!count($users)) {\n\t\t\t$this->out('nothing to do.');\n\t\t\treturn;\n\t\t}\n\t\tif ($this->params['dry-run']) {\n\t\t\t$this->out('dry-run.. skipping.');\n\t\t\treturn;\n\t\t}\n\t\tforeach ($users as $userId) {\n\t\t\t$this->User->id = $userId;\n\t\t\t$allCount = $this->Project->find('count', array('conditions' => array('Project.user_id' => $userId)));\n\t\t\t$publicCount = $this->Project->find('count', array('conditions' => array('Project.user_id' => $userId, 'Project.public' => Project::PROJ_PUBLIC)));\n\t\t\t$user = array(\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => $userId,\n\t\t\t\t\t'project_count' => $allCount,\n\t\t\t\t\t'public_count' => $publicCount,\n\t\t\t\t\t'modified' => false,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif (!$this->User->save($user)) {\n\t\t\t\t$this->out('<error>Error saving count.</error>');\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->out('.', 0);\n\t\t\t}\n\t\t\tunset($user);\n\t\t}\n\t\t$this->out('done.');\n\t}",
"function update_user_total_groups($user) {\n global $db;\n $count = $db->count(tbl($this->gp_tbl), \"group_id\", \" userid='$user' \");\n $db->update(tbl(\"users\"), array(\"total_groups\"), array($count), \" userid='$user' \");\n }",
"public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }",
"public function setTotalUsers(?int $value): void {\n $this->getBackingStore()->set('totalUsers', $value);\n }",
"function update_users_tracking_alert_count()\n{\n $update_tracking_count = '\n UPDATE user\n LEFT JOIN (SELECT user_id,COUNT(*) alert_count FROM tracking_and_alerts GROUP BY user_id) as tracking_and_alerts\n ON tracking_and_alerts.user_id = user.user_id\n SET user.no_of_alerts_subscribed = tracking_and_alerts.alert_count';\n execute_sql($update_tracking_count);\n}",
"function wp_update_network_user_counts() {\n\tglobal $wpdb;\n\n\t$count = $wpdb->get_var( \"SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'\" );\n\tupdate_site_option( 'user_count', $count );\n}",
"public function handbks_object_counts_update() {\n $this->db->query(\"call handbks_object_counts_update();\");\n }",
"function countUsers(){\n\t\n\t}",
"public function updateCount() {\n $query = $this->connection->select($this->mapTable);\n $query->addExpression('COUNT(*)', 'count');\n $query->condition('needs_update', MigrateMap::STATUS_NEEDS_UPDATE);\n $count = $query->execute()->fetchField();\n return $count;\n }",
"public function userCount(Request $request)\n {\n $company = Company::findOrfail($request->compId);\n $company->user_count = $request->userCount;\n if ($company->save()) {\n return response()->json([\n 'count_msg' => 'User count changed successfully!',\n 'style' => 'color:darkblue'\n ]);\n } else {\n return response()->json([\n 'count_msg' => 'Sorry, user count not changed!',\n 'style' => 'color:darkred'\n ]);\n }\n\n }",
"public function updateLikesCount()\n {\n $totals = Db::table('rainlab_forum_likes as r')\n ->select(Db::raw('sum(r.like) as likes, sum(r.unlike) as unlikes'))\n ->wherePostId($this->id)\n ->first();\n\n $this->count_likes = $totals->likes;\n $this->count_unlikes = $totals->unlikes;\n $this->save();\n }",
"public static function updateUserCount($id){\n\n\t\t$id = intval($id);\n\n\t\t$query = \"SELECT COUNT(*) FROM `games` WHERE `id` = '$id'\";\n\t\t$result = @DB::sql_fetch(DB::sql($query));\n\n\t\tif($result){\n\n\t\t\t$updated_count = intval(($result['COUNT(*)']));\n\n\t\t\t$query = \"UPDATE `games` SET `user_count` = '$updated_count' WHERE `id` = '$id'\";\n\n\t\t\tif(DB::sql($query)){\n\t\t\t\treturn $updated_count;\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn false;\n\n\t}",
"private function updateUnitCount(){\n $units = $this->currentUnits + $this->requestedUnits;\n error_log(\"Updated Unit Count: \" . $units);\n try {\n $stmt = $this->dbh->prepare(\"UPDATE `Locations`\n SET AccUnits = :units\n WHERE P_Id = :id\");\n $stmt->bindParam(\":units\", $units);\n $stmt->bindParam(\":id\",$this->accId);\n $stmt->execute();\n } catch (Exception $e) {\n error_log(\"Error: \" . $e->getMessage());\n }\n }",
"public function numUsers(){\n $query = \"SELECT count(*) FROM final_usuario\";\n return $this->con->action($query);\n }",
"function wp_schedule_update_user_counts()\n {\n }",
"public function updateCount($user_mail,$login_count) {\n\n $changed = time();\n $login_count++;\n \n $query = \\Drupal::database()->update('am_registration_login_count');\n $query->fields([\n 'logincount' => $login_count,\n 'changed' => $changed,\n ]);\n $query->condition('mail', $user_mail);\n $query->execute();\n \n return $result;\n }",
"function _update_user()\n {\n //pr_db($post_total);\n $tbl = 'user';\n $list = model($tbl)->get_list();\n foreach ($list as $row) {\n $post_total = model('product')->filter_get_total(['user_id' => $row->id]);\n $post_is_publish = model('product')->filter_get_total(['user_id' => $row->id, 'status' => 1]);\n $post_is_draft = model('product')->filter_get_total(['user_id' => $row->id, 'is_draft' => 1]);\n $post_is_deleted = model('product')->filter_get_total(['user_id' => $row->id, 'deleted' => 1]);\n\n $follow_total = model('user_storage')->filter_get_total(['user_id' => $row->id,'action'=>'subscribe']);\n $follow_by_total = model('user_storage')->filter_get_total(['table_id' => $row->id,'action'=>'subscribe']);\n model($tbl)->update($row->id,\n [\n 'post_total' => $post_total,\n 'post_is_publish' => $post_is_publish,\n 'post_is_draft' => $post_is_draft,\n 'post_is_deleted' => $post_is_deleted,\n\n 'follow_total' => $follow_total,\n 'follow_by_total' => $follow_by_total,\n ]\n );\n echo '<br>--';\n pr_db(0, 0);\n }\n }",
"public function getTotalUsers(View $view)\n {\n $users = \\DB::table('users')->get();\n $total_users = \\DB::table('users')->count();\n $view->with('totalUsers', $total_users);\n }",
"public function updateCommentCount()\n {\n $this->comment_count = $this->comments()->count();\n\n $this->save();\n }",
"public function actionUpdatacount(){\n $allusermodel = MY_User::find()->where(\"iseal = 0 && isout = 0\")->all();\n $cashcount = 0;\n $registcount = 0;\n $hcgcount = 0;\n $shopcount = 0;\n $stockcount = 0;\n $sellstockcount = 0;\n foreach ($allusermodel as $usermodel){\n $user = MY_User::find()->where(\"id = :userid\",[\":userid\"=>$usermodel->id])->with([\"stock\",\"level\",\"wallet\"])->one();\n\n if($user instanceof MY_User){\n if($user->wallet){\n $cashcount = $cashcount + $user->wallet->cash_wa;\n $registcount = $registcount + $user->wallet->regist_wa;\n $hcgcount = $hcgcount + $user->wallet->hcg_wa;\n $shopcount = $shopcount + $user->wallet->shop_wa;\n }\n if($user->stock){\n if($user->stock->stock > $user->level->dfc_base){\n $sellstockcount = $sellstockcount + ($user->stock->stock - $user->level->dfc_base);\n }\n $stockcount = $stockcount + $user->stock->stock;\n }\n }\n }\n $updatacount = new \\common\\models\\Syscache();\n $updatacount->cash_wa = $cashcount;\n $updatacount->regist_wa = $registcount;\n $updatacount->hcg_wa = $hcgcount;\n $updatacount->shop_wa = $shopcount;\n $updatacount->stockcount = $stockcount;\n $updatacount->sellstock = $sellstockcount;\n $updatacount->created_at = time();\n $updatacount->updated_at = time();\n if($updatacount->save()){\n Yii::$app->getSession()->setFlash(\"success\", \"数据更新成功!\");\n }else{\n Yii::$app->getSession()->setFlash(\"error\", \"数据更新失败!\");\n $updatacount->errors();\n }\n return $this->render(\"index\");\n }",
"function update_view_count($table, $set_field, $where_field, $where_value)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"UPDATE $table SET $set_field = $set_field + 1 WHERE $where_field = $where_value\";\n\n\t\tif ( !$db->sql_query($sql) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, \"Could Not Update Count\", '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}",
"public function setTotalUsersCount($val)\n {\n $this->_propDict[\"totalUsersCount\"] = intval($val);\n return $this;\n }",
"public function setTotalCount($totalCount);",
"public function setCompleteUsersCount(?int $value): void {\n $this->getBackingStore()->set('completeUsersCount', $value);\n }",
"static public function update(Count $obj){\n\t\t$sql = 'CALL count_update(:count_id, :total)';\n\t\t$params = array(':count_id' => $obj->getId(), ':total' => $obj->getTotal());\n\t\tDatabaseHandler::execute($sql, $params);\n\t}",
"function IncrementUsers(){\n\t\t$query = \"UPDATE\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tSET\n\t\t\t\t\tVartotoju_kiekis = Vartotoju_kiekis + 1 WHERE Id=0\";\n\t \n\t\t// prepare query\n\t\t$stmt = $this->conn->prepare($query);\n\t \n\t\t// execute query\n\t\t$stmt->execute();\n\t\treturn $stmt->errno;\n\t\t \n\t}",
"public function SetCount($UserID) {\n if (!is_numeric($UserID) || $UserID <= 0) {\n return;\n } \n $Query = GDN::SQL();\n // exclude deleted users if config is set\n if (C('Plugins.ProfileVisitors.HideDeletedUsers') == 1) {\n $Query->Where('u.Deleted <>', '1')\n ->Join('User u', 'v.UpdateUserID = u.UserID', 'left outer');\n }\n // Get count\n $Query->Select('v.UpdateUserID', 'count')\n ->From('Profilevisitor v')\n ->Where('v.ProfileUserID', $UserID);\n $Result = $Query->Get()->ResultArray();\n $CountProfilevisitors = $Result[0]['UpdateUserID'];\n\n // Set count\n $Query->Update('User')\n ->Set('CountProfilevisitors', $CountProfilevisitors)\n ->Where('UserID', $UserID)\n ->Put();\n return $CountProfilevisitors;\n }"
] |
[
"0.7643811",
"0.7521148",
"0.7178687",
"0.70029646",
"0.6946224",
"0.6806719",
"0.6778533",
"0.67357934",
"0.672145",
"0.6646877",
"0.66329443",
"0.66294235",
"0.6510486",
"0.65022814",
"0.64313704",
"0.64099455",
"0.6367131",
"0.63315475",
"0.6316229",
"0.62794673",
"0.62741774",
"0.62546474",
"0.6253877",
"0.62260616",
"0.62160414",
"0.6181596",
"0.6167053",
"0.61593616",
"0.61574566",
"0.6157058"
] |
0.784431
|
0
|
Set requisition list item.
|
public function setItem(RequisitionListItemInterface $item)
{
$this->item = $item;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setItem($item) {\n $this->item = $item;\n }",
"public function setItem(object $item): void\n {\n $this->item = $item;\n }",
"public function setItem($key, $item);",
"abstract function set ($item, $data);",
"public function setItem($item, $key, $expiration = NULL);",
"public function setItem($key, $value) {\n $this->setItems([$key => $value]);\n }",
"public function set($key, $item)\n {\n $this->items[$key] = $item;\n }",
"public function set_item( $item = false ) {\n\t\tif ( ! $item ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->item = $item;\n\n\t\treturn $this->get_item();\n\t}",
"public function __set($item, $value)\n {\n $this->offsetSet($item, $value);\n }",
"public function setItem(\\PB_Item $value=null)\n {\n return $this->set(self::ITEM, $value);\n }",
"function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}",
"function set_item($item, $value)\n\t{\n\t\t$this->config[$item] = $value;\n\t}",
"function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }",
"function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }",
"public function edit(Requisition $requisition)\n {\n //\n }",
"public function set_processed_item( $item ) {\n\t\t$this->processed_item = $item;\n\n\t\treturn $this->get_processed_item();\n\t}",
"protected function set__items( $val )\n\t{\n\t\t\n\t}",
"public function setReference( &$ref ) {\n\t\t$this->items = $ref;\n\t\treturn $this;\n\t}",
"function setItemId($a_item_id)\n\t{\n\t\t$this->item_id = $a_item_id;\n\t}",
"public function setQuantity(int $quantity): void\n {\n $this->_quantity = $quantity;\n }",
"public function updateItems()\n {\n if (count($this->items)) {\n foreach ($this->items as $item) {\n $item->setInvoice($this);\n }\n }\n }",
"function setId_item($iid_item = '')\n {\n $this->iid_item = $iid_item;\n }",
"public function testSetCollectionItemTimelock()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function set_quantity( $cart_item_key, $quantity = 1 ) {\n\t\t\tif ($quantity==0 || $quantity<0) :\n\t\t\t\tunset($this->cart_contents[$cart_item_key]);\n\t\t\telse :\n\t\t\t\t$this->cart_contents[$cart_item_key]['quantity'] = $quantity;\n\t\t\tendif;\n\t\n\t\t\t$this->set_session();\n\t\t}",
"public function setItem_list($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }",
"public function setItem($item)\n {\n $this->item = $item;\n $this->storeId = $item->getStoreId();\n return $this;\n }",
"public function setItem($item)\n {\n $this->item = $item;\n $this->storeId = $item->getStoreId();\n return $this;\n }",
"public function restorethisitem()\n {\n $id_item = $this->request->getParameter(\"id\");\n $this->item->restoreItem($id_item);\n $this->message->extendedCardRestored();\n }",
"public function setItem($item, $index)\n {\n if (!$this->hasIndex($index)) {\n $message = 'Could not set item at given index';\n throw new \\Exception($message);\n }\n\n $this->list[$index] = $item;\n }",
"private function initPromoItem()\n {\n $this->promoItem = $this->createPartialMock(\n \\Amasty\\Promo\\Model\\ItemRegistry\\PromoItemData::class,\n []\n );\n $this->promoItem->setSku('test_sku')->setRuleId(1);\n }"
] |
[
"0.6421646",
"0.62387145",
"0.5751977",
"0.56551147",
"0.56366986",
"0.5525939",
"0.5452341",
"0.5404427",
"0.53739536",
"0.5364131",
"0.5355978",
"0.5343435",
"0.53069764",
"0.53069764",
"0.5287875",
"0.519878",
"0.5196818",
"0.5192849",
"0.51857746",
"0.5166087",
"0.51539457",
"0.513137",
"0.51302993",
"0.5129562",
"0.51116705",
"0.5085873",
"0.5085873",
"0.5082601",
"0.5072849",
"0.5069702"
] |
0.66156983
|
0
|
Set requisition list item errors.
|
public function setItemErrors(array $errors)
{
$this->itemErrors = $errors;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function setErrors()\n {\n $this->errors = [\n 'error_no' => curl_errno($this->curl),\n 'error' => curl_error($this->curl),\n ];\n }",
"public function setError($err);",
"function setErrors( array $errors );",
"function set_error() \n {\n $this->error_state = FORMEX_FIELD_ERROR;\n }",
"public function testGetRequisitionListItemsWithValidationErrors()\n {\n $requisitionListId = 1;\n $websiteId = 1;\n\n $validationError = 'Item validation error';\n $this->request->expects($this->once())\n ->method('getParam')->with('requisition_id')->willReturn($requisitionListId);\n $requisitionListItems = [\n $this->getMockBuilder(\\Magento\\RequisitionList\\Api\\Data\\RequisitionListItemInterface::class)\n ->setMethods(['getSku', 'setProduct', 'setNoProduct', 'setItemError', 'getItemError'])\n ->disableOriginalConstructor()->getMockForAbstractClass(),\n $this->getMockBuilder(\\Magento\\RequisitionList\\Api\\Data\\RequisitionListItemInterface::class)\n ->setMethods(['getSku', 'setProduct', 'setNoProduct', 'setItemError', 'getItemError'])\n ->disableOriginalConstructor()->getMockForAbstractClass(),\n $this->getMockBuilder(\\Magento\\RequisitionList\\Api\\Data\\RequisitionListItemInterface::class)\n ->setMethods(['getSku', 'setProduct', 'setNoProduct', 'setItemError', 'getItemError'])\n ->disableOriginalConstructor()->getMockForAbstractClass()\n ];\n $this->itemSelector->expects($this->atLeastOnce())->method('selectAllItemsFromRequisitionList')\n ->with($requisitionListId, $websiteId)->willReturn($requisitionListItems);\n $websiteMock = $this->getMockBuilder(\\Magento\\Store\\Api\\Data\\WebsiteInterface::class)\n ->disableOriginalConstructor()->setMethods(['getId'])->getMockForAbstractClass();\n $this->storeManager->expects($this->atLeastOnce())->method('getWebsite')->willReturn($websiteMock);\n $websiteMock->expects($this->atLeastOnce())->method('getId')->willReturn($websiteId);\n $this->validation->expects($this->at(0))->method('validate')->with($requisitionListItems[0])->willReturn([]);\n $this->validation->expects($this->at(1))\n ->method('validate')->with($requisitionListItems[1])->willReturn([$validationError]);\n $this->validation->expects($this->at(2))->method('validate')->with($requisitionListItems[2])\n ->willThrowException(new \\Magento\\Framework\\Exception\\NoSuchEntityException());\n $requisitionListItems[0]->expects($this->atLeastOnce())->method('getId')->willReturn(10);\n $requisitionListItems[1]->expects($this->atLeastOnce())->method('getId')->willReturn(11);\n $requisitionListItems[2]->expects($this->atLeastOnce())->method('getId')->willReturn(12);\n $this->assertSame(\n [2 => $requisitionListItems[2], 1 => $requisitionListItems[1], 0 => $requisitionListItems[0]],\n $this->grid->getRequisitionListItems()\n );\n $this->assertEquals(2, $this->grid->getItemErrorCount());\n $this->assertEquals([], $this->grid->getItemErrors($requisitionListItems[0]));\n $this->assertEquals([$validationError], $this->grid->getItemErrors($requisitionListItems[1]));\n $this->assertEquals(\n [__('The SKU was not found in the catalog.')],\n $this->grid->getItemErrors($requisitionListItems[2])\n );\n }",
"function set_error($err) {\n # Set Current Error Message\n $this->error_message = $err;\n\n # Add to Error Log\n $this->error_log[] = $err;\n\n # Increment Error Counter\n $this->error_count++;\n }",
"public function setError($error) {\n if (is_array($this->errors)) {\n $this->errors = $error;\n }\n }",
"function setError ($msg) {\r\n $this->errors[]=$msg;\r\n }",
"protected function setErrorsExist() {}",
"public function getItemErrors()\n {\n return $this->itemErrors;\n }",
"function resetErrorList(){\n\t\t$this->_errorList = array();\n\t}",
"public function setErrors($error) {\n\t\t$params = $this->controller->request->params; \n\t\t$message = $error->getMessage();\n\t\t$url = $this->controller->request->here();\n\t\t$code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500;\n\t\t$this->controller->response->statusCode($code);\n\t\t$this->controller->set(array(\n\t\t\t'name' => $message,\n\t\t\t'message' => h($url),\n\t\t\t'error' => $error,\n\t\t));\n\t\tif(isset($params['admin'])){\n\t\t\t$this->controller->render('/Errors/admin_error','admin_login');\n\t\t}else{\n\t\t\techo \"asdsadsadsa\"; die;\n\t\t\t$this->controller->render('/Errors/error','error');\n\t\t}\n\t}",
"public function setErrors($errors)\n {\n $this->errors = $errors;\n }",
"function setErrorMsg($error) {\r\r\n\t\t$this->errorMsg = KT_DynamicData($error, $this->tNG, '', false);\r\r\n\t}",
"private function set_error( $key )\n\t{\n\t\tglobal $path;\n\t\tif( isset($this->err_code[$key]) && isset($this->err_code[$key]) )\n\t\t{\t\n\t\t\t$this->arr_error[].= $this->err_label[$key]; // => array_push\n\t\t\t// DEV -->\n\t\t\t$this->num_error += $this->err_code[$key];\n\t\t\t// <-- DEV\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error( $key . ' undefined');\n\t\t\texit;\n\t\t}\n\t}",
"private function setErrors($errorMensaje)\r\n\t\t{\r\n\t\t\t$this->_controlErrors[] = $errorMensaje;\r\n\t\t}",
"protected function setErrorClassAttribute() {}",
"public function setErrors ($errors)\n {\n\n $this->errors = array_merge($this->errors, $errors);\n\n }",
"public function setErrors($val)\n {\n $this->_propDict[\"errors\"] = $val;\n return $this;\n }",
"public function getItemError()\n {\n return !empty($this->itemErrors) ? reset($this->itemErrors) : null;\n }",
"public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state);",
"public function setErrors(array $errors): void\n {\n $this->errors = $errors;\n }",
"private function setError($value) {\r\n $this->debug('setError() was called with value: ' . $value);\r\n $this->error = $value;\r\n }",
"protected function resetErrors() {\n $this->errors = array();\n }",
"private function resetErrors() {\n $this->errors = array();\n }",
"protected function _setValidationErrors($errorList)\n {\n if (!is_null($errorList)) {\n $errorList = $this->_normalizeIterable($errorList);\n }\n\n $this->validationErrors = $errorList;\n }",
"public function set_errors()\n {\n\n // Encode the array so it can be stored in a cookie\n $_SESSION['errors'] = json_encode($this->errors);\n\n }",
"public function setError($message, $key = null) {\n if (!is_null($key))\n $this->errors[$key] = $message;\n else\n $this->errors[] = $message;\n }",
"protected function setError(string $err, $value)\n {\n if (!Util::isNumeric($value))\n $value = '\"' . $value . '\"';\n\n $this->_error_bag[$this->_field] = preg_replace_callback(\n '/\\{([^}]+)\\}/', function($matches) use ($value) {\n $capture = $matches[1];\n\n switch(strtolower($capture))\n {\n case 'this':\n return $value;\n\n case '_this':\n return $this->_field;\n\n case '_index':\n return $this->_index + 1;\n }\n }, $err);\n $this->_succeeds = false;\n return false;\n }",
"public function setError($msg)\n {\n array_push($this->errors, $msg);\n }"
] |
[
"0.66296387",
"0.6462271",
"0.63785887",
"0.6296959",
"0.62086767",
"0.6183458",
"0.60671383",
"0.60588765",
"0.60392565",
"0.5930804",
"0.5921245",
"0.5907646",
"0.5880704",
"0.5854409",
"0.57959414",
"0.57883495",
"0.5780374",
"0.5778663",
"0.57666004",
"0.5728689",
"0.56671536",
"0.5634596",
"0.5626566",
"0.56195545",
"0.56126297",
"0.5609487",
"0.56094366",
"0.5606652",
"0.5601056",
"0.56005734"
] |
0.6778621
|
0
|
Get requisition list item errors.
|
public function getItemErrors()
{
return $this->itemErrors;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getItemError()\n {\n return !empty($this->itemErrors) ? reset($this->itemErrors) : null;\n }",
"public function get_list_errors()\n\t{\n\t\treturn $this->errors;\n\t}",
"public function getErrors()\n {\n return $this->getProperty(OperationInterface::BPMN_PROPERTY_ERRORS, new Collection);\n }",
"public function getError()\r\n\t\t{\r\n\t\t\treturn $this->_errores;\r\n\t\t}",
"function getListOfErrors() {\n\t\treturn $this->errorList;\n\t}",
"public function getErrors()\n\t{\n\t\treturn $this->_errorMessage;\n\t}",
"public function errors()\n {\n // return new \\ArrayList($this->errorList.values());\n }",
"public function getErrors() {\r\n return $this->pdocrudErrCtrl->getErrors();\r\n }",
"public function getErrorLog()\n {\n return $this->_errorList;\n }",
"public function getError()\n {\n $errors = self::$errors;\n self::$errors = array();\n return $errors;\n }",
"public function getErrors(): array\n {\n $error = [];\n\n foreach ($this->list as $r) {\n $error[$r->getPropertyPath()] = $r->getMessage();\n }\n\n return $error;\n }",
"function obtenerListaErrores()\n {\n return $this->_errores;\n }",
"public function getErrors()\n {\n return $this->_getChildrenByName('error');\n }",
"function getError()\n\t{\n\t\treturn $this->errors;\n\t}",
"function getError()\n\t{\n\t\treturn $this->errors;\n\t}",
"public function get_errors() {\n $res = array();\n foreach($this->errors as $error) {\n $res[] = $error->errormsg;\n }\n return $res;\n }",
"public function getError(): array\n {\n return $this->errorMessages;\n }",
"public function getErrors()\n {\n $sErrMsg = '';\n if (count($this->aErrors) > 1) {\n foreach ($this->aErrors as $sError) {\n $sErrMsg .= $sError . \"\\r\\n\";\n }\n }\n\n return $sErrMsg;\n }",
"function getErrors() {\n\t\treturn $this->_arc2_RemoteStore->getErrors();\n\t}",
"public function getErrors(){\r\n return $this->_errors['error'];\r\n }",
"public function get_error_objects() {\n return $this->errors;\n }",
"public function getError()\n {\n if (empty($this->error) != true){\n end($this->error); //Pointer to the end\n $key = key($this->error); //Get the key of last element\n $ret = array( \"code\" => $key, \"description\" => $this->error[$key] );\n reset($this->error);\n }else{\n $ret = array( \"code\" => \"get_error\", \"description\" => \"No are errors to show\" );\n }\n \n return $ret;\n }",
"static public function getErrors()\n\t{\n\t\treturn static::$aErrors;\n\t}",
"public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}",
"public function getErrors()\n\t{\n\t\treturn $this->_errors;\n\t}",
"public function getErrors()\r\n\t{\r\n\t\treturn $this->errors;\r\n\t}",
"public function getError() {\n\t\t$error = array();\n\t\t$error['message'] = $this->err_message;\n\t\t$error['code'] = $this->err_code;\n\t\treturn $error;\n\t}",
"public function errors() {\n\t\treturn $this->errs;\n\t}",
"public function getErrors()\n\t{\n\t\treturn $this->errors;\n\t}",
"public function getErrors()\n\t{\n\t\treturn $this->errors;\n\t}"
] |
[
"0.75538963",
"0.74165356",
"0.7312287",
"0.7195229",
"0.71227616",
"0.710407",
"0.7039848",
"0.7030033",
"0.7005177",
"0.69641995",
"0.69370794",
"0.6919939",
"0.69149196",
"0.69068193",
"0.69068193",
"0.6877642",
"0.68464303",
"0.6842871",
"0.6839705",
"0.68369246",
"0.6830862",
"0.6829438",
"0.6808728",
"0.68053",
"0.67941236",
"0.679085",
"0.6783279",
"0.67721415",
"0.67548156",
"0.67548156"
] |
0.76730686
|
0
|
Get product from requisition list item.
|
public function getRequisitionListProduct()
{
$item = $this->getItem();
if (!$this->requisitionListItemProduct->isProductAttached($item) && !$this->isOptionsUpdated()) {
return null;
}
try {
$product = $this->requisitionListItemProduct->getProduct($item);
return $product;
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
return null;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getProduct()\r\n {\r\n return $this->item->getParentObject()->getProduct();\r\n }",
"public function product()\n {\n return $this->m_product;\n }",
"public function getProduct() {\n return $this->_registry->registry ( 'current_product' );\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\r\n {\r\n return $this->product;\r\n }",
"public function get_product()\n {\n return $this->_product;\n }",
"public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }",
"protected function getProduct() {\n return $this->registry->registry('product');\n }",
"public function getProduct()\n {\n return Mage::registry('current_product');\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\n {\n return $this->product;\n }",
"public function getProduct()\n {\n return $this->getSubscription()->getProduct();\n }",
"public function getProduct() {\r\n return $this->_product;\r\n }",
"public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }",
"public function getProduct()\n {\n return isset($this->product) ? $this->product : null;\n }",
"public function getProduct() {\n\t\t// if this is just a model made on our end, we might not the serialized product yet\n\t\t// alternatively: newer BillForward may omit serialized product and necessitate a fetch\n\t\tif (!$this->product) {\n\t\t\tif (!$this->productID) {\n\t\t\t\tthrow new Bf_PreconditionFailedException(\"This Bf_ProductRatePlan has neither a 'product' specified, nor a 'productID' by which to obtain said product.\");\n\t\t\t}\n\t\t\t$this->product = Bf_Product::getByID($this->productID);\n\t\t}\n\t\treturn $this->product;\n\t}",
"public function getProduct(){\r\n return Mage::registry('current_product');\r\n }",
"public function getProduct() {\n\n if (!$this->product) {\n $this->product = $this->productPublicRepository->getById($this->getCartItem()->product_id);\n }\n return $this->product;\n }",
"public function getProduct()\n {\n return Mage::registry('product');\n }",
"public function getProduct()\n {\n return Mage::registry('product');\n }",
"public function getProduct()\n {\n return Mage::registry('product');\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getItem()\n {\n return $this->hasOne(CatalogProduct::className(), ['id' => 'item_id']);\n }",
"public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}",
"public function getProduct() {\n return Mage::registry('product');\n }"
] |
[
"0.6791526",
"0.6788082",
"0.67369854",
"0.67347574",
"0.67347574",
"0.67347574",
"0.67347574",
"0.67347574",
"0.67347574",
"0.6725329",
"0.6678978",
"0.66718805",
"0.6647321",
"0.66355956",
"0.6631595",
"0.6631595",
"0.66064274",
"0.6601603",
"0.6545155",
"0.6531527",
"0.6524043",
"0.6518634",
"0.649541",
"0.6491699",
"0.6491699",
"0.6491699",
"0.6442661",
"0.64272857",
"0.6413384",
"0.6379604"
] |
0.7660962
|
0
|
Format product price including tax.
|
public function getFormattedPrice()
{
return $this->formatProductPrice($this->getFinalPrice($this->displayPriceIncludingTax()));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFormattedPriceAttribute()\n {\n //attributes['price']\n return number_format(($this->attributes['price'] / 100), 2, '.', '');\n }",
"public function getFormattedPriceExcludingTax()\n {\n return $this->formatProductPrice($this->getFinalPrice(false));\n }",
"protected function priceFormat($price)\n {\n return number_format((float)$price, 2, '.', '') * 100;\n }",
"public function getFormattedPrice(): string\n {\n\n return number_format($this->price, 0, '', ' ');\n\n }",
"public function formatPrice($value)\n\t{\n\t\treturn Mage::getSingleton('adminhtml/session_quote')->getStore()->formatPrice($value);\n\t}",
"public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}",
"public function formatPrice($price)\n {\n // Suppress errors from formatting the price, as we may have EUR12,00 etc\n return @number_format($price, 2, '.', '');\n }",
"public function formatedPrice()\n {\n // if I format total amount of cart, use cart->total_price\n $amount = $this->price ? $this->price : $this->total_price;\n $fmt_price = new NumberFormatter('en', NumberFormatter::CURRENCY);\n \n return $fmt_price->formatCurrency($amount, \"EUR\");\n }",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }",
"protected function _formatPriceString($price, $product)\n {\n $priceTax = Mage::helper('tax')->getPrice($product, $price);\n $priceIncTax = Mage::helper('tax')->getPrice($product, $price, true);\n\n if (Mage::helper('tax')->displayBothPrices() && $priceTax != $priceIncTax) {\n $formatted = Mage::helper('core')->currency($priceTax, true, false) . ' (+'\n . Mage::helper('core')->currency($priceIncTax, true, false) . ' '\n . Mage::helper('tax')->__('Incl. Tax') . ')';\n } else {\n $formatted = $this->helper('core')->currency($priceTax, true, false);\n }\n\n return $formatted;\n }",
"public function getProductPrice()\n {\n return $this->getPrice(!sfConfig::get('app_tax_display_prices_with_tax', false));\n }",
"private static function moneyFormat($price)\r\n {\r\n return addCurrency(number_format($price, 2, ',', ' '));\r\n }",
"public function pricer($price)\n {\n $string_price = number_format($price,2,',','.');\n return $string_price;\n }",
"function couponxl_format_price_number( $price ){\n\n\tif( !is_numeric( $price ) ){\n\t\treturn $price;\n\t}\n\t$unit_position = couponxl_get_option( 'unit_position' );\n\t$unit = '₹';\n\n\tif( $unit_position == 'front' ){\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n\telse{\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n}",
"public function getTaxedPrice();",
"function tep_calculate_tax($price, $tax) {\n return $price * $tax / 100;\n }",
"function price () {\n global $value;\n $pricefloat = ceil($value['price']);\n\n if ($pricefloat <= 999) {\n echo $pricefloat;\n } elseif ($pricefloat >= 1000) {\n $num_format = number_format($pricefloat, 0, '.', ' ');\n echo $num_format . \" ₽\";\n }\n }",
"public function formattedTax(): string;",
"function formatPrice2($price)\n{\n\t$price = @number_format($price, 2, '.', ' '); // Igor\n\treturn $price;\n}",
"function tep_calculate_tax($price, $tax) {\n global $currencies;\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }",
"public function viewPrice()\n {\n return number_format($this->price/100, 2);\n }",
"function column_price($item){\n if ( $item['post_id'] && WPLA_ProductWrapper::hasVariations( $item['post_id'] ) ) {\n\n $variations = $this->getProductVariations( $item['post_id'] );\n if ( ! is_array($variations) || ! sizeof($variations) ) return '';\n\n $price_min = PHP_INT_MAX;\n $price_max = 0;\n foreach ($variations as $var) {\n $price = $var['price'];\n if ( $price > $price_max ) $price_max = $price;\n if ( $price < $price_min ) $price_min = $price;\n }\n\n if ( $price_min == $price_max ) {\n return $this->number_format( $price_min, 2 );\n } else {\n return $this->number_format( $price_min, 2 ) . ' - ' . $this->number_format( $price_max, 2 );\n }\n } // parent variation\n\n\n // get prices\n $regular_price = $this->getPriceForItem( $item );\n $sale_price = $this->getSalePriceForItem( $item );\n\n $profile = $this->getProfile( $item['profile_id'] );\n\n // check for profile prices (standard_price or price) and run the prices through WPLA_FeedDataBuilder::parseProfileShortcode()\n // to substitute shortcodes with actual values #20263\n if ( !empty( $profile->fields['standard_price'] ) ) {\n $price = WPLA_FeedDataBuilder::parseProfileShortcode( $profile->fields['standard_price'], $profile->fields['standard_price'], $item, wc_get_product( $item['post_id'] ), $item['post_id'], $profile );\n return $this->number_format( $price, 2 );\n } elseif ( !empty( $profile->fields['price'] ) ) {\n $price = WPLA_FeedDataBuilder::parseProfileShortcode( $profile->fields['price'], $profile->fields['price'], $item, wc_get_product( $item['post_id'] ), $item['post_id'], $profile );\n return $this->number_format( $price, 2 );\n }\n\n // no sale price\n if ( ! $sale_price )\n return $this->number_format( $regular_price, 2 );\n\n // show sale price\n return sprintf('<span style=\"%1$s\">%2$s</span> <br><span style=\"\">%3$s</span>',\n /*$1%s*/ 'text-decoration: line-through;color:silver',\n /*$2%s*/ $this->number_format( $regular_price, 2 ),\n /*$3%s*/ $this->number_format( $sale_price, 2 )\n ); \n\n }",
"function pms_format_price( $price = 0, $currency = '', $args = array() ) {\r\n\r\n $currency = pms_get_currency_symbol( $currency );\r\n\r\n //format number based on current locale with 2 decimals\r\n $price = number_format_i18n( $price, 2 );\r\n\r\n //remove any decimal 0s that are irrelevant; will match: x,00, x.00 and also x,10 or x.10\r\n $price = preg_replace('/(\\.|\\,)?0*$/', '', $price);\r\n\r\n $price = ( !empty( $args['before_price'] ) && !empty( $args['after_price'] ) ? $args['before_price'] . $price . $args['after_price'] : $price );\r\n $currency = ( !empty( $args['before_currency'] ) && !empty( $args['after_currency'] ) ? $args['before_currency'] . $currency . $args['after_currency'] : $currency );\r\n\r\n $settings = get_option( 'pms_payments_settings' );\r\n\r\n $output = ( !isset( $settings['currency_position'] ) || ( isset( $settings['currency_position'] ) && $settings['currency_position'] == 'after' ) ? $price . $currency : $currency . $price );\r\n\r\n return apply_filters( 'pms_format_price', $output, $price, $currency, $args );\r\n\r\n }",
"public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace(' ', ' ', $separator));\n }",
"function get_list_product_price() {\n\n global $product;\n\n if ( $price_html = $product->get_price_html() ) :\n \t\n \techo '<span class=\"price uk-margin-small-bottom\" style=\"float: right\">';\n \techo $price_html;\n \techo '</span>';\n \t\n endif; \n\n }",
"function tep_calculate_tax($price, $tax) {\n global $currencies;\n\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n}",
"function format_price($price)\n{\n $price = number_format(ceil($price), 0, \".\", \" \");\n return $price . \" \" . \"₽\";\n}",
"function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }",
"public function getPrice($format = true)\n {\n return $format == true ? number_format($this->price, 2, \",\", \" \") : $this->price;\n }"
] |
[
"0.71511424",
"0.71260303",
"0.70843065",
"0.7000295",
"0.6997287",
"0.6976209",
"0.6969622",
"0.6940779",
"0.6900554",
"0.6900554",
"0.6861496",
"0.6839989",
"0.6796638",
"0.67917275",
"0.6782341",
"0.67624235",
"0.67275745",
"0.6712114",
"0.6666443",
"0.662321",
"0.66119134",
"0.6610338",
"0.66045564",
"0.65942967",
"0.6592587",
"0.6547394",
"0.6529238",
"0.6517929",
"0.65023667",
"0.6496708"
] |
0.742112
|
0
|
Format product price excluding tax.
|
public function getFormattedPriceExcludingTax()
{
return $this->formatProductPrice($this->getFinalPrice(false));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFormattedPrice()\n {\n return $this->formatProductPrice($this->getFinalPrice($this->displayPriceIncludingTax()));\n }",
"public function formatPrice($price)\n {\n // Suppress errors from formatting the price, as we may have EUR12,00 etc\n return @number_format($price, 2, '.', '');\n }",
"public function getFormattedPrice(): string\n {\n\n return number_format($this->price, 0, '', ' ');\n\n }",
"protected function priceFormat($price)\n {\n return number_format((float)$price, 2, '.', '') * 100;\n }",
"public function getFormattedPriceAttribute()\n {\n //attributes['price']\n return number_format(($this->attributes['price'] / 100), 2, '.', '');\n }",
"protected function _formatPriceString($price, $product)\n {\n $priceTax = Mage::helper('tax')->getPrice($product, $price);\n $priceIncTax = Mage::helper('tax')->getPrice($product, $price, true);\n\n if (Mage::helper('tax')->displayBothPrices() && $priceTax != $priceIncTax) {\n $formatted = Mage::helper('core')->currency($priceTax, true, false) . ' (+'\n . Mage::helper('core')->currency($priceIncTax, true, false) . ' '\n . Mage::helper('tax')->__('Incl. Tax') . ')';\n } else {\n $formatted = $this->helper('core')->currency($priceTax, true, false);\n }\n\n return $formatted;\n }",
"public function formatPrice($value)\n\t{\n\t\treturn Mage::getSingleton('adminhtml/session_quote')->getStore()->formatPrice($value);\n\t}",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }",
"function ppom_price( $price ) {\n\t\n\t$price\t\t\t\t\t= floatval($price);\n\t\n\t$decimal_separator\t\t= wc_get_price_decimal_separator();\n\t$thousand_separator\t\t= wc_get_price_thousand_separator();\n\t$decimals\t\t\t\t= wc_get_price_decimals();\n\t$price_format\t\t\t= get_woocommerce_price_format();\n\t$negative \t\t= $price < 0;\n\t\n\t// $wc_price = number_format( $price,$decimals, $decimal_separator, $thousand_separator );\n\t$wc_price = number_format( abs($price), $decimals, $decimal_separator, $thousand_separator );\n\t$formatted_price = ( $negative ? '-' : '' ) . sprintf( $price_format, get_woocommerce_currency_symbol(), $wc_price );\n\treturn apply_filters('ppom_woocommerce_price', $formatted_price);\n}",
"public function getProductPrice()\n {\n return $this->getPrice(!sfConfig::get('app_tax_display_prices_with_tax', false));\n }",
"public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }",
"public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }",
"function removeFormatPrice($price='')\n {\n //Agregamos el punto decimal\n $price = str_replace(\"<sup>\", \"<sup>.\", $price);\n //removemos etiquetas html y espacios duplicados\n $price = preg_replace('/\\s+/', ' ',strip_tags($price));\n //\n //Extraemos el valor numerico de la divisa y signo de moneda\n $arrayNum = explode(\" \", $price);\n //Eliminamos las comas de las cifras de miles, millones, etc\n $arrayNum[1] = str_replace(\",\", \"\", $arrayNum[1]);\n\n return $arrayNum;\n }",
"public function getFormattedSubtotalExcludingTax()\n {\n return $this->formatProductPrice($this->getFinalPrice(false) * $this->getItem()->getQty());\n }",
"private static function moneyFormat($price)\r\n {\r\n return addCurrency(number_format($price, 2, ',', ' '));\r\n }",
"function paces_filter_price_text( $price ){\n $price = floatval( $price );\n $parts = explode( '.', (string)$price );\n\n if ( empty( $parts[1] ) ) {\n return $price;\n }\n if ( strlen( $parts[1] ) == 1 ) {\n $price = (string)$price . '0';\n }\n return $price;\n}",
"public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace(' ', ' ', $separator));\n }",
"function couponxl_format_price_number( $price ){\n\n\tif( !is_numeric( $price ) ){\n\t\treturn $price;\n\t}\n\t$unit_position = couponxl_get_option( 'unit_position' );\n\t$unit = '₹';\n\n\tif( $unit_position == 'front' ){\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n\telse{\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n}",
"public function price_to_s(){\n return number_format($this->price, 2, '€', '');\n }",
"public function pricer($price)\n {\n $string_price = number_format($price,2,',','.');\n return $string_price;\n }",
"public function get_price_html( $price = '' ) {\n\n\t\t$prices = $this->get_variation_prices( true );\n\n\t\tif ( empty( $prices['price'] ) ) {\n\t\t\treturn apply_filters( 'woocommerce_variable_empty_price_html', '', $this );\n\t\t}\n\n\t\t$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );\n\n\t\t$price = WC_Subscriptions_Product::get_price( $this->get_meta( '_min_price_variation_id' ) );\n\t\t$price = 'incl' == $tax_display_mode ? wcs_get_price_including_tax( $this, array( 'price' => $price ) ) : wcs_get_price_excluding_tax( $this, array( 'price' => $price ) );\n\t\t$price = $this->get_price_prefix( $prices ) . wc_price( $price ) . $this->get_price_suffix();\n\t\t$price = apply_filters( 'woocommerce_variable_price_html', $price, $this );\n\t\t$price = WC_Subscriptions_Product::get_price_string( $this, array( 'price' => $price ) );\n\n\t\treturn apply_filters( 'woocommerce_variable_subscription_price_html', apply_filters( 'woocommerce_get_price_html', $price, $this ), $this );\n\t}",
"function get_product_price_incl_or_excl_tax( $product, $price ) {\n\n\t\tif ( ! $this->is_wc_21() || $price == 0 )\n\t\t\treturn $price;\n\n\t\tif ( $this->wc_option_tax_display_shop == 'excl' )\n\t\t\t$product_price = $product->get_price_excluding_tax( 1, $price );\n\t\telse\n\t\t\t$product_price = $product->get_price_including_tax( 1, $price );\n\n\t\treturn $product_price;\n\t}",
"function get_price_excluding_tax() {\n\t\t\n\t\t$price = $this->price;\n\t\t\t\n\t\tif (get_option('woocommerce_prices_include_tax')=='yes') :\n\t\t\n\t\t\tif ( $rate = $this->get_tax_base_rate() ) :\n\t\t\t\t\n\t\t\t\tif ( $rate>0 ) :\n\t\t\t\t\t\n\t\t\t\t\t$_tax = &new woocommerce_tax();\n\n\t\t\t\t\t$tax_amount = $_tax->calc_tax( $price, $rate, true );\n\t\t\t\t\t\n\t\t\t\t\t$price = $price - $tax_amount;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\tendif;\n\t\t\n\t\tendif;\n\t\t\n\t\treturn $price;\n\t}",
"public function formatedPrice()\n {\n // if I format total amount of cart, use cart->total_price\n $amount = $this->price ? $this->price : $this->total_price;\n $fmt_price = new NumberFormatter('en', NumberFormatter::CURRENCY);\n \n return $fmt_price->formatCurrency($amount, \"EUR\");\n }",
"function price () {\n global $value;\n $pricefloat = ceil($value['price']);\n\n if ($pricefloat <= 999) {\n echo $pricefloat;\n } elseif ($pricefloat >= 1000) {\n $num_format = number_format($pricefloat, 0, '.', ' ');\n echo $num_format . \" ₽\";\n }\n }",
"public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}",
"function pms_format_price( $price = 0, $currency = '', $args = array() ) {\r\n\r\n $currency = pms_get_currency_symbol( $currency );\r\n\r\n //format number based on current locale with 2 decimals\r\n $price = number_format_i18n( $price, 2 );\r\n\r\n //remove any decimal 0s that are irrelevant; will match: x,00, x.00 and also x,10 or x.10\r\n $price = preg_replace('/(\\.|\\,)?0*$/', '', $price);\r\n\r\n $price = ( !empty( $args['before_price'] ) && !empty( $args['after_price'] ) ? $args['before_price'] . $price . $args['after_price'] : $price );\r\n $currency = ( !empty( $args['before_currency'] ) && !empty( $args['after_currency'] ) ? $args['before_currency'] . $currency . $args['after_currency'] : $currency );\r\n\r\n $settings = get_option( 'pms_payments_settings' );\r\n\r\n $output = ( !isset( $settings['currency_position'] ) || ( isset( $settings['currency_position'] ) && $settings['currency_position'] == 'after' ) ? $price . $currency : $currency . $price );\r\n\r\n return apply_filters( 'pms_format_price', $output, $price, $currency, $args );\r\n\r\n }",
"function formatPrice2($price)\n{\n\t$price = @number_format($price, 2, '.', ' '); // Igor\n\treturn $price;\n}",
"function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }"
] |
[
"0.7309592",
"0.72325444",
"0.7083832",
"0.70779127",
"0.6917579",
"0.68912685",
"0.68717945",
"0.6839803",
"0.6839803",
"0.68122655",
"0.67980945",
"0.67853737",
"0.67853737",
"0.67777896",
"0.6734576",
"0.67005026",
"0.6695806",
"0.6693228",
"0.6684368",
"0.66743463",
"0.66455877",
"0.6626988",
"0.66264087",
"0.6621605",
"0.66209054",
"0.66126275",
"0.65887976",
"0.6582376",
"0.6561465",
"0.64603376"
] |
0.80803496
|
0
|
Format subtotal price of item including tax.
|
public function getFormattedSubtotal()
{
return $this->formatProductPrice(
$this->getFinalPrice($this->displayPriceIncludingTax()) * $this->getItem()->getQty()
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFormattedSubtotalExcludingTax()\n {\n return $this->formatProductPrice($this->getFinalPrice(false) * $this->getItem()->getQty());\n }",
"public function subtotalWithTax()\n {\n return $this->subtotal() + $this->tax();\n }",
"function fix_order_amount_item_total( $price, $order, $item, $inc_tax = false, $round = true ) {\n $qty = ( ! empty( $item[ 'qty' ] ) && $item[ 'qty' ] != 0 ) ? $item[ 'qty'] : 1;\n if( $inc_tax ) {\n $price = ( $item[ 'line_total' ] + $item[ 'line_tax' ] ) / $qty;\n } else {\n $price = $item[ 'line_total' ] / $qty;\n }\n $price = $round ? round( $price, 2 ) : $price;\n return $price;\n}",
"public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }",
"protected function calculate_item_subtotals() {\n\t\tforeach ( $this->items as $item_key => $item ) {\n\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\tif ( $this->cart->get_customer()->get_is_vat_exempt() ) {\n\t\t\t\t\t$item = $this->remove_item_base_taxes( $item );\n\t\t\t\t} elseif ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {\n\t\t\t\t\t$item = $this->adjust_non_base_location_price( $item );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$item->subtotal = $item->price;\n\t\t\t$subtotal_taxes = array();\n\n\t\t\tif ( $this->calculate_tax && $item->product->is_taxable() ) {\n\t\t\t\t$subtotal_taxes = WC_Tax::calc_tax( $item->subtotal, $item->tax_rates, $item->price_includes_tax );\n\t\t\t\t$item->subtotal_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $subtotal_taxes ) );\n\n\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t// Use unrounded taxes so we can re-calculate from the orders screen accurately later.\n\t\t\t\t\t$item->subtotal = $item->subtotal - array_sum( $subtotal_taxes );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax_data'] = array( 'subtotal' => wc_remove_number_precision_deep( $subtotal_taxes ) );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal'] = wc_remove_number_precision( $item->subtotal );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal_tax'] = wc_remove_number_precision( $item->subtotal_tax );\n\t\t}\n\t\t$this->set_total( 'items_subtotal', array_sum( array_map( 'round', array_values( wp_list_pluck( $this->items, 'subtotal' ) ) ) ) );\n\t\t$this->set_total( 'items_subtotal_tax', array_sum( array_values( wp_list_pluck( $this->items, 'subtotal_tax' ) ) ) );\n\n\t\t$this->cart->set_subtotal( $this->get_total( 'items_subtotal' ) );\n\t\t$this->cart->set_subtotal_tax( $this->get_total( 'items_subtotal_tax' ) );\n\t}",
"public static function getItemSubtotal($item) {\n return $item['BNew'];\n }",
"public function getSubtotal()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->getDiscountedPrice($this->program->id) * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }",
"public function getBaseSubtotal();",
"public function getSubTotal()\n {\n if (($this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity() && $this->unit_price_overridden == 'false'\n ) {\n return $this->unit_price * $this->getMinimumQuantity();\n } else {\n return $this->unit_price * $this->quantity;\n }\n\n }",
"public function getFormattedPrice()\n {\n return $this->formatProductPrice($this->getFinalPrice($this->displayPriceIncludingTax()));\n }",
"public function getSubtotalAfterTax(){\n return $this->getParameter('sub_total_after_tax');\n }",
"public function subtotal();",
"public function getBaseSubtotalInclTax();",
"function es_set_cart_product_subtotal($sub_total , $cart_item, $cart_item_key) {\n\t\n\t$quantity = intval( $cart_item['quantity'] );\n\t$price = es_get_product_price($cart_item);\n\t$cart_item['data']->price = ( $price * $quantity );\t\n\t\n\treturn wc_price($cart_item['data']->price);\n}",
"public function subtotal()\n {\n $subTotal = 0;\n foreach($this->items as $item) {\n $subTotal += $item->get(Cart\\Item::KEY_AMOUNT);\n }\n return $subTotal;\n }",
"function get_cart_subtotal() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t// Display ex tax if the option is set, or prices exclude tax\n\t\t\tif ($this->display_totals_ex_tax || !$this->prices_include_tax) :\n\t\t\t\t\n\t\t\t\t$return = cmdeals_price( $this->subtotal_ex_tax );\n\t\t\t\t\n\t\t\t\tif ($this->tax_total>0 && $this->prices_include_tax) :\n\t\t\t\t\t$return .= ' <small>'.$cmdeals->countries->ex_tax_or_vat().'</small>';\n\t\t\t\tendif;\n\t\t\t\treturn $return;\n\t\t\t\t\n\t\t\telse :\n\t\t\t\t\n\t\t\t\t$return = cmdeals_price( $this->subtotal );\n\t\t\t\t\n\t\t\t\tif ($this->tax_total>0 && !$this->prices_include_tax) :\n\t\t\t\t\t$return .= ' <small>'.$cmdeals->countries->inc_tax_or_vat().'</small>';\n\t\t\t\tendif;\n\t\t\t\treturn $return;\n\t\t\t\n\t\t\tendif;\n\t\n\t\t}",
"public function subTotal($tax = false, $formatted = true)\n {\n $total = 0;\n if ($this->count() != 0) {\n foreach ($this->getItems() as $item) {\n $total += $item->subTotal($tax, false) + $item->subItemsTotal($tax, false);\n }\n }\n\n if ($formatted) {\n return \\LaraCart::formatMoney($total, $this->locale, $this->internationalFormat);\n } else {\n return $total;\n }\n\n }",
"function ywraq_formatted_line_total( $order, $item, $tax_display = '' ) {\n\n if ( ! $tax_display ) {\n $tax_display = yit_get_prop( $order, 'tax_display_cart', true );\n }\n\n if ( ! isset( $item['line_total'] ) || ! isset( $item['line_total'] ) || ! isset( $item['line_subtotal'] ) || ! isset( $item['line_subtotal'] ) ) {\n return '';\n }\n\n $show_old_price = get_option('ywraq_show_old_price', false);\n\n $show_discount = apply_filters('ywraq_show_discount_in_line_total', $show_old_price=='yes' && $item['line_subtotal'] > $item['line_total'], $item );\n\n\t\t$currency = method_exists( $order, 'get_currency') ? $order->get_currency() : $order->get_order_currency;\n\n if ( 'excl' == $tax_display ) {\n $ex_tax_label = yit_get_prop( $order, '_prices_include_tax', true ) ? 1 : 0;\n\n $line_total = wc_price( $order->get_line_total( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $currency ) );\n $line_subtotal = wc_price( $order->get_line_subtotal( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $currency ) );\n\n } else {\n $line_total = wc_price( $order->get_line_total( $item, true ), array('currency' => $currency ) );\n $line_subtotal = wc_price( $order->get_line_subtotal( $item, true ), array('currency' => $currency ) );\n }\n\n if( $show_discount ){\n $line_total = '<small><del>'.$line_subtotal.'</del></small> '.$line_total;\n }\n return apply_filters( 'ywraq_formatted_line_total', $line_total, $item, $order );\n }",
"function carton_format_total( $number ) {\n\treturn number_format( (float) $number, (int) get_option( 'carton_price_num_decimals' ), '.', '' );\n}",
"function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }",
"public function getFormattedPriceAttribute()\n {\n //attributes['price']\n return number_format(($this->attributes['price'] / 100), 2, '.', '');\n }",
"protected function priceFormat($price)\n {\n return number_format((float)$price, 2, '.', '') * 100;\n }",
"public function getFormattedPriceExcludingTax()\n {\n return $this->formatProductPrice($this->getFinalPrice(false));\n }",
"function column_price($item){\n if ( $item['post_id'] && WPLA_ProductWrapper::hasVariations( $item['post_id'] ) ) {\n\n $variations = $this->getProductVariations( $item['post_id'] );\n if ( ! is_array($variations) || ! sizeof($variations) ) return '';\n\n $price_min = PHP_INT_MAX;\n $price_max = 0;\n foreach ($variations as $var) {\n $price = $var['price'];\n if ( $price > $price_max ) $price_max = $price;\n if ( $price < $price_min ) $price_min = $price;\n }\n\n if ( $price_min == $price_max ) {\n return $this->number_format( $price_min, 2 );\n } else {\n return $this->number_format( $price_min, 2 ) . ' - ' . $this->number_format( $price_max, 2 );\n }\n } // parent variation\n\n\n // get prices\n $regular_price = $this->getPriceForItem( $item );\n $sale_price = $this->getSalePriceForItem( $item );\n\n $profile = $this->getProfile( $item['profile_id'] );\n\n // check for profile prices (standard_price or price) and run the prices through WPLA_FeedDataBuilder::parseProfileShortcode()\n // to substitute shortcodes with actual values #20263\n if ( !empty( $profile->fields['standard_price'] ) ) {\n $price = WPLA_FeedDataBuilder::parseProfileShortcode( $profile->fields['standard_price'], $profile->fields['standard_price'], $item, wc_get_product( $item['post_id'] ), $item['post_id'], $profile );\n return $this->number_format( $price, 2 );\n } elseif ( !empty( $profile->fields['price'] ) ) {\n $price = WPLA_FeedDataBuilder::parseProfileShortcode( $profile->fields['price'], $profile->fields['price'], $item, wc_get_product( $item['post_id'] ), $item['post_id'], $profile );\n return $this->number_format( $price, 2 );\n }\n\n // no sale price\n if ( ! $sale_price )\n return $this->number_format( $regular_price, 2 );\n\n // show sale price\n return sprintf('<span style=\"%1$s\">%2$s</span> <br><span style=\"\">%3$s</span>',\n /*$1%s*/ 'text-decoration: line-through;color:silver',\n /*$2%s*/ $this->number_format( $regular_price, 2 ),\n /*$3%s*/ $this->number_format( $sale_price, 2 )\n ); \n\n }",
"public function setSubtotalAfterTax($value){\n return $this->setParameter('sub_total_after_tax', $value);\n }",
"function getSalesTax($subTotal)\n\t\t{\n\t\t\t$subTotal = $subTotal * 0.07;\n\t\t\treturn $subTotal;\n\t\t}",
"public function getSubtotal(){\n return $this->_getData(self::SUBTOTAL);\n }",
"public function subtotal()\n {\n return $this->getCartItemCollection()->sum(function (CartItem $item) {\n return $item->subtotal();\n });\n }",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }"
] |
[
"0.7132601",
"0.7022787",
"0.67623556",
"0.6697892",
"0.6491012",
"0.64881945",
"0.64587355",
"0.6384926",
"0.63282895",
"0.63095725",
"0.6290376",
"0.62713253",
"0.62545353",
"0.6248586",
"0.6205481",
"0.61904955",
"0.61829925",
"0.61464375",
"0.6131873",
"0.6131698",
"0.61211747",
"0.6116639",
"0.60775083",
"0.6071188",
"0.6066878",
"0.6065838",
"0.60635203",
"0.6061108",
"0.6039647",
"0.6039647"
] |
0.767098
|
0
|
Format subtotal price of item excluding tax.
|
public function getFormattedSubtotalExcludingTax()
{
return $this->formatProductPrice($this->getFinalPrice(false) * $this->getItem()->getQty());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFormattedSubtotal()\n {\n return $this->formatProductPrice(\n $this->getFinalPrice($this->displayPriceIncludingTax()) * $this->getItem()->getQty()\n );\n }",
"public function getFormattedPriceExcludingTax()\n {\n return $this->formatProductPrice($this->getFinalPrice(false));\n }",
"function fix_order_amount_item_total( $price, $order, $item, $inc_tax = false, $round = true ) {\n $qty = ( ! empty( $item[ 'qty' ] ) && $item[ 'qty' ] != 0 ) ? $item[ 'qty'] : 1;\n if( $inc_tax ) {\n $price = ( $item[ 'line_total' ] + $item[ 'line_tax' ] ) / $qty;\n } else {\n $price = $item[ 'line_total' ] / $qty;\n }\n $price = $round ? round( $price, 2 ) : $price;\n return $price;\n}",
"public function subtotalWithTax()\n {\n return $this->subtotal() + $this->tax();\n }",
"public function getSubtotal()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->getDiscountedPrice($this->program->id) * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }",
"public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }",
"public function getSubTotal()\n {\n if (($this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity() && $this->unit_price_overridden == 'false'\n ) {\n return $this->unit_price * $this->getMinimumQuantity();\n } else {\n return $this->unit_price * $this->quantity;\n }\n\n }",
"public function getFormattedPrice()\n {\n return $this->formatProductPrice($this->getFinalPrice($this->displayPriceIncludingTax()));\n }",
"function ywraq_formatted_line_total( $order, $item, $tax_display = '' ) {\n\n if ( ! $tax_display ) {\n $tax_display = yit_get_prop( $order, 'tax_display_cart', true );\n }\n\n if ( ! isset( $item['line_total'] ) || ! isset( $item['line_total'] ) || ! isset( $item['line_subtotal'] ) || ! isset( $item['line_subtotal'] ) ) {\n return '';\n }\n\n $show_old_price = get_option('ywraq_show_old_price', false);\n\n $show_discount = apply_filters('ywraq_show_discount_in_line_total', $show_old_price=='yes' && $item['line_subtotal'] > $item['line_total'], $item );\n\n\t\t$currency = method_exists( $order, 'get_currency') ? $order->get_currency() : $order->get_order_currency;\n\n if ( 'excl' == $tax_display ) {\n $ex_tax_label = yit_get_prop( $order, '_prices_include_tax', true ) ? 1 : 0;\n\n $line_total = wc_price( $order->get_line_total( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $currency ) );\n $line_subtotal = wc_price( $order->get_line_subtotal( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $currency ) );\n\n } else {\n $line_total = wc_price( $order->get_line_total( $item, true ), array('currency' => $currency ) );\n $line_subtotal = wc_price( $order->get_line_subtotal( $item, true ), array('currency' => $currency ) );\n }\n\n if( $show_discount ){\n $line_total = '<small><del>'.$line_subtotal.'</del></small> '.$line_total;\n }\n return apply_filters( 'ywraq_formatted_line_total', $line_total, $item, $order );\n }",
"public function getBaseSubtotal();",
"public function formatPrice($price)\n {\n // Suppress errors from formatting the price, as we may have EUR12,00 etc\n return @number_format($price, 2, '.', '');\n }",
"public static function getItemSubtotal($item) {\n return $item['BNew'];\n }",
"function carton_format_total( $number ) {\n\treturn number_format( (float) $number, (int) get_option( 'carton_price_num_decimals' ), '.', '' );\n}",
"protected function calculate_item_subtotals() {\n\t\tforeach ( $this->items as $item_key => $item ) {\n\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\tif ( $this->cart->get_customer()->get_is_vat_exempt() ) {\n\t\t\t\t\t$item = $this->remove_item_base_taxes( $item );\n\t\t\t\t} elseif ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {\n\t\t\t\t\t$item = $this->adjust_non_base_location_price( $item );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$item->subtotal = $item->price;\n\t\t\t$subtotal_taxes = array();\n\n\t\t\tif ( $this->calculate_tax && $item->product->is_taxable() ) {\n\t\t\t\t$subtotal_taxes = WC_Tax::calc_tax( $item->subtotal, $item->tax_rates, $item->price_includes_tax );\n\t\t\t\t$item->subtotal_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $subtotal_taxes ) );\n\n\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t// Use unrounded taxes so we can re-calculate from the orders screen accurately later.\n\t\t\t\t\t$item->subtotal = $item->subtotal - array_sum( $subtotal_taxes );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax_data'] = array( 'subtotal' => wc_remove_number_precision_deep( $subtotal_taxes ) );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal'] = wc_remove_number_precision( $item->subtotal );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal_tax'] = wc_remove_number_precision( $item->subtotal_tax );\n\t\t}\n\t\t$this->set_total( 'items_subtotal', array_sum( array_map( 'round', array_values( wp_list_pluck( $this->items, 'subtotal' ) ) ) ) );\n\t\t$this->set_total( 'items_subtotal_tax', array_sum( array_values( wp_list_pluck( $this->items, 'subtotal_tax' ) ) ) );\n\n\t\t$this->cart->set_subtotal( $this->get_total( 'items_subtotal' ) );\n\t\t$this->cart->set_subtotal_tax( $this->get_total( 'items_subtotal_tax' ) );\n\t}",
"protected function priceFormat($price)\n {\n return number_format((float)$price, 2, '.', '') * 100;\n }",
"public function formatValue($total)\n {\n if (!$total->getIsFormated()) {\n return $this->helper('adminhtml/sales')->displayPrices(\n $this->getOrder(),\n $total->getBaseValue(),\n $total->getValue()\n );\n }\n return $total->getValue();\n }",
"function get_cart_subtotal() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t// Display ex tax if the option is set, or prices exclude tax\n\t\t\tif ($this->display_totals_ex_tax || !$this->prices_include_tax) :\n\t\t\t\t\n\t\t\t\t$return = cmdeals_price( $this->subtotal_ex_tax );\n\t\t\t\t\n\t\t\t\tif ($this->tax_total>0 && $this->prices_include_tax) :\n\t\t\t\t\t$return .= ' <small>'.$cmdeals->countries->ex_tax_or_vat().'</small>';\n\t\t\t\tendif;\n\t\t\t\treturn $return;\n\t\t\t\t\n\t\t\telse :\n\t\t\t\t\n\t\t\t\t$return = cmdeals_price( $this->subtotal );\n\t\t\t\t\n\t\t\t\tif ($this->tax_total>0 && !$this->prices_include_tax) :\n\t\t\t\t\t$return .= ' <small>'.$cmdeals->countries->inc_tax_or_vat().'</small>';\n\t\t\t\tendif;\n\t\t\t\treturn $return;\n\t\t\t\n\t\t\tendif;\n\t\n\t\t}",
"public function formatValue($total)\r\n {\r\n if (!$total->getIsFormated()) {\r\n if($total->getCode()=='aw_storecredit'){\r\n return $this->helper('adminhtml/sales')->displayPrices(\r\n $this->getOrder(),\r\n $total->getBasestorecredit(),\r\n $total->getStorecreditindollers()\r\n );\r\n }\r\n else{\r\n return $this->helper('adminhtml/sales')->displayPrices(\r\n $this->getOrder(),\r\n $total->getBaseValue(),\r\n $total->getValue()\r\n );\r\n }\r\n }\r\n return $total->getValue();\r\n }",
"public function getBaseSubtotalInclTax();",
"public function getFormattedPrice(): string\n {\n\n return number_format($this->price, 0, '', ' ');\n\n }",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }",
"public function getFormattedPrice()\n {\n return $this->formatted_price;\n }",
"public function subtotal()\n {\n $subTotal = 0;\n foreach($this->items as $item) {\n $subTotal += $item->get(Cart\\Item::KEY_AMOUNT);\n }\n return $subTotal;\n }",
"private static function moneyFormat($price)\r\n {\r\n return addCurrency(number_format($price, 2, ',', ' '));\r\n }",
"public function getFormattedPriceAttribute()\n {\n //attributes['price']\n return number_format(($this->attributes['price'] / 100), 2, '.', '');\n }",
"public function subtotal();",
"public function getSubTotalWithoutConditions($formatted = true)\n {\n $cart = $this->getContent();\n\n $sum = $cart->sum(function ($item) {\n return $item->getPriceSum();\n });\n\n return Helpers::formatValue(floatval($sum), $formatted, $this->config);\n }",
"function column_price($item){\n if ( $item['post_id'] && WPLA_ProductWrapper::hasVariations( $item['post_id'] ) ) {\n\n $variations = $this->getProductVariations( $item['post_id'] );\n if ( ! is_array($variations) || ! sizeof($variations) ) return '';\n\n $price_min = PHP_INT_MAX;\n $price_max = 0;\n foreach ($variations as $var) {\n $price = $var['price'];\n if ( $price > $price_max ) $price_max = $price;\n if ( $price < $price_min ) $price_min = $price;\n }\n\n if ( $price_min == $price_max ) {\n return $this->number_format( $price_min, 2 );\n } else {\n return $this->number_format( $price_min, 2 ) . ' - ' . $this->number_format( $price_max, 2 );\n }\n } // parent variation\n\n\n // get prices\n $regular_price = $this->getPriceForItem( $item );\n $sale_price = $this->getSalePriceForItem( $item );\n\n $profile = $this->getProfile( $item['profile_id'] );\n\n // check for profile prices (standard_price or price) and run the prices through WPLA_FeedDataBuilder::parseProfileShortcode()\n // to substitute shortcodes with actual values #20263\n if ( !empty( $profile->fields['standard_price'] ) ) {\n $price = WPLA_FeedDataBuilder::parseProfileShortcode( $profile->fields['standard_price'], $profile->fields['standard_price'], $item, wc_get_product( $item['post_id'] ), $item['post_id'], $profile );\n return $this->number_format( $price, 2 );\n } elseif ( !empty( $profile->fields['price'] ) ) {\n $price = WPLA_FeedDataBuilder::parseProfileShortcode( $profile->fields['price'], $profile->fields['price'], $item, wc_get_product( $item['post_id'] ), $item['post_id'], $profile );\n return $this->number_format( $price, 2 );\n }\n\n // no sale price\n if ( ! $sale_price )\n return $this->number_format( $regular_price, 2 );\n\n // show sale price\n return sprintf('<span style=\"%1$s\">%2$s</span> <br><span style=\"\">%3$s</span>',\n /*$1%s*/ 'text-decoration: line-through;color:silver',\n /*$2%s*/ $this->number_format( $regular_price, 2 ),\n /*$3%s*/ $this->number_format( $sale_price, 2 )\n ); \n\n }",
"public function getDisplayTotalPriceAttribute()\n {\n return Shop::format($this->totalPrice);\n }",
"public function formatValue($total)\n {\n if (!$total->getIsFormated()) {\n return $this->getOrder()->formatPrice($total->getValue());\n }\n return $total->getValue();\n }"
] |
[
"0.77388304",
"0.6884088",
"0.67974937",
"0.66275257",
"0.6585497",
"0.65740603",
"0.6480198",
"0.6386918",
"0.6378102",
"0.6363359",
"0.63575125",
"0.63134605",
"0.62874967",
"0.62829155",
"0.6262879",
"0.6231299",
"0.62300885",
"0.6192556",
"0.61884063",
"0.61761487",
"0.61718976",
"0.61718976",
"0.6138266",
"0.6133735",
"0.61254376",
"0.6119735",
"0.6108193",
"0.60843384",
"0.60684854",
"0.60678154"
] |
0.7824128
|
0
|
Get url of product image from requisition list item.
|
public function getImageUrl()
{
try {
$product = $this->itemResolver->getFinalProduct($this->itemOptionsLocator->getOptions($this->getItem()));
$imageUrl = $this->imageHelper->getDefaultPlaceholderUrl('thumbnail');
if ($product !== null) {
$imageUrl = $this->imageHelper->init($product, 'product_thumbnail_image')->getUrl();
}
return $imageUrl;
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
return null;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getProductUrlByItem()\n {\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $product->getProductUrl();\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }",
"public function getMediaImageUrl() {\n return $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ()->getBaseUrl ( \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA ) . 'catalog/product';\n }",
"public function getImage() {\n if ($this->item_image == null) {\n return Yii::app()->request->baseUrl . \"/images/box/default.jpg\";\n } else {\n return Yii::app()->request->baseUrl . \"/images/box/\" . $this->item_image;\n }\n }",
"public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }",
"public function getThumbnail() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('thumbnail'));\n }",
"public function imageUrl()\n\t{\n\t\treturn \"/storage/$this->image\";\n\t}",
"public function getImage() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('image'));\n }",
"protected function getImageUrl($item) {\n\n $imageUrl = [];\n if (isset($item->snippet->thumbnails->high)) {\n $imageUrl['high'] = $item->snippet->thumbnails->high->url;\n } else {\n $imageUrl['high'] = '';\n }\n if (isset($item->snippet->thumbnails->medium)) {\n $imageUrl['medium'] = $item->snippet->thumbnails->medium->url;\n } else {\n $imageUrl['medium'] = '';\n }\n if (isset($item->snippet->thumbnails->default)) {\n $imageUrl['default'] = $item->snippet->thumbnails->default->url;\n } else {\n $imageUrl['default'] = '';\n }\n return $imageUrl;\n }",
"public function getThumbnailUrl();",
"public function getImageUrl() \n {\n // return a default image placeholder if your source avatar is not found\n $imagen = isset($this->imagen) ? $this->imagen : 'default_product.jpg';\n return Url::to('@web/img/producto/'). $imagen;\n }",
"public function getProductUrl()\n {\n return $this->product_url;\n }",
"public function getPreviewUrlProduct()\n {\n return $this->previewUrlProduct;\n }",
"public function getImageUrl()\n {\n return $this->info->thumbnail_url ? $this->info->thumbnail_url : null;\n }",
"public function get_image_url()\n {\n }",
"public function getImageURL() {\n\n return $this->image_url;\n }",
"protected function getImageUrl() {\r\n\t\treturn $this->imageUrl;\r\n\t}",
"public function getItemUrl($item)\r\n {\r\n if ($this->isSelected($item)) {\r\n return $item->getRemoveUrl();\r\n }\r\n\r\n return $item->getUrl();\r\n }",
"public function getImageUrl()\n {\n return $this->image_url;\n }",
"public function getImageUrl()\n {\n return $this->image_url;\n }",
"public function getImageUrl()\n\t{\n\t\treturn $this->image_url;\n\t}",
"public function getImageUrl($product)\n {\n $viewImageConfig = $this->viewConfig->getViewConfig()->getMediaAttributes(\n 'Magento_Catalog',\n Image::MEDIA_TYPE_CONFIG_NODE,\n 'wishlist_small_image'\n );\n return $this->imageUrlBuilder->getUrl(\n $product->getData($viewImageConfig['type']),\n 'wishlist_small_image'\n );\n }",
"public function getImageUrl()\n {\n return $this->imageUrl;\n }",
"public function getImageUrl(): string\n {\n return $this->imageUrl;\n }",
"public function getImageUrl()\n {\n return isset($this->image_url) ? $this->image_url : null;\n }",
"public function getImageUrl() {\n return $this->image_url;\n\n }",
"public function getItemLinkUrl()\n {\n return $this->escapeXssInUrl($this->getEntity()->getData('list_item_url'));\n }",
"public function getProduct_img () {\n\t$preValue = $this->preGetValue(\"product_img\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_img;\n\treturn $data;\n}",
"public function getImageUrl() {\n if ($this->_getData('image_url')) {\n if (strpos($this->_getData('image_url'), 'http://') === false) {\n $this->setImageUrl(Mage::getBaseUrl() . ltrim($this->_getData('image_url'), '/ '));\n }\n }\n\n return $this->_getData('image_url');\n }",
"public function getPlaceholderImage(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n $storeManager = $objectManager->get(\"\\Magento\\Store\\Model\\StoreManagerInterface\");\n $mediaUrl = $storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA );\n return $mediaUrl.'catalog/product/placeholder/'.\\Magento\\Framework\\App\\ObjectManager::getInstance()\n ->get('Magento\\Framework\\App\\Config\\ScopeConfigInterface')\n ->getValue('catalog/placeholder/thumbnail_placeholder');\n }",
"public function getImageUrl()\n {\n $baseUrl = $this->getBaseImageUrl();\n if ($baseUrl) {\n $dimensions = $this->getImageDimensions();\n $imageData = $this->getImageData();\n $width = Kwf_Media_Image::getResponsiveWidthStep($dimensions['width'],\n Kwf_Media_Image::getResponsiveWidthSteps($dimensions, $imageData['file']));\n $ret = str_replace('{width}', $width, $baseUrl);\n $ev = new Kwf_Component_Event_CreateMediaUrl($this->getData()->componentClass, $this->getData(), $ret);\n Kwf_Events_Dispatcher::fireEvent($ev);\n return $ev->url;\n }\n return null;\n }"
] |
[
"0.7587097",
"0.675509",
"0.6678582",
"0.6638463",
"0.66321266",
"0.65973496",
"0.6595451",
"0.65802884",
"0.6563858",
"0.65471095",
"0.65297276",
"0.6495536",
"0.64868647",
"0.6436366",
"0.6429904",
"0.6426684",
"0.6424846",
"0.64186007",
"0.64186007",
"0.6404198",
"0.6378501",
"0.6368695",
"0.6360995",
"0.63484406",
"0.63423586",
"0.6339169",
"0.63311994",
"0.63216233",
"0.6310658",
"0.6301839"
] |
0.74328226
|
1
|
Get url of product from requisition list item.
|
public function getProductUrlByItem()
{
try {
$product = $this->requisitionListItemProduct->getProduct($this->getItem());
return $product->getProductUrl();
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
return null;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getProductUrl()\n {\n return $this->product_url;\n }",
"public function getItemLinkUrl()\n {\n return $this->escapeXssInUrl($this->getEntity()->getData('list_item_url'));\n }",
"public function getPreviewUrlProduct()\n {\n return $this->previewUrlProduct;\n }",
"protected function getUrl($product)\n {\n $url = trim(Settings::get('octoshop_products_itemurl', '/product'), '/');\n\n return implode('/', [$url, $product->slug]);\n }",
"public function getItemUrl($item)\r\n {\r\n if ($this->isSelected($item)) {\r\n return $item->getRemoveUrl();\r\n }\r\n\r\n return $item->getUrl();\r\n }",
"public function getItemConfigureUrl()\n {\n return $this->getUrl(\n 'requisition_list/item/configure',\n [\n 'item_id' => $this->getItem()->getItemId(),\n 'id' => $this->requisitionListItemProduct->getProduct($this->getItem())->getId(),\n 'requisition_id' => $this->getItem()->getRequisitionListId()\n ]\n );\n }",
"public function uri()\n {\n return sprintf('products/%s', $this->id);\n }",
"public function getItemConfigureUrl($product)\n {\n return $this->_getHelper()->getConfigureUrl($product);\n }",
"public function getProductUrl($item, $additional = [])\n {\n return $this->_getHelper()->getProductUrl($item, $additional);\n }",
"public function getCatalogItemUri($params=[]) {\n\t\t$uri = '/'.$params['item']['url'];\n\t\treturn $uri;\n\t}",
"public function getItemAddToCartUrl($item)\n {\n return Mage::helper('cminds_multiwishlist')->getAddToCartUrl($item);\n }",
"public function getItemConfigureUrl($product)\n {\n if ($product instanceof Mage_Catalog_Model_Product) {\n $id = $product->getWishlistItemId();\n } else {\n $id = $product->getId();\n }\n $params = array('id' => $id);\n\n return $this->getUrl('multiwishlist/index/configure/', $params);\n }",
"public function getCartUrl($product) {\n return $this->objectManager->get ( 'Magento\\Checkout\\Helper\\Cart' )->getAddUrl ( $product );\n }",
"public function getProductosUrl(){\n return $this->vectorUrlsProductos;\n }",
"public function getImageUrl()\n {\n try {\n $product = $this->itemResolver->getFinalProduct($this->itemOptionsLocator->getOptions($this->getItem()));\n $imageUrl = $this->imageHelper->getDefaultPlaceholderUrl('thumbnail');\n if ($product !== null) {\n $imageUrl = $this->imageHelper->init($product, 'product_thumbnail_image')->getUrl();\n }\n return $imageUrl;\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }",
"public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}",
"public function productByUrlAction()\n {\n $search = \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $words = explode('/', $search);\n $lastWord = array_pop($words);\n $vars['products'] = $this->model->getProductsBySearch($lastWord);\n $this->view->render('Riding Gear', $vars);\n }",
"public function getCatalogItemUrl($params=[]) {\n\t\t$textpageUrl = $this->textPagesUrlProvider->getTextpageUrl();\n\t\t$catalogItemUri = $this->getCatalogItemUri($params);\n\t\t$url = $textpageUrl.$catalogItemUri;\n\t\t\n\t\treturn $url;\n\t}",
"public function getRowUrl($item)\n {\n return $this->getUrl('*/*/edit', ['todo_id' => $item->getId()]);\n }",
"public function getURL()\n {\n return $this->uRL;\n }",
"public function getUrlModel()\n {\n if ($this->_urlModel === null) {\n $this->_urlModel = Mage::getSingleton('catalog/factory')->getProductUrlInstance();\n }\n return $this->_urlModel;\n }",
"public static function url($itemID = '') {\n\t\t$url = new Purl(self::pw('pages')->get('pw_template=whse-bin-inquiry')->url);\n\t\tif (empty($itemID)) {\n\t\t\treturn $url->getUrl();\n\t\t}\n\t\t$url->query->set('itemID', $itemID);\n\t\treturn $url->getUrl();\n\t}",
"private function getProductsSubLink() : string\n {\n return \"/models/\" . $this->getId() . \"/products\";\n }",
"protected function getRel( $item ){\n\t\t$rel = \"\";\n\t\tif(!empty($this->itemAttributesCallback)){\n\n\t\t\t$attributes = explode(\",\" , $this->itemAttributesCallback );\n\n\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\t$value = $this->getValue( $item, $attribute, $this->itemClass ) ;\n\t\t\t\t$rel .= \"_*_$value\" ;\n\t\t\t}\n\t\t\t$rel = substr( $rel, 3, strlen($rel)-3); //quitamos el primer \"_*_\"\n\n\t\t}\n\t\treturn $rel;\n\t}",
"public function getUrl()\n {\n if (array_key_exists('link', $this->data)) {\n return $this->data['link'];\n }\n\n if ($this->getType() == Reader\\Reader::TYPE_YML) {\n $link = $this->xpath->evaluate('string(/yml_catalog/shop/url)');\n }\n\n if (! $link) {\n $link = null;\n }\n\n $this->data['link'] = $link;\n\n return $this->data['link'];\n }",
"public function Link()\n {\n if ($product = $this->Product()) {\n return $product->Link;\n }\n return '';\n }",
"public function uri()\n {\n return route('product.show', [\n 'product' => $this->id,\n 'alias' => $this->alias,\n ]);\n }",
"public function url()\n {\n return '/recipe/' . $this->recipe->getKey();\n }",
"public function getAddToCartUrl($productId)\n {\n // Just a dummy link, to be implemented later\n return '/cart/add/' . $productId;\n }",
"protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}"
] |
[
"0.7300924",
"0.7049564",
"0.6983294",
"0.69303465",
"0.69221705",
"0.6816373",
"0.6531234",
"0.64716697",
"0.64118266",
"0.63201624",
"0.6317475",
"0.63108444",
"0.6169243",
"0.6126387",
"0.6057942",
"0.59772193",
"0.59584177",
"0.595419",
"0.5931885",
"0.59088624",
"0.59067285",
"0.588583",
"0.5885818",
"0.58784586",
"0.58625793",
"0.58369905",
"0.5834712",
"0.583064",
"0.58302647",
"0.58252597"
] |
0.8234946
|
0
|
Get url to configure product from requisition list item.
|
public function getItemConfigureUrl()
{
return $this->getUrl(
'requisition_list/item/configure',
[
'item_id' => $this->getItem()->getItemId(),
'id' => $this->requisitionListItemProduct->getProduct($this->getItem())->getId(),
'requisition_id' => $this->getItem()->getRequisitionListId()
]
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getItemConfigureUrl($product)\n {\n return $this->_getHelper()->getConfigureUrl($product);\n }",
"public function getItemConfigureUrl($product)\n {\n if ($product instanceof Mage_Catalog_Model_Product) {\n $id = $product->getWishlistItemId();\n } else {\n $id = $product->getId();\n }\n $params = array('id' => $id);\n\n return $this->getUrl('multiwishlist/index/configure/', $params);\n }",
"public function getProductUrlByItem()\n {\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $product->getProductUrl();\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }",
"public function getProductUrl()\n {\n return $this->product_url;\n }",
"public function getPreviewUrlProduct()\n {\n return $this->previewUrlProduct;\n }",
"public function getConfigurationUrl() {\n return Mage::helper(\"adminhtml\")->getUrl('adminhtml/system_config/edit', array('section' => 'admin'));\n }",
"protected function _getConfigUrl()\r\n\t{\r\n return $this->getUrl(\r\n 'adminhtml/system_config/edit',\r\n array(\r\n 'section' => 'manager'\r\n )\r\n );\r\n\t}",
"public function getURL() {\n $defaultPorts= array(\n 'http' => 80,\n 'https' => 443\n );\n \n // Determine which settings we need to pass\n $xsr= array();\n if (\n ($this->getProduct() != $this->getDefaultProduct()) ||\n ($this->getLanguage() != $this->getDefaultLanguage())\n ) {\n $xsr[]= $this->getProduct();\n $xsr[]= $this->getLanguage();\n }\n if ($this->getSessionId()) $xsr[]= 'psessionid='.$this->getSessionId();\n\n $port= '';\n if (\n $this->getPort() &&\n (!isset($defaultPorts[$this->getScheme()]) ||\n $this->getPort() != $defaultPorts[$this->getScheme()])\n ) {\n $port= ':'.$this->getPort();\n }\n\n\n return sprintf(\n '%s://%s%s/xml/%s%s%s%s',\n $this->getScheme(),\n $this->getHost(),\n $port,\n (sizeof($xsr) ? implode('.', $xsr).'/' : ''),\n $this->getStateName(), \n $this->getQuery() ? '?'.$this->getQuery() : '',\n $this->getFragment() ? '#'.$this->getFragment() : ''\n );\n }",
"function get_config_url() {\n global $CFG;\n return $CFG->wwwroot . '/blocks/php_report/config_params.php?id=' . $this->id . '&showcancel=1';\n }",
"public function uri()\n {\n return sprintf('products/%s', $this->id);\n }",
"public function getItemLinkUrl()\n {\n return $this->escapeXssInUrl($this->getEntity()->getData('list_item_url'));\n }",
"public function get_settings_url( $_ = null ) {\n\t\treturn admin_url( 'admin.php?page=wc-settings&tab=products§ion=inventory' );\n\t}",
"protected function getUrl($product)\n {\n $url = trim(Settings::get('octoshop_products_itemurl', '/product'), '/');\n\n return implode('/', [$url, $product->slug]);\n }",
"protected function getOpenIdConfigUrl()\n {\n return $this->getAdfsServer().$this->config_endpoint;\n }",
"public function getGridUrl() {\n $params = array(\n 'product_id' => $this->getProduct()->getId(),\n 'store' => $this->getRequest()->getParam('store', 0),\n );\n return $this->getUrl('vidtest_admin/admin_product/grid', $params);\n }",
"public function url()\n {\n return '/recipe/' . $this->recipe->getKey();\n }",
"public function getLuUrl()\n {\n return Mage::getStoreConfig(self::GENERAL_SETTINGS_PATH . 'lu_url', $this->getStoreId());\n }",
"public function getUrlModel()\n {\n if ($this->_urlModel === null) {\n $this->_urlModel = Mage::getSingleton('catalog/factory')->getProductUrlInstance();\n }\n return $this->_urlModel;\n }",
"public function getItemUrl($item)\r\n {\r\n if ($this->isSelected($item)) {\r\n return $item->getRemoveUrl();\r\n }\r\n\r\n return $item->getUrl();\r\n }",
"public function getCartUrl($product) {\n return $this->objectManager->get ( 'Magento\\Checkout\\Helper\\Cart' )->getAddUrl ( $product );\n }",
"public function getActionUrl()\n {\n return Mage::getUrl('supplier/plan/buy');\n }",
"public function getUrl()\n {\n return rtrim(empty($this->_config['url']) ? self::URL : $this->_config['url'], '/') . '/';\n }",
"public function getProductosUrl(){\n return $this->vectorUrlsProductos;\n }",
"public function getmultiselectUrl()\r\n {\r\n return Mage::getUrl('marketplace/product/manage');\r\n }",
"public function getURL() {\n\t\treturn $this->selectedEndpoint['url'];\t\n\t}",
"public function getCatalogItemUri($params=[]) {\n\t\t$uri = '/'.$params['item']['url'];\n\t\treturn $uri;\n\t}",
"public function getEditUrl()\n {\n return $this->_urlBuilder->getUrl('*/*/edit', ['id' => $this->getSubscription()->getId()]);\n }",
"public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}",
"public function getRedirectUrl()\n {\n return $this->getUrl(self::ION_CONFIG_URL);\n }",
"private function getProductsSubLink() : string\n {\n return \"/models/\" . $this->getId() . \"/products\";\n }"
] |
[
"0.7723346",
"0.7564959",
"0.6841327",
"0.68005544",
"0.65632576",
"0.6536653",
"0.6358535",
"0.62868065",
"0.62833065",
"0.6245681",
"0.612436",
"0.6101099",
"0.609221",
"0.6083258",
"0.60686195",
"0.6068067",
"0.6031743",
"0.60050434",
"0.59548825",
"0.5950263",
"0.5944878",
"0.5907161",
"0.58870095",
"0.58761257",
"0.5858392",
"0.58554125",
"0.58364296",
"0.5779226",
"0.5752391",
"0.5743108"
] |
0.84013385
|
0
|
Check if we should display in catalog prices including tax.
|
private function displayPriceIncludingTax()
{
try {
$product = $this->requisitionListItemProduct->getProduct($this->getItem());
$adjustment = $product->getPriceInfo()->getAdjustment(\Magento\Tax\Pricing\Adjustment::ADJUSTMENT_CODE);
return $adjustment->isIncludedInDisplayPrice();
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
return false;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function display_prices_including_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, 'incl' === $this->tax_display_cart );\n\t}",
"public static function IncludesTax()\n {\n if (class_exists('Catalogue')) {\n return Catalogue::config()->price_includes_tax;\n }\n\n return true;\n }",
"public function isCatalogTaxVisible()\n {\n return (\n $this->isCatalogInformationVisible() && Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_TAX)\n ) ? true : false;\n }",
"public function isIncludedInDisplayPrice();",
"public function displayPriceInclTax()\n {\n return $this->itemPriceRenderer->displayPriceInclTax();\n }",
"public function displayPriceExclTax()\n {\n return $this->itemPriceRenderer->displayPriceExclTax();\n }",
"function get_discounts_before_tax() {\n\t\t\tif ($this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}",
"public function displayCartCardIncludeTaxPrice($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_CART_PRINTED_CARD, $store);\n return ($configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH\n || $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_INCLUDING_TAX);\n }",
"public function displayPriceInclTax()\n {\n switch ($this->zone) {\n case PricingRender::ZONE_CART:\n return $this->taxHelper->displayCartPriceInclTax($this->storeId);\n case PricingRender::ZONE_EMAIL:\n case PricingRender::ZONE_SALES:\n return $this->taxHelper->displaySalesPriceInclTax($this->storeId);\n default:\n return $this->taxHelper->displayCartPriceInclTax($this->storeId);\n }\n }",
"public function canApplyTax(){\n\t\tif(Mage::getStoreConfig(self::XML_LOGICBORKER_EDI_APPLY_TAX)==0){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function priceIncludesTax()\n {\n return $this->quotationTaxHelper->priceIncludesTax($this->getItem()->getStoreId());\n }",
"public function displayPriceExclTax()\n {\n switch ($this->zone) {\n case PricingRender::ZONE_CART:\n return $this->taxHelper->displayCartPriceExclTax($this->storeId);\n case PricingRender::ZONE_EMAIL:\n case PricingRender::ZONE_SALES:\n return $this->taxHelper->displaySalesPriceExclTax($this->storeId);\n default:\n return $this->taxHelper->displayCartPriceExclTax($this->storeId);\n }\n }",
"public function isIncludingTax()\n {\n $session = Mage::getSingleton(\"core/session\", array(\"name\"=>\"frontend\"));\n $showincl = $session->getData(\"inclexcltaxswitch_showincl\");\n $val = 1;\n \n if ( $showincl===true ) {\n $val = 2;\n }elseif ( $showincl===false ) {\n $val = 1;\n }else{\n $val = Mage::getStoreConfig('tax/display/type');\n }\n \n if (!$this->getData('is_including_tax')) {\n $this->setData('is_including_tax', $val);\n }\n\n return $this->getData('is_including_tax');\n }",
"public function displaySalesCardIncludeTaxPrice($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_SALES_PRINTED_CARD, $store);\n return ($configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH\n || $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_INCLUDING_TAX);\n }",
"public function hasRealPrice(){\n return $this->_has(21);\n }",
"function hasVAT( )\n {\n if ( $this->HasTax == 1 )\n return true;\n else\n return false;\n }",
"public function isIncludedInPrice();",
"public function getDisplayTaxAndDutySeparately()\n {\n return Mage::getStoreConfig('iparcel/tax/mode') == Iparcel_All_Model_System_Config_Source_Tax_Mode::SEPARATELY;\n }",
"public function isCatalogBackendIsQtyDecimalVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_IS_QTY_DECIMAL);\n }",
"public function displayCartWrappingIncludeTaxPrice($store = null)\n {\n $configValue = Mage::getStoreConfig(self::XML_PATH_PRICE_DISPLAY_CART_WRAPPING, $store);\n return ($configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_BOTH\n || $configValue == Mage_Tax_Model_Config::DISPLAY_TYPE_INCLUDING_TAX);\n }",
"function get_discounts_after_tax() {\n\t\t\tif ($this->discount_total) :\n\t\t\t\treturn cmdeals_price($this->discount_total); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}",
"public function isIncludedInBasePrice();",
"public function hasTax()\r\n {\r\n return $this->item->getParentObject()->getOrder()->getProxy()->hasTax();\r\n }",
"public function apply_before_tax() {\n\t\treturn true;\n\t}",
"public function hasPrice()\n {\n return $this->amount_month || $this->amount_year;\n }",
"public function hasPrice(){\n return $this->_has(12);\n }",
"public function hasTaxes()\n {\n return !empty($this->taxes);\n }",
"public function displayBothPrices()\n {\n return $this->taxHelper->displayBothPrices($this->_storeManager->getStore());\n }",
"public function getCatalogTaxFlag()\n {\n // Are catalog product prices with tax included or excluded?\n if ($this->taxCatalogFlag === null) {\n $this->taxCatalogFlag = (int) Mage::getStoreConfig(\n 'tax/calculation/price_includes_tax',\n $this->getStoreId()\n );\n }\n\n // 0 means excluded, 1 means included\n return $this->taxCatalogFlag;\n }",
"public function getTaxedPrice();"
] |
[
"0.8262366",
"0.74416184",
"0.7408404",
"0.7166296",
"0.6952421",
"0.68623674",
"0.6811821",
"0.6735747",
"0.66961867",
"0.66566974",
"0.6611707",
"0.6577467",
"0.65625834",
"0.65200484",
"0.6487844",
"0.6478302",
"0.6474772",
"0.64644957",
"0.63921696",
"0.63702923",
"0.6351821",
"0.63235956",
"0.6295121",
"0.6268793",
"0.62578404",
"0.6199025",
"0.6198105",
"0.6124622",
"0.611924",
"0.61156327"
] |
0.7505082
|
1
|
Check if edit action is available for requisition list item.
|
public function canEdit()
{
if ($this->isOptionsUpdated()) {
return true;
}
if (!$this->getRequisitionListProduct()) {
return false;
}
try {
$product = $this->requisitionListItemProduct->getProduct($this->getItem());
return $this->productChangesAvailabilityChecker->isProductEditable($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
return false;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function isEditAction() {}",
"public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}",
"public function is_editing() {\n\n\t\tif ( 'edit' !== Param::get( 'action' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Param::get( 'redirection', false, FILTER_VALIDATE_INT );\n\t}",
"function CheckEditListAccess($item=array())\n {\n return $this->CheckShowListAccess();\n }",
"function CheckEditAccess($item=array())\n {\n return $this->CheckShowAccess($item);\n }",
"protected function canEdit() {}",
"static function has_edit_screen(): bool { return true; }",
"public function can_edit() {\n return true;\n }",
"public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }",
"public function canEdit()\n {\n return $this->is_locked == 0;\n }",
"public function canEditQty()\n {\n $item = $this->getItem();\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($item);\n return $this->requisitionListItemProduct->isProductAttached($item)\n || $this->productChangesAvailabilityChecker->isQtyChangeAvailable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }",
"abstract function allowEditAction();",
"public function edititemAction()\n {\n $this->defaultNoItemRoute = $this->toolboxRoute;\n\n //Run the editItem action method\n $viewList = parent::edititemAction();\n\n //Return the result\n return $viewList;\n }",
"public function canEdit()\n {\n return true;\n }",
"function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function canEdit() {\n\t\t\treturn true;\n\t\t}",
"public function isEditOnlyMode();",
"public function isEditFormShown() {}",
"public function isFrontendEditingActive() {}",
"public function isSwitchToEditEnabled();",
"protected function isFrontendEditActive() {}",
"protected function isFrontendEditActive() {}",
"function rich_edit_exists()\n {\n }",
"public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}",
"function can_do_bulkedit() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }",
"public function canEditCaption()\n {\n return in_array('edit_caption', $this->actions);\n }",
"protected function is_edit_page() {\n\t\treturn false;\n\t}",
"private function isEditMode(){\n\t\tif(isset($this->AddRecordInsertData) and count($this->AddRecordInsertData) > 0 )\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function is_edit_page() {\n\t\t\tglobal $current_screen;\n\n\t\t\treturn in_array( $current_screen->id, (array) $this->_meta_box['pages'] );\n\t\t}"
] |
[
"0.79520655",
"0.71333873",
"0.71045935",
"0.7041456",
"0.7024523",
"0.69859695",
"0.6926228",
"0.6911825",
"0.6830541",
"0.6802585",
"0.67959243",
"0.67450035",
"0.67311007",
"0.6724287",
"0.6688579",
"0.6687988",
"0.6664347",
"0.66216284",
"0.6613428",
"0.64559114",
"0.6450389",
"0.6450389",
"0.63943017",
"0.6346394",
"0.6295672",
"0.62579834",
"0.6245197",
"0.6219038",
"0.6214971",
"0.62114847"
] |
0.7536797
|
1
|
Check if product quantity can be changed for requisition list item.
|
public function canEditQty()
{
$item = $this->getItem();
try {
$product = $this->requisitionListItemProduct->getProduct($item);
return $this->requisitionListItemProduct->isProductAttached($item)
|| $this->productChangesAvailabilityChecker->isQtyChangeAvailable($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
return false;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function hasQuantity(): bool;",
"function _isEligibleQuantity()\r\n {\r\n $item = $this->find('first', array(\r\n 'conditions' => array(\r\n 'Item.id' => (!empty($this->data[$this->name]['sub_item_id']) ? $this->data[$this->name]['sub_item_id'] : $this->data[$this->name]['item_id']) ,\r\n ) ,\r\n 'fields' => array(\r\n 'Item.item_user_count',\r\n 'Item.max_limit'\r\n ) ,\r\n 'recursive' => -1\r\n ));\r\n $newTotal = $item['Item']['item_user_count']+$this->data[$this->name]['quantity'];\r\n if ($item['Item']['max_limit'] <= 0 || $newTotal <= $item['Item']['max_limit']) {\r\n return true;\r\n }\r\n if (preg_match(\"/./\", $item['Item']['max_limit'])) {\r\n return false;\r\n }\r\n return false;\r\n }",
"function ju_assert_qty_supported(P $p):void {ju_assert(\n\tju_pt_has_qty($t = $p->getTypeId()), \"Products of type `$t` do not have a quantity.\"\n);}",
"private function validateInventoryChange($item_id, $qty, $onHand) {\n //setup success variable\n $success = true;\n \n //fetch the item record\n $this->itemRecord = $this->Item->find('first', array(\n 'conditions' => array(\n 'Item.id' => $item_id\n ),\n 'contain' => false\n ));\n \n //check for onHand change\n if($onHand != $this->itemRecord['Item']['quantity']){\n $success = $this->updateOnHandInventory($onHand);\n }\n \n //check for available inventory to pull\n if($success){\n if($this->itemRecord['Item']['quantity'] + $qty >= 0 && $success){\n $success = true;\n } else {\n $this->error = 'There is not enough inventory to pull this item';\n $success = false;\n }\n }\n return $success;\n }",
"private function _checkAvailableStock($productUid = \"\", $qty = 0, $oldQty = 0) {\n $product = Product::where('uid', $productUid)->first();\n if($product) {\n $availableStock = Product::getAvailableStock($product) + $oldQty;\n if(($availableStock - $qty) < 0) return false; \n }\n return true;\n }",
"public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }",
"function twentynineteen_child_wc_qty_update_cart_validation( $passed, $cart_item_key, $values, $quantity ) {\n $product_min = twentynineteen_child_wc_min_limit( $values['product_id'] );\n\n if ( ! empty( $product_min ) ) {\n // min is empty\n if ( false !== $product_min ) {\n $new_min = $product_min;\n } \n }\n $product = wc_get_product( $values['product_id'] );\n $already_in_cart = twentynineteen_child_wc_cart_qty( $values['product_id'], $cart_item_key );\n if ( ( $already_in_cart + $quantity ) < $new_min ) {\n wc_add_notice( apply_filters( 'wc_qty_error_message', sprintf( esc_html__( 'You should have minimum of %1$s %2$s\\'s to %3$s.', 'twentynineteen-child-min-quantity' ),\n $new_min,\n $product->get_name(),\n '<a href=\"' . esc_url( wc_get_cart_url() ) . '\">' . esc_html__( 'your cart', 'twentynineteen-child-min-quantity' ) . '</a>'),\n $new_min ),\n 'error' );\n $passed = false;\n }\n return $passed;\n }",
"public function isSetQuantity()\n {\n return !is_null($this->_fields['Quantity']['FieldValue']);\n }",
"function check_quantity($product_id,$quantity){\r\n\t\tglobal $db;\r\n\t\t\r\n\t\t$q = \"SELECT price_min_qty, price_max_qty\r\n\t\t\tFROM product_price where product_id=$product_id\";\r\n\t\t$db->query($q);\r\n\t\t$db->next_record();\r\n\t\t$price_max_qty = $db->f(\"price_max_qty\");\r\n\t\t$price_min_qty = $db->f(\"price_min_qty\");\r\n\t\tif ($price_max_qty>0 && $quantity > $price_max_qty) {\r\n\t\t\t$d[\"error\"] = \"Vous ne pouvez pas commander plus de $price_max_qty bouteilles de cet article.\";\r\n\t\t\t$quantity = $price_max_qty;\r\n\t\t}\r\n\t\t\r\n\t\tif (CHECK_STOCK) {\r\n\t\t\t$q = \"SELECT product_stock \";\r\n\t\t\t$q .= \"FROM product where product_id=\";\r\n\t\t\t$q .= $product_id;\r\n\t\t\t$db->query($q);\r\n\t\t\t$db->next_record();\r\n\t\t\t$product_in_stock = $db->f(\"product_stock\");\r\n\t\t\tif ($quantity > $product_in_stock) {\r\n\t\t\t\t$d[\"error\"] = \"Quantity selected exceeds available stock.<BR>\";\r\n\t\t\t\t$d[\"error\"] .= \"Currently have $product_in_stock items available.\";\r\n\t\t\t\t$quantity = $product_in_stock;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// If no quantity sent them assume $price_min_qty\r\n\t\tif ($quantity == \"\" || !ereg(\"^[0-9]*$\", $quantity) || $quantity < 0 || $quantity<$price_min_qty){\r\n\t\t\t$quantity = $price_min_qty;\r\n\t\t}\r\n\r\n\t\treturn $quantity;\r\n\t}",
"public function issetQuantity(): bool\n {\n return isset($this->quantity);\n }",
"public function has_qty() {\n\t\treturn $this->get_qty() !== '';\n\t}",
"public function testUpdateQuantity()\n {\n $cart = new Cart(['foo']);\n $this->assertEquals(['foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 6);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'foobar']);\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['bar', 'foo', 'foo', 'foo', 'foo', 'foobar'], $cart->getItems());\n }",
"public function isQtyUsesDecimals($productId) {\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n if ($manageStock) {\n $isQtyDecimal = $stockItem->getIsQtyDecimal();\n if ($isQtyDecimal == 1) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n }",
"public function isProductTypeWithQty(): ?bool;",
"public function changeQtyAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isChangeItemQtyAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n $quoteItem->setQty(\n $this->getRequest()->getPost('qty')\n );\n\n try {\n if ($quoteItem->getHasError() === true) {\n $result['error'] = $quoteItem->getMessage(true);\n } else {\n $this->_recalculateTotals();\n $result['success'] = true;\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during changing product qty');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }",
"public function productquantity() {\n\n $this->checkPlugin();\n\n if ($_SERVER['REQUEST_METHOD'] === 'PUT') {\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProductsQuantity($requestjson);\n } else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n } else {\n $json['success'] = false;\n $json['error'] = \"Invalid request method, use PUT method.\";\n $this->sendResponse($json);\n }\n }",
"function change_quantity($pid,$q){\n\t// scart-products_addorder.php?action=checkout -- id=\"submit_editqty\" \n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\t$pid=intval($pid);\n\t$max=count($_SESSION[$cart]);\n\tif(product_exists($pid)) {\n\t for($i=0;$i<$max;$i++){\n\t\tif($pid==$_SESSION[$cart][$i]['bookid']){\n\t\t $_SESSION[$cart][$i]['qty']=$q;\n\t\t // break;\n\t\t}\n\t }\n\t print '<script type=\"text/javascript\">';\n\t print 'alert(\"Quantity Updated!\\n--- New Quantity = '.$q.'!\\n\\n\")';\n\t print '</script>';\n return $pid; // pid existing return empty array no message\n\t}\n\n}",
"function jm_sub_fix_action( $valid, $product_id, $quantity )\n{\n\tglobal $woocommerce;\n\n\tif ( !WC_Subscriptions_Product::is_subscription( $product_id ) && WC_Subscriptions_Cart::cart_contains_subscription() ) \n\t\tadd_filter( 'add_to_cart_redirect', 'jm_sub_fix_filter', 10, 1 );\n\n\n\treturn $valid;\n}",
"public function getQuantityAvailable(): int;",
"public function isModifyingEscrowFacilityAtSubscriptionASuccess($product_id,$member_id,$quantity){\n $model = new MemberSubscribedToProducts;\n return $model->isModifyingEscrowFacilityAtSubscriptionASuccess($product_id,$member_id,$quantity);\n }",
"public function cart_stock($product_id, $options, $quantity) {\n\t\t\n\t\t$ro_settings = $this->config->get('related_options');\n\t\t$ro_combs = $this->get_related_options_sets_by_poids($product_id, $options, true, true);\n\t\t//$ro_combs = $this->get_related_options_sets_by_poids($product_id, $options);\n\t\t$stock_ok = true;\n\t\tif ($ro_combs) {\n\t\t\tforeach ($ro_combs as $ro_comb) {\n\t\t\t\t$stock_ok = $stock_ok && ($quantity <= $ro_comb['quantity'] || !empty($ro_settings['allow_zero_select']));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $stock_ok;\n\t\t\n\t}",
"public function testItemQtyUpdate()\n {\n $item = $this->addItem();\n $itemHash = $item->getHash();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n\n $this->assertEquals(7, $item->qty);\n $this->assertEquals($itemHash, $item->getHash());\n\n $options = [\n 'a' => 2,\n 'b' => 1\n ];\n\n $item = $this->addItem(1, 1, false, $options);\n $this->addItem(1, 1, false, array_reverse($options));\n\n $this->assertEquals(2, $item->qty);\n }",
"function _isEligibleMinimumQuantity()\r\n {\r\n $item = $this->find('first', array(\r\n 'conditions' => array(\r\n 'Item.id' => $this->data[$this->name]['item_id'],\r\n ) ,\r\n 'fields' => array(\r\n 'Item.buy_min_quantity_per_user',\r\n 'Item.item_user_count',\r\n 'Item.max_limit'\r\n ) ,\r\n 'recursive' => -1\r\n ));\r\n if ($item['Item']['buy_min_quantity_per_user'] > 1) {\r\n $items_count = $this->_countUserBoughtItems();\r\n $boughtTotal = (!empty($items_count[0]['total_count']) ? $items_count[0]['total_count'] : 0) +$this->data[$this->name]['quantity'];\r\n $min = $item['Item']['buy_min_quantity_per_user'];\r\n if (!empty($item['Item']['max_limit']) && $min >= $item['Item']['max_limit']-$item['Item']['item_user_count']) {\r\n $min = $item['Item']['max_limit']-$item['Item']['item_user_count'];\r\n }\r\n if ($boughtTotal >= $min) {\r\n return true;\r\n }\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }",
"function validate_update_cart_item(){\n\t\t$total = count($this->cart->contents());\n\t\t \n\t\t// Retrieve the posted information\n\t\t$item = $this->input->post('rowid');\n\t\t$qty = $this->input->post('qty');\n\t \n\t\t// Cycle true all items and update them\n\t\tfor($i=0;$i < $total;$i++)\n\t\t{\n\t\t\t// Create an array with the products rowid's and quantities. \n\t\t\t$data = array(\n\t\t\t 'rowid' => $item[$i],\n\t\t\t 'qty' => $qty[$i]\n\t\t\t);\n\t\t\t \n\t\t\t// Update the cart with the new information\n\t\t\t$this->cart->update($data);\n\t\t}\n\t \n\t}",
"public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }",
"public function cart_stock($product_id, $options, $quantity) {\n\t\t\n\t\t$ro_settings = $this->config->get('related_options');\n\t\t$ro_combs = $this->getROCombsByPOIds($product_id, $options, true);\n\t\t//$ro_combs = $this->getROCombsByPOIds($product_id, $options);\n\t\t$stock_ok = true;\n\t\tif ($ro_combs) {\n\t\t\tforeach ($ro_combs as $ro_comb) {\n\t\t\t\t$stock_ok = $stock_ok && ($quantity <= $ro_comb['quantity'] || !empty($ro_settings['allow_zero_select']));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $stock_ok;\n\t\t\n\t}",
"public function check_product_items(){\n\t\t$arr = $this->arr_product_items;\n\t\t//taxper\n\t\tif(isset($arr['taxper']))\n\t\t\t$this->arr_product_items['taxper'] = (float)$arr['taxper'];\n\t\telse\n\t\t\t$this->arr_product_items['taxper'] = 0;\n\t\t//sizew_unit\n\t\tif(!isset($arr['sizew_unit']) || $arr['sizew_unit']=='')\n\t\t\t$this->arr_product_items['sizew_unit'] = 'in';\n\t\t//sizeh_unit\n\t\tif(!isset($arr['sizeh_unit']) || $arr['sizeh_unit']=='')\n\t\t\t$this->arr_product_items['sizeh_unit'] = 'in';\n\t\t//sizew\n\t\tif(isset($arr['sizew']))\n\t\t\t$this->arr_product_items['sizew'] = (float)$arr['sizew'];\n\t\telse\n\t\t\t$this->arr_product_items['sizew'] = 0;\n\t\t//sizeh\n\t\tif(isset($arr['sizeh']))\n\t\t\t$this->arr_product_items['sizeh'] = (float)$arr['sizeh'];\n\t\telse\n\t\t\t$this->arr_product_items['sizeh'] = 0;\n\t\t//quantity\n\t\tif(isset($arr['quantity']))\n\t\t\t$this->arr_product_items['quantity'] = (float)$arr['quantity'];\n\t\telse\n\t\t\t$this->arr_product_items['quantity'] = 0;\n\n\t\t//adj_qty\n\t\t$this->arr_product_items['adj_qty'] = 0;\n\n\t\t//oum\n\t\tif(!isset($arr['oum']))\n\t\t\t$this->arr_product_items['oum'] = 'unit';\n\n\t\t//oum_depend\n\t\tif(!isset($arr['oum_depend']))\n\t\t\t$this->arr_product_items['oum_depend'] = 'unit';\n\t\tif(isset($arr['oum_depend']) && $arr['oum_depend']=='Sq. ft.')\n\t\t\t$this->arr_product_items['oum_depend'] = 'Sq.ft.';\n\n\t\t//sell_price\n\t\tif(isset($arr['sell_price']))\n\t\t\t$this->arr_product_items['sell_price'] = (float)$arr['sell_price'];\n\t\telse\n\t\t\t$this->arr_product_items['sell_price'] = 0;\n\n\t\t//plus_sell_price\n\t\tif(isset($arr['plus_sell_price']))\n\t\t\t$this->arr_product_items['plus_sell_price'] = (float)$arr['plus_sell_price'];\n\t\telse\n\t\t\t$this->arr_product_items['plus_sell_price'] = 0;\n\n\t\t//plus_price\n\t\tif(isset($arr['plus_unit_price']))\n\t\t\t$this->arr_product_items['plus_unit_price'] = (float)$arr['plus_unit_price'];\n\t\telse\n\t\t\t$this->arr_product_items['plus_unit_price'] = 0;\n\n\t\t//reset unit_price\n\t\t\t$this->arr_product_items['unit_price'] = 0;\n\t\t//reset sub_total\n\t\t\t$this->arr_product_items['sub_total'] = 0;\n\t\t//reset tax\n\t\t\t$this->arr_product_items['tax'] = 0;\n\t\t//reset amount\n\t\t\t$this->arr_product_items['amount'] = 0;\n\n\t}",
"public function hookactionUpdateQuantity($params)\n {\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n \n $context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n $product = new Product($id_product, false, $id_lang, $id_shop, $context);\n \n if (empty($product)) {\n return;\n }\n \n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $product_has_attributes = $product->hasAttributes();\n $productInfo = array(\n 'product_name' => $product_name,\n 'product_id' => $id_product\n );\n $check_oos = ($product_has_attributes && $id_product_attribute)\n || (!$product_has_attributes && !$id_product_attribute);\n $product_quantity = (int)$params['quantity'];\n if (Module::isInstalled('mailalerts')) {\n // For out of stock notification to admin\n $isActivate = $this->isRulesetActive('out_of_stock_alerts');\n if ($check_oos\n && $product->active == 1\n && $isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity <= $this->outStock) {\n $legendstemp = $this->replaceProductLegends(\n $isActivate[0]['template'],\n $productInfo\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $this->adminMobile\n );\n \n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('OutStock', $legendstemp, $this->adminMobile);\n }\n \n // For back in stock\n $isActivate = $this->isRulesetActive('back_of_stock_alerts');\n if ($isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity > 0) {\n $bosSql = 'SELECT DISTINCT adr.phone_mobile, oos.id_customer';\n $bosSql .= ' FROM '._DB_PREFIX_. 'mailalert_customer_oos as oos';\n $bosSql .= ' INNER JOIN '._DB_PREFIX_. 'address as adr ON oos.id_customer = adr.id_customer';\n $bosSql .= ' WHERE oos.id_product = \"' . (int)$id_product . '\" AND deleted = 0';\n $bosResults = Db::getInstance()->ExecuteS($bosSql);\n \n if ($bosResults) {\n foreach ($bosResults as $customerVal) {\n $customerInfo = array(\n 'id_customer' => $customerVal['id_customer'],\n 'phone_mobile' => $customerVal['phone_mobile']\n );\n $legendstemp = $this->replaceProductCustomerLegends(\n $isActivate[0]['template'],\n $customerInfo,\n $productInfo\n );\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n // Use send SMS API here\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $customerVal['phone_mobile']\n );\n $this->sendSMSByAPI($postAPIdata);\n $delQuery = 'DELETE FROM ' . _DB_PREFIX_ . 'mailalert_customer_oos';\n $delQuery .= ' WHERE id_customer = \"' . (int)$customerVal['id_customer'] . '\"';\n Db::getInstance()->execute($delQuery);\n Onehopsmsservice::onehopSaveLog('BackStock', $legendstemp, $customerVal['phone_mobile']);\n }\n }\n }\n }\n }",
"function cf_order_valid_qty($params)\n\t{\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\tif (! isset($params->requisition_line_id) && !$params->requisition_line_id)\n\t\t\treturn false;\n\t\t\n\t\t$id = $params->requisition_line_id;\n\t\t$str = \"select (t1.qty - (select coalesce(sum(qty),0) from cf_order_line where is_active = '1' and is_deleted = '0' and requisition_line_id = t1.id)) as qty \n\t\t\tfrom cf_requisition_line as t1 where t1.is_deleted = '0' and t1.id = $id\";\n\t\t$row = $this->db->query($str)->row();\n\t\tif ($row->qty - $params->qty < 0) {\n\t\t\t$this->session->set_flashdata('message', $row->qty);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"public function update_quantity()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$quantity = $this->input->post('quantity');\n\t\t$this->cart->update_quantity($item->product, $item->variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}"
] |
[
"0.6764691",
"0.673956",
"0.66375494",
"0.65451854",
"0.6446102",
"0.63228095",
"0.6305335",
"0.63023",
"0.6268382",
"0.62070704",
"0.61835706",
"0.6155921",
"0.6138934",
"0.6136667",
"0.61262864",
"0.61260843",
"0.6124021",
"0.6091039",
"0.6064079",
"0.6063692",
"0.6062066",
"0.6032574",
"0.6023387",
"0.6022041",
"0.5993411",
"0.5979759",
"0.59725374",
"0.5971264",
"0.5970715",
"0.5961929"
] |
0.8113494
|
0
|
Check if product options were updated and product should be reconfigured.
|
public function isOptionsUpdated()
{
return !empty($this->itemErrors[SkuValidator::ERROR_OPTIONS_UPDATED]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function maybe_update_options() {\n $current_version = get_option( 'laterpay_version' );\n\n if ( version_compare( $current_version, '0.9.8.1', '>=' ) ) {\n delete_option( 'laterpay_plugin_is_activated' );\n }\n }",
"public function checkProductsList() {\n if (!is_array($this->products) || !count($this->products)) {\n $this->logger->info(\"No \".$this->type.\" found in DST.\");\n }\n $this->logger->info(\"Checking products List\");\n foreach ($this->products as $sku => $product) {\n $errors = $this->pimhelper->check_one_reference($this->type, $product->getData());\n if ($errors > 0) {\n $this->logger->info($errors.\" Fields are missing in product : \".$sku);\n die;\n }\n }\n $this->logger->info(\"Fields were created in every products\");\n return true;\n }",
"public static function maybe_update_credentials_error_flag() {\n\n\t\t// Check if the API credentials are being saved - we can't do this on the 'woocommerce_update_options_payment_gateways_paypal' hook because it is triggered after 'admin_notices'\n\t\tif ( ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) && isset( $_POST['woocommerce_paypal_api_username'] ) || isset( $_POST['woocommerce_paypal_api_password'] ) || isset( $_POST['woocommerce_paypal_api_signature'] ) ) {\n\n\t\t\t$credentials_updated = false;\n\n\t\t\tif ( isset( $_POST['woocommerce_paypal_api_username'] ) && WCS_PayPal::get_option( 'api_username' ) != $_POST['woocommerce_paypal_api_username'] ) {\n\t\t\t\t$credentials_updated = true;\n\t\t\t} elseif ( isset( $_POST['woocommerce_paypal_api_password'] ) && WCS_PayPal::get_option( 'api_password' ) != $_POST['woocommerce_paypal_api_password'] ) {\n\t\t\t\t$credentials_updated = true;\n\t\t\t} elseif ( isset( $_POST['woocommerce_paypal_api_signature'] ) && WCS_PayPal::get_option( 'api_signature' ) != $_POST['woocommerce_paypal_api_signature'] ) {\n\t\t\t\t$credentials_updated = true;\n\t\t\t}\n\n\t\t\tif ( $credentials_updated ) {\n\t\t\t\tdelete_option( 'wcs_paypal_credentials_error' );\n\t\t\t}\n\t\t}\n\n\t\tdo_action( 'wcs_paypal_admin_update_credentials' );\n\t}",
"private function checkUpdate() {\n\n $doupdate = false;\n\n foreach(array_values($this->checkUpdateVersion) AS $package) {\n $match = explode(':', $package);\n // always set and extract if not match\n if ($this->get_config('last_'.$match[0].'_version') == $match[1]) {\n $doupdate = false;\n } else {\n $this->set_config('last_'.$match[0].'_version', $match[1]);\n $doupdate = true;\n break; // this is possibly needed to force install upgrade routines\n }\n }\n\n return $doupdate ? true : false;\n }",
"public function check_for_updates() {\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, $this->config->version, '!=' ) ) {\n $this->install();\n }\n }",
"public function canUpdateKount()\n {\n return !Mage::registry('kount_ens_update')\n && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_merchant_id')\n && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_api_key');\n }",
"public function updateIsAvailable()\n {\n return self::INSTALLED_VERSION != $this->version;\n }",
"public static function tc_needs_wc_db_update() {\n\t\t$_tm_current_woo_version = get_option( 'woocommerce_db_version' );\n\t\t$_tc_needs_wc_db_update = FALSE;\n\t\tif ( get_option( 'woocommerce_db_version' ) !== FALSE ) {\n\t\t\tif ( version_compare( get_option( 'woocommerce_db_version' ), '2.3', '<' ) && version_compare( get_option( 'woocommerce_version' ), '2.4', '<' ) ) {\n\t\t\t\t$_tm_notice_check = '_wc_needs_update';\n\t\t\t\t$_tc_needs_wc_db_update = get_option( $_tm_notice_check );\n\t\t\t\t// no check after 2.6 update\n\t\t\t} elseif ( version_compare( get_option( 'woocommerce_db_version' ), '2.5', '>=' ) ) {\n\t\t\t\t$_tc_needs_wc_db_update = FALSE;\n\t\t\t} else {\n\t\t\t\t$_tm_notice_check = 'woocommerce_admin_notices';\n\t\t\t\t$_tc_needs_wc_db_update = in_array( 'update', get_option( $_tm_notice_check, array() ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $_tc_needs_wc_db_update;\n\t}",
"public function isUpdateSecurityRelevant() {}",
"function fn_update_exceptions($product_id)\n{\n\t$result = false;\n\n\tif ($product_id) {\n\n\t\t$exceptions = fn_get_product_exceptions($product_id);\n\n\t\tif (!empty($exceptions)) {\n\t\t\tdb_query(\"DELETE FROM ?:product_options_exceptions WHERE product_id = ?i\", $product_id);\n\t\t\tforeach ($exceptions as $k => $v) {\n\t\t\t\t$_options_order = db_get_fields(\"SELECT a.option_id FROM ?:product_options as a LEFT JOIN ?:product_global_option_links as b ON a.option_id = b.option_id WHERE a.product_id = ?i OR b.product_id = ?i ORDER BY position\", $product_id, $product_id);\n\n\t\t\t\tif (empty($_options_order)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$combination = array();\n\n\t\t\t\tforeach ($_options_order as $option) {\n\t\t\t\t\tif (!empty($v['combination'][$option])) {\n\t\t\t\t\t\t$combination[$option] = $v['combination'][$option];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$combination[$option] = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$_data = array(\n\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t'exception_id' => $v['exception_id'],\n\t\t\t\t\t'combination' => serialize($combination),\n\t\t\t\t);\n\t\t\t\tdb_query(\"INSERT INTO ?:product_options_exceptions ?e\", $_data);\n\n\t\t\t}\n\n\t\t\t$result = true;\n\t\t}\n\t}\n\n\treturn $result;\n}",
"public function disabled_notice_woocommerce_check() {\n\n\t\techo '<div class=\"woocommerce-message error fade\"><p>';\n\t\tif ( self::themecomplete_woocommerce_check_only() ) {\n\t\t\techo sprintf( esc_html__( '%sImportant:%s Please run WooCommerce updater before using WooCommerce TM Extra Product Options.',\n\t\t\t\t'woocommerce-tm-extra-product-options' ),\n\t\t\t\t'<strong>', '</strong>' );\n\t\t} else {\n\t\t\techo sprintf( esc_html__( '%sImportant:%s WooCommerce TM Extra Product Options requires %sWooCommerce%s %s or later.', 'woocommerce-tm-extra-product-options' ),\n\t\t\t\t'<strong>', '</strong>', '<a href=\"http://wordpress.org/extend/plugins/woocommerce/\">', '</a>', THEMECOMPLETE_EPO_WC_VERSION );\n\t\t}\n\t\techo '</p>';\n\n\t\tif ( self::themecomplete_woocommerce_check_only() && get_option( 'woocommerce_db_version' ) ) {\n\n\t\t\t$update_url = wp_nonce_url(\n\t\t\t\tadd_query_arg( 'do_update_woocommerce', 'true', admin_url( 'admin.php?page=wc-settings' ) ),\n\t\t\t\t'wc_db_update',\n\t\t\t\t'wc_db_update_nonce'\n\t\t\t);\n\n\t\t\techo '<p class=\"submit\"><a href=\"' . esc_url( $update_url ) . '\" class=\"wc-update-now button-primary\">' . esc_attr__( 'Run the updater', 'woocommerce' ) . '</a></p>';\n\t\t}\n\n\t\techo '</div>';\n\n\t}",
"function is_plugin_update() {\n\t\t\treturn ! $this->is_plugin_new_install();\n\t\t}",
"public function isExtListUpdateNecessary() {}",
"public function settings_updated() {\n\t\tglobal $pagenow;\n\t\t$on_options_page = ($pagenow == 'options-general.php');\n\t\t$on_plugins_page = (isset($_GET['page']) && $_GET['page'] == $this->menu_page);\n\t\t$just_updated = (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true');\n\n\t\tif($on_options_page && $on_plugins_page && $just_updated) {\n\t\t\tdo_action('chaos-settings-updated');\n\t\t}\n\t}",
"function setupAutoUpdate() {\n try {\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('new_modules_available', 'system', 'b:0;')\");\n DB::execute(\"INSERT INTO \" . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('update_archive_url', 'system', 'N;')\");\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('update_download_progress', 'system', 'i:0;')\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }",
"public function check_version() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tif ( is_plugin_active( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) ) ) {\n\t\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice' ) );\n\t\t\t\tif ( isset( $_GET['activate'] ) ) {\n\t\t\t\t\tunset( $_GET['activate'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( self::old_version() ) {\n\t\t\tdeactivate_plugins( 'woocommerce-tm-custom-price-fields/tm-woo-custom-prices.php' );\n\t\t\tadd_action( 'admin_notices', array( $this, 'deprecated_notice' ) );\n\t\t}\n\n\t\tif ( ! self::woocommerce_check() ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice_woocommerce_check' ) );\n\t\t}\n\n\t}",
"public function addCheckingForUpdate() {\n global $laterpay_version;\n\n if ( get_option('laterpay_version') != $laterpay_version ) {\n $this->activate();\n }\n }",
"public function transfer_options() {\n\n\t\t// check if PRO option exists and contains data entered by user\n\t\t$pro_options = array(\n\t\t\t'general' => get_option( 'mc4wp', false ),\n\t\t\t'checkbox' => get_option( 'mc4wp_checkbox', false ),\n\t\t\t'form' => get_option( 'mc4wp_form', false )\n\t\t);\n\n\t\t// only bail if all three options have settings.\n\t\tif ( $pro_options['general'] !== false\n\t\t && $pro_options['checkbox'] !== false\n\t\t && $pro_options['form'] !== false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// create new settings array\n\t\t$settings = include dirname( __FILE__ ) . '/config/default-options.php';\n\n\t\tforeach ( $settings as $group_key => $options ) {\n\t\t\tforeach ( $options as $option_key => $option_value ) {\n\t\t\t\tif ( ! empty( $this->lite_options[$group_key][$option_key] ) ) {\n\t\t\t\t\t$settings[$group_key][$option_key] = $this->lite_options[$group_key][$option_key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// store options\n\t\tupdate_option( 'mc4wp', $settings['general'] );\n\t\tupdate_option( 'mc4wp_checkbox', $settings['checkbox'] );\n\t\tupdate_option( 'mc4wp_form', $settings['form'] );\n\t\treturn true;\n\t}",
"private function OnUpdatePayments(Enlight_Event_EventArgs $args)\n {\n $request = $args->getSubject()->Request();\n $paymentName = $request->name;\n $active = $request->active;\n $shops = $request->shops;\n $activeShops = $this->getActiveShops();\n\n $selectedShops = array();\n foreach ($shops as $key => $shop) {\n $selectedShops[] = $shop['id'];\n }\n\n if ($active and ! empty($selectedShops)) {\n foreach ($activeShops as $key => $shop) {\n if (in_array($shop['id'], $selectedShops)) {\n $newActive = true;\n } else {\n $newActive = false;\n }\n $this->setActivatedConfig($newActive, $paymentName, $shop['id']);\n }\n }\n\n if (!$active || empty($selectedShops)) {\n foreach ($activeShops as $key => $shop) {\n $this->setActivatedConfig($active, $paymentName, $shop['id']);\n }\n }\n return true;\n }",
"public function autoupdate() {\n\t\t$options = $this->get_option();\n\t\t$update_successful = true;\n\n\t\tif (version_compare($options['version'], '2.0', '<')) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$sql = \"\n\t\t\t\tUPDATE $wpdb->postmeta\n\t\t\t\tSET meta_key='im8_additional_css_file'\n\t\t\t\tWHERE meta_key='additional_css_file'\";\n\t\t\t$update_successful &= $wpdb->query($sql) != -1;\n\n\t\t\t$sql = \"\n\t\t\t\tUPDATE $wpdb->postmeta\n\t\t\t\tSET meta_key='im8_additional_css'\n\t\t\t\tWHERE meta_key='additional_css'\";\n\t\t\t$update_successful &= $wpdb->query($sql) != -1;\n\n\t\t\t$options['version'] = '2.0';\n\t\t\tif ($update_successful)\n\t\t\t\tupdate_option($this->option_name, $options);\n\t\t}\n\n\t\tif ($update_successful) {\n\t\t\t$options['version'] = $this->version;\n\t\t\tupdate_option($this->option_name, $options);\n\t\t}\n\t}",
"public static function activation_check() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\twp_die( sprintf( esc_html__( 'WooCommerce TM Extra Product Options requires WordPress %s or later.', 'woocommerce-tm-extra-product-options' ), THEMECOMPLETE_EPO_WP_VERSION ) );\n\t\t}\n\n\t}",
"public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }",
"public function check()\n {\n foreach ($this->options as $id => $option) {\n $option->check();\n }\n }",
"private function activateAddUpdateOption()\n {\n // check current option exists or not.\n $current_options = get_option($this->main_option_name);\n\n if ($current_options === false) {\n // if this is newly activate. it is never activated before, add the options.\n $this->setupAllOptions();\n $this->saveOptions($this->all_options);\n } elseif (\n is_array($current_options) &&\n array_key_exists('rdsfw_plugin_db_version', $current_options) &&\n version_compare($current_options['rdsfw_plugin_db_version'], $this->db_version, '<')\n ) {\n // if there is db updated. it is just updated because `activateCreateAlterTables()` that is using `dbDelta()` were called before this method.\n // the table structure should already get updated by this.\n // save the new db version.\n $current_options['rdsfw_plugin_db_version'] = $this->db_version;\n $this->saveOptions($current_options);\n }\n\n unset($current_options);\n }",
"public function isUpdated() {}",
"public function beenUpdated()\n {\n return count($this->updatePlan) > 0;\n }",
"private function checkProducts()\n {\n $products = Product::with('prices')->get();\n $errors = [];\n foreach ($products as $product) {\n $basePrice = $product->prices->where('currency_id', Currency::defaultCurrency()->id)->first();\n if ( ! $basePrice) {\n $errors[] = sprintf(\n 'The product \"%s (%s)\" has no price set for your default currency.',\n $product->name,\n $product->id\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }",
"public function do_updates() {\n\t\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$installed_version = get_option( $this->option_name );\n\n\t\t// Maybe it's the first install.\n\t\tif ( ! $installed_version ) {\n\t\t\t$this->save_version();\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( version_compare( $installed_version, $this->version, '<' ) ) {\n\t\t\t$this->perform_updates();\n\t\t}\n\t}",
"function edd_pup_eligible_updates( $payment_id, $updated_products, $object = true, $licenseditems = null, $email_id = 0 ){\r\n\r\n\tif ( empty( $payment_id) || empty( $updated_products ) || $email_id = 0 ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( is_null( $licenseditems ) ) {\r\n\t\tglobal $wpdb;\r\n\t\t$licenseditems = $wpdb->get_results( \"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_edd_sl_enabled' AND meta_value = 1\", OBJECT_K );\r\n\t}\r\n\r\n\t$customer_updates = '';\r\n\t$licensing = edd_get_option( 'edd_pup_license' );\r\n\t$payment_meta = get_post_meta( $payment_id, '_edd_payment_meta', true );\r\n\r\n\tif ( ( $licensing != false ) && is_plugin_active('edd-software-licensing/edd-software-licenses.php' ) ) {\r\n\t\t$licenses = edd_pup_get_license_keys( $payment_id );\r\n\t}\r\n\r\n\tforeach ( maybe_unserialize( $payment_meta['cart_details'] ) as $item ){\r\n\t\t$item['name'] = addslashes( $item['name'] );\r\n\r\n\t\t// Skip $item if it is not a product being updated\r\n\t\tif ( !isset( $updated_products[ $item['id'] ] ) ){\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// If Software Licensing integration is active and the $item has software licensing enabled\r\n\t\tif ( ( $licensing != false ) && isset( $licenseditems[ $item['id'] ] ) ) {\r\n\r\n\t\t\t// If the customer has licenses and the license for this $item is enabled and active\r\n\t\t\t$enabled = get_post_status( $licenses[$item['id']]['license_id'] ) == 'publish' ? true : false;\r\n\r\n\t\t\tif ( !empty( $licenses ) && $enabled && in_array( edd_software_licensing()->get_license_status( $licenses[$item['id']]['license_id'] ), apply_filters( 'edd_pup_valid_license_statuses', array( 'active', 'inactive' ) ) ) ) {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t}\r\n\t}\r\n\r\n\treturn $customer_updates;\r\n}",
"public static function has_update() {\n\t\trequire_once(trailingslashit(ABSPATH) . 'wp-admin/includes/plugin.php');\n\t\trequire_once(trailingslashit(ABSPATH) . 'wp-admin/includes/plugin-install.php');\n\t\treturn (version_compare(static::get_version(), static::get_remote_version()) < 0);\n\t}"
] |
[
"0.6474731",
"0.6241679",
"0.62250805",
"0.6125108",
"0.61233383",
"0.60871303",
"0.60608554",
"0.59921587",
"0.59701514",
"0.59683233",
"0.5952581",
"0.5933096",
"0.59172446",
"0.58891433",
"0.58717823",
"0.58657277",
"0.5854258",
"0.58346915",
"0.58300817",
"0.5800073",
"0.57982206",
"0.5789571",
"0.5787518",
"0.577591",
"0.5774979",
"0.5767342",
"0.57595706",
"0.5754517",
"0.5752307",
"0.57403713"
] |
0.73831457
|
0
|
Get validation error for requisition list item.
|
public function getItemError()
{
return !empty($this->itemErrors) ? reset($this->itemErrors) : null;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getValidationFailed();",
"public function getItemErrors()\n {\n return $this->itemErrors;\n }",
"public function validAndGetErrorMsg() {\r\n require_once 'Samus/Samus_CRUD/Samus_CRUD_RequestValidator.php';\r\n $req = new Samus_CRUD_RequestValidator($this->object);\r\n $req->init();\r\n return $req->result();\r\n }",
"public function getError()\n {\n return count($this->errors) ? current($this->errors) : NULL;\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function getValidationErrors() {\n\t\treturn $this->_validationErrors;\n\t}",
"public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }",
"public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}",
"function getError()\n\t{\n\t\treturn $this->errors;\n\t}",
"function getError()\n\t{\n\t\treturn $this->errors;\n\t}",
"function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}",
"public function getError()\n {\n return $this->currentError;\n }",
"public function getErrorMsg()\n\t{\n\t\treturn $this->error;\n\t}",
"public function getValidationErrors()\n\t{\n\t\treturn $this->validationErrors;\n\t}",
"public function getValidationFailed()\n {\n if (is_null($this->ValidationFailed)) {\n /** @psalm-var ?float $data */\n $data = $this->raw(self::FIELD_VALIDATION_FAILED);\n if (is_null($data)) {\n return null;\n }\n $this->ValidationFailed = (float) $data;\n }\n\n return $this->ValidationFailed;\n }",
"public function getError() {\n\t\treturn $this->current_error;\n\t}",
"public function getFieldValidationErrors()\n {\n return $this->_aInputValidationErrors;\n }",
"public function getValidationErrors();",
"public function getValidationErrors();",
"public function getError()\n\t{\n\t\treturn $this->_error;\n\t}",
"public function getError()\r\n\t\t{\r\n\t\t\treturn $this->_errores;\r\n\t\t}",
"public function getError() {\n return $this->_error;\n }",
"public function getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}",
"public function getError()\n {\n return $this->_error;\n }",
"public function getError()\n {\n return $this->_error;\n }",
"public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}",
"public function getErrors()\n {\n return $this->_arrValidationErrors;\n }",
"public function getError()\r\n {\r\n return count($this->strError) == 0 ? null :\r\n (count($this->strError) == 1 ? $this->strError[0] :\r\n $this->strError);\r\n }",
"public function getError() {\n\t\treturn $this->error;\n\t}",
"public function getError() {\n\t\treturn $this->error;\n\t}"
] |
[
"0.6752288",
"0.6694718",
"0.6636317",
"0.6516256",
"0.63484013",
"0.63078785",
"0.63068503",
"0.627811",
"0.6273213",
"0.6273213",
"0.62609226",
"0.6254787",
"0.6251489",
"0.62473446",
"0.62469167",
"0.6222354",
"0.6218007",
"0.6213141",
"0.6213141",
"0.6211441",
"0.6210214",
"0.6199107",
"0.61933476",
"0.6186421",
"0.6186421",
"0.61751133",
"0.6163997",
"0.61592263",
"0.61477005",
"0.61477005"
] |
0.7163328
|
0
|
Returns whatever is at the requested index in the config, or the default. Supports nested lookups in the form of `toplevel.secondlevel.third.etc`.
|
public function get(string $index, $default = null)
{
$config = $this->config;
foreach (explode('.', $index) as $part) {
if (!isset($config[$part])) {
return $default;
}
$config = $config[$part];
}
return $config;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"static public function get($key, $default = null)\n {\n $keys = explode('.', $key);\n \n // Root search\n $k = array_shift($keys);\n $opt = isset(self::$_config[$k]) ? self::$_config[$k] : null;\n \n // Iterative search\n foreach ($keys as $k) {\n if (!isset($opt[$k])) {\n return $default;\n } \n $opt = $opt[$k];\n }\n \n return $opt !== null ? $opt : $default;\n }",
"public function get($parameter, $default = null){\n\t\t$path\t= explode('.', $parameter);\n\t\t$value\t= $this->config;\n\t\tforeach($path as $level){\n\t\t\tif(!isset($value[$level])){\n\t\t\t\treturn $default;\n\t\t\t}\n\n\t\t\t$value\t= $value[$level];\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function getFromSubArray($setting, $subArray, $default = '')\n {\n //Pull the setting key for this level out of the setting array.\n $settingName = array_shift($setting);\n\n //Check to see if the key is found in our subArray\n if (isset($subArray[$settingName])) {\n //The key is found, let's check if we need to drill down deeper into the subArray\n if (is_array($subArray[$settingName]) && count($setting) > 0) {\n //We need to go down another level in the array. Return what is found at a lower level.\n return $this->getFromSubArray($setting, $subArray[$settingName], $default);\n }\n\n //This is the lowest level in our search. Return the associated value.\n return $subArray[$settingName];\n }\n\n //The given key cannot be found in the given subArray. Return the given default value.\n return $default;\n }",
"private function _read($from_variable,$index,$default)\n {\n $name = $this->_configVarNames($index);\n\t\tswitch (count($name)) {\n\t\t\tcase 3:\n\t\t\t\tif (isset($from_variable[$name[0]][$name[1]][$name[2]])) {\n\t\t\t\t\treturn $from_variable[$name[0]][$name[1]][$name[2]];\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (isset($from_variable[$name[0]][$name[1]])) {\n\t\t\t\t\treturn $from_variable[$name[0]][$name[1]];\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif (isset($from_variable[$name[0]])) {\n\t\t\t\t\treturn $from_variable[$name[0]];\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n return $default;\n }",
"public static function get(string $name, $default)\n {\n self::getInstance();\n\n $path = explode('.', $name);\n $conf = self::$config;\n\n for ($i=0; $i < count($path) - 1; $i++) {\n if (isset($conf->{$path[$i]})) {\n $conf = $conf->{$path[$i]};\n } else {\n return $default;\n }\n }\n \n $last = end($path);\n if (isset($conf->$last)) {\n return $conf->$last;\n }\n\n return $default;\n }",
"function config_item($index)\n{\n\tglobal $config;\n\treturn isset($config[$index])? $config[$index] : false;\n}",
"function ign_udef_index(&$name, $index, $default = \"\")\r\n{\r\n if (isset($name[$index]))\r\n {\r\n return $name[$index];\r\n }\r\n else\r\n {\r\n return $default;\r\n }\r\n}",
"function idx($value, $key, $default = null) {\n if (is_null($value) || is_null($key)) {\n return $default;\n }\n\n if (is_array($value)) {\n if (array_key_exists($key, $value)) {\n return $value[$key];\n }\n } else {\n if (property_exists($value, $key)) {\n return $value->$key;\n }\n }\n return $default;\n}",
"public function offsetGet($index)\n\t{\n\t\tif (parent::offsetExists($index))\n\t\t{\n\t\t\treturn parent::offsetGet($index);\n\t\t}\n\t\tif (isset(self::$global[$index]))\n\t\t{\n\t\t\treturn self::$global[$index];\n\t\t}\n\n\t\treturn null;\n\t}",
"private function get(string $name, $default = null)\n {\n $path = explode('/', $name);\n $current = $this->items;\n\n foreach ($path as $field) {\n if (is_array($current) && isset($current[$field])) {\n $current = $current[$field];\n } else {\n return $default;\n }\n }\n\n return $current;\n }",
"public function get($setting, $default = '')\n {\n //Checks if $setting is string\n if (is_string($setting)) {\n //$setting is a string, checks if the given key is set in the top level of the $mergedConfig array.\n if (isset($this->mergedConfig[$setting])) {\n //The key is found, so return the value.\n return $this->mergedConfig[$setting];\n }\n } elseif (is_array($setting) && count($setting) > 0) {\n //$setting is a non-empty array. Let's drill down to find our value.\n return $this->getFromSubArray($setting, $this->mergedConfig, $default);\n }\n\n //$setting is not found in the MergedConfig array. Return the given default value.\n return $default;\n }",
"function my_config($index = '') \n\t{\t\n\t\tglobal $CI;\n\n\t\treturn $CI->my_config->item($index); \n\t}",
"public function get($index = null, $default = null)\n {\n \tif (!$index) {\n \t\t return $this->options;\n \t} else if (is_array($index) and count($index)) {\n $options = [];\n\n foreach ($index as $option) {\n $options[$option] = $this->fetch($option);\n }\n\n return $options;\n }\n\n return $this->fetch($index, $default);\n }",
"public static function get($index)\n {\n return self::getInstance()->dotNotation->get($index);\n }",
"function get($path=null, $default=null)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t\n\t\t\tif ($path==null) return $this->settings;\n\t\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$tmp = $this->settings;\n\t\t\tforeach($path as $pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\tif (!isset($tmp[$pointer])){\n\t\t\t\t\t\treturn $default;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = $tmp[$pointer];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $tmp;\n\t\t}",
"public function get($var = null, $default = null) {\n $name = $this->__configVarNames($var);\n\n if (empty($name)) {\n return $this->data;\n }\n switch (count($name)) {\n case 6:\n if (isset($this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]][$name[5]])) {\n return $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]][$name[5]];\n }\n case 5:\n if (isset($this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]])) {\n return $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]];\n }\n break;\n case 4:\n if (isset($this->data[$name[0]][$name[1]][$name[2]][$name[3]])) {\n return $this->data[$name[0]][$name[1]][$name[2]][$name[3]];\n }\n break;\n case 3:\n if (isset($this->data[$name[0]][$name[1]][$name[2]])) {\n return $this->data[$name[0]][$name[1]][$name[2]];\n }\n break;\n case 2:\n if (isset($this->data[$name[0]][$name[1]])) {\n return $this->data[$name[0]][$name[1]];\n }\n break;\n case 1:\n if (isset($this->data[$name[0]])) {\n return $this->data[$name[0]];\n }\n break;\n default:\n return MOC_Array::classicExtract($this->data, $var);\n //throw new MOC_Configuration_Exception(sprintf('Unable to get the key. Depth is invalid (\"%s\")', count($name)));\n }\n\n return $default;\n }",
"public static function get($needle, $haystack, $default_return=null) {\n return isset($haystack[$needle]) ? $haystack[$needle] : $default_return;\n }",
"function config($key, $default=null)\n{\n global $config;\n\n // Extract config keys\n list($a, $b) = explode('.', $key);\n\n if (empty($a)) {\n return $default;\n } elseif (empty($b)) {\n return $config[$a] ? $config[$a] : $default;\n } else {\n return $config[$a][$b] ? $config[$a][$b] : $default;\n }\n}",
"public function item($item = '', $index = ''){\n\t\t$value = false;\n\t\tif($index == ''){\n\t\t\tif(isset($this->config[$item])){\n\t\t\t\t$value = $this->config[$item];\n\t\t\t}\n\t\t}else{\n\t\t\tif(array_key_exists($index, $this->config) && in_array($item, $this->config)){\n\t\t\t\t$value = $this->config[$index][$item];\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}",
"public function get_value($index = NULL,$item = NULL){\n if(is_null($index)){\n return $this->ini_file_array;\n } else if(is_null($item)){\n if(array_key_exists($index,$this->ini_file_array)){\n return $this->ini_file_array[\"$index\"];\n } else {\n return NULL;\n }\n } else {\n if(isset($this->ini_file_array[\"$index\"][\"$item\"])){\n return $this->ini_file_array[\"$index\"][\"$item\"];\n } else {\n return NULL;\n }\n }\n }",
"function getAt ( $index = 0 , $default = null )\n\t{\n\t\treturn $this->_count > $index ? $this->_tokens[$index] : $default ;\n\t}",
"function array_get($array, $key, $default = null)\n{\n if (is_null($key)) {\n return $array;\n }\n if (isset($array[$key])) {\n return $array[$key];\n }\n\n foreach (explode('.', $key) as $segment) {\n if ( ! is_array($array) or ! array_key_exists($segment, $array)) {\n return $default;\n }\n $array = $array[$segment];\n }\n\n return $array;\n}",
"public function get($index = null, $default = false) {\n\t\tif (!is_null($index)) {\n\n\t\t\t// the model is defined by the first element in the uri - so 'model' returns the 0 index.\n\t\t\tif ($index == 'model') return $this->path[0];\n\n\t\t\t// return the full uri as a string.\n\t\t\tif ($index == 'full') {\n\t\t\t\t// remove the query string from the uri. (preg_replace will generally be fastest)\n return preg_replace('/\\?(?!.*\\?)\\S+/', '', implode('/',$this->path));\n\t\t\t}\n\n if (isset($this->path[$index]) && $this->path[$index] != '') {\n \t// remove the query string from the specified uri segment.\n return preg_replace('/\\?(?!.*\\?)\\S+/', '', $this->path[$index]);\n }\n else return $default;\n }\n // return the path as an array.\n else return $this->path;\n\t}",
"public function get(int $index);",
"public function get(int $index);",
"public function lookupLabel(int $index)\n {\n return $this->indexes[$index] ?? null;\n }",
"public static function get($key, $default = null) {\n $segments = explode('.', $key);\n\n // Check to see if the value is already loaded.\n $value = static::lookup($segments);\n if ($value !== null) return $value;\n\n if (count($segments) < 3) return $default;\n\n // Attempt a 'lazy load' if the key has at least 3 segments.\n if (!static::load($segments)) return $default;\n\n // Recheck for the setting.\n $value = static::lookup($segments);\n return $value !== null ? $value : $default;\n }",
"function getConfig($item) {\n if (array_key_exists($item, CONFIG)) return CONFIG[$item];\n if (array_key_exists($item, DEFAULTS)) return DEFAULTS[$item];\n}",
"public function get($key){\r\n\t\tif(key_exists($key, $this->config)){\r\n\t\t\treturn $this->config[$key];\r\n\t\t}\r\n\t\tdie('Index is out of range');\r\n\t}",
"function GetDefaultLocation()\r\n{\r\n $locations = parse_ini_file('./settings/locations.ini', true);\r\n BuildLocations($locations);\r\n \r\n $def = $locations['locations']['default'];\r\n if( !$def )\r\n $def = $locations['locations']['1'];\r\n $loc = $locations[$def]['default'];\r\n if( !$loc )\r\n $loc = $locations[$def]['1'];\r\n \r\n return $locations[$loc];\r\n}"
] |
[
"0.63780624",
"0.57980704",
"0.57965416",
"0.57569724",
"0.5741964",
"0.57314354",
"0.5694477",
"0.56235623",
"0.557671",
"0.5565098",
"0.55596787",
"0.5535319",
"0.55043674",
"0.54763716",
"0.54748565",
"0.545499",
"0.54519135",
"0.5427305",
"0.5426175",
"0.541085",
"0.5397954",
"0.53957886",
"0.5368021",
"0.53526944",
"0.53526944",
"0.5344802",
"0.53224534",
"0.53127116",
"0.52716666",
"0.526318"
] |
0.72324896
|
0
|
Displays homepage with subscribe form.
|
public function actionIndex()
{
$model = new SubscribeForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
$subscriptionRes = $model->subscribe();
$alertType = 'error';
if ($subscriptionRes['success']) {
$alertType = 'success';
}
Yii::$app->session->addFlash($alertType, ['message' => $subscriptionRes['message']]);
}
return $this->render('index', ['subscribeModel' => $model]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function renderSubscribe() {\n $this->checkAccess('user',true,true);\n\n $template = new Template;\n echo $template->render('header.html');\n echo $template->render('user/subscribe.html');\n echo $template->render('footer.html');\n\n //clear error status\n $this->f3->set('SESSION.haserror', '');\n }",
"public function index()\n {\n $this->content = 'pages/unsubscribe';\n $this->layout();\n }",
"public function subscribe()\n\t{\n\n\t\t\t$this->data['user'] = $this->subscriber_m->get_new();\t\t\n\t\t//setup the form\n\t\t$rules=$this->subscriber_m->_rules_page;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t//process the form \n\t\tif($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$data = $this->subscriber_m->array_from_post(array('semail'));\n\t\t\t$this->subscriber_m->save($data);\n//\t\t\tredirect('/');\n\t\t\t\n\t\t}\n\t\t//load SUBSCRIBER view\n\t\t$this->load->view('sidebar',$this->data);\n\t}",
"function newsletters_subscribe_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-subscribe.php\" );\r\n }",
"public function actionSubscribe()\n\t{\n\t\t$modelSub=new EventSubscribe;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['EventSubscribe']))\n\t\t{\t\n\t\t\t$modelSub->attributes=$_POST['EventSubscribe'];\n\t\t\t$modelSub->status=1; //Subscription Active\n\t\t\t\n\t\t\tif($modelSub->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('event/view', 'id'=>$modelSub->event_id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('view',array(\n\t\t\t'modelSub'=>$modelSub,\n\t\t));\n\t}",
"public function subscribe()\n {\n\t\t//dd(env(\"POSTMARK_API_KEY\"));\n return view( 'businesses/subscribe' );\n }",
"public function display_account_subscriptions( ){\n\t\tif( $this->is_page_visible( \"subscriptions\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_subscriptions.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_subscriptions.php' );\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_subscriptions.php' ) )\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_subscriptions.php' );\n\t\t}\n\t}",
"public function subscribeAction()\n {\n $orgId = urldecode($this->getRequest()->getParam('org'));\n\n if ($orgId && ($orgId != $this->currentUser->getCurrentOrganizationId())) {\n $allowedOrganizations = $this->currentUser->getAllowedOrganizations();\n if ((! $this->currentUser->isActive()) || isset($allowedOrganizations[$orgId])) {\n $this->currentUser->setCurrentOrganization($orgId);\n }\n }\n\n $this->html->h1($this->_('Subscribe'));\n\n $screen = $this->currentUser->getCurrentOrganization()->getSubscribeScreen();\n\n if ($screen instanceof SubscribeScreenInterface) {\n $params = $screen->getSubscribeParameters();\n $snippets = $screen->getSubscribeSnippets();\n } else {\n $list = $this->_getScreenOrgs('gor_respondent_subscribe');\n if ($list) {\n $params = [\n 'action' => 'subscribe',\n 'info' => $this->_('Select an organization to subscribe to:'),\n 'orgs' => $list,\n ];\n $snippets = ['Organization\\\\ChooseListedOrganizationSnippet'];\n } else {\n $params = [];\n $snippets = ['Subscribe\\\\NoSubscriptionsSnippet'];\n }\n }\n\n $this->addSnippets($snippets, $params);\n }",
"function add_subscriber_view() {\n return '\n <div class=\"card\">\n <h3>Add Subscriber</h3>\n <form action=\"email_list.php\" method=\"post\">\n <p><label>Name:</label> <input type=\"text\" name=\"name\"></p>\n <p><label>Email:</label> <input type=\"text\" name=\"email\"></p>\n <p><input type=\"submit\" value=\"Sign Up\"/></p>\n <input type=\"hidden\" name=\"action\" value=\"create\">\n </form>\n </div>\n ';\n }",
"public function form(): string {\n\n\t\twp_enqueue_style( 'subscribe' );\n\t\twp_enqueue_script( 'subscribe' );\n\n\t\tob_start();\n\t\trequire SUBSCRIBE_PATH . 'templates/subscribe-form.php';\n\n\t\treturn (string) ob_get_clean();\n\t}",
"public function inscription()\n {\n # echo '<h1>JE SUIS LA PAGE INSCRIPTION</h1>';\n $this->render('membre/inscription');\n }",
"public function subscribe() {\n\t\tglobal $current_user;\n\t\tget_currentuserinfo();\n\t\t$name = $current_user->user_firstname;\n\t\tif ( empty( $name ) ) {\n\t\t\t$name = $current_user->display_name;\n\t\t}\n\t\t?>\n\t\t<div class=\"wpbuddy-cr-form\">\n\t\t\t<label style=\"width: 110px; display: inline-block;\" for=\"text1210658\"><?php echo __( 'Your first name', $this->_google_drive_cdn->get_textdomain() ); ?></label>\n\t\t\t<input style=\"width: 140px;\" id=\"text1210658\" name=\"209681\" type=\"text\" value=\"<?php echo $name; ?>\" />\n\t\t\t<label style=\"width: 110px; display: inline-block;\" for=\"text1210692\"><?php echo __( 'Your E-Mail address', $this->_google_drive_cdn->get_textdomain() ); ?></label>\n\t\t\t<input style=\"width: 140px;\" id=\"text1210692\" name=\"email\" value=\"<?php echo $current_user->user_email; ?>\" type=\"text\" />\n\t\t\t<a href=\"#\" class=\"button button-primary\"><?php echo __( 'Subscribe', $this->_google_drive_cdn->get_textdomain() ); ?></a>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\t\t\t//<![CDATA[\n\n\t\t\tjQuery( document ).ready( function () {\n\t\t\t\t/** Subscribe form **/\n\t\t\t\tjQuery( '.wpbuddy-cr-form a.button' ).click( function ( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar name = jQuery( '#text1210658' ).val();\n\t\t\t\t\tvar mail = jQuery( '#text1210692' ).val();\n\n\t\t\t\t\tjQuery( [\n\t\t\t\t\t\t'<form style=\"display:none;\" action=\"https://10955.cleverreach.com/f/54067/wcs/\" method=\"post\" target=\"_blank\">',\n\t\t\t\t\t\t'<input id=\"text1210692\" name=\"email\" value=\"' + mail + '\" type=\"text\" />',\n\t\t\t\t\t\t'<input id=\"text1210658\" name=\"209681\" type=\"text\" value=\"' + name + '\" />',\n\t\t\t\t\t\t'</form>'\n\t\t\t\t\t].join( '' ) ).appendTo( 'body' )[0];\n\n\t\t\t\t} );\n\t\t\t} );\n\t\t\t/* ]]> */\n\t\t</script>\n\t<?php\n\t}",
"public function subscribe(Request $request) {\n session()->put('referrer', $request->server('HTTP_REFERER'));\n\n\t\t// display subscribe form\n\t\treturn view('subscribe', [ \n\t\t\t'action' => 'subscribe'\n\t\t]);\n }",
"function subscription_schedule(){ \n?>\n\t<h2><?php _e('Add Subscription Form', 'wpscripts'); ?></h2>\n\t\n\t<p>\n\t*Make sure to enter this code on the page that you wish it to be displayed on:<br />\n\t<h3>[subscription_show]</h3>\n\t\n\tAlso make sure it is entered in the HTML tab in the Page, not the VISUAL tab.<br />\n\tOtherwise your Subscription Form won't show.\n\t</p>\n\t</form>\n<?php\n}",
"function ical_subscribe() {\n \t$this->wireframe->print_button = false;\n\n $ical_url = assemble_url('ical', array(\n 'token' => $this->logged_user->getToken(true),\n ));\n\n $ical_subscribe_url = str_replace(array('http://', 'https://'), array('webcal://', 'webcal://'), $ical_url);\n\n $this->smarty->assign(array(\n 'ical_url' => $ical_url . '&subscribe=no',\n 'ical_subscribe_url' => $ical_subscribe_url\n ));\n }",
"public function index()\n {\n $this->data['segments']=$this->segments->all();\n return view('admin.subscribe.index',$this->data);\n }",
"public function signInPage() {\n $view = new View('inscription');\n $view->generate();\n }",
"public function display_submenu_page() {\n\t\techo wp_kses_post( sprintf( '<div class=\"wrap\">\n\t\t\t\t<h1>%s</h1>\n\t\t\t\t%s\n\t\t\t\t<p>%s</p>\n\t\t\t</div>',\n\t\t\tesc_attr__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t$this->sync_newsletter(),\n\t\t\tesc_attr__( 'Synchronization of newsletters with MailChimp.', 'elemarjr' )\n\t\t) );\n\t}",
"public function index(Request $req)\n {\n \n $user = $req->user();\n if ($user->subscribed('main')) {\n //\n return \"vous etes deja abonné\";\n }\n else{\n return view('subscription');\n }\n }",
"function index()\n {\n // Check if there errors from the forms, and display them.\n $this->registry->template->loginSend = Util::checkExcistInSession($this->loginError);\n $this->registry->template->registerSend = Util::checkExcistInSession($this->registerError);\n\n // If the user is loggedIn show the logout button\n if ($this->registry->userAccount->isLogedIn()) {\n $this->registry->template->show('account-loggedin');\n } else {\n $this->registry->template->show('account');\n }\n }",
"public function index()\n {\n $users = SubscribedUser::all();\n return view('admin.page.subscribedUser.home',compact('users'));\n }",
"function index()\n\t{\n\t\t$this->output('/consent/ev_form/v_main_form');\n\t}",
"public function action_index()\n\t{\n\t\t// $this->action_subscriptions();\n\t}",
"public function actionIndex()\n {\n $searchModel = new SubscribeclassSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }",
"public function index()\n\t{\n\n\t\t$this->view('guest/contact-us');\n\t}",
"public function index()\n {\n //\n return view('subscriptions.index');\n }",
"function subscribeUser()\n\t\t{\n\t\t\techo $this->email.\"add to the database !!\";\n\t\t}",
"public function index() {\r\n $this->data[\"pagetitle\"] = \"RedScribeIt Manage\";\r\n $this->data[\"heading\"] = \"Manage Subscriptions\";\r\n $this->data[\"menu\"] = \"menu\";\r\n $this->data[\"content\"] = 'manage';\r\n \r\n $this->load->model(\"subscription\");\r\n\t\t\t\r\n\t /* Set username and avatar img here */\r\n $this->data[\"avatar\"] = \"assets/images/null.jpg\";\r\n $this->data[\"uname\"] = \"NULLUSER\";\r\n\t\t\r\n /* calls Render in the Main_Controller \r\n see MY_Controller.php in ./core */\r\n $this->render(); \r\n }",
"public function index()\n {\n $title = 'Subscribers';\n $subs = Subscriber::whereHas('topic')->get();\n return view('subscriber.index', compact('title','subs'));\n }"
] |
[
"0.7276655",
"0.7073377",
"0.70501876",
"0.68676126",
"0.6732297",
"0.6614577",
"0.6589703",
"0.6555597",
"0.6544836",
"0.6492394",
"0.64808077",
"0.6476228",
"0.6472942",
"0.64710534",
"0.646384",
"0.6409613",
"0.6364468",
"0.6317738",
"0.6297542",
"0.62316954",
"0.6191095",
"0.61410564",
"0.60935915",
"0.6080445",
"0.6073178",
"0.6058986",
"0.60511744",
"0.6042073",
"0.6033016",
"0.60319734"
] |
0.7324951
|
0
|
Asserting that refreshing leads to updated content that is already cached.
|
protected function assertRefresh(RefreshCapable $proxyClient, $path = '/cache.php')
{
$this->assertMiss($this->getResponse($path));
$response = $this->getResponse($path);
$this->assertHit($response);
$proxyClient->refresh($path)->flush();
usleep(1000);
$refreshed = $this->getResponse($path);
$originalTimestamp = (float) (string) $response->getBody();
$refreshedTimestamp = (float) (string) $refreshed->getBody();
Assert::assertThat(
$refreshedTimestamp,
Assert::greaterThan($originalTimestamp)
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function testContentLocallyCached() {\n\t\t$this->cache\n\t\t\t->expects( $this->once() ) // <-- the assert\n\t\t\t->method( 'get' )\n\t\t\t->will( $this->returnValue( $this->statusSchema ) );\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t}",
"private function assertPageNotReloaded(): void {\n $this->assertSession()->pageTextContains($this->pageReloadMarker);\n }",
"public function test_page_cache()\n {\n }",
"public function testRefresh()\n {\n parent::setUpPage();\n\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElements(WebDriverBy::className('toolsRefresh'))[0];\n $link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }",
"abstract protected function needRefresh();",
"function testSchemaNotInCacheDoUpdate() {\n\t\t// If the revision was not in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( false ) );\n\n\t\t// ...RemoteSchema will attempt to acquire an update lock:\n\t\t$this->cache\n\t\t\t->expects( $this->any() )\n\t\t\t->method( 'add' )\n\t\t\t->with( $this->stringContains( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( true ) );\n\n\t\t// With the lock acquired, we'll see an HTTP request\n\t\t// for the revision:\n\t\t$this->http\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with(\n\t\t\t\t$this->stringContains( '?' ),\n\t\t\t\t$this->lessThan( RemoteSchema::LOCK_TIMEOUT ) )\n\t\t\t->will( $this->returnValue( FormatJson::encode( $this->statusSchema ) ) );\n\n\t\t$this->assertEquals( $this->statusSchema, $this->schema->get() );\n\t}",
"public function needsRefreshing()\n {\n return $this->isExpired() || ! $this->isLoaded();\n }",
"public function testUpdateRefresh(): void\n {\n $fixturesSet = 'TUFTestFixtureSimple';\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n $updater = $this->getSystemInTest();\n // This refresh should succeed.\n $updater->refresh();\n // Put the server-side repo into an invalid state.\n $this->testRepo->removeRepoFile('timestamp.json');\n // The updater is already refreshed, so this will return early, and\n // there should be no changes to the client-side repo.\n $updater->refresh();\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n // If we force a refresh, the invalid state of the server-side repo will\n // raise an exception.\n $this->expectException(RepoFileNotFound::class);\n $this->expectExceptionMessage('File timestamp.json not found.');\n $updater->refresh(true);\n }",
"public function testGets()\n {\n $this->assertEquals(self::$cache->get('Butternut'), '', 'Does not return false on missing file.');\n\n //Test with expired date\n self::$cache->set('Toaster', 'Test', -5);\n\n $this->assertEquals(self::$cache->get('Toaster'), '', 'File not counted as expired.');\n\n //Test with okay file\n self::$cache->set('Toaster', 'Test', 5);\n\n $this->assertEquals(self::$cache->get('Toaster'), 'Test', 'File has not been Get correctly.');\n }",
"function testSchemaInCache() {\n\t\t// If the revision was in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( $this->statusSchema ) );\n\n\t\t// ...no HTTP call will need to be made\n\t\t$this->http\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'get' );\n\n\t\t// ...so no lock will be acquired\n\t\t$this->cache\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'add' );\n\n\t\t$this->assertEquals( $this->statusSchema, $this->schema->get() );\n\t}",
"public function _cache_refresh_all()\n {\n }",
"public function testForever()\n {\n self::$cache->set('Toaster', 'Test', -5);\n self::$cache->forever('Toaster', 'Toast');\n\n $this->assertEquals(self::$cache->get('Toaster'), 'Toast');\n }",
"public function test_caches_and_uses_cache()\n {\n $this->doRequest('/')->assertResponseOk()->assertNotHeaderKeys(['X-Cache', 'X-Cache-ID']);\n\n $this->assertTrue($this->di('redis')->exists($this->cacheMw->getLastKey()));\n\n // req #2 cached\n $this->doRequest('/')->assertResponseOk()->assertHeaderKeys(['X-Cache', 'X-Cache-ID']);\n\n $this->di('redis')->delete($this->cacheMw->getLastKey());\n }",
"public function testGetHit()\n {\n $key = \"unique\";\n $item = $this->cache->getItem($key);\n $item->set(\"content\");\n\n $res = $item->get();\n $this->assertNull($res, \"Should not be able to find a value\");\n\n $this->cache->save($item);\n $res = $item->get();\n $this->assertTrue(!is_null($res), \"Should have a value\");\n }",
"public function testCacheGet() \n\t{\n\t\t$key = uniqid('key_');\n\t\t$value = uniqid('value_');\n\t\t$this->assertFalse(\\Cache\\Cache::get($key));\n\n\t\t\\Cache\\Cache::set($key, $value);\n\t\t$this->assertEquals(\\Cache\\Cache::get($key), $value);\n\t}",
"public function testRefresh()\n\t{\n\t\t// Mock the Petri net.\n\t\t$mockedNet = $this->getMock('PNPetrinet', array('getTransitions'), array('test'));\n\n\t\t// Create 3 mocked transitions. 2 of them enabled.\n\t\t$transition1 = $this->getMock('PNTransition');\n\t\t$transition1->expects($this->once())\n\t\t\t->method('isEnabled')\n\t\t\t->will($this->returnValue(true));\n\n\t\t$transition2 = $this->getMock('PNTransition');\n\t\t$transition2->expects($this->once())\n\t\t\t->method('isEnabled')\n\t\t\t->will($this->returnValue(false));\n\n\t\t$transition3 = $this->getMock('PNTransition');\n\t\t$transition3->expects($this->once())\n\t\t\t->method('isEnabled')\n\t\t\t->will($this->returnValue(true));\n\n\t\t$mockedNet->expects($this->once())\n\t\t\t->method('getTransitions')\n\t\t\t->will($this->returnValue(array($transition1, $transition2, $transition3)));\n\n\t\t// Inject the Petri net.\n\t\tTestReflection::setValue($this->object, 'net', $mockedNet);\n\n\t\t$enabledTransitions = $this->object->refresh();\n\n\t\t// Check the $transition2 is not present because not enabled.\n\t\t$this->assertEquals($enabledTransitions[0], $transition1);\n\t\t$this->assertEquals($enabledTransitions[1], $transition3);\n\t}",
"public function updateCache();",
"public function checkCache()\n {\n $this->assertWritableDir($this->config->getPath('cache'));\n }",
"public function testPersistanceGet() {\n\t\t// the values are still retrievable.\n\t\t$this->assertEquals( 'remember', $this->cache->get( 'keep' ) );\n\t}",
"public function testCreateCachedObject() {\n\t\t// Load the config file\n\t\tCore\\Config::load('MyProject');\n\t\tCore\\Config::set('cache', 'enable', true, true);\n\n\t\t// Put the cache\n\t\tCore\\Cache::put('foo', 'bar');\n\n\t\t// The file exists?\n\t\t$this->assertTrue(Core\\Cache::has('foo'));\n\n\t\t// And the file has the correct contents?\n\t\t$this->assertEquals(Core\\Cache::get('foo'), 'bar');\n\t}",
"public function testGetCachedTimestamp()\n {\n // create dummy cache file for the following test\n file_put_contents('./cache/'.sha1($this->smarty->getTemplateDir(0) . 'helloworld.tpl').'.helloworld.tpl.php', '<?php ?>');\n $this->smarty->caching = true;\n $this->smarty->cache_lifetime = 1000;\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n $this->assertTrue(is_integer($tpl->cached->timestamp));\n $this->assertEquals(10, strlen($tpl->cached->timestamp));\n }",
"public function testCaching()\n {\n if (false == $this->fixture->cacheEnabled()) {\n $this->markTestSkipped('Skip tests of ARC2_Store caching, because cache is not enabled.');\n }\n\n // add test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n }');\n\n $selectQuery = 'SELECT * FROM <http://example.com/> {?s ?p ?o.}';\n\n // check that query is not known in cache\n $this->assertFalse($this->dbConfig['cache_instance']->has(\\hash('sha1', $selectQuery)));\n\n $result = $this->fixture->query($selectQuery);\n unset($result['query_time']);\n $this->assertEquals(1, \\count($result['result']['rows']));\n\n $this->assertTrue($this->dbConfig['cache_instance']->has(\\hash('sha1', $selectQuery)));\n\n // compare cached and raw result\n $cachedResult = $this->fixture->query($selectQuery);\n unset($cachedResult['query_time']);\n $this->assertEquals($result, $cachedResult);\n }",
"public function testCache()\n {\n $client = static::createClient();\n $client->request('GET', '/include.php?part=site');\n /** @var $response \\Symfony\\Component\\HttpFoundation\\Response */\n $response = $client->getResponse();\n $this->assertNotEmpty($response->headers->getCacheControlDirective('public'));\n $client = static::createClient(array('environment' => 'test2'));\n $client->request('GET', '/include.php?part=site');\n $response = $client->getResponse();\n $this->assertFalse($response->headers->hasCacheControlDirective('public'));\n }",
"public function cacheInvalidate() {\n }",
"public function testNothingModifiedLastRunSet()\n {\n $this->_cs->updateLastRun($this->_name);\n sleep(2);\n\n $check = $this->_cs->checkEntitiesChanged($this->_name, array(self::ENTITY_NAME));\n $this->assertFalse($check);\n }",
"function _cache_refresh ($name = \"\") {\n\t\t$this->_cache_put($name);\n\t}",
"public function testRefreshTokenExpired()\n {\n $oauthToken = $this->getOAuthToken(GoogleApiAuthenticationTest::EXPIRED_IN_SECONDS);\n $request = $this->getRequestWithSession(serialize($oauthToken));\n $this->mockTokenStorage($oauthToken);\n $this->mockGoogleResourceOwner();\n\n $tokenHasBeenUpdated = $this->googleApiAuthentication->refreshToken($request);\n\n $this->assertTrue($tokenHasBeenUpdated);\n }",
"public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}",
"function testCacheClearOnSave() {\n\t\t$_back = array(\n\t\t\t'check' => Configure::read('Cache.check'),\n\t\t\t'disable' => Configure::read('Cache.disable'),\n\t\t);\n\t\tConfigure::write('Cache.check', true);\n\t\tConfigure::write('Cache.disable', false);\n\n\t\t$this->loadFixtures('OverallFavorite');\n\t\t$OverallFavorite =& new OverallFavorite();\n\n\t\ttouch(CACHE . 'views' . DS . 'some_dir_overallfavorites_index.php');\n\t\ttouch(CACHE . 'views' . DS . 'some_dir_overall_favorites_index.php');\n\n\t\t$data = array(\n\t\t\t'OverallFavorite' => array(\n\t\t \t\t'model_type' => '8-track',\n\t\t\t\t'model_id' => '3',\n\t\t\t\t'priority' => '1'\n\t\t\t)\n\t\t);\n\t\t$OverallFavorite->create($data);\n\t\t$OverallFavorite->save();\n\n\t\t$this->assertFalse(file_exists(CACHE . 'views' . DS . 'some_dir_overallfavorites_index.php'));\n\t\t$this->assertFalse(file_exists(CACHE . 'views' . DS . 'some_dir_overall_favorites_index.php'));\n\n\t\tConfigure::write('Cache.check', $_back['check']);\n\t\tConfigure::write('Cache.disable', $_back['disable']);\n\t}",
"public function testWriteCachedContent()\n {\n $this->smarty->caching = true;\n $this->smarty->cache_lifetime = 1000;\n $this->smarty->clearAllCache();\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n $this->smarty->fetch($tpl);\n $this->assertTrue(file_exists($tpl->cached->filepath));\n }"
] |
[
"0.6918238",
"0.6492016",
"0.64271027",
"0.641367",
"0.63910687",
"0.6386036",
"0.6380317",
"0.6347586",
"0.62782156",
"0.624818",
"0.62419814",
"0.6184532",
"0.61770535",
"0.61762327",
"0.6120746",
"0.61012876",
"0.6074943",
"0.6074095",
"0.60236317",
"0.60104144",
"0.5989831",
"0.59821856",
"0.59789824",
"0.5970461",
"0.5966689",
"0.59466666",
"0.59422076",
"0.5936891",
"0.5914355",
"0.59133863"
] |
0.66095203
|
1
|
Lists all Translation models.
|
public function actionIndex()
{
$searchModel = new TranslationSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAllTranslationByLanguage();",
"public function all()\n {\n if (!$this->isLogged()) exit;\n $this->oUtil->getModel('Todo');\n $this->oModel = new \\TestProject\\Model\\Todo;\n\n $this->oUtil->oTodos = $this->oModel->getAll();\n\n $this->oUtil->getView('index');\n }",
"public function translationsAll()\n {\n return $this->hasMany($this->translatableModel, 'source_id');\n }",
"public function index()\n {\n $nameTranslations = NameTranslation::all();\n return view('admin.nameTranslations.list', compact('nameTranslations'));\n }",
"public function index()\n {\n $models = Collection::make($this->repository->getAll([], true));\n\n $this->layout->content = View::make('translations.admin.index')\n ->withModels($models);\n }",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}",
"public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function actionIndex()\n {\n $searchModel = new SearchTransInfo();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"protected function all()\n {\n $viewmodel = new TodoModel();\n $this->returnView($viewmodel->all(),true);\n }",
"public function index()\n\t{\n\t\t$translation=Translation::all();\n\t\treturn view('translation.index')->with('translation',$translation);\n\t}",
"public function actionIndex()\n {\n $searchModel = new SiteLangSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $this->updateAuthRecordsByController('index');\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public function index()\n {\n return $this->model->all();\n }",
"public function index()\n {\n return $this->model->getAll();\n }",
"public function index()\n {\n $trans = Trans::paginate(2);\n return view('trans.index',compact('trans'));\n }",
"public function index(){\n return $this->model->all();\n }",
"public function GetAll()\n {\n return $this->model->all();\n }",
"public function getModels();",
"public function getModels();",
"public function all()\n {\n return $this->model->get();\n }",
"public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}",
"public function findAll()\n {\n $query = $this->createQueryBuilder('a')\n ->getQuery()\n ;\n //prevent executing a query for every translated field\n $query->setHint(\n \\Doctrine\\ORM\\Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\\\Translatable\\\\Query\\\\TreeWalker\\\\TranslationWalker'\n );\n\n return $query->getResult();\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function getAll();",
"public function getAll();"
] |
[
"0.69217163",
"0.6458665",
"0.64199346",
"0.6289615",
"0.6281847",
"0.6244652",
"0.6226401",
"0.61709076",
"0.6156837",
"0.61156905",
"0.61128527",
"0.6043248",
"0.603396",
"0.60320675",
"0.60320675",
"0.60320675",
"0.6008351",
"0.6000441",
"0.5987006",
"0.5972911",
"0.5960012",
"0.5930232",
"0.5928316",
"0.5928316",
"0.59180254",
"0.5909619",
"0.5908907",
"0.5885666",
"0.5875944",
"0.5875944"
] |
0.7127692
|
0
|
Creates a new Translation model. If creation is successful, the browser will be redirected to the 'view' page.
|
public function actionCreate()
{
$modelTranslation = new Translation();
$modelForm = [new TranslationForm()];
$postData = Yii::$app->request->post();
if($modelTranslation->load(Yii::$app->request->post())){
// var_dump($postData);
// exit(0);
// var_dump($modelTranslation->estimate_id);
// exit(0);
$modelTranslationSave = [];
foreach (Yii::$app->request->post('TranslationForm') as $i => $post) {
$modelTranslationSave[$i] = new Translation();
$modelForm[$i] = new TranslationForm();
}
if (Model::loadMultiple($modelForm, Yii::$app->request->post()) && Model::validateMultiple($modelForm)) {
$this->saveFormToTranslation($modelForm,$modelTranslationSave,$modelTranslation->estimate_id);
return $this->redirect(['view', 'id' => $modelTranslationSave[0]->id]);
}
else{
/*handle error forms*/
}
}
else {
return $this->render('create', [
'model' => $modelTranslation,
'modelForm' => $modelForm,
]);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function actionCreate()\n {\n $model = new SiteLang();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->code]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n $model = new TabelleRelease();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n\n return $this->redirect(['update', 'id' => $model->id, 'mySuccess' => 2]);\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new Deliveries();\r\n\r\n $model_msg = new SourceLangMessage();\r\n $langs = Languages::find()->where(['is', 'is_default', NULL])->andWhere(['active' => 1])->all();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n $this->save_translate($model, $model_msg);\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'model_msg' => $model_msg,\r\n 'langs' => $langs\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new SourceMessage();\n\n if ($model->load(Yii::$app->request->post())) {\n\n\n\n\n $model->save();\n\n foreach ($_POST['language'] as $key => $value) {\n\n $message = new Message();\n $message->id = $model->id;\n $message->language = $key;\n $message->translation = $value;\n $message->save(false);\n }\n return $this->redirect(['index', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new EnglishNanorep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Template();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n\t{\n\t\treturn view('translation.form');\n\t}",
"public function actionCreate()\n {\n $model = new TaKegiatan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Prog' => $model->Kd_Prog, 'Kd_Keg' => $model->Kd_Keg, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function store()\n\t{\n\n\t\t$input = Input::all();\n\t\t$v = Validator::make($input, Translation::$rules);\n\t\tif ($v->passes()) {\n\t\t\t$translation = new Translation();\n\t\t\t$translation->label = $_POST['label'];\n\t\t\t$translation->description = $_POST['description'];\n\t\t\t$translation->de = $_POST['de'];\n\t\t\t$translation->en = $_POST['en'];\n\t\t\t$translation->fr = $_POST['fr'];\n\t\t\tif ($translation->save()) {\n\n\t\t\t\treturn Redirect::route('translation_add')->with('success', 'The translation Created successfully');\n\t\t\t}\n\t\t}\n\t\telse {\n\n\t\t\treturn Redirect::route(\"translation_add\")->with('error', 'The translations already exists!!!');\n\t\t}\n\t}",
"public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }",
"public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Actividad();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}",
"public function actionCreate()\n\t{\n\t\t$this->layout='//layouts/column1';\n\t\t$model=\tnew Article();\n\t\t$model->public_time = time();\n\t\t$model->author_name = Yii::app()->user->data()->username;\n\t\t\n\t\tif(isset($_POST['Article']))\n\t\t{\n\t\t\t$model->attributes = $_POST['Article'];\n\t\t\t$model->tmp_sections = isset($_POST['Article']['sections']) ? $_POST['Article']['sections'] : array();\n\t\t\t$model->tmp_categories = isset($_POST['Article']['categories']) ? $_POST['Article']['categories'] : array();\n\t\t\t$model->created = time();\n\t\t\t$model->last_modify = time();\n\t\t\t$model->creator = Yii::app()->user->getId();\n\t\t\t$model->public_time = strtotime($_POST['Article']['public_time']); \n \t$model->setTags($_POST['tags']);\n\t\t\t$model->validate();\n\t\t\tif($model->save()){\n\t\t\t\t/**\n\t\t\t\t * save traslate default\n\t\t\t\t */\n\t\t\t\t$languageDefault = Language::model()->find(\"is_default = 1\");\n\t\t\t\t$articleTrans = ArticleTranslation::model()->findByAttributes(array('article_id'=>$model->id, 'language_code'=>$languageDefault->code));\n\t\t\t\tif(empty($articleTrans)){\n\t\t\t\t\t$articleTrans = new ArticleTranslation();\n\t\t\t\t}\n\t\t\t\t$articleTrans->article_id = $model->id;\n\t\t\t\t$articleTrans->language_code = $languageDefault->code;\n\t\t\t\t$articleTrans->attributes = $model->attributes;\n\t\t\t\t$articleTrans->validate();\n\t\t\t\tif(!$articleTrans->hasErrors()){\n\t\t\t\t\t$articleTrans->save();\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * save traslate\n\t\t\t\t */\n\t\t\t\tif(isset($_POST['ArticleTranslation']))\n\t\t\t\t{\n\t\t\t\t\tforeach ($_POST['ArticleTranslation'] as $lang => $article){\n\t\t\t\t\t\t$articleTrans = ArticleTranslation::model()->findByAttributes(array('article_id'=>$model->id, 'language_code'=>$lang));\n\t\t\t\t\t\tif(empty($articleTrans)){\n\t\t\t\t\t\t\t$articleTrans = new ArticleTranslation();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$articleTrans->article_id = $model->id;\n\t\t\t\t\t\t$articleTrans->language_code = $lang;\n\t\t\t\t\t\t$articleTrans->attributes = $article;\n\t\t\t\t\t\t$articleTrans->validate();\n\t\t\t\t\t\tif(!$articleTrans->hasErrors()){\n\t\t\t\t\t\t\t$articleTrans->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new TfLunas();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_tf_lunas]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"function create()\n {\n \treturn view('transaksi.create');\n }",
"public function actionCreate()\n {\n $model = new Produksi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Purchase();\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', AppConstants::MESSAGE_SAVE_SUCCESS);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n $trans = Trans::all();\n return view('trans.create',compact('trans'));\n }",
"public function actionCreate() {\n $model = new TabellePlattform();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n// $this->success = 2; // 2->insert erfolgreich\n \n// $model = $this->findModel($model->id);\n// $model->setIsNewRecord(false);\n \n return $this->redirect(['update','id'=>$model->id,'mySuccess' => 2]);\n// return $this->render('update', [\n// 'model' => $model,\n// ]);\n// $this->redirect(\\Yii::$app->urlManager->createUrl(\"test/show\"));\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Uprawnienia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'konto_id' => $model->konto_id, 'podkategoria_id' => $model->podkategoria_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Message();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save())\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Tournament();\n\n if ($model->load(Yii::$app->request->post()) && $model->createNewTournament()) {\n\n return $this->redirect(['view', 'id' => $model->id_t]);\n }\n\n return $this->render('create', [\n 'model' => $model\n ]);\n }",
"public function create()\n\t{\n\t \n\t \n\t return view('admin.language.create');\n\t}",
"public function actionCreate()\r\n {\r\n $model = new Tax;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'added' => 'yes']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n $data['record'] \t = FALSE;\n \t$data['active_class'] = 'languages';\n $data['title'] = LanguageHelper::getPhrase('add_language');\n $data['layout'] = 'layouts.admin.adminlayout';\n $data['module_helper'] = false;\n $data['admin'] = $this->admin;\n $data['breadcumbs'] = $this->breadcumbs;\n return view('lmanager::languages.add-edit', $data);\n }",
"public function actionCreate()\n {\n $model = new HasilKonsultasi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_hasil_konsultasi]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }"
] |
[
"0.72838825",
"0.7103566",
"0.7078396",
"0.69854474",
"0.6955206",
"0.6947849",
"0.68317866",
"0.67851686",
"0.6779535",
"0.67777663",
"0.67545015",
"0.6725318",
"0.6706785",
"0.6706722",
"0.66982156",
"0.66455597",
"0.6644263",
"0.6637502",
"0.6600439",
"0.6593564",
"0.6592815",
"0.6591852",
"0.6589984",
"0.65832615",
"0.65765226",
"0.6573898",
"0.657389",
"0.6566563",
"0.656391",
"0.6563395"
] |
0.768136
|
0
|
Finds the Translation model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
|
protected function findModel($id)
{
if (($model = Translation::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function findModel($id)\n {\n if (($model = SiteLang::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"public function findTranslation($id = null)\n {\n $translation = $this->getTranslationModel();\n return $id?$translation::findOne($id):$translation;\n }",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = TransInfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}",
"protected function findModel($id)\n {\n if (($model = EnglishKb::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"protected function findModel($id)\n {\n if (($model = Transaksi::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = SourceMessage::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Module::t('The requested page does not exist.'));\n }\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=MasterTransaksi::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public abstract function find($primary_key, $model);",
"protected function findModel($id) {\n if (($model = TabelleRelease::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Subject::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('Запрашиваемая страница не найдена!');\n }\n }",
"public function loadModel($id) {\n $model = Task::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('app', 'Http.404'));\n return $model;\n }",
"protected function findModel($id)\n {\n if (($model = Template::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = SubAkun::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}",
"protected function findModel($id)\n {\n if (($model = SourceMessage::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = EnglishNanorep::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }",
"protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `ID`, `LOCALE`, `CONTENT`, `FILE_ID`, `KEY_ID`, `CREATED_AT`, `UPDATED_AT` FROM `translation_content` WHERE `ID` = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new TranslationContent();\n $obj->hydrate($row);\n TranslationContentPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }",
"protected function findModel($id)\n {\n if (($model = Items::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('Запрашиваемая страница не существует!!!');\n }\n }",
"protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}",
"public function returnFindByPK($id);",
"protected function findModel($id)\n {\n if (($model = TinTuc::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Transaction::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}"
] |
[
"0.6525654",
"0.65245676",
"0.64824724",
"0.62532085",
"0.6221152",
"0.6210304",
"0.6202681",
"0.61950564",
"0.61713636",
"0.6145507",
"0.6123291",
"0.608246",
"0.6076774",
"0.60763246",
"0.60386664",
"0.60299957",
"0.6025671",
"0.6023787",
"0.6016291",
"0.5995148",
"0.59847075",
"0.59794736",
"0.59464234",
"0.5943407",
"0.5927667",
"0.5926969",
"0.59150726",
"0.59068745",
"0.59048164",
"0.5893641"
] |
0.7032146
|
0
|
Add to Allowed Blocks
|
public function addBlockToAllowedBlocks($theme_path, $blockName)
{
$allowed_blocks_filepath = $theme_path.'admin/SetAllowedBlocks.php';
$allowed_blocks_contents = file_get_contents($allowed_blocks_filepath);
$pattern = "/acf\/$blockName/";
$result = preg_match($pattern, $allowed_blocks_contents);
if ($result) {
//If already exists abort
\WP_CLI::error('Block already added to AllowedBlocks');
return false;
}
$pattern = "/public \$allowedBlocks = \[[.\w\W]*(\];)/gmU";
$replace = " '\\App\\ACF_Blocks\\".$blockClassName."',";
$replace .= "\n ];";
$block_service_provider_file_contents = preg_replace("/];/", $replace, $block_service_provider_file_contents);
$result = file_put_contents($block_service_provider_path, $block_service_provider_file_contents);
\WP_CLI::line('Block registration class referenced created in BlockServiceProvider');
$result = preg_match($pattern, $allowed_blocks_contents);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function register_blocks() {\n\t\t}",
"function AllowGutenbergBlocks(){\n $AllowedBlocks = array_merge($this->WPgutenberg_AllowedBlocks, $this->WPgutenberg_CustomAllowedBlocks);\n return $AllowedBlocks;\n }",
"public function registerBlocks(): void\n\t{\n\t\tforeach (Components::getBlocks() as $block) {\n\t\t\t$this->registerBlock($block);\n\t\t}\n\t}",
"function fuxt_block_whitelist() {\n\treturn array(\n\t\t'core/paragraph',\n\t\t'core/image',\n\t\t'core/heading',\n\t\t'core/gallery',\n\t\t'core/list',\n\t\t'core/quote',\n\t\t'core/columns',\n\t\t'core/column',\n\t\t'core/embed',\n\t);\n}",
"public function apply_block_supports()\n {\n }",
"public function register_blocks() {\n\t\tif ( function_exists( 'register_block_type' ) ) {\n\t\t\tregister_block_type(\n\t\t\t\t\"civil/{$this->slug}\",\n\t\t\t\t[\n\t\t\t\t\t'editor_script' => 'block-js-' . $this->slug,\n\t\t\t\t\t'render_callback' => function( array $attributes ) {\n\t\t\t\t\t\treturn $this->render_block_data( $attributes );\n\t\t\t\t\t},\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'title' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Title', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Description', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_button_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Button', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter' => [\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter_list' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\treturn $this;\n\t}",
"function wp_pre_kses_block_attributes($content, $allowed_html, $allowed_protocols)\n {\n }",
"public function register_cpt_blocks() {\n /* Include CPT creation file */\n //include_once( ILIO_BLOCKS_INCLUDES_DIR . '/blockss.post-type.php' );\n }",
"public function add_static_block(){\r\n\t\tif($this->has_admin_panel()) return $this->module_add_static_block();\r\n return $this->module_no_permission();\r\n\t}",
"public function register_blocks() {\n\n\t\t// Return early if this function does not exist.\n\t\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Shortcut for the slug.\n\t\t$slug = $this->_slug;\n\n\t\tregister_block_type(\n\t\t\t$slug . '/accordion',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/alert',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/author',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/click-to-tweet',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/dynamic-separator',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gif',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gist',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/highlight',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-carousel',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-masonry',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-stacked',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t}",
"function _register_core_block_patterns_and_categories()\n {\n }",
"function addBlock($name, $cached = false, $cachetime = 0)\n {\n //if ( $this->activated ) $this->blocks[] = array('name' => $name, 'cached' => $cached, 'cachetime' => $cachetime);\n }",
"function theme_allowed_block_types($allowed_blocks, $post) {\n\n // if(get_page_template_slug( $post ) === 'template-name.php') {\n // return array();\n // }\n\n return array(\n 'acf/xxx',\n 'acf/home-hero',\n 'acf/text-image-right',\n 'acf/image-left-text', \n 'acf/prospectives-listen',\n 'acf/perspectives-read',\n 'acf/perspectives-learn', \n 'acf/perspectives-generic', \n );\n}",
"function register_blocks() {\t\n\n // Fail if block editor is not supported\n\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\treturn;\n\t}\n\n // List all of the blocks for your plugin\n $blocks = [\n \"antaresplugin/gallery\",\n ];\n\n // Register each block with same CSS and JS\n foreach( $blocks as $block ) {\n if( \"antaresplugin/gallery\" === $block ) { \n register_block_type( $block, [\n 'editor_script' => 'antares-plugin-editor-js',\n 'editor_style' => 'antares-plugin-editor-css',\n 'style' => 'antares-plugin-css',\n 'attributes' => [ \n 'images' => [\n 'type' => \"array\",\n 'default' => []\n ],\n 'direction' => [\n 'type'=> \"string\",\n 'default' => \"row\"\n ],\n 'isLightboxEnabled' => [\n 'type' => \"boolean\",\n 'default' => true\n ]\n ]\n ] );\t \n }\n else { \n register_block_type( $block, [\n 'editor_script' => 'antares-plugin-editor-js',\n 'editor_style' => 'antares-plugin-editor-css',\n 'style' => 'antares-plugin-css'\n ] );\t \n }\n }\n\n}",
"function EventReg_listblock_init()\n{\n // Security\n pnSecAddSchema('EventReg:Listblock:', 'Block title:Block Id:Type Id');\n}",
"public function register_hooks() {\n\t\tadd_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );\n\t\tadd_filter( 'block_categories', array( $this, 'add_block_category' ) );\n\n\t\t$block_integrations = array(\n\t\t\tnew WPSEO_How_To_Block(),\n\t\t\tnew WPSEO_FAQ_Block(),\n\t\t);\n\n\t\tforeach ( $block_integrations as $block_integration ) {\n\t\t\t$block_integration->register_hooks();\n\t\t}\n\t}",
"private function loadBlockSettings() {\n\t\t$this->block['limited_categories'] = get_sub_field($this->current . '_category_filter');\n\n\t\t$this->block['limited_categories_term_string'] = [];\n\t\t$category_filters = get_sub_field($this->current . '_category_filter');\n\t\tif(!empty($category_filters)):\n\t\t\tforeach($category_filters as $filter_cat):\n\t\t\t\t$this->block['limited_categories_term_string'][] = $filter_cat->slug;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\t$this->block['block_title'] = get_sub_field($this->current . '_title_title');\n\n\t\tif($this->layout == 'key_areas')\n\t\t\t$this->block['sections'] = get_sub_field($this->current . '_keyarea');\n\n\t\tif($this->layout == 'jobs_aside')\n\t\t\t$this->block['sections'] = get_sub_field($this->current . '_sections');\n\n\t}",
"function before_block( $instance ) {\n\t\t}",
"function register_block_core_pattern()\n {\n }",
"public function register ()\n {\n\n add_action( 'enqueue_block_editor_assets', array ( $this , 'mtk_enqueueBlockEditorFiles' ) );\n add_action( 'enqueue_block_assets ', array ( $this , 'mtk_enqueueBlockFiles' ) );\n $this->registerBlock();\n }",
"public function registerBlock()\n {\n register_block_type( 'mtk-plugin/cptshortcode' , array (\n 'editor_script' => 'mtk_cptshortcode_editor',\n 'editor_style' => 'mtk_cptshortcode_editor',\n 'style' => 'mtk_cptshortcode',\n ) );\n\n }",
"private function enableBlocks()\n {\n // Check dates\n if ($this->getActionDate('statusstaticblocksmanager/statusstaticblocksmanager_group/enablestartdate', 'statusstaticblocksmanager/statusstaticblocksmanager_group/enablestarttime')) {\n\n //Mage::log('Enabling blocks', null, 'wapone.log');\n\n //Blocks list to enable\n $blocks_to_enable = $this->getBlocks('statusstaticblocksmanager/statusstaticblocksmanager_group/blockstoenable');\n\n if (count($blocks_to_enable) > 0) {\n for ($row = 0; $row < count($blocks_to_enable); $row++) {\n //Mage::log('Block to enable:'.$blocks_to_enable[$row], null, 'wapone.log');\n Mage::getModel('cms/block')->load($blocks_to_enable[$row])\n ->setData('is_active', self::ACTIVE)\n ->save();\n }\n /*** If you are using Letsi FPC module uncomment line below ***/\n //Mage::getSingleton('fpc/fpc')->clean();\n /*** In any case, you have to flush the cache, if you're using one ***/\n\n Mage::getConfig()->saveConfig('statusstaticblocksmanager/statusstaticblocksmanager_group/module_enabling_status', '0', 'default', 0);\n }\n }\n }",
"public function actionAdd()\n {\n $userId = Yii::$app->user->identity->getId();\n\n $blockedNodeId = Yii::$app->request->post('blocked_node');\n\n\n if(Blacklist::add($userId, $blockedNodeId)){\n return [\n 'status' => 'success',\n 'access_token' => Yii::$app->user->identity->getAuthKey()\n ];\n } else {\n return [\n 'status' => 'fail',\n 'error' => 'No such node',\n 'access_token' => Yii::$app->user->identity->getAuthKey()\n ];\n }\n\n\n }",
"function register_block_core_block()\n {\n }",
"public static function addToBlockedList(array $list=[])\n\t{\n\t\tDirectory::$blockedList = $list;\n\t}",
"protected function register_blocks() {\n\n\t\t\\register_block_type(\n\t\t\t'tcc/column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-1-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-2-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-3-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-4-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t}",
"static function add_ip_to_block_list($ip_address, $reason='')\r\n {\r\n global $wpdb, $aio_wp_security;\r\n //Check if this IP address is already in the block list\r\n $blocked = AIOWPSecurity_Blocking::is_ip_blocked($ip_address);\r\n $time_now = date_i18n( 'Y-m-d H:i:s' );\r\n if(empty($blocked)){\r\n //Add this IP to the blocked table\r\n $data = array(\r\n 'blocked_ip'=>$ip_address,\r\n 'block_reason'=>$reason,\r\n 'blocked_date'=>$time_now\r\n );\r\n $data = apply_filters('pre_add_to_permanent_block', $data);\r\n $res = $wpdb->insert(AIOWPSEC_TBL_PERM_BLOCK, $data);\r\n if($res === false){\r\n $aio_wp_security->debug_logger->log_debug(\"AIOWPSecurity_Blocking::add_ip_to_block_list - Error inserting record into AIOWPSEC_TBL_PERM_BLOCK table for IP \".$ip_address);\r\n return false;\r\n }\r\n return true;\r\n }\r\n return true;\r\n }",
"function iqor_blocks_register_block_type($block, $options = array()) {\n register_block_type(\n 'iqor-blocks/' . $block,\n array_merge(\n array(\n 'editor_script' => 'iqor-blocks-editor-script',\n 'editor_style' => 'iqor-blocks-editor-style',\n 'script' => 'iqor-blocks-script',\n 'style' => 'iqor-blocks-style'\n ),\n $options\n )\n );\n\n}",
"public function loadBlockDefinitions(){\n\t\tforeach($this->sections as $section){\n\t\t\tforeach( $section['allowedBlocks'] as $block_id ) {\n\t\t\t\t$path = Block::locateDefinition( $block_id);\n\n\t\t\t\tif (!is_null($path)) {\n\t\t\t\t\t$block = Block::fromDefinitionFile($path);\n\t\t\t\t\t$this->blockDefinitions->push($block);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function myblocks() {\n $this->name=\"myblocks\";\n $this->title=\"<#LANG_MODULE_MYBLOCKS#>\";\n $this->module_category=\"<#LANG_SECTION_SETTINGS#>\";\n $this->checkInstalled();\n}"
] |
[
"0.6769448",
"0.6402526",
"0.6114749",
"0.60333544",
"0.60260975",
"0.58825904",
"0.5827898",
"0.5787213",
"0.5744731",
"0.5695982",
"0.56912905",
"0.5650539",
"0.5644458",
"0.5635",
"0.561351",
"0.5597599",
"0.55889255",
"0.55878174",
"0.5574107",
"0.55210906",
"0.55121887",
"0.5499786",
"0.5498785",
"0.5488315",
"0.5486069",
"0.5484466",
"0.5482776",
"0.5475108",
"0.5474214",
"0.5441764"
] |
0.65610474
|
1
|
Hook into any filters specific to this provider (optional) NOTE: This is only necessary if you are modifying the default values of parameters used throughout the OAuth process
|
function filters(){
add_filter( 'oauth_authorization_parameters', array( $this, 'authorization_parameters'), 1, 1 );
// add_filter( 'oauth_token_parameters', array( $this, 'token_parameters'), 1, 1 );
add_filter( 'oauth_token_response', array( $this, 'token_response'), 1, 1 );
// add_filter( 'oauth_identity_parameters', array( $this, 'identity_parameters'), 1, 1 );
add_filter( 'oauth_identity_response', array( $this, 'identity_response'), 1, 1 );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function filterParams()\n {\n }",
"private function setFilter()\n\t{\n\t\t// get filter values\n\t\t$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();\n\t\t$this->filter['application'] = $this->getParameter('application');\n\t\t$this->filter['module'] = $this->getParameter('module');\n\t\t$this->filter['type'] = $this->getParameter('type', 'array');\n\t\t$this->filter['name'] = $this->getParameter('name');\n\t\t$this->filter['value'] = $this->getParameter('value');\n\n\t\t// build query for filter\n\t\t$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);\n\t}",
"public function registerFilters() {\n//\t $this->addFilter('get_avatar', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterGetLinkedInAvatar'], 10, 3);\n\t $this->addFilter('CommentModel.created', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterMarkCommentWithLinkedInUserId']);\n\t $this->addFilter('pre_comment_approved', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterApproveLinkedInUserComment'], 10, 2);\n\t\t/* chayka: registerFilters */\n }",
"public function registerFilterBindings()\n {\n $this->app->bind('LucaDegasperi\\OAuth2Server\\Filters\\OAuthFilter', function ($app) {\n $httpHeadersOnly = $app['config']->get('oauth2-server-laravel::oauth2.http_headers_only');\n\n return new OAuthFilter($httpHeadersOnly);\n });\n }",
"protected function setParamsFilters()\n {\n if ($this->arParams['IBLOCK_TYPE'])\n {\n $this->filterParams['IBLOCK_TYPE'] = $this->arParams['IBLOCK_TYPE'];\n }\n\n if ($this->arParams['IBLOCK_ID'])\n {\n $this->filterParams['IBLOCK_ID'] = $this->arParams['IBLOCK_ID'];\n }\n\n if ($this->arParams['SECTION_CODE'])\n {\n $this->filterParams['SECTION_CODE'] = $this->arParams['SECTION_CODE'];\n }\n elseif ($this->arParams['SECTION_ID'])\n {\n $this->filterParams['SECTION_ID'] = $this->arParams['SECTION_ID'];\n }\n\n if ($this->arParams['INCLUDE_SUBSECTIONS'] === 'Y')\n {\n $this->filterParams['INCLUDE_SUBSECTIONS'] = 'Y';\n }\n\n if ($this->arParams['ELEMENT_CODE'])\n {\n $this->filterParams['CODE'] = $this->arParams['ELEMENT_CODE'];\n }\n elseif ($this->arParams['ELEMENT_ID'])\n {\n $this->filterParams['ID'] = $this->arParams['ELEMENT_ID'];\n }\n\n if ($this->arParams['CHECK_PERMISSIONS'])\n {\n $this->filterParams['CHECK_PERMISSIONS'] = $this->arParams['CHECK_PERMISSIONS'];\n }\n\n if (!isset($this->filterParams['ACTIVE']))\n {\n $this->filterParams['ACTIVE'] = 'Y';\n }\n\n if (strlen($this->arParams['EX_FILTER_NAME']) > 0\n && preg_match(\"/^[A-Za-z_][A-Za-z01-9_]*$/\", $this->arParams['EX_FILTER_NAME'])\n && is_array($GLOBALS[$this->arParams['EX_FILTER_NAME']])\n )\n {\n $this->filterParams = array_merge_recursive($this->filterParams, $GLOBALS[$this->arParams['EX_FILTER_NAME']]);\n\n $this->addCacheAdditionalId($GLOBALS[$this->arParams['EX_FILTER_NAME']]);\n }\n }",
"protected function setup_filters()\n\t{\n\t\t$this->orderby = ( !empty($_GET['orderby']) ? $_GET['orderby'] : 'timestamp' );\n\t\t$order = ( !empty($_GET['order']) ? $_GET['order'] : 'asc' );\n\t\t\n\t\tswitch( $order )\n\t\t{\n\t\t\tcase 'asc': case 'desc': break;\n\t\t\tdefault: $order = null; break;\n\t\t}\n\n\t\tswitch( $this->orderby )\n\t\t{\n\t\t\tcase 'timestamp':\n\t\t\t\tif( !$order ) $order = 'asc';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->orderby = 'timestamp';\n\t\t\t\tif( !$order ) $order = 'asc';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\n\t\tif( !isset($_GET) ) $_GET = array();\n\t\t$_GET['orderby'] = $this->orderby;\n\t\t$_GET['order'] = $order;\n\t\t\n\t\t$this->orderby .= ' '.$order;\n\t}",
"public function register_filters() {\n\n\t\t}",
"public function addFilters()\n {\n }",
"public function getDefaultFilterParameters(): array;",
"private function setFilter()\n {\n $this->filter['value'] = $this->getParameter('value') == null ? '' : $this->getParameter('value');\n }",
"protected function applyDefaultFiltering()\n\t{\n\t\tif (empty($this->filters) && !empty($this->defaultFilters)) {\n\t\t\t$this->filters = $this->defaultFilters;\n\t\t}\n\t}",
"protected function setup_filters() {\n\t\tadd_filter( 'cron_schedules', array( $this, 'cron_schedules' ) );\n\t\tadd_filter('blmd_social_classes_button', function($classes, $network=null) {\n\t\t\tif ($network == 'twitter') { $classes .= ' native'; }\n\t\t\treturn $classes;\n\t\t}, 10, 2);\n\t}",
"public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}",
"function add_filters()\n {\n }",
"private function setup_filters() {\n\n\t\tadd_filter( 'pre_option_posts_per_page', array( $this, 'filter_posts_per_page' ) );\n\n\t\tadd_filter( 'plugins_url', array( $this, 'filter_plugins_url' ) );\n\n\t}",
"abstract public function prepareFilters();",
"private function filters() {\n\n\n\t}",
"public function attachDefaultFilters() {\n\n /**\n * It's possible to extend what filters the content is subjected to.\n * By default, this is a URL filter, and a PATH filter. Other filters\n * can be implemented and attached if other conversions are also required.\n */\n $this->attachFilter('URL', 'TigerfishDTLReplaceHrefAndSrc');\n $this->filters['URL']->from($this->fromValue);\n $this->filters['URL']->to($this->toValue);\n $this->filters['URL']->relative($this->relative);\n $this->filters['URL']->https($this->https);\n $this->filters['URL']->debugMode($this->debug);\n\n $this->attachFilter('PATH', 'TigerfishDTLReplacePaths');\n $this->filters['PATH']->from($this->fromValue);\n $this->filters['PATH']->to($this->toValue);\n $this->filters['PATH']->relative($this->relative);\n $this->filters['PATH']->https($this->https);\n $this->filters['PATH']->debugMode($this->debug);\n\n }",
"public function apply_filters_in_request() {\n\n\t\t\t$args = jet_smart_filters()->query->get_query_args();\n\n\t\t\tif ( ! $args ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'jet-engine/listing/grid/posts-query-args', array( $this, 'add_query_args' ), 10, 2 );\n\n\t\t}",
"function apply_filters( $name ) {\n\n\t\t$args = func_get_args();\n\t\tarray_unshift( $args, 'filter' );\n\n\t\treturn call_user_func_array( array( $this, 'api'), $args );\n\t}",
"public function setupFilterRules()\n { }",
"function beforeFilter() {\n }",
"public function addFilterParams($name)\n {\n if ($this->getRequestParameter($name))\n {\n foreach ($this->params as &$params)\n {\n $params[$name] = $this->getRequestParameter($name);\n }\n }\n \n // set an array for building a link to this filter (we don't want it to already have the filter in there)\n $this->params[$name] = $this->params['pagination'];\n unset($this->params[$name][$name]);\n }",
"function beforeFilter() {\r\n $this->Auth->mapActions(\r\n array(\r\n 'create' => array('index', 'save_api', 'setGeneralOption'),\r\n )\r\n );\r\n parent::beforeFilter();\r\n }",
"protected function registerFilterChain()\n\t{\n\t\t//filters\n\t\t$this->filters['deserial'] = 'deserializationFilter';\n\t\t$this->filters['batch'] = 'batchProcessFilter';\n\t\t$this->filters['serialize'] = 'serializationFilter';\n\t}",
"public function register_filters() {\n\t\tadd_filter( 'json_endpoints', array( $this, 'register_routes' ) );\n\t\tadd_filter( 'json_post_type_data', array( $this, 'type_archive_link' ), 10, 2 );\n\t}",
"protected function setDefaultParameters() {\n // Vendor token of the business that done the request.\n $this->setParameter('vendor_token', $this->getLydiaVendorToken()) ;\n\n // UUID of the remote payment request.\n $this->setParameter('request_uuid', $this->requestUUID) ;\n }",
"public function setFilter($filter){ }",
"public function onKernelRequest(): void\n {\n $user = $this->em->getRepository(User::class)->findOneBy(['username' => 'jane.doe']);\n $filter = $this->em->getFilters()->enable('user_filter');\n $filter->setParameter('id', $user->getId());\n }",
"public function getFilterParameters(): array;"
] |
[
"0.6806034",
"0.66748375",
"0.6660204",
"0.6493581",
"0.6409542",
"0.6367624",
"0.63666517",
"0.6336618",
"0.6278512",
"0.6229136",
"0.61479896",
"0.6129562",
"0.6121858",
"0.60543346",
"0.6048319",
"0.6001944",
"0.5987084",
"0.59701437",
"0.59506077",
"0.59416765",
"0.5941272",
"0.5939155",
"0.59374714",
"0.5931271",
"0.5922943",
"0.58867073",
"0.58623505",
"0.5839275",
"0.5831375",
"0.58167696"
] |
0.7995475
|
0
|
Modify/extend the token response parameters
|
public function token_response($params){
$params['refresh_token'] = 'refresh_token';
$params['issued_at'] = 'issued_at';
$params['signature'] = 'signature';
$params['scope'] = 'scope';
$params['id_token'] = 'id_token';
$params['instance_url'] = 'instance_url';
$params['id'] = 'id';
$params['error_description'] = 'error_description';
return $params;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function prepareResponse(Request $request, Context $context, EditToken $token)\n {\n }",
"public function consume_token($params, $response){\n $this->set_field('refresh_token', $response[ $params['refresh_token'] ]);\n $this->set_field('issues_at', date(\"m/d/Y H:i:s\", time( $response[ $params['issued_at'] ]) ));\n\n \t\t# Used for gateway to Force.com's Identity Service\n \t\t$this->identity_url = $response[ $params['id'] ];\n \t\t\n \t\t$this->set_field('instance_url', $response[ $params['instance_url'] ]);\n \t\t$this->set_field('scope', $response[ $params['scope'] ]);\n \t\t\n \t}",
"protected function setParametersFromToken()\n {\n if (count($this->token->attributes) > 0) {\n foreach ($this->token->attributes as $key => $value) {\n $this->controller['parameters']->$key = $value;\n }\n }\n\n $this->controller['parameters']->token = $this->token;\n\n return $this;\n }",
"protected function prepareToken()\n {\n if ($this->tokenFlag && $this->tokenUseFlag) {\n $this->options['Action'] = 'ListFinancialEventsByNextToken';\n unset($this->options['MaxResultsPerPage']);\n $this->resetFilters();\n } else {\n $this->options['Action'] = 'ListFinancialEvents';\n unset($this->options['NextToken']);\n $this->list = [];\n }\n }",
"public function extend(){\n $url = self::$_graph_url.'oauth/access_token';\n $postVars = array(\n 'client_id' => $this->_FBApp->key,\n 'client_secret' => $this->_FBApp->secret,\n 'grant_type' => 'fb_exchange_token',\n 'fb_exchange_token' => $this->token\n );\n $requestUrl = $url .\"?\". http_build_query($postVars);\n $this->setUrl($requestUrl);\n $this->setCustomRequest('GET');\n $this->query();\n $response = $this->getResponse();\n return $response;\n }",
"protected function prepareToken()\n {\n include $this->env;\n if ($this->tokenFlag && $this->tokenUseFlag) {\n $this->options['Action'] = 'GetReportRequestListByNextToken';\n if (isset($THROTTLE_LIMIT_REPORTTOKEN)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTTOKEN;\n }\n if (isset($THROTTLE_TIME_REPORTTOKEN)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTTOKEN;\n }\n $this->throttleGroup = 'GetReportRequestListByNextToken';\n $this->resetRequestIds();\n $this->resetReportTypes();\n $this->resetReportStatuses();\n unset($this->options['MaxCount']);\n unset($this->options['RequestedFromDate']);\n unset($this->options['RequestedToDate']);\n } else {\n $this->options['Action'] = 'GetReportRequestList';\n if (isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST;\n }\n if (isset($THROTTLE_TIME_REPORTREQUESTLIST)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST;\n }\n $this->throttleGroup = 'GetReportRequestList';\n unset($this->options['NextToken']);\n $this->reportList = [];\n $this->index = 0;\n }\n }",
"public function setToken($token);",
"abstract public function setNextAuthToken($token);",
"public function tokenFromResponse($response){\n parse_str($response);\n $this->token = $access_token;\n }",
"public function setAccessParams ($response)\n {\n if ((isset($response['token_type'])) && (isset($response['access_token']))) {\n $this->token_type = $response['token_type'];\n $this->access_token = $response['access_token'];\n } else {\n throw new Exception('The identification was incorrect, check clientId and clientSecret');\n }\n \n if ((isset($response['expires_in'])) && (isset($response['scope']))) {\n $this->expires_in = $response['expires_in'];\n $this->scope = $response['scope'];\n }\n }",
"protected function additionalProtocolParameters()\n {\n return array('oauth_verifier');\n }",
"public function setToken($token, $token_secret) {}",
"public function getOtherAuthorizationRequestParams() {\n }",
"function build_token_meta( $token ) {\n\t\t$this->set_token(\n\t\t\tnew Keyring_Access_Token(\n\t\t\t\t$this->get_name(),\n\t\t\t\tnew OAuthToken(\n\t\t\t\t\t$token['oauth_token'],\n\t\t\t\t\t$token['oauth_token_secret']\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$response = $this->request( $this->verify_url, array( 'method' => $this->verify_method ) );\n\t\tif ( Keyring_Util::is_error( $response ) ) {\n\t\t\t$meta = array();\n\t\t} else {\n\t\t\t$meta = array(\n\t\t\t\t'user_id' => $response->Profile->{'@attributes'}->ref,\n\t\t\t\t'username' => $response->Profile->screen_name,\n\t\t\t\t'name' => $response->Profile->public_display_name,\n\t\t\t\t'picture' => $response->Profile->photo_url,\n\t\t\t);\n\t\t}\n\n\t\treturn apply_filters( 'keyring_access_token_meta', $meta, $this->get_name(), $token, $response, $this );\n\t}",
"public function setToken()\n\t{\n\t\t $args = phpSmug::processArgs( func_get_args() );\n\t\t $this->oauth_token = $args['id'];\n\t\t $this->oauth_token_secret = $args['Secret'];\n\t}",
"private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }",
"public function testAuthenticateTokenParameter()\n {\n $request = new ServerRequest();\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => '[email protected]',\n 'created' => new FrozenTime('2014-03-17 01:18:23'),\n 'updated' => new FrozenTime('2014-03-17 01:20:31'),\n ];\n $request = new ServerRequest(['url' => 'posts/index?token=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $this->auth->setConfig('parameter', 'tokenname');\n $request = new ServerRequest(['url' => 'posts/index?tokenname=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = new ServerRequest(['url' => 'posts/index?wrongtoken=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }",
"private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }",
"private function setHttpHeader($token = null){\n\t\t$ApiReqDetail['header']['Content-Type'] = HEADER_TYPE;\n\t\t$ApiReqDetail['header']['Accept'] = HEADER_TYPE;\n\t\treturn $ApiReqDetail;\n\t}",
"private function headerWithToken()\n {\n return [\n 'Accept:application/json',\n 'Content-Type:application/json',\n 'Authorization:Bearer ' . $this->token\n ];\n }",
"protected function generateParameterWrapToken() {}",
"public function setToken($token){\n $this->token = $token;\n }",
"public function setTokens($data)\n {\n $data = json_decode($data);\n\n $data->access_token_expires_at = Carbon::now()\n ->addSeconds($data->access_token_expires_in)\n ->format('Y-m-d H:i:s');\n\n $data->refresh_token_expires_at = Carbon::now()\n ->addSeconds($data->refresh_token_expires_in)\n ->format('Y-m-d H:i:s');\n\n $this->preferences->hue_access_token = $data->access_token;\n $this->preferences->hue_access_token_expires_in = $data->access_token_expires_in;\n $this->preferences->hue_access_token_expires_at = $data->access_token_expires_at;\n\n $this->preferences->hue_refresh_token = $data->refresh_token;\n $this->preferences->hue_refresh_token_expires_in = $data->refresh_token_expires_in;\n $this->preferences->hue_refresh_token_expires_at = $data->refresh_token_expires_at;\n $this->preferences->update();\n }",
"function fsapi_set_vars($access_token, $just_authenticated=FALSE) {\n $expires = time() + 60*60;\n variable_set('fsapi_access_token',$access_token);\n variable_set('fsapi_access_token_expires', $expires);\n\n //Set the time that the site admin will need to reauthenticate\n if($just_authenticated) {\n variable_set('fsapi_access_token_last_authentication', time());\n\n $next_month = time() + (30 * 24 * 60 * 60);\n variable_set('fsapi_access_token_reauthenticate', $next_month);\n }\n}",
"protected function getAuthParam(){\n\t\treturn '?key=' . $this->key . '&token=' . $this->token;\n\t}",
"private function _setParams ()\n {\n $endpoint = $this->_endpoint->getData();\n if (count($endpoint) > 0) {\n \n $method = $this->_endpoint->getUrl();\n $methodname = 'setParameter' . ucfirst($method['method']);\n \n $this->_httpclient->{$methodname}('access_token', \n $this->_accesstoken);\n $this->_httpclient->{$methodname}('api_secret', $this->_apisecret);\n \n foreach ($endpoint as $param => $value) {\n $this->_httpclient->{$methodname}($param, $value);\n }\n }\n }",
"private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }",
"public function processRFSOption(array $options)\n {\n if (isset($options[static::TOKEN_LABEL])) {\n $this->query['access_token'] = $options[static::TOKEN_LABEL];\n }\n }",
"protected function createNewToken($token){\n return response()->json([\n 'access_token' => $token,\n 'token_type' => 'bearer',\n 'expires_in' => auth('api')->factory()->getTTL() * 60,\n 'user' => auth()->user()\n ]);\n\n\n }",
"public function parseToken()\n {\n $this->token = null;\n // if token is not in get request\n if (!isset($_GET['token'])) {\n if (isset($_SERVER['HTTP_AUTHORIZATION'])) {\n $this->token = $_SERVER['HTTP_AUTHORIZATION'];\n }\n } else {\n $this->token = $_GET['token'];\n }\n // if there was a token in the request\n if ($this->token) {\n // remove bearer for header based token\n $this->token = str_replace('Bearer ', '', $this->token);\n }\n // return class object to enable method chaining\n return $this;\n }"
] |
[
"0.591842",
"0.5907348",
"0.58628803",
"0.58532226",
"0.5827852",
"0.579404",
"0.57329625",
"0.5703282",
"0.5674975",
"0.5632077",
"0.5592673",
"0.5556023",
"0.55466163",
"0.5541266",
"0.5538847",
"0.5522178",
"0.5514899",
"0.5469473",
"0.5468599",
"0.5432297",
"0.54010373",
"0.5396445",
"0.5383796",
"0.53799397",
"0.5370841",
"0.5350298",
"0.5348853",
"0.5335373",
"0.53350735",
"0.53304106"
] |
0.7234298
|
0
|
Modify/extend the identity response parameters
|
public function identity_response($params){
$params['organization_id'] = 'organization_id';
$params['first_name'] = 'first_name';
$params['last_name'] = 'last_name';
$params['display_name'] = 'display_name';
$params['username'] = 'username';
$params['timezone'] = 'timezone';
return $params;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function consume_identity($params, $response){\n $this->set_identity('email', $response[ $params['email'] ]);\n \t}",
"protected function addAdditionalIdentityPropertiesIfNeeded() {}",
"protected function renderAdditionalIdentityFields() {}",
"public function testUpdateIdentity()\n {\n }",
"public function setAuthenticationParams() {\n }",
"public function prepareResponse(&$params)\n {\n if (is_array($this->_props) && count($this->_props) > 0) {\n\n $params['openid.ns.ax'] = GoogleAuth_OpenId_Extension_Ax::NAMESPACE_1_0;\n \n foreach (self::getAxProperties() as $prop=>$value) {\n if (!empty($this->_props[$prop])) {\n $params['openid.ax.type.' . $prop] = $this->_props[$prop];\n }\n }\n }\n return true;\n }",
"public function token_response($params){\n $params['refresh_token'] = 'refresh_token';\n $params['issued_at'] = 'issued_at';\n \t\t$params['signature'] \t = 'signature';\n \t\t$params['scope'] \t\t = 'scope';\n \t\t$params['id_token'] \t = 'id_token';\n \t\t$params['instance_url'] = 'instance_url';\n $params['id'] = 'id';\n \t\t$params['error_description'] = 'error_description';\n \t\treturn $params;\n \t}",
"public function setAuthParams()\n {\n if( $this->getUseSession() )\n {\n // FIXME Need to add session functionality\n }\n else\n {\n $this->getHttpClient()->setParameterGet( 'user', $this->getUsername() );\n $this->getHttpClient()->setParameterGet( 'password', $this->getPassword() );\n $this->getHttpClient()->setParameterGet( 'api_id', $this->getApiId() );\n }\n }",
"public function getIdentityProperties() {}",
"protected function _respond($version, $ret, $params, $extensions=null)\n {\n if (empty($params['openid_assoc_handle']) ||\n !$this->_storage->getAssociation($params['openid_assoc_handle'],\n $macFunc, $secret, $expires)) {\n /* Use dumb mode */\n if (!empty($params['openid_assoc_handle'])) {\n $ret['openid.invalidate_handle'] = $params['openid_assoc_handle'];\n }\n $macFunc = $version >= 2.0 ? 'sha256' : 'sha1';\n $secret = $this->_genSecret($macFunc);\n $handle = uniqid();\n $expiresIn = $this->_sessionTtl;\n $this->_storage->addAssociation($handle,\n $macFunc, $secret, time() + $expiresIn);\n $ret['openid.assoc_handle'] = $handle;\n } else {\n $ret['openid.assoc_handle'] = $params['openid_assoc_handle'];\n }\n if (isset($params['openid_return_to'])) {\n $ret['openid.return_to'] = $params['openid_return_to'];\n }\n if (isset($params['openid_claimed_id'])) {\n $ret['openid.claimed_id'] = $params['openid_claimed_id'];\n }\n if (isset($params['openid_identity'])) {\n $ret['openid.identity'] = $params['openid_identity'];\n }\n\n if ($version >= 2.0) {\n if (!empty($this->_opEndpoint)) {\n $ret['openid.op_endpoint'] = $this->_opEndpoint;\n } else {\n $ret['openid.op_endpoint'] = Zend_OpenId::selfUrl();\n }\n }\n $ret['openid.response_nonce'] = gmdate('Y-m-d\\TH:i:s\\Z') . uniqid();\n $ret['openid.mode'] = 'id_res';\n\n Zend_OpenId_Extension::forAll($extensions, 'prepareResponse', $ret);\n\n $signed = '';\n $data = '';\n foreach ($ret as $key => $val) {\n if (strpos($key, 'openid.') === 0) {\n $key = substr($key, strlen('openid.'));\n if (!empty($signed)) {\n $signed .= ',';\n }\n $signed .= $key;\n $data .= $key . ':' . $val . \"\\n\";\n }\n }\n $signed .= ',signed';\n $data .= 'signed:' . $signed . \"\\n\";\n $ret['openid.signed'] = $signed;\n\n $ret['openid.sig'] = base64_encode(\n Zend_OpenId::hashHmac($macFunc, $data, $secret));\n\n return $ret;\n }",
"private static function transform($params) {\n unset($params['age']);\n $params['id'] = $_SESSION['user_id'];\n return $params;\n }",
"public function getOtherAuthorizationRequestParams() {\n }",
"function ts3client_createIdentity(&$result) {}",
"private function _setParams ()\n {\n $endpoint = $this->_endpoint->getData();\n if (count($endpoint) > 0) {\n \n $method = $this->_endpoint->getUrl();\n $methodname = 'setParameter' . ucfirst($method['method']);\n \n $this->_httpclient->{$methodname}('access_token', \n $this->_accesstoken);\n $this->_httpclient->{$methodname}('api_secret', $this->_apisecret);\n \n foreach ($endpoint as $param => $value) {\n $this->_httpclient->{$methodname}($param, $value);\n }\n }\n }",
"public function setAccessParams ($response)\n {\n if ((isset($response['token_type'])) && (isset($response['access_token']))) {\n $this->token_type = $response['token_type'];\n $this->access_token = $response['access_token'];\n } else {\n throw new Exception('The identification was incorrect, check clientId and clientSecret');\n }\n \n if ((isset($response['expires_in'])) && (isset($response['scope']))) {\n $this->expires_in = $response['expires_in'];\n $this->scope = $response['scope'];\n }\n }",
"public function setIdentity($value);",
"public abstract function getIdentity(array $params);",
"private function addIdentityFieldsToUser()\n {\n\n /** @var CrudService $service */\n $service = $this->container->get('shopware_attribute.crud_service');\n\n foreach (self::PROVIDERS as $provider) {\n $service->update('s_user_attributes', strtolower($provider) . '_identity', 'string', [\n 'label' => 'Identity ' . $provider,\n\n //user has the opportunity to translate the attribute field for each shop\n 'translatable' => false,\n\n //attribute will be displayed in the backend module\n 'displayInBackend' => true,\n\n //in case of multi_selection or single_selection type, article entities can be selected,\n 'entity' => Customer::class,\n\n //numeric position for the backend view, sorted ascending\n 'position' => 100,\n\n //user can modify the attribute in the free text field module\n 'custom' => false,\n ]);\n }\n\n $models = $this->container->get('models');\n $metaDataCache = $models->getConfiguration()->getMetadataCacheImpl();\n $metaDataCache->deleteAll();\n $models->generateAttributeModels(['s_user_attributes']);\n }",
"public function getAttributes() {\n $toReturn = array();\n $toReturn[\"id\"] = $this->id_;\n $toReturn[\"username\"] = $this->username_;\n $toReturn[\"email\"] = $this->email_;\n $toReturn[\"displayName\"] = $this->displayName_;\n $toReturn[\"firstName\"] = $this->firstName_;\n $toReturn[\"lastName\"] = $this->lastName_;\n $toReturn[\"postalCode\"] = $this->postalCode_;\n if ($this->privileges_ !== null) {\n $toReturn[\"privileges\"] = $this->privileges_;\n } else {\n $toReturn[\"privileges\"] = array();\n }\n \n $toReturn[\"isVerified\"] = $this->isVerified_;\n return $toReturn;\n }",
"protected function _generateParams()\r\n { \r\n $this->_transactionalParams = array('EmailAddress' =>$this->_emailPostedData['emailInfos'], 'storeId'=>$this->_emailPostedData['storeId']);\r\n $this->_mapValuesWithAttributes(); \r\n }",
"protected function initUserInfoAttributes()\n {\n return $this->api(\"user/get_user_info\", 'GET', ['oauth_consumer_key'=>$this->getUserAttributes()['client_id'], 'openid'=>$this->getUserAttributes()['openid']]);\n }",
"protected function getIdentityprovidersIdentitynowRequest()\n {\n\n $resourcePath = '/api/v2/identityproviders/identitynow';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // 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 prepareResponse(): self\n {\n // Invoke the response preparation on the parent (General) provider.\n parent::prepareResponse();\n\n // Then override or add to fine tune as per this specific provider\n\n // Prepare SubjectConfirmation element\n $this->subjectConfirmation->setMethod(SamlIdpConstants::CM_BEARER);\n $this->subjectConfirmationData->setNotOnOrAfter($this->notOnOrAfter);\n $this->subjectConfirmationData->setRecipient(self::AWS_SAML_URL);\n $this->subjectConfirmation->setSubjectConfirmationData($this->subjectConfirmationData);\n\n // Set valid audience specifying AWS\n $this->assertion->setValidAudiences(['urn:amazon:webservices']);\n\n return $this;\n }",
"protected function initUserAttributes()\n {\n Event::on(Request::className(), Request::EVENT_AFTER_SEND, function ($event) {\n ///Replace `callback( {\"client_id\":\"101367642\",\"openid\":\"9B18299BC4CBFDAFCA09DBE95A6A0F23\"} );` with ` {\"client_id\":\"101367642\",\"openid\":\"9B18299BC4CBFDAFCA09DBE95A6A0F23\"}`\n $event->response->content = preg_replace('/^callback\\(\\s*(\\{.*\\})\\s*\\);$/is', '\\1', $event->response->content);\n });\n return $this->api('oauth2.0/me', 'GET');\n }",
"public function prepareResponse();",
"function hook_openid_connect_userinfo_alter(array &$userinfo, array $context) {\n // Add some custom information.\n if ($context['plugin_id'] == 'generic') {\n $userinfo['my_info'] = [\n 'full_name' => $userinfo['first_name'] . ' ' . $userinfo['last_name'],\n 'remarks' => 'Information provided by generic client plugin.',\n ];\n }\n}",
"protected function initUserAttributes()\n {\n return $this->api('people/~:(' . implode(',', $this->attributeNames) . ')', 'GET');\n }",
"protected function additionalProtocolParameters()\n {\n return array('oauth_verifier');\n }",
"public function setIdentifiers($username, $password);",
"public function prefillBaseFieldsForSuccessResponse(): void\n {\n $this->setCode(Response::HTTP_OK);;\n $this->setSuccess(true);\n }"
] |
[
"0.6189711",
"0.60505384",
"0.5880731",
"0.5470973",
"0.5435229",
"0.5422168",
"0.537931",
"0.53289026",
"0.53173834",
"0.52720857",
"0.5215146",
"0.51864904",
"0.5133742",
"0.5113357",
"0.5082144",
"0.50382614",
"0.4978597",
"0.49695802",
"0.49638098",
"0.49555233",
"0.4939133",
"0.49341258",
"0.49298286",
"0.49002624",
"0.4895627",
"0.4859415",
"0.48486847",
"0.48291022",
"0.48024753",
"0.4769509"
] |
0.7512239
|
0
|
Provider specific private methods Activate provider specific steps based on features enabled for the provider
|
public function activate(){
# Enable Single Sign-On
if(in_array("login", $this->features, TRUE)){
$this->enable_sso();
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function configurePlanFeaturesAcl()\n {\n if ($this->get('core.status.system')->isPaymentEnabled()) {\n //switch on 'plan features acl'\n $this->get('plan.features.acl.provider')->enable();\n }\n }",
"public function promo_feature_method()\n {\n \n }",
"public function load_supported_features()\n {\n $root = $this->module_roots['dir'];\n // load plugin constants/data\n require_once $root . 'classes/constants.php';\n $custom_plugin_data = new Constants( $this->module_roots );\n // echo \"<pre>\";\n // print_r($custom_plugin_data);\n // echo \"</pre>\";\n // links on the main plugin index page\n require_once $root . 'classes/utility.php';\n $utility = new Utility( $this->module_roots, $custom_plugin_data );\n $plugin_data = get_plugin_data( $this->module_roots['file'], false, false );\n // data to pass to certain classes\n $new_features_json = Utility::get_new_features_json();\n $new_features_arr = Utility::filter_and_decode_json( $new_features_json );\n // functionality for free version only\n $path = $root . 'classes/hooks.php';\n \n if ( file_exists( $path ) ) {\n require_once $path;\n new Hooks( $this->module_roots );\n }\n \n // enqueue plugin scripts\n require_once $root . 'classes/enqueue-scripts.php';\n new Enqueue_Scripts(\n $this->module_roots,\n $new_features_arr,\n $plugin_data,\n $custom_plugin_data\n );\n // plugin settings pages\n require_once $root . 'classes/settings.php';\n new Settings(\n $this->module_roots,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n require_once $root . 'classes/settings-new-features.php';\n new New_Features_Settings(\n $this->module_roots,\n $new_features_arr,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n require_once $root . 'classes/settings-welcome.php';\n new Welcome_Settings(\n $this->module_roots,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n // register blocks\n require_once $root . 'classes/register-blocks.php';\n new Register_Blocks( $this->module_roots );\n // [svg-flag] shortcode\n require_once $root . 'classes/shortcodes/shortcodes.php';\n new Shortcodes( $this->module_roots, $custom_plugin_data );\n // links on the main plugin index page\n require_once $root . 'classes/links.php';\n new Flags_Links(\n $this->module_roots,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n // run upgrade routine when plugin updated to new version\n require_once $root . 'classes/upgrade.php';\n new Flags_Upgrade( $this->module_roots, $custom_plugin_data );\n // localize plugin\n require_once $root . 'classes/localize.php';\n new Localize( $this->module_roots );\n }",
"function ff_activate_feature( $feature )\n\t{\n\t\tff_FeatureFlags::getInstance()->getFeature( $feature )->globalEnable();\n\t}",
"public function plugin_activate_hook() {\r\n add_option( 'woolentor_do_activation_redirect', TRUE );\r\n add_option( 'woolentor_do_activation_library_cache', TRUE );\r\n }",
"protected function migrateFeatureManager() {\n\t\tif ( empty( $this->oldOptions['modules']['aiosp_feature_manager_options'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $this->oldOptions['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_opengraph'] ) ) {\n\t\t\taioseo()->options->social->facebook->general->enable = false;\n\t\t\taioseo()->options->social->twitter->general->enable = false;\n\t\t}\n\n\t\tif ( empty( $this->oldOptions['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) ) {\n\t\t\taioseo()->options->sitemap->general->enable = false;\n\t\t\taioseo()->options->sitemap->rss->enable = false;\n\t\t}\n\n\t\tif ( ! empty( $this->oldOptions['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_robots'] ) ) {\n\t\t\taioseo()->options->tools->robots->enable = true;\n\t\t}\n\t}",
"function activate() \n {\n // prepare the options\n $this->get_options();\n // set the WordPress hooks\n $this->wp_hooks();\n }",
"public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }",
"public function activatePlugins() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('activatePlugins', func_get_args()));\n }",
"protected function add_hooks() {\n\t\t// hooks always active for the gateway\n\t\tadd_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );\n\n\t\tif ( 'no' === $this->enabled ) {\n\t\t\treturn;\n\t\t}\n\t\t// hooks only active when the gateway is enabled\n\t\tadd_filter( 'woocommerce_credit_card_form_fields', array( $this, 'woocommerce_credit_card_form_fields' ) );\n\n\t\tif ( is_add_payment_method_page() ) {\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'tokenization_script' ) );\n\t\t}\n\t}",
"public static function isFeatureActive()\n {\n }",
"public function activate_extension()\n\t{\n\t\t// Setup custom settings in this array.\n\t\t$this->settings = array();\n\t\t\n\t\t$batch = array();\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'store_order_complete_end',\n\t\t\t'hook'\t\t=> 'store_order_complete_end',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'sessions_end',\n\t\t\t'hook'\t\t=> 'sessions_end',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'store_payment_gateways',\n\t\t\t'hook'\t\t=> 'store_payment_gateways',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'freemember_update_member_custom_start',\n\t\t\t'hook'\t\t=> 'freemember_update_member_custom_start',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\tee()->db->insert_batch('extensions', $batch);\t\n\n\t\t\t\t\t\n\t\t\n\t}",
"protected function _initFeatureSwitch()\n\t{\n\t\t$cfgPath = $this->getOption('configPath');\n\t\t$config = new Zend_Config_Ini($cfgPath . 'features.ini', APPLICATION_ENV);\n\n\t\tZend_Registry::set('features', $config->toArray());\n\t}",
"public function install()\r\n {\r\n if (Shop::isFeatureActive()){\r\n Shop::setContext(Shop::CONTEXT_ALL);\r\n }\r\n\r\n return parent::install()\r\n && $this->_installHookCustomer()\r\n && $this->registerHook('fieldBrandSlider')\r\n && $this->registerHook('displayHeader')\r\n && $this->_createConfigs()\r\n && $this->_createTab();\r\n }",
"protected function setSupportedProviders()\n {\n $this->addSupportedReadProvider(new RESTAPI\\D7RefineryServerCurrent());\n }",
"protected function registerFeature() {\r\n //add feature\r\n $capability = aam_Core_ConfigPress::getParam(\r\n 'aam.feature.' . self::FEATURE_ID . '.capability', \r\n 'administrator'\r\n );\r\n\r\n //makre sure that current user has access to current Extension. This is \r\n //mandatory check and should be obeyed by all developers\r\n if (current_user_can($capability)) {\r\n //register the Extension's javascript\r\n add_action('admin_print_scripts', array($this, 'printScripts'));\r\n //register the Extension's stylesheet\r\n add_action('admin_print_styles', array($this, 'printStyles'));\r\n //register the Feature\r\n aam_View_Collection::registerFeature((object) array(\r\n //uid is mandatory and this should be the unique ID\r\n 'uid' => self::FEATURE_ID,\r\n //Extension Position is the list of AAM features. This works\r\n //the same way as WordPress Admin Menu\r\n 'position' => 150,\r\n //Extension's Title\r\n 'title' => __('Feature Example', 'aam'),\r\n //Define what subjects can see the Extenion's UI. AAM is based on \r\n //idea of Subjects (Blog, Role, User & Visitor) and Objects (Post, \r\n //Term, Event, Menu etc). This property defines what Subjects are\r\n //allowed to see this feature. So as Example if you click on Visitor\r\n //(on the Control Manager) you will not find Menu or Metabox Features.\r\n //This is because any visitor of your website does not have access to\r\n //backend so there is no need to show these features.\r\n 'subjects' => array(\r\n aam_Control_Subject_Role::UID,\r\n aam_Control_Subject_User::UID,\r\n aam_Control_Subject_Visitor::UID\r\n ),\r\n //Reference to Extension's Controller. Make sure that if your \r\n //Extension display any UI, the controller property contains the \r\n //instance of the Extenion's Controller and Controller has function\r\n //content. See aam_View_Manager::retrieveFeatures function for more\r\n //information\r\n 'controller' => $this\r\n ));\r\n }\r\n }",
"public function activate() {\n global $wp_roles;\n\n if ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) {\n // @codingStandardsIgnoreLine\n $wp_roles = new \\WP_Roles();\n }\n\n $all_cap = array(\n 'dokan_view_booking_menu',\n 'dokan_add_booking_product',\n 'dokan_edit_booking_product',\n 'dokan_delete_booking_product',\n 'dokan_manage_booking_products',\n 'dokan_manage_booking_calendar',\n 'dokan_manage_bookings',\n 'dokan_manage_booking_resource',\n );\n\n foreach ( $all_cap as $key => $cap ) {\n $wp_roles->add_cap( 'seller', $cap );\n $wp_roles->add_cap( 'administrator', $cap );\n $wp_roles->add_cap( 'shop_manager', $cap );\n }\n\n // flush rewrite rules after plugin is activate\n $this->flush_rewrite_rules();\n }",
"protected function setSupportedProviders()\n {\n $this->addSupportedReadProvider(new RESTAPI\\D7RefineryServerNew());\n }",
"function before_enable() { }",
"function instant_ide_manager_activate_pre() {\n\t\n\tif ( ! get_option( 'instant_ide_manager_access_pin' ) )\n\t\tupdate_option( 'instant_ide_manager_access_pin', '' );\n\t\t\n\tif ( ! get_option( 'instant_ide_manager_access_status' ) )\n\t\tupdate_option( 'instant_ide_manager_access_status', 'locked' );\n\t\n\tif ( file_exists( IIDEM_IIDE_DIR . '/iide-constants.php' ) ) {\n\t\t\n\t\tinclude_once( IIDEM_IIDE_DIR . '/iide-constants.php' );\n\t\t\n\t\tif ( version_compare( IIDE_VERSION, IIDE_LATEST_VERSION, '>=' ) )\n\t\t\treturn;\n\t\t\t\n\t\t\t$current_iide_dir = IIDEM_IIDE_DIR;\n\t\t\tinstant_ide_manager_backup_files();\n\t\t\tinstant_ide_manager_delete_dir( IIDEM_IIDE_DIR );\n\t\t\tinstant_ide_manager_copy_dir( IIDEM_IDE_DIR . '/instant-ide', $current_iide_dir );\n\t\t\tinstant_ide_manager_restore_files();\n\t\t\n\t}\n\t\t\n}",
"public function getProvidedFeatures();",
"protected function bootProviders() {\n\n\t\tforeach ( $this->getProviders() as $provider ) {\n\t\t\t$this->bootProvider( $provider );\n\t\t}\n\t}",
"public function activateProviderConfiguration($userId, $providerCode);",
"function mediatags_activate_plugin()\n\t{\n\t\tinclude_once ( dirname (__FILE__) . '/mediatags_legacy_convert.php' );\n\t\tmediatags_plugin_version_check();\n\n\t\t// Support for Role Manager plugin http://www.im-web-gefunden.de/wordpress-plugins/role-manager/\n\t\tmediatags_add_default_capabilities();\n\t\t//mediatags_reconcile_counts();\n\t}",
"public function check_capabilities() {\n\n add_action('admin_init', array( $this, 'init' ) );\n\n // Make sure user can edit theme options\n if ( ! current_user_can('edit_theme_options') ) {\n return;\n }\n\n // Add the menu item\n add_action('admin_menu', array( $this, 'create_menu' ) );\n\n // Load required asstes\n add_action('admin_enqueue_scripts', array( $this, 'load_assets' ) );\n\n }",
"private function __construct() {\n\t\trequire_once __DIR__ . '/class-itsec-two-factor-core-compat.php';\n\t\trequire_once __DIR__ . '/providers/class.two-factor-provider.php';\n\n\t\tif ( is_admin() ) {\n\t\t\t// Always instantiate enabled providers in admin for use in settings, etc\n\t\t\tadd_action( 'init', array( $this, 'get_enabled_provider_instances' ) );\n\t\t} else {\n\t\t\tadd_action( 'init', array( $this, 'get_all_providers' ) );\n\t\t}\n\t}",
"public function activate_extension() {\n $hooks = array(\n 'template_post_parse' => 'template_post_parse'\n );\n foreach($hooks as $hook => $method) {\n $data = array(\n 'class' => __CLASS__,\n 'method' => $method,\n 'hook' => $hook,\n 'priority' => 10,\n 'version' => $this->version,\n 'enabled' => 'y',\n 'settings' => ''\n );\n ee()->db->insert('exp_extensions', $data);\n }\n return true;\n }",
"final public function activate() {\n\t\n\t\t//Check PHP Version and deactivate & die if it doesn't meet minimum requirements.\n\t\tif ( version_compare(PHP_VERSION, '7.2.0', '<=') ) {\n\t\t\tdeactivate_plugins( plugin_basename( WRP_PLUGIN_FILE ) );\n\t\t\twp_die( 'This plugin requires <b>PHP Version 7.2 and up</b>. <a href=\"' . admin_url('plugins.php') . '\">Go Back</a>' );\n }\n \n //Check if WooCommerce is activated. Otherwise, do not activate the plugin.\n if( !is_plugin_active('woocommerce/woocommerce.php') ) {\n deactivate_plugins( plugin_basename( WRP_PLUGIN_FILE ) );\n\t\t\twp_die( 'This plugin requires <b>WooCommerce<b>. <a href=\"' . admin_url('plugins.php') . '\">Go Back</a>' );\n }\n\t\t\n //Do activate Stuff now...\n \n\t}",
"public function __construct() {\n add_action( 'init', array( $this, 'check_capabilities' ) );\n }",
"private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}"
] |
[
"0.5990385",
"0.5854299",
"0.5813074",
"0.57316774",
"0.57225657",
"0.57056445",
"0.57054543",
"0.5656375",
"0.56498176",
"0.5629655",
"0.5575681",
"0.5570097",
"0.5569382",
"0.5509306",
"0.54993767",
"0.54887325",
"0.53953654",
"0.53785104",
"0.53779596",
"0.53659856",
"0.5357197",
"0.53567326",
"0.534345",
"0.53432685",
"0.53380823",
"0.53200394",
"0.531456",
"0.53101456",
"0.5301644",
"0.5284544"
] |
0.63602066
|
0
|
Update notices for active accounts.
|
public function updateNotices()
{
// Fetch a list of users whos has not notice about article.
$ar_unnoticed = User::find()
->leftJoin('{{%article_user}}',
'{{%user}}.id = {{%article_user}}.user_id AND ' .
sprintf('{{%%article_user}}.article_id = %d', $this->id)
)
->andWhere(['IS', '{{%article_user}}.user_id', (new Expression('NULL'))])
//->andWhere(['IS NOT', '{{%article_user}}.is_readed', (new Expression('NULL'))])
->andWhere(['=', '{{%user}}.is_active', User::STATUS_ACTIVE])
->andWhere(['<>','{{%user}}.id', \Yii::$app->user->getId()])
->all();
foreach ($ar_unnoticed as $account) {
//$this->link('readers', $account, ['is_readed' => 1]);
$this->link('readers', $account, ['is_readed' => 1]);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function notices(): void {\n $notices = new \\WPTRT\\AdminNotices\\Notices();\n foreach ($this->getTransient() as $notice) {\n\n // Delete Notice if is older than MAX_AGE\n if (time() - $notice->creationTime > $this->max_age) {\n self::remove($notice->id);\n continue;\n }\n\n $notices->add($notice->id, $notice->title, $notice->message, $notice->options);\n\n // Delete wptrt Dismissed options to always show notice until it is removed\n\t // Otherwise it would bes stored over and over again but not displayed\n if (isset($notice->options['scope']) && $notice->options['scope'] === \"user\") {\n \t$user = wp_get_current_user();\n \t$key = isset($notice->options['option_prefix']) ? $notice->options['option_prefix'].\"_\".$notice->id : \"wptrt_notice_dismissed_\". $notice->id;\n\t delete_user_meta( $user->ID, $key);\n } else {\n\t delete_option( \"wptrt_notice_dismissed_\". $notice->id);\n }\n }\n $notices->boot();\n }",
"public function account_updated(){\n $this->log();\n http_response_code(200);\n ob_end_flush();\n }",
"public function cloudflare_notices() {\n\t\tforeach ( $this->cloudflare_notices as $notice ) {\n\t\t\t$this->cloudflare_admin_notice( $notice );\n\t\t}\n\t}",
"public function updateAccount()\n\t{\n\t\tif (in_array('newsletter', $this->Config->getActiveModules()))\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('newsletter;', 'newsletter,newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('assignDir;', 'assignDir;{newsletter_legend:hide},newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\t\n\t\t$intUser = $this->Input->get('id');\n\n\t\t// Front end call\n\t\tif (TL_MODE == 'FE')\n\t\t{\n\t\t\t$this->import('FrontendUser', 'User');\n\t\t\t$intUser = $this->User->id;\n\t\t}\n\n\t\t// Edit account\n\t\tif (TL_MODE == 'FE' || $this->Input->get('act') == 'edit')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t// E-mail address has changed\n\t\t\t\tif (!empty($_POST) && $this->Input->post('email', true) != $objUser->email)\n\t\t\t\t{\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_news_recipients SET email=? WHERE email=?\")\n\t\t\t\t\t\t\t\t ->execute($this->Input->post('email', true), $objUser->email);\n\n\t\t\t\t\t$objUser->email = $this->Input->post('email', true);\n\t\t\t\t}\n\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT pid FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\n\t\t\t\t$strNews = serialize($objSubscriptions->fetchEach('pid'));\n\n\t\t\t\t$this->Database->prepare(\"UPDATE tl_member SET newsalert=? WHERE id=?\")\n\t\t\t\t\t\t\t ->execute($strNews, $intUser);\n\n\t\t\t\t// Update the front end user object\n\t\t\t\tif (TL_MODE == 'FE')\n\t\t\t\t{\n\t\t\t\t\t$this->User->newsalert = $strNews;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Delete account\n\t\telseif ($this->Input->get('act') == 'delete')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"DELETE FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\t\t\t}\n\t\t}\n\t}",
"function swp_affiliatewp_update_notification( $notices = array() ) {\n if (is_string( $notices ) ) {\n $notices = array();\n }\n\n $notices[] = array(\n 'key' => 'update_notice_affiliatewp_' . SWAW_VERSION, // database key unique to this version.\n 'message' => 'Looks like your copy of Social Warfare - Pro isn\\'t up to date with Core. While you can still use both of these plugins, we highly recommend you keep both Core and Pro up-to-date for the best of what we have to offer.',\n 'ctas' => array(\n array(\n 'action' => 'Remind me in a week.',\n 'timeframe' => 7 // dismiss for one week.\n ),\n array(\n 'action' => 'Thanks for letting me know.',\n 'timeframe' => 0 // permadismiss for this version.\n )\n )\n );\n\n return $notices;\n}",
"public function updated_message() {\n\t\t$tab = Template::current_tab();\n\n\t\t// Show updated notice.\n\t\tadd_action( 'beehive_admin_top_notices', function () use ( $tab ) {\n\t\t\tswitch ( $tab ) {\n\t\t\t\tcase 'tracking':\n\t\t\t\t\t$this->notice( __( 'Tracking ID updated successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->notice( __( 'Changes were saved successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} );\n\t}",
"function _active($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('completed');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}",
"public function activeAlerts(){\n $today=Date('Y-m-d');\n $data=array(\n 'status'=>'active'\n );\n $this->db->where('reminderDate <=',$today);\n $this->db->where('status !=','done');\n $this->db->update('regularcost',$data);\n }",
"public function customizer_notice() {\n\t\t$notices = get_option( 'swc_activation_notice' );\n\n\t\tif ( $notices = get_option( 'swc_activation_notice' ) ) {\n\n\t\t\tforeach ( $notices as $notice ) {\n\t\t\t\techo '<div class=\"updated\">' . $notice . '</div>';\n\t\t\t}\n\n\t\t\tdelete_option( 'swc_activation_notice' );\n\t\t}\n\t}",
"protected function doAPINotices()\n {\n if (\\wpSPIO()->settings()->verifiedKey)\n {\n return; // all fine.\n }\n\n $activationDate = \\wpSPIO()->settings()->activationDate;\n $noticeController = Notices::getInstance();\n $now = time();\n\n if (! $activationDate)\n {\n $activationDate = $now;\n \\wpSPIO()->settings()->activationDate = $activationDate;\n }\n\n $notice = $noticeController->getNoticeByID(self::MSG_NO_APIKEY);\n $notice_repeat = $noticeController->getNoticeByID(self::MSG_NO_APIKEY_REPEAT);\n $notice_long = $noticeController->getNoticeByID(self::MSG_NO_APIKEY_REPEAT_LONG);\n\n $notice_dismissed = ($notice && $notice->isDismissed()) ? true : false;\n $notice_dismissed_repeat = ($notice_repeat && $notice_repeat->isDismissed()) ? true : false;\n $notice_dismissed_long = ($notice_long && $notice_long->isDismissed()) ? true : false;\n\n if (! $notice)\n {\n // If no key is activated, load the general one.\n $message = $this->getActivationNotice();\n $notice = Notices::addNormal($message);\n Notices::makePersistent($notice, self::MSG_NO_APIKEY, YEAR_IN_SECONDS);\n }\n\n // The trick is that after X amount of time, the first message is replaced by one of those.\n if ($notice_dismissed && ! $notice_dismissed_repeat && $now > $activationDate + (6 * HOUR_IN_SECONDS)) // after 6 hours.\n {\n //$notice->messageType = Notices::NOTICE_WARNING;\n // $notice->\n //Notices::removeNoticeByID(self::MSG_NO_APIKEY); // remove the previous one.\n $message = __(\"Action needed. Please <a href='https://shortpixel.com/wp-apikey' target='_blank'>get your API key</a> to activate your ShortPixel plugin.\",'shortpixel-image-optimiser');\n\n $notice = Notices::addWarning($message);\n Notices::makePersistent($notice, self::MSG_NO_APIKEY_REPEAT, YEAR_IN_SECONDS);\n }\n elseif ($notice_dismissed_repeat && $notice_dismissed && ! $notice_dismissed_long && $now > $activationDate + (3 * DAY_IN_SECONDS) ) // after 3 days\n {\n // Notices::removeNoticeByID(self::MSG_NO_APIKEY); // remove the previous one.\n $message = __(\"Your image gallery is not optimized. It takes 2 minutes to <a href='https://shortpixel.com/wp-apikey' target='_blank'>get your API key</a> and activate your ShortPixel plugin.\",'shortpixel-image-optimiser') . \"<BR><BR>\";\n\n $notice = Notices::addWarning($message);\n Notices::makePersistent($notice, self::MSG_NO_APIKEY_REPEAT_LONG, YEAR_IN_SECONDS);\n\n }\n\n }",
"public function update_account() {\n global $dbconfig;\n\n $user_id = $this->params['user_id'];\n $status = isset($this->params['status']) ? $this->params['status'] : BLOCKED;\n $account_dbobj = $this->params['account_dbobj'];\n $user_status = BLOCKED;\n $store_status = PENDING;\n\n if($status === ACTIVATED) {\n $user_status = CREATED;\n $store_status = PENDING;\n }\n\n // update users table\n $user_obj = new User($account_dbobj, $user_id);\n $user_obj->setStatus($status);\n $user_obj->save();\n\n $user = BaseModel::findCachedOne($dbconfig->account->name . \".user?id=$user_id\");\n if(!empty($user['store_id'])){\n $store_id = $user['store_id'];\n // store need to manually launch\n $store_obj = new Store($account_dbobj, $store_id);\n if($store_obj->getId()) {\n $store_obj->setStatus($store_status);\n $store_obj->save();\n if($store_status != ACTIVATED){\n GlobalProductsMapper::deleteProductsInStore($account_dbobj, $store_id);\n }\n }\n }\n }",
"public function on_loco_admin_notices(){\n $this->inline = true;\n $this->flush();\n }",
"function onesignin_client_handle_after_update_notification($account) {\n watchdog('onesignin', 'Updating user %name on request of One Signin server.', array('%name' => $account->name), WATCHDOG_INFO);\n onesignin_client_userdata_synchronize($account->server_uid);\n}",
"function genesis_extender_essentials_is_active_nag()\n\t\t{\t\t\t\n\t\t\techo '<div id=\"update-nag\">';\n\t\t\tprintf( __( '<strong>Genesis Extender & Genesis Essentials Are Currently Active!</strong> These two Cobalt Apps products are not to be used together so deactivate <a href=\"%s\">Genesis Extender</a> or <a href=\"%s\">Genesis Essentials</a>.', 'extender' ), admin_url( 'plugins.php' ), admin_url( 'plugins.php' ) );\n\t\t\techo '</div>';\n\t\t}",
"function display_notice(){\r\n\t\t\tglobal $hook_suffix;\r\n\t\t\t$status = \"not-activated\";\r\n\t\t\t$ultimate_keys = get_option('ultimate_keys');\r\n\t\t\t$username = $ultimate_keys['envato_username'];\r\n\t\t\t$api_key = $ultimate_keys['envato_api_key'];\r\n\t\t\t$purchase_code = $ultimate_keys['ultimate_purchase_code'];\r\n\t\t\t$user_email = (isset($ultimate_keys['ultimate_user_email'])) ? $ultimate_keys['ultimate_user_email'] : '';\r\n\r\n\t\t\t$activation_check = get_option('ultimate_license_activation');\r\n\r\n\t\t\tif(false === ( get_transient( 'ultimate_license_activation' ) )){\r\n\t\t\t\tif(!empty($activation_check)){\r\n\t\t\t\t\t$get_activation_data = check_license_activation($purchase_code, $username, $user_email);\r\n\t\t\t\t\t$activation_check_temp = json_decode($get_activation_data);\r\n\t\t\t\t\t$val = array(\r\n\t\t\t\t\t\t'response' => $activation_check_temp->response,\r\n\t\t\t\t\t\t'status' => $activation_check_temp->status,\r\n\t\t\t\t\t\t'code' => $activation_check_temp->code\r\n\t\t\t\t\t);\r\n\t\t\t\t\tupdate_option('ultimate_license_activation', $val);\r\n\t\t\t\t\tdelete_transient( 'ultimate_license_activation' );\r\n\t\t\t\t\tset_transient( \"ultimate_license_activation\", true, 60*60*12);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$activation_check = get_option('ultimate_license_activation');\r\n\t\t\t$ultimate_constants = get_option('ultimate_constants');\r\n\t\t\t$builtin = get_option('ultimate_updater');\r\n\r\n\t\t\tif($activation_check !== ''){\r\n\t\t\t\t$status = isset($activation_check['status']) ? $activation_check['status'] : \"not-activated\";\r\n\t\t\t\t$code = $activation_check['code'];\r\n\t\t\t}\r\n\r\n\t\t\tif($status == \"Deactivated\" || $status == \"not-activated\" || $status == \"not-verified\"){\r\n\t\t\t\tif ( $hook_suffix == 'plugins.php' ){\r\n\t\t\t\t\tif( $builtin === 'disabled' || $ultimate_constants['ULTIMATE_NO_PLUGIN_PAGE_NOTICE'] === true || (is_multisite() == true && is_main_site() == false))\r\n\t\t\t\t\t\t$hide_notice = true;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$hide_notice = false;\r\n\t\t\t\t\t$reg_link = (is_multisite()) ? network_admin_url('index.php?page=bsf-dashboard') : admin_url('index.php?page=bsf-dashboard');\r\n\r\n\t\t\t\t\tif(!$hide_notice) :\r\n\t\t\t\t\t?>\r\n <div class=\"updated\" style=\"padding: 0; margin: 0; border: none; background: none;\">\r\n <style type=\"text/css\">\r\n .ult_activate{min-width:825px;background: #FFF;border:1px solid #0096A3;padding:5px;margin:15px 0;border-radius:3px;-webkit-border-radius:3px;position:relative;overflow:hidden}\r\n .ult_activate .ult_a{position:absolute;top:5px;right:10px;font-size:48px;}\r\n .ult_activate .ult_button{font-weight:bold;border:1px solid #029DD6;border-top:1px solid #06B9FD;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#FFF;background:#029DD6;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}\r\n .ult_activate .ult_button:hover{text-decoration:none !important;border:1px solid #029DD6;border-bottom:1px solid #00A8EF;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#F0F8FB;background:#0079B1;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}\r\n .ult_activate .ult_button_border{border:1px solid #0096A3;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;background:#029DD6;}\r\n .ult_activate .ult_button_container{cursor:pointer;display:inline-block; padding:5px;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;width:215px}\r\n .ult_activate .ult_description{position:absolute;top:8px;left:230px;margin-left:25px;color:#0096A3;font-size:15px;z-index:1000}\r\n .ult_activate .ult_description strong{color:#0096A3;font-weight:normal}\r\n </style>\r\n <div class=\"ult_activate\">\r\n <div class=\"ult_a\"><img style=\"width:1em;\" src=\"<?php echo plugins_url(\"img/logo-icon.png\",__FILE__); ?>\" alt=\"\"></div>\r\n <?php\r\n\r\n ?>\r\n <div class=\"ult_button_container\" onclick=\"document.location='<?php echo $reg_link; ?>'\">\r\n <div class=\"ult_button_border\">\r\n <div class=\"ult_button\"><span class=\"dashicons-before dashicons-admin-network\" style=\"padding-right: 6px;\"></span><?php __('Activate your license', 'ultimate_vc');?></div>\r\n </div>\r\n </div>\r\n <div class=\"ult_description\"><h3 style=\"margin:0;padding: 2px 0px;\"><strong><?php _e('Almost done!','ultimate_vc'); ?></strong></h3><p style=\"margin: 0;\"><?php _e('Please activate your copy of the Ultimate Addons for Visual Composer to receive automatic updates & get premium support','ultimate_vc'); ?></p></div>\r\n </div>\r\n </div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\tendif;\r\n\t\t\t\t} else if($hook_suffix == 'post-new.php' || $hook_suffix == 'edit.php' || $hook_suffix == 'post.php'){\r\n\t\t\t\t\tif( $builtin === 'disabled' || $ultimate_constants['ULTIMATE_NO_EDIT_PAGE_NOTICE'] === true || (is_multisite() == true && is_main_site() == false))\r\n\t\t\t\t\t\t$hide_notice = true;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$hide_notice = false;\r\n\t\t\t\t\tif(!$hide_notice) :\r\n\t\t\t\t\t?>\r\n\r\n <div class=\"updated fade\">\r\n\r\n <p><?php echo _e('Howdy! Please','ultimate_vc').' <a href=\"'.$reg_link.'\">'.__('activate your copy','ultimate_vc').' </a> '.__('of the Ultimate Addons for Visual Composer to receive automatic updates & get premium support.','ultimate_vc');?>\r\n <span style=\"float: right; padding: 0px 4px; cursor: pointer;\" class=\"uavc-activation-notice\">X</span>\r\n </p>\r\n </div>\r\n <script type=\"text/javascript\">\r\n jQuery(\".uavc-activation-notice\").click(function(){\r\n jQuery(this).parents(\".updated\").fadeOut(800);\r\n });\r\n </script>\r\n\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\tendif;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public function apiUpdate()\n {\n // Update only if account key existe and Account status is active\n $apiKey = Mage::getStoreConfig('steerfox_plugins/account/api_key');\n $accountStatus = Mage::getStoreConfig('steerfox_plugins/account/status');\n\n if (!empty($apiKey) && 1 == $accountStatus) {\n $coreHelper = Mage::helper('steerfox_plugins/core_data');\n $steerfoxContainer = $coreHelper->getSteerfoxContainer();\n $steerfoxApi = $steerfoxContainer->get('api');\n $steerfoxApi instanceof SteerfoxApiService;\n $result = $steerfoxApi->updateAccount();\n\n if (!$result) {\n Mage::getSingleton('core/session')->addError('Steerfox update account : Error occurred.');\n }\n\n Mage::app()->getStore()->resetConfig();\n }\n }",
"function activated_notice() {\n\t\tif ( 'network' == $this->get_option( 'activated' ) ) {\n\t\t\t$message = sprintf(\n\t\t\t\t__( 'Each site will need to be registered with VaultPress separately. You can purchase new keys from your <a href=\"%1$s\">VaultPress Dashboard</a>.', 'vaultpress' ),\n\t\t\t\t'https://dashboard.vaultpress.com/'\n\t\t\t);\n\t\t\t$this->ui_message( $message, 'activated', __( 'VaultPress has been activated across your network!', 'vaultpress' ) );\n\n\t\t// key and secret already exist in db\n\t\t} elseif ( $this->is_registered() ) {\n\t\t\tif ( $this->check_connection() ) {\n\t\t\t}\n\t\t}\n\n\t\t$this->delete_option( 'activated' );\n\t}",
"private function setAnnounced() {\n $queryBuilder = $this->manager->getRepository(Grund::class)->createQueryBuilder('g');\n $entities = $queryBuilder\n ->andWhere('g.status IN (:statuses)')\n ->setParameter('statuses', [GrundStatus::FREMTIDIG])\n ->andWhere('g.datoannonce <= :now')\n ->setParameter('now', new \\DateTime(null, new \\DateTimeZone('UTC')))\n ->getQuery()->getResult();\n\n $this->write(sprintf('Set announced; #entities: %d', count($entities)));\n foreach ($entities as $entity) {\n $this->write(\n sprintf(\n \"% 8d: %s\\t%s\",\n $entity->getId(),\n (string) $entity,\n $entity->getDatoAnnonce()->format(\\DateTime::ISO8601)\n )\n );\n $entity->setStatus(GrundStatus::ANNONCERET);\n $this->manager->persist($entity);\n }\n $this->manager->flush();\n }",
"public function noticeWPFCMNotActive() {\n\t\t\tadd_action( 'admin_notices', array( get_class(), 'renderNoticeWPFCMNotActive' ) );\n\t\t}",
"public function activatePending()\n {\n $mydate = date('Y-m-d H:i:s',strtotime(\"-36 hours\"));\n $sql = \"SELECT `bids`.* \n FROM `bids`\n JOIN `campaigns`\n ON `bids`.`campaign_id` = `campaigns`.`id`\n WHERE `campaigns`.`status` = ? \n AND `bids`.`status` = ?\n AND `bids`.`created_at` < ?;\";\n $result = DB::select($sql, array(1, 5, $mydate));\n if(sizeof($result)){\n Log::info(sizeof($result).' Pending Bids to Activate');\n foreach($result as $row){\n $sql = 'UPDATE `bids` SET `status` = ? WHERE `id` = ?';\n DB::update($sql, array(1, $row->id));\n //$info = 'Campaign '.$row->campaign_id.' Activated on Zone '.$row->zone_handle;\n //Log::info($info); \n }\n }else{\n Log::info('No Pending Bids to Activate.');\n }\n }",
"public function updateMyAccountInfo()\n {\n $ajax_data = array();\n $post = $this->request->request->all();\n \n // validate POST parameters\n $result = $this->user_logic->validateAccountInfoPostData($post);\n if (($result['error'] == '') AND ! empty($result['params'])) {\n $user_id = $this->user_session->getUserId();\n $update = $this->user_logic->updateUserInfo($user_id, $result['params']);\n if ($update !== false) {\n $ajax_data['code'] = 0;\n $ajax_data['data'] = $post;\n $ajax_data['message'] = 'Updated Account Information'; \n } else {\n $errors = $this->user_logic->getErrorMessage();\n if (! empty($errors) AND is_array($errors)) {\n $errors = implode(',',$errors);\n } else {\n $errors = 'Failed to update account info due to database error';\n }\n \n $ajax_data['code'] = 1;\n $ajax_data['message'] = $ajax_data['validation_error'][] = $errors;\n }\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = $ajax_data['validation_error'][] = $result['error']; \n }\n \n $this->ajax_respond($ajax_data);\n }",
"public function activeAccount(Request $request, $infoActive = \"\" ){\n //chay sang trng hom neu da login\n if(Auth::user()){\n return redirect(\"home\");\n }\n\n if ( strlen( $infoActive ) > 0 ){\n $data = json_decode( base64_decode( $infoActive ) );\n\n //check neu da active roi va chua login hien thong bao da active kem link login\n try {\n $activeUser = User::where('email', '=', $data[1])->firstOrFail();\n if( $activeUser->active == 1 ) {\n //chay sang trang thong bao\n return redirect(\"notification/useractived\");\n }\n } catch (Exception $e) {\n echo \"Error : ket noi\";\n die(); \n }\n $count = User::where('email','=', $data[1])\n ->where('updated_at','>', Carbon::now()->subDay(3))\n ->count();\n if($count==0){\n $request->session()->flash('error', 'Link Active Account expired!');\n }else{\n //kiem tra va update kich hoat tk\n if ( $data[0] == hash( \"sha256\", md5( md5( $data[1] ) ) ) ) {\n try {\n $user = User::where( 'email', '=', $data[1] )->first();\n $user->active = 1;\n $user->save();\n UserData::find($user->id )->update( ['active' => 1] );\n //Active vaf redirect ve trang thong bao kem theo link login\n if($user){\n return redirect(\"notification/useractive\");\n }else{\n $request->session()->flash('error', 'Cannot activate !');\n }\n } catch ( Exception $e ) {\n \n }\n } else {\n $request->session()->flash('error', 'Something wrongs. We cannot activated!');\n }\n }\n\n } else {\n $request->session()->flash('error', 'Something wrongs. We cannot activated!');\n }\n return view('adminlte::auth.reactive');\n }",
"protected function adminNotices()\n {\n if (! empty($_GET[self::NOTICE]) &&\n \\filter_var($_GET[self::NOTICE], FILTER_VALIDATE_INT) === 1\n ) {\n $message = \\esc_html__('The cache has been successfully cleared.', 'wp-rest-api-cache');\n echo \"<div class='notice updated is-dismissible'><p>{$message}</p></div>\"; // PHPCS: XSS OK.\n }\n }",
"public static function update_account_status($email) {\n $connection = DatabaseConnection::connection();\n $sql = \"UPDATE users SET active = 1 WHERE email=:email\";\n $statement = $connection->prepare($sql);\n $statement->execute(['email' => $email]);\n }",
"public function admin_notices()\n {\n if ( get_transient( 'lbry_notices' ) ) {\n $notices = get_transient( 'lbry_notices' );\n foreach ( $notices as $key => $notice ) {\n $this->create_admin_notice( $notice );\n }\n delete_transient( 'lbry_notices' );\n }\n }",
"function displayAlerts() {\n //show alert when the user successfully updates their account\n if($_SESSION['account_update_flag'] == true) {\n echo '<br/><br/><div class=\"alert alert-success\" role=\"alert\">Successfully updated account information</div>';\n\n //lower flag so that alert doesn't display when the page is reloaded\n $_SESSION['account_update_flag'] = false;\n }\n}",
"public function update(UpdateNoticeRequest $request, Notice $notice)\n {\n //\n $this->authorize('update',$notice);\n $notice->title = $request->title;\n $notice->description = $request->description;\n $notice->date = $request->date;\n $notice->user_id = auth()->user()->id;\n $notice->name = auth()->user()->name;\n $notice->update();\n\n return redirect('notices')->with('message','Notices Updated Successfully');\n }",
"public function sendUserUpdateNotification(): void\n {\n $this->notify(new VerifyAccountNotification());\n }",
"public function update_active()\n\t{\t\n\t\t$change_status=$this->input->post('status_value');\n\t\t$status_record = array('status' => $this->input->post('status_record'));\n\t\t\n\t\tif ($status_record['status'] == 0) {\n\t\t\t$status_record['status'] = 1;\n\t\t}\n\n\t\tforeach ($change_status as $status) {\n\t\t\t\t\t$this->AboutModel->update_status($status , $status_record);\n\t\t\t\t}\n\t\t $this->session->set_flashdata('msg', 'Status Changed Successfully ');\n\t}",
"public function admin_notice() {\n // Notices filter and run the notices function.\n $admin_notices = apply_filters( 'nf_admin_notices', array() );\n self::$instance->notices->admin_notice( $admin_notices );\n }"
] |
[
"0.6236869",
"0.5988746",
"0.59700805",
"0.5869287",
"0.58479095",
"0.5725015",
"0.5673441",
"0.5671164",
"0.5652169",
"0.5633414",
"0.5615055",
"0.5590321",
"0.5579663",
"0.5447475",
"0.54337",
"0.5422249",
"0.5418307",
"0.5399576",
"0.5396678",
"0.53889287",
"0.53591835",
"0.5338637",
"0.5336819",
"0.5287192",
"0.5285738",
"0.5252706",
"0.5252506",
"0.52469164",
"0.52415955",
"0.5227096"
] |
0.6069951
|
1
|
Creates a new Service model. If creation is successful, the browser will be redirected to the 'view' page.
|
public function actionCreate()
{
$model = new Service();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$cities = Yii::$app->getRequest()->post('cities');
$model->attachCities($cities);
$requestTypes = Yii::$app->getRequest()->post('request_types');
$model->attachRequestTypes($requestTypes);
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('create', [
'model' => $model,
]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function actionCreate()\n {\n $model = new Service();\n if($model->load(Yii::$app->request->post()) ){\n $model->created_by=Yii::$app->user->id;\n $model->created_at=time();\n if ( $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new ClinicServices();\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->save()) {\n\n $model->upload();\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create(){\n return view('admin/service/service_create');\n }",
"public function create()\n {\n $services = Service::all();\n return view('backend.service-detail.create',compact('services'));\n }",
"public function create()\n {\n $services = Service::all();\n return view('back.service.addService', compact('services'));\n }",
"public function create()\n {\n //\n\t\treturn view('services.create');\n }",
"public function create()\n {\n return view(\"backoffice.service_detail.create\");\n }",
"public function create()\n {\n return view('admin/services.service.create');\n }",
"public function actionCreate()\n {\n $model = new Services();\n $model2 = new \\app\\models\\Photos();\n //$model2->setAttribute('path',$_FILES[\"photos\"]['path']);\n \n $categories = ServiceCategories::find()->all();\n $categoryArray = [];\n foreach($categories as $category){\n $categoryArray[$category->id ] = $category->title;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id, 'serviceCategoriesId' => $model->serviceCategoriesId, 'hairdressersId' => $model->hairdressersId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'model2' => $model2,\n 'categories' => $categoryArray,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Erform();\n \n if ($model->load(Yii::$app->request->post()))\n {\n $model->service_req = json_encode($model->service_req);\n $model->status = 1;\n \n\n if($model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n\n \n } else {\n var_dump($model->getErrors());exit;\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n }",
"public function create()\n {\n return view(\"admin.services.create\");\n }",
"public function create()\r\n {\r\n $serviceCategory = ServiceCategory::all();\r\n return view('admin.service.services.form', compact('serviceCategory'));\r\n }",
"public function actionCreate() {\n\t\t$model = new ServiceDrug;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif (isset($_POST['ServiceDrug'])) {\n\t\t\t$model->attributes = $_POST['ServiceDrug'];\n\t\t\tif ($model->save()) {\n\t\t\t\t$this->redirect(array('view', 'id' => $model->id));\n\t\t\t}\n\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t'model' => $model,\n\t\t));\n\t}",
"public function create()\n {\n return view('admin.services.create');\n \n }",
"public function create()\n {\n $service = new Service;\n $service_code = self::generateServiceCode();\n $ships = Ship::all();\n \n return view('service.create', compact('service', 'service_code','ships'));\n }",
"public function create()\r\n\t{\r\n\t\treturn View::make('services.create');\r\n\t}",
"public function store(CreateServiceRequest $request)\n {\n $service = new Service;\n $service->title = $request->title;\n $service->price = $request->price;\n $service->save();\n return redirect('/services');\n }",
"public function actionCreate()\n {\n $model = new JetShopDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n $customers = Customer::all();\n $items = Item::all();\n $cars=Car::all();\n $services=Service::all();\n return view('Admin.serviceMaintenance.create', compact('customers', 'items','cars','services'));\n \n }",
"public function create()\n\t{\n\t\treturn view('recinto_servicios.create');\n\t}",
"public function addService()\n {\n $option = 'submitnewservice';\n return view('cmsServicesAdd', ['title'=>'Add Service','option'=>$option]);\n }",
"public function store()\r\n\t{\r\n\t\t// validate\r\n\t\t// read more on validation at http://laravel.com/docs/validation\r\n\t\t$rules = array (\r\n\t\t\t'name' => 'required|unique:services,name',\r\n\t\t\t'estimated_days' => 'required|numeric|min:1'\r\n\t\t);\r\n\r\n\t\t$validator = Validator::make(Input::all(), $rules);\r\n\r\n\t\t//process\r\n\t\tif ($validator->fails()) {\r\n\t\t\treturn Redirect::to('services/create')\r\n\t\t\t\t->withErrors($validator)\r\n\t\t\t\t->withInput();\r\n\t\t} else {\r\n\t\t\t// store service\r\n\t\t\t$service = new Service();\r\n\t\t\t$service->name \t \t= Input::get('name');\r\n\t\t\t$service->estimated_days\t= Input::get('estimated_days');\r\n\t\t\t$service->organization_id = Auth::user()->organization_id;\r\n\t\t\t$service->is_active = 1;\r\n\t\t\t$service->database = Input::get('database');\r\n\t\t\t$service->tabel = Input::get('tabel');\r\n\t\t\t$service->save();\r\n\r\n\r\n\t\t\t// redirect\r\n\t\t\tSession::flash('message', 'Successfully created service');\r\n\t\t\treturn Redirect::to('services/'.$service->id);\r\n\t\t}\r\n\t}",
"public function create()\n\t{\n\t\treturn View::make('services.create');\n\t}",
"public function store()\n {\n $service = new Service;\n $service->name = Input::get('name');\n $service->icon = Input::get('icon');\n $service->description = Input::get('description');\n $service->long_desc = Input::get('long_desc');\n $service->img_detail = Input::get('img_detail');\n $service->save();\n\n return Redirect::to('/admin/services');\n }",
"public function actionCreate()\n {\n $model = new MaterialesServicios();\n //Desplegables\n $unidad_medida = UnidadMedida::find()->all();\n $presentacion = Presentacion::find()->all();\n //autocompletar\n $sub_especfica = PartidaSubEspecifica::find()\n ->select(['nombre as value', 'id as id'])\n ->asArray()\n ->all();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'sub_especfica' => $sub_especfica,\n 'unidad_medida' => $unidad_medida,\n 'presentacion' => $presentacion\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}",
"public function actionCreate()\n\n {\n\n $model = new Orders();\n\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n\t\t\t\n\n\t\t\tYii::$app->session->setFlash('orders', 'Orders has been added successfully');\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n\n }\n\n }",
"public function create()\n {\n // $services = Service::all();\n $services = Service::all();\n return view('admin.orders.form', compact('services'));\n }",
"public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }"
] |
[
"0.8270163",
"0.7342793",
"0.7199805",
"0.7099891",
"0.70834446",
"0.7038947",
"0.700515",
"0.68822306",
"0.67976403",
"0.67974836",
"0.6780933",
"0.67523503",
"0.6712019",
"0.66456413",
"0.6640352",
"0.6621828",
"0.6611626",
"0.66072965",
"0.6601782",
"0.65978086",
"0.65881145",
"0.6573033",
"0.6559031",
"0.65579575",
"0.6555083",
"0.6545317",
"0.65441644",
"0.6543287",
"0.6537546",
"0.6535852"
] |
0.7840252
|
1
|
Permet d'ajouter une citation
|
public function addCitation($author, $chapter, $content, $date, $image){
// Récuperation de la connection à la base de donnée
// Rappel: pour récupérer une variable défini en dehors de la fonction, on préfixera la variable par "global"
global $bdd;
// Requete d'ajout en base de donnée
mysqli_query($bdd, "INSERT INTO citation (author, chapter, content, date, image) VALUES ('$author', '$chapter', '$content', '$date', '$image')");
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function citationTask()\n\t{\n\t\t// Incoming\n\t\t$format = Request::getString('type', 'bibtex');\n\n\t\t// Get our model and load publication data\n\t\t$this->model = new Models\\Publication($this->_identifier, $this->_version);\n\n\t\t// Make sure we got a result from the database\n\t\tif (!$this->model->exists() || $this->model->isDeleted())\n\t\t{\n\t\t\tNotify::error(Lang::txt('COM_PUBLICATIONS_RESOURCE_NOT_FOUND'));\n\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option, false)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get version authors\n\t\t$authors = $this->model->table('Author')->getAuthors($this->model->version->get('id'));\n\n\t\t// Build publication path\n\t\t$path = $this->model->path('base', true);\n\n\t\tif (!is_dir($path))\n\t\t{\n\t\t\tif (!Filesystem::makeDirectory(PATH_APP . $path, 0755, true, true))\n\t\t\t{\n\t\t\t\t$this->setError('Error. Unable to create path.');\n\t\t\t}\n\t\t}\n\n\t\t// Build the URL for this resource\n\t\t$sef = Route::url($this->model->link('version'));\n\t\t$url = Request::base() . ltrim($sef, '/');\n\n\t\t// Choose the format\n\t\tswitch ($format)\n\t\t{\n\t\t\tcase 'endnote':\n\t\t\t\t$doc = \"%0 \" . Lang::txt('COM_PUBLICATIONS_GENERIC') . \"\\r\\n\";\n\t\t\t\t$doc .= \"%D \" . Date::of($this->model->published())->toLocal('Y') . \"\\r\\n\";\n\t\t\t\t$doc .= \"%T \" . trim(stripslashes($this->model->version->get('title'))) . \"\\r\\n\";\n\n\t\t\t\tif ($authors)\n\t\t\t\t{\n\t\t\t\t\tforeach ($authors as $author)\n\t\t\t\t\t{\n\t\t\t\t\t\t$name = $author->name ? $author->name : $author->p_name;\n\t\t\t\t\t\t$auth = preg_replace('/{{(.*?)}}/s', '', $name);\n\t\t\t\t\t\tif (!strstr($auth, ','))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$bits = explode(' ', $auth);\n\t\t\t\t\t\t\t$n = array_pop($bits) . ', ';\n\t\t\t\t\t\t\t$bits = array_map('trim', $bits);\n\t\t\t\t\t\t\t$auth = $n . trim(implode(' ', $bits));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$doc .= \"%A \" . trim($auth) . \"\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$doc .= \"%U \" . $url . \"\\r\\n\";\n\t\t\t\tif ($this->model->published())\n\t\t\t\t{\n\t\t\t\t\t$doc .= \"%8 \" . Date::of($this->model->published())->toLocal('M') . \"\\r\\n\";\n\t\t\t\t}\n\t\t\t\tif ($this->model->version->get('doi'))\n\t\t\t\t{\n\t\t\t\t\t$doc .= \"%1 \" . 'doi:' . $this->model->version->get('doi');\n\t\t\t\t\t$doc .= \"\\r\\n\";\n\t\t\t\t}\n\n\t\t\t\t$file = 'publication' . $this->model->get('id') . '.enw';\n\t\t\t\t$mime = 'application/x-endnote-refer';\n\t\t\tbreak;\n\n\t\t\tcase 'bibtex':\n\t\t\tdefault:\n\t\t\t\tinclude_once Component::path('com_citations') . DS . 'helpers' . DS . 'BibTex.php';\n\n\t\t\t\t$bibtex = new \\Structures_BibTex();\n\t\t\t\t$addarray = array();\n\t\t\t\t$addarray['type'] = 'misc';\n\t\t\t\t$addarray['cite'] = Config::get('sitename') . $this->model->get('id');\n\t\t\t\t$addarray['title'] = stripslashes($this->model->version->get('title'));\n\n\t\t\t\tif ($authors)\n\t\t\t\t{\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ($authors as $author)\n\t\t\t\t\t{\n\t\t\t\t\t\t$name = $author->name ? $author->name : $author->p_name;\n\t\t\t\t\t\t$author_arr = explode(',', $name);\n\t\t\t\t\t\t$author_arr = array_map('trim', $author_arr);\n\n\t\t\t\t\t\t$addarray['author'][$i]['first'] = (isset($author_arr[1])) ? $author_arr[1] : '';\n\t\t\t\t\t\t$addarray['author'][$i]['last'] = (isset($author_arr[0])) ? $author_arr[0] : '';\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$addarray['month'] = Date::of($this->model->published())->toLocal('M');\n\t\t\t\t$addarray['url'] = $url;\n\t\t\t\t$addarray['year'] = Date::of($this->model->published())->toLocal('Y');\n\t\t\t\tif ($this->model->version->get('doi'))\n\t\t\t\t{\n\t\t\t\t\t$addarray['doi'] = 'doi:' . DS . $this->model->version->get('doi');\n\t\t\t\t}\n\n\t\t\t\t$bibtex->addEntry($addarray);\n\n\t\t\t\t$file = 'publication_' . $this->model->get('id') . '.bib';\n\t\t\t\t$mime = 'application/x-bibtex';\n\t\t\t\t$doc = $bibtex->bibTex();\n\t\t\tbreak;\n\t\t}\n\n\t\t// Write the contents to a file\n\t\t$fp = fopen($path . DS . $file, \"w\") or die(\"can't open file\");\n\t\tfwrite($fp, $doc);\n\t\tfclose($fp);\n\n\t\t$this->_serveup(false, $path, $file, $mime);\n\n\t\tdie; // REQUIRED\n\t}",
"function CitationStr($entry) {\r\n\t\t$str = $this->StartCitationStr($entry);\r\n\t\t$fullnames = $this->AuthorsStr($entry);\r\n\t\t$str .= '<span class=\"bibtex-author\">' . ($fullnames[strlen($fullnames)-1] == '.' ? substr($fullnames, 0, -1) : $fullnames) . '.</span> ';\r\n\t\t$str .= '(<span class=\"bibtex-year\">' .$entry['year'] . '</span>)';\r\n\t\t$str .= ' <span class=\"bibtex-title\"><a href=\"'.(!isset($entry['paperurl']) ? 'http://www.google.com/search?q=' . $this->RemoveTag($entry['title']) : $entry['paperurl'] ). '\">' . $entry['title'] . '</a></span>. ';\r\n\t\t$str .= (isset($entry['booktitle']) ? 'In <span class=\"bibtex-booktitle\">' . $entry['booktitle'] . '</span>' : '');\r\n\t\t$str .= (isset($entry['journal'])?' <span class=\"bibtex-jname\">' . $entry['journal'] . '</span>':'');\r\n\t\t$str .= (isset($entry['volume'])?', <span class=\"bibtex-volume\">'.$entry['volume'].'</span>':'');\r\n\t\t$str .= (isset($entry['number'])?'<span class=\"bibtex-number\">('.$entry['number'].')</span>':'');\r\n\t\t$str .= (isset($entry['pages']) ? (isset($entry['number']) || isset($entry['volume']) ? '' : ', ') .'<span class=\"bibtex-pages\">'.(isset($entry['volume'])?':':'pages ').'' . $this->PagesStr($entry) . '</span>' : '');\r\n\t\t$str .=\t(isset($entry['publisher']) ? ', <span class=\"bibtex-publisher\">' . $entry['publisher'] . '</span>':'');\r\n\t\t$str .= (isset($entry['note']) ? ', <span class=\"bibtex-note\">' .$entry['note'] . '</span>.' : '' );\r\n\t\t$str .= $this->CitationNoteStr($entry);\r\n\t\t$str .= $this->CitationImplementUrlStr($entry);\r\n\t\t$str .= $this->EndCitationStr();\r\n\t\treturn $str;\r\n\t}",
"function add_or_update_publication_entry(&$entry, $bibtex_file, $ID=NULL) {\n $post = array(\n 'ID' => $ID, //Are you updating an existing post?\n 'post_content' => $this->createContent($entry), //The full text of the post.\n 'post_name' => $entry->getKey(), // The name (slug) for your post\n 'post_status' => 'publish',\n 'post_title' => $entry->getTitle(), //The title of your post.\n 'post_type' => __WP_PLUGIN__, //You may want to insert a regular post, page, link, a menu item or some custom post type\n ); \n $post_id = wp_insert_post( $post ); \n update_post_meta($post_id, 'bibtex', $bibtex_file);\n }",
"function insertQuote(array $data){\n // On ajoute la nouvelle citation\n $pdo = getPDO();\n // La requête SQL\n $sql = \"INSERT INTO citations (texte, auteur) value (?,?)\";\n // Préparation de la requête\n $statement = $pdo->prepare($sql);\n // Paramètres\n $params = [$data[\"texte\"], $data[\"auteur\"]];\n // Exécution des paramètres\n $statement->execute($params);\n}",
"public static function comment_text_add_cite($text, $comment = null, $args = array()) {\n // only change text for pinbacks/trackbacks/webmentions\n if (!$comment) {\n return $text;\n }\n\n // thanks to @snarfed for the idea\n if ($comment->comment_type == \"\" && $canonical = get_comment_meta($comment->comment_ID, \"semantic_linkbacks_canonical\", true)) {\n $host = parse_url($canonical, PHP_URL_HOST);\n\n // strip leading www, if any\n $host = preg_replace(\"/^www\\./\", \"\", $host);\n // note that WordPress's sanitization strips the class=\"u-url\". sigh. :/ also,\n // <cite> is one of the few elements that make it through the sanitization and\n // is still uncommon enough that we can use it for styling.\n $text .= '<p><small>— <cite><a class=\"u-url\" href=\"' . $canonical . '\">via ' . $host .\n '</a></cite></small></p>';\n }\n\n return apply_filters(\"semantic_linkbacks_cite\", $text);\n }",
"function activation_action() { \n // add a sample.bib\n //@file_put_contents(plugin_dir_path(__FILE__).'/sample.bib', \n // \"@article{doe2000,title={An article},author={Jane Doe},journal={The Wordpress Journal},year=2000}\\n\".\n // \"@book{doo2001,title={An bok},author={Jane Doe},year=2001}\");\n \n //add_fake_post\n $post = array(\n 'post_content' => \"[wp-publications bib=sample.bib all=1] gives:\\n[wp-publications bib=sample.bib all=1]\", //The full text of the post.\n 'post_status' => 'publish',\n 'post_title' => 'wp-publications example', //The title of your post.\n ); \n $post_id = wp_insert_post( $post ); \n }",
"public static function setCitation(Citation $citation)\n {\n self::$citation = $citation;\n }",
"static public function cite($content, $attributes=array()) {\n return self::content('cite', $content, $attributes);\n }",
"function create_citation_if_does_not_exist($citation, $t_source)\n {\n\n // /* lookup spreadsheet for mapping\n $this->map = self::get_WD_entity_mappings();\n // */\n \n $citation_obj = self::parse_citation_using_anystyle($citation, 'all', 2);\n if($ret = self::does_title_exist_in_wikidata($citation_obj, $citation, $t_source)) { //orig un-comment in real operation\n print_r($ret);\n return $ret['wikidata_id'];\n }\n else {\n $title = $citation_obj[0]->title[0];\n $title = self::manual_fix_title($title);\n echo \"\\nTitle does not exist (A). [$title]\\n\";\n self::create_WD_reference_item($citation_obj, $citation, $t_source);\n } \n }",
"public function getCitation($cit_num) {\n $sql = 'SELECT cit_num,per_num,per_num_valide,per_num_etu,cit_libelle,cit_date,cit_valide,cit_date_valide,cit_date_depo FROM citation c WHERE cit_num='.$cit_num;\n\n $requete = $this->db->prepare($sql);\n\n $requete->execute();\n\n $ligne = $requete->fetch(PDO::FETCH_OBJ);\n $citation = new Citation($ligne);\n //$citation->ctrlSaisie = new ControleurSaisie();\n $requete->closeCursor();\n return $citation;\n }",
"function bibTex() {\n\t\t$bibtex = '';\n\t\tforeach ($this->data as $entry) {\n\t\t\t//Intro\n\t\t\t$bibtex .= '@' . strtolower($entry['entryType']) . ' { ' . $entry['cite'] . \",\\n\";\n\t\t\t//Other fields except author\n\t\t\tforeach ($entry as $key => $val) {\n\t\t\t\tif ($this->_options['wordWrapWidth'] > 0) {\n\t\t\t\t\t$val = $this->_wordWrap($val);\n\t\t\t\t}\n\t\t\t\tif (!in_array($key, array('cite', 'entryType', 'author', 'editor'))) {\n\t\t\t\t\tif($key != 'url')\n\t\t\t\t\t\t$val = str_replace(array_keys($this->escapedChars), array_values($this->escapedChars), $val);\n\t\t\t\t\tif($key == 'pages')\n\t\t\t\t\t\t$val = str_replace('-', '--', $val);\n\n\t\t\t\t\t$bibtex .= \"\\t\" . $key . ' = {' . $val . \"},\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Author\n\t\t\t$author = '';\n\t\t\tif (array_key_exists('author', $entry)) {\n\t\t\t\tif ($this->_options['extractAuthors']) {\n\t\t\t\t\t$tmparray = array(); //In this array the authors are saved and the joind with an and\n\t\t\t\t\tforeach ($entry['author'] as $authorentry) {\n\t\t\t\t\t\t$tmparray[] = $this->_formatAuthor($authorentry);\n\t\t\t\t\t}\n\t\t\t\t\t$author = join(' and ', $tmparray);\n\t\t\t\t} else {\n\t\t\t\t\t$author = $entry['author'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$editor = '';\n\t\t\tif (array_key_exists('editor', $entry)) {\n\t\t\t\tif ($this->_options['extractAuthors']) {\n\t\t\t\t\t$tmparray = array(); //In this array the authors are saved and the joind with an and\n\t\t\t\t\tforeach ($entry['editor'] as $authorentry) {\n\t\t\t\t\t\t$tmparray[] = $this->_formatAuthor($authorentry);\n\t\t\t\t\t}\n\t\t\t\t\t$editor = join(' and ', $tmparray);\n\t\t\t\t} else {\n\t\t\t\t\t$editor = $entry['editor'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!empty($author))\n\t\t\t\t$bibtex .= \"\\tauthor = {\" . str_replace(array_keys($this->escapedChars), array_values($this->escapedChars), $author) . \"}\";\n\n\t\t\tif(!empty($editor))\n\t\t\t\t$bibtex .= \",\\n\\teditor = {\" . str_replace(array_keys($this->escapedChars), array_values($this->escapedChars), $editor) . \"}\";\n\t\t\t$bibtex.=\"\\n}\\n\\n\";\n\t\t}\n\t\treturn $bibtex;\n\t}",
"public function ajoutPublication($auteurs, $titre_article, $reference_publication, $annee, $categorie, $lieu = null, $statut){\n $publicationInseree = new Publication(null, $auteurs, $titre_article, $reference_publication, $annee, $statut, $categorie, $lieu);\n if($this->verificationPublicationBase($publicationInseree)){\n throw new Exception(\"Publication déja présente\");\n }\n\t\t\t//On insère d'abord la publication dans la table Publication\n $reqInsertion= 'INSERT INTO Publication(id, titre_article, reference_publication, annee, categorie, lieu, statut, date_ajout) VALUES(?, ?, ?, ?, ?, ?, ?, ?)';\n $this->executerRequete($reqInsertion, array(NULL, $titre_article, $reference_publication, $annee, $categorie, $lieu, $statut, date(\"Y-m-d\"))); \n //On récupère l'id de la publication que l'on viens d'inserer\n $reqIdPublication = 'SELECT LAST_INSERT_ID()'; \n $idPublications = $this->executerRequete($reqIdPublication);\n $idPublication = $idPublications->fetch()[0];\n $place = 1;\n\t\t\tforeach($auteurs as $auteur){\n //On verifie que l'auteur n'est pas déja présent dans la BDD\n //Si il ne l'est pas on l'ajoute\n if(!$this->verificationAuteurBase($auteur)){\n $this->ajouterChercheur($auteur);\n //On récupère l'ID de l'auteur que l'on viens d'inserer\n $reqIdAuteur = 'SELECT LAST_INSERT_ID()';\n $idAuteurs = $this->executerRequete($reqIdAuteur);\n $idAuteur = $idAuteurs->fetch()[0];\n }\n //Si il l'est on recupère son id\n else{\n $idAuteur = $this->verificationAuteurBase($auteur);\n }\n //On insère dans la table rédige les couples idAuteur/idPublication\n\t\t $reqInsRedige = 'INSERT INTO redige(Publication_id, Auteur_id, place) VALUES(?, ?, ?)'; \n\t\t\t $this->executerRequete($reqInsRedige, array($idPublication, $idAuteur, $place));\n $place++;\n\t\t\t}\n\t\t}",
"function fergcorp_blockquote_cite( $content ) {\n\t$content = preg_replace_callback( \"/<blockquote cite[ ]?=[ ]?[\\\"|'](.*?)[\\\"|'][ ]?>/\", 'fergcorp_blockquote', $content );\n\n\treturn $content;\n}",
"function inc_journal_dist($phrase, $opt = array()) {\n\tif (_IS_BOT)\n\t\treturn;\n\n\tif (!strlen($phrase))\n\t\treturn;\n\tif ($opt)\n\t\t$phrase .= \" :: \".str_replace(\"\\n\", ' ', join(', ',$opt));\n\n\t/**\n\t * Journalise t on en base ou pas\n\t * @var unknown_type\n\t */\n\t$config = unserialize($GLOBALS['meta']['bigbrother']);\n\tif(isset($config[$opt['faire']]) && ($config[$opt['faire']] == 'oui')){\n\t\tif((lire_config('bigbrother/enregistrer_ip') == 'oui') && !$opt['infos']['ip']){\n\t\t\t$opt['infos']['ip'] = $GLOBALS['ip'];\n\t\t}\n\t\tif($f = charger_fonction($opt['faire'],'journal',true)){\n\t\t\t$f($opt);\n\t\t}else{\n\t\t\t$champs = array(\n\t\t\t\t\t'id_auteur' => $opt['qui'],\n\t\t\t\t\t'action' => $opt['faire'],\n\t\t\t\t\t'id_objet' => $opt['id'],\n\t\t\t\t\t'objet' => $opt['quoi'],\n\t\t\t\t\t'infos' => $opt['infos'],\n\t\t\t\t\t'date' => $opt['date'] ? $opt['date'] : date('Y-m-d H:i:s', time())\n\t\t\t\t);\n\t\t\t// Envoyer aux plugins\n\t\t\t$champs = pipeline('pre_edition',\n\t\t\t\tarray(\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'table' => 'spip_journal',\n\t\t\t\t\t\t'action'=>'inserer'\n\t\t\t\t\t),\n\t\t\t\t\t'data' => $champs\n\t\t\t\t)\n\t\t\t);\n\t\t\tif(is_array($champs['infos'])){\n\t\t\t\t$champs['infos'] = serialize($champs['infos']);\n\t\t\t}\n\t\t\tsql_insertq(\n\t\t\t\t'spip_journal',\n\t\t\t\t$champs\n\t\t\t);\n\t\t}\n\t}\n\tinclude_spip('inc/filtres');\n\tspip_log(filtrer_entites($phrase), 'journal');\n}",
"function censusCitation($year, $page, $idir, $type)\n{\n global $connection;\n global $debug;\n\n if ($type == Citation::STYPE_BIRTH &&\n \t!is_null($idir))\n {\t // citation to birth\n \t// extract keys identifying the specific page of the census\n \t// from the citation string\n \t$prov\t\t = '';\n \t$dist\t \t= 0;\n \t$subdist \t= '';\n \t$div\t \t= '';\n \t$pagenum \t= 0;\n \t$pattern \t= \"/^([A-Z]{2},|) *(dist *([0-9.]+)|).*?, *(subdist ([A-Z0-9]+)|)(.*?)(div *([A-Z0-9]+)|) *page *([0-9]+)/i\";\n \t//$pattern\t= \"/^(([A-Z]{2},|))/i\";\n \t$count\t \t= preg_match($pattern,\n \t\t\t\t \t\t $page,\n \t\t\t\t \t\t $matches);\n \tif ($count == 1)\n \t{\n \t if ($debug)\n \t\t\tprint \"\\\"matches\\\" : \" . print_r($matches, true) . \",\\n\";\n \t if (strlen($matches[1]) == 3)\n \t\t\t$prov\t= substr($matches[1],0,2);\n \t else\n \t\t\t$prov\t= \"''\";\n \t $dist\t = $matches[3];\n \t $subdist\t= $matches[5];\n \t $div\t = $matches[8];\n \t $pagenum\t= $matches[9];\n \t if ($debug)\n \t {\n \t\t\tprint \"\\\"prov\\\" : \" . json_encode($prov) . \",\\n\";\n \t\t\tprint \"\\\"dist\\\" : \" . json_encode($dist) . \",\\n\";\n \t\t\tprint \"\\\"subdist\\\" : \" . json_encode($subdist) . \",\\n\";\n \t\t\tprint \"\\\"div\\\" : \" . json_encode($div) . \",\\n\";\n \t\t\tprint \"\\\"pagenum\\\" : \" . json_encode($pagenum) . \",\\n\";\n \t }\n \t}\n \telse\n \tif ($debug)\n \t print \"\\\"count\\\" : \" . json_encode($count) . \",\\n\";\n\n \t// get information about the individual in a format\n \t// suitable for use in the SQL command\n \t// the individual may be identified in the census by\n \t// birth name, married name, or other alternate name\n\n \tprint \",\\n \\\"alt\\\" : {\\n\";\n \t$nameparms\t = array('idir' => $idir);\n \t$namerecs\t = new RecordSet('Names', $nameparms);\n\n \t$whereName\t = '';\n \t$genderTest\t = '';\n \t$or\t\t = '';\n $sqlParms\t = array();\n \tforeach($namerecs as $idnx => $namerec)\n \t{\n \t $surname\t = $namerec->get('surname');\n \t $givenname\t = $namerec->get('givenname');\n \t $birthsd\t = $namerec->get('birthsd');\n \t $gender\t = $namerec->get('gender');\n \t print \"\\\"row$idnx\\\" : {\\n\";\n \t print \"\\\"idnx\\\" : \" . json_encode($idnx) . \",\\n\";\n \t print \"\\\"surname\\\" : \" . json_encode($surname) . \",\\n\";\n \t print \"\\\"givenname\\\" : \" . json_encode($givenname) . \",\\n\";\n \t print \"\\\"birthsd\\\" : \" . json_encode($birthsd) . \",\\n\";\n \t print \"\\\"gender\\\" : \" . json_encode($gender) . \"\\n\";\n \t print \"}\\n\";\n \t $sqlParms['surname' . $idnx]\t= $surname;\n \t $sqlParms['partGiven' . $idnx]\t= substr($givenname, 0, 2);\n \t if (strlen($genderTest) == 0)\n \t {\t\t // add gender test\n \t\t\tif ($gender == 0)\n \t\t\t\t$genderTest\t= \"SEX='M' AND \";\n \t\t\telse\n \t\t\tif ($gender == 1)\n \t\t\t\t$genderTest\t= \"SEX='F' AND \";\n \t }\t\t // add gender test\n \t $whereName\t.= \"$or(LEFT(SOUNDEX(:surname$idnx),4)=SurnameSoundex AND \" .\n \t\t\t\t\t\t\"LOCATE(:partGiven$idnx, GivenNames) > 0)\";\n \t $or\t\t = ' OR ';\n $birthYear\t= floor($birthsd/10000);\n \t}\t // loop through matching names\n \tprint \"}\";\n\n \tif (strlen($whereName) > 0)\n \t{\t // have at least one name to check\n \t // search the census page for a vague match\n \t $sqlParms['dist']\t\t= $dist;\n \t $sqlParms['subdist']\t= $subdist;\n \t $sqlParms['div']\t\t= $div;\n \t $sqlParms['pagenum']\t= $pagenum;\n \t $sqlParms['birthYear']\t= $birthYear;\n \t if ($year < 1867)\n \t {\n \t\t\t$sqlParms['prov']\t= $prov;\n \t\t\t$select\t= \"SELECT Line, Surname, GivenNames FROM Census$year \" .\n \t\t\t\t\t\" WHERE Province=:prov AND\" .\n \t\t\t\t\t\" District=:dist AND\" .\n \t\t\t\t\t\" SubDistrict=:subdist AND\" .\n \t\t\t\t\t\" Division=:div AND\" .\n \t\t\t\t\t\" Page=:pagenum AND $genderTest\" .\n \t\t\t\t\t\" ($whereName) AND\" .\n \t\t\t\t\t\" ABS(BYear - :birthYear) < 3\";\n \t }\n \t else\n \t\t\t$select\t= \"SELECT Line, Surname, GivenNames FROM Census$year \" .\n \t\t\t\t\t\"WHERE District=:dist AND \" .\n \t\t\t\t\t\"SubDistrict=:subdist AND \" .\n \t\t\t\t\t\"Division=:div AND \" .\n \t\t\t\t\t\"Page=:pagenum AND $genderTest \" .\n \t\t\t\t\t\"($whereName) AND \" .\n \t\t\t\t\t\"ABS(BYear - :birthYear) < 3\";\n \t $sqlParmsText\t= print_r($sqlParms, true);\n \t $stmt\t\t = $connection->prepare($select);\n \t if ($stmt->execute($sqlParms))\n \t {\t // select succeeded\n \t\t\t$sresult\t= $stmt->fetchAll(PDO::FETCH_ASSOC);\n \t\t\t$count\t\t= count($sresult);\n print \",\\n \\\"select\\\" : {\\n\";\n print \" \\\"count\\\" : $count,\";\n print \" \\\"cmd\\\" : \" .\n json_encode($select) . \",\\n\";\n print \" \\\"parms\\\" : \" .\n json_encode($sqlParmsText) . \"\\n\";\n print \" }\";\n $comma = \",\\n\";\n \t\t\tforeach($sresult as $row)\n \t\t\t{\t // found match in census\n \t\t\t $line\t = $row['line'];\n \t\t\t $csurname\t = $row['surname'];\n \t\t\t $cgivennames = $row['givennames'];\n\n \t\t\t print \",\\n \\\"row$line\\\" : {\\n\";\n \t\t\t print \"\t \\\"line\\\" : $line,\\n\";\n print \"\t \\\"surname\\\" : \" . \n json_encode($csurname) . \",\\n\";\n print \" \\\"givennames\\\" : \" .\n json_encode($cgivennames) . \"\\n\";\n print \"\\n }\";\n\n \t\t\t if ($count == 1)\n \t\t\t {\t\t// unique match\n \t\t\t\t\tif ($year < 1867)\n \t\t\t\t\t $censusId\t\t= $prov . $year;\n \t\t\t\t\telse\n \t\t\t\t\t $censusId\t\t= 'CA' . $year;\n \t\t\t\t\t$line\t= new CensusLine(array(\n \t\t\t\t\t\t\t\t 'Census'\t=> $censusId,\n \t\t\t\t\t\t\t\t 'District'\t=> $dist,\n \t\t\t\t\t\t\t\t 'SubDistrict'=> $subdist,\n \t\t\t\t\t\t\t\t 'Division'\t=> $div,\n \t\t\t\t\t\t\t\t 'Page'\t\t=> $pagenum),\n \t\t\t\t\t\t\t\t $line);\n \t\t\t\t\t$line->set('idir', $idir);\n $result\t\t= $line->save();\n print \",\\n \\\"sqlcmd\" . __LINE__ . \"\\\" : \" .\n json_encode($line->getLastSqlCmd());\n \t\t\t }\t\t// unique match\n \t\t\t}\t\t // found matches in census\n \t }\t\t // select succeeded\n \t else\n \t {\t // failed to select records\n print \" \\\"select\\\" : {\\n\";\n print \" \\\"failed\\\" : true,\";\n print \" \\\"cmd\\\" : \" .\n json_encode($select) . \",\\n\";\n print \" \\\"parms\\\" : \" .\n json_encode($sqlParmsText) . \",\\n\";\n print \" \\\"msg\\\" : \" .\n json_encode(print_r($stmt->errorInfo(),true)) . \"\\n\";\n print \" },\\n\";\n \t }\t // failed\n \t}\t // have at least one name to check\n }\t\t // citation to birth\n}",
"public function loadLinkedFromdeterminationcitation() { \n // ForeignKey in: determinationcitation\n $t = new determinationcitation();\n }",
"function ajout_avis($db, $avis, $article) {\n\t\t//if(interdit($avis))\n\t\t\t//{\t\n\t\t\t\t$article=htmlentities($article, ENT_QUOTES);\n\t\t\t\t$query = 'INSERT INTO commentaire (id_user, id_art, commentaire) VALUES (:id_user, :id_art, :commentaire)';\n\t\t\t\t$prep = $db -> prepare($query);\n\t\t\t\t$prep -> bindValue('id_user', $_SESSION['id_user'], PDO::PARAM_INT);\n\t\t\t\t$prep -> bindValue('id_art', $article, PDO::PARAM_INT);\n\t\t\t\t$prep -> bindValue('commentaire', $avis, PDO::PARAM_STR);\n\t\t\t\t$prep -> execute();\n\t\t\t\t$prep->closeCursor();\n\t\t\t\t$prep = NULL;;\n\t\t\t//}\n\n\t}",
"private function create_WD_reference_item($citation_obj, $citation, $t_source)\n {\n $obj = $citation_obj[0];\n\n // /* manual fixes\n if($val = @$obj->title[0]) $obj->title[0] = self::manual_fix_title($val);\n // */\n\n // print_r($obj); exit(\"\\nstop muna\\n\");\n $rows = array();\n $rows[] = 'CREATE';\n\n // /* scholarly ?\n // The \"instance of\" classifications: To keep things simple, we could use \"scholarly article\" if the reference parsers tell us it's a journal article, \n // and \"scholarly work\" for everything else.\n $publication_types = array(\"article-journal\", \"chapter\", \"book\");\n if(in_array(@$obj->type, $publication_types)) {}\n else echo(\"\\nUndefined publication type. [\".@$obj->type.\"]\\nWill terminate.\\n\");\n if(stripos(@$obj->type, 'journal') !== false) $scholarly = \"scholarly article\";\n else $scholarly = \"scholarly work\";\n // */\n\n // /* first two entries: label and description\n # LAST TAB Lfr TAB \"Le croissant magnifique!\"\n if($title = @$obj->title[0]) {\n $rows[] = 'LAST|Len|' .'\"'.$title.'\"';\n $rows[] = 'LAST|Den|' .'\"'.self::build_description($obj, $scholarly).'\"';\n }\n // */\n\n // /* scholarly xxx\n // if($dois = @$obj->doi) $rows[] = \"LAST|P31|Q13442814\"; // instance of -> scholarly article //old\n if($scholarly == \"scholarly article\") $rows[] = \"LAST|P31|Q13442814 /* scholarly article */\"; // instance of -> scholarly article\n else $rows[] = \"LAST|P31|Q55915575 /* scholarly work */\"; // instance of -> scholarly work\n // */\n\n if($authors = @$obj->author) $rows = self::prep_for_adding($authors, 'P2093', $rows); #ok use P50 if author is an entity\n if($publishers = @$obj->publisher) $rows = self::prep_for_adding($publishers, 'P123', $rows, \"publisher\");\n if($place_of_publications = @$obj->location) $rows = self::prep_for_adding($place_of_publications, 'P291', $rows, \"place of publication\");\n if($pages = @$obj->pages) $rows = self::prep_for_adding($pages, 'P304', $rows, \"page(s)\"); #ok\n // if($issues = @$obj->issue) $rows = self::prep_for_adding($issues, 'P433', $rows); #ok\n if($volumes = @$obj->volume) $rows = self::prep_for_adding($volumes, 'P478', $rows, \"volume\"); #ok\n if($publication_dates = @$obj->date) $rows = self::prep_for_adding($publication_dates, 'P577', $rows, \"publication date\"); #ok\n if($chapters = @$obj->chapter) $rows = self::prep_for_adding($chapters, 'P792', $rows, \"chapter\"); //No 'chapter' parsed by AnyStyle. Eli should do his own parsing.\n if($titles = @$obj->title) $rows = self::prep_for_adding($titles, 'P1476', $rows, \"title\"); #ok\n\n // /* Eli's initiative, but was given a go signal -> property 'type of reference' (P3865)\n if($type = @$obj->type) $rows = self::prep_for_adding(array($type), 'P3865', $rows); #ok\n // */\n\n // /* Eli's initiative but close to Jen's \"published in\" (P1433) proposal\n if($containers = @$obj->{\"container-title\"}) $rows = self::prep_for_adding($containers, 'P1433', $rows, \"published in\"); #ok\n // */\n\n // Others:\n if($dois = @$obj->doi) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\"); #ok\n else { //check if t.source is DOI, if yes use it | New: Mar 13, 2023\n if($dois = $this->get_doi_from_tsource($t_source)) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\");\n }\n /* seems no instructions to use this yet:\n if($reference_URLs = @$obj->url) $rows = self::prep_for_adding($reference_URLs, 'P854', $rows);\n */\n\n /* Eli's choice: will take Jen's approval first -> https://www.wikidata.org/wiki/Property:P1683 -> WikiData says won't use it here.\n $rows = self::prep_for_adding(array($citation), 'P1683', $rows);\n */\n\n print_r($rows);\n $WRITE = Functions::file_open($this->citation_export_file, \"w\");\n foreach($rows as $row) fwrite($WRITE, $row.\"\\n\");\n fclose($WRITE);\n\n // /* new: so it continues...\n $this->debug['citation not matched in WD'][$t_source][$citation] = '';\n return \"-to be assigned-\";\n // */\n\n /* NEXT TODO: is the exec_shell command to trigger QuickStatements */\n exit(\"\\n[$t_source]\\n[$citation]\\nUnder construction...\\n\");\n \n /* Reminders:\n CREATE\n LAST\tP31\tQ13442814\n instance of -> scholarly article\n\n scholarly article https://www.wikidata.org/wiki/Q13442814 for anything with a DOI and \n scholarly work https://www.wikidata.org/wiki/Q55915575 for all other items we create for sources.\n */\n \n // CREATE\n // LAST|Len|\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|Den|\"scholarly article by G\"\n // LAST|P31|Q13442814 /* scholarly article */\n // LAST|P2093|\"G, Brazil Flora\"\n // LAST|P478|\"393\" /* volume */\n // LAST|P577|+2019-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|P356|\"10.15468/1mtkaw\" /* DOI */\n\n\n // created...\n // [t.source] => https://doi.org/10.1007/978-3-662-02604-5_58\n // [t.citation] => C. N. PAGE. 1990. Pinaceae. In: The families and genera of vascular plants. Volume I; Pteridophytes and Gymnosperms. K. Kubitzki, K. U. Kramer and P. S. Green, eds.\n // https://www.wikidata.org/wiki/Q117088084\n // CREATE\n // LAST|Len|\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by PAGE\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"PAGE, C.N.\"\n // LAST|P478|\"I\" /* volume */\n // LAST|P577|+1990-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|P356|\"10.1007/978-3-662-02604-5_58\" /* DOI */\n\n // to be created...\n // [t.source] => https://doi.org/10.1007/978-3-540-31051-8\n // [t.citation] => J.W. Kadereit, C. Jeffrey, K. Kubitzki (eds). 2007. The families and genera of vascular plants. Volume VIII; Flowering Plants; Eudicots; Asterales. Springer Nature.\n // CREATE\n // LAST|Len|\"The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by Kadereit et al.\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"Kadereit, J.W.\"\n // LAST|P2093|\"Jeffrey, C.\"\n // LAST|P2093|\"Kubitzki, K.\"\n // LAST|P123|\"Flowering Plants; Eudicots; Asterales. Springer Nature\" /* publisher */\n // LAST|P478|\"VIII\" /* volume */\n // LAST|P577|+2007-00-00T00:00:00Z/9\n // LAST|P1476|en:\"The families and genera of vascular plants\"\n // LAST|P3865|Q55915575 /* book */\n // LAST|P356|\"10.1007/978-3-540-31051-8\" /* DOI */\n \n \n }",
"public static function insert(string $reference, string $authors, string $title, string $date, string $journal = NULL, string $volume = NULL, string $number = NULL, string $pages = NULL, string $note = NULL, string $abstract = NULL, string $keywords = NULL, string $series = NULL, string $localite = NULL, string $publisher = NULL, string $editor = NULL, string $pdf = NULL, string $date_display = NULL, int $category_id = NULL){\n global $base, $login, $password;\n\n $publicationGW = new PublicationGateway(new Connection($base, $login, $password));\n $publicationGW->insert($reference, $authors, $title, $date, $journal, $volume, $number, $pages, $note, $abstract, $keywords, $series, $localite, $publisher, $editor, $pdf, $date_display, $category_id);\n }",
"function crear_cita($cita) {\n $this->db->insert('citas', $cita);\n }",
"function Build($publication) {\n\n\t\t$this->publication=$publication;\n\n\t\t// $this->Parse(file_get_contents($this->publication->getFullname())); // This requires >4.3.0\n\t\t\n\t\t$bibtex = file($this->publication->getFullname());\n\t\t$citation = '';\n\t\tfor ($index=0; $index<count($bibtex); $index++) // Less elegant, but backward compatible\n\t\t\t$citation = $citation . $bibtex[$index];\n\t\t$this->Parse($citation);\n\t}",
"public function addPublique(String $titre)\n {\n $this->gwL->ajouterListePublique($titre);\n }",
"public function filterItemCitation($citation,$args)\n\t{\n\t\t$item = $args['item'];\n \n $publication = option('site_title');\n \n $creator = metadata($item,array('Dublin Core','Creator')) ? metadata($item,array('Dublin Core','Creator')).', ' : null;\n \n $title = metadata($item,array('Dublin Core','Title')) ? metadata($item,array('Dublin Core','Title')) : null;\n \n $date = metadata($item,array('Dublin Core','Date')) ? ' '.metadata($item,array('Dublin Core','Date')) : null;\n \n if(element_exists('Dublin Core','Provenance')){\n\t \n\t $provenance=metadata($item,array('Dublin Core','Provenance')) ? metadata($item,array('Dublin Core','Provenance')).', ' : null; \n\t \n }else{\n\t \n\t $provenance = null;\n\t \n }\n \n $today = date(\"F j, Y\");\n \n $url = WEB_ROOT.'/items/show/'.$item->id;\n\n\t\t$citation = $creator.$title.$date.'. '.$provenance.'<em>'.$publication.'</em>, accessed '.$today.', '.$url;\n\n return $citation;\n }",
"public function addAnnonce($nom_annonce, $description_annonce, $prix_annonce, $date_depot, $photo_annonce, $categorie_id, $utilisateur_id, $region_id){\n $db = $this->getPDO();\n //les private\n $this->nom_annonce = $nom_annonce;\n $this->description_annonce = $description_annonce;\n $this->prix_annonce = $prix_annonce;\n $this->date_depot = $date_depot;\n $this->photo_annonce = $photo_annonce;\n $this->categorie_id = $categorie_id;\n $this->utilisateur_id = $utilisateur_id;\n $this->region_id = $region_id;\n\n $sql = \"INSERT INTO `annonces`(`nom_annonce`, `description_annonce`, `prix_annonce`, `photo_annonce`, `date_depot`, `categorie_id`, `utilisateur_id`, `regions_id`) VALUES (?,?,?,?,?,?,?,?)\";\n\n $insert = $db->prepare($sql);\n\n $insert->bindParam(1,$nom_annonce);\n $insert->bindParam(2, $description_annonce);\n $insert->bindParam(3, $prix_annonce);\n $insert->bindParam(4, $photo_annonce);\n $insert->bindParam(5, $date_depot);\n $insert->bindParam(6, $categorie_id);\n $insert->bindParam(7, $utilisateur_id);\n $insert->bindParam(8, $region_id);\n\n $insert->execute(array($nom_annonce, $description_annonce, $prix_annonce, $photo_annonce, $date_depot, $categorie_id, $utilisateur_id, $region_id));\n\n return $insert;\n }",
"public function insert(string $reference, string $authors, string $title, string $date, string $journal = NULL, string $volume = NULL, string $number = NULL, string $pages = NULL, string $note = NULL, string $abstract = NULL, string $keywords = NULL, string $series = NULL, string $localite = NULL, string $publisher = NULL, string $editor = NULL, string $pdf = NULL, string $date_display = NULL, int $category_id){\n $query = 'INSERT INTO Publication (`reference`, `authors`, `title`, `date`, `journal`, `volume`, `number`, `pages`, `note`, `abstract`, `keywords`, `series`, `localite`, `publisher`, `editor`, `pdf`, `date_display`, `categorie_id`) VALUES (:reference, :authors, :title, :date, :journal, :volume, :number, :pages, :note, :abstract, :keywords, :series, :localite, :publisher, :editor, :pdf, :date_display, :category_id);';\n $this->connection->executeQuery($query, array(\n ':reference' => array($reference, PDO::PARAM_STR),\n ':authors' => array($authors, PDO::PARAM_STR),\n ':title' => array($title, PDO::PARAM_STR),\n ':date' => array($date, PDO::PARAM_STR),\n ':journal' => array($journal, PDO::PARAM_STR),\n ':volume' => array($volume, PDO::PARAM_STR),\n ':number' => array($number, PDO::PARAM_STR),\n ':pages' => array($pages, PDO::PARAM_STR),\n ':note' => array($note, PDO::PARAM_STR),\n ':abstract' => array($abstract, PDO::PARAM_STR),\n ':keywords' => array($keywords, PDO::PARAM_STR),\n ':series' => array($series, PDO::PARAM_STR),\n ':localite' => array($localite, PDO::PARAM_STR),\n ':publisher' => array($publisher, PDO::PARAM_STR),\n ':editor' => array($editor, PDO::PARAM_STR),\n ':pdf' => array($pdf, PDO::PARAM_STR),\n ':date_display' => array($date_display, PDO::PARAM_STR),\n ':category_id' => array($category_id, PDO::PARAM_INT) \n ));\n }",
"public function ajouterAuteurPublication(Publication $publication, Chercheur $chercheur){\n\t\t\t//On verifie que l'auteur n'est pas déja indiqué dans la liste des auteurs\n\t\t\tif(!$publication->verificationAuteur($chercheur)){\n\t\t\t $sql = 'INSERT INTO redige(Publication_id, Auteur_id, place) VALUES (?, ?, ?)';\n\t\t\t $this->executerRequete($sql, array($publication->getId(), $chercheur->getId(), 0));\n\t\t\t}\n\t\t}",
"function newArticle(Article $cours) {\n $query = $this->dbh->prepare(\"INSERT INTO articles (discipline, titre, contenu, auteur, creation_date) \"\n . \"VALUES (:discipline,:titre, :contenu, :auteur, :creation_date);\");\n $query->bindValue('discipline', $cours->getDiscipline());\n $query->bindValue('titre', $cours->getTitre());\n $query->bindValue('contenu', $cours->getContenu());\n $query->bindValue('auteur', $cours->getAuteur());\n $query->bindValue('creation_date', $cours->getDate());\n $query->execute();\n return TRUE;\n }",
"function addPOSEntry()\n{\n\n}",
"function insert_annonce() {\n\n\tspip_log(\"[Vu!] -- Création d'une nouvelle annonce dans la base\", \"vu!\");\n\treturn sql_insertq(\"spip_vu_annonces\", array('date' => date('Y-m-d')));\n\n}",
"public function insert($turmaDisciplina);"
] |
[
"0.5820998",
"0.57513",
"0.56963515",
"0.5501549",
"0.5443854",
"0.5387141",
"0.5355863",
"0.53275603",
"0.53137726",
"0.530817",
"0.5281471",
"0.526014",
"0.5256059",
"0.52511364",
"0.52403104",
"0.5222135",
"0.51456344",
"0.51397234",
"0.51113987",
"0.50862634",
"0.50829273",
"0.5035311",
"0.5030549",
"0.5017813",
"0.50127447",
"0.5003837",
"0.49869347",
"0.49852267",
"0.49668694",
"0.49558565"
] |
0.66429883
|
0
|
Accessor Appointment Date to GET DATE FROM DATABASE
|
public function getAppointmentDateAttribute($value)
{
return Carbon::createFromFormat('Y-m-d', $value)->format('d/m/Y');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getSurveyDateAttribute(){\n return date('d/m/' , strtotime( $this->created_at ) ).(date('Y',strtotime($this->created_at))+543);\n }",
"public function getPaymentDate();",
"function getDate() {\n\t\treturn $this->data_array['adddate'];\n\t}",
"public function getDate() { return $this->date; }",
"public function getProgramDateAttribute()\n {\n return excel_date($this->program->start_date);\n }",
"public function getScheduleDate(){return $this->date;}",
"public function getDate();",
"public function getDate();",
"public function getStartDate();",
"public function getStartDate();",
"public function get()\n {\n return $this->date;\n }",
"public function getDateString(){\n $date = Carbon::parse($this->created_at);\n $date->timezone = 'America/Montreal';\n return $date->format('d/m/Y');\n //return $date->format('m/d/Y');\n }",
"private function getAssetArrivalDateValue() {\n return date('m/d/Y', strtotime($this->attributes['asset_arrival_date']));\n }",
"function getDate() {\n return $this->date;\n }",
"public function todayAppointments(){\n $today = Carbon::today()->format('Y-m-d');\n//dd($today);\n return $this->appointments()->whereDate('date',$today)->orderby('date','asc');\n }",
"public function requestDate();",
"public function getInvdate()\n {\n return $this->invdate;\n }",
"function dbToUIdate() {\r\n\t\t\r\n\t\t$year = substr($this->event_date_time, -19, 4);\r\n\t\t$month = substr($this->event_date_time, -14, 2);\r\n\t\t$day = substr($this->event_date_time, -11, 2);\r\n\r\n\t\t$this->date = $month . \"/\" . $day . \"/\" . $year;\r\n\t\r\n\t}",
"public function getApplicantSubmissionDate()\n {\n return $this->getProperty('applicant_submission_date');\n }",
"public function getStartingDay() : \\DateTime{\n return new \\DateTime(\"{$this->year}-{$this->month}-01\");\n}",
"public function getDate()\r\n {\r\n return $this->date;\r\n }",
"public function getDate(){\n\t\treturn $this->laDate;\n\t}",
"public function get_date_permastruct()\n {\n }",
"function getDate( )\r\n\t{\r\n\t\treturn $this->date;\r\n\t}",
"public function getDate()\n {\n return $this->date = new \\DateTime($this->get()->post_date);\n }",
"public function getDate() {\n return @$this->attributes['date'];\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}",
"function getFecha(){\n\t\treturn $this->fecha;\n\t}",
"public function getRecordDate()\n {\n return $this->record_date;\n }"
] |
[
"0.6269327",
"0.62657934",
"0.6257056",
"0.62138766",
"0.6213823",
"0.61779076",
"0.6034065",
"0.6034065",
"0.6021348",
"0.6021348",
"0.60076636",
"0.60060596",
"0.60030586",
"0.600296",
"0.5951213",
"0.594731",
"0.59308136",
"0.587687",
"0.5873364",
"0.58677816",
"0.58605474",
"0.58579636",
"0.5857812",
"0.58539665",
"0.5853725",
"0.5853414",
"0.58524853",
"0.5836202",
"0.58283895",
"0.58234864"
] |
0.6550149
|
0
|
agrega los productos a la tabla de detalles_venta
|
public static function agregarDetallesModel($id, $tabla, $datos){
$sql = Conexion::conectar()->prepare("INSERT INTO $tabla(id, id_producto, id_venta, nombre, cantidad, precio) VALUES (NULL,:producto, :venta, :nombre, :cantidad, :precio)");
$sql2 = Conexion::conectar()->prepare("UPDATE productos SET stock = stock-:stock WHERE id_producto=:producto");
$sql3 = Conexion::conectar()->prepare("INSERT INTO historial(id_historial, id_producto, id_usuario, id_tienda, fecha, nota, referencia, cantidad) VALUES(NULL, :producto, :usuario, :tienda, :fecha, :nota, :referencia, :cantidad)");
foreach ($_SESSION["carrito"] as $producto) {
$sql->bindParam(":producto", $producto->id_producto, PDO::PARAM_INT);
$sql->bindParam(":venta", $id, PDO::PARAM_INT);
$sql->bindParam(":nombre", $producto->nombre, PDO::PARAM_STR);
$sql->bindParam(":cantidad", $producto->cantidad, PDO::PARAM_INT);
$sql->bindParam(":precio", $producto->precio, PDO::PARAM_STR);
$sql->execute();
$sql2->bindParam(":stock", $producto->cantidad, PDO::PARAM_INT);
$sql2->bindParam(":producto", $producto->id_producto, PDO::PARAM_INT);
$sql2->execute();
$nota = "Venta del producto";
$referencia = "000$datos[usuario]$producto->cantidad$producto->id_producto";
$sql3->bindParam(":producto", $producto->id_producto, PDO::PARAM_INT);
$sql3->bindParam(":usuario", $datos["usuario"], PDO::PARAM_INT);
$sql3->bindParam(":tienda", $datos["tienda"], PDO::PARAM_INT);
$sql3->bindParam(":fecha", $datos["fecha"], PDO::PARAM_INT);
$sql3->bindParam(":nota", $nota, PDO::PARAM_STR);
$sql3->bindParam(":referencia", $referencia, PDO::PARAM_STR);
$sql3->bindParam(":cantidad", $producto->cantidad, PDO::PARAM_STR);
$sql3->execute();
}
return "success";
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function ListarProductosVendidos() \n\t{\n\t\tself::SetNames();\n\t\t$sql =\"SELECT \n\tproductos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, productos.stockminimo, categorias.nomcategoria, SUM(detalleventas.cantventa) as cantidad \n\tFROM\n\t(productos LEFT OUTER JOIN detalleventas ON productos.codproducto=detalleventas.codproducto) LEFT OUTER JOIN categorias ON \n\tcategorias.codcategoria=productos.codcategoria WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? AND detalleventas.codproducto is not null GROUP BY productos.codproducto\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN PRODUCTOS VENDIDOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}",
"public function get_detalle_aros_rec_ini($numero_venta){\n $conectar=parent::conexion();\n parent::set_names();\n\n $sql=\"select p.marca,p.color,p.modelo,p.categoria,d.id_producto,d.numero_venta from producto as p join detalle_ventas as d where p.id_producto=d.id_producto and d.numero_venta=? and categoria='aros';\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1,$numero_venta);\n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n}",
"public function get_AllDetalleproductos() \n {\n $sql=\"select pb.PAR_D_NOMBRE,pa.PAR_D_NOMBRE,p.PRO_D_NOMBRE,p.PRO_E_ESTADOVENTAS from dg_productos p\n INNER JOIN dg_parametros pa on pa.PAR_C_CODIGO=p.PAR_C_CODIGO\n INNER JOIN dg_parametros pb on pb.PAR_C_CODIGO=pa.PAR_C_PADRE;\";\n $res = mysql_query($sql);\n return $res;\n }",
"function listar_producto_vendido(){\n\t\t$sql=\"SELECT SUM(cantidad_det) AS TotalVentas, claves_pro, categoria_pro, producto_det, detal_pro, mayor_pro, id_pro, id_pro AS directorio_image FROM producto, detalle_pedido WHERE producto_det=id_pro GROUP BY producto_det ORDER BY SUM(cantidad_det) DESC LIMIT 0 , 5\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$id_buscar=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image FROM imagen WHERE galeria_image='$id_buscar'\";\n\t\t\t$buscar=mysql_query($sql2)\tor die(mysql_error());\n\t\t\t$resultados=mysql_fetch_array($buscar);\n\t\t\t$resultado['directorio_image']=$resultados['directorio_image'];\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\n\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}",
"public function productosCarrito()\n {\n $total = 0;\n $tabla = \"\";\n $numeroArticulos=0;\n if (isset($_SESSION[\"carritoJDV\"])) {\n $numCarrito=(count($_SESSION[\"carritoJDV\"]));\n for ($i=0; $i<$numCarrito; $i++) {\n \t\t\t$numPiezas=$_SESSION[\"carritoJDV\"][$i][1];\n $numeroArticulos+=$numPiezas;\n }\n $tabla = '<h1 class=\"subTitulos\">Carrito de compras</h1>\n <p class=\"text-muted\">Actualmente tienes '.$numeroArticulos.' artículo(s) en tu carrito.</p>\n <div class=\"table-responsive\">\n <table class=\"table\">\n <thead>\n <tr>\n <th colspan=\"2\">Producto</th>\n <th>Cantidad</th>\n <th>Precio unitario</th>\n <th>Descuento</th>\n <th colspan=\"2\">Total</th>\n </tr>\n </thead>\n <tbody>';\n\n foreach ($_SESSION[\"carritoJDV\"] as $contenido) {\n $prod = $this->BD->ConsultaWhereSimple(\"producto\", \"activo=? AND ID=?\", array(1,$contenido[0]));\n $tabla .= '<tr>\n <td>\n <a href=\"detail.php?id=' . $prod[0][\"ID\"] . '\">\n <img src=\"' . $prod[0][\"img1_prod\"] . '\" alt=\"' . $prod[0][\"nombre_prod\"] . '\">\n </a>\n </td>\n\n <td>\n <a href=\"detail.php?id=' . $prod[0][\"ID\"] . '\">' . $prod[0][\"nombre_prod\"] . ' (' . $contenido[2] . ')</a>\n </td>\n \n <td><form method=\"POST\" action=\"procesos.php\" onchange=\"this.submit();\">\n <input type=\"hidden\" name=\"talla_prod_add\" value=\"' . $contenido[2] . '\">\n <input type=\"hidden\" name=\"id_prod_cart_add\" value=\"' . $prod[0][\"ID\"] . '\">\n <input type=\"number\" name=\"cantidad_prod_add\" value=\"' . $contenido[1] . '\" class=\"quanitySniper\">\n \n </form>\n \n </td>\n \n <td>$' . $prod[0][\"precio_prod\"] . '</td>\n ' . ($prod[0][\"preciodesc_prod\"] > 0 ? \"<td>$\" . ($prod[0][\"precio_prod\"] - $prod[0][\"preciodesc_prod\"]) . \"</td>\" : \"<td>$0</td>\") . ($prod[0][\"preciodesc_prod\"] > 0 ? \"<td>$\" . $prod[0][\"preciodesc_prod\"] * $contenido[1] . \"</td>\" : \"<td>$\" . $prod[0][\"precio_prod\"] * $contenido[1] . \"</td>\") . '\n \n <td><a href=\"procesos.php?deleteprod=' . $prod[0][\"ID\"] . '&talla=' . $contenido[2] . '\"><i class=\"far fa-trash-alt\"></i></a>\n </td>\n </tr>';\n //Problema complejo\n $x=$contenido[1];\n ($prod[0][\"preciodesc_prod\"] > 0 ? ($total = $total + $prod[0][\"preciodesc_prod\"] * $contenido[1]) : ($total = $total + $prod[0][\"precio_prod\"] * $contenido[1]));\n \n }\n \n /**\n * Aqui ya muestra el no. de articulos del carrito\n *var_dump(count($_SESSION[\"carritoJDV\"])); \n *Cuando se inicia sesion, si solo se pone el correo y se da enter, entra a procesos pero ya no avanza\n */\n \n\n $tabla .= '</tbody>\n <tfoot>\n <tr>\n <th colspan=\"5\">Total</th>\n <th colspan=\"2\">$' . $total . '</th>\n </tr>\n </tfoot>\n </table>\n\n </div>\n <!-- /.table-responsive -->\n\n <div class=\"box-footer\">\n <div class=\"pull-right\"><form method=\"post\" action=\"procesos.php\"><input type=\"hidden\" name=\"compra\" value=\"1\">\n <a href=\"basket.php\" class=\"btn btn-default\"><i class=\"fas fa-sync-alt\"></i> Actualizar cesta</a>\n \n <button type=\"submit\" class=\"btn btn-primary\">Proceder a la compra <i class=\"fa fa-chevron-right\"></i>\n </button>\n </form>\n </div>\n </div>';\n } else {\n return \"Aun no cuentas con productos en tu carrito de compras.\";\n }\n return $tabla;\n }",
"public function listar_productos_carrito() {\n \n try {\n $sql = \"\n select \n p.descripcion,\n i.cantidad,\n i.precio_venta,\n e.importe_total,\n p.id_producto\n from \n al_producto p inner join al_inventario i\n on\n p.id_producto = i.id_producto inner join pedido e\n on\n i.id_pedido = e.id_pedido \n where\n e.id_cliente = '$_SESSION[cliente_id]' and e.estado is null; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }",
"public function tablaProductos () \n\t\t{\t\t\n\t\t\t//Javascript !!!\n\t\t\taddJs('js/products_table.js');\n\t\t\thidden ('iter',0); \n\t\t\t\n\t\t\techo '<table id=\"tabla_productos\" bgColor=#333 cellspacing=1 cellpadding=2 width=700><tbody>';\n\t\t\techo '<tr>'.\n\t\t\t\t\t'<th>Cantidad</th><th>Producto</th><th>Precio<br>sin Iva</th>'.\n\t\t\t\t\t'<th>Precio<br>con Iva</th><th>Total Neto</th><th>Total</th><th></th></tr>';\n\n\t\t\techo '</tbody></table>';\n\n\t\t\techo '<table bgColor=#333 cellspacing=1 cellpadding=2 width=700>';\n\t\t\t$this->tablaSumatoria();\n\t\t\techo '</table>';\t\t\t\n\t\t}",
"function consultar_productos($marca=\"\"){\n\t\t//Primero conectarse a la bd\n\t\t$conexion_bd = conectar_bd();\n\n\t\t$resultado = \"<table><thead><tr><th>ID</th><th></th><th>Nombre de Marca</th><th></th><th>Acciones</th></tr></thead>\";\n\n\t\t/*$consulta = 'SELECT pr.descripcion as pr_descripcion, m.nombre as m_nombre, pr.cantidad as pr_cantidad, pr.precio as pr_precio, tp.nombre as tp_nombre, e.nombre as e_nombre FROM producto as pr, productotiene as pt, marca as m, tipoproducto as tp, estatus as e WHERE pr.id_producto = pt.id_producto AND m.id_marca = pt.id_marca AND tp.id_tipo = pt.id_tipo AND e.id_estatus = pt.id_estatus'; */\n\n\t\t$consulta = 'SELECT m.nombre as m_nombre, m.id as m_id FROM marca as m ';\n\t\t\n\t\t//Ahora con el buscador necesitamos un validador de que es lo que quiere buscar\n\t\tif ($marca != \"\") {\n\t\t\t$consulta .= \" WHERE m_id=\".$marca;\n\t\t}\n\n\n\t\t$resultados = $conexion_bd->query($consulta); \n\t\twhile ($row = mysqli_fetch_array($resultados, MYSQLI_BOTH)) {\n\t\t\t//$resultado .= $row[0]; //Se puede usar el índice de la consulta\n\t\t\t$resultado .= \"<tr>\";\n\t\t $resultado .= \"<td>\".$row['m_id'].\"</td>\";\n\t\t $resultado .= \"<td></td>\";\n\t\t $resultado .= \"<td>\".$row['m_nombre'].\"</td>\";\n\t\t $resultado .= \"<td></td>\";\n\t\t $resultado .= \"<td>\";\n\t\t $resultado .= \"<a class=\\\"waves-effect waves-light btn-small\\\"><i class=\\\"material-icons\\\">add_box</i></a>\";\n\t\t $resultado .= \"<a class=\\\"waves-effect waves-light btn-small\\\"><i class=\\\"material-icons\\\">edit</i></a>\";\n\t\t $resultado .= \"<a class=\\\"waves-effect waves-light btn-small\\\" href=\\\"registrarIngresoProductos.php\\\"><i class=\\\"material-icons\\\">receipt</i></a>\";\n\t\t $resultado .= '<a href=\"controlador_eliminar_producto.php?id='.$row['m_id'].'\"';\n\t\t $resultado .= borrarBoton();\n\t\t $resultado .= '</a>' ;\n\n\t\t /* $resultado .= '<a href=\"controlador_eliminar_producto.php?id='.$row['p_id'].' class=\"waves-effect waves-light btn-small red lighten-2\"><i class=\"material-icons\">delete</i></a>';*/\n\n\t\t $resultado .= \"</td>\" ;\n\t\t $resultado .= \"</tr>\" ;\n\t\t}\n\t\tmysqli_free_result($resultados); //Liberar la memoria\n\n\t\t// desconectarse al termino de la consulta\n\t\tdesconectar_bd($conexion_bd);\n\n\t\t$resultado .= \"</tbody></table>\";\n\n\t\treturn $resultado;\n\t}",
"public function Mostrar_Producto(){\r\n\r\n\t\t\t$sql=$this->db->query(\"CALL SP_M_TABLA_PRODUCTO\");\r\n\t\t\twhile($filas=$sql->fetch(PDO::FETCH_ASSOC)){\r\n\t\t\t\t$this->productos[]=$filas;\r\n\t\t\t}\r\n\t\t\treturn $this->productos;\r\n\t\t}",
"public function ListarProductos()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"public function VerDetallesIngredientesProductos()\n{\n\tself::SetNames();\n\t$sql =\"SELECT productosvsingredientes.codproducto, productosvsingredientes.cantracion, ingredientes.codingrediente, ingredientes.nomingrediente, ingredientes.costoingrediente, ingredientes.cantingrediente, ingredientes.unidadingrediente FROM (productos LEFT JOIN productosvsingredientes ON productos.codproducto=productosvsingredientes.codproducto) LEFT JOIN ingredientes ON ingredientes.codingrediente=productosvsingredientes.codingrediente WHERE productosvsingredientes.codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t$num = $stmt->rowCount();\n\n\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$this->p[]=$row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}",
"public function listaProductos(){\n\n $respuesta = Datos::mdlListaProductos(\"productos\");\n $cont =0;\n\n foreach ($respuesta as $row => $item){\n \t$cont ++;\n\n\n echo '<tr>\n <td>'.$cont.'</td>\n <td>'.$item[\"codProducto\"].'</td>\n <td>'.$item[\"nombre\"].'</td>\n <td>'.$item[\"tipo\"].'</td>\n <td><a href=\"updtProducto.php?idEditar='.$item[\"idProducto\"].'\"><button class=\"btn btn-warning\">Editar</button></a></td>\n <td><a href=\"listaProductos.php?idBorrar='.$item[\"idProducto\"].'\" ><button class=\"btn btn-danger\">Borrar</button></a></td>\n </tr>';\n }\n\n }",
"public function generarVentasProductos() {\n\n $cartItems = $this->obtenerItemsCarro();\n\n $i = 0;\n foreach ($cartItems as $item) {\n $vP = new VentasProductos();\n $vP->producto_id = $item->producto_id;\n $vP->categoria_id = $item->categoria_id;\n $vP->cantidad = $item->cantidad;\n $vP->precio_unitario = $item->precio_unitario;\n $vP->precio_total = $item->precio_total;\n $vP->precio_id =$item->id_precio;\n $ventasProducto[$i] = $vP;\n $i++;\n }\n\n return $ventasProducto;\n }",
"public function ListarIngredientesVendidos() \n{\n\tself::SetNames();\n\t$sql =\"SELECT \n\tproductos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, productos.stockminimo, categorias.nomcategoria, SUM(detalleventas.cantventa) as cantidad \n\tFROM\n\t(productos LEFT OUTER JOIN detalleventas ON productos.codproducto=detalleventas.codproducto) LEFT OUTER JOIN categorias ON \n\tcategorias.codcategoria=productos.codcategoria WHERE detalleventas.codproducto is not null GROUP BY productos.codproducto\";\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"public function todaInfoProductos(){\n\n for($i = 0; $i < count($this -> listProducto); $i++){\n $this -> listProducto[$i][0] -> getInfoBasic();\n }\n }",
"public function operaciones($proy_id,$com_id){\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); \n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// recupera datos de la tabla fase activa\n $productos = $this->model_producto->lista_operaciones($com_id,$this->gestion); // Lista de productos\n $tabla ='';\n $tabla .='<thead>\n <tr class=\"modo1\">\n <th style=\"width:1%; text-align=center\"><b>COD.</b></th>\n <th style=\"width:1%; text-align=center\"><b>E/B</b></th>\n <th style=\"width:2%;\"><b>COD. OR.</b></th>\n <th style=\"width:2%;\"><b>COD. ACT.</b></th>\n <th style=\"width:15%;\"><b>ACTIVIDAD</b></th>\n <th style=\"width:15%;\"><b>RESULTADO</b></th>\n <th style=\"width:10%;\"><b>TIP. IND.</b></th>\n <th style=\"width:10%;\"><b>INDICADOR</b></th>\n <th style=\"width:1%;\"><b>LINEA BASE '.($this->gestion-1).'</b></th>\n <th style=\"width:1%;\"><b>META</b></th>\n <th style=\"width:4%;\"><b>ENE.</b></th>\n <th style=\"width:4%;\"><b>FEB.</b></th>\n <th style=\"width:4%;\"><b>MAR.</b></th>\n <th style=\"width:4%;\"><b>ABR.</b></th>\n <th style=\"width:4%;\"><b>MAY.</b></th>\n <th style=\"width:4%;\"><b>JUN.</b></th>\n <th style=\"width:4%;\"><b>JUL.</b></th>\n <th style=\"width:4%;\"><b>AGO.</b></th>\n <th style=\"width:4%;\"><b>SEP.</b></th>\n <th style=\"width:4%;\"><b>OCT.</b></th>\n <th style=\"width:4%;\"><b>NOV.</b></th>\n <th style=\"width:4%;\"><b>DIC.</b></th>\n <th style=\"width:10%;\"><b>MEDIO DE VERIFICACIÓN</b></th>\n <th style=\"width:7%;\"><b>DELETE</b></th>\n <th style=\"width:7%;\"><b>PTTO..</b></th>\n <th style=\"width:7%;\"><b>NRO. REQ.</b></th>\n </tr>\n </thead>\n <tbody>';\n $cont = 0;\n foreach($productos as $rowp){\n $cont++;\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $programado=$this->model_producto->producto_programado($rowp['prod_id'],$this->gestion);\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $color=''; $titulo=''; $por='';\n if($rowp['indi_id']==2){ // Relativo\n $por='%';\n if($rowp['mt_id']==3){\n if($sum[0]['meta_gest']!=$rowp['prod_meta'] || $rowp['or_id']==0){\n $color='#fbd5d5';\n $titulo='ERROR EN LA DISTRIBUCION O FALTA DE ALINEACION';\n }\n }\n }\n else{ // Absoluto\n if($sum[0]['meta_gest']!=$rowp['prod_meta'] || $rowp['or_id']==0){\n $color='#fbd5d5';\n $titulo='ERROR EN LA DISTRIBUCION O FALTA DE ALINEACION';\n }\n }\n \n $tabla .='<tr bgcolor=\"'.$color.'\" class=\"modo1\" title='.$titulo.'>';\n $tabla.='<td align=\"center\"><font color=\"blue\" size=\"2\"><b>'.$rowp['prod_cod'].'</b></font></td>';\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACIÓN\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n /*if($this->tp_adm==1){\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACIÓN\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n }*/\n if($rowp['prod_ppto']==1){\n $tabla.='<a href=\"'.site_url(\"\").'/prog/requerimiento/'.$proy_id.'/'.$rowp['prod_id'].'\" target=\"_blank\" title=\"REQUERIMIENTOS DE LA OPERACIÓN\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/insumo.png\" WIDTH=\"33\" HEIGHT=\"33\"/></a>';\n }\n $tabla.='</td>';\n $tabla.='<td style=\"width:2%;text-align=center\"><b><font size=5 color=blue>'.$rowp['or_codigo'].'</font></b></td>';\n $tabla.='<td style=\"width:2%;text-align=center\"><b><font size=5>'.$rowp['prod_cod'].'</font></b></td>';\n $tabla.='<td style=\"width:15%;\">'.$rowp['prod_producto'].'</td>';\n $tabla.='<td style=\"width:15%;\">'.$rowp['prod_resultado'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['indi_abreviacion'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_indicador'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.round($rowp['prod_linea_base'],2).'</td>';\n $tabla.='<td style=\"width:10%;\">'.round($rowp['prod_meta'],2).'</td>';\n if(count($programado)!=0){\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['enero'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['febrero'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['marzo'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['abril'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['mayo'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['junio'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['julio'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['agosto'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['septiembre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['octubre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['noviembre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['diciembre'],2).' '.$por.'</td>';\n }\n else{\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>';\n }\n $tabla.='<td style=\"width:10%;\" bgcolor=\"#e5fde5\">'.$rowp['prod_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width:7%;\">';\n if($this->tp_adm==1 || $this->fun_id==715 || $this->fun_id==690){\n $tabla.='<a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_del_ff\" class=\"btn btn-default del_ff\" title=\"ELIMINAR OPERACIÓN\" name=\"'.$rowp['prod_id'].'\" id=\"'.$proy_id.'\"><img src=\"' . base_url() . 'assets/ifinal/eliminar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a><br><br>';\n $tabla.=' <center>\n <input type=\"checkbox\" name=\"req[]\" value=\"'.$rowp['prod_id'].'\" onclick=\"scheck'.$cont.'(this.checked);\"/>\n </center>';\n }\n $tabla.='</td>';\n $tabla.='<td>'.number_format($ptto, 2, ',', '.').'</td>';\n $tabla.='<td style=\"width:7%;\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.count($this->model_producto->insumo_producto($rowp['prod_id'])).'</b></font></td>';\n $tabla .='</tr>';\n ?>\n <script>\n function scheck<?php echo $cont;?>(estaChequeado) {\n val = parseInt($('[name=\"tot\"]').val());\n if (estaChequeado == true) {\n val = val + 1;\n } else {\n val = val - 1;\n }\n $('[name=\"tot\"]').val((val).toFixed(0));\n }\n </script>\n <?php\n }\n $tabla.='</tbody>';\n\n return $tabla;\n }",
"public function operaciones2019($proy_id,$com_id){\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); \n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// recupera datos de la tabla fase activa\n $productos = $this->model_producto->list_producto_programado($com_id,$this->gestion); // Lista de productos\n $tabla ='';\n $tabla .='<thead>\n <tr class=\"modo1\">\n <th style=\"width:1%; text-align=center\"><b>COD.</b></th>\n <th style=\"width:1%; text-align=center\"><b>E/B</b></th>\n <th style=\"width:20%;\"><b>OPERACIÓN</b></th>\n <th style=\"width:20%;\"><b>RESULTADO</b></th>\n <th style=\"width:10%;\"><b>TIP. IND.</b></th>\n <th style=\"width:10%;\"><b>INDICADOR</b></th>\n <th style=\"width:1%;\"><b>LINEA BASE</b></th>\n <th style=\"width:1%;\"><b>META</b></th>\n <th style=\"width:5%;\"><b>PONDERACIÓN</b></th>\n <th style=\"width:4%;\"><b>ENE.</b></th>\n <th style=\"width:4%;\"><b>FEB.</b></th>\n <th style=\"width:4%;\"><b>MAR.</b></th>\n <th style=\"width:4%;\"><b>ABR.</b></th>\n <th style=\"width:4%;\"><b>MAY.</b></th>\n <th style=\"width:4%;\"><b>JUN.</b></th>\n <th style=\"width:4%;\"><b>JUL.</b></th>\n <th style=\"width:4%;\"><b>AGO.</b></th>\n <th style=\"width:4%;\"><b>SEP.</b></th>\n <th style=\"width:4%;\"><b>OCT.</b></th>\n <th style=\"width:4%;\"><b>NOV.</b></th>\n <th style=\"width:4%;\"><b>DIC.</b></th>\n <th style=\"width:7%;\"><b>MEDIO DE VERIFICACIÓN</b></th>\n <th style=\"width:7%;\"><b>DELETE</b></th>\n <th style=\"width:7%;\"><b>NRO. REQ.</b></th>\n </tr>\n </thead>\n <tbody>';\n $cont = 0;\n foreach($productos as $rowp){\n $cont++;\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $color='';\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n $tabla .='<tr bgcolor=\"'.$color.'\" class=\"modo1\">';\n $tabla.='<td title=\"CÓDIGO OPERACIÓN : '.$rowp['prod_cod'].'\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.$rowp['prod_cod'].'</b></font></td>';\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACIÓN\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n $tabla.='<a href=\"'.site_url(\"\").'/prog/requerimiento/'.$proy_id.'/'.$rowp['prod_id'].'\" target=\"_blank\" title=\"REQUERIMIENTOS DE LA OPERACIÓN\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/insumo.png\" WIDTH=\"33\" HEIGHT=\"33\"/></a>';\n\n $tabla.='</td>';\n $tabla.='<td style=\"width:20%;\">'.$rowp['prod_producto'].'</td>';\n $tabla.='<td style=\"width:20%;\">'.$rowp['prod_resultado'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['indi_abreviacion'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_indicador'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_linea_base'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_meta'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_ponderacion'].'%</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['enero'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['febrero'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['marzo'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['abril'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['mayo'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['junio'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['julio'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['agosto'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['septiembre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['octubre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['noviembre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['diciembre'].'</td>';\n $tabla.='<td style=\"width:7%;\" bgcolor=\"#e5fde5\">'.$rowp['prod_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width:7%;\">';\n $tabla.='<a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_del_ff\" class=\"btn btn-default del_ff\" title=\"ELIMINAR OPERACIÓN\" name=\"'.$rowp['prod_id'].'\" id=\"'.$proy_id.'\"><img src=\"' . base_url() . 'assets/ifinal/eliminar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a><br><br>';\n $tabla.='<center>\n <input type=\"checkbox\" name=\"req[]\" value=\"'.$rowp['prod_id'].'\" onclick=\"scheck'.$cont.'(this.checked);\"/>\n </center>';\n $tabla.='</td>';\n $tabla.='<td style=\"width:7%;\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.count($this->model_producto->insumo_producto($rowp['prod_id'])).'</b></font></td>';\n $tabla .='</tr>';\n ?>\n <script>\n function scheck<?php echo $cont;?>(estaChequeado) {\n val = parseInt($('[name=\"tot\"]').val());\n if (estaChequeado == true) {\n val = val + 1;\n } else {\n val = val - 1;\n }\n $('[name=\"tot\"]').val((val).toFixed(0));\n }\n </script>\n <?php\n }\n $tabla.='</tbody>';\n\n return $tabla;\n }",
"public function listar_productos_resumen_totales_2() {\n \n try {\n $sql = \"\n select \n \tDISTINCT e.cantidad_productos as num_producto,\n e.gravado,\n e.exonerado,\n e.inafecto,\n e.igv,\n e.redondeo,\n e.subtotal,\n e.importe_total\n FROM \n \tal_inventario a inner join pedido e \n ON \n \ta.id_pedido = e.id_pedido\n where\n e.id_cliente = '$_SESSION[cliente_id]' and e.estado is null;\n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }",
"private function createViewProducto()\n {\n $this->addView('ListProductoSample', 'ProductoSample', 'products', 'fas fa-cubes');\n $this->addSearchFields('ListProductoSample', ['referencia', 'descripcion', 'observaciones']);\n $this->addOrderBy('ListProductoSample', ['referencia'], 'reference');\n $this->addOrderBy('ListProductoSample', ['descripcion'], 'description');\n $this->addOrderBy('ListProductoSample', ['precio'], 'price');\n $this->addOrderBy('ListProductoSample', ['stockfis'], 'stock');\n $this->addOrderBy('ListProductoSample', ['actualizado'], 'update-time');\n\n $manufacturers = $this->codeModel::all('fabricantes', 'codfabricante', 'nombre');\n $this->addFilterSelect('ListProductoSample', 'codfabricante', 'manufacturer', 'codfabricante', $manufacturers);\n\n $families = $this->codeModel::all('familias', 'codfamilia', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codfamilia', 'family', 'codfamilia', $families);\n\n $taxes = $this->codeModel::all('impuestos', 'codimpuesto', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codimpuesto', 'tax', 'codimpuesto', $taxes);\n\n $this->addFilterCheckbox('ListProductoSample', 'nostock', 'no-stock', 'nostock');\n $this->addFilterCheckbox('ListProductoSample', 'bloqueado', 'locked', 'bloqueado');\n $this->addFilterCheckbox('ListProductoSample', 'secompra', 'for-purchase', 'secompra');\n $this->addFilterCheckbox('ListProductoSample', 'sevende', 'for-sale', 'sevende');\n $this->addFilterCheckbox('ListProductoSample', 'publico', 'public', 'publico');\n }",
"public function listaProductos($id)\n{\n conectar::conexiones();\n $sql=\"SELECT id, nombreArticulo, ventaFinal, ventaProvedor FROM items\";\n $query=mysql_query($sql);\n\n echo '<div class=\"table-responsive\">\n <table id=\"dataTable1\" class=\"table table-bordered table-striped-col\">\n <thead>\n <tr>\n <th>Nombre</th>\n <th>Valor Normal</th>\n <th>Valor Con Descuento</th>\n <th></th>\n \n </tr>\n </thead>\n \n ';\n \n while ($rs=mysql_fetch_array($query)) {\n # code...\n\n echo ' <tr>\n <td>'.$rs[\"nombreArticulo\"].'</td>\n <td align=\"center\">$'.number_format($rs[\"ventaFinal\"]).'</td>\n <td align=\"center\">$'.number_format($rs[\"ventaProvedor\"]).'</td>\n <td>\n\n <a href=\"'.$this->datospagina(5).'/productos/producto.php?id='.$id.'&producto='.$this->encrypt($rs[\"id\"], publickey).'\">\n <button class=\"btn btn-primary\"><i class=\"fa fa-edit\"></i> ¿Quieres Editarlo?</button>\n </a>\n\n <a href=\"'.$this->datospagina(5).'/productos/lista.php?id='.$id.'&eliminar='.$this->encrypt($rs[\"id\"].\"-eliminar-0\", publickey).'\">\n <button class=\"btn btn-danger\"> <i class=\"fa fa-trash\"></i> Necesitas Borrarlo?</button>\n </a>\n </td>\n </tr>\n ';\n }\n\n echo ' </tbody>\n </table>\n </div>\n ';\n conectar::desconectar();\n}",
"public function mostrarTablasMaestras(){\n\t\tif($_GET[\"bd\"] == \"vtama_tipo_producto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoProducto.controlador.php\";\n\t\t\trequire_once \"../models/tipoProducto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$entrada = \"tablaMaestra\";\n\t\t\t$tipoProductos = ControladorTipoProducto::ctrMostrarTipoProducto($item,$valor,$entrada);\n\t\t\tif(count($tipoProductos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoProductos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' data-toggle='modal' data-target='#modalTipoProducto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoProductos[$i][\"dsc_tipo_producto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_documento\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoDocumento.controlador.php\";\n\t\t\trequire_once \"../models/tipoDocumento.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoDocumentos = ControladorTipoDocumento::ctrMostrarTipoDocumento($item,$valor);\n\t\t\tif(count($tipoDocumentos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoDocumentos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' data-toggle='modal' data-target='#modalTipoDocumento' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoDocumentos[$i][\"dsc_tipo_documento\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_categoria_cliente\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/categoriaCliente.controlador.php\";\n\t\t\trequire_once \"../models/categoriaCliente.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$categoriaClientes = ControladorCategoriaCliente::ctrMostrarCategoriaClientes($item,$valor);\n\t\t\tif(count($categoriaClientes) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($categoriaClientes); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' data-toggle='modal' data-target='#modalCategoriaCliente' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($categoriaClientes[$i][\"dsc_categoria_cliente\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_pais\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/pais.controlador.php\";\n\t\t\trequire_once \"../models/pais.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$paises = ControladorPais::ctrMostrarPaises($item,$valor);\n\t\t\tif(count($paises) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($paises); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' data-toggle='modal' data-target='#modalPais' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($paises[$i][\"dsc_pais\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_cotizacion\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoCotizacion.controlador.php\";\n\t\t\trequire_once \"../models/estadoCotizacion.modelo.php\";\n\t\t\t$item = $valor = $entrada = null;\n\t\t\t$estadoCotizacion = ControladorEstadoCotizacion::ctrMostrarEstadoCotizacion($item,$valor,$entrada);\n\t\t\tif(count($estadoCotizacion) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoCotizacion); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoCotizacion' codEstadoCotizacion='\".$estadoCotizacion[$i][\"cod_estado_cotizacion\"].\"' data-toggle='modal' data-target='#modalEstadoCotizacion' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoCotizacion[$i][\"dsc_estado_cotizacion\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= '] \n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_perfil\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/perfil.controlador.php\";\n\t\t\trequire_once \"../models/perfil.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$perfil = ControladorPerfil::ctrMostrarPerfil($item,$valor);\n\t\t\tif(count($perfil) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($perfil); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPerfil' codPerfil='\".$perfil[$i][\"cod_perfil\"].\"' data-toggle='modal' data-target='#modalPerfil' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($perfil[$i][\"dsc_perfil\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_moneda\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/moneda.controlador.php\";\n\t\t\trequire_once \"../models/moneda.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$moneda = ControladorMoneda::ctrMostrarMoneda($item,$valor);\n\t\t\tif(count($moneda) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($moneda); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' data-toggle='modal' data-target='#modalMoneda' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($moneda[$i][\"dsc_moneda\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_forma_pago\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/formaPago.controlador.php\";\n\t\t\trequire_once \"../models/formaPago.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$formaPago = ControladorFormaPago::ctrMostrarFormaPago($item,$valor);\n\t\t\tif(count($formaPago) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($formaPago); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' data-toggle='modal' data-target='#modalFormaPago' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($formaPago[$i][\"dsc_forma_pago\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_canal_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/canalContacto.controlador.php\";\n\t\t\trequire_once \"../models/canalContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$canalContacto = ControladorCanalContacto::ctrMostrarCanalContacto($item,$valor);\n\t\t\tif(count($canalContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($canalContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' data-toggle='modal' data-target='#modalCanalContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($canalContacto[$i][\"dsc_canal_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoContacto.controlador.php\";\n\t\t\trequire_once \"../models/estadoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$estadoContacto = ControladorEstadoContacto::ctrMostrarEstadoContacto($item,$valor);\n\t\t\tif(count($estadoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' data-toggle='modal' data-target='#modalEstadoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoContacto[$i][\"dsc_estado_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoContacto.controlador.php\";\n\t\t\trequire_once \"../models/tipoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoContacto = ControladorTipoContacto::ctrMostrarTipoContacto($item,$valor);\n\t\t\tif(count($tipoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' data-toggle='modal' data-target='#modalTipoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoContacto[$i][\"dsc_tipo_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}\n\t\techo $datosJson;\n\t}",
"public function displayProducts()\n {\n $today = Carbon::now()->format('Y-m-d');\n // $today = Carbon::createFromFormat('Y-m-d', $date);\n $todayFormat = Carbon::now();\n $traUnMeseFormat = $todayFormat->addMonth();\n $traUnMese = $traUnMeseFormat->format('Y-m-d');\n // dd($traUnMese);\n // Vecchia query da fare refactoring\n $products = DB::table(\"sectors\")\n ->join(\"products\", function($join){\n $join->on(\"product_id\", \"=\", \"products.id\");\n })\n ->select(DB::raw('sum(quantita_rimanente) AS quantita' ),'products.id','products.codice_prodotto', 'products.name', 'products.codice_stock', 'products.data_di_scadenza','products.peso', DB::raw('sum(quantita_bloccata) AS bloccata'))\n \n ->groupBy(\"products.codice_prodotto\")\n ->orderBy('products.data_di_scadenza', 'desc')\n ->get();\n // Vecchia query da fare refactoring\n\n $sector = Sector::all();\n $observerCall = Product::all();\n $users = User::where('ragione_sociale', '!=', NULL)->get();\n\n $orderEcommerce=Order_Ecommerces::all();\n /* dd($orderEcommerce); */\n return view('ecommerce.ordersCreate', compact('products', 'sector', 'users','today', 'traUnMese','orderEcommerce') );\n }",
"public function BuscarProductosVendidos() \n{\n\tself::SetNames();\n\t$sql =\"SELECT productos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, categorias.nomcategoria, SUM(detalleventas.cantventa) as cantidad FROM (productos LEFT JOIN detalleventas ON productos.codproducto=detalleventas.codproducto) \n\tLEFT JOIN categorias ON categorias.codcategoria=productos.codcategoria WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? GROUP BY detalleventas.codproducto, detalleventas.precioventa ORDER BY productos.codproducto ASC\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN PRODUCTOS FACTURADOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}",
"public function DetallesVentasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codcliente as cliente, detalleventas.codproducto, detalleventas.producto, detalleventas.codcategoria, detalleventas.cantventa, detalleventas.precioventa, detalleventas.preciocompra, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, productos.ivaproducto, productos.existencia, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, usuarios.nombres FROM detalleventas LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN clientes ON detalleventas.codcliente = clientes.codcliente LEFT JOIN productos ON detalleventas.codproducto = productos.codproducto LEFT JOIN usuarios ON detalleventas.codigo = usuarios.codigo WHERE detalleventas.coddetalleventa = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"coddetalleventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}",
"public function loadProductList()\n {\n $selectQuery = $this->DBH->query(\"SELECT pr_name, pr_id, pcat_name, psub_name, sup_name FROM product JOIN product_subcategory ON psub_id = pr_subcategory JOIN product_category ON psub_category = pcat_id JOIN supplier ON pr_supplier = sup_id\");\n\n echo \"<table class=\\\"information\\\">\";\n echo \"<tr>\";\n echo \"<th>#</th>\";\n echo \"<th>Název produktu</th>\";\n echo \"<th>Název kategorie</th>\";\n echo \"<th>Název podkategorie</th>\";\n echo \"<th>Název dodavatele</th>\";\n echo \"<th></th>\";\n echo \"<th></th>\";\n echo \"</tr>\";\n\n $i = 1;\n while($r = mysql_fetch_assoc($selectQuery))\n {\n ?>\n\n <tr>\n <td><?php echo $i;?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"pr_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"pcat_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"psub_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareTExt($r[\"sup_name\"]);?></td>\n <td class=\"buttons\"><form method=\"post\" action=\"\"><input type=\"hidden\" name=\"deleteProduct\" value=\"<?php echo $this->FILTER->prepareInputForSQL($r[\"pr_id\"]); ?>\"><input onclick=\"return confirm('Opravdu chcete smazat tento produkt?');\" type=\"submit\" value=\"Smazat\" class=\"button\"></form></td>\n <td class=\"buttons\"><a href=\"Admin.php?action=Show&edittype=product&edit=<?php echo $this->FILTER->prepareText($r[\"pr_id\"]); ?>\">Editovat</a></td>\n </tr>\n\n <?php\n $i++;\n }\n\n echo \"</table>\";\n\n }",
"public static function listAll(){//le todos os dados da tabela\n\n\t\t$sql = new Sql();\n\n\t\treturn $sql->select(\n\t\t\t\"SELECT * FROM tb_products ORDER BY desproduct\" \n\t\t\t);\n\t}",
"public function VerDetallesVentas()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM detalleventas LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria WHERE detalleventas.codventa = ?\";\t\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(base64_decode($_GET[\"codventa\"])));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\n\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$this->p[]=$row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}",
"function listar(){\n try{\n $sql=\"select * from producto\";\n $ps=$this->conexion->getConexion()->prepare($sql);\n $ps->execute(NULL);\n $resultado = [];\n while($row=$ps->fetch(PDO::FETCH_OBJ)){\n $producto = new producto(\n $row->pro_id,\n $row->pro_nombre,\n $row->pro_descripcion,\n $row->pro_cantidad,\n $row->pro_valor\n\n );\n //$producto ->setProId($row->pro_id);\n //$producto ->setProNombre($row->pro_nombre);\n //$producto ->setProDescripcion($row->pro_descripcion);\n //$producto ->setProCantidad($row->pro_cantidad);\n //$producto ->setProValor($row->pro_valor);\n array_push($resultado,$producto);\n }\n $this->conexion =null;\n }catch(PDOException $e){\n echo \"Fallo la conexion\" . $e->getMessage();\n }\n return $resultado;\n }",
"public function mostrarTablaProductos()\n {\n $item = null;\n $valor = null;\n $productos = ControladorProductos::ctrMostrarProductos($item, $valor);\n $productosJson['data'] = $productos;\n echo json_encode($productosJson);\n }",
"public function buscaProducto($tabla, $codigo){\n\n $res = Datos::buscaProducto($tabla, $codigo);\n\n foreach ($res as $row => $val) {\n\n echo $val['destino'];\n echo \" || \";\n echo $val['kg'];\n echo \" || \";\n echo $val['precio'];\n echo \" || \";\n\n }\n\n }"
] |
[
"0.6837283",
"0.68232465",
"0.6792889",
"0.67200494",
"0.66029936",
"0.65749604",
"0.6558113",
"0.6539261",
"0.6508939",
"0.64755124",
"0.6453973",
"0.64312595",
"0.64018583",
"0.6401146",
"0.63894",
"0.63537943",
"0.6298461",
"0.6297334",
"0.6294184",
"0.62911797",
"0.6291174",
"0.62830496",
"0.62775123",
"0.62676436",
"0.62593454",
"0.6229708",
"0.6212202",
"0.6209706",
"0.6209219",
"0.6203599"
] |
0.69284207
|
0
|
/ Build Attributes AttributeData Type build_idinteger product_idinteger namestring descriptionstring milestonestring isactiveboolean / get Get A Build by ID Usage Build.get Parameters ParameterData TypeComments build_idintegerMust be greater than 0. Return Array: [build_id] [product_id] [name] [milestone] [isactive] [description]
|
function Build_get($build_id) {
// Create call
$call = new xmlrpcmsg('Build.get', array(new xmlrpcval($build_id, "int")));
// Do call and return value
return do_call($call);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function buildToParams($build) {\n $data = array(\n 'namespace' => $build->namespace, \n 'type' => $build->type, \n 'object_key' => $build->metaKey, \n 'object_id' => $build->objectID\n );\n if ($build->relation) {\n\n unset($data['object_key']);\n $data['operation'] = $build->relation->type;\n $data['user_id'] = $build->relation->user;\n $data['value'] = $build->relation->value;\n if ($build->objectCreation) {\n $data['timestamp'] = $build->objectCreation;\n }\n\n }\n return $data;\n }",
"public static function get_build()\n {\n }",
"public function getBuildData($deviceName) {\r\n return $this->con->query(\"SELECT * FROM build WHERE device='\" . $deviceName . \"' ORDER BY dt_added DESC LIMIT 3\");\r\n }",
"private function apiGetBuild($data)\n {\n $output = array();\n for($i=0; $i<count($data); $i++){\n $output = array(\n\n );\n }\n\n return $output;\n }",
"public function getBuildings(){\n $buildings = Edificiosauditorios::getAll();\n //$auditorio = Auditorios::getID_AUDIENCE($inuId);\n if (!empty($buildings) || is_array($buildings)) {\n print json_encode($buildings);\n \n } else {\n print json_encode($buildings->toArray());\n }\n }",
"function getBuildingInfo() {\n return getOne(\"SELECT * FROM building WHERE id = ?\",[getLogin()['bid']]);\n}",
"public function CLIAccesWithShortArgumentsBuildsCorrectRequest() {}",
"public function findBuildingDetails($id){\n\t\t$details = array();\n\t\t\n\t\t$details['building'] = $this->db->q(\"select building.name as building_name, user.name as user_name, user.id as user_id, building.id as building_id, building.*, user.* from Building building join User user on building.fk_user = user.id where building.id = \".$id);\n\t\t$details['comments'] = $this->db->q(\"select comment.*, user.name as user_name, user.id as user_id from Comment comment join User user on comment.fk_user = user.id where fk_building = \".$id.\" order by id desc\");\n\t\t$details['ratings'] = $this->db->q(\"select rating.* from Rating rating where fk_building = \". $id);\n\t\t$details['media'] = $this->db->q(\"select media.* from Media media where fk_building = \". $id);\n\t\t\n\t\treturn $details;\n\t\t\n\t}",
"private function accessory_params() {\n return [\n 'name' => $this->params['name'],\n 'release_date' => date('Y-m-d', strtotime($this->params['release_date'])),\n 'description' => $this->params['description'],\n 'producer' => $this->params['producer'],\n 'console_id' => $this->params['console_id']\n ];\n }",
"public function getSelectedBuild($data) {\n\t\tif (isset($data['SelectRelease']) && !empty($data[$data['SelectRelease']])) {\n\t\t\t// Filter out the tag/branch name if required\n\t\t\t$array = explode('-', $data[$data['SelectRelease']]);\n\t\t\treturn reset($array);\n\t\t}\n\t\tif (isset($data['FilteredCommits']) && !empty($data['FilteredCommits'])) {\n\t\t\treturn $data['FilteredCommits'];\n\t\t}\n\t}",
"function Buildings_get() {\n\n $model = M('Buildings');\n if ($id = $this->_get('id')) {\n $data = $model->find($id);\n if ($data) {\n $this->response($data);\n } else {\n //NOT FOUND\n $this->response(NULL, NULL, 404);\n }\n }\n else if($name=$this->_get('name')){\n $data = $model->where(array(\"name\"=>$name))->select();\n if($data){\n $this->response($data);\n }else{\n $this->response(NULL,NULL,404);\n }\n }\n else {\n $data = $model->select();\n $this->response($data);\n }\n }",
"public function getProductAttributesDetails($params){\n\t\ttry {\t\n\t\t\t\n\t\t\t//$query = \"select * from store_products where product_id=\".$params['id'];\n\t\t\t\n\t\t\t$query = \"SELECT\n\t\t\t\t\t\tspav.product_id, spast.attributes_group_id, spast.attributes_set_id, spast.attributes_set_title,\n\t\t\t\t\t\tspa.attribute_id, spa.attribute_title, spav.attribute_value\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\tstore_products_attributes spa,\n\t\t\t\t\t\tstore_products_attributes_values spav,\n\t\t\t\t\t\tstore_products_attributes_sets spast,\n\t\t\t\t\t\tstore_products_attributes_sets_mapping spasm\n\t\t\t\t\t\twhere\n\t\t\t\t\t\tspa.attribute_id = spav.attribute_id\n\t\t\t\t\t\tAND spast.attributes_set_id = spasm.attributes_set_id\n\t\t\t\t\t\tAND spa.attribute_id = spasm.attribute_id\n\t\t\t\t\t\tAND spa.statusid=1\n\t\t\t\t\t\tAND spav.statusid=1\n\t\t\t\t\t\tAND spast.statusid=1\n\t\t\t\t\t\tAND spasm.statusid=1\n\t\t\t\t\t\tAND spav.product_id = \".$params['id'];\n\t\t\t\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}",
"function getConstructionInfo($conn, $buildingType){\n\tif($buildingType == \"custom\"){\n\t\t$sql = \"SELECT * FROM constructioninfo ORDER BY InfoType\";\n\t}\n\telse{\n\t\t$sql = \"SELECT * FROM constructioninfo WHERE BuildingType = :buildingType ORDER BY InfoType\";\n\t}\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':buildingType', $buildingType, PDO::PARAM_STR, 25);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n\n}",
"public function infoOfBuilding($buildingId, $take = null, $dateTake = null, $highlight = 0)\n {\n if (empty($take) && empty($dateTake)) {\n return TfBuildingActivity::where(['building_id' => $buildingId, 'highlight' => $highlight, 'action' => 1])->orderBy('created_at', 'DESC')->get();\n } else {\n return TfBuildingActivity::where(['building_id' => $buildingId, 'highlight' => $highlight, 'action' => 1])->where('created_at', '<', $dateTake)->orderBy('activity_id', 'DESC')->skip(0)->take($take)->get();\n }\n\n }",
"public function info()\n {\n $info = array();\n $info['author'] = 'Chris Graham';\n $info['organisation'] = 'ocProducts';\n $info['hacked_by'] = null;\n $info['hack_version'] = null;\n $info['version'] = 2;\n $info['locked'] = false;\n $info['parameters'] = array('param', 'limit', 'hot', 'date_key', 'username_key', 'title', 'check');\n return $info;\n }",
"public function build( $data );",
"public function hasBuildId(){\n return $this->_has(2);\n }",
"function rest_get()\n{\n global $build;\n $response = array();\n\n // Are we looking for what went wrong with this build?\n if (isset($_GET['getproblems'])) {\n $response['hasErrors'] = false;\n $response['hasFailingTests'] = false;\n\n // Lookup some details about this build.\n $buildtype = $build->Type;\n $buildname = $build->Name;\n $siteid = $build->SiteId;\n $starttime = $build->StartTime;\n $projectid = $build->ProjectId;\n\n // Check if this build has errors.\n $buildHasErrors = $build->BuildErrorCount > 0;\n if ($buildHasErrors) {\n $response['hasErrors'] = true;\n // Find the last occurrence of this build that had no errors.\n $no_errors_result = pdo_query(\n \"SELECT starttime FROM build\n WHERE siteid='$siteid' AND type='$buildtype' AND\n name='$buildname' AND projectid='$projectid' AND\n starttime<='$starttime' AND parentid<1 AND builderrors<1\n ORDER BY starttime DESC LIMIT 1\");\n\n if (pdo_num_rows($no_errors_result) > 0) {\n $no_errors_row = pdo_fetch_array($no_errors_result);\n $gmtdate = strtotime($no_errors_row['starttime'] . ' UTC');\n } else {\n // Find the first build\n $firstbuild = pdo_single_row_query(\n \"SELECT starttime FROM build\n WHERE siteid='$siteid' AND type='$buildtype' AND\n name='$buildname' AND projectid='$projectid' AND\n starttime<='$starttime'\n ORDER BY starttime ASC LIMIT 1\");\n $gmtdate = strtotime($firstbuild['starttime'] . ' UTC');\n }\n $response['daysWithErrors'] =\n round((strtotime($starttime) - $gmtdate) / (3600 * 24));\n $response['failingSince'] = date(FMT_DATETIMETZ, $gmtdate);\n $response['failingDate'] = substr($response['failingSince'], 0, 10);\n }\n\n // Check if this build has failed tests.\n $buildHasFailingTests = $build->TestFailedCount > 0;\n if ($buildHasFailingTests) {\n $response['hasFailingTests'] = true;\n // Find the last occurrence of this build that had no test failures.\n $no_fails_result = pdo_query(\n \"SELECT starttime FROM build\n WHERE siteid='$siteid' AND type='$buildtype' AND\n name='$buildname' AND projectid='$projectid' AND\n starttime<='$starttime' AND parentid<1 AND testfailed<1\n ORDER BY starttime DESC LIMIT 1\");\n\n if (pdo_num_rows($no_fails_result) > 0) {\n $no_fails_row = pdo_fetch_array($no_fails_result);\n $gmtdate = strtotime($no_fails_row['starttime'] . ' UTC');\n } else {\n // Find the first build\n $firstbuild = pdo_single_row_query(\n \"SELECT starttime FROM build\n WHERE siteid='$siteid' AND type='$buildtype' AND\n name='$buildname' AND projectid='$projectid' AND\n starttime<='$starttime' AND parentid<1\n ORDER BY starttime ASC LIMIT 1\");\n $gmtdate = strtotime($firstbuild['starttime'] . ' UTC');\n }\n $response['daysWithFailingTests'] =\n round((strtotime($starttime) - $gmtdate) / (3600 * 24));\n $response['testsFailingSince'] = date(FMT_DATETIMETZ, $gmtdate);\n $response['testsFailingDate'] =\n substr($response['testsFailingSince'], 0, 10);\n }\n echo json_encode(cast_data_for_JSON($response));\n }\n}",
"function getAttributedetail($filter=false)\n\t{\n\t\t$qry=$this->db->query(\"select * from rp_project_attribute_values where projectID='$filter'\");\n\t\treturn $qry->result();\n\t}",
"public function getData()\n {\n $this->validate(\n 'app_id',\n 'productid',\n 'app_key'\n );\n\n $params = $this->parameters->all();\n $params['appid'] = $params['app_id'];\n $params['appkey'] = $params['app_key'];\n $params['mch_id'] = $params['partner'];\n $params = array_only($params, array(\n 'appid', 'productid', 'appkey',\n 'noncestr', 'timestamp', 'package','mch_id'\n ));\n\n\n return $params;\n }",
"function device_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n // die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->input->get('device');\n \n // Get the full device/system information\n $device = $this->device_model->getDeviceInfo( $this->get('id') );\n \n if($device){\n $this->response($device, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }",
"function info()\n\t{\n\t\t$info=array();\n\t\t$info['author']='Chris Graham';\n\t\t$info['organisation']='ocProducts';\n\t\t$info['hacked_by']=NULL;\n\t\t$info['hack_version']=NULL;\n\t\t$info['version']=2;\n\t\t$info['locked']=false;\n\t\t$info['parameters']=array('root','sort','search','max','param','select','template_set','display_type');\n\t\treturn $info;\n\t}",
"function Build_update($build_id, $name, $description = NULL, $milestone = NULL, $isactive = TRUE) {\n\t$varray = array(\"name\" => \"string\", \"description\" => \"string\", \"milestone\" => \"string\", \"isactive\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('Build.update', array(new xmlrpcval($build_id, \"int\"), new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function getDataConsumableRequestByID($strDataID)\n{\n global $db;\n $tbl = new cGaConsumableRequest();\n $dataEdit = $tbl->findAll(\"id = $strDataID\", \"\", \"\", null, 1, \"id\");\n $arrResult['dataIdItem'] = $dataEdit[$strDataID]['id_item'];\n $arrResult['dataRequestDate'] = $dataEdit[$strDataID]['request_date'];\n $arrResult['dataItemAmount'] = $dataEdit[$strDataID]['item_amount'];\n $arrResult['dataRemark'] = $dataEdit[$strDataID]['remark'];\n $arrResult['dataConsReqNo'] = $dataEdit[$strDataID]['id'];\n //foreach($arrTripCost[$dataDonation ['trip_type']\n return $arrResult;\n}",
"public static function get_parameters() {\n $r = array_merge(\n iform_map_get_map_parameters(),\n iform_report_get_minimal_report_parameters(),\n array(\n array(\n 'name' => 'downloadOwnDataOnly',\n 'caption' => 'Download own data only',\n 'description' => 'If ticked then the user is only allowed to download data when showing just their own data.',\n 'type' => 'checkbox',\n 'default' => false,\n 'required' => false\n ),\n array(\n 'name' => 'includeEditLink',\n 'caption' => 'Include edit link',\n 'description' => 'Include an edit link for each row that was input by the current user',\n 'type' => 'checkbox',\n 'default' => true,\n 'required' => false\n ),\n array(\n 'name' => 'includeEditLinkPath',\n 'caption' => 'Path to page used for edits',\n 'description' => 'The path to the page used for edits. This is just the site relative path, e.g. http://www.example.com/index.php?q=enter-records needs '.\n 'to be input as just enter-records. The path is called with the id of the record in a parameter called occurrence_id.',\n 'type' => 'text_input',\n 'default' => '',\n 'required' => false\n ),\n array(\n 'name' => 'columns_config',\n 'caption' => 'Columns Configuration',\n 'description' => 'Define a list of columns with various configuration options when you want to override the '.\n 'default output of the report.',\n 'type' => 'jsonwidget',\n 'schema' => '{\n \"type\":\"seq\",\n \"title\":\"Columns List\",\n \"sequence\":\n [\n {\n \"type\":\"map\",\n \"title\":\"Column\",\n \"mapping\": {\n \"fieldname\": {\"type\":\"str\",\"desc\":\"Name of the field to output in this column. Does not need to be specified when using the template option.\"},\n \"display\": {\"type\":\"str\",\"desc\":\"Caption of the column, which defaults to the fieldname if not specified.\"},\n \"actions\": {\n \"type\":\"seq\",\n \"title\":\"Actions List\",\n \"sequence\": [{\n \"type\":\"map\",\n \"title\":\"Actions\",\n \"desc\":\"List of actions to make available for each row in the grid.\",\n \"mapping\": {\n \"caption\": {\"type\":\"str\",\"desc\":\"Display caption for the action\\'s link.\"},\n \"visibility_field\": {\"type\":\"str\",\"desc\":\"Optional name of a field in the data which contains true or false to define the visibility of this action.\"},\n \"img\": {\"type\":\"str\",\"desc\":\"Set img to the path to an image to use an image for the action instead of a text caption - the caption '.\n 'then becomes the image\\'s title. The image path can contain {rootFolder} to be replaced by the root folder of the site, in this '.\n 'case it excludes the path parameter used in Drupal when dirty URLs are used (since this is a direct link to a URL).\"},\n \"url\": {\"type\":\"str\",\"desc\":\"A url that the action link will point to, unless overridden by JavaScript. The url can contain tokens which '.\n 'will be subsituted for field values, e.g. for http://www.example.com/image/{id} the {id} is replaced with a field called id in the current row. '.\n 'Can also use the subsitution {currentUrl} to link back to the current page, {rootFolder} to represent the folder on the server that the current PHP page is running from, and '.\n '{imageFolder} for the image upload folder\"},\n \"urlParams\": {\n \"type\":\"map\",\n \"subtype\":\"str\",\n \"desc\":\"List of parameters to append to the URL link, with field value replacements such as {id} begin replaced '.\n 'by the value of the id field for the current row.\"\n },\n \"class\": {\"type\":\"str\",\"desc\":\"CSS class to attach to the action link.\"},\n \"javascript\": {\"type\":\"str\",\"desc\":\"JavaScript that will be run when the link is clicked. Can contain field value substitutions '.\n 'such as {id} which is replaced by the value of the id field for the current row. Because the javascript may pass the field values as parameters to functions, '.\n 'there are escaped versions of each of the replacements available for the javascript action type. Add -escape-quote or '.\n '-escape-dblquote to the fieldname. For example this would be valid in the action javascript: foo(\\\"{bar-escape-dblquote}\\\"); '.\n 'even if the field value contains a double quote which would have broken the syntax.\"}\n }\n }]\n },\n \"visible\": {\"type\":\"bool\",\"desc\":\"Should this column be shown? Hidden columns can still be used in templates or actions.\"},\n \"template\": {\"type\":\"txt\",\"desc\":\"Allows you to create columns that contain dynamic content using a template, rather than just the output '.\n 'of a field. The template text can contain fieldnames in braces, which will be replaced by the respective field values. '.\n 'Note that template columns cannot be sorted by clicking grid headers.\" }\n }\n }\n ]\n}',\n 'required' => false,\n 'group' => 'Report Settings'\n ),\n )\n );\n // @todo Set the default report name\n foreach ($r as &$param) {\n if ($param['name']==='report_name') {\n $param['default'] = 'library/occurrences/explore_list';\n $param['description'] .= '<br/>The report used must meet a set of criteria to be used for this form, as illustrated by the library/occurrences/explore_list '.\n 'report. The report should have the following columns:<br/>'.\n '<strong>belongs_to_user</strong> - a boolean indicating if the record belongs to (i.e. is editable by) the logged in user.<br/>'.\n '<strong>certainty</strong> - text output which identifies the certainty of the record if known. This is appended to the word '.\n 'certainty to make a class which is attached to the row HTML, allowing you to use CSS to style the row output. E.g. if the report '.\n 'outputs C in this column then the row HTML will have a class certaintyC.<br/>'.\n '<br/>The report should have the following parameters:<br/>'.\n '<strong>location_id</strong> - Warehouse ID of the user\\'s preferred recording location passed automatically from the user\\'s account. Only applied if own_locality is 1.<br/>'.\n '<strong>ownLocality</strong> - Boolean (1 or 0) parameter which defines if the output should be filtered to the contents of the location identified by location_id.<br/>'.\n '<strong>taxon_groups</strong> Takes a comma separated list of taxon_group_ids as a string suitable for insertion into an SQL in (...) clause. '.\n 'Will be passed the user\\'s preferred species groups from their user account if the Easy Login feature is installed. Only applied if ownGroups is 1.<br/>'.\n '<strong>ownGroups</strong> - Boolean (1 or 0) parameter which defines if the output should be filtered to the contents of the taxon groups identified by taxon_groups.<br/>'.\n '<strong>currentUser</strong> Warehouse User ID of the logged in user, used to filter records to their own data. Only applied if ownData is 1.<br/>'.\n '<strong>ownData</strong> - Boolean (1 or 0) parameter which defines if the output should be filtered to the user\\'s own records.';\n }\n elseif ($param['name']==='param_presets')\n $param['default'] = \"smpattrs=\\noccattrs=\\nlocation_id={profile_location}\\ntaxon_groups={profile_taxon_groups}\\ncurrentUser={profile_indicia_user_id}\";\n elseif ($param['name']==='param_defaults')\n $param['default'] = \"idlist=\\nsearchArea=\";\n elseif ($param['name']==='standard_controls')\n $param['default'] = \"layerSwitcher\\npanZoomBar\";\n }\n return $r;\n }",
"public function info()\n {\n $info = array();\n $info['author'] = 'Chris Graham';\n $info['organisation'] = 'ocProducts';\n $info['hacked_by'] = null;\n $info['hack_version'] = null;\n $info['version'] = 2;\n $info['locked'] = false;\n $info['parameters'] = array('username', 'period', 'display', 'title', 'width', 'height');\n return $info;\n }",
"function info()\n\t{\n\t\t$info=array();\n\t\t$info['author']='Chris Graham';\n\t\t$info['organisation']='ocProducts';\n\t\t$info['hacked_by']=NULL;\n\t\t$info['hack_version']=NULL;\n\t\t$info['version']=4;\n\t\t$info['locked']=false;\n\t\t$info['parameters']=array();\n\t\t$info['update_require_upgrade']=1;\n\n\t\treturn $info;\n\t}",
"function get_detail_data_by_id($params) {\n $sql = \"SELECT a.*, b.airlines_nm, c.operator_name, c.jabatan, d.services_nm \n FROM fa_data a \n LEFT JOIN airlines b ON b.airlines_id = a.airlines_id \n LEFT JOIN com_user c ON c.user_id = a.mdb_finish \n LEFT JOIN services_code d ON d.services_cd = a.services_cd\n WHERE a.data_id = ?\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }",
"function info()\n\t{\n\t\t$info=array();\n\t\t$info['author']='Chris Graham';\n\t\t$info['organisation']='ocProducts';\n\t\t$info['hacked_by']=NULL;\n\t\t$info['hack_version']=NULL;\n\t\t$info['version']=2;\n\t\t$info['locked']=false;\n\t\t$info['parameters']=array('subject','path','to','param');\n\t\treturn $info;\n\t}",
"public function getRequestData($property_id,$unit_id,$ownerData)\n\t{//echo $this->db->last_query(); exit;\n\t $property_where = \" \";\n\t\tif($property_id >0)\n\t\t{\n\n\t\t\t$property_where = \" AND \".$this->db->dbprefix.\"maintenance_request.property_id='\".$property_id.\"'\";\n\t\t}\n\t\treturn $this->db->query(\"\n\t\t\tSELECT\n\t\t\tDATE_FORMAT(onelane_maintenance_request.created_at,' %M %D %Y') AS formatted_date, \n\t\t\t\".$this->db->dbprefix.\"maintenance_request.request_text,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.description_text,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.id,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.unit_id,\n\t\t\tonelane_property_units.unit,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.ref_id,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.property_id,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.owner_id,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.service_id,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.status,\n\t\t\t\".$this->db->dbprefix.\"properties.address,\n\t\t\t\".$this->db->dbprefix.\"users.firstname,\n\t\t\t\".$this->db->dbprefix.\"users.lastname,\".$this->db->dbprefix.\"services.name,\n\t\t\t\".$this->db->dbprefix.\"maintenance_request.created_at\n\t\t\tFROM \".$this->db->dbprefix.\"maintenance_request \n\n\n\n\n\t\t\tJOIN \".$this->db->dbprefix.\"properties ON \".$this->db->dbprefix.\"maintenance_request.property_id = \".$this->db->dbprefix.\"properties.Id\n\n\t\t\tJOIN onelane_property_units ON onelane_property_units.id = onelane_maintenance_request.unit_id\n\n\t\t\tJOIN \".$this->db->dbprefix.\"users ON \".$this->db->dbprefix.\"maintenance_request.owner_id = \".$this->db->dbprefix.\"users.id\n\n\t\t\tJOIN \".$this->db->dbprefix.\"services ON \".$this->db->dbprefix.\"maintenance_request.service_id = \".$this->db->dbprefix.\"services.id \n\n\t\t\t WHERE \".$this->db->dbprefix.\"properties.owner_id = $ownerData AND onelane_maintenance_request.unit_id = $unit_id\".$property_where.\" order BY onelane_maintenance_request.id DESC \")->result_array();\n\n\t\t//echo $this->db->last_query(); exit;\n\t}"
] |
[
"0.5618725",
"0.5515292",
"0.5505249",
"0.54220444",
"0.5281492",
"0.5260865",
"0.520061",
"0.5186425",
"0.50059164",
"0.5000828",
"0.4936768",
"0.49179113",
"0.49041307",
"0.48369357",
"0.48115435",
"0.47903192",
"0.47771978",
"0.47759086",
"0.4769511",
"0.4764831",
"0.47545493",
"0.47456065",
"0.47158423",
"0.47078016",
"0.4706172",
"0.47048458",
"0.46758187",
"0.4673988",
"0.46677867",
"0.4666663"
] |
0.5564845
|
1
|
/ create Create A New Build Usage Build.create Parameters ParameterData TypeComments new_valueshashmapSee required attributes list below. Required attributes: name and product_id. Return build_id
|
function Build_create($product_id, $name, $description = NULL, $milestone = NULL, $isactive = TRUE) {
$varray = array("product_id" => "int", "name" => "string", "description" => "string", "milestone" => "string", "isactive" => "int");
foreach($varray as $key => $val) {
if (isset(${$key})) {
$carray[$key] = new xmlrpcval(${$key}, $val);
}
}
// Create call
$call = new xmlrpcmsg('Build.create', array(new xmlrpcval($carray, "struct")));
// Do call and return value
return do_call($call);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function TestRun_create($build_id, $environment_id, $manager_id, $plan_id, $plan_text_version, $summary, $notes = NULL, $start_date = NULL, $stop_date = NULL) {\n\t$varray = array(\"build_id\" => \"int\", \"environment_id\" => \"int\", \"manager_id\" => \"int\", \"plan_id\" => \"int\", \"plan_text_version\" => \"int\", \"summary\" => \"string\", \"notes\" => \"string\", \"start_date\" => \"string\", \"stop_date\" => \"string\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.create', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function create( array $parameters );",
"public function create( array $parameters );",
"private function buildToParams($build) {\n $data = array(\n 'namespace' => $build->namespace, \n 'type' => $build->type, \n 'object_key' => $build->metaKey, \n 'object_id' => $build->objectID\n );\n if ($build->relation) {\n\n unset($data['object_key']);\n $data['operation'] = $build->relation->type;\n $data['user_id'] = $build->relation->user;\n $data['value'] = $build->relation->value;\n if ($build->objectCreation) {\n $data['timestamp'] = $build->objectCreation;\n }\n\n }\n return $data;\n }",
"function buildingCreate(Request $req){\n $input = app('request')->all();\n\n \t\t$rules = [\n \t\t\t'building_name' => ['required'],\n \t\t\t'floor_name' => ['required']\n \t\t];\n\n \t\t$validator = app('validator')->make($input, $rules);\n \t\tif($validator->fails()){\n \t\t\treturn $this->respond_json(412, 'Invalid input', $input);\n \t\t}\n\n $build = new building;\n $build->building_name = $req->building_name;\n $build->floor_name = $req->floor_name;\n $build->created_by = $req->created_by;\n $build->status = 1;\n\n if($req->filled('remark')){\n $build->remark = $req->remark;\n }\n\n $build->save();\n\n return $this->respond_json(200, 'data saved', $build);\n }",
"public function create()\n {\n return view('admin.builds.create', ['types' => TypeBuild::all()]);\n }",
"public function create($params);",
"private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }",
"public function create($params = array()) {\n\n }",
"public function create($params)\n {\n }",
"public function create($parameters) {\n return $this->sendRequest(\n self::METHOD_POST, \n self::$endPoints['create'] . '?' . http_build_query($parameters)\n );\n }",
"public static function get_build()\n {\n }",
"public function build(array $params = array());",
"function TestCaseRun_create($assignee, $build_id, $case_id, $case_text_version, $environment_id, $run_id, $canview = NULL, $close_date = NULL, $iscurrent = NULL, $notes = NULL, $sortkey = NULL, $testedby = NULL) {\n\t$varray = array(\"assignee\" => \"int\", \"build_id\" => \"int\", \"case_id\" => \"int\", \"case_text_version\" => \"int\", \"environment_id\" => \"int\", \"run_id\" => \"int\", \"canview\" => \"int\", \"close_date\" => \"string\", \"iscurrent\" => \"int\", \"notes\" => \"string\", \"sortkey\" => \"int\", \"testedby\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestCaseRun.create', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function create( array $params );",
"public function build( $data );",
"function TestPlan_create($author_id, $product_id, $default_product_version, $type_id, $name, $creation_date = NULL, $isactive = TRUE) {\n\t$varray = array(\"author_id\" => \"int\", \"product_id\" => \"int\", \"default_product_version\" => \"string\", \"type_id\" => \"int\", \"name\" => \"string\", \"creation_date\" => \"string\", \"isactive\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.create', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function actionCreate(array $attributes)\n {\n $input = new XInputFilter($attributes);\n $param = $input->getModel('Setting');\n\n if ($param->module == 'System') {\n $param->module = '';\n }\n\n // Get max ordering in a group\n $sql = \"\n SELECT MAX(ordering)\n FROM \" . SITE_ID . \"_setting\n WHERE module=:Module AND setting_group=:GroupName\n \";\n $con = Yii::app()->db;\n $command = $con->createCommand($sql);\n $maxOrdering = $command->queryScalar(array(':Module' => $param->module, ':GroupName' => $param->setting_group));\n $param->ordering = $maxOrdering + 1;\n\n $temp = Setting::model()->findByPk(array('name' => $param->Name, 'module' => $param->module));\n if (!is_null($temp)) {\n errorHandler()->log(Yii::t('Settings.Api', 'PARAMETER_EXISTS'));\n } else {\n if (!$param->save()) {\n errorHandler()->log($this->normalizeModelErrors($param->Errors));\n } else {\n $this->actionDb2php();\n }\n }\n $this->result = $param;\n }",
"function createProduct($params = array()){\n\t\t\n\t\t//echo json_encode($params['data']); die();\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::POST , '/multivendor/product/create/product.json' , false, $params['data'] ),true);\n\t}",
"function createProduct ($prodName,$typeCode,$prodPic,$prodStock,$prodValue,\n $prodDescription){\n \n return insertProduct ($prodName,$typeCode,$prodPic,$prodStock,$prodValue,\n $prodDescription);\n }",
"public function actionCreate() {\n\t\t$model = new Building();\n\n\t\tif ( $model->load( Yii::$app->request->post() ) && $model->save() ) {\n\t\t\treturn $this->redirect( [ 'index', 'id' => $model->id ] );\n\t\t} else {\n\t\t\treturn $this->render( 'create', [\n\t\t\t\t'model' => $model,\n\t\t\t] );\n\t\t}\n\t}",
"public function createProduct($data);",
"public function store(CreateBuildingAPIRequest $request)\n {\n if(Gate::denies('admin')){\n \treturn $this->sendError('Permission Denied');\n }\n $input = $request->all();\n\n $buildings = $this->buildingRepository->create($input);\n\n return $this->sendResponse($buildings->toArray(), 'Building saved successfully');\n }",
"public function create($data)\n {\n $productId = $data['product_id'];\n $data['title'] = str_replace('\"', '\\\"', $data['title']);\n $dataJson = str_replace(\"'\", \"\\'\", json_encode($data));\n \n $entry = $this->load($productId);\n $query = '';\n\n if (!empty($entry)) {\n $query = \"UPDATE products SET original_data = '{$dataJson}', last_status_change = NOW() WHERE id = {$productId}\";\n } else {\n $query = \"INSERT INTO products(id, original_data) VALUES ({$productId}, '{$dataJson}')\";\n }\n \n $this->query($query);\n $errors = $this->getLastError(); \n if ($errors) {\n http_response_code(400);\n die($errors);\n }\n \n return $this;\n }",
"public function create()\n\t{\n return View::make('buildings.create');\n\t}",
"private function storeBuild($buildId){\n $buildMapper = $this->getServiceLocator()->get('cphp-agent.mapper.build');\n $data = [\n 'path' => $buildId,\n 'date' => new \\DateTime('now'),\n ];\n $build = new \\CphpAgent\\Entity\\Build();\n $build->exchangeArray($data);\n $buildMapper->store($build);\n $buildMapper->flush();\n }",
"public function createProduct( $params ) {\n\t\treturn $this->requester->request('POST', $this->url, $params);\n\t}",
"public function actionProductCreate()\n\t{\n\n\t\t$data = $_POST;\n\t\t$merchantId=$data['merchant_id'];\n\t\t$logFIle = 'product/create/'.$data['merchant_id'];\n\t\tData::createLog('Data : '.json_encode($data),$logFIle,'a');\n\t\n\t\t$connection = Yii::$app->getDb();\n\t\t$result = Jetproductinfo::saveNewRecords($data['data'],$data['merchant_id'],$connection);\n\t}",
"public function createAction() {\n\n $this->validateUser();\n\n $form = new Yourdelivery_Form_Testing_Create();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->getRequest()->getPost())) {\n if ($form->getValue('tag') && $this->getRequest()->getParam('proceed') == 'false') {\n $tags = Yourdelivery_Model_Testing_TestCase::searchForTags($form->getValue('tag'));\n\n if ($tags) {\n foreach ($tags as $tag) {\n $ids .= sprintf('<a href=\"/testing_cms/overview/id/%s\" target=\"blank\">%s</a> ', $tag['id'], $tag['id']);\n }\n $this->warn('Tag already in use for testcase ' . $ids);\n $this->_redirect(vsprintf('testing_cms/create/title/%s/author/%s/description/%s/priority/%s/tag/%s/proceed/true', $form->getValues()));\n }\n }\n\n $testCase = new Yourdelivery_Model_Testing_TestCase();\n $testCase->setData($form->getValues());\n $id = $testCase->save();\n $this->success('Testcase successfully created.');\n $this->_redirect('testing_cms/add/id/' . $id);\n } else {\n $this->error($form->getMessages());\n }\n }\n $this->view->post = $this->getRequest()->getParams();\n }",
"function rest_put()\n{\n global $buildid;\n}"
] |
[
"0.5603769",
"0.55775565",
"0.55775565",
"0.55154884",
"0.54498285",
"0.5313383",
"0.5276871",
"0.52326095",
"0.5228992",
"0.51612204",
"0.5140922",
"0.51321703",
"0.51295704",
"0.51227933",
"0.5078739",
"0.50605136",
"0.5048612",
"0.5044323",
"0.50424564",
"0.5038952",
"0.5037033",
"0.5023366",
"0.5014969",
"0.50010484",
"0.49753797",
"0.49671683",
"0.49513596",
"0.49432895",
"0.49228823",
"0.49205884"
] |
0.6411733
|
0
|
/ update Update An Existing Build Usage Build.update Parameters ParameterData TypeComments build_idinteger new_valueshashmapbuild_id and product_id can not be modified. Return Array: [build_id] [name] [milestone] [isactive] [description]
|
function Build_update($build_id, $name, $description = NULL, $milestone = NULL, $isactive = TRUE) {
$varray = array("name" => "string", "description" => "string", "milestone" => "string", "isactive" => "int");
foreach($varray as $key => $val) {
if (isset(${$key})) {
$carray[$key] = new xmlrpcval(${$key}, $val);
}
}
// Create call
$call = new xmlrpcmsg('Build.update', array(new xmlrpcval($build_id, "int"), new xmlrpcval($carray, "struct")));
// Do call and return value
return do_call($call);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function TestRun_update($run_id, $build_id, $environment_id, $manager_id, $plan_text_version, $summary, $notes = NULL, $start_date = NULL, $stop_date = NULL) {\n\t$varray = array(\"build_id\" => \"int\", \"environment_id\" => \"int\", \"manager_id\" => \"int\", \"plan_text_version\" => \"int\", \"summary\" => \"string\", \"notes\" => \"string\", \"start_date\" => \"string\", \"stop_date\" => \"string\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.update', array(new xmlrpcval($run_id, \"int\"), new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestCaseRun_update($run_id, $case_id, $build_id, $environment_id, $assignee = NULL, $case_run_status_id = NULL, $notes = NULL, $update_bugs = NULL) {\n\t$varray = array(\"assignee\" => \"int\", \"case_run_status_id\" => \"int\", \"notes\" => \"string\", \"update_bugs\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestCaseRun.update', array(new xmlrpcval($run_id, \"int\"),new xmlrpcval($case_id, \"int\"),new xmlrpcval($build_id, \"int\"),new xmlrpcval($environment_id, \"int\"), new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function buildUpdate($params)\n {\n $result = '';\n $setStatement = '';\n $fieldList = $this->getFieldList($params['table']);\n reset($fieldList);\n\n while(current($fieldList))\n {\n if (in_array(current($fieldList), array_keys($params)))\n {\n $setStatement .= \"`\" . current($fieldList) . \"` = '\" . $params[current($fieldList)] . \"', \";\n }\n else\n {\n $this->setError(\"\", \"buildUpdate #001\");\n return false;\n }\n $fieldInfo = next($fieldList);\n }\n\n $setStatement = preg_replace(\"/,\\s*$/\", \"\", $setStatement);\n\n $result = \"UPDATE \" . $params[\"table\"] . \" SET \" . $setStatement;\n\n if (isset($params['where']))\n {\n $result .= \" WHERE \" . $params['where'] . \";\" ;\n }\n else\n {\n $result .= \";\";\n }\n\n return $result;\n }",
"public function update( array $params );",
"public\n\n function updateschlbuildstatus()\n {\n $emis_loggedin = $this->session->userdata('emis_loggedin');\n if ($emis_loggedin)\n {\n $value = $this->input->post('value');\n if ($value == \"1\" || $value == \"2\" || $value == \"3\" || $value == \"4\" || $value == \"5\" || $value == \"6\" || $value == \"7\")\n {\n $data = array(\n \"buil_status\" => $value\n );\n $school_id = $this->session->userdata('emis_school_id');\n if ($this->Udise_assetmodel->updatedata($data, $school_id))\n {\n $result_arr['response_code'] = 1;\n }\n else\n {\n $result_arr['response_code'] = 0;\n $result_arr['error_msg'] = \"Unable to update the database. Kindly re-try\";\n }\n }\n else\n {\n $result_arr['response_code'] = - 1;\n $result_arr['error_msg'] = \"School Building Status \" . \" is not in the correct format.Re-check and submit again \";\n }\n\n echo json_encode($result_arr);\n }\n else\n {\n redirect('/', 'refresh');\n }\n }",
"function editBuildingHandler() {\n global $inputs;\n\n $res = updateDb('building', [\n 'building_name' => $inputs['name'], \n 'address' => $inputs['address'],\n 'description' => $inputs['desc'],\n 'area' => $inputs['area']],\n ['id' => $inputs['id']]);\n\n formatOutput(true, 'update success', $res);\n}",
"public function update($params,$where){\n\t\t$rdata=0;\n\t\t$data=array();\n\t\t$sql=array();\n\t\tif(!empty($params)){\n\t\t\t$sql=array();\n\t\t\tforeach($params as $tname=>$cvalue){\n\t\t\t\t$data=array();\n\t\t\t\tforeach($cvalue as $field=>$value){\n\t\t\t\t\t$marray=array();\n\t\t\t\t\tif(preg_match('/^#(.*)$/',$field,$marray)){\n\t\t\t\t\t\t$field=$marray[1];\n\t\t\t\t\t\t$data[]=\"`\".trim($field,'`').\"`=\".$value;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$data[]=\"`\".trim($field,'`').\"`='\".$value.\"'\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->query(\"UPDATE `\".$tname.\"` SET \".implode(',',$data).\" \".(!empty($where)?\"WHERE \".$where:'').\";\");\n\t\t\t\t$rdata=$this->affected_rows;\n\t\t\t}\n\t\t}\n\t\treturn $rdata;\n\t}",
"public\n\n function updateschoolbuildingtype()\n {\n $emis_loggedin = $this->session->userdata('emis_loggedin');\n if ($emis_loggedin)\n {\n $value = $this->input->post('value');\n if ($value == \"1\" || $value == \"2\" || $value == \"3\" || $value == \"4\")\n {\n $data = array(\n \"buil_type\" => $value\n );\n $school_id = $this->session->userdata('emis_school_id');\n if ($this->Udise_assetmodel->updatedata($data, $school_id))\n {\n $result_arr['response_code'] = 1;\n }\n else\n {\n $result_arr['response_code'] = 0;\n $result_arr['error_msg'] = \"Unable to update the database. Kindly re-try\";\n }\n }\n else\n {\n $result_arr['response_code'] = - 1;\n $result_arr['error_msg'] = \"school type \" . \" is not in the correct format.Re-check and submit again \";\n }\n\n echo json_encode($result_arr);\n }\n else\n {\n redirect('/', 'refresh');\n }\n }",
"public function update($params, $data)\n\t{\n\t\treturn $this->entity->update($params, $data);\n\t}",
"public function updateBy(array $params, array $data)\n {\n return $this ->model ->where($params) ->update($data);\n }",
"public function updateProject(int $projectId, array $params) : string;",
"public static function doUpdate($params=NULL) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$conn->update(self::TABLE_NAME);\n\t\tif (!is_a($params, 'wgConnector') && isset($params['where'])) {\n\t\t\tif (!isset($params['wherecol'])) $params['wherecol'] = self::PRIMARY_KEY;\n\t\t\t$conn->where($params['wherecol'], $params['where']);\n\t\t\tunset($params['where']);\n\t\t\tunset($params['wherecol']);\n\t\t}\n\t\tif (!empty($params) && is_array($params)) {\n\t\t\tforeach ($params as $key=>$par) {\n\t\t\t\tif (isset(self::$_tableFields[$key])) $conn->set($key, $par);\n\t\t\t\telse throw new WgException(\"Field \".self::TABLE_NAME.\".$key does not exist.\");\n\t\t\t}\n\t\t}\n\t\t$af = (int) DbModel::doAffected($conn, new ProjectsListingsModel());\n\t\tif (!(bool) $af) $af = 1;\n\t\treturn (int) $af;\n\t}",
"public function update(Request $request, Build $build)\n {\n $build->update($request->all());\n SetHistory::save('Обновил', $build->id, null);\n $build->save();\n return redirect()->route('admin.builds.index');\n }",
"public static function Update( $params ) {\n clude( 'models/submission.php' );\n global $user;\n $user[ 'rights' ] < 40 && die( 'hard' );\n \n Controller::RequiredParameters( $params, 'userid', 'assignmentid', 'validationid' ) or die( 'hard' );\n if( Submission::Update( $params[ 'userid' ], $params[ 'assignmentid' ], $params[ 'validationid' ] ) == 0 ){\n Submission::Create( $params[ 'assignmentid' ], $params[ 'userid' ], $params[ 'validationid' ] );\n }\n $res = Submission::UserResults( $params[ 'userid' ], $params[ 'assignmentid' ] );\n //TODO: write a view to output the description.\n echo $res[ 0 ][ 'description' ];\n }",
"public function update(array $data, array $where);",
"public function updateData($data){\n $data = $this->validation($data, 'edit');\n if(isset($data['error']) && $data['error'] != null){\n return $data;\n }else {\n $dbTable = 'reports';\n $postData = array(\n 'status' => $data['status'],\n 'check_in' => $data['check_in'],\n 'check_out' => $data['check_out'],\n 'meter_type' => $data['meter_type'],\n 'meter_reading' => $data['meter_reading'],\n 'meter_measurement' => $data['meter_measurement'],\n 'oil_level' => $data['oil_level'],\n 'keys_front_door' => $data['keys_front_door'],\n 'keys_bedroom_door' => $data['keys_bedroom_door'],\n 'keys_block_door' => $data['keys_block_door'],\n 'keys_back_door' => $data['keys_back_door'],\n 'keys_garage_door' => $data['keys_garage_door'],\n 'keys_other_door' => $data['keys_other_door'],\n 'fire_extin' => $data['fire_extin'],\n 'fire_blanket' => $data['fire_blanket'],\n 'smoke_alarm' => $data['smoke_alarm']\n );\n $where = \"`id` = {$data['id']}\";\n\n $this->_db->update($dbTable, $postData, $where);\n return true;\n }\n\t}",
"public static function updateBy($data = array(), $params = array()) {\n\t\tif (!is_array($data)) return false;\n\t\treturn self::_getDao()->updateBy($data, $params);\n\t}",
"public static function updateConfigBy($data, $params) {\n\t\tif (!is_array($data)) return false;\n if (!is_array($params)) return false; \n $data['update_time'] = Common::getTime();\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->updateBy($data, $params);\n\t}",
"public function updateCampaign($params)\r\n {\r\n }",
"public function UpdateProject($params)\n{\n $cuo_id = $this->db->real_escape_string($params['cuoId']);\n $cus_id = $this->db->real_escape_string($params['cusId']); \n $cus_Parent = $this->db->real_escape_string($params['cusParent']);\n\n $qry01 = \" UPDATE ctt_customers_owner \n SET cus_id = '$cus_id', \n cus_parent = '$cus_Parent'\n WHERE cuo_id = '$cuo_id';\";\n\n $this->db->query($qry01);\n\n $pjt_id = $this->db->real_escape_string($params['projId']); \n $pjt_name = $this->db->real_escape_string($params['pjtName']); \n $pjt_date_start = $this->db->real_escape_string($params['pjtDateStart']);\n $pjt_date_end = $this->db->real_escape_string($params['pjtDateEnd']); \n $pjt_time = $this->db->real_escape_string($params['pjtTime']); \n $pjt_location = $this->db->real_escape_string($params['pjtLocation']);\n $pjt_type = $this->db->real_escape_string($params['pjtType']);\n $pjttc_id = $this->db->real_escape_string($params['pjttcId']);\n $loc_id = $this->db->real_escape_string($params['locId']);\n $pjt_how_required = $this->db->real_escape_string($params['pjtHowRequired']);\n $pjt_trip_go = $this->db->real_escape_string($params['pjtTripGo']);\n $pjt_trip_back = $this->db->real_escape_string($params['pjtTripBack']);\n $pjt_to_carry_on = $this->db->real_escape_string($params['pjtToCarryOn']);\n $pjt_to_carry_out = $this->db->real_escape_string($params['pjtToCarryOut']);\n $pjt_test_tecnic = $this->db->real_escape_string($params['pjtTestTecnic']);\n $pjt_test_look = $this->db->real_escape_string($params['pjtTestLook']);\n\t$edos_id = $this->db->real_escape_string($params['edos_id']);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\n $qry02 = \"UPDATE ctt_projects\n SET pjt_name = '$pjt_name', \n pjt_date_start = '$pjt_date_start', \n pjt_date_end = '$pjt_date_end',\n pjt_time = '$pjt_time',\n pjt_location = '$pjt_location', \n pjt_how_required = '$pjt_how_required',\n pjt_trip_go = '$pjt_trip_go',\n pjt_trip_back = '$pjt_trip_back',\n pjt_to_carry_on = '$pjt_to_carry_on',\n pjt_to_carry_out = '$pjt_to_carry_out',\n pjt_test_tecnic = '$pjt_test_tecnic',\n pjt_test_look = '$pjt_test_look',\n pjttp_id = '$pjt_type', \n cuo_id = '$cuo_id',\n loc_id = '$loc_id',\n pjttc_id = '$pjttc_id',\n edos_id = '$edos_id'\n WHERE pjt_id = $pjt_id;\n \";\n $this->db->query($qry02);\n\n return $pjt_id;\n\n}",
"public static function updateBy($data, $params) {\n\t\tif (!is_array($data)) return false;\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->updateBy($data, $params);\n\t}",
"function update_numberreturnsubmission($numberReturnSubmissionId,$params)\n {\n $this->db->where('numberReturnSubmissionId',$numberReturnSubmissionId);\n $response = $this->db->update('numberreturnsubmission',$params);\n if($response)\n {\n return \"numberreturnsubmission updated successfully\";\n }\n else\n {\n return \"Error occuring while updating numberreturnsubmission\";\n }\n }",
"function update_batch($batch_id,$params)\n {\n $this->db->where('batch_id',$batch_id);\n return $this->db->update('batch',$params);\n }",
"function TestCase_update($case_id, $case_status_id, $category_id, $isautomated, $alias = NULL, $arguments = NULL, $default_tester_id = NULL, $priority_id = NULL, $requirement = NULL, $script = NULL, $summary = NULL, $sortkey = NULL) {\n\t$varray = array(\"case_id\" => \"int\", \"case_status_id\" => \"int\", \"category_id\" => \"int\", \"isautomated\" => \"int\", \"alias\" => \"string\", \"arguments\" => \"string\", \"default_tester_id\" => \"int\", \"priority_id\" => \"int\", \"requirement\" => \"string\", \"script\" => \"string\", \"summary\" => \"string\", \"sortkey\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.update', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function updateactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $activity_id = $this->input->post('activityid');\n $name = $this->input->post('name');\n $multiplicity = $this->input->post('multiplicity');\n $severity = $this->input->post('severity');\n $unit = $this->input->post('unit');\n $desc = $this->input->post('desc');\n $status = $this->m_activities->update($activity_id, $wl_id, $name, $multiplicity, $severity, $unit, $desc);\n $this->activities();\n }",
"public function testUpdateProject()\n {\n echo \"\\nTesting project update...\";\n $id = \"P5334183\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('prj_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }",
"public function update($parameters,$id)\n {\n \t $this->db->update('product', $parameters, array('product_id' => $id));\n return true;\n }",
"public function update($data = NULL, $where = NULL){\n $this->db->where($where);\n return $this->db->update($this->table,$data);\n }",
"public static function update($params)\n {\n try {\n if (empty($params) || !is_array($params['values'])) {\n throw new Exception('db update: too few arguments');\n }\n\n $values = '';\n foreach ($params['values'] as $key => $value) {\n $values .= ($values ? ',' : '') . \"{$key}='{$value}'\";\n }\n $condition = static::buildCondition($params);\n\n $sql = \"update {$params['table']} set {$values} {$condition}\";\n\n return static::conn()->exec($sql);\n } catch (Exception $e) {\n Logger::error($e->getMessage());\n return null;\n }\n }",
"function Environment_update($environment_id, $isactive, $product_id = NULL, $name = NULL) {\n\t$varray = array(\"isactive\" => \"int\", \"product_id\" => \"int\", \"name\" => \"string\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('Environment.update', array(new xmlrpcval($environment_id, \"int\"), new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}"
] |
[
"0.57454574",
"0.5713409",
"0.56555367",
"0.56214905",
"0.547906",
"0.5471611",
"0.54303324",
"0.54220176",
"0.541778",
"0.53332627",
"0.5303682",
"0.52929866",
"0.52869153",
"0.526802",
"0.5267641",
"0.52036977",
"0.5168654",
"0.5154668",
"0.51513135",
"0.513592",
"0.51211315",
"0.5117596",
"0.5061877",
"0.5056143",
"0.50557375",
"0.50539535",
"0.503856",
"0.5028363",
"0.5027513",
"0.50247794"
] |
0.68020827
|
0
|
/ lookup_id_by_name Lookup A Build ID By Its Name Usage Build.lookup_id_by_name Parameters ParameterData TypeComments namestringCannot be null or empty string Return build_id
|
function Build_lookup_id_by_name($name) {
// Create call
$call = new xmlrpcmsg('Build.lookup_id_by_name', array(new xmlrpcval($name, "string")));
// Do call and return value
return do_call($call);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function Build_lookup_name_by_id($build_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('Build.lookup_name_by_id', array(new xmlrpcval($build_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function Product_lookup_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('Product.lookup_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestRun_lookup_environment_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.lookup_environment_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function getPerson_ID($name, &$official_name)\r\n\t{\r\n\t\t//build the api request using the key [global variable] and json format, and postcode \r\n\t\tglobal $Open_Australia_Key;\r\n\t\t$person_id = null;\r\n\r\n\t\t\r\n\t\tfor($count = 0; $person_id == null && $count < 2; $count++)\r\n\t\t{\r\n\t\t\tif($count == 0)\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getRepresentatives\";\r\n\t\t\telse\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getSenators\";\r\n\t\t\t\t\r\n\t\t\t$data = array('search'=>$name,'output'=>'js','key'=> $Open_Australia_Key);\r\n\t\t\t$GETurl = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n\t\t\r\n\t\t\t//translate fullBio into a usable form\r\n\t\t\t$fullBio = json_decode(file_get_contents($GETurl));\r\n\t\t\t\r\n\t\t\t//check if the name yielded any actual data;\r\n\t\t\tif(! ($fullBio == new StdClass()))\r\n\t\t\t{\r\n\t\t\t\t//pull the first record [it's now an object!!!]\r\n\t\t\t\t$pollie = $fullBio[0];\r\n\r\n\t\t\t\t\r\n\t\t\t\t//get the values from the object\r\n\t\t\t\t$person_id = $pollie->person_id;\r\n\t\t\t\t$official_name = $pollie->full_name;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $person_id;\r\n\t}",
"function TestPlan_lookup_type_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.lookup_type_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestCase_lookup_category_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.lookup_category_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function Build_get($build_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('Build.get', array(new xmlrpcval($build_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function findID($d) {\n\t\t$url = \"https://inpho.cogs.indiana.edu/thinker.json\";\n\t\t$data = @file_get_contents($url,o,null,null);\n\t\t$json = json_decode($data);\n\t\t$results = $json->responseData->results;\n\t\tforeach($results as $value) {\n\t\t\tif (strcasecmp($value->label,$d)==0) { \n\t\t\t\t$id = $value->ID;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//return value of $id when string matches\n\t\treturn $id;\n\t}",
"static function findIdByName($name) {\n $campaign = self::findByName($name);\n if (count($campaign)>0) return $campaign['id'];\n return 0;\n }",
"public function getIdByName($name) {\n $id = $this->db->queryToSingleValue(\n \t\"select \n \t\tid\n from \n \tOvalSourceDef \n where\n \tname='\".mysql_real_escape_string($name).\"'\");\n if ($id == null) {\n return -1;\n }\n return $id;\n }",
"function TestRun_lookup_environment_name_by_id($environment_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.lookup_environment_name_by_id', array(new xmlrpcval($environment_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestCaseRun_lookup_status_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCaseRun.lookup_status_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestCase_lookup_priority_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.lookup_priority_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function Product_lookup_name_by_id($product_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('Product.lookup_name_by_id', array(new xmlrpcval($product_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestCase_lookup_status_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.lookup_status_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"static function getIdOf ($name)\n {\n return array_search ($name, self::$NAMES);\n }",
"function GetID($ConditionString);",
"private function retrieve_id() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$replacement = $this->args->ID;\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getReplacementId($name);",
"public function nameToId($name)\n {\n // If the username already contains an ampersand, then we don't need to process. \n $pos = strpos($name, '@');\n if ($pos !== false)\n {\n return $name;\n }\n \n $url = 'http://idgettr.com';\n switch ($this->get('params')->get('source'))\n {\n case 'user_photos':\n case 'friend_photos':\n $data = array('photostream' => 'http://www.flickr.com/photos/'.$name);\n break;\n case 'group_photos':\n $data = array('photostream' => 'https://www.flickr.com/groups/'.$name);\n break;\n case 'set_photos':\n $data = array('photostream' => 'https://www.flickr.com/photos/'.$name.'/sets/'.$this->get('params')->get('flickrset'));\n break;\n }\n\n if ($url)\n {\n if (function_exists('curl_init'))\n {\n $useragent = \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)\";\n\n $curl_handle = curl_init();\n curl_setopt($curl_handle, CURLOPT_URL, $url);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl_handle, CURLOPT_REFERER, 'idgettr.com');\n curl_setopt($curl_handle, CURLOPT_USERAGENT, $useragent);\n $buffer = curl_exec($curl_handle);\n curl_close($curl_handle);\n\n if (!empty($buffer))\n {\n $pos = strpos($buffer, '<p><strong>id:</strong> ');\n if ($pos !== false)\n {\n $pos_start = $pos + 24;\n $pos_end = strpos($buffer, '</p>', $pos_start);\n $length = $pos_end - $pos_start;\n $id = substr($buffer, $pos_start, $length);\n return $id;\n } \n }\n }\n }\n\n\t\treturn false;\n }",
"protected function findNamedBuildingNid($string) {\n $nids = \\Drupal::entityQuery('node')\n ->condition('type', 'named_building')\n ->condition('field_building_building_id', $string)\n ->execute();\n\n foreach ($nids as $nid) {\n return $nid;\n }\n\n return NULL;\n }",
"function getPersonID($projectUUID, $personName){\n\t\n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT persons.uuid\n\t\t\t\t\tFROM persons\n\t\t\t\t\tWHERE persons.project_id = '\".$projectUUID.\"'\n\t\t\t\t\tAND persons.combined_name LIKE '%\".$personName.\"%'\t\n\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\n\t\t\t\t\tUNION\n\t\t\t\t\t\n\t\t\t\t\tSELECT users.uuid AS uuid\n\t\t\t\t\tFROM users \n\t\t\t\t\tWHERE users.combined_name LIKE '%\".$personName.\"%'\t\n\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\n\t\t\t\t\t\";\n\t\t \n\t\t $result = $db->fetchAll($sql, 2);\n\t\t $personID = false;\n\t\t if($result){\n\t\t\t\t$personID = $result[0][\"uuid\"];\n\t\t }\n\t\t \n\t\t return $personID;\n \n }",
"function getItemIDByName($name)\r\n\t{\r\n\t\t// storage for the output\r\n\t\t$retVal = \"\";\r\n\r\n\t\t// for each item returned\r\n\t\tforeach($this->UserNameList as $item)\r\n\t\t{\r\n\t\t\t// is this the one we are looking for\r\n\t\t\tif($item[2] == $name)\r\n\t\t\t{\r\n\t\t\t\t// save the value\r\n\t\t\t\t$retVal = $item[0];\r\n\r\n\t\t\t\t// no need to continue\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// return to the caller\r\n\t\treturn $retVal;\r\n\t}",
"abstract protected function buildWantID($filter, $config);",
"public static function create($params) {\n $rows = DB::query('INSERT INTO Unit (name_singular, name_plural, abbreviation) '\n . 'VALUES (:name_singular, :name_plural, :abbreviation) '\n . 'RETURNING ID',\n array('name_singular' => $params['name_singular'],\n 'name_plural' => $params['name_plural'],\n 'abbreviation' => $params['abbreviation']\n ));\n \n if (count($rows) > 0) {\n $row = $rows[0];\n \n $last_id = $row['id'];\n }\n \n return $last_id;\n }",
"protected static function GET_id(array $params) {\n\t\tif($id = trim(array_shift($params)))\n\t\t\tif(is_numeric($id)) {\n\t\t\t\t$id = +$id;\n\t\t\t\tif($db = self::RequireLatestDatabase())\n\t\t\t\t\tif($recipe = self::fromID($id, $db))\n\t\t\t\t\t\tself::Success($recipe);\n\t\t\t\t\telse\n\t\t\t\t\t\tself::NotFound(\"No recipe at ID $id.\");\n\t\t\t} else\n\t\t\t\tself::NeedMoreInfo(\"ID '$id' is not numeric.\");\n\t\telse\n\t\t\tself::NeedMoreInfo('ID to look up needs to be passed in the URL as recipe/id/{ID}.');\n\t}",
"function sqlout_id($out, $id, $string)\r\n{\r\n\t\r\n\tswitch ( $string )\r\n\t{\r\n\t\tcase 'map_id': $str = array('map_id', 'map_name'); break;\r\n\t\tcase 'forum_id': $str = array('forum_id', 'forum_name'); break;\r\n\t\tcase 'menu_id': $str = array('menu_id', 'menu_name'); break;\r\n\t\tcase 'profile_id': $str = array('profile_id', 'profile_name'); break;\r\n\t\tcase 'dl_id':$str = array('dl_id', 'dl_name'); break;\r\n\t}\r\n\t\r\n\tforeach ( $out as $_out )\r\n\t{\r\n\t\tforeach ( $_out as $var => $value )\r\n\t\t{\r\n\t\t\tif ( $var === $string )\r\n\t\t\t{\r\n\t\t\t\tif ( $value == $id )\r\n\t\t\t\t{\r\n\t\t\t\t\t$return['id'] = $_out[$str[0]];\r\n\t\t\t\t\t$return['name'] = $_out[$str[1]];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $return;\r\n}",
"function get_app_id_for_codename($link, &$data, $codename) // Colorize: green\n { // Colorize: green\n $res = 0; // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"SELECT\" // Colorize: green\n . \" id\" // Colorize: green\n . \" FROM \" . DB_TABLE_APPS // Colorize: green\n . \" WHERE codename = '\" . $link->real_escape_string($codename) . \"'\"; // Colorize: green\n // Ignore PhpAlignmentVerifier [END] // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $result = $link->query($sql); // Colorize: green\n die_if_sql_failed($result, $link, $data, $sql); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n if ($result->num_rows == 1) // Colorize: green\n { // Colorize: green\n $res = $result->fetch_row()[0]; // Colorize: green\n $result->close(); // Colorize: green\n } // Colorize: green\n else // Colorize: green\n { // Colorize: green\n $result->close(); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n db_disconnect($link); // Colorize: green\n // Colorize: green\n $data[\"message\"] = \"Application not found\"; // Colorize: green\n // Colorize: green\n die(json_encode($data)); // Colorize: green\n } // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return $res; // Colorize: green\n }",
"public function determineId() {}",
"function getCreateSampleTypeID($parameters){\n\t$idSampleType = '0';\n\t$sampleTypeName = '';\n\t\n\t$ownConnection = false;\n\t//Make a connection to the DB if none is given.\n\tif(isset($parameters['connection'])){\n\t\t\t$connection = $parameters['connection'];\n\t}\n\telse{\n\t\t$connection = makeConnectionToDIAMONDS();\n\t\t$ownConnection = true;\n\t}\n\t\n\t//Check if all the required fields are given.\n\tif(isset($parameters['name'])){\n\t\t$sampleTypeName = $parameters['name'];\n\t}\n\t\n\tif(isset($parameters['idSampleType'])){\n\t\t$idSampleType = $parameters['idSampleType'];\n\t}\n\t\n\t//Check if sampleType already exist, if yes return that id\n\t$query = \"SELECT idSampleType FROM tSampleType WHERE idSampleType = \".$idSampleType.\" OR name = '$sampleTypeName'\";\n\t\n\t$id = '';\n\t\n\tif ($result = mysqli_query($connection, $query)) {\n\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t$id = $row['idSampleType'];\n\t\t}\n\t}\n\t\n\t//Create the sampleType if it does not yet exist\n\tif($id == ''){\n\t\n\t\t$sqlStatement = \"INSERT INTO tSampleType (name) VALUES(?)\";\n\t\t\t\n\t\t$sqlQuery = prepareSQLStatement($connection, $sqlStatement);\n\t\t\n\t\t//Bind the variables to the SQL parameters\n\t\t$sqlQuery->bind_param('s',\n\t\t$sampleTypeName\n\t\t);\n\t\t\n\t\t$id = executeSQLStatementGetID($connection, $sqlQuery);\n\t\t$connection->commit();\n\t\t\n\t\techo \"<p><font color=orange>SampleType: \".$sampleTypeName. \" created in DIAMONDS DB</font></p>\";\n\t}\n\t\n\tif($ownConnection == true){\n\t\tcloseConnectionDB($connection);\n\t}\n\t\n\treturn $id;\n\t\n}"
] |
[
"0.74283135",
"0.59765315",
"0.57461715",
"0.5650516",
"0.5380674",
"0.53715914",
"0.5328323",
"0.53106856",
"0.51278037",
"0.5115059",
"0.5076167",
"0.5026887",
"0.49832076",
"0.49530965",
"0.49248132",
"0.49172297",
"0.49029005",
"0.48915276",
"0.48795432",
"0.48644692",
"0.4852889",
"0.48264903",
"0.48252398",
"0.48185953",
"0.47930083",
"0.47758594",
"0.4770087",
"0.475937",
"0.47583598",
"0.47541413"
] |
0.7034429
|
1
|
/ lookup_name_by_id Lookup A Build Name By Its ID Usage Build.lookup_name_by_id Parameters ParameterData TypeComments idintegerCannot be 0 Return name
|
function Build_lookup_name_by_id($build_id) {
// Create call
$call = new xmlrpcmsg('Build.lookup_name_by_id', array(new xmlrpcval($build_id, "int")));
// Do call and return value
return do_call($call);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function Build_lookup_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('Build.lookup_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function Product_lookup_name_by_id($product_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('Product.lookup_name_by_id', array(new xmlrpcval($product_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function getName( $ID)\r\n{\r\n global $db;\r\n\r\n list( $temp, $hidden) = $db->getItems( array( \"name\", \"HIDE\"), $ID);\r\n\r\n if ( ANIMALPEDIGREE)\r\n $temp = $db->changeBrack( $temp);\r\n else\r\n $temp = str_replace( \"/\", \"\", $temp);\r\n if ( $hidden == \"Yes\")\r\n $temp = $db->obstr( $temp, 1);\r\n\r\n if ( $temp == UNDEFINED) {\r\n return UNDEFINED;\r\n } else {\r\n if ( trim( $temp) == \"\")\r\n $temp = \"(no name specified)\";\r\n return $temp;\r\n } \r\n}",
"function Product_lookup_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('Product.lookup_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestPlan_lookup_type_name_by_id($type_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.lookup_type_name_by_id', array(new xmlrpcval($type_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function forName();",
"function getPerson_ID($name, &$official_name)\r\n\t{\r\n\t\t//build the api request using the key [global variable] and json format, and postcode \r\n\t\tglobal $Open_Australia_Key;\r\n\t\t$person_id = null;\r\n\r\n\t\t\r\n\t\tfor($count = 0; $person_id == null && $count < 2; $count++)\r\n\t\t{\r\n\t\t\tif($count == 0)\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getRepresentatives\";\r\n\t\t\telse\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getSenators\";\r\n\t\t\t\t\r\n\t\t\t$data = array('search'=>$name,'output'=>'js','key'=> $Open_Australia_Key);\r\n\t\t\t$GETurl = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n\t\t\r\n\t\t\t//translate fullBio into a usable form\r\n\t\t\t$fullBio = json_decode(file_get_contents($GETurl));\r\n\t\t\t\r\n\t\t\t//check if the name yielded any actual data;\r\n\t\t\tif(! ($fullBio == new StdClass()))\r\n\t\t\t{\r\n\t\t\t\t//pull the first record [it's now an object!!!]\r\n\t\t\t\t$pollie = $fullBio[0];\r\n\r\n\t\t\t\t\r\n\t\t\t\t//get the values from the object\r\n\t\t\t\t$person_id = $pollie->person_id;\r\n\t\t\t\t$official_name = $pollie->full_name;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $person_id;\r\n\t}",
"function objGetNameFromId($dbh, $id, $get=\"name\")\r\n{\r\n\tglobal $g_obj_cache;\r\n\r\n\tif ($g_obj_cache)\r\n\t{\r\n\t\tif (isset($g_obj_cache[$dbh->dbname][$id][$get]))\r\n\t\t\treturn $g_obj_cache[$dbh->dbname][$id][$get];\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif (!isset($g_obj_cache[$dbh->dbname]))\r\n\t\t\t$g_obj_cache[$dbh->dbname] = array();\r\n\r\n\t\t$result = $dbh->Query(\"select id, name, title from app_object_types order by title\");\r\n\t\t$num = $dbh->GetNumberRows($result);\r\n\t\tfor ($i = 0; $i < $num; $i++)\r\n\t\t{\r\n\t\t\t$row = $dbh->GetRow($result, $i);\r\n\t\t\t$g_obj_cache[$dbh->dbname][$row['id']] = array(\"name\"=>$row['name'], \"title\"=>$row['title'], \"id\"=>$row['id']);\r\n\t\t}\r\n\t\t$dbh->FreeResults($result);\r\n\r\n\t\tif (isset($g_obj_cache[$dbh->dbname][$id][$get]))\r\n\t\t\treturn $g_obj_cache[$dbh->dbname][$id][$get];\r\n\t}\r\n\r\n\treturn \"\";\r\n}",
"static function get_name($id) {\r\n\t\t\tif (trim($id)=='') {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$all = self::get_all();\r\n\t\t\treturn $all[$id][0];\r\n\t\t}",
"function entityName( $id ) ;",
"function name_from_id($nfi_table, $nfi_id, $nfi_id_col, $nfi_name_col){\r\n\t\tglobal $conn;\r\n\t\t$sql_quary = \"SELECT * FROM \".$nfi_table.\" WHERE \".$nfi_id_col.\"='\".$nfi_id.\"';\";\r\n\t\t$sql = $conn->prepare($sql_quary);\r\n\t\t$sql->execute();\r\n\t\t\t\r\n\t\t$numRows = $sql->fetchAll();\r\n\t\t\tif(count($numRows)>0){\r\n\t\t\t\tforeach($numRows as $row){\r\n\t\t\t\t\treturn $row[$nfi_name_col];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}",
"function TestPlan_lookup_type_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.lookup_type_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function getName($id, $tableName, $lan) {\n //pr($lan);\n $nameData='';\n $tableEntity = TableRegistry::get($tableName);\n $data = $tableEntity->find()\n ->select(['id', 'name'])\n ->where(['id' => $id])\n ->first();\n if(!empty($data->name)){\n $dataNm = json_decode($data->name,TRUE);\n }\n if(!empty($dataNm[$lan])){\n \n \n //pr($dataNm);\n $nameData = $dataNm[$lan];\n // pr($nameData);\n }elseif(!empty($dataNm['en_US'])){\n $nameData = $dataNm['en_US'];\n } \n return $nameData;\n }",
"function TestCase_lookup_category_name_by_id($category_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.lookup_category_name_by_id', array(new xmlrpcval($category_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function ibase_name_result($result, $name)\n{\n}",
"function getById($id, Suggestor $suggestor, DataHolder $dataHolder = NULL);",
"function TestCase_lookup_category_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.lookup_category_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function TestRun_lookup_environment_name_by_id($environment_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.lookup_environment_name_by_id', array(new xmlrpcval($environment_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"function getNameById($id, $includeBlocked = FALSE) {\n $result = array();\n if (is_array($id)) {\n $isMultiples = TRUE;\n } else {\n $isMultiples = FALSE;\n $id = array($id);\n }\n $loadIds = array();\n foreach ($id as $value) {\n if (checkit::isGUID($value, TRUE)) {\n if (isset($this->nameByIdCache[$value]) &&\n $this->nameByIdCache[$value] != '') {\n $result[$value] = $this->nameByIdCache[$value];\n } else {\n $loadIds[] = $value;\n }\n }\n }\n if (count($loadIds) > 0) {\n // Otherwise, look up these names in database\n $filter = str_replace(\n '%',\n '%%',\n $this->databaseGetSQLCondition('surfer_id', $loadIds)\n );\n $blockedClause = ($includeBlocked === FALSE) ? ' AND surfer_valid != 4' : '';\n $sql = \"SELECT surfer_id,\n surfer_handle,\n surfer_surname,\n surfer_givenname\n FROM %s\n WHERE $filter $blockedClause\";\n $params = array($this->tableSurfer);\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n // Store handle in cache for future use and return it\n $this->nameByIdCache[$row['surfer_id']] = array(\n 'surfer_handle' => $row['surfer_handle'],\n 'surfer_surname' => $row['surfer_surname'],\n 'surfer_givenname' => $row['surfer_givenname']\n );\n $this->handleByIdCache[$row['surfer_id']] = $row['surfer_handle'];\n $this->idByHandleCache[$row['surfer_handle']] = $row['surfer_id'];\n $result[$row['surfer_id']] = array(\n 'surfer_handle' => $row['surfer_handle'],\n 'surfer_surname' => $row['surfer_surname'],\n 'surfer_givenname' => $row['surfer_givenname']\n );\n }\n }\n }\n if ($isMultiples) {\n // case 1: multiples ids\n return $result;\n } elseif (count($result) > 0) {\n // case 2: one id lookup\n return reset($result);\n } else {\n return '';\n }\n }",
"function nameFromIduri( $iduri )\n{\n\treturn $iduri;\n}",
"function test_getNameById() {\r\n\t\t$myName = MemberClassesDB::getNameById(1);\r\n\t\t$this->assertEqual($myName, \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myName);\r\n\t}",
"static function getNameOf ($id)\n {\n return get (self::$NAMES, $id, false);\n }",
"function getUnameFromId( $userid = 0, $usereal = 0, $is_linked = 1 )\n {\t\t\n\t\tif (isset($this)) {\n\t\t\t$zariliaUser = &$this;\n\t\t} else {\n\t\t\tglobal $zariliaUser;\n\t\t}\t\t\n $name = '';\n $userid = intval( $userid ) > 0 ? intval( $userid ) : $zariliaUser->getVar( 'uid' );\n $usereal = intval( $usereal );\n if ( $userid > 0 ) {\n $member_handler = &zarilia_gethandler( 'member' );\n $user = &$member_handler->getUser( $userid );\n if ( is_object( $user ) ) {\n if ( $usereal ) {\n $name = htmlSpecialChars( $user->getVar( 'name' ), ENT_QUOTES );\n } else {\n $name = htmlSpecialChars( $user->getVar( 'uname' ), ENT_QUOTES );\n }\n }\n if ( $is_linked ) {\n $name = '<a href=\"' . ZAR_URL . '/index.php?page_type=userinfo&uid=' . $userid . '\">' . $name . '</a>';\n }\n } else {\n $name = $GLOBALS['zariliaConfig']['anonymous'];\n }\n return $name;\n }",
"function getIdentifier();",
"function getIdentifier();",
"public function getName($id)\n\t{\n\t\t// iterate over the data until we find the one we want\n\t\tforeach ($this->data as $record)\n\t\t\tif ($record['code'] == $id)\n\t\t\t\treturn $record['name'];\n\t\treturn null;\n\t}",
"function getIdentifier() ;",
"function getIdentifier() ;",
"function getIdentifier() ;",
"public function findByName($id){\n\n }"
] |
[
"0.6570218",
"0.6013454",
"0.58451205",
"0.5835939",
"0.5826812",
"0.577003",
"0.569457",
"0.5624269",
"0.5624243",
"0.56236476",
"0.55528325",
"0.55466545",
"0.5517871",
"0.5493331",
"0.5479874",
"0.54780394",
"0.54683137",
"0.5437649",
"0.54331523",
"0.542498",
"0.5398693",
"0.53934145",
"0.53619576",
"0.53531307",
"0.53531307",
"0.53429526",
"0.53360003",
"0.53353786",
"0.53353786",
"0.5329524"
] |
0.66911846
|
0
|
/ Component Attributes AttributeData Type descriptionstring component_idinteger initialownerinteger initialqacontactinteger nameString product_idinteger product_namestring / get Get A Component by ID Usage Component.get Parameters ParameterData TypeComments component_idintegerMust be greater than 0. Return Array: [initialowner] [disallownew] [product_id] [name] [id] [description] [initialqacontact]
|
function Component_get($component_id) {
// Create call
$call = new xmlrpcmsg('Component.get', array(new xmlrpcval($component_id, "int")));
// Do call and return value
return do_call($call);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getComponent($compID){\r\n mysql_connect(mysql_server, mysql_username, mysql_password) or die(mysql_error()); \r\n mysql_select_db(mysql_database) or die(mysql_error()); \r\n $data = mysql_query(\"SELECT * FROM components WHERE id = $compID\") \r\n or die(mysql_error());\r\n //grab those vars\r\n $info = mysql_fetch_array($data);\r\n\r\n $comp_args['id'] = $info['id'];\r\n $comp_args['slug'] = $info['slug'];\r\n $comp_args['component_type'] = $info['component_type'];\r\n $comp_args['position'] = $info['position'];\r\n $comp_args['rotation'] = $info['rotation'];\r\n $comp_args['scale'] = $info['scale'];\r\n $comp_args['mesh'] = $info['mesh'];\r\n $comp_args['material'] = $info['material'];\r\n $comp_args['functions'] = $info['functions'];\r\n $comp_args['init_script'] = $info['init_script'];\r\n $comp_args['main_script'] = $info['main_script'];\r\n $comp_args['render_script'] = $info['render_script'];\r\n $comp_args['animation_script'] = $info['animation_script'];\r\n\r\n return $comp_args;\r\n}",
"public function get($component, $arguments=array()) {\r\n\t\tif ($this->factory->has($component)) {\r\n\t\t\treturn $this->factory->get($component, $arguments);\r\n\t\t}\r\n\t\t$resource = $this->resourceResolver->resolve($component);\r\n\t\treturn $this->factory->get($resource, $arguments);\r\n\t}",
"function getProduct($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/id/'.(int)$params['id'].'.json'),true);\n\t}",
"public function component_info() {\n return array(\n 'name' => 'Accessibility Content Utility',\n 'description' => 'Add utility functions to Content for Accessibility',\n 'category' => 'accessibility',\n );\n }",
"function getComponents(){\r\n mysql_connect(mysql_server, mysql_username, mysql_password) or die(mysql_error()); \r\n mysql_select_db(mysql_database) or die(mysql_error()); \r\n $data = mysql_query(\"SELECT id, slug, component_type FROM components ORDER BY slug DESC LIMIT 20\") \r\n or die(mysql_error());\r\n //grab those vars\r\n global $comp_args;\r\n while($info = mysql_fetch_assoc($data)){\r\n $comp_args[] = $info;\r\n }\r\n \r\n return;\r\n}",
"public function component_info() {\n \n // Load the component's language files\n $this->CI->lang->load( 'frontend', $this->CI->config->item('language'), FALSE, TRUE, MIDRUB_BASE_ADMIN_FRONTEND );\n \n // Return component information\n return array(\n 'app_name' => $this->CI->lang->line('frontend'),\n 'display_app_name' => $this->CI->lang->line('frontend'),\n 'component_slug' => 'frontend',\n 'component_icon' => '<i class=\"far fa-edit\"></i>',\n 'version' => '0.0.1',\n 'required_version' => '0.0.7.8'\n );\n \n }",
"function modComponent($id, $data);",
"function _getXMLComponents(& $iCal, & $component) {\n\t$compName = $component->getName();\n\t$comp = & $iCal->newComponent($compName);\n\t$subComponents = array('valarm', 'standard', 'daylight');\n\tforeach ($component->children() as $compPart) { // properties and (opt) subComponents\n\t\tif (1 > $compPart->count())\n\t\t\tcontinue;\n\t\tif (in_array($compPart->getName(), $subComponents))\n\t\t\t_getXMLComponents($comp, $compPart);\n\t\telseif ('properties' == $compPart->getName()) {\n\t\t\tforeach ($compPart->children() as $property) // properties as single property\n\t\t\t\t_getXMLProperties($comp, $property);\n\t\t}\n\t} // end foreach( $component->children() as $compPart )\n}",
"public function getProductData()\n {\n // use\n //$this->request->getParams(); // all params\n $id= $this->request->getParam('param');\n $product = $this->_product->create()->load($id);\n return $product;\n\n }",
"function CUX9002($component) {\n if ($component['parent_device_interface'] == 'CUxD' && $component['visible'] == 'true' && isset($component['TEMPERATURE'])) {\n $datapoints = array();\n \n if(isset($component['TEMPERATURE'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['TEMPERATURE'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"TEMPERATURE\"></span>';\n }\n if(isset($component['HUMIDITY'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['HUMIDITY'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"HUMIDITY\"></span>';\n }\n if(isset($component['DEW_POINT'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['DEW_POINT'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"DEW_POINT\"></span>';\n }\n if(isset($component['ABS_HUMIDITY'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['ABS_HUMIDITY'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"ABS_HUMIDITY\"></span>';\n }\n if(isset($component['TEMP_MIN_24H'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['TEMP_MIN_24H'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"TEMP_MIN_24H\"></span>';\n }\n if(isset($component['TEMP_MAX_24H'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['TEMP_MAX_24H'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"TEMP_MAX_24H\"></span>';\n }\n if(isset($component['HUM_MIN_24H'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['HUM_MIN_24H'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"HUM_MIN_24H\"></span>';\n }\n if(isset($component['HUM_MAX_24H'])) {\n $datapoints[] = '<span class=\"info\" data-id=\"' . $component['HUM_MAX_24H'] . '\" data-component=\"' . $component['component'] . '\" data-datapoint=\"HUM_MAX_24H\"></span>';\n }\n \n return '<div class=\"hh\">'\n . '<div class=\"pull-left\"><img src=\"../assets/icons/' . $component[\"icon\"] . '\" class=\"icon\">' . $component['name'] . '</div>'\n . '<div class=\"pull-right\">'\n . implode('', $datapoints)\n . '</div>'\n . '<div class=\"clearfix\"></div>'\n . '</div>';\n }\n}",
"public function componentDetails()\n {\n return [\n 'name' => 'List Component',\n 'description' => 'No description provided yet...'\n ];\n }",
"function _civicrm_api3_custom_value_get_spec(&$params) {\n $params['entity_id']['api.required'] = 1;\n}",
"protected function getComponentData($component, $rank = 1)\n {\n // Assemble base WHERE clause\n $whereClause = 'component = ' . $this->getDatabaseConnection()->fullQuoteStr($component,\n 'tx_displaycontroller_components_mm') . ' AND rank = ' . (int)$rank;\n // Select the right uid for building the relation\n // If a _ORIG_uid is defined (i.e. we're in a workspace), use it preferentially\n // Otherwise, take the localized uid (i.e. we're using a translation), if it exists\n $referenceUid = $this->cObj->data['uid'];\n if (!empty($this->cObj->data['_ORIG_uid'])) {\n $referenceUid = $this->cObj->data['_ORIG_uid'];\n } elseif (!empty($this->cObj->data['_LOCALIZED_UID'])) {\n $referenceUid = $this->cObj->data['_LOCALIZED_UID'];\n }\n $where = $whereClause . ' AND uid_local = ' . (int)$referenceUid;\n // Query the database and return the fetched data\n // If the query fails or turns up no results, throw an exception\n $row = $this->getDatabaseConnection()->exec_SELECTgetSingleRow(\n '*',\n 'tx_displaycontroller_components_mm',\n $where\n );\n if (empty($row)) {\n $message = sprintf(\n $this->pi_getLL('exception.no_component'),\n $component,\n $rank\n );\n throw new MissingComponentException(\n $message,\n 1265577739\n );\n } else {\n $componentData = $row;\n }\n return $componentData;\n }",
"abstract public function attr(string $component_name, string $attr_data = null);",
"function getProductInfos($oid){\n if (!isset($this->products[$oid])){\n $r = array('pool'=>NULL, 'ticket'=>NULL, 'person'=>NULL, 'taarticleno'=>NULL);\n $selectedfields = array('tapool', 'taperson', 'taticket', 'prdconf');\n if ($this->xwtscatalog->fieldExists('taarticleno')){\n $selectedfields[] = 'taarticleno';\n }\n $dp = $this->xwtscatalog->display(array('oid'=>$oid,\n 'selectedfields'=>$selectedfields,\n 'options'=>array('tapool'=>array('target_fields'=>array('prjno', 'poolno')),\n 'taperson'=>array('target_fields'=>array('ptno')),\n 'prdconf'=>array('target_fields'=>array('calendar')),\n 'taticket'=>array('target_fields'=>array('tapool', 'ttno'))\n )\n )\n );\n $r['project'] = $dp['otapool']->link['oprjno']->raw;\n $r['pool'] = $dp['otapool']->link['opoolno']->raw;\n $r['ticket'] = $dp['otaticket']->link['ottno']->raw;\n $r['person'] = $dp['otaperson']->link['optno']->raw;\n $r['calendartype'] = $dp['oprdconf']->link['ocalendar']->link['otype']->raw;\n if (isset($dp['otaarticleno']))\n $r['taarticleno'] = $dp['otaarticleno']->raw;\n $this->products[$oid] = $r;\n }\n return $this->products[$oid];\n }",
"protected function setStationDataParams($component){\n\t\t$unit=\"\";\n\t\t$query = \"\";\n\t\t$errorbar = false;\n\t\t$style = \"bar\";\n\t\tif($component == 'SSAM Low Frequency Limit'){\n\t\t\t$unit = \"Hz\";\n\t\t\t$attribute = \"sd_ssm_lowf\";\n\t\t\t$query = \"select a.sd_ssm_stime as stime, a.$attribute as value from sd_ssm as a, sd_sam as b where a.sd_sam_id=b.sd_sam_id and b.ss_id=%s and a.$attribute IS NOT NULL and b.sd_sam_pubdate <= now()\";\n\t\t}else if($component == 'SSAM High Frequency Limit'){\n\t\t\t$unit = \"Hz\";\n\t\t\t$attribute = \"sd_ssm_highf\";\n\t\t\t$query = \"select a.sd_ssm_stime as stime, a.$attribute as value from sd_ssm as a, sd_sam as b where a.sd_sam_id=b.sd_sam_id and b.ss_id=%s and a.$attribute IS NOT NULL and b.sd_sam_pubdate <= now()\";\n\t\t}else if($component == 'SSAM Counts'){\n\t\t\t$unit = \"counts\";\n\t\t\t$attribute = \"sd_ssm_count\";\n\t\t\t$query = \"select a.sd_ssm_stime as stime, a.$attribute as value from sd_ssm as a, sd_sam as b where a.sd_sam_id=b.sd_sam_id and b.ss_id=%s and a.$attribute IS NOT NULL and b.sd_sam_pubdate <= now()\";\n\t\t}\t\n\t\t$result = array(\"unit\" => $unit,\n\t\t\t\t\t\t\"style\" => $style,\n\t\t\t\t\t\t\"errorbar\" => $errorbar,\n\t\t\t\t\t\t\"query\" =>$query\n\t\t\t\t\t\t);\n\t\treturn $result;\n\t}",
"private static function newComponent($component){\r\n\t\t\r\n\t $return = new script_component(self::$xml_file);\r\n $return->setFilename($component->jsfile);\r\n $return->setTitle($component->title);\r\n\t\t\t\t$return->setIntjs($component->intjs);\r\n $return->setDashboard($component['dashboard']);\r\n $return->setId($component['id']);\r\n $return->setIntmarkup($component->intmarkup);\r\n $return->setName($component->name);\r\n \r\n $ary = array();\r\n \r\n if (count($return->dependenicies) > 0) {\r\n foreach ($return->dependenicies->dependent as $dependent) {\r\n array_push($ary, array('filename'=>$dependent->filename, 'name'=>$dependent->name));\r\n }\r\n $return->dependicies($ary);\r\n }\r\n\t\treturn $return;\r\n\t\t\r\n\t}",
"function getUsageInfo(){\r\n\t\t$usage_array = array ('name' => $this->getName(), \r\n\t\t\t\t\t\t\t 'last_click' => $this->getLastClick(), \r\n\t\t\t\t\t\t\t 'email' => $this->getEmail(), \r\n\t\t\t\t\t\t\t 'total_clicks' => $this->getTotalClicks(), \r\n\t\t\t\t\t\t\t 'last_month_clicks' => $this->getLastMonthClicks());\r\n\t\treturn $usage_array;\r\n\t}",
"function aiccItem($type='config',$params) {\r\n \tif(isset($params))\r\n \t{\r\n \t\tswitch($type){\r\n \t\t\tcase 'db':\r\n \t\t\t\tparent::learnpathItem($params,api_get_user_id());\r\n \t\t\t\t$this->aicc_contact = false;\r\n \t\t\t\t//TODO implement this way of metadata object creation\r\n \t\t\t\treturn false;\r\n \t\t\tcase 'config': //do the same as the default\r\n \t\t\tdefault:\r\n\t\t\t \t//if($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function\r\n\t\t\t \tforeach($params as $a => $value)\r\n\t\t\t \t{\r\n\t\t\t \t\tswitch($a)\r\n\t\t\t \t\t{\r\n \t\t\t\tcase 'system_id':\r\n \t\t\t\t\t$this->identifier = mysql_real_escape_string(strtolower($value));\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'type':\r\n \t\t\t\t\t$this->au_type = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'command_line':\r\n \t\t\t\t\t$this->command_line = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'max_time_allowed':\r\n \t\t\t\t\t$this->maxtimeallowed = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'time_limit_action':\r\n \t\t\t\t\t$this->timelimitaction = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'max_score':\r\n \t\t\t\t\t$this->max_score = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'core_vendor':\r\n \t\t\t\t\t$this->core_vendor = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'system_vendor':\r\n \t\t\t\t\t$this->system_vendor = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'file_name':\r\n \t\t\t\t\t$this->path = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'mastery_score':\r\n \t\t\t\t\t$this->masteryscore = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase 'web_launch':\r\n \t\t\t\t\t$this->parameters = mysql_real_escape_string($value);\r\n \t\t\t\t\tbreak;\r\n\t\t\t \t\t}\r\n\t\t\t \t}\r\n\t\t\t\t\treturn true;\r\n \t\t}\r\n \t}\r\n \treturn false;\r\n }",
"public function getProductAttributesDetails($params){\n\t\ttry {\t\n\t\t\t\n\t\t\t//$query = \"select * from store_products where product_id=\".$params['id'];\n\t\t\t\n\t\t\t$query = \"SELECT\n\t\t\t\t\t\tspav.product_id, spast.attributes_group_id, spast.attributes_set_id, spast.attributes_set_title,\n\t\t\t\t\t\tspa.attribute_id, spa.attribute_title, spav.attribute_value\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\tstore_products_attributes spa,\n\t\t\t\t\t\tstore_products_attributes_values spav,\n\t\t\t\t\t\tstore_products_attributes_sets spast,\n\t\t\t\t\t\tstore_products_attributes_sets_mapping spasm\n\t\t\t\t\t\twhere\n\t\t\t\t\t\tspa.attribute_id = spav.attribute_id\n\t\t\t\t\t\tAND spast.attributes_set_id = spasm.attributes_set_id\n\t\t\t\t\t\tAND spa.attribute_id = spasm.attribute_id\n\t\t\t\t\t\tAND spa.statusid=1\n\t\t\t\t\t\tAND spav.statusid=1\n\t\t\t\t\t\tAND spast.statusid=1\n\t\t\t\t\t\tAND spasm.statusid=1\n\t\t\t\t\t\tAND spav.product_id = \".$params['id'];\n\t\t\t\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}",
"static public function componente($componente, $clase = null, $datos = null) {\n Seguridad_DeshabilitarSesion::deshabilitar();\n\n if ($clase == null) {\n $clase = $_GET['accion'];\n }\n include_once(dirname(__FILE__) . '/' . $componente . '/' . $clase . '.php');\n\n $clase = 'Componentes_' . $componente . '_' . $clase;\n\n $componente = new $clase();\n $componente->set($datos);\n return $componente->get();\n }",
"function getComponent()\n {\n }",
"public static function listComponent($getDefaultComponent,$type=null){\n if($getDefaultComponent) $list=PayrollComponent::where('component_type',$type)->get();\n else $list=PayrollComponent::where('default_flag',0)->get();\n $result='';\n foreach($list as $row){\n\n $result.='<option value=\"'.$row->id.'\" data-amount=\"'.$row->component_amount.'\" data-type=\"'.$row->component_type.'\">'.$row->component_name.'</option>';\n }\n return $result;\n }",
"public function getRandomComponent() {\n $component = Component::getRandomComponent();\n return \\Response::json($component);\n }",
"function loadComponents($ar=NULL){\n $p = new XParam($ar, array());\n\n $what = $p->get('what');\n\n $clearbefore = $p->get('clearbefore');\n\n if ($what == 'all' or $what == $this->tapool)\n $this->loadPools($clearbefore);\n\n elseif ($what == 'all' or $what == $this->tapersontype)\n $this->loadPersonTypes($clearbefore);\n\n elseif ($what == 'all' or $what == $this->tatickettype)\n $this->loadTicketTypes($clearbefore);\n \n else\n XShell::setNextData('message', 'unknown component '.$what);\n\n }",
"abstract public function getDataDesc();",
"public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }",
"public function getProductDetails($params){\n\t\ttry {\t\n\t\t\t\n\t\t\t//$query = \"select * from store_products where product_id=\".$params['id'];\n\t\t\t\n\t\t\t$query = \"SELECT\n\t\t\tsp.product_id, sp.attributes_group_id, sp.merchant_id, sp.brand_id, sp.product_sku, sp.product_title,\n\t\t\tsp.product_small_description, sp.product_meta_title, sp.product_meta_description,\n\t\t\tspd.description_id, spd.product_description\n\t\t\tFROM store_products sp\n\t\t\tLEFT JOIN store_products_description spd ON (sp.product_id=spd.product_id) where sp.product_id=\".$params['id'];\n\t\t\t\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetch();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}",
"public function componentDetails()\n {\n return[\n 'name' => 'Logo',\n 'description' => ' Logo'\n ];\n }",
"public function getComponent($componentId, $listFormat = 1, $depth = 1) {\n $component = Component::getComponent($componentId, $listFormat, $depth);\n return \\Response::json($component);\n }"
] |
[
"0.5896892",
"0.54642665",
"0.5178167",
"0.51744956",
"0.51682097",
"0.51662153",
"0.515686",
"0.5139863",
"0.5113495",
"0.5109644",
"0.51015234",
"0.50918186",
"0.50510085",
"0.50460607",
"0.50253457",
"0.49855402",
"0.49472293",
"0.4942802",
"0.49307948",
"0.4917252",
"0.4904521",
"0.49003363",
"0.4897439",
"0.4877491",
"0.4871868",
"0.48531276",
"0.48400715",
"0.48285204",
"0.48122254",
"0.480702"
] |
0.58055896
|
1
|
/ list Get A List of Environments Based on A Query Usage Environment.list Parameters ParameterData TypeComments queryhashmapCan not be null. Result Array [0] Array [environment_id] [product_id] [name] [isactive] [1] Array ...
|
function Environment_list($query) {
// Create array
foreach($query as $key => $val) {
switch($key) {
case "environment_id":
case "isactive":
case "product_id":
$type = "int";
break;
case "name":
default:
$type = "string";
}
$qarray[$key] = new xmlrpcval($val, $type);
}
// Create call
$call = new xmlrpcmsg('Environment.list', array(new xmlrpcval($qarray, "struct")));
// Do call and return value
return do_call($call);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function listEnvironments()\n {\n\t\t$data = $this->call(array(), \"GET\", \"environments.json\");\n\t\treturn $data;\n\t\t\n\t\t$data = $this->call(array(), \"GET\", \"environments.json\");\n\t\t$data = $data->{'environments'};\n\t\t$environmentArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$environmentArray->append(new Environment($data[$i], $this));\n\t\t}\n\t\treturn $environmentArray;\n }",
"public function getEnvironments();",
"function get_environment_details() : array {\n\t$id = Altis\\get_environment_name();\n\t$type = Altis\\get_environment_type();\n\tif ( $type === 'local' ) {\n\t\t// Create distinct_id (important for Mixpanel).\n\t\t$id = get_local_install_id();\n\t}\n\n\t$traits = [\n\t\t'site_name' => get_site_option( 'site_name', get_option( 'blogname', '' ) ),\n\t\t'environment' => $type,\n\t\t'domain' => get_site_url(),\n\t\t'multisite' => is_multisite(),\n\t\t'feature_tier' => Altis\\get_feature_tier(),\n\t\t'environment_tier' => Altis\\get_environment_tier(),\n\t\t'support_tier' => Altis\\get_support_tier(),\n\t\t'version' => Altis\\get_version(),\n\t];\n\n\t/**\n\t * Filter environment traits delivered to segment.io.\n\t *\n\t * @param array $traits Environment traits to send to Segment.io.\n\t */\n\t$traits = (array) apply_filters( 'altis.telemetry.env_traits', $traits );\n\n\treturn [\n\t\t'id' => $id,\n\t\t'traits' => $traits,\n\t];\n}",
"public function siteEnvLookupParameters()\n {\n return [\n\n // Site not specified on commandline\n // Command takes site_env and variable arguments\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'list: [a, b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'list: [a, b]'],\n ['program', 'example:op', 'othersite.test', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'list: [b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site_env and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'item: a'],\n ['program', 'example:op', 'othersite.test', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'item: EMPTY'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site: site-from-config', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site: othersite', 'item: a'],\n ['program', 'example:op', 'othersite', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site: EMPTY', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n [],\n ],\n\n ];\n }",
"public function getEnvs();",
"function listEnvironments($con, $def_envID)\n\t{\n\t\t# Default value for the environment dropdown\n\t\t$sql_env = \"SELECT envID, envName FROM environments\";\n\t\t$result_env = $con->query($sql_env) or die(mysqli_error($con));\n\t\n\t\t$list_env = \"\";\n\t\twhile($rowv = mysqli_fetch_array($result_env))\n\t\t{\n\t\t\t$envID = htmlspecialchars($rowv['envID']);\n\t\t\t$envName = htmlspecialchars($rowv['envName']);\n\t\n\t\t\tif($envID == $def_envID) { $selected = \"selected='true'\"; } else { $selected = \"\"; }\n\t\n\t\t\t$list_env .= \"<option value='$envID' $selected>$envName</option>\";\n\t\t}\n\n\t\treturn $list_env;\n\t}",
"public function getData($environment)\n {\n $this->init();\n\n $data = @file_get_contents($this->tempDB);\n if($data === FALSE)\n {\n echo '[]';\n return;\n }\n\n $list = json_decode($data, true);\n\n $output = [];\n\n if(array_key_exists('p', $environment))\n {\n if($list !== NULL)\n {\n foreach ($list as $li)\n {\n if(strpos($li, $environment['p']) !== false)\n {\n array_push($output, $li);\n }\n }\n }\n }\n else\n {\n $output = ($list === NULL) ? [] : $list;\n }\n\n echo json_encode($output);\n }",
"public function getAllNames()\r\n {\r\n $query = \"EXEC [dbo].[srv_GetAllEnvironmentName]\";\r\n $stmt = $this->db->getParams($query);\r\n if (!empty($stmt)) {\r\n return $stmt;\r\n }\r\n return;\r\n }",
"public function getAll()\r\n {\r\n $query = \"EXEC\t [dbo].[srv_GetAllEnvironments_returnhtml]\";\r\n $table = $this->db->getParams($query);\r\n if (!empty($table)) {\r\n return $table;\r\n }\r\n return;\r\n }",
"private function getEnvironmentInfos()\n\t{\n\t\t// Get a instance of Joomla\\CMS\\Environment\\Browser\n\t\t$browser = JBrowser::getInstance();\n\n\t\t// Get the values form the useragent string\n\t\t$detectedPlatform = $browser->getPlatform();\n\t\t$detectedBrowser = $browser->getBrowser();\n\n\t\t// Prepare the return values\n\t\t$environmentInfos = array(\n\t\t\t'platform' => 'unknown',\n\t\t\t'browser' => 'unknown',\n\t\t);\n\n\t\t// Set the platform value when we support it.\n\t\tif (array_key_exists($detectedPlatform, $this->supportedPlatforms))\n\t\t{\n\t\t\t$environmentInfos['platform'] = $detectedPlatform;\n\t\t}\n\n\t\t// Set the browser value when we support it.\n\t\tif (array_key_exists($detectedBrowser, $this->supportedBrowsers))\n\t\t{\n\t\t\t$environmentInfos['browser'] = $detectedBrowser;\n\t\t}\n\n\t\t// Return the results\n\t\treturn $environmentInfos;\n\t}",
"protected function getEnvParameters()\n {\n $parameters = array();\n\n foreach ($_SERVER as $key => $value) {\n if (0 === strpos($key, 'SYMFONY__')) {\n $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value === '~'?null:$value;\n }\n }\n\n return $parameters;\n }",
"public function organizationList(){\n if($this->request->all()){\n $regionIds = array_flatten($this->request->all());\n $sorted = $this->organization->select('id','name')->whereIn('region_id',$regionIds)->get()->sortBy('name');\n return $sorted->values()->all();\n }else{\n $sorted = $this->organization->select('id','name')->get()->sortBy('name');\n return $sorted->values()->all();\n }\n }",
"public function getParametersList(){\n return $this->_get(2);\n }",
"public function environments($projectId)\n {\n return $this->request('get', '/api/projects/'.$projectId.'/environments');\n }",
"public function acl_custom_get_allowed_environments_list($group, $return_assoc_array = false) {\n\t\tdie('NOW DEPRECATED. Use Configure::read(\\'deployable_envs\\')');\n\t\t//\n\t\t//\n\t\t//$std_available_environments = array(\n\t\t//\t'' => 'Select Environment' ,\n\t\t//\t'development1' => 'Development 1',\n\t\t//\t'development2' => 'Development 2',\n\t\t//\t'qa1_eu' => 'QA 1 - EU',\n\t\t//\t'qa1_na' => 'QA 1 - NA',\n\t\t//\t'qa2_eu' => 'QA 2 / Security - EU',\n\t\t//\t'qa2_na' => 'QA 2 / Security - NA',\n\t\t//\t'qa3_eu' => 'QA 3 - EU',\n\t\t//\t'qa3_na' => 'QA 3 - NA',\n\t\t//);\n\t\t//\n\t\t//$production_environments = array(\n\t\t//\t'production_eu' => 'EU Production',\n\t\t//\t'production_na' => 'NA Production',\n\t\t//);\n\t\t//\n\t\t//$development_environments = array(\n\t\t//\t'development1' => 'Development 1',\n\t\t//\t'development2' => 'Development 2'\n\t\t//);\n\t\t//\t\n\t\t//$oregontrail_environments = array(\n\t\t//\t'capistrano' => 'RTW Oregon Trail Master',\n\t\t//\t'production_eu_linux_mgr' => 'Prod EU Linux Manager',\n\t\t//\t'production_na_linux_mgr' => 'Prod NA Linux Manager',\n\t\t//);\n\t\t//\n\t\t//\n\t\t//// Available Sites and Environments, determined by ACL\n\t\t//switch ($group) {\n\t\t//\tcase 'operations':\n\t\t//\tcase 'producers':\n\t\t//\t\t$available_environments = $std_available_environments;\n\t\t//\t\t$available_environments = array_merge($available_environments, $production_environments); // Add production to list\n\t\t//\t\tbreak;\n\t\t//\tcase 'developers': // Only Dev Environments\n\t\t//\t\t$available_environments = $development_environments;\n\t\t//\t\tbreak;\n\t\t//\tcase 'administrators':\n\t\t//\t\t$available_environments = $std_available_environments;\n\t\t//\t\t$available_environments = array_merge($available_environments, $production_environments); // Add production to list\n\t\t//\t\t$available_environments = array_merge($available_environments, $oregontrail_environments); // Add oregon trail to list\n\t\t//\t\tbreak;\n\t\t//\tdefault: // They should have been redirected out of here, so this should not happen\n\t\t//\t\treturn false;\n\t\t//\t\tbreak;\n\t\t//}\n\t\t//\n\t\t//if ($return_assoc_array) {\n\t\t//\treturn $available_environments;\n\t\t//} else {\n\t\t//\treturn array_keys($available_environments);\t// Discard the Human Readable \"descriptions\"\n\t\t//}\n\t}",
"public static function getEnvironments()\n {\n $instanceSpecificKeys = [\n 'app_frontend_url',\n 'app_backend_url'\n ];\n\n $globalKeys = [\n 'app_config_path',\n 'server_config_path',\n 'isolation_config_path',\n 'handlers_config_path',\n 'configuration:Magento/Mtf/TestSuite/MtfTests',\n 'app_instances',\n 'events_preset',\n 'log_directory'\n ];\n\n $globalEnvironmentVariables = [];\n foreach ($globalKeys as $key) {\n if (isset($_ENV[$key])) {\n $globalEnvironmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $environments = [];\n if (isset($_ENV['app_instances'])) {\n $instancesCount = $_ENV['app_instances'];\n\n for ($x = 0; $x < $instancesCount; $x++) {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n $instanceKey = $key . \"_\" . $x;\n if (isset($_ENV[$instanceKey])) {\n $environmentVariables[$key] = $_ENV[$instanceKey];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n } else {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n if (isset($_ENV[$key])) {\n $environmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n\n return $environments;\n }",
"public function lists(){\r\n\r\n\r\n \t//$this->level2 = '环境配置';\r\n\r\n\r\n \t\r\n\r\n \t//$this->assign('active',$this->active);\r\n\r\n \t$log = D('OperLogView');\r\n $user = D('UserRelation');\r\n $keyword = '';\r\n $condition = '';\r\n \tif(I('keyword') != '') {\r\n $condition['name']=array('like',I('keyword') . '%');\r\n $condition['source_ip']=array('like',I('keyword') . '%');\r\n $condition['_logic']='OR';\r\n \t\t$keyword = I('keyword');\r\n $count = $log->where($condition)->count();\r\n\r\n \t\t//$count = $env->where('env.env_name like \"' . $keyword . '%\" or env.envname like \"' . $keyword . '%\"')->count();\r\n \t} else {\r\n \t\t//$count = $env->where(array('env_name' => array('like',$keyword .'%' )) or array('name' => array('like',$keyword .'%' )))->group('env_id')->count();\r\n $count = $log->count();\r\n \t}\r\n \r\n \t$user_data['user_id'] = session(C('USER_AUTH_KEY'));\r\n \r\n $user_data['page'] = $_POST['page'] != '' ? $_POST['page'] : session('page');\r\n if($user->save($user_data) !== false) {\r\n session('page',$user_data['page']);\r\n } \r\n $page = new \\Lib\\MyPage($count,session('page'));\r\n\r\n \t//$page->parameter=I('get.');\r\n \t//$page->setConfig('header','条数据');\r\n \t\r\n \t\t\r\n\r\n \t$show = $page->show();\r\n \t\r\n \tif($condition != '') {\r\n $list = $log->where($condition)->order('oper_time desc')->limit($page->firstRow . ',' . $page->listRows)->select();\r\n \r\n \r\n }else{\r\n $list = $log->order('oper_time desc')->limit($page->firstRow . ',' . $page->listRows)->select();\r\n \r\n \r\n }\r\n \r\n \r\n\r\n \t//$list = $env->where('env_name like \"' . $keyword . '%\" or envname like \"' . $keyword . '%\"')->order('env_id')->limit($page->firstRow . ',' . $page->listRows)->select();\r\n \t\r\n // dump($list);die;\r\n \t$this->assign('loglist',$list);\r\n \t$this->assign('page',$show);\r\n if($keyword != '') {\r\n $this->assign('keyword',$keyword);\r\n }\r\n $this->assign('count',$count);\r\n $this->assign('userPage',session('page')); \t\r\n \r\n //print_r($list);die;\r\n \t$this->assign('level1',$this->level1);\r\n \t$this->assign('level2',$this->level2);\r\n \t$this->assign('level3',$this->level3);\r\n \t$this->display();\r\n }",
"public function getEnvironments(): array\n {\n return $this->environments;\n }",
"public function listAction()\n {\n $response = new Response();\n $auth = $this->session->get('auth');\n $data = $this->request->getPost();\n $pageSize = (isset($data['PageSize']) && is_numeric($data['PageSize']) && $data['PageSize'] > 0) ? $data['PageSize'] : 10;\n $page = (isset($data['Page']) && is_numeric($data['Page']) && $data['Page'] > 0) ? $data['Page'] : 1;\n\n $query = $this->modelsManager->createBuilder()\n ->columns('OE . OrganizationId,OE . EquipmentId,OE . Number,OE . Amount,OE . Intro,OE . UpdateTime,OE . Display,OE . Image,E . Name as EquipmentName')\n ->addFrom(OrganizationAndEquipment::class, 'OE')\n ->join(Equipment::class, 'E . Id = OE . EquipmentId', 'E', 'left')\n ->where(\"OE.OrganizationId=:OrganizationId:\", ['OrganizationId' => $auth['HospitalId']]);\n //显示状态\n if (!empty($data['Display']) && isset($data['Display'])) {\n $query->andWhere('OE . Display =:Display:', ['Display' => $data['Display']]);\n }\n //搜索设备名字\n if (!empty($data['Name']) && isset($data['Name'])) {\n $sphinx = new Sphinx($this->sphinx, 'equipment');\n $name = $sphinx->match($data['Name'], 'name')->fetchAll();\n $ids = array_column($name ? $name : [], 'id');\n if (count($ids)) {\n $query->andWhere('E . Id in ' . sprintf('(%s)', implode(',', $ids)));\n } else {\n $query->andWhere('E . Id = -1');\n }\n }\n $paginator = new QueryBuilder(\n [\n \"builder\" => $query,\n \"limit\" => $pageSize,\n \"page\" => $page,\n ]\n );\n $pages = $paginator->getPaginate();\n $totalPage = $pages->total_pages;\n $count = $pages->total_items;\n $datas = $pages->items->toArray();\n $equipmentAndSections = EquipmentAndSection::query()->inWhere('EquipmentId', array_column($datas, 'EquipmentId'))->andWhere(sprintf('OrganizationId=%d', $auth['HospitalId']))->execute()->toArray();\n $equipmentAndSections_new = [];\n if (count($equipmentAndSections)) {\n foreach ($equipmentAndSections as $equipmentAndSection) {\n $equipmentAndSections_new[$equipmentAndSection['EquipmentId']][] = $equipmentAndSection['SectionId'];\n }\n }\n foreach ($datas as &$data) {\n $data['Image'] = $data['Image'] ?: Equipment::DEFAULT_IMAGE;\n $data['SectionIds'] = $equipmentAndSections_new[$data['EquipmentId']];\n }\n $result = [];\n $result['Data'] = $datas;\n $result['PageInfo'] = ['Count' => $count, 'PageSize' => $pageSize, 'TotalPage' => $totalPage, 'Page' => $page];\n $response->setJsonContent($result);\n return $response;\n }",
"public function getEnvironmentTags() {\n\t\treturn array_merge($this->environments[0]);\n\t}",
"public static function get_parameters() {\n return array(\n array(\n 'name' => 'termlist_id',\n 'caption' => 'Term List',\n 'description' => 'The term list being edited.',\n 'type' => 'select',\n 'table' => 'termlist',\n 'captionField' => 'title',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n ),\n array(\n 'name' => 'language_id',\n 'caption' => 'Language',\n 'description' => 'The language that terms are created in.',\n 'type' => 'select',\n 'table' => 'language',\n 'captionField' => 'language',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n )\n );\n }",
"public function getEmployeeList($postData){\n\t\t$this->db->select('EMP_ID, EMP_NAME');\n\t\t$this->db->from('ALL_EMP_MST A');\n\t\t$this->db->where(['A.EMP_DEP_ID'=>$postData]);\n\t\t$q = $this->db->get();\t\t\t\t\n \t$response = $q->result_array();\n \treturn $response;\n\t}",
"public function getQueryParameters(): array;",
"function toArray()\n {\n $ary = array('request' => $this->uri, 'type' => $this->_type);\n if ($this->_shortName) {\n $ary['shortname'] = $this->_shortName;\n }\n if ($this->_description) {\n $ary['description'] = $this->_description;\n }\n \n if (!isset($this->template)) {\n throw new RuntimeException('The search template has not been set!');\n }\n $ary['template'] = $this->template; \n if ($this->_developer) {\n $ary['developer'] = $this->_developer;\n }\n if ($this->contact) {\n $ary['contact'] = $this->contact;\n }\n \n if (count($this->tags) > 0) {\n $ary['tags'] = $this->tags;\n }\n if ($this->_longName) {\n $ary['longname'] = $this->_longName;\n }\n \n if (count($this->_image) > 0) {\n $ary['image'] = $this->_image;\n }\n \n if ($this->_attribution) {\n $ary['attribution'] = $this->_attribution;\n }\n \n if ($this->_syndicationRight) {\n $ary['syndicationright'] = $this->_syndicationRight;\n }\n if (isset($this->adultContent)) {\n $ary['adultcontent'] = $this->adultContent;\n }\n \n if (count($this->languages) > 0) {\n $ary['language'] = $this->languages;\n }\n if (count($this->inputEncodings) > 0) {\n $ary['inputencodings'] = $this->inputEncodings;\n }\n if (count($this->outputEncodings) > 0) {\n $ary['outputencodings'] = $this->outputEncodings;\n }\n \n if ($this->exampleQuery || count($this->_contextSets) > 0) {\n $ary['query'] = array();\n if ($this->exampleQuery) {\n $ary['query']['example'] = $this->exampleQuery;\n }\n foreach ($this->_contextSets as $c) {\n if (!$ary['query']['context-sets']) {\n $ary['query']['context-sets'] = array();\n }\n array_push($ary['query']['context-sets'], $c->toArray());\n }\n }\n return $ary;\n }",
"function loadAllEquipments($post,$deviceType,$appVersion,$OSVersion,$browserVersion)\n{\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\n\t session_start();\n $OrgID=$_SESSION['OrgID'];\n $result = mysql_query(\"SELECT * FROM SCP_Equipments WHERE OrgID='\".$OrgID.\"'\");\n //CHECK FOR ERROR\n if (!$result) die('Invalid query: ' . mysql_error());\n $rows = array();\n while($row = mysql_fetch_assoc($result)) {\n\t\t if($row['StatusID'] == 1) {\n\t\t\t\t$row['Status'] = 'Active';\n\t\t\t} else {\n\t\t\t\t$row['Status'] = 'Deactive';\n\t\t\t}\n\t\t\t$rows[] = $row;\n }\n if($rows) {\n $data['responseData'] = $rows;\n $data['message'] = \"All Equipments get successfully\";\n $data['responseCode'] = \"200\";\n $data['status'] = \"1\";\n } else {\n $data['responseData'] = '';\n $data['message'] = \"No Equipments Found\";\n $data['responseCode'] = \"201\";\n $data['status'] = \"0\";\n }\n print json_encode($data);\n mysql_close($con); //close the connection\n}",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM cst_tech_req';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public function list(string $scope): array;",
"function ael_request_2($filters_array) {\n $event_arr = [];\n $filter_str = '';\n\n foreach($filters_array as $param => $value)\n $filter_str .= \"{$param}='{$value}'&\";\n\n exec(\"curl -X GET --insecure --connect-timeout 10 --user root:passw0rd \\\"http://10.103.0.60:9595/objectserver/restapi/alerts/status?filter={$filter_str}collist=\".implode(',', $GLOBALS['AEL_col_list_arr']).\"\\\"\", $arr_data);\n $json_arr = json_decode(implode(' ', $arr_data), true);\n\n if ($json_arr['rowset']['affectedRows'] > 0)\n foreach ($json_arr['rowset']['rows'] as $event)\n $event_arr[$event['Serial']] = $event;\n\n return $event_arr;\n}",
"public function getConditionlistData($request)\n {\n $promoId = $request['promoId'];\n $wherQuery = '';\n if(!empty($promoId)){\n $wherQuery .= ' WHERE pl.promo_list_id = p.id and p.id = '.$promoId.' AND pl.language_code = \"'.$language.'\" ';\n }\n $dataArray = [];\n $query = 'SELECT ';\n $query .= ' pl.promo_list_id,\n pl.title,\n pl.description_app,\n p.promo_start_time,\n p.promo_end_time,\n p.promo_sub_type,\n p.promo_type,\n p.max_apply_count\n ';\n $query .= ' FROM promo_list as p,promo_list_display_language as pl '.$wherQuery.' ';\n $this->query($query);\n $dataList = $this->resultset();\n return $dataList;\n }",
"protected function getEnvironments()\n {\n return array('dev', 'test', 'preprod');\n }"
] |
[
"0.67900246",
"0.5865405",
"0.55461425",
"0.5476065",
"0.5473012",
"0.54705113",
"0.5460561",
"0.54512",
"0.5412727",
"0.5261058",
"0.5215349",
"0.5213895",
"0.5211306",
"0.5208484",
"0.51280516",
"0.5113795",
"0.50970286",
"0.5087016",
"0.5047194",
"0.50347304",
"0.50072527",
"0.49749938",
"0.4970634",
"0.49649805",
"0.49638158",
"0.49576116",
"0.49547416",
"0.49505293",
"0.49389046",
"0.4910573"
] |
0.75356394
|
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.