query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
/ Gets the 'lexik_form_filter.form_data_extractor' service. This service is shared. This method always returns the same instance of the service. | protected function getLexikFormFilter_FormDataExtractorService()
{
$this->services['lexik_form_filter.form_data_extractor'] = $instance = new \Lexik\Bundle\FormFilterBundle\Filter\DataExtractor\FormDataExtractor();
$instance->addMethod($this->get('lexik_form_filter.data_extraction_method.default'));
$instance->addMethod($this->get('lexik_form_filter.data_extraction_method.text'));
$instance->addMethod($this->get('lexik_form_filter.data_extraction_method.key_values'));
return $instance;
} | [
"protected function getLexikFormFilter_FormDataExtractorService()\n {\n $this->services['lexik_form_filter.form_data_extractor'] = $instance = new \\Lexik\\Bundle\\FormFilterBundle\\Filter\\DataExtractor\\FormDataExtractor();\n\n $instance->addMethod(${($_ = isset($this->services['lexik_form_filter.data_extraction_method.default']) ? $this->services['lexik_form_filter.data_extraction_method.default'] : $this->get('lexik_form_filter.data_extraction_method.default')) && false ?: '_'});\n $instance->addMethod(${($_ = isset($this->services['lexik_form_filter.data_extraction_method.text']) ? $this->services['lexik_form_filter.data_extraction_method.text'] : $this->get('lexik_form_filter.data_extraction_method.text')) && false ?: '_'});\n $instance->addMethod(${($_ = isset($this->services['lexik_form_filter.data_extraction_method.key_values']) ? $this->services['lexik_form_filter.data_extraction_method.key_values'] : $this->get('lexik_form_filter.data_extraction_method.key_values')) && false ?: '_'});\n\n return $instance;\n }",
"protected function getDataCollector_Form_ExtractorService()\n {\n return $this->privates['data_collector.form.extractor'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataExtractor();\n }",
"protected function getDataCollector_Form_ExtractorService()\n {\n return $this->services['data_collector.form.extractor'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataExtractor();\n }",
"protected function getDataCollector_FormService()\n {\n return $this->privates['data_collector.form'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataCollector(($this->privates['data_collector.form.extractor'] ?? ($this->privates['data_collector.form.extractor'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataExtractor())));\n }",
"protected function getDataCollector_FormService()\n {\n return $this->services['data_collector.form'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataCollector($this->get('data_collector.form.extractor'));\n }",
"protected function getDataCollector_FormService()\n {\n return $this->privates['data_collector.form'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataCollector(new \\Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataExtractor());\n }",
"protected function getTranslation_ExtractorService()\n {\n $this->services['translation.extractor'] = $instance = new \\Symfony\\Component\\Translation\\Extractor\\ChainExtractor();\n\n $instance->addExtractor('php', $this->get('translation.extractor.php'));\n\n return $instance;\n }",
"final public function getExtractor() {\n if ($this->_extractor === null) {\n $this->_extractor = $this->createExtractor();\n }\n\n return $this->_extractor;\n }",
"protected function getTranslation_ExtractorService()\n {\n $this->services['translation.extractor'] = $instance = new \\Symfony\\Component\\Translation\\Extractor\\ChainExtractor();\n\n $instance->addExtractor('php', $this->get('translation.extractor.php'));\n $instance->addExtractor('twig', $this->get('twig.translation.extractor'));\n\n return $instance;\n }",
"protected function getTranslation_ExtractorService()\n {\n $this->services['translation.extractor'] = $instance = new \\Symfony\\Component\\Translation\\Extractor\\ChainExtractor();\n\n $instance->addExtractor('php', ${($_ = isset($this->services['translation.extractor.php']) ? $this->services['translation.extractor.php'] : $this->get('translation.extractor.php')) && false ?: '_'});\n $instance->addExtractor('twig', ${($_ = isset($this->services['twig.translation.extractor']) ? $this->services['twig.translation.extractor'] : $this->get('twig.translation.extractor')) && false ?: '_'});\n\n return $instance;\n }",
"protected function getApp_Service_DataconverterprocessorService()\n {\n include_once \\dirname(__DIR__, 4).'/src/Service/DataConverterProcessor.php';\n\n return $this->services['app.service.dataconverterprocessor'] = new \\App\\Service\\DataConverterProcessor($this);\n }",
"protected function getTwig_Translation_ExtractorService()\n {\n return $this->services['twig.translation.extractor'] = new \\Symfony\\Bridge\\Twig\\Translation\\TwigExtractor($this->get('twig'));\n }",
"protected function getApp_Service_Base64extractorService()\n {\n include_once \\dirname(__DIR__, 4).'/src/Service/Base64FileExtractor.php';\n\n return $this->services['app.service.base64extractor'] = new \\App\\Service\\Base64FileExtractor();\n }",
"public function GetExtractor()\r\n\t\t{\r\n\t\t\treturn $this->_extractor;\r\n\t\t}",
"protected function getForm_TypeExtension_Form_DataCollectorService()\n {\n return $this->services['form.type_extension.form.data_collector'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\Type\\DataCollectorTypeExtension(${($_ = isset($this->services['data_collector.form']) ? $this->services['data_collector.form'] : $this->get('data_collector.form')) && false ?: '_'});\n }",
"protected function getForm_TypeExtension_Form_DataCollectorService()\n {\n return $this->services['form.type_extension.form.data_collector'] = new \\Symfony\\Component\\Form\\Extension\\DataCollector\\Type\\DataCollectorTypeExtension($this->get('data_collector.form'));\n }",
"protected function getDbal_ExtractorService()\n {\n return $this->services['dbal.extractor'] = $this->get('dbal.extractor.factory')->get();\n }",
"protected function getLexikJwtAuthentication_Extractor_QueryParameterExtractorService()\n {\n return $this->services['lexik_jwt_authentication.extractor.query_parameter_extractor'] = new \\Lexik\\Bundle\\JWTAuthenticationBundle\\TokenExtractor\\QueryParameterTokenExtractor('');\n }",
"protected function getFormDefinitionConversionServiceService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Form\\\\Domain\\\\Configuration\\\\FormDefinitionConversionService'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Form\\Domain\\Configuration\\FormDefinitionConversionService::class);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Moves $entity after $positionEntity. | public function moveAfter($entity, $positionEntity)
{
$this->move('moveAfter', $entity, $positionEntity);
} | [
"public function moveAfter($entity)\n {\n $this->move('moveAfter', $entity);\n }",
"public function moveAfter($entity)\n {\n $sortableGroupField = $this->getSortableGroupField();\n if ($sortableGroupField && $this->$sortableGroupField !== $entity->$sortableGroupField) {\n throw new SortableException($this->$sortableGroupField, $entity->$sortableGroupField);\n }\n\n /** @var \\Illuminate\\Database\\Connection $connection */\n $connection = $this->getConnection();\n\n $this->_transaction(function () use ($connection, $entity) {\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $query */\n $query = $connection->table($this->getTable());\n $query = $this->_applySortableGroup($query);\n\n if ($this->position > $entity->position) {\n $query\n ->where('position', '>', $entity->position)\n ->where('position', '<', $this->position)\n ->increment('position');\n\n $this->position = $entity->position + 1;\n } elseif ($this->position < $entity->position) {\n $query\n ->where('position', '<=', $entity->position)\n ->where('position', '>', $this->position)\n ->decrement('position');\n\n $this->position = $entity->position;\n $entity->position = $entity->position - 1;\n }\n\n $this->save();\n });\n }",
"public function moveAfter($entity)\n {\n return $this->move('moveAfter', $entity);\n }",
"public function moveAfter($entity)\n {\n $sortableGroupField = $this->getSortableGroupField();\n $sortableField = $this->getSortableField();\n\n if ($sortableGroupField) {\n if (is_array($sortableGroupField)) {\n foreach ($sortableGroupField as $field) {\n if ($this->$field !== $entity->$field) {\n throw new SortableException($this->$field, $entity->$field);\n }\n }\n } elseif ($this->$sortableGroupField !== $entity->$sortableGroupField) {\n throw new SortableException($this->$sortableGroupField, $entity->$sortableGroupField);\n }\n }\n\n /** @var \\Illuminate\\Database\\Connection $connection */\n $connection = $this->getConnection();\n\n $this->_transaction(function () use ($connection, $entity,$sortableField) {\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $query */\n $query = $connection->table($this->getTable());\n $query = $this->_applySortableGroup($query);\n\n if ($this->{$sortableField} > $entity->{$sortableField}) {\n $query\n ->where($sortableField, '>', $entity->{$sortableField})\n ->where($sortableField, '<', $this->{$sortableField})\n ->increment($sortableField);\n\n $this->{$sortableField} = $entity->{$sortableField} + 1;\n } elseif ($this->{$sortableField} < $entity->{$sortableField}) {\n $query\n ->where($sortableField, '<=', $entity->{$sortableField})\n ->where($sortableField, '>', $this->{$sortableField})\n ->decrement($sortableField);\n\n $this->{$sortableField} = $entity->{$sortableField};\n $entity->{$sortableField} = $entity->{$sortableField} - 1;\n }\n\n $this->save();\n });\n }",
"public function moveBefore($entity)\n {\n if ($this->parent_id == $entity->parent_id) {\n $this->position = $entity->position - 1;\n $this->save();\n } else {\n $this->moveTo($entity->position - 1, $entity->parent_id);\n }\n }",
"public function move_after(Frame $frame)\n {\n $this->get_parent()->insert_child_after($frame, $this);\n }",
"public function moveBefore($entity)\n {\n /** @var \\Illuminate\\Database\\Connection $connection */\n $connection = $this->getConnection();\n\n $this->_transaction(function() use($connection, $entity){\n /** @var \\Illuminate\\Database\\Eloquent\\Builder $query */\n $query = $connection->table($this->getTable());\n\n $query = $this->_applySortableGroup($query, $entity);\n\n if ($this->position > $entity->position) {\n $query\n ->where('position', '>=', $entity->position)\n ->where('position', '<', $this->position)\n ->increment('position');\n\n $this->position = $entity->position;\n\n $entity->position = $entity->position + 1;\n\n } elseif ($this->position < $entity->position) {\n $query\n ->where('position', '<', $entity->position)\n ->where('position', '>', $this->position)\n ->decrement('position');\n\n $this->position = $entity->position - 1;\n }\n\n $this->save();\n });\n }",
"public function moveBefore($entity)\n {\n $this->move('moveBefore', $entity);\n }",
"public function moveAndRenderAction(Node $node, Node $targetNode, $position, $typoScriptPath) {\n\t\t$this->nodeOperations->move($node, $targetNode, $position);\n\t\t$this->redirectToRenderNode($targetNode, $typoScriptPath);\n\t}",
"public function move(): void\n {\n $this->location = $this->location->move($this->direction);\n }",
"function moveLast()\n {\n $this->position = count($this->model->triples) - 1;\n }",
"public function moveBefore($entity)\n {\n $sortableGroupField = $this->getSortableGroupField();\n if ($sortableGroupField && $this->$sortableGroupField !== $entity->$sortableGroupField) {\n throw new SortableException($this->$sortableGroupField, $entity->$sortableGroupField);\n }\n\n /** @var \\Illuminate\\Database\\Connection $connection */\n $connection = $this->getConnection();\n\n $this->_transaction(function () use ($connection, $entity) {\n $query = $connection->table($this->getTable());\n $query = $this->_applySortableGroup($query);\n\n if ($this->position > $entity->position) {\n $query\n ->where('position', '>=', $entity->position)\n ->where('position', '<', $this->position)\n ->increment('position');\n\n $this->position = $entity->position;\n\n $entity->position = $entity->position + 1;\n } elseif ($this->position < $entity->position) {\n $query\n ->where('position', '<', $entity->position)\n ->where('position', '>', $this->position)\n ->decrement('position');\n\n $this->position = $entity->position - 1;\n }\n\n $this->save();\n });\n }",
"private function decrementPositionsAfter($position)\n {\n $statement = $this->db->prepare('UPDATE list SET list.position=list.position-1 WHERE list.position > :position');\n $statement->bindParam(':position', $position);\n $statement->execute();\n }",
"abstract public function moveAfter(ActiveRecord $model): bool;",
"public function moveAsLastChildOf(\\App\\DomainObject\\Node $node);",
"public function moveTo(int $position) {\n if ($position < 1) return;\n if ($position == $this->position) return;\n\n $resources = $this->__object->getResources($this->type);\n $last = $resources[sizeof($resources) - 1];\n\n if ($position > $last->position)\n $position = $last->position;\n\n $destination = $last;\n for($i = sizeof($resources) - 1; $i >= 0; --$i) {\n $res = $resources[$i];\n if ($res->position == $position) {\n $destination = $res;\n break;\n }\n }\n\n if ($destination->position == $this->position) return;\n\n // Exchange positions\n $t = $this->__table;\n $ref = $this->__object->reference_column();\n if ($destination->position < $this->position) {\n DB::query($t)\n ->set('position', 'position + 1', false)\n ->where($ref, $this->__object->ID)\n ->where('type', $this->type)\n ->where('position', '<=', $destination->position)\n ->update();\n }\n else {\n DB::query($t)\n ->set('position', 'position - 1', false)\n ->where($ref, $this->__object->ID)\n ->where('type', $this->type)\n ->where('position', '>=', $destination->position)\n ->update();\n }\n\n DB::query($t)\n ->set('position', $destination->position)\n ->where('ID', $this->ID)\n ->update();\n\n $this->position = $destination->position;\n $this->__object->getResources($this->type, true);\n }",
"public function moveToPosition($position)\n {\n $this->getParent()->moveChildToPosition($this, $position);\n }",
"public abstract function moveBelow($node);",
"public function moveBefore($entity)\n {\n $sortableGroupField = $this->getSortableGroupField();\n $sortableField = $this->getSortableField();\n if ($sortableGroupField) {\n if (is_array($sortableGroupField)) {\n foreach ($sortableGroupField as $field) {\n if ($this->$field !== $entity->$field) {\n throw new SortableException($this->$field, $entity->$field);\n }\n }\n } elseif ($this->$sortableGroupField !== $entity->$sortableGroupField) {\n throw new SortableException($this->$sortableGroupField, $entity->$sortableGroupField);\n }\n }\n\n /** @var \\Illuminate\\Database\\Connection $connection */\n $connection = $this->getConnection();\n\n $this->_transaction(function () use ($connection, $entity,$sortableField) {\n $query = $connection->table($this->getTable());\n $query = $this->_applySortableGroup($query);\n\n if ($this->{$sortableField} > $entity->{$sortableField}) {\n $query\n ->where($sortableField, '>=', $entity->{$sortableField})\n ->where($sortableField, '<', $this->{$sortableField})\n ->increment($sortableField);\n\n $this->{$sortableField} = $entity->{$sortableField};\n\n $entity->{$sortableField} = $entity->{$sortableField} + 1;\n } elseif ($this->{$sortableField} < $entity->{$sortableField}) {\n $query\n ->where($sortableField, '<', $entity->{$sortableField})\n ->where($sortableField, '>', $this->{$sortableField})\n ->decrement($sortableField);\n\n $this->{$sortableField} = $entity->{$sortableField} - 1;\n }\n\n $this->save();\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves all genres for a specific series. | function getSeriesGenres($seriesID){
connectToMeekro();
$result = DB::query("SELECT sg.name FROM SeriesGenre AS sg WHERE sg.seriesID = %i;", $seriesID);
return $result;
} | [
"public static function getGenres()\n {\n self::wakeup();\n\n return self::$db->fetchAll(\n 'SELECT genre_code AS value, genre_descr AS text FROM public.rec_genrelookup ORDER BY genre_descr ASC'\n );\n }",
"function GetGenreSeeds(){\n $array = $this->executeCURL(\"https://api.spotify.com/v1/recommendations/available-genre-seeds\", array(\"Authorization: Bearer $this->accessToken\"), \"GET\");\n return $array['genres'];\n }",
"public function getGenres() {\n $query = sprintf(\" SELECT DISTINCT album_genre FROM `%s` ORDER BY album_genre ASC\",\n self::DB_TABLE\n );\n \n $db = Db::instance();\n $result = $db->lookup($query);\n if(!mysql_num_rows($result))\n return null;\n else {\n $genres = array();\n while($row = mysql_fetch_assoc($result)) {\n array_push($genres, $row['album_genre']);\n }\n return ($genres);\n }\n }",
"public function getGenres(): array\n {\n return $this->genres;\n }",
"function getGenre($id){\n $serie = ORM::for_table('series')->find_one($id);\n $genres = ORM::for_table('seriesgenres')->where('series_id', $id)->find_array();\n $genreName = array();\n foreach($genres as $genre){\n array_push($genreName, ORM::for_table('genres')->find_one($genre['genre_id']));\n }\n return $genreName;\n}",
"public function getGenres()\n {\n return $this->genres;\n }",
"public static function getAllGenres(){\r\n $return = array();\r\n $genres = Users::model()->findAll(\r\n array(\r\n \"select\" => \"track_genre\",\r\n \"condition\" => \"track_genre != '' AND isactive = 1\",\r\n \"distinct\" => true,\r\n \"order\" => \"track_genre asc\",\r\n )\r\n );\r\n foreach($genres as $k => $v){\r\n $return[] = $v->track_genre;\r\n }\r\n return $return;\r\n }",
"public function getGenres()\n {\n return $this->genres;\n }",
"public function getGenres()\r\n {\r\n return $this->genres;\r\n }",
"public function getGenres()\n {\n return $this->hasMany(Genre::className(), ['id' => 'genre_id'])->viaTable('film_genre', ['film_id' => 'id']);\n }",
"public function getGenres(){\r\n $genres = array();\r\n $sql = \"SELECT * FROM artworkgenres join genres WHERE artworkgenres.GenreID = genres.GenreID AND ArtWorkID=:id\";\r\n $ps = $this->pdo->prepare($sql);\r\n $ps->bindValue(':id',$this->id);\r\n $ps->execute();\r\n $ps->setFetchMode(PDO::FETCH_ASSOC);\r\n while ($row = $ps->fetch()) {\r\n $genres[] = $row; \r\n }\r\n return $genres;\r\n }",
"public function getGenres()\n\t{\n\t\treturn $this->genres;\n\t}",
"public function getAllMovieGenres(): iterable\n {\n $parsedBody = $this->getParsedBody();\n $results = $parsedBody['genres'];\n\n foreach ($results as $result) {\n yield $this->genreBuilder->createFromArray($result);\n }\n }",
"public function get_genres_by_spotify_id($spotify_id)\n\t{\n\t\t$genres = DB::select('select g.name from artists a join artists_genres ag on a.id = ag.artist_id join genres g on ag.genre_id = g.id where a.spotify_id = ? limit 0,?', [$spotify_id, self::MAX_GENRE_MATCH]);\n\n\t\t$results = array();\n\t\tforeach($genres as $genre){\n\t\t\t$results[] = $genre->name;\n\t\t}\t\n\n\t\treturn $results;\n\t}",
"public function getGenres()\n {\n return $this->data['fields']['genres'];\n }",
"public function get_all_genre() // [-Done-]\n {\n $this->db->order_by(\"name\", \"ASC\");\n return $this->db->get(\"_komik_genre\")->result_array();\n }",
"public function getGenres(){\n $this->cors();\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n $genres = Genre::model()->findAll();\n\n $this->sendResponse([\"success\" => 1, \"data\" => $genres]);\n exit();\n }",
"public function allGenres()\n {\n return json_encode([\n 'Alternative Rock' => 'alternativerock',\n 'Ambient' => 'ambient',\n 'Classical' => 'classical',\n 'Country' => 'country',\n 'Dance & EDM' => 'danceedm',\n 'Dancehall' => 'dancehall',\n 'Deep House' => 'deephouse',\n 'Disco' => 'disco',\n 'Drum & Bass' => 'drumbass',\n 'Dubstep' => 'dubstep',\n 'Electronic' => 'electronic',\n 'Folk & Singer-Songwriter' => 'folksingersongwriter',\n 'Hip-hop & Rap' => 'hiphoprap',\n 'House' => 'house',\n 'Indie' => 'indie',\n 'Jazz & Blues' => 'jazzblues',\n 'Latin' => 'latin',\n 'Metal' => 'metal',\n 'Piano' => 'piano',\n 'Pop' => 'pop',\n 'R&B & Soul' => 'rbsoul',\n 'Reggae' => 'reggae',\n 'Reggaeton' => 'reggaeton',\n 'Rock' => 'rock',\n 'Soundtrack' => 'soundtrack',\n 'Techno' => 'techno',\n 'Trance' => 'trance',\n 'Trap' => 'trap',\n 'Triphop' => 'triphop',\n 'World' => 'world',\n ]);\n }",
"public function genres () {\n if (empty($this->moviegenres)) {\n if ($this->page[\"Title\"] == \"\") $this->openpage (\"Title\");\n $this->moviegenres = explode(\",\",$this->page[\"Title\"]->{'genres_list'});\n }\n return $this->moviegenres;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cleans up mobile passwords older than defined mimutes Returns the mobile file linked to the deleted file iff a password was deleted, "" otherwise REQ065 | function cleanupMobilePassword() {
global $mobiletimeout; // hours
global $mobilefolder;
$mobileFileLinkedToDeletedPW = "";
$olderthanxxxweeks = 60*$mobiletimeout;
foreach (glob($mobilefolder."*.txt") as $file) {
$diff = time() - filectime($file);
if($diff > $olderthanxxxweeks){
$handle = fopen($file, "r");
$mobileFileLinkedToDeletedPW = trim(fgets($handle));
fclose($handle);
unlink($file);
}
}
return $mobileFileLinkedToDeletedPW;
} | [
"function remOld(){\r\n\t\t\r\n\t\t//private vars\r\n\t\t$authf = $this-> config['filen'];\r\n\t\t\r\n\t\t//list the files in array\r\n\t\tif($dir = opendir($this-> config['filep'])){\r\n \t\t\r\n\t\t\twhile(($file = readdir($dir)) !== FALSE){ \r\n \t\t\r\n\t\t\t\tif(substr($file,1,strlen($authf)) == $authf){ \r\n \t\t\t\r\n\t\t\t\t\t//file in array\r\n\t\t\t\t\t$files[] = $file;\r\n\t\t\t\t\r\n\t\t\t\t} \r\n \t\t\t}\r\n \t\t\r\n\t\t\tclosedir($dir); \r\n\t\t}\r\n\t\t\r\n\t\t//remove Old Files\r\n\t\tif(is_array($files)){\r\n\t\t\r\n\t\t\tforeach($files as $value){\r\n\t\t\t\r\n\t\t\t\t//verify file\r\n\t\t\t\t$ftime = substr($value,strlen($authf)+1,10); //file create time\r\n\t\t\t\t$time = time(); //actual time\r\n\r\n\t\t\t\tif($ftime + $this-> cookie['expires'] < $time){\r\n\t\t\t\t\r\n\t\t\t\t\t//delete file\r\n\t\t\t\t\t$this-> authfdel($value);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn 0;\r\n\t}",
"public static function delverifycode()\n {\n return Sms::delVerifycode('login','13333339558','$code');\n }",
"private function removePassword()\n {\n $accounts = $this->loadAccounts();\n $this->println(\"Remove which password (specify index number):\");\n $index = readline();\n unset($accounts[$index]);\n $this->saveAccounts($accounts);\n }",
"public function delete(){\n $status = imap_deletemailbox($this->client->connection, $this->path);\n $this->client->expunge();\n\n return $status;\n }",
"function Aastra_delete_unavail_message_Asterisk($user)\n{\nGlobal $AA_VM_BOXBASE;\n\n# Translate user if needed\n$user=Aastra_get_userdevice_Asterisk($user);\n\n# Delete temporary message\n$dir=$AA_VM_BOXBASE.'/'.$user;\n@unlink($dir.'/unavail.wav');\n@unlink($dir.'/unavail.WAV');\n}",
"function FileRmUser($username)\r\n {\r\n // remove any whitespace from the var\r\n $username = trim($username);\r\n // open the file for reading, with $fp at the beginning\r\n $fp = @fopen($this->AuthFile, \"r\") or die (\"Cannot open file for writing.\");\r\n // loop through the file line by line and do some stuff\r\n while ($line = fgets($fp, 1024)) {\r\n // trim whitespace from front and end of line\r\n $cleanline = trim($line);\r\n // break $line into an array based on the $this->FieldDel delimeter\r\n $cleanline = explode($this->FieldDel, $cleanline);\r\n // clean the white space from the front/end of each element\r\n $tmp_usr = trim($cleanline[0]);\r\n $tmp_pass = trim($cleanline[1]);\r\n $tmp_email = trim($cleanline[2]);\r\n // as long as the $tmp_usr if not equal to the original username\r\n // we want to add the line to $new_lines array for re-writing with the\r\n // original record for $username left out\r\n if ($username != $tmp_usr) {\r\n $lines[] = $tmp_usr.$this->FieldDel.$tmp_pass.$this->FieldDel.$tmp_email.\"\\n\";\r\n }\r\n }\r\n // now that we have an array of lines minus $username\r\n // close the file\r\n @fclose($fp);\r\n // and fnally, we can re-write the password file\r\n // open the file for writing, with $fp at the beginning; overwrite file contents\r\n $fp = @fopen($this->AuthFile, \"w\") or die (\"Cannot open file for writing.\");\r\n // lock the file for writing\r\n $this->FileLock($fp);\r\n // write the new info to the password file\r\n if (is_array($lines))\r\n\t foreach ($lines as $line) {\r\n\t fputs($fp, \"$line\");\r\n\t }\r\n // unlock the file\r\n $this->FileUnLock($fp);\r\n // close the file\r\n @fclose($fp);\r\n return true;\r\n }",
"function delete_machine() {\n\tunset($_GET['edit_machine']);\n\tglobal $db;\n\t$u = $_SESSION['Username'];\n\t$mn = $_POST['mname'];\n\t$query = \"DELETE FROM machines WHERE username='$u' and mname='$mn'\";\n\t$dummy = mysqli_query($db, $query);\n\tif($dummy == False)\n\t\treturn 0;\n\treturn 1;\n}",
"private function _hash_gc()\n\t{\n\t\t$timeout = ($this->CI->config->item('passwd_change_timeout')) ? \n\t\t\t\t\t\t$this->CI->config->item('passwd_change_timeout') : 24*60*60;\t\t\n\t\t\n\t\t$this->CI->db->where('request_time <', time() - $timeout)->delete('simple_auth_passwd_request');\t\n\t}",
"public function recoverAdminPassword()\r\n {\r\n global $database;\r\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\r\n if (isset($_SESSION['token']) && $_POST['token'] === $_SESSION['token']) {\r\n $email = $this->clean($_POST['email']);\r\n\r\n if ($this->emailExists($email)) {\r\n $validation_code = md5($email . microtime());\r\n\r\n setcookie('temp_access_code', $validation_code, time()+900);\r\n\r\n $sql = \"UPDATE admin SET validation_code = '\".$database->escape($validation_code).\"' WHERE email = '\".$database->escape($email).\"'\";\r\n $result = $database->query($sql);\r\n\r\n $subject = \"Please Reset Your Password\";\r\n $message = \"Hello, <br><br>Here is your Password Reset code: {$validation_code} <br><br>Please <a href=\\\"\".Config::ADMIN_URL.\"/code.php?email=$email&code=$validation_code\\\">Click Here </a>to reset your password.<br><br>Thanks,<br>Team Medywise\";\r\n $header = \"From: noreply@medywise.com\";\r\n\r\n $this->sendMail($email, $subject, $message, $header);\r\n $this->setMessage(\"<p class='bg-success text-center'>Please Check Your Email for Password Reset Code</p>\");\r\n $this->redirect(\"login.php\");\r\n } else {\r\n echo $this->validationErrors(\"This email does not exists\");\r\n }\r\n } else {\r\n $this->redirect(\"login.php\");\r\n }\r\n\r\n if (isset($_POST['cancel_submit'])) {\r\n $this->redirect(\"login.php\");\r\n }\r\n }\r\n }",
"public function cleanup_pms(){\n\t\t$pm_cleanup_max_age = $this->config_vars['pm_cleanup_max_age'];\n\t\t$date_sent = date('Y-m-d H:i:s', strtotime(\"now -\".$pm_cleanup_max_age));\n\t\t$this->aauth_db->where('date_sent <', $date_sent);\n\n\t\treturn $this->aauth_db->delete($this->config_vars['pms']);\n\t}",
"function clean(){\n\t\t$app =& Dataface_Application::getInstance();\n\t\tmysql_query(\"delete from `\".Dataface_Clipboard_tablename.\"` where UNIX_TIMESTAMP(`lastmodified`) > \".(time()-Dataface_Clipboard_lifetime),\n\t\t\t$app->db()) or trigger_error(\"Failed to clean old data from the clipboard: \".mysql_error($app->db()), E_USER_ERROR);\n\t}",
"function delspamer()\n{\n $del = $_REQUEST['spamdel'];\n $query = \"DELETE FROM \".$this->db->get('SpamDB').\" WHERE SpamEmail=? AND Account=?\";\n\t$data = array( $del, $this->auth->get_account() );\n\t$this->db->sqldo($query, $data);\n}",
"function delete_file()\r\n{\r\n\t\r\n\t$wr=make_where($_POST);\r\n\t//echo $wr;\r\n\tif(strlen($wr)>0)\r\n\t{\r\n\t\t//echo $wr;\r\n\t\t\r\n\t\t$sql_attachment='delete from attachment where id=\\''.$_POST['_attachment_id'].'\\'';\r\n\t\t$sql_link='update `'.$_POST['_tablename'].'` set attach=\\'0\\' where '.$wr;\r\n\t\t\r\n\t\t//echo $sql_attachment.'<br>';\r\n\t\t//echo $sql_link.'<br>';\r\n\t\t\r\n\t\t$link=mysql_connect('127.0.0.1',$_SESSION['login'],$_SESSION['password']);\r\n\t\tmysql_select_db('attachment',$link);\r\n\t\t\r\n\t\tif(!$result=mysql_query($sql_attachment,$link)){echo mysql_error();}\r\n\t\telse\r\n\t\t{\r\n\t\t\techo mysql_affected_rows($link).' attachment id='.$_POST['_attachment_id'].' deleted in attachment database<br>';\r\n\t\t\tmysql_select_db($_POST['_database'],$link);\r\n\t\t\tif(!$result=mysql_query($sql_link,$link)){echo mysql_error();}\r\n\t\t}\r\n\t}\r\n}",
"function deletefirm() {\n if(!isset($this->id) || ($this->id <= 0)) {\n $this->Error[\"Application Error ClssOffrDltOffrID-Invalid Argument\"] = \"Class firm: In deleteOffr firm_ID is not set\";\n return false;\n }\n\n \n $sql = sprintf(\"DELETE FROM firms WHERE id = %d\", $this->id);\n $this->conn->setsql($sql);\n $this->conn->updateDB();\n if($this->conn->error) {\n for(reset($this->conn->error); $key = key($this->conn->error); next($this->conn->error)) {\n $this->Error[\"SQL ERROR ClssOffrDltOffr-\".$key] = $this->conn->error[$key];\n }\n return false;\n }\n\n $offPcs = glob('pics/firms/'.$this->id.\"_*\");\n \n\n if(count($offPcs) > 0) {\n foreach($offPcs as $val) {\n if(strlen($val) > 0) {\n if(!@@unlink($val)) {\n $this->Error[\"Application Error ClssOffrDltOffr-Invalid Operation\"] = \"Class firm: In deleteOffr -> The file \".basename($val).\" cannot be deleted!\";\n return false;\n }\n }\n }\n }\n\n\n // ======================================== DELETE VIDEO ===================================================== \t\n \t\t\t$video_name = $this->id; \t\t\t\n \n\t\t\t\tif(file_exists(\"videos/firms/\".$video_name.\".flv\"))\n\t\t\t\t{\n\t\t\t\t\t@unlink(\"videos/firms/\".$video_name.\".flv\");\n\t\t\t\t}\n\t\t\t\tif(file_exists(\"videos/firms/\".$video_name.\"._thumb.jpg\"))\n\t\t\t\t{\n\t\t\t\t\t@unlink(\"videos/firms/\".$video_name.\"_thumb.jpg\");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t//=============================================================================================================\n\t\n\t\n\n \n\t//**************************************** Изтриваме Таговете **************************************\n \n $sql = sprintf(\"DELETE FROM firm_tags WHERE firmID = %d \",$this->id);\n $this->conn->setsql($sql);\n $this->conn->updateDB();\n\t\t \t\n //***********************************************************************************************\n \n\t \n\t \n // --------------Iztrivame i prileja6tite paketi--------------\n\t$sql = sprintf(\"DELETE FROM purchased_packages WHERE company_id = %d\", $this->id);\n \t$this->conn->setsql($sql);\n \t$this->conn->updateDB();\n \t if($this->conn->error) {\n \tfor(reset($this->conn->error); $key = key($this->conn->error); next($this->conn->error)) {\n \t$this->Error[\"SQL ERROR ClssCmpnDltCmpn-\".$key] = $this->conn->error[$key];\n \t}\n \treturn false;\n \t}\n\t\n\t\n \t$sql=sprintf(\"DELETE FROM firm_pics WHERE firmID = %d\", $this->id);\n\t\t$this->conn->setsql($sql);\n\t\t$this->conn->updateDB();\n\t\t\n\t\t\n\t\t$sql=sprintf(\"DELETE FROM recipes WHERE firm_id = %d\", $this->id);\n\t\t$this->conn->setsql($sql);\n\t\t$this->conn->updateDB();\n\t\t\n\t\t$sql=sprintf(\"DELETE FROM drinks WHERE firm_id = %d\", $this->id);\n\t\t$this->conn->setsql($sql);\n\t\t$this->conn->updateDB();\n\t\t\n\t\t\n\t\t$sql=sprintf(\"DELETE FROM guides WHERE firm_id = %d\", $this->id);\n\t\t$this->conn->setsql($sql);\n\t\t$this->conn->updateDB();\n\t\t\n\t\t$sql=sprintf(\"DELETE FROM posts WHERE autor_type = 'firm' AND autor = %d\", $this->id);\n\t\t$this->conn->setsql($sql);\n\t\t$this->conn->updateDB();\n\t\t\n\t\t\n\t\n\t\n \t// --------------Iztrivame i kategoriite na firmata --------------\n\t\t$sql = sprintf(\"DELETE FROM firms_category_list WHERE firm_id = %d\", $this->id);\n \t$this->conn->setsql($sql);\n \t$this->conn->updateDB();\n \tif($this->conn->error) {\n \tfor(reset($this->conn->error); $key = key($this->conn->error); next($this->conn->error)) {\n \t$this->Error[\"SQL ERROR ClssCmpnDltCmpn-\".$key] = $this->conn->error[$key];\n \t}\n \treturn false;\n \t}\n\t\n \t\n \t// --------------Iztrivame i ot LOG tablicata --------------\n\t$sql = sprintf(\"DELETE FROM log_firm WHERE firm_id = %d\", $this->id);\n \t$this->conn->setsql($sql);\n \t$this->conn->updateDB();\n \tif($this->conn->error) \n\t{\n\t\tfor(reset($this->conn->error); $key = key($this->conn->error); next($this->conn->error)) {\n\t \t$this->Error[\"SQL ERROR ClssCmpnDltCmpn-\".$key] = $this->conn->error[$key];\n\t\t}\n\t\treturn false;\n \t}\n \t\n \t\n \t\n \t\n return true;\n }",
"private static function remove_password() {\r\n\t\tforeach ( self::$info['field_data_array'] as $key => $field_arr ) {\r\n\t\t\tif ( false !== stripos( $field_arr['name'], 'password-' ) ) {\r\n\t\t\t\tunset( self::$info['field_data_array'][ $key ] );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function delete() {\n\t\t// Get sslData for every member with access to this password and delete it\n\t\t$sslDataList = $this->getSslList();\n\t\t$sslDataList->deleteListItems();\n\n\t\t// Delete password\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_passwordmgr_password',\n\t\t\t'uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'], 'tx_passwordmgr_password')\n\t\t);\n\t\t$this->checkAffectedRows('deletePassword', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'deletePassword', 'Removed password '.$this['uid']);\n\t}",
"function delete_exercise_program_file()\n\t{\n\t\t$data['is_deleted'] \t\t= 1;\n\n\t\t$data['deleted_by_user']\t= $this->session->userdata(\"userid\");\n\t\t$data['date_deleted'] \t\t= date(\"Y-m-d h:i:s\");\n\n\t\t// update details -\n\t\t\t\t\t\t$res = $this->db->query(\"DELETE FROM `exercise_meta` WHERE id = \".$_POST['id']);\n\n\n\t\tif($res)\n\t\t{\n\t\t\techo $_POST['id'];\t// send delete id as response\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 0;\n\t\t}\n\t}",
"function NasAccessUserDel($m)\n{\n\tglobal $g;\n\t\n\t$d_sysrebootreqd_path = $g['varrun_path'] . \"/sysreboot.reqd\";\n\n\tif (file_exists($d_sysrebootreqd_path))\n\t{\n\t\t$returnmsg = Nas2BMsg(\"fail\",\"Please reboot NAS first!\");\t\t\n\t\treturn new xmlrpcresp(php_xmlrpc_encode($returnmsg));\t\t\n\t}\n\n\tglobal $config;\n\t\n\t$uuid = $m->getParam(0);\n\t$uuid = $uuid->scalarVal();\n\n\tif (!is_array($config['access']['user']))\n\t\t$config['access']['user'] = array();\n\n\tarray_sort_key($config['access']['user'], \"login\");\n\n\t$a_user = &$config['access']['user'];\n\n\tif (false === ($cnid = array_search_ex($uuid,$a_user,\"uuid\"))) \n\t{\n\t\t$returnmsg = Nas2BMsg(\"fail\",\"User id error!\");\n\t\treturn new xmlrpcresp(php_xmlrpc_encode($returnmsg));\n\t}\n\n\tunset($a_user[$cnid]);\n\twrite_config();\n\n\t$retval = 0;\n\t\n\tconfig_lock();\n\t$retval |= rc_exec_service(\"userdb\");\n\tconfig_unlock();\n\n\tif(!$retval)\n\t{\n\t\t$returnmsg = Nas2BMsg(\"success\",\"User del success!\");\n\t}\n\telse\n\t{\n\t\t$returnmsg = Nas2BMsg(\"fail\",\"User del fail!\");\n\t}\n\t\n\treturn new xmlrpcresp(php_xmlrpc_encode($returnmsg));\n\t\n}",
"public function testforgottenPassDeleted() {\n $customer = $this->getRandomCustomer();\n $email = $customer->getEmail();\n $customer->delete();\n $this->assertEquals(2, $customer->forgottenPass($email));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up mocks as such that the fixture has a parent class, with a file. | private function whenFixtureIsRelatedToAClassWithFile()
{
$file = m::mock(FileDescriptor::class);
$parent = m::mock(ClassDescriptor::class);
$parent->shouldReceive('getFile')->andReturn($file);
$parent->shouldReceive('getFullyQualifiedStructuralElementName')->andReturn(new Fqsen('\My\Class1'));
$this->fixture->setParent($parent);
return $file;
} | [
"protected function _setupOtherMocks() {\n\t\t$out = $this->getMock('ConsoleOutput', array(), array(), '', false);\n\t\t$in = $this->getMock('ConsoleInput', array(), array(), '', false);\n\n\t\t$this->Task->LegacyModel = $this->getMock('LegacyModelTask', array(), array($out, $out, $in));\n\t\t$this->Task->Template = new TemplateTask($out, $out, $in);\n\n\t\t$this->Task->name = 'LegacyFixture';\n\t\t$this->Task->interactive = true;\n\t}",
"public function setUp() {\n $this->fixture= $this->newFixture();\n }",
"public function setUp ( )\n {\n $this->setSharedFixture(new ArrayObject(array(\n 'fields' => new ArrayObject(array(\n 'test' => null,\n )), // END fields\n 'values' => new ArrayObject(array(\n )), // END values\n 'storage' => $this->getMock('ethos_Model_Storage_Interface', array(\n 'save', 'load',\n )), // END storage\n ))); // END setSharedFixture(ArrayObject)\n\n $this->_fixtureOptions = $this->sharedFixture;\n\n parent::setUp();\n }",
"public function setUp() {\n $this->fixture= new ArchiveClassLoader(new Archive(\n $this->getClass()->getPackage()->getResourceAsStream('archive.xar')\n ));\n }",
"public function create_mockers() {\n\t\tif( @is_writable( PT_MOCK_DIR ) ) {\n\t\t\t@set_time_limit( 600 );\n\n\t\t\t$this->mockConstants();\n\n\t\t\t$filelist = $this->getPaths();\n\t\t\t$this->mock( $filelist[ 'core' ], PT_MOCK_DIR . '/core.php' );\n\t\t}\n\t}",
"public function setUp(): void\n {\n $this->fileOwners = new FileOwners();\n }",
"public function setUp() {\n $this->fs = new Filesystem();\n }",
"protected function setUp(): void\n {\n // read the information for a new Beer object from a local JSON file\n $beerJson = file_get_contents(\"tests/single_beer_json.json\");\n $beerInfo = json_decode($beerJson, 1);\n\n // build the beer object\n $beer = Beer::fromArray($beerInfo);\n\n // store the beer object for testing\n $this->beerObject = $beer;\n }",
"protected function setUpFixtures()\n {\n $this->modelCache = [];\n\n $clz = get_class($this);\n if (!empty(static::$alreadyLoadedFixtures[$clz])) {\n $this->loadedFixtures = static::$alreadyLoadedFixtures[$clz];\n } else {\n $this->loadedFixtures = $this->loadFixtures();\n static::$alreadyLoadedFixtures[$clz] = $this->loadedFixtures;\n }\n }",
"public function setUp()\n\t{\n\t\tBundle::start('basset');\n\n\t\tif(!file_exists(__DIR__ . '/mock'))\n\t\t{\n\t\t\tmkdir(__DIR__ . '/mock');\n\t\t}\n\t}",
"protected function setUp()\n {\n\n // create a mock object for the parent instance\n $parent = $this->getMockBuilder($nameAwareInterface = 'AppserverIo\\Psr\\EnterpriseBeans\\Description\\NameAwareDescriptorInterface')\n ->setMethods(get_class_methods($nameAwareInterface))\n ->getMock();\n\n // mock the getName() method\n $parent->expects($this->any())\n ->method('getName')\n ->willReturn('SomeBean');\n\n // initialize the descriptor\n $this->descriptor = new PersistenceUnitReferenceDescriptor($parent);\n }",
"protected function parentSetup() {\n }",
"protected function setUp()\n {\n $this->vfs = vfsStream::setup('fst');\n $this->vfs->addChild(vfsStream::newFile('test/directory/dir/newup.keep'));\n $this->vfs->addChild(vfsStream::newFile('test/directory/first.php'));\n $this->vfs->addChild(vfsStream::newFile('test/file.txt'));\n $this->vfs->addChild(vfsStream::newFile('first.php'));\n }",
"protected function setUp()\n {\n $heroClass = new HeroHalfElf;\n $this->hero = new Hero;\n $this->hero->setHeroRace($heroClass);\n }",
"public function setUp()\n {\n BaseMock::setDefaultCallBehavior(BaseMock::DEFAULT_BEHAVIOUR_RETURN_NULL);\n\n $this->classMocker = new ClassMocker;\n //$this->classMocker->setGenerationDir('./var/generation');\n\n $this->classMocker->mock('Foobar\\*');\n $this->classMocker->registerTrait(TraitA::class);\n $this->classMocker->registerTrait(TraitB::class);\n $this->classMocker->registerTrait(TraitC::class);\n $this->classMocker->registerTrait(DummyTrait::class, 'Foobar\\*', 1000);\n\n // test footprints\n $footprintA = new ClassFootprint();\n $footprintA->addInterface(Readable::class);\n $footprintA->addInterface(Talkable::class);\n\n $footprintB = new ClassFootprint();\n $footprintB->setParent('Foobar\\BaseClass');\n\n $this->classMocker->registerFootprint('Foobar\\BaseClass', $footprintA);\n $this->classMocker->registerFootprint('Foobar\\TestClass', $footprintB);\n $this->classMocker->enable();\n }",
"public function setUp() {\n try {\n $this->file= new TempFile();\n FileUtil::setContents($this->file, 'Created by FileInputStreamTest');\n } catch (\\io\\IOException $e) {\n throw new \\unittest\\PrerequisitesNotMetError('Cannot write temporary file', $e, array($this->file));\n }\n }",
"public function setUp() {\n $this->fixture= create('new net.xp_framework.unittest.core.generics.Lookup<String, TestCase>()');\n }",
"protected function setUp()\n {\n $heroClass = new HeroHuman;\n $this->hero = new Hero;\n $this->hero->setHeroRace($heroClass);\n }",
"public function setUp()\n\t{\n\t\t$uploaded_file_mock = m::mock('Symfony\\Component\\HttpFoundation\\File\\UploadedFile');\n\t\t$rules = array();\n\t\t$import_state_mock = m::mock('Jacopo\\LaravelImportExport\\Models\\StateHandling\\Import\\ImportState');\n\t\t$import_state_mock->shouldReceive(array(\n\t\t\t\t'getFormInput' => $uploaded_file_mock,\n\t\t\t\t'getRules' => $rules,\n\t\t\t\t'setErrors' => true,\n\t\t\t));\n\t\t$this->import_state_mock = $import_state_mock;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all forms in a request. | public function GetForms(Request $request)
{
if($request->request_id){
$forms = PresenterFactory::getInstance('Application')->getFormbyRequestID($request->request_id);
return Response::json(array('forms' => $forms), 200);
}
} | [
"public function getAllForms()\n\t{\n\t\t$attributes\t= array('order' => 'name');\n\n\t\treturn $this->getCriteria($attributes)->find();\n\t}",
"public function retrieveForms()\n {\n return $this->start()->uri(\"/api/form\")\n ->get()\n ->go();\n }",
"public function getForms();",
"public function getForms(){\n if(empty($this->forms)){\n $this->forms = $this->loadForms();\n }\n\n return $this->forms;\n }",
"public function forms()\n {\n if (!$forms = $this->dispatch(new GetMultiformFromValue($this))) {\n return [];\n }\n\n return array_map(\n function (FormBuilder $form) {\n return $form\n ->make()\n ->getForm();\n },\n $forms->getForms()->all()\n );\n }",
"public function forms() {\n\n return self::request($this->api_key, 'forms', array());\n }",
"public static function get_all_forms() {\n\t\t\tglobal $wpdb;\n\t\t\t$table_name = TFB_FORM_TABLE;\n\t\t\t$forms = $wpdb->get_results( \"SELECT * FROM $table_name\" );\n\t\t\treturn $forms;\n\t\t}",
"public function getForms(): array\n {\n if (null === $this->_forms) {\n $header = $this->header();\n\n // Call event to allow filling the page header form dynamically (e.g. use case: Comments plugin)\n $grav = Grav::instance();\n $grav->fireEvent('onFormPageHeaderProcessed', new Event(['page' => $this, 'header' => $header]));\n\n $rules = $header->rules ?? null;\n if (!is_array($rules)) {\n $rules = [];\n }\n\n $forms = [];\n\n // First grab page.header.form\n $form = $this->normalizeForm($header->form ?? null, null, $rules);\n if ($form) {\n $forms[$form['name']] = $form;\n }\n\n // Append page.header.forms (override singular form if it clashes)\n $headerForms = $header->forms ?? null;\n if (is_array($headerForms)) {\n foreach ($headerForms as $name => $form) {\n $form = $this->normalizeForm($form, $name, $rules);\n if ($form) {\n $forms[$form['name']] = $form;\n }\n }\n }\n\n $this->_forms = $forms;\n }\n\n return $this->_forms;\n }",
"public function get1xForms()\n {\n global $wpdb;\n\n $table = $wpdb->prefix . 'iphorm_forms';\n $forms = array();\n\n if ($wpdb->get_var($wpdb->prepare(\"SHOW TABLES LIKE '%s'\", $wpdb->esc_like($table))) == $table) {\n $results = $wpdb->get_results(\"SELECT * FROM \" . $table . \" ORDER BY id ASC\", ARRAY_A);\n\n foreach ($results as $result) {\n $form = maybe_unserialize($result['config']);\n\n if (is_array($form)) {\n $forms[] = $form;\n }\n }\n }\n\n return $forms;\n }",
"public static function getAvailableForms()\n {\n return static::$availableForms;\n }",
"public static function get_forms() {\n\n\t\tif ( is_null( self::$_forms ) ) {\n\t\t\t$form_ids = GFFormsModel::get_form_ids();\n\n\t\t\tif ( empty( $form_ids ) ) {\n\t\t\t\treturn array(\n\t\t\t\t\t'data' => array(),\n\t\t\t\t\t'done' => true,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$forms_by_id = GFFormsModel::get_form_meta_by_id( $form_ids );\n\n\t\t\tself::$_forms = array();\n\t\t\tforeach ( $forms_by_id as $form ) {\n\t\t\t\tself::$_forms[ $form['id'] ] = $form;\n\t\t\t}\n\t\t}\n\n\t\treturn self::$_forms;\n\t}",
"public function getWebForms()\n {\n $formHandle = craft()->request->getParam('formHandle');\n return craft()->webForm->getWebForms($formHandle);\n }",
"public function getForms() {\n $build['replication_unblock_button'] = $this->formBuilder()->getForm('Drupal\\workspace\\Form\\UnblockReplicationForm');\n $build['clear_queue_button'] = $this->formBuilder()->getForm('Drupal\\workspace\\Form\\ClearReplicationQueueForm');\n $build['replication_settings'] = $this->formBuilder()->getForm('Drupal\\replication\\Form\\SettingsForm');\n return $build;\n }",
"protected function GetLoginForms()\n\t{\n\t\t$forms = array();\n\n\t\t$authenticators = Authenticator::get_authenticators();\n\t\tforeach($authenticators as $authenticator) {\n\t\t array_push($forms,\n\t\t\t\t\t\t\t\t call_user_func(array($authenticator, 'get_login_form'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this));\n\t\t}\n\n\t\treturn $forms;\n\t}",
"public static function all()\n {\n return array_merge_recursive(static::$app['request']->input(), static::$app['request']->files->all());\n }",
"static function getAllForms($sort = \"id ASC\") {\n\t\t\t$mod = new BigTreeModule(\"btx_form_builder_forms\");\n\t\t\t\n\t\t\treturn $mod->getAll($sort);\n\t\t}",
"public function get_forms() {\n\t\t\treturn get_posts(\n\t\t\t\tarray(\n\t\t\t\t\t'post_type' => 'wpcf7_contact_form',\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t)\n\t\t\t);\n\t\t}",
"function list_forms(){\n\t\treturn $this->available_forms;\n\t}",
"function searchForms(){\n\t\tif(empty($_GET['q'])) return;\n\t\t$this->load->model('form');\n\t\t$forms = $this->form->getWithNameLike($_GET['q']);\n\t\t$data = array();\n\t\tif(is_array($forms)){\n\t\t\tforeach($forms as $f){\n\t\t\t\t$data[] = array('name'=>$f->name, 'value'=>$f->name);\n\t\t\t}\n\t\t}\n\t\t$this->_jsonresp($data);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates PHP/HTML code for this nodes children. | public function render_children() {
$newline = '<?php echo "\n"; ?>';
$result = '';
$i = 0;
foreach($this->children as $child) {
if($child->render_indent)
$result .= $child->indent();
$result .= $child->render();
if($child->render_newline and ++$i != count($this->children))
$result .= $newline;
}
return $result;
} | [
"public function childrenToHTML(){\n\t\t$ret = \"\";\n\t\tforeach ($this as $child){\n\t\t\t/** @var BBCodeTag $child */\n\t\t\t$ret .= $child->toHTML();\n\t\t}\n\t\treturn $ret;\n\t}",
"protected function emitChildElements(): string {\n\t\t$ret = \"\";\n\n\t\tforeach($this->m_children as $child) {\n\t\t\t$ret .= $child->html();\n\t\t}\n\n\t\treturn $ret;\n\t}",
"public function render() {\n\t\t$children = '';\n\t\tforeach ($this->children as $child) {\n\t\t\t$children .= trim($child->render());\n\t\t} // foreach\n\t\t$output = '<?php '.(empty($this->pre) ? 'echo' : $this->pre).\" {$this->class}::{$this->name}('$children',{$this->args}); ?>\";\n\t\treturn $this->debug($output);\n\t}",
"protected function ChildrenToHtml() {\n $markup = '';\n foreach ($this->widgets as $widget) $markup .= $widget->ToHtml();\n return $markup;\n }",
"public function renderChildren()\n\t{\n\t\treturn implode( '', array_map( '\\Html\\Html::renderNode', $this->children ) );\n\t}",
"function childrenToHtml()\n {\n $ret = '';\n foreach($this->children as $child) {\n if (!is_object($child)) {\n $ret .= $child;\n continue;\n }\n \n $ret .= $child->toHtml();\n }\n return $ret;\n }",
"public function render() {\n\t \n\t if($this->control_structure) {\n\t foreach($this->children as $child)\n\t $child->indent_level --;\n \n\t if($this->control_structure == 'elseif' or $this->control_structure == 'else')\n\t $return = $this->control_structure;\n elseif($this->control_structure == 'foreach') {\n list($array, $other) = handlers\\Tag::quote_safe_explode(' as ', $this->content);\n $array = trim($array);\n $other = trim($other);\n $return = '<?php $__array = ' . $array . '; if(!empty($__array)) { '\n . 'foreach($__array as ' . $other . ') { ?>';\n } else\n $return = '<?php ' . $this->control_structure;\n \n\t switch($this->control_structure) {\n\t case 'if':\n\t case 'elseif':\n\t case 'while':\n\t case 'for':\n\t case 'switch':\n\t $return .= '(' . $this->content . ') { ?>';\n break;\n case 'do':\n case 'else':\n $return .= ' { ?>';\n break;\n case 'case':\n foreach($this->children as $child)\n\t $child->indent_level --;\n $return .= ' ' . $this->content . '; ?>';\n break;\n\t }\n\t \n\t $return .= $this->render_children() . '<?php echo \"\\n\"; ?>';\n\t \n\t if($this->control_structure == 'case');\n elseif($this->control_structure == 'if' or $this->control_structure == 'elseif') {\n $next = $this->next_sibling();\n if($next and get_class($next) == get_class() and\n ($next->control_structure == 'elseif' or $next->control_structure == 'else'))\n $return .= '<?php } ';\n else\n $return .= '<?php } ?>';\n } elseif($this->control_structure == 'foreach') {\n $next = $this->next_sibling();\n if($next and get_class($next) == get_class() and $next->control_structure == 'else')\n $return .= '<?php }} ';\n else\n $return .= '<?php }} ?>';\n } else\n $return .= '<?php } ?>';\n \n return $return;\n\t }\n\t \n\t return '<?php ' . $this->content . '; ?>';\n\t \n\t}",
"public function children() : htmldoc {\n\t\treturn $this->find('*>*');\n\t}",
"public function renderChildren() : string\n {\n if ($this->isVoidElement() || empty($this->children)) {\n return '';\n }\n\n return implode('', $this->children);\n }",
"public function renderChildren()\n\t{\n\t\tif (count($this->children) > 0)\n\t\t{\n\t\t\tforeach ($this->children as $child)\n\t\t\t{\n\t\t\t\tif ($child instanceof View)\n\t\t\t\t{\n\t\t\t\t\t$child->render();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo $child;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function output(){\n echo ($this->showSize ? str_pad($this->size(), 10, ' ', STR_PAD_LEFT) . ' ' : '') . $this->pad($this->depth) . \"{$this->name}\\n\";\n \n if (is_array($this->children) && count($this->children))\n foreach ($this->children as $child)\n $child->output();\n }",
"public function output()\n {\n printf(\"<ul><li>\");\n if (isset($this->link)) {\n printf(\"<a %s>%s</a>\", $this->attr($this->link), $this->label);\n } else {\n printf(\"%s\", $this->label);\n }\n foreach ($this->items as $text) {\n printf(\"<br />%s\", $text);\n }\n $links = array();\n if (count($this->links) != 0) {\n printf(\"<span class=\\\"links\\\">\");\n foreach ($this->links as $name => $attr) {\n $links[] = sprintf(\"<a %s>%s</a>\", $this->attr($attr), $name);\n }\n printf(\"%s</span>\", implode(\", \", $links));\n }\n printf(\"</li>\");\n foreach ($this->childs as $child) {\n $child->output();\n }\n printf(\"</ul>\\n\");\n }",
"private function buildInnerHtml() {\n $build = '';\n if (strlen($this->getText())) {\n $build = ($this->raw) ? $this->getText() : htmlspecialchars($this->getText());\n }\n\n if (!empty($this->children) && is_array($this->children)) {\n // Don't use getChildrens() method, it may not reflect the correct\n // Children hiearchy if object use different pointers!.\n foreach ($this->children as $k => $child) {\n $build .= $child->buildContent();\n unset($child);\n }\n }\n\n return $build;\n }",
"public function render()\n {\n $insert = SimpleRenderer::children($this->children);\n if (empty($insert)) {\n return '';\n } else {\n return \"<p>{$insert}</p>\".PHP_EOL;\n }\n }",
"protected function generate_admin_post_getChildren($child_field) {\n $str_output = '';\n $str_output_2 = '';\n\n $grid_order = array(1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six');\n\n switch (intval($child_field['type'])) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n\n if (intval($child_field['count_children']) >= 0) {\n\n ob_start();\n ?>\n <div id=\"<?php echo $child_field['id']; ?>\" data-typefield=\"<?php echo intval($child_field['type']); ?>\" data-iscontainer=\"1\" class=\"zgpb-gridsytem-box zgpb-field-template zgpb-gridsystem-<?php echo $grid_order[intval($child_field['type'])]; ?>\">\n <div class=\"sfdc-container-fluid\">\n <div class=\"sfdc-row\">\n <?php\n $str_output .= ob_get_contents();\n ob_end_clean();\n if (isset($child_field['inner'])) {\n\n $count_str = 1;\n $count_total = count($child_field['inner']);\n foreach ($child_field['inner'] as $key => $value) {\n\n $str_output .= '<div class=\"zgpb-fl-gs-block-style sfdc-col-md-' . $value['cols'] . '\" data-zgpb-blocknum=\"' . $value['num_tab'] . '\" data-zgpb-width=\"\" data-zgpb-blockcol=\"' . $value['cols'] . '\">';\n $str_output .= '<div class=\"zgpb-items-container zgpb-fl-gs-block-inner\">';\n\n\n if (!empty($value['children'])) {\n foreach ($value['children'] as $key2 => $value2) {\n //get field\n $get_data = array();\n \n if (isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) {\n $get_data = $this->generate_admin_post_getChildren($value2);\n $str_output .= $get_data['output_html'];\n } else {\n $get_data = $this->generate_admin_post_getField($value2);\n $str_output .= $get_data['output_html'];\n }\n \n }\n }\n\n $str_output .= '</div>';\n\n if ($count_str < $count_total) {\n ob_start();\n ?>\n <div class=\"zgpb-fl-gridsystem-opt\">\n <div data-zgpb-side=\"1\" class=\"zgpb-fl-gd-drag-line zgpb-fl-gd-drag-line-right\">\n <div class=\"zgpb-fl-gd-opt-icon-handler\"></div>\n </div>\n </div>\n <?php\n $str_output .= ob_get_contents();\n ob_end_clean();\n } else {\n ob_start();\n ?>\n <div class=\"zgpb-fl-gridsystem-opt\"></div>\n <?php\n $str_output .= ob_get_contents();\n ob_end_clean();\n }\n\n $str_output .= '</div>';\n $count_str++;\n }\n }\n\n ob_start();\n ?>\n </div>\n </div>\n </div>\n <?php\n $str_output .= ob_get_contents();\n ob_end_clean();\n }\n break;\n case 31:\n /* panel */\n\n break;\n default:\n break;\n }\n $return = array();\n $return['output_html'] = $str_output;\n $return['output_css'] = $str_output_2;\n\n return $return;\n }",
"public function children();",
"protected function transformChildren() {\n foreach ($this->children as $objectId => $DUMMY) {\n $this->content = str_replace(\n '<' . $objectId . ' />', $this->children[$objectId]->transform(), $this->content\n );\n }\n }",
"function wpbst_children() {\n\t\tglobal $post; // Setup the global variable $post\n\t\tif ( is_page() && $post->post_parent ) // Make sure we are on a page and that the page is a parent\n\t\t\t$kiddies = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );\n\t\telse\n\t\t\t$kiddies = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );\n\t\t \n\t\tif ( $kiddies ) {\n\t\t\t$html .= '<div class=\"panel panel-default\">';\n\t\t\t$html .= '<div class=\"panel-heading\">Further Reading</div>';\n\t\t\t$html .= '<div class=\"panel-body\">';\n\t\t\t$html .= '<ul class=\"nav nav-pills\">';\n\t\t\t$html .= $kiddies;\n\t\t\t$html .= '</ul>';\n\t\t\t$html .= '</div></div>';\n\t\t\techo $html;\n\t\t}\n\t}",
"protected function parseChild()\n {\n return $this->prepareTpl(false);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function copyFiles Copies Pass files to pass directory | private function copyFiles($path,$passname) {
if($this->logopath){
copy($this->logopath,$path.$passname."/logo.png");
}
if($this->logohdpath){
copy($this->logohdpath,$path.$passname."/logo@2x.png");
}
if($this->iconpath){
copy($this->iconpath,$path.$passname."/icon.png");
}
if($this->iconpathhd){
copy($this->iconpathhd,$path.$passname."/icon@2x.png");
}
if($this->background){
copy($this->background,$path.$passname."/background.png");
}
if($this->background_hd){
copy($this->background_hd,$path.$passname."/background@2x.png");
}
if($this->thumbnail){
copy($this->thumbnail,$path.$passname."/thumbnail.png");
}
if($this->thumbnail_hd){
copy($this->thumbnail_hd,$path.$passname."/thumbnail@2x.png");
}
if($this->strip){
copy($this->strip,$path.$passname."/strip.png");
}
if($this->strip_hd){
copy($this->strip_hd,$path.$passname."/strip@2x.png");
}
} | [
"protected function copyFiles()\n {\n foreach($this->directories as $dir) {\n $this->createDirectory($dir);\n\n if (! $this->includeFiles($dir))\n continue;\n\n $files = $this->getFileList($this->getSrc($dir));\n foreach($files as $file) {\n $this->copyFile($dir, $file);\n }\n }\n }",
"abstract function copyFile($source_file, $dest_file);",
"public function copyFiles(): Result {\n\t\t$w3c_core = $this->root_folder . self::W3C_TESTS . '/level1/core/files/*.html';\n\t\t$w3c_html = $this->root_folder . self::W3C_TESTS . '/level1/html/files/*.html';\n\n\t\t$cp_dirs = [\n\t\t\t$w3c_core => $this->root_folder . '/tests/' . self::W3C . '/Level1/Core/files/',\n\t\t\t$w3c_html => $this->root_folder . '/tests/' . self::W3C . '/Level1/Html/files/' ];\n\n\t\treturn $this->taskFlattenDir( $cp_dirs )->run();\n\t}",
"function copy_files($path_src, $path_out)\n{\n create_dir($path_out);\n $files = glob(\"$path_src/*\");\n\n foreach ($files as $file) {\n if (is_file($file)) {\n copy_file($path_src, $path_out, basename($file));\n }\n }\n}",
"function from_demo_copy($path_to_root, $files, $demo_dir = 'demo') {\n foreach ($files as $file) {\n copy($path_to_root . \"/$demo_dir/$file\", $path_to_root . \"/$file\");\n }\n}",
"function copyFiles($p_sourcedir, $p_destdir, $p_files)\r\n\t{\r\n\t\tif(is_array($p_files) && count($p_files) > 0)\r\n\t\t{\r\n\t\t\tforeach($p_files as $_file)\r\n\t\t\t{\r\n\t\t\t\t$filesource\t= $this->pathName($p_sourcedir) . $_file;\r\n\t\t\t\t$filedest\t= $this->pathName($p_destdir) . $_file;\r\n\t\t\t\tif($this->isWindows())\r\n\t\t\t\t{\r\n\t\t\t\t\t$filesource = str_replace('/','\\\\',$filesource);\r\n\t\t\t\t\t$filedest\t= str_replace('/','\\\\',$filedest);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$filesource = str_replace('\\\\','/',$filesource);\r\n\t\t\t\t\t$filedest\t= str_replace('\\\\','/',$filedest);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(file_exists($filesource))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!(copy($filesource,$filedest) && chmod($filedest, 0777)))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->setError(1,\"Failed to copy file: $filesource to $filedest\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->setError(1,\"File $filesource does not exist!\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function copy($filepath);",
"protected function copyFiles()\n {\n $skeleton_finder = new SkeletonFinder();\n $source_path = $skeleton_finder->findByName($this->skeleton_name)->getRealpath();\n\n $finder = $this->getFinderForFilesToCopy($source_path);\n\n foreach ($finder as $file) {\n $target_file_path = $this->target_path . DIRECTORY_SEPARATOR . $file->getRelativePathname();\n $target_file_path = $this->twig_string_renderer->renderToString($target_file_path, $this->data);\n\n $this->fs->copy($file->getRealpath(), $target_file_path, $this->overwrite_enabled);\n\n $msg = '[copy] ' . $file->getRealpath() . ' => ' . $target_file_path;\n\n if ($this->reporting_enabled) {\n $this->report[] = $msg;\n }\n }\n }",
"private function copyFile($arguments) {\n if ($arguments['sourceExtension']) {\n $sourceExtensionDirectory = \\SAV\\SavLibraryKickstarter\\Configuration\\ConfigurationManager::getExtensionDir($arguments['sourceExtension']);\n } else {\n $sourceExtensionDirectory = \\SAV\\SavLibraryKickstarter\\Configuration\\ConfigurationManager::getExtensionDir('sav_library_kickstarter');\n }\n if ($arguments['destinationExtension']) {\n $destinationExtensionDirectory = \\SAV\\SavLibraryKickstarter\\Configuration\\ConfigurationManager::getExtensionDir($arguments['destinationExtension']);\n } else {\n $destinationExtensionDirectory = \\SAV\\SavLibraryKickstarter\\Configuration\\ConfigurationManager::getExtensionDir('sav_library_kickstarter');\n }\n if (!@copy($sourceExtensionDirectory . $arguments['source'], $destinationExtensionDirectory . $arguments['destination'])) {\n throw new RuntimeException('Copy failed.');\n }\n }",
"public function copyFile( $source, $destination );",
"function recurse_copy($src,$dst) { \n\t\t\t$dir = opendir($src); \n\t\t\t@mkdir($dst); \n\t\t\twhile(false !== ( $file = readdir($dir)) ) { \n\t\t\t\tif (( $file != '.' ) && ( $file != '..' )) { \n\t\t\t\t\tif ( is_dir($src . '/' . $file) ) { \n\t\t\t\t\t\trecurse_copy($src . '/' . $file,$dst . '/' . $file); \n\t\t\t\t\t} \n\t\t\t\t\telse { \n\t\t\t\t\t\tcopy($src . '/' . $file,$dst . '/' . $file); \n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t} \n\t\t\tclosedir($dir); \n\t\t}",
"public function copyFilesTo()\r\n {\r\n // check 'FROM' permission\r\n $from_gid = $this->input->get_post('gid') ?: '-1';\r\n if ( ! $this->_is_group_viewer($from_gid))\r\n {\r\n $this->_outputPermissionDeniedJSON();\r\n return;\r\n }\r\n // check 'TO' permission\r\n $to_gid = $this->input->get_post('to_gid') ?: '-1';\r\n if ( ! $this->_is_group_editor($to_gid))\r\n {\r\n $this->_outputPermissionDeniedJSON();\r\n return;\r\n }\r\n\r\n // check crumb\r\n $this->_check_path_crumb();\r\n\r\n // insert userlog\r\n $to_access_full_path = $this->_get_access_full_path($to_gid, $this->_get_path('to_path'));\r\n $details = lang('miiicloud-files-userlog_copy_to', NULL, array('path' => $to_access_full_path));\r\n $this->_insert_userlog(Userlog_model::FILE_COPY, $details);\r\n\r\n $from_access_full_path = $this->_get_access_full_path();\r\n $filenames = $this->input->get_post('filenames');\r\n $filenames_arr = json_decode($filenames);\r\n $rtn = $this->files_model->copy_files_to($from_access_full_path, $to_access_full_path, $filenames_arr);\r\n $format = $this->input->get_post('format');\r\n if ($format == 'json' || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'))\r\n {\r\n $this->_outputJSON($rtn);\r\n }\r\n\r\n // return to folder\r\n $folder_url = '/files?' . $this->files_model->build_query_string();\r\n header('Location: ' . $folder_url);\r\n }",
"function wpsc_recursive_copy( $src, $dst ) {\n\t$dir = opendir( $src );\n\t@mkdir( $dst );\n\twhile ( false !== ( $file = readdir( $dir )) ) {\n\t\tif ( ( $file != '.' ) && ( $file != '..' ) ) {\n\t\t\tif ( is_dir( $src . '/' . $file ) ) {\n\t\t\t\twpsc_recursive_copy( $src . '/' . $file, $dst . '/' . $file );\n\t\t\t} else {\n\t\t\t\t@ copy( $src . '/' . $file, $dst . '/' . $file );\n\t\t\t}\n\t\t}\n\t}\n\tclosedir( $dir );\n}",
"abstract protected function copyFile($sourcePath, $destPath, $name, $destName = '');",
"public function testCopy()\n {\n // Create temporary file\n $path = tempnam(sys_get_temp_dir(), 'test');\n $fileName = basename($path);\n\n // Create test dir\n $testDir = sys_get_temp_dir().'/testDir/';\n if (!$this->fileService->exists($testDir)) {\n $this->fileService->mkDir($testDir);\n }\n\n // Try to null source file\n $this->fileService->copyPath($path.'TEST', $testDir.$fileName);\n\n // Perform test\n $this->assertFileNotExists($testDir.$fileName, 'File service copy file failed - Copied file not found');\n\n // Move file to a new dir\n $this->fileService->copyPath($path, $testDir.$fileName);\n\n // Perform test\n $this->assertFileExists($testDir.$fileName, 'File service copy file failed - Copied file not found');\n\n // Create test dir\n $testDir2 = sys_get_temp_dir().'/testDir2/';\n if (!$this->fileService->exists($testDir2)) {\n $this->fileService->mkDir($testDir2);\n }\n\n // Copy whole dir with new file to a second new dir\n $this->fileService->copyPath($testDir, $testDir2);\n\n // Perform test\n $this->assertFileExists($testDir2.$fileName, 'File service copy folder dir failed - Copied file not found');\n\n // Create temporary file\n $path2 = tempnam(sys_get_temp_dir(), 'test');\n $fileName2 = basename($path2);\n\n // Copy whole dir to a file\n $this->fileService->copyPath(dirname($path2), $testDir2.$fileName2);\n\n // Perform test\n $this->assertFileNotExists($testDir2.$fileName2, 'File service copy file to folder failed - Copied file found');\n }",
"function copy_file ($from_file,$to_file) {\n \n global $CFG;\n \n if (is_file($from_file)) {\n umask(0000);\n if (copy($from_file,$to_file)) {\n chmod($to_file,$CFG->filepermissions);\n return true;\n }\n return false;\n }\n else if (is_dir($from_file)) {\n return copy_dir($from_file,$to_file);\n }\n else{\n return false;\n }\n}",
"protected function copyConfigFiles()\n\t{\n\t\t$aFiles = $this->getConfigFiles();\n\n\t\tforeach ($aFiles as $aFile)\n\t\t{\n\t\t\t$this->checklist->addItem(\n\t\t\t\t'config_file_'.$aFile['basename'],\n\t\t\t\tcopy(\n\t\t\t\t\t$this->root().'/_install/'.$aFile['filename'],\n\t\t\t\t\tOKT_CONFIG_PATH.'/'.$aFile['filename']\n\t\t\t\t),\n\t\t\t\t'Copy config file '.$aFile['filename'],\n\t\t\t\t'Cannot copy config file '.$aFile['filename']\n\t\t\t);\n\t\t}\n\t}",
"public static function recurse_copy($src,$dst) { \n $dir = opendir($src); \n @mkdir($dst); \n chmod($dst,0777);\n while(false !== ( $file = readdir($dir)) ) { \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) { \n self::recurse_copy($src . '/' . $file,$dst . '/' . $file); \n } \n else { \n copy($src . '/' . $file,$dst . '/' . $file); \n chmod($dst . '/' . $file,0777);\n } \n } \n } \n closedir($dir); \n }",
"function smartCopy( $source, $dest, $options = array('folderPermission' => 0777, 'filePermission' => 0777) )\n{\n $result=false;\n $file_paths = array();\n\n if (is_file($source)) {\n if ($dest[strlen($dest)-1]=='/') {\n if (!file_exists($dest)) {\n cmfcDirectory::makeAll($dest,$options['folderPermission'],true);\n }\n $__dest=$dest.\"/\".basename($source);\n } else {\n $__dest=$dest;\n }\n\n $f = \"\";\n $tmp = $__dest;\n $sp = array_filter(explode('/', $tmp), 'strlen');\n\n if ($dest[strlen($dest)-1]!='/') {\n array_pop($sp);\n }\n\n foreach($sp as $sub) {\n $f .= \"/\" . $sub;\n if(!is_dir($f)) {\n mkdir($f);\n }\n }\n\n $result=copy($source, $__dest);\n if($result)\n $file_paths[] = $__dest;\n chmod($__dest,$options['filePermission']);\n\n } elseif(is_dir($source)) {\n if ($dest[strlen($dest)-1]=='/') {\n if ($source[strlen($source)-1]=='/') {\n //Copy only contents\n } else {\n //Change parent itself and its contents\n $dest=$dest.basename($source);\n @force_mkdir($dest);\n chmod($dest,$options['filePermission']);\n }\n } else {\n if ($source[strlen($source)-1]=='/') {\n //Copy parent directory with new name and all its content\n @force_mkdir($dest,$options['folderPermission']);\n chmod($dest,$options['filePermission']);\n } else {\n //Copy parent directory with new name and all its content\n @force_mkdir($dest,$options['folderPermission']);\n chmod($dest,$options['filePermission']);\n }\n }\n\n $files=scandir($source);\n foreach($files as $file)\n {\n if($file!=\".\" && $file!=\"..\")\n {\n $file_paths = array_merge($file_paths, smartCopy($source.\"/\".$file, $dest.\"/\".$file, $options));\n }\n }\n\n } else {\n $result=false;\n }\n return $file_paths;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saved changes are stored in the bookindexedits table. this redoes the saved edits for the whole book. | function savedChangesAction(){
$this->_helper->viewRenderer->setNoRender();
$db = Zend_Registry::get('db');
$numChanges = 0;
$sql = "SELECT * FROM book_index_edits ";
$resultA = $db->fetchAll($sql, 2);
foreach($resultA as $rowA){
$firstWord = $rowA["word_a"];
$secondWord = $rowA["word_b"];
$sql = "SELECT * FROM book_index WHERE word = '$firstWord' ";
$resultB = $db->fetchAll($sql, 2);
if($resultB){
$loopCount = 0;
foreach($resultB as $rowB){
$firstWordId = $rowB['id'];
$firstWordPage = $rowB['page'];
$firstWordCount = $rowB["pageCount"];
echo "<br/>WordA: ".$firstWord." <strong>".$numChanges."<strong>";
if($loopCount == 0){
$loopCount++;
$sql = "SELECT * FROM book_index WHERE word = '$secondWord' AND page = $firstWordPage LIMIT 1;";
echo "<br/>".$sql;
$resultC = $db->fetchAll($sql, 2);
if($resultC){
$secondWordID = $resultC[0]['id'];
$secondWordCount = $resultC[0]["pageCount"];
$data = array("word" => $firstWord.$secondWord,
"pageCount" => $firstWordCount + $secondWordCount
);
$where = array();
$where[] = "id = $firstWordId ";
$db->update("book_index", $data, $where);
unset($where);
$where = array();
$where[] = "id = $secondWordID ";
$db->delete("book_index", $where);
$numChanges = $numChanges + 1;
}
}//end case for looking on the same page
else{
$loopCount++;
$checkSecondID = $firstWordId + 1;
$sql = "SELECT * FROM book_index WHERE word = '$secondWord' AND id = $checkSecondID LIMIT 1;";
echo "<br/><em>".$sql."</em>";
$resultC = $db->fetchAll($sql, 2);
if($resultC){
$secondWordID = $resultC[0]['id'];
$secondWordCount = $resultC[0]["pageCount"];
$data = array("word" => $firstWord.$secondWord,
"pageCount" => $firstWordCount + $secondWordCount
);
$where = array();
$where[] = "id = $firstWordId ";
$db->update("book_index", $data, $where);
unset($where);
$where = array();
$where[] = "id = $secondWordID ";
$db->delete("book_index", $where);
$numChanges = $numChanges + 1;
}
}
}
}
}//end loop resultA
$sql = "SELECT * FROM book_index WHERE word = '$firstWord' ";
$result = $db->fetchAll($sql, 2);
foreach($result as $row){
$firstWordId = $row['id'];
$firstWordCount = $row['pageCount'];
$testSecondId = $firstWordId + 1;
$sql = "SELECT * FROM book_index WHERE id = $testSecondId LIMIT 1";
$resultB = $db->fetchAll($sql, 2);
if($resultB[0]["word"] == $secondWord){
$secondWordCount = $resultB[0]["pageCount"];
$data = array("word" => $firstWord.$secondWord,
"pageCount" => $firstWordCount + $secondWordCount
);
$where = array();
$where[] = "id = $firstWordId ";
$db->update("book_index", $data, $where);
unset($where);
$where = array();
$where[] = "id = $testSecondId ";
$db->delete("book_index", $where);
$numChanges = $numChanges + 1;
}
}
$pageURI = "http://penelope2.oc/pdf/review?page=1&numChanges=".$numChanges;
//header('Location: '.$pageURI);
} | [
"public function testUpdateBook()\n {\n }",
"public function modifyBook($book);",
"public function save() {\n\t\tif(!$this->hasPermission(\\OCP\\PERMISSION_UPDATE)) {\n\t\t\tthrow new Exception(self::$l10n->t('You don\\'t have permissions to update the address book.'), 403);\n\t\t}\n\t}",
"public function editAction() { \t \n \t$book = $this->_booksTable->find($this->_getParam('edit'))->current(); \n \t$this->_form->populate($book->toArray());\t\n \t$this->view->form = $this->_form;\n \t$this->view->book = $book;\n }",
"public function modifyBook($book)\r\n\t{\r\n\t\t$idx = $this->getBookIndexById($book->id);\r\n\t\tif ($idx > -1)\r\n\t\t{\r\n\t\t\t$_SESSION['BookList'][$idx]->title = $book->title;\r\n\t\t\t$_SESSION['BookList'][$idx]->author = $book->author;\r\n\t\t\t$_SESSION['BookList'][$idx]->description = $book->description;\r\n\t\t}\r\n\t}",
"function save() {\n\t\tif($this->save_all) {\n\t\t\tfor($i=0; $i<$this->record_count; $i++) {\n\t\t\t\t$this->save_update_record($this->record);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor($i=$this->record_count; $i<count($this->records); $i++) {\n\t\t\t$this->save_new_record($this->records[$i]);\n\t\t}\n\t\t$this->record_count = count($this->records);\n\t}",
"public function modify($book)\r\n {\r\n\r\n $sql = \"UPDATE LIBRO SET cod_documento = \" . $book->getCod_documento() . \",\r\n fecha_publicacion = '\" . $book->getFecha_publicacion() . \"',\r\n isbn = '\" . $book->getIsbn() . \"' ,\r\n total_paginas= \" . $book->getTotal_paginas() . \"\r\n where cod_documento = \" . $book->getCod_documento() . \";\";\r\n pg_Exec($this->conexion, $sql);\r\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"book\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $book = Book::findFirstByid($id);\n\n if (!$book) {\n $this->flash->error(\"book does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"book\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $book->setid($this->request->getPost(\"id\"));\n $book->settitulo($this->request->getPost(\"titulo\"));\n $book->setautor($this->request->getPost(\"autor\"));\n \n\n if (!$book->save()) {\n\n foreach ($book->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"book\",\n 'action' => 'edit',\n 'params' => [$book->getId()]\n ]);\n\n return;\n }\n\n $this->flash->success(\"book was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"book\",\n 'action' => 'index'\n ]);\n }",
"static function editBook($bookId, $newTitle, $newPrice, $newAuthor, $newYear){\n // $originInfo = null;\n // $str = null;\n // $listBook = Book::getListFromFile();\n // foreach ($listBook as $value) {\n // # code...\n // if($bookId == $value->id){\n // $tempArr = [ $value->title, $value->price, $value->author, $value->year];\n // $originInfo = $value->id . \"#\" . $value->title . \"#\" . $value->price . \"#\" . $value->author . \"#\" . $value->year;\n // for($i = 0; $i < 4; $i++) {\n // # code...\n // if($changedInfo[$i] == \"\")\n // $changedInfo[$i] = $tempArr[$i];\n // }\n // break; \n // }\n // }\n\n // $str = $bookId . \"#\" . $changedInfo[0] . \"#\" . $changedInfo[1] . \"#\" . $changedInfo[2] . \"#\" . $changedInfo[3];\n // $contents = file_get_contents(\"data/book.txt\");\n // $contents = str_replace($originInfo, $str, $contents);\n // file_put_contents(\"data/book.txt\", $contents);\n $con= Book::connect();\n $sql = \"UPDATE book SET Title='$newTitle', Author='$newAuthor', Price='$newPrice', Year='$newYear' WHERE ID=$bookId\";\n if($con->query($sql)==true){\n echo \"Cập nhật thành công\";\n }else {\n echo \"Cập nhật thất bại\";\n }\n }",
"function save_book(){\r\n $db = new Database();\r\n $con = $db->conect_db();\r\n\r\n //check_record_Exists() return true if record exist, and false otherwise\r\n if ($db->check_record_Exists(\"bookisbn, userid\", \"book\", \"where bookisbn = '\".\"$this->bookisbn\".\"' and userid = '\".\"$this->userid\".\"'\") === false) {\r\n $book_infos = array(\"booknumb\" => \"'$this->booknumb'\", \"bookisbn\" => \"'$this->bookisbn'\", \r\n \"bookauthor\" => \"'$this->bookauthor'\", \"booktitle\" => \"'$this->booktitle'\",\r\n \"bookEdNumb\" => \"'$this->bookEdNumb'\", \"bookpublisher\" => \"'$this->bookpublisher'\",\r\n \"booklanguage\" => \"'$this->booklanguage'\", \"bookprice\" => \"'$this->bookprice'\",\r\n \"bookquality\" => \"'$this->bookquality'\",\r\n \"bookquantity\" => \"'$this->bookquantity'\", \"bookcreatedate\"=>\"'\".date(\"Y-m-d H:i:s\",time()).\"'\",\r\n \"catid\" => \"'$this->catid'\", \"userid\"=> \"'$this->userid'\"\r\n );\r\n $this->booknumber = $db->insert($book_infos, 'book');\r\n $this->bookcreatedate = time();\r\n return $this->booknumber;\r\n }else{\r\n //else if the isbn exist alredy, the book will just be updated\r\n $book_infos = array( \"bookauthor\" => \"'$this->bookauthor'\", \"booktitle\" => \"'$this->booktitle'\",\r\n \"bookEdNumb\" => \"'$this->bookEdNumb\", \"bookpublisher\" => \"'$this->bookpublisher'\", \r\n \"booklanguage\" => \"'$this->booklanguage'\", \"bookprice\" => \"'bookprice'\",\r\n \"bookquality\" => \"'$this->bookquality'\", \"bookquantity\" => \"'$this->bookquantity'\",\r\n \"bookdescription\"=> \"'$this->bookdescription'\", \"bookcreatedate\"=>\"'\".date(\"Y-m-d H:i:s\",time()).\"'\",\r\n \"catid\" => \"'$this->catid'\", \"userid\"=> \"'$this->userid'\"\r\n );\r\n\r\n //remainder about update() prototype in our Database.class.php file\r\n //true function update($array_data, $table, $where= \"\", $low_priority = \"\", $ignore = \"\", $limit_numb = \"\")\r\n $db->update($book_infos, 'book', \"where isbn = '\".\"$this->bookisbn\".\"' and userid = '\".\"$this->userid\".\"'\");\r\n return $this->id;\r\n }\r\n \r\n }",
"public function update_indexables()\n {\n }",
"abstract public function modifyBook($book);",
"public function reIndex()\n\t{\n\t\t$counter = 0;\n\t\t\n\t\tforeach($this as $questionHint)\n\t\t{\n\t\t\t/* @var $questionHint ilAssQuestionHint */\n\t\t\t\n\t\t\t$questionHint->setIndex(++$counter);\n\t\t\t$questionHint->save();\n\t\t}\n\t}",
"function musicEditSave() {\n\t\t$this->save();\n\t\ttry { \n\t\t\t//$this->setTags($this->getTags(). \" \".$this->getArtistID().\" \". $this->getTrackName());\n\t\t\t//momusicTag::getInstance(momusicTags::getInstance($this->getID())->getTagID())->setName($this->getTags())->save();;\n\t\t} catch ( Exception $e) {\n\t\t\tsystemLog::message($e);\n\t\t}\t\n\t}",
"function save() {\n $query = $GLOBALS['DB']->exec(\"INSERT INTO books (book_name)\n VALUES ('{$this->getBookName()}') RETURNING id;\");\n $this->id = $GLOBALS['DB']->lastInsertId('books_id_seq');\n }",
"abstract public function reindexStates();",
"public function updateRecordsInIndexer() {\n\t\tforeach($this->tempArrayForUpdatingExistingRecords as $query) {\n\t\t\t$GLOBALS['TYPO3_DB']->sql_query($query['set']);\n\t\t\t$GLOBALS['TYPO3_DB']->sql_query($query['execute']);\n\t\t}\n\t\t$this->tempArrayForUpdatingExistingRecords = array();\n\t}",
"public function editBook()\n {\n if (isset($_POST)){\n $toEdit = array(\n 'id'=> $_POST['id'],\n 'titre'=>$_POST['titre'],\n 'auteur'=>$_POST['auteur'],\n 'edition'=>$_POST['edition'],\n 'description'=>$_POST['description']\n );\n\n if ($_FILES['upfile']['tmp_name'] !== ''){\n $toEdit['couverture'] = 'assets/img/livres/'.$_POST['id'].'.'.$this->getExt($_FILES['upfile']['type']);\n }\n\n echo ($this->livre->set($toEdit) && $this->theme->delBook(array('id_livre'=>$_POST['id'])) && $this->theme->assignThemeToBook($_POST['id'],explode(';',$_POST['themes'])) &&\n ($_FILES['upfile']['tmp_name'] !== '')? ($this->saveFile('assets/img/livres/', $_POST['id'], true) === self::SUCCESS)? true : false : true)?\n self::SUCCESS : self::FAILURE;\n }else{\n echo self::FAILURE;\n }\n }",
"public function doReindex()\n {\n $this->pushToSolr($this->owner);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the allowed events for this widget | protected static function allowedEvents()
{
return array();
} | [
"public function getValidEvents()\n\t{\n\t\treturn array('change', 'create', 'slide', 'start', 'stop');\n\t}",
"final public function allowsEvents() {\n\t\treturn $this->_allowEvents;\n\t}",
"public function getValidEvents()\n\t{\n\t\treturn array('create', 'selected', 'selecting', 'start', 'stop', 'unselected', 'unselecting');\n\t}",
"public function getEventActions()\n {\n return $this->allowedEventActions;\n }",
"public abstract function getSupportedEventTypes();",
"public function getTriggeredEvents();",
"protected function allowedEventNames(): array\n {\n return ['start', 'end', 'connection', 'message', 'close'];\n }",
"public function getEvents();",
"public function getEventHandlers()\n {\n return self::$events;\n }",
"public final function getInstanceEvents(){\n return $this->_instance_events;\n }",
"public static final function getEvents(){\n if (!isset(static::$_events[static::className()])){\n static::$_events[static::className()] = [];\n }\n return static::$_events[static::className()];\n }",
"public function getAvailableEvents() {\n\t\treturn $this->availableEvents;\n\t}",
"function getAllEvents() {\n\n $this->events = $this->getEvents();\n //If plugin adds new events for an already defined type\n Plugin::doHook('item_get_events', $this);\n\n return $this->events;\n }",
"protected static function recordableEvents() {\n if(isset(static::$recordableEvents)) {\n return static::$recordableEvents;\n }\n\n return ['created', 'updated'];\n }",
"public function events()\n {\n return array(\n 'onAfterEmbeddedDocsInit' => 'afterEmbeddedDocsInit',\n 'onBeforeToArray' => 'beforeToArray',\n 'onAfterToArray' => 'afterToArray',\n 'onBeforeValidate' => 'beforeValidate',\n 'onAfterValidate' => 'afterValidate',\n );\n }",
"public function getMonitorEvents()\n {\n return array(\n \"REQUEST\" => array('handleRequestEvent',2),\n \"CONTROLLER\" => array('handleControllerEvent',0)\n );\n }",
"public function getCompatibleEvents()\n {\n return [\n TaskModel::EVENT_CLOSE,\n TaskModel::EVENT_OPEN\n ];\n }",
"function GetEventListeners()\n\t{\n\t\treturn\n\t\t\tarray (\n\t\t\t\tarray (\n\t\t\t\t\t'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATETEXTMENULINKS',\n\t\t\t\t\t'trigger_details' => array (\n\t\t\t\t\t\t'Addons_checkpermissions',\n\t\t\t\t\t\t'GetTextMenuItems',\n\t\t\t\t\t),\n\t\t\t\t\t'trigger_file' => '{%IEM_ADDONS_PATH%}/checkpermissions/checkpermissions.php'\n\t\t\t\t),\n\t\t\t);\n\t}",
"public static function validEventsProvider()\n\t{\n\t\t$validation_start_event = new OLPBlackbox_Event(\n\t\t\tOLPBlackbox_Event::EVENT_VALIDATION_START,\n\t\t\tarray(OLPBlackbox_Event::ATTR_SENDER => OLPBlackbox_Event::TYPE_TARGET)\n\t\t);\n\t\t$validation_end_event = new OLPBlackbox_Event(\n\t\t\tOLPBlackbox_Event::EVENT_VALIDATION_START,\n\t\t\tarray(OLPBlackbox_Event::ATTR_SENDER => OLPBlackbox_Event::TYPE_TARGET)\n\t\t);\n\t\t\n\t\treturn array(\n\t\t\tarray(array($validation_start_event, $validation_end_event),)\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modifica el valor correspondiente a idTipoUsuario | public function setIdTipoUsuario($idTipoUsuario){
$this->idTipoUsuario = $idTipoUsuario;
} | [
"public function modificar($id_tipo, $nombre) {\n $sql = \"SELECT * FROM `tipocouch` WHERE `idTipo` = $id_tipo and `nombreTipo` = '$nombre'\";\n $consulta = $consulta = $this->db->query($sql);\n $cantidad = $consulta->num_rows();\n if ($cantidad == 1) {\n return FALSE;\n } else {\n $query = \"SELECT idTipo FROM tipocouch WHERE '$nombre' = UPPER(nombreTipo)\";\n $result = $this->db->query($query);\n $cant = $result->num_rows();\n if($cant == 1) {\n return 22;\n } else {\n $sql = \"UPDATE `tipocouch` SET `nombreTipo` = '$nombre' WHERE `idTipo` = $id_tipo\";\n $consulta = $this->db->query($sql);\n return 7;\n } \n }\n }",
"public function updateTypeUser($conn, $id, $tipo){\n $sth = $conn->prepare('update utenti set tipo=:type where id=:id');\n $sth->bindParam(':id', $id, PDO::PARAM_INT);\n $sth->bindParam(':type', $tipo, PDO::PARAM_STR);\n $sth->execute();\n }",
"public function getIdtipoUsuario(){\n return $this->idtipoUsuario;\n }",
"public function getIdTipoUsuario(){\n return $this->idTipoUsuario;\n }",
"public function alterarUsuario() {\r\n // Carrega variavel com o id contido na url\r\n $idUsuario = $this->uri->segment(3);\r\n\r\n if ($idUsuario <> NULL) {\r\n $user = $_SESSION['userLogin'];\r\n $data = ['base_url' => $this->config->base_url(),\r\n 'tiposPerfis' => $this->perfil_model->get_tiposPerfil_all()->result(),\r\n 'usuario' => $this->usuario_model->get_usuario_byid($idUsuario)->row()];\r\n\r\n $this->twig->display('admin/alterarUsuario', $data);\r\n } else {\r\n redirect('admin/listarUsuario', 'refresh');\r\n }\r\n }",
"public function modificar ($pk, $objeto) {\n $db = new Database();\n //Guardar los datos del objeto $pk antes de modificar\n if ($this->exists($pk)){\n $datos = $this->consultar($pk);\n\t\t\t\n $oldnombre_usuario = $datos['nombre_usuario'];\n $newnombre_usuario = $objeto->nombre_usuario;\n\t\t\n if ($oldnombre_usuario != $newnombre_usuario){\n $sql = 'UPDATE Usuario SET nombre_usuario=\\''. $newnombre_usuario . '\\' WHERE dni = \\'' . $pk . '\\'' ;\n\n $db->consulta($sql) or die('ERROR: No se ha podido modificar el nombre de usuario');\n }\n\t\t\n $oldcorreo_usuario = $datos['correo_usuario'];\n $newcorreo_usuario = $objeto->correo_usuario;\n\t\t\n if ($oldcorreo_usuario != $newcorreo_usuario){\n $sql = 'UPDATE Usuario SET correo_usuario=\\''. $newcorreo_usuario . '\\' WHERE dni = \\'' . $pk . '\\'' ;\n\n $db->consulta($sql) or die('ERROR: No se ha podido modificar el correo del usuario');\n }\n\t\t\t\t\t\n\t\t\t\t\t\t$oldtipo_usuario = $datos['tipo_usuario'];\n $newtipo_usuario = $objeto->tipo_usuario;\n\t\t\n if ($oldtipo_usuario != $newtipo_usuario){\n $sql = 'UPDATE Usuario SET tipo_usuario=\\''. $newtipo_usuario . '\\' WHERE dni = \\'' . $pk . '\\'' ;\n\n $db->consulta($sql) or die('ERROR: No se ha podido modificar el tipo_usuario');\n }\n\n $result = true;\n \n $oldPass = $datos['password'];\n $newPass = $objeto->password;\n\n if (($oldPass != $newPass) && ($newPass != \"d41d8cd98f00b204e9800998ecf8427e\")){\n $result = $this->setpassword($oldPass, $newPass, $pk);\n }\n \n $db->desconectar();\n return $result;\n }else {\n return false;\n }\n }",
"public function actualizarTipoResiduo($tipoResiduo){\n //Insertar provincia se invoca al metodo en datos\n $this->tipoResiduoAccesoDatos->conectar();\n $resultado = $this->tipoResiduoAccesoDatos->actualizarTipoResiduo($tipoResiduo);\n $this->tipoResiduoAccesoDatos->cerrarConexion();\n return $resultado;\n }",
"public function modificar(){\n\t\t$objDatos = new clsDatos();\n\t\t$sql = \"UPDATE usuario SET(id_per='$this->id_per',id_car='$this->id_car',fot_usu='$this->fot_usu',nus_usu='$this->nus_usu',con_usu='$this->con_usu',ema_usu='$this->ema_usu',ffc_usu='$this->ffc_usu',est_usu='$this->est_usu')\";\n\t\t$objDatos->ejecutar($sql);\n\t\t$objDatos->crerrarconexion();\n\t}",
"public function setUser_tipo(int $user_tipo): void{\n $this->user_tipo = $user_tipo;\n}",
"final public function modificarUsuario(){\n\t\tif($this->usuario == null){\n\t\t\tthrow new Exception('Usuario sin datos');\n\t\t}\n\t\tDataAccess::update($this->usuario);\t\n\t}",
"public function alterarTipoServico($tipoServico){\r\n \r\n try {\r\n \r\n $this->validarDadosTipoServico($tipoServico);\r\n return $this->tipoServicoDAO->update($tipoServico);\r\n } catch (DataException $e) {\r\n throw $e; \r\n } \r\n }",
"public function getIdUsuarioModificacion()\n {\n return $this->idUsuarioModificacion;\n }",
"public function modificarDatos($usuario);",
"public function editarPermiso($usuarioID, $permisoID, $valor)\n {\n $this->_db->query(\n \"replace into permisos_usuario set \".\n \"usuario = $usuarioID , permiso = $permisoID, valor ='$valor'\"\n );\n }",
"public function modificar(){\n\t\t$objDatos = new clsDatos();\n\t\t$sql = \"UPDATE usuario SET(id_car='$this->id_car',ced_usu='$this->ced_usu',pno_usu='$this->pno_usu',sno_usu='$this->sno_usu',pap_usu='$this->pap_usu',sap_usu='$this->sap_usu',fna_usu='$this->fna_usu',cel_usu='$this->cel_usu',tel_usu='$this->tel_usu',fot_usu='$this->fot_usu',nus_usu='$this->nus_usu',con_usu='$this->con_usu',ema_usu='$this->ema_usu',ffc_usu='$this->ffc_usu',est_usu='$this->est_usu')\";\n\t\t$objDatos->ejecutar($sql);\n\t\t$objDatos->crerrarconexion();\n\t}",
"function editUsuario(Usuario $usuario, $id){\n $gestor = new GestorUsuario();\n return $gestor->save($usuario, $id);\n }",
"function set_idUsuario( $idUsuario ) {\n // sets the value of idUsuario\n $this->idUsuario = $idUsuario;\n }",
"function cambiaUsuario($id, $usuario, $clave, $tipo, $nombre, $telefono, $email, $fax){\r\n\t\t\t$data = array(\r\n\t\t\t\t'Usuario_Usuario' => $usuario,\r\n\t\t\t\t'Clave_Usuario' => $clave,\r\n\t\t\t\t'Tipo_Usuario' => $tipo,\r\n\t\t\t\t'Nombre_Usuario' => $nombre,\r\n\t\t\t\t'Telefono_Usuario' => $telefono,\r\n\t\t\t\t'Email_Usuario' => $email,\r\n\t\t\t\t'Fax_Usuario' => $fax\r\n\t\t\t);\r\n\t\t\t$this->db->update('usuario',$data,array('ID_Usuario'=> $id));\r\n\t\t}",
"final public function update_estado_user() {\n global $config;\n\n # Actualiza Estado\n $this->db->query(\"UPDATE users SET estado=if(estado=0,1,0)\n WHERE id_user='$this->id' LIMIT 1;\");\n\n # Redireccionar a la página principal del controlador\n $this->functions->redir($config['site']['url'] . 'administracion/usuario');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the fetchmode used to retrieve results. | public function getFetchmode(); | [
"public function getFetchMode()\n {\n return $this->_fetchMode;\n }",
"public function getFetchMode();",
"public function getFetchMode()\n {\n return $this->fetchMode;\n }",
"private static function GetFetchMode()\n {\n return EasyPDO::$FetchModes[EasyPDO::$FetchMode];\n }",
"public function defaultFetchMode()\n {\n $cls = self::$ext . strtoupper( bcDB::resource( 'EXTENSION' ) );\n return $cls::getAttribute( 'default_fetch_mode' );\n }",
"public static function getFetchMode(){\n //Method inherited from \\Illuminate\\Database\\Connection \n return \\Illuminate\\Database\\MySqlConnection::getFetchMode();\n }",
"public function setFetchMode($mode);",
"public function setFetchMode($mode){}",
"function SetFetchMode($mode)\r\n\t{\t\r\n\t\tGLOBAL $ADODB_FETCH_MODE;\r\n\t\t$old = $ADODB_FETCH_MODE;\r\n\t\t$ADODB_FETCH_MODE = $mode;\r\n\t\treturn $old;\r\n\t}",
"public function set_fetch_mode($mode)\n\t{\t\n\t\tif($mode == MYSQLI_NUM) $this->fetch_mode = MYSQLI_NUM;\n\t\telse $this->fetch_mode = MYSQLI_ASSOC;\n\t}",
"public static function setFetchMode($fetchMode){}",
"abstract public function setFetchMode($mode);",
"public function setFetchMode($mode) {\n\t\tswitch($mode) {\n\t\t\tcase Hydra_Db::FETCH_ARRAY:\n\t\t\tcase Hydra_Db::FETCH_ASSOC:\n\t\t\tcase Hydra_Db::FETCH_COLUMN:\n\t\t\tcase Hydra_Db::FETCH_NUM:\n\t\t\tcase Hydra_Db::FETCH_OBJ:\n\t\t\t\t$this->_fetchMode = $mode;\n\t\t\tdefault:\n\t\t\t\tthrow new Hydra_Db_Adapter_Exception('Modo de fetch inválido');\n\t\t}\n\t}",
"public function setFetchType($mode)\n\t\t{\n\t\t\tif($mode && $mode < 5)\n\t\t\t{\n\t\t\t\t$this->fetch_mode = (integer) $mode;\n\t\t\t}\n\t\t}",
"public static function fetchType() {\n switch( DB_FETCH_TYPE ) {\n case 'class':\n return PDO::FETCH_CLASS;\n break;\n\n case 'array':\n return PDO::FETCH_ASSOC;\n break;\n }\n }",
"public function setFetchMode(int $fetchMode)\n {\n }",
"private function _get_fetch_mode_complete() {\n $current_fetch = $this->fetch_mode;\n $current_cl = $this->fetch_receptacle;\n $current_ctor = $this->ctor_args;\n return [\n $current_fetch,\n $current_cl,\n $current_ctor,\n ];\n }",
"public function getPDOFetchMode($iMDB2FetchMode) {\n\t\tswitch($iMDB2FetchMode) {\n\n\t\t\t// MDB2 Modes\n\t\t\tcase MDB2_FETCHMODE_DEFAULT:\n\t\t\t\treturn $this->_iPDOFetchMode;\n\t\t\t\tbreak;\n\t\t\tcase MDB2_FETCHMODE_ORDERED:\n\t\t\t\treturn PDO::FETCH_NUM;\n\t\t\t\tbreak;\n\t\t\tcase MDB2_FETCHMODE_ASSOC:\n\t\t\t\treturn PDO::FETCH_ASSOC;\n\t\t\t\tbreak;\n\t\t\tcase MDB2_FETCHMODE_OBJECT:\n\t\t\t\treturn PDO::FETCH_OBJ;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Unimplemented/unknown MDB2 fetchmode: ' . var_export($iMDB2FetchMode, true));\n\n\t\t}\n\t}",
"function fetch($mode=MYSQL_ASSOC){\n\t\treturn(mysql_fetch_array($this->res,$mode));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represents the failure policy of a pipeline. Currently, the default of a pipeline is that the pipeline will continue to run until no more tasks can be executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. However, if a pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it will stop scheduling any new tasks when a task has failed. Any scheduled tasks will continue to completion. Generated from protobuf field .google.cloud.aiplatform.v1.PipelineFailurePolicy failure_policy = 4; | public function getFailurePolicy()
{
return $this->failure_policy;
} | [
"public function getFailureType()\n {\n return $this->failure_type;\n }",
"public function setFailure($var)\n {\n GPBUtil::checkMessage($var, \\Cerbos\\Policy\\V1\\TestResults\\Failure::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function setFailureCondition($var)\n {\n GPBUtil::checkString($var, True);\n $this->failure_condition = $var;\n\n return $this;\n }",
"public function getFailureReason()\n {\n return $this->failure_reason;\n }",
"public function getFailureThreshold()\n {\n return $this->failure_threshold;\n }",
"public function setFailureStatus($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Rpc\\Status::class);\n $this->failure_status = $var;\n\n return $this;\n }",
"public function setFailureCause($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Deploy\\V1\\PredeployJobRun\\FailureCause::class);\n $this->failure_cause = $var;\n\n return $this;\n }",
"public function getChildWorkflowExecutionFailedEventAttributes()\n {\n return $this->readOneof(38);\n }",
"public function getFailureTypeAttribute()\n {\n return ($this->attributes['failure'] == 0) ? '' : FailureTypes::name($this->attributes['failure']);\n }",
"public function getFailedValue()\n {\n return $this->failedValue;\n }",
"public function setFailureReason($var)\n {\n GPBUtil::checkString($var, True);\n $this->failure_reason = $var;\n\n return $this;\n }",
"public function getFailureReason()\n {\n if (array_key_exists(\"failureReason\", $this->_propDict)) {\n return $this->_propDict[\"failureReason\"];\n } else {\n return null;\n }\n }",
"public function getLPFailed()\n {\n return xdhtParticipant::where(array(\n 'status' => ilLPStatus::LP_STATUS_FAILED_NUM,\n 'training_obj_id' => $this->getId()\n ))->getArray(null, 'usr_id');\n }",
"public function setFailure($var)\n {\n GPBUtil::checkMessage($var, \\Temporal\\Api\\Failure\\V1\\Failure::class);\n $this->failure = $var;\n\n return $this;\n }",
"public function getFailureMessage()\n {\n return $this->failure_message;\n }",
"public function getFailureDirectory()\n {\n return $this->failureDirectory;\n }",
"public function failed()\n {\n return $this->failedRules;\n }",
"public function setFailure($var)\n {\n GPBUtil::checkMessage($var, \\Cerbos\\Response\\V1\\PlaygroundFailure::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function setPartialFailures($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Rpc\\Status::class);\n $this->partial_failures = $arr;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the montant autre32. | public function setMontantAutre32($montantAutre32) {
$this->montantAutre32 = $montantAutre32;
return $this;
} | [
"public function testSetMontantAutre33() {\n\n $obj = new LignesMsaEmploye();\n\n $obj->setMontantAutre33(10);\n $this->assertEquals(10, $obj->getMontantAutre33());\n }",
"public function setMontant($_montant) { $this->montant = $_montant; }",
"public function testSetMontant32() {\n\n $obj = new LignesMsaEmploye();\n\n $obj->setMontant32(10);\n $this->assertEquals(10, $obj->getMontant32());\n }",
"public function getMontantAutre32(): ?int {\n return $this->montantAutre32;\n }",
"public function testSetMontantAutre23() {\n\n $obj = new LignesMsaEmploye();\n\n $obj->setMontantAutre23(10);\n $this->assertEquals(10, $obj->getMontantAutre23());\n }",
"public function setMontantAutre34(?int $montantAutre34): LignesMsaEmploye {\n $this->montantAutre34 = $montantAutre34;\n return $this;\n }",
"public function getMontantAutre31() {\n return $this->montantAutre31;\n }",
"public function setMontantAutre31(?int $montantAutre31): LignesMsaEmploye {\n $this->montantAutre31 = $montantAutre31;\n return $this;\n }",
"public function setMontant($montant)\n {\n $this->montant = $montant;\n }",
"public function setMontantAutre13(?int $montantAutre13): LignesMsaEmploye {\n $this->montantAutre13 = $montantAutre13;\n return $this;\n }",
"public function setMontant($_montant)\n {\n $this->_montant = $_montant;\n\n return $this;\n }",
"public function testSetMontant33() {\n\n $obj = new LignesMsaEmploye();\n\n $obj->setMontant33(10);\n $this->assertEquals(10, $obj->getMontant33());\n }",
"public function setMontantAutre21($montantAutre21) {\n $this->montantAutre21 = $montantAutre21;\n return $this;\n }",
"public function testSetMontant() {\n\n $obj = new LignesAta();\n\n $obj->setMontant(10.092018);\n $this->assertEquals(10.092018, $obj->getMontant());\n }",
"public function setMontantAutre14(?int $montantAutre14): LignesMsaEmploye {\n $this->montantAutre14 = $montantAutre14;\n return $this;\n }",
"function setAltNumber(int $altNumber) : void {}",
"public function preset90() {\n \n self::$mesaMezclas->preset(90);\n\n }",
"function setNum_asistentes($inum_asistentes = '')\n {\n $this->inum_asistentes = $inum_asistentes;\n }",
"public function testSetMontant24() {\n\n $obj = new LignesMsaEmploye();\n\n $obj->setMontant24(10);\n $this->assertEquals(10, $obj->getMontant24());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the request token URL. | public function getRequestTokenURL() {
return $this->selectedEndpoint['request_token_url'];
} | [
"public function requestTokenURL() {\n\t\treturn $this->getUrl('request_token');\n\t}",
"public function getRequestTokenUrl()\n {\n if (!$this->_requestTokenUrl && $this->_siteUrl) {\n return $this->_siteUrl . '/request_token';\n }\n return $this->_requestTokenUrl;\n }",
"public function getRequestTokenUrl()\n {\n return $this->_requestTokenUrl;\n }",
"protected function getTokenUrl(): string\n {\n return $this->buildUrl('/token');\n }",
"protected function getTokenUrl()\n {\n return $this->host . $this->tokenUrl;\n }",
"protected function getTokenUrl(): string\n {\n return $this->baseUrl .'/oauth/' . $this->version . '/token';\n }",
"private function get_token_url(){\n\t\t# Return url with a filter hook for modifications\n\t\treturn apply_filters( 'oauth_token_url', $this->tokens_url );\n\t}",
"protected function getTokenUrl(): string\n {\n return $this->baseUrl .'/oauth2.0/token';\n }",
"private function getTokenUrl()\n {\n return static::API_DOMAIN.'/oauth/token';\n }",
"protected function getTokenUrl()\n {\n\n $token_url = MeliManager::$API_ROOT_URL.MeliManager::$OAUTH_URL;\n\n return $token_url;\n }",
"public function getRequestTokenUri()\n {\n return $this->request_token_uri;\n }",
"protected function getTokenUrl()\n {\n return 'https://toyhou.se/~oauth/token';\n }",
"protected function getTokenUrl()\n {\n return config('sso.url') . '/oauth/token';\n }",
"public function getRequestTokenUri()\n {\n return $this->requestTokenUri;\n }",
"public function getTokenGenerationUrl();",
"protected function getTokenUrl()\n {\n }",
"private static function getTokenUrl() {\n return \\Drupal::config('iish_conference.settings')\n ->get('conference_base_url') . 'oauth/token';\n }",
"public function getTokenUri()\n {\n return $this->token_uri;\n }",
"protected function getApiTokenUrl()\n {\n return \"api/Token\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request path, without parameters. | private function createRequestPath($urlFullArray) {
$head = $urlFullArray['head'];
$protocol = $head['protocol'];
$domain = $head['domain'];
$section = $head['section'];
$section2 = $head['section2'];
$apiName = $head['api-name'];
$format = $head['format'];
if (NULL == $section2) {
$requestPath = "$protocol://$domain/api/$section/$apiName.$format";
}
else {
$requestPath = "$protocol://$domain/api/$section/$section2/$apiName.$format";
}
return $requestPath;
} | [
"public function getRequestPath();",
"function testRequestPathWithoutParams() {\n $_SERVER[\"REQUEST_URI\"] = '/the/command?XML=1';\n $r = api_request::getInstance(true);\n $this->assertEqual('/the/command', $r->getPath());\n }",
"private function buildRequestUrl() \n {\n\n // Build request url\n $request = '';\n\n if ($this->namespaces) {\n $request .= '/'.implode('/', $this->namespaces);\n }\n\n // Add action if set\n if ($this->action) {\n $request .= '/'.$this->action;\n }\n\n return $request;\n }",
"private function buildRequestUrl() {\n\n // Build request url\n $request = '';\n\n // Add id if set\n if ($this->id) {\n $request .= '/'.$this->id;\n }\n\n // Add action if set\n if ($this->action) {\n $request .= '/'.$this->action;\n }\n\n return $request;\n }",
"public function create_path()\n\t\t{\n\t\treturn \\Path::base_to($this->index->parent->path . '/edit', $this->index->parent->key_pair);\n\t\t}",
"abstract protected function buildSpecificRequestUri();",
"protected abstract function _buildSpecificRequestUri();",
"private function _buildFullUrl()\n {\n\n $this->request_url = $this->url = \n $this->apiUrl . \"{$this->request_api}/{$this->apiVersion}/{$this->request_functionName}\" . \n (empty($this->request_id) ? '' : \"/{$this->request_id}/\");\n\n }",
"public function newPath(){}",
"private function setPath()\n {\n $restoUrl = filter_input(INPUT_GET, '_path', FILTER_UNSAFE_RAW);\n if (isset($restoUrl)) {\n $this->path = ($restoUrl !== '/' && substr($restoUrl, -1) === '/' ? substr($restoUrl, 0, strlen($restoUrl) - 1) : $restoUrl);\n }\n }",
"protected function composeDefaultPath()\n {\n return ['params', $this->id];\n }",
"protected function assemblePath($params)\n {\n return $this->apiUrl . '/' . $params;\n }",
"private function descifrarRequestPath($request){\n $queryParams = $request->getQueryParams();\n $path = $queryParams['PATH_INFO'];\n $pathArray = explode('/', $path);\n $pathArray = array_filter($pathArray);\n $queryParams['PATH_INFO'] = $pathArray;\n return $queryParams;\n }",
"public function testConstructorPathSet()\n {\n $check = md5(microtime(true));\n $request = new Request($check);\n $this->assertEquals($check, $this->getRequestProperty($request, 'path'));\n }",
"public static function prepareRequestPathTag($path)\n\t{\n\t\t$path = trim((string)$path, '/ ');\n\t\treturn Df_PageCache_Model_Processor::REQUEST_PATH_PREFIX . md5($path);\n\t}",
"private function _getPath($path) {\n if ( ! $path) {\n return $this->request->getParam('controller') . '.' . $this->request->getParam('action');\n }\n\n return $path;\n }",
"private function _appendPath($path)\n {\n if(!isset($path) || empty($path)) \n throw new HttpException(\"Request endpoint path should be provided\", 1);\n \n if ($this->_baseEndpointUrl && $path) \n $this->_endpointUrl = $this->_baseEndpointUrl.ltrim($path, '/');\n }",
"public function testWithPathInvalidQueryString()\n {\n $uri = $this->getUriForTest();\n $uri->withPath('/foo/bar?foo=bar');\n }",
"function make_url(string $path = ''): string\n{\n return FULL_URL . preg_replace('#^\\/?(.*?)\\/?$#', '\\1', $path);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the allowTextSuggestion property value. Indicates whether or not to allow text suggestions during the test. | public function getAllowTextSuggestion(): ?bool {
$val = $this->getBackingStore()->get('allowTextSuggestion');
if (is_null($val) || is_bool($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'allowTextSuggestion'");
} | [
"public function getAllowTextSuggestion()\n {\n if (array_key_exists(\"allowTextSuggestion\", $this->_propDict)) {\n return $this->_propDict[\"allowTextSuggestion\"];\n } else {\n return null;\n }\n }",
"public function setAllowTextSuggestion($val)\n {\n $this->_propDict[\"allowTextSuggestion\"] = boolval($val);\n return $this;\n }",
"public function setAllowTextSuggestion(?bool $value): void {\n $this->getBackingStore()->set('allowTextSuggestion', $value);\n }",
"public function getEnableSpellCorrection()\n {\n return $this->enable_spell_correction;\n }",
"public function getValueTextEnabled()\n {\n return $this->valueTextEnabled;\n }",
"public function getSuggestion()\n {\n return $this->suggestion;\n }",
"public function getSuggestionFeatureConfig()\n {\n return $this->suggestion_feature_config;\n }",
"public function getAllowSearch()\n {\n return $this->allowSearch;\n }",
"public function getContentSuggestion()\n {\n return $this->content_suggestion;\n }",
"public function isEMTSuggestion() {\n return $this->type == self::TYPE_EMT_SUGGESTION;\n }",
"public function getAllow()\n {\n return $this->allow;\n }",
"public function getSuggestion()\n {\n return $this->readOneof(3);\n }",
"public function getSuggestConfig()\n {\n return $this->getRequest()->getParam('suggest', false);\n }",
"public function isAutoText() {\n return $this->autoText;\n }",
"public function getHumanAgentSuggestionConfig()\n {\n return $this->human_agent_suggestion_config;\n }",
"public function getEnableWordConfidence()\n {\n return $this->enable_word_confidence;\n }",
"public function getEnableFuzzyExtraction()\n {\n return $this->enable_fuzzy_extraction;\n }",
"public function suggestion(): string\n {\n return $this->suggestion;\n }",
"public function getAllowVoiceFlag()\n {\n $value = $this->get(self::ALLOWVOICEFLAG_);\n return $value === null ? (boolean)$value : $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the payment method is oyst | public function isPaymentMethodOyst(Mage_Sales_Model_Order $order)
{
/** @var Oyst_OneClick_Model_Payment_Method_Freepay $paymentMethod */
$freepayPaymentMethod = Mage::getModel('oyst_oneclick/payment_method_freepay');
return false !== strpos($order->getPayment()->getMethod(), $freepayPaymentMethod->getCode());
} | [
"public function isPayment();",
"public function isObfuscated()\n {\n return ($this->getType() === PaymentMethod::OBFUSCATED_CARD);\n }",
"public function isCNovationPay()\n\t{\n\t\treturn (Registry::getSession()->getBasket()->getPaymentId() == \"c_novation_pay\");\n//\t\treturn ($this->getSession()->getVariable(\"paymentid\") == \"c_novation_pay\");\n\n\t}",
"public function isSatisfiedBy($paymentMethod);",
"public function isRatePAYPayment()\n {\n $payment = Shopware()->Models()->find('Shopware\\Models\\Payment\\Payment', $this->_user->getPaymentId());\n\n return in_array($payment->getName(), array(\"rpayratepayinvoice\", \"rpayratepayrate\", \"rpayratepaydebit\"));\n }",
"public function isWorldpayPayment(){\n\n $paymentMethod= $this->getPaymentMethod();\n if ($paymentMethod=='worldpay_cc' || $paymentMethod=='worldpay_apm' || $paymentMethod=='worldpay_moto' || $paymentMethod=='worldpay_cc_vault')\n {\n return true;\n }\n\n return false;\n }",
"function hasPayment(): bool;",
"public function getPaymentMethod();",
"function get_payment_type()\n {\n // echeck - payment funded with e-check\n // instant - payment was funded with platnosci balance, credit card, or instant transfer\n return $this->platnosci_post_vars['payment_type'];\n }",
"public function getPaymentMethod()\n {\n }",
"public function isPayonePaymentMethod($paymentName)\n {\n return preg_match('#mopt_payone__#', $paymentName) ? true : false;\n }",
"function isPaymentPending(): bool;",
"public function is_using_saved_payment_method() {\n $payment_method = isset( $_POST['payment_method'] ) ? wc_clean( wp_unslash( $_POST['payment_method'] ) ) : 'dokan-stripe-connect'; // phpcs:ignore WordPress.Security.NonceVerification\n\n return ( isset( $_POST[ 'wc-' . $payment_method . '-payment-token' ] ) && 'new' !== $_POST[ 'wc-' . $payment_method . '-payment-token' ] ); // phpcs:ignore WordPress.Security.NonceVerification\n }",
"public function isCaptureOperation()\n {\n return in_array(\n $this->getOpsStatus(),\n array(\n Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_REQUESTED,\n Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_PROCESSING,\n Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_UNCERTAIN,\n Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_REFUSED,\n Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_DECLINED_ACQUIRER,\n Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_PROCESSED_MERCHANT,\n Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_IN_PROGRESS,\n )\n );\n }",
"public function isPaymentOnShipping();",
"private function containsIdeal()\n {\n return stristr($this->getPaymentMethod(), 'ideal') !== false;\n }",
"protected function isPaymentMethodRequired()\n {\n return 0 < $this->getOpenTotal()\n && ($this instanceof \\XLite\\Model\\Cart || $this->getOrderNumber() === null);\n }",
"public function getPaymentType();",
"public function paymentMethod()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
THIS FUNCTION RETURNS AN ARRAY OF ALL THE INTERNAL IDS ASSOCIATED WITH THE ENTRIES OF A PARTICULAR FORM $formhandle can be an array of handles, or if not specified then all entries for all handles are returned $formhandle can all just be a single handle $formhandle values can be: the title of the form, or the id number of the form If formhandle is an array, then $ids becomes a two dimensional array: $ids[$formhandle][] = $id Crazy in efficiencies going on here in terms of how ids and titles are getting converted back and forth and back and forth. And using form titles in the data array is the last bit of general stupidity that should be squeezed out, but its a backwards compatibility issue now. | function internalRecordIds($entry, $formhandle = "", $id = "NULL", $fidAsKeys = false) {
if (is_numeric($id)) {
$entry = $entry[$id];
}
if (!$formhandle) {
$formhandle = getFormHandlesFromEntry($entry);
} else {
// need to convert possible legacy framework form handles to form ids
$formhandle = dealWithDeprecatedFormHandles($formhandle);
}
if (is_array($formhandle)) {
foreach ($formhandle as $handle) {
$handle = _parseInternalRecordIdsFormHandle($handle);
foreach ($entry[$handle] as $id => $element) {
if ($fidAsKeys) {
$fid = formulize_getFormIdFromName($handle);
$ids[$fid][] = $id;
} else {
$ids[$handle][] = $id;
}
}
}
} else {
$formhandle = _parseInternalRecordIdsFormHandle($formhandle);
foreach ($entry[$formhandle] as $id => $element) {
$ids[] = $id;
}
}
return $ids;
} | [
"protected function getFieldIdsByHandle(): array\n {\n $handles = [];\n $fields = $this->getAllFields();\n foreach ($fields as $field) {\n $handles[$field->handle] = (int)$field->id;\n }\n return $handles;\n }",
"public static function formIds();",
"public function getAllFormIds()\n {\n if ( ! Quform::isPostRequest()) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Bad request', 'quform')\n ));\n }\n\n if ( ! current_user_can('quform_full_access')) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Insufficient permissions', 'quform')\n ));\n }\n\n $oldForms = $this->get1xForms();\n $formIds = array();\n\n foreach ($oldForms as $oldForm) {\n $oldFormId = (int) $oldForm['id'];\n\n if ($oldFormId > 0) {\n $formIds[] = $oldFormId;\n }\n }\n\n wp_send_json(array(\n 'type' => 'success',\n 'formIds' => $formIds\n ));\n }",
"public function get_form_ids() {\r\n\t\treturn $this->wpdb->get_col( \"SELECT `id` FROM {$this->prefixed_table_name}\" );\r\n\t}",
"protected function formIds()\n {\n $form = new FormGridIds();\n $form->ids = Yii::$app->request->post('ids', []);\n\n if (! $form->validate()) {\n return false;\n }\n\n return $form;\n }",
"protected function gform_ids_from_admin_labels( array $admin_labels, $form ) {\n\n\t\t/* Initialize output */\n\t\t$ids_array = [];\n\n\t\t/* Find ids of the corresponding fields */\n\t\tforeach ( $form['fields'] as $field ) {\n\n\t\t\tif ( in_array( $field['adminLabel'], $admin_labels ) ) {\n\n\t\t\t\t$ids_array[ $field['adminLabel'] ] = $field['id'];\n\n\t\t\t}\n\t\t}\n\n\t\treturn $ids_array;\n\n\t}",
"abstract protected function getHandlesList(): array;",
"public function getAssignedFormIds()\n {\n /** @var \\app\\models\\User $user */\n $user = Yii::$app->user->identity;\n $userForms = $user->getUserForms()->asArray()->all(); // TODO Add forms created by the same user\n $userForms = ArrayHelper::getColumn($userForms, 'form_id');\n return $userForms;\n }",
"public function get_log_ids( $form_id = '' ) {\n\n\t\t// get Give_Logging class\n\t\tglobal $give_logs;\n\n\t\t// get log for this form\n\t\t$logs = $give_logs->get_logs( $form_id );\n\n\t\tif ( $logs ) {\n\t\t\t$log_ids = array();\n\n\t\t\t// make an array with all the donor IDs\n\t\t\tforeach ( $logs as $log ) {\n\t\t\t\t$log_ids[] = $log->ID;\n\t\t\t}\n\n\t\t\treturn $log_ids;\n\t\t}\n\n\t\treturn null;\n\n\t}",
"public function getMyFormIds()\n {\n /** @var \\app\\models\\User $user */\n $user = Yii::$app->user->identity;\n $userForms = Form::find()->where([\n 'created_by' => $user->id\n ])->asArray()->all();\n $userForms = ArrayHelper::getColumn($userForms, 'id');\n return $userForms;\n }",
"protected function createHandlerIdsFromJsonDatabase() {\n // Create database object.\n $this->database = new Controller_Default_Database($this->botname);\n // Get data.\n $dataset = $this->database->data();\n $array_of_handlerids = array();\n \n // Iterate over data.\n foreach ($dataset as $key => $value) {\n $this->value = $value;\n $this->key = $key;\n // Register multiple action handlers.\n $array_of_handlerids[] = \n $this->irc->registerActionHandler(SMARTIRC_TYPE_CHANNEL, $this->value->message, array($this, 'message')\n );\n }\n return $array_of_handlerids;\n }",
"private static function get_all_post_ids_for_form( $form_id, $args ) {\n\t\t$where = array(\n\t\t\t'e.form_id' => $form_id,\n\t\t\t'e.is_draft' => 0,\n\t\t);\n\n\t\tself::add_to_where_query( $args, $where );\n\n\t\t$query_args = self::setup_args_for_frmdb_query( $args );\n\n\t\tglobal $wpdb;\n\t\t$table = $wpdb->prefix . 'frm_items e';\n\n\t\treturn FrmDb::get_col( $table, $where, 'e.post_id', $query_args );\n\t}",
"public function getFormEntries() {\r\n return $this->dbConn->queryAssoc(\"SELECT `id` FROM `form_entries` WHERE `form_id` = \".intval($this->id).\" ORDER BY `updated_at` DESC\");\r\n }",
"function getIdByHandle($handle, $includeBlocked = FALSE) {\n $result = array();\n if (is_array($handle)) {\n $isMultiples = TRUE;\n } else {\n $isMultiples = FALSE;\n $handle = array($handle);\n }\n $loadHandles = array();\n foreach ($handle as $value) {\n if (trim($value) != '') {\n if (isset($this->idByHandleCache[$value]) &&\n $this->idByHandleCache[$value] != '') {\n $result[$value] = $this->idByHandleCache[$value];\n } else {\n $loadHandles[] = $value;\n }\n }\n }\n if (count($loadHandles) > 0) {\n $filter = str_replace(\n '%',\n '%%',\n $this->databaseGetSQLCondition('surfer_handle', $loadHandles)\n );\n $blockedClause = ($includeBlocked === FALSE) ? ' AND surfer_valid != 4' : '';\n // Otherwise, look up this handle in database\n $sql = \"SELECT surfer_id, surfer_handle\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 id in cache for future use and return it\n $this->idByHandleCache[$row['surfer_handle']] = $row['surfer_id'];\n $this->handleByIdCache[$row['surfer_id']] = $row['surfer_handle'];\n $result[$row['surfer_handle']] = $row['surfer_id'];\n }\n }\n }\n if ($isMultiples) {\n // case 1: multiples handles\n return $result;\n } else if (count($result) > 0) {\n // case 2: one handle lookup\n return reset($result);\n }\n return '';\n }",
"protected function assembleIdListStructure() {\n\t\t\t// Assemble a list of all different tables, of all uid's\n\t\t\t// and of all table names and uids concatenated together\n\t\t$tables = array();\n\t\t$uids = array();\n\t\t$uidList = array();\n\t\tforeach ($this->selectedRecords as $record) {\n\t\t\t$tables[] = $record['tablenames'];\n\t\t\t$uids[] = $record['uid_foreign'];\n\t\t\t$uidList[] = $record['tablenames'] . '_' . $record['uid_foreign'];\n\t\t}\n\t\t\t// Assemble the data structure and return it\n\t\t$tables = array_unique($tables);\n\t\t$numberOfRecords = count($uidList);\n\t\t$dataStructure = array(\n\t\t\t'uniqueTable' => (count($tables) == 1) ? array_shift($tables) : '',\n\t\t\t'uidList' => implode(',', $uids),\n\t\t\t'uidListWithTable' => implode(',', $uidList),\n\t\t\t'count' => $numberOfRecords,\n\t\t\t'totalCount' => $numberOfRecords,\n\t\t);\n\t\treturn $dataStructure;\n\t}",
"protected function generateFormtypesArray() {\n\t\t$this->formtypes = array();\n\n\t\t$select = 'uid,formtype';\n\t\t$from = 'tx_powermail_fields';\n\t\t//$where = 'pid = ' . intval($this->pid);\n\t\t$where = '';\n\t\t$orderBy = '';\n\t\t$groupBy = '';\n\t\t$limit = '';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n\t\tif ($res !== false) {\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t$this->formtypes['uid' . $row['uid']] = $row['formtype'];\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t\t}\n\t}",
"private static function maybe_get_all_entry_ids_for_form( &$args ) {\n\t\tif ( empty( $args['entry_ids'] ) && $args['after_where'] == 0 ) {\n\n\t\t\t$query = array( 'form_id' => $args['form_id'] );\n\t\t\tif ( $args['drafts'] != 'both' ) {\n\t\t\t\t$query['is_draft'] = $args['drafts'];\n\t\t\t}\n\n\t\t\t$args['entry_ids'] = FrmDb::get_col( 'frm_items', $query );\n\t\t}\n\t}",
"function qa_db_user_get_handle_userids($handles)\n{\n\tif (count($handles)) {\n\t\treturn qa_db_read_all_assoc(qa_db_query_sub(\n\t\t\t'SELECT handle, userid FROM ^users WHERE handle IN ($)',\n\t\t\t$handles\n\t\t), 'handle', 'userid');\n\t}\n\n\treturn array();\n}",
"function cf_support_rest_form_ids(){\n\treturn rest_ensure_response( cf_support_form_ids() );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getEPrintJSON fetches an EPrint record for a given id and return an JSON formatted document | function getEPrintJSON($eprint_url, $eprint_id, $eprint_user = "", $eprint_password = "", $pretty_print = true) {
$src = getEPrintXML($eprint_url, $eprint_id, $eprint_user, $eprint_password);
if ($src && stripos($src, "<?xml") !== false) {
if ($pretty_print == true) {
return json_encode(xmlToArray($src), JSON_PRETTY_PRINT);
} else {
return json_encode(xmlToArray($src));
}
}
return '{}';
} | [
"public function getLayerRecord($id){\n\n try {\n\n $layerRecordPath = Config::getMarkupLayerRecordsPath();\n $file = $layerRecordPath . $this->filenamePrefix . $id . '.json';\n\n if (file_exists($file)) {\n header('Content-Type: application/json');\n echo file_get_contents($file);\n } else {\n header(\"HTTP/1.0 404 Not Found\");\n return;\n }\n\n } catch(\\Exception $e) {\n\n $response = new \\stdClass();\n $response->errorCode = 'ServerError';\n $response->errorMessage = $e->getMessage();\n $response->layerRecordId = $id;\n\n header(\"HTTP/1.0 580 Server Error\");\n header('Content-Type: application/json');\n echo json_encode($response);\n }\n\n }",
"function get_pdf_json($id)\n{\n global $conn;\n\n $id = $conn->real_escape_string($id);\n $res = mysqli_query($conn, \"SELECT * FROM pdf WHERE id='$id'\");\n\n $obj = mysqli_fetch_assoc($res);\n\n echo json_encode($obj);\n}",
"public function readDocumentsIdE($id)\n {\n $query = \"SELECT * FROM documentos_equipo WHERE idequipo=$id\";\n $stm = Conection::DBconection()->prepare($query);\n if ($stm->execute()) {\n return printf(json_encode($stm->fetchAll(PDO::FETCH_ASSOC)));\n } else {\n return printf(json_encode(array('action' => \"error\")));\n }\n }",
"public function questoesJson($id){\n \t$questoes = $empresa = DB::table('entrevistas_questoes')->\n \t\tjoin('entrevistas', 'entrevistas_questoes.eq_codEntrevista', '=', 'entrevistas.codEntrevista')->\n \t\tjoin('questoes', 'entrevistas_questoes.eq_codQuestao', '=', 'questoes.codQuestao')->\n join('clientes', 'entrevistas.codCliente', '=', 'clientes.codCliente')->\n \t\twhere('entrevistas.codEntrevista', '=', $id)->get();\n \treturn json_encode($questoes);\n }",
"public function getEmployeeData($id = '')\n {\n $employee = null;\n if (!empty($id)) {\n $employee = $this->model('Employee')->getEmployeeByID($id);\n }\n echo json_encode($employee);\n }",
"public function poi_get_json() {\r\n\t\t$result = $this->logic->getlist ();\r\n\t\techo json_encode ( $result );\r\n\t}",
"public function export_json()\n\t{\n\t\t$o = new stdClass();\n\t\t\n\t\t$a = $this->o_db->setMode('OBJECT')->q(\"SELECT * FROM `{$this->s_table}`\")->fetchAllRows();\n\t\tforeach ($a as $o)\n\t\t{\n\t\t\t$a_return[$o->{$this->s_primary_col}] = $o;\n\t\t}\n\t\treturn json_encode($a_return);\n\t\t\n\t}",
"public function toJsonRecords($id = 'id')\n {\n $data = $this->toArray();\n\n $records = [];\n\n foreach ($data as $row) {\n $idValue = static::getItemFieldValue($row, $id);\n $records[$idValue] = $row;\n }\n\n return json_encode($records);\n }",
"public function GetPrintModel($id)\n {\n return $this->em->getRepository(self::ENTITY_NAME)->findOneBy(array('id' => $id));\n }",
"public function fetch($printer_id) {\n\n }",
"public function json()\n\t{\n\t\tp('Use <code>json()</code> to output objects inline as JSON:');\n\t\tjson($this->data());\n\t\tp('Alternatively, you can simply <i>return</i> any complex object, and Sketchpad will format it for you.');\n\t}",
"public function getJsonString () {\r\n\t\t// Start building string\r\n\t\t$str = '';\r\n\t\t$str .= '{';\r\n\t\t$str .= '\"interviews\":';\r\n\t\t$str .= '['; // begin array\r\n\t\tforeach (self::getData() as $row) { // For each row in the table:\r\n\t\t\t$str .= '{'; // Open record\r\n\t\t\t$str .= '\"id\":\"' . $row['id'] . '\",';\r\n\t\t\t$str .= '\"jobID\":\"' . $row['jobID'] . '\",';\r\n\t\t\t$str .= '\"resumeID\":\"' . $row['resumeID'] . '\",';\r\n\t\t\t$str .= '\"time\":\"' . $row['time'] .'\"';\r\n\t\t\t$str .= '},'; // Close record\r\n\t\t}\r\n\t\t$str = substr($str,0,-1); // remove last comma\r\n\t\t$str .= ']'; // end array\r\n\t\t$str .= '}';\r\n\t\t\r\n\t\treturn $str;\r\n\r\n\t}",
"public function api_show_eod($id)\n {\n return EOD::select('stock_id','last_refreshed','date','open','high','low','close','volume')->where('stock_id',$id)->get();\n }",
"public function detail($id) {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/interface/pppoe-client/print\");\n $sentence->where(\".id\", \"=\", $id);\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return \"No Interface PPPoE-Client With This id = \" . $id;\n }\n }",
"public function getPrinterInfo()\n {\n echo json_encode(\n array(\n 'file' => $this->obj->get('file'),\n 'port' => $this->obj->get('port'),\n 'model' => $this->obj->get('model'),\n 'ip' => $this->obj->get('ip'),\n 'config' => strtolower($this->obj->get('config')),\n 'configFile' => $this->obj->get('configFile'),\n )\n );\n exit;\n }",
"function getPerso($id)\n\t\t\t\t{\n\t\t\t\t\t// Get perso\n\t\t\t\t\t$perso = R::findOne('persos', 'id='.$id);\n\n\t\t\t\t\t// Send response\n\t\t\t\t\tprint_r(json_encode(R::exportAll($perso)));\n\t\t\t\t}",
"public function as_json() {\n header('Content-type: application/json');\n echo json_encode($this->report_objects);\n }",
"function get_product_json() {\n //header('Content-Type: application/json');\n echo $this->CrudModel->get_all_product();\n }",
"public function toJson() {\n $mhd = null;\n if($this->getMhd() != new DateTime('0000-00-00')){\n $mhd = $this->getMhd()->format('d-m-Y');\n }\n return json_encode(array(\n 'active' => $this->getActive(),\n 'date' => $this->getDate()->format('d-m-Y'),\n 'description' => $this->getDescription(),\n 'mhd' => $mhd,\n 'offerID' => $this->getOfferID(),\n 'picture' => base64_encode($this->getPicture()),\n 'plz' => $this->getPLZ()->toJson(),\n 'report' => $this->getReport(),\n 'tag' => $this->getTag()->toJson(),\n 'title' => $this->getTitle(),\n 'ocID' => $this->getOcID() \n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add subproducts to compound products table | function insert_subproducts( $product_id, $subprod_quantities, $subprod_ids )
{
global $connection;
$has_subprods = false;
$sql_ins_subprods = 'INSERT INTO '
.TABLE_COMPOUND_PRODUCT_PREP.' (
compound_product_id,
constituent_product_id,
constituent_quantity
) VALUES';
if ($subprod_quantities != null)
{
$subprod_index = 0;
foreach ($subprod_quantities as $prod_quantity)
{
// Ignore invalid input, and round any fractions
$prod_quantity = (int)( (float)$prod_quantity + 0.5 );
if ($prod_quantity > 0)
{
if ($has_subprods)
{
$sql_ins_subprods .= ',';
}
$sql_ins_subprods .= ' (
"'.$product_id.'",
"'.$subprod_ids[$subprod_index].'",
"'.$prod_quantity.'"
)';
$has_subprods = true;
}
$subprod_index++;
}
}
// If we found some subproducts, this is a compound product,
// so add the subproducts to the compound products table
if ( $has_subprods )
{
$res_sub_prods = @mysql_query($sql_ins_subprods,$connection) or die(mysql_error());
}
else
{
$res_sub_prods = true;
}
if ($res_sub_prods)
{
// Add an update to flag the compound product in the product table
// N.B. Better to do this with a TRIGGER in theory, but can't rely on
// having the SUPER (in MySQL < 5.1.6) or TRIGGER (MySQL >= 5.1.6) priv
$sql_upd_compound = "
UPDATE ".TABLE_PRODUCT_PREP."
SET is_compound = '".($has_subprods ? 1 : 0)."'
WHERE product_id = '".$product_id."'";
$res_sub_prods = @mysql_query($sql_upd_compound,$connection)
or die(mysql_error());
}
return $res_sub_prods;
} | [
"function subproducts_transform() {\n\n\t\t$drop_old_subproducts = \"DROP TABLE IF EXISTS subproducts\";\n\n\t\t$this->DatabaseTransformer->query($drop_old_subproducts);\n\n\n\n\t\t// vytvorim si novou\n\n\t\t$create_new_subproducts = \"\n\n\t\t\tCREATE TABLE IF NOT EXISTS `subproducts` (\n\n\t\t\t `id` int(10) unsigned NOT NULL auto_increment,\n\n\t\t\t `created` datetime NOT NULL,\n\n\t\t\t `modified` datetime NOT NULL,\n\n\t\t\t `price_with_dph` decimal(10,2) unsigned NOT NULL default '0.00',\n\n\t\t\t `price_wout_dph` decimal(10,2) unsigned NOT NULL,\n\n\t\t\t `product_id` int(10) unsigned NOT NULL default '0',\n\n\t\t\t `pieces` int(11) NOT NULL,\n\n\t\t\t `active` tinyint(1) NOT NULL default '0',\n\n\t\t\t `availability_id` int(10) unsigned NOT NULL,\n\n\t\t\t PRIMARY KEY (`id`)\n\n\t\t\t)\n\n\t\t\";\n\n\t\t$this->DatabaseTransformer->query($create_new_subproducts);\n\n\n\n\t\t// dropnu starou tabulku attributes_subproducts\n\n\t\t$drop_old_attributes_subproducts = \"DROP TABLE IF EXISTS attributes_subproducts\";\n\n\t\t$this->DatabaseTransformer->query($drop_old_attributes_subproducts);\n\n\n\n\t\t// a vytvorim si novou\n\n\t\t$create_new_attributes_subproducts = \"\n\n\t\t\tCREATE TABLE IF NOT EXISTS `attributes_subproducts` (\n\n\t\t\t `id` int(10) unsigned NOT NULL auto_increment,\n\n\t\t\t `created` datetime NOT NULL,\n\n\t\t\t `modified` datetime NOT NULL,\n\n\t\t\t `attribute_id` int(10) unsigned NOT NULL,\n\n\t\t\t `subproduct_id` int(10) unsigned NOT NULL,\n\n\t\t\t PRIMARY KEY (`id`)\n\n\t\t\t)\n\n\t\t\";\n\n\t\t$this->DatabaseTransformer->query($create_new_attributes_subproducts);\n\n\t\t\n\n\t\t// nactu si produkty\n\n\t\tApp::import('Model', 'Product');\n\n\t\t$this->Product = &new Product;\n\n\n\n\t\t// prenastavim zdroje pro modely na zalozni tabulky\n\n\t\t$this->Product->setSource('old_products');\n\n\t\t$this->Product->Subproduct->setSource('old_subproducts');\n\n\t\t$this->Product->Subproduct->Attribute->setSource('old_attributes');\n\n//\t\t$this->Product->Subproduct->Attribute->Value->setSource('old_values');\n\n\t\t\t\n\n\t\t// nactu idcka produktu\n\n\t\t$products = $this->Product->find('all', array(\n\n//\t\t\t'conditions' => array('Product.id >' => 895),\n\n\t\t\t'order' => array('Product.id' => 'asc'),\n\n\t\t\t'contain' => array(\n\n\t\t\t\t'Subproduct' => array(\n\n\t\t\t\t\t'Attribute' => array(\n\n\t\t\t\t\t\t'Option'//, 'Value'\n\n\t\t\t\t\t),\n\n\t\t\t\t\t'fields' => array('id', 'price')\n\n\t\t\t\t\t\n\n\t\t\t\t)\n\n\t\t\t),\n\n\t\t\t'fields' => array('id')\n\n\t\t));\n\n\n\n\t\t// nastavim zdroje pro modely zpatky na nove tabulky\n\n\t\t$this->Product->setSource('products');\n\n\t\t$this->Product->Subproduct->setSource('subproducts');\n\n\t\t\t\n\n\t\t// vyfiltruju produkty, ktere nemaji subprodukty\n\n\t\t$products = array_filter($products, array('DatabaseTransformersController', 'leave_empty'));\n\n\t\n\n\t\t// pro kazdy ze zbylych produktu (co maji subprodukty)\n\n\t\tforeach ($products as $product) {\n\n\t\t\t// inicializace\n\n\t\t\t$subproducts = array();\n\n\t\t\t// pro kazdy subprodukt aktualniho produktu\n\n\t\t\tforeach ($product['Subproduct'] as $subproduct) {\n\n\t\t\t\t// generuju pole subproduktu podle option_id\n\n\t\t\t\tif (isset($subproduct['Attribute']['option_id'])) {\n\n\t\t\t\t\t$subproducts[$subproduct['Attribute']['option_id']][] = $subproduct;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\n\t\t\t// vygeneruju si nove subprodukty s jejich atributy\n\n\t\t\t$combinations = $this->DatabaseTransformer->combine($subproducts);\n\n\t\t\tforeach ($combinations as $combination) {\n\n\t\t\t\t// vytvorim subprodukt\n\n\t\t\t\t$new_subproduct = array();\n\n\t\t\t\t$new_subproduct['Subproduct']['product_id'] = $product['Product']['id'];\n\n\t\t\t\tunset($this->Product->Subproduct->id);\n\n\t\t\t\t// ulozim\n\n\t\t\t\tif (!$this->Product->Subproduct->save($new_subproduct)) {\n\n\t\t\t\t\tdebug($product);\n\n\t\t\t\t\tdebug($new_subproduct);\n\n\t\t\t\t\tdie('CHYBA');\n\n\t\t\t\t}\n\n\t\t\t\tdebug($this->Product->Subproduct->id);\n\n\t\t\t\t// zapamatuju si jeho idcko, abych ho pak mohl pridavat do vztahu mezi subproduktem a atributy\n\n\t\t\t\t$subproduct_id = $this->Product->Subproduct->id;\n\n\t\t\t\t// inicializace prirustkove ceny subproduktu\n\n\t\t\t\t$subproduct_price = 0;\n\n\t\t\t\t// prochazim mozne kombinace\n\n\t\t\t\tforeach ($combination as $attributes_subproduct) {\n\n\t\t\t\t\t// generuju vztahy mezi subproduktem a atributy\n\n\t\t\t\t\t$new_attributes_subproduct = array();\n\n\t\t\t\t\t$new_attributes_subproduct['AttributesSubproduct']['subproduct_id'] = $subproduct_id;\n\n\t\t\t\t\t$new_attributes_subproduct['AttributesSubproduct']['attribute_id'] = $attributes_subproduct['Attribute']['id'];\n\n\t\t\t\t\t$subproduct_price += $attributes_subproduct['price'];\n\n\t\t\t\t\t// ulozim\n\n\t\t\t\t\t$insert = \"\n\n\t\t\t\t\t\tINSERT INTO attributes_subproducts (subproduct_id, attribute_id)\n\n\t\t\t\t\t\tVALUES (\" . $new_attributes_subproduct['AttributesSubproduct']['subproduct_id'] . \", \" . $new_attributes_subproduct['AttributesSubproduct']['attribute_id'] . \")\n\n\t\t\t\t\t\";\n\n\t\t\t\t\t$this->DatabaseTransformer->query($insert);\n\n\t\t\t\t\t// updatuju prirustkovou cenu subproduktu\n\n\t\t\t\t\t$this->Product->Subproduct->contain();\n\n\t\t\t\t\t$this->Product->Subproduct->read(null, $subproduct_id);\n\n\t\t\t\t\t$this->Product->Subproduct->set(array(\n\n\t\t\t\t\t\t'price_with_dph' => $subproduct_price\n\n\t\t\t\t\t));\n\n\t\t\t\t\t$this->Product->Subproduct->save();\n\n\t\t\t\t}\n\n\t\t\t\t// vytvorim vztahy mezi subproduktem a jeho atributy z pole combinations\n\n\t\t\t}\n\n\t\t}\n\n\t\tdie('hotovo');\n\n\t}",
"protected function addProducts()\n {\n /**\n * @var $cartProduct \\Extcode\\Cart\\Domain\\Model\\Cart\\Product\n */\n foreach ($this->cart->getProducts() as $cartProduct) {\n if ($cartProduct->getBeVariants()) {\n $this->addProductVariants($cartProduct);\n } else {\n $this->addProduct($cartProduct);\n }\n }\n }",
"function testAddMultipleProductSubTotal()\n {\n // first product\n $id = '1';\n $description = 'Um produto muito bom!';\n $quantity = 2;\n $value = 21.50;\n $this->process->addProduct($id, $description, $quantity, $value);\n\n // second product\n $id = '2';\n $description = 'Outro produto da minha loja';\n $quantity = 1;\n $value = 44.10;\n $this->process->addProduct($id, $description, $quantity, $value);\n\n // third product\n $id = '3';\n $description = 'Outro produto da minha loja';\n $quantity = 7;\n $value = 3.10;\n $this->process->addProduct($id, $description, $quantity, $value);\n\n $this->assertEquals(108.8, $this->process->getOrderSubTotal());\n }",
"function subproduct($data, $subproduct_price = 0) {\t\r\n\t\tif(isset($data['Product'])) {\r\n\t\t\t$data = $data['Product'];\r\n\t\t} \r\n\t\r\n\t\tif($data['special_price'] > 0) {\r\n\t\t\t$special_price = true;\r\n\t\t\t$price = $data['special_price'];\r\n\t\t} else {\r\n\t\t\t$price = $data['price'];\r\n\t\t}\r\n\t\t\r\n\t\tif(($subproduct_price != 0)) {\r\n\t\t\t$price = $price + $subproduct_price;\r\n\t\t\t$price = $this->currency($price);\r\n\t\t} else {\r\n\t\t\t$price = '';\r\n\t\t}\r\n\t\treturn $price;\r\n }",
"public function addProducts(array $products);",
"public function setSubProductId($subProductId);",
"public function addOrderProducts() {\n \n }",
"public function subirAllProducts() {\n\t\t$all_active_products = E_Prod_Vtex_Activos::getAllProductosActivos();\n\t\t\n\t\t/*Valido si no hay ningun producto subido en VTEX*/\n\t\tif (count($all_active_products) == 0) {\n\t\t\t/*Llamo a la funcion para subir los productos*/\n\t\t\t$all_products = Tp_adic::getAllProducts();\n\t\t\tinsertProducts($all_products);\n\n\t\t} else {\n\t\t\t/*Subir lote de productos cuando ya existen otros activos en la Plataforma de Pisano*/\n\t\t\n\t\t\t$list_sku_activos = array();\n\n\t\t\tforeach ($all_active_products as $key => $value) {\n\t\t\t\t$list_sku_activos[] = $value->sku;\n\t\t\t}\n\n\t\t\t/*Obtengo todos los productos que no estan activos en VTEX*/\n\t\t\t$all_products = tp_adic::getAllProductosNoActivos($list_sku_activos);\n\t\t\tinsertProducts($all_products);\n\n\t\t}\n\n\t}",
"function fetch_prod_arbo($prod, $compl_path=\"\", $multiply=1, $level=1, $id_parent=0)\n\t{\n\t\tglobal $conf,$langs;\n\n\t\t$product = new Product($this->db);\n\t\t//var_dump($prod);\n\t\tforeach($prod as $id_product => $desc_pere)\t// $id_product is 0 (first call starting with root top) or an id of a sub_product\n\t\t{\n\t\t\tif (is_array($desc_pere))\t// If desc_pere is an array, this means it's a child\n\t\t\t{\n\t\t\t\t$id=(! empty($desc_pere[0]) ? $desc_pere[0] :'');\n\t\t\t\t$nb=(! empty($desc_pere[1]) ? $desc_pere[1] :'');\n\t\t\t\t$type=(! empty($desc_pere[2]) ? $desc_pere[2] :'');\n\t\t\t\t$label=(! empty($desc_pere[3]) ? $desc_pere[3] :'');\n\t\t\t\t$incdec=!empty($desc_pere[4]) ? $desc_pere[4] : 0;\n\n\t\t\t\tif ($multiply < 1) $multiply=1;\n\n\t\t\t\t//print \"XXX We add id=\".$id.\" - label=\".$label.\" - nb=\".$nb.\" - multiply=\".$multiply.\" fullpath=\".$compl_path.$label.\"\\n\";\n\t\t\t\t$this->fetch($id);\t\t// Load product\n\t\t\t\t$this->load_stock('nobatch,novirtual');\t// Load stock to get true this->stock_reel\n\t\t\t\t$this->res[]= array(\n\t\t\t\t\t'id'=>$id,\t\t\t\t\t// Id product\n\t\t\t\t\t'id_parent'=>$id_parent,\n\t\t\t\t\t'ref'=>$this->ref,\t\t\t// Ref product\n\t\t\t\t\t'nb'=>$nb,\t\t\t\t\t// Nb of units that compose parent product\n\t\t\t\t\t'nb_total'=>$nb*$multiply,\t// Nb of units for all nb of product\n\t\t\t\t\t'stock'=>$this->stock_reel,\t// Stock\n\t\t\t\t\t'stock_alert'=>$this->seuil_stock_alerte,\t// Stock alert\n\t\t\t\t\t'label'=>$label,\n\t\t\t\t\t'fullpath'=>$compl_path.$label,\t\t\t// Label\n\t\t\t\t\t'type'=>$type,\t\t\t\t// Nb of units that compose parent product\n\t\t\t\t\t'desiredstock'=>$this->desiredstock,\n\t\t\t\t\t'level'=>$level,\n\t\t\t\t\t'incdec'=>$incdec,\n\t\t\t\t\t'entity'=>$this->entity\n\t\t\t\t);\n\n\t\t\t\t// Recursive call if there is childs to child\n\t\t\t\tif (is_array($desc_pere['childs']))\n\t\t\t\t{\n\t\t\t\t\t//print 'YYY We go down for '.$desc_pere[3].\" -> \\n\";\n\t\t\t\t\t$this->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3].\" -> \", $desc_pere[1]*$multiply, $level+1, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function add(){\n\t\t\t$this->insertData($this->getTblProduct(),$this->getArrayDatas());\n\t}",
"public function addProducts()\n {\n $this->_rootElement->find($this->addProducts)->click();\n }",
"protected function addSubsection(Product $product)\n {\n $this->chain($product, 'name');\n $product->name .= $this->_original;\n $product->subsection = mb_convert_case($this->_original, MB_CASE_TITLE);\n }",
"public function changeSubProduct() {\n $slug = array_values(array_slice(explode('/', url()->previous()), -1))[0];\n $set = Set::where('alias', $slug)->first();\n $this->_ifExists($set);\n\n $subproduct = SubProduct::find(request('subproductId'));\n if(count($subproduct) > 0) {\n\n if(session()->get('subproductsId')) {\n foreach (session()->get('subproductsId') as $key => $subproductId) {\n $subproductsId[$key] = $subproductId;\n }\n }\n\n $subproductsId[$subproduct->product_id] = $subproduct->id;\n\n session(['subproductsId' => $subproductsId]);\n\n $data['subproducts'] = view('front.inc.products', compact('set'))->render();\n return json_encode($data);\n } else {\n return response()->json('Something failed', 400);\n }\n }",
"private function calculateSubtotals()\n {\n for ($i = 0; $i < count($this->productPrice); $i++) {\n $subtotals[] = $this->productPrice[$i] * $this->productOrderQty[$i];\n }\n\n $this->productSubtotal = $subtotals;\n }",
"public function attachProductData($data) {\n\t\t\n\t\tif (isset($data['CartItem'])) {\n\t\t\t\n\t\t\t$productIDs = Set::extract('CartItem.{n}.product_id', $data);\n\t\t\t$conditionsForProduct = array(\n\t\t\t\t\t// Product Data\t\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Product.visible' =>true,\n\t\t\t\t\t\t'Product.id' \t =>$productIDs,\n\t\t\t\t\t),\n\t\t\t\t\t'contain' => array(\n\t\t\t\t\t\t'ProductImage'=>array(\n\t\t\t\t\t\t 'fields' => array('filename'),\n\t\t\t\t\t\t 'order'=>array(\n\t\t\t\t\t\t\t\t'ProductImage.cover DESC')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t\t'Variant' => array(\n\t\t\t\t\t\t\t'order'=>'Variant.order ASC',\n\t\t\t\t\t\t\t'VariantOption' => array(\n\t\t\t\t\t\t\t\t'fields' => array('id', 'value', 'field', 'variant_id'),\n\t\t\t\t\t\t\t\t'order' => 'VariantOption.order ASC',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t\t'ProductsInGroup'=>array(\n\t\t\t\t\t\t 'fields' => array(\n\t\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t\t'product_id'),\n\t\t\t\t\t\t \n\t\t\t\t\t\t 'ProductGroup'=>array(\n\t\t\t\t\t\t\t 'fields' => array(\n\t\t\t\t\t\t\t\t\t'id', \n\t\t\t\t\t\t\t\t\t'title', 'handle',\n\t\t\t\t\t\t\t\t\t'description', 'visible_product_count',\n\t\t\t\t\t\t\t\t\t'url', 'vendor_count'),\n\t\t\t\t\t\t )\n\t\t\t\t\t )\n\t\t\t\t ),\n\t\t\t\t\t'link' => array('Vendor'=>array('fields'=>array('id', 'title'))),\n\t\t\t\t);\n\t\t\t\n\t\t\t/**\n\t\t\t * $products is in the form of {n}=>array(Product, ProductImage, ProductsInGroup=>array(ProductGroup))\n\t\t\t **/\n\t\t\t$products = $this->Product->find('all', $conditionsForProduct);\n\t\t\t\n\t\t\t$originalIndex = array_keys($data['CartItem']);\n\t\t\t\n\t\t\t// then we use product_id as the index in $products to facilitate the insertion\n\t\t\t$products = Set::combine($products, '{n}.Product.id', '{n}');\n\t\t\t\n\t\t\t// now we insert the Product data\n\t\t\tforeach($data['CartItem'] as $id=>$item) {\n\t\t\t\t$product_id = $item['product_id'];\n\t\t\t\tif (!empty($products[$product_id])) {\n\t\t\t\t\t$data['CartItem'][$id]['Product'] = $products[$product_id]['Product'];\n\t\t\t\t\t$data['CartItem'][$id]['ProductImage'] = $products[$product_id]['ProductImage'];\n\t\t\t\t\t$data['CartItem'][$id]['ProductsInGroup'] = $products[$product_id]['ProductsInGroup'];\n\t\t\t\t\t$data['CartItem'][$id]['Variant']\t= $products[$product_id]['Variant'];\n\t\t\t\t\t$data['CartItem'][$id]['Vendor']\t= $products[$product_id]['Vendor'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// now we put the original index back\n\t\t\t$cartItems = array_values($data['CartItem']);\n\t\t\t$data['CartItem'] = array_combine($originalIndex, $cartItems);\n\n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"public function admin_add() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['ShopBranchStock'][0]['shop_branch_id'] = '5076d76c-6710-47cc-8f7e-0aeac0a80102';\n\t\t\ttry {\n\t\t\t\tif ($this->{$this->modelClass}->saveProduct($this->request->data)) {\n\t\t\t\t\t$this->notice('saved');\n\t\t\t\t}\n\t\t\t\t$this->notice('not_saved');\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$this->notice($e);\n\t\t\t}\n\t\t}\n\n\t\t$shopImages = $this->ShopProduct->ShopImage->find('list');\n\t\t$shopCategories = $this->ShopProduct->ShopCategoriesProduct->ShopCategory->generateTreeList();\n\t\t$shopSuppliers = $this->ShopProduct->ShopSupplier->find('list');\n\t\t$shopBrands = $this->ShopProduct->ShopBrand->find('list');\n\t\t$shopProductTypes = $this->ShopProduct->ShopProductType->find('list');\n\t\t$shopBranches = $this->ShopProduct->ShopBranchStock->ShopBranch->find('all', array(\n\t\t\t'contain' => array(\n\t\t\t\t'ContactBranch.name',\n\t\t\t\t'Manager.full_name'\n\t\t\t)\n\t\t));\n\t\t$this->set(compact('shopImages', 'shopCategories', 'shopSuppliers', 'shopBrands', 'shopProductTypes', 'shopBranches'));\n\t}",
"public function append_product()\n\t{\n\t\t$product_id = $this->input->post(\"product_id\");\n\t\t$vendor_id = $this->input->post(\"vendor_id\");\n\t\t$initial_stock = $this->input->post(\"stock\");\n\t\t$initial_price = $this->input->post(\"price\");\n\t\tif ($this->vendor->add_product($vendor_id, $product_id, $initial_stock, $initial_price)) \n\t\t{\n\t\t\t$this->products();\n\t\t}\t\n\t}",
"public function addProduct()\r\n {\r\n }",
"function uc_order_edit_products_add($form, &$form_state) {\n $form_state['products_action'] = 'products_select';\n $form_state['refresh_products'] = TRUE;\n $form_state['rebuild'] = TRUE;\n $order = $form_state['build_info']['args'][0];\n\n $data = module_invoke_all('uc_add_to_cart_data', $form_state['values']['product_controls']);\n $product = uc_product_load_variant(intval($form_state['values']['product_controls']['nid']), $data);\n $product->qty = isset($form_state['values']['product_controls']['qty']) ? $form_state['values']['product_controls']['qty'] : $product->default_qty;\n\n drupal_alter('uc_order_product', $product, $order);\n uc_order_product_save($order->order_id, $product);\n $order->products[] = $product;\n\n uc_order_log_changes($order->order_id, array('add' => t('Added (@qty) @title to order.', array('@qty' => $product->qty, '@title' => $product->title))));\n\n // Decrement stock.\n if (module_exists('uc_stock')) {\n uc_stock_adjust_product_stock($product, 0, $order);\n }\n\n // Add this product to the form values for accurate tax calculations.\n $form_state['values']['products'][] = (array) $product;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation addItemReceiptActivityAsync Create an itemReceiptActivity | public function addItemReceiptActivityAsync($body)
{
return $this->addItemReceiptActivityAsyncWithHttpInfo($body)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function addItemReceiptActivity($body)\n {\n list($response) = $this->addItemReceiptActivityWithHttpInfo($body);\n return $response;\n }",
"public function addItemReceiptActivityAsyncWithHttpInfo($body)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\ItemReceiptActivity';\n $request = $this->addItemReceiptActivityRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function addOrderLineActivity($body)\n {\n list($response, $statusCode, $httpHeader) = $this->addOrderLineActivityWithHttpInfo ($body);\n return $response; \n }",
"protected function addItemReceiptActivityRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addItemReceiptActivity'\n );\n }\n\n $resourcePath = '/beta/itemReceiptActivity';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function addItemReceiptActivityAuditRequest($item_receipt_activity_id, $item_receipt_activity_audit)\n {\n // verify the required parameter 'item_receipt_activity_id' is set\n if ($item_receipt_activity_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_receipt_activity_id when calling addItemReceiptActivityAudit'\n );\n }\n // verify the required parameter 'item_receipt_activity_audit' is set\n if ($item_receipt_activity_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_receipt_activity_audit when calling addItemReceiptActivityAudit'\n );\n }\n\n $resourcePath = '/beta/itemReceiptActivity/{itemReceiptActivityId}/audit/{itemReceiptActivityAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($item_receipt_activity_id !== null) {\n $resourcePath = str_replace(\n '{' . 'itemReceiptActivityId' . '}',\n ObjectSerializer::toPathValue($item_receipt_activity_id),\n $resourcePath\n );\n }\n // path params\n if ($item_receipt_activity_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'itemReceiptActivityAudit' . '}',\n ObjectSerializer::toPathValue($item_receipt_activity_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addItemReceiptActivityWithHttpInfo($body)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\ItemReceiptActivity';\n $request = $this->addItemReceiptActivityRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\ItemReceiptActivity',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\ApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function addItemReceiptActivityAuditAsync($item_receipt_activity_id, $item_receipt_activity_audit)\n {\n return $this->addItemReceiptActivityAuditAsyncWithHttpInfo($item_receipt_activity_id, $item_receipt_activity_audit)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addActivity($data);",
"public function add($item)\n {\n $timelineItem = new TimelineItem();\n $timelineItem->timeline = $this->id;\n $timelineItem->item = ($item instanceof Item) ? $item->itemId : $item;\n return $timelineItem->save();\n }",
"protected function getDuplicateItemReceiptActivityByIdRequest($item_receipt_activity_id)\n {\n // verify the required parameter 'item_receipt_activity_id' is set\n if ($item_receipt_activity_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_receipt_activity_id when calling getDuplicateItemReceiptActivityById'\n );\n }\n\n $resourcePath = '/beta/itemReceiptActivity/duplicate/{itemReceiptActivityId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($item_receipt_activity_id !== null) {\n $resourcePath = str_replace(\n '{' . 'itemReceiptActivityId' . '}',\n ObjectSerializer::toPathValue($item_receipt_activity_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function addItemReceiptActivityFileByURLRequest($body, $item_receipt_activity_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addItemReceiptActivityFileByURL'\n );\n }\n // verify the required parameter 'item_receipt_activity_id' is set\n if ($item_receipt_activity_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_receipt_activity_id when calling addItemReceiptActivityFileByURL'\n );\n }\n\n $resourcePath = '/beta/itemReceiptActivity/{itemReceiptActivityId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($item_receipt_activity_id !== null) {\n $resourcePath = str_replace(\n '{' . 'itemReceiptActivityId' . '}',\n ObjectSerializer::toPathValue($item_receipt_activity_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addItemReceiptActivityTagAsync($item_receipt_activity_id, $item_receipt_activity_tag)\n {\n return $this->addItemReceiptActivityTagAsyncWithHttpInfo($item_receipt_activity_id, $item_receipt_activity_tag)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public static function AddActivity($activity){\n $activity->Insert();\n }",
"protected function deleteItemReceiptActivityRequest($item_receipt_activity_id)\n {\n // verify the required parameter 'item_receipt_activity_id' is set\n if ($item_receipt_activity_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_receipt_activity_id when calling deleteItemReceiptActivity'\n );\n }\n\n $resourcePath = '/beta/itemReceiptActivity/{itemReceiptActivityId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($item_receipt_activity_id !== null) {\n $resourcePath = str_replace(\n '{' . 'itemReceiptActivityId' . '}',\n ObjectSerializer::toPathValue($item_receipt_activity_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create(NoteActivity $activity): NoteActivity\n {\n $response = $this->client->post($this->prepareUrlForKey('add-note'), [], $activity->jsonSerialize());\n $responseData = $response->getDecodedBody();\n\n return new NoteActivity($responseData);\n }",
"public function addItemReceiptActivityFileByURLAsyncWithHttpInfo($body, $item_receipt_activity_id)\n {\n $returnType = '';\n $request = $this->addItemReceiptActivityFileByURLRequest($body, $item_receipt_activity_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function getItemReceiptActivityTagsRequest($item_receipt_activity_id)\n {\n // verify the required parameter 'item_receipt_activity_id' is set\n if ($item_receipt_activity_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_receipt_activity_id when calling getItemReceiptActivityTags'\n );\n }\n\n $resourcePath = '/beta/itemReceiptActivity/{itemReceiptActivityId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($item_receipt_activity_id !== null) {\n $resourcePath = str_replace(\n '{' . 'itemReceiptActivityId' . '}',\n ObjectSerializer::toPathValue($item_receipt_activity_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addActivity($event)\n {\n if (!App::runningInConsole()) {\n Activity::create([\n 'actor_id' => Auth::check() ? Auth::id() : null,\n 'subject_id' => $this->getKey(),\n 'subject_type' => get_class($this),\n 'action' => $event,\n ]);\n }\n }",
"public function createFeedItem() {\n\t\t$body = file_get_contents('php://input');\n\t\t$feedItem = FeedItem::createModelFromJson($body);\n\t\t$service = new ActivityStreamService($this->contextUser, $this->repository);\n\t\t$feedItem = $service->createFeedItem($feedItem);\n\t\treturn $feedItem;\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all the menu items. | public function getAllMenuItems(){
$this->db->select('*')->from(TABLES::$MENU_ITEM_TABLE)->order_by('name','asc');
$query = $this->db->get();
$result = $query->result_array();
return $result;
} | [
"public function all()\n {\n return $this->menu->all();\n }",
"function getMenuItems()\n {\n }",
"public function getAvailableMenuItems(){\n\n $menuItems = $this->MenuItem->getAvailableMenuItems( $this->Auth->user['uid'] );\n\n $this->set( 'menuItems', $menuItems );\n $this->set( '_serialize', [\n 'menuItems'\n ]);\n\n }",
"abstract public function getMenus();",
"private function getMenuItems()\n {\n if (null === $this->menuItems) {\n $this->menuItems = $this->_renderer\n ->getApplication()\n ->getContainer()->get('cloud.global_content_factory')\n ->getHeaderMenu()\n ->getParamValue('items');\n }\n\n return $this->menuItems;\n }",
"private function getMenuItems()\n {\n $sql = \"SELECT * FROM menu_items\";\n if($result = $this->db->conn->query($sql))\n {\n while($resultArray = $result->fetch_assoc())\n {\n array_push($this->menuItemArray, new MenuItem($resultArray['item_id'], $resultArray['item_name'], $resultArray['item_price'], $resultArray['item_description'], $resultArray['item_category'], $resultArray['item_picture_name'], $resultArray['make_time']));\n }\n }\n }",
"public function getMenuItems() {\n\t\treturn $this->menuItems;\n\t}",
"public function getMenuItems()\n {\n return $this->adminMenu->all();\n }",
"function get_all_menu()\n {\n $this->builder->orderBy('id');\n return $this->builder->get()->getResultArray();\n }",
"public function getMenuItems(){\n return MenuItem::query()->where('parent_id', '=', null)->where('menuItem','=',true)->get();\n }",
"public function getAllMenuItems()\n {\n return $this->db->query('SELECT admin_menu.*, a.name as parent from admin_menu left join admin_menu a on a.id=admin_menu.parent')->result_array();\n }",
"public function retrieveAll()\n {\n return Menu::all();\n }",
"public function getAllMenu(){\n $query = $this->db->get('s_menu');\n return $query->custom_result_object('Menu');\n }",
"public static function getMenuItems(){\n\t\t$menuItems = array();\n\t\t$condition = array('order'=>'menu_order ASC');\n\t\t$items = Menus::model()->findAll($condition);\n\n\t\tforeach($items as $i){\n\t\t\t/**\n\t\t\t*the link should be created differently\n\t\t\t* depending on how the items in it are stored\n\t\t\t*/\n\t\t\tif($i->link =='home')\n\t\t\t\t$link = Yii::app()->createAbsoluteUrl('cinema/index');\n\t\t\telse if($i->link !='' && $i->static_id !=0 )\n\t\t\t\t$link = array(trim($i->link),'id'=>$i->static_id);\n\t\t\telse if($i->link !='' && $i->static_id ==0)\n\t\t\t\t$link = array(trim($i->link));\n\t\t\telse \n\t\t\t\t$link = '';\n\n\t\t\t$menuItems[] = array(\n\t\t\t\t'label'=>$i->name,\n\t\t\t\t'url'=>$link\n\t\t\t);\n\t\t}\n\t\treturn $menuItems;\n\t}",
"public static function getAllMenu()\n {\n $rows = Yii::$app->cache->get(\"BackendMenu:all\");\n if (false === is_array($rows)) {\n $rows = static::find()\n ->orderBy('parent_id ASC, sort_order ASC')\n ->asArray()\n ->all();\n Yii::$app->cache->set(\n \"BackendMenu:all\",\n $rows,\n 86400,\n new TagDependency([\n 'tags' => [\n ActiveRecordHelper::getCommonTag(static::className())\n ]\n ])\n );\n }\n // rebuild rows to tree $all_menu_items\n $all_menu_items = Tree::rowsArrayToMenuTree($rows, 1, 1, false);\n return $all_menu_items;\n }",
"public function getChildrenMenuitems(){\n\t\treturn $this->getResource()->getChildrenMenuitems($this);\n\t}",
"public function getMenuItems() {\n\n $url = $this->urlHelper;\n $items = [];\n\n //Links Visible always to everyone logged in or not.\n //default Home page - no login required. \n\n /* $items[] = [\n 'id' => 'home',\n 'label' => 'Home',\n 'link' => $url('home')\n ]; */\n\n //add links here for pages that will be visible for all users logged-in or not.\n //you must adjust User\\Module.php (~line 85) onDispatch method to ignore calls for \n //the associated Controller and action or you will end up with an infinite loop.\n /*\n $items[] = [\n 'id' => 'about',\n 'label' => 'About',\n 'link' => $url('about')\n ];\n */\n\n $user = $this->authManager->getLoggedInUser();\n\n //BEGIN Authentication/Rendering Logic\n // Display \"Login\" menu item for not authorized user only. On the other hand,\n // display \"Admin\" and \"Logout\" menu items only for authorized users and any other links \n // that should be visible by logged-in users.\n if (!$user) {\n\n $items[] = [\n 'id' => 'login',\n 'label' => 'Sign in',\n 'link' => $url('login'),\n 'float' => 'right'\n ];\n } else {\n\n //render Customers link for all users with sales_attr_id value in users table\n if (!empty($user->getSales_attr_id())) {\n $items[] = [\n 'id' => 'customers',\n 'label' => 'Customers',\n 'data-ffm-salesperson' => $user->getFullName(),\n 'float' => 'static',\n 'link' => $url('customer', ['action' => 'view', 'id' => $user->getSales_attr_id()])\n ];\n }\n //only display admin drop down for admin users.\n $isAdmin = $this->authManager->isAdmin();\n if ($isAdmin) {\n $items[] = [\n 'id' => 'admin',\n 'label' => '<i class=\"ion-gear-a\"></i>',\n 'float' => 'right',\n 'dropdown' => [\n [\n 'id' => 'users',\n 'label' => 'Manage Users',\n 'link' => $url('users')\n ]\n ]\n ];\n }\n\n $settingsDropDownManageAccount = [\n 'id' => 'manage_account',\n 'label' => 'Manage Account',\n 'link' => $url('users', ['action' => 'edit', 'id' => $user->getId()])\n ];\n\n $settingsDropDownViewAccount = [\n 'id' => 'view_account',\n 'label' => 'View Account',\n 'link' => $url('application', ['action' => 'settings'])\n ];\n\n $settingsDropDownLogout = [\n 'id' => 'logout',\n 'label' => 'Logout',\n 'link' => $url('logout')\n ];\n\n $settingsDropDown = [];\n\n //only add the Manage Account link for Admins.\n if ($isAdmin) {\n $settingsDropDown[] = $settingsDropDownManageAccount;\n }\n\n $settingsDropDown[] = $settingsDropDownViewAccount;\n\n $settingsDropDown[] = $settingsDropDownLogout;\n\n $items[] = [\n 'id' => 'settings',\n 'label' => '<i class=\"ion-person\"></i>' . $user->getUsername(),\n 'float' => 'right',\n 'dropdown' => $settingsDropDown\n ];\n\n $loggedInItems = $this->getLoggedInItems();\n\n if ($loggedInItems)\n array_merge($items, $loggedInItems);\n\n // add items to right of settings in top right corner only for logged-in users here\n //Show Salespeople link only to Admin users\n if ($isAdmin) {\n\n $items[] = [\n 'id' => 'salespeople',\n 'label' => 'Salespeople',\n 'float' => 'static',\n 'link' => $url('salespeople', ['action' => 'index']),\n ];\n }\n }\n\n return $items;\n }",
"public function getMenuItems() {\n $url = $this->urlHelper;\n //This variable ARRAY $items[] will contain all menu items that will be shown \n $items = [];\n \n //Home Menu: setOptions($id, $label, $route, $floating)\n $items[]= $this->setOptions('home', 'Home', 'home', '');\n \n /* \n * Display \"Login\" menu item for not authorized user only. On the other hand,\n * display \"Admin\" and \"Logout\" menu items only for authorized users. \n */\n if (!$this->authService->hasIdentity()) { \n $items[]= $this->setOptions('login', 'Sign in', 'login', 'right'); \n } \n else { //CREATE A DYNAMIC MENUS WITH THE OPTIONS GIVEN OR ASSIGNED TO EACH MENU \n \n /* \n * - getMainMenuPermissions(): \n * it returns an array with the menu and its permission associated by the Menu Role, \n * which will be tested against the RBAC \n */\n \n $mainMenuPermissions = $this->getMainMenuPermissions(); \n //$mainMenu1 = [\"management\", \"marketing\", \"mis\", \"purchasing\", \"quality\",\n // \"manufacturing\", \"sales\",\"receiving\",\"warehourse\",\"maintenance\"]; \n \n \n /*\n * Getting params\n * \n * - Label: It's a string that idenfifies ONE item of the Main Menu \n * - $menuOptions : It receives the items of menu will be rendered\n * - Id, Label and $menuOptions are passed to the method:\n * addOptionToMenuDropDown to be added to Menu Items \n */\n \n //----- Menus will be added -----\n $mainMenu = [\n \"management\", //\"marketing\", \"mis\", \n \"purchasing\", //\"quality\",\"manufacturing\", \n \"sales\",\n \"receiving\",\n \"warehouse\", //\"maintenance\"\n \"admin\", \n ];\n \n // rendering the menus dynamically \n foreach ($mainMenu as $moduleName) {\n //getting the permission associated to menu :(+menu.purchasing, +menu.admin etc)\n //echo $mainMenuPermissions[$moduleName]['permission'].\"<br>\"; \n $menuOptions = $this->addOptionsToMenu($mainMenuPermissions[$moduleName]['permission']); \n // $id (it's like a name of object\n $id = $mainMenuPermissions[$moduleName]['id']; \n $label = $mainMenuPermissions[$moduleName]['label']; \n $items[] = $this->setOptionsToMenu( $id, $label, $menuOptions );\n }\n \n /*\n * Adding About Menu\n */\n $items[] = $this->setOptions('about', 'About', 'about',''); \n \n /*\n * Adding Sing in Menu \n */\n $items[] = [\n 'id' => 'logout',\n 'label' => $this->authService->getIdentity(),\n 'float' => 'right',\n 'dropdown' => [\n [\n 'id' => 'settings',\n 'label' => 'Settings',\n 'link' => $url('application', ['action'=>'settings'])\n ],\n [\n 'id' => 'logout',\n 'label' => 'Sign out',\n 'link' => $url('logout')\n ],\n ]\n ];\n }\n \n return $items;\n }",
"public static function getAllMenus()\n {\n $allMenus = static::find()->where(['status' => MENU_ACTIVE, 'deleted' => MENU_NOT_DELETED,\n 'module_id' => MENU_BACKEND])->all();\n// $menus = [];\n// foreach ($allMenus as $menu) {\n// if (self::checkMenuPermission($menu)) {\n// $menus[] = $menu;\n// }\n// }\n return $allMenus;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
summarizeBackup prepareOutput Prepare data for storing on wiki Call: $output = prepareOutput($dirContent,$level); Where: $output text data for storing on wiki $dirContent dir content in the format returned by loadDir $level level of file/directory for recursive calls | function prepareOutput($dirContent,$level=0) {
$result = '';
if ($level > SHOW_LEVELS) { // Don't show more than SHOW_LEVELS levels
return '';
}
// Process files
if (isset($dirContent['FILES']) && $dirContent['FILES']) {
ksort($dirContent['FILES']); // Sort files
foreach ($dirContent['FILES'] as $key => $val) {
$result .= formatOutput($key,$val,$level);
}
}
else if (SHOW_EMPTY) { // Add 'empty' string if dir is empty
$result .= str_repeat(LEVEL_CHAR, $level).' '.EMPTY_SIGN.NEW_REC;
}
// Process dirs
if (isset($dirContent['DIRS']) && $dirContent['DIRS']) {
ksort($dirContent['DIRS']); // Sort dirs
foreach ($dirContent['DIRS'] as $key => $val) {
$result .= formatOutput($key,$val['SIZE'],$level);
$result .= prepareOutput($val,$level+1);
}
}
return $result;
} | [
"function prepare(){\n //$jbkw_hdfs_kwl_file=\"/user/nstat/\".$this->day.\"/jbkw/kwl_sort\";\n $hdfs_se_sort_keywords_merge_links=\"/user/nstat/\".$this->day.\"/se_baidu/sort_keywords_merge_links\";\n //$this->jbkw_sortkeywords($hdfs_se_sort_keywords_merge_links);\n $jbkw_local_merge_dir=\"/tmp/jbkw_\".$this->day.\"_merge_\".rand();\n //$this->jbkw_simple_prepare($hdfs_se_sort_keywords_merge_links,$jbkw_local_merge_dir);\n $jbkw_preli_output=\"/user/nstat/\".$this->day.\"/jbkw/preli_output\";\n $jbkw_video_output=\"/user/nstat/\".$this->day.\"/jbkw/video_output\";\n // $this->jbkw_preli_step($jbkw_local_merge_dir,$jbkw_preli_output);\n // $this->jbkw_video_cate($jbkw_preli_output,$jbkw_video_output);\n $jbkw_sort_nv_output=\"/user/nstat/\".$this->day.\"/jbkw/sort_nv_output\";\n $this->merge_nv($jbkw_preli_output,$jbkw_video_output,$jbkw_sort_nv_output); \n\n\t}",
"public function rebuild_output_folders() {\n $this->log('== Rebuilding languages.md5 and lang-table.html files ==');\n\n foreach (new DirectoryIterator($this->outputdirroot) as $outputdir) {\n if (!$outputdir->isDir()) {\n continue;\n }\n\n if ($outputdir->isDot()) {\n continue;\n }\n\n $version = mlang_version::by_dir($outputdir->getFilename());\n\n $this->rebuild_languages_md5($version);\n $this->rebuild_download_page($version);\n }\n }",
"public function process() {\n $hash = md5(print_r($_REQUEST, true));\n $tmp = md5(time().rand());\n $temp = \"out/$tmp-dokuwiki-$hash.tgz\";\n $file = \"out/dokuwiki-$hash.tgz\";\n\n if(!file_exists($file)){\n // add dokuwiki itself\n $version = (string) $_REQUEST['version'];\n $version = $this->dirclean($version);\n if($version === '') $this->abort();\n $src = realpath(\"src/dokuwiki/$version\");\n if(!is_dir($src)) die('something went wrong');\n $this->addFolder($src);\n\n // add plugins\n foreach((array) $_REQUEST['plugins'] as $plugin){\n $plugin = $this->dirclean($plugin);\n $src = realpath(\"src/plugins/$plugin\");\n if(!is_dir($src)) continue;\n $this->addFolder($src, '', \"lib/plugins/$plugin\");\n //FIXME add plugin.data file?\n }\n\n // remove unwanted languages\n $langs = $_REQUEST['langs'];\n $langs = array_map(array($this, 'dirclean'), $langs);\n $langs[] = 'en';\n $langs = array_unique($langs);\n $langs = array_filter($langs);\n $this->stripLanguages($langs);\n\n // remove unwanted dirs\n $this->stripUnwanted();\n\n // on update only, remove same files\n if(!empty($_REQUEST['updateonly'])){\n $this->diffTo(realpath('src/dokuwiki/oldstable'));\n }\n\n // move into a sub directory\n $this->moveBase('dokuwiki');\n\n // add USB-Stick Support\n if(!empty($_REQUEST['onastick'])){\n foreach((array) $_REQUEST['onastick'] as $server){\n $server = $this->dirclean($server);\n $src = realpath(\"src/usbstick/$server\");\n if(!is_dir($src)) continue;\n $this->addFolder($src);\n }\n\n // make sure we have a single top directory\n $this->moveBase('DokuWikiStick');\n }\n\n $this->buildTar($temp);\n rename($temp, $file);\n }\n\n header('Location: get?id='.$hash);\n }",
"public function rebuild_output_folders() {\n $this->log('== Rebuilding index.php and languages.md5 files ==');\n\n foreach ($this->get_versions() as $version) {\n $packinfofile = $this->vardirroot.'/'.$version->dir.'/packinfo.ser';\n if (!file_exists($packinfofile)) {\n $this->log('File packinfo.ser not found for '.$version->dir, amos_cli_logger::LEVEL_WARNING);\n continue;\n }\n $packinfo = unserialize(file_get_contents($packinfofile));\n ksort($packinfo);\n\n $this->rebuild_languages_md5($version, $packinfo);\n $this->rebuild_index_php($version, $packinfo);\n $this->rebuild_index_tablehtml($version, $packinfo);\n }\n }",
"function prepareForBackup(){\n\t\tif(empty($this->plugins->backup))return;\n\t\tforeach($this->plugins->backup as $name=>&$backuper){\n\t\t\ttry{\n\t\t\t\t$backuper->prepareForBackup($this->index->base);\n\t\t\t\techo \"preparing backuping plugin $name <font color='green'>succeed</font>\\n<br/>\";\n\t\t\t}catch(Exception $err){\n\t\t\t\techo 'preparing backuping plugin '.$name.' <font color=\"red\">FAILED</font>: '.$err.\"\\n<br/>\";\n\t\t\t}\n\n\t\t}\n\t}",
"function makeBackups(){\n\t\tif(empty($this->plugins->backup))return;\n\t\tforeach($this->plugins->backup as $name=>&$backuper){\n\t\t\ttry{\n\t\t\t\t$res=$backuper->makeBackup($this->zip);\n\t\t\t\tif(isset($res)){\n\t\t\t\t\tif(isset($res['comment']))$this->comment.=$res['comment'];\n\t\t\t\t}\n\t\t\t\techo \"backuping plugin $name <font color='green'>succeed</font>\\n<br/>\";\n\t\t\t}catch(Exception $err){\n\t\t\t\techo $name.' backuping plugin '.$name.' <font color=\"red\">FAILED</font>: '.$err->getMessage().\"\\n<br/>\";\n\t\t\t}\n\t\t}\n\t}",
"public function backupHierarchy(){\n \t\tGLOBAL $SynchContentHierarchy;\n \t\t\n \t\t$backup = $SynchContentHierarchy->serializeHierarchyData();\n \t\t$this->saveToFile($backup, $this->getSerialisedNavFileName());\n\t\t\n \t}",
"private function _toFiles()\n {\n system(\"mkdir -p modules/\" . $this->_name);\n write_array_to_file(\"dictionary['\" . $this->_name . \"']\", $this->_vardefs, 'modules/' . $this->_name . '/vardefs.php');\n echo \"wrote modules/$this->_name/vardefs.php \\n\";\n \n file_put_contents(\"modules/\" . $this->_name . \"/\" . $this->_name . \".php\", $this->_classDef);\n echo \"wrote modules/\" . $this->_name . \"/\" . $this->_name . \".php \\n\";\n \n $this->_copyMetadataFiles();\n echo \"wrote modules/\" . $this->_name . \"/metadata directory \\n\";\n \n $this->_copyDashletFiles();\n echo \"wrote modules/\" . $this->_name . \"/Dashlets directory \\n\";\n \n system(\"cp -a include/SugarObjects/templates/\" . $this->_template_type . \"/language modules/\" . $this->_name);\n echo \"wrote modules/\" . $this->_name . \"/language directory \\n\";\n \n system(\"mkdir -p custom/Extension/application/Ext/Include/\");\n file_put_contents(\"custom/Extension/application/Ext/Include/\" . $this->_name . \".php\", $this->_includeModules);\n echo \"wrote modules/\" . $this->_name . \"/\" . $this->_name . \".php \\n\";\n \n system(\"mkdir -p custom/Extension/application/Ext/Language/\");\n foreach ($this->_includeLanguage as $lang => $contents) {\n file_put_contents(\"custom/Extension/application/Ext/Language/\" . $lang . \".\" . $this->_name . \".php\", \"<?php \\n \" . $contents);\n echo \"wrote custom/Extension/application/Ext/Language/\" . $lang . \".\" . $this->_name . \".php \\n\";\n }\n \n file_put_contents(\"modules/{$this->_name}/Menu.php\", $this->_menu);\n echo \"wrote modules/{$this->_name}/Menu.php \\n\";\n\n system(\"touch modules/\" . $this->_name . \"/Forms.php\");\n echo \"touched modules/\" . $this->_name . \"/Forms.php \\n\";\n \n echo \"you need to create custom/themes/default/images/Create\" . strtolower($this->_name) . \".gif, commander \\n\";\n echo \"you need to create custom/themes/default/images/\" . strtolower($this->_name) . \".gif, commander \\n\";\n echo \"you need to create custom/themes/default/images/icon_\" . $this->_name . \"_32.png, commander \\n\";\n echo \"you need to create custom/themes/default/images/icon_\" . strtolower($this->_name) . \"_bar_32.png, commander \\n\";\n file_put_contents(\"modules/{$this->_name}/manual_labels.txt\", var_export($this->_manual_labels, true));\n echo \"you need to insert the labels in modules/{$this->_name}/manual_labels.txt manually, commander. \\n\";\n \n }",
"private function outputFuncBackupMgr() {\n\t\t// get vars\n\t\t$filename = t3lib_div::_POST('file');\n\t\t$origDiff = t3lib_div::_POST('origDiff');\n\t\t$extPath = $this->MOD_SETTINGS['extList'];\n\n\t\t// get output\n\t\t$metaArray = $this->backupObj->getMetaInfos(2);\n\t\tif (!count($metaArray)) {\n\t\t\tthrow new LFException('failure.backup.noFiles', 1);\n\t\t}\n\t\t$content = tx_lfeditor_mod1_template::outputManageBackups($metaArray, $extPath);\n\n\t\t$diff = $metaDiff = NULL;\n\t\tif ($origDiff) {\n\t\t\t// set backup file\n\t\t\t$metaArray = $this->backupObj->getMetaInfos(3);\n\t\t\t$informations = array(\n\t\t\t\t'absPath' => typo3Lib::fixFilePath(\n\t\t\t\t\tPATH_site . '/' .\n\t\t\t\t\t$metaArray[$filename]['pathBackup']\n\t\t\t\t),\n\t\t\t\t'relFile' => $filename,\n\t\t\t);\n\t\t\t$this->backupObj->setVar($informations);\n\n\t\t\t// exec diff\n\t\t\ttry {\n\t\t\t\t// read original file\n\t\t\t\t$this->initFileObject(\n\t\t\t\t\t$this->backupObj->getVar('langFile'),\n\t\t\t\t\tPATH_site . '/' . $this->backupObj->getVar('extPath'),\n\t\t\t\t\t$this->MOD_SETTINGS['wsList']\n\t\t\t\t);\n\n\t\t\t\t// read backup file\n\t\t\t\t$this->backupObj->readFile();\n\n\t\t\t\t// get language data\n\t\t\t\t$origLang = $this->fileObj->getLocalLangData();\n\t\t\t\t$backupLocalLang = $this->backupObj->getLocalLangData();\n\n\t\t\t\t// get meta data\n\t\t\t\t$origMeta = $this->fileObj->getMetaData();\n\t\t\t\t$backupMeta = $this->backupObj->getMetaData();\n\n\t\t\t\t$diff = tx_lfeditor_mod1_functions::getBackupDiff(0, $origLang, $backupLocalLang);\n\t\t\t\t$metaDiff = tx_lfeditor_mod1_functions::getMetaDiff(0, $origMeta, $backupMeta);\n\t\t\t} catch (LFException $e) {\n\t\t\t\treturn $e->getMessage() . $content;\n\t\t\t}\n\t\t}\n\n\t\t// generate diff\n\t\tif (count($diff)) {\n\t\t\t$content .= tx_lfeditor_mod1_template::outputManageBackupsDiff(\n\t\t\t\t$diff, $metaDiff,\n\t\t\t\t$this->fileObj->getLocalLangData(), $this->backupObj->getLocalLangData(),\n\t\t\t\t$this->fileObj->getOriginLangData(), $this->backupObj->getOriginLangData(),\n\t\t\t\t$this->fileObj->getMetaData(), $this->backupObj->getMetaData()\n\t\t\t);\n\t\t}\n\n\t\treturn $content;\n\t}",
"function do_output() {\n\t\tglobal $config, $phpEx, $phpbb_seo, $db;\n\t\tif ($this->outputs['showstats']) {\n\t\t\t$this->outputs['gen_data'] = sprintf('%.5f', $phpbb_seo->microtime_float() - $this->outputs['microtime']);\n\t\t\t$mem_stats = $this->mem_usage();\n\t\t\t$this->outputs['data'] .= \"\\n\" . sprintf($this->gym_master->style_config['stats_genlist'], $this->outputs['gen_data'], $mem_stats, $db->sql_num_queries(), $this->outputs['url_sofar']);\n\t\t}\n\t\tif ($this->cache['cache_enable']) {\n\t\t\t$this->write_cache();\n\t\t\tif ($this->check_cache($this->cache['file'])) {\n\t\t\t\t$this->cache_output();\n\t\t\t} else {\n\t\t\t\t$this->otf_output();\n\t\t\t}\n\t\t} else {\n\t\t\t$this->otf_output();\n\t\t}\n\t\treturn;\n\t}",
"function hys_backup_make($bkup_type,$file_name) {\t\n\t\tglobal $hys;\n\t\t\n\t\t$dir_error \t\t= false;\n\t\t$file_error\t\t= false;\n\t\t\n\t\t$backup_dir \t= WP_CONTENT_DIR.'/hys_sql_backups';\n\t\t$backup_folder \t= $backup_dir.'/'.$hys['site'];\n\t\t$backup_file \t= $backup_folder.'/'.$file_name;\n\t\t\n\t\t//create backup directory and index file if not exsist\n\t\tif (!is_dir($backup_dir)) {\n\t\t\tif (!mkdir($backup_dir, 0777))\n\t\t\t\t$dir_error = \"Unable to make directory: \".$backup_dir;\n\t\t\t\n\t\t\t//make index file to prevent indexing\n\t\t\t$fp = fopen($backup_dir.'/index.php', 'w+');\n\t\t\tfwrite($fp, \"<?php\\n//silence is golden\\n?>\");\n\t\t\tfclose($fp);\n\t\t}\n\t\t//create backup directory and index file if not exsist\n\t\tif (!is_dir($backup_folder)) {\n\t\t\tif (!mkdir($backup_folder, 0777))\n\t\t\t\t$dir_error = \"Unable to make directory: \".$backup_folder;\n\t\t\t\n\t\t\t//make index file to prevent indexing\n\t\t\t$fp = fopen($backup_folder.'/index.php', 'w+');\n\t\t\tfwrite($fp, \"<?php\\n//silence is golden\\n?>\");\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t//dump database into bckup file\n\t\tif (fopen($backup_file, \"w+\")) {\n\t\t\t$mysqldump \t= (isset($hys['settings']['backup_from']) && !empty($hys['settings']['backup_from'])) ? $hys['settings']['backup_from'].\"/\" : false;\n\t\t\t$command \t= \"{$mysqldump}mysqldump -h\".DB_HOST.\" -u\".DB_USER.\" -p\".DB_PASSWORD.\" \".DB_NAME.\" > {$backup_file}\";\n\t\t\texec($command,$error);\n\t\t} else {\t\t\t\n\t\t\t$file_error = \"Unable to open/create .sql file: {$backup_file}\";\n\t\t}\n\t\t\n\t\t//if there was an error, email it and kill the page\n\t\tif ($error || !$mysqldump || $dir_error || $file_error) {\n\t\t\tif (!$mysqldump) $error = \"location of mysqldump is not set\";\n\t\t\t//EMAIL //@TODO: remove this before putting public\n\t\t\t$to \t\t= 'heyyou@davidsword.ca';\n\t\t\t$subject \t= 'BACKUP ERROR';\n\t\t\t$headers = 'From: heyyou <errors@hey-you.ca>' . \"\\r\\n\";\n\t\t\t$message\t= \"<p><strong>WARNING</strong>: Backup Error for \".get_bloginfo('url').\"</p> <p>: {--{ <strong>\". $error .\"</strong> }--} : </p> \".\n\t\t\t\t\t\t \"<p>An email of this error has been sent to heyyou staff.\".\n\t\t\t\t\t\t \"If this persists please contact www.hey-you.ca/contact/ directly.</p>\".\n\t\t\t\t\t\t \"<p> </p>\\n<p>Regards,<p>\\n\\n\".\n\t\t\t\t\t\t \"<p>heyyou<br />\\n\".\n\t\t\t\t\t\t \"www.hey-you.ca</p>\\n\";\n\t\t\t$mailit\t\t= wp_mail($to, $subject, $message, $headers);\n\t\t\tdie($message);\t\t\t\n\t\t} \n\t\t\n\t\t//return full path to file for mailing\n\t\treturn $backup_file;\n\t}",
"private function prepare()\n {\n $this->prepareFileDirectory();\n }",
"function abcde(){\t \n\t ob_start();\n\tif(user_can('back_up')){\n\t\t$output = '<h2>Backup Your Database</h2><hr>';\n\t\t$output .='<a class=\"btn btn-primary\" href=\"?pages=back_up&get=true&type=direct\">Download The Database Backup OF Your Site</a>';\n\t\t$output .='<p><small>Click the buttom to download the site database</small></p>';\n\t\t\n\t\t$output .= 'You can generate your full database . All table and all field with data';\n\t\t\n\t\t//echo '<a class=\"btn btn-primary\" href=\"?pages=backup&get=true&type=save\">Download The Database Backup OF Your Site</a>';\n\t\tif(isset($_GET['get']) & isset($_GET['type']) ){\n\t\t\tif($_GET['get']=='true' and $_GET['type']=='direct'){\n\t\t\t\n\t\t\t\t/*\n\t\t\t\t *\n\t\t\t\t *\n\t\t\t\t *\tThe Backup Script\n\t\t\t\t *\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\t global $dbconnect;\n\t\t\t\tdefine('HOST',\t\t$dbconnect['DBHOST']);\t\t// Host name\n\t\t\t\tdefine('USERNAME',\t$dbconnect['DBUSER']);\t\t// User name\n\t\t\t\tdefine('PASSWORD',\t$dbconnect['DBPASS']);\t\t// Password\n\t\t\t\tdefine('DATABASE',\t$dbconnect['DBNAME']);\t\t\t// DB Name\n\t\t\t\tdefine('PATH',\t\t'./');\t\t// Backup Directory\n\t\t\t\tclass DBBackup\n\t\t\t\t{\n\t\t\t\t private $con;\n\t\t\t\t private $tables = array();\n\t\t\t\t private $path;\n\n\t\t\t\t function __construct($host = null, $username = null, $password = null, $database = null)\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\t\tConnect and select MySQL DB\n\t\t\t\t\t*/\n\t\t\t\t\tif( is_null($host) || is_null($username) || is_null($password) || is_null($database) ) throw new Exception(\"The host, username, password and database name arguments must be specified!\");\n\t\t\t\t\tif( ! $this->con = @mysql_connect($host, $username, $password) ) throw new Exception(\"Could not connect MySQL server {$username}@{$host}\");\n\t\t\t\t\tif( ! @mysql_select_db($database, $this->con) )throw new Exception(\"Could not select database: {$database}\");\n\t\t\t\t }\n\n\n\t\t\t\t public function table( $table = 'all' )\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\t\tGet defined tables\n\t\t\t\t\t*/\n\t\t\t\t\tif( is_array( $table )){\n\t\t\t\t\t // Cheque table validity\n\t\t\t\t\t foreach($table as $t){\n\t\t\t\t\t\tif(in_array($t , $this->getAllTables())){\n\t\t\t\t\t\t $this->tables[] = $t;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t throw new Exception(\"Table `{$t}` not exists in the DB\");\n\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\telseif( $table == 'all' ){\n\t\t\t\t\t\t$this->tables = $this->getAllTables();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tthrow new Exception(\"Please enter tables name as array\");\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t public function path($path = '')\n\t\t\t\t { \n\t\t\t\t\t/*\n\t\t\t\t\tSet upload path\n\t\t\t\t\t*/\n\t\t\t\t\t$this->path = $path;\n\t\t\t\t }\n\n\t\t\t\t public function backUp()\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\tDone backup\n\t\t\t\t\t*/\n\t\t\t\t\t$return = '';\n\t\t\t\t\tforeach($this->tables as $table){\n\t\t\t\t\t\t$return .= $this->tableStracture($table);\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ($this->recode($table) as $result) {\n\t\t\t\t\t\t\t$return .= $result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tob_end_flush();\n\t\t\t\t\tob_end_clean();\n\t\t\t\t\t//$this->writeToFile($return);\n\t\t\t\t\theader(\"Content-type: application/sql\");\n\t\t\t\t\theader(\"Content-Disposition: attachment; filename= \".date('Y-m-d-H-i').\".sql\");\n\t\t\t\t\theader(\"Pragma: no-cache\");\n\t\t\t\t\theader(\"Expires: 0\");\n\t\t\t\t\techo \"\n\t\t\t\t\t\n\t\t\t\t\t--\n\t\t\t\t\t-- This is the database backup of Borno CMS\n\t\t\t\t\t-- \n\t\t\t\t\t-- --------------------------------------------------\n\t\t\t\t\t-- ---------------------------------------------------\n\n\t\t\t\t\t\";\n\t\t\t\t\techo $return;\n\n\t\t\t\t\texit; \n\t\t\t\t\t\n\t\t\t\t//\techo $return;\n\t\t\t\t // print_r($return);\n\t\t\t\t\treturn true;\n\t\t\t\t }\n\n\t\t\t\t private function getAllTables()\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\tGet tables list name from DB\n\t\t\t\t\t*/\n\t\t\t\t\t$sql = mysql_query(\"SHOW TABLES\");\n\t\t\t\t\twhile ($row = mysql_fetch_row($sql) )\n\t\t\t\t\t{\n\t\t\t\t\t foreach ($row as $key => $value)\n\t\t\t\t\t {\n\t\t\t\t\t\t$table[] = $value;\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\treturn $table;\n\t\t\t\t }\n\n\t\t\t\t private function tableStracture($table)\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\tGet table stracture\n\t\t\t\t\t*/\n\t\t\t\t\t$return = \"\\nDROP TABLE IF EXISTS `{$table}`;\\n\\n\";\n\t\t\t\t\t$row = ( mysql_fetch_row(mysql_query(\"SHOW CREATE TABLE {$table}\")) );\n\t\t\t\t\t$return .= $row[1].\";\\n\\n\";\n\t\t\t\t\treturn $return;\n\t\t\t\t }\n\n\t\t\t\t private function recode($table)\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\tGet data recodes\n\t\t\t\t\t*/\n\t\t\t\t\t$query = mysql_query(\"SELECT * FROM {$table} LIMIT 0, 1000\");\n\t\t\t\t\t$num_fields = mysql_num_fields($query);\n\t\t\t\t\t$num_rows = mysql_num_rows($query);\n\t\t\t\t\t$results = array();\n\t\t\t\t\tif ($num_rows){\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile($row = mysql_fetch_row($query))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$return = \"INSERT INTO {$table} VALUES(\";\n\t\t\t\t\t\t\tfor($i=0; $i<$num_fields; $i++) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t $row[$i] = addslashes($row[$i]);\n\t\t\t\t\t\t $row[$i] = str_replace(\"\\n\",\"\\\\n\",$row[$i]);\n\t\t\t\t\t\t $row[$i] = str_replace(\"\\r\",\"\\\\r\",$row[$i]);\n\n\t\t\t\t\t\t\t\t$return .= ( isset($row[$i]) ) ? \"'{$row[$i]}'\" : \"''\";\n\t\t\t\t\t\t\t\tif ($i<($num_fields-1)) { $return.= ','; }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$return.= \");\\n\";\n\t\t\t\t\t\t\t$results[] = $return;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\treturn $results;\n\t\t\t\t }\n\n\t\t\t\t private function writeToFile($str)\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\tWrite down backup file\n\t\t\t\t\t*/\n\t\t\t\t\t$path = (isset($this->path))? $this->path : '';\n\t\t\t\t\t$backupPath = $path . date('Y-m-d-H-i').'_'.md5(uniqid()).'.sql';\n\t\t\t\t\tif( ! $handle = @fopen( $backupPath ,'w+') ) throw new Exception(\"Could not save backup file at {$backupPath}\"); \n\t\t\t\t\tfwrite($handle, $str);\n\t\t\t\t\tfclose($handle);\n\t\t\t\t }\n\n\t\t\t\t public function close()\n\t\t\t\t {\n\t\t\t\t\t/*\n\t\t\t\t\tClose MySQL connection\n\t\t\t\t\t*/\n\t\t\t\t\tmysql_close($this->con);\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tob_end_flush();\n\t\t\t\ttry {\n\t\t\t\t\t$db = new DBBackup(HOST, USERNAME, PASSWORD, DATABASE);\n\t\t\t\t\t$db->table();\n\t\t\t\t\t$db->path(PATH);\n\t\t\t\t\t$db->backUp();\n\t\t\t\t\t$db->close();\n\t\t\t\t\techo \"Done!\";\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tdie($e->getMessage());\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 *\tThe backup script end\n\t\t\t\t */\n\t\t\t\t \n\t\t\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\treturn\t('You can not visit this page');\n\t}\n\t\treturn $output;\n}",
"public function processOutput($output)\n {\n $this->stored_output = $this->stored_output.$output;\n }",
"protected function _prepare()\n\t{\n\t\tdebugMsg(__CLASS__ . \" :: Starting _prepare()\");\n\n\t\t$defaultExcluded = $this->getDefaultExclusions();\n\n\t\t$parameters = array_merge(array(\n\t\t\t'root' => rtrim(AKFactory::get('kickstart.setup.destdir'), '/' . DIRECTORY_SEPARATOR),\n\t\t\t'excluded' => $defaultExcluded,\n 'dryRun' => AKFactory::get('kickstart.setup.dryrun', false)\n\t\t), $this->_parametersArray);\n\n\t\t$this->root = $parameters['root'];\n\t\t$this->excluded = $parameters['excluded'];\n\t\t$this->directory_list[] = $this->root;\n\t\t$this->done_subdir_scanning = true;\n\t\t$this->done_file_scanning = true;\n\t\t$this->total_files = 0;\n\t\t$this->done_files = 0;\n\t\t$this->total_folders = 0;\n\t\t$this->done_folders = 0;\n\t\t$this->dryRun = $parameters['dryRun'];\n\n\t\tif (empty($this->root))\n\t\t{\n\t\t\t$error = \"The folder to delete was not specified.\";\n\n\t\t\tdebugMsg(__CLASS__ . \" :: \" . $error);\n\t\t\t$this->setError($error);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (!is_dir($this->root))\n\t\t{\n\t\t\t$error = sprintf(\"Folder %s does not exist\", $this->root);\n\n\t\t\tdebugMsg(__CLASS__ . \" :: \" . $error);\n\t\t\t$this->setError($error);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setState('prepared');\n\n\t\tdebugMsg(__CLASS__ . \" :: prepared\");\n\t}",
"function updateSummaryofBackupFile($debug=false)\n {\n //if ($debug) echo \"Allocated Memory : \".getNiceFileSize(memory_get_usage(false),false).\" / \".getNiceFileSize(memory_get_usage(true),false).\"\\n\"; // true including unused pages\n $params=$this->getConfigurationStatus(\"array\");\n $ergebnis=array();\n $this->analyseBackupDirectoryStatus($ergebnis);\n if ($debug) \n {\n echo \"Allocated Memory : \".getNiceFileSize(memory_get_usage(false),false).\" / \".getNiceFileSize(memory_get_usage(true),false).\"\\n\"; // true including unused pages \n echo \"updateSummaryofBackupFile: status von Backup aus Backup.csv eruieren (Rückmeldung analyseBackupDirectoryStatus) :\\n\";\n print_r($ergebnis);\n } \n $backUpLogTable = $this->getBackupLogTable($debug); \n if ($debug) \n {\n echo \" vorhandene Datum_backup.csv Log Files:\\n\";\n print_r($backUpLogTable); \n }\n foreach ($ergebnis as $BackupDirEntry => $entry)\n {\n $pathinfo=pathinfo($BackupDirEntry);\n $backupName=$pathinfo[\"filename\"];\n if ($debug) echo \"suche $backupName in backUpLogTable.\\n\";\n if (isset($backUpLogTable[$backupName]))\t/* wenn es kein Backup Logfile gibt ist das Backup nicht abgeschlossen */\n {\n if ($debug) echo \" --> gefunden $backupName in backUpLogTable:\\n\"; print_r($backUpLogTable[$backupName]);\n $ergebnis[$BackupDirEntry][\"type\"]=$backUpLogTable[$backupName][\"type\"];\n $ergebnis[$BackupDirEntry][\"logFilename\"]=$backUpLogTable[$backupName][\"filename\"];\n $ergebnis[$BackupDirEntry][\"logFiledate\"]=$backUpLogTable[$backupName][\"filedate\"]; // zusaetzlich Datum in die Tabelle aufnehmen\n $ergebnis[$BackupDirEntry][\"status\"]=\"finished\";\n }\n else $ergebnis[$BackupDirEntry][\"status\"]=\"error\";\n }\n $this->BackOverviewTable=$ergebnis;\n if ($debug) \n {\n echo \"Ergebnis von updateSummaryofBackupFile, neuer BackOverviewTable:\\n\";\n print_r($ergebnis);\n }\n $this->writeBackupDirectorySummaryStatus($debug);\n $this->writeTableStatus($params);\n if ($debug) echo \"Allocated Memory : \".getNiceFileSize(memory_get_usage(false),false).\" / \".getNiceFileSize(memory_get_usage(true),false).\"\\n\"; // true including unused pages\n }",
"function dumpingData($table, $fields) {\n\n\t\t$output = \"\";\n\t\t$insertTable = \"\n--\n-- Dumping values for table `$table`\n-- \n\n\";\n\t\t$insertTable .= \"insert into $table (\";\n\t\t//adding the tables fields into the query\n\t\tforeach ($this->table_fields as $table_fields) {\n\t\t\t$insertTable .= $table_fields;\n\t\t\tif (end($this->table_fields) != $table_fields) {\n\t\t\t\t$insertTable .= \",\";\n\t\t\t}\n\t\t}\n\t\t$insertTable .= \") values \\n\";\n\t\t$countRows = 0;\n\t\t//OUTPUT CONTENT TO STRING BUFFER OUTPUT\n\t\t$result = mysql_query(\"SELECT * FROM \".$table);\n\t\t$this->numDumpRows = 0;\n\t\twhile ($row = mysql_fetch_array($result)) {\n\t\t\tif ($countRows == $this->queryLimitRow) {\n\t\t\t\t//reset counter\n\t\t\t\t$countRows = 0;\n\t\t\t\t$output .= \"EOF\".$insertTable;\n\t\t\t}\n\t\t\t$output .= \"(\";\n\t\t\t$i = 1;\n\t\t\tforeach ($fields as $val) {\n\t\t\t\t$value = addslashes($row[$val]);\n\t\t\t\t//set\n\t\t\t\t($i == sizeof($fields)) ? $delimiter = \"\" : $delimiter = \",\";\n\t\t\t\t//if its a number dont put the quotes\n\t\t\t\t(is_numeric($value)) ? $query = $value : $query = \"'$value'\";\n\t\t\t\t$output .= $query.$delimiter;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$output .= \"),\\n\";\n\t\t\t$countRows++;\n\t\t\t$this->numDumpRows++;\n\t\t}\n\t\t//flag for EOF\n\t\t$output .= \"EOF\";\n\t\t//if there are any rows that where created then add to query\n\t\tif ($this->numDumpRows) {\n\t\t\t$this->output .= $insertTable.str_replace(\",\\nEOF\", \";\\n\", $output);\n\t\t}\n\t\t//make new directory to dump data\n\t\t$directory = $this->makeDirectory();\n\t\t//PLACE CONTENT ON [TABLE_NAME].TXT FILE\n\t\tfile_put_contents(\"$directory/$table.sql\", $this->output);\n\t\t//PLACE CONTENT ONTO SVN DIR\n\t\tif (is_dir($this->svnpath)) {\n\t\t\tfile_put_contents(\"$this->svnpath/$table.txt\", $this->output);\n\t\t}\n\t\t$this->files[] = \"$table.sql\";\n\n\t}",
"public function main() {\n\t\t$theOutput = '';\n\t\tif ($this->pObj->id) {\n\n\t\t\t\t// Depth selector:\n\t\t\t$h_func = BackendUtility::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');\n\t\t\t$h_func .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang'], 'index.php');\n\t\t\t$theOutput .= $h_func;\n\n\t\t\t\t// Add CSH:\n\t\t\t$theOutput .= BackendUtility::cshItem('_MOD_web_info', 'lang', $GLOBALS['BACK_PATH'], '|<br/>');\n\n\t\t\t\t// Showing the tree:\n\t\t\t\t// Initialize starting point of page tree:\n\t\t\t$treeStartingPoint = intval($this->pObj->id);\n\t\t\t$treeStartingRecord = BackendUtility::getRecordWSOL('pages', $treeStartingPoint);\n\t\t\t$depth = $this->pObj->MOD_SETTINGS['depth'];\n\n\t\t\t\t// Initialize tree object:\n\t\t\t$tree = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Backend\\\\Tree\\\\View\\\\PageTreeView');\n\t\t\t$tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));\n\t\t\t$tree->addField('l18n_cfg');\n\n\t\t\t\t// Creating top icon; the current page\n\t\t\t$HTML = IconUtility::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align=\"top\"');\n\t\t\t$tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML );\n\n\t\t\t\t// Create the tree from starting point:\n\t\t\tif ($depth) {\n\t\t\t\t$tree->getTree($treeStartingPoint, $depth, '');\n\t\t\t}\n\n\t\t\t\t// Add CSS needed:\n\t\t\t$css_content = '\n\t\t\t\tTABLE#langTable {\n\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t}\n\t\t\t\tTABLE#langTable TR TD {\n\t\t\t\t\tpadding-left : 2px;\n\t\t\t\t\tpadding-right : 2px;\n\t\t\t\t\twhite-space: nowrap;\n\t\t\t\t}\n\t\t\t\tTD.c-notvisible { background-color: red; }\n\t\t\t\tTD.c-visible { background-color: #669966; }\n\t\t\t\tTD.c-translated { background-color: #A8E95C; }\n\t\t\t\tTD.c-nottranslated { background-color: #E9CD5C; }\n\t\t\t\tTD.c-leftLine {border-left: 2px solid black; }\n\t\t\t\t.bgColor5 { font-weight: bold; }\n\t\t\t';\n\t\t\t$marker = '/*###POSTCSSMARKER###*/';\n\t\t\t$this->pObj->content = str_replace($marker, $css_content . chr(10) . $marker, $this->pObj->content);\n\n\t\t\t\t// Render information table:\n\t\t\t$theOutput .= $this->renderL10nTable($tree);\n\t\t}\n\n\t\treturn $theOutput;\n\t}",
"public function parseFileListing($output);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(PHP 4, PHP 5) Arc tangent | function atan ($arg) {} | [
"public function atan();",
"function a1($t,$dt,$pathFunction) {\n list($xt,$yt,$zt) = $pathFunction($t);\n list($xdt,$ydt,$zdt) = $pathFunction($t+$dt);\n return rad2deg(atan2($ydt-$yt,$xdt-$xt));\n}",
"public function arc_tan2($input) { # :: (Float -> Float) -> Float\n return new Num\\Float(\n atan2($this->value, TypeInference :: to_primitive($input)));\n }",
"public function deg2rad();",
"public function arc($sx, $sy, $ex, $ey, $sd, $ed){}",
"function tangentsCircle($x1=100, $y1=200, $a=100, $r=30) {\r\n$x2=$x1+$a; $y2=$y1-$a;\r\n//line($x1,$y1,$x2,$y2); circle($x2,$y2,$r);\r\n$d=sqrt( ($x2-$x1)**2 + ($y2-$y1)**2 );\r\n$rm = $d/2; \r\n$cmx = $x1+$a/2;\r\n$cmy = $y1-$a/2;\r\n//circle($cmx,$cmy,$rm);\r\n$points = circlesIntersection($x2, $y2, $r, $cmx, $cmy, $rm);\r\n//$points = array($x3,$y3,$x4,$y4);\r\n$x3=$points[0];\r\n$y3=$points[1];\r\n$x4=$points[2];\r\n$y4=$points[3];\r\n//circle($x3,$y3,3); circle($x4,$y4,3);\r\n//line($x1,$y1,$x3,$y3); line($x1,$y1,$x4,$y4);\r\nreturn array($x3,$y3,$x4,$y4);\r\n}",
"function atan2($x, $y)\n{\n return 0.0;\n}",
"function tangentsCircleV($cx=200, $cy=200, $h=100, $r=30) {\r\n$xh=$cx; $yh=$cy-$h; //external point coords (xh,yh)\r\n//point($cx,$cy,2,'red'); point($xh,$yh,2,'red');\r\n//line($cx,$cy,$xh,$yh); circle($cx,$cy,$r);\r\n//center of second circle\r\n$rm = $h/2; \r\n$cmx = $cx;\r\n$cmy = $cy-$h/2; //point($cmx,$cmy,2,'green');\r\n//circle($cmx,$cmy,$rm);\r\n$points = circlesIntersection($cx, $cy, $r, $cmx, $cmy, $rm);\r\n//$points = array($x1,$y1,$x2,$y2);\r\n$x1=$points[0];\r\n$y1=$points[1];\r\n$x2=$points[2];\r\n$y2=$points[3];\r\n//circle($x1,$y1,3); circle($x2,$y2,3);\r\n//line($xh,$yh,$x1,$y1); line($xh,$yh,$x2,$y2);\r\nreturn array($x1,$y1,$x2,$y2);\r\n}",
"public static function arcCcwDeg($mx=100, $my=100, $r=30, $deg=45, \r\n$style='stroke:black;stroke-width:1;fill:none;') {\r\n$rad=deg2rad($deg); $dx=$r*sin($rad); $dy=$r*(1-cos($rad)); $x=$mx+$dx; $y=$my-$dy;\r\necho \"<path d='M$mx $my A$r $r 0 0 0 $x $y' style='$style' />\";\r\nreturn array($mx,$my,$r,$deg,$x,$y);\r\n}",
"public function getAngle(): float;",
"public function rad2deg();",
"public function arctangente(){\n $this->pantalla = atan((float)$this->pantalla);\n //Devuelve el valor en radianes\n }",
"function Arc($x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4)\n {\n $this->forcePen();\n //echo \"$this->_canvas.drawArc($x1, $y1, $r * 2, $r * 2, 180, 270);\\n\";\n }",
"private function arc(Point $from, Point $to): float\n {\n $latFrom = $from->getLatitude();\n $latTo = $to->getLatitude();\n\n $lngFrom = $from->getLongitude();\n $lngTo = $to->getLongitude();\n\n $latHaversine = sin(($latFrom - $latTo) * static::DEGREES_TO_RADIANS * 0.5) ** 2;\n $lngHaversine = sin(($lngFrom - $lngTo) * static::DEGREES_TO_RADIANS * 0.5) ** 2;\n\n $cosProduct = cos($latFrom * static::DEGREES_TO_RADIANS) * cos($latTo * static::DEGREES_TO_RADIANS);\n\n return 2 * asin(sqrt($latHaversine + $cosProduct * $lngHaversine));\n }",
"function drawarc($r, $startAngle, $endAngle) {}",
"function arc($x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4)\r\n {\r\n $this->forcePen();\r\n //echo \"$this->_canvas.drawArc($x1, $y1, $r * 2, $r * 2, 180, 270);\\n\";\r\n }",
"function gcBearingTo($from, $to) {\n global $PI, $DEG2RAD, $RAD2DEG;\n\n $x1 = $from[\"x\"] * $DEG2RAD;\n $y1 = $from[\"y\"] * $DEG2RAD;\n $x2 = $to[\"x\"] * $DEG2RAD;\n $y2 = $to[\"y\"] * $DEG2RAD;\n\n $a = cos($y2) * sin($x2 - $x1);\n $b = cos($y1) * sin($y2) - sin($y1) * cos($y2) * cos($x2 - $x1);\n if(($a == 0) && ($b == 0)) {\n $bearing = 0;\n return $bearing;\n }\n if($b == 0) {\n if($a < 0) \n $bearing = 270;\n else\n $bearing = 90;\n return $bearing;\n }\n \n if( $b < 0) \n $adjust = $PI;\n else {\n if($a < 0) \n $adjust = 2 * $PI;\n else\n $adjust = 0;\n }\n $bearing = (atan($a/$b) + $adjust) * $RAD2DEG;\n return $bearing;\n}",
"public static function octagonDeg($cx=100, $cy=100, $r=50, $startDeg=0,\r\n$style='stroke:black;stroke-width:1;fill:none') { \r\n$alpha=2*M_PI/8; $start=deg2rad($startDeg);\r\n$arr1=fm::returnCartesianDeg($r,$start);\r\n$arr2=fm::returnCartesianDeg($r,$start+$alpha);\r\n$arr3=fm::returnCartesianDeg($r,$start+2*$alpha);\r\n$arr4=fm::returnCartesianDeg($r,$start+3*$alpha);\r\n$arr5=fm::returnCartesianDeg($r,$start+4*$alpha);\r\n$arr6=fm::returnCartesianDeg($r,$start+5*$alpha);\r\n$arr7=fm::returnCartesianDeg($r,$start+6*$alpha);\r\n$arr8=fm::returnCartesianDeg($r,$start+7*$alpha);\r\n$x1=$cx+$arr1[0]; $y1=$cy+$arr1[1];\r\n$x2=$cx+$arr2[0]; $y2=$cy+$arr2[1];\r\n$x3=$cx+$arr3[0]; $y3=$cy+$arr3[1];\r\n$x4=$cx+$arr4[0]; $y4=$cy+$arr4[1];\r\n$x5=$cx+$arr5[0]; $y5=$cy+$arr5[1];\r\n$x6=$cx+$arr6[0]; $y6=$cy+$arr6[1];\r\n$x7=$cx+$arr7[0]; $y7=$cy+$arr7[1];\r\n$x8=$cx+$arr8[0]; $y8=$cy+$arr8[1];\r\necho \"<polygon points='$x1,$y1 $x2,$y2 $x3,$y3 $x4,$y4 $x5,$y5 $x6,$y6 $x7,$y7 $x8,$y8' \r\nstyle='$style' />\";\r\nreturn array($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4,$x5,$y5,$x6,$y6,$x7,$y7,$x8,$y8);\r\n}",
"function GetAngleOfLine($X1,$Y1,$X2,$Y2)\n{\n $xDiff = $X2 - $X1;\n $yDiff = $Y2 - $Y1;\n return atan2($yDiff, $xDiff) * (180 / pi());\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the vertex through which the set distance to start is achieved | public function getVertexToStart() : Vertex; | [
"public function getStartingVertex()\n {\n return $this->startingVertex;\n }",
"public function getStartVertex(): VertexInterface;",
"public function getStartVertex(): VertexInterface\n {\n return $this->startVertex;\n }",
"abstract public function getVertexToFrom(Vertex $startVertex);",
"abstract public function getVerticesStart();",
"function find_min_vertex($v1,$vertices,$distance_table){\n $min = INF;\n $min_i = 0;\n\n foreach($vertices as $v2){\n $d = distance_lookup($v1,$v2,$distance_table);\n if($d < $min){\n $min = $d;\n $min_i = $v2;\n }\n }\n return array($min_i,$min);\n\n}",
"public function getDistanceFromStart() : float;",
"public function getDegreeMin()\n {\n return $this->getDegreeVertex($this->graph->getVertices()->getVertexOrder(array($this, 'getDegreeVertex')));\n }",
"abstract public function getVertexFromTo(Vertex $endVertex);",
"public function getTo(): Vertex\n {\n return $this->to;\n }",
"public function getEndingVertex()\n {\n return $this->endingVertex;\n }",
"public function getStartPoint()\n {\n $p = $this->points;\n return reset($p);\n }",
"private function getStartVertices() {\r\n\t\t$startVertices = $this->vertexStartCoordinates;\r\n\t\t$amountOfOptionalVertices = $this->amountOfVertices - count($this->vertexStartCoordinates);\r\n\t\tfor($i = 0; $i <= $amountOfOptionalVertices - 1; $i++) {\r\n\t\t\t$randomIndex = array_rand($this->optionalVertexStartCoordinates);\r\n\t\t\t$startVertices[$randomIndex] = $this->optionalVertexStartCoordinates[$randomIndex];\r\n\t\t\tunset($this->optionalVertexStartCoordinates[$randomIndex]);\r\n\t\t}\r\n\t\t\r\n\t\tksort($startVertices);\r\n\r\n\t\treturn $startVertices;\r\n\t}",
"public function setDistanceFromStartThroughVertex(float $distance, Vertex $throughVertex);",
"public function getEdges()\n {\n $totalCostOfCheapestPathTo = Array();\n // start node distance\n $totalCostOfCheapestPathTo[$this->vertex->getId()] = INF;\n\n // just to get the cheapest vertex in the correct order\n $cheapestVertex = new SplPriorityQueue();\n $cheapestVertex->insert($this->vertex, 0);\n\n // predecessor\n $predecesVertexOfCheapestPathTo = Array();\n $predecesVertexOfCheapestPathTo[$this->vertex->getId()] = $this->vertex;\n\n // mark vertices when their cheapest path has been found\n $usedVertices = Array();\n\n $isFirst = true;\n\n // Repeat until all vertices have been marked\n $totalCountOfVertices = \\count($this->vertex->getGraph()->getVertices());\n for ($i = 0; $i < $totalCountOfVertices; ++$i) {\n $currentVertex = NULL;\n $currentVertexId = NULL;\n $isEmpty = false;\n do {\n // if the priority queue is empty there are isolated vertices, but the algorithm visited all other vertices\n if ($cheapestVertex->isEmpty()) {\n $isEmpty = true;\n break;\n }\n // Get cheapest unmarked vertex\n $currentVertex = $cheapestVertex->extract();\n $currentVertexId = $currentVertex->getId();\n // Vertices can be in the priority queue multiple times, with different path costs (if vertex is already marked, this is an old unvalid entry)\n } while (isset($usedVertices[$currentVertexId]));\n\n // catch \"algorithm ends\" condition\n if ($isEmpty) {\n break;\n }\n\n if ($isFirst) {\n $isFirst = false;\n } else {\n // mark this vertex\n $usedVertices[$currentVertexId] = true;\n }\n\n // check for all edges of current vertex if there is a cheaper path (or IN OTHER WORDS: Add reachable nodes from currently added node and refresh the current possible distances)\n foreach ($currentVertex->getEdgesOut() as $edge) {\n $weight = $edge->getWeight();\n if ($weight < 0) {\n throw new UnexpectedValueException('Djkstra not supported for negative weights - Consider using MooreBellmanFord');\n }\n\n $targetVertex = $edge->getVertexToFrom($currentVertex);\n $targetVertexId = $targetVertex->getId();\n\n // if the targetVertex is marked, the cheapest path for this vertex has already been found (no negative edges) {\n if (!isset($usedVertices[$targetVertexId])) {\n // calculate new cost to vertex\n $newCostsToTargetVertex = $totalCostOfCheapestPathTo[$currentVertexId] + $weight;\n if (\\is_infinite($newCostsToTargetVertex)) {\n $newCostsToTargetVertex = $weight;\n }\n\n if ((!isset($predecesVertexOfCheapestPathTo[$targetVertexId]))\n // is the new path cheaper?\n || $totalCostOfCheapestPathTo[$targetVertexId] > $newCostsToTargetVertex){\n\n // Not an update, just an new insert with lower cost\n $cheapestVertex->insert($targetVertex, - $newCostsToTargetVertex);\n // so the lowest cost will be extraced first\n // and higher cost will be skipped during extraction\n\n // update/set costs found with the new connection\n $totalCostOfCheapestPathTo[$targetVertexId] = $newCostsToTargetVertex;\n // update/set predecessor vertex from the new connection\n $predecesVertexOfCheapestPathTo[$targetVertexId] = $currentVertex;\n }\n }\n }\n }\n\n if ($totalCostOfCheapestPathTo[$this->vertex->getId()] === INF) {\n unset($predecesVertexOfCheapestPathTo[$this->vertex->getId()]);\n }\n\n // algorithm is done, return resulting edges\n return $this->getEdgesCheapestPredecesor($predecesVertexOfCheapestPathTo);\n }",
"abstract public function getVerticesTarget();",
"public function vertex();",
"function distance2point(&$vertex){\r\n\t\t$distance = infinity; // start very far away\r\n\t\t// loop all vertices of polygon\r\n\t\t$va =& $this->first; \t// first vertex of first segment to check\r\n\t\t$vb =& $va->Next();\t\t// second vertex of segment\r\n\t\tdo{\r\n\t\t\t// get the distance of given vertex to current line segment\r\n\t\t\t$dist = $this->dist_line2point($va->X(),$va->Y(),$vb->X(),$vb->Y(),$vertex->X(),$vertex->Y());\r\n\t\t\t// save it if it is shortest distance so far\r\n\t\t\t$distance = ($dist<$distance)?$dist:$distance;\r\n\t\t\t// set next line segments' vertices\r\n\t\t\t$va =& $va->Next();\r\n\t\t\t$vb =& $va->Next();\r\n\t\t}while ($vb->id() != $this->first->id());\r\n\t\t// return distance if it was resolved, otherwise return null\r\n\t\treturn ($distance<infinity)?$distance:NULL;\t // if in geomode, distance is in meters\r\n\t}",
"function dijkstra(Graph $graph, $startIndex) {\n // init spt bool array to mark visited vertices\n // init dist array to mark distance between vertices from start\n // init parent array to all -1\n // set start dist to 0\n // set traverse ptr to start index\n // while not all vertices are visited\n // put index into spt\n // get edges of index\n // loop through all edges of this index\n // if distance to reach this vertex is bigger than this index dist + current weight\n // set this vertex dist to this index dist + current weight\n // set parent of this vertex to index\n // advance to next edge\n // loop through all vertices\n // if stored dist is bigger than current vertex dist\n // set dist to new smaller dist\n // set index to the smaller dist\n $spt = array_fill(0, $graph->getVerticeCount(), False);\n $dist = array_fill(0, $graph->getVerticeCount(), PHP_INT_MAX);\n $parent = array_fill(0, $graph->getVerticeCount(), -1);\n\n $dist[$startIndex] = 0;\n $index = $startIndex;\n\n while (in_array(False, $spt)) {\n $spt[$index] = True;\n $curr = $graph->getEdges()[$index];\n while (!empty($curr)) {\n if ($dist[$curr->data] > $dist[$index] + $curr->weight) {\n $dist[$curr->data] = $dist[$index] + $curr->weight;\n $parent[$curr->data] = $index;\n }\n $curr = $curr->next;\n }\n $minDist = PHP_INT_MAX;\n for ($i=0; $i < $graph->getVerticeCount(); $i++) { \n if (!$spt[$i] && $minDist > $dist[$i]) {\n $minDist = $dist[$i];\n $index = $i;\n }\n }\n }\n return $parent;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the job is a conform | public function isConformJob() {
return ($this->getJobTypeId() == JobType::TYPE_CONFORM);
} | [
"public function hasValidJobData()\n {\n try {\n if (!is_numeric($this->jobID) || $this->jobID < 0) {\n return false;\n }\n $jobObj = PaySlipJob::get_by_id('PaySlipJob', $this->jobID);\n if (!$jobObj) {\n return false;\n }\n\n $this->jobObject = $jobObj;\n $this->taxBrackets = $jobObj->FinancialYear()->TaxBrackets();\n\n return true;\n } catch (Exception $e) {\n error_log($e->getTraceAsString());\n }\n\n return false;\n }",
"public function hasJob()\n {\n return $this->hasEntity();\n }",
"public function isAcceptanceJob() {\n return ($this->getJobType()->id == JobTypePA::TYPE_ACCEPTANCE);\n }",
"public function isAcceptanceJob() {\n return ($this->getJobTypeId() == JobType::TYPE_ACCEPTANCE);\n }",
"protected function verifyCompliance()\n {\n // Get the policy based on the job name\n $policyClass = sprintf('%sPolicy', str_replace('Jobs', 'JobPolicies', get_class($this)));\n\n // Job complies if no policy exists\n if (! class_exists($policyClass)) {\n return true;\n }\n\n // Instantiate the policy\n $policy = app($policyClass);\n\n // Policy will either return true or throw an exception\n return $policy->complies($this);\n }",
"private function shouldPerform() {\n $key = self::KEY_RECURRING_JOBS . \":\" . static::getJobIdentifier( get_called_class() );\n return Resque::redis()->get( $key ) == $this->job->payload['id'];\n }",
"public function canHandleJob(JobData $jobData);",
"private function isSupported(string $job): bool\n {\n if (in_array($job, (new CakeShellHandler())->getList())) {\n return true;\n }\n\n $this->out(sprintf('Unsupported job provided: %s', $job));\n\n return false;\n }",
"public function validate() {\r\n if (!is_object($this->Organisation) || empty($this->Organisation->id)) {\r\n throw new Exception(\"Cannot save job - organisation is empty or invalid\"); \r\n return false;\r\n }\r\n \r\n if (!is_object($this->Location) || empty($this->Location->id)) {\r\n throw new Exception(\"Cannot save job - job location is empty or invalid\"); \r\n return false;\r\n }\r\n \r\n if (!is_object($this->Classification) || empty($this->Classification->id)) {\r\n throw new Exception(\"Cannot save job - job classification is empty or invalid\"); \r\n return false;\r\n }\r\n \r\n if (empty($this->desc)) {\r\n throw new Exception(\"Cannot save job - job description is empty or invalid\"); \r\n return false;\r\n }\r\n \r\n if (!filter_var($this->salary, FILTER_VALIDATE_INT)) {\r\n $this->salary = \"0\";\r\n }\r\n \r\n if (empty($this->duration) || strtolower($this->duration) == \"ongoing\") {\r\n $this->duration = \"\";\r\n }\r\n \r\n if (empty($this->title)) {\r\n throw new Exception(\"Cannot save job - job title is empty or invalid\"); \r\n return false;\r\n }\r\n \r\n if (empty($this->special_cond)) {\r\n $this->special_cond = \"\"; \r\n }\r\n \r\n if (is_null($this->thread_id)) {\r\n $this->thread_id = 0;\r\n }\r\n \r\n if (!($this->expiry instanceof DateTime)) {\r\n $this->expiry = new DateTime($this->expiry); \r\n }\r\n \r\n $this->salary = filter_var($this->salary, FILTER_SANITIZE_NUMBER_INT);\r\n \r\n return true;\r\n }",
"public function testJobValidate(): void\n {\n $tasksManager = $this->getTasksManager();\n //====================================================================//\n // Test Standard Result\n $testJob = new TestJob();\n Assert::assertTrue(\n $this->invokeMethod($tasksManager, \"validate\", array($testJob))\n );\n\n //====================================================================//\n // Detect Wrong Action\n $testJob->setInputs(array(\"Error-Wrong-Action\" => true));\n Assert::assertFalse(\n $this->invokeMethod($tasksManager, \"validate\", array($testJob))\n );\n\n //====================================================================//\n // Detect Wrong Priority\n $testJob->setInputs(array(\"Error-Wrong-Priority\" => true));\n Assert::assertFalse(\n $this->invokeMethod($tasksManager, \"validate\", array($testJob))\n );\n }",
"private function validateStaticJob(AbstractJob $job): bool\n {\n //====================================================================//\n // If is a Static Job\n //====================================================================//\n if (is_subclass_of($job, AbstractStaticJob::class)) {\n if ($job->getFrequency() <= 0) {\n return false;\n }\n }\n\n return true;\n }",
"public function doesExist(){ return $this->APICall( '', \"Could not test for existence for job \" . $this->description() ); }",
"function _jr_needs_publish( $job ){\n\treturn in_array( $job->post_status, array( 'draft', 'expired' ) );\n}",
"private function isValidJob($id, $user) {\n $task = new Job();\n return $task->exists('job_id=:job_id AND submitted_by=:submitted_by', array(\n ':job_id' => $id,\n ':submitted_by' => $user));\n }",
"protected function isUnsupportedServiceJob()\n {\n return $this->serviceJobId === null\n && $this->serviceNumber === null\n && $this->serviceEventType === null\n && $this->repoToken !== null;\n }",
"private static function validateJob($class, $queue)\n\t{\n\t\tif (empty($class)) {\n\t\t\tthrow new Resque_Exception('Jobs must be given a class.');\n\t\t}\n\t\telse if (empty($queue)) {\n\t\t\tthrow new Resque_Exception('Jobs must be put in a queue.');\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"function handle_job($oakjobs,$job) {\n\tif (isset($job->url)) { // It's a dependency message\n\t\t// Ignore it\n\t}\n\telse if (isset($job->id)) { // It's a dbchanges message\n\t\tforeach_dependency($job->id,'announce_docchange');\n\t}\n\telse { // It's a docchanges message\n\t\tforeach_dependency($job,'announce_docchange');\n\t}\n\n\treturn true;\n}",
"public function isTranscribeJob() {\n return ($this->getJobTypeId() == JobType::TYPE_TRANSCRIBE);\n }",
"public function isAllowedToReview() {\n return $this->isTranscribeJob() ||\n $this->isConformJob() ||\n $this->isTimingJob() ||\n $this->isStandaloneQa() ||\n $this->isStandaloneAcceptance();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort documents in payroll folder | public static function sortDocumentsPayrollFolder($subsectionId)
{
$docsQueue = array();
$addedDocs = array(0=>'0');
$condition = new CDbCriteria();
$condition->condition = "t.Subsection_ID = '$subsectionId'";
$condition->join = "LEFT JOIN documents ON documents.Document_ID = t.Document_ID
LEFT JOIN payrolls ON documents.Document_ID = payrolls.Document_ID
LEFT JOIN payroll_types ON payroll_types.Payroll_Type_ID = payrolls.Payroll_Type_ID";
$condition->order = "payroll_types.Title ASC, payrolls.Version ASC, documents.Created ASC";
// get Pos
$criteria = clone $condition;
$criteria->addCondition("documents.Document_Type = '" . Documents::PR . "'");
$prs = LibraryDocs::model()->findAll($criteria);
foreach ($prs as $pr) {
$docsQueue[] = $pr;
$addedDocs[] = $pr->Document_ID;
}
// get other docs
$criteria = clone $condition;
$criteria->addCondition("t.Document_ID NOT IN ('" . implode("','", $addedDocs) . "')");
$docs = LibraryDocs::model()->findAll($criteria);
foreach ($docs as $doc) {
$docsQueue[] = $doc;
}
// set documents order nums
$i = 1;
foreach($docsQueue as $doc) {
$doc->Sort_Numb = $i;
$doc->save();
$i++;
}
} | [
"protected function sortFileObjects() {\n\t\t$sortingProperty = '';\n\t\tif ($this->typoScriptConfiguration['sorting'] || $this->typoScriptConfiguration['sorting.']) {\n\t\t\t$sortingProperty = $this->contentObject->stdWrap(\n\t\t\t\t$this->typoScriptConfiguration['sorting'],\n\t\t\t\t$this->typoScriptConfiguration['sorting.']\n\t\t\t);\n\t\t}\n\t\tif ($sortingProperty !== '' && count($this->fileObjects) > 1) {\n\t\t\tusort(\n\t\t\t\t$this->fileObjects,\n\t\t\t\tfunction(\n\t\t\t\t\t\\TYPO3\\CMS\\Core\\Resource\\FileInterface $a,\n\t\t\t\t\t\\TYPO3\\CMS\\Core\\Resource\\FileInterface $b\n\t\t\t\t) use($sortingProperty) {\n\t\t\t\t\tif ($a->hasProperty($sortingProperty) && $b->hasProperty($sortingProperty)) {\n\t\t\t\t\t\treturn strnatcasecmp($a->getProperty($sortingProperty), $b->getProperty($sortingProperty));\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}",
"public static function sortDocumentsInVendorFolder($subsectionId)\n {\n $condition = new CDbCriteria();\n $condition->condition = \"t.Subsection_ID = '$subsectionId'\";\n\n // get payments\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN payments ON payments.Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::PM . \"'\");\n $criteria->order = \"payments.Payment_Check_Number DESC\";\n $payments = LibraryDocs::model()->findAll($criteria);\n\n $docsQueue = array();\n $addedDocs = array(0=>'0');\n foreach ($payments as $payment) {\n $docsQueue[] = $payment;\n $addedDocs[] = $payment->Document_ID;\n\n // get Pos\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN pos ON pos.Document_ID = documents.Document_ID\n LEFT JOIN aps ON aps.PO_ID = pos.PO_ID\n LEFT JOIN ap_payments ON ap_payments.AP_ID = aps.AP_ID\n LEFT JOIN payments ON ap_payments.Payment_ID = payments.Payment_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::PO . \"'\");\n $criteria->addCondition(\"payments.Document_ID = '\" . $payment->Document_ID . \"'\");\n $criteria->order = \"pos.PO_Number DESC\";\n $pos = LibraryDocs::model()->findAll($criteria);\n foreach ($pos as $po) {\n // get Aps\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.Document_ID = documents.Document_ID\n LEFT JOIN pos ON aps.PO_ID = pos.PO_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::AP . \"'\");\n $criteria->addCondition(\"pos.Document_ID = '\" . $po->Document_ID . \"'\");\n $criteria->order = \"aps.Invoice_Number DESC\";\n $aps = LibraryDocs::model()->findAll($criteria);\n\n foreach ($aps as $ap) {\n $docsQueue[] = $ap;\n $addedDocs[] = $ap->Document_ID;\n\n // get AP's BUs\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.AP_Backup_Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::BU . \"'\");\n $criteria->addCondition(\"aps.Document_ID = '\" . $ap->Document_ID . \"'\");\n $bu = LibraryDocs::model()->find($criteria);\n if ($bu) {\n $docsQueue[] = $bu;\n $addedDocs[] = $bu->Document_ID;\n }\n }\n\n $docsQueue[] = $po;\n $addedDocs[] = $po->Document_ID;\n\n // get PO's BUs\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN pos ON pos.PO_Backup_Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::BU . \"'\");\n $criteria->addCondition(\"pos.Document_ID = '\" . $po->Document_ID . \"'\");\n $bu = LibraryDocs::model()->find($criteria);\n\n if ($bu) {\n $docsQueue[] = $bu;\n $addedDocs[] = $bu->Document_ID;\n }\n }\n\n // get payment aps without POs\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.Document_ID = documents.Document_ID\n LEFT JOIN ap_payments ON ap_payments.AP_ID = aps.AP_ID\n LEFT JOIN payments ON ap_payments.Payment_ID = payments.Payment_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::AP . \"'\");\n $criteria->addCondition(\"payments.Document_ID = '\" . $payment->Document_ID . \"'\");\n $criteria->addCondition(\"t.Document_ID NOT IN ('\" . implode(\"','\", $addedDocs) . \"')\");\n $criteria->order = \"aps.Invoice_Number DESC\";\n $aps = LibraryDocs::model()->findAll($criteria);\n\n foreach ($aps as $ap) {\n $docsQueue[] = $ap;\n $addedDocs[] = $ap->Document_ID;\n\n // get AP's BUs\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.AP_Backup_Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::BU . \"'\");\n $criteria->addCondition(\"aps.Document_ID = '\" . $ap->Document_ID . \"'\");\n $bu = LibraryDocs::model()->find($criteria);\n if ($bu) {\n $docsQueue[] = $bu;\n $addedDocs[] = $bu->Document_ID;\n }\n }\n }\n\n // add ap-po blocks without payments\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN pos ON pos.Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::PO . \"'\");\n $criteria->addCondition(\"t.Document_ID NOT IN ('\" . implode(\"','\", $addedDocs) . \"')\");\n $criteria->order = \"pos.PO_Number DESC\";\n $pos = LibraryDocs::model()->findAll($criteria);\n foreach ($pos as $po) {\n // get Aps\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.Document_ID = documents.Document_ID\n LEFT JOIN pos ON aps.PO_ID = pos.PO_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::AP . \"'\");\n $criteria->addCondition(\"pos.Document_ID = '\" . $po->Document_ID . \"'\");\n $criteria->order = \"aps.Invoice_Number DESC\";\n $aps = LibraryDocs::model()->findAll($criteria);\n\n foreach ($aps as $ap) {\n $docsQueue[] = $ap;\n $addedDocs[] = $ap->Document_ID;\n\n // get AP's BUs\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.AP_Backup_Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::BU . \"'\");\n $criteria->addCondition(\"aps.Document_ID = '\" . $ap->Document_ID . \"'\");\n $bu = LibraryDocs::model()->find($criteria);\n if ($bu) {\n $docsQueue[] = $bu;\n $addedDocs[] = $bu->Document_ID;\n }\n }\n\n $docsQueue[] = $po;\n $addedDocs[] = $po->Document_ID;\n\n // get BU\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN pos ON pos.PO_Backup_Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::BU . \"'\");\n $criteria->addCondition(\"pos.Document_ID = '\" . $po->Document_ID . \"'\");\n $bu = LibraryDocs::model()->find($criteria);\n\n if ($bu) {\n $docsQueue[] = $bu;\n $addedDocs[] = $bu->Document_ID;\n }\n }\n\n // get single aps\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::AP . \"'\");\n $criteria->addCondition(\"t.Document_ID NOT IN ('\" . implode(\"','\", $addedDocs) . \"')\");\n $criteria->order = \"aps.Invoice_Number DESC\";\n $aps = LibraryDocs::model()->findAll($criteria);\n foreach ($aps as $ap) {\n $docsQueue[] = $ap;\n $addedDocs[] = $ap->Document_ID;\n\n // get AP's BUs\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN aps ON aps.AP_Backup_Document_ID = documents.Document_ID\";\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::BU . \"'\");\n $criteria->addCondition(\"aps.Document_ID = '\" . $ap->Document_ID . \"'\");\n $bu = LibraryDocs::model()->find($criteria);\n if ($bu) {\n $docsQueue[] = $bu;\n $addedDocs[] = $bu->Document_ID;\n }\n }\n\n // get other docs\n $criteria = clone $condition;\n $criteria->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\";\n $criteria->addCondition(\"t.Document_ID NOT IN ('\" . implode(\"','\", $addedDocs) . \"')\");\n $criteria->order = \"documents.Created ASC\";\n $docs = LibraryDocs::model()->findAll($criteria);\n foreach ($docs as $doc) {\n $docsQueue[] = $doc;\n }\n\n // set documents order nums\n $i = 1;\n foreach($docsQueue as $doc) {\n $doc->Sort_Numb = $i;\n $doc->save();\n $i++;\n }\n }",
"protected function sortFilesAndFolders()\n {\n sort($this->files, SORT_STRING | SORT_FLAG_CASE);\n sort($this->folders, SORT_STRING | SORT_FLAG_CASE);\n }",
"protected function sortFilesInPublication(&$publication) {\n // Takes the nids and sort by their weights.\n $nids = array_column($publication->field_core_files[LANGUAGE_NONE], 'target_id');\n usort($nids, function ($a, $b) {\n return $this->getFileWeight($a) > $this->getFileWeight($b);\n });\n\n // Empty 'field_core_files' and added sorted NodeIDs.\n $publication->field_core_files[LANGUAGE_NONE] = [];\n foreach ($nids as $nid) {\n $publication->field_core_files[LANGUAGE_NONE][]['target_id'] = $nid;\n }\n }",
"static function sort_pdf_array_by_date($file_obj_array){\n\t\tfor($j = 0; $j < count($file_obj_array); $j++){\n\t\t\tfor($i = 0; $i < count($file_obj_array) - 1; $i++){ //Will run on all items except the last one\n\t\t\t\tif($file_obj_array[$i]->date < $file_obj_array[$i + 1]->date){\n\t\t\t\t\tarray_splice($file_obj_array, $i + 2, 0, array($file_obj_array[$i]));\n\t\t\t\t\tunset($file_obj_array[$i]);\n\t\t\t\t\t$file_obj_array = array_values($file_obj_array);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $file_obj_array;\n\t}",
"protected function _sort() {}",
"public function sortSearchPages($search_pages);",
"function my_sort($a, $b)\n{\n\tif ($a->fileTimestamp > $b->fileTimestamp) {\n\t\treturn -1;\n\t} else if ($a->fileTimestamp < $b->fileTimestamp) {\n\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\n}",
"public static function sortDocumentsAccountsReceivableFolder($subsectionId)\n {\n $docsQueue = array();\n $addedDocs = array(0=>'0');\n\n $condition = new CDbCriteria();\n $condition->condition = \"t.Subsection_ID = '$subsectionId'\";\n $condition->join = \"LEFT JOIN documents ON documents.Document_ID = t.Document_ID\n LEFT JOIN ars ON documents.Document_ID = ars.Document_ID\";\n $condition->order = \"ars.Invoice_Number DESC, documents.Created DESC\";\n\n // get Pos\n $criteria = clone $condition;\n $criteria->addCondition(\"documents.Document_Type = '\" . Documents::AR . \"'\");\n\n $ars = LibraryDocs::model()->findAll($criteria);\n foreach ($ars as $ar) {\n $docsQueue[] = $ar;\n $addedDocs[] = $ar->Document_ID;\n }\n\n // get other docs\n $criteria = clone $condition;\n $criteria->addCondition(\"t.Document_ID NOT IN ('\" . implode(\"','\", $addedDocs) . \"')\");\n $docs = LibraryDocs::model()->findAll($criteria);\n foreach ($docs as $doc) {\n $docsQueue[] = $doc;\n }\n\n // set documents order nums\n $i = 1;\n foreach($docsQueue as $doc) {\n $doc->Sort_Numb = $i;\n $doc->save();\n $i++;\n }\n }",
"public function testSortSubdocuments()\n {\n // Primer nivel\n $post = $this->Post->find( 'first', array(\n 'revision' => 'draft'\n ));\n \n $blocks = $post ['Post']['blocks'];\n $blocks = array_reverse( $blocks);\n \n foreach( $blocks as $key => $block)\n {\n $this->Post->updateSubdocument( 'blocks', $block ['id'], array(\n 'sort' => $key\n ), array(\n 'revision' => 'draft'\n ));\n \n $document = $this->Post->findSubdocumentById( 'blocks', $block ['id'], 'draft');\n $this->assertEqual( $document ['subdocument']['sort'] == $key, true);\n }\n \n \n // Segundo nivel\n $post = $this->Post->find( 'first', array(\n 'revision' => 'draft'\n ));\n \n $photos = $post ['Post']['blocks'][0]['photos'];\n $photos = array_reverse( $photos);\n\n foreach( $photos as $key => $photo)\n {\n $this->Post->updateSubdocument( 'blocks.photos', $photo ['id'], array(\n 'sort' => $key\n ), array(\n 'revision' => 'draft'\n ));\n \n $document = $this->Post->findSubdocumentById( 'blocks.photos', $photo ['id'], 'draft');\n $this->assertEqual( $document ['subdocument']['sort'] == $key, true);\n }\n }",
"protected function _sort()\n {\n if ($this->_dirtyIndex) {\n $newIndex = [];\n $index = 0;\n\n foreach ($this->_pages as $hash => $page) {\n $order = $page->getOrder();\n if ($order === null) {\n $newIndex[$hash] = $index;\n $index++;\n } else {\n $newIndex[$hash] = $order;\n }\n }\n\n asort($newIndex);\n $this->_index = $newIndex;\n $this->_dirtyIndex = false;\n }\n }",
"private function sort($file)\r\n {\r\n $ocr = $file->getOCR();\r\n\r\n $node = '';\r\n $fileName = '';\r\n\r\n // Ignore Invoice documents\r\n if (preg_match('/Summary Report/i', $ocr)) {\r\n $found = false;\r\n\r\n // Elapsed: 0d 0h 4m 43s 689msFinished\r\n // $positions = [];\r\n\r\n // All our Group Ids start with '01'\r\n // $needle = '01';\r\n // $last = 0;\r\n\r\n // while (($last = strpos($ocr, $needle, $last)) !== false) {\r\n // $positions[] = $last;\r\n // $last = $last + strlen($needle);\r\n // }\r\n\r\n // foreach ($positions as $value) {\r\n // $groupId = substr($ocr, $value, 7);\r\n\r\n // if (ctype_digit($groupId)) {\r\n // if (in_array($groupId, array_keys($this->lookup))) {\r\n // $found = true;\r\n\r\n // $node = $this->lookup[$groupId]['node'];\r\n\r\n // // Need these to be alphabetized\r\n // // [Group Name]-[Page #].[Ext]\r\n // $fileName = $this->lookup[$groupId]['group'] . '-' . $file->page . '.' . $file->ext;\r\n\r\n // break;\r\n // }\r\n // }\r\n // }\r\n\r\n // Elapsed: 0d 0h 4m 42s 690msFinished\r\n foreach ($this->lookup as $id => $info) {\r\n if (preg_match('/' . $id . '/i', $ocr)) { // strpos didn't work\r\n $found = true;\r\n\r\n $node = $info['node'];\r\n\r\n // Need these to be alphabetized\r\n // [Group Name]-[Page #].[Ext]\r\n $fileName = $info['group'] . '-' . $file->page . '.' . $file->ext;\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (! $found) {\r\n $node = 'unknown';\r\n\r\n // [Original File Name]-[Page #].[Ext]\r\n $fileName = $this->getFileName($file->name) . '-' . $file->page . '.' . $file->ext;\r\n }\r\n }\r\n\r\n return [$fileName, $node];\r\n }",
"function syt_archive_sort($a, $b)\n{\n\tif($a->post_date == $b->post_date) return 0;\n\treturn ($a->post_date > $b->post_date) ? -1 : 1;\n\n}",
"private function bibliography()\n {\n $order = $this->multiSort($this->generateBibliographySort());\n Container::getData()->sort($order);\n\n if (Container::getCitationItem() !== false) {\n Container::getCitationItem()->sort($order);\n }\n }",
"public function asort () {}",
"private function sortLangFiles()\r\n\t{\r\n\t\tforeach ($this->pushDataFiles as $file => $files) {\r\n\t\t\tif (array_key_exists($this->defaultLanguage, $files)) {\r\n\t\t\t\t$element[$this->defaultLanguage] = $this->pushDataFiles[$file][$this->defaultLanguage];\r\n\t\t\t\tunset($this->pushDataFiles[$file][$this->defaultLanguage]);\r\n\t\t\t\t$this->pushDataFiles[$file] = array_merge($element, $this->pushDataFiles[$file]);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function sort();",
"function archiveDocuments($document)\n{\n\tglobal $config;\n\t$filename = $document->getFilename();\n\t$fromFile = $config->GENERATEDIR.'/'.$filename;\n\t$toFile = $config->ARCHIVEDIR.'/'.$filename;\n\t$status = rename($fromFile, $toFile);\n\tlogError(($status ? \"Succeeded \" : \"Failed \" ).\"in moving $fromFile to $toFile\");\n\treturn $status;\n}",
"function sortImages(){\r\n $jsonData = file_get_contents('../../../data/content'.$_POST['scroller_id'].'.json');\r\n $images = json_decode($jsonData, TRUE);\r\n $order = explode(',', $_POST['data']);\r\n $orderedImages = array();\r\n \r\n for ($i=0; $i<=count($order); $i++){\r\n $id = 0;\r\n \r\n foreach ($images as $image):\r\n $id++;\r\n \r\n if ($id == $order[$i]){\r\n array_push($orderedImages, $image);\r\n break;\r\n }\r\n endforeach;\r\n }\r\n\r\n $file = fopen('../../../data/content'.$_POST['scroller_id'].'.json', 'w');\r\n fwrite($file, json_encode($orderedImages));\r\n fclose($file);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation storeProductsDraft Create new products draft | public function storeProductsDraft($body)
{
list($response) = $this->storeProductsDraftWithHttpInfo($body);
return $response;
} | [
"public function testStoreProductsDraft()\n {\n }",
"public function storeProductsDraftWithHttpInfo($body)\n {\n $returnType = '\\RackbeatApp\\Client\\Model\\Product';\n $request = $this->storeProductsDraftRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse()->getBody()->getContents()\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\RackbeatApp\\Client\\Model\\Product',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function create( &$prod ) {\n\t\t$prod->set_version( WC_VERSION );\n\t\t//$prod->set_date_created( current_time( 'timestamp', true ) );\n\t\t//$prod->set_currency( $prod->get_currency() ? $prod->get_currency() : get_woocommerce_currency() );\n\n\t\t$id = wp_insert_post( apply_filters( 'woocommerce_new_prod_data', array(\n\t\t\t//'post_date' => gmdate( 'Y-m-d H:i:s', $prod->get_date_created( 'edit' )->getOffsetTimestamp() ),\n\t\t\t//'post_date_gmt' => gmdate( 'Y-m-d H:i:s', $prod->get_date_created( 'edit' )->getTimestamp() ),\n\t\t\t'post_type' => $prod->get_type( 'edit' ),\n\t\t\t'post_status' => 'wc-' . ( $prod->get_status( 'edit' ) ? $prod->get_status( 'edit' ) : apply_filters( 'woocommerce_default_prod_status', 'pending' ) ),\n\t\t\t'ping_status' => 'closed',\n\t\t\t'post_author' => 1,\n\t\t\t'post_title' => $this->get_post_title(),\n\t\t\t'post_password' => uniqid( 'prod_' ),\n\t\t\t'post_parent' => $prod->get_parent_id( 'edit' ),\n\t\t\t'post_excerpt' => $this->get_post_excerpt( $prod ),\n\t\t) ), true );\n\n\t\tif ( $id && ! is_wp_error( $id ) ) {\n\t\t\t$prod->set_id( $id );\n\t\t\t$this->update_post_meta( $prod );\n\t\t\t$prod->save_meta_data();\n\t\t\t$prod->apply_changes();\n\t\t\t$this->clear_caches( $prod );\n\t\t}\n\t}",
"function create_draft() {\n\n\t\t$author_id = 1;\n\t\t$post_title = $this->message;\n\t\t$status = 'draft';\n\n\t\t$post_data = array(\n\t\t\t'post_type'\t\t\t=> 'piwaka',\n\t\t\t'post_author'\t\t=> $author_id,\n\t\t\t'post_title'\t\t=> $post_title,\n\t\t\t'post_status'\t\t=> $status,\n\t\t\t'post_content'\t\t=> '[piwaka-featured]'\n\t\t);\n\n\t\t$post_id = wp_insert_post($post_data);\n\n\t\t$this->post_id = $post_id;\n\t\t$this->post_title = $post_title;\n\t\t$this->permalink = get_permalink( $post_id );\n\n\t}",
"public static function createDraft(array $draft_data)\n {\n parent::create(self::TABLE_NAME, $draft_data);\n return self::findDraft($draft_data['draft_id']);\n }",
"public function testCreateDrafts()\n {\n }",
"public function actionProductsCreate()\n {\n $data = json_decode(file_get_contents('php://input'), true);\n ProductShopifyAdminRestApiForm::createOrUpdateFromApiData($data);\n }",
"public function store(Createstock_productsRequest $request)\n {\n $input = $request->all();\n\n $stockProducts = $this->stockProductsRepository->create($input);\n\n Flash::success('Stock Products saved successfully.');\n\n return redirect(route('stockProducts.index'));\n }",
"public function createAction()\n {\n \t if (!$this->request->isPost()) {\n return $this->forward(\"products/index\");\n }\n\n $form = new ProductsForm;\n $product = new Products();\n\n $product->id = $this->request->getPost(\"id\", \"int\");\n $product->product_types_id = $this->request->getPost(\"product_types_id\", \"int\");\n $product->name = $this->request->getPost(\"name\", \"striptags\");\n $product->price = $this->request->getPost(\"price\", \"double\");\n $product->active = $this->request->getPost(\"active\");\n // ...\n }",
"public function createProduct();",
"public function createAction()\n {\n $entity = new Product();\n $request = $this->getRequest();\n $form = $this->createForm(new ProductType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('BSDataBundle_product_show', array('id' => $entity->getId())));\n\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function created(Products $products)\n {\n //\n }",
"private function savePurchaseInvoiceDraft()\n {\n try {\n $pi = new PurchaseInvoice();\n $pi->supplier_id = 0;\n $pi->ship_to_branch_id = 0;\n $pi->purchase_rep = Auth::user()->staff->id;\n $pi->due_date = date('Y-m-d');\n $pi->currency_id = 1;\n $pi->is_draft = 1;\n $pi->save();\n\n return $pi->id;\n } catch (\\Exception $ex) {\n return false;\n }\n }",
"public function create()\r\n\t{\r\n\t\t$this->auth->restrict('Product.Settings.Create');\r\n\r\n\t\tif ($this->input->post('submit'))\r\n\t\t{\r\n\t\t\tif ($insert_id = $this->save_product())\r\n\t\t\t{\r\n\t\t\t\t// Log the activity\r\n\t\t\t\t$this->load->model('activities/Activity_model', 'activity_model');\r\n\r\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('product_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'product');\r\n\r\n\t\t\t\tTemplate::set_message(lang('product_create_success'), 'success');\r\n\t\t\t\tTemplate::redirect(SITE_AREA .'/settings/product');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tTemplate::set_message(lang('product_create_failure') . $this->product_model->error, 'error');\r\n\t\t\t}\r\n\t\t}\r\n\t\tAssets::add_module_js('product', 'product.js');\r\n\r\n\t\tTemplate::set('toolbar_title', lang('product_create') . ' Product');\r\n\t\tTemplate::render();\r\n\t}",
"public function store(CreateProductPresentationTranslationRequest $request)\n {\n\n\n // save ProductPresentation\n $productPresentation = $this->saveProductPresentation($request);\n\n // save ProductPresentationTranslation\n $productPresentationTranslation = $this->saveProductPresentationTranslation($request, $productPresentation);\n\n Flash::success('Product Presentation saved successfully.');\n\n return redirect(route('admin.productPresentations.index'));\n }",
"function NewDraft()\n\t{\n\t\t$b = $this->GetBlog();\n\t\t$this->html = file_get_contents( \"res/blog_draft.html\" );\n\t\t$this->tokens->screen_title = \"New Post\";\n\t\t$this->tokens->title = \"\";\n\t\t$this->tokens->text = \"\";\n\t\t$this->tokens->dateline = \"\";\n\t\t$this->tokens->postid = \"new\";\n\t}",
"public function createProducts($productXml) {\n try{\n return $this->getPostRequest('products/feed.xml?type=create', $productXml);\n } catch (Exception $e) {\n Mage::log('Post Request Exception ' . $e, null, Flubit_Flubit_Helper_Data::FLUBIT_EXCEPTIONS);\n }\n }",
"public function createProductAction(){\n $reponse = array(\n 'status' => \\Helpers\\Language::$postStatusFailure,\n 'message' => \\Helpers\\Language::$errorPostParameters\n );\n // must be a POST request\n if ($this->request->isPost() == true) {\n $params = $this->request->get();\n $product = new \\Multiple\\Models\\Product();\n foreach($params as $key => $value){\n \\Helpers\\Model::setCreateProperty($product,$key,$value);\n }\n $auth = $this->session->get('auth');\n $user = \\Multiple\\Models\\User::findFirst(array(\n \"username = :username:\",\n \"bind\" => array(\n \"username\" => $auth['username']\n )\n ));\n $product->created = 'NOW()';\n $product->created_by = $user->username;\n $response['message'] = 'Failed to create product';\n if($product->create()){\n $response['status'] = \\Helpers\\Language::$postStatusSuccess;\n $response['message'] = 'Product created successfully';\n $response['id'] = $product->id;\n }\n }\n \\Helpers\\Controller::jsonify($response);\n $this->view->disable();\n }",
"public function createProduct() {\n\n $name= $_POST[\"name\"];\n $status=$_POST[\"status\"];\n $category=$_POST[\"category\"];\n\n $var = Object_Product::create([\n \"name\" => $name,\n \"status\" => $status,\n \"category\" => $category,\n ]);\n\n $var->setKey($_POST[\"key\"]);\n $var->setParentId(48);\n $var->save();\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure that context inheritance works up the context tree. | public function test_effective_context_inheritance() {
$this->resetAfterTest();
$systemdata = $this->create_and_set_purpose_for_contextlevel('PT1S', CONTEXT_SYSTEM);
/*
* System
* - Cat
* - Subcat
* - Course
* - Forum
* - User
* - User block
*/
$cat = $this->getDataGenerator()->create_category();
$subcat = $this->getDataGenerator()->create_category(['parent' => $cat->id]);
$course = $this->getDataGenerator()->create_course(['category' => $subcat->id]);
$forum = $this->getDataGenerator()->create_module('forum', ['course' => $course->id]);
list(, $forumcm) = get_course_and_cm_from_instance($forum->id, 'forum');
$user = $this->getDataGenerator()->create_user();
$contextsystem = \context_system::instance();
$contextcat = \context_coursecat::instance($cat->id);
$contextsubcat = \context_coursecat::instance($subcat->id);
$contextcourse = \context_course::instance($course->id);
$contextforum = \context_module::instance($forumcm->id);
$contextuser = \context_user::instance($user->id);
// Initially everything is set to Inherit.
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "0"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat, "0"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse, "0"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum, "0"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextuser));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextuser, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextuser, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextuser));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextuser, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextuser, "0"));
// When actively set, user will use the specified value.
$userdata = $this->create_and_set_purpose_for_contextlevel('PT1S', CONTEXT_USER);
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "0"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat, "0"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse, "0"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum, "-1"));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum, "0"));
$this->assertEquals($userdata->purpose, api::get_effective_context_purpose($contextuser));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextuser, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum, "-1"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum, "0"));
$this->assertEquals($userdata->category, api::get_effective_context_category($contextuser));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextuser, "-1"));
// Set a context for the top category.
$catpurpose = new purpose(0, (object) [
'name' => 'Purpose',
'retentionperiod' => 'P1D',
'lawfulbases' => 'gdpr_art_6_1_a',
]);
$catpurpose->save();
$catcategory = new category(0, (object) ['name' => 'Category']);
$catcategory->save();
api::set_context_instance((object) [
'contextid' => $contextcat->id,
'purposeid' => $catpurpose->get('id'),
'categoryid' => $catcategory->get('id'),
]);
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "-1"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat, "0"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextsubcat));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextsubcat, "-1"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextsubcat, "0"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcourse));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcourse, "-1"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcourse, "0"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextforum));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextforum, "-1"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextforum, "0"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextforum, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "-1"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat, "0"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextsubcat));
$this->assertEquals($catcategory, api::get_effective_context_category($contextsubcat, "-1"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextsubcat, "0"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcourse));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcourse, "-1"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcourse, "0"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextforum));
$this->assertEquals($catcategory, api::get_effective_context_category($contextforum, "-1"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextforum, "0"));
// Set a context for the sub category.
$subcatpurpose = new purpose(0, (object) [
'name' => 'Purpose',
'retentionperiod' => 'P1D',
'lawfulbases' => 'gdpr_art_6_1_a',
]);
$subcatpurpose->save();
$subcatcategory = new category(0, (object) ['name' => 'Category']);
$subcatcategory->save();
api::set_context_instance((object) [
'contextid' => $contextsubcat->id,
'purposeid' => $subcatpurpose->get('id'),
'categoryid' => $subcatcategory->get('id'),
]);
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "-1"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat, "0"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextsubcat));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextsubcat, "-1"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextsubcat, "0"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextcourse));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextcourse, "-1"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextcourse, "0"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextforum));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextforum, "-1"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextforum, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "-1"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat, "0"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextsubcat));
$this->assertEquals($catcategory, api::get_effective_context_category($contextsubcat, "-1"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextsubcat, "0"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextcourse));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextcourse, "-1"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextcourse, "0"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextforum));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextforum, "-1"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextforum, "0"));
// Set a context for the course.
$coursepurpose = new purpose(0, (object) [
'name' => 'Purpose',
'retentionperiod' => 'P1D',
'lawfulbases' => 'gdpr_art_6_1_a',
]);
$coursepurpose->save();
$coursecategory = new category(0, (object) ['name' => 'Category']);
$coursecategory->save();
api::set_context_instance((object) [
'contextid' => $contextcourse->id,
'purposeid' => $coursepurpose->get('id'),
'categoryid' => $coursecategory->get('id'),
]);
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "-1"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat, "0"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextsubcat));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextsubcat, "-1"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextsubcat, "0"));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextcourse));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextcourse, "-1"));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextcourse, "0"));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextforum));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextforum, "-1"));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextforum, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "-1"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat, "0"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextsubcat));
$this->assertEquals($catcategory, api::get_effective_context_category($contextsubcat, "-1"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextsubcat, "0"));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextcourse));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextcourse, "-1"));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextcourse, "0"));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextforum));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextforum, "-1"));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextforum, "0"));
// Set a context for the forum.
$forumpurpose = new purpose(0, (object) [
'name' => 'Purpose',
'retentionperiod' => 'P1D',
'lawfulbases' => 'gdpr_art_6_1_a',
]);
$forumpurpose->save();
$forumcategory = new category(0, (object) ['name' => 'Category']);
$forumcategory->save();
api::set_context_instance((object) [
'contextid' => $contextforum->id,
'purposeid' => $forumpurpose->get('id'),
'categoryid' => $forumcategory->get('id'),
]);
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat));
$this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat, "-1"));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextcat, "0"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextsubcat));
$this->assertEquals($catpurpose, api::get_effective_context_purpose($contextsubcat, "-1"));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextsubcat, "0"));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextcourse));
$this->assertEquals($subcatpurpose, api::get_effective_context_purpose($contextcourse, "-1"));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextcourse, "0"));
$this->assertEquals($forumpurpose, api::get_effective_context_purpose($contextforum));
$this->assertEquals($coursepurpose, api::get_effective_context_purpose($contextforum, "-1"));
$this->assertEquals($forumpurpose, api::get_effective_context_purpose($contextforum, "0"));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat));
$this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat, "-1"));
$this->assertEquals($catcategory, api::get_effective_context_category($contextcat, "0"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextsubcat));
$this->assertEquals($catcategory, api::get_effective_context_category($contextsubcat, "-1"));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextsubcat, "0"));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextcourse));
$this->assertEquals($subcatcategory, api::get_effective_context_category($contextcourse, "-1"));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextcourse, "0"));
$this->assertEquals($forumcategory, api::get_effective_context_category($contextforum));
$this->assertEquals($coursecategory, api::get_effective_context_category($contextforum, "-1"));
$this->assertEquals($forumcategory, api::get_effective_context_category($contextforum, "0"));
} | [
"public function test_effective_context_inheritance_explicitly_set() {\n $this->resetAfterTest();\n\n $systemdata = $this->create_and_set_purpose_for_contextlevel('PT1S', CONTEXT_SYSTEM);\n\n /*\n * System\n * - Cat\n * - Subcat\n * - Course\n * - Forum\n * - User\n * - User block\n */\n $cat = $this->getDataGenerator()->create_category();\n $subcat = $this->getDataGenerator()->create_category(['parent' => $cat->id]);\n $course = $this->getDataGenerator()->create_course(['category' => $subcat->id]);\n $forum = $this->getDataGenerator()->create_module('forum', ['course' => $course->id]);\n list(, $forumcm) = get_course_and_cm_from_instance($forum->id, 'forum');\n\n $contextsystem = \\context_system::instance();\n $contextcat = \\context_coursecat::instance($cat->id);\n $contextsubcat = \\context_coursecat::instance($subcat->id);\n $contextcourse = \\context_course::instance($course->id);\n $contextforum = \\context_module::instance($forumcm->id);\n\n // Initially everything is set to Inherit.\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum));\n\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum));\n\n // Set a default value of inherit for CONTEXT_COURSECAT.\n $classname = \\context_helper::get_class_for_level(CONTEXT_COURSECAT);\n list($purposevar, $categoryvar) = data_registry::var_names_from_context($classname);\n set_config($purposevar, '-1', 'tool_dataprivacy');\n set_config($categoryvar, '-1', 'tool_dataprivacy');\n\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum));\n\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum));\n\n // Set a default value of inherit for CONTEXT_COURSE.\n $classname = \\context_helper::get_class_for_level(CONTEXT_COURSE);\n list($purposevar, $categoryvar) = data_registry::var_names_from_context($classname);\n set_config($purposevar, '-1', 'tool_dataprivacy');\n set_config($categoryvar, '-1', 'tool_dataprivacy');\n\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum));\n\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum));\n\n // Set a default value of inherit for CONTEXT_MODULE.\n $classname = \\context_helper::get_class_for_level(CONTEXT_MODULE);\n list($purposevar, $categoryvar) = data_registry::var_names_from_context($classname);\n set_config($purposevar, '-1', 'tool_dataprivacy');\n set_config($categoryvar, '-1', 'tool_dataprivacy');\n\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsystem));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextsubcat));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextcourse));\n $this->assertEquals($systemdata->purpose, api::get_effective_context_purpose($contextforum));\n\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsystem));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextsubcat));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextcourse));\n $this->assertEquals($systemdata->category, api::get_effective_context_category($contextforum));\n }",
"public function refineContextdefinitions();",
"abstract protected function initializeContext();",
"public function getParentContext();",
"public function setBehavioursToContextIfNotSet()\n {\n $this->assertTrue(\n $this->object->context()->hasBehaviour('get rule class')\n );\n $this->assertTrue(\n $this->object->context()->hasBehaviour('include rule file')\n );\n }",
"function bare_pages_set_child_context() {\n static $processed;\n // Make sure external resources are not included more than once.\n if (isset($processed)) {\n return;\n }\n $processed = TRUE;\n\n // Disable admin_menu, admin module output and similar modules, which\n // is something child windows don't need.\n module_invoke_all('suppress');\n\n // Tell Drupal's theme system to use the Bare Pages template.\n $GLOBALS['bare_pages_page_template'] = TRUE;\n \n // Allow other modules to react\n module_invoke_all('bp_child_context_activated');\n}",
"public function test_parentusersetcontext() {\n $newobj = $this->inituserset();\n $newobj->save();\n\n $context = \\local_elisprogram\\context\\userset::instance($newobj->id);\n\n // Validate that a context record was actually created with correct values.\n $this->assertGreaterThan(0, $context->id);\n $this->assertEquals(CONTEXT_ELIS_USERSET, $context->contextlevel);\n $this->assertEquals($newobj->id, $context->instanceid);\n\n // Create the context path to validate this in the returned context object.\n $path = '/'.SYSCONTEXTID.'/'.$context->id;\n\n $this->assertEquals($path, $context->path);\n $this->assertEquals(substr_count($path, '/'), $context->depth);\n }",
"public function anaContext()\n {\n $this->setContext($this->parent->context);\n }",
"protected function parentSetup() {\n }",
"private function setup_contexts()\n {\n if ($this->context_head)\n {\n return;\n }\n\n $contexts = $this->setup();\n $default_context = new Context();\n $default_context->add(new ExitApplication(), new Help(), new Trace(), new State(), new Evaluator(), new CatchAll());\n $contexts[] = $default_context;\n\n /**\n * @var Context $context\n */\n krsort($contexts);\n $state = $this->get(self::STATE) ?: array();\n foreach($contexts as $context)\n {\n if ($tail = $this->context_head)\n {\n $context->append($tail, $state);\n }\n\n $this->context_head = $context;\n\n }\n unset($tail, $context, $contexts);\n }",
"public function contextStrategy();",
"protected function initializeContext() : void {}",
"public function hasContexts();",
"public function inheritance()\n {\n // Some example data\n $data['title'] = \"The Smarty parser works with template inheritance!\";\n $data['body'] = \"This is body text to show that Smarty 3 template inheritance works with Smarty Parser.\";\n \n // Load the template from the views directory\n $this->parser->parse(\"inheritancetest.tpl\", $data);\n \n }",
"public function fillBaseContextStructure(Context $context): Context\n {\n if (\\App\\Enum\\ContextType::EMPTY()->getValue() === $context->getType()) {\n return $context;\n }\n\n $contextStructureFile = $this->getBaseContextStructureFileForType($context->getType());\n\n $contextStructure = $this->createStructureFromFile($contextStructureFile);\n\n $this->applyStructureToContext($contextStructure, $context);\n\n return $context;\n }",
"private function ensureParentConfigExtrasInitialized()\n {\n if (null === $this->parentConfigExtras) {\n $this->parentConfigExtras = new ConfigExtraCollection();\n $this->parentConfigExtras->setConfigExtras($this->createParentConfigExtras());\n }\n }",
"protected function _initContext()\r\n {\r\n if(isset($this->contexts)) {\r\n $this->_helper->contextSwitch->initContext();\r\n $this->_context = $this->_helper->contextSwitch->getCurrentContext();\r\n }\r\n }",
"protected function _cleanContexts(){\n\n //remove no more present contexts\n foreach( $this->_destroyContext as $_context ){\n\n self::_TimeStampMsg( \"(parent \" . self::$tHandlerPID . \") : need to delete a context\" );\n $this->_killPids( $_context );\n\n }\n $this->_destroyContext = array();\n\n }",
"public function createSubScopeContext();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END FUNCTION / TOGGLE Raspberry GPIO Output | function GPIO_Toggle($var1,$var2,$intensite,$progression) {
// Determine GPIO Output Status ON or OFF
$retstatus = exec("gpio -1 read $var2", $Output, $retval);
echo('exec("gpio -1 read $var2", $Output, $retval)' . CRLF);
$NewValue="0"; $intensite="0x0"; if ($retstatus=="0") { $NewValue = "1"; $intensite="0x32";}
// Set new Value (Opposite)
$retstatus = exec("gpio -1 write ".$var2." ".$NewValue, $Output, $retval);
// Return Status if OK
if ($retstatus=="") {
$trigger = new trigger();
$trigger->OUTtrigger("wiringPI", $var1, $var2, $intensite);
} // END IF
} | [
"public function turnOff()\n {\n exec(\"gpio -g write {$this->pin} 0\");\n }",
"public function turnOn()\n {\n exec(\"gpio -g write {$this->pin} 1\");\n }",
"function toggle_power()\n{\n global $path_gpio_power\n , $GPIO_ON\n , $GPIO_OFF\n , $BUTTON_PRESS_DELAY\n , $HTTP_RESPONSE_CODE_OK\n , $HTTP_RESPONSE_CODE_SERVERERROR;\n\n $path_gpio_power_value = $path_gpio_power.'/value';\n\n $currentValue = file_get_contents($path_gpio_power_value);\n // [0] because the FIRST character should be either '1' or '0'\n // else we compare a longer string due to the last byte in the file\n $result = file_put_contents($path_gpio_power_value, $currentValue[0] === $GPIO_ON ? $GPIO_OFF : $GPIO_ON);\n\n usleep($BUTTON_PRESS_DELAY);\n\n $currentValue = file_get_contents($path_gpio_power_value);\n $result = file_put_contents($path_gpio_power_value, $currentValue[0] === $GPIO_ON ? $GPIO_OFF : $GPIO_ON);\n \n if($result) {\n return $HTTP_RESPONSE_CODE_OK;\n } else {\n return $HTTP_RESPONSE_CODE_SERVERERROR;\n }\n}",
"function garageDoor() {\n system('gpio mode 0 out');\n\n // set GPIO pin #1 to On/1/High\n system('gpio write 0 1');\n\n // wait 0.25 sec\n usleep(250000);\n\n // set GPIO pin #1 to Off/0/Low\n system('gpio write 0 0');\n}",
"public function switchOn();",
"public function switchOff()\n {\n }",
"protected function powerOn()\n {\n if ($this->powerPin > -1) {\n system('amixer -q set PCM 90%');\n system('raspi-gpio set '.$this->powerPin.' op');\n system('raspi-gpio set '.$this->powerPin.' dl');\n }\n }",
"private function ledOff()\n {\n $this->ledPin->setValue(PinInterface::VALUE_LOW);\n }",
"public static function handleOnOff(){\n\t\t//\n\t}",
"public function turnLightOff()\n {\n echo 'The light is already off'.PHP_EOL;\n }",
"public function setRed($power = 1){\n file_put_contents(\"/dev/pi-blaster\", \"{$this->GPIORed}=$power\\n\");\n }",
"function control_gpio()\n{\n $data = read_file();\n // fetch data from object\n foreach ($data->equipment as $value) {\n if ($value->status == 1) {\n //execute command line using exec function\n exec(\"gpio -g mode {$value->port} out\");\n exec(\"gpio -g write {$value->port} 1\");\n } else {\n exec(\"gpio -g write {$value->port} 0\"); \n }\n }\n \n}",
"public function off()\n {\n echo 'The light is off now.' . PHP_EOL;\n }",
"public function enable()\n {\n if (\\App::environment('production'))\n {\n shell_exec('gpio -g write ' . $this->pin . ' 1');\n }\n \n $this->active = TRUE;\n $this->save();\n }",
"public function turnOff()\r\n {\r\n $this->os->halt();\r\n $this->bios->powerDown();\r\n }",
"public function turnOff()\n {\n $this->os->halt();\n $this->bios->powerDown();\n }",
"protected function setPowerLed(){\n if($this->outputLedPwr->getValue() == GPIO::LOW){\n $this->outputLedPwr->setValue(GPIO::HIGH);\n }\n }",
"public function turnOn()\r\n {\r\n $this->bios->execute();\r\n $this->bios->waitForKeyPress();\r\n $this->bios->launch($this->os);\r\n }",
"function setPWM($chip,$period,$duty){\n $cmd=\"echo 0 > /sys/class/pwm/pwmchip\".$chip.\"/export\"; // Enables PWM\n shell_exec($cmd);\n $cmd=\"echo \". $period .\" > /sys/class/pwm/pwmchip\".$chip.\"/pwm0/period\";\n shell_exec($cmd);\n $cmd=\"echo \".$duty.\" > /sys/class/pwm/pwmchip\".$chip.\"/pwm0/duty_cycle\";\n shell_exec($cmd);\n $cmd=\"echo 1 > /sys/class/pwm/pwmchip\".$chip.\"/pwm0/enable\";\n shell_exec($cmd);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "PN_CHARS" $ANTLR start "PN_PREFIX" | function mPN_PREFIX(){
try {
// Tokenizer11.g:568:3: ( PN_CHARS_BASE ( ( PN_CHARS | DOT )* PN_CHARS )? )
// Tokenizer11.g:569:3: PN_CHARS_BASE ( ( PN_CHARS | DOT )* PN_CHARS )?
{
$this->mPN_CHARS_BASE();
// Tokenizer11.g:570:3: ( ( PN_CHARS | DOT )* PN_CHARS )?
$alt31=2;
$LA31_0 = $this->input->LA(1);
if ( (($LA31_0>=$this->getToken('45') && $LA31_0<=$this->getToken('46'))||($LA31_0>=$this->getToken('48') && $LA31_0<=$this->getToken('57'))||$LA31_0==$this->getToken('95')||($LA31_0>=$this->getToken('97') && $LA31_0<=$this->getToken('122'))||$LA31_0==$this->getToken('183')||($LA31_0>=$this->getToken('192') && $LA31_0<=$this->getToken('214'))||($LA31_0>=$this->getToken('216') && $LA31_0<=$this->getToken('246'))||($LA31_0>=$this->getToken('248') && $LA31_0<=$this->getToken('893'))||($LA31_0>=$this->getToken('895') && $LA31_0<=$this->getToken('8191'))||($LA31_0>=$this->getToken('8204') && $LA31_0<=$this->getToken('8205'))||($LA31_0>=$this->getToken('8255') && $LA31_0<=$this->getToken('8256'))||($LA31_0>=$this->getToken('8304') && $LA31_0<=$this->getToken('8591'))||($LA31_0>=$this->getToken('11264') && $LA31_0<=$this->getToken('12271'))||($LA31_0>=$this->getToken('12289') && $LA31_0<=$this->getToken('55295'))||($LA31_0>=$this->getToken('63744') && $LA31_0<=$this->getToken('64975'))||($LA31_0>=$this->getToken('65008') && $LA31_0<=$this->getToken('65533'))) ) {
$alt31=1;
}
switch ($alt31) {
case 1 :
// Tokenizer11.g:571:5: ( PN_CHARS | DOT )* PN_CHARS
{
// Tokenizer11.g:571:5: ( PN_CHARS | DOT )*
//loop30:
do {
$alt30=3;
$alt30 = $this->dfa30->predict($this->input);
switch ($alt30) {
case 1 :
// Tokenizer11.g:572:7: PN_CHARS
{
$this->mPN_CHARS();
}
break;
case 2 :
// Tokenizer11.g:573:9: DOT
{
$this->mDOT();
}
break;
default :
break 2;//loop30;
}
} while (true);
$this->mPN_CHARS();
}
break;
}
}
}
catch(Exception $e){
throw $e;
}
} | [
"function mPNAME_NS(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$PNAME_NS;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n $p=null;\n\n // Tokenizer11.g:316:3: ( (p= PN_PREFIX )? ':' ) \n // Tokenizer11.g:317:3: (p= PN_PREFIX )? ':' \n {\n // Tokenizer11.g:317:4: (p= PN_PREFIX )? \n $alt2=2;\n $LA2_0 = $this->input->LA(1);\n\n if ( (($LA2_0>=$this->getToken('97') && $LA2_0<=$this->getToken('122'))||($LA2_0>=$this->getToken('192') && $LA2_0<=$this->getToken('214'))||($LA2_0>=$this->getToken('216') && $LA2_0<=$this->getToken('246'))||($LA2_0>=$this->getToken('248') && $LA2_0<=$this->getToken('767'))||($LA2_0>=$this->getToken('880') && $LA2_0<=$this->getToken('893'))||($LA2_0>=$this->getToken('895') && $LA2_0<=$this->getToken('8191'))||($LA2_0>=$this->getToken('8204') && $LA2_0<=$this->getToken('8205'))||($LA2_0>=$this->getToken('8304') && $LA2_0<=$this->getToken('8591'))||($LA2_0>=$this->getToken('11264') && $LA2_0<=$this->getToken('12271'))||($LA2_0>=$this->getToken('12289') && $LA2_0<=$this->getToken('55295'))||($LA2_0>=$this->getToken('63744') && $LA2_0<=$this->getToken('64975'))||($LA2_0>=$this->getToken('65008') && $LA2_0<=$this->getToken('65533'))) ) {\n $alt2=1;\n }\n switch ($alt2) {\n case 1 :\n // Tokenizer11.g:317:4: p= PN_PREFIX \n {\n $pStart1012 = $this->getCharIndex();\n $this->mPN_PREFIX(); \n $p = new CommonToken($this->input, TokenConst::$INVALID_TOKEN_TYPE, TokenConst::$DEFAULT_CHANNEL, $pStart1012, $this->getCharIndex()-1);\n\n }\n break;\n\n }\n\n $this->matchChar(58); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function mPREFIX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql10_Sparql10_Tokenizer::$PREFIX;\n $_channel = Erfurt_Sparql_Parser_Sparql10_Sparql10_Tokenizer::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer.g:31:3: ( 'prefix' ) \n // Tokenizer.g:32:3: 'prefix' \n {\n $this->matchString(\"prefix\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function mPREFIX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$PREFIX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:101:3: ( 'prefix' ) \n // Tokenizer11.g:102:3: 'prefix' \n {\n $this->matchString(\"prefix\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"private function generatePrefixDecl($prefix) {\n \t\t$returnString = \"\";\n \t\t\n \t\twhile ($p = each($prefix)) {\n \t\t\t$returnString .= \"PREFIX \".$p[\"key\"].\": \".\"<\".$p[\"value\"].\">\\n\";\n \t\t}\n \t\treturn $returnString;\n \t}",
"function mPN_CHARS(){\n try {\n // Tokenizer11.g:557:3: ( PN_CHARS_U | MINUS | ( '0' .. '9' ) | '\\\\u00B7' | '\\\\u0300' .. '\\\\u036F' | '\\\\u203F' .. '\\\\u2040' ) \n $alt29=6;\n $LA29_0 = $this->input->LA(1);\n\n if ( ($LA29_0==$this->getToken('95')||($LA29_0>=$this->getToken('97') && $LA29_0<=$this->getToken('122'))||($LA29_0>=$this->getToken('192') && $LA29_0<=$this->getToken('214'))||($LA29_0>=$this->getToken('216') && $LA29_0<=$this->getToken('246'))||($LA29_0>=$this->getToken('248') && $LA29_0<=$this->getToken('767'))||($LA29_0>=$this->getToken('880') && $LA29_0<=$this->getToken('893'))||($LA29_0>=$this->getToken('895') && $LA29_0<=$this->getToken('8191'))||($LA29_0>=$this->getToken('8204') && $LA29_0<=$this->getToken('8205'))||($LA29_0>=$this->getToken('8304') && $LA29_0<=$this->getToken('8591'))||($LA29_0>=$this->getToken('11264') && $LA29_0<=$this->getToken('12271'))||($LA29_0>=$this->getToken('12289') && $LA29_0<=$this->getToken('55295'))||($LA29_0>=$this->getToken('63744') && $LA29_0<=$this->getToken('64975'))||($LA29_0>=$this->getToken('65008') && $LA29_0<=$this->getToken('65533'))) ) {\n $alt29=1;\n }\n else if ( ($LA29_0==$this->getToken('45')) ) {\n $alt29=2;\n }\n else if ( (($LA29_0>=$this->getToken('48') && $LA29_0<=$this->getToken('57'))) ) {\n $alt29=3;\n }\n else if ( ($LA29_0==$this->getToken('183')) ) {\n $alt29=4;\n }\n else if ( (($LA29_0>=$this->getToken('768') && $LA29_0<=$this->getToken('879'))) ) {\n $alt29=5;\n }\n else if ( (($LA29_0>=$this->getToken('8255') && $LA29_0<=$this->getToken('8256'))) ) {\n $alt29=6;\n }\n else {\n $nvae = new NoViableAltException(\"\", 29, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt29) {\n case 1 :\n // Tokenizer11.g:558:3: PN_CHARS_U \n {\n $this->mPN_CHARS_U(); \n\n }\n break;\n case 2 :\n // Tokenizer11.g:559:5: MINUS \n {\n $this->mMINUS(); \n\n }\n break;\n case 3 :\n // Tokenizer11.g:560:5: ( '0' .. '9' ) \n {\n // Tokenizer11.g:560:5: ( '0' .. '9' ) \n // Tokenizer11.g:560:6: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n\n }\n break;\n case 4 :\n // Tokenizer11.g:561:5: '\\\\u00B7' \n {\n $this->matchChar(183); \n\n }\n break;\n case 5 :\n // Tokenizer11.g:562:5: '\\\\u0300' .. '\\\\u036F' \n {\n $this->matchRange(768,879); \n\n }\n break;\n case 6 :\n // Tokenizer11.g:563:5: '\\\\u203F' .. '\\\\u2040' \n {\n $this->matchRange(8255,8256); \n\n }\n break;\n\n }\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function prefixedName(){\n try {\n // Sparql11query.g:604:3: ( PNAME_LN | PNAME_NS ) \n // Sparql11query.g: \n {\n if ( $this->input->LA(1)==$this->getToken('PNAME_NS')||$this->input->LA(1)==$this->getToken('PNAME_LN') ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }",
"private function generateProlog($prefix) {\n\t\t$prefix_stuff = $this -> generatePrefixDecl($prefix);\n\t\treturn $prefix_stuff;\n\t}",
"function mVARNAME(){\n try {\n // Tokenizer11.g:541:3: ( ( PN_CHARS_U | ( '0' .. '9' ) ) ( PN_CHARS_U | ( '0' .. '9' ) | '\\\\u00B7' | '\\\\u0300' .. '\\\\u036F' | '\\\\u203F' .. '\\\\u2040' )* ) \n // Tokenizer11.g:542:3: ( PN_CHARS_U | ( '0' .. '9' ) ) ( PN_CHARS_U | ( '0' .. '9' ) | '\\\\u00B7' | '\\\\u0300' .. '\\\\u036F' | '\\\\u203F' .. '\\\\u2040' )* \n {\n // Tokenizer11.g:542:3: ( PN_CHARS_U | ( '0' .. '9' ) ) \n $alt27=2;\n $LA27_0 = $this->input->LA(1);\n\n if ( ($LA27_0==$this->getToken('95')||($LA27_0>=$this->getToken('97') && $LA27_0<=$this->getToken('122'))||($LA27_0>=$this->getToken('192') && $LA27_0<=$this->getToken('214'))||($LA27_0>=$this->getToken('216') && $LA27_0<=$this->getToken('246'))||($LA27_0>=$this->getToken('248') && $LA27_0<=$this->getToken('767'))||($LA27_0>=$this->getToken('880') && $LA27_0<=$this->getToken('893'))||($LA27_0>=$this->getToken('895') && $LA27_0<=$this->getToken('8191'))||($LA27_0>=$this->getToken('8204') && $LA27_0<=$this->getToken('8205'))||($LA27_0>=$this->getToken('8304') && $LA27_0<=$this->getToken('8591'))||($LA27_0>=$this->getToken('11264') && $LA27_0<=$this->getToken('12271'))||($LA27_0>=$this->getToken('12289') && $LA27_0<=$this->getToken('55295'))||($LA27_0>=$this->getToken('63744') && $LA27_0<=$this->getToken('64975'))||($LA27_0>=$this->getToken('65008') && $LA27_0<=$this->getToken('65533'))) ) {\n $alt27=1;\n }\n else if ( (($LA27_0>=$this->getToken('48') && $LA27_0<=$this->getToken('57'))) ) {\n $alt27=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 27, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt27) {\n case 1 :\n // Tokenizer11.g:543:5: PN_CHARS_U \n {\n $this->mPN_CHARS_U(); \n\n }\n break;\n case 2 :\n // Tokenizer11.g:544:7: ( '0' .. '9' ) \n {\n // Tokenizer11.g:544:7: ( '0' .. '9' ) \n // Tokenizer11.g:544:8: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n\n }\n break;\n\n }\n\n // Tokenizer11.g:546:3: ( PN_CHARS_U | ( '0' .. '9' ) | '\\\\u00B7' | '\\\\u0300' .. '\\\\u036F' | '\\\\u203F' .. '\\\\u2040' )* \n //loop28:\n do {\n $alt28=6;\n $LA28_0 = $this->input->LA(1);\n\n if ( ($LA28_0==$this->getToken('95')||($LA28_0>=$this->getToken('97') && $LA28_0<=$this->getToken('122'))||($LA28_0>=$this->getToken('192') && $LA28_0<=$this->getToken('214'))||($LA28_0>=$this->getToken('216') && $LA28_0<=$this->getToken('246'))||($LA28_0>=$this->getToken('248') && $LA28_0<=$this->getToken('767'))||($LA28_0>=$this->getToken('880') && $LA28_0<=$this->getToken('893'))||($LA28_0>=$this->getToken('895') && $LA28_0<=$this->getToken('8191'))||($LA28_0>=$this->getToken('8204') && $LA28_0<=$this->getToken('8205'))||($LA28_0>=$this->getToken('8304') && $LA28_0<=$this->getToken('8591'))||($LA28_0>=$this->getToken('11264') && $LA28_0<=$this->getToken('12271'))||($LA28_0>=$this->getToken('12289') && $LA28_0<=$this->getToken('55295'))||($LA28_0>=$this->getToken('63744') && $LA28_0<=$this->getToken('64975'))||($LA28_0>=$this->getToken('65008') && $LA28_0<=$this->getToken('65533'))) ) {\n $alt28=1;\n }\n else if ( (($LA28_0>=$this->getToken('48') && $LA28_0<=$this->getToken('57'))) ) {\n $alt28=2;\n }\n else if ( ($LA28_0==$this->getToken('183')) ) {\n $alt28=3;\n }\n else if ( (($LA28_0>=$this->getToken('768') && $LA28_0<=$this->getToken('879'))) ) {\n $alt28=4;\n }\n else if ( (($LA28_0>=$this->getToken('8255') && $LA28_0<=$this->getToken('8256'))) ) {\n $alt28=5;\n }\n\n\n switch ($alt28) {\n \tcase 1 :\n \t // Tokenizer11.g:547:5: PN_CHARS_U \n \t {\n \t $this->mPN_CHARS_U(); \n\n \t }\n \t break;\n \tcase 2 :\n \t // Tokenizer11.g:548:7: ( '0' .. '9' ) \n \t {\n \t // Tokenizer11.g:548:7: ( '0' .. '9' ) \n \t // Tokenizer11.g:548:8: '0' .. '9' \n \t {\n \t $this->matchRange(48,57); \n\n \t }\n\n\n \t }\n \t break;\n \tcase 3 :\n \t // Tokenizer11.g:549:7: '\\\\u00B7' \n \t {\n \t $this->matchChar(183); \n\n \t }\n \t break;\n \tcase 4 :\n \t // Tokenizer11.g:550:7: '\\\\u0300' .. '\\\\u036F' \n \t {\n \t $this->matchRange(768,879); \n\n \t }\n \t break;\n \tcase 5 :\n \t // Tokenizer11.g:551:7: '\\\\u203F' .. '\\\\u2040' \n \t {\n \t $this->matchRange(8255,8256); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop28;\n }\n } while (true);\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function mVARNAME(){\n try {\n // Tokenizer.g:484:3: ( ( PN_CHARS_U | ( '0' .. '9' ) ) ( PN_CHARS_U | ( '0' .. '9' ) )* ) \n // Tokenizer.g:485:3: ( PN_CHARS_U | ( '0' .. '9' ) ) ( PN_CHARS_U | ( '0' .. '9' ) )* \n {\n // Tokenizer.g:485:3: ( PN_CHARS_U | ( '0' .. '9' ) ) \n $alt27=2;\n $LA27_0 = $this->input->LA(1);\n\n if ( ($LA27_0==$this->getToken('95')||($LA27_0>=$this->getToken('97') && $LA27_0<=$this->getToken('122'))) ) {\n $alt27=1;\n }\n else if ( (($LA27_0>=$this->getToken('48') && $LA27_0<=$this->getToken('57'))) ) {\n $alt27=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 27, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt27) {\n case 1 :\n // Tokenizer.g:486:5: PN_CHARS_U \n {\n $this->mPN_CHARS_U(); \n\n }\n break;\n case 2 :\n // Tokenizer.g:487:7: ( '0' .. '9' ) \n {\n // Tokenizer.g:487:7: ( '0' .. '9' ) \n // Tokenizer.g:487:8: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n\n }\n break;\n\n }\n\n // Tokenizer.g:489:3: ( PN_CHARS_U | ( '0' .. '9' ) )* \n //loop28:\n do {\n $alt28=3;\n $LA28_0 = $this->input->LA(1);\n\n if ( ($LA28_0==$this->getToken('95')||($LA28_0>=$this->getToken('97') && $LA28_0<=$this->getToken('122'))) ) {\n $alt28=1;\n }\n else if ( (($LA28_0>=$this->getToken('48') && $LA28_0<=$this->getToken('57'))) ) {\n $alt28=2;\n }\n\n\n switch ($alt28) {\n \tcase 1 :\n \t // Tokenizer.g:490:5: PN_CHARS_U \n \t {\n \t $this->mPN_CHARS_U(); \n\n \t }\n \t break;\n \tcase 2 :\n \t // Tokenizer.g:491:7: ( '0' .. '9' ) \n \t {\n \t // Tokenizer.g:491:7: ( '0' .. '9' ) \n \t // Tokenizer.g:491:8: '0' .. '9' \n \t {\n \t $this->matchRange(48,57); \n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop28;\n }\n } while (true);\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function prefixName($prefix);",
"function mRPAREN(){\n try {\n $_type = GroupLexer::T_RPAREN;\n $_channel = GroupLexer::DEFAULT_TOKEN_CHANNEL;\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n {\n $this->matchChar(41); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"private function _handleTypePrefixedLiterals()\n {\n $id = $this->_token->Id;\n if ($id != ExpressionTokenId::IDENTIFIER) {\n return;\n }\n\n $quoteFollows = $this->_ch == '\\'';\n if (!$quoteFollows) {\n return;\n }\n\n $tokenText = $this->_token->Text;\n\n if (strcasecmp('datetime', $tokenText) == 0) {\n $id = ExpressionTokenId::DATETIME_LITERAL;\n } else if (strcasecmp('guid', $tokenText) == 0) {\n $id = ExpressionTokenId::GUID_LITERAL;\n } else if (strcasecmp('binary', $tokenText) == 0\n || strcasecmp('X', $tokenText) == 0\n || strcasecmp('x', $tokenText) == 0\n ) {\n $id = ExpressionTokenId::BINARY_LITERAL;\n } else {\n return;\n }\n\n $tokenPos = $this->_token->Position;\n do {\n $this->_nextChar();\n } while ($this->_ch != '\\0' && $this->_ch != '\\'');\n\n if ($this->_ch == '\\0') {\n $this->_parseError(\n Messages::expressionLexerUnterminatedStringLiteral(\n $this->_textPos, $this->_text\n )\n );\n }\n\n $this->_nextChar();\n $this->_token->Id = $id;\n $this->_token->Text\n = substr($this->_text, $tokenPos, $this->_textPos - $tokenPos);\n }",
"function mPN_LOCAL(){\n try {\n // Tokenizer11.g:581:3: ( ( PN_CHARS_U | ( '0' .. '9' ) ) ( ( PN_CHARS | DOT )* PN_CHARS )? ) \n // Tokenizer11.g:582:3: ( PN_CHARS_U | ( '0' .. '9' ) ) ( ( PN_CHARS | DOT )* PN_CHARS )? \n {\n // Tokenizer11.g:582:3: ( PN_CHARS_U | ( '0' .. '9' ) ) \n $alt32=2;\n $LA32_0 = $this->input->LA(1);\n\n if ( ($LA32_0==$this->getToken('95')||($LA32_0>=$this->getToken('97') && $LA32_0<=$this->getToken('122'))||($LA32_0>=$this->getToken('192') && $LA32_0<=$this->getToken('214'))||($LA32_0>=$this->getToken('216') && $LA32_0<=$this->getToken('246'))||($LA32_0>=$this->getToken('248') && $LA32_0<=$this->getToken('767'))||($LA32_0>=$this->getToken('880') && $LA32_0<=$this->getToken('893'))||($LA32_0>=$this->getToken('895') && $LA32_0<=$this->getToken('8191'))||($LA32_0>=$this->getToken('8204') && $LA32_0<=$this->getToken('8205'))||($LA32_0>=$this->getToken('8304') && $LA32_0<=$this->getToken('8591'))||($LA32_0>=$this->getToken('11264') && $LA32_0<=$this->getToken('12271'))||($LA32_0>=$this->getToken('12289') && $LA32_0<=$this->getToken('55295'))||($LA32_0>=$this->getToken('63744') && $LA32_0<=$this->getToken('64975'))||($LA32_0>=$this->getToken('65008') && $LA32_0<=$this->getToken('65533'))) ) {\n $alt32=1;\n }\n else if ( (($LA32_0>=$this->getToken('48') && $LA32_0<=$this->getToken('57'))) ) {\n $alt32=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 32, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt32) {\n case 1 :\n // Tokenizer11.g:583:5: PN_CHARS_U \n {\n $this->mPN_CHARS_U(); \n\n }\n break;\n case 2 :\n // Tokenizer11.g:584:7: ( '0' .. '9' ) \n {\n // Tokenizer11.g:584:7: ( '0' .. '9' ) \n // Tokenizer11.g:584:8: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n\n }\n break;\n\n }\n\n // Tokenizer11.g:586:3: ( ( PN_CHARS | DOT )* PN_CHARS )? \n $alt34=2;\n $LA34_0 = $this->input->LA(1);\n\n if ( (($LA34_0>=$this->getToken('45') && $LA34_0<=$this->getToken('46'))||($LA34_0>=$this->getToken('48') && $LA34_0<=$this->getToken('57'))||$LA34_0==$this->getToken('95')||($LA34_0>=$this->getToken('97') && $LA34_0<=$this->getToken('122'))||$LA34_0==$this->getToken('183')||($LA34_0>=$this->getToken('192') && $LA34_0<=$this->getToken('214'))||($LA34_0>=$this->getToken('216') && $LA34_0<=$this->getToken('246'))||($LA34_0>=$this->getToken('248') && $LA34_0<=$this->getToken('893'))||($LA34_0>=$this->getToken('895') && $LA34_0<=$this->getToken('8191'))||($LA34_0>=$this->getToken('8204') && $LA34_0<=$this->getToken('8205'))||($LA34_0>=$this->getToken('8255') && $LA34_0<=$this->getToken('8256'))||($LA34_0>=$this->getToken('8304') && $LA34_0<=$this->getToken('8591'))||($LA34_0>=$this->getToken('11264') && $LA34_0<=$this->getToken('12271'))||($LA34_0>=$this->getToken('12289') && $LA34_0<=$this->getToken('55295'))||($LA34_0>=$this->getToken('63744') && $LA34_0<=$this->getToken('64975'))||($LA34_0>=$this->getToken('65008') && $LA34_0<=$this->getToken('65533'))) ) {\n $alt34=1;\n }\n switch ($alt34) {\n case 1 :\n // Tokenizer11.g:587:5: ( PN_CHARS | DOT )* PN_CHARS \n {\n // Tokenizer11.g:587:5: ( PN_CHARS | DOT )* \n //loop33:\n do {\n $alt33=3;\n $alt33 = $this->dfa33->predict($this->input);\n switch ($alt33) {\n \tcase 1 :\n \t // Tokenizer11.g:588:7: PN_CHARS \n \t {\n \t $this->mPN_CHARS(); \n\n \t }\n \t break;\n \tcase 2 :\n \t // Tokenizer11.g:589:9: DOT \n \t {\n \t $this->mDOT(); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop33;\n }\n } while (true);\n\n $this->mPN_CHARS(); \n\n }\n break;\n\n }\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function prefix( $prefix )\n {\n $this->pattern = $prefix . $this->pattern;\n }",
"function mPLUS(){\n try {\n $_type = t048rewrite2::T_PLUS;\n $_channel = t048rewrite2::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t048rewrite2.g\n // runtime/Php/test/Antlr/Tests/grammers/t048rewrite2.g\n {\n $this->matchChar(43); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function readIdentifier($prefix = null, $allowedChars = null)\n {\n if ($prefix) {\n if ($this->peek(mb_strlen($prefix)) !== $prefix) {\n return;\n }\n\n $this->consume();\n } elseif (!$this->peekAlphaIdentifier($allowedChars)) {\n return;\n }\n\n return $this->readWhile(function () use ($allowedChars) {\n return $this->peekIdentifier($allowedChars);\n });\n }",
"function mPN_CHARS_BASE(){\n try {\n // Tokenizer.g:460:3: ( 'a' .. 'z' ) \n // Tokenizer.g:461:3: 'a' .. 'z' \n {\n $this->matchRange(97,122); \n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function prefix( $prefix )\n {\n $pattern = $this->pattern;\n // Find pattern delimiter\n $patternDelim = $pattern[0];\n // Obtain pattern modifiers\n $patternModifier = substr( strrchr( $pattern, $patternDelim ), 1 );\n // Find prefix delimiter\n $prefixDelim = $prefix[0];\n // Obtain prefix modifiers\n $prefixModifier = substr( strrchr( $prefix, $prefixDelim ), 1 );\n // If modifiers are not the same, throw exception\n if ( $patternModifier !== $prefixModifier )\n {\n throw new ezcMvcRegexpRouteException( \"The pattern modifiers of the prefix '{$prefix}' and pattern '{$pattern}' do not match.\" );\n }\n // Reassemble the new pattern\n $newPattern = $patternDelim;\n $newPattern .= substr( $prefix, 1, -1 - strlen( $prefixModifier ) );\n $newPattern .= substr( $pattern, 1 + ( $pattern[1] == '^' ) );\n\n $this->pattern = $newPattern;\n }",
"public function prologue(){\n try {\n // Sparql10.g:29:5: ( ( baseDecl )? ( prefixDecl )* ) \n // Sparql10.g:29:7: ( baseDecl )? ( prefixDecl )* \n {\n // Sparql10.g:29:7: ( baseDecl )? \n $alt2=2;\n $LA2_0 = $this->input->LA(1);\n\n if ( ($LA2_0==$this->getToken('BASE')) ) {\n $alt2=1;\n }\n switch ($alt2) {\n case 1 :\n // Sparql10.g:29:7: baseDecl \n {\n $this->pushFollow(self::$FOLLOW_baseDecl_in_prologue117);\n $this->baseDecl();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n\n // Sparql10.g:29:17: ( prefixDecl )* \n //loop3:\n do {\n $alt3=2;\n $LA3_0 = $this->input->LA(1);\n\n if ( ($LA3_0==$this->getToken('PREFIX')) ) {\n $alt3=1;\n }\n\n\n switch ($alt3) {\n \tcase 1 :\n \t // Sparql10.g:29:17: prefixDecl \n \t {\n \t $this->pushFollow(self::$FOLLOW_prefixDecl_in_prologue120);\n \t $this->prefixDecl();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop3;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a CostLine entity. | public function deleteAction(Request $request, CostLine $costLine, $associationUniqueId)
{
if($associationUniqueId === 'chooseAnAssociation') {
// 'You need to choose an association first';
$associations = $this->getTAssociations();
if(!in_array($costLine->getAssociation(), $associations)) {
throw $this->createNotFoundException("We can't find this user");
}
return $this->render('frediAppBundle:association:select.html.twig', array(
'associations' => $associations
));
}
$form = $this->createDeleteForm($costLine, $associationUniqueId);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->remove($costLine);
$em->flush();
}
return $this->redirectToRoute('cost_index', array('associationUniqueId' => $associationUniqueId));
} | [
"public function deleteCartLine($cart_id, $line_id);",
"function LineDelete(){}",
"public function deleteAction(Request $request, CostLine $costLine, $associationUniqueId)\n {\n if($associationUniqueId === 'chooseAnAssociation') {\n // 'You need to choose an association first';\n $associations = $this->getAssociations();\n if(!in_array($costLine->getAssociation(), $associations)) {\n throw $this->createNotFoundException(\"We can't find this user\");\n }\n return $this->render('frediAppBundle:association:select.html.twig', array(\n 'associations' => $associations\n ));\n }\n $form = $this->createDeleteForm($costLine, $associationUniqueId);\n $form->handleRequest($request);\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($costLine);\n $em->flush();\n }\n return $this->redirectToRoute('costline_index', array('associationUniqueId' => $associationUniqueId));\n }",
"public function DelLine($idLine) {\n\t$oLine = $this->Engine()->CartLines($idLine);\n\t$idCartMe = $this->GetKeyValue();\n\t$idCartDel = $oLine->CartID();\n\tif ($idCartDel == $idCartMe) {\n\t // matches -- okay to delete line\n\t $oLine->Qty(0);\t// zero the qty\n\t $oLine->Save();\t// save the change\n\t} else {\n\t // mismatch -- either an internal bug or a hacking attempt\n\t throw new exception(\"Attempted to delete item line ID $idLine, which is in cart ID $idCartDel not in cart ID $idCartMe.\");\n\t}\n }",
"public function deleteLine($lineIndex = null) {\n if (!is_null($lineIndex) && $lineIndex < $this->linesCount) {\n unset($this->lines[$lineIndex]);\n }\n }",
"public function delete($sem_linea_investigacion);",
"public function deleteAction()\n {\n $productLineId = (int) $this->params()->fromRoute('id', null);\n\n if (null === $productLineId) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You must first select a product line in order to access the product line asset component.');\n\n return $this->redirect()->toRoute('rocket-admin/products/product-lines');\n }\n\n $productLine = $this->productLineService->getProductLine($productLineId);\n\n if (!($productLine instanceof ProductLinesInterface)) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You must first select a product line in order to access the product line asset component.');\n\n return $this->redirect()->toRoute('rocket-admin/products/product-lines');\n }\n\n $productLineAssetId = (int) $this->params()->fromRoute('productlineassetid', null);\n\n if (null === $productLineAssetId) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/products/product-lines/view/asset', array('id' => $productLineId));\n }\n\n $productLineAsset = $this->productLineAssetService->getProductLineAsset($productLineAssetId);\n\n if (!($productLineAsset instanceof ProductLineAssetInterface)) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/products/product-lines/view/asset', array('id' => $productLineId));\n }\n\n $this->productLineAssetService->delete($this->identity(), $productLineAsset);\n\n $this->flashMessenger()->setNamespace('success')\n ->addMessage('You have successfully deleted the product line asset.');\n\n return $this->redirect()->toRoute('rocket-admin/products/product-lines/view/asset', array('id' => $productLineId));\n }",
"public function creditTransactionLineRemoved(TransactionLine $transactionLine): void\n {\n $this->creditTransactionLines->removeElement($transactionLine);\n }",
"public function deletedLine($line, $colspan=0)\n\t{\n\t\treturn $this->wrapLine('-', 'diff-deletedline', $line, $colspan);\n\t}",
"public function deleteInvoiceLine(WeFact_CreditInvoiceLine $creditInvoiceLine)\n {\n if ($creditInvoiceLine->getIdentifier() == '') {\n throw new \\InvalidArgumentException(\n sprintf('CreditInvoiceLine Identifier must be defined!')\n );\n }\n\n $invoiceLines = array();\n foreach ($this->getInvoiceLines() as $invoiceLine) {\n if ($creditInvoiceLine->getIdentifier() != $invoiceLine->getIdentifier()) {\n $invoiceLines[] = $invoiceLine;\n }\n }\n $this->setInvoiceLines($invoiceLines);\n\n return $this;\n }",
"public function delete($costo);",
"public function testOrderLineDeleteException($orderId, $orderLine)\n {\n $client = static::getInsalesApiClient();\n $client->orderLineDelete($orderId, $orderLine);\n }",
"public function delete($grupo_linea_investigacion);",
"public function transactionLineRemoved(TransactionLine $transactionLine): void\n {\n $this->transactionLines->removeElement($transactionLine);\n }",
"private function createDeleteForm(CostLine $costLine, $associationUniqueId)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('costline_delete', array('id' => $costLine->getId(), 'associationUniqueId' => $associationUniqueId)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function cancelOrderLine($orderId, OrderLine $newOrderLine);",
"public function removeOrderLine($line_id) {\n\t\t$output = false;\n\t\t$stmt = $this->mysqli->prepare(\"DELETE FROM order_workbench_line WHERE id = ?\");\n\t\t$stmt->bind_param('i', $line_id);\n\t\t$output = $stmt->execute();\n\t\t$stmt->close();\n\t\treturn ($output);\n\t}",
"public function delete(UserInterface $identity, ProductLineAssetInterface $productLineAsset)\n {\n if (!$productLineAsset instanceof ProductLineAssetInterface) {\n throw Exception\\UnexpectedValueException::invalidProductLineAssetEntity($productLineAsset);\n }\n\n $this->objectManager->remove($productLineAsset);\n $this->objectManager->flush();\n\n $this->getEventManager()->trigger(new ProductLineAssetEvent('productLineAssetDeleted', $productLineAsset));\n\n return $productLineAsset;\n }",
"public function removeLineItem(LineItemInterface $line_item);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
VISE EN RUTE WHERE ruteId = ? | public function getRute($ruteId, $logg)
{
include (realpath(dirname(__FILE__)).'/db.php');;
$sql = "SELECT ruteId, fraDestId, tilDestId, sesongId, navn FROM rute WHERE ruteId=?;";
$queryRute = $db_connection->prepare($sql);
$queryRute->bind_param('i'
, $ruteId);
$queryRute->execute();
//henter result set
$resultSet = $queryRute->get_result();
$rute = $resultSet->fetch_all();
//Error logging
if($queryRute == false){
$logg->Ny('Mislyktes å hente fra db: '.mysql_error($db_connection), 'ERROR', htmlspecialchars($_SERVER['PHP_SELF']), '');
}
$resultSet->free();
$queryRute->close();
$db_connection->close();
return $rute;
} | [
"function definirRotaAtiva($rota_id){\n ExecSQL(\"UPDATE rota SET STATUS = 0 WHERE id <> $rota_id and USUARIO_ID = \".getUsuarioLogadoID());\n // ativa a rota passada no parametro\n ExecSQL(\"UPDATE rota SET STATUS = 1 WHERE id = $rota_id and USUARIO_ID = \".getUsuarioLogadoID());\n\n sucesso();\n\n\t\n}",
"function montant_recolte($id)\r\n {\r\n global $db;\r\n\r\n $montant = $db->prepare(\"SELECT * FROM récoltes WHERE id = ? \");\r\n $montant->execute([$id]);\r\n\r\n $montant_result = $montant->fetch(PDO::FETCH_ASSOC);\r\n return $montant_result['montant'];\r\n }",
"function consultarIDRuta($ruta){\n\t\t$conecto=$this->consultar(\"SELECT * FROM ruta WHERE nombre='\".$ruta.\"'\");\n\t\treturn $this->f_fila($conecto)->id_ruta;\n\n\t}",
"function caricaRuolo($id) {\r\n\t\tglobal $database, $dati_db;\r\n\r\n\t\t$sql=\"SELECT * FROM \".$dati_db['prefisso'].\"etrasp_ruoli WHERE id=$id\";\r\n\t\tif ( !($risultato = $database->connessioneConReturn($sql)) ) {\r\n\t\t\tdie('Non posso caricare dati ruoli'.$sql);\r\n\t\t}\r\n\r\n\t\t$ente = $database->sqlArray($result);\r\n\r\n\t\treturn $ente;\r\n\r\n\t}",
"function caricaRuolo($id) {\n\t\tglobal $database, $dati_db;\n\n\t\t$sql=\"SELECT * FROM \".$dati_db['prefisso'].\"etrasp_ruoli WHERE id=$id\";\n\t\tif ( !($risultato = $database->connessioneConReturn($sql)) ) {\n\t\t\tdie('Non posso caricare dati ruoli'.$sql);\n\t\t}\n\n\t\t$ente = $database->sqlArray($result);\n\n\t\treturn $ente;\n\n\t}",
"function acerta_receitas_movimentacoes() {\n return \" UPDATE receitas_movimentacoes SET valor = ( valor * -1 )\n WHERE receita_id in ( select distinct receitas.id\n from receitas\n inner join planocontas on planocontas.id = receitas.planoconta_id\n where planocontas.estrutural like '9%'\n or planocontas.estrutural like '49%')\";\n }",
"function evaluacionesAcademico($rutAcademico){\n\t$result = $this->conn->query('SELECT * FROM evaluacion WHERE rutAcademico = \"'.$rutAcademico.'\"');\n\t$this->imprimir($result);\t\n}",
"static function caricaUtente() : string\n {\n return \"SELECT *\n FROM utente\n WHERE id = :id;\";\n }",
"public function _consultarPorId( $id ) {\n\t\treturn $this->timeDAO->consultarPorId ( $id );\n\t}",
"function getMeterEau($rid, $type = 'Eau'){\n require 'mysql/connect.php';\n $req = $pdo->prepare('SELECT Me_id FROM Meter WHERE R_id = :rid AND Me_type = :mType');\n $req->bindValue(':rid',$rid);\n $req->bindValue(':mType',$type);\n $req->execute();\n $meter_id = $req->fetch(PDO::FETCH_NUM);\n $pdo=null;\n return (int)$meter_id[0];\n}",
"public function getResignUser(){\n return $this->userSync\n ->where('qp_user_sync.active','N')\n ->join('qp_user', 'qp_user_sync.emp_no', '=', 'qp_user.emp_no')\n ->select('qp_user.row_id as user_row_id')->get();\n }",
"function getFinishedIdForAppraiseeIdAndRaterId($a_appr_id, $a_rat_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$set = $ilDB->query(\"SELECT finished_id, user_fi FROM svy_finished\".\n\t\t\t\" WHERE survey_fi = \".$ilDB->quote($this->getSurveyId(), \"integer\").\n\t\t\t\" AND appr_id = \".$ilDB->quote($a_appr_id, \"integer\").\n\t\t\t\" AND user_fi = \".$ilDB->quote($a_rat_id, \"integer\"));\n\t\t$row = $ilDB->fetchAssoc($set);\n\t\treturn $row[\"finished_id\"];\n\t}",
"public function RDVbyID() {\n $query = 'SELECT' //dateHour concatene 2 valeurs qui sont la date et l'heure, je les sépare ds la requête de la façon qui suit:\n . ' appointments.id,'\n . ' DATE_FORMAT(dateHour, \\'%Y-%m-%d\\') AS date,' //renvoie dateHour au format %Y-%m-%d pr la date\n . ' DATE_FORMAT(dateHour, \\'%H:%i\\') AS time,' //renvoie dateHour au format %H:%i pr l'heure\n . ' lastname,'\n . ' firstname'\n . ' FROM appointments'\n . ' INNER JOIN `patients`' //jointure \n . ' ON appointments.idPatients = patients.id'\n . ' WHERE `appointments`.`id`= :idAppointment';\n $afficherRDV = $this->database->prepare($query);\n $afficherRDV->bindValue(':idAppointment', $this->id, PDO::PARAM_INT); //recupere l'id\n $afficherRDV->execute();\n $resultRDV = $afficherRDV->fetch(PDO::FETCH_OBJ);\n return $resultRDV;\n }",
"function ancien_star(){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT pseudo FROM utilisateur WHERE star = TRUE AND TIME_TO_SEC(TIMEDIFF((CURRENT_TIMESTAMP),(DATE_STAR)))/60 > 10;\");\n\t\t$req->execute(array(0));\n\t\t$result = $req->fetchAll();\n\t\t\n\t\t$req->closeCursor();\n\t\treturn $result;\n\t}",
"public function votar2Ronda($nota, $login, $id) {\n $db = new BD();\n $sentencia = \"UPDATE votaprofesional SET voto2round='\".$nota.\"' WHERE pincho_idpincho='\".$id.\"' AND juradoprofesional_usuarios_login='\".$login.\"'\";\n $res = mysqli_query($db->connection,$sentencia);\n $db->desconectar();\n return $res;\n }",
"function readSurc($id)\n {\n \t $sucurId = succursale::where('id','=',$id)->get()->first();\n \t return $sucurId;\n }",
"public function _consultarPorIdtime($time) {\n return $this->crimeDAO->consultarPorIdkindCrime($time);\n }",
"function getMeter($rid, $type = 'Electrique'){\n require 'mysql/connect.php';\n $req = $pdo->prepare('SELECT Me_id FROM Meter WHERE R_id = :rid AND Me_type = :mType');\n $req->bindValue(':rid',$rid);\n $req->bindValue(':mType',$type);\n $req->execute();\n $meter_id = $req->fetch(PDO::FETCH_NUM);\n $pdo=null;\n return (int)$meter_id[0];\n}",
"public function saldarTransaccionPendiente($idEmisor, $idReceptor, $arm, $mun, $dol) {\n \n if ($idEmisor == $idReceptor) return false;\n \n // caso 1: emisor es el que vende\n $where1 = \"id_vendedor = $idEmisor AND id_comprador = $idReceptor \n AND (\n (recurso = 'arm' AND cantidad - cantidad_dev >= $arm AND $arm != 0)\n OR\n (recurso = 'mun' AND cantidad - cantidad_dev >= $mun AND $mun != 0)\n OR\n (recurso = 'dol' AND cantidad - cantidad_dev >= $dol AND $dol != 0)\n )\";\n \n // caso 2: emisor es el que compra\n $where2 = \"id_comprador = $idEmisor AND id_vendedor = $idReceptor\n AND (\n ($arm != 0 AND compra_arm - compra_arm_dev >= $arm) OR\n ($mun != 0 AND compra_mun - compra_mun_dev >= $mun) OR\n ($dol != 0 AND compra_dol - compra_dol_dev >= $dol)\n )\";\n \n $query = $this->select()->where(\"($where1) OR ($where2)\")\n ->where(\"aceptada = 1\")\n ->where(\"fecha_fin > ?\", date(\"Y-m-d H:i:s\"))\n ->order(\"id_mercado ASC\")\n ->limit(1);\n $data = $this->_db->fetchAll($query);\n \n /*if (false) {\n Zend_Debug::dump($query->__toString(), \"query\");\n Zend_Debug::dump($data, \"data\");\n }*/\n \n if (empty($data)) return false;\n $data = $data[0];\n $update = array();\n if ($data[\"id_comprador\"] == $idEmisor) {\n // saldo las compras\n // si de algun recurso envie mas de lo que tenia que enviar, es un transporte normal, no se salda el comercio\n \n foreach (array(\"arm\", \"mun\", \"dol\") as $v) {\n if ($data[\"compra_\".$v] - $data[\"compra_\".$v.\"_dev\"] < ${$v}) return false;\n \n if (${$v}) $update[] = \"compra_\".$v.\"_dev = compra_\".$v.\"_dev + \".(int)${$v};\n } \n } else {\n // saldo la venta\n $recursoVendido = $data[\"recurso\"];\n $tmpRecursos = array_filter(array(\"arm\" => $arm, \"mun\" => $mun, \"dol\" => $dol));\n // el recurso que envie no es el que tengo que saldar, es un transporte normal\n if (sizeof($tmpRecursos) != 1 || empty($tmpRecursos[$recursoVendido])) return false;\n $update = array(\"cantidad_dev = cantidad_dev + \".(int)${$recursoVendido});\n }\n $queryUpdate = \"UPDATE mob_mercado SET %s WHERE id_mercado = \".(int)$data[\"id_mercado\"].\" LIMIT 1\";\n \n if (empty($update)) return false;\n \n $queryUpdate = sprintf($queryUpdate, implode(\", \", $update));\n //if (false) {var_dump($queryUpdate);die();}\n \n $this->_db->query($queryUpdate);\n\n return $data[\"id_mercado\"]; \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search for a string in a specific array column | public static function search(array $array, string $q, $col = null)
{
$array = array_filter($array, function ($v) use ($q, $col) {
if ($col == null) {
return (strpos(strtoupper($v), strtoupper($q)) !== false);
} else {
if (is_array($col)) {
foreach ($col as $c) {
if (strpos(strtoupper($v[$c]), strtoupper($q)) !== false) {
return true;
}
}
return false;
} else {
return (strpos(strtoupper($v[$col]), strtoupper($q)) !== false);
}
}
}, ARRAY_FILTER_USE_BOTH);
return array_values($array);
} | [
"function search_in_column($keyword, $array, $column){\n foreach ($array as $key => $val) {\n if ($val[''.$column.''] === $keyword) {\n return $key;\n }\n }\n return -1;\n}",
"function search_array($string, $array) {\r\n foreach($array as $entry) {\r\n // searches substring $string in $entry\r\n if (strpos($entry, $string) !== false) {\r\n return $entry;\r\n }\r\n }\r\n }",
"public function find(&$array, $column_name, $column_value)\n {\n $result = null;\n foreach($array as $key=>$value)\n {\n if ($value[$column_name] == $column_value)\n {\n $result = $key;\n break;\n }\n }\n return $result;\n }",
"function string_inarray($array, $searchingFor) {\r\n\t $i=0;\r\n\t foreach ($array as $key=>$element) {\r\n\t if (strpos($element, $searchingFor) !== false) {\r\n\t return array('index'=>$i,'value'=>$key);\r\n\t }\r\n\t $i++;\r\n\t }\r\n\t return false;\r\n\t}",
"function search_array($array, $str) {\n for ($i = 0; $i < count($array); $i++) {\n if (in_array($str, $array[$i])) {\n return true;\n break;\n }\n }\n return false;\n }",
"private function _arrayLsearch( $str, $array ) {\n\t\t\tforeach($array as $k=>$v){\n\t\t\t\tif(strtolower($v)===strtolower($str)){\n\t\t\t\t\treturn $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new \\System\\Base\\InvalidOperationException(\"{$str} does not exist in array\");\n\t\t}",
"function find_column_by_name(& $sheet, $name_list) \n{\n # The first one found, will be returned.\n # If several appear on the same row, they will be\n # searched in order. So put $name_list in priority order.\n # Names are not case sensitive. $name_list must be in lower case.\n foreach ($sheet as $row) {\n $row_lc = array_map(\"strtolower\", $row);\n $row_lc = array_map(\"trim\", $row_lc);\n foreach ($name_list as $name) {\n $pos = array_search($name, $row_lc);\n if ($pos !== FALSE) {\n return $pos;\n }\n }\n }\n return FALSE; # Not found.\n}",
"function search($arr, $key, $keyword)\n\t{\n\t foreach ($arr as $data) \n\t {\n\t\tif (strpos($data[$key], $keyword) !== false) \n\t\t{\n\t\t\t$result[] = $data;\n\t\t}\n\t }\n\t return empty($result) ? 'No result found' : $result;\n\t}",
"public static function isearch($array,$value){\n $value = mb_strtolower($value);\n foreach($array as $key => $sub) if(mb_strtolower($sub) == $value) return $key;\n return false;\n }",
"function array_search_partial(& $arr, $keyword) {\n foreach($arr as $index => $string) {\n if (strpos($string, $keyword) !== FALSE)\n return $index;\n }\n return -1;\n}",
"public function orWhereJsonContains($column, $value);",
"function get_items_where_key_contain($array, $search_string){\n $result = [];\n foreach ($array as $k=>$v){\n if (strpos($k, $search_string) !== false) {\n $result[$k] = $v;\n }\n }\n return $result;\n}",
"function cs_in_array($string,$object) {\n\n\t$string = strtolower($string);\n\n\t$returnValue = null;\n\n\tfor ($row=0;$row<count($object);$row++) {\n\n\t\t$tempValue = strtolower($object[$row]);\n\n\t\tif ($tempValue == $string) {\n\t\t $returnValue = $tempValue; \n\t\t break;\n }\n \n\t}\n\n\tif ($returnValue) return $returnValue;\n\telse return false;\n\n}",
"function getColumn($targetColumn, $table, $searchColumn, $string) {\r\n\t$result = mysql_query(\"SELECT `$targetColumn` FROM `$table` WHERE `$searchColumn` = '$string'\");\r\n\tif (mysql_num_rows($result) != 0) {\r\n\t\t$row = mysql_fetch_array($result);\r\n\t\treturn $row[$targetColumn];\r\n\t} else return false;\r\n}",
"static protected function arraySearchPartial($arr, $keyword) {\n foreach($arr as $index => $string) {\n if (strpos($string, $keyword) !== FALSE)\n return $index;\n }\n }",
"function search_array_keyword($keyword, $array){\n $matches = array_filter($array, function($var) use ($keyword){ return preg_match(\"/\\b$keyword\\b/i\", $var);});\n return $matches;\n}",
"function findInColumn( $arr2D, $colIdx, $target, $negate ) {\n if (!isset($negate)) $negate = false;\n $whenToIncrement = !$negate; // (we are incidentally coercing to a boolean)\n $matches = array();\n foreach ($arr2D as $rowNum => $row) {\n if ( isset($row[$colIdx]) && ($row[$colIdx]==$target) == $whenToIncrement)\n $matches[] = $rowNum;\n }\n return $matches;\n }",
"function querySearch($search_array, $db_name, $search_col, $print_name, $db_connection)\n\t{\n\t\t$query = \"SELECT $print_name FROM $db_name WHERE\";\n\t\tforeach($search_array as $word)\n\t\t\t$query .= ' ' . $search_col . ' LIKE \"%'. $word . '%\" AND';\n\t\t // remove last \"AND\"\n\t\t$query = substr($query, 0, -3);\n\t\t$tbl = mysqli_query($db_connection, $query);\n\t\treturn $tbl;\n\t}",
"function teluguWordContainsSubstringPosition($word, $user_search_string)\n{\n $indexArray = [];\n $match = false;\n\n // $user_search_string is expected to be a 2D array of telugu words...\n for ($j = 0; $j < count($user_search_string); $j++) {\n // for each character in the word...\n for ($i = 0; $i < count($word); $i++) {\n //... Loop over each character in the search string.\n for ($k = 0; $k < count($user_search_string[$j]); $k++) {\n // if each value in the search string is found...\n if (isset($word[$i + $k]) && $word[$i + $k] == $user_search_string[$j][$k]) {\n $match = true;\n if ($k == 0) {\n $indexArray[$j] = $i;\n }\n if ($k == count($user_search_string[$j]) - 1) {\n break;\n }\n } else {\n $match = false;\n break;\n }\n }\n if ($match == true) break;\n }\n }\n\n return $indexArray;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set Sets a property search value | public function set($class_name, $property_name, $value)
{
$this->search_values[$class_name][$property_name] = $value;
} | [
"public function __set($property, $value);",
"final public function set($property_name, $new_value) {}",
"function __set($property, $value) {\n $this -> adodb -> $property = $value;\n }",
"public function set($property, $value) {\n \t\t\tif (property_exists($this, $property)) {\n $this->$property = $value;\n } elseif (isset($this->fieldaliases)) {\n\t\t\t\t if (array_key_exists($property, $this->fieldaliases)) {\n\t\t\t\t\t $realproperty = $this->fieldaliases[$property];\n\t $this->$realproperty = $value;\n\t\t\t\t } else {\n\t $this->error(\"This property or alias ($property) does not exist\");\n\t return false;\n\t }\n } else {\n $this->error(\"This property or alias ($property) does not exist\");\n return false;\n }\n \t\t}",
"public function __set($property, $value)\n { \n if($property == 'limitstart') {\n $property = 'offset';\n } \n \t\n parent::__set($property, $value); \n \t}",
"public function set_search( $search ) {\n\t\t$this->search = $search;\n\t}",
"function __set($property,$value)\n\t{\n\t\t$this->data[$property] = $value;\n\t}",
"function com_propset($module, $property_name, $value) {}",
"function set_property(){\n }",
"public abstract function setPropertyValue($object, $property, $value);",
"public function updateProperty($property) {\n\t\t$cmd = \"zfs get -H \" . $property . \" \\\"\" . $this->name . \"\\\" 2>&1\";\n\t\tOMVModuleZFSUtil::exec($cmd,$out,$res);\n\t\t$tmpary = preg_split('/\\t+/', $out[0]);\n\t\t$this->properties[\"$tmpary[1]\"] = array(\"value\" => $tmpary[2], \"source\" => $tmpary[3]);\n\t}",
"abstract public function setProperty( $path, ezcWebdavProperty $property );",
"public function setProperty($id,$value);",
"public function setSearchValue($value) {\n\t\tif(!check($this->_type)) throw new Exception(lang('error_117'));\n\t\t$this->_value = $value;\n\t}",
"public function setValue(&$object, $propertyPath, $value);",
"public function setProperty($property, $value)\n\t{\n\t\tglobal $mysql;\n\t\t$property = real_escape_string($property);\n\t\t$value = real_escape_string($value);\n\t\treturn $mysql->query(\"UPDATE tickets SET `\".$property.\"` = '\".$value.\"' WHERE `id` = \".$this->getID());\n\t}",
"public function __set($prop, $value)\n {\n $this->data[$prop] = $value;\n }",
"function setModelProperty($property) {\n if (!is_null($property) && ($property !== false) && !is_a($property, 'Ac_Model_Property')) \n trigger_error (\"\\$property should be null, false or the instance of Ac_Model_Property\", E_USER_ERROR);\n $this->_property = $property;\n if (is_a($property, 'Ac_Model_Property') && is_a($property->srcObject, 'Ac_Model_Data')) {\n $this->setModel($property->srcObject);\n $this->modelPropertyName = $property->propName;\n }\n }",
"function __set($prop, $value)\n\t{\n\t\t$this->rpc->$prop = $value;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get or set pop3 | public function pop3(Pop3DataSourceNameOrId $pop3 = null)
{
if(null === $pop3)
{
return $this->child('pop3');
}
return $this->child('pop3', $pop3);
} | [
"function getTrack3() {\n\t\treturn $this->m_track3;\n\t}",
"public function getPicture3()\n {\n return $this->picture3;\n }",
"public function getThird()\n {\n return isset($this->third) ? $this->third : null;\n }",
"private function process_pop3_mailbox()\n\t{\n\t\t$this->_mailserver = new Net_POP3();\n\n\t\t$t_connectresult = $this->_mailserver->connect( $this->_mailbox[ 'hostname' ], $this->_mailbox[ 'port' ] );\n\n\t\tif ( $t_connectresult === TRUE )\n\t\t{\n\t\t\t$t_loginresult = $this->mailbox_login();\n\n\t\t\tif ( $this->_test_only === FALSE && !$this->pear_error( 'Attempt login', $t_loginresult ) )\n\t\t\t{\n\t\t\t\tif ( project_get_field( $this->_mailbox[ 'project_id' ], 'enabled' ) == TRUE )\n\t\t\t\t{\n\t\t\t\t\t$t_numMsg = $this->_mailserver->numMsg();\n\t\t\t\t\tif ( !$this->pear_error( 'Retrieve number of messages', $t_numMsg ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$t_numMsg = $this->check_fetch_max( $t_numMsg );\n\n\t\t\t\t\t\tfor ( $i = 1; $i <= $t_numMsg; $i++ )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$t_emailresult = $this->process_single_email( $i );\n\n\t\t\t\t\t\t\tif ( $this->_mail_delete && $t_emailresult )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$t_deleteresult = $this->_mailserver->deleteMsg( $i );\n\n\t\t\t\t\t\t\t\t$this->pear_error( 'Attempt delete email', $t_deleteresult );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->custom_error( 'Project is disabled: ' . project_get_field( $this->_mailbox[ 'project_id' ], 'name' ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_mailserver->disconnect();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->custom_error( 'Failed to connect to the mail server' );\n\t\t}\n\t}",
"function createPop3DataSource(MailPop3DataSource $pop3);",
"public function getVar3()\n {\n return $this->getParameter('var3');\n }",
"public function getAnswer3()\n {\n return $this->answer3;\n }",
"public function getOetbcon3usestockpull()\n {\n return $this->oetbcon3usestockpull;\n }",
"public function getData3()\n {\n return $this->data3;\n }",
"private function process_pop3_mailbox()\n\t{\n\t\t$this->_mailserver = new Net_POP3();\n\n\t\t$this->_result = $this->_mailserver->connect( $this->_mailbox[ 'hostname' ], $this->_mailbox[ 'port' ] );\n\n\t\tif ( $this->_result === TRUE )\n\t\t{\n\t\t\t$this->mailbox_login();\n\n\t\t\tif ( $this->_test_only === FALSE && !$this->pear_error( $this->_result ) )\n\t\t\t{\n\t\t\t\t$t_numMsg = $this->check_fetch_max( $this->_mailserver->numMsg() );\n\n\t\t\t\tfor ( $i = 1; $i <= $t_numMsg; $i++ )\n\t\t\t\t{\n\t\t\t\t\t$this->process_single_email( $i );\n\n\t\t\t\t\tif ( $this->_mail_delete )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_mailserver->deleteMsg( $i );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_mailserver->disconnect();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->custom_error( 'Failed to connect to the mail server' );\n\t\t}\n\t}",
"public function setProp3(string $prop3)\n {\n if (!empty($prop3)) {\n $this->prop3 = $prop3;\n }\n }",
"public function _getIso3() {\n\t\treturn $this->_iso3;\n\t}",
"public function getCcmp3()\n {\n return $this->ccmp3;\n }",
"function getStreet3()\n {\n return ($this->__street3) ;\n }",
"public function _getTestkit3() {\n\t\treturn $this->_testkit3;\n\t}",
"public function getValue3()\n {\n return $this->Value3;\n }",
"function openPop3($host=false,$username=false, $password=false, $port=143, $service=false, $service_option=false){\n if (!empty($host)){\n $this->pop3_host=$host;\n }\n if (!empty($username)){\n $this->mailbox_username=$username;\n }\n if (!empty($password)){\n $this->mailbox_password=$password;\n }\n\n #$port = '110/pop3/notls';\n $port = '143/imap/novalidate-cert';\n set_time_limit(6000);\n\n if (!$this->testmode) {\n $this->_mailbox_link =imap_open(\"{\".$this->pop3_host.\":\".$port.\"}INBOX\",$this->mailbox_username,$this->mailbox_password,CL_EXPUNGE);\n } else {\n $this->_mailbox_link =imap_open(\"{\".$this->pop3_host.\":\".$port.\"}INBOX\",$this->mailbox_username,$this->mailbox_password);\n }\n\n if (!$this->_mailbox_link){\n $this->error_msg=\"Cannot create POP3 connection to $this->pop3_host \\nError MSG:\".imap_last_error();\n $this->output();\n return false;\n }\n else{\n $this->output(\"Connect to $this->pop3_host successed\");\n return true;\n }\n }",
"public function getAddress3()\n {\n return $this->address3;\n }",
"public function getForThree() {\n\t\treturn $this->forThree;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks for duplicate transaction id ignored when database is off also only now we need to connect to the db if enabled | protected function txn_is_duplicate() {
if($this->log_to_db) {
if($this->connect_db()) {
if(mysql_num_rows(mysql_query("SELECT txn_id FROM ipn WHERE txn_id='".mysql_real_escape_string($this->ipn['txn_id'],$this->dbc)."'",$this->dbc)) != 0) {
return true;
}
}
}
return false;
} | [
"public function payoneApiLogTransactionIdExist()\n {\n $DBConfig = Shopware()->Db()->getConfig();\n\n $sql = \"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='s_plugin_mopt_payone_api_log'\n AND TABLE_SCHEMA='\" . $DBConfig['dbname'] . \"'\n AND COLUMN_NAME ='transaction_id';\";\n $result = Shopware()->Db()->query($sql);\n\n if ($result->rowCount() === 0) {\n return false;\n }\n\n return true;\n }",
"function checkDuplicateItem()\r\n {\r\n $sql = \"select * from order1 where p_status=0 and Service_ID=:Service_ID and Cus_ID=:Cus_ID\";\r\n $args = [':Service_ID' => $this->Service_ID, ':Cus_ID' => $this->Cus_ID];\r\n $stmt = DB::run($sql, $args);\r\n $count = $stmt->rowCount();\r\n return $count;\r\n }",
"protected function isDuplicate($checkUserName) {\n $ret = FALSE;\n\n//connection information for the database \n if ($_SERVER[\"HTTP_HOST\"] == \"localhost\") { //development\n require '../../../bin/dbConnection.inc.php';\n } else {\n require '../../bin/dbConnection.inc.php';\n }\n\n //process to open a connection to the database\n include '../include/connection_open.inc.php';\n $sql = \"SELECT id FROM users where username ='\" . $checkUserName . \"'\";\n\n $result = $conn->query($sql);\n if ($result->num_rows > 0) {\n $ret = TRUE;\n }\n //close the connection\n mysqli_close($conn);\n\n return $ret;\n }",
"function is_duplicate_txn_id($txn_id = '')\n{\n global $ilance;\n \n $sql = $ilance->db->query(\"\n SELECT invoiceid\n FROM \" . DB_PREFIX . \"invoices\n WHERE custommessage = '\" . $ilance->db->escape_string($txn_id) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n return true;\n }\n \n return false;\n}",
"private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }",
"function checkUidIsUnique($uid) {\n try {\n $NetworkConnection = new NetworkConnection();\n $PDO = $NetworkConnection->getNewDbConnection();\n \n $stmt = $PDO->prepare(\"SELECT * FROM uids WHERE uid = ?\");\n $stmt->execute([$uid]);\n $dbUid = $stmt->fetch();\n\n if (!$dbUid) {\n //uid does not yet exist, yay!\n return true;\n } else {\n //UID already exists\n return false;\n }\n } catch (Exception $e) {\n return false;\n }\n}",
"function isTransactionIDValid($txn_idFromPaypal) {\n\t$conn = Doctrine_Manager::connection(); \n\t$query = \"SELECT txn_id from payment WHERE txn_id = '\".$txn_idFromPaypal.\"'\";\n\t$result = $conn->fetchOne($query); \n\t\n\tif(!isEmptyString($result)){ \n\t\t// an error occured while processing the query\n\t\tsendTestMessage(\"Paypal Transaction ID \".$txn_idFromPaypal.\" already exists!!\", \"Query: \".$query.\", <br>Error: \");\n\t\treturn false;\n\t} else {\n\t\t// if there are no rows returned then txn_id has not been used before and is therefore valid.\t\n\t\treturn true;\n\t}\n}",
"function is_duplicate($sql)\n{\n\t$ci=get_instance();\n\t$query=$ci->db->query($sql);\n\tif($query->num_rows()>0){ return TRUE; }else{ return FALSE; }\n}",
"protected function checkDB() {\n }",
"function isUniqueTrackingNumber($db_conn) {\n\tdo {\n\t\t$tn = getTrackingNumber();\n\t\t$sql = \"select tracking_number from orders where tracking_number=:bind\";\n\t\t$statement = OCIParse($db_conn, $sql);\n\t\tOCIBindByName($statement, ':bind', $tn);\n\t\tOCIExecute($statement, OCI_DEFAULT);\n\t\t$r = OCI_Fetch_Array($statement, OCI_BOTH);\n\t} while ($r[0] == $tn);\n\n\treturn $tn;\n\n\n}",
"function noregister_transactionstored($txn_id) {\r\n\t\tglobal $db_connection;\r\n\t\t// IS THERE A TRANSACTION??\r\n\t\t$u_name_q = \"select count(*) from classified_pay where ( transid = '\";\r\n\t\t$u_name_q .= trim($txn_id);\r\n\t\t$u_name_q .= \"')\";\r\n\t\t////\r\n\t\t//\t\t\r\n\t\t$q_result = @mysqli_query($u_name_q) or die (mysqli_error($db_connection)); // \r\n\t\t//\r\n\t\t$row = @mysqli_fetch_row($q_result);\r\n\t\t//\r\n\t\t$counter = $row[0];\r\n\r\n\t\tif ( $counter <= 0 ) return(true);\r\n\t\treturn(false);\r\n\t}",
"function transaction_exists( $transaction_id ) {\n global $wpdb;\n\n $query = $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}{$this->table} WHERE trxId = %d\", $transaction_id );\n $result = $wpdb->get_row( $query );\n\n if ( $result ) {\n return true;\n }\n\n return false;\n }",
"function checkDuplicate(PDO $db, string $name) : bool {\n $query = $db->prepare(\"SELECT `name` FROM `idols` WHERE `name` = :name;\");\n $query->bindParam(':name', $name);\n $query->execute();\n $return = $query->fetch();\n if (gettype($return) == 'array') {\n $return = 1;\n } return $return;\n}",
"private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }",
"function check_connection($branch)\r\n{\r\n if (!isset($_SESSION['db-con-lock-' . $branch->ip]) || !$_SESSION['db-con-lock-' . $branch->ip]) {\r\n\r\n $_SESSION['db-con-lock-' . $branch->ip] = true;\r\n\r\n global $port, $dbuser, $dbpass, $db;\r\n\r\n $conn = mysqli_init();\r\n mysqli_options($conn, MYSQLI_OPT_CONNECT_TIMEOUT, 1);\r\n mysqli_options($conn, MYSQLI_OPT_READ_TIMEOUT, 1);\r\n mysqli_real_connect($conn, $branch->ip, $dbuser, $dbpass, $db, $port);\r\n\r\n if (mysqli_connect_errno()) {\r\n $_SESSION['db-con-lock-' . $branch->ip] = false;\r\n return FALSE;\r\n } else {\r\n if ($branch->queue != \"\") {\r\n update_db($branch);\r\n }\r\n $_SESSION['db-con-lock-' . $branch->ip] = false;\r\n return TRUE;\r\n }\r\n }\r\n}",
"function isUnique($value) {\r\n //connect to mysql database\r\n\t$hostname = \"localhost\";\r\n\t$dbuser=\"root\";\r\n\t$dbpass=\"root\";\r\n\t$db=\"bookstore_test\";\r\n\t$conn = @mysqli_connect($hostname,$dbuser,$dbpass,$db) \r\n\t\t\tor die('Could not connect to MySQL DB -> ' . mysqli_connect_error()); \r\n\t\r\n\t//check if value exists\r\n\t$isUnique = true;\r\n\t$query = mysqli_query($conn, \"SELECT * FROM creator WHERE creator.ID='\".$value.\"';\");\r\n if (!$query)\r\n die('Error connecting to database: ' . mysqli_connect_error($conn));\r\n \r\n if(mysqli_num_rows($query) > 0)\r\n\t $isUnique = false;\r\n \r\n mysqli_close($conn);\r\n\treturn $isUnique;\r\n}",
"private function isTransactionWithHashAlreadyDone($hash){\n $query =& $this->_db->getQuery(TRUE);\n $query->select('*');\n $query->from('#__rsmembership_transactions');\n $query->where('hash = '.$this->_db->Quote($hash));\n $query->where('gateway ='.$this->_db->Quote('Dibs'));\n $this->_db->setQuery($query);\n $this->debug($query->dump(), __FUNCTION__);\n $transaction = $this->_db->loadObject();\n if(!$transaction){\n return FALSE;\n }else{\n return TRUE;\n }\n }",
"public function check_is_same_db() {\n\t\treturn isset($this->options['separate_db'])?(bool)$this->options['separate_db']: false;\n\t}",
"function verify_id()\n\t{\n\t\tlog_debug(\"name_server\", \"Executing verify_id()\");\n\n\t\tif ($this->id)\n\t\t{\n\t\t\t$sql_obj\t\t= New sql_query;\n\t\t\t$sql_obj->string\t= \"SELECT id FROM `name_servers` WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t\t$sql_obj->execute();\n\n\t\t\tif ($sql_obj->num_rows())\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'Civi_Api4_Service_Spec_Provider_ContributionCreationSpecProvider' shared service. | protected function getCiviApi4ServiceSpecProviderContributionCreationSpecProviderService()
{
return $this->services['Civi_Api4_Service_Spec_Provider_ContributionCreationSpecProvider'] = new \Civi\Api4\Service\Spec\Provider\ContributionCreationSpecProvider();
} | [
"protected function getCiviApi4ServiceSpecProviderFinancialItemCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_FinancialItemCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\FinancialItemCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderCampaignCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_CampaignCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\CampaignCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderContactTypeCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_ContactTypeCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\ContactTypeCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderPaymentProcessorCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_PaymentProcessorCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\PaymentProcessorCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderUFFieldCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_UFFieldCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\UFFieldCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderEntityTagCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_EntityTagCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\EntityTagCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderEmailCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_EmailCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\EmailCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderDomainCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_DomainCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\DomainCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderTagCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_TagCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\TagCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderBatchCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_BatchCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\BatchCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderNoteCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_NoteCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\NoteCreationSpecProvider();\n }",
"protected function getCiviApi4ServiceSpecProviderOptionValueCreationSpecProviderService()\n {\n return $this->services['Civi_Api4_Service_Spec_Provider_OptionValueCreationSpecProvider'] = new \\Civi\\Api4\\Service\\Spec\\Provider\\OptionValueCreationSpecProvider();\n }",
"protected function getIcap_Wiki_ContributionRepositoryService()\n {\n return $this->services['icap.wiki.contribution_repository'] = $this->get('doctrine.orm.default_entity_manager')->getRepository('Icap\\\\WikiBundle\\\\Entity\\\\Contribution');\n }",
"public function gitProvider()\n {\n return $this->provider;\n }",
"function _createContribution(array $params = array()) {\n $result = civicrm_api3('SepaImport', 'create', array_merge(array(\n 'contact_id' => '1',\n 'iban' => 'DE89 3704 0044 0532 0130 00',\n 'status' => 'FRST',\n 'create_date' => '1970-01-01', /* Shouldn't matter in most cases, as long as it's <= start_date. */\n 'start_date' => '2015-05-05',\n 'frequency_unit' => 'month',\n 'frequency_interval' => '1',\n 'amount' => '23',\n 'payment_processor_id' => '1', /* Usually tests will set up exactly one PP for SEPA. */\n 'financial_type_id' => '1', /* Shouldn't matter for most tests. */\n 'sequential' => 1,\n ), $params));\n\n CRM_Core_DAO::$_dbColumnValueCache = null; /* Get rid of stale values, causing mysterious failures later on. */\n\n return $result['values'][0]['entity_id']; /* SepaImport.create returns the SepaMandate.create result -- so the Contribution ID is in the 'entity_id' field. */\n }",
"protected function getComposerManifestProposalGeneratorService()\n {\n return $this->privates['TYPO3\\\\CMS\\\\Extensionmanager\\\\Service\\\\ComposerManifestProposalGenerator'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\Service\\ComposerManifestProposalGenerator::class, ($this->services['TYPO3\\\\CMS\\\\Core\\\\Http\\\\RequestFactory'] ?? $this->getRequestFactoryService()), ($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\EmConfUtility'] ?? ($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\EmConfUtility'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\Utility\\EmConfUtility::class))));\n }",
"public static function getProvider()\r\n\t{\r\n\t\treturn MetroPcsDistributionProvider::get();\r\n\t}",
"public function getProvider()\n {\n if (!$this->_provider) {\n // No provider is available yet, attempt to load it\n $provider = Rx_Config::get('rx.sharedfiles.provider.' . $this->getId(), 'default');\n $this->setProvider($provider);\n if (!$this->_provider) {\n throw new Rx_SharedFiles_Exception('No information provider is defined for shared files collection \"' . $this->getId() . '\"');\n }\n }\n return ($this->_provider);\n }",
"public function findContribution() {\n $etp = $this->entity_table;\n $eid = $this->entity_id;\n switch ($etp) {\n case 'civicrm_contribution_recur' :\n $contr = new CRM_Contribute_BAO_Contribution();\n $contr->get('contribution_recur_id', $eid);\n return $contr;\n break;\n case 'civicrm_contribution' :\n $contr = new CRM_Contribute_BAO_Contribution();\n $contr->get('id', $eid);\n return $contr;\n break;\n default:\n echo 'Huh ? ' . $etp;\n }\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks wether the given $item can be printed as String | public static function CanBeString($item)
{
return
(
!is_array($item)
)
&&
(
(!is_object($item)
&&
settype($item, 'string') !== false
)
||
(is_object($item)
&&
method_exists($item, '__toString')
)
);
} | [
"function canBeString ($item) {\n\t\n\t\tif(\n\t\t\t( !is_null( $item ) ) && \n\t\t\t( ( !is_array( $item ) ) &&\n\t\t\t( ( !is_object( $item ) && settype( $item, 'string' ) !== false ) ||\n\t\t\t( is_object( $item ) && method_exists( $item, '__toString' ) ) ) )\n\t\t)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t\n\t}",
"private function isStringUnIndentedCollectionItem()\n {\n return (0 === strpos($this->currentLine, '- '));\n }",
"protected function _isntIiifDisplayableItem($item) {\n return (($item->fileCount() == 0 || get_option('iiifitems_bridge_prefix') == \"\") && !$item->hasElementText('IIIF Item Metadata', 'JSON Data')) || IiifItems_Util_Canvas::isNonIiifItem($item);\n }",
"protected function _isntIiifDisplayableItem($item) {\n return ($item->fileCount() == 0 && !$item->hasElementText('IIIF Item Metadata', 'JSON Data')) || IiifItems_Util_Canvas::isNonIiifItem($item);\n }",
"public function isPrintable(): bool\n {\n return $this->utf8::is_printable($this->str);\n }",
"public function isPrintableEntity(EntityInterface $entity);",
"function CheckArrayItems(&$item)\n {\n if (is_string($item))\n {\n if ($item == \"@\" || $item == \"@@\" )\n {\n $item = \"'\" . $item . \"'\";\n }\n else if ((substr($item,0,1) == \"@\" && substr($item,-1) == \"@\"))\n {\n $item = trim($item, \"@\");\n }\n /*\t\t\telse if ((substr($item,0,1) == \"$\" && substr($item,-1) == \"$\"))\n {\n\n $item = trim($item, \"$\");\n }*/\n else\n {\n $item = \"'\" . trim($item, \"'\") . \"'\";\n }\n\n if (mb_detect_encoding($item, 'UTF-8', true) === false) { \n $item = utf8_encode($item); \n } \t\t\t\n\n }\n }",
"function MyMod_Item_Print($item=array())\n {\n if (empty($item)) { $item-$this->ItemHash; }\n\n $latex=\n $this-> Submissions_Latex_Doc_Head($item).\n \"\\n\".\n $this->MyMod_Item_Latex($item).\n $this->Submissions_Latex_Doc_Tail().\n \"\";\n\n if ($this->CGI_GETint(\"Latex\")==1)\n {\n $this->ShowLatexCode($latex);\n exit();\n }\n \n return $this->Latex_PDF\n (\n $this->MyMod_Item_Print_FileName($item),\n $latex\n );\n \n \n }",
"public static function dump($item) {\n var_dump(self::export($item));\n }",
"protected function checkItemType($itemObj)\n {\n return true;\n }",
"public function isPrintable()\n {\n return $this->printable;\n }",
"function is_printable_str($temp) {\n\t$len = strlen($temp);\n\n\tfor ($i=0; $i<$len; $i++) {\n\t\t$ascii_val = ord( substr( $temp,$i,1 ) );\n\t\tif( $ascii_val < 32 || $ascii_val > 126 )\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}",
"abstract protected function matchesSafely($item);",
"public function print_item_preview($item)\n {\n global $OUTPUT, $DB;\n\n $align = right_to_left() ? 'right' : 'left';\n $str_required_mark = '<span class=\"apply_required_mark\">*</span>';\n\n $presentation = explode(APPLY_TEXTFIELD_SEP, $item->presentation);\n //$outside_style = isset($presentation[2]) ? $presentation[2]: get_string('outside_style_default', 'apply');\n //$item_style = isset($presentation[3]) ? $presentation[3]: get_string('item_style_default', 'apply');\n $item->outside_style = ''; //$outside_style;\n $item->item_style = ''; //$item_style;\n\n //print the question and label\n $requiredmark = ($item->required == 1) ? $str_required_mark : '';\n $output = '';\n $output .= '<div class=\"apply_item_label_'.$align.'\">';\n $output .= '('.$item->label.') ';\n $output .= format_text($item->name.$requiredmark, true, false, false).' ['.$item->position.']';\n if ($item->dependitem) {\n if ($dependitem = $DB->get_record('apply_item', array('id'=>$item->dependitem))) {\n $output .= ' <span class=\"apply_depend\">';\n $output .= '('.$dependitem->label.'->'.$item->dependvalue.')';\n $output .= '</span>';\n }\n }\n $output .= '</div>';\n\n apply_open_table_item_tag($output, true);\n\n //print the presentation\n echo '<div class=\"apply_item_presentation_'.$align.'\">';\n echo '<span class=\"apply_item_textfield\">';\n apply_item_box_start($item);\n echo '<input type=\"text\" '.\n 'name=\"'.$item->typ.'_'.$item->id.'\" '.\n 'size=\"'.$presentation[0].'\" '.\n 'maxlength=\"'.$presentation[1].'\" '.\n 'value=\"\" />';\n apply_item_box_end();\n echo '</span>';\n echo '</div>';\n\n apply_close_table_item_tag();\n }",
"public function hasDescription($item)\n {\n return trim($item->getDescription()) != '';\n }",
"function _afo_display_grid_printItems($item, $options=array()) {\n\tif(!is_array($item)) return null;\n\t\n\tforeach($item as $label => $item_content) {\n\t\tif($item_content && substr($label,0,1)!='#') {\n\t\t\t\n\t\t\t// define toggle class\n\t\t\tif($label != 'thumbnail' && !$options['expandable']) $toggleClass = 'rollToggle';\n\t\t\telse $toggleClass = '';\n\t\t\t\n\t\t\tif(!is_array($item_content)) {\n\t\t\t\t$item_display .= \"<div class='item-$label $toggleClass'>\";\n\t\t\t\t$item_display .= $item_content;\n\t\t\t\t$item_display .= \"</div>\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$item_display .= '<div class=\"'.$toggleClass.' item-'.$label.' '.$item_content['#class'].'\">';\n\t\t\t\t$item_display .= $item_content['#content'];\n\t\t\t\t$item_display .= \"</div>\";\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn $item_display;\n}",
"private function prepareItemDataForPrint ($item) {\n if ($item->quantity) {\n $itemPackage = Packages::findFirst(\"item_id=$item->id\");\n $types = $this->fixture['types'];\n\n $printData = [\n 'type' => $item->type,\n 'width' => $item->width,\n 'length' => $item->length,\n 'customerOrder' => $item->customer_order,\n ];\n\n if (count($types[$item->type]) == 1) {\n $barcodeSecondPart = str_pad($itemPackage->primary_type, 3, '0', STR_PAD_LEFT);\n\n for ($i = 1; $i <= $itemPackage->primary_no; $i++) {\n $barcode = substr_replace($item->barcode, str_pad($i, 3, '0', STR_PAD_LEFT) . '-' . $barcodeSecondPart, -7);\n $printData['items']['barcode'][] = $barcode;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcode);\n $printData['items']['totalOfNo'][] = $i;\n $printData['items']['totalInPackage'][] = (int) $barcodeSecondPart;\n }\n\n if ($itemPackage->total_leftover_quantity) {\n $barcodeLeftover = substr_replace($item->barcode, str_pad(++$itemPackage->primary_no, 3, '0', STR_PAD_LEFT) .\n '-' . str_pad($itemPackage->total_leftover_quantity, 3, '0', STR_PAD_LEFT), -7);\n $printData['items']['barcode'][] = $barcodeLeftover;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcodeLeftover);\n $printData['items']['totalOfNo'][] = $itemPackage->primary_no;\n $printData['items']['totalInPackage'][] = $itemPackage->total_leftover_quantity;\n }\n\n } else if (count($types[$item->type]) == 2) {\n $barcodeSecondPartPrimary = str_pad($types[$item->type][0], 3, '0', STR_PAD_LEFT);\n $barcodeSecondPartSecondary = str_pad($types[$item->type][1], 3, '0', STR_PAD_LEFT);\n\n if ($itemPackage->primary_no && $itemPackage->secondary_no) {\n for ($i = 1; $i <= $itemPackage->primary_no; $i+=2) {\n $barcode = substr_replace($item->barcode, str_pad($i, 3, '0', STR_PAD_LEFT) . '-' . $barcodeSecondPartPrimary, -7);\n $printData['items']['barcode'][] = $barcode;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcode);\n $printData['items']['totalOfNo'][] = $i;\n $printData['items']['totalInPackage'][] = (int) $barcodeSecondPartPrimary;\n }\n\n if ($itemPackage->secondary_no == 1) {\n $barcode = substr_replace($item->barcode, str_pad(2, 3, '0', STR_PAD_LEFT) . '-' .\n $barcodeSecondPartSecondary, -7);\n $printData['items']['barcode'][] = $barcode;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcode);\n $printData['items']['totalOfNo'][] = 2;\n $printData['items']['totalInPackage'][] = (int) $barcodeSecondPartSecondary;\n } else {\n for ($j = 2; $j <= $itemPackage->secondary_no; $j+=2) {\n $barcode = substr_replace($item->barcode, str_pad($j, 3, '0', STR_PAD_LEFT) . '-' .\n $barcodeSecondPartSecondary, -7);\n $printData['items']['barcode'][] = $barcode;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcode);\n $printData['items']['totalOfNo'][] = $j;\n $printData['items']['totalInPackage'][] = (int) $barcodeSecondPartSecondary;\n }\n }\n } else if ($itemPackage->primary_no == 1) {\n $barcode = substr_replace($item->barcode, str_pad(1, 3, '0', STR_PAD_LEFT) . '-' .\n $barcodeSecondPartPrimary, -7);\n $printData['items']['barcode'][] = $barcode;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcode);\n $printData['items']['totalOfNo'][] = 1;\n $printData['items']['totalInPackage'][] = (int) $barcodeSecondPartPrimary;\n } else if ($itemPackage->secondary_no == 1) {\n $barcode = substr_replace($item->barcode, str_pad(1, 3, '0', STR_PAD_LEFT) . '-' .\n $barcodeSecondPartSecondary, -7);\n $printData['items']['barcode'][] = $barcode;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcode);\n $printData['items']['totalOfNo'][] = 1;\n $printData['items']['totalInPackage'][] = (int) $barcodeSecondPartSecondary;\n }\n\n if ($itemPackage->total_leftover_quantity) {\n $max = $itemPackage->primary_no > $itemPackage->secondary_no ?\n $itemPackage->primary_no : ($itemPackage->secondary_no == 1 ? 1 : $itemPackage->secondary_no);\n\n $barcodeLeftover = substr_replace($item->barcode, str_pad(++$max, 3, '0', STR_PAD_LEFT) .\n '-' . str_pad($itemPackage->total_leftover_quantity, 3, '0', STR_PAD_LEFT), -7);\n\n $printData['items']['barcode'][] = $barcodeLeftover;\n $printData['items']['barcodeCode'][] = $this->generateBarcodePNG($barcodeLeftover);\n $printData['items']['totalOfNo'][] = $max;\n $printData['items']['totalInPackage'][] = $itemPackage->total_leftover_quantity;\n }\n }\n\n return $printData;\n }\n }",
"function write_item( $item ) {\r\n global $CFG;\r\n // initial string;\r\n $expout = \"\";\r\n // add comment\r\n $expout .= \"\\n\\n<!-- item: $item->id -->\r\n<div class='item'>\\n\";\r\n\t\t// \r\n\t\tif ($item){\r\n\t\t\t// DEBUG\r\n\t\t\t// echo \"<br />\\n\";\r\n\t\t\t// print_r($item);\r\n $code = $item->code_item;\r\n $description_item = $item->description_item;\r\n $ref_referentiel = $item->ref_referentiel;\r\n $ref_competence = $item->ref_competence;\r\n\t\t\t$type_item = $item->type_item;\r\n\t\t\t$poids_item = $item->poids_item;\r\n\t\t\t$num_item = $item->num_item;\r\n $expout .= \" <ul>\\n\";\r\n\t\t\t$expout .= \" <li><b>\".get_string('code','referentiel').\"</b> : $code</li>\\n\"; \r\n $expout .= \" <li><b>\".get_string('description_item','referentiel').\"</b> : $description_item</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('ref_referentiel','referentiel').\"</b> : $ref_referentiel</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('ref_competence','referentiel').\"</b> : $ref_competence</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('type_item','referentiel').\"</b> : $type_item</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('poids_item','referentiel').\"</b> : $poids_item</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('num_item','referentiel').\"</b> : $num_item</li>\\n\";\t\t\t\r\n\t\t\t$expout .= \" </ul>\\n\"; \r\n }\r\n\t\t$expout .= \"</div>\\n\";\r\n return $expout;\r\n }",
"public function toString()\n {\n return (string) $this->item;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes sorting div after shop loop | function remove_default_sorting_storefront() {
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );
} | [
"function wb_prod_sort() {\n\tif ( is_active_sidebar( 'prod_sort' ) ) {\n\t\tdynamic_sidebar( 'prod_sort' );\n\t}\n}",
"public function dropSort() {\r\n $plugin = new Application_Model_DbTable_Plugins();\r\n $plugConf = new Application_Model_DbTable_PluginsSettings();\r\n\r\n $pluginId = $plugin->getBySystemName('siteMapHtml')['id'];\r\n $plugConf->delete(\"plugins_id=$pluginId AND name='sort'\");\r\n return TRUE;\r\n }",
"function cleanSort()\n {\n if ($this instanceof DataObjectList)\n $this->sort = array();\n }",
"public function unsortable();",
"public function clearOrder() {\r\n if (!$this->placed) {\r\n $this->item_list = array();\r\n }\r\n }",
"public function disableSorting() {\n\t\t$this->_tableSort = false;\n }",
"function woocommerce_reset_loop()\n {\n }",
"public function cms_reorder() {\n\t\t$this->autoRender = false;\n\t\tforeach($this->request->query['sortable'] as $k=>$v) {\n\t\t\t$this->Page->id = end(explode('row_',$v));\n\t\t\t$this->Page->set('position',$k);\n\t\t\t$this->Page->save();\n\t\t}\t\t\n\t}",
"public static function dislay_top_abandoned_products() {\n global $wpdb;\n $abandoned_products = $wpdb->get_results($wpdb->prepare(\"SELECT DISTINCT product.ID,count(product.ID) as count FROM {$wpdb->postmeta} as pm \n INNER JOIN {$wpdb->posts} as product ON FIND_IN_SET(product.ID, pm.meta_value) \n INNER JOIN {$wpdb->posts} as cartlist ON cartlist.ID=pm.post_id\n WHERE pm.meta_key=%s AND product.post_type=%s AND cartlist.post_type=%s AND cartlist.post_status=%s\n GROUP BY product.ID order by count(product.ID) DESC LIMIT 10\", 'rac_product_details', 'product', 'raccartlist', 'rac-cart-abandon'), ARRAY_A);\n ?>\n <style>\n .fp_rac_top_abandoned_products{\n width:100%;\n border:1px solid #f2f2f2;\n border-collapse: collapse;\n }\n\n .fp_rac_top_abandoned_products tr td{\n padding-top: 10px;\n padding-bottom: 10px;\n padding-left:10px;\n vertical-align: left;\n border:none !important;\n }\n .fp_rac_top_abandoned_products tr:nth-child(odd){\n background-color: #f2f2f2;\n }\n </style>\n <table class=\"fp_rac_top_abandoned_products\" cellpadding='2'>\n <tr>\n <td><?php _e('S.No', 'recoverabandoncart'); ?></td>\n <td><?php _e('Product Name', 'recoverabandoncart'); ?></td>\n <td><?php _e('Abandoned Count', 'recoverabandoncart'); ?></td>\n </tr>\n <tbody>\n <?php foreach ($abandoned_products as $key => $abandoned_product) { ?>\n <tr>\n <td>\n <span> <?php echo $key + 1; ?></span>\n </td>\n <td>\n <span style=\"font-weight:bold;\"> <?php echo get_the_title($abandoned_product['ID']); ?> </span>\n </td>\n <td>\n <span> <?php echo $abandoned_product['count']; ?></span>\n </td>\n </tr>\n <?php } ?>\n </tbody>\n </table>\n <?php\n }",
"private function sort_items_html($head_title) {\n $grid_min = self::$GRID_MIN_ITEMS;\n $disabled = $this->is_readonly ? ' disabled' : '';\n $class = $this->is_readonly ? 'class=\"disabled\" ' : '';\n $no_items = error_str('error.arrange');\n return <<<HTML\n\n<% if (items !== false) { %> \n\n <% if (items.length) { var has_grid = items.length >= {$grid_min}; %>\n\n<h2>{$head_title}</h2>\n\n<div id=\"sort-list-cnt\" class=\"form-group\">\n <ul id=\"sort-list\" data-role=\"<%= has_grid ? 'none' : 'listview' %>\" <%= has_grid ? ' class=\"sort-grid{$disabled}\"' : '{$class}data-split-theme=\"a\"' %>>\n\n <% for (var i=0; i < items.length; i++) { var item = items[i]; %>\n\n <li data-id=\"<%= item['id'] %>\"<% if (has_grid && item['image'].length) { %> style=\"background-image:url(<%= item['image'] %>);\"<% } %>>\n <% if ( ! has_grid && item['image'].length) { %><img src=\"<%= item['image'] %>\" /><% } %>\n <div class=\"sort-number\"><%= (i + 1) %></div>\n <h3><%= item['name'] %></h3>\n </li>\n\n <% } %>\n\n </ul>\n</div>\n\n <% } else { %>\n\n<p id=\"sort-no-items\">{$no_items}</p>\n\n <% } %>\n\n<% } %>\n\nHTML;\n\n }",
"public function clearSorts(): void\n {\n $this->{$this->getTableName()}['sorts'] = [];\n }",
"function get_tour_order_filterer(){\n\n\t\t\t\t$ajax_settings = $this->settings;\n\t\t\t\tunset($ajax_settings['query']);\n\n\t\t\t\t$ret = '<div class=\"tourmaster-tour-order-filterer-wrap tourmaster-item-mglr clearfix\" ';\n\t\t\t\t$ret .= 'data-tm-ajax=\"tourmaster_tour_order_ajax\" ';\n\t\t\t\t$ret .= 'data-settings=\"' . esc_attr(json_encode($ajax_settings)) . '\" ';\n\t\t\t\t$ret .= 'data-target=\"tourmaster-tour-item-holder\" ';\n\t\t\t\t$ret .= 'data-target-action=\"replace\" ';\n\t\t\t\t$ret .= 'data-ajax-url=\"' . esc_attr(TOURMASTER_AJAX_URL) . '\" ';\n\t\t\t\t$ret .= ' >';\n\n\t\t\t\t$ret .= '<h3 class=\"tourmaster-tour-order-filterer-title\" >' . esc_html__('Sort by', 'tourmaster') . '</h3>';\n\n\t\t\t\t// orderby\n\t\t\t\t$order_options = array(\n\t\t\t\t\t'date' => esc_html__('Release Date', 'tourmaster'),\n\t\t\t\t\t'tour-date' => esc_html__('Tour Date', 'tourmaster'),\n\t\t\t\t\t'title' => esc_html__('Title', 'tourmaster'),\n\t\t\t\t\t'price' => esc_html__('Price', 'tourmaster'),\n\t\t\t\t\t'popularity' => esc_html__('Popularity', 'tourmaster'),\n\t\t\t\t\t'rating' => esc_html__('Rating', 'tourmaster'),\n\t\t\t\t\t'duration' => esc_html__('Duration', 'tourmaster'),\n\t\t\t\t);\n\t\t\t\t$ret .= '<div class=\"tourmaster-combobox-wrap\" >';\n\t\t\t\t$ret .= '<select data-ajax-name=\"orderby\" >';\n\t\t\t\tforeach( $order_options as $order_slug => $order_title ){\n\t\t\t\t\t$ret .= '<option value=\"' . esc_attr($order_slug) . '\" ';\n\t\t\t\t\t$ret .= $this->settings['orderby'] == $order_slug? 'selected': '';\n\t\t\t\t\t$ret .= ' >' . $order_title . '</option>';\n\t\t\t\t}\n\t\t\t\t$ret .= '</select>';\n\t\t\t\t$ret .= '</div>';\n\n\t\t\t\t// order\n\t\t\t\t$ret .= '<div class=\"tourmaster-combobox-wrap\" >';\n\t\t\t\t$ret .= '<select data-ajax-name=\"order\" >';\n\t\t\t\t$ret .= '<option value=\"asc\" ' . ($this->settings['order'] == 'asc'? 'selected': '') . ' >' . esc_html__('Ascending', 'tourmaster') . '</option>';\n\t\t\t\t$ret .= '<option value=\"desc\" ' . ($this->settings['order'] == 'desc'? 'selected': '') . ' >' . esc_html__('Descending', 'tourmaster') . '</option>';\n\t\t\t\t$ret .= '</select>';\n\t\t\t\t$ret .= '</div>';\n\n\t\t\t\t// list style\n\t\t\t\t$ret .= '<span class=\"tourmaster-tour-order-filterer-style\" >';\n\t\t\t\tif( !empty($this->settings['order-filterer-list-style']) && $this->settings['order-filterer-list-style'] != 'none' ){\n\t\t\t\t\t$temp = str_replace('-with-frame', '', $this->settings['order-filterer-list-style']);\n\t\t\t\t\t$ret .= '<a href=\"#\" data-ajax-name=\"item-style\" ';\n\t\t\t\t\t$ret .= ' class=\"' . ($temp == $this->settings['tour-style']? 'tourmaster-active': '') . '\" ';\n\t\t\t\t\t$ret .= ' data-ajax-value=\"list-style\" >';\n\t\t\t\t\tif( !empty($this->settings['filter-icon']) && $this->settings['filter-icon'] == 'svg' ){\n\t\t\t\t\t\t$ret .= tourmaster_get_svg('list');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$ret .= '<i class=\"fa fa-th-list\" ></i>';\n\t\t\t\t\t}\n\t\t\t\t\t$ret .= '</a>';\n\t\t\t\t}\n\t\t\t\tif( !empty($this->settings['order-filterer-grid-style']) && $this->settings['order-filterer-grid-style'] != 'none' ){\n\t\t\t\t\t$temp = str_replace('-with-frame', '', $this->settings['order-filterer-grid-style']);\n\t\t\t\t\t$ret .= '<a href=\"#\" data-ajax-name=\"item-style\" ';\n\t\t\t\t\t$ret .= ' class=\"' . ($temp == $this->settings['tour-style']? 'tourmaster-active': '') . '\" ';\n\t\t\t\t\t$ret .= ' data-ajax-value=\"grid-style\" >';\n\t\t\t\t\tif( !empty($this->settings['filter-icon']) && $this->settings['filter-icon'] == 'svg' ){\n\t\t\t\t\t\t$ret .= tourmaster_get_svg('grid');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$ret .= '<i class=\"fa fa-th\" ></i>';\n\t\t\t\t\t}\n\t\t\t\t\t$ret .= '</a>';\n\t\t\t\t}\n\t\t\t\t$ret .= '</span>';\n\n\t\t\t\t$ret .= '</div>';\n\n\t\t\t\treturn $ret;\n\t\t\t}",
"public function sortAction() {\n\t\t$extlistContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByCustomConfiguration(\n\t\t\t$this->settings['listConfig']['accommodationAdmin'], 'accommodationAdmin'\n\t\t);\n\t\t$extlistContext->getDataBackend()->getSorter()->reset();\n\t\t$this->forward('list');\n\t}",
"function link_ordering_page(){\n\t\techo '<div class=\"wrap\">';\n\t\t\tscreen_icon('themes');\n\t\t\techo '<h2>'.__('Keeping Your Links in Order','wp-simple-links').'!</h2>';\n\t\t\n\t\t\n\t\t\t//Create the Dropdown for by Category Sorting\n\t\t\t$all_cats = get_terms('simple_link_category');\n\t\t\tif( is_array( $all_cats ) ){ \n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Select a Link Category to Sort Links in that Category Only ( optional )','wp-simple-links');?></br></h3>\n\t\t\t\t\t<select id=\"SL-sort-cat\">\n\t\t\t\t\t\t<option value=\"Xall-catsX\"><?php _e('All Categories','wp-simple-links');?></option>\n\t\t\t\t\n\t\t\t\t<?php \n\t\t\t\tforeach( $all_cats as $cat ){\n\t\t\t\t\tprintf( '<option value=\"%s\">%s</option>', $cat->slug, $cat->name );\n\t\t\t\t}\n\t\t\t\n\t\t\t\techo '</select> <br> <br>';\n\t\t\t\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('To Sort by Link Categories, you must Add Some Links to them','wp-simple-links');?>.<br>\n\t\t\t\t\t<a href=\"/wp-admin/edit-tags.php?taxonomy=simple_link_category&post_type=simple_link\"><?php _e('Follow Me','wp-simple-links');?></a>\n\t\t\t\t</h3>\n\t\t\t\t<?php \n\t\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\t//Retrieve all the links\n\t\t\t$links = get_posts( 'post_type=simple_link&orderby=menu_order&order=ASC&numberposts=200' );\n\t\t\n\t\t\techo '<ul class=\"draggable-children\" id=\"SL-drag-ordering\">';\n\t\t\n\t\t\t#-- Create the items list\n\t\t\tforeach( $links as $link ){\n\t\t\t\t$cats = '';\n\t\t\t\n\t\t\t\t//All Cats Assigned to this\n\t\t\t\t$all_assigned_cats = get_the_terms($link->ID, 'simple_link_category');\n\t\t\t\tif( !is_array( $all_assigned_cats ) ) {\n\t\t\t\t\t$all_assigned_cats = array();\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//Create a sting of cats assigned to this link\n\t\t\t\tforeach( $all_assigned_cats as $cat ){\n\t\t\t\t\t$cats .= ' ' . strtolower(str_replace(' ', '-', $cat->name)); \n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t?>\n\t\t <li id=\"postID-<?php echo $link->ID; ?>\" class=\"<?php echo $cats; ?>\">\n \t<div class=\"menu-item-handle\">\n\t\t \t\t<span class=\"item-title\"><?php echo $link->post_title ?></span> \n\t\t \t</div>\n\t\t </li>\n\t\t \n\t\t <?php \n\t\t }\n\t\t \t\n\t echo '</ul></div><!-- End .wrap -->';\n\t}",
"protected function resetSorter()\n {\n // TODO put this into abstract controller\n if ($this->filterbox->getFilterboxConfiguration()->getResetToDefaultSortingOnSubmit()) {\n $this->dataBackend->getSorter()->resetToDefault();\n } else {\n $this->dataBackend->getSorter()->reset();\n }\n\n // TODO add method to data backend that resets sorting and resets cache!\n $this->dataBackend->resetListDataCache();\n }",
"protected function sorting()\n {\n $output = '';\n \n $output .= '<label class=\"hide-past-bookings-wrapper\"><input type=\"checkbox\" value=\"hide-past-bookings\" id=\"hide-past-bookings\" '.($this->hide_past_bookings ? 'checked' : '').' /> '.__('Hide past bookings', 'wp-booking-system').'</label>';\n\n $output .= '<select id=\"wpbs-bookings-order-by\">';\n $output .= '<option value=\"\" disabled selected>' . __('Sort by', 'wp-booking-system') . '</option>';\n $output .= '<option value=\"id\">' . __('Date', 'wp-booking-system') . '</option>';\n $output .= '<option value=\"check-in-date\">' . __('Check-in date', 'wp-booking-system') . '</option>';\n $output .= '<option value=\"check-out-date\">' . __('Check-out date', 'wp-booking-system') . '</option>';\n $output .= '</select>';\n\n $output .= '<select id=\"wpbs-bookings-order\">';\n $output .= '<option value=\"\" disabled selected>' . __('Sort order', 'wp-booking-system') . '</option>';\n $output .= '<option value=\"asc\">' . __('Ascending', 'wp-booking-system') . '</option>';\n $output .= '<option value=\"desc\">' . __('Descending', 'wp-booking-system') . '</option>';\n $output .= '</select>';\n\n return $output;\n }",
"function remove_loop_button(){\nremove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );\nremove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );\n}",
"public function sortableDeleted()\n {\n $this->decrementAbovePosition();\n }",
"public function makeSortable()\n {\n //\\Limbonia\\Widget::includeScript($this->sWebShareDir . \"/sorttable.js\");\n $this->addClass('sortable');\n $this->addClass('sortGrid');\n $this->writeJavascript('sorttable.init();');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the user ID from the request attribute | public function getUserId()
{
return (int)$this->request->getAttribute('user_id');
} | [
"private function getUserId() {\n $request = $this->getRequest();\n return empty($request['uid']) ? $this->getAccount()->uid : $request['uid'];\n }",
"private function getUserId($request)\n {\n if ($request->getAttribute('userId')) {\n $userId = $request->getAttribute('userId');\n } else {\n $userId = $request->getAttribute('id');\n }\n return $userId;\n }",
"public function get_user_id();",
"public function get_request_user_id()\n {\n return $this->get_default_property(self::PROPERTY_REQUEST_USER_ID);\n }",
"public function getUserId()\n {\n return parent::getValue('user_id');\n }",
"public static function get_requesting_user() {\n global $USER;\n\n return empty(self::$requestinguserid) ? $USER->id : self::$requestinguserid;\n }",
"public function get_current_user_id()\n {\n return $this->getRequest()->query->get(self::PARAM_USER_ID, $this->get_user_id());\n }",
"public static function id()\n\t{\n\t\tif (static::config(\"USE_SESSION\")) {\n\t\t\treturn static::$session->get(\"AUTH_USER\")[\"id\"] ?? null;\n\t\t}\n\n\t\t$payload = static::validateToken(static::getSecretKey());\n\t\tif (!$payload) return null;\n\t\treturn $payload->user_id;\n\t}",
"function getUserId() {\n return $this->getFieldValue('user_id');\n }",
"public function getRequestOauthUserId()\n {\n return $this->getRequestOauthClaim('oauth_user_id');\n }",
"private function GetUser()\r\n\t\t{\r\n\t\t\tif (!empty($_POST['customer_id']))\r\n\t\t\t\treturn $_POST['customer_id'];\r\n\t\t\t\r\n\t\t\tif (!empty($_GET['customer_id']))\r\n\t\t\t\treturn $_GET['customer_id'];\r\n\t\t}",
"protected function _getUserId() {\n\t\t// get the userID either from the session or customerobject or from the cookie\n\t\treturn Mage::helper('yoochoose') -> getUserId();\n\t}",
"protected abstract function getUserId();",
"private function get_user_id() {\n if (!$this->userinfo) $this->userinfo = wp_get_current_user();\n\n return $this->userinfo && isset($this->userinfo->ID) && $this->userinfo->ID > 0 ?\n $this->userinfo->ID :\n $_SERVER[\"REMOTE_ADDR\"];\n }",
"public function getStoredUserId();",
"public function getIduser()\n {\n return $this->iduser;\n }",
"protected function getUserId()\n {\n return $this->auth->user()->id;\n }",
"protected function userID ()\n {\n $tokenHeader = apache_request_headers();\n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm);\n //var_dump($datosUsers);\n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('nombre'=>$datosUsers->nombre),\n array('password'=>$datosUsers->password)\n )\n ));\n if(!empty($user))\n {\n $id=0;\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n $username = $user[$key]->nombre;\n $password = $user[$key]->password;\n }\n return $id; \n } \n }",
"public function get_userid() {\n return $this->userid;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getDuplicateCartById' | protected function getDuplicateCartByIdRequest($cart_id)
{
// verify the required parameter 'cart_id' is set
if ($cart_id === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $cart_id when calling getDuplicateCartById'
);
}
$resourcePath = '/beta/cart/duplicate/{cartId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cart_id !== null) {
$resourcePath = str_replace(
'{' . 'cartId' . '}',
ObjectSerializer::toPathValue($cart_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('API-Key');
if ($apiKey !== null) {
$headers['API-Key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function duplicateOrderCartAction(int $orderId)\n {\n $cartId = $this->getCommandBus()->handle(new DuplicateOrderCartCommand($orderId))->getValue();\n\n return $this->json(\n $this->getQueryBus()->handle(\n (new GetCartForOrderCreation($cartId))\n ->setHideDiscounts(true)\n )\n );\n }",
"protected function getDuplicateCartonByIdRequest($carton_id)\n {\n // verify the required parameter 'carton_id' is set\n if ($carton_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $carton_id when calling getDuplicateCartonById'\n );\n }\n\n $resourcePath = '/beta/carton/duplicate/{cartonId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($carton_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cartonId' . '}',\n ObjectSerializer::toPathValue($carton_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createCart();",
"public function actionDuplicate($id) {\n $getProduct = $this->findModel($id);\n $getProductDetail = \\backend\\models\\ProductDetail::findOne($id);\n $getProductImage = \\backend\\models\\ProductImage::find()\n ->where([\"product_id\" => $id])\n ->all();\n\t\t$getProductStock = \\backend\\models\\ProductStock::find()\n\t\t\t\t->where([\"product_id\" => $id])\n\t\t\t\t->all();\n\t\t$getProductFeature = \\backend\\models\\ProductFeature::find()\n\t\t\t\t->where([\"product_id\" => $id])\n\t\t\t\t->all();\n\t\t$getProductNewArrival = \\backend\\models\\ProductNewarrival::find()\n\t\t\t\t->where([\"product_id\" => $id])\n\t\t\t\t->all();\n $getProductRelated = \\backend\\models\\ProductRelated::find()\n ->where([\"product_parent_id\" => $id])\n ->all();\n $getProductWarranty = \\backend\\models\\ProductWarranty::find()\n ->where([\"product_id\" => $id])\n ->all();\n $getSpecificPrice = \\backend\\models\\SpecificPrice::find()\n ->where([\"product_id\" => $id])\n ->all();\n\t\t\n\t\t$modelProduct = new \\backend\\models\\Product();\n\t\t$modelProductDetail = new \\backend\\models\\ProductDetail();\n\t\t\n\t\t/* Duplicate Product */\n\t\t$modelProduct->product_category_id = $getProduct->product_category_id;\n\t\t$modelProduct->product_sub_category_id = $getProduct->product_sub_category_id;\n\t\t$modelProduct->suppliers_supplier_id = $getProduct->suppliers_supplier_id;\n\t\t$modelProduct->category_id = $getProduct->category_id;\n\t\t$modelProduct->brands_brand_id = $getProduct->brands_brand_id;\n\t\t$modelProduct->brands_collection_id = $getProduct->brands_collection_id;\n\t\t$modelProduct->quantity = $getProduct->quantity;\n\t\t$modelProduct->minimal_quantity = $getProduct->minimal_quantity;\n\t\t$modelProduct->price = $getProduct->price;\n\t\t$modelProduct->price_usd = $getProduct->price_usd;\n\t\t$modelProduct->width = $getProduct->width;\n\t\t$modelProduct->height = $getProduct->height;\n\t\t$modelProduct->depth = $getProduct->depth;\n\t\t$modelProduct->weight = $getProduct->weight;\n\t\t$modelProduct->active = $getProduct->active;\n\t\t$modelProduct->available_for_order = $getProduct->available_for_order;\n\t\t$modelProduct->available_date = $getProduct->available_date;\n\t\t$modelProduct->show_price = $getProduct->show_price;\n\t\t$modelProduct->visibility = $getProduct->visibility;\n\t\t$modelProduct->product_sort = $getProduct->product_sort;\n\t\t$modelProduct->date_created = $getProduct->date_created;\n $modelProduct->date_updated = $getProduct->date_updated;\n $modelProduct->disable_click = $getProduct->disable_click;\n\t\t$modelProduct->save();\n\t\t\n $countProductDetail = \\backend\\models\\ProductDetail::find()\n\t\t\t\t->where([\"link_rewrite\" => $getProductDetail->link_rewrite])\n\t\t\t\t->count();\n\t\t\n\t\t/* Duplicate Product Detail */\n\t\t$modelProductDetail->product_id = $modelProduct->product_id;\n\t\t$modelProductDetail->sku_number = \"CHANGE_SKU_NUMBER\";\n\t\t$modelProductDetail->apps_language_id = $getProductDetail->apps_language_id;\n\t\t$modelProductDetail->description = $getProductDetail->description;\n\t\t$modelProductDetail->spesification = $getProductDetail->spesification;\n\t\t$modelProductDetail->product_size_info = $getProductDetail->product_size_info;\n\t\t$modelProductDetail->product_care = $getProductDetail->product_care;\n\t\t$modelProductDetail->meta_description = $getProductDetail->meta_description;\n\t\t$modelProductDetail->meta_keywords = $getProductDetail->meta_keywords;\n\t\t$modelProductDetail->meta_title = $getProductDetail->meta_title;\n\t\t$modelProductDetail->available_now = $getProductDetail->available_now;\n\t\t$modelProductDetail->available_later = $getProductDetail->available_later;\n\t\t$modelProductDetail->shipping_availability_location_id = $getProductDetail->shipping_availability_location_id;\n\t\t$i = (int)$countProductDetail;\n\t\tif($i > 0){\n\t\t\t$n = $i + 1;\n\t\t\t$modelProductDetail->link_rewrite = $getProductDetail->link_rewrite.\"-\".$n;\n\t\t\t$modelProductDetail->name = $getProductDetail->name.\" \".$n;\n\t\t}\n\t\t$modelProductDetail->save();\n\t\t\n\t\t/* Duplicate Product Image */\n\t\t// cannot be implemented yet\n\t\t/*\n\t\t$rows_d = array();\n\t\tforeach($getProductImage as $gpi){\n\t\t\t// $modelProductImage = new \\backend\\models\\ProductImage();\n\t\t\t// $modelProductImage->product_id = $modelProduct->product_id;\n\t\t\t// $modelProductImage->position = $getProductImage->position == null ? 0:$getProductImage->position;\n\t\t\t// $modelProductImage->cover = $getProductImage->cover == null ? 0:$getProductImage->cover;\n\t\t\t// $modelProductImage->save();\n\t\t}\n\t\t*/\n\t\t\n\t\t/* Duplicate Product Stock */\n\t\tif(count($getProductStock) > 0){\n\t\t\tforeach($getProductStock as $gps){\n\t\t\t\t$modelProductStock = new \\backend\\models\\ProductStock();\n\t\t\t\t$modelProductStock->product_id = $modelProduct->product_id;\n\t\t\t\t$modelProductStock->product_attribute_id = $gps->product_attribute_id;\n\t\t\t\t$modelProductStock->quantity = $gps->quantity;\n\t\t\t\t$modelProductStock->save();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Duplicate Product Feature */\n\t\tif(count($getProductFeature) > 0){\n\t\t\tforeach($getProductFeature as $gpf){\n\t\t\t\t$modelProductFeature = new \\backend\\models\\ProductFeature();\n\t\t\t\t$modelProductFeature->product_id = $modelProduct->product_id;\n\t\t\t\t$modelProductFeature->feature_id = $gpf->feature_id;\n\t\t\t\t$modelProductFeature->feature_value_id = $gpf->feature_value_id;\n\t\t\t\t$modelProductFeature->save();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Duplicate Product New Arrival */\n\t\tif(count($getProductNewArrival) > 0){\n\t\t\tforeach($getProductNewArrival as $gpna){\n\t\t\t\t$modelProductNewArrival = new \\backend\\models\\ProductNewarrival();\n\t\t\t\t$modelProductNewArrival->product_id = $modelProduct->product_id;\n\t\t\t\t$modelProductNewArrival->product_newarrival_start_date = $gpna->product_newarrival_start_date;\n\t\t\t\t$modelProductNewArrival->product_newarrival_end_date = $gpna->product_newarrival_end_date;\n\t\t\t\t$modelProductNewArrival->save(); \n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Duplicate Product Related */\n\t\tif(count($getProductRelated) > 0){\n\t\t\tforeach($getProductRelated as $gpr){\n\t\t\t\t$modelProductRelated = new \\backend\\models\\ProductRelated();\n\t\t\t\t$modelProductRelated->product_id = $modelProduct->product_id;\n\t\t\t\t$modelProductRelated->product_parent_id = $gpr->product_parent_id;\n\t\t\t\t$modelProductRelated->save();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Duplicate Product Warranty */\n\t\tif(count($getProductWarranty) > 0){\n\t\t\tforeach($getProductWarranty as $gpw){\n\t\t\t\t$modelProductWarranty = new \\backend\\models\\ProductWarranty();\n\t\t\t\t$modelProductWarranty->product_id = $modelProduct->product_id;\n\t\t\t\t$modelProductWarranty->warranty_type_id = $gpw->warranty_type_id == null ? 0:$gpw->warranty_type_id;\n\t\t\t\t$modelProductWarranty->product_warranty_year = $gpw->product_warranty_year == null? \"\":$gpw->product_warranty_year;\n\t\t\t\t$modelProductWarranty->save();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Duplicate Product SpecificPrice */\n\t\tif(count($getSpecificPrice) > 0){\n\t\t\tforeach($getSpecificPrice as $gsp){\n\t\t\t\t$modelSpecificPrice = new \\backend\\models\\SpecificPrice();\n\t\t\t\t$modelSpecificPrice->product_id = $modelProduct->product_id;\n\t\t\t\t$modelSpecificPrice->currency_id = $gsp->currency_id;\n\t\t\t\t$modelSpecificPrice->customer_id = $gsp->customer_id;\n\t\t\t\t$modelSpecificPrice->product_attribute_id = $gsp->product_attribute_id;\n\t\t\t\t$modelSpecificPrice->from_quantity = $gsp->from_quantity;\n\t\t\t\t$modelSpecificPrice->reduction = $gsp->reduction;\n\t\t\t\t$modelSpecificPrice->reduction_extra = $gsp->reduction_extra;\n\t\t\t\t$modelSpecificPrice->reduction_plus_extra = $gsp->reduction_plus_extra;\n\t\t\t\t$modelSpecificPrice->reduction_type = $gsp->reduction_type;\n\t\t\t\t$modelSpecificPrice->label_type = $gsp->label_type;\n\t\t\t\t$modelSpecificPrice->label = $gsp->label;\n\t\t\t\t$modelSpecificPrice->description = $gsp->description;\n\t\t\t\t$modelSpecificPrice->from = $gsp->from;\n\t\t\t\t$modelSpecificPrice->to = $gsp->to;\n\t\t\t\t$modelSpecificPrice->is_flash_sale = $gsp->is_flash_sale;\n\t\t\t\t$modelSpecificPrice->flash_sale_qty = $gsp->flash_sale_qty;\n\t\t\t\t$modelSpecificPrice->save();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->redirect(Yii::$app->urlManager->getBaseUrl() . '/products/update/'.$modelProduct->product_id);\n\t}",
"public function findProductsWithCartId(int $cart_id);",
"public function addCartId($cart_id);",
"public function create(array $cartItems): ResponseInterface;",
"public function addByOne(Request $req, $pid)\n { \n //[[pid,qty]]\n // $cart=[[1,2],[8,9]];\n \n if($req->session()->get('cart')==null){\n $c= new Cart(null);\n $newCart=$c->add($pid);\n $req->session()->put('cart',$newCart);\n }else{\n $oldCart=$req->session()->get('cart');\n $c= new Cart($oldCart);\n $newCart=$c->add($pid);\n $req->session()->put('cart',$newCart);\n }\n \n $req->session()->flash('msg', 'Product Id('.$pid.') added by one.');\n $req->session()->flash('type','warning');\n return redirect()->route('customer.cart'); \n \n }",
"public function create($id, $qty)\t\n{\n $this->items[$id] = CartItem::factory($id, $qty); \n //Yii::log(\"CREATE ITEM SUCCESS: id=$id, qty=$qty\",'warning');\n return $this->items[$id];\n}",
"#[CustomOpenApi\\Operation(id: 'CartSync', tags: [Tags::Cart, Tags::V1])]\n #[OpenApi\\Parameters(factory: DefaultHeaderParameters::class)]\n #[CustomOpenApi\\RequestBody(request: SyncCartRequest::class)]\n #[CustomOpenApi\\Response(resource: CartResource::class, statusCode: 200)]\n public function sync(SyncCartRequest $request): CartResource\n {\n $cart = tenancy()\n ->getUser()\n ->syncCart(\n CartItem::fromRequest($request),\n $request->customer_id ?? null,\n $request->discount_id ?? null,\n );\n\n return new CartResource($cart);\n }",
"public function createCartItem();",
"public function executeCreateCommonFromCart() {\n\t\t$class_name = $this->getClassName();\n\t\t$this->object = new $class_name();\n\t\t$object_name = $this->getRequestParameter('object_name', $this->getRequestParameter('history[object_name]'));\n\t\t$peer_class = $object_name.'Peer';\n\t\t$name = $peer_class::getMetadata('name', $object_name);\n\t\tif(is_array($name)){\n\t\t\t$plural_name = $name['plural'];\n\t\t\t$name = $name['singular'];\n\t\t} else {\n\t\t\t$plural_name = $name.'s';\n\t\t}\n\t\t$object_count = $this->getCart()->count($object_name);\n\t\t$this->history->setObjectName($object_name);\n\t\t$this->history->setDateRef(time());\n\t\t$this->prepareCommonActions('create');\n\t\t$this->action_title = \"Ajout d'historique sur {$object_count} \".($object_count > 1 ? $plural_name : $name);\n\t\t$this->success = false;\n\t\tif ($this->getRequest()->getMethod() == sfRequest::POST) {\n\t\t\t$this->updateHistoryFromRequest();\n\t\t\t$object_ids = $this->getCart()->getAllItemsId($object_name);\n\t\t\tforeach($object_ids as $id){\n\t\t\t\t$history = new History;\n\t\t\t\t$history->fromArray($this->history->toArray());\n\t\t\t\tforeach($this->history->getContacts() as $contact){\n\t\t\t\t\t$history->addContact($contact);\n\t\t\t\t}\n\t\t\t\t$history->setObjectId($id);\n\t\t\t\t$history->save();\n\t\t\t}\n\t\t\t$this->success = true;\n\t\t\t$s = ($object_count > 1 ? 's' : '');\n\t\t\t$a = ($object_count > 1 ? 'ont' : 'a');\n\t\t\t$this->setFlash('notice', \"{$object_count} historique{$s} {$a} été ajouté{$s}\");\n\t\t}\n\t}",
"public function addItemsToCartNewAction()\n {\n $decoded = $this->get('webservice.helper')->processRequest($this->getRequest());\n\n $user = array_key_exists('auth_token', $decoded) ? $this->get('webservice.helper')->findUserByAuthToken($decoded['auth_token']) : null;\n if ($user) {\n $items = isset($decoded[\"items\"]) ? $decoded[\"items\"] : \"0\";\n if ($items != 0) {\n //$this->container->get('cart.helper.cart')->removeUserCart($user);\n foreach ($items as $detail) {\n /*Remove From Wish list*/\n $this->container->get('cart.helper.wishlist')->removeWishlistByItem($user, $detail[\"item_id\"]);\n $this->container->get('cart.helper.cart')->fillCartforService($detail[\"item_id\"], $user, $detail[\"quantity\"]);\n }\n $resp = 'Items has been added to Cart Successfully';\n $res = $this->get('webservice.helper')->response_array(true, $resp);\n } else {\n $res = $this->get('webservice.helper')->response_array(false, 'Array Item not found');\n }\n } else {\n $res = $this->get('webservice.helper')->response_array(false, 'User not authenticated.');\n }\n return new Response($res);\n\n }",
"protected function getDuplicateCartLocationByIdRequest($cart_location_id)\n {\n // verify the required parameter 'cart_location_id' is set\n if ($cart_location_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cart_location_id when calling getDuplicateCartLocationById'\n );\n }\n\n $resourcePath = '/beta/cartLocation/duplicate/{cartLocationId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($cart_location_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cartLocationId' . '}',\n ObjectSerializer::toPathValue($cart_location_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getDuplicatedCartItems()\n {\n return DB::table('carts')\n ->rightJoin('product_cart', 'carts.id', '=', 'product_cart.cart_id')\n ->where('user_id', Auth::user()->id)\n ->where('state', 'direct-buy')\n ->get();\n }",
"public function getCart(){\n $this->request->type = 'get';\n $this->request->method = '/rest/cart';\n if (!is_null($this->cart->cartId))\n $this->request->method .= '/' . $this->cart->cartId;\n $this->doCall();\n $this->setCart();\n }",
"protected function getDuplicateCartonTypeByIdRequest($carton_type_id)\n {\n // verify the required parameter 'carton_type_id' is set\n if ($carton_type_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $carton_type_id when calling getDuplicateCartonTypeById'\n );\n }\n\n $resourcePath = '/beta/cartonType/duplicate/{cartonTypeId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($carton_type_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cartonTypeId' . '}',\n ObjectSerializer::toPathValue($carton_type_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function payCart()\n {\n\n $data = [];\n $data['success'] = false;\n // refresh CSRF token\n $data['csrf_token'] = csrf_hash();\n\n $orderRequestModel = new OrderRequestModel();\n $orderLineModel = new OrderLineModel();\n\n $listCart = [];\n $cart = json_decode($this->request->getPost('cart')); // get the cart\n if (is_object($cart)) {\n $listCart[] = $cart;\n } else {\n $listCart = $cart;\n }\n\n if (count($listCart) > 0) {\n $newOrder = new OrderRequest();\n $newOrder->fill([\n 'state' => \"w\",\n 'id_users' => $_SESSION['id']\n ]);\n $idOrder = $orderRequestModel->insert($newOrder);\n foreach ($listCart as $orderLine) {\n $newOrderLine = new OrderLine();\n $newOrderLine->fill([\n 'id_order' => $idOrder,\n 'id_article' => $orderLine->id_article,\n \"quantity_ordered\" => $orderLine->quantity\n ]);\n $orderLineModel->insert($newOrderLine);\n }\n $data['success'] = true;\n }\n\n\n header('Content-Type: application/json');\n echo json_encode($data);\n die;\n }",
"protected function createCartRequest($payload = null)\n {\n\n $resourcePath = '/carts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($payload)) {\n $_tempBody = $payload;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fonction hashage de mot de passe | function mdp_hash($mdp){
//hashage du mot de passe avec l'algo: sha256
$mdph = hash('sha256',$mdp);
return $mdph;
} | [
"function HashPassword($mdp)\n {\n return hash ( \"sha256\", hash ( \"md5\", $mdp ) );\n }",
"function Encrypt($mdp)\r\n{\r\n $retour = password_hash($mdp, PASSWORD_DEFAULT);\r\n \r\n return $retour;\r\n}",
"function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }",
"function hassPass($pass){\r\n\t\treturn Security::hash($pass, null, true);\r\n\t}",
"function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}",
"public function getOneTimeLoginHash();",
"function securiser_pwd($mot_de_passe){\r\n\r\n\t\treturn password_hash($mot_de_passe,PASSWORD_DEFAULT);\r\n\r\n\t}",
"public function hashPassword()\n {\n $this->password = Yii::$app->getSecurity()->generatePasswordHash($this->password);\n }",
"private function hashPassword($pass){\n global $site_secret;\n return md5($pass . $site_secret);\n }",
"protected function hashPassword()\n {\n $this->userdata['password'] = Password::hash($this->userdata['password']);\n }",
"public function hashPassword(){\r\n $this->password = password_hash($this->password, PASSWORD_DEFAULT);\r\n }",
"public function isHash($pass);",
"public function getHashedPassword()\n {\n }",
"public static function hash(string $password): string;",
"abstract public function hash($password);",
"function hash_pass($email, $pass) {//--todo--Should implement key stretching, although that would entail a lot of painfulness.\n\tglobal $SECRET_SALT;\n\t$hash = hash('sha512', 'lhsmath $4S5KoOyu\\'B5FRrg(*#%@22aM,jBxQjZIRwnY./\\\\[X2d$MDLGeUD)}:\"mlAt9kekTiaET!mcmVQYTJlk;TdYZJS1aqo' . $email);\n\t$hash = hash('sha512', $hash . ' lhsmath 2BATHJ0G61o23#%zEHEw];.246893QW0SmXA@$#)bcjtPQI%&#RjjANLpyz' . $pass);\n\treturn hash('sha512', $hash . ' lhsmath elEf\\\\0il(*@#%.*()eVvBO6' . $pass . ';Rjz@um3FbPj#$89WnYViPz\\'XwiP7#C7x42M4hUFd' . $SECRET_SALT);\n}",
"public function _h($password){\n \treturn hash('sha256',md5($password.\"livecliker\"));\n }",
"function HashPassword($clearPW)\n{\n $newPassword = hash('sha256', $clearPW);\n //echo $newPassword;\n return $newPassword;\n}",
"public function getForgotHash() : string {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Sot2 model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new Sot2();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->ID]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
} | [
"public function actionCreate()\n {\n $model = new Svision();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new EtsyShopDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Model();\n $model->setScenario('insert');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['/admin/model']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = $this->getModel('model');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if(Yii::$app->request->post('save-add'))\n return $this->redirect(['create']);\n if(Yii::$app->request->post('save-exit'))\n return $this->redirect(['index']);\n if(Yii::$app->request->post('save-show') && method_exists($model, 'getUrl'))\n return $this->redirect($model->getUrl());\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Objects();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Sms();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new PS();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['/ps']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new BaseStation();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new SolicitudesSeguimiento();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'seguidor_id' => $model->seguidor_id, 'seguido_id' => $model->seguido_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Typzamku();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t\t\treturn $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Saleposmobile();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Servis();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->No_Servis]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Salerecord();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->display_date = (date('Y-m-d'));\n $model->save();\n // return $this->redirect(['view', 'id' => $model->id, 'plant_id' => $model->plant_id, 'customer_id' => $model->customer_id, 'grade_id' => $model->grade_id]);\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Wxshop();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->s_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Osallotment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->os_allotment_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Student();\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()\r\n {\r\n $model = new Seo();\r\n $model->scenario = $model::SCENARIO_CREATE;\r\n $model->status = $model::STATUS_DRAFT;\r\n $model->name = 'no-name';\r\n $model->save();\r\n return $this->redirect(['update', 'id' => $model->id]);\r\n }",
"public function actionCreate()\n {\n $model = new Orders();\n\n if( $model->load(Yii::$app->request->post()) && $model->save() )\n {\n return $this->redirect(['view', 'id' => $model->id]);\n } else\n {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Solicitacao();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Solicitação salva com sucesso.');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get details of the holiday project. | public function getHolidayInfo()
{
if (!isset($this->options['holiday_projects'])) {
return null;
}
if (!isset($this->holidays['total_allocated']) && isset($this->project_table_data)) {
$this->holidays['total_allocated'] = $this->getDataFromCache('holidays_allocated');
}
return $this->holidays;
} | [
"public function ProjectInformation();",
"public static function getProjectInfo($id) {\n\t\t$result = \\DB::table('projects')\n\t\t\t\t\t->where('projects.project_id','=', $id)\n\t\t\t\t\t->join('employees', 'employees.id','=', 'projects.specialist_id')\n\t\t\t\t\t->first();\n\t\treturn $result;\n\t}",
"public function display_project(){\n\t\techo \"<dl>\\n\";\n\t\techo \"<dt>Short name:</dt> <dd>\" . $this->get_short_name() . \"</dd>\\n\";\n\t\techo \"<dt>Full name:</dt> <dd>\" . $this->get_full_name() . \"</dd>\\n\";\n\t\techo \"<dt>Manager:</dt> <dd>\" . $this->get_manager_id() . \"</dd>\\n\";\n\t\techo \"<dt>Start date:</dt> <dd>\" . $this->get_start_date() . \"</dd>\\n\";\n\t\techo \"<dt>End date:</dt> <dd>\" . $this->get_end_date() . \"</dd>\\n\";\n\t\techo \"</dl>\\n\";\n\t}",
"public function getBankHolidayInfo()\n\t{\n\t\tif (!isset($this->options['holiday_projects'])) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!isset($this->bank_holidays['total_allocated']) && isset($this->project_table_data)) {\n\t\t\t$this->bank_holidays['total_allocated'] = $this->getDataFromCache('bank_holidays_allocated');\n\t\t}\n\t\t\n\t\treturn $this->bank_holidays;\n\t}",
"public function getProjects();",
"public function getTaskInfo()\n {global $conf;\n $Company=strpos($conf->global->TIMESHEET_HEADERS, 'Company')!==FALSE;\n $taskParent=strpos($conf->global->TIMESHEET_HEADERS, 'TaskParent')!==FALSE;\n $sql ='SELECT p.rowid,p.datee as pdatee, p.fk_statut as pstatus, p.dateo as pdateo, pt.dateo,pt.datee, pt.planned_workload, pt.duration_effective';\n if($conf->global->TIMESHEET_HIDE_REF==1){\n $sql .= ',p.title as title, pt.label as label,pt.planned_workload';\n if($taskParent)$sql .= ',pt.fk_task_parent,ptp.label as taskParentLabel';\t \t\n }else{\n $sql .= \",CONCAT(p.ref,' - ',p.title) as title\";\n $sql .= \",CONCAT(pt.ref,' - ',pt.label) as label\";\n if($taskParent)$sql .= \",pt.fk_task_parent,CONCAT(ptp.ref,' - ',ptp.label) as taskParentLabel\";\t\n }\n if($Company)$sql .= ',p.fk_soc as companyId,s.nom as companyName';\n\n $sql .=\" FROM \".MAIN_DB_PREFIX.\"projet_task AS pt\";\n $sql .=\" JOIN \".MAIN_DB_PREFIX.\"projet as p\";\n $sql .=\" ON pt.fk_projet=p.rowid\";\n if($taskParent){\n $sql .=\" LEFT JOIN \".MAIN_DB_PREFIX.\"projet_task as ptp\";\n $sql .=\" ON pt.fk_task_parent=ptp.rowid\";\n }\n if($Company){\n $sql .=\" LEFT JOIN \".MAIN_DB_PREFIX.\"societe as s\";\n $sql .=\" ON p.fk_soc=s.rowid\";\n }\n $sql .=\" WHERE pt.rowid ='\".$this->id.\"'\";\n #$sql .= \"WHERE pt.rowid ='1'\";\n dol_syslog(__METHOD__, LOG_DEBUG);\n\n $resql=$this->db->query($sql);\n if ($resql)\n {\n\n if ($this->db->num_rows($resql))\n {\n\n $obj = $this->db->fetch_object($resql);\n\n $this->description\t\t\t= $obj->label;\n $this->fk_project = $obj->rowid;\n $this->ProjectTitle\t\t\t= $obj->title;\n #$this->date_start\t\t\t= strtotime($obj->dateo.' +0 day');\n #$this->date_end\t\t\t= strtotime($obj->datee.' +0 day');\n $this->date_start\t\t\t= $this->db->jdate($obj->dateo);\n $this->date_end\t\t\t= $this->db->jdate($obj->datee);\n $this->duration_effective = $obj->duration_effective;\t\t// total of time spent on this task\n \n $this->planned_workload = $obj->planned_workload;\n $this->startDatePjct=$this->db->jdate($obj->pdateo);\n\t\t\t$this->stopDatePjct=$this->db->jdate($obj->pdatee);\n\t\t\t$this->pStatus=$obj->pstatus;\n \n\t\t\tif($taskParent){\n $this->fk_projet_task_parent = $obj->fk_projet_task_parent;\n $this->taskParentDesc =$obj->taskParentLabel;\n }\n if($Company){\n $this->companyName =$obj->companyName;\n $this->companyId =$obj->companyId;\n }\n }\n $this->db->free($resql);\n\n return 1;\n }\n else\n {\n $this->error=\"Error \".$this->db->lasterror();\n dol_syslog(__METHOD__.$this->error, LOG_ERR);\n\n return -1;\n }\t\n }",
"public function project()\n {\n $project_id = $this->request->getIntegerParam('project_id');\n $start = $this->request->getStringParam('start');\n $end = $this->request->getStringParam('end');\n\n // Common filter\n $filter = $this->taskFilterCalendarFormatter\n ->search($this->userSession->getFilters($project_id))\n ->filterByProject($project_id);\n\n // Tasks\n if ($this->config->get('calendar_project_tasks', 'date_started') === 'date_creation') {\n $events = $filter->copy()->filterByCreationDateRange($start, $end)->setColumns('date_creation', 'date_completed')->format();\n } else {\n $events = $filter->copy()->filterByStartDateRange($start, $end)->setColumns('date_started', 'date_completed')->format();\n }\n\n // Tasks with due date\n $events = array_merge($events, $filter->copy()->filterByDueDateRange($start, $end)->setColumns('date_due')->setFullDay()->format());\n\n $events = $this->hook->merge('controller:calendar:project:events', $events, array(\n 'project_id' => $project_id,\n 'start' => $start,\n 'end' => $end,\n ));\n\n $this->response->json($events);\n }",
"function getInfo()\n\t{\n\t\treturn array(\"ProjectID\"=>$this->ProjectID, \"ClientName\"=>$this->ClientName, \"ProjectName\"=>$this->ProjectName, \"Description\"=>$this->Description);\n\t}",
"function projectdetailbyid($projectid=''){\n\n\n\n\t\tApp::import(\"Model\", \"Project\");\n\n\t\t$this->Project = & new Project();\n\n\n\n\t\t$this->Project->bindModel(array('belongsTo'=>array(\n\n\t\t\t\t'Sponsor'=>array(\n\n\t\t\t\t\t\t'foreignKey'=>false,\n\n\t\t\t\t\t\t'conditions'=>'Sponsor.id = Project.sponsor_id'\n\n\t\t\t\t)\n\n\t\t)));\n\n\n\n\t\t$condition = \"Project.id = '\".$projectid.\"'\";\n\n\t\t$ptdata = $this->Project->find('all',array(\"conditions\"=>$condition));\n\n\n\n\t\tif($ptdata){\n\n\t\t\treturn $ptdata;\n\n\t\t}else{\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}",
"public function getProject()\n\t{\n\t\t$key = $this->getProjectId();\n\n\t\tif(empty($key))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn \\b8\\Store\\Factory::getStore('Project')->getById($key);\n\t}",
"public function read_holiday_information($id) {\r\n\r\n\t\t$sql = 'SELECT * FROM xin_holidays WHERE holiday_id = ? limit 1';\r\n\t\t$binds = array($id);\r\n\t\t$query = $this->db->query($sql, $binds);\r\n\r\n\t\tif ($query->num_rows() > 0) {\r\n\t\t\treturn $query->result();\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public function pia_getHolidays()\n {\n return View::make('politics.holidays');\n }",
"public function getProjectEffort();",
"public function getProjectOtherInformation()\r\n {\r\n return $this->project_other_information;\r\n }",
"public function getProjectDescription(){\n return $this->projectDescription; \n }",
"public function getProjecto()\n {\n return $this->projecto;\n }",
"public function getEmploymentInfo($application_id);",
"private function _getHolidaysData() {\n //returns holidays\n return Yii::app()->db->createCommand()\n ->select('sh.hol_id, loc_id, hol_date')\n ->from('shop_holidays sh, Holidays h')\n ->where('sh.hol_id = h.hol_id')\n ->queryAll();\n }",
"protected function getProject()\r\n {\r\n $projectManager = $this->getService('cerad.project.repository');\r\n $projectParams = $this->getService('cerad_tourn.project');\r\n $projectEntity = $projectManager->findOneBy(array('hash' => $projectParams->getKey()));\r\n return $projectEntity;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register the shortcode with WordPress | public abstract function register_shortcode( $atts, $content = null ); | [
"public function register_shortcode() {\n\t\t\t/**\n\t\t\t * Filters a shortcode name.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t * @param string $this->name Shortcode name.\n\t\t\t */\n\t\t\t$tag = apply_filters( self::$name . '_shortcode_name', self::$name );\n\t\t\tadd_shortcode( $tag, array( $this, 'do_shortcode' ) );\n\n\t\t\t$tag_alternative = apply_filters( self::$name . '_shortcode_name', 'cherry_' . self::$name );\n\t\t\tadd_shortcode( $tag_alternative, array( $this, 'do_shortcode' ) );\n\t\t}",
"function register_shortcodes(){\n add_shortcode('shortcode', 'shortcode_function');\n}",
"function register_shortcodes() { }",
"protected function register_shortcodes() {}",
"function initialize_shortcode() {\n\tif ( ! ( shortcode_exists( shortcode_slug ) ) ) {\n\t\tadd_shortcode( shortcode_slug, __NAMESPACE__ . '\\\\replacement' );\n\t}\n}",
"public function register_shortcode_ui();",
"function shortcode_ui_dev_register_shortcodes() {\n\t// This is a simple example for a pullquote with a citation.\n\tadd_shortcode( 'blockquote', 'shortcake_blockquote_shortcode' );\n\tadd_shortcode( 'accordion', 'shortcake_accordion_shortcode' );\n\tadd_shortcode( 'button', 'shortcake_button_shortcode' );\n\tadd_shortcode( 'loginform', 'shortcake_loginform_shortcode' );\n\tadd_shortcode( 'username', 'tend_username_shortcode' );\n\tadd_shortcode( 'logout', 'tend_logout_shortcode' );\n}",
"public static function init_shortcode() {\n\t\tadd_shortcode( self::shortcode_tag, array( __CLASS__, 'shortcode' ) );\n\t}",
"public function register_shortcode() {\n add_shortcode( 'dynavic-content', array( $this, 'parse_dynavic_content' ) );\n add_filter( 'widget_text', 'do_shortcode' );\n add_filter( 'the_excerpt', 'do_shortcode');\n }",
"public function register_shortcode() {\n\t\tadd_shortcode( 'column', array( &$this, 'do_shortcode' ) );\n\t}",
"function mits_shortcode_resource() {\n\twp_register_script(\"mits-shortcode-script\", plugin_dir_url(__FILE__).\"js/jadwal.js\", array('jquery'));\n\twp_register_style(\"mits-shortcode-style\", plugin_dir_url(__FILE__).\"css/jadwal.css\", array());\n}",
"function bbp_register_shortcodes()\n{\n}",
"public function add_shortcode()\n {\n add_shortcode( 'ref', [ $this, 'shortcode' ] );\n }",
"public static function register_shortcodes() \n {\n $dir = SHORTCODES_DIR;\n \n $codes = array(\n 'gdi_empreendimentos',\n 'blog_feed',\n 'form_simple',\n 'form_multiple',\n 'default_submit',\n 'sistema_qualidade',\n 'address_map',\n 'sistema_qualidade_empre',\n 'morar_ou_alugar',\n 'concepcao',\n 'book_empre',\n 'icon/medidas',\n 'icon/habitacoes',\n 'icon/dark_seal',\n 'icon/gdi',\n );\n\n // Add shortcodes\n foreach($codes as $code) {\n $code_function = str_replace(['/','-'], '_', $code);\n if(file_exists($dir . $code . '.php')) {\n require_once($dir . $code . '.php');\n add_shortcode($code_function, $code_function);\n }\n }\n }",
"function register_short_code(){\n\t\twp_enqueue_style('cp-shortcode',CP_PATH_URL.'/frontend/shortcodes/css/shortcode.css');\n\t}",
"function c4_shortcode_init(){\r\n function c4_short_code(){\r\n echo \"<h2>We are creating a shortcode</h2>\";\r\n}\r\nadd_shortcode('header_tag','c4_short_code');\r\n}",
"public static function example_add_shortcode() {\n add_shortcode( 'ammonite_plugin_scaffold_example_shortcode', array( 'Ammonite_Plugin_Scaffold', 'example_shortcode_callback' ) );\n }",
"public function register_shortcodes() {\n\n\t\tadd_shortcode( 'nowhiring', array( $this, 'list_openings' ) );\n\t\tadd_shortcode( 'nowhiring-howtoapply', array( $this, 'how_to_apply' ) );\n\n\t}",
"function Smart_AddOn_ShortcodeRegister() {\n require_once USAEV_SHORTCODES . 'smart-shortcodes.php';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Elimina un monitor del vendor, realiza funciones curl debido a la inexistencia de un metodo del api que permite eliminar monitores del vendor necesita un usuario y password valido con suficientes permisos para poder realizar la operacion, esta funcion tambien cambia la plantilla del sistema ya que esta opcion solo esta disponible en la plantilla antigua del sistema. | function deleteVendorMonitor($graphIds){
/**
* url de la aplicacion
*/
$urlApp="http://localhost:8060";
/**
* Credenciales
*/
$username='admin';
$password='admin';
$apiKey='37a71eee44cb4f74731a066484cf8628';
/**
* Monitores a eliminar
*/
if(!is_array($graphIds)){
$graphIds=array($graphIds);
}
/**
* Agente para las peticiones
*/
$userAgent="Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36";
/**
* Parametros que enviamos a la pagina de logueo para simular inicio de sesion
*/
$paramsLogin="clienttype=html&isCookieADAuth=&domainName=NULL&authType=localUserLogin"
. "&webstart=&ScreenWidth=1366&ScreenHeight=224"
. "&loginFromCookieData=&userName=$username&password=$password&uname=&apiKey=$apiKey";
try {
/**
* Parametros a usar para iniciar la sesion por CURL
*/
$curl_options[CURLOPT_RETURNTRANSFER] = TRUE;
$curl_options[CURLOPT_USERAGENT] = $userAgent;
$curl_options[CURLOPT_URL] = "$urlApp/jsp/Login.do";
$curl_options[CURLOPT_POST] = 1;
$curl_options[CURLOPT_FOLLOWLOCATION] = 1;
$curl_options[CURLOPT_POSTFIELDS] = $paramsLogin;
$curl_options[CURLOPT_REFERER] = "$urlApp/LoginPage.do";
$curl_options[CURLOPT_COOKIESESSION] = TRUE;
$curl_options[CURLOPT_COOKIEJAR] = 'cookie-name';
$curl_options[CURLOPT_COOKIEFILE] = dirname(__FILE__).'/cookie.tmp';
$curl = curl_init();
curl_setopt_array($curl, $curl_options);
/**
* Depurar la peticion realizada
*/
$fp=fopen(dirname(__FILE__).'/curl.txt','w');
curl_setopt($curl,CURLOPT_VERBOSE,TRUE);
curl_setopt($curl,CURLOPT_STDERR,$fp);
curl_exec($curl);
if(curl_error($curl)){
throw new Exception("Error al autenticar - " . curl_error());
}
/**
* Setea la plantilla del sistema a la antigua para poder usar las pagina de eliminacion de monitores
*/
curl_setopt($curl,CURLOPT_URL,"$urlApp/api/json/admin/updateTheme?apiKey=$apiKey");
curl_setopt($curl,CURLOPT_POST,TRUE);
curl_setopt($curl,CURLOPT_POSTFIELDS,"apiKey=$apiKey&selectedSkin=CreamyBlue");
curl_exec($curl);
if(curl_error($curl)){
throw new Exception("Error al cambiar la plantilla - " . curl_error());
}
curl_setopt($curl,CURLOPT_POST,FALSE);
/**
* Eliminar los monitores deseados
*/
foreach($graphIds as $graphId){
curl_setopt($curl,CURLOPT_URL,"$urlApp/admin/AddDeviceTypeForm.do?operation=delete&graphid=$graphId");
$resp= curl_exec($curl);
if(curl_error($curl)){
throw new Exception("Error al eliminar el monitor:$graphId de la plantilla:$templateId - " . curl_error());
}
}
// echo $resp;
$result=true;
$message='Monitores eliminados satisfactoriamente';
curl_close($curl);
} catch (Exception $exc) {
$result=false;
$message=$exc->getMessage();
}
return array('result'=>$result,'message'=>$message);
} | [
"function delPromo_a($auth,$r){\n// Vista: /promosAdmin/gestion.php\n// Controlador: /promosAdmin/js/controller.promosAdmin.js\n//---------------------------------------------\n// Autenticacion: Requerida como Administrador\n// Objetivo: Eliminar promociones\n\n $cdgo = $r->id_code; //Nombre del codigo promocional recibido en la solicitud\n\n //Se elimina de la base de datos el codigo solicitado\n $cmd = \"DELETE FROM promocodes WHERE cdgo = '$cdgo'\";\n $code = executeSQL($cmd);\n\n if ($code === response_ok) {\n //Se elimina listado de clientes enlazados a la promocion eliminada\n $cmd = \"DELETE FROM assignm WHERE id_code = '$cdgo'\";\n $code = executeSQL($cmd);\n }\n\n $response = array();\n SendResponse($code,$response); //Se envia respuesta del servidor\n}",
"public function removeOfficerAdmin()\n {\n // TODO removeOfficerAdmin\n // Your code here\n\n http_response_code(200);\n echo json_encode(array(\n 'message' => 'API is not depressed'\n ));\n }",
"public function eliminar_producto_controlador(){\n\n /*-- Comprobando privilegios - Checking privileges --*/\n\t\t\tif($_SESSION['cargo_sto']!=\"Administrador\" && $_SESSION['cargo_sto']!=\"Usuario\"){\n $alerta=[\n \"Alerta\"=>\"simple\",\n \"Titulo\"=>\"Acceso no permitido\",\n \"Texto\"=>\"No tienes los permisos necesarios para realizar esta operación en el sistema\",\n \"Icon\"=>\"error\",\n \"TxtBtn\"=>\"Aceptar\"\n ];\n\t\t\t\techo json_encode($alerta);\n\t\t\t\texit();\n\t\t\t}\n\n /*-- Recuperando id del producto - Retrieving client id - --*/\n\t\t\t$id=mainModel::decryption($_POST['producto_id_del']);\n\t\t\t$id=mainModel::limpiar_cadena($id);\n\n\n /*-- Comprobando producto en la BD - Checking client in DB --*/\n\t\t\t$check_producto=mainModel::ejecutar_consulta_simple(\"SELECT producto_id FROM producto WHERE producto_id='$id'\");\n\t\t\tif($check_producto->rowCount()<=0){\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alerta\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"producto no encontrado\",\n\t\t\t\t\t\"Texto\"=>\"El producto que intenta eliminar no existe en el sistema\",\n \"Icon\"=>\"error\",\n \"TxtBtn\"=>\"Aceptar\"\n\t\t\t\t];\n\t\t\t\techo json_encode($alerta);\n\t\t\t\texit();\n\t\t\t}\n\t\t\t$check_producto->closeCursor();\n\t\t\t$check_producto=mainModel::desconectar($check_producto);\n\n /*-- Eliminando producto - Deleting client --*/\n\t\t\t$eliminar_producto=mainModel::eliminar_registro(\"producto\",\"producto_id\",$id);\n\n\t\t\tif($eliminar_producto->rowCount()==1){\n\t\t\t\t$alerta=[\n \"Alerta\"=>\"recargar\",\n \"Titulo\"=>\"¡producto eliminado!\",\n \"Texto\"=>\"El producto ha sido eliminado del sistema exitosamente\",\n \"Icon\"=>\"success\",\n \"TxtBtn\"=>\"Aceptar\"\n ];\n\t\t\t}else{\n\t\t\t\t$alerta=[\n \"Alerta\"=>\"simple\",\n \"Titulo\"=>\"Ocurrió un error inesperado\",\n \"Texto\"=>\"No hemos podido eliminar el producto del sistema, por favor intente nuevamente\",\n \"Icon\"=>\"error\",\n \"TxtBtn\"=>\"Aceptar\"\n ];\n\t\t\t}\n\n\t\t\t$eliminar_producto->closeCursor();\n\t\t\t$eliminar_producto=mainModel::desconectar($eliminar_producto);\n\n\t\t\techo json_encode($alerta);\n }",
"private function unregisterRemoteMiner() {\n $url = $this->getRemoteMinerUrl().\"/miners/\".$this->getRemoteMinerId();\n\n $curlRequest=self::prepareNewCurlRequest($url);\n $response=$curlRequest->delete();\n\n return $this->parseResponse($response, \"Miner unregistered/removed.\");\n }",
"public function desactivarSonidoContraparte() {\n\n self::$mesaMezclas->apagar(MesaMezclas::$CANAL1,\"videoconferencia\");\n\n }",
"public function deletedevicereg(Request $request){ \n $tray = $request->tray;\n $traycount = $request->traycount; \n /* return $tray; */\n if($traycount > 0){\n DB::connection($this->mysql)->table('tbl_deviceregistration')->wherein('id',$tray)->delete(); \n } \n return $this->displaydevreg();\n }",
"function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}",
"function eliminarAsignacion()\n {\n\n $id_servidor_software = $this->input->get('id_servidor_software');\n $delete = $this->Mantenedor_model->eliminarAsignacion($id_servidor_software);\n }",
"function runDeshabilitar() {\r\n\r\n $_respuesta = array('Codigo' => 0, \"Mensaje\" => $this->MensajeActualizacion);\r\n\r\n $ID_USUARIO = $this->_usuario['IDUSUARIO'];\r\n $FECHA = 'SYSDATE';\r\n\r\n try {\r\n\r\n $sql = <<<OE\r\n DELETE {$this->Table} WHERE {$this->PrimaryKey} = {$this->_datos}\r\nOE;\r\n\r\n $this->Consulta($sql);\r\n } catch (Exception $e) {\r\n $_respuesta = array('Codigo' => 99, \"Mensaje\" => $e->getMessage());\r\n }\r\n print_r(json_encode($_respuesta));\r\n }",
"public function uninstall()\n {\n //check if visitor has administrator privilleges\n if($this->pluginaizer->session->is_admin()){\n //delete plugin config and remove plugin data\n $this->pluginaizer->delete_config()->remove_plugin();\n //check for errors\n if(count($this->pluginaizer->error) > 0){\n echo $this->pluginaizer->jsone(['error' => $this->pluginaizer->error]);\n }\n echo $this->pluginaizer->jsone(['success' => 'Plugin uninstalled successfully']);\n } else{\n echo $this->pluginaizer->jsone(['error' => 'Please login first!']);\n }\n }",
"public function deleteDevice(){\n }",
"public function eliminar_venta_controlador(){\r\n\r\n /*== Recuperando codigo de venta ==*/\r\n\t\t\t$codigo=mainModel::decryption($_POST['venta_codigo_del']);\r\n $codigo=mainModel::limpiar_cadena($codigo);\r\n \r\n /*== Comprobando venta en la BD ==*/\r\n\t\t\t$check_venta=mainModel::ejecutar_consulta_simple(\"SELECT venta_id FROM venta WHERE venta_codigo='$codigo'\");\r\n\t\t\tif($check_venta->rowCount()<=0){\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"La venta que intenta eliminar no existe en el sistema.\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t\techo json_encode($alerta);\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\t\t\t$check_venta->closeCursor();\r\n $check_venta=mainModel::desconectar($check_venta);\r\n \r\n /*== Comprobando privilegios ==*/\r\n\t\t\tsession_start(['name'=>'SVI']);\r\n\t\t\tif($_SESSION['cargo_svi']!=\"Administrador\"){\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"No tienes los permisos necesarios para realizar esta operación en el sistema.\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t\techo json_encode($alerta);\r\n\t\t\t\texit();\r\n }\r\n\r\n /*== Eliminado pagos ==*/\r\n $check_pago=mainModel::ejecutar_consulta_simple(\"SELECT * FROM pago WHERE venta_codigo='$codigo'\");\r\n\t\t\tif($check_pago->rowCount() >= 1){\r\n $eliminar_pago=mainModel::eliminar_registro(\"pago\",\"venta_codigo\",$codigo);\r\n if($eliminar_pago->rowCount()<=0){\r\n $alerta=[\r\n \"Alerta\"=>\"simple\",\r\n \"Titulo\"=>\"Ocurrió un error inesperado\",\r\n \"Texto\"=>\"No hemos podido eliminar los pagos asociados a esta venta, no podemos continuar. Por favor intente nuevamente..\",\r\n \"Tipo\"=>\"error\"\r\n ];\r\n echo json_encode($alerta);\r\n exit();\r\n }\r\n $eliminar_pago->closeCursor();\r\n $eliminar_pago=mainModel::desconectar($eliminar_pago);\r\n }\r\n \r\n /*== Eliminado venta ==*/\r\n $eliminar_venta=mainModel::eliminar_registro(\"venta\",\"venta_codigo\",$codigo);\r\n\t\t\tif($eliminar_venta->rowCount()==1){\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"recargar\",\r\n\t\t\t\t\t\"Titulo\"=>\"¡Venta eliminada!\",\r\n\t\t\t\t\t\"Texto\"=>\"La venta ha sido eliminada del sistema exitosamente.\",\r\n\t\t\t\t\t\"Tipo\"=>\"success\"\r\n\t\t\t\t];\r\n\t\t\t}else{\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"No hemos podido eliminar la venta del sistema, por favor intente nuevamente.\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t}\r\n\r\n\t\t\t$eliminar_venta->closeCursor();\r\n\t\t\t$eliminar_venta=mainModel::desconectar($eliminar_venta);\r\n\t\t\techo json_encode($alerta);\r\n }",
"function remove_data()\n{\n\trequire('unidress_narola_uninstall.php');\n}",
"function _password_changer_api_remove_system($module_name) {\r\n \r\n //Get persistent variable\r\n $register_modules = (array) variable_get('password_changer_api_register_modules', array());\r\n \r\n //Unregistered the angel module\r\n if (!empty($register_modules)) {\r\n //Log Uninstall to watchdog\r\n watchdog('[password_changer_api_inc][remove_system function] ',\r\n 'Uninstall module %module_name', array('%module_name' => $module_name), WATCHDOG_ERROR);\r\n //Remove from array\r\n unset($register_modules[$module_name]);\r\n //Save to Drupal persistent variable\r\n variable_set('password_changer_api_register_modules', $register_modules);\r\n } \r\n}",
"private function CRUDExecuterUsbDelete() {\n\t\tif ((isset($_POST['uuidNotModified']) && ($_POST['uuidNotModified'] === '0' || !empty($_POST['uuidNotModified'])))) {\n\t\t\t$uuidNotModified = htmlspecialchars(($_POST['uuidNotModified']));\n\n\t\t\tif ($this->_usbManager->getOneUsb($uuidNotModified)) {\n\t\t\t\t$this->_usbManager->deleteOneUsb($uuidNotModified);\n\n\t\t\t\t$this->_informationMessageOthers = 'The USB has been correctly deleted';\n\t\t\t} else {\n\t\t\t\t$this->_errorMessageOthers = 'An error has occurred';\n\t\t\t\t$this->CRUDRouter('usbs');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_errorMessageOthers = 'An error has occurred';\n\t\t\t$this->CRUDRouter('usbs');\n\t\t}\n\t}",
"public function removeDiamondFileMaster()\n {\n $keys = array(\"tenent_id\",\"entity_id\",\"dm_id\");\n\n $data = check_api_keys($keys,$this->mydata);\n // $upData = \n $res = $this->common->updateData(['dm_status' => 1],'diamond_upload_file_master',\"dm_tenent_id = '{$data['tenent_id']}' AND dm_entity_id = '{$data['entity_id']}' AND dm_id = '{$data['dm_id']}'\");\n\n if($res)\n respond_success_to_api(\"success\");\n else \n respond_error_to_api(\"error\", \"Opss! Someting wentwrong. Please try after sometime.\");\n }",
"public function eliminarAdministradorControlador()\n\t\t{\n\t\t\t$codigo = modeloPrincipal::desencriptar($_POST['codigo-del']);\n\t\t\t$adminPrivilegio = modeloPrincipal::desencriptar($_POST['privilegio-admin']);\n\n\t\t\t$codigo = modeloPrincipal::limpiarCadena($codigo);\n\t\t\t$adminPrivilegio = modeloPrincipal::limpiarCadena($adminPrivilegio);\n\n\n\t\t\tif ($adminPrivilegio==1) {\n\t\t\t\t$consultaAdmin = modeloPrincipal::ejecutarConsultaSimpleSQL(\"SELECT id FROM admin WHERE CuentaCodigo='$codigo'\");\n\n\t\t\t\t$datosAdmin = $consultaAdmin->fetch();\n\n\t\t\t\tif ($datosAdmin['id']!=1) {\n\t\t\t\t\t$eliminarAdmin = administradorModelo::eliminarAdministradorModelo($codigo);\n\n\t\t\t\t\tmodeloPrincipal::eliminarBitacora($codigo);\n\n\t\t\t\t\tif ($eliminarAdmin->rowCount()>=1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$eliminarUsuario = modeloPrincipal::eliminarCuenta($codigo);\n\n\t\t\t\t\t\tif ($eliminarUsuario->rowCount()==1) {\n\t\t\t\t\t\t\t$alerta = [\n\t\t\t\t\t\t\t\t\"Alerta\" => \"recargar\",\n\t\t\t\t\t\t\t\t\"Titulo\" => \"Éxito\",\n\t\t\t\t\t\t\t\t\"Texto\" => \"El administrador fue eliminado correctamente del sistema\",\n\t\t\t\t\t\t\t\t\"Tipo\" => \"success\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$alerta = [\n\t\t\t\t\t\t\t\t\"Alerta\" => \"simple\",\n\t\t\t\t\t\t\t\t\"Titulo\" => \"Error\",\n\t\t\t\t\t\t\t\t\"Texto\" => \"No se elimino la Cuenta del Administrador. Intentelo mas tarde\",\n\t\t\t\t\t\t\t\t\"Tipo\" => \"error\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$alerta = [\n\t\t\t\t\t\t\t\"Alerta\" => \"simple\",\n\t\t\t\t\t\t\t\"Titulo\" => \"Error\",\n\t\t\t\t\t\t\t\"Texto\" => \"No se elimino el Administrador. Intentelo mas tarde\",\n\t\t\t\t\t\t\t\"Tipo\" => \"error\"\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\n\t\t\t\t} else {\n\t\t\t\t\t$alerta = [\n\t\t\t\t\t\t\"Alerta\" => \"simple\",\n\t\t\t\t\t\t\"Titulo\" => \"Error\",\n\t\t\t\t\t\t\"Texto\" => \"No se puede eliminar el SUPER Administrador\",\n\t\t\t\t\t\t\"Tipo\" => \"error\"\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t} else {\n\t\t\t\t$alerta = [\n\t\t\t\t\t\t\"Alerta\" => \"simple\",\n\t\t\t\t\t\t\"Titulo\" => \"Error\",\n\t\t\t\t\t\t\"Texto\" => \"No tienes los permisos necesarios\",\n\t\t\t\t\t\t\"Tipo\" => \"error\"\n\t\t\t\t\t];\n\t\t\t}\n\n\n\t\t\treturn modeloPrincipal::mostrarAlerta($alerta);\n\t\t\t\n\n\t\t}",
"function eliminar_paquete_unico() {\n $idPaquete = $_REQUEST[\"idpaquete\"];\n $observacion_eliminar = $_REQUEST[\"observacionEliminar\"];\n $resultado_paquete = $this->paquete_model->id_paquete($idPaquete);\n $resultado_paquete->observaciones=$observacion_eliminar;\n $this->paquete_model->crear_paquete_eliminado($resultado_paquete);\n $id_pxp = $resultado_paquete->id_pxp;\n $id_sede = $resultado_paquete->id_sede;\n $this->paquete_model->eliminar_paquete($id_pxp,$id_sede);\n $this->paquete_model->eliminar_sesiones_x_paquete($id_pxp,$id_sede);\n echo \"OK\";\n }",
"public function remove()\n {\n secupay_log($this->sp_log, \"remove\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN ('\" . implode(\n \"', '\",\n $this->keys()\n ) . \"','MODULE_PAYMENT_SECUPAY_SK_XTC_ALLOWED') AND configuration_key NOT IN ('MODULE_PAYMENT_SECUPAY_APIKEY','MODULE_PAYMENT_SECUPAY_EXPERIENCE','MODULE_PAYMENT_SECUPAY_TAUTOSEND','MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT','MODULE_PAYMENT_SECUPAY_SESSION')\");\n\n //check for other secupay payment module\n $qry = xtc_db_query(\"SELECT * FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key LIKE 'MODULE_PAYMENT_SP%_SORT_ORDER';\");\n\n if (xtc_db_num_rows($qry) == 0) {\n //no other secupay payment module installed, remove apikey\n secupay_log($this->sp_log, \"remove apikey\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_APIKEY'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_TAUTOSEND'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_EXPERIENCE'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_SESSION'\");\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the form key associated with this builder. | public function getFormKey() {
return $this->formKey;
} | [
"public function getFormKey()\n {\n return $this->formKey->getFormKey();\n }",
"public function getFormKey()\n {\n if (!$this->isPresent()) {\n $this->set($this->mathRandom->getRandomString(16));\n }\n return $this->escaper->escapeHtmlAttr($this->session->getData(self::FORM_KEY));\n }",
"public function getFormKey () {\n\t\t\treturn Mage::getSingleton (\"core/session\")->getFormKey ();\n\t\t}",
"public function getFormKey()\n {\n return Mage::getSingleton('core/session')->getFormKey();\n }",
"public function getFormKey()\r\n {\r\n return Mage::getSingleton('core/session')->getFormKey();\r\n }",
"public function getFormkey()\n {\n // generate the key and store it inside the class\n $this->formkey = $this->generateFormkey();\n // store the form key in the session\n $_SESSION['formkey'] = $this->formkey;\n // output the form key\n return \"<input type='hidden' name='formkey' value='\" . $this->formkey . \"' />\";\n }",
"public function getCookieFormKey()\n {\n return Mage::getSingleton('core/cookie')->get(self::FORMKEY_COOKIE);\n }",
"public function getFormId(): string\n {\n return $this->formId;\n }",
"public function formGetSessionKey()\n {\n return $this->formWidget->getSessionKey();\n }",
"public function getKeyName()\n {\n if (is_null($this->form)) {\n return;\n }\n\n return $this->relationKeyName;\n }",
"public function getFormId();",
"public function get_field_key() {\n\t\treturn $this->get_field_attr( 'field_key' );\n\t}",
"public function getSelectionFormKey();",
"public function getFormId()\n {\n return $this->strFormId;\n }",
"protected function get_form_identifier() {\n $formid = $this->_customdata->id.'_'.get_class($this);\n return $formid;\n }",
"protected function getViewKey()\n {\n $viewData = $this->getController()->getViewData();\n $key = $viewData->offsetGet('main_view_key');\n\n if (empty($key)) {\n $key = 'formwrap';\n }\n\n return $key;\n }",
"public function getId() {\n return $this->formId;\n }",
"public function getFormId() {\n $form_id = 'my_entity_bundle_add_form';\n return $form_id;\n }",
"public function getKey(): string\n {\n if ($this->key) {\n return $this->key;\n }\n\n if ($this->config->has('key')) {\n $key = Key::validate($this->config->get('key'), 'layout');\n\n $this->key = $key;\n\n return $this->key;\n }\n\n $this->key = sprintf(\n '%s_%s',\n $this->parentKey,\n Key::sanitize($this->config->get('name'))\n );\n\n return $this->key;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The ad group simulation referenced in the query. Generated from protobuf field .google.ads.googleads.v13.resources.AdGroupSimulation ad_group_simulation = 107; | public function getAdGroupSimulation()
{
return $this->ad_group_simulation;
} | [
"public function setAdGroupSimulation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V13\\Resources\\AdGroupSimulation::class);\n $this->ad_group_simulation = $var;\n\n return $this;\n }",
"public function setAdGroupSimulation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V2\\Resources\\AdGroupSimulation::class);\n $this->ad_group_simulation = $var;\n\n return $this;\n }",
"public function setAdGroupCriterionSimulation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V1\\Resources\\AdGroupCriterionSimulation::class);\n $this->ad_group_criterion_simulation = $var;\n\n return $this;\n }",
"public function getAdGroupCriterionSimulation()\n {\n return $this->ad_group_criterion_simulation;\n }",
"public function getCampaignSimulation()\n {\n return $this->campaign_simulation;\n }",
"public function filterBySimulation($simulation, $comparison = Criteria::EQUAL)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(GroupPeer::ID_SIMULATION, $simulation->getId(), $comparison);\n\t}",
"public function setCampaignCriterionSimulation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V2\\Resources\\CampaignCriterionSimulation::class);\n $this->campaign_criterion_simulation = $var;\n\n return $this;\n }",
"public function setCampaignCriterionSimulation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V1\\Resources\\CampaignCriterionSimulation::class);\n $this->campaign_criterion_simulation = $var;\n\n return $this;\n }",
"public function getCampaignCriterionSimulation()\n {\n return $this->campaign_criterion_simulation;\n }",
"public function setBiddingStrategySimulation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V13\\Resources\\BiddingStrategySimulation::class);\n $this->bidding_strategy_simulation = $var;\n\n return $this;\n }",
"public function getAdGroup()\n {\n return $this->ad_group;\n }",
"public function getAdGroupAd()\n {\n return $this->ad_group_ad;\n }",
"public function simulation()\n {\n return $this->hasOne(Simulation::class);\n }",
"public function getAdGroup()\n {\n return isset($this->ad_group) ? $this->ad_group : '';\n }",
"public function getBiddingStrategySimulation()\n {\n return $this->bidding_strategy_simulation;\n }",
"public function getAdGroupAdOperation()\n {\n return $this->readOneof(1);\n }",
"public function getAdGroupAsset()\n {\n return $this->ad_group_asset;\n }",
"public function getSimulationResults()\n {\n return $this->simulationResults;\n }",
"public function setAdGroupAd($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V13\\Resources\\AdGroupAd::class);\n $this->ad_group_ad = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
///////////////////////// GETTERS ///////////////////////////////// ///////////////////////// SETTERS ///////////////////////////////// Set the consumer token object | public function setConsumer( $token )
{
$this->consumer = $token;
return $this;
} | [
"private function _setConsumerToken()\n {\n // Url encode the consumer_key and consumer_secret in accordance with RFC 1738\n $encoded_consumer_key = urlencode($this->_consumer_key);\n $encoded_consumer_secret = urlencode($this->_consumer_secret);\n\n $this->_consumer_token = base64_encode($encoded_consumer_key .':'. $encoded_consumer_secret);\n }",
"private function setToken()\r\n {\r\n $this->token = $this->response->data->sl_token;\r\n\r\n $this->setTokenExpiryDate();\r\n }",
"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}",
"abstract function new_request_token($consumer);",
"public function setToken();",
"function new_request_token($consumer) {\n }",
"public function setaccess_token($value);",
"public function setupToken() {\n $this->value = $this->token;\n }",
"public function setConsumerKey($consumer_key);",
"public function setConsumerSecret($consumer_secret);",
"public function setToken($token, $token_secret)\n {\n }",
"public function setToken($token);",
"public function setAuthToken()\n {\n $this->authtoken = $this->getAccessTokenByRefreshToken();\n }",
"public function setToken($token, $token_secret = null) {\n\n parent::setToken($token,$token_secret);\n $this->OAuth->setToken($this->oauth_token, $this->oauth_token_secret);\n\n }",
"public function setToken($token, $token_secret = null) \n {\n if (is_array($token)) {\n $this->oauthToken = $token['token'];\n $this->oauthTokenSecret = $token['token_secret'];\n } else {\n $this->oauthToken = $token;\n $this->oauthTokenSecret = $token_secret;\n }\n\n }",
"function setToken($token){\n\t\t\\Clever::setToken(($this->token = $token));\n\t}",
"public function setSecurityToken($token);",
"public function testSetOauthTokenSetsOauthToken()\n {\n $this->class->set_oauth_token('token');\n\n $this->assertPropertyEquals('oauth_token', 'token');\n }",
"public function setOAuthToken($value)\n {\n return $this->set('OAuthToken', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a publication is linked to an entry_id in the cazy database. If it is not the case put the link to add it | function check_entry_id_link_document_id($dico_entry_id_prot_access, $document_id, $pmid, $manager_cazy)
{
$check_pmid = [];
foreach($dico_entry_id_prot_access as $entry_id => $array_prot_access)
{
$request_annot_id = $manager_cazy->pdo->prepare("SELECT annot_id FROM annotation WHERE entry_id = $entry_id");
$request_annot_id->execute();
$annot_id = $request_annot_id->fetch();
$annot_id = $annot_id['annot_id'];
$request_entry_id_link_doc_id = $manager_cazy->pdo->prepare("SELECT entry_id FROM annotation INNER JOIN pub_annot ON annotation.annot_id = pub_annot.annot_id WHERE document_id = '$document_id' AND entry_id = $entry_id");
//var_dump($request_entry_id_link_doc_id);
$request_entry_id_link_doc_id-> execute();
$check_doc_id_link = $request_entry_id_link_doc_id->fetch();
$add_article = '<a href="http://10.1.22.212/privatesite/add_pubmed.cgi?entry_id=' . $entry_id . '&id=' . $pmid . '&annotid=' . $annot_id . '" target="_blank">ADD_article</a>';
if(!empty($check_doc_id_link))
{
$check_pmid[$entry_id] = '<font color="green">OK</font>';
}
else
{
$check_pmid[$entry_id] = $add_article;
}
}
return $check_pmid;
} | [
"function add_www( $entry, $post_id = null ) {\r\n if( !empty( $entry['title'] ) &&\r\n !empty( $entry['url'] )\r\n ) {\r\n $item['type'] = 'misc';\r\n $item['title'] = $entry['title'];\r\n $item['url'] = $entry['url'];\r\n \r\n // add to global database\r\n if( $post_id == null )\r\n return $this->add_bib( $item );\r\n elseif( $this->add_bib( $item, true, $post_id ) ) { // add to post_id\r\n $this->add_bib( $item ); // also try to add it to global database\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"function inPublication($id){\r\n global $db;\r\n $inPulication = $db->prepare('SELECT * FROM publications WHERE id = ?');\r\n $inPulication->execute(array($id));\r\n $publication = $inPulication->fetch();\r\n if(intval($publication['target']) != 0){\r\n return '<span class=\"flux-black\"><a href=\"https://kamevo.com/page/?group='.$publication['target'].'\" class=\"flux-black\"><i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"></i> '.utf8_encode(getGroupInfos($publication['target'], 'name')).'</a></span>';\r\n }else{\r\n return '';\r\n }\r\n }",
"public function addShared(string $id, $entry): Entry;",
"function sf_publish_blog_link($postid)\n{\n\tglobal $wpdb;\n\ninclude_once(SF_PLUGIN_DIR.'/sf-slugs.php');\n\n\tif(isset($_POST['sflink']))\n\t{\n\t\trequire_once('forum/sf-links.php');\n\n\t\t# sadly need to check if both items already set (forum @ topic)\n\t\t$checkrow = sf_blog_links_postmeta('read', $postid, '');\n\t\tif(($checkrow) && (strpos($checkrow->meta_value, '@')))\n\t\t{\n\t\t\t# already cooked\n\t\t\treturn;\n\t\t} else {\n\t\t\t# first - get the post content\n\t\t\t$content = $wpdb->get_row(\"SELECT post_content, post_title, post_author, post_status FROM \".$wpdb->prefix.\"posts WHERE ID = \".$postid.\";\");\n\t\t\t$post_title = apply_filters('sf_save_topic_title', $content->post_title);\n\t\t\t$post_title = $wpdb->escape($post_title);\n\t\t\t$slug = sf_create_slug($post_title, 'topic');\n\n\t\t\t# now create the topic and post records - it should already be escaped fully.\n\t\t\t$sql = \"INSERT INTO \".SFTOPICS.\" (topic_name, topic_slug, topic_date, forum_id, user_id, post_count, blog_post_id, post_id) VALUES ('\".$post_title.\"', '\".$slug.\"', now(), \".$_POST['sfforum'].\", \".$content->post_author.\", 1, \".$postid.\", \".$postid.\");\";\n\t\t\t$wpdb->query($sql);\n\n\t\t\t$topicid = $wpdb->insert_id;\n\n\t\t\t# check the topic slug and if empty use the topic id\n\t\t\tif(empty($slug))\n\t\t\t{\n\t\t\t\t$slug = 'topic-'.$topicid;\n\t\t\t\t$thistopic = $wpdb->query(\"\n\t\t\t\t\tUPDATE \".SFTOPICS.\"\n\t\t\t\t\tSET topic_slug='\".$slug.\"', topic_name='\".$slug.\"'\n\t\t\t\t\tWHERE topic_id=\".$topicid);\n\t\t\t}\n\n\t\t\t# Full content or excerpt?\n\t\t\t$postcontent = sf_make_excerpt($postid, $content->post_content);\n\t\t\t$postcontent = $wpdb->escape($postcontent);\n\n\t\t\t$sql = \"INSERT INTO \".SFPOSTS.\" (post_content, post_date, topic_id, user_id, forum_id) VALUES ('\".$postcontent.\"', now(), \".$topicid.\", \".$content->post_author.\", \".$_POST['sfforum'].\");\";\n\t\t\t$wpdb->query($sql);\n\n\t\t\t# and then update postmeta with forum AND topic\n\t\t\t$text = $_POST['sfforum'].\"@\".$topicid;\n\t\t\tsf_blog_links_postmeta('save', $postid, $text);\n\n\t\t\t# Update authors forum post count\n\t\t\t$postcount = (sf_get_member_item($content->post_author, 'posts')+1);\n\t\t\tsf_update_member_item($content->post_author, 'posts', $postcount);\n\n\t\t\t# Update forum, topic and post index data\n\t\t\tsf_build_forum_index($_POST['sfforum']);\n\t\t\tsf_build_post_index($topicid, $slug);\n\t\t}\n\t}\n\treturn;\n}",
"function eatlas_search_menu_link_insert($link) {\n\t// bid => Point to the book\n\t// original_bid => Value of 0 - should not be used\n\t// link_path => Point to the book page - may be used as a fallback\n\t_eatlas_search_menu_link_modified($link);\n}",
"function addEntry($entry) {\n if (!$entry->hasField('key')) {\n throw new Exception('error: a bibliographic entry must have a key '.$entry->getText());\n }\n // we keep its insertion order\n $entry->order = count($this->bibdb);\n $this->bibdb[$entry->getKey()] = $entry;\n }",
"function independent_publisher_single_author_link( $link, $author_id, $author_nicename ) {\n\treturn $link;\n}",
"public function link($pks, $mediaId = null)\n\t{\n\t\t// Initialise variables.\n $db = JFactory::getDbo();\n\t\t$user = JFactory::getUser();\n $date = JFactory::getDate(); \n\n // Load HWD authorise library.\n hwdMediaShareFactory::load('authorise');\n $HWDauthorise = hwdMediaShareAuthorise::getInstance();\n \n\t\t$table = $this->getTable(); \n\n\t\t// Sanitize the ids.\n\t\t$pks = (array) $pks;\n\t\tJArrayHelper::toInteger($pks);\n\n\t\t// Iterate through the items to process each one.\n\t\tforeach ($pks as $i => $pk)\n\t\t{\n\t\t\t$table->reset();\n\n if (!$HWDauthorise->authoriseAlbumAction('link', $pk, $mediaId))\n {\n // Prune items that you can't change.\n unset($pks[$i]);\n $error = $this->getError();\n\n if ($error)\n {\n JLog::add($error, JLog::WARNING, 'jerror');\n return false;\n }\n else\n {\n JLog::add(JText::_('COM_HWDMS_ERROR_ACTION_NOT_PERMITTED'), JLog::WARNING, 'jerror');\n return false;\n }\n }\n \n // Check if association already exists.\n $db = JFactory::getDbo();\n $query = $db->getQuery(true)->select('id')->from('#__hwdms_album_map')\n ->where($db->quoteName('album_id') . ' = ' . $db->quote($pk))\n ->where($db->quoteName('media_id') . ' = ' . $db->quote($mediaId));\n $db->setQuery($query);\n $exists = $db->loadResult();\n\n // Create an object to bind to the database.\n if (!$exists)\n {\n $object = new StdClass;\n $object->id = '';\n $object->album_id = (int) $pk;\n $object->media_id = (int) $mediaId;\n $object->created_user_id = (int) $user->id;\n $object->created = $date->toSql();\n\n // Attempt to save the data.\n if (!$table->save($object))\n {\n $this->setError($table->getError());\n return false;\n }\n } \n\t\t}\n\n\t\t// Clear the component's cache.\n\t\t$this->cleanCache();\n\n\t\treturn true;\n\t}",
"function wsu_redirect_publication_id() {\n\t/* @var WPDB $wpdb */\n\tglobal $wpdb;\n\n\tif ( ! isset( $_SERVER['HTTP_HOST'] ) ) {\n\t\treturn;\n\t}\n\n //pattern: \n //http://news.wsu.edu/pages/publications.asp?Action=Detail&PublicationID=36331&TypeID=1\n\tif ( isset( $_GET['PublicationID'] ) && isset( $_GET['Action'] ) && 'Detail' === $_GET['Action'] && 0 !== absint( $_GET['PublicationID'] ) ) {\n\t\t$publication_id = absint( $_GET['PublicationID'] );\n\t\t$post_id = $wpdb->get_var( $wpdb->prepare( \"SELECT post_id FROM wp_postmeta WHERE meta_key = '_publication_id' AND meta_value = %s\", $publication_id ) );\n\t\tif ( 0 !== absint( $post_id ) ) {\n\t\t\twp_safe_redirect( get_permalink( $post_id ), 301 );\n\t\t\texit;\n\t\t}\n\t}\n\n //pattern: \n //http://news.wsu.edu/articles/36828/1/New-cyber-security-firm-protects-Seattle-businesses\n $actual_link = \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n \n\tif ( strpos( $actual_link,'/articles/')>-1 ) {\n $urlparts = explode('/',$actual_link);\n\t\t$publication_id = absint( $urlparts[4] );\n\t\t$post_id = $wpdb->get_var( $wpdb->prepare( \"SELECT post_id FROM wp_postmeta WHERE meta_key = '_publication_id' AND meta_value = %s\", $publication_id ) );\n\t\tif ( 0 !== absint( $post_id ) ) {\n\t\t\twp_safe_redirect( get_permalink( $post_id ), 301 );\n\t\t\texit;\n\t\t}\n\t} \n\n\treturn;\n}",
"function bust_canonical_post_id_lookup_on_add( $mid, $object_id, $meta_key, $meta_value ) {\n\n\tif ( 'ea-syncable-import-src-id-canonical' !== $meta_key ) {\n\t\treturn;\n\t}\n\n\twp_cache_delete( absint( $meta_value ), 'ea-canonical-id-lookup-post' );\n}",
"function add_book( $entry, $post_id = null ) {\r\n if( isset( $entry['title'] ) && $entry['title'] != '' ) {\r\n $api = new BPSP_Bibliography_WebApis( array( 'worldcat' => $this->worldcat_key ) );\r\n $item = $api->worldcat_opensearch( $entry['title'] );\r\n if( !empty( $item ) ) {\r\n $item[0]['type'] = 'book';\r\n if( !empty( $entry['desc'] ) )\r\n $item[0]['desc'] = $entry['desc'];\r\n \r\n // add to global database\r\n if( $post_id == null )\r\n return $this->add_bib( $item[0] );\r\n elseif( $this->add_bib( $item[0], true, $post_id ) ) { // add to post_id\r\n $this->add_bib( $item[0] ); // also try to add it to global database\r\n return true;\r\n }\r\n }\r\n } elseif ( isset( $entry['isbn'] ) && $entry['isbn'] != '' ) {\r\n $api = new BPSP_Bibliography_WebApis( array( 'isbndb' => $this->isbndb_key ) );\r\n $item = $api->isbndb_query( $entry['isbn'] );\r\n if( !empty( $item ) ) {\r\n $item[0]['type'] = 'book';\r\n if( !empty( $entry['desc'] ) )\r\n $item[0]['desc'] = $entry['desc'];\r\n \r\n // add to global database\r\n if( $post_id == null )\r\n return $this->add_bib( $item[0] );\r\n elseif( $this->add_bib( $item[0], true, $post_id ) ) { // add to post_id\r\n $this->add_bib( $item[0] ); // also try to add it to global database\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }",
"function serendipity_insertPermalink(&$data, $type = 'entry') {\n global $serendipity;\n\n $link = serendipity_getPermalink($data, $type);\n\n switch($type) {\n case 'entry':\n $idfield = 'id';\n break;\n\n case 'author':\n $idfield = 'authorid';\n break;\n\n case 'category':\n $idfield = 'categoryid';\n break;\n }\n\n return(serendipity_db_query(sprintf(\"INSERT INTO {$serendipity['dbPrefix']}permalinks\n (permalink, entry_id, type)\n VALUES ('%s', '%s', '%s')\",\n\n serendipity_db_escape_string($link),\n (int)$data[$idfield],\n serendipity_db_escape_string($type))));\n}",
"function checkEditDuplicate( $publicationId , $publicationName )\n\t{\n\t\ttry{\n\t\t\t$objPublication = new Network_Db_Publication();\n\t\t\t$objPublication->set( \"publicationName||$publicationName\" );\n\t\t\tif( $objPublication->getTotalCount() > 0 ){\n\t\t\t\tif( $publicationId == $objPublication->get( \"publicationId\" ) ){\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch( Exception $ex ){\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"private function does_publication_exist() : bool {\n\t\t$publication = get_term( $this->publication, 'publication' );\n\n\t\tif ( ! $publication || is_wp_error( $publication ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->publication_term = $publication;\n\n\t\treturn true;\n\t}",
"function updateArticle()\n{\n $query = \"UPDATE articles SET \";\n $query_end = \"WHERE id=\" . $_GET['id'];\n\n $ischanged = 0;\n if (!empty($_GET['title'])) {\n $query = $query . \"title='\" . str_replace(\"'\", \"''\", $_GET['title']) . \"' \";\n $ischanged = 1;\n }\n if (!empty($_GET['year'])) {\n $query = $query . \"publication_year='\" . $_GET['year'] . \"' \";\n $ischanged = 1;\n }\n if (!empty($_GET['link'])) {\n $query = $query . \"link_to_article='\" . $_GET['link'] . \"' \";\n $ischanged = 1;\n }\n if ($ischanged == 1) {\n $query = $query . $query_end;\n\n $answer = pg_query($query);\n\n if ($answer == false) {\n return pg_last_error();\n }\n }\n\n if (!empty($_GET['authors'])) {\n $authors_array = explode(\",\", $_GET['authors']);\n\n $query = \"DELETE FROM write WHERE article_id=\" . $_GET['id'];\n\n $answer = pg_query($query);\n\n if ($answer == false) {\n return pg_last_error();\n }\n\n for ($i = 0; $i < count($authors_array); $i++) {\n $query = \"INSERT INTO write VALUES('\" . getAuthorId(trim($authors_array[$i])) . \"','\" . $_GET['id'] . \"');\";\n\n $answer = pg_query($query);\n\n if ($answer == false) {\n return pg_last_error();\n }\n }\n }\n return true;\n}",
"public function doPublish()\n\t{\n\t\t/* Check Permissions */\n\t\tif( ! $this->registry->blogFunctions->allowPublish( $this->blog ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_blog_mod_permission', 10699, null, null, 403 );\n\t\t}\n\n \t\t/* Check entry ID */\n \t\t$entry_id = intval( $this->request['entryid'] );\n\n \t\tif( ! $entry_id )\n \t\t{\n \t\t\t$this->registry->output->showError( 'incorrect_use', 106100, null, null, 404 );\n \t\t}\n\n\t\t$entry = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'blog_entries', 'where' => \"entry_id={$entry_id}\" ) );\n\n\t\t/* Check access */\n\t\tif( empty( $entry ) or $entry['entry_name'] == \"\" )\n\t\t{\n \t\t\t$this->registry->output->showError( 'incorrect_use', 106101, null, null, 404 );\n\t\t}\n\n\t\t/* Check published status */\n\t\tif( $entry['entry_status'] != 'draft' )\n\t\t{\n \t\t\t$this->registry->output->showError( 'incorrect_use', 106102 );\n\t\t}\n\n\t\t/* Publish */\n\t\t$this->registry->blogFunctions->changeEntryApproval( array( $entry_id ), 1 );\n\t\t\n\t\t/* Redirect back to Blog page */\n\t\t$this->registry->output->silentRedirect( \"{$this->settings['base_url']}app=blog&module=display&section=blog&blogid={$this->blog_id}\", $this->blog['blog_seo_name'], false, 'showblog' );\n\t}",
"function wp_publications_shortcode_handler( $atts, $content=null, $code=\"\" ) {\n // first we simulate a standard call to bibtexbrowser\n $_GET = array_merge($_GET, $atts);\n \n $_GET['bib'] = $this->resolve($_GET['bib']);\n $database = zetDB($this->resolve($_GET['bib']));\n \n foreach($database->getEntries() as $entry) {\n $bibdisplay = new BibEntryDisplay($entry);\n \n $key =$entry->getKey(); \n $args=array(\n 'name' => $key,\n 'post_type' => __WP_PLUGIN__,\n );\n $my_posts = get_posts($args);\n if( $my_posts ) {\n // already added in the database\n // echo 'ID on the first post found '.$my_posts[0]->ID;\n } else {\n $this->add_or_update_publication_entry($entry,$atts['bib']);\n }\n }\n ob_start();\n $x = new Dispatcher();\n $x->main();\n return ob_get_clean(); \n }",
"public function insertEntryRec($feedId, Entry $entry) {\n\t\ttry {\n\t\t\t$stmt = $this->dbh->prepare(\"INSERT INTO Entry (entryId, title, updated, authors, alternateLink, contentType, content, feed_id) \".\n\t\t\t\t\"VALUES (:entryId, :title, :updated, :authors, :alternateLink, :contentType, :content, :feed_id)\");\n\t\t\t$stmt->bindValue(\":entryId\", $entry->entryId, PDO::PARAM_STR);\n\t\t\t$stmt->bindValue(\":title\", addslashes($entry->title), PDO::PARAM_STR);\n\t\t\t$stmt->bindValue(\":updated\", (int)$entry->updated, PDO::PARAM_INT);\n\t\t\t$stmt->bindValue(\":authors\", $entry->authors, PDO::PARAM_STR);\n\t\t\t$stmt->bindValue(\":alternateLink\", $entry->alternateLink, PDO::PARAM_STR);\n\t\t\t$stmt->bindValue(\":contentType\", $entry->contentType, PDO::PARAM_STR);\n\t\t\t$stmt->bindValue(\":content\", addslashes($entry->content), PDO::PARAM_STR);\n\t\t\t$stmt->bindValue(\":feed_id\", (int)$feedId, PDO::PARAM_INT);\n\t\t\tif ($this->execQuery($stmt, \"insertEntryRec: Inserting new entry\", true)) {\n\t\t\t\t$entryId = $this->dbh->lastInsertId();\n\t\t\t\t// This method is called when inserting a new entry into an existing feed.\n\t\t\t\t// So update UserEntryRel table for all users to whom this feed belongs\n\t\t\t\t$stmt = $this->dbh->prepare(\"INSERT INTO UserEntryRel (user_id, entry_id) \".\n\t\t\t\t\t\"SELECT user_id, :entryId FROM UserFeedRel WHERE feed_id = :feedId\");\n\t\t\t\t$stmt->bindValue(\":entryId\", (int)$entryId, PDO::PARAM_INT);\n\t\t\t\t$stmt->bindValue(\":feedId\", (int)$feedId, PDO::PARAM_INT);\n\t\t\t\tif ($this->execQuery($stmt, \"insertEntryRec: Update UserEntryRel\", true)) \n\t\t\t\t\treturn $entryId;\n\t\t\t}\n\t\t} catch (PDOException $e) {\n\t\t\t$this->dbh->rollBack();\n\t\t\terror_log(\"FeedAggregator::EntryManager::insertEntryRec: \".$e->getMessage(), 0);\n\t\t}\n\t\treturn false;\n\t}",
"function loadEntry($entryId) {\n $sql = \"SELECT fe.feedentry_id, fe.feedentry_status,\n fe.feedentry_ident, fe.feedentry_url,\n fe.feedentry_updated, fe.feedentry_fetched,\n fe.feedentry_title,\n fe.feedentry_summary, fe.feedentry_summary_type,\n fe.feedentry_content, fe.feedentry_content_type,\n f.feed_id, f.feed_title\n FROM %s AS fe, %s AS f, %s AS rel\n WHERE fe.feedentry_id = '%d'\n AND rel.feedentry_id = fe.feedentry_id\n AND f.feed_id = rel.feed_id\";\n $params = array(\n $this->tableFeedEntries,\n $this->tableFeeds,\n $this->tableFeedRelations,\n $entryId\n );\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $this->entry = $row;\n return TRUE;\n }\n }\n return FALSE;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION :: Randomly give scores to records | public function FakeModifyScores()
{
$records = $this->records;
$new_records = array();
foreach ($records AS $record) {
#USER RATINGS
$record['instructor_skill'] = rand(0,5);
$record['instructor_knowledge'] = rand(0,5);
$record['technical_ease'] = rand(0,5);
$record['technical_quality_video'] = rand(0,5);
$record['technical_quality_audio'] = rand(0,5);
#INSTRUCTOR RATINGS
$record['user_skill'] = rand(0,5);
$record['user_knowledge'] = rand(0,5);
$record['technical_ease'] = rand(0,5);
$record['technical_quality_video'] = rand(0,5);
$record['technical_quality_audio'] = rand(0,5);
$new_records[] = $record;
}
$this->records = $new_records;
} | [
"public function hit(){\n array_push($this->hand,mt_rand(1,11));\n $this->score = array_sum($this->hand);\n }",
"public static function generateRandomDataRecords()\n {\n $db = \\Database::getInstance();\n for ($i = 0; $i < 10000; $i++)\n {\n $objMember = $db->query('SELECT id FROM tl_member ORDER BY RAND() LIMIT 1');\n $objSubject = $db->query('SELECT id FROM tl_subject ORDER BY RAND() LIMIT 1');\n $objStudent = $db->query('SELECT id FROM tl_student ORDER BY RAND() LIMIT 1');\n $set = array('teacher' => $objMember->id, 'student' => $objStudent->id, 'subject' => $objSubject->id, 'tstamp' => 999, 'skill1' => 1, 'skill2' => 2, 'skill3' => 3, 'skill4' => 4, 'skill5' => 1, 'skill6' => 1, 'skill7' => 1, 'skill8' => 1);\n $objRand = $db->prepare('SELECT id FROM tl_voting WHERE teacher=? AND student=? AND subject=?')->execute($objMember->id, $objStudent->id, $objSubject->id);\n if (!$objRand->numRows)\n {\n $db->prepare('INSERT INTO tl_voting %s')->set($set)->execute();\n }\n }\n }",
"function premRecords() {\n $records = array(\"Most caps\", \"Most runs\", \"Most wickets\", \"Most runs in a season\", \"Most sixes in a season\", \"Most sixes in a match\", \"Most wickets in a season\", \"Most catches in a season\", \"Most catches in a match\", \"Most wickets in a match\", \"Highest individual score\", \"Best bowling figures\", \"Most centuries\", \"Most 5 wicket bags\");\n shuffle($records);\n //print_r($records);\n $html = '\n <h2>Prem Records</h2>\n <div class=\"stats-home-wrapper prem-stats\">';\n foreach($records as $record) {\n $html .= getRecord($record);\n }\n $html .= '</div>';\n\n return $html;\n}",
"function recommendMatchesFromMap($matchingUsers) {\n\n $pickedUsers = array();\n for($i=0; $i < sizeof($matchingUsers); $i++) {\n if($matchingUsers[$i]['Weight'] == 1) {\n // 10% chance\n if(rand(0,1) <= 0.1 ) {\n // echo \"\\\"\\r\\n\\\" 10%\";\n // echo \"Picked <br>\";\n $pickedUsers[] = $matchingUsers[$i];\n }\n }\n else if($matchingUsers[$i]['Weight'] == 2) {\n // 20% chance\n if(rand(0,1) <= 0.2 ) {\n //echo \"\\\"\\r\\n\\\" 20%\";\n // echo \"picked <br>\";\n $pickedUsers[] = $matchingUsers[$i];\n }\n }\n else if($matchingUsers[$i]['Weight'] == 3) {\n // 30% chance\n if(rand(0,1) <= 0.3 ) {\n // echo \"\\\"\\r\\n\\\" 30%\";\n // echo \"picked <br>\";\n $pickedUsers[] = $matchingUsers[$i];\n }\n }\n else if($matchingUsers[$i]['Weight'] == 4) {\n // 40% chance\n if(rand(0,1) <= 0.4 ) {\n // echo \"\\\"\\r\\n\\\" 40%\";\n // echo \"picked <br>\";\n $pickedUsers[] = $matchingUsers[$i];\n }\n }\n else if($matchingUsers[$i]['Weight'] == 5) {\n // 50% chance\n if(rand(0,1) <= 0.5 ) {\n // echo \"\\\"\\r\\n\\\" 50%\";\n // echo \"picked <br>\";\n $pickedUsers[] = $matchingUsers[$i];\n }\n }\n\n }\n return $pickedUsers;\n}",
"public function randomSort() {\r\n\t\t$this->query[$this->query_id][\"sort\"][] = \"RAND()\";\r\n\t}",
"protected function generateLikes()\n {\n $dice = mt_rand(1, 10);\n if ($dice <= 8) {\n $value = mt_rand(self::LIKES_MIN, self::LIKES_MAX/2);\n } else {\n $value = mt_rand(self::LIKES_MAX/2, self::LIKES_MAX);\n }\n $this->likesCount = $value;\n }",
"function gen_stats(){\n $this->rolls = array();\n $x = 0;\n for( $x = 0; $x < 6; $x++) {\n $roll = random_int(1,6) + random_int(1,6) + random_int(1,6);\n array_push($this->rolls, $roll);\n }\n sort($this->rolls);\n }",
"public function randomize()\n {\n foreach($this->collection as $index => $sensor) {\n /** @var Sensor $sensor */\n $sensor->detectRandom();\n }\n }",
"public function set_score()\n {\n if ($this->score_tracker)\n {\n $this->update_tracker();\n }\n else\n {\n $this->create_tracker();\n }\n }",
"function get_score_data($title,&$score, $ar_id = array('_')) {\n\t// requires existing database connection\n\tforeach($ar_id as $id) {\n//\t\t$db_title = '/'.addslashes($title).':'.$id.'>';\n//\t\t$sql = \"SELECT * FROM tt3_scores WHERE collection LIKE '%$db_title%'\";\n $db_title = title_url_format($title);\n $sql = \"SELECT * FROM tt3_scores WHERE m_url = '$db_title'\";\n//echo $sql;\t\t\n\t\tif(mysql_num_rows( ($r = mysql_query($sql)) )) {\n\t\t\twhile($rS=mysql_fetch_assoc($r)) {\n\t\t\t\t// matches all collections given\n//\t\t\t\tpreg_match(\"'<([^<:]*?):([^:/]*?)/(\".preg_quote($title,\"'\").\"):(\".str_replace('_','.',$id).\")>'\",$rS['collection'],$cm);\n//\t\t\t\t$s_id = $cm[4];\n $s_id = $rS['s_id'];\n\t\t\t\t$s_title = title_unbracket($rS['title']);\n\t\t\t\t$s_author = $rS['author'];\n preg_match(\"'<copyright(?:| year=\\\"(.*?)\\\")(?:| cc=\\\"(.*?)\\\")(?:| tt=\\\"(.*?)\\\")>(.*?)</copyright>'\", $rS['copyright'], $sm);\n\t\t\t\t$s_copyyear = $sm[1]; $s_copycc = $sm[2]; $s_copytt = $sm[3]; $s_copyowner = $sm[4];\n\t\t\t\t$s_meter = $rS['meter'];\n\t\t\t\t// only uses first key listed\n\t\t\t\t$s_key = preg_replace(\"',.+'\",'',$rS['keytone']);\n\t\t\t\t$s_sib = (int)str_replace('-','',$rS['sib']);\n\t\t\t\t$s_pdf = (int)$rS['pdf'];\n\t\t\t\t$s_mid = (int)$rS['mid'];\n\t\t\t\t$s_hi = $rS['hi'];\n\t\t\t\t$s_lo = (int)$rS['lo'];\n\t\t\t\t$s_wma = (int)$rS['wma'];\n\t\t\t\t$score[$s_id] = new Score($s_id,$s_title,$s_author,array('year'=>$s_copyyear,'cc'=>$s_copycc,'tt'=>$s_copytt,'owner'=>$s_copyowner),$s_meter,$s_key,$s_sib,$s_pdf,$s_mid,$s_hi,$s_lo,$s_wma);\n\t\t\t}\n\t\t} else {\n\t\t\t$s_media = array();\n\t\t\tif(get_media($s_media, $title)) {\n\t\t\t\t$s_sib = str_replace('/','',$s_media['sib']); // date\n\t\t\t\t$s_pdf = str_replace('/','',$s_media['pdf']); // date\n\t\t\t\t$s_mid = str_replace('/','',$s_media['mid']); // date\n\t\t\t\t$s_hi = $s_media['hi']; // duration\n\t\t\t\t$s_lo = str_replace('/','',$s_media['lo']); // date\n\t\t\t\t$s_wma = str_replace('/','',$s_media['wma']); // date\n\t\t\t}\n\t\t}\n\t}\n\tksort($score);\n}",
"function listScore($questions) {\n\t \t$assocOutput = array();\n\t \t// $indexedQuestions = array('0,ali' => array(56,345,324453), \n\t \t// \t\t\t\t\t\t '5,ahmetcan' => array(3,23423,5435435), \n\t \t// \t\t\t\t\t\t '18,zeynep' => array(234,234234,2434), \n\t \t// \t\t\t\t\t\t '6,ummetcan' => array(23234,2134234,24354)\n\t \t// \t\t\t\t\t\t );\n\t \t\n\t \t//converts question string into array of word indices\n\t \t$indexedQuestions = array();\n\t \tforeach ($questions as $key => $val) {\n\t \t\t$indexed = $this->queryToIndices($val);\n\t \t\t$indexedQuestions[$key] = $indexed;\n\t \t}\n\n\t \t//iterate through the list to match&score every possible query\n\t \t$keys = array_keys($indexedQuestions);\n\t \tfor ($i=0; $i < count($indexedQuestions); $i++) {\n\t \t\t\n\t \t\t$currentQuestion = $indexedQuestions[$keys[$i]];\n\n\t \t\tfor ($j=($i+1); $j < count($indexedQuestions); $j++) { \n\t \t\t\t\n\t \t\t\t$toCompare = $indexedQuestions[$keys[$j]];\n\t \t\t\t$key = $keys[$i].\",\".$keys[$j];\n\t \t\t\t//$questionPairScore = rand();\n\t \t\t\t$questionPairScore = $this->queryScore($currentQuestion,$toCompare);\n\t \t\t\t$assocOutput[$key] = $questionPairScore;\n\t \t\t}\n\t \t}\n\n\t \t//sorts according to values in descending order\n\t \tarsort($assocOutput);\n\t \t\n\t \treturn $assocOutput;\n\t }",
"public function redis_sorted_sets_zScore_float_member_int_score()\n {\n // Start from scratch\n $this->assertGreaterThanOrEqual(0, $this->redis->delete($this->key));\n $total = random_int(1, 10);\n $data = [];\n for ($i = 0; $i < $total; $i++) {\n $member = ($i * 1.1) + 65;\n $value = 1.1 * $i;\n $data[(string) $member] = $value;\n $this->assertEquals(1, $this->redis->zAdd($this->key, $value, $member));\n }\n // T E S T -----------------------------------------------------------\n $member = random_int(1, $total);\n $member = array_keys($data)[$member - 1];\n $score = $this->redis->zScore($this->key, $member);\n $this->assertIsFloat($score);\n $this->assertEquals($data[$member], $score);\n // Remove all the keys used\n $this->assertEquals(1, $this->redis->delete($this->key));\n }",
"public function getScore();",
"function getTopScore (){\nreturn 4;\n}",
"function updateScore() {\n\t\t\n\t}",
"public function getRandomQuiz() {\n\t\t$sql = \"SELECT * from {$this->_dbName}.{$this->_tableName} ORDER BY RAND()\";\n\t\treturn $this->getRecord($sql);\n\t}",
"public function random()\n {\n $this->setNumber(rand(1, 100));\n }",
"function play(){\r\n\t\tfor($i=1; $i<4; $i++){\r\n\t\t\t\t${\"randomValue\".$i} = rand(0,3);\r\n\t\t\t\tdisplaySymbol(${\"randomValue\".$i}, $i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdisplayPoints($randomValue1,$randomValue2,$randomValue3);\r\n\t}",
"public static function getRandomRecord(array $records);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the baseURL which is prependet to the links if not set before it uses config.baseURL from TypoScript | public function getBaseURL() {
if (!$this->baseURL)
$this->baseURL = $GLOBALS['TSFE']->tmpl->setup['config.']['baseURL'];
return $this->baseURL;
} | [
"private static function getBaseUrl () {\n\t\t$backendUtility = GeneralUtility::makeInstance(BackendUtility::class);\n\t\t$rootLine = $backendUtility->BEgetRootline(1);\n\t\t$TemplateService = GeneralUtility::makeInstance(TemplateService::class);\n\t\t$TemplateService->tt_track = 0;\n\t\t$TemplateService->init();\n\t\t$TemplateService->runThroughTemplates($rootLine);\n\t\t$TemplateService->generateConfig();\n\n\t\t$typoScript = $TemplateService->setup;\n\n\t\t$serverName = filter_input(INPUT_SERVER, 'SERVER_NAME', FILTER_SANITIZE_URL);\n\n\t\treturn !$typoScript['config.']['baseURL'] ? self::getProtocol() . $serverName . '/' : $typoScript['config.']['baseURL'];\n\t}",
"private function base_url() {\n global $config;\n if(isset($config['base_url']) && $config['base_url']) return $config['base_url'];\n\n $url = '';\n $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';\n $script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';\n if($request_url != $script_url) {\n $url = trim(preg_replace('/'. str_replace('/', '\\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/');\n }\n\n $protocol = $this->get_protocol();\n return rtrim(str_replace($url, '', $protocol . \"://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), '/');\n }",
"protected function getBaseUrl() {\n\t\treturn $this->getConfig()->system->base_url;\n\t}",
"private function getBaseUrl ()\n\t{\n\t\t# If the base_url isn't given: use the request's root\n\t\tif(is_null($this->config['base_url']) || trim($this->config['base_url']) == '')\n\t\t{\n\t\t\treturn Request::root();\n\t\t}\n\n\t\t# Return the base_url from the config\n\t\treturn $this->config['base_url'];\n\t}",
"function getBaseUrl()\n\t{\n\t\t$baseurl = $this->_baseurl;\n\t\tif (!$baseurl) {\n\t\t\treturn \"http://login.live.com/\";\n\t\t}\n\t\treturn $baseurl;\n\t}",
"public static function urlBase ()\n {\n return ESys_Application::get('config')->get('urlBase');\n }",
"private function detectBaseUrl() {\n $this->baseurl = empty($this->subdir) ? '/' : \"/{$this->subdir}/\";\n }",
"private function _setBaseUrl()\n\t{\n\t\tif ($this->_base_url === null)\n\t\t{\n\t\t\t$this->_base_url = $this->_domain_url . '/' . $this->getUrl();\n\t\t}\n\t}",
"function base_url() {\n return Micro::get(Config::class)->get('app.base_url');\n }",
"public static function base_url()\n\t\t{\n\t\t\treturn rtrim(self::get_setting('base_url'), '/') . '/';\n\t\t}",
"public function base_url()\n {\n global $base_url;\n return $base_url;\n }",
"function setBaseUrl($base = null){\n\n\t\tif ($base) {\n\t\t\tstr_replace('http://','',$base);\n\t\t}else{\n\t\t\t$request = self::request();\n\n\t\t\t$base = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n\t\t\t$base = str_replace($request['path'],'',$base);\n\t\t\tif (!empty($request['subdomain'])) {\n\t\t\t\t$base = $request['subdomain'].\".\".$base;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tself::setRequest('baseUrl',\"http://\".$base);\n\t}",
"public function setBaseUrl()\n {\n if (empty($this->url)) {\n $this->getUrl();\n }\n\n if ($this->friendly_url) {\n $this->base_url = $this->getUrl();\n } else {\n $appending_query_strings = array();\n $this->excluded_query_strings[$this->page_index] = $this->page_index;\n foreach ($_GET as $k => $v) {\n if ((array_search($k, $this->excluded_query_strings) === false)) {\n $appending_query_strings[$k] = $k.'='.$v;\n }\n }\n if (count($appending_query_strings)) {\n $this->base_url = $this->appendQueryString($this->url, implode('&', $appending_query_strings));\n } else {\n $this->base_url = $this->getUrl();\n }\n }\n }",
"protected function get_base_url(){\n\t\treturn $this->request->path;\n\t}",
"protected function getBaseUrl()\n {\n // Base URL is different for author searches:\n if ($this->searchType == 'author') {\n if ($this->searchSubType == 'home') {\n return $this->serverUrl.\"/Author/Home?\";\n }\n if ($this->searchSubType == 'search') {\n return $this->serverUrl.\"/Author/Search?\";\n }\n } else if ($this->searchType == 'newitem') {\n return $this->serverUrl . '/Search/NewItem?';\n } else if ($this->searchType == 'reserves') {\n return $this->serverUrl . '/Search/Reserves?';\n } else if ($this->searchType == 'favorites') {\n return $this->serverUrl . '/MyResearch/Favorites?';\n } else if ($this->searchType == 'list') {\n return $this->serverUrl . '/MyResearch/MyList/' .\n urlencode($_GET['id']) . '?';\n }\n\n // If none of the special cases were met, use the default from the parent:\n return parent::getBaseUrl();\n }",
"abstract protected function setBaseUrl();",
"public static function base() {\n\t\tif (isset(static::$base)) return static::$base;\n\n\t\t$base = 'http://localhost';\n\n\t\t// If the application's URL configuration is set, we will just use that\n\t\t// instead of trying to guess the URL from the $_SERVER array's host\n\t\t// and script variables as this is a more reliable method.\n\t\tif (($url = Config::get('application.url')) !== '') {\n\t\t\t$base = $url;\n\t\t} else {\n\t\t\t$base = Request::foundation()->getRootUrl();\n\t\t}\n\n\t\treturn static::$base = $base;\n\t}",
"public static function getBaseUrl() {\n\t\treturn base_url();\n\t}",
"private function set_base_url()\n\t{\n\t\t// We completely kill the site URL value. It's now blank.\n\t\t// This enables us to use only the \"index.php\" part of the URL.\n\t\t// Since we do not know where the CP access file is being loaded from\n\t\t// we need to use only the relative URL\n\t\t$this->config->set_item('site_url', '');\n\n\t\t// We set the index page to the SELF value.\n\t\t// but it might have been renamed by the user\n\t\t$this->config->set_item('index_page', SELF);\n\t\t$this->config->set_item('site_index', SELF); // Same with the CI site_index\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter de l'attribut $age | public function getAge(){
return $this->age;
} | [
"public function getage()\n {\n return $this->age;\n }",
"public function get_age()\n {\n return $this->_age;\n }",
"public function getAge()\r\n {\r\n return $this->_age;\r\n }",
"public function getAge()\n\t{\n\t\treturn $this->age;\n\t}",
"public function getAge(): int\n {\n return $this->_age;\n }",
"public function getAge()\n\t{\n\t}",
"function getAge()\n\t{\n\t\treturn $this->age * 365;\n\t}",
"function get_age($date) {\n // return $age;\n }",
"public function getAgeInfo()\n {\n return $this->ageInfo;\n }",
"public function getAgeAttribute()\n {\n return Carbon::parse($this->user->birthday)->age;\n }",
"public function getPropertyAge()\n {\n return isset($this->PropertyAge) ? $this->PropertyAge : null;\n }",
"public function getAge()\n\t{\n\t\t$interval = $this->bdate->diff($this->today);\n\t\t$this->age = $interval->y;\n\t}",
"function getAgeGroupAge()\n {\n return ($this->__agegroupage) ;\n }",
"public function getStudentAge(){\n\t return $this->student_age;\n\t }",
"public function getUserAge() : int {\n return ($this->userAge);\n }",
"public function getPatientAgeAttribute()\n {\n return $this->patient_age();\n }",
"public function getAgeRange()\n {\n return $this->age_range;\n }",
"function getAge(){\n\t\t\t$age = intval (date('Y')) - $this->reg_year;\n\t\t\treturn $age;\n\t\t \n\t\t }",
"public function ageCalculator($age)\n\n {\t\n\n\t\treturn $age = Carbon::parse($age)->age;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that it finds the subscriptions given a plan id | public function testGetSubscriptionListByPlanId(){
PayU::$apiLogin = PayUTestUtil::API_LOGIN;
PayU::$apiKey = PayUTestUtil::API_KEY;
Environment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);
// Subscription parameters
$parameters = PayUTestUtil::buildSubscriptionParameters();
// Customer parameters
$parameters = PayUTestUtil::buildSubscriptionParametersCustomer($parameters);
// Plan parameters
$plan = PayUSubscriptionPlans::create(PayUTestUtil::buildSuccessParametersPlan($parameters));
$parameters[PayUParameters::PLAN_ID] = $plan->id;
$parameters = PayUTestUtil::buildSubscriptionParametersCreditCard($parameters);
$response = PayUSubscriptions::createSubscription($parameters);
$this->assertNotNull($response->id);
$this->assertNotNull($response->plan->id);
$subscriptionId0 = $response->id;
$parameters[PayUParameters::PLAN_ID] = $plan->id;
$parameters = PayUTestUtil::buildSubscriptionParametersCreditCard($parameters);
$response = PayUSubscriptions::createSubscription($parameters);
$this->assertNotNull($response->id);
$this->assertNotNull($response->plan->id);
$subscriptionId1 = $response->id;
$subscriptionIds = array($subscriptionId0, $subscriptionId1);
$parameters = array(PayUParameters::PLAN_ID => $plan->id);
$response = PayUSubscriptions::findSubscriptionsByPlanOrCustomerOrAccount($parameters);
$this->assertNotNull($response);
$this->assertEquals(2, count($response->subscriptionsList));
$this->assertContains($response->subscriptionsList[0]->id, $subscriptionIds);
$this->assertContains($response->subscriptionsList[1]->id, $subscriptionIds);
} | [
"public function testGetSubscriptionById()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetCustomerListByPlanId(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\t\n\t\t// Subscription parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParameters();\n\t\t\n\t\t// Customer parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCustomer($parameters);\n\t\t\n\t\t// Plan parameters\n\t\t$plan = PayUSubscriptionPlans::create(PayUTestUtil::buildSuccessParametersPlan($parameters));\n\t\t$parameters[PayUParameters::PLAN_ID] = $plan->id;\n\t\t\n\t\t// Credit card parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCreditCard($parameters);\n\t\t\n\t\t$response = PayUSubscriptions::createSubscription($parameters);\n\t\t\n\t\t$this->assertNotNull($response->id);\n\t\t$this->assertNotNull($response->plan->id);\n\t\n\t\n\t\t$parameters = array(PayUParameters::PLAN_ID => $plan->id);\n\t\t$response = PayUCustomers::findCustomerListByPlanIdOrPlanCode($parameters);\n\t\t\n\t\t$this->assertNotNull($response);\n\t\t$this->assertEquals(1, count($response->customerList));\n\t}",
"function stripe_subscriptions_get_plan_from_id($plan_id) {\n\n\t$plans = elgg_get_entities_from_metadata(array(\n\t\t'types' => 'object',\n\t\t'subtypes' => SiteSubscriptionPlan::SUBTYPE,\n\t\t'limit' => 1,\n\t\t'metadata_names' => 'plan_id',\n\t\t'metadata_values' => $plan_id,\n\t));\n\n\treturn ($plans) ? $plans[0] : false;\n}",
"public function testSubscriptionsIdGet()\n {\n }",
"public function find($id)\n {\n if (!is_array($id)) {\n return $this->subscriptionPlan->where('id', $id)->first();\n }\n \n return $this->subscriptionPlan->whereIn('id', $id)->get();\n }",
"private function findSubscription() {\n $result = mysqli_query( $this->db, \"SELECT * FROM `subscriptions` s WHERE s.user_id = \" . $this->id . \" ORDER BY id DESC\");\n if( mysqli_num_rows( $result ) > 0 ) {\n $row = mysqli_fetch_array( $result );\n if( $row['canceled_at'] == null || $row['next_capture_at'] > time() ) {\n $this->subscription = new Subscription();\n $this->subscription->setOffer( $this->offerId );\n $this->subscription->setPayment( $row['payment_id'] );\n $this->subscription->setPaymillId( $row['paymill_id'] );\n $this->subscription->setActive( $row['active'] );\n $this->subscription->setCanceledAt( $row['canceled_at'] );\n } else {\n $update = \"UPDATE subscriptions s SET active = false WHERE s.id = \" . $row['id'];\n $this->log->addInfo( $update );\n mysqli_query( $this->db, $update );\n }\n }\n }",
"public function testCrceTariffGetAvailablePlansSubscription()\n {\n\n }",
"public function getSubscription($subscription_id);",
"public function viewSubscriptionPlans($id = null) {\n $pageTitle = 'Subscription Plans | View';\n $pageHedding = 'Subscription Plans | View';\n $breadcrumb = array(\n array('label' => 'Manage Website', 'link' => 'homePages/subscriptionPlans/'),\n array('label' => 'View'),\n );\n $this->set(compact('breadcrumb', 'pageTitle', 'pageHedding'));\n $this->loadModel('SubscriptionPlans');\n $id = $this->Encryption->decode($id);\n $SubscriptionPlan = $this->SubscriptionPlans->find()->contain('Attributes')->hydrate(false)\n ->where(['SubscriptionPlans.id =' => $id])->first();\n\n $this->set(compact('SubscriptionPlan'));\n }",
"public function testCreateSubscriptionWithExistingPlan(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\t\n\t\t// Subscription parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParameters();\n\t\t\t\t\n\t\t// Customer parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCustomer($parameters);\t\t\n\t\t\n\t\t// Plan parameters\n\t\t$plan = PayUSubscriptionPlans::create(PayUTestUtil::buildSuccessParametersPlan($parameters));\n\t\t$parameters[PayUParameters::PLAN_ID] = $plan->id;\n\t\t\n\t\t// Credit card parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCreditCard($parameters);\n\n\t\t$response = PayUSubscriptions::createSubscription($parameters);\n\t\t\n\t\t$this->assertNotNull($response->id);\n\t\t$this->assertNotNull($response->plan->id);\n\t\t$this->assertNotNull($response->customer->id);\n\t\t$this->assertCount( 1, $response->customer->creditCards);\n\t\t$this->assertEquals($parameters[PayUParameters::INSTALLMENTS_NUMBER], $response->installments);\n\t\t$this->assertEquals($parameters[PayUParameters::QUANTITY], $response->quantity);\n\t}",
"public function testGetManageScheduledPlansById()\n {\n }",
"public function planFind($id);",
"public function findSubscription($id)\n {\n if ($this->subscription->id == $id) {\n return $this->subscription;\n }\n }",
"public function getPlanById()\n {\n // Arrange\n // Act\n if (! isset($this->plans)) {\n $this->getsAListOfPlans();\n }\n $plans = $this->plans;\n $plan = $plans['data'][0];\n\n $plan = Ezypay::getPlan($plan['id']);\n\n // Assert\n $this->assertNotNull($plan);\n $this->assertEquals($plan['id'], $plan['id']);\n }",
"public function hr_subscription($id, $params = array())\n {\n return $this->customQuery('hr/subscriptions/'.(int)$id, $params, 'GET');\n }",
"public function testCrceTariffGetActivePlanSubscription()\n {\n\n }",
"public function testListSubscriptions()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function findActivePlanBySubId($id) {\n\t\t$query = $this->db\n\t\t\t->from($this->table . ' as s')\n\t\t\t->join('subscription_plans as sp', 's.' . $this->planId . ' = sp.plan_id')\n\t\t\t->where(array('s.' . $this->subscriberId => $id, 's.' . $this->status => 'active'))\n\t\t\t->get();\n\t\treturn $query->row_array();\n\t}",
"public function testCrceFlexiPlanServiceGetPlanSubscriptionTemplate()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolves status number from a status string. Returns status number or null if the status string was unknown. | public static function resolveStatus($statusString)
{
$statusConst = "self::$statusString";
if (defined($statusConst)) {
return constant($statusConst);
} else {
return null;
}
} | [
"private function statusIDFromUrl(string $url): ?int {\n if (!preg_match(\"`^/?(?:[^\\/]+)/status(es)?/(?<statusID>[\\d]+)`\", parse_url($url, PHP_URL_PATH) ?? \"\", $matches)) {\n return null;\n }\n\n return (int)$matches[\"statusID\"];\n }",
"static public function StatusToInt( $status ) {\n\t\t$status = strtolower( $status );\n\t\tif ( !strcmp( $status, 'released' ) ) {\n\t\t\treturn self::STATUS_RELEASED;\n\t\t} elseif ( !strcmp( $status, 'unreleased' ) ) {\n\t\t\treturn self::STATUS_UNRELEASED;\n\t\t} elseif ( !strcmp( $status, 'preview' ) ) {\n\t\t\treturn self::STATUS_PREVIEW;\n\t\t} else {\n\t\t\treturn self::STATUS_UNKNOWN;\n\t\t}\n\t}",
"protected function mapStatus($status) : int\n {\n switch ($status) {\n case Dispatcher::METHOD_NOT_ALLOWED:\n return self::METHOD_NOT_ALLOWED;\n case Dispatcher::FOUND:\n return self::FOUND;\n case Dispatcher::NOT_FOUND:\n default:\n return self::NOT_FOUND;\n }\n }",
"function get_status_code($api_status) {\n\t\t$status = 0;\n\t\tswitch ($api_status) {\n\t\t\tcase 'NS':\n\t\t\tcase 'TBD':\n\t\t\t\t$status = 0;\n\t\t\tbreak;\n\t\t\tcase '1H':\n\t\t\tcase '2H':\n\t\t\tcase 'INT':\n\t\t\t\t$status = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'HT':\n\t\t\t\t$status = 2;\n\t\t\t\tbreak;\n\t\t\tcase 'FT':\n\t\t\tcase 'AET':\n\t\t\tcase 'PEN':\n\t\t\t\t$status = 3;\n\t\t\t\tbreak;\n\t\t\tcase 'ET':\n\t\t\t\t$status = 4;\n\t\t\t\tbreak;\n\t\t\tcase 'P':\n\t\t\t\t$status = 5;\n\t\t\t\tbreak;\n\t\t\tcase 'PST':\n\t\t\t\t$status = 6;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $status;\n\t}",
"public static function interpret($status)\n {\n // Status from integer or numeric string\n if (is_numeric($status)) {\n if (isset(self::$statusCodes[$status])) {\n return \"$status \" . self::$statusCodes[$status];\n \n } else {\n $msg = \"Unknown status code: $status\";\n throw new InvalidArgumentException($msg);\n }\n\n // Status from string\n } else if (is_string($status)){\n // Build a string-to-integer lookup for converting a symbol (like\n // 'created' or 'notImplemented') into its corresponding HTTP status\n // code (like 200 or 501). \n static $symbolToStatusCode = array();\n if (empty($symbolToStatusCode)) {\n foreach (self::$statusCodes as $code => $message) {\n $symbol = Mad_Support_Inflector::camelize($message, \n $first='lower');\n $symbolToStatusCode[$symbol] = $code;\n }\n } \n \n // Convert status symbol to integer code, return header\n if (isset($symbolToStatusCode[$status])) {\n return self::interpret($symbolToStatusCode[$status]);\n } \n\n // Error: Status symbol could not be converted to an integer code\n // Try to help if the developer mixed up underscore/camel\n $msg = \"Unknown status: '$status'\";\n if (strpos($status, '_')) {\n $status = Mad_Support_Inflector::camelize($status, \n $first='lower');\n if (isset($symbolToStatusCode[$status])) {\n $msg .= \" (underscore), did you mean '$status' (camel)?\";\n }\n }\n throw new InvalidArgumentException($msg);\n\n // Status is an unknown type\n } else {\n $msg = '$status must be numeric or string, got '\n . gettype($status);\n throw new InvalidArgumentException($msg);\n }\n\n }",
"protected function resolveStatus($statusDescription)\n {\n $statuses = [\n Track::STATUS_DELIVERED => [\n 'Delivered',\n 'Zugestellt',\n ],\n Track::STATUS_IN_TRANSIT => [\n 'Mailed',\n 'Aufgabe',\n 'Sorting',\n 'Sortierung',\n 'Postal customs clearance',\n 'Im Postverzollungsprozess',\n 'Handed to customs',\n 'An Zoll übergeben',\n 'Arrival at border point',\n 'Ankunft Grenzstelle Bestimmungsland',\n 'Departure from border point',\n 'Abgang Grenzstelle Aufgabeland',\n 'Registered for collection',\n 'Zur Abholung gemeldet',\n 'Arrival at delivery post office',\n 'Ankunft Zustellstelle',\n ],\n Track::STATUS_WARNING => [],\n Track::STATUS_EXCEPTION => [],\n ];\n\n foreach ($statuses as $status => $needles) {\n foreach ($needles as $needle) {\n if (strpos($statusDescription, $needle) !== false) {\n return $status;\n }\n }\n }\n\n return Track::STATUS_UNKNOWN;\n }",
"private function handleArgumentStatusId($status)\n {\n if (is_numeric($status)) {\n return $status;\n }\n\n // Handle status (ex: Open, Closed, Feedback ecc..).\n $status = strtolower($status);\n if (strpos($status, ',') !== false) {\n $statuses = explode(',', $status);\n } else {\n $statuses = array($status);\n }\n $default_statues = array('*', 'open', 'close');\n $status_params = array();\n foreach ($statuses as &$requested_status) {\n $requested_status = trim($requested_status);\n if (in_array($requested_status, $default_statues)) {\n array_push($status_params, $requested_status);\n } else {\n $custom_statuses = $this->getService()->getClient()->api('issue_status')->all()['issue_statuses'];\n foreach ($custom_statuses as $custom_status) {\n if (strtolower($custom_status['name']) === $requested_status) {\n array_push($status_params, $custom_status['id']);\n }\n }\n }\n }\n\n $status_params = implode('|', $status_params);\n\n if (strlen($status_params) != 0) {\n return $status_params;\n }\n throw new \\Exception('Status not found.');\n }",
"public static function convertStatusNameToCode($status_name)\n {\n if ($status_name == \"No Status\") { // just created the ds160 form\n return 5;\n }elseif ($status_name == \"Ready\"){ // ?\n return 4;\n }elseif ($status_name == \"Refused\"){\n return 3;\n }elseif ($status_name == \"Administrative Processing\"){\n return 2;\n }elseif ($status_name == \"Issued\"){\n return 1;\n }else{\n return 0;\n }\n }",
"public function resolveRideStatusHumanReadable($status = null)\n {\n if (is_null($status)) {\n $status = $this->attributes['ride_status'];\n }\n\n switch ($status) {\n case self::RIDE_STATUS_PENDING:\n return 'pending';\n break;\n case self::RIDE_STATUS_ACTIVE:\n return 'active';\n break;\n case self::RIDE_STATUS_STARTED:\n return 'started';\n break;\n case self::RIDE_STATUS_ENDED:\n return 'ended';\n break;\n case self::RIDE_STATUS_ONE_TRIP_COMPLETED:\n return 'goingCompleted';\n break;\n case self::RIDE_STATUS_GOING_CONFIRMED:\n return 'returnConfirmed';\n break;\n case self::RIDE_STATUS_CANCELED:\n return 'canceled';\n break;\n case self::RIDE_STATUS_FAILED:\n return 'failed';\n break;\n case self::RIDE_STATUS_CONFIRMED:\n return 'confirmed';\n break;\n case self::RIDE_STATUS_FILLED:\n return 'filled';\n break;\n case self::RIDE_STATUS_EXPIRED:\n return 'expired';\n break;\n default:\n return 'undefined';\n break;\n }\n }",
"private function __findStatus($stringStatus) {\n $stringStatus = strtolower($stringStatus);\n $status = array_search($stringStatus, $this->_statuses);\n if ($status !== false) {\n return $status;\n }\n return false;\n }",
"private function status_to_numeric_value($status) {\n if(array_key_exists($status,$this->status_array())) {\n $a = $this->status_array();\n return $a[$status];\n }\n die(\"unknown status status_to_numeric_value [\" . htmlspecialchars($status) . \"]\");\n }",
"protected function parseStatusCode()\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Check if a result status is configured.\n\t\t\tif( ! array_key_exists($this->result->getStatus(), $this->getStatus()))\n\t\t\t{\n\t\t\t\tthrow new MisconfiguredStatusException();\n\t\t\t}\n\n\t\t\treturn $this->getStatus()[$this->result->getStatus()];\n\t\t}\n\t\tcatch(MisconfiguredStatusException $e)\n\t\t{\n\t\t\treturn self::HTTP_INTERNAL_SERVER_ERROR;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\treturn self::HTTP_BAD_REQUEST;\n\t\t}\n\t}",
"public function getStatusNameFromNum($status_num) {\n return (isset($this->__status['name'][$status_num]) ? $this->__status['name'][$status_num] : NULL);\n }",
"private function parseHttpStatusCode(&$http_message)\n {\n preg_match(\"/HTTP\\/\\d\\.\\d\\s(\\d{3})/\", $http_message, $code);\n\n if (!empty($code)) {\n return intval($code[1]);\n }\n\n return 0;\n }",
"public function parseStatus() {\n\t\t$matches = preg_grep('/^save_\\d/', array_keys($this->controller->data));\n\t\tif ($matches) {\n\t\t\tlist(, $status) = explode('_', array_shift($matches));\n\t\t\treturn $status;\n\t\t} else {\n\t\t\treturn $this->controller->setAction('throwBadRequest');\n\t\t}\n\t}",
"function convertStatusFromCode($status)\n{\n if ($status == 1) {\n $status = 'Rendu';\n } else {\n $status = 'En cours';\n }\n\n return $status;\n}",
"protected static function validateTaskStatus($status)\n {\n if (!v::numeric()->between(0, 1)->validate($status)) {\n throw new TaskException('Invalid status', 400);\n }\n\n return $status;\n }",
"public function getImportStatusId()\n {\n preg_match('~usage/(?<id>[^/]+)/status~i', $this->getImportStatusUrl(), $match);\n return isset($match['id']) ? $match['id'] : null;\n }",
"static function getStatusConstant($statusCode) {\r\r\n\t\tif($statusCode == null) {\r\r\n\t\t\treturn -1;\r\r\n\t\t} else {\r\r\n\t\t\t$statusConstant = intval($statusCode);\r\r\n\t\t\t\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == 16 ) {\r\r\n\t\t\t\treturn TelekomStatusConstants::ENVIRONMENT_INVALID;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::SUCCESS) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::INTERNAL_ERROR) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::ENVIRONMENT_INVALID) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::PERMISSIONS_MISSING) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::ACCEPT_HEADER_UNKNOWN) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::QUOTAS_EXCEEDED) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::TOKEN_EXPIRED) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::ACCOUNT_MISMATCH) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::INSUFFICIENT_CREDITS) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\tif($statusConstant == TelekomStatusConstants::TOKEN_INVALID) {\r\r\n\t\t\t\treturn $statusConstant;\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t\treturn SmsValidationClient::SERVICE_NUMBER * 10000 + $statusConstant;\r\r\n\t\t}\r\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a given organiser to a tournament | public function add_organiser($memberid){
$sql = "INSERT INTO tournamentOrganisers(tournamentID, organiserID) VALUES ($this->id, $memberid)";
$result = self::$database->query($sql);
if (!$result){
$this->errors[] = "Insertion of organiser failed. Either member id doesnt exist or member is already an organiser.";
}
} | [
"public function add($team);",
"function tb_add_organizer($organizer) {\n\tglobal $wpdb;\n\t$id = htmlspecialchars($organizer['id']);\n\t$wp_id = htmlspecialchars($organizer['wp_id']);\n\t$desc = htmlspecialchars($organizer['description']);\n\t$name = htmlspecialchars($organizer['name']);\n\n\t$querystr = \"INSERT INTO wp_tinybird_mentors (id, wp_id, name, description) VALUES ('$id', '$wp_id', '$name', '$desc')\";\n\t$wpdb->query($querystr);\t\n}",
"public function addTournament($name){\n\t\tif($this->db->insert(SPORT_LEAGUE_DB_PREFIX . \"tournaments\", array('name' => $name))){\n\t\t\treturn $this->db->insert_id;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function add(array $sponsor);",
"public function addTournamentNode(TournamentInterface $node)\n {\n $bag = $this->getOrCreateTournamentBag();\n\n return $bag->addTournamentNode($node);\n }",
"public function setTournament(Tournament $tournament);",
"public function addUserOrganization(OrganizationUserInterface $organizationUser);",
"function add_users_to_team() {\n\t\t$this->_team->retrieve(\"West\");\n\t\t$this->_team->add_user_to_team($this->guids['sarah']);\n\t\t$this->_team->add_user_to_team($this->guids['sally']);\n\t\t$this->_team->add_user_to_team($this->guids[\"max\"]);\n\n\t\t// Create the east team memberships\n\t\t$this->_team->retrieve(\"East\");\n\t\t$this->_team->add_user_to_team($this->guids[\"will\"]);\n\t\t$this->_team->add_user_to_team($this->guids['chris']);\n\t}",
"public function register(Tournament $tournament){\n if(\n $tournament->status->id !== current(current(\\App\\Status::where('name', 'Public Open')->where('allowed','App\\Tournament')->pluck('id'))) ||\n count($tournament->registrations->where('user_id', Auth::user()->id)) >= 1\n ){\n return redirect()->route('tournamentList');\n }\n\n TournamentRegistration::create([\n 'user_id' => Auth::user()->id,\n 'tournament_id' => $tournament->id,\n 'status_id' => current(current(\\App\\Status::where('name', 'Register')->where('allowed','App\\TournamentRegistration')->pluck('id'))),\n 'accepted' => 2,\n ]);\n\n session()->flash('success', 'Je hebt je succesvol ingeschreven voor dit tournament');\n return back();\n }",
"public function testAskedToAddOrganisation()\n {\n // Arrange\n $user = $this->loginUserSet[0];\n\n // Act\n $this->registerUser($user);\n\n // Assert\n $this->see('Organisation Editor');\n $this->assertThat($this->byId('orgModalLabel')->text(), $this->equalTo('Organisation Editor'));\n $this->assertThat($this->byId('btn-save-org')->text(), $this->equalTo('Add Organisation'));\n\n }",
"function add( $args, $assoc_args ) {\n\n CmdlineSupport::preCondtion();\n\n list( $player, $seed ) = $args;\n $last_error = error_get_last();\n if( !is_null( $last_error ) ) {\n WP_CLI::error(\"Wrong args for ... player, seed \");\n exit;\n }\n\n $env = CmdlineSupport::get_instance()->getEnv();\n list( $clubId, $eventId, $bracketName ) = $env;\n $last_error = error_get_last();\n if( !is_null( $last_error ) ) {\n WP_CLI::error(\"Wrong env for ... clubId, eventId, bracketName \");\n exit;\n }\n \n $evts = Event::find( array( \"club\" => $clubId ) );\n $found = false;\n $target = null;\n if( count( $evts ) > 0 ) {\n foreach( $evts as $evt ) {\n $target = CmdlineSupport::get_instance()->getEventRecursively( $evt, $eventId );\n if( isset( $target ) ) {\n $found = true;\n break;\n }\n }\n if( $found ) {\n $club = Club::get( $clubId );\n $name = $club->getName();\n $evtName = $target->getName();\n $td = new TournamentDirector( $target );\n try {\n if( $td->addEntrant( $player, $seed, $bracketName ) ) {\n WP_CLI::success(\"tennis signup add ... signed up $player\");\n }\n else {\n WP_CLI::error(\"tennis signup add ... unable to signed up $player\");\n }\n }\n catch( Exception $ex ) {\n $mess = $ex->getMessage();\n WP_CLI::error(\"tennis signup add ... unable to signed up $player because '$mess'\" );\n }\n }\n else {\n WP_CLI::warning( \"tennis signup add ... could not find event with Id '$eventId' for club with Id '$clubId'\" );\n }\n }\n else {\n WP_CLI::warning( \"tennis signup add ... could not find any events for club with Id '$clubId'\" );\n }\n }",
"private function setOrganizer($organizer, $parameters)\n {\n $this->_vevent->setAttribute('ORGANIZER', $organizer, $parameters);\n }",
"function processAcceptOrganisationInvite() {\n global $sender;\n global $destination;\n global $conn;\n\n $organisation_id = getOrganisationId($sender);\n\n if ($organisation_id != -1) {\n deleteExistingOrganisation();\n\n $sql = \"INSERT INTO organisation_members (teacher_username, organisation_id) VALUES (?, ?);\";\n\n if ($stmt = $conn->prepare($sql)) {\n $stmt->bind_param(\"si\", $param_username, $param_id);\n $param_username = $destination;\n $param_id = $organisation_id;\n\n if (!$stmt->execute()) {\n die(\"Database error: {$stmt->error}\");\n }\n\n $stmt->close();\n removeInvite();\n respond(true, \"ACCEPTED\");\n } else {\n die(\"Database error: {$conn->error}\");\n }\n } else {\n respond(false, \"Organisation with username {$sender} does not exist\");\n }\n }",
"public function add_competitor($memberid){\n $member = Member::find_by_id($memberid);\n $sql = \"INSERT INTO tournamentCompetitors(tournamentID, competitorID, initrating) VALUES ($this->id, $memberid, $member->rating)\"; \n $result = self::$database->query($sql);\n if (!$result){\n $this->errors[] = \"Insertion of competitor failed. Either member id doesnt exist or member is already a competitor.\";\n }\n }",
"public static function incrementParticipantsInATournament($idTournament,$numPlayers){\n DB::table('tournaments')\n ->where('id',$idTournament)\n ->increment('num_participantes_actual', $numPlayers);\n }",
"function assignTournament($eventId=null)\n {\n /*\tif (!$eventId) {\n $this->Session->setFlash('Error with ID');\n $this->logErr('error occured: Invalid Event.');\n return $this->redirect(\"/\");\n }\n\n $managers = $this->Manager->find('list',array('fields'=>array('user_id','user_id'),'conditions' => array('Manager.model' => 'Event','Manager.model_id'=>$eventId)));\n $this->Access->checkAccess('event','u',$managers);\n\n if (!empty($this->request->data['Tournament']['tournament'])){\n $EventTournament = ClassRegistry::init('EventTournament');\n if (empty($this->request->data['Tournament']['is_satellite']))\n\t\t\t\t\t \t $this->request->data['Tournament']['is_satellite'] = 0;\n $cnt = $EventTournament->find('count',array('conditions'=>array('event_id'=>$eventId,'tournament_id'=>$this->request->data['Tournament']['tournament'])));\n if ($cnt>0) {\n\t\t\t\t\t \t $EventTournament->updateAll(array('is_satellite'=>$this->request->data['Tournament']['is_satellite']),array('event_id'=>$eventId,'tournament_id'=>$this->request->data['Tournament']['tournament']));\n\t\t\t\t\t \t $this->Session->setFlash('Tournament assigment has been changed.');\n\t\t\t\t\t $this->redirect(\"/events/edit/\".$eventId);\n } else {\n\t\t\t\t\t\t $eventTournamentData = array();\n\t\t\t\t\t\t $eventTournamentData['event_id'] = $eventId;\n\t\t\t\t\t\t $eventTournamentData['tournament_id'] = $this->request->data['Tournament']['tournament'];\n\t\t\t\t\t\t $eventTournamentData['is_satellite'] = $this->request->data['Tournament']['is_satellite'];\n\t\t\t\t\t\t $EventTournament->save($eventTournamentData);\n }\n unset($EventTournament);\n $this->Session->setFlash('Tournament has been assigned.');\n $this->redirect(\"/events/edit/\".$eventId);\n } else {\n $this->Session->setFlash('Tournament can not be empty.');\n return $this->redirect(\"/events/edit/\".$eventId);\n }\n\n $this->Session->setFlash('Tournament has been assigned.');\n return $this->redirect(\"/events/edit/\".$eventId);\n */\n }",
"public function addTeam($team)\n {\n $this->teams[] = $team;\n }",
"private function addLeagueManager() {\n\t\t$stmt = Database::$conn->prepare($this->query_add_league_manager);\n\n\t\t$stmt->bindParam(':user_id', $_SESSION['user']['id']);\n\t\t// Bind the tournament id as the last insert id.\n\t\t$stmt->bindParam(':tournament_id', $this->tournament_id);\n\n\t\tif (!$stmt->execute() || $stmt->rowCount() != 1) {\n\t\t\t$this->error_msg = \"Failed to add you as a league manager\";\n\t\t\t$this->success = false;\n\t\t}\n\t\telse {\n\t\t\t$this->returnTournamentData();\n\t\t}\n\t}",
"function processAddOrganisationInvite() {\n global $sender;\n global $destination;\n global $conn;\n\n $notification = new OrgInviteNotification($sender, $destination, false, \"organisation_invites.php\", null);\n\n $sql = \"INSERT INTO notifications (username, sender, type, target_link) VALUES (?, ?, ?, ?);\";\n\n if ($stmt = $conn->prepare($sql)) {\n $stmt->bind_param(\"ssss\", $param_username, $param_sender, $param_type, $param_target);\n $param_username = $notification->getReceiver();\n $param_sender = $notification->getSender();\n $param_type = $notification->getType();\n $param_target = $notification->getTarget_link();\n\n if (!$stmt->execute()) {\n die(\"Database error: {$stmt->error}\");\n }\n\n $id = $stmt->insert_id;\n\n updateInviteTargetURL($id);\n\n $stmt->close();\n } else {\n die(\"Database error: {$conn->error}\");\n }\n respond(true, \"INVITED\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cast's the passed value based on the backend type information. | public function castValueByBackendType($backendType, $value); | [
"abstract protected function cast($value);",
"abstract public function cast($value);",
"public function phpTypecast($value);",
"public function dbTypecast($value);",
"public function typecast($value) {\n if (gettype($value) === $this->type || $value === null || $value instanceof CDbExpression)\n return $value;\n if ($value === '' && $this->allow_null)\n return $this->type === 'string' ? '' : null;\n switch ($this->type) {\n case 'string': return (string) $value;\n case 'integer': return (integer) $value;\n case 'boolean': return (boolean) $value;\n case 'double':\n default: return $value;\n }\n }",
"protected function typecast($value)\n {\n if ($value === ''\n && !in_array(\n $this->type,\n [\n Schema::TYPE_TEXT,\n Schema::TYPE_STRING,\n Schema::TYPE_BINARY,\n Schema::TYPE_CHAR\n ],\n true)\n ) {\n return null;\n }\n\n if ($value === null\n || gettype($value) === $this->phpType\n || $value instanceof ExpressionInterface\n || $value instanceof Query\n ) {\n return $value;\n }\n\n if (is_array($value)\n && count($value) === 2\n && isset($value[1])\n && in_array($value[1], $this->getPdoParamTypes(), true)\n ) {\n return new PdoValue($value[0], $value[1]);\n }\n\n switch ($this->phpType) {\n case 'resource':\n case 'string':\n if (is_resource($value)) {\n return $value;\n }\n if (is_float($value)) {\n // ensure type cast always has . as decimal separator in all locales\n return str_replace(',', '.', (string) $value);\n }\n return (string) $value;\n case 'integer':\n if (is_bool($value)) {\n return ($value) ? 1 : 0;\n }\n return (int) $value;\n case 'boolean':\n return (boolean) $value;\n case 'double':\n return (double) $value;\n }\n\n return $value;\n }",
"protected function castValue($value, $type) {\n\t\tif ($type == 'string' || $type == 'date' || $type == 'datetime' || $type == 'time') {\n\t\t\treturn $value;\n\t\t}\n\t\tif ($type == 'boolean') {\n\t\t\treturn $value == 'true' ? true : false;\n\t\t}\n\t\tif ($type == 'integer') {\n\t\t\treturn (int)$value;\n\t\t}\n\t\treturn (float)$value;\n\t}",
"function type_cast($value) {\n\t\tif (is_null($value)) return null;\n\n\t\tswitch ($this->type) {\n\t\t\tcase DATETIME:\n\t\t\t\treturn date(SQL_DATE_TIME_FORMAT, strtotime($value));\n\n\t\t\tcase DATE:\n\t\t\t\treturn date('Y-m-d', strtotime($value));\n\n\t\t\tcase INTEGER:\n\t\t\t\treturn intval($value);\n\n\t\t\tcase FLOAT:\n\t\t\t\treturn floatval($value);\n\n\t\t\tcase BOOLEAN:\n\t\t\t\treturn boolval($value);\n\n\t\t\tdefault:\n\t\t\t\treturn $value;\n\t\t}\n\t}",
"function cast($field, $value) {\n\t\t// if the column doesn't exist, don't cast the value\n\t\tif (!isset($this->columns[$field])) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t// precast arrays\n\t\tif (is_array($value)) {\n\t\t\t$value = $this->columns[$field]->array_to_type(array_values($value));\n\t\t}\n\n\t\t// cast value\n\t\t$value = $this->columns[$field]->type_cast($value);\n\n\t\treturn $value;\n\n\t}",
"private function typeCast($value, $type) {\n\t\tswitch ($type) {\n\t\t\tcase 'integer':\n\t\t\t\t$value = intval($value);\n\t\t\t\tbreak;\n\t\t\tcase 'float':\n\t\t\t\t$value = floatval($value);\n\t\t\t\tbreak;\n\t\t\tcase 'object':\n\t\t\t\t$value = (object) $value;\n\t\t\t\tbreak;\n\t\t\tcase 'array':\n\t\t\t\t// cheat a bit; assume CSV\n\t\t\t\t$value = (array) explode(',', $value);\n\t\t\t\tbreak;\n\t\t\tcase 'string':\n\t\t\tdefault:\n\t\t\t\t$value = (string) $value;\n\t\t}\n\t\treturn $value;\n\t}",
"public static function typeCast($value,$type) {\n switch($type) {\n case 'bool':\n case 'boolean':\n return (boolean) $value;\n case 'double':\n return (double) $value;\n case 'int':\n case 'integer':\n return (integer) $value;\n default:\n return (string) $value;\n }\n }",
"public function castToType()\n {\n\n // load the params value\n $value = $this->getNodeValue()->__toString();\n\n // query whether or not we've an environment variable and/or a constant\n $this->isEnv() ? $value = getenv($value) : $value;\n $this->isConstant() ? $value = constant($value) : $value;\n\n // query the parameters type\n switch ($type = $this->getType()) {\n case 'bool':\n case 'boolean':\n // bool + boolean needs custom handling\n $value = Boolean::valueOf(new String($value))->booleanValue();\n break;\n default:\n // all other can go the same way\n settype($value, $type);\n }\n\n // return the value\n return $value;\n }",
"abstract public function convertFromRawValue($value);",
"public function cast($value, $type)\n {\n settype($value, $type);\n\n return $value;\n }",
"function variant_cast($variant, $type) {}",
"function auto_cast($value)\n {\n if (is_string($value)) {\n if (is_numeric($value)) {\n if (str_contains($value, '.')) {\n // float, real or double\n return floatval($value);\n } else {\n return intval($value);\n }\n } elseif (strtolower($value) === 'true' || strtolower($value) === 'false') {\n return boolval($value);\n }\n }\n return $value;\n }",
"public function guessTypeByValue($value);",
"function variant_cast (variant $variant, $type) {}",
"protected function castAttribute($key, $value)\r\n {\r\n if (is_null($value)) {\r\n return $value;\r\n }\r\n\r\n switch ($this->getCastType($key)) {\r\n case 'int':\r\n case 'integer':\r\n return (int) $value;\r\n case 'real':\r\n case 'float':\r\n case 'double':\r\n return (float) $value;\r\n case 'string':\r\n return (string) $value;\r\n case 'bool':\r\n case 'boolean':\r\n return (bool) $value;\r\n case 'object':\r\n return $this->fromJson($value, true);\r\n case 'array':\r\n case 'json':\r\n return $this->fromJson($value);\r\n case 'collection':\r\n return new BaseCollection($this->fromJson($value));\r\n case 'date':\r\n return $this->asDate($value);\r\n case 'datetime':\r\n return $this->asDateTime($value);\r\n case 'timestamp':\r\n return $this->asTimestamp($value);\r\n case 'file':\r\n if ($value) {\r\n return new FileCast($value, $this->uploadifyFiles[$key]);\r\n }\r\n case 'image':\r\n if ($value) {\r\n return new ImageCast($value, $this->uploadifyImages[$key]);\r\n }\r\n default:\r\n return $value;\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Aduan model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new Aduan();
$modelDepartment = Department::find()->all();
$dept_list = ArrayHelper::map($modelDepartment, 'dept_id', 'dept_name');
if(!empty(Yii::$app->request->post()))
{
//save model Aduan
$model->load(Yii::$app->request->post());
$model->save();
//save model Dept_aduan
$modelDeptAduan = new DeptAduan();
$modelDeptAduan->dept_id = $model->dept_id;
$modelDeptAduan->aduan_id = $model->aduan_id;
$modelDeptAduan->save();
//after save all data, redirect list
return $this->redirect(['index']);
// echo"<pre>";
// print_r($modelDeptAduan);
// echo"</pre>";
// die();
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->aduan_id]);
}
return $this->render('create', [
'model' => $model,
'dept_list' => $dept_list,
]);
} | [
"public function actionCreate()\n {\n $model = new Anggota();\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 {\r\n $model = new Pesan();\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 actionCreate()\n {\n $model = new DataPelayanan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_data_pelayanan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Abitur();\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 Pendataan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Tb_akun1();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->kd_akun1]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Aluno();\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 Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new 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() {\n $model = new MusrenbangSkpdAcara();\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_Unit' => $model->Kd_Unit, 'Kd_Sub_Unit' => $model->Kd_Sub_Unit]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Davomat();\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 Mahasiswa();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Laporan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n $model = new A2Caja();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_caja]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Aportexdetalle();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'iddetalle' => $model->iddetalle, 'idaporte' => $model->idaporte]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Avaria();\n\n $model->estado = 0;\n $model->data = date(\"Y-m-d H:i:s\");\n $model->idUtilizador = Yii::$app->user->identity->idUtilizador;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idAvaria]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new penjualan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_penjualan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Absensi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Pelanggan();\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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register item coupon discount functions hooks. | public static function init() {
add_filter(
'woocommerce_checkout_create_order_line_item',
array(
__CLASS__,
'copy_total_coupon_discount_meta_data_to_order_item',
),
10,
4
);
add_filter(
'wc_postfinancecheckout_packages_coupon_discount_totals_including_tax',
array(
__CLASS__,
'get_coupons_discount_totals_including_tax',
),
10,
1
);
add_filter(
'wc_postfinancecheckout_packages_coupon_cart_has_coupon_discounts_applied',
array(
__CLASS__,
'has_cart_coupon_discounts_applied',
),
10,
1
);
add_filter(
'wc_postfinancecheckout_packages_coupon_discounts_applied_by_cart',
array(
__CLASS__,
'get_coupon_discounts_applied_by_cart',
),
10,
1
);
add_filter(
'wc_postfinancecheckout_packages_coupon_percentage_discounts_by_item',
array(
__CLASS__,
'get_coupon_percentage_discount_by_item',
),
10,
1
);
} | [
"public static function wcap_coupon_callback() {\n\t\t}",
"function capweb_woocommerce_coupon_links(){\n\n\t// Bail if WooCommerce or sessions aren't available.\n\n\tif (!function_exists('WC') || !WC()->session) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Filter the coupon code query variable name.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param string $query_var Query variable name.\n\t */\n\t$query_var = apply_filters('woocommerce_coupon_links_query_var', 'coupon_code');\n\n\t// Bail if a coupon code isn't in the query string.\n\n\tif (empty($_GET[$query_var])) {\n\t\treturn;\n\t}\n\n\t// Set a session cookie to persist the coupon in case the cart is empty.\n\n\tWC()->session->set_customer_session_cookie(true);\n\n\t// Apply the coupon to the cart if necessary.\n\n\tif (!WC()->cart->has_discount($_GET[$query_var])) {\n\n\t\t// WC_Cart::add_discount() sanitizes the coupon code.\n\n\t\tWC()->cart->add_discount($_GET[$query_var]);\n\t}\n}",
"public function applyDiscount(CartLine $item);",
"function item_discounts() \r\n\t{\r\n\t\t// Check if POST data has been submitted, if so, call the custom demo model function to handle the submitted data.\r\n\t\tif ($this->input->post('update_discounts'))\r\n\t\t{\r\n\t\t\t$this->load->model('demo_cart_admin_model');\r\n\t\t\t$this->demo_cart_admin_model->demo_update_discounts();\r\n\t\t}\r\n\t\t\r\n\t\t// Get an array of all discounts filtered by a 'type' of 1 ('item discounts') and for purposes of this demo, have an id of 32+.\r\n\t\t$sql_where = array(\r\n\t\t\t$this->flexi_cart_admin->db_column('discounts', 'id').' >=' => 32,\r\n\t\t\t$this->flexi_cart_admin->db_column('discounts', 'type') => 1\r\n\t\t);\r\n\t\t$this->data['discount_data'] = $this->flexi_cart_admin->get_db_discount_query(FALSE, $sql_where)->result_array();\r\n\t\t\r\n\t\t// Set a variable to indicate on the html page that the discount is an 'item' discount.\r\n\t\t$this->data['discount_type'] = 'item';\r\n\t\r\n\t\t// Get any status message that may have been set.\r\n\t\t$this->data['message'] = $this->session->flashdata('message');\r\n\r\n\t\t$this->load->view('admin/discounts/discounts_view', $this->data);\r\n\t}",
"public function update_coupon($item, $args)\n {\n }",
"public function add_coupon_edit_hooks() {\n\n\t\tif ( version_compare( $GLOBALS['it_exchange']['version'], '1.33.0', '>' ) ) {\n\t\t\tadd_action( 'it_exchange_basic_coupons_coupon_edit_tab_general', array( $this, 'coupon_edit' ) );\n\t\t} else {\n\t\t\tadd_action( 'it_exchange_basics_coupon_coupon_edit_screen_end_fields', array( $this, 'coupon_edit' ) );\n\t\t}\n\t}",
"public function get_discounted_price($item)\n {\n }",
"public function calculateDiscountFromCoupon($coupon) {\n $cart = $this->getFullCart();\n\n // Checks whether coupon is a percentage\n if ((float) $coupon->percentage > 0) {\n $discount = 0;\n\n if (count($coupon->courses) > 0) { //Se existe curso especificado no cupom\n foreach ($cart as $item) {\n if (in_array($item->id, $coupon->courses->lists('id')->toArray())) {\n\n $checkDiscount = ($coupon->percentage / 100) * $item->options->original_price;\n\n //Se o desconto for mario que o preço de venda o valor do desconto deve ser zero = 0\n if ($checkDiscount > $item->price) {\n $discount += $item->price;\n } else {\n $discount += ($coupon->percentage / 100) * $item->options->original_price;\n }\n\n $checkDiscount = 0;\n }\n }\n } else {\n\n $total = 0;\n foreach ($cart as $item) {\n $checkDiscount = ($coupon->percentage / 100) * $item->options->original_price;\n\n //Se o desconto for mario que o preço de venda o valor do desconto deve ser zero = 0\n if ($checkDiscount > $item->price) {\n $discount += $item->price;\n } else {\n $discount += ($coupon->percentage / 100) * $item->options->original_price;\n }\n\n $checkDiscount = 0;\n $total += $discount;\n }\n\n// $discount = $total;\n }\n }\n\n\n // Checks whether coupon is a value\n if ((float) $coupon->value > 0) {\n $discount = 0;\n\n if (count($coupon->courses) >= 1) {\n foreach ($cart as $item) {\n if (in_array($item->id, $coupon->courses->lists('id')->toArray())) {\n $discount = $discount + $coupon->value;\n }\n }\n } else {\n $discount = $coupon->value;\n }\n }\n\n $coupon->save();\n\n if (isset($discount))\n $this->setDiscountInSession($discount);\n }",
"public function calculateDiscountUsingCoupoCode( $coupon ) : void{\n try{\n $discount = new CouponCodeDiscount($this->getCart(), $coupon);\n $discount->calculateDiscount();\n }catch(Exception $e){\n throw $e;\n }\n }",
"function apply_product_on_coupon( ) {\n \t// WC()->cart->add_discount($coupon_id);\n \tif (isset($_GET[\"quantity\"])) {\n $prodId = $_GET[\"quantity\"];\n } else if (isset($_POST[\"quantity\"])) {\n $prodId = $_POST[\"quantity\"];\n } else {\n $prodId = null;\n }\n\n if (isset($_GET[\"add-to-cart\"])) {\n $groupedId = (int)$_GET[\"add-to-cart\"];\n } else if (isset($_POST[\"add-to-cart\"])) {\n $groupedId = (int)$_POST[\"add-to-cart\"];\n } else {\n $groupedId = null;\n }\n if($groupedId == \"31116\" && array_key_exists(\"517\", $prodId)) {\n \t$coupon_id = 'dvsubscriptionupgrade';\n \tWC()->cart->add_discount($coupon_id);\n }\n \n}",
"public function applyFakeCoupons()\n {\n global $woocommerce;\n\n // 'newyear' is a temporary coupon for validation.\n $coupon_code = apply_filters('woocommerce_coupon_code', $this->coupon_code);\n\n // Getting New Instance with the Coupon Code.\n $the_coupon = FlycartWoocommerceCoupon::wc_get_coupon($coupon_code);\n if($the_coupon->is_valid()){\n self::setAppliedCoupon($coupon_code);\n }\n // Validating the Coupon as Valid and discount status.\n if ($the_coupon->is_valid() && !$woocommerce->cart->has_discount($coupon_code)) {\n\n // Do not apply coupon with individual use coupon already applied\n if ($woocommerce->cart->applied_coupons) {\n foreach ($woocommerce->cart->applied_coupons as $code) {\n $coupon = FlycartWoocommerceCoupon::wc_get_coupon($code);\n if (FlycartWoocommerceCoupon::get_individual_use($coupon) == true) {\n return false;\n }\n }\n }\n\n // Add coupon\n $woocommerce->cart->applied_coupons[] = $coupon_code;\n $trigger_applied_coupon_before_load_cart = apply_filters('woo_discount_rules_trigger_applied_coupon_before_load_cart', false);\n if($trigger_applied_coupon_before_load_cart){\n add_action('woocommerce_before_cart', array($this, 'trigger_event_woocommerce_applied_coupon'));\n add_action('woocommerce_review_order_before_cart_contents', array($this, 'trigger_event_woocommerce_applied_coupon'));\n } else {\n remove_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCoupons'));\n do_action('woocommerce_applied_coupon', $coupon_code);\n add_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCoupons'));\n }\n\n return true;\n }\n }",
"function createDBCoupon($coupon_code){\n\t//$coupon_code = $coupon_code; // Code\n\t$amount = '10'; // Amount\n\t$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product\n\t\t\t\t\t\t\n\t$coupon = array(\n\t\t'post_title' => $coupon_code,\n\t\t'post_content' => '',\n\t\t'post_status' => 'publish',\n\t\t'post_author' => 1,\n\t\t'post_type'\t\t=> 'shop_coupon'\n\t);\n\t\t\t\t\t\t\n\t$new_coupon_id = wp_insert_post( $coupon );\n\t\t\t\t\t\t\n\t// Add meta\n\tupdate_post_meta( $new_coupon_id, 'discount_type', $discount_type );\n\tupdate_post_meta( $new_coupon_id, 'coupon_amount', $amount );\n\tupdate_post_meta( $new_coupon_id, 'individual_use', 'no' );\n\tupdate_post_meta( $new_coupon_id, 'product_ids', '' );\n\tupdate_post_meta( $new_coupon_id, 'exclude_product_ids', '' );\n\tupdate_post_meta( $new_coupon_id, 'usage_limit', '' );\n\tupdate_post_meta( $new_coupon_id, 'expiry_date', '' );\n\tupdate_post_meta( $new_coupon_id, 'apply_before_tax', 'yes' );\n\tupdate_post_meta( $new_coupon_id, 'free_shipping', 'no' );\n}",
"function it_exchange_register_quantity_discounts_addon() {\n\t$options = array(\n\t\t'name' => __( 'Quantity Discounts', 'LION' ),\n\t\t'description' => __( 'Allows store owners the ability to set bulk discounts for products.', 'LION' ),\n\t\t'author' => 'ExchangeWP',\n\t\t'author_url' => 'https://exchangewp.com/downloads/quantity-discounts/',\n\t\t'icon' => ITUtility::get_url_from_file( dirname( __FILE__ ) . '/quantity-discounts50px.png' ),\n\t\t'file' => dirname( __FILE__ ) . '/init.php',\n\t\t'category' => 'product-features',\n\t\t'settings-callback' => 'it_exchange_quantity_discounts_addon_settings_callback',\n\t);\n\tit_exchange_register_addon( 'quantity-discounts', $options );\n}",
"function DiscountedPrice ($itemPrice, $itemCost, $couponInfo) {\n\t$discount = $couponInfo['value'];\n\t$discountrate = $discount/100;\n\t$itemPriceDiscounted = $itemPrice - ($itemPrice * $discountrate);\n\tif ($itemPrice < $itemCost)\n\t\t$itemPrice = $itemCost;\n\treturn $itemPriceDiscounted;\n}",
"function get_total_discounted_amount_on_cart(){\r\n\t\r\n\t$total_amount = 0;\r\n\t$CI =& get_instance();\r\n\t//if coupon code applied than add amount of coupon code\r\n\t$les_coupon_discount = $CI->session->userdata('les_coupon_discount');\r\n\t$les_coupon_amount = $CI->session->userdata('les_coupon_amount');\r\n\t$les_coupon_id = $CI->session->userdata('les_coupon_id');\r\n\tif(($les_coupon_discount) && !empty($les_coupon_amount) && !empty($les_coupon_id)){\r\n\t\t$total_amount = $total_amount+$les_coupon_amount;\r\n\t}\r\n\r\n\t//if any special discount applied than calculate discount amount\r\n\t$les_discount_applied = $CI->session->userdata('les_discount_applied');\r\n\t$les_discount_amount = $CI->session->userdata('les_discount_amount');\r\n\t$les_discount_id = $CI->session->userdata('les_discount_id');\r\n\t\r\n\tif(($les_discount_applied) && !empty($les_discount_amount) && !empty($les_discount_id)){\r\n\t\t$total_amount = $total_amount+$les_discount_amount;\t\r\n\t}\r\n\r\n\t//if any E Gift voucher applied than calculate amount\r\n\t$les_egift_applied = $CI->session->userdata('les_egift_applied');\r\n\t$les_egift_amount = $CI->session->userdata('les_egift_amount');\r\n\t$les_egift_id = $CI->session->userdata('les_egift_id');\r\n\t\r\n\tif(($les_egift_applied) && !empty($les_egift_amount) && !empty($les_egift_id)){\r\n\t\t$total_amount = $total_amount+$les_egift_amount;\t\r\n\t}\r\n\t//if lotus money applied than calculate discount from all discounted amount\r\n\t$les_lotus_money_amount = $CI->session->userdata('les_lotus_money_amount');\r\n\t$les_lotus_money_applied = $CI->session->userdata('les_lotus_money_discount');\r\n\t\r\n\tif(($les_lotus_money_applied) && !empty($les_lotus_money_amount))\r\n\t{\r\n\t\t$total_amount = $total_amount+$les_lotus_money_amount;\r\n\t}\r\n\t\r\n\treturn $total_amount;\r\n}",
"function apply_referral_discount( $stripe, $user_id, $coupon_id, $verbose = false ) {\n\n // First get the Memberpress Subscription ID for the user\n $author = new MeprUser( $user_id );\n $memberships = $author->active_product_subscriptions('transactions',true);\n\n // Fail if there are no memberships\n if( empty( $memberships )) {\n if( $verbose ){ return 'FAILED: No Active Subscriptions Found'; }\n return;\n }\n // Only get a Subscription that is not \"0\"\n foreach( $memberships as $memb ) {\n $temp_id = $memb->subscription_id;\n if( $temp_id != '0' ) {\n $sub_id = $temp_id;\n break;\n }\n }\n if( $sub_id ) {\n // This user has a subscription -- proceed\n $sub = new MeprSubscription($sub_id);\n // Some customers SUBSCRIPTIONS are not noted by their customer number,\n // e.g., cus_XXX -- others have a subscription number, e.g., sub_XXX\n if( strpos($sub->subscr_id, 'cus_') === 0 ) {\n // this is a cus_ id, we're ready to make our Stripe request\n $customer_id = $sub->subscr_id;\n } else {\n // this is (probably) a sub_ id, so we need to take an extra step\n try {\n $subscription = (object)$stripe->send_stripe_request(\"subscriptions/{$sub->subscr_id}\");\n } catch (Exception $e) {\n if( $verbose ){ return $e->getMessage(); }\n return;\n }\n $customer_id = $subscription->customer;\n }\n\n // Get the Stripe Customer obj\n $customer = (object)$stripe->send_stripe_request(\"customers/{$customer_id}\");\n $current_discount = $customer->discount['coupon']['id'];\n\n // This happened back when I was trying to get the customer by using\n // sub_XXX id's. Leaving this diagnostic in just in case\n if( property_exists( $customer, 'scalar' ) ) {\n if( $verbose ){ return 'FAILED: Customer ID Mismatch'; }\n return;\n }\n\n // Do discount logic\n if( $current_discount && $current_discount == $coupon_id ) {\n // Discount is current. Nothing to do\n if( $verbose ){ return 'FAILED: Discount Already Applied'; }\n return;\n }\n if( $current_discount ) {\n // If a current discount exists, but the discount is wrong, we need to delete it before updating\n try {\n $delete = (object)$stripe->send_stripe_request(\"customers/{$customer->id}/discount\", array(), 'delete');\n } catch (Exception $e) {\n if( $verbose ){ return $e->getMessage(); }\n return;\n }\n }\n // otherwise, apply the discount\n try {\n $try = (object)$stripe->send_stripe_request(\"customers/{$customer->id}\", array( 'coupon' => $coupon_id ));\n } catch (Exception $e) {\n if( $verbose ){ return $e->getMessage(); }\n return;\n }\n\n if( $verbose ){ return 'yay'; }\n return;\n\n } else {\n // this person might not exist in Stripe\n if( $verbose ){ return 'FAILED: No Customer Found'; }\n return;\n }\n\n}",
"function woocommerce_checkout_coupon_form() {\n}",
"protected function applyDiscounts() {\r\n foreach ($this->discounts as $discount) {\r\n $discountObj = Yii::createComponent($discount);\r\n $discountObj->setShoppingCart($this);\r\n $discountObj->apply();\r\n }\r\n }",
"private function updateDiscount()\n {\n $discount = 0;\n\n if ($this->coupon) {\n $expiry = Carbon::parse($this->coupon->expires_at);\n\n if (!$expiry->isPast()) {\n $discount = $this->coupon->type === 'percent'\n ? $this->coupon->discount * .01 * $this->cost\n : $this->coupon->discount;\n }\n }\n\n $this->discount = $discount;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a parameter constraint by its parameter name. | public function getConstraint($param); | [
"public function get(string $name): ConstraintInterface;",
"public function getParam(string $name);",
"public function findParameter($name)\n {\n foreach ($this->parameters as $param) {\n if ($param->name == $name) {\n return $param;\n }\n }\n return null;\n }",
"public function getParam($name);",
"public function getGetParameter($name)\n {\n if (isset($this->getParameters[$name])) {\n return $this->getParameters[$name];\n } else {\n return null;\n }\n }",
"public static function getParameter($name)\n {\n return self::getInstance()->getContainer()->getParameter($name);\n }",
"protected function getParameter($name)\r\n {\r\n return $this->container->getParameter($name);\r\n }",
"protected function getParameter(string $name)\n {\n return $this->container->getParameter($name);\n }",
"protected function getParameter($name)\n\t{\n\t\treturn $this->container->getParameter($name);\n\t}",
"public function createConstraint(string $name): Constraint;",
"public function getConstraintName();",
"public function get_parameter($name, $default = null);",
"protected function getServiceOrParameter($name)\n {\n if (0 === strpos($name, '%'))\n {\n return $this->container->getParameter(trim($name, '%'));\n }\n\n return $this->container->get($name);\n }",
"public function getConstraint();",
"abstract public function getConstraint();",
"protected function _get_parameter($name, $key)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $shares = $this->_get_shares(self::TYPE_ALL);\n\n if (isset($shares[$name][$key]))\n return $shares[$name][$key];\n else\n throw new Flexshare_Parameter_Not_Found_Exception($key);\n }",
"protected function assertIsDefined(string $name) : input\\Parameter\n {\n /* @var input\\Parameter $parameter */\n if (!$parameter = $this->definitions->get($name)) {\n throw new \\OutOfBoundsException(\"The parameter [$name] is not defined.\");\n }\n\n return $parameter;\n }",
"function get_search_parameter($name)\r\n {\r\n return $this->search_parameters[$name];\r\n }",
"private function getDynamicParameter($name)\n {\n throw new InvalidArgumentException(sprintf('The dynamic parameter \"%s\" must be defined.', $name));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tries to obtain user details, either recurring directly to the user's system profile or trough one of the user's course enrollments (course profile). | private static function user_get_user_details_courses($user) {
global $USER, $CFG;
require_once($CFG->dirroot . "/user/lib.php");
$userdetails = null;
// Get the courses that the user is enrolled in (only active).
$courses = enrol_get_users_courses($user->id, true);
$systemprofile = self::can_view_user_details_cap($user);
$systemprofile |= ($user->id == $USER->id);
$systemprofile |= has_coursecontact_role($user->id);
// Try using system profile
if ($systemprofile) {
$userdetails = user_get_user_details($user, null);
} else {
// Try through course profile
foreach ($courses as $course) {
$courseprofile = self::can_view_user_details_cap($user, $course);
$courseprofile |= ($user->id == $USER->id);
$courseprofile |= has_coursecontact_role($user->id);
if ($courseprofile) {
$userdetails = user_get_user_details($user, $course);
}
}
}
return $userdetails;
} | [
"private function _getProfileUser()\n\t{\n\t\t// Get URL segments\n\t\t$section = craft()->request->getSegment(1);\n\t\t$userId = craft()->request->getSegment(2);\n\t\t// Determine whether page is a profile\n\t\t$profile = (('users' == $section) && is_numeric($userId));\n\t\t$myaccount = ('myaccount' == $section);\n\t\t// Return profile user (if valid)\n\t\tif ($profile) {\n\t\t\treturn craft()->users->getUserById($userId);\n\t\t} else if ($myaccount) {\n\t\t\treturn craft()->userSession->getUser();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getProfileDetails()\n {\n // check if the respective cookies exist or not\n if (check_jwt_cookie($this->auth[\"service_name\"], $this->auth[\"cookie_name\"])) {\n // check if the user_id is provided\n if (empty($_POST['user_id'])) {\n json_output(BAD_DATA, array(\n \"code\" => BAD_DATA,\n \"message\" => \"user_id missing from input params\"\n ));\n return;\n }\n $user_id = $_POST['user_id'];\n $user_details = $this->UserModel->getUserDetails($user_id);\n if (isset($user_details)) {\n json_output(SUCCESS, array(\n \"code\" => SUCCESS,\n \"message\" => \"User profile details fetched\",\n \"data\" => [\n \"user_id\" => $user_details->id,\n \"email\" => $user_details->email,\n \"first_name\" => $user_details->firstname,\n \"last_name\" => $user_details->lastname,\n \"phone_number\" => $user_details->phonenumber,\n \"gender\" => $user_details->gender,\n ]));\n return;\n }\n } else {\n json_output(UNAUTHORIZED, array(\n \"code\" => UNAUTHORIZED,\n \"message\" => \"Invalid cookies\"\n ));\n }\n return;\n }",
"public function get_user_info();",
"public function getUserProfile();",
"public function test_customer_can_retrieve_own_profile_information()\n {\n $user = factory(User::class)->create();\n $response = $this->actingAs($user)->json('get', 'web/me');\n $retrievedUser = json_decode($response->getContent())->user;\n\n $this->assertEquals($retrievedUser->id, $user->id);\n }",
"public function getAuthUserProfile();",
"function getUserProfile($access_token, $provider_details = '')\n {\n // ask google api for user infos\n $graphApiUrl = 'https://www.googleapis.com/oauth2/v1/userinfo?access_token=' . $access_token;\n $_response = _doGet($graphApiUrl);\n if (!isset($_response['id']) || isset($_response['error'])) {\n throw new Exception(\"User profile request failed! google returned an invalid response.\", 6);\n }\n $user = (object)array();\n $user->access_token = $user->access_token_secret = '';\n $user->access_token = $access_token;\n $user->identifier = (array_key_exists('id', $_response)) ? $_response['id'] : \"\";\n $user->firstName = (array_key_exists('given_name', $_response)) ? $_response['given_name'] : \"\";\n $user->lastName = (array_key_exists('family_name', $_response)) ? $_response['family_name'] : \"\";\n $user->displayName = (array_key_exists('name', $_response)) ? $_response['name'] : \"\";\n $user->photoURL = (array_key_exists('picture', $_response)) ? $_response['picture'] : \"\";\n $user->profileURL = \"https://plus.google.com/\" . $user->identifier;\n $user->gender = (array_key_exists('gender', $_response)) ? $_response['gender'] : \"\";\n $user->email = (array_key_exists('email', $_response)) ? $_response['email'] : \"\";\n $user->emailVerified = (array_key_exists('email', $_response)) ? $_response['email'] : \"\";\n $user->language = (array_key_exists('locale', $_response)) ? $_response['locale'] : \"\";\n if (array_key_exists('birthday', $_response)) {\n list($birthday_year, $birthday_month, $birthday_day) = explode('-', $_response['birthday']);\n $user->birthDay = (int)$birthday_day;\n $user->birthMonth = (int)$birthday_month;\n $user->birthYear = (int)$birthday_year;\n }\n return $user;\n }",
"public function profile()\n\t{\n\t\t$uid = $this->f3->get( 'PARAMS.uid' );\n\t\t$contact = new UserContacts( $this->db );\n\t\t$incontact = $contact->getHostIDContactID( $this->f3->get('SESSION.uid'), $this->f3->get('PARAMS.uid') );\n\n\t\tif( $this->f3->get('SESSION.lvl') <= 2 || $this->f3->get('SESSION.uid') == $this->f3->get('PARAMS.uid') || !empty($incontact) )\n\t\t{\n\t\t\t$usercomplete = new viewUserCompleteProfile($this->db);\n\t\t\t$user = $usercomplete->getUserFullProfileByUid($uid);\n\n\t\t\tif( is_object($user) ) {\n\t\t\t\t$usergroups = new viewUserGroups($this->db);\n\t\t\t\t$groups = $usergroups->getGroupsByUserID($uid);\n\t\t\t\t$creator = $usercomplete->getUserFullProfileByUid($user->creatorUid);\n\t\t\t\t$updator = !empty($user->updatedBy) ? $usercomplete->getUserFullProfileByUid($user->updatedBy) : null;\n\t\t\t\t$this->f3->mset(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'user' => $user,\n\t\t\t\t\t\t'groups' => $groups,\n\t\t\t\t\t\t'creator' => $creator,\n\t\t\t\t\t\t'updator' => $updator,\n\t\t\t\t\t\t'page_header' => $this->T('user_profile').' : '.strtoupper($user->nom).' '.ucfirst($user->prenom),\n\t\t\t\t\t\t'view' => 'user/show.htm'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->f3->set('SESSION.warnings', $this->T('user_wrong_datas_contact_admin'));\n\t\t\t\t$this->f3->reroute('/users/list');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->f3->reroute('/events');\n\t\t}\n\t}",
"function retrieve_course_user_relation($course_code, $user_id);",
"function getUserProfile()\r\n\t{\r\n\t\tHybrid_Logger::info( \"Enter [{$this->providerId}]::getUserProfile()\" );\r\n\r\n\t\tif ( ! Hybrid_Auth::hasSession() )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"HybridAuth can't access user profile data. The current user have to sign in with [{$this->providerId}] before any request!\" );\r\n\t\t}\r\n\r\n\t\t// add / remove watever u want\r\n\t\t// http://developer.linkedin.com/docs/DOC-1061\r\n\t\t$response = $this->api->profile('~:(id,first-name,last-name,public-profile-url,picture-url,date-of-birth,phone-numbers,summary)');\r\n\r\n\t\tif( isset( $response['success'] ) && $response['success'] === TRUE ) \r\n\t\t{\r\n\t\t\t$data = new SimpleXMLElement($response['linkedin']); \r\n\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), Get user data\", $data );\r\n\r\n\t\t\tif ( ! is_object( $data ) )\r\n\t\t\t{\r\n\t\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), reSet user to deconnected\" );\r\n\t\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 0 );\r\n\t\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", NULL );\r\n\r\n\t\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalide xml data.\" );\r\n\t\t\t} \r\n\r\n\t\t\t$this->user->providerUID \t= @ (string) $data->{'id'};\r\n\t\t\t$this->user->profile->firstName \t= @ (string) $data->{'first-name'};\r\n\t\t\t$this->user->profile->lastName \t= @ (string) $data->{'last-name'}; \r\n\t\t\t$this->user->profile->displayName \t= @ $this->user->profile->firstName . \" \" . $this->user->profile->lastName;\r\n\r\n\t\t\t$this->user->profile->photoURL \t= @ (string) $data->{'picture-url'}; \r\n\t\t\t$this->user->profile->profileURL = @ (string) $data->{'public-profile-url'}; \r\n\t\t\t$this->user->profile->description = @ (string) $data->{'summary'}; \r\n\r\n\t\t\t$this->user->profile->phone = @ (string) $data->{'phone-numbers'}->{'phone-number'}->{'phone-number'}; \r\n\r\n\t\t\tif( $data->{'date-of-birth'} ) { \r\n\t\t\t\t$this->user->profile->birthDay = @ (string) $data->{'date-of-birth'}->day; \r\n\t\t\t\t$this->user->profile->birthMonth = @ (string) $data->{'date-of-birth'}->month; \r\n\t\t\t\t$this->user->profile->birthYear = @ (string) $data->{'date-of-birth'}->year; \r\n\t\t\t} \r\n\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), set user data\", $this->user );\r\n\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", $this->user );\r\n\t\t} \r\n\t\telse {\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), reSet user to deconnected\" );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 0 );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", NULL );\r\n\r\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalide response.\" );\r\n\t\t}\r\n\r\n\t\t// if the the provider has failed to return the user profile\r\n\t\tif ( ! $this->user->providerUID )\r\n\t\t{\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), reSet user to deconnected\" );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 0 );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", NULL );\r\n\r\n\t\t\tthrow new Exception( \"User profile request failed! The user was able to authenticate with {$this->providerId}, but the provider has failed to return the user profile.\" );\r\n\t\t}\r\n\t}",
"public function testGetUserDetails(){\r\n $url = $this->_serviceurl.'users/get-user-details';\r\n \r\n // not updating email here intentionally\r\n $parameters = array(\r\n 'user_token' =>'f3b270954bb94691ebe9ca2678b5f602',\r\n );\r\n $objUserWorkout = new \\lib\\Api\\Client($parameters, $this->_accessKey, $this->_secret, $url);\r\n $objUserWorkout->request();\r\n }",
"public static function GetProfile($user_id){\n // then it's visible or it must be user's own profile if it's private.\n }",
"function getUserProfile()\r\n\t{\r\n\t\tHybrid_Logger::info( \"Enter [{$this->providerId}]::getUserProfile()\" );\r\n\r\n\t\tif ( ! Hybrid_Auth::hasSession() )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"HybridAuth can't access user profile data. The current user have to sign in with [{$this->providerId}] before any request!\" );\r\n\t\t}\r\n\r\n\t\t$access_token = Hybrid_Auth::storage()->get( \"hauth_session.live.access_token\" ); \r\n\t\t$info_url = 'http://apis.live.net/V4.1/cid-'. $this->user->providerUID .'/Profiles/1-' . $this->user->providerUID ;\r\n\t\t\r\n\t\t$response = $this->api->GET($info_url, false, $access_token );\r\n\t\t$response = @ json_decode( $response );\r\n\r\n\t\tHybrid_Logger::debug( \"[{$this->providerId}]::getUserProfile(), received response\", $response );\r\n\r\n\t\tif ( ! is_object( $response ) )\r\n\t\t{\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 0 );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", NULL );\r\n\r\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\" );\r\n\t\t}\r\n\r\n\t\t$this->user->profile->firstName = @ (string) $response->FirstName; \r\n\t\t$this->user->profile->lastName = @ (string) $response->LastName; \r\n\t\t$this->user->profile->profileURL = @ (string) $response->UxLink; \r\n\t\t$this->user->profile->gender = @ (string) $response->Gender; \r\n\t\t$this->user->profile->email = @ (string) $response->Emails[0]->Address; \r\n\r\n\t\t$this->user->profile->displayName = $this->user->profile->firstName . \" \" . $this->user->profile->lastName; \r\n\r\n\t\tif( $this->user->profile->gender == 1 ){\r\n\t\t\t$this->user->profile->gender = \"female\";\r\n\t\t}\r\n\t\telseif( $this->user->profile->gender == 2 ){\r\n\t\t\t$this->user->profile->gender = \"male\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->user->profile->gender = \"\";\r\n\t\t}\r\n\r\n\t\tHybrid_Logger::info( \"[{$this->providerId}]::loginFinish(), set user data\", $this->user );\r\n\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", $this->user ); \r\n\r\n\t\t// if the the provider has failed to return the user profile\r\n\t\tif ( ! $this->user->providerUID )\r\n\t\t{\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), reSet user to deconnected\" );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 0 );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", NULL );\r\n\r\n\t\t\tthrow new Exception( \"User profile request failed! The user was able to authenticate with {$this->providerId}, but the provider has failed to return the user profile.\" );\r\n\t\t}\r\n\t}",
"function getUser() {\r\n\t\t$this->u = owa_coreAPI::entityFactory('base.user');\r\n\t\t$this->u->getByColumn('user_id', $this->credentials['user_id']);\r\n\t}",
"private function retrieve_user_description()\n {\n }",
"public function getUserProfile()\n {\n }",
"function get_moodle_user_details(array $conditions = array()) {\n global $DB;\n\n return $DB->get_record('user', $conditions, '*');\n}",
"public function user_profile_hook(&$user) {\n global $DB;\n\n $context = context_system::instance();\n $uid = $user->id;\n // Ignore users from don't_touch list.\n $ignore = explode(\",\", $this->config->donttouchusers);\n\n // Skip explicitly ignored users.\n if (!empty($ignore) AND array_search($user->username, $ignore) !== false) {\n return;\n };\n\n // Ignore guests.\n if (isguestuser($user)) {\n return;\n };\n\n // Ignore users with no email address (probably UNIT tests.)\n if (empty($user->email)) {\n return;\n }\n\n // Get cohorts.\n $params = array(\n 'contextid' => $context->id,\n );\n if ($this->config->enableunenrol == 1) {\n $params['component'] = self::COMPONENT_NAME;\n };\n\n $cohorts = $DB->get_records('cohort', $params);\n\n $cohortslist = array();\n foreach ($cohorts as $cohort) {\n $cohortslist[$cohort->id] = format_string($cohort->name);;\n }\n\n // Get advanced user data.\n profile_load_data($user);\n profile_load_custom_fields($user);\n $userprofiledata = cohortauto_prepare_profile_data($user, $this->config->secondrule_fld);\n\n // Additional values for email.\n list($emailusername, $emaildomain) = explode(\"@\", $userprofiledata['email']);\n\n // Email root domain.\n $emaildomainarray = explode('.', $emaildomain);\n if (count($emaildomainarray) > 2) {\n $emailrootdomain = $emaildomainarray[count($emaildomainarray) - 2].'.'.\n $emaildomainarray[count($emaildomainarray) - 1];\n } else {\n $emailrootdomain = $emaildomain;\n }\n $userprofiledata['email'] = array(\n 'full' => $userprofiledata['email'],\n 'username' => $emailusername,\n 'domain' => $emaildomain,\n 'rootdomain' => $emailrootdomain\n );\n\n // Set delimiter in use.\n $delimiter = $this->config->delim;\n $delim = strtr($delimiter, array('CR+LF' => chr(13).chr(10), 'CR' => chr(13), 'LF' => chr(10)));\n\n // Calculate cohort names for user.\n $replacementstemplate = $this->config->replace_arr;\n\n $replacements = array();\n if (!empty($replacementstemplate)) {\n $replacementsarray = explode($delim, $replacementstemplate);\n foreach ($replacementsarray as $replacement) {\n list($key, $val) = explode(\"|\", $replacement);\n $replacements[$key] = $val;\n };\n };\n\n // Generate cohort array.\n $mainrule = $this->config->mainrule_fld;\n $mainrulearray = array();\n $templates = array();\n if (!empty($mainrule)) {\n $mainrulearray = explode($delim, $mainrule);\n } else {\n return; // Empty mainrule; no further processing to do.\n };\n\n // Find %split function.\n foreach ($mainrulearray as $item) {\n if (preg_match('/(?<full>%split\\((?<fld>\\w*)\\|(?<delim>.{1,5})\\))/', $item, $splitparams)) {\n // Split!\n $parts = explode($splitparams['delim'], $userprofiledata[$splitparams['fld']]);\n foreach ($parts as $key => $val) {\n $userprofiledata[$splitparams['fld'].\"_$key\"] = $val;\n $templates[] = strtr($item, array(\"{$splitparams['full']}\" => \"{{ \".$splitparams['fld'].\"_$key }}\"));\n }\n } else {\n $templates[] = $item;\n }\n }\n\n $processed = array();\n\n // Apply templates and process the user's cohort memberships.\n foreach ($templates as $cohort) {\n // Transform templates into cohort names with Mustache.\n $cohortname = $this->mustache->render($cohort, $userprofiledata);\n // Apply symbol replacements as necessary.\n $cohortname = (!empty($replacements)) ? strtr($cohortname, $replacements) : $cohortname;\n\n // Skip empty cohort names. Users with no cohort name should not be assigned.\n if ($cohortname == '') {\n continue;\n };\n\n $cid = array_search($cohortname, $cohortslist);\n if ($cid !== false) {\n if (!$DB->record_exists('cohort_members', array('cohortid' => $cid, 'userid' => $user->id))) {\n cohort_add_member($cid, $user->id);\n };\n } else {\n // Cohort with this name does not exist, so create a new one.\n $newcohort = new stdClass();\n $newcohort->name = $cohortname;\n $newcohort->description = \"created \".date(\"d-m-Y\");\n $newcohort->contextid = $context->id;\n $newcohort->idnumber = '';\n if ($this->config->enableunenrol == 1) {\n $newcohort->component = self::COMPONENT_NAME;\n };\n $cid = cohort_add_cohort($newcohort);\n // Add new cohort into the list to avoid creating new ones with same name.\n $cohortslist[$cid] = $cohortname;\n // Add user to the new cohort.\n cohort_add_member($cid, $user->id);\n\n };\n $processed[] = $cid;\n };\n\n // Remove users from cohorts if necessary.\n if ($this->config->enableunenrol == 1) {\n // List of cohorts, managed by this plugin, where the user is a member.\n $sql = \"SELECT DISTINCT c.id AS cid\n FROM {cohort} c\n JOIN {cohort_members} cm ON cm.cohortid = c.id\n WHERE c.component = :component AND cm.userid = :userid\";\n $params = array(\n 'component' => self::COMPONENT_NAME,\n 'userid' => $uid,\n );\n $incohorts = $DB->get_records_sql($sql, $params);\n\n foreach ($incohorts as $target) {\n // Remove membership if it no longer matches a processed cohort.\n if (array_search($target->cid, $processed) === false) {\n cohort_remove_member($target->cid, $uid);\n };\n };\n };\n }",
"abstract public function getUserInfo();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reading the notoverwritten values from the elementdata Can be used instead of read, if there's no readaccess to the datasource itself | function element_values($data)
{
$values = array();
foreach($this->name2id as $name => $id)
{
if (!($data['pe_overwrite'] & $id))
{
$values[$name] = $data[$name];
}
}
return $values;
} | [
"public function getOldValues();",
"public function readElement();",
"public function getUnexpectedReadOnlyDataModification()\n {\n return $this->unexpected_read_only_data_modification;\n }",
"public function getreadOnlyVals()\r\n\t{\r\n\t\treturn $this->readOnlyVals;\r\n\t}",
"public function read()\n\t{\n\t\t$data = parent::read();\n\t\t$this->access->value = $data[0]->access;\n\t}",
"private function _getDcData() {\n $opfContents = simplexml_load_file($this->ebookDir . '/' . $this->opfFile);\n $this->dcElements = (array) $opfContents->metadata->children('dc', true);\n }",
"public function readData()\n {\n if (config('setting.cache.enabled')) {\n return $this->readDataFromCache();\n }\n\n return $this->read();\n }",
"public function read()\n\t{\n\t\tparent::read();\n\t\t$query = \"CALL siteSectionExtraPropertiesSelect({$this->id->value})\";\n\t\t$data = $this->fetchRecords($query);\n\t\t$this->initializeExtraProperties();\n\t\tif (count($data) > 0) {\n\t\t\t$this->id_param = $data[0]->id_param;\n\t\t\t$this->parent = $data[0]->parent;\n\t\t\t$this->label = $data[0]->label;\n\t\t}\n\t\t$this->readTemplates();\n\t}",
"function read_set()\n\t{\n\t\tglobal $REQUEST;\n\t\tif (!$this->writeable)\n\t\t{\n\t\t\tpage_error('Read only attribute ' . $this->name);\n\t\t}\n\t\t$this->value = $REQUEST->read($this->id, $this->mandatory);\n\t\t\n\t\tUtilLogging::getInstance()->debug(\"read_set - Attribute: \". $this->id . \" - value set: \" . $this->value);\n\t}",
"public function getRemovedData()\n {\n return array_diff($this->existedData, $this->rawData);\n }",
"protected function getEditmodeData() {}",
"public function getData()\n { \n if($this->_state->isUnique()) {\n $data = $this->getItem();\n } else {\n $data = $this->getList();\n }\n \n return $data; \n }",
"public function getReadEmptyCells()\n {\n return $this->readEmptyCells;\n }",
"private function loadReadDataIntoMDR() {\r\n \r\n }",
"protected function _getReadOnlyFields()\n {\n return (array_merge(\n parent::_getReadOnlyFields(),\n array('db_id', '_raw')\n ));\n }",
"function readRow(){\r\n \r\n }",
"public function getInvalidData();",
"function read(){\n\n // If id property is present fetch single record\n if($this->id){\n\t\t\t\t\t\t\n\t\t\t// SQL Query to fetch a single assignment \n $query = \"SELECT a.Id, a.Name FROM {$this->tableName} a WHERE a.id = :id\";\n\n // Prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // Santize and bind property\n $this->id = parent::sanitize($this->id);\n $stmt->bindParam(\":id\", $this->id);\n\n }else{\n \t// SQL query to fetch all assignment records if no id is present \n $query = \"SELECT a.Id, a.Name FROM {$this->tableName} a\";\n\n // Prepare query statement\n $stmt = $this->conn->prepare($query);\n }\n\n // Execute query\n $stmt->execute();\n \n // Creates associative array with keys to contain values from fetched from database \t\t\t\t \n $assignmentProp = array_fill_keys(array(\"name\", \"id\"),\"\");\n // Populate array with values from database\n $dataArr = parent::fetchRows($stmt, $assignmentProp);\n\t\t\t\t\n\t\t// Return associative array \n return $dataArr;\n }",
"public function getDataComplete() {\n\t\tif (! is_array ( $this->document_data_all ) || count ( $this->document_data_all ) < 1) {\n\t\t\t$rawdata = array ();\n\t\t\t$data = $this->getData ();\n\t\t\tif (is_array ( $data ) && count ( $data ) > 0) {\n\t\t\t\t$detail = $this->getDataDetail ();\n\t\t\t\t$permission = $this->getDataPermission ();\n\t\t\t\t\n\t\t\t\t$rawdata ['data'] = $data;\n\t\t\t\t$rawdata ['detail'] = $detail;\n\t\t\t\t$rawdata ['permission'] = $permission;\n\t\t\t}\n\t\t\t$this->document_data_all = $rawdata;\n\t\t}\n\t\treturn $this->document_data_all;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Interpolate two RGB colors and return as hex color | protected static function interpolateHex(array $min, array $max, $status)
{
$status = max(0, min(1, $status));
$rgb = [];
for ($color = 0; $color < 3; ++$color) {
$rgb[$color] = $min[$color] + $status * ($max[$color] - $min[$color]);
}
return self::rgbToHex($rgb);
} | [
"function hueToRgb($temp1, $temp2, $hue) {\n if ($hue < 0) {\n $hue += 1;\n }\n if ($hue > 1) {\n $hue -= 1;\n }\n\n if ((6 * $hue) < 1 ) {\n return ($temp1 + ($temp2 - $temp1) * 6 * $hue);\n } elseif ((2 * $hue) < 1 ) {\n return $temp2;\n } elseif ((3 * $hue) < 2 ) {\n return ($temp1 + ($temp2 - $temp1) * ((2 / 3) - $hue) * 6);\n }\n return $temp1;\n}",
"function hueToRgb($temp1, $temp2, $hue) {\n if ($hue < 0) { \n $hue += 1;\n }\n if ($hue > 1) {\n $hue -= 1;\n }\n\n if ((6 * $hue) < 1 ) {\n return ($temp1 + ($temp2 - $temp1) * 6 * $hue);\n } elseif ((2 * $hue) < 1 ) {\n return $temp2;\n } elseif ((3 * $hue) < 2 ) {\n return ($temp1 + ($temp2 - $temp1) * ((2 / 3) - $hue) * 6);\n }\n return $temp1;\n}",
"public static function rgbToHex($red, $green, $blue);",
"function seColor($r=0, $g=0, $b=0, $a=0) {\r\n return ($a << 24) + ($r << 16) + ($g << 8) + $b;\r\n}",
"function _fivestar_color_blend($hex1, $hex2, $alpha) {\n $in1 = _fivestar_color_unpack($hex1);\n $in2 = _fivestar_color_unpack($hex2);\n for ($i = 0; $i < 3; ++$i) {\n $out[] = $in1[$i] + ($in2[$i] - $in1[$i]) * $alpha;\n }\n return _fivestar_color_pack($out);\n}",
"public static function rgb2hex(){\n\t\tif(func_num_args() === 1) $rgb=func_get_arg(0); \n\t\telse $rgb=func_get_args();\n\t\t$hex='';\n\t\tforeach($rgb as $color){\n\t\t\t$color=dechex($color);\n\t\t\t$hex .= strlen($color) == 2 ? $color : '0'.$color; // '0' ou $color ??? .$color\n\t\t}\n\t\treturn $hex;\n\t}",
"function getColorInt($rgb)\n{\n // ACHTUNG: bisher werden in der EMU die Farben als BGR interpretiert !!!\n $tab = explode(\",\",str_replace(\" \",\"\",$rgb));\n \n $hex = \"\";\n $hex .= str_pad(dechex($tab[2]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($tab[1]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($tab[0]), 2, \"0\", STR_PAD_LEFT);\n \n return hexdec($hex);\n}",
"function shoestrap_mix_colors( $hex1, $hex2, $percentage ) {\n\n // Format the hex color string\n $hex1 = str_replace( '#', '', $hex1 );\n if ( strlen( $hex1 ) == 3 )\n $hex1 = str_repeat( substr( $hex1, 0, 1 ), 2 ) . str_repeat( substr( $hex1, 1, 1 ), 2 ) . str_repeat( substr( $hex1, 2, 1 ), 2 );\n\n $hex2 = str_replace( '#', '', $hex2 );\n if ( strlen( $hex2 ) == 3 )\n $hex2 = str_repeat( substr( $hex2, 0, 1 ), 2 ) . str_repeat( substr( $hex2, 1, 1 ), 2 ) . str_repeat( substr( $hex2, 2, 1 ), 2 );\n\n // Get decimal values\n $r1 = hexdec( substr( $hex1, 0, 2 ) );\n $g1 = hexdec( substr( $hex1, 2, 2 ) );\n $b1 = hexdec( substr( $hex1, 4, 2 ) );\n $r2 = hexdec( substr( $hex2, 0, 2 ) );\n $g2 = hexdec( substr( $hex2, 2, 2 ) );\n $b2 = hexdec( substr( $hex2, 4, 2 ) );\n\n $r = ( $percentage * $r1 + ( 100 - $percentage ) * $r2 ) / 100;\n $g = ( $percentage * $g1 + ( 100 - $percentage ) * $g2 ) / 100;\n $b = ( $percentage * $b1 + ( 100 - $percentage ) * $b2 ) / 100;\n\n $r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );\n $g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );\n $b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );\n\n return '#' . $r_hex . $g_hex . $b_hex;\n}",
"function RGB_TO_HSV(&$R, &$G, &$B) {\n $HSL = array();\n\n $var_R = ($R / 255);\n $var_G = ($G / 255);\n $var_B = ($B / 255);\n\n $var_Min = min($var_R, $var_G, $var_B);\n $var_Max = max($var_R, $var_G, $var_B);\n $del_Max = $var_Max - $var_Min;\n\n $V = $var_Max;\n\n if ($del_Max == 0) {\n $H = 0;\n $S = 0;\n } else {\n $S = $del_Max / $var_Max;\n\n $del_R = ( ( ( $var_Max - $var_R ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n $del_G = ( ( ( $var_Max - $var_G ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n $del_B = ( ( ( $var_Max - $var_B ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n\n if ($var_R == $var_Max) $H = $del_B - $del_G;\n else if ($var_G == $var_Max) $H = ( 1 / 3 ) + $del_R - $del_B;\n else if ($var_B == $var_Max) $H = ( 2 / 3 ) + $del_G - $del_R;\n\n if ($H<0) $H++;\n if ($H>1) $H--;\n }\n\n $R = min(max((int)($H * 255), 0), 255);\n $G = min(max((int)($S * 255), 0), 255);\n $B = min(max((int)($V * 255), 0), 255);\n}",
"function getRGBFill(){}",
"public function toRGB()\n {\n $hue = $this->hue / 360;\n $saturation = $this->saturation / 100;\n $value = $this->value / 100;\n if ($saturation == 0) {\n $red = $value * 255;\n $green = $value * 255;\n $blue = $value * 255;\n } else {\n $var_h = $hue * 6;\n $var_i = floor($var_h);\n $var_1 = $value * (1 - $saturation);\n $var_2 = $value * (1 - $saturation * ($var_h - $var_i));\n $var_3 = $value * (1 - $saturation * (1 - ($var_h - $var_i)));\n\n if ($var_i == 0) {\n $var_r = $value;\n $var_g = $var_3;\n $var_b = $var_1;\n } elseif ($var_i == 1) {\n $var_r = $var_2;\n $var_g = $value;\n $var_b = $var_1;\n } elseif ($var_i == 2) {\n $var_r = $var_1;\n $var_g = $value;\n $var_b = $var_3;\n } elseif ($var_i == 3) {\n $var_r = $var_1;\n $var_g = $var_2;\n $var_b = $value;\n } else {\n if ($var_i == 4) {\n $var_r = $var_3;\n $var_g = $var_1;\n $var_b = $value;\n } else {\n $var_r = $value;\n $var_g = $var_1;\n $var_b = $var_2;\n }\n }\n\n $red = round($var_r * 255);\n $green = round($var_g * 255);\n $blue = round($var_b * 255);\n }\n return new RGB($red, $green, $blue);\n }",
"function imagecolorclosesthwb($image, $red, $green, $blue){}",
"function rgbtohex(string $t_rgb){\n\n // Prende il contenuto fra parentesi\n $rgbcsv = substr($t_rgb, 4, -1);\n\n // Fa split su ','\n $rgbarray = explode(',', $rgbcsv);\n\n $dec_r = $rgbarray[0]; // valore decimale r\n $dec_g = $rgbarray[1]; // valore decimale g\n $dec_b = $rgbarray[2]; // valore decimale b\n\n // evito che i valori siano maggiori di 255\n if ($dec_r > 255){\n $dec_r = 255;\n }\n if ($dec_g > 255){\n $dec_g = 255;\n }\n if ($dec_b > 255){\n $dec_b = 255;\n }\n\n $hex_r = dechex($dec_r); // conversione r in hex\n $hex_g = dechex($dec_g); // conversione g in hex\n $hex_b = dechex($dec_b); // conversione b in hex\n\n // conversioni in stringhe\n $hex_r = \"$hex_r\";\n $hex_g = \"$hex_g\";\n $hex_b = \"$hex_b\";\n\n // i numeri hex devono essere due per colore: \n // risolve problema: #0x -> x -> #x\n if (strlen($hex_r) == 1){\n $hex_r = \"0\" . $hex_r;\n }\n if (strlen($hex_g) == 1){\n $hex_g = \"0\" . $hex_g;\n }\n if (strlen($hex_b) == 1){\n $hex_b = \"0\" . $hex_b;\n }\n\n if($GLOBALS['boold']){\n // visualizzazione debug\n echo \"dec_r = $dec_r -> $hex_r <br />\";\n echo \" dec_g = $dec_g -> $hex_g <br />\";\n echo \" dec_b = $dec_b -> $hex_b <br /><br />\";\n }\n\n // return stringa \"hex\"\n return \"#$hex_r$hex_g$hex_b\";\n }",
"public function toRgb();",
"function hsv2hex($h, $s, $v)\n {\n $s /= 256.0;\n $v /= 256.0;\n if ($s == 0.0) {\n $r = $g = $b = $v;\n return '';\n } else {\n $h = $h / 256.0 * 6.0;\n $i = floor($h);\n $f = $h - $i;\n\n $v *= 256.0;\n $p = (integer)($v * (1.0 - $s));\n $q = (integer)($v * (1.0 - $s * $f));\n $t = (integer)($v * (1.0 - $s * (1.0 - $f)));\n switch($i) {\n case 0:\n $r = $v;\n $g = $t;\n $b = $p;\n break;\n\n case 1:\n $r = $q;\n $g = $v;\n $b = $p;\n break;\n\n case 2:\n $r = $p;\n $g = $v;\n $b = $t;\n break;\n\n case 3:\n $r = $p;\n $g = $q;\n $b = $v;\n break;\n\n case 4:\n $r = $t;\n $g = $p;\n $b = $v;\n break;\n\n default:\n $r = $v;\n $g = $p;\n $b = $q;\n break;\n }\n }\n return Image_Color::rgb2hex(array($r, $g, $b));\n }",
"function HEX_TO_HSL ($hexcode) {\n\n $redhex = substr($hexcode,0,2);\n $greenhex = substr($hexcode,2,2);\n $bluehex = substr($hexcode,4,2);\n\n $var_r = (hexdec($redhex)) / 255;\n $var_g = (hexdec($greenhex)) / 255;\n $var_b = (hexdec($bluehex)) / 255;\n\n $var_min = min($var_r,$var_g,$var_b);\n $var_max = max($var_r,$var_g,$var_b);\n $del_max = $var_max - $var_min;\n\n $l = ($var_max + $var_min) / 2;\n\n if ($del_max == 0)\n {\n $h = 0;\n $s = 0;\n }\n else\n {\n if ($l < 0.5)\n {\n $s = $del_max / ($var_max + $var_min);\n }\n else\n {\n $s = $del_max / (2 - $var_max - $var_min);\n };\n\n $del_r = ((($var_max - $var_r) / 6) + ($del_max / 2)) / $del_max;\n $del_g = ((($var_max - $var_g) / 6) + ($del_max / 2)) / $del_max;\n $del_b = ((($var_max - $var_b) / 6) + ($del_max / 2)) / $del_max;\n\n if ($var_r == $var_max)\n {\n $h = $del_b - $del_g;\n }\n elseif ($var_g == $var_max)\n {\n $h = (1 / 3) + $del_r - $del_b;\n }\n elseif ($var_b == $var_max)\n {\n $h = (2 / 3) + $del_g - $del_r;\n };\n\n if ($h < 0)\n {\n $h += 1;\n };\n\n if ($h > 1)\n {\n $h -= 1;\n };\n }\n\n $HSL['0'] = $h;\n $HSL['1'] = $s;\n $HSL['2'] = $l;\n\n return $HSL;\n\n}",
"function imagecolorclosesthwb ($image, $red, $green, $blue) {}",
"function rgb_cmy($r,$g,$b) {\n\treturn array(1 - ( $r / 255 ),1 - ( $g / 255 ),1 - ( $b / 255 )); // c,m,y entre 0 et 1\n}",
"function mts_hsl_to_hex( $hsl = array() ) {\n\n\tlist( $H, $S, $L ) = array( $hsl['H'] / 360, $hsl['S'], $hsl['L'] );\n\n\tif ( $S == 0 ) {\n\t\t$r = $L * 255;\n\t\t$g = $L * 255;\n\t\t$b = $L * 255;\n\t} else {\n\n\t\tif ( $L < 0.5 ) {\n\t\t\t$var_2 = $L * ( 1 + $S );\n\t\t} else {\n\t\t\t$var_2 = ( $L + $S ) - ( $S * $L );\n\t\t}\n\n\t\t$var_1 = 2 * $L - $var_2;\n\n\t\t$r = round( 255 * mts_huetorgb( $var_1, $var_2, $H + ( 1 / 3 ) ) );\n\t\t$g = round( 255 * mts_huetorgb( $var_1, $var_2, $H ) );\n\t\t$b = round( 255 * mts_huetorgb( $var_1, $var_2, $H - ( 1 / 3 ) ) );\n\t}\n\n\t// Convert to hex\n\t$r = dechex( $r );\n\t$g = dechex( $g );\n\t$b = dechex( $b );\n\n\t// Make sure we get 2 digits for decimals\n\t$r = ( strlen( \"\" . $r ) === 1 ) ? \"0\" . $r : $r;\n\t$g = ( strlen( \"\" . $g ) === 1 ) ? \"0\" . $g : $g;\n\t$b = ( strlen( \"\" . $b ) === 1 ) ? \"0\" . $b : $b;\n\n\treturn $r . $g . $b;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optional. Type of the article suggestion model. If not provided, model_type is used. Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 3 [(.google.api.field_behavior) = OPTIONAL]; | public function setTrainingModelType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\ModelType::class);
$this->training_model_type = $var;
return $this;
} | [
"public function setModelTypeId($var)\n {\n GPBUtil::checkString($var, True);\n $this->model_type_id = $var;\n\n return $this;\n }",
"public function getModelType()\n {\n return $this->modelType;\n }",
"public function setModelVariant($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\SpeechModelVariant::class);\n $this->model_variant = $var;\n\n return $this;\n }",
"public function setModel($var)\n {\n GPBUtil::checkString($var, True);\n $this->model = $var;\n\n return $this;\n }",
"public function setConversationModelConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\V2\\HumanAgentAssistantConfig\\ConversationModelConfig::class);\n $this->conversation_model_config = $var;\n\n return $this;\n }",
"public function setSpeechModelVariant($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dialogflow\\V2\\SpeechModelVariant::class);\n $this->speech_model_variant = $var;\n\n return $this;\n }",
"public function setModelExplanation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ModelExplanation::class);\n $this->model_explanation = $var;\n\n return $this;\n }",
"public function setModel($var)\n {\n GPBUtil::checkMessage($var, \\Clarifai\\Internal\\_Model::class);\n $this->model = $var;\n\n return $this;\n }",
"public function getTypeModel()\n {\n if (!$this->hasData('type_model')) {\n if ($blockType = $this->_getData('block_type')) {\n $rewritingClassName = $this->_getData('rewriting_class_name');\n $typeModels = $this->getGridTypeConfig()->getTypesModels();\n \n foreach ($typeModels as $code => $typeModel) {\n if ($typeModel->isAppliableToGridBlock($blockType, $rewritingClassName)) {\n $this->addData(\n array(\n 'type_code' => $code,\n 'type_model' => $typeModel,\n 'base_type_model' => $typeModel,\n )\n );\n break;\n }\n }\n \n if (($forcedTypeCode = $this->_getData('forced_type_code'))\n && isset($typeModels[$forcedTypeCode])) {\n $this->setData('type_model', $typeModels[$forcedTypeCode]);\n } \n } else {\n $this->unsetData('type_code');\n \n $defaultTypeModel = Mage::getSingleton('customgrid/grid_type_default');\n $this->setData('type_model', $defaultTypeModel);\n $this->setData('base_type_model', $defaultTypeModel);\n }\n }\n return $this->_getData('type_model');\n }",
"protected function setModelType(): void\n {\n $namespaceArray = explode('\\\\', get_class($this));\n $lastPart = end($namespaceArray);\n $this->modelType = strtolower($lastPart);\n }",
"protected function guessModelClass()\n {\n if (empty($this->modelClass)) {\n $this->modelClass = $this->modelPath . str_replace($this->appendName, '', class_basename(get_class($this)));\n }\n\n return $this->modelClass;\n }",
"protected function setModelType(){\n\n $this->modelType = $this->getClassName() . 's';\n\n return $this->modelType;\n\n }",
"public static function determineModelType($typeExt)\n {\n $allModelTypes = [\n self::color(),\n self::concept(),\n self::detectConcept(),\n self::detection(),\n self::embedding(),\n self::faceEmbedding(),\n ];\n foreach ($allModelTypes as $modelType) {\n if ($modelType->typeExt() == $typeExt) {\n return $modelType;\n }\n }\n return null;\n }",
"public function getType() {\n return $this->model->botType;\n }",
"public function getAutomlModel()\n {\n return $this->readOneof(2);\n }",
"protected function defineModel() {\n $this->model = new CandidateModel();\n }",
"public function getModelType() : int\n {\n $data = $data ?? $this->getStoreAsArray();\n\n switch (true) {\n case isset($data['meta']):\n return self::MODEL_TYPE_PHR;\n case isset($data[0]['proof']):\n return self::MODEL_TYPE_GPR;\n case isset($data[0]['proof_index']):\n return self::MODEL_TYPE_PVR;\n default:\n return 0;\n }\n }",
"protected function getModel(): string|null\n\t{\n\t\t$model = trim($this->getModelInput());\n\n\t\tif (! $model && $this->guessModel()) {\n\t\t\t$model = Str::singular(last(Str::ucsplit($this->getNameInput())));\n\t\t}\n\n\t\treturn $model ? $this->qualifyModel($model) : null;\n\t}",
"protected function getModelFormClass()\n {\n return 'XLite\\Module\\XCExample\\Recommendations\\View\\Model\\Recommendation';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END FUNCTION ================================================================ ================================================================ Function: Captcha Form JS Cookie Name | public static function jscookiename($y_form_name) {
//--
$y_form_name = trim((string)$y_form_name);
//--
return 'SmartCaptcha_DATA_'.sha1($y_form_name.SMART_FRAMEWORK_SECURITY_KEY);
//--
} | [
"function getCaptchaFieldName()\n\t{\t\t\n\t\treturn \"_register_captcha\";\n\t}",
"public function getCookieFormKey()\n {\n return Mage::getSingleton('core/cookie')->get(self::FORMKEY_COOKIE);\n }",
"protected static function getCookieName()\n {\n return 'rex_' . static::$addon_name . '_' . static::$plugin_name;\n }",
"static function getCookieName() {\n\n $conf = sfConfig::get('apoll_settings_submission');\n\n return isset($conf['cookie_name']) ? $conf['cookie_name'] : 'aPoll_submission';\n }",
"public static function getCookieName() {}",
"function form_input_captcha()\n{\n $tabindex = get_form_field_tabindex(null);\n\n $code_needed = $GLOBALS['SITE_DB']->query_select_value_if_there('captchas', 'si_code', array('si_session_id' => get_session_id()));\n if (is_null($code_needed)) {\n generate_captcha();\n }\n\n // Show template\n $input = do_template('FORM_SCREEN_INPUT_CAPTCHA', array('_GUID' => 'f7452af9b83db36685ae8a86f9762d30', 'TABINDEX' => strval($tabindex)));\n return _form_input('captcha', do_lang_tempcode('SECURITY_IMAGE'), do_lang_tempcode('DESCRIPTION_CAPTCHA'), $input, true, false);\n}",
"function getCaptchaText()\n{\n return substr(md5(date(\"U\") . rand(1, 99999)), 0, -26);\n}",
"function _preserve_post_cookie_name() {\n\t\treturn 'praized_'.$this->_config['community'].'_post_holder';\n\t}",
"function get_css_cookie_name(string $name)\n{\n return sprintf(\"CSS_CACHED_%s\", strtoupper($name));\n}",
"function Forms_poser_cookie_sondage() {\n\tif ($id_form = intval($_POST['id_form'])) {\n\t\t$nom_cookie = $GLOBALS['cookie_prefix'].'cookie_form_'.$id_form;\n\t\t// Ne generer un nouveau cookie que s'il n'existe pas deja\n\t\tif (!$cookie = $_COOKIE[$nom_cookie]) {\n\t\t\tinclude_spip(\"inc/session\");\n\t\t\t$cookie = creer_uniqid();\n\t\t}\n\t\t$GLOBALS['cookie_form'] = $cookie; // pour utilisation dans inc_forms...\n\t\t// Expiration dans 30 jours\n\t\tsetcookie($nom_cookie, $cookie, time() + 30 * 24 * 3600);\n\t}\n}",
"public function backup_campaign_cookies()\n {\n // Insert hidden fields\n echo '<input id=\"woochimp_cookie_mc_eid\" name=\"woochimp_data[woochimp_mc_eid]\" type=\"hidden\">\n <input id=\"woochimp_cookie_mc_cid\" name=\"woochimp_data[woochimp_mc_cid]\" type=\"hidden\">';\n\n // Enqueue jQuery cookie (if not yet)\n if (!wp_script_is('jquery-cookie', 'enqueued')) {\n wp_register_script('jquery-cookie', WOOCHIMP_PLUGIN_URL . '/assets/js/jquery.cookie.js', array('jquery'), '1.4.1');\n wp_enqueue_script('jquery-cookie');\n }\n\n // Launch our JS script, which will store cookie values in hidden fields\n wp_register_script('woochimp-cookie', WOOCHIMP_PLUGIN_URL . '/assets/js/woochimp-cookie.js', array('jquery'), WOOCHIMP_VERSION);\n wp_enqueue_script('woochimp-cookie');\n }",
"function captchaSrc()\r\n {\r\n return url('captcha') . '?v=' . time();\r\n }",
"function getName($var){\n preg_match(\"/Set-Cookie:\\s+(.*?)=.*?;/is\",$var,$restr); \n if(count($restr)>=2){\n return $restr[1]; \n }\n return \"\";\n \n}",
"function captcha_info_cb() { ?>\r\n \r\n\t<form action=\"\" method=\"post\">\r\n \r\n\t<p><a href=\"<?php echo admin_url( 'plugins.php#super-simple-contact-form' ); ?>\">This plugin</a> is now available with a reCAPTCHA human verification system for just $5. This will basically eliminate any contact form spam you are getting.</p>\r\n \r\n\t<h3>Learn more on this plugin’s <a href=\"http://shinraholdings.com/plugins/super-simple-contact-form/captcha/\" title=\"Learn more about reCaptcha and this plugin\" target=\"_blank\" style=\"font-weight: bold; text-decoration: none;\">homepage</a>.</h3>\r\n \r\n\t<p style=\"text-align:right;\">\r\n\t\t<input class=\"primary button\" type=\"submit\" name=\"sscf-action\" value=\"Close Forever\" />\r\n\t</p>\r\n </form>\r\n <?php \r\n\t}",
"private function getRandomCaptchaName(string $CaptchaListName):string\n {\n // $CaptchaListName = \"arcaptcha,bibot,recaptcha\";\n // Here we split CaptchaName.\n $CaptchaName = explode( \",\", $CaptchaListName );\n $key = array_rand($CaptchaName);\n // set var _getRandomCaptchaName whit random name \n $this->_getRandomCaptchaName=$CaptchaName[$key];\n return $this->_getRandomCaptchaName;\n }",
"static function get_cookie_name() {\r\n\r\n\t\tstatic $hash;\r\n\r\n\t\tif ( empty( $hash ) ) {\r\n\t\t\t$hash = 'wordpress_tts_theme_' . md5( home_url( '', 'http' ) );\r\n\t\t}\r\n\r\n\t\treturn $hash;\r\n\t}",
"function getCaptchaFieldName()\n\t{\t\t\n\t\treturn $this->pSet->captchaEditFieldName();\n\t}",
"public function set_captcha() {\n\n\t\t// First number from date\n\t\t$number1 = date( 'N' ); // Grab day of the week\n\t\t$number1 = $number1 / 2;\n\t\t$number1 = (int) $number1;\n\n\t\t// Second number from nonce\n\t\t$string = wp_create_nonce( 'spam-killer' ); // Using a nonce since it's semi-random but also consistent over a set time period\n\t\t$number2 = ord( $string ); // Convert string to numerical number\n\t\t$number2 = $number2 / 20;\n\t\t$number2 = (int) $number2;\n\n\t\t$this->captcha_value = $number1 + $number2;\n\t\t$this->captcha_question = $number1 . ' + ' . $number2;\n\t}",
"function formJavascriptClass()\n\t{\n\t\tFabrikHelperHTML::script('javascript.js', 'components/com_fabrik/plugins/element/fabrikcaptcha/', true);\n\t\t$user =& JFactory::getUser();\n\t\t$params =& $this->getParams();\n\t\tif ($params->get('captcha-method') == 'recaptcha' && ($user->id == 0 || (int)$params->get('captcha-showloggedin', 0) == 1)) {\n\t\t\t/*\n\t\t\t$pubkey = $params->get('recaptcha_publickey');\n\t\t\t$src = 'http://www.google.com/recaptcha/api//js/recaptcha_ajax.js';\n\t\t\t$document =& JFactory::getDocument();\n\t\t\t$document->addScript($src);\n\t\t\t*/\n\t\t\tFabrikHelperHTML::script('recaptcha_ajax.js', 'http://www.google.com/recaptcha/api/js/', true);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether this resolver can resolve the value for the given ArgumentMetadata. | public function supports(mixed $data, ArgumentMetadata $argument): bool; | [
"public function supports($data, ArgumentMetadata $argument): bool;",
"public function acceptsArguments()\n {\n return ($this->argumentName !== null);\n }",
"public function argumentValueIsSet(string $name) : bool;",
"public function hasArgument($name)\n {\n return isset($this->arguments[$name]);\n }",
"public function existArgumentsInAttribute(array $arguments, ReflectionAttribute $attribute): bool;",
"public function has_argument($name) {\n if (isset($this->_request_arguments[$name])) {\n return true;\n } else {\n return false;\n }\n }",
"public function has(string $key): bool\n {\n $argument = $this->arguments[$key] ?? null;\n\n if ($argument === null) {\n return false;\n }\n\n return $argument->value !== null;\n }",
"public function hasContentArgument($key)\n {\n return (bool) isset($this->arguments[$key]);\n }",
"public function isArgumentValue($argument, $value) {\n $arguments = $this->getArguments();\n return isset($arguments[$argument]) && $arguments[$argument] == $value;\n }",
"public function defined($name, array $argv = null)\n {\n // The argument isn't defined if it's not defined by the calling code.\n if (!$this->exists($name)) {\n return false;\n }\n\n $argument = $this->arguments[$name];\n $command_arguments = $this->getArguments($argv);\n\n foreach ($command_arguments as $command_argument) {\n if ($this->isArgument($argument, $command_argument)) {\n return true;\n }\n }\n\n return false;\n }",
"public function hasValidArguments($args): bool;",
"public function hasArgument($name);",
"public function resolveCanProcess(TypeResolverInterface $typeResolver, string $directiveName, array $directiveArgs = [], string $field, array &$variables): bool;",
"public function resolveCanProcess(TypeResolverInterface $typeResolver, string $fieldName, array $fieldArgs = []): bool;",
"public function hasArgumentsList()\n {\n return $this->arguments !== null;\n }",
"public function hasArgumentByShortName($name)\n\t{\n\t\tforeach ($this->arguments as $arg) {\n\t\t\tif ($arg->getShortName() == $name) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function hasArgument($name)\n {\n return $this->_input->hasArgument($name);\n }",
"protected function authorizeViewArgument(array $arguments)\n {\n foreach ($arguments as $argument) {\n if (!$this->argumentAcl->canView($argument)) {\n return false;\n }\n }\n\n return true;\n }",
"public function hasArgumentAtPosition($position)\n {\n return isset($this->arguments[$position]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a preapproval payment | public function create_preapproval_payment($preapproval_payment) {
$request = array(
"uri" => "/preapproval",
"params" => array(
"access_token" => $this->get_access_token()
),
"data" => $preapproval_payment
);
$preapproval_payment_result = MPRestClient::post($request);
return $preapproval_payment_result;
} | [
"public function create_preapproval_payment($preapproval_payment) {\n $access_token = $this->get_access_token();\n\n $preapproval_payment_result = MPRestClient::post(\"/preapproval?access_token=\" . $access_token, $preapproval_payment);\n return $preapproval_payment_result;\n }",
"public function create_preapproval_payment( $preapproval_payment ) {\n\t\t$request = array(\n\t\t\t'uri' => '/preapproval',\n\t\t\t'params' => array( 'access_token' => $this->get_access_token() ),\n\t\t\t'data' => $preapproval_payment,\n\t\t);\n\t\t$preapproval_payment_result = MPRestClient::post( $request );\n\t\treturn $preapproval_payment_result;\n\t}",
"function CallPreapproval( $returnUrl, $cancelUrl, $currencyCode, \n $startingDate, $endingDate, $maxTotalAmountOfAllPayments,\n $senderEmail, $maxNumberOfPayments, $paymentPeriod, $dateOfMonth, \n $dayOfWeek, $maxAmountPerPayment, $maxNumberOfPaymentsPerPeriod, $pinType )\n {\n /* Gather the information to make the Preapproval call.\n The variable nvpstr holds the name-value pairs.\n */\n\n // required fields\n $nvpstr = \"returnUrl=\" . urlencode($returnUrl) . \"&cancelUrl=\" . urlencode($cancelUrl);\n $nvpstr .= \"¤cyCode=\" . urlencode($currencyCode) . \"&startingDate=\";\n $nvpstr .= urlencode($startingDate) . \"&endingDate=\" . urlencode($endingDate);\n $nvpstr .= \"&maxTotalAmountOfAllPayments=\" . urlencode($maxTotalAmountOfAllPayments);\n\n // optional fields\n if (\"\" != $senderEmail)\n {\n $nvpstr .= \"&senderEmail=\" . urlencode($senderEmail);\n }\n\n if (\"\" != $maxNumberOfPayments)\n {\n $nvpstr .= \"&maxNumberOfPayments=\" . urlencode($maxNumberOfPayments);\n }\n\n if (\"\" != $paymentPeriod)\n {\n $nvpstr .= \"&paymentPeriod=\" . urlencode($paymentPeriod);\n }\n\n if (\"\" != $dateOfMonth)\n {\n $nvpstr .= \"&dateOfMonth=\" . urlencode($dateOfMonth);\n }\n\n if (\"\" != $dayOfWeek)\n {\n $nvpstr .= \"&dayOfWeek=\" . urlencode($dayOfWeek);\n }\n\n if (\"\" != $maxAmountPerPayment)\n {\n $nvpstr .= \"&maxAmountPerPayment=\" . urlencode($maxAmountPerPayment);\n }\n\n if (\"\" != $maxNumberOfPaymentsPerPeriod)\n {\n $nvpstr .= \"&maxNumberOfPaymentsPerPeriod=\" . urlencode($maxNumberOfPaymentsPerPeriod);\n }\n\n if (\"\" != $pinType)\n {\n $nvpstr .= \"&pinType=\" . urlencode($pinType);\n }\n\n /* Make the Preapproval call to PayPal */\n $resArray = hash_call(\"Preapproval\", $nvpstr);\n\n /* Return the response array */\n return $resArray;\n }",
"public function actionCreate()\n {\n $model = new LoanRepaymentPrepaid();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->prepaid_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"protected function createRegularPaymentPOST()\n {\n $IsLive = $this->mode=='TEST'?false:true;\n $paynet = new \\PaynetClient($this->account->secret_key, $IsLive);\n \n $paymentParams \t\t\t\t = new \\PaymentParameters();\n $paymentParams->amount \t = (string) $this->amountFormat($this->order->amount);\n $paymentParams->reference_no \t= (string) $this->order->id;\n $paymentParams->pan \t = $this->card->number;\n $paymentParams->month \t = $this->card->month;\n $paymentParams->year \t = $this->card->year;\n $paymentParams->cvc \t = (string) $this->card->cvv;\n $paymentParams->card_holder_mail= (string) filter_var($this->order->email, FILTER_VALIDATE_EMAIL)?$this->order->email:\"msn@msn.com\";\n $paymentParams->description \t= (string) isset($this->order->description)?$this->order->description:\"\";\n if($this->account->is_installment){\n $paymentParams->instalment \t= (int) $this->order->installment?:0;\n }\n $paymentParams->add_commission \t= $this->account->is_commission?true:false;\n\n if($this->account->ratio_code){\n $paymentParams->ratio_code \t= (string) $this->account->ratio_code;\n }\n if($this->account->agent_id){\n $paymentParams->agent_id \t= (string) $this->account->agent_id;\n }\n $paymentParams->transaction_type= (int) $this->type;\n\n $result \t\t\t= $paynet->PaymentPost($paymentParams);\n $XactId \t\t\t= $result->xact_id;\n $this->data = $result;\n if($result->is_succeed == true and filter_var($this->order->email, FILTER_VALIDATE_EMAIL) and $this->account->is_slip_post==true){\n $SlipParams \t\t\t\t= new \\SlipParameters();\n $SlipParams->xact_id \t \t= (string) $XactId;\n $SlipParams->email \t\t\t= (string) $this->order->email;\n $SlipParams->send_mail\t\t= true;\n $SlipResult\t\t \t\t\t= $paynet->SlipPost($SlipParams);\n }\n return $this;\n }",
"public function paypalCreatePayment(){\n \n if(!$_REQUEST['Amount']){\n $this->setMessage('warning', \"Invalid amount!\");\n return $this->redirectBack();\n }\n \n $member = Security::getCurrentUser();\n $payment = new \\Payment();\n $payment->Amount = $_REQUEST['Amount'];\n $payment->Gateway = 'Paypal';\n $payment->Status = 'Pending';\n $payment->MemberID = $member->ID;\n $payment->write();\n \n $apiContext = $this->getPaypalApiContext();\n \n $payer = new \\PayPal\\Api\\Payer();\n $payer->setPaymentMethod('paypal');\n \n \n $usd = $this->convertCurrency($_REQUEST['Amount']);\n if(!$usd){\n $this->setMessage('warning', \"Could not process, please try again!\");\n return $this->redirect('/dashboard');\n }\n \n $amount = new \\PayPal\\Api\\Amount();\n $amount->setTotal($usd);\n $amount->setCurrency('USD');\n \n $transaction = new \\PayPal\\Api\\Transaction();\n $transaction->setAmount($amount);\n \n $redirectUrls = new \\PayPal\\Api\\RedirectUrls();\n $redirectUrls->setReturnUrl(Director::absoluteBaseURL().\"dashboard/paypalExecutePayment?pid=\".$payment->ID)\n ->setCancelUrl(Director::absoluteBaseURL().\"dashboard?status=cancel\");\n \n $payment = new \\PayPal\\Api\\Payment();\n $payment->setIntent('sale')\n ->setPayer($payer)\n ->setTransactions(array($transaction))\n ->setRedirectUrls($redirectUrls);\n \n // After Step 3\n try {\n $payment->create($apiContext);\n //echo $payment;\n return $this->redirect($payment->getApprovalLink());\n //echo \"\\n\\nRedirect user to approval_url: \" . $payment->getApprovalLink() . \"\\n\";\n }\n catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n // This will print the detailed information on the exception.\n //REALLY HELPFUL FOR DEBUGGING\n //echo $ex->getData();\n }\n $this->setMessage('warning', \"Could not process, please try again!\");\n return $this->redirect('/dashboard');\n }",
"protected function genPrePay()\n {\n $package = $this->preparePackage();\n $data = array(\n \"appid\" => $this->getAppId(),\n \"traceid\" => $this->getOrder()->getTraceid(),\n \"noncestr\" => $this->getNonceStr(),\n \"package\" => $package,\n \"timestamp\" => $this->getTimestamp(),\n \"app_signature\" => $this->getAppSignature($package),\n \"sign_method\" => self::TENPAY_SIGN_METHOD\n );\n return $this->sendRequest($this->getGenPrePayUrl(), $data);\n }",
"public function get_preapproval_payment($id) {\n $access_token = $this->get_access_token();\n\n $preapproval_payment_result = MPRestClient::get(\"/preapproval/{$id}?access_token=\" . $access_token);\n return $preapproval_payment_result;\n }",
"public function manualpaymentAction() {\n\t\t$entry = array(\n\t\t\t\"date\" => $this->getRequest()->getParam( 'date', false ),\n\t\t\t\"name\" => $this->getRequest()->getParam( 'name', false ),\n\t\t\t\"account\" => $this->getRequest()->getParam( 'account', false ),\n\t\t\t\"amount\" => $this->getRequest()->getParam( 'amount', false ),\n\t\t\t\"type\" => $this->getRequest()->getParam( 'type', false ),\n\t\t\t\"mutation\" => $this->getRequest()->getParam( 'mutation', false ),\n\t\t\t\"remarks\" => $this->getRequest()->getParam( 'remarks', false ),\n\t\t\t\"identifier\" => $this->getRequest()->getParam( 'identifier', false )\n\t\t);\n\n\t\t// Create a new bankitem\n\t\t$bankmodel = Mage::getModel( 'bankintegration/bankintegration' );\n\t\t$bankmodel->setData( $entry );\n\t\t$bankmodel->save();\n\n\t\t// Return to the overview page\n\t\tMage::getSingleton( 'adminhtml/session' )->addSuccess( Mage::helper( 'bankintegration' )->__( 'Manual payment added.' ) );\n\t\t$this->getResponse()->setRedirect( $this->getUrl( '*/review/all/' ) );\n\t}",
"function _prePayment( $data )\n {\n // prepare the payment form\n Tienda::load( 'TiendaHelperBase', 'helpers._base' );\n $helper = TiendaHelperBase::getInstance();\n \n $params = $this->get('params', array());\n \n $vars = new JObject();\n $vars->action = $params->get('action', '1');\n $vars->track_id = $data['order_id'];\n $vars->orderpayment_id = $data['orderpayment_id'];\n $vars->total = number_format($data['orderpayment_amount'], 2, \".\", \"\");\n $vars->email = JFactory::getUser()->email;\n \n $vars->response_url = JURI::base().'plugins/tienda/'.$this->_element.'/tmpl/response.php';\n $vars->error_url = JURI::base().'plugins/tienda/'.$this->_element.'/tmpl/error.php';\n \n \n // Is Demo or production?\n if($this->params->get('demo', '0') == 0){\n \t$vars->url = 'https://www.constriv.com/cg/servlet/PaymentInitHTTPServlet';\n \t$vars->account_id = $params->get('account_id', '');\n \t$vars->password = $params->get('password', '');\n } else{\n \t$vars->url = 'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet';\n \t$vars->account_id = $params->get('account_id_demo', '');\n \t$vars->password = $params->get('password_demo', '');\n }\n \n $vars->currency = $params->get('currency', '978');\n \n \n // Language\n \t\tif ($this->params->get('language', 'auto') == 'auto')\n \t\t{\n \t// automatic language from joomla\n \t\t\tjimport('joomla.language.helper');\n \t\t\t$lang = JLanguageHelper::detectLanguage();\n // TODO Use JFactory::getLanguage(); \n // and explode the language's code by the '-' to get the var->lang for 2CO\n \t\t\tswitch($lang)\n \t\t\t{\n \t\t\t\tcase \"es-ES\":\n \t\t\t\t\t$vars->language = \"ESP\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"en-US\":\n \t\t\t\t\t$vars->language = \"USA\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"de-DE\":\n \t\t\t\t\t$vars->language = \"DEU\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"fr-FR\":\n \t\t\t\t\t$vars->language = \"FRA\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"it-IT\":\n \t\t\t\t\t$vars->language = \"ITA\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"en-GB\":\n \t\t\t\tdefault: \t \n \t\t\t\t\t$vars->language = 'ENG';\n \t\t\t\t\tbreak;\n \t\t\t}\n \t\t\t\n } else{\n \t$vars->language = $this->params->get('language', 'ENG');\n }\n \n $data = new JObject();\n \n // Check the parameters!!\n\t\t //Apro la connessione\n\t\t $ch=curl_init($vars->url);\n\n\t\t $DataToSend =\"id=$vars->account_id&password=$vars->password&action=$vars->action&amt=\".$vars->total.\"&currencycode=$vars->currency&langid=\".$vars->language.\"&responseURL=$vars->response_url&errorURL=$vars->error_url&trackid=$vars->track_id&udf3=EMAILADDR:\".$vars->email.\"&udf1=\".$vars->orderpayment_id;\n\t\t \n\t\t //Imposto gli headers HTTP\n\t\t //imposto curl per protocollo https\n\t\t curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t curl_setopt($ch,CURLOPT_POST,1);\n\t\t \n\t\t //Invio i dati\n\t\t curl_setopt($ch,CURLOPT_POSTFIELDS,$DataToSend);\n\t\t \n\t\t //imposta la variabile PHP \n\t\t curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1); \n\t\t \n\t\t //Ricevo la risposta dal server\n\t\t $varResponse=curl_exec($ch); \n\t\t \n\t\t //chiudo la connessione \n\t\t curl_close($ch); \n\t\t \n\t\t if (substr($varResponse,0,7) == '!ERROR!') {\n\t\t \n\t\t \t\t$data->error = 1;\n\t\t \t\t$data->message = $varResponse;\n\t\t \n\t\t } else {\n\t\t \n\t\t \t\t//Separo il contenuto della stringa ricevuta (PaymentID:RedirectURL)\n\t\t \t\t \t\t\n\t\t \t\t$varPosiz= strpos($varResponse, ':http');\n\t\t \t\t$varPaymentId= substr($varResponse,0,$varPosiz);\n\t\t \t\t$nc=strlen($varResponse);\n\t\t \t\t$nc=($nc-17);\n\t\t \t\t$varRedirectURL=substr($varResponse,$varPosiz+1);\n\t\t \n\t\t\t\t//Creo l'URL di redirezione\n\t\t \t\t$varRedirectURL =\"$varRedirectURL?PaymentID=$varPaymentId\";\n\t\t \t\t//echo $varRedirectURL;\n\t\t\t\t\n\t\t\t\t//Redirezione finale del browser sulla HPP\n\t\t \t\t$data->error = 0;\n\t\t \t\t$data->redirect = $varRedirectURL;\n\t\t}\n \n\t\t\n $html = $this->_getLayout('prepayment', $data);\n //$html = \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$varRedirectURL\\\">\";\n return $html;\n }",
"public function addNewPreauthorisationRequest() {\n return $this->addNewTxn(self::getNewTxnByType(self::PREAUTHORISE));\n }",
"public function makePayment()\n {\n }",
"function _prePayment( $data )\n {\n // prepare the payment form\n Tienda::load( 'TiendaHelperBase', 'helpers._base' );\n $helper = TiendaHelperBase::getInstance();\n \n $vars = new JObject();\n $vars->cart_order_id = $data['order_id'].$helper->getToday();\n $vars->merchant_order_id = $data['order_id'];\n $vars->orderpayment_id = $data['orderpayment_id'];\n $vars->total = $data['orderpayment_amount'];\n \n $vars->x_Receipt_Link_URL = JURI::base().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n \n // Destination\n if($this->params->get('page', 'single') == 'single'){\n \t$vars->url = 'https://www.2checkout.com/checkout/spurchase';\n } else{\n \t$vars->url = 'https://www.2checkout.com/checkout/purchase';\n \t// Payment type\n \t$vars->pay_method = $this->params->get('pay_method', 'CC');\n }\n \n // Sandbox mode?\n if($this->params->get('sandbox', '0') == 1) \n \t$vars->url = \"http://developers.2checkout.com/return_script/\";\n \n // 2Checkout account number\n $vars->sid = $this->params->get('sid', '0');\n \n // Demo Mode?\n \t\tif($this->params->get('demo', '0') == 1){\n \t$vars->demo = true;\n } else{\n \t$vars->demo = false;\n }\n \n // Language\n \t\tif ($this->params->get('automatic_language', '0') == 1)\n \t\t{\n \t// automatic language from joomla\n \t\t\tjimport('joomla.language.helper');\n \t\t\t$lang = JLanguageHelper::detectLanguage();\n // TODO Use JFactory::getLanguage(); \n // and explode the language's code by the '-' to get the var->lang for 2CO\n \t\t\tswitch($lang)\n \t\t\t{\n \t\t\t\t// Do more than these two\n \t\t\t\tcase \"it-IT\":\n \t\t\t\t\t$vars->lang = \"it\";\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"en-GB\":\n \t\t\t\tdefault: \t \n \t\t\t\t\t$vars->lang = 'en';\n \t\t\t\t\tbreak;\n \t\t\t}\n \t\t\t\n } else{\n \t$vars->lang = $this->params->get('default_language', 'en');\n }\n \n // Skip Landing\n if($this->params->get('skip_landing', '0') == 1)\n \t$vars->skip_landing = true;\n else\n \t$vars->skip_landing = false;\n \t\n // Billing Address\n $vars->first_name = $data['orderinfo']->billing_first_name;\n $vars->last_name = $data['orderinfo']->billing_last_name;\n $vars->email = $data['orderinfo']->user_email;\n $vars->street_address = $data['orderinfo']->billing_address_1;\n $vars->street_address2 = $data['orderinfo']->billing_address_2;\n $vars->city = $data['orderinfo']->billing_city;\n $vars->country = $data['orderinfo']->billing_country_name;\n $vars->state = $data['orderinfo']->billing_zone_name;\n $vars->zip = $data['orderinfo']->billing_postal_code;\n \n // Shipping Address\n $vars->ship_name = $data['orderinfo']->shipping_first_name. \" \" . $data['orderinfo']->shipping_last_name;\n $vars->ship_street_address = $data['orderinfo']->shipping_address_1;\n $vars->ship_street_address2 = $data['orderinfo']->shipping_address_2;\n $vars->ship_city = $data['orderinfo']->shipping_city;\n $vars->ship_country = $data['orderinfo']->shipping_country_name;\n $vars->ship_state = $data['orderinfo']->shipping_zone_name;\n $vars->ship_zip = $data['orderinfo']->shipping_postal_code;\n \n $html = $this->_getLayout('prepayment', $vars);\n return $html;\n }",
"public function requiresPrePayment() {\n\t\treturn FALSE;\n\t}",
"public function createPayment($data) {\n\t\t$params = array(\n\t\t\t'AccountId' => $data['Customer']['Connection'][0]['value']['Account']['Id'],\n\t\t\t'InvoiceId' => NULL,\n\t\t\t'Amount' => $data['Transaction']['total'],\n\t\t\t'IsDebit' => false, // IsDebit indicates whether this Payment is a refund.\n\t\t\t'InvoiceNumber' => NULL,\n\t\t\t'PurchaseOrderNumber' => NULL,\n\t\t\t'OrderId' => $data['Transaction']['id'],\n\t\t\t'Description' => __SYSTEM_SITE_NAME, //$data['Transaction']['description'],\n\t\t\t'CVV' => $data['Transaction']['card_sec'],\n\t\t\t'PaymentSubType' => $data['Transaction']['paymentSubType'],\n\t\t\t'Id' => 0\n\t\t); \n\t\treturn $this->_sendRequest('POST', '/payment', $params);\n\t}",
"function houzez_create_paypal_agreement($package_id, $access_token, $plan_id) {\n global $current_user;\n wp_get_current_user();\n $userID = $current_user->ID;\n $blogInfo = esc_url( home_url() );\n\n $host = 'https://api.sandbox.paypal.com';\n $is_paypal_live = houzez_option('paypal_api');\n if( $is_paypal_live =='live'){\n $host = 'https://api.paypal.com';\n }\n\n $time = time();\n $date = date('Y-m-d H:i:s',$time);\n\n $packPrice = get_post_meta($package_id, 'fave_package_price', true );\n $packName = get_the_title($package_id);\n $billingPeriod = get_post_meta( $package_id, 'fave_billing_time_unit', true );\n $billingFreq = intval( get_post_meta( $package_id, 'fave_billing_unit', true ) );\n\n $submissionCurency = houzez_option('currency_paid_submission');\n $return_url = houzez_get_template_link('template/template-thankyou.php');\n $plan_description = $packName.' '.esc_html__('Membership payment on ','houzez').$blogInfo;\n $return_url = houzez_get_template_link('template/template-thankyou.php');\n\n $url = $host.'/v1/payments/billing-agreements/';\n\n\n $billing_agreement = array(\n 'name' => $packName,\n 'description' => $plan_description,\n 'start_date' => gmdate(\"Y-m-d\\TH:i:s\\Z\", time()+100 ),\n \n );\n \n $billing_agreement['payer'] = array(\n 'payment_method'=>'paypal',\n 'payer_info' => array('email'=>'payer@example.com'),\n );\n \n $billing_agreement['plan'] = array(\n 'id' => $plan_id,\n );\n \n $json = json_encode($billing_agreement);\n $json_resp = houzez_execute_paypal_request($url, $json,$access_token);\n \n foreach ($json_resp['links'] as $link) {\n if($link['rel'] == 'execute'){\n $payment_execute_url = $link['href'];\n $payment_execute_method = $link['method'];\n } else if($link['rel'] == 'approval_url'){\n $payment_approval_url = $link['href'];\n $payment_approval_method = $link['method'];\n print $payment_approval_url;\n }\n }\n\n $output['payment_execute_url'] = $payment_execute_url;\n $output['access_token'] = $access_token;\n $output['package_id'] = $package_id;\n $output['recursive'] = 1;\n $output['date'] = $date;\n\n $save_output[$userID] = $output;\n update_option('houzez_paypal_package_transfer', $save_output);\n update_user_meta( $userID, 'houzez_paypal_package', $output);\n \n}",
"public function createPayment() \n\t\t{ \n\t\t\tif ($this->isFirstTransaction()) {\n\t\t\t\t$rest_price = 100 - $this->pay_price;\n\t\t\t} else {\n\t\t\t\tif (!$this->isCheckCash()) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t$rest_price = $this->isCheckCash() - $this->pay_price;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t$query = \"INSERT INTO payments (user_id, pay_price, rest_price) VALUES('$this->user_id', '$this->pay_price', '$rest_price')\";\n $result = mysqli_query($this->db, $query);\n\n if ($result ) {\n return true;\n } else {\n return false;\n } \n \n\t\t}",
"public function createReceiptsTest()\n {\n /*$this->number;\n $this->expire;\n $this->amount = '350000';*/\n // ZTest::assertEquals(1, $token);\n\n $token = Az::$app->payer->payme->create();\n vdd(Az::$app->payer->payme->createReceipts());\n }",
"public function make3DPayPayment()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
throw new \Exception ("loadUserByName $username"); | public function loadUserByUsername($username)
{
} | [
"public function loadUserByUsername(string $username)\n {\n }",
"public function loadUserByUsername($username);",
"public function testLoadUnsupportedUsername()\n {\n $provider = new ContaoUserProvider();\n $provider->loadUserByUsername('foo');\n }",
"function testLoadInvalidUserByInvalidUserCode() {\n\t\t$usr = \\Scrivo\\User::fetch(self::$context, \"aa\");\n\t}",
"function loadUserByUsername($username)\n {\n// $user = Usuario->findOneBy(array('username' => $username));\n\n if (empty($user)) {\n throw new UsernameNotFoundException('Could not find user. Sorry!');\n }\n\n $this->user = $user;\n\n return $user;\n }",
"abstract public function fetchUserByUsername($username);",
"function findUserByUsername($username);",
"function getUser($username) {\n\n if (!userExists($username)) {\n throw new IllegalArgumentException(\"Requested user does not exist (or database-error.)\");\n } else {\n $connection = $GLOBALS[\"_connection\"];\n\n $sql = \"SELECT * FROM UserData WHERE Username = '$username' LIMIT 1\";\n $result = mysql_query($sql);\n\n if (!$result) {\n throw new SqlException(mysql_errno($connection) . \": \" . mysql_error($connection) . \"\\n\");\n }\n\n $userdataarray = mysql_fetch_array($result);\n $user = new User($userdataarray[\"Username\"], $userdataarray[\"Password\"], $userdataarray[\"Email\"], $userdataarray[\"ID\"], $userdataarray[\"activeUser\"], $userdataarray[\"lastAction\"]);\n\n return $user;\n }\n}",
"public function retrieveUserByUsername($username);",
"public function loadUserByUsername($username)\n {\n // TODO: Implement loadUserByUsername() method.\n }",
"private function get_username(){\n for($i=0; $i<100; $i++){\n $username = $this->generateRandomString(8);\n if(!$this->username_exist($username)){\n return $username;\n }\n }\n /**\n * We should not end up here.\n */\n throw new Exception(__CLASS__.' says: Could not generate new username in method get_username.');\n }",
"public function testFindUserByUsernameFailed()\n {\n expect_not(User::findByUsername('not-existing'));\n }",
"public function findUserByUsername($username);",
"public function testGetInvalidUserByUserName(): void {\n\t\t// Grab an username that does not exist\n\t\t$user = User::getUserByUserName($this->getPDO(), \"doesnotexist\");\n\t\t$this->assertCount(0, $user);\n\t}",
"public static function fetchUserByUsername($username);",
"public function testFindByUsernameWhenUsernameDoesNotExist()\n {\n\n // Try to get non-existent user.\n $retrievedUser = $this->_usersTable->findByUsername('username');\n $this->assertFalse($retrievedUser);\n\n }",
"public function getUserByUsername(string $username);",
"public function getUserByUsername($username);",
"public function testGetIdByUsernameExceptionUsernameEmpty()\n {\n try {\n $this->_flickr->getIdByUsername('0');\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('supply a username', $e->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ PickTask state : return the list of all unassigned tasks | function argPickTask()
{
return [
'tasks' => Tasks::getUnassigned(),
];
} | [
"public function getUnassignedTasks() {\n\n\n $issueList = array();\n\n $query_projects = \"SELECT project.id \".\n \"FROM `mantis_project_table` as project \".\n \"JOIN `codev_team_project_table` as team_project ON project.id = team_project.project_id \".\n \"WHERE team_project.team_id = $this->id \".\n \"AND team_project.type NOT IN (\".Project::type_noStatsProject.', '.Project::type_sideTaskProject.') ';\n\n $query = \"SELECT * \".\n \"FROM `mantis_bug_table` \".\n \"WHERE project_id IN ($query_projects) \".\n \"AND handler_id = '0' \".\n \"AND status < get_project_resolved_status_threshold(project_id) \".\n \"ORDER BY project_id ASC, id ASC\";\n\n $result = SqlWrapper::getInstance()->sql_query($query);\n if (!$result) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n exit;\n }\n while($row = SqlWrapper::getInstance()->sql_fetch_object($result)) {\n $issueList[$row->id] = IssueCache::getInstance()->getIssue($row->id, $row);\n }\n\n if(self::$logger->isDebugEnabled()) {\n self::$logger->debug(\"getUnassignedTasks(teamid=$this->id) nbIssues=\".count($issueList));\n }\n return $issueList;\n }",
"public function pendingTasks()\n {\n return $this->hasMany(Task::class, 'assigned_user_id')->where('status', TaskStatus::whereIn('name', [config('seed_data.task_statuses')[0], config('seed_data.task_statuses')[1]])->first()->id);\n }",
"function get_unasked () {\n\t\t$unasked = array();\n\t\tforeach ( $this->entries as $entry )\n\t\t\tif ( !$entry->has_been_asked() ) $unasked[] = $entry;\n\t\treturn $unasked;\n\t}",
"public function get_keep_completed_task_list()\n {\n }",
"public function pendingTasks()\n {\n return $this->hasMany(Task::class)->where('state', 0);\n }",
"function vh_get_default_auto_clean_task_list() {\r\n $list = array();\r\n return $list;\r\n}",
"public function getUncompletedTasks() {\r\n return $this->tasksService->getAllTasksByStatus(0);\r\n }",
"public function pendingTasks();",
"public function getAvailableTasks();",
"function nf_getListofUncompletedTasks(&$processlist) {\n global $_TABLES;\n\n $retval = array();\n $plist = implode(',',$processlist);\n $sql = \"SELECT distinct a.id \";\n $sql .= \"FROM {$_TABLES['nfqueue']} a inner join {$_TABLES['nfprocess']} b on a.nf_processId = b.id \";\n $sql .= \"inner join {$_TABLES['nftemplatedata']} c on a.nf_templateDataId = c.id \";\n $sql .= \"inner join {$_TABLES['nfprocess']} d on a.nf_processId = d.id \";\n $sql .= \"inner join {$_TABLES['nftemplate']} e on b.nf_templateId = e.id \";\n $sql .= \"inner join {$_TABLES['nfsteptype']} h on c.nf_steptype = h.id \";\n $sql .= \"WHERE d.complete=0 \";\n if (count($processlist) > 0) {\n $sql .= \"AND a.id not in ($plist) \";\n }\n $sql .= \" AND (a.status=0 AND a.archived is null AND h.is_interactiveStepType=0)\";\n $query = DB_query($sql);\n $retval['count'] = DB_numRows($query);\n while (list($taskid) = DB_fetchArray($query)) {\n array_push($processlist,$taskid);\n }\n $retval['list'] = $processlist;\n return $retval;\n}",
"public function get_task_list()\n {\n }",
"public function getPendingTasks()\n {\n return array_sum(array_filter(function($value) {\n return $value->isPending()\n ? $value\n : false;\n }, $this->tasks));\n }",
"function get_wf_task_state_list(){\n return array(\n 'I' => __tr('wf_txt_task_state_processing'),\n 'T' => __tr('wf_txt_task_state_completed'),\n 'C' => __tr('wf_txt_task_state_canceled')\n );\n }",
"public function getRemainingTasks(): array\n {\n $remainingTasks = $this->removeFalsyAssocArrayValues($this->required_tasks);\n if (count($remainingTasks) === 0) {\n return ['None'];\n }\n\n return $remainingTasks;\n }",
"public function getBoppTasks()\r\n {\r\n return $this->boppTasks;\r\n }",
"public function getOverdueTasks()\n {\n return $this->taskFinderModel->getOverdueTasks();\n }",
"public function getTasklist();",
"public function getTaskList();",
"public function upcomingTasks()\n {\n return Taskr_Model_DataMapper::getInstance()->loadList('tasks.active');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Groups model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate() {
$model = new Groups();
if($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
else {
return $this->render('group-form', [
'model' => $model,
]);
}
} | [
"public function actionCreate()\n {\n $model = new GroupsForm();\n $isNewRecord = true;\n $project_id = Yii::$app->request->get('project_id');\n $model->project_id = isset($project_id) ? $project_id : null;\n\n if ($model->load(Yii::$app->request->post())) {\n $groupModel = $model->save();\n return $this->redirect(['view', 'id' => $groupModel->id]);\n } else {\n return $this->render('groups', [\n 'model' => $model,\n 'isNewRecord' => $isNewRecord,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Group();\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 Group();\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $this->layout = \"layout1\";\n $model = new Group();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new LicGroups();\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 actionCreategroup()\n {\n $user = $this->getUser();\n $group = new Groups();\n $group->l_user = $user->username;\n $group->create_date = date(\"Y-m-d\");\n $group->status = 'o';\n\tif ($group->load(Yii::$app->request->post()) && $group->validate()) \n {\n if(!$group->groupExist())\n {\n if($group->save())\n {\n return $this->goHome();\n } else {\n return $this->render('say', ['message'=>'GroupErr']);\n }\n } else {\n return $this->render('error', ['name' => 'error', 'message'=>\"You Created this group $group->groupname...\"]);\n }\n }\n\treturn $this->render('creategroup', ['model'=>$group]);\n }",
"public function actionCreate() {\n $group = $this->groups->add($this->user->id);\n $this->redirect('Group:edit', $group->id);\n }",
"public function actionCreate()\n {\n $model = new UserGroup();\n\n if ($model->load(Yii::$app->request->post() ) ) {\n\n $model->created_at = date(\"Y/m/d H:i:s\");\n $model->created_by = Yii::$app->user->identity->id;\n\n if ($model->save()) {\n Yii::$app->db->createCommand()->insert('auth_item',['name'=>$model->name,'type'=>1])->execute();\n Yii::$app->session->setFlash('success', \"Usergroup \".$model->name.\" has been added\");\n return $this->redirect(['view', 'id' => $model->id]);\n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n //print_r($model->errors);die();\n\n } else {\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create() {\r\n\t\tif(!$this->Accounts_model->checkLogin())\r\n\t\t\treturn;\r\n\r\n\t\t// Check for button POST data\r\n\t\tif($this->input->post('submit_create_group')) {\r\n\t\t\t// Rules\r\n\t\t\t$this->form_validation->set_rules('group_name', 'Group Name', 'trim|required|min_length[1]|max_length[32]|alpha_dash');\r\n\t\t\t$this->form_validation->set_rules('parent_group_dropdown', 'Parent Group', 'trim|required|is_natural');\r\n\t\t\t\r\n\t\t\tif($this->form_validation->run() == FALSE) {\r\n\t\t\t\t$this->session->set_flashdata('error_message', validation_errors());\r\n\t\t\t\tredirect('groups');\r\n\t\t\t} else {\r\n\t\t\t\t// Add group to the database\r\n\t\t\t\t$group_id = $this->Groups_model->createGroup($this->input->post('group_name'), $this->input->post('parent_group_dropdown'), $this->session->userdata('account_id'));\r\n\t\t\t\tif($group_id == 0) {\r\n\t\t\t\t\t// Add to db failed\r\n\t\t\t\t\t$this->session->set_flashdata('error_message', 'Could not add group to database');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Redirect to view page\r\n\t\t\t\t\t$this->session->set_flashdata('status_message', 'Group has been created successfully');\r\n\t\t\t\t\tredirect('groups/view/' . $group_id);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->session->set_flashdata('error_message', 'You must fill in the form to create a group!');\r\n\t\t}\r\n\t\t\r\n\t\t// Send them to the groups page:\r\n\t\tredirect('groups');\r\n\t}",
"public function create()\n\t{\n\t\treturn view('groupsGroups.create');\n\t}",
"public function actionCreate()\n {\n $model = new StudyGroup();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Группа успешно создана');\n return $this->redirect(['update', 'id' => $model->id]);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new CustomerGroups();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->comp_id = Yii::$app->session->get('Rules')['comp_id'];\n $model->save();\n\n self::createHasGroup([\n 'model' => $model,\n 'customers' => Yii::$app->request->post('customer_id') \n ]);\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $searchModel = new HasGorupSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->andWhere(['group_id' => $model->id]);\n\n return $this->render('create', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionCreate() \n {\n $model = new HrGroup();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->save();\n return $this->redirect(['index', 'id' => $model->smartgroup_code]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n 'kd_group'=>Yii::$app->ambilkode->Kodegroup_company()\n ]);\n }\n }",
"public function createAction()\n {\n $group = new Group();\n\n $form = $this->createForm(GroupType::class, $group);\n $form->bindRequest($this->getRequest());\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($group);\n $em->flush();\n\n $this->get('session')->getFlashBag()->set('success', 'The group has been created.');\n\n return $this->redirect($this->generateUrl('orkestra_group_show', array('id' => $group->getId())));\n\n }\n\n return array(\n 'group' => $group,\n 'form' => $form->createView()\n );\n }",
"public function actionCreate()\n {\n $request = Yii::app()->request;\n $notify = Yii::app()->notify;\n $group = new CampaignGroup();\n\n $group->customer_id = (int)Yii::app()->customer->getId();\n\n if ($request->isPostRequest && ($attributes = (array)$request->getPost($group->modelName, array()))) {\n $group->attributes = $attributes;\n $group->customer_id = Yii::app()->customer->getId();\n if (!$group->save()) {\n $notify->addError(Yii::t('app', 'Your form has a few errors, please fix them and try again!'));\n } else {\n $notify->addSuccess(Yii::t('app', 'Your form has been successfully saved!'));\n }\n\n Yii::app()->hooks->doAction('controller_action_save_data', $collection = new CAttributeCollection(array(\n 'controller'=> $this,\n 'success' => $notify->hasSuccess,\n 'group' => $group,\n )));\n\n if ($collection->success) {\n $this->redirect(array('campaign_groups/update', 'group_uid' => $group->group_uid));\n }\n }\n\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('campaigns', 'Create new group'),\n 'pageHeading' => Yii::t('campaigns', 'Create new campaign group'),\n 'pageBreadcrumbs' => array(\n Yii::t('campaigns', 'Campaigns') => $this->createUrl('campaigns/index'),\n Yii::t('campaigns', 'Groups') => $this->createUrl('campaign_groups/index'),\n Yii::t('app', 'Create new'),\n )\n ));\n\n $this->render('form', compact('group'));\n }",
"public function actionCreate()\n {\n $model = new Grupo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['grupo/associar-usuarios', 'id'=>$model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Schedulegroup();\n\n if ($model->load(Yii::$app->request->post())) {\n\n if($model->validate())\n {\n $model->CREATE_BY = Yii::$app->user->identity->username;\n $model->CREATE_AT = date(\"Y-m-d H:i:s\");\n $model->save();\n }\n\n return $this->redirect(['index','SCDL_GROUP'=>$model->ID]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n\t{\n\t\treturn View::make('modulegroups.create');\n\t}",
"public function actionCreate()\n {\n\n if (!Yii::$app->user->can(\"admin\")) {\n throw new HttpException(403, 'You are not allowed to perform this action.');\n }\n \n $model = new FileGroup();\n $model->is_deleted=0;\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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reload this StrategyQuestionConditional from the database. | public function Reload() {
// Make sure we are actually Restored from the database
if (!$this->__blnRestored)
throw new QCallerException('Cannot call Reload() on a new, unsaved StrategyQuestionConditional object.');
// Reload the Object
$objReloaded = StrategyQuestionConditional::Load($this->intId);
// Update $this's local variables to match
$this->QuestionId = $objReloaded->QuestionId;
$this->StrategyId = $objReloaded->StrategyId;
$this->ConditionalType = $objReloaded->ConditionalType;
} | [
"public function refresh()\n {\n $where = $this->_getWhereQuery();\n\n $that = $this->_table->fetchRow($where);\n\n foreach($that as $key => $value)\n {\n if(substr($key, 0, 1) == '_')\n {\n continue;\n }\n $this->$key = $value;\n }\n\n $this->_isInsert = false;\n }",
"public function reload()\n {\n if (!$this->exists) {\n return;\n }\n // Get new instance\n $model = static::find($this->getKey());\n\n // Reload attributes\n $this->attributes = $model->getAttributes();\n $this->syncOriginal();\n }",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved FormAnswer object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = FormAnswer::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->SignupEntryId = $objReloaded->SignupEntryId;\n\t\t\t$this->FormQuestionId = $objReloaded->FormQuestionId;\n\t\t\t$this->strTextValue = $objReloaded->strTextValue;\n\t\t\t$this->AddressId = $objReloaded->AddressId;\n\t\t\t$this->PhoneId = $objReloaded->PhoneId;\n\t\t\t$this->EmailId = $objReloaded->EmailId;\n\t\t\t$this->intIntegerValue = $objReloaded->intIntegerValue;\n\t\t\t$this->blnBooleanValue = $objReloaded->blnBooleanValue;\n\t\t\t$this->dttDateValue = $objReloaded->dttDateValue;\n\t\t}",
"public function markForReload()\n\t{\n\t\tif ($this->isLoaded())\n\t\t{\n\t\t\t$related = $this->toModelArray($this->related);\n\n\t\t\t$this->related = NULL;\n\t\t\t$this->loaded = FALSE;\n\t\t}\n\t}",
"function reload()\n {\n $record = self::getById($this->id);\n $this->synchronizeWithArray($record->toArray());\n }",
"public function refresh()\n {\n $this->oldAttributes = $this->attributes;\n $this->findOne($this->key);\n }",
"public function ForceReload() {\n\t\t$this->LoadedInstance = null;\n\t}",
"public static function refresh()\n {\n if (!is_null(self::$engine)) {\n $contest = Contests::find()\n ->where([\"contests.id\" => (int) self::$engine->contest->id])\n ->innerjoinWith(\"game\", true)\n ->one();\n\n self::$engine->contest = $contest;\n }\n }",
"private function syncQuestionDB() {\n global $ilDB;\n\n $qpl_questions = array_filter(\n $this->getAllCourseQuestions(),\n function($question) {\n return strpos(\n $question->getQuestionType(),\n \"Reviewable\"\n ) !== FALSE;\n }\n );\n $plg_questions = $this->review_db->getCycleQuestions(array());\n\n $cmp_qst = function($question_a, $question_b) {\n if ($question_a->getID() > $question_b->getID()) {\n return 1;\n }\n if ($question_a->getID() < $question_b->getID()) {\n return -1;\n }\n return 0;\n };\n $new_questions = array_udiff($qpl_questions, $plg_questions, $cmp_qst);\n $del_questions = array_udiff($plg_questions, $qpl_questions, $cmp_qst);\n\n foreach ($new_questions as $new_question) {\n $new_cycle_question = new ilCycleQuestion(\n $ilDB,\n $this->review_db,\n $this->getID(),\n $new_question->getID(),\n 0,\n 0,\n self::getQuestionTimestamp($new_question->getID()),\n $new_question,\n $ilDB->nextID(\"rep_robj_xrev_quest\")\n );\n $new_cycle_question->storeToDB();\n $this->proceedToNextPhase($new_cycle_question);\n $this->notifyAdminsAboutNewQuestion($new_cycle_question);\n }\n\n foreach ($del_questions as $del_question) {\n $this->notifyReviewersAboutDeletion(\n // TODO change notify function to use the object\n array($del_question->getID())\n );\n $reviews = $this->review_db->getReviewForms(\n array(\"question_id\" => $del_question->getID())\n );\n foreach ($reviews as $review) {\n $review->copyToHistory();\n $review->deleteFromDB();\n }\n $del_question->deleteFromDB();\n }\n\n $qpl_questions = array_filter(\n $this->getAllCourseQuestions(),\n function($question) {\n return strpos(\n $question->getQuestionType(),\n \"Reviewable\"\n ) !== FALSE;\n }\n );\n $plg_questions = $this->review_db->getCycleQuestions(array());\n\n foreach ($qpl_questions as $qpl_question) {\n foreach ($plg_questions as $plg_question) {\n if (\n $qpl_question->getID()\n == $plg_question->getID()\n && self::getQuestionTimestamp($qpl_question->getID())\n > $plg_question->getTimestamp()\n ) {\n $plg_question->setTimestamp(\n self::getQuestionTimestamp($qpl_question->getID())\n );\n $plg_question->storeToDB();\n if ($plg_question->getState() == 0) {\n $this->proceedToNextPhase($plg_question);\n } else if ($plg_question->getState() == -1) {\n $plg_question->setState(0);\n $plg_question->setPhase(0);\n $this->proceedToNextPhase($plg_question);\n }\n break;\n }\n }\n }\n }",
"public function reload()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$id = $this->id();\n\t\t\t\n\t\t\t$reloaded_instance = static::load($id, ['use_cache' => false]);\n\t\t\t$this->setDataArray($reloaded_instance->getDataArray());\n\t\t}\n\t\tcatch(\\Exception $e)\n\t\t{\n\t\t\tif($e->getCode() === static::ERROR_RECORD_NOT_FOUND)\n\t\t\t{\n\t\t\t\t$classname = get_called_class();\n\t\t\t\tthrow new \\Exception(\"$classname #$id could not be found in database anymore\", static::ERROR_RECORD_NOT_FOUND);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t}",
"public function refresh()\n {\n $keyName = $this->keyName;\n\n //If we don't have a key we cant refresh\n if (! isset($this->$keyName))\n {\n return;\n }\n\n $dbItem = self::getOneByKey($this->getKey());\n\n //Check if we are already the same\n if ($dbItem == $this)\n {\n return;\n }\n\n //Get values from DB & check if they match. Update if needed\n foreach (get_object_vars($dbItem) as $var => $val)\n {\n if ($this->$var !== $val)\n {\n $this->$var = $val;\n }\n }\n }",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipFund object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipFund::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->MinistryId = $objReloaded->MinistryId;\n\t\t\t$this->strName = $objReloaded->strName;\n\t\t\t$this->strExternalName = $objReloaded->strExternalName;\n\t\t\t$this->strAccountNumber = $objReloaded->strAccountNumber;\n\t\t\t$this->strFundNumber = $objReloaded->strFundNumber;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t\t$this->blnExternalFlag = $objReloaded->blnExternalFlag;\n\t\t}",
"private function restoreUnsavedData()\n {\n $this->condition = $this->cFieldsRepository->getConditionModel();\n $tempData = $this->dataPersistor->get(self::FORM_NAMESPACE);\n\n if ($tempData) {\n $tempData['rule'] = isset($tempData['rule']) ? $tempData['rule'] : [];\n $this->condition->loadPost($tempData['rule']);\n $this->condition->getConditions();\n $this->prepareResultData();\n\n return true;\n }\n\n return false;\n }",
"public function skill_reload(){\n $this->skill_load(array(\n 'skill_id' => $this->skill_id,\n 'skill_token' => $this->skill_token\n ));\n }",
"function refresh()\n\t\t{\n\t\t\t$id = $this->getId();\n\t\t\t$res = Database::query(\n\t\t\t\t\"SELECT * \".\n\t\t\t\t\"FROM `\". static::$_tableName .\"` \".\n\t\t\t\t\"WHERE `\". static::$_keyField .\"` = '$id'\");\n\t\t\t\n\t\t\tif ($res && Database::getRowCount($res) == 1) {\n\t\t\t\t// Fetch the row from the DB.\n\t\t\t\t$row = Database::fetchMap($res);\n\t\t\t\t$this->_recordExists = true;\n\t\t\t\t\n\t\t\t\tif (method_exists($this, 'recordLoaded')) {\n\t\t\t\t\t$this->recordLoaded($row);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach ($row as $column => $value) {\n\t\t\t\t\t$this->$column = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Nothing found; this empty record remains intact.\n\t\t\t\t$this->_recordExists = false;\n\t\t\t}\n\t\t}",
"public function load()\n {\n if ($this->_state == IPF_ORM_Record::STATE_PROXY) {\n $this->refresh();\n $this->_state = IPF_ORM_Record::STATE_CLEAN;\n return true;\n }\n return false;\n }",
"public function reload()\n {\n $this->adapters = $this->findValidAdapters();\n }",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved Word object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = Word::Load($this->intWordId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->strWord = $objReloaded->strWord;\n\t\t\t$this->StatusTypeId = $objReloaded->StatusTypeId;\n\t\t\t$this->intProposalCount = $objReloaded->intProposalCount;\n\t\t\t$this->dttLastSent = $objReloaded->dttLastSent;\n\t\t}",
"public function load()\n\t{\n\t\t$pk = static::pk();\n\t\t$pk_val = $this->_data[$pk];\n\t\t$stmnt = static::db()->query(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM \".static::$_table.\"\n\t\t\t\t\t WHERE {$pk} = '{$pk_val}'\"\n\t\t);\n\t\t$data = $stmnt->fetch(\\PDO::FETCH_ASSOC);\n\t\tforeach($data as $k => $v) {\n\t\t\t$this->_data[$k] = $v;\n\t\t}\n\t\t$stmnt->closeCursor();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reformats a sugar url to meet sidecar rules | public static function reformatURL($url)
{
global $sugar_config;
$site_url = str_replace("http://", '', $sugar_config['site_url']);
$site_url = str_replace("https://", '', $site_url);
if (!self::hasString($site_url, $url)) {
return self::setClickableURLs($url);
}
$original_url = $url;
$properties = parse_url($url);
$module = '';
$record = '';
$action = '';
//if ajax
if (isset($properties['fragment'])) {
if (self::hasString("ajaxUILoc=", $properties['fragment'])) {
$decoded = urldecode(str_replace("ajaxUILoc=index.php%3F", '', $properties['fragment']));
parse_str($decoded);
} else if (self::hasString("module=Home&action=index", $properties['query']) && !empty($properties['fragment'])) {
return self::setClickableURLs($url);
} else if (self::hasString("bwc/index.php", $properties['fragment'])) {
//url is already bwc
return self::setClickableURLs($url);
}
} //if query string
else if (isset($properties['query'])) {
if (self::hasString("index.php", $properties['path'])) {
parse_str(str_replace("index.php?", '', $properties['query']));
}
}
if (isModuleBWC($module) && !self::hasString("#bwc", $url)) {
$url = self::setClickableURLs(rtrim($sugar_config['site_url'], '/') . "/#bwc/index.php?module={$module}&action={$action}&record={$record}");
} else if (!isModuleBWC($module) && self::hasString(array("index.php/#", "index.php#"), $url)) {
//ignore as this is a valid url
$url = self::setClickableURLs($url);
} else if (!isModuleBWC($module) && self::hasString("index.php", $url)) {
$url = self::setClickableURLs(rtrim($sugar_config['site_url'], '/') . "/#" . buildSidecarRoute($module, $record, $action));
}
if ($original_url != $url) {
if (version_compare($GLOBALS['sugar_version'], '7.6', '<')) {
return trim($url) . '<a href="javacript:void(0)" class="btn btn-invisible worklog-popovers" rel="popover" data-content="' . $original_url . '" data-original-title="Parsed from:"><i class="icon-info-sign"></i></a>';
} else {
return trim($url) . '<a href="javacript:void(0)" class="btn btn-invisible worklog-popovers" rel="popover" data-content="' . $original_url . '" data-original-title="Parsed from:"><i class="fa-info"></i></a>';
}
}
return self::setClickableURLs($url);
} | [
"private function tidyUrl($url)\n {\n if (!preg_match(\"#^https?://#\", $url)) {\n $url = \"https://api.github.com/\" . ltrim($url, \"/\");\n }\n return $url;\n }",
"function yourls_clean_url( $url ) {\n\t$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'\"()\\\\x80-\\\\xff]|i', '', $url );\n\t$strip = array('%0d', '%0a', '%0D', '%0A');\n\t$url = yourls_deep_replace($strip, $url);\n\t$url = str_replace(';//', '://', $url);\n\t$url = str_replace('&', '&', $url); // Revert & not to break query strings\n\t\n\treturn $url;\n}",
"private function prepareUrl($url) {\n return ltrim($this->replacePlaceHolder($url), '/');\n }",
"function convertToBeautyURL($url){\n $title_pattern = '/title/i';\n $page_pattern = '/page/i';\n if(preg_match($title_pattern, $url) && preg_match($page_pattern, $url)){\n $text = explode('?',$url);\n $params = explode('&',$text[1]);\n $result = array();\n $result[] = $text[0];\n foreach ($params as $param){\n $value = explode('=',$param);\n $result[] = $value[1];\n }\n $temp = implode('/',$result);\n return $temp;\n }\n return $url;\n}",
"function formatCurrentUrl() ;",
"private function transformUrl($url)\n {\n $url = preg_replace('#^http://#', 'https://', $url);\n\n return $url;\n }",
"abstract public function resolveURL();",
"private function _calculateUrl()\n {\n $urlParts = array(\n $this->Marca->nome,\n $this->modelo,\n $this->placa,\n );\n\n $url = App_String::arrayToUrl($urlParts);\n $url = trim($url, '/');\n $this->_set('url', $url);\n }",
"protected function _fixReqUrl($url) {\n return $url;\n }",
"function sharedurl_fix_submitted_url($url)\n{\n // note: empty urls are prevented in form validation\n $url = trim($url);\n\n // remove encoded entities - we want the raw URI here\n $url = html_entity_decode($url, ENT_QUOTES, 'UTF-8');\n\n if (!preg_match('|^[a-z]+:|i', $url) and !preg_match('|^/|', $url)) {\n // invalid URI, try to fix it by making it normal URL,\n // please note relative urls are not allowed, /xx/yy links are ok\n $url = 'http://' . $url;\n }\n\n return $url;\n}",
"function urlFormat($str)\n{\n // Strip out all whitespace\n $str = preg_replace('/\\s*/', '', $str);\n //Convert the string to all lowercase\n $str = strtolower($str);\n // URL Encode\n $str = urldecode($str);\n return $str;\n}",
"protected function normalize_http_url($url)\n\t{\n\t\treturn OAuthHelper::url_format($url);\n\t}",
"public function escapeUrl($url){ }",
"function prepareURL($_sUrl) {\n $sUrl = trim($_sUrl);\n if(strlen($sUrl) > 0) {\n //add protocol if necessary\n if(strpos($sUrl, '://') === FALSE) {\n $sUrl = 'http://'.$sUrl;\n }\n //remove ancors if necessary\n if(strpos($sUrl, '#') !== FALSE) {\n list($sUrl) = explode('#', $sUrl, 2);\n }\n //remove after-? marks\n if(strpos($sUrl, '?') !== FALSE) {\n list($sUrl) = explode('?', $sUrl, 2);\n }\n }\n return $sUrl;\n}",
"function standardize_url($url) {\n if(empty($url)) return $url;\n return (strstr($url,'http://') OR strstr($url,'https://')) ? $url : 'http://'.$url;\n}",
"function url() {\n\t$route_parts = func_get_args();\n\t\n\treturn trim(Url::getBase(), '/') .'/'. trim(preg_replace(\n\t\t'~/+~', \n\t\t'/', \n\t\timplode('/', $route_parts)\n\t), '/');\n}",
"function sy_fix_url($url, $traillingSlash = false)\r\n{\r\n $url = preg_replace('#\\\\\\+#', '/', $url);\r\n\r\n if (!preg_match('|\\.[^/]+$|', $url)) {\r\n if ($traillingSlash) {\r\n if (!strrpos('/', $url) === 0)\r\n $url .= '/';\r\n }\r\n elseif (strrpos('/', $url) === 0) {\r\n $url = substr($url, 0, strlen($url) - 1);\r\n }\r\n }\r\n\r\n $url = preg_replace('/(\\/[^\\/]+\\/\\.\\.)/', '', $url);\r\n\r\n return $url;\r\n}",
"function acf_strip_protocol( $url ) {\n}",
"function final_url($url)\n{\n $resolver = new \\Resolver\\URLResolver();\n $resolver->isDebugMode(true);\n $resolver->setMaxRedirects(10);\n $resolver->setUserAgent('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36');\n $resolver->isDebugMode(false);\n return $resolver->resolveURL($url)->getURL();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides data that is missing required fields | public function provideMissingRequiredFields() {
return [
[array(
'label' => 'I am a label',
'coordinates' => '39.7392° N, 104.9903° W',
'depth' => 11,
'temperature' => 98.6,
'date' => 1325533342
)],
[array(
'label' => 'I am a label',
'coordinates' => '39.7392° N, 104.9903° W',
'depth' => 11,
'temperature' => 98.6,
'reporter' => 'DataValidationServiceTest.php'
)],
[array(
'label' => 'I am a label',
'coordinates' => '39.7392° N, 104.9903° W',
'depth' => 11,
'date' => 1325533342,
'reporter' => 'DataValidationServiceTest.php'
)],
[array(
'label' => 'I am a label',
'coordinates' => '39.7392° N, 104.9903° W',
'temperature' => 98.6,
'date' => 1325533342,
'reporter' => 'DataValidationServiceTest.php'
)],
[array(
'label' => 'I am a label',
'depth' => 11,
'temperature' => 98.6,
'date' => 1325533342,
'reporter' => 'DataValidationServiceTest.php'
)],
[array(
'coordinates' => '39.7392° N, 104.9903° W',
'depth' => 11,
'temperature' => 98.6,
'date' => 1325533342,
'reporter' => 'DataValidationServiceTest.php'
)],
];
} | [
"abstract protected function getRequiredFields();",
"public function hasMandatoryData();",
"public function determineMissingFields()\n {\n $missing = array();\n\n foreach ($this->_requiredParams AS $param)\n {\n if (!isset($this->_queryParameters[$param]) || strlen($this->_queryParameters[$param]) === 0)\n {\n $missing[] = $param;\n }\n }\n\n if (empty($this->_username)) {\n $missing[] = 'USER';\n }\n\n if (empty($this->_password)) {\n $missing[] = 'PWD';\n }\n\n if (empty($this->_signature)) {\n $missing[] = 'SIGNATURE1';\n }\n\n return $missing;\n }",
"protected function requiredFromResponse($data, $requiredFields) {\n foreach ($requiredFields as $field) {\n if (empty($data[$field])) {\n throw new AWeberOAuthDataMissing($field);\n }\n }\n }",
"public function requiredFieldsSet()\n {\n $missing_fields = array_filter(\n get_object_vars($this),\n function ($a) {\n return is_null($a);\n }\n );\n if (!empty($missing_fields)) {\n $keys = array_keys($missing_fields);\n throw new SwiftReachException(\n \"The following fields cannot be blank: \" . implode(\", \", $keys)\n );\n }\n }",
"protected function checkRequired()\n {\n // doesWaste and doesRecycling will return\n // false alarm when a '0'.\n $requiredFields = [\n 'hauler_id', 'hauler_email', 'lead_id', 'status', 'net_monthly'\n ];\n\n $errorFields = [];\n\n foreach ($requiredFields as $field)\n {\n if (empty($this->$field))\n {\n $errorFields[] = $field;\n }\n }\n\n if (count($errorFields))\n {\n throw new MissingRequiredFields(trans('messages.bidValidationErrors', ['fields' => implode(', ', $errorFields)]));\n }\n }",
"public function getFrontEndRequiredFields();",
"protected function getAllFieldsAreEmpty() {}",
"protected function addMissingRequired()\n {\n $required = [\n '1:Revision' => '',\n '2:ImageParameters' => '',\n '2:PermitNumber' => '',\n '4:PermitIssuingPOZip5' => '',\n '14:POZipCode' => '',\n '34:FacilityType' => 'DDU',\n '35:MailClassEnclosed' => 'Other',\n '36:MailClassOther' => 'Free Samples',\n '37:WeightInPounds' => '22',\n '38:WeightInOunces' => '10',\n '39:ImageType' => 'PDF',\n '40:SeparateReceiptPage' => 'false',\n '41:AllowNonCleansedFacilityAddr' => 'false',\n '42:HoldForManifest' => 'N',\n '43:CommercialPrice' => 'N',\n ];\n\n foreach ($required as $item => $value) {\n $explode = explode(':', $item);\n if (!isset($this->fields[$item])) {\n $this->setField($explode[0], $explode[1], $value);\n }\n }\n }",
"public function testNoFields() {\n\t\t$this->_loadBehavior();\n\n\t\t// Test with unique data\n\t\t$data = $this->_uniqueData;\n\t\t$expected = array();\n\t\t$this->_assertValidate($data, $expected);\n\n\t\t// Test with non-unique data\n\t\t$data = $this->_nonUniqueData;\n\t\t$expected = array();\n\t\t$this->_assertValidate($data, $expected);\n\t}",
"protected function getEmptyFields()\n {\n $data = parent::getEmptyFields();\n $data['link_type'] = null;\n $data['text'] = null;\n return $data;\n }",
"public function getInvalidData();",
"protected function checkRequired(){\r\n $OK = array();\r\n foreach ($this->_submitted as $name => $value) {\r\n $value = is_array($value) ? $value : trim($value);\r\n if (!empty($value)) {\r\n $OK[] = $name;\r\n }\r\n }\r\n // pass the values that are not OK to the missing array . // http://www.developphp.com/view_lesson.php?v=460\r\n $this->_missing = array_diff($this->_required, $OK);\r\n }",
"public function addMissingRequired() {\n\t $required = array(\n\t\t 'Option' => '',\n\t\t 'Revision' => '2',\n\t\t 'ImageParameters' => '');\n\t /*\n \t$required = array(\n \t\t'1:Revision' => '',\n \t\t'2:ImageParameters' => '',\n \t\t'2:PermitNumber' => '',\n \t\t'4:PermitIssuingPOZip5' => '',\n \t\t'14:POZipCode' => '',\n\n \t\t'34:FacilityType' => 'DDU',\n \t\t'35:MailClassEnclosed' => 'Other',\n \t\t'36:MailClassOther' => 'Free Samples',\n \t\t'37:WeightInPounds' => '22',\n \t\t'38:WeightInOunces' => '10',\n \t\t'39:ImageType' => 'PDF',\n \t\t'40:SeparateReceiptPage' => 'false',\n \t\t'41:AllowNonCleansedFacilityAddr' => 'false',\n \t\t'42:HoldForManifest' => 'N',\n \t\t'43:CommercialPrice' => 'N',\n \t\t);\n\t */\n\t foreach($required as $item => $value) {\n\t\t $this->setField($item, $value);\n\t }\n }",
"private function checkRequiredFields() {\n $result = true;\n foreach ($this->requiredFields as $requiredField) {\n if (!isset($this->bodyMessage->{$requiredField})) {\n $result = \"Field \" . $requiredField . \" is missing.\";\n break;\n } else if ($this->bodyMessage->{$requiredField} === \"\") {\n $result = \"Field \" . $requiredField . \" is empty.\";\n break;\n }\n }\n\n if ($result !== true) {\n throw new BadRequestException($result);\n }\n }",
"public function getNoData(){\n \treturn $this->_no_data;\n }",
"public function getRequiredFields()\n {\n return $this->schema->required;\n }",
"public function getFieldsThatHaveDefaults();",
"public function getRequiredFields()\n {\n return [\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get envato item by id. | private function get_envato_item($id, $post_type){
/* get item data by ID */
$item_data = $this->remote_get_envato_item($id);
/* is error. */
if(isset($item_data->error))
return $item_data;
/* get attributes key */
$attributes_key = envato_market()->get_root_attributes_key($post_type);
/* insert item. */
return $this->insert_post($item_data, $post_type, $attributes_key);
} | [
"public function get_by_id( $id )\n\t{\n//\t\texit;\n\t\treturn $this->get_connection()->get($this->name_space . 'item' . $id);\n\t}",
"public function getItem($id);",
"public static function getItemById($id)\n {\n return self::find($id);\n }",
"public function getItem ($id);",
"function get_inventory_item($id) {\n\t\tglobal $db;\n\t\t$id = $db->real_escape_string($id);\n\n\t\t$r = $db->query(\"SELECT * FROM `inventory` WHERE `id` = '$id'\");\n\t\tif (!$r || $r->num_rows == 0) return assoc();\n\t\treturn $r->fetch_assoc();\n\t}",
"public function retrieve($id)\n {\n return MenuItem::find($id);\n }",
"public function getMenuItemById(int $id): object\n {\n return MenuItem::select(\n 'id',\n 'menu_id',\n 'url_type',\n 'title',\n 'url',\n 'route',\n 'icon'\n )\n ->where('id', $id)\n ->first();\n }",
"public function getItemById($id) {\r\n $items = Item::find($id);\r\n return $items;\r\n }",
"public function item($id);",
"function get($id)\n {\n $this->db->where('id', $id);\n $query = $this->db->get('nieuwsitem');\n return $query->row();\n }",
"public function showItem($id)\n {\n $item = Items::where('id', $id)->first();\n if ($item) {\n return $item;\n } else {\n return response()->json([\n 'message' => 'Item not found',\n ]);\n }\n }",
"function get_inventory_by_id($id)\n\t{\n\t\t$this->db->where('inventory_id', $id);\n $query = $this->db->get('inventory');\n\t\treturn $query->result();\n\t}",
"static function getItem( $id ) {\n\t\t$dbr = wfGetDB( DB_SLAVE );\n\t\t$res = $dbr->select(\n\t\t\t'finance_lineitem',\n\t\t\t'*',\n\t\t\tarray( 'id' => $id ),\n\t\t\t__METHOD__\n\t\t);\n\t\t$result = array();\n\t\tforeach ( $res as $item ) {\n\t\t\t$result[] = $item;\n\t\t}\n\t\treset( $result );\n\t\treturn current( $result );\n\t}",
"public function findEntityById($id)\n {\n $item = $this->itemRepository->find($id);\n if (!$item) {\n return null;\n }\n\n return $item;\n }",
"function backup_migrate_crud_get_item($type, $id) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->item($id);\n }\n}",
"public function findOneById($id)\n {\n return $this->em->getRepository(Cita::class)->find($id);\n }",
"public static function findById($id)\n\t{\n\t\t//$item = static::find($id);\n\t\t$ingredient = Ingredient::where('id','=', $id)->get();\n\n\t\tif (!$ingredient)\n\t\t{\n\t\t\tthrow new NotFoundException('Ingredient was not found');\n\t\t}\n\n\t\treturn $ingredient;\n\t}",
"function getItem($item_id) {\n $db = Database::instance()->db();\n $stmt = $db->prepare('SELECT * FROM item WHERE item_id = ?');\n $stmt->execute(array($item_id));\n return $stmt->fetch();\n }",
"public function getItem( $id ) {\n\t\tJSpaceLog::add('Geting item id=' . $id, JLog::DEBUG, JSpaceLog::CAT_REPOSITORY);\n\t\t$this->flushErrors();\n\t\t\n\t\tif( !isset( $this->_items[ $id ] ) ) { \n\t\t\ttry {\n\t\t\t\t$this->_items[ $id ] = $this->_getItem( $id );\n\t\t\t}\n\t\t\tcatch( Exception $e ) {\n\t\t\t\tthrow JSpaceRepositoryError::raiseError( $this, $e );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->_items[ $id ];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all opportunities assigned to user | public function opportunities()
{
return $this->hasMany(Contact::class, 'assigned_user_id')->where('status', ContactStatus::where('name', config('seed_data.contact_status')[1])->first()->id);
} | [
"public function getOpportunities()\n\t{\n\t\treturn Opportunities::model()->findAll('ios_id=:iosid', array(':iosid' => $this->id));\n\t}",
"function get_opportunities()\n\t{\n\t\t// First, get the list of IDs.\n\t\t$query = \"SELECT opportunity_id as id from accounts_opportunities where account_id='$this->id' AND deleted=0\";\n\n\t\treturn $this->build_related_list($query, new Opportunity());\n\t}",
"public function getOpportunities() {\n\t\treturn $this->opportunities;\n\t}",
"public static function getOpportunities() {\n $opportunities = array();\n $response = HttpClient::get(\"/Zapier/GetOpportunities\");\n foreach ($response as $item) {\n $opportunities[] = new Opportunity($item);\n }\n return $opportunities;\n }",
"public function assigned_opportunities() {\n\t\tif($this->session->userdata('uid')){\n\t\t\t$user_id = $this->session->userdata('uid');\n\t\t\t$data = $this->opp_common->fetch_userPrivilages($user_id);\n\t\t\t$this->load->view('manager_opportunity_assigned', $data);\n\t\t}else{\n\t\t\tredirect('indexController');\n\t\t}\n\t}",
"public function get_upcoming_opportunities_by_user_id($user_id) {\n $days_before_opportunity_can_be_cancelled = $this->config->item('days_before_opportunity_can_be_cancelled');\n $query = $this->db->query('\n SELECT\n o.id,\n DATE_FORMAT(o.date, \"%m/%d/%Y\") AS date,\n DATE_FORMAT(o.start_time, \"%H:%i\") AS start_time,\n DATE_FORMAT(o.end_time, \"%H:%i\") AS end_time,\n CASE WHEN o.date > DATE_ADD(CURDATE(), INTERVAL ? DAY) THEN 1 ELSE 0 END AS can_be_cancelled,\n r.description AS role_description,\n r.id AS role_id,\n l.name AS location_name\n FROM opportunities o \n INNER JOIN roles r on o.role_id = r.id\n INNER JOIN locations l on o.location_id = l.id\n WHERE\n o.user_id = ? AND o.date >= CURDATE()',\n array(\n $days_before_opportunity_can_be_cancelled, \n $user_id\n )\n );\n \n return $query->result();\n }",
"public function get_assignees() {\n\t\t//used only while creating an opportunity as it's only one opportunity\n\t\tif ($this->session->userdata('uid')) {\n\t\t\ttry {\n\t\t\t\t$json = file_get_contents(\"php://input\");\n\t\t\t\t$data = json_decode($json);\n\t\t\t\t$user_id = $this->session->userdata('uid');\n\t\t\t\t$data->user_id = $user_id;\n\t\t\t\t// Get users based on stage assignment or ownership assignment.\n\t\t\t\tif ($data->btn_status == 'oppOwner')\n\t\t\t\t{\n\t\t\t\t\t$users = $this->opp_mgr->fetch_users($data,'oppOwner');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$users = $this->opp_mgr->fetch_users($data,'stageOwner');\n\t\t\t\t}\n\n\t\t\t\techo json_encode($users);\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}",
"public function getOpportunities(): array\n {\n $opportunities = [];\n $result = $this->collectPaginatedResults('opportunities');\n\n foreach ($result as $opportunityData)\n {\n $opportunities[] = new CapsuleOpportunity($opportunityData);\n }\n\n return $opportunities;\n }",
"public function displayOpportunities(){\n if(!isset($_SESSION['user_id'])){\n $this->view('opprtunity/displayOpportunities');\n }\n else{\n $data= $this->$opportunityModel->getOpportunities();\n\n $this->view('opprtunity/displayOpportunities', $data);\n }\n }",
"public function opportunities()\n {\n\n return view('opportunity.opportunity-list');\n }",
"public function get_assigned_opportunities($status) {\n\t\tif($this->session->userdata('uid')){\n\t\t\ttry {\n\t\t\t\t$user_id = $this->session->userdata('uid');\n\t\t\t\t$new = $this->opp_mgr->fetch_assigned_opportunities($user_id,$status);\n\t\t\t\techo json_encode($new);\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('indexController');\n\t\t}\n\t}",
"function GetMyOpportunities($count)\n\t{\n\t\t$result = $this->sendRequest(\"GetMyOpportunities\", array(\"Count\"=>$count));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function opportunities()\n {\n return $this->belongsToMany(MobileOpportunity::class);\n }",
"public function display_registration_opportunities() {\n return $this->registration_opportunities()\n ->withCount('teams')\n ->withCount('pilots')\n ->withCount('soapboxes')\n // Where open\n ->where(function($q) {\n $q->where(function($query) {\n $query->where('from', '<=', now())\n ->where('to', '>', now());\n })\n ->orWhere(function($query) {\n $query->where('from', '<=', now())\n ->whereNull('to');\n })\n ->orWhere(function($query) {\n $query->where('to', '>', now())\n ->whereNull('from');\n })\n ->orWhere(function($query) {\n $query->whereNull('to')\n ->whereNull('from');\n });\n })\n // Or where teasing and not past\n ->orWhere(function($q) {\n $q->where('teasing', true)\n ->where('from', '>', now());\n });\n }",
"public function getRelatedOpportunities()\n {\n $results = array();\n $query = \"select * from quotes_opportunities where quote_id = ? and deleted = 0\";\n $stmt = $this->db->getConnection()->executeQuery($query, array($this->id));\n while ($row = $stmt->fetch()) {\n $results[] = $row;\n }\n return $results;\n }",
"function get_user_pinned_opportunities()\n{\n $CI = &get_instance();\n $CI->db->select('tblopportunities.id, tblopportunities.name');\n $CI->db->join('tblopportunities', 'tblopportunities.id=tblpinnedopportunities.opportunity_id');\n $CI->db->where('tblpinnedopportunities.staff_id', get_staff_user_id());\n $opportunities = $CI->db->get('tblpinnedopportunities')->result_array();\n $CI->load->model('opportunities_model');\n $i = 0;\n foreach ($opportunities as $opportunity) {\n $opportunities[$i]['progress'] = $CI->opportunities_model->calc_progress($opportunity['id']);\n $i++;\n }\n\n return $opportunities;\n}",
"public function index() {\n $view = $this->load->view('opportunity/index', array(\n 'all_users' => json_encode($this->user_model->get_all_users_for_opportunity_list(), JSON_HEX_APOS)\n ), TRUE);\n\n return $this->load->view($this->template, array(\n 'page_title' => $this->page_title_prefix . 'Opportunities',\n 'main' => $view,\n ));\n }",
"public function assignedToYou()\n {\n $user = auth()->user()->id;\n $data['open'] = $this->open->count();\n $data['closed'] = $this->closed->count();\n $data['query'] = Incidents::where('assigned', $user)->paginate(20);\n\n return view('incidents.index', $data);\n }",
"public static function getAssignStories()\n {\n $res_des = Auth::user()->designation;\n $res_id = Auth::user()->id;\n $result_user_stories = null;\n\n if ($res_des == 'Developer' || $res_des == 'Project Manager') {\n $result_user_stories = DB::table('user_stories')->where('assignee', '=', $res_id)->get();\n }\n return $result_user_stories;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test initialization of beepsend client. We should set some non existing token and client should return invalid token exception. | public function testInitialization()
{
$client = new Client('TokenThatDoesntExists');
$client->customer->get(); // Try to get customer data
} | [
"public function canInit()\n {\n $client = new Client(\"FAKE KEY\", \"FAKE SECRET KEY\", new GuzzleClient());\n $this->assertInstanceOf('Wkop\\Client', $client);\n }",
"public function testNoAppIdError() {\n\n\t\t$config = $this->config;\n\n\t\t// Remove app_id from config\n\t\tunset($config['app_id']);\n\n // Instantiate new Client knowing it will throw an exception\n\t\tnew GoCardless_Client($config);\n\n\t}",
"public function testCreateBraintreeClientTokenNotActive()\n {\n $this->graphQlMutation($this->getMutation());\n }",
"public function testCreateBotWithEmptyTokenFails()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Token cannot be empty');\n $bot = new Bot('');\n }",
"public function initClient();",
"public function testGetAccountTokenSuccessfully(){\n $this->assertEquals(getTokenAccount('someRandomTestToken'),'test@gmail.com');\n setAccountToken('test@gmail.com','');\n }",
"public function testInitWithKeyAndClientId() {\n $ably = new AblyRest( array_merge( self::$defaultOptions, [\n 'key' => self::$testApp->getAppKeyDefault()->string,\n 'clientId' => 'testClientId',\n ] ) );\n\n $this->assertTrue( $ably->auth->isUsingBasicAuth(), 'Expected basic auth to be used' );\n\n $ably->auth->authorize();\n $this->assertEquals( 'testClientId', $ably->auth->clientId,\n 'Expected clientId result to match the provided id' );\n $this->assertEquals( 'testClientId', $ably->auth->getTokenDetails()->clientId,\n 'Expected clientId in tokenDetails to match the provided id' );\n }",
"public function testInitWithApiKey() {\n $sendgrid = new s\\Client('token123456789');\n $this->assertEquals('SendGrid\\Client', get_class($sendgrid));\n $this->assertEquals($sendgrid->apiKey, 'token123456789');\n }",
"public function testAuthenticationError()\n {\n $client = ClientBuilder::create('not-a-valid-api-key')->build();\n $client->listEngines();\n }",
"public function testCreateBotWithToken()\n {\n $bot = new Bot('token');\n $this->assertInstanceOf(Bot::class, $bot);\n $this->assertInstanceOf(Config::class, $bot->config);\n $this->assertEquals('token', $bot->config->getToken());\n }",
"public function testInitWithApiKeyOptions() {\n $sendgrid = new s\\Client('token123456789', ['foo' => 'bar']);\n $this->assertEquals('SendGrid\\Client', get_class($sendgrid));\n }",
"public function testGetTokenWithInValidTokenEndPoint()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(\n 'http://api.fronter.com/clients',\n OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS,\n $params\n );\n $httpCode = $tokenResponse['code'];\n\n $this->assertEquals($httpCode, 404);\n }",
"private function initFakeTestSession()\n {\n }",
"public function testGetRequestToken(): void\n {\n $options = $this->createConfiguration('accounting', 'public');\n $expected = ['oauth_token' => $options['token'], 'oauth_secret' => $options['token_secret']];\n $response = 'oauth_token=' . $options['token'] . '&oauth_secret=' . $options['token_secret'];\n $mock = new MockHandler(\n [\n new Response(200, ['Content-Type' => 'application/x-www-form-urlencoded'], $response)\n ]\n );\n $options['handler'] = new HandlerStack($mock);\n\n $tokens = XeroClient::getRequestToken($options['consumer_key'], $options['consumer_secret'], $options);\n $this->assertEquals($expected, $tokens);\n }",
"public function testInit()\n {\n $application = new GameApplication();\n $engines = $application->getEngines();\n\n $this->assertTrue(count($engines) > 0, 'GameApplication failed to run games engines!');\n }",
"public function testInitLibWithKeyOption() {\n $key = 'fake.key:veryFake';\n $ably = new AblyRest( ['key' => $key ] );\n $this->assertTrue( $ably->auth->isUsingBasicAuth(), 'Expected basic auth to be used' );\n }",
"private function initialize()\n {\n $this->token = Configuration::getDefaultConfiguration()->getAccessToken();\n\n if (empty($this->token)) {\n throw new Exception(\"Before using StompClient you need to autorizate\");\n }\n\n $this->replyTo = Configuration::getDefaultConfiguration()->getReplyToStomp();\n\n if (empty($this->replyTo)) {\n throw new Exception(\"replyTo can't be empty please see Configuration.php\");\n }\n\n $this->stompHost = Configuration::getDefaultConfiguration()->getStompHost();\n\n if (empty($this->stompHost)) {\n throw new Exception(\"stompHost can't be empty please see Configuration.php\");\n }\n\n $this->port = Configuration::getDefaultConfiguration()->getStompPort();\n\n if (empty($this->port)) {\n throw new Exception(\"port for Stomp connection can't be empty please see Configuration.php\");\n }\n }",
"public function testHexonetClient2()\n {\n $cl = CF::getClient([\n \"registrar\" => \"HEXONET\",\n \"username\" => self::$user,\n \"password\" => self::$pw,\n \"sandbox\" => true,\n \"referer\" => \"https://www.hexonet.net\",\n \"ua\" => [\n \"name\" => \"WHMCS\",\n \"version\" => \"8.2.0\",\n \"modules\" => [\n \"ispapi\" => \"7.0.4\"\n ]\n ],\n \"proxyserver\" => \"http://192.168.2.31\",\n \"logging\" => true\n ]);\n $this->assertInstanceOf(CL::class, $cl);\n }",
"public function testShouldNotAllowToSendSmsIfGnokiiCommandIsNotDefined()\n\t {\n\t\tdefine(\"SMSC_NUMBER\", \"+79043490000\");\n\n\t\tdefine(\"EXCEPTION_GNOKII_COMMAND_IS_NOT_SET\", 1);\n\t\t$this->expectException(Exception::class);\n\t\t$this->expectExceptionCode(EXCEPTION_GNOKII_COMMAND_IS_NOT_SET);\n\t\t$sender = new PhpGnokii();\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the site icon height. | public function site_icon_height( $val, Rich_Snippet $rich_snippet, array $meta_info ): string {
if ( ! has_site_icon() ) {
return '';
}
return (string) Helper_Model::instance()->get_media_meta(
'height',
get_option( 'site_icon' )
);
} | [
"public function loginIconHeight()\r\n\t{\r\n\t\treturn Mage::getStoreConfig('ezfacebook/facebook/iconheight');\r\n\t}",
"public function getThumbnailHeightSiteFavIconEdit()\n {\n return $this->thumbnailHeightSiteFavIconEdit;\n }",
"public function getThePlatformSeticonHeight(){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n // $criteria->condition='id=:id';\n // $criteria->params = array(':id'=>$id);\n $icon = PlatformSettings::model()->find($criteria); \n \n return $icon['icon_height'];\n }",
"public function getShrinkHeightSiteFavIcon()\n {\n return $this->shrinkHeightSiteFavIcon;\n }",
"protected function gateway_icon_size() {\n $settings_icons_maxheight = $this->s( 'quickpay_icons_maxheight' );\n return ! empty( $settings_icons_maxheight ) ? $settings_icons_maxheight . 'px' : '20px'; \n }",
"public function getImageHeight()\n\t{\n\t\treturn $this->info['height'];\n\t}",
"public function getHeight() {\n return $this->imageInfo['height'];\n }",
"protected function getImageHeight()\n\t\t{\n\t\t\treturn $this->image_height;\n\t\t}",
"Public Static function getCustomPhotoHeight() {\n $custom_icon_height = self::getParams('custom_icon_height');\n if ($custom_icon_height && is_numeric($custom_icon_height) && $custom_icon_height>0) {\n return $custom_icon_height;\n } \n\n return 0;\n }",
"public function getImageHeight();",
"public function getImageHeight()\n {\n return $this->image_height;\n }",
"public function getHeight(){\n\t\tif(file_exists($this->pathOrigin)){\n\t\t\t$size=getimagesize($this->pathOrigin);\n\t\t\treturn $size[1];\n\t\t}\n\t\telse\n\t\t\t return 0;\n\t}",
"public function getLogoheight(){\n return $this->logoheight;\n }",
"public function getImageHeight()\n {\n return $this->scopeConfig->getValue(\n 'magepow_ajaxcart/success_popup/product_image_height',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function getHeight() {\n\t\treturn $this->image['height'];\n\t}",
"function getHeight() {\n\t\treturn $this->getData('height');\n\t}",
"public function get_height();",
"function getLocalizedHeight() {\r\n\t\treturn $this->getLocalizedData('height');\r\n\t}",
"public function getSpriteHeightPixels()\n {\n return $this->sprite_height_pixels;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array containing the admin_ip values from .env and stores that array in the $admin_ip_allowed property. | public function admin_ip(): Array
{
$ips = $this->config->setting['admin_ip'];
$ip = preg_split( '/,/', $ips);
foreach($ip as $addr => $val)
{
$this->admin_ip_allowed[$val] = $val;
}
return $this->admin_ip_allowed;
} | [
"function _project11b_get_allowed_ips() {\n $allowed_ips = array();\n $allowed_ips_str = variable_get('project11b_allowed_ips', '');\n $allowed_ips_str = trim($allowed_ips_str);\n\n if ($allowed_ips_str) {\n $allowed_ips = preg_split('/\\R/', $allowed_ips_str);\n }\n\n return $allowed_ips;\n}",
"protected function getAllowedIps()\n {\n $ipTextField = Mage::getStoreConfig('admin/security/allowed_ips');\n $ipTextField = explode(\"\\n\",$ipTextField);\n\n $allowedIps = array();\n foreach ($ipTextField as $ipLine) {\n $ipString = explode(\" \", $ipLine);\n if (!empty($ipString[0])) $allowedIps[] = $ipString[0];\n }\n return $allowedIps;\n }",
"private function _createAllowedList()\n {\n $c = [];\n $c[] = DotEnv::get('SERVER_IP_ONE');\n $c[] = DotEnv::get('SERVER_IP_TWO');\n $whitelist = IpWhiteList::all();\n $c = array_merge($c, Arr::flatten($whitelist->pluck('ip_add')->toArray() ?? []));\n return $c;\n }",
"public function privateUseIpAddresses()\n {\n return array(\n array('9.255.255.255', false),\n array('10.0.0.0', true),\n array('10.255.255.255', true),\n array('11.0.0.0', false),\n array('172.15.255.255', false),\n array('172.16.0.0', true),\n array('172.31.255.255', true),\n array('172.32.0.0', false),\n array('192.167.255.255', false),\n array('192.168.0.0', true),\n array('192.168.255.255', true),\n array('192.169.0.0', false),\n array('fcff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', false),\n array('fd00::', true),\n array('fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', true),\n array('fe00::', false),\n );\n }",
"function checkIpAllowed()\n {\n $ip_list = explode(',', config('bogpayment.allowed_ips'));\n\n if ($ip_list) {\n $client_ip = request()->getClientIp();\n\n if (!in_array($client_ip, $ip_list)) {\n abort(403, 'Access denied for IP: ' . $client_ip);\n }\n }\n }",
"private function check_allowed_ip() {\n if (!$this->login_user->is_admin) {\n $ip = get_real_ip();\n $allowed_ips = $this->Settings_model->get_setting(\"allowed_ip_addresses\");\n if ($allowed_ips) {\n $allowed_ip_array = array_map('trim', preg_split('/\\R/', $allowed_ips));\n if (!in_array($ip, $allowed_ip_array)) {\n redirect(\"forbidden\");\n }\n }\n }\n }",
"protected function allowableEnvironments(): array\n {\n if (!empty(config('core-middleware.allowable-environments'))) {\n return config('core-middleware.allowable-environments');\n }\n\n return ['local'];\n }",
"function checkAdminIpAccess()\n{\n if(!empty($GLOBALS['admin']['allowed_ips']))\n {\n if(in_array($_SERVER['REMOTE_ADDR'], $GLOBALS['admin']['allowed_ips'])) return true;\n else\n {\n foreach($GLOBALS['admin']['allowed_ips'] as $ip)\n {\n if(preg_match('/'.$ip.'/', $_SERVER['REMOTE_ADDR'])) return true;\n }\n }\n\n header('HTTP/1.0 403 Forbidden');\n exit('access denied');\n }\n}",
"public function whitelist()\n {\n return ['whitelisted_ips' => $this->whitelist];\n }",
"public function provideIpAddresses () {\n return [\n ['39.7392° N, 104.9903° W', ''],\n ['39.7392° N, 104.9903° W', '127.0.0.1'],\n ['39.7392° N, 104.9903° W', '151.101.113.175']\n ];\n }",
"public function getValidIPs()\n {\n return $this->validIPs;\n }",
"public function getWhitelist() {\n $ip_list = $this->getSettings()->get('restrict_whitelist', []);\n\n if (!is_array($ip_list)) {\n $this->logger->handleInvalidConfiguration('restrict_restricted_paths', 'array', gettype($ip_list));\n $ip_list = [$ip_list];\n }\n\n return $ip_list;\n }",
"private function isIPInAdminWhitelist()\n\t{\n\t\tif ($this->cparams->getValue('ipwl', 0) == 1)\n\t\t{\n\t\t\t$db = $this->container->db;\n\t\t\t$sql = $db->getQuery(true)\n\t\t\t ->select($db->qn('ip'))\n\t\t\t ->from($db->qn('#__admintools_adminiplist'))\n\t\t\t;\n\n\t\t\t$db->setQuery($sql);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$ipTable = $db->loadColumn();\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$ipTable = null;\n\t\t\t}\n\n\t\t\tif (!empty($ipTable))\n\t\t\t{\n\t\t\t\tif (AtsystemUtilFilter::IPinList($ipTable))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function getAllowedIpsForIpn()\n {\n return explode(',', Mage::getStoreConfig(self::GENERAL_SETTINGS_PATH . 'allowedips', $this->getStoreId()));\n }",
"public function get_temp_whitelist() {\n\t\t$whitelist = get_site_option( 'itsec_temp_whitelist_ip', false );\n\n\t\tif ( ! is_array( $whitelist ) ) {\n\t\t\t$whitelist = array();\n\t\t} elseif ( isset( $whitelist['ip'] ) ) {\n\t\t\t// Update old format\n\t\t\t$whitelist = array(\n\t\t\t\t$whitelist['ip'] => $whitelist['exp'] - ITSEC_Core::get_time_offset(),\n\t\t\t);\n\t\t} else {\n\t\t\treturn $whitelist;\n\t\t}\n\n\t\tupdate_site_option( 'itsec_temp_whitelist_ip', $whitelist );\n\n\t\treturn $whitelist;\n\t}",
"protected function get_ip_data()\n\t{\n\t\t$fields = array (\n\t\t\t'HTTP_X_FORWARDED_FOR',\n\t\t\t'REMOTE_ADDR',\n\t\t\t'HTTP_CLIENT_IP'\n\t\t);\n\t\t$fields = apply_filters( 't5_404_ip_fields', $fields );\n\t\t$url = apply_filters(\n\t\t\t't5_404_ip_check_url',\n\t\t\t'http://ip.toscho.de/?ip=%s'\n\t\t);\n\n\t\t$out = array ();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\tisset ( $_SERVER[ $field ] )\n\t\t\t\tand $out[ $field ] = sprintf( $url, $_SERVER[ $field ] );\n\t\t}\n\n\t\treturn $out;\n\t}",
"private function _adminEmails()\n {\n return array_column(Employee::getAdmin(), 'email');\n }",
"public function getAdminCredentials()\n {\n return [\n $this->adminUsername,\n $this->adminPassword,\n $this->adminAccountSuffix,\n ];\n }",
"function getInstancePublicIPs() {\n\t\t$addrs = array();\n\t\t$addresses = OpenStackNovaController::_get_property( $this->instance, 'addresses' );\n\t\tif ( $addresses ) {\n\t\t\tforeach ( $addresses as $addresslist ) {\n\t\t\t\tforeach ( $addresslist as $address ) {\n\t\t\t\t\t$addr = OpenStackNovaController::_get_property( $address, 'addr' );\n\t\t\t\t\tif ( $addr && filter_var( $addr, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE ) ) {\n\t\t\t\t\t\t$addrs[] = $addr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $addrs;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable two factor auth | public function disableTwoFactorAuth()
{
$request = new \Zimbra\Account\Request\DisableTwoFactorAuth();
return $this->getClient()->doRequest($request);
} | [
"public function disableTwoFactorAuth(): void\n {\n $this->twoFactorAuth->flushAuth()->delete();\n\n event(new Events\\TwoFactorDisabled($this));\n }",
"public function disableTwoFactorAuth() : void\n {\n $this->twoFactorAuth->flushAuth()->save();\n\n event(new Events\\TwoFactorDisabled($this));\n }",
"public function enableTwoFactorAuth() : void;",
"private function disableAuth()\n {\n Shopware()->Plugins()->Backend()->Auth()->setNoAuth(true);\n Shopware()->Plugins()->Backend()->Auth()->setNoAcl(true);\n }",
"function shibboleth_disable_password_changes() {\n\t$disable = shibboleth_getoption( 'shibboleth_disable_local_auth', false );\n\n\t$bypass = defined( 'SHIBBOLETH_ALLOW_LOCAL_AUTH' ) && SHIBBOLETH_ALLOW_LOCAL_AUTH;\n\n\tif ( $disable && ! $bypass ) {\n\t\tadd_filter( 'show_password_fields', '__return_false' );\n\t}\n}",
"public static function disable2FA()\n {\n $user = Auth::guard('admin')->user();\n $user->google2fa = 0;\n $user->passwordSecurity->delete();\n $user->save();\n return redirect()\n ->route('backend.profile')\n ->with('success', 'Двухфакторная аутентификация выключена');\n }",
"public static function disable_auth_subsystem() {\n\t\tself::$fake_instance = new Auth_NoAuth();\n\t}",
"public function testTwoFactorIsDisabled()\n {\n $model = factory(User::class)->make(['totp_secret' => self::USER_TOTP_SECRET, 'use_totp' => true]);\n\n $this->google2FA->shouldReceive('verifyKey')->with(self::DECRYPTED_USER_SECRET, 'test-token', self::TEST_WINDOW_INT)->once()->andReturn(true);\n $this->repository->shouldReceive('withoutFreshModel->update')->with($model->id, [\n 'totp_authenticated_at' => Carbon::now(),\n 'use_totp' => false,\n ])->once()->andReturnNull();\n\n $this->assertTrue($this->getService()->handle($model, 'test-token'));\n }",
"public function setDoubleAuthActive($value = false);",
"protected function userHasNotEnabledTwoFactorAuth()\n {\n return ! ($this->user instanceof TwoFactorAuthenticatable && $this->user->hasTwoFactorEnabled());\n }",
"public function setNonAdminAuth() {\n $_SERVER['PHP_AUTH_USER'] = $GLOBALS['NON_ADMIN_USERNAME'];\n $_SERVER['PHP_AUTH_PW'] = $GLOBALS['NON_ADMIN_PASSWORD'];\n }",
"public function disableAutoLogin() {\n setcookie('id');\n setcookie('password');\n }",
"public function disable2fa(Request $request): RedirectResponse\n {\n $user = auth()->user();\n\n if (! Hash::check($request->get('current-password'), $user->password)) {\n return back()->with('error', 'Het gegeven wachtwoord klopt niet met uw huidige wachtwoord. Probeer het opnieuw.');\n }\n\n $validatedData = $request->validate(['current-password' => 'required']);\n\n // $user->passwordSecurity->update(['google2fa_enable' => false]);\n $user->passwordSecurity->delete();\n\n return redirect()->route('account.security')\n ->with('success', '2FA is gedeactiveerd.');\n }",
"public function disableBasicAuth(): void\n {\n $this->basicAuth = false;\n }",
"public function editTwoFactorAuth() {\n\n $this->_checkIfUserIsLoggedIn();\n\n $twoFactorAuth = Input::get('two-factor-auth');\n\n if ($twoFactorAuth === 'active') {\n // Enable two factor auth\n $this->_usersModel->handleTwoFactorAuthStatus($this->_userId, 1);\n $this->_returnResponse('success', 'Two factor authentication was enabled');\n }\n // Disable two factor auth\n $this->_usersModel->handleTwoFactorAuthStatus($this->_userId, 0);\n $this->_returnResponse('success', 'Two factor authentication was disabled');\n }",
"public static function admin_force_two_step_authentication_setup(){\n global $pagenow;\n if(is_user_logged_in()){\n $user = wp_get_current_user();\n $secret_word = SWTSA_Users_Security::get_user_secret_word($user->ID);\n if(!$secret_word){\n if($pagenow !== 'profile.php'){\n wp_redirect(get_edit_profile_url());\n die();\n } else {\n add_action('admin_notices', array('SWTSA_Users_Security', 'admin_area_no_secret_word_notice'));\n }\n }\n }\n }",
"public function isTwoFactorEnabled()\n {\n return in_array('two_factor', config('awesio-auth.enabled'));\n }",
"public function disable2FA(): void;",
"public function dontSeeAuthentication()\n {\n $this->assertFalse($this->app['auth']->check(), 'User is logged in');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set filter by item id | public function addIdFilter($item)
{
if (is_array($item)) {
$this->addFieldToFilter('item_id', array('in'=>$item));
} elseif ($item instanceof Mage_Sales_Model_Order_Item) {
$this->addFieldToFilter('item_id', $item->getId());
} else {
$this->addFieldToFilter('item_id', $item);
}
return $this;
} | [
"private function setMenuIdFilter()\n\t{\n\t\t$this->setFilters(array('menu_id' => $this->getUser()->getAttribute('menu_id')));\n\t}",
"public function setItemId($id);",
"public function attachFilter($id, IFilterModel $filter);",
"public function getFilter($id);",
"public function setFilterTypeId($id)\n\t{\n\t\tif (is_numeric($id)) {\n\t\t\t$this->_filterTypeId = (int)$id;\n\t\t}\n\t}",
"public function setItemPublic($id)\n {\n $query = $this->createQueryBuilder('q')\n ->update(Food::class, 'f')\n ->set('f.isPublic', '?1')\n ->where('f.id = ?2')\n ->setParameter(1, true)\n ->setParameter(2, $id)\n ->getQuery();\n\n $query->execute();\n }",
"private function filter_item($id = null)\n { \n if (is_null($id)) return null;\n\n $id = trim(filter_var($id, FILTER_SANITIZE_NUMBER_INT));\n\n if( $this->item_exists($id))\n {\n return $id;\n }\n\n return null;\n }",
"public function setFilterId($filter_id)\r\n\t{\r\n\t\t$this->filter_id = $filter_id;\r\n\t}",
"function filter_id($filtername){}",
"public function setFilter($filter){}",
"public function actionFilterSetSiteId()\n\t{\n\t\t$this->setFilter('site_id', $_POST['site_id']);\n\t}",
"function filter_id ($filtername) {}",
"public function setItemPublic($id)\n {\n $query = $this->createQueryBuilder('q')\n ->update(Review::class, 'r')\n ->set('r.isPublic', '?1')\n ->where('r.id = ?2')\n ->setParameter(1, true)\n ->setParameter(2, $id)\n ->getQuery();\n\n $query->execute();\n }",
"public function filterUser(int|UniqueId $id): self;",
"public function userIdFiltering(&$filter)\n {\n // Enter your code here\n }",
"public function addStoreIdFilter($id){\r\n\t\t$this->getSelect()\r\n\t\t\t->where('store_id='.$id.\" OR store_id=0\");\r\n\t\t\t\r\n\t\treturn $this;\t\r\n\t}",
"public function SetID($filter_id)\n {\n $this->filter_id = $filter_id;\n $this->filter_data = null;\n \n return $this;\n }",
"function setProductFilter($productId) {\n\t\t\treturn $this->addFieldToFilter( 'product_id', $productId );\n\t\t}",
"public function setAssignmentFilterId($val)\n {\n $this->_propDict[\"assignmentFilterId\"] = $val;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rewrited default vat value | public function getRewritedVatValue()
{
$rewritedVat = $this->rewritedVatValue;
return is_null($rewritedVat) === false ? $rewritedVat : $this->getAttribute('vatValue');
} | [
"public function fixVat()\n\t{\n\t\tif (!isset($this->vat_rate))\n\t\t {\n\t\t\t $this->vat_rate=Yii::app()->params['standardVatRate'];\n\t\t\t $this->vat_amount=$this->vatAmount;\t\t\t \n\t\t }\t\n\t}",
"private function setRawDefault(): void\n {\n // Reserve now() to generate as `useCurrent`.\n if ($this->default === 'now()') {\n return;\n }\n\n $default = $this->repository->getDefaultByColumnName($this->tableName, $this->name);\n\n if ($default === null) {\n return;\n }\n\n // If default value is expression, eg: timezone('Europe/Rome'::text, now())\n if (!preg_match('/\\((.?)\\)/', $default)) {\n return;\n }\n\n $this->default = $default;\n $this->rawDefault = true;\n }",
"public function applyDefaultValue();",
"public function setVat($value);",
"public function applyDefault()\n {\n $this->internalValue = $this->internalDefaultValue;\n }",
"function _set_case_default() {\n\n\t// eger varsayılan form durumu yok ise ilk degeri varsayilan yapalim\n\t$where = array('taxonomy'=>'extra_case', 'is_default'=>'default', 'is_bank'=>0);\n\n\tif($query = db()->query(\"SELECT * FROM \".dbname('extra').\" WHERE taxonomy='extra_case' AND val_5='default' AND val_enum='0' \")) {\n\t\tif(!$query->num_rows) {\n\t\t\tdb()->query(\"UPDATE \".dbname('extra').\" SET val_5='default' WHERE taxonomy='extra_case' AND val_5='' AND val_enum='0' ORDER BY id ASC LIMIT 1\");\n\t\t}\n\t}\n\n\tif($query = db()->query(\"SELECT * FROM \".dbname('extra').\" WHERE taxonomy='extra_case' AND val_5='default' AND val_enum='1' \")) {\n\t\tif(!$query->num_rows) {\n\t\t\tdb()->query(\"UPDATE \".dbname('extra').\" SET val_5='default' WHERE taxonomy='extra_case' AND val_5='' AND val_enum='1' ORDER BY id ASC LIMIT 1\");\n\t\t}\n\t}\n\n}",
"public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->pregnancyweek = 0;\n $this->version = 0;\n $this->privilege = false;\n $this->urgent = false;\n $this->uuid_id = 0;\n }",
"private function setDefaultValue() {\r\n\t\t$this->Value = $this->Options['default'];\r\n\t}",
"public function applyDefaultValues()\n\t{\n\t\t$this->price = 0;\n\t\t$this->price_koef = 0;\n\t\t$this->weight = 0;\n\t\t$this->is_approved = false;\n\t\t$this->is_global = false;\n\t\t$this->is_editable = true;\n\t}",
"public function setDefaults();",
"public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 0;\n $this->status = 0;\n $this->request = 0;\n }",
"abstract protected function defaultInitialValue();",
"private function setDefaults() {\n\t\t$this->setParameter('defaulttemplatesuffix', '.default');\n\n\t\t$parameters = $this->getParametersForRichness();\n\t\tforeach ($parameters as $parameter) {\n\t\t\tif ($this->getData($parameter)['default'] !== null && !($this->getData($parameter)['default'] === false && $this->getData($parameter)['boolean'] === true)) {\n\t\t\t\tif ($parameter == 'debug') {\n\t\t\t\t\t\\DynamicPageListHooks::setDebugLevel($this->getData($parameter)['default']);\n\t\t\t\t}\n\t\t\t\t$this->setParameter($parameter, $this->getData($parameter)['default']);\n\t\t\t}\n\t\t}\n\t}",
"protected function set_defaults() {\n }",
"public function setDefaults() {\n\t\t\tif (!$this->current()->get('tagid') && $strTag = $this->current()->get('tag')) {\n\t\t\t\tAppLoader::includeModel('TagModel');\n\t\t\t\t$objTag = new TagModel();\n\t\t\t\tif ($objTag->loadByTag($strTag, array('AutoFilterOff' => true))) {\n\t\t\t\t\tif (!$objTag->count()) {\n\t\t\t\t\t\t$objTag->import(array(\n\t\t\t\t\t\t\t'tag' => $strTag\n\t\t\t\t\t\t));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($objTag->save()) {\n\t\t\t\t\t\t\t$this->current()->set('tagid', $objTag->first()->get('tagid'));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->current()->set('tagid', $objTag->first()->get('tagid'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (!$this->current()->get('weight')) {\n\t\t\t\t$this->current()->set('weight', 1);\n\t\t\t}\n\t\t}",
"function setDefaultToInput(){\n foreach( $this->defaultS as $key=>$val ){\n if( !isset($this->inputS[$key]) ){\n $this->inputS[$key] = $val;\n }\n }\n }",
"protected function assignVatNumber()\n {\n }",
"public function setDefaults() {\n\t\t\tif (!$this->current()->get('sent')) {\n\t\t\t\t$this->current()->set('sent', date(AppRegistry::get('Database')->getDatetimeFormat()));\n\t\t\t}\n\t\t\tif (!$this->current()->get('code')) {\n\t\t\t\t$this->current()->set('code', md5(time() . rand(1, 10000)));\n\t\t\t}\n\t\t}",
"public function get_default_value();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds available wizard icons | public function getAvailableWizardIcons(array &$parameters) : void
{
$identifiers = [
'content-header',
'content-textpic',
'content-bullets',
'content-table',
'content-special-uploads',
'content-special-menu',
'content-special-html',
'content-special-div',
'content-special-shortcut',
'content-elements-login',
'content-elements-mailform',
'content-plugin'
];
foreach ($identifiers as $identifier) {
$parameters['items'][] = [
'LLL:EXT:dce/Resources/Private/Language/locallang_db.xlf:wizardIcon.' . $identifier,
$identifier,
$identifier
];
}
$ll = 'LLL:EXT:dce/Resources/Private/Language/locallang_db.xlf:';
$parameters['items'][] = [$ll . 'wizardIcon.custom', '--div--'];
$parameters['items'][] = [$ll . 'wizardIcon.customIcon', 'custom'];
} | [
"public function register_menu_icons() {\n $this->registered_menu_icons = true;\n }",
"protected function registerBackendIcons() {}",
"public abstract function setIcons();",
"protected function registerTCAIcons() {}",
"private function setIconPacks()\n {\n \t$arr_icons = array(\n\t\t\t\"active\" \t\t\t\t\t=> \"glyphicon glyphicon-ok\",\n\t\t\t\"add\" \t\t\t\t\t\t=> \"glyphicon glyphicon-plus\",\n \t\t\"aim\"\t\t\t\t\t\t=> \"glyphicon glyphicon-screenshot\",\n \t\t\"announcement\"\t\t\t\t=> \"glyphicon glyphicon-earphone\",\n\t\t\t\"attachment\" \t\t\t\t=> \"glyphicon glyphicon-paperclip\",\n\t\t\t\"back_old\" \t\t\t\t\t=> \"glyphicon glyphicon-arrow-left\",\n\t\t\t\"back\"\t\t\t\t\t\t=> \"glyphicon glyphicon-arrow-left\",\n \t\t\"back_left\"\t\t\t\t\t=> \"glyphicon glyphicon-arrow-left\",\n\t\t\t\"bar-chart\" \t\t\t\t=> \"glyphicon glyphicon-signal\",\n\t\t\t\"behaviours\" \t\t\t\t=> \"glyphicon glyphicon-link\",\n\t\t\t\"bulk\"\t\t\t\t\t\t=> \"glyphicon glyphicon-bullhorn\",\n \t\t\"cache\"\t\t\t\t\t\t=> \"glyphicon glyphicon-flash\",\n \t\t\"campaigns\"\t\t\t\t\t=> \"glyphicon glyphicon-magnet\",\n\t\t\t\"calendar\" \t\t\t\t\t=> \"glyphicon glyphicon-calendar\",\n \t\t\"city\"\t\t\t\t\t\t=> \"glyphicon glyphicon-king\",\n\t\t\t\"comment\" \t\t\t\t\t=> \"glyphicon glyphicon-paperclip\",\n\t\t\t\"comms\" \t\t\t\t\t=> \"glyphicon glyphicon-volume-down\",\n\t\t\t\"contacts\"\t\t\t\t\t=> 'glyphicon glyphicon-user',\n \t\t\"contact_status\"\t\t\t=> \"glyphicon glyphicon-record\",\n \t\t'dashboard'\t\t\t\t\t=> 'glyphicon glyphicon-dashboard',\n\t\t\t\"database\" \t\t\t\t\t=> \"glyphicon glyphicon-oil\",\n\t\t\t\"delete\" \t\t\t\t\t=> \"glyphicon glyphicon-remove\",\n\t\t\t\"duplicate\" \t\t\t\t=> \"glyphicon glyphicon-floppy-disk\",\n \t\t\"edit\"\t\t\t\t\t\t=> \"glyphicon glyphicon-wrench\",\n\t\t\t\"email\" \t\t\t\t\t=> \"glyphicon glyphicon-envelope\",\n\t\t\t\"exit\" \t\t\t\t\t\t=> \"glyphicon glyphicon-off\",\n\t\t\t\"fax\" \t\t\t\t\t\t=> \"glyphicon glyphicon-phone-alt\",\n\t\t\t\"fields\" \t\t\t\t\t=> \"glyphicon glyphicon-th-list\",\n \"inbox\" => \"glyphicon glyphicon-inbox\",\n\t\t\t\"file_manager\" \t\t\t\t=> \"glyphicon glyphicon-file\",\n\t\t\t\"files\" \t\t\t\t\t=> \"glyphicon glyphicon-folder-close\",\n\t\t\t\"forms\" \t\t\t\t\t=> \"glyphicon glyphicon-list-alt\",\n\t\t\t\"groups\" \t\t\t\t\t=> \"glyphicon glyphicon-globe\",\n \t\t\"help\"\t\t\t\t\t\t=> \"glyphicon glyphicon-question-sign\",\n\t\t\t\"html_templates_comms\" \t\t=> \"glyphicon glyphicon-th\",\n\t\t\t\"html_templates_forms\" \t\t=> \"glyphicon glyphicon-th\",\n\t\t\t\"inactive\" \t\t\t\t\t=> \"glyphicon glyphicon-remove-circle\",\n\t\t\t\"info\" \t\t\t\t\t\t=> \"glyphicon glyphicon-option-horizontal\",\n \t\t\"layout\"\t\t\t\t\t=> \"glyphicon glyphicon-blackboard\",\n\t\t\t\"line-chart\" \t\t\t\t=> \"glyphicon glyphicon-stats\",\n \t\t\"link\"\t\t\t\t\t\t=> \"glyphicon glyphicon-resize-small\",\n \t\t\"links\"\t\t\t\t\t\t=> \"glyphicon glyphicon-resize-small\",\n \t\t\"list\"\t\t\t\t\t\t=> \"glyphicon glyphicon-list\",\n\t\t\t\"load\" \t\t\t\t\t\t=> \"glyphicon glyphicon-floppy-open\",\n\t\t\t\"loading\" \t\t\t\t\t=> \"glyphicon glyphicon-transfer\",\n \t\t\"location\"\t\t\t\t\t=> \"glyphicon glyphicon-cloud-upload\",\n \t\t\"look_feel\"\t\t\t\t\t=> \"glyphicon glyphicon-refresh\",\n\t\t\t\"modify\" \t\t\t\t\t=> \"glyphicon glyphicon-pencil\",\n\t\t\t\"next\" \t\t\t\t\t\t=> \"glyphicon glyphicon-arrow-right\",\n\t\t\t\"order\"\t\t\t\t\t\t=> \"glyphicon glyphicon-sort-by-order\",\n \t\t\"panels\"\t\t\t\t\t=> \"glyphicon glyphicon-flag\",\n\t\t\t\"picture\" \t\t\t\t\t=> \"glyphicon glyphicon-picture\",\n\t\t\t\"pie-chart\" \t\t\t\t=> \"glyphicon glyphicon-adjust\",\n \t\t\"preview\"\t\t\t\t\t=> \"glyphicon glyphicon-eye-open\",\n\t\t\t\"print\" \t\t\t\t\t=> \"glyphicon glyphicon-print\",\n\t\t\t\"profile\" \t\t\t\t\t=> \"glyphicon glyphicon-eye-open\",\n \t\t\"profile-admin\"\t\t\t\t=> \"glyphicon glyphicon-folder-close\",\n \t\t\"profiles\"\t\t\t\t\t=> \"glyphicon glyphicon-folder-close\",\n\t\t\t\"refresh\" \t\t\t\t\t=> \"glyphicon glyphicon-refresh\",\n\t\t\t\"report\" \t\t\t\t\t=> \"glyphicon glyphicon-stats\",\n\t\t\t\"roles\" \t\t\t\t\t=> \"glyphicon glyphicon-link\",\n\t\t\t\"save\" \t\t\t\t\t\t=> \"glyphicon glyphicon-floppy-save\",\n\t\t\t\"search\" \t\t\t\t\t=> \"glyphicon glyphicon-zoom-in\",\n\t\t\t\"secure\" \t\t\t\t\t=> \"\",\n\t\t\t\"settings\" \t\t\t\t\t=> \"glyphicon glyphicon-cog\",\n\t\t\t\"sms\" \t\t\t\t\t\t=> \"glyphicon glyphicon-phone-alt\",\n\t\t\t\"status-error\" \t\t\t\t=> \"glyphicon glyphicon-remove\",\n\t\t\t\"status-info\" \t\t\t\t=> \"glyphicon glyphicon-eye-open\",\n\t\t\t\"status-success\" \t\t\t=> \"glyphicon glyphicon-ok\",\n \t\t\"sync\"\t\t\t\t\t\t=> \"glyphicon glyphicon-retweet\",\n\t\t\t\"tables\" \t\t\t\t\t=> \"glyphicon glyphicon-th-large\",\n\t\t\t\"tasks\" \t\t\t\t\t=> \"glyphicon glyphicon-tasks\",\n\t\t\t\"unsecure\" \t\t\t\t\t=> \"\",\n\t\t\t\"tracker\"\t\t\t\t\t=> \"glyphicon glyphicon-filter\",\n\t\t\t\"upload\" \t\t\t\t\t=> \"glyphicon glyphicon-cloup-upload\",\n \t\t\"user-data-acl\"\t\t\t\t=> \"glyphicon glyphicon-bishop\",\n \t\t\"user\"\t\t\t\t\t\t=> \"glyphicon glyphicon-user\",\n \t\t\"users\" \t\t\t\t\t=> \"glyphicon glyphicon-user\",\n\t\t\t\"warning\" \t\t\t\t\t=> \"glyphicon glyphicon-warning-sign\",\n \t\t\"webhook\"\t\t\t\t\t=> \"glyphicon glyphicon-globe\",\n \t);\n\n \tforeach ($arr_icons as $icon => $css) {\n\n $additional_style = \"\";\n\n //set sepcific icon additional styles\n \t\tswitch ($icon)\n \t\t{\n\n case \"active\":\n\t\t\t\t\t$additional_style = \"color: green;\";\n \t\t\t\tbreak;\n\n \t\t\tcase \"inactive\":\n \t\t\tcase \"delete\":\n \t\t\t\t$additional_style = \"color: red;\";\n \t\t\t\tbreak;\n\n \t\t} //end switch\n\n \t\t$icon = str_replace(\"-\", \"_\", strtoupper($icon));\n \t\tif (!defined(\"ICON_SMALL_{$icon}_HTML\"))\n \t\t{\n \t\t\tdefine(\"ICON_SMALL_{$icon}_HTML\", \"<span style=\\\"$additional_style\\\"><span class=\\\"$css\\\"></span></span>\");\n \t\t\tdefine(\"ICON_MEDIUM_{$icon}_HTML\", \"<span style=\\\"$additional_style\\\"><span class=\\\"$css\\\"></span></span>\");\n \t\t\tdefine(\"ICON_LARGE_{$icon}_HTML\", \"<span style=\\\"$additional_style\\\"><span class=\\\"$css\\\"></span></span>\");\n \t\t\tdefine(\"ICON_XLARGE_{$icon}_HTML\", \"<span style=\\\"$additional_style\\\"><span class=\\\"$css\\\"></span></span>\");\n \t\t\tdefine(\"ICON_CSS_{$icon}_CLASS\", $css);\n \t\t}//end if\n \t}//end foreach\n }",
"private function _base_wizard() {\n $this->_wizard = array(\n '#attr' => array(\n 'class' => 'wizard wizard-ux',\n 'id' => 'myWizard'\n ),\n 'steps' => $this->_steps\n );\n }",
"public function add_wizard_page()\n {\n }",
"public function add_to($wizard) {\n\t\t\n\t\t// generate HTML from properties\n\t\t$this->__set(\"html\",$this->generate_html());\n\t\t$this->__set(\"html_base64\",base64_encode($this->html));\n\t\t\n\t\t// generate fallback HTML if method exists\n\t\tif (method_exists($this,\"generate_fallback_html\")) {\n\t\t\t$this->__set(\"fallback_html\",$this->generate_fallback_html());\n\t\t\t$this->__set(\"fallback_html_base64\",base64_encode($this->fallback_html));\n\t\t}\n\t\t\n\t\t// add to wizard\n\t\tarray_push($wizard->items,$this);\n\t\t\n\t\t// add any jQuery code to the wizard\n\t\tif (count($this->jquery) > 0) {\n\t\t\tforeach ($this->jquery as $statement) {\n\t\t\t\tarray_push($wizard->jquery,$statement);\n\t\t\t}\n\t\t}\n\n\t}",
"function SetIcons(wxIconBundle $icons){}",
"private function setIconPaths()\n {\n // Directory URL and path\n $plugin = CGIT_SOCIALIZE_PLUGIN;\n $dir = 'icons';\n $url = plugin_dir_url($plugin) . $dir;\n $path = plugin_dir_path($plugin) . $dir;\n\n // Apply filters for customization\n $ext = apply_filters('cgit_socialize_icon_extension', '.svg');\n $url = apply_filters('cgit_socialize_icon_url', $url);\n $path = apply_filters('cgit_socialize_icon_path', $path);\n\n // Make sure directories have trailing slashes\n $url = trailingslashit($url);\n $path = trailingslashit($path);\n\n // Add URLs and paths to each network\n foreach ($this->networks as $key => $value) {\n $this->networks[$key]['icon'] = $url . $key . $ext;\n $this->networks[$key]['icon_path'] = $path . $key . $ext;\n }\n }",
"public function addGridItemsToWizard(array &$gridItems, array &$wizardItems)\n {\n if (empty($gridItems)) {\n return;\n }\n // create gridelements node\n $wizardItems['gridelements'] = array();\n // set header label\n $wizardItems['gridelements']['header'] = $this->getLanguageService()->sL(\n 'LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_backend_layout_wizard_label'\n );\n $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);\n // traverse the gridelements and create wizard item for each gridelement\n foreach ($gridItems as $key => $item) {\n $largeIcon = '';\n if (empty($item['iconIdentifierLarge'])) {\n if (is_array($item['icon']) && isset($item['icon'][1])) {\n $item['iconIdentifierLarge'] = 'gridelements-large-' . $key;\n $largeIcon = $item['icon'][1];\n if (StringUtility::beginsWith($largeIcon, '../typo3conf/ext/')) {\n $largeIcon = str_replace('../typo3conf/ext/', 'EXT:', $largeIcon);\n }\n if (StringUtility::beginsWith($largeIcon, '../uploads/tx_gridelements/')) {\n $largeIcon = str_replace('../', '', $largeIcon);\n } else if (!StringUtility::beginsWith($largeIcon, 'EXT:') && strpos($largeIcon,\n '/') === false\n ) {\n $largeIcon = GeneralUtility::resolveBackPath($item['icon'][1]);\n }\n if (!empty($icon)) {\n if (StringUtility::endsWith($largeIcon, '.svg')) {\n $iconRegistry->registerIcon($item['iconIdentifierLarge'], SvgIconProvider::class, array(\n 'source' => $largeIcon,\n ));\n } else {\n $iconRegistry->registerIcon($item['iconIdentifierLarge'], BitmapIconProvider::class,\n array(\n 'source' => $largeIcon,\n ));\n }\n }\n } else {\n $item['iconIdentifierLarge'] = 'gridelements-large-' . $key;\n $iconRegistry->registerIcon($item['iconIdentifierLarge'], SvgIconProvider::class, array(\n 'source' => 'EXT:gridelements/Resources/Public/Icons/gridelements.svg',\n ));\n }\n }\n\n // Traverse defVals\n $defVals = '';\n\n if ($item['tt_content_defValues']) {\n foreach ($item['tt_content_defValues'] as $field => $value) {\n if ($field == 'header') {\n $value = $GLOBALS['LANG']->sL($value);\n }\n $defVals .= '&defVals[tt_content][' . $field . ']=' . $value;\n }\n }\n\n $itemIdentifier = $item['alias'] ? $item['alias'] : $item['uid'];\n $wizardItems['gridelements_' . $itemIdentifier] = array(\n 'title' => $item['title'],\n 'description' => $item['description'],\n 'params' => ($largeIcon ? '&largeIconImage=' . $largeIcon : '') . '&defVals[tt_content][CType]=gridelements_pi1' . $defVals . '&defVals[tt_content][tx_gridelements_backend_layout]=' . $item['uid'] . ($item['tll'] ? '&isTopLevelLayout' : ''),\n 'tt_content_defValues' => array(\n 'CType' => 'gridelements_pi1',\n 'tx_gridelements_backend_layout' => $item['uid'],\n ),\n );\n\n $icon = '';\n if ($item['iconIdentifier']) {\n $wizardItems['gridelements_' . $itemIdentifier]['iconIdentifier'] = $item['iconIdentifier'];\n } elseif (is_array($item['icon']) && isset($item['icon'][0])) {\n $item['iconIdentifier'] = 'gridelements-' . $key;\n $icon = $item['icon'][0];\n if (StringUtility::beginsWith($icon, '../typo3conf/ext/')) {\n $icon = str_replace('../typo3conf/ext/', 'EXT:', $icon);\n }\n if (StringUtility::beginsWith($icon, '../uploads/tx_gridelements/')) {\n $icon = str_replace('../', '', $icon);\n } else if (!StringUtility::beginsWith($icon, 'EXT:') && strpos($icon, '/') !== false) {\n $icon = GeneralUtility::resolveBackPath($item['icon'][0]);\n }\n if (StringUtility::endsWith($icon, '.svg')) {\n $iconRegistry->registerIcon($item['iconIdentifier'], SvgIconProvider::class, array(\n 'source' => $icon,\n ));\n } else {\n $iconRegistry->registerIcon($item['iconIdentifier'], BitmapIconProvider::class, array(\n 'source' => $icon,\n ));\n }\n } else {\n $item['iconIdentifier'] = 'gridelements-' . $key;\n $iconRegistry->registerIcon($item['iconIdentifier'], SvgIconProvider::class, array(\n 'source' => 'EXT:gridelements/Resources/Public/Icons/gridelements.svg',\n ));\n }\n if ($icon && !isset($wizardItems['gridelements_' . $itemIdentifier]['iconIdentifier'])) {\n $wizardItems['gridelements_' . $itemIdentifier]['iconIdentifier'] = 'gridelements-' . $key;\n } else if (!isset($wizardItems['gridelements_' . $itemIdentifier]['iconIdentifier'])) {\n $wizardItems['gridelements_' . $itemIdentifier]['iconIdentifier'] = 'gridelements-default';\n }\n }\n }",
"public function slcr_add_new_icon_set_to_iconbox() { \n\t\t\t$icons_name = \"flaticon\";\n\t\t $param = WPBMap::getParam( 'vc_icon', 'type' );\n\t $param['value'][__( 'Custom Pack', 'moppers' )] = $icons_name;\n\t vc_update_shortcode_param( 'vc_icon', $param ); \n\t // list of icons that add \n\t add_filter( 'vc_iconpicker-type-flaticon', array( $this, 'slcr_add_icon_array' ), 15 ); \n\t add_action( 'vc_base_register_front_css', array( $this, 'slcr_vc_iconpicker_base_register_css' ), 15 );\n \t\tadd_action( 'vc_base_register_admin_css', array( $this, 'slcr_vc_iconpicker_base_register_css' ), 15 );\n\n \t\tadd_action( 'vc_backend_editor_enqueue_js_css', array( $this, 'slcr_vc_iconpicker_editor_css' ), 15 );\n \t\tadd_action( 'vc_frontend_editor_enqueue_js_css', array( $this, 'slcr_vc_iconpicker_editor_css' ), 15 );\n }",
"function theone_unyson_icon_register($current_packs) {\n /**\n * $current_packs is an array of pack names.\n * You should return which one you would like to show in the picker.\n */\n return array('font-awesome');\n}",
"function inkpro_set_customizer_tabs_icons() {\r\n\t$mods = inkpro_customizer_get_mods();\r\n\r\n\t$css = '';\r\n\r\n\tforeach ( $mods as $key => $value) {\r\n\t\t\r\n\t\tif ( isset( $value['icon'] ) && isset( $value['id'] ) ) {\r\n\r\n\t\t\t$section_id = $value['id'];\r\n\t\t\t$icon_slug = $value['icon'];\r\n\r\n\t\t\t$css .= '\r\n\t\t\t\t#accordion-section-' . $section_id . ' .accordion-section-title:before{\r\n\t\t\t\t\tposition:relative;\r\n\t\t\t\t\tfont-family:Dashicons;\r\n\t\t\t\t\tcontent : \"' . inkpro_get_dashicon_css_unicode( $icon_slug ) . '\";\r\n\t\t\t\t\tposition: relative;\r\n\t\t\t\t\ttop: 2px;\r\n\t\t\t\t\tmargin-left: 5px;\r\n\t\t\t\t\tleft: -6px;\r\n\t\t\t\t\tline-height: inherit;\r\n\t\t\t\t\tfont-weight: normal;\r\n\t\t\t\t}\r\n\t\t\t';\r\n\t\t}\r\n\t}\r\n\r\n\tif ( ! SCRIPT_DEBUG ) {\r\n\t\t$css = wolf_compact_css( $css );\r\n\t}\r\n\r\n\twp_add_inline_style( 'inkpro-customizer-style', $css );\r\n}",
"function add_galleries_icon() {\n\n\t\t$plugin_css = plugin_dir_url( __FILE__ ) . '/css/admin-style.css';\n\n\t\twp_register_style( 'admin-style', $plugin_css );\n\n\t\twp_enqueue_style( 'admin-style' );\n\t}",
"public static function getPaymentManagerIcons()\n\t\t{\n\t\t\techo \"<div id = 'cpanel' class='payment_manager_icons'>\";\n\n\t\t\t$link = 'index.php?option=com_rbids&task=orders.listing';\n\t\t\tJTheFactoryAdminHelper::quickiconButton($link, 'admin/paymentitems.png', JText::_(\"COM_RBIDS_VIEW_ORDERS\"));\n\n\t\t\t$link = 'index.php?option=com_rbids&task=payments.listing';\n\t\t\tJTheFactoryAdminHelper::quickiconButton($link, 'admin/payments.png', JText::_(\"COM_RBIDS_VIEW_PAYMENTS\"));\n\n\t\t\t$link = 'index.php?option=com_rbids&task=balances.listing';\n\t\t\tJTheFactoryAdminHelper::quickiconButton($link, 'admin/payments.png', JText::_(\"COM_RBIDS_USER_PAYMENT_BALANCES\"));\n\n\n\t\t\techo \"</div>\n\t\t\t\t <div style = 'height:100px'> </div>\n\t\t\t\t <div style = 'clear:both;'></div>\n\t\t\t\t \";\n\n\n\t\t}",
"function buildIcons() {\n $this->optimizeSvgIcons();\n $this->taskExec('node ' . self::BASE_DIR . '/build/fe/tasks/icons')\n ->dir(self::BASE_DIR)\n ->run();\n $this->_remove(self::BASE_DIR . '/web/assets/Icons/Content/icons.data.png.css');\n $this->_remove(self::BASE_DIR . '/web/assets/Icons/Content/icons.fallback.css');\n }",
"protected function collectTcaSpriteIcons() {}",
"function ArrangeIcons(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Metodo que inicializa las propiedades de la clase Medico. | function Medico() {
$this->cedula = null;
$this->nombre = null;
$this->apellido = null;
$this->usuario = null;
$this->contrasena = null;
$this->fisio = null;
} | [
"function __construct($tipo)\n {\n parent::__construct();\n Moto::setTipo($tipo);\n }",
"public function usarMedio() {\n $this->usoDeMedio++; \n }",
"function __construct()\n {\n $this->modelo = new Modelo();\n $this->fx=new FxFormularios();\n\t //$this->pantallas=new Pantallas();\n }",
"private function cargar_instancias() {\n \n // Cree una instancia del cargador que se utilizará para registrar los ganchos con WordPress.\n $this->cargador = new DCM_Cargador;\n $this->dcm_admin = new DCM_Admin( $this->get_plugin_name(), $this->get_version() );\n $this->dcm_public = new DCM_Public( $this->get_plugin_name(), $this->get_version() );\n $this->ajax = new DCM_Ajax;\n }",
"function __construct() {\n\t\t\tparent::__construct();\n //include_once 'TIcfes_Competencias.inc';\n\t\t\t$this->includeModel('TIcfes', 'TPrograma','ICompetencia', 'ICuestionario', 'ICualitativo');\n\t\t\t$this->vista->setTitle('Pruebas');\n\t\t\t$this->ICuestionario = new ICuestionario();\n\t }",
"function __construct() {\n // Add metaboxes\n add_action( 'add_meta_boxes', array( $this, 'descriptif_detail_add_meta_box' ) );\n\t\t// Save infos from metaboxes\n\t\tadd_action( 'save_post', array( $this, 'descriptif_detail_save' ) );\n\t\t// Metabox class (call)\n\t\t$this->metaboxClass = new Equipeer_Metabox();\n\t}",
"function metodos() {\n $this->vista = \"listaMetodos\";\n $controladorMetodos = new MetodosController();\n $this->dv->vistaMetodos = $controladorMetodos->metodosObjeto();\n }",
"function __construct(){\n $this->ConjuntosDAO=new dao_institucion();\n }",
"public function __construct() {\n\t\t$this->carregar = new Carregar();\n\t}",
"public function __construct() {\n parent::__construct();\n //register the fields to be persisted and loaded\n $this->setPersistenceKeys(array(\"php\", \"kajona\"));\n }",
"public function __construct() {\n $this->model = new CursoDAO();\n $this->modeloPersona = new PersonaDAO();\n $this->modeloTema = new TemaDAO();\n $this->utilidades = new Utilidades();\n }",
"function __construct()\n {\n $this->obj_contato_anunciante = new OBJ_Contato_Anunciante();\n }",
"function __construct() {\n // Add metaboxes\n add_action( 'add_meta_boxes', array( $this, 'type_add_meta_box' ) );\n\t\t// Save infos from metaboxes\n\t\tadd_action( 'save_post', array( $this, 'type_save' ) );\n\t\t// Metabox class (call)\n\t\t$this->metaboxClass = new Equipeer_Metabox();\n\t\t// Titan call\n\t\t$this->equipeer_options = TitanFramework::getInstance( EQUIPEER_ID );\n\t}",
"public function get_medico()\n {\n \n // loads the associated object\n if (empty($this->medico))\n $this->medico = new Medicos($this->medico_id);\n \n // returns the associated object\n return $this->medico;\n }",
"function __construct() {\n // Add metaboxes\n add_action( 'add_meta_boxes', array( $this, 'aptitudes_saut_add_meta_box' ) );\n\t\t// Save infos from metaboxes\n\t\tadd_action( 'save_post', array( $this, 'aptitudes_saut_save' ) );\n\t\t// Metabox class (call)\n\t\t$this->metaboxClass = new Equipeer_Metabox();\n\t}",
"function __construct() {\n\t\t\t$conexion = new Conexion(APPBD, APP);\n\t\t\t$this->entidad = $conexion->doctrineORM();\n\t\t}",
"public function __construct()\n\t{\n\t\t//$this->tipo = 'prod' ;\n\t\t//$this->tipo = 'paralelo' ;\n\t\t$this->tipo = 'respaldo' ;\n\t}",
"function __construct() {\n // Add metaboxes\n add_action( 'add_meta_boxes', array( $this, 'notes_add_meta_box' ) );\n\t\t// Save infos from metaboxes\n\t\tadd_action( 'save_post', array( $this, 'notes_save' ) );\n\t\t// Metabox class (call)\n\t\t$this->metaboxClass = new Equipeer_Metabox();\n\t}",
"function testeMedico()\n{\n // $a->setNome(\"LISA CUDDY\");\n // $a->identifica();\n // $a->setCodEspecialidade(\"17\");\n // $a->alterar();\n\n $a = new lMedico();\n $a->setNome(\"LISA CUDDY\");\n $a->identifica();\n // print_r($a->listaEspecialidades());\n print_r($a->listaHorarios()[0][\"seg\"]);\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// Payments // Payments() Retrieves Applied Payments that have been made specifically against this Account Retrieves Applied Payments that have been made specifically against this Account | public function Payments ()
{
return new AppliedPayments ($this);
} | [
"public function listPayments($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), 'Google\\Service\\AdSense\\Payments');\n }",
"public function getPayments()\n {\n return $this->payments;\n }",
"public function getPayments()\n {\n return $this->Payments;\n }",
"public function setPayments($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Lnrpc\\Payment::class);\n $this->payments = $arr;\n\n return $this;\n }",
"public function getPayments() {\n return isset($this->container['Payments']) ? $this->container['Payments'] : null;\n\t}",
"public function getPaymentsAccountId()\n {\n return $this->payments_account_id;\n }",
"public function findPaymentAdjustments(array $parameters = []) {\n return $this->oauth()->requestCollection('GET', '/payments/:payment_id/adjustments', $parameters);\n }",
"public function getPaymentsAccountInfo()\n {\n return $this->payments_account_info;\n }",
"public function getPayments();",
"public function totalAccountPayable()\n {\n $payables = $this->journals()\n ->join(ChartOfAccount::getTableName(), ChartOfAccount::getTableName('id'), '=', Journal::getTableName('chart_of_account_id'))\n ->join(ChartOfAccountType::getTableName(), ChartOfAccountType::getTableName('id'), '=', ChartOfAccount::getTableName('type_id'))\n ->where(function ($query) {\n $query->where(ChartOfAccountType::getTableName('name'), '=', 'current liability')\n ->orWhere(ChartOfAccountType::getTableName('name'), '=', 'long term liability')\n ->orWhere(ChartOfAccountType::getTableName('name'), '=', 'other current liability');\n })\n ->selectRaw('SUM(`credit`) AS credit, SUM(`debit`) AS debit')\n ->first();\n\n return $payables->credit - $payables->debit;\n }",
"public function payments($merchantId)\n {\n return Merchant::findorFail($merchantId)->payments->all();\n }",
"abstract public function getPayments();",
"public function getAllPayments()\n {\n return $this->payment->getPaymentMethods();\n }",
"public function getAcceptedPayments()\n {\n return $this->acceptedPayments;\n }",
"public function payPeriodPayments($id){\n $this->PayPeriods = TableRegistry::getTableLocator()->get('PayPeriods');\n $this->Jobs = TableRegistry::getTableLocator()->get('Jobs');\n $this->Businesses = TableRegistry::getTableLocator()->get('Businesses');\n\n $payPeriod = $this->PayPeriods->get($id, [\n 'contain' => []\n ]);\n\n // Get Business\n $business = $this->Businesses->get($payPeriod->business_id);\n\n // Setup array to be passed\n $pay_period = [\n 'id'=>$payPeriod->id,\n 'business_id'=>$business->id,\n 'account_id'=> $business->default_account_id,\n\n ];\n\n // Get all Jobs within Pay Period Dates\n // Filter all Jobs with payments made\n $jobs = $this->Jobs->find('all')\n ->where(['appointment_date >='=>$payPeriod->start_date->format('Y-m-d')])\n ->where(['appointment_date <='=>$payPeriod->end_date->format('Y-m-d')])\n ->contain(['Payments','AccountPayments'])->toArray();\n\n // separate jobs out\n foreach($jobs as $job){\n $pay_period['contractors'][$job->technician] = $job->technician;\n\n $status = strtolower($job->job_status);\n\n switch($job->job_status){\n case 'COMPLETED':\n $pay_period['completed'][] = $job->id;\n break;\n case 'CANCELLED':\n $pay_period['cancelled'][] = $job->id;\n break;\n case 'NOT_SERVICED':\n $pay_period['pending'][] = $job->id;\n break;\n }\n }\n\n // Create all payments\n if(isset($pay_period['completed'])){\n $pay_results = $this->makePayments($pay_period);\n } else {\n $pay_results = [];\n }\n\n return $pay_results;\n }",
"public function getPayment(): ?PaymentsInterface\n {\n foreach ($this->complements as $c) {\n if ($c instanceof Payments10) {\n return $c;\n }\n if ($c instanceof Payments20) {\n return $c;\n }\n }\n\n return null;\n }",
"private function _getTotalAmount($payments) {\n $totalAmount = 0;\n foreach($payments as $payment)\n $totalAmount += $payment['payable'];\n\n return $totalAmount;\n }",
"public function payAmount()\n {\n if ($this->amount >= 500) {\n $payment = new payByCC();\n } else {\n $payment = new payByPayPal();\n }\n\n $payment->pay($this->amount);\n }",
"public function getPaymentsAccountName()\n {\n return $this->payments_account_name;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable showing item extra | public function showItemExtra() : void
{
//noop
} | [
"public function showItemExtra() : void\n {\n $this->showItemExtra = true;\n }",
"public function showsItemExtra() : bool\n {\n return false;\n }",
"public function showsItemExtra() : bool;",
"public function hideItemExtra() : void\n {\n $this->showItemExtra = false;\n }",
"public function showsItemExtra() : bool\n {\n return $this->showItemExtra;\n }",
"public function hideItemExtra() : void;",
"function set_extra() {\n $this->extra = true;\n return $this;\n }",
"public function hookPublicItemsShow() {\n if (get_option('item_relations_public_append_to_items_show')) {\n $item = get_current_record('item');\n\n echo common('item-relations-show', array(\n 'subjectRelations' => self::prepareSubjectRelations($item),\n 'objectRelations' => self::prepareObjectRelations($item)\n ));\n }\n }",
"public function enableDetailsRow()\n {\n $this->details_row = true;\n }",
"function display_additional_meta_data(){}",
"public function getItemExtraOptions($id)\n {}",
"protected function showOptionalAdditionalInfo()\n {\n return;\n }",
"public function getIsLineItemsEnabled()\n {\n return true;\n }",
"public function hookPublicItemsShow($args)\n {\n $item = $args['item'];\n $resources = AdditionalResource::getItemResources($item);\n echo get_view()->partial('additional-resources/show.php', array('resources' => $resources));\n }",
"protected function beforeShow() {}",
"public function field_additional_items() {\n\t\t$addtl_items = array(\n\t\t\t\t'log_404s' => __( 'Log 404 errors as events', 'wp-google-analytics' ),\n\t\t\t\t'log_searches' => sprintf( __( 'Log searches as /search/{search}?referrer={referrer} (<a href=\"%s\">deprecated</a>)', 'wp-google-analytics' ), 'http://wordpress.org/extend/plugins/wp-google-analytics/faq/' ),\n\t\t\t\t'log_outgoing' => __( 'Log outgoing links as events', 'wp-google-analytics' ),\n\t\t\t);\n\t\tforeach( $addtl_items as $id => $label ) {\n\t\t\techo '<label for=\"wga_' . $id . '\">';\n\t\t\techo '<input id=\"wga_' . $id . '\" type=\"checkbox\" name=\"wga[' . $id . ']\" value=\"true\" ' . checked( 'true', $this->_get_options( $id ), false ) . ' />';\n\t\t\techo ' ' . $label;\n\t\t\techo '</label><br />';\n\t\t}\n\t}",
"public function beforeItemRender($item)\n {\n return true;\n }",
"private function configureFrontendExtras(): void\n {\n $this->faqBlockId = $this->insertExtra($this->getModule(), ModuleExtraType::block(), $this->getModule());\n $this->insertExtra($this->getModule(), ModuleExtraType::widget(), 'MostReadQuestions', 'MostReadQuestions');\n $this->insertExtra($this->getModule(), ModuleExtraType::widget(), 'AskOwnQuestion', 'AskOwnQuestion');\n $this->insertExtra($this->getModule(), ModuleExtraType::widget(), 'Categories', 'Categories');\n }",
"public function show_atts_on_shop()\n\t{\n\t\tglobal $product;\n\t\techo wp_kses_post($this->the_attributes($product, 'li'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the minimal value according to a given comparator. Returns null for an empty iterable. | public function min(?callable $compare = null)
{
return i\iterable_min($this->iterable, $compare);
} | [
"public function min(callable $comparator = null);",
"public function minWith(callable $comparator);",
"public function min()\n {\n if ($this->empty()) {\n return null;\n }\n\n if (is_array($this->pipeline)) {\n /** @psalm-suppress ArgumentTypeCoercion */\n return min($this->pipeline);\n }\n\n $this->pipeline = self::makeNonRewindable($this->pipeline);\n\n $min = null;\n\n foreach ($this->pipeline as $min) {\n break;\n }\n\n // Return if there's nothing more to fetch\n if (!$this->pipeline->valid()) {\n return $min;\n }\n\n foreach ($this->pipeline as $value) {\n if ($value < $min) {\n $min = $value;\n }\n }\n\n return $min;\n }",
"public function minBy(callable $callback): Option;",
"public function minBy(callable $callback): mixed;",
"public function min()\n\t\t{\n\t\t\t// Ensure all elements are valid numbers\n\t\t\tif (!$this->all(function($n) { return is_numeric($n); }))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"plinq->min(): expects completely numeric data set\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Filter out min number in set\n\t\t\treturn min($this->data);\n\t\t}",
"public function min(): mixed\n {\n return $this->data ? min($this->data) : null;\n }",
"public function min()\n {\n $collection = $this->getSortedCollection();\n\n return $collection->first();\n }",
"public static function min($set)\n {\n # remove non-numerics\n self::_sanitize($set);\n \n if ($set->count() === 0) {\n return null;\n } \n \n return min($set->toArray());\n }",
"function min($list)\n{\n // extract first element in list\n $fst = head($list);\n\n return fold(\n function ($acc, $val) {\n return _filterNumeric($val) ? ($val < $acc ? $val : $acc) : $acc;\n },\n $list,\n !_filterNumeric($fst) ? 0 : $fst\n );\n}",
"public function first(?callable $predicate = null)\n {\n if ($predicate === null)\n return isset($this->items[0]) ? $this->items[0] : null;\n\n foreach ($this as $i => $item)\n if ($predicate($item, $i) === true)\n return $item;\n\n return null;\n }",
"public function smallest()\n {\n $area = array_column($this->items, 'area_sq_km');\n\n if ($this->lang == 'np') {\n $area = array_map(function ($item) {\n return Helper::numericEnglish($item);\n }, $area);\n }\n return $this->items[array_search(min($area), $area)];\n }",
"public function smallest()\n {\n $area = array_column($this->items, 'area_sq_km');\n\n if($this->lang == 'np'){\n $area = array_map(function ($item){\n return Helper::numericEnglish($item);\n }, $area);\n }\n\n return $this->items[array_search(min($area), $area)];\n }",
"public function min()\n\t{\n\t\treturn $this->n() ? min($this->observations) : null;\n\t}",
"public static function MIN() {\n\t\t// Return value\n\t\t$returnValue = null;\n\n\t\t// Loop trough arguments\n\t\t$aArgs = self::flattenArray(func_get_args());\n\t\tforeach ($aArgs as $arg) {\n\t\t\t// Is it a numeric value?\n\t\t\tif ((is_numeric($arg)) && (!is_string($arg))) {\n\t\t\t\tif ((is_null($returnValue)) || ($arg < $returnValue)) {\n\t\t\t\t\t$returnValue = $arg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return\n\t\tif(is_null($returnValue)) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn $returnValue;\n\t}",
"function first($array, $predicate) {\n\n foreach ($array as $value) {\n if($predicate($value)) {\n return $value;\n }\n }\n return null;\n}",
"public function getMinimumValue(array $sequence)\r\n\t{\r\n\t\tif (empty($sequence))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn min($sequence);\r\n\t}",
"public static function getLowerBound(array $array, callable $key, $min)\n {\n $lo = 0;\n $hi = count($array) - 1;\n\n // Based on a non-recursive binary search.\n while ($lo <= $hi) {\n $m = floor(($lo + $hi) / 2);\n $value = $key($array[$m]);\n if ($value < $min) {\n $lo = $m + 1;\n } elseif ($value >= $min) {\n if (!isset($array[$m - 1]) || $key($array[$m - 1]) < $min) {\n return $m;\n }\n $hi = $m - 1;\n }\n }\n\n return null;\n }",
"public static function min( $dates )\n {\n if ( $dates instanceof Traversable )\n {\n $dates = ArrayUtils::iteratorToArray( $dates );\n }\n\n if ( ! is_array( $dates ) )\n {\n $dates = func_get_args();\n }\n\n $min = null;\n\n foreach ( $dates as $date )\n {\n if ( empty( $date ) )\n {\n continue;\n }\n\n if ( is_scalar( $date ) )\n {\n $date = new static(\n is_int( $date )\n ? '@' . intval( $date )\n : $date\n );\n }\n\n if ( $date instanceof \\DateTime )\n {\n if ( null === $min || $date < $min )\n {\n $min = $date;\n }\n }\n }\n\n return $min;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field friend_frommname | public function setFriendFrommname($friend_frommname)
{
$this->friend_frommname = $friend_frommname;
return $this;
} | [
"function setFromName($value) {\n return $this->setFieldValue('from_name', $value);\n }",
"public function setFromName($from_name)\n\t{\n\t\t$this->from_name = $from_name;\n\t}",
"public function setFrom ($from, $name = null)\n {\n \tif($name !== null) {\n \t\t $this->fromAddress = \"\\\"\" . $name . \"\\\" <\" . $from . \">\";\n \t}\n \telse {\n \t$this->fromAddress = $from;\n \t}\n }",
"function SetFromName() {\n\tglobal $fromName, $fromNameThem, $fromNameThemField;\n\n\t$fn = \"\";\n\n\t// If we want to use the sender's name as the From Name, parse all name-{fields}\n\tif ($fromNameThem) {\n\t\t$fn = $fromNameThemField;\n\n\t\t// Extract variable names from the name field\n\t\tpreg_match_all(\"/\\{([a-zA-Z0-9_-]+)\\}/\", $fn, $nameMatches);\n\n\t\t// Loop through all variables of the name field\n\t\tforeach($nameMatches[1] as $val) {\n\t\t\t// Try to replace all variables with the corresponding postvars (if they exist, otherwise it'll make it empty)\n\t\t\t$fn = str_replace(\"{\" . $val . \"}\", (isset($_POST[$val]) ? $_POST[$val] : \"\"), $fn);\n\t\t}\n\t}\n\n\t// Double check if fromName isn't empty, otherwise fill it with the predefined name\n\t$fn = trim($fn);\n\t$fn = ($fn ? $fn : $fromName);\n\t$fn = preg_replace('/([\"“”‘’„”«»]|")/', \"\", $fn, -1);\n\n\treturn $fn;\n}",
"public function getFriendFrommavatar()\n {\n return $this->friend_frommavatar;\n }",
"public function setFromName($fromName)\n {\n $this->fromName = $fromName;\n return $this;\n }",
"public function setFrom(string $value) {\n $name = '';\n $addr = '';\n $this->splitEmailNameAdress($value, $name, $addr);\n $this->from = $addr;\n $this->fromName = $name;\n }",
"function SetSender($from)\n\t{\n\t\tif (strlen($from) > 20) {\n\t\t\t$this->debug(\"Error: sender id too long.<br />\");\n\t\t\treturn;\n\t\t}\n\t\t$this->_source_address = $from;\n\t}",
"function SetSender($from)\n\t{\n\t\tif (strlen($from) > 20) {\n\t\t\t$this->debug(\"Error: sender id too long.\\n\");\n\t\t\treturn;\n\t\t}\n\t\t$this->_source_address = $from;\n\t}",
"function setSender( $newSender )\r\n {\r\n $this->From = $newSender;\r\n }",
"public function getFromName()\n {\n return $this->from_name;\n }",
"function SetSender($from)\n{\nif (strlen($from) > 20) {\n$this->debug(\"Error: sender id too long.\\n\");\nreturn;\n}\n$this->_source_address = $from;\n}",
"public function setFromUser($fromUser) {\r\n\t$this->fromUser = $fromUser;\r\n }",
"public function set_sender_name($name){\n\n\t\t$this->senderName = $name;\n\n }",
"public function setFirstname($value);",
"private function AddMailFromNameField()\n {\n $name = 'MailFromName';\n $field = Input::Text($name, $this->settings->GetMailFromName());\n $this->AddField($field);\n }",
"public function setGivenName($value)\n {\n $this->givenName = $value;\n }",
"public function setFromUser($fromUser) {\n $this->fromString = null;\n $this->fromUser = $fromUser;\n }",
"function setSwimmerFirstName($txt)\r\n {\r\n $this->_firstname = $txt ;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a LocalSettings.php for the whole wiki farm and return it. Doesn't contain any extensions yet | public static function createLocalSettings() {
global $mwtTemplatePath, $mwtLocalSettingsTemplate, $mwtServer;
// Get template
$localSettings = @file_get_contents( $mwtTemplatePath . '/' . $mwtLocalSettingsTemplate );
if ( $localSettings === false ) {
throw new Exception( "Couldn't read LocalSettings.php template: " . $mwtTemplatePath . '/' . $mwtLocalSettingsTemplate );
}
// Append database name switch... get rid of leading <?php as that can cause trouble
$localSettings = substr( $localSettings, strpos( $localSettings, "\n" ) + 1 );
$localSettings = "<?php\n" . self::getDatabaseSwitch() . $localSettings;
return self::settingTemplateVarSubstitution( $localSettings );
} | [
"public static function initLocalSettings() {\n $GLOBALS[\"wgSitename\"] = \"Unit Test Stub Wiki\";\n $GLOBALS[\"wgMetaNamespace\"] = \"Unit_Test_Stub_Wiki\";\n $GLOBALS[\"wgDBprefix\"] = \"mwtq_\";\n $GLOBALS[\"wgShellLocale\"] = \"en_US.utf8\";\n $GLOBALS[\"wgLanguageCode\"] = \"en\";\n $GLOBALS[\"wgContLang\"] = LongCiteWikiLanguageStub::stubNew(\"en\");\n $GLOBALS[\"wgExternalLinkTarget\"] = '_blank';\n $GLOBALS[\"wgRawHtml\"] = true;\n $GLOBALS[\"wgShowDebug\"] = true;\n }",
"function CreateDefaultSettings() {\n\t$dset = array();\n\n\t$dset['version'] = FB_SETTINGS_VER;\n\t$dset['e_gzip'] = 1;\n\t$dset['farm_server'] = 0;\n\t$dset['bot_speed'] = 8;\n\t$dset['not_plugin'] = '';\n\t$dset['lonlyanimals'] = 1;\n\t$dset['acceptneighborhelp'] = 1;\n\tSaveSettings($dset);\n\n\treturn $dset;\n}",
"public static function Create() {\n\t\t$s = new WP_United_Settings();\n\t\tif(!$s->load_from_wp()) {\n\t\t\treturn($s->load_from_phpbb());\n\t\t}\n\t\treturn $s;\n\t}",
"public function generateSettingsFile()\n {\n /**\n * @var [] $allData array\n * @var string $fileName settings file name\n */\n $allData = [];\n\n //needed for installer app's CSS generation.\n try {\n /**\n * Get data and push to $allData array\n */\n $db = $this->getService('db');\n $query = $db->table('module_simplesetting')\n ->leftJoin('structure_elements', 'module_simplesetting.id', '=', 'structure_elements.id')\n ->leftJoin('module_language', 'module_simplesetting.id', '=', 'module_language.id')\n ->select('structureName', 'value');\n\n if ($querySettings = $query->get()) {\n foreach ($querySettings as $setting) {\n $allData[$setting['structureName']] = $setting['value'];\n }\n $this->settingsList = $allData;\n }\n $this->getService('PathsManager')->ensureDirectory($this->cachePath);\n\n /**\n * Create cache files with settings data\n */\n $filePath = $this->cachePath . $this->fileName;\n $text = $this->generateSettingsText($allData);\n file_put_contents($filePath, $text);\n } catch (Exception $exception) {\n\n }\n }",
"protected static function getDbSettings() { return \"DAL/db_localsettings.php\"; }",
"function wikiembed_settings()\n{\n\t$wikiembed_options['tabs'] = 1;\n\t$wikiembed_options['accordions'] = 1;\n\t$wikiembed_options['style'] = 1;\n\t$wikiembed_options['tabs-style'] = 0;\n\t$wikiembed_options['wiki-update'] = \"30\";\n\t\n\t$wikiembed_options['wiki-links'] = \"default\";\n\t$wikiembed_options['wiki-links-new-page-email'] = '';\n\t$wikiembed_options['default']['source'] = 1;\n\t$wikiembed_options['default']['pre-source'] = \"source:\";\n\t\n\t\n\t$wikiembed_options['default']['no-contents'] = 1;\n\t$wikiembed_options['default']['no-edit'] = 1;\n\t$wikiembed_options['default']['no-infobox'] = 0;\n\t$wikiembed_options['default']['tabs'] = 1;\n\t$wikiembed_options['security']['whitelist'] = null;\n\n\n\treturn $wikiembed_options;\n}",
"function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\nif (!defined('PDNSADMIN')) {\n header('HTTP/1.0 403 Forbidden');\n die;\n}\n\n\\$set = array();\n\n\";\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}",
"static function getSettingsFile() {\n return \\Env::get('cx')->getWebsiteConfigPath() . '/settings.php';\n }",
"function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'prefix' => $this->sets['prefix'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\\n\\$set = array();\\n\\nif (!defined('QUICKSILVERFORUMS')) {\\n header('HTTP/1.0 403 Forbidden');\\n die;\\n}\\n\\n\";\n\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}",
"private function _getExtensionSettings()\n\t{\n\t\tif(!class_exists('Nsm_live_look_ext'))\n\t\t\trequire(PATH_THIRD.\"{$this->addon_id}/ext.{$this->addon_id}.php\");\n\t\t$ext = new Nsm_live_look_ext();\n\t\t$settings = $ext->settings;\n\t\treturn $settings;\n\t}",
"function settingsFile() {\n \n // Assign properties to variables\n $company = self::$company;\n $domain = self::$domain;\n $support = self::$support;\n $host = self::$host;\n $name = self::$name;\n $user = self::$user;\n $pass = self::$pass;\n \n \n // Write the settings.json file\n $in\t\t\t= __DIR__.'/settings/settings.json';\n\t $make\t\t= fopen($in, 'w') or die(\"<b>Error creating settings file! Are settings folder permissions 777?</b><br>\");\n\t $inject\t= \"\n\t \n {\n\n \\\"company-name\\\" : \\\"$company\\\",\n \\\"domain-name\\\" : \\\"$domain\\\",\n \\\"support-email\\\" : \\\"$support\\\",\n\n \\\"db-host\\\" : \\\"$host\\\",\n \\\"db-name\\\" : \\\"$name\\\",\n \\\"db-user\\\" : \\\"$user\\\",\n \\\"db-pass\\\" : \\\"$pass\\\"\n \n }\n\t \n \";\n\t\n\t fwrite($make, $inject);\n\t fclose($make);\n\t \n\t return true;\n \n }",
"private function load_local_config(){\n $local = $this->DIR . \"/wp-config-local.php\";\n $secrets = $this->DIR . \"/wp-secrets.php\";\n $this->require( $local, $secrets ); \n }",
"function defaults_settings_content( $SETTINGS, $DB, $PLUGINS, $constants ){\n\n $filecontents = \"<?php \\n\\n\"\n . \"/**\\n\"\n . \" * Settings File, Furasta.Org\\n\"\n . \" * \\n\"\n . \" * Contains settings created by the installer.\\n\"\n . \" * This file is also altered during the running\\n\"\n . \" * system.\\n\"\n . \" * \\n\"\n . \" * @author\\tInstaller\\n\"\n . \" * @version\\t1.0\\n\"\n . \" */\\n\\n\";\n\n\tforeach( $constants as $constant => $value )\n\t\t$filecontents .= \"define( '\" . $constant . \"', '\" . $value . \"' );\\n\"; \n\n\t$filecontents .= \"\\n\" .\n\t\t\t'$PLUGINS' . \" = array( \\n\";\n\n\n\tforeach( $PLUGINS as $plugin => $version )\n\t\t$filecontents .= \"\\t'\" . $plugin . \"' => '\" . $version . \"',\\n\";\n\n\t$filecontents .= \");\\n\\n\" .\n\t\t\t'$SETTINGS' . \" = array( \\n\";\n\n\t/**\n\t * print settings array, two layer deep array\n\t */\n\tforeach( $SETTINGS as $setting => $value ){\n\t\tif( is_array( $value ) ){\n\t\t\t$filecontents .= \"\\t'\" . $setting . \"' => array(\\n\";\n\t\t\tforeach( $value as $s => $v )\n\t\t\t\t$filecontents .= \"\\t\\t\" . $s . \"' => '\" . $v . \"',\\n\";\n\t\t\t$filecontents .= \"\\t),\\n\";\n\t\t\tcontinue;\n\t\t}\n\t\t$filecontents .= \"\\t'\" . $setting . \"' => '\" . addslashes( $value ) . \"',\\n\";\n\t}\n\n\t$filecontents .= \"\\n\\n\" \n . ');' . \"\\n\"\n\t\t\t. '$DB = array(' . \"\\n\"\n\t\t\t. \"\\t'name'\\t=>\\t'\" . $DB[ 'name' ] . \"',\\n\" \n\t\t\t. \"\\t'host'\\t=>\\t'\" . $DB[ 'host' ] . \"',\\n\" \n\t\t\t. \"\\t'user'\\t=>\\t'\" . $DB[ 'user' ] . \"',\\n\" \n\t\t\t. \"\\t'pass'\\t=>\\t'\" . $DB[ 'pass' ] . \"'\\n\" \n\t\t\t. ');' . \"\\n\";\n\n return $filecontents;\n}",
"static public function load_settings() {\n\t\trequire_once FL_BUILDER_DIR . 'includes/global-settings.php';\n\t\trequire_once FL_BUILDER_DIR . 'includes/layout-settings.php';\n\t\trequire_once FL_BUILDER_DIR . 'includes/row-settings.php';\n\t\trequire_once FL_BUILDER_DIR . 'includes/column-settings.php';\n\t\trequire_once FL_BUILDER_DIR . 'includes/module-settings.php';\n\t}",
"function DefineWikis() {\n $conf = $this->getConfig(); // object to get configuration variables from extension.json and LocalSettings.php\n\n if ( $conf->get( 'WikifarmWikiListMode' ) == \"memory\" ){ \n $this->WikiListCreate();\n } else { // == \"file\"\n $this->WikiListRead();\n }\n}",
"private function _loadExtensionSettings(){\n\t\t$this->settings = new DOMDocument('1.0', 'UTF-8');\n\t\tif(!is_file($this->extension_settings_file)){\n\t\t\t$this->settings->appendChild($this->settings->createElement('settings'));\n\t\t} else {\n\t\t\t$this->settings->load($this->extension_settings_file);\n\t\t}\n\t}",
"public function getText() {\n\t\t$this->extensions = [];\n\t\t$this->skins = [];\n\n\t\t$localSettings = parent::getText();\n\n\t\t$localSettings .= \"\n# This is the main settings file for all BlueSpice extensions and settings\n# It will include all files in \\\"\\$IP/settings.d/\\\" directory\nrequire_once \\\"\\$IP/LocalSettings.BlueSpice.php\\\";\n\";\n\n\t\t$localSettings .= \"\\n\";\t\n\t\t$localSettings .= \"\n\\$wgUserMergeProtectedGroups = array();\n\\$wgUserMergeUnmergeable = array();\n\\$wgMFAutodetectMobileView = true;\n\\$wgMFEnableDesktopResources = true;\n\";\n\n\t\treturn $localSettings;\n\t}",
"public function populateSettingsFile()\n {\n $root = $this->getDrupalRootPath();\n\n // Assume Drupal scaffold created the settings.php\n $this->filesystem->chmod($root . '/sites/default/settings.php', 0664);\n\n // If we haven't already written to settings.php.\n if (!(strpos(file_get_contents($root . '/sites/default/settings.php'), 'START SHEPHERD CONFIG') !== false)) {\n // Append Shepherd-specific environment variable settings to settings.php.\n file_put_contents(\n $root.'/sites/default/settings.php',\n $this->generateSettings(),\n FILE_APPEND\n );\n }\n }",
"function include_settings() {\r\n global $webrock;\r\n\r\n // Get Settings\r\n if (file_exists('webrock/webrock.settings.php'))\r\n require_once('webrock/webrock.settings.php');\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update fields, make needed fields with cdata | static public function updateCdataFields($definition)
{
$default_internal_errors = libxml_use_internal_errors(true);
// create dom document instance
$dom_xml = new DOMDocument;
$dom_xml->formatOutput = true;
$dom_xml->loadXML($definition);
$dom_xml_xpath = new DOMXPath($dom_xml);
// make changes
foreach (self::$cdata_fields as $field_name => $path) {
// getting element
$elements = $dom_xml_xpath->query($path);
if ($elements) {
foreach ($elements as $element) {
$value = $element->nodeValue;
$element->nodeValue = '';
$element->appendChild($element->ownerDocument->createCDATASection($value));
}
}
}
libxml_clear_errors();
libxml_use_internal_errors($default_internal_errors);
return $dom_xml->saveXML();
} | [
"public function setCDATA($fields = '') {\n if ($fields = '') {\n $this->desc = '<![CDATA['.$this->desc.']]>';\n $this->name = '<![CDATA['.$this->name.']]>';\n } else {\n if(strstr($fields,',')) {\n $fields = explode(',',$fields);\n foreach($fields as $f) {\n $this->$f = '<![CDATA['.$this->$f.']]>';\n }\n } else {\n $this->$fields = '<![CDATA['.$this->$fields.']]>';\n }\n }\n }",
"protected function addFieldsToData () {\n\t\t$addFields = array_flip(t3lib_div::trimExplode(',', $this->conf['addFieldsToData']));\n\t\t$this->cObj->data = t3lib_div::array_merge_recursive_overrule(\n\t\t\t$this->cObj->data,\n\t\t\t$addFields\n\t\t);\n\t}",
"protected function _modify_category_data_fields()\n\t{\n\t\t// Get all fields\n\n\t\t$cat_fields = ee()->db->get('category_fields');\n\n\t\tforeach ($cat_fields->result_array() as $field)\n\t\t{\n\t\t\t$field_name = 'field_id_'.$field['field_id'];\n\n\t\t\tee()->smartforge->modify_column(\n\t\t\t\t'category_field_data',\n\t\t\t\tarray(\n\t\t\t\t\t$field_name => array(\n\t\t\t\t\t\t'name' \t\t\t=> $field_name,\n\t\t\t\t\t\t'type' \t\t\t=> 'text',\n\t\t\t\t\t\t'null' \t\t\t=> TRUE\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"function srs_data_sync_hlpUpdateSetFieldsByObject($fields, $row, &$updateNode) {\n //$fields = srs_data_sync_sanitizeFields($fields);\n\n foreach($fields as $oracol => $drupalfield) {\n\n $isFiltered = _srs_data_sync_IsFilteredHTML($drupalfield);\n $oracol = trim($oracol, '_');\n $_srsfield = $row->$oracol;\n \n //Drupal title field is set differently than the rest\n if($drupalfield == 'title') {\n $updateNode->title = $_srsfield;\n } \n else {\n\t //Need to set field language value by reference to avoid scalar type offset error\n\t $_temp = &$updateNode->$drupalfield;\n $_temp['und'][0]['value'] = $_srsfield;\n if($isFiltered) $_temp['und'][0]['format'] = 'filtered_html';\n }\n }\n return true;\n}",
"abstract public function fillFields(&$data);",
"protected function prepareData()\n {\n $this->form = new CatSymbolForm();\n ;\n $this->customContent .= $this->form->apply();\n }",
"public function testUpdateExtraFields(): void { }",
"function bug_prepare_edit( $p_bug_data ) {\n\t\t$p_bug_data->category\t\t\t= string_attribute( $p_bug_data->category );\n\t\t$p_bug_data->date_submitted\t\t= string_attribute( $p_bug_data->date_submitted );\n\t\t$p_bug_data->last_updated\t\t= string_attribute( $p_bug_data->last_updated );\n\t\t$p_bug_data->date_deadline\t= string_attribute( $p_bug_data->date_deadline );\n\t\t$p_bug_data->os\t\t\t\t\t= string_attribute( $p_bug_data->os );\n\t\t$p_bug_data->os_build\t\t\t= string_attribute( $p_bug_data->os_build );\n\t\t$p_bug_data->platform\t\t\t= string_attribute( $p_bug_data->platform );\n\t\t$p_bug_data->version\t\t\t= string_attribute( $p_bug_data->version );\n\t\t$p_bug_data->build\t\t\t\t= string_attribute( $p_bug_data->build );\n\t\t$p_bug_data->summary\t\t\t= string_attribute( $p_bug_data->summary );\n\n\t\t$p_bug_data->description\t\t= string_textarea( $p_bug_data->description );\n\t\t$p_bug_data->steps_to_reproduce\t= string_textarea( $p_bug_data->steps_to_reproduce );\n\t\t$p_bug_data->additional_information\t= string_textarea( $p_bug_data->additional_information );\n\n\t\treturn $p_bug_data;\n\t}",
"public function item_custom_fields_to_db($record) {\n // 1. special management for fields equipped with \"free\" checkbox\n // nothing to do: they don't exist in this plugin\n\n // 2. special management for composite fields\n if ($record->pattern == SURVEYPROFIELD_CHARACTER_CUSTOMPATTERN) {\n $record->pattern = $record->pattern_text;\n\n $record->minlength = strlen($record->pattern_text);\n $record->maxlength = $record->minlength;\n }\n\n // 3. special management for defaultvalue\n // nothing to do: defaultvalue doesn't need any further care\n }",
"public function testUpdateAisleCustomFields()\n {\n }",
"function bug_prepare_edit( $p_bug_data ) {\r\n\t\t$p_bug_data->category\t\t\t= string_attribute( $p_bug_data->category );\r\n\t\t$p_bug_data->date_submitted\t\t= string_attribute( $p_bug_data->date_submitted );\r\n\t\t$p_bug_data->last_updated\t\t= string_attribute( $p_bug_data->last_updated );\r\n\t\t$p_bug_data->os\t\t\t\t\t= string_attribute( $p_bug_data->os );\r\n\t\t$p_bug_data->os_build\t\t\t= string_attribute( $p_bug_data->os_build );\r\n\t\t$p_bug_data->platform\t\t\t= string_attribute( $p_bug_data->platform );\r\n\t\t$p_bug_data->version\t\t\t= string_attribute( $p_bug_data->version );\r\n\t\t$p_bug_data->build\t\t\t\t= string_attribute( $p_bug_data->build );\r\n\t\t$p_bug_data->fixed_in_version\t= string_attribute( $p_bug_data->fixed_in_version );\r\n\t\t$p_bug_data->summary\t\t\t= string_attribute( $p_bug_data->summary );\r\n\t\t$p_bug_data->sponsorship_total\t= string_attribute( $p_bug_data->sponsorship_total );\r\n\t\t$p_bug_data->sticky\t\t\t\t= string_attribute( $p_bug_data->sticky );\r\n\r\n\t\t$p_bug_data->description\t\t= string_textarea( $p_bug_data->description );\r\n\t\t$p_bug_data->steps_to_reproduce\t= string_textarea( $p_bug_data->steps_to_reproduce );\r\n\t\t$p_bug_data->additional_information\t= string_textarea( $p_bug_data->additional_information );\r\n\r\n\t\treturn $p_bug_data;\r\n\t}",
"function writeDataField($value) { $this->_datafield = $value; }",
"function field_save($field_info) {\n\t global $database;\n\n\t $old_field_query = $database->database_query(\"SELECT \".$this->type.\"field_id AS field_id, \".$this->type.\"field_\".$this->type.\"cat_id AS field_cat_id, \".$this->type.\"field_dependency AS field_dependency, \".$this->type.\"field_order AS field_order, \".$this->type.\"field_title AS field_title, \".$this->type.\"field_desc AS field_desc, \".$this->type.\"field_error AS field_error, \".$this->type.\"field_options AS field_options, \".$this->type.\"field_special AS field_special FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\t if($database->database_num_rows($old_field_query) != 0) { $old_field_info = $database->database_fetch_assoc($old_field_query); } else { $old_field_info = \"\"; $old_field_info[field_dependency] = 0; }\n\t if($old_field_info[field_dependency] != 0) { $field_info[field_type] = ($field_info[field_type] == 3) ? 3: 1; $field_info[field_cat_id] = $old_field_info[field_cat_id]; }\n\n\t // FIELD TYPE IS TEXT FIELD\n\t if($field_info[field_type] == \"1\") {\n\t $column_type = \"varchar(250)\";\n\t $column_default = \"default ''\";\n\t $field_info[field_html] = str_replace(\">\", \"\", str_replace(\"<\", \"\", str_replace(\" \", \"\", $field_info[field_html])));\n\t $suggestions = explode(\"\\r\\n\", $field_info[field_suggestions]);\n\t for($i=0;$i<count($suggestions);$i++) {\n\t if(trim($suggestions[$i]) != \"\") {\n\t $options[] = Array('value'=>$i, 'label'=>$suggestions[$i], 'dependency'=>'0', 'dependent_label'=>'', 'dependent_id'=>'');\n\t }\n\t }\n\n\t // FIELD TYPE IS TEXTAREA\n\t } elseif($field_info[field_type] == \"2\") {\n\t $column_type = \"text\";\n\t $column_default = \"\";\n\t $field_info[field_html] = str_replace(\">\", \"\", str_replace(\"<\", \"\", str_replace(\" \", \"\", $field_info[field_html])));\n\n\t // FIELD TYPE IS SELECT BOX OR RADIO BUTTONS\n\t } elseif($field_info[field_type] == \"3\" || $field_info[field_type] == \"4\" || $field_info[field_type] == \"6\") {\n\t $field_info[field_html] = \"\";\n\t for($i=0;$i<count($field_info[field_options]);$i++) {\n\t if(trim($field_info[field_options][$i][value]) != \"\" && trim($field_info[field_options][$i][label]) != \"\") {\n\t $set_values[] = $field_info[field_options][$i][value];\n\t $options[] = $field_info[field_options][$i];\n\t if(ereg(\"^[0-9]+$\", $field_info[field_options][$i][value]) === FALSE) { $this->is_error = 146; break; }\n\t } elseif($field_info[field_options][$i][dependent_id] != \"\") {\n\t $dependent_ids[] = $field_info[field_options][$i][dependent_id];\n\t }\n\t }\n \n\t if( !empty($set_values) && $field_info[field_type] == \"6\" ) {\n\t $column_type = \"set('\".implode(\"', '\", $set_values).\"')\";\n\t $column_default = \"\";\n\t } else {\n\t $column_type = \"int(2)\";\n\t $column_default = \"default '-1'\";\n\t }\n\n\t // IF NO OPTIONS HAVE BEEN SPECIFIED\n\t if(count($options) == 0) { $this->is_error = 143; }\n\n\t // FIELD TYPE IS DATE FIELD\n\t } elseif($field_info[field_type] == \"5\") {\n\t $box5_display = \"block\";\n\t $column_type = \"date\";\n\t $column_default = \"default '0000-00-00'\";\n\t $field_info[field_html] = \"\";\n\n\n\t // FIELD TYPE NOT SPECIFIED\n\t } else {\n\t $this->is_error = 85;\n\t }\n\n\t // FIELD TITLE IS EMPTY\n\t if(trim($field_info[field_title]) == \"\" && $old_field_info[field_dependency] == 0) { $this->is_error = 94; }\n\n\t // NO ERROR \n\t if($this->is_error == 0) {\n\n\t // OLD FIELD (SAVE)\n\t if($database->database_num_rows($old_field_query)) { \n\n\t if($old_field_info[field_cat_id] != $field_info[field_cat_id]) {\n\t $field_order_info = $database->database_fetch_assoc($database->database_query(\"SELECT max(\".$this->type.\"field_order) as f_order FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_dependency='0' AND \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]'\"));\n\t $field_info[field_order] = $field_order_info[f_order]+1;\n\t } else {\n\t $field_info[field_order] = $old_field_info[field_order];\n\t }\n\n\t SE_Language::edit($old_field_info[field_title], $field_info[field_title]);\n\t SE_Language::edit($old_field_info[field_desc], $field_info[field_desc]);\n\t SE_Language::edit($old_field_info[field_error], $field_info[field_error]);\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]', \".$this->type.\"field_order='$field_info[field_order]', \".$this->type.\"field_type='$field_info[field_type]', \".$this->type.\"field_style='$field_info[field_style]', \".$this->type.\"field_maxlength='$field_info[field_maxlength]', \".$this->type.\"field_link='$field_info[field_link]', \".$this->type.\"field_required='$field_info[field_required]', \".$this->type.\"field_regex='$field_info[field_regex]', \".$this->type.\"field_html='$field_info[field_html]', \".$this->type.\"field_search='$field_info[field_search]', \".$this->type.\"field_display='$field_info[field_display]', \".$this->type.\"field_special='$field_info[field_special]' WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\t $column_name = $this->type.\"value_\".$field_info[field_id];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values MODIFY $column_name $column_type $column_default\");\n\n\t // ENSURE FIRST DISPLAY NAME GETS CLEARED IF NECESSARY\n\t if($this->type == \"profile\" && $old_field_info[field_special] == 2 && $field_info[field_special] != 2) {\n\t\t$database->database_query(\"UPDATE se_users SET user_fname='' WHERE user_fname<>''\");\n\t // ENSURE LAST DISPLAY NAME GETS CLEARED IF NECESSARY\n\t } elseif($this->type == \"profile\" && $old_field_info[field_special] == 3 && $field_info[field_special] != 3) {\n\t\t$database->database_query(\"UPDATE se_users SET user_lname='' WHERE user_lname<>''\");\n\t }\n\n\t // GET OLD LABEL LANGUAGE VARS\n\t $old_field_options = unserialize($old_field_info[field_options]);\n\t for($o=0;$o<count($old_field_options);$o++) { $old_language_ids[$old_field_options[$o][value]] = $old_field_options[$o][label]; }\n\n\t // EDIT DEPENDENT FIELDS\n\t for($d=0;$d<count($options);$d++) {\n\t if($old_language_ids[$options[$d][value]] != \"\") {\n\t\t $options[$d][label] = SE_Language::edit($old_language_ids[$options[$d][value]], $options[$d][label]);\n\t\t unset($old_language_ids[$options[$d][value]]);\n\t } else {\n\t\t $options[$d][label] = SE_Language::edit(0, $options[$d][label], NULL, LANGUAGE_INDEX_FIELDS);\n\t\t}\n\n\t $dep_field = $database->database_query(\"SELECT \".$this->type.\"field_id AS field_id, \".$this->type.\"field_title AS field_title FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_id='\".$options[$d][dependent_id].\"'\");\n\n\t if($database->database_num_rows($dep_field) == \"1\") {\n\t $dep_field_info = $database->database_fetch_assoc($dep_field);\n\t if($options[$d][dependency] == \"1\") {\n\t SE_Language::edit($dep_field_info[field_title], $options[$d][dependent_label]);\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]' WHERE \".$this->type.\"field_id='$dep_field_info[field_id]'\");\n\t } else {\n\t $database->database_query(\"DELETE FROM se_\".$this->type.\"fields, se_languagevars USING se_\".$this->type.\"fields JOIN se_languagevars ON se_\".$this->type.\"fields.\".$this->type.\"field_title=se_languagevars.languagevar_id WHERE \".$this->type.\"field_id='$dep_field_info[field_id]'\");\n\t $column_name = $this->type.\"value_\".$dep_field_info[field_id];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values DROP COLUMN $column_name\");\n\t }\n\t } else {\n\t if($options[$d][dependency] == \"1\") {\n\t\t $dep_languagevar_id = SE_Language::edit(0, $options[$d][dependent_label], NULL, LANGUAGE_INDEX_FIELDS);\n\t $database->database_query(\"INSERT INTO se_\".$this->type.\"fields (\".$this->type.\"field_\".$this->type.\"cat_id, \".$this->type.\"field_title, \".$this->type.\"field_order, \".$this->type.\"field_type, \".$this->type.\"field_style, \".$this->type.\"field_dependency, \".$this->type.\"field_maxlength, \".$this->type.\"field_link, \".$this->type.\"field_options, \".$this->type.\"field_required, \".$this->type.\"field_regex) VALUES ('$field_info[field_cat_id]', '\".$dep_languagevar_id.\"', '0', '1', '', '$field_info[field_id]', '100', '', '', '0', '')\");\n\t $dep_field_id = $database->database_insert_id();\n\t $options[$d][dependent_id] = $dep_field_id;\n\t $column_name = $this->type.\"value_\".$dep_field_id;\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values ADD $column_name varchar(250) NOT NULL\");\n\t }\n\t }\n\t }\n\n\t // DELETE OLD DEPENDENT FIELDS\n\t for($d=0;$d<count($dependent_ids);$d++) {\n\t $database->database_query(\"DELETE FROM se_\".$this->type.\"fields, se_languagevars USING se_\".$this->type.\"fields JOIN se_languagevars ON se_\".$this->type.\"fields.\".$this->type.\"field_title=se_languagevars.languagevar_id WHERE \".$this->type.\"field_id='$dependent_ids[$d]'\");\n\t $column_name = $this->type.\"value_\".$dependent_ids[$d];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values DROP COLUMN $column_name\");\n\t }\n\n\t // DELETE OLD LANGUAGE VARS\n if( !empty($old_language_ids) && is_array($old_language_ids) )\n $database->database_query(\"DELETE FROM se_languagevars WHERE languagevar_id IN('\".join(\"', '\", $old_language_ids).\"')\");\n\n\t // INSERT OPTIONS\n\t $field_info[field_options] = $options;\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_options='\".serialize($options).\"' WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\n\n\t // NEW FIELD (ADD)\n\t } else {\n\n\t $field_order_info = $database->database_fetch_assoc($database->database_query(\"SELECT max(\".$this->type.\"field_order) as f_order FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_dependency='0' AND \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]'\"));\n\t $field_order = $field_order_info[f_order]+1;\n\t $field_info[field_title_id] = SE_Language::edit(0, $field_info[field_title], NULL, LANGUAGE_INDEX_FIELDS);\n\t $field_info[field_desc_id] = SE_Language::edit(0, $field_info[field_desc], NULL, LANGUAGE_INDEX_FIELDS);\n\t $field_info[field_error_id] = SE_Language::edit(0, $field_info[field_error], NULL, LANGUAGE_INDEX_FIELDS);\n\t $database->database_query(\"INSERT INTO se_\".$this->type.\"fields (\".$this->type.\"field_\".$this->type.\"cat_id, \".$this->type.\"field_title, \".$this->type.\"field_desc, \".$this->type.\"field_error, \".$this->type.\"field_order, \".$this->type.\"field_type, \".$this->type.\"field_style, \".$this->type.\"field_dependency, \".$this->type.\"field_maxlength, \".$this->type.\"field_link, \".$this->type.\"field_required, \".$this->type.\"field_regex, \".$this->type.\"field_html, \".$this->type.\"field_search, \".$this->type.\"field_display, \".$this->type.\"field_special) VALUES ('$field_info[field_cat_id]', '$field_info[field_title_id]', '$field_info[field_desc_id]', '$field_info[field_error_id]', '$field_order', '$field_info[field_type]', '$field_info[field_style]', '0', '$field_info[field_maxlength]', '$field_info[field_link]', '$field_info[field_required]', '$field_info[field_regex]', '$field_info[field_html]', '$field_info[field_search]', '$field_info[field_display]', '$field_info[field_special]')\");\n\t $field_info[field_id] = $database->database_insert_id();\n\t $column_name = $this->type.\"value_\".$field_info[field_id];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values ADD $column_name $column_type NOT NULL $column_default\");\n\n\t // ADD DEPENDENT FIELDS\n\t $field_options = \"\";\n\t for($d=0;$d<count($options);$d++) {\n\t\t$label_languagevar_id = SE_Language::edit(0, $options[$d][label], NULL, LANGUAGE_INDEX_FIELDS);\n\t\t$options[$d][label] = $label_languagevar_id;\n\t if($options[$d][dependency] == \"1\") {\n\t\t $dep_languagevar_id = SE_Language::edit(0, $options[$d][dependent_label], NULL, LANGUAGE_INDEX_FIELDS);\n\t $database->database_query(\"INSERT INTO se_\".$this->type.\"fields (\".$this->type.\"field_\".$this->type.\"cat_id, \".$this->type.\"field_title, \".$this->type.\"field_order, \".$this->type.\"field_type, \".$this->type.\"field_style, \".$this->type.\"field_dependency, \".$this->type.\"field_maxlength, \".$this->type.\"field_link, \".$this->type.\"field_options, \".$this->type.\"field_required, \".$this->type.\"field_regex) VALUES ('$field_info[field_cat_id]', '\".$dep_languagevar_id.\"', '$d', '1', '', '$field_info[field_id]', '100', '', '', '0', '')\");\n\t $dep_field_id = $database->database_insert_id();\n\t $options[$d][dependent_id] = $dep_field_id;\n\t $column_name = $this->type.\"value_\".$dep_field_id;\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values ADD $column_name varchar(250) NOT NULL\");\n\t }\n\t }\n\n\t // INSERT OPTIONS\n\t $field_info[field_options] = $options;\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_options='\".serialize($options).\"' WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\n\t }\n\t }\n\n\t return $field_info;\n\n\t}",
"public function item_custom_fields_to_db($record) {\n // 1. special management for fields equipped with \"free\" checkbox\n // nothing to do: they don't exist in this plugin\n\n // 2. special management for composite fields\n $fieldlist = $this->item_composite_fields();\n foreach ($fieldlist as $field) {\n if (isset($record->{$field.'_year'}) && isset($record->{$field.'_month'}) && isset($record->{$field.'_day'}) &&\n isset($record->{$field.'_hour'}) && isset($record->{$field.'_minute'})) {\n $record->{$field} = $this->item_datetime_to_unix_time($record->{$field.'_year'}, $record->{$field.'_month'},\n $record->{$field.'_day'}, $record->{$field.'_hour'}, $record->{$field.'_minute'});\n unset($record->{$field.'_year'});\n unset($record->{$field.'_month'});\n unset($record->{$field.'_day'});\n unset($record->{$field.'_hour'});\n unset($record->{$field.'_minute'});\n } else {\n $record->{$field} = null;\n }\n }\n\n // 3. special management for defaultvalue\n // nothing to do: defaultvalue doesn't need any further care\n }",
"public function updateExtraData()\n {\n // Prepare extra data value.\n $extraData = (!$this->extra_data) ? \"NULL\" : $this->db->quote($this->extra_data);\n\n $query = $this->db->getQuery(true);\n\n $query\n ->update($this->db->quoteName(\"#__crowdf_transactions\"))\n ->set($this->db->quoteName(\"extra_data\") . \" = \" . $extraData)\n ->where($this->db->quoteName(\"id\") . \" = \" . (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n }",
"private function clean_data()\n {\n $this->clean = array();\n foreach($this->fields as $name => &$field)\n $this->clean[$name] = $field->get_value();\n }",
"function createUpdateFields()\n\t{\n\t $insertValues = \"\";\n\t $update_functions = \"\";\n\t $table = Doctrine_Core::getTable($this->tableName)->getColumns();\n\t \n\t foreach ($table as $fielname => $info)\n\t {\n\t if (strtolower($fielname) != 'id' && strtolower($fielname) != 'created_at' && strtolower($fielname) != 'updated_at')\n\t {\n\t $insertValues .= \"if (isset($\".$this->moduleNameVar.\"['\".$fielname.\"'])) {\n\t $\".$this->moduleNameVar.\"_rs->\".$fielname.\" = \\$this->update\".$this->moduleName.ucfirst($fielname).\"($\".$this->moduleNameVar.\"['\".$fielname.\"']);\n\t }\n\t \";\n\t $update_functions .= \"\n protected function update\".ucfirst($this->moduleNameVar).ucfirst($fielname).\"($\".$fielname.\" = '') {\n return $\".$fielname.\";\n }\";\n\t }\n\t }\n\t \n\t $this->update_functions = $update_functions;\n\t $this->updateFromRequestFields = $insertValues;\n\t}",
"private function updateFields()\n {\n\t\tif(\\Cart2Quote\\License\\Model\\License::getInstance()->isValid()) {\n\t\t\t$this->_eventManager->dispatch(\n 'quotation_controller_before_update_quote',\n [\n 'quote' => $this->quoteSession->getQuote(),\n 'action' => $this\n ]\n );\n $payload = json_decode($this->getRequest()->getContent());\n $this->quoteSession->addGuestFieldData(json_decode(\n $payload->{\\Cart2Quote\\Quotation\\Model\\Session::QUOTATION_GUEST_FIELD_DATA},\n true\n ));\n $this->quoteSession->addConfigData(json_decode(\n $payload->{\\Cart2Quote\\Quotation\\Model\\Session::QUOTATION_STORE_CONFIG_DATA},\n true\n ));\n $this->quoteSession->addFieldData(json_decode(\n $payload->{\\Cart2Quote\\Quotation\\Model\\Session::QUOTATION_FIELD_DATA},\n true\n ));\n $this->quoteSession->addProductData(json_decode(\n $payload->{\\Cart2Quote\\Quotation\\Model\\Session::QUOTATION_PRODUCT_DATA},\n true\n ));\n $this->_eventManager->dispatch(\n 'quotation_controller_after_update_quote',\n [\n 'quote' => $this->quoteSession->getQuote(),\n 'action' => $this\n ]\n );\n\t\t}\n\t}",
"private function prepareContactFields($fields){\n if(isset($fields['section'])){\n $fields['Section'] = $fields['section'];\n }\n return $fields;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing _insert for newer versions with orderdate set | public function test__insert_NewVersion_OrderDateSet()
{
$oMockConfig = $this->getMock('oxConfig', array('getShopId'));
$oMockConfig->expects($this->any())->method('getShopId')->will($this->returnValue('oxbaseshop'));
$oTestObject = $this->getMock('fcPayOneOrder', array('_fcGetCurrentVersion', '_setNumber', '_getCounterIdent'));
$oTestObject->expects($this->any())->method('_fcGetCurrentVersion')->will($this->returnValue(4800));
$oTestObject->expects($this->any())->method('_setNumber')->will($this->returnValue(true));
$oTestObject->expects($this->any())->method('_getCounterIdent')->will($this->returnValue('someCounterIdent'));
$oTestObject->oxorder__oxordernr = new oxField('');
$oTestObject->oxorder__oxorderdate = new oxField('2016-05-09');
$oMockUtilsDate = $this->getMock('oxUtilsDate', array('getTime', 'formatDBDate'));
$oMockUtilsDate->expects($this->any())->method('getTime')->will($this->returnValue(time()));
$oMockUtilsDate->expects($this->any())->method('formatDBDate')->will($this->returnValue('someFormattedTime'));
$oMockCounter = $this->getMock('oxCounter', array('update'));
$oMockCounter->expects($this->any())->method('update')->will($this->returnValue(true));
$oHelper = $this->getMockBuilder('fcpohelper')->disableOriginalConstructor()->getMock();
$oHelper->expects($this->any())->method('fcpoGetUtilsDate')->will($this->returnValue($oMockUtilsDate));
$oHelper->expects($this->any())->method('getFactoryObject')->will($this->returnValue($oMockCounter));
$oHelper->expects($this->any())->method('fcpoGetConfig')->will($this->returnValue($oMockConfig));
$this->invokeSetAttribute($oTestObject, '_oFcpoHelper', $oHelper);
$blResponse = $blExpect = $this->invokeMethod($oTestObject, '_insert');
$this->assertEquals($blExpect, $blResponse);
} | [
"public function insertOrder($data){\n // Add created and modified date if not included\n if(!array_key_exists(\"created\", $data)){\n $data['created'] = date(\"Y-m-d H:i:s\");\n }\n if(!array_key_exists(\"modified\", $data)){\n $data['modified'] = date(\"Y-m-d H:i:s\");\n }\n \n // Insert order data\n $insert = $this->db->insert($this->ordTable, $data);\n\n // Return the status\n return $insert?$this->db->insert_id():false;\n }",
"public function test__insert_NewVersion_OrderNrSet() \n {\n $oMockConfig = $this->getMock('oxConfig', array('getShopId'));\n $oMockConfig->expects($this->any())->method('getShopId')->will($this->returnValue('oxbaseshop'));\n\n $oTestObject = $this->getMock('fcPayOneOrder', array('_fcGetCurrentVersion', '_setNumber', '_getCounterIdent'));\n $oTestObject->expects($this->any())->method('_fcGetCurrentVersion')->will($this->returnValue(4800));\n $oTestObject->expects($this->any())->method('_setNumber')->will($this->returnValue(true));\n $oTestObject->expects($this->any())->method('_getCounterIdent')->will($this->returnValue('someCounterIdent'));\n $oTestObject->oxorder__oxordernr = new oxField('1234');\n\n $oMockUtilsDate = $this->getMock('oxUtilsDate', array('getTime', 'formatDBDate'));\n $oMockUtilsDate->expects($this->any())->method('getTime')->will($this->returnValue(time()));\n $oMockUtilsDate->expects($this->any())->method('formatDBDate')->will($this->returnValue('someFormattedTime'));\n\n $oMockCounter = $this->getMock('oxCounter', array('update'));\n $oMockCounter->expects($this->any())->method('update')->will($this->returnValue(true));\n\n $oHelper = $this->getMockBuilder('fcpohelper')->disableOriginalConstructor()->getMock();\n $oHelper->expects($this->any())->method('fcpoGetUtilsDate')->will($this->returnValue($oMockUtilsDate));\n $oHelper->expects($this->any())->method('getFactoryObject')->will($this->returnValue($oMockCounter));\n $oHelper->expects($this->any())->method('fcpoGetConfig')->will($this->returnValue($oMockConfig));\n $this->invokeSetAttribute($oTestObject, '_oFcpoHelper', $oHelper);\n\n $blResponse = $blExpect = $this->invokeMethod($oTestObject, '_insert');\n\n $this->assertEquals($blExpect, $blResponse);\n }",
"public function test_order_dates()\n {\n $this->seed(ClassicModelsSeeder::class);\n\n $order = \\DB::table('orders')->where('id', 10367)->first();\n $this->assertEquals(205, $order->customer_id);\n $this->assertEquals(326, \\DB::table('orders')->count());\n $this->assertEquals((new Carbon('January 12 2005')), new Carbon($order->order_date));\n $this->assertEquals((new Carbon('January 21 2005')), new Carbon($order->required_date));\n $this->assertEquals((new Carbon('January 16 2005')), new Carbon($order->shipped_date));\n }",
"function add_new_order($orderStartDate, $customerID){\n\tglobal $db;\n $query = \"INSERT INTO orders\n (orderStartDate, customerID)\n VALUES\n ('$orderStartDate', '$customerID')\";\n $db->exec($query);\n}",
"public function testV1UpdateOrder()\n {\n\n }",
"function update_sales_order_version($order)\n{\n foreach ($order as $so_num => $so_ver) {\n $sql= 'UPDATE '.TB_PREF.'sales_orders SET version=version+1 WHERE order_no='. db_escape($so_num).\n\t' AND version='.$so_ver . \" AND trans_type=30\";\n db_query($sql, 'Concurrent editing conflict while sales order update');\n }\n}",
"public function testInsertWithUpdateBefore()\n {\n try\n {\n self::$builder->table('books')\n ->fields(\n [\n 'title',\n 'genre',\n ]\n )\n ->values(['John', 'Whisper'])\n ->where(['title', '=', 'Another story'])\n ->groupBy(['title', 'genre', 'pages'])\n ->having(['pages', '>', '600'])\n ->andHaving(['title', 'LIKE', '%1'])\n ->orderBy(['title', 'ASC'])\n ->update()\n ->insert()\n ->run();\n } catch (QueryBuilderException $exception)\n {\n return;\n }\n\n $this->fail(\n 'An expected exception has not been raised.'\n );\n }",
"function insertVersion() {\n\t\t$model = &$this->getDefaultModel();\n\t\tif (!$model) return false;\n\t\t$pk = $model->primaryKey();\n\t\tif (!isset($model->$pk) || empty($model->$pk)) return false;\n\t\t$version_model = &$this->loadModel('cms_nterchange_versions');\n\t\tif (!$version_model) {\n\t\t\t// raise error: no versioning model available\n\t\t\treturn false;\n\t\t}\n\t\tif (!$this->_versionDiff($model)) {\n\t\t\t$this->debug('Version not changed for ' . $model->tableName() . ': ' . $model->$pk, 'VERSION');\n\t\t\treturn false;\n\t\t}\n\t\t$this->debug($model->tableName() . ' ' . $model->$pk, 'VERSION insert');\n\t\t// load the current info from the db (this happens before the update)\n\t\t$old_model = &NModel::factory($this->name);\n\t\t$old_model->get($model->$pk);\n\t\t// convert to client time to auto-convert back to server on update\n\t\t$this->convertDateTimesToClient($old_model);\n\t\t// insert the current info into the version\n\t\t$version_model->asset = $this->name;\n\t\t$version_model->asset_id = $old_model->$pk;\n\t\t$version_model->version = serialize($old_model->toArray());\n\t\t$version_model->cms_created = $old_model->cms_created;\n\t\t$version_model->cms_modified = $old_model->cms_modified;\n\t\t$version_model->cms_modified_by_user = isset($this->_auth) && is_object($this->_auth)?$this->_auth->currentUserID():0;\n\t\t$ret = $version_model->insert();\n\t\tunset($version_model);\n\t\tunset($old_model);\n\t\treturn $ret;\n\t}",
"protected function preInsert() {}",
"function before_insert()\r\n\t{\r\n\t\t$this->reviewed_at = date(SQL_DATETIME_FORMAT);\r\n\t}",
"public function testInsert_dateNotEntered()\n {\n $oTestNews = oxNew('oxnews');\n $oTestNews->UNITinsert();\n\n $oNews = oxNew('oxnews');\n if (!$oNews->load($oTestNews->getId())) {\n $this->fail('insert failed');\n }\n\n $this->assertEquals(date(\"d.m.Y\"), $oNews->oxnews__oxdate->value);\n }",
"public function shouldCreateNewVersion();",
"abstract protected function _insert();",
"protected function _syncModDate() {}",
"public function setOrderDate($orderDate);",
"public function testAdapterInsert()\n {\n $row = array (\n 'bug_description' => 'New bug',\n 'bug_status' => 'NEW',\n 'created_on' => '2007-04-02',\n 'updated_on' => '2007-04-02',\n 'reported_by' => 'micky',\n 'assigned_to' => 'goofy',\n 'verified_by' => 'dduck'\n );\n $rowsAffected = $this->_db->insert('zfbugs', $row);\n $this->assertEquals(1, $rowsAffected);\n $lastInsertId = $this->_db->lastInsertId();\n $this->assertEquals('5', (string) $lastInsertId,\n 'Expected new id to be 5');\n }",
"function wcfmmp_new_order_check($order, $updated_props) {\n if (!$order || !is_a($order, 'WC_Order'))\n return;\n if (defined('WCFM_MANUAL_ORDER'))\n return;\n if (defined('WC_BOOKINGS_VERSION'))\n return;\n if (defined('WC_APPOINTMENTS_VERSION'))\n return;\n $order_id = $order->get_id();\n if ($order_id) {\n if (get_post_meta($order_id, '_wcfmmp_order_processed', true))\n return;\n $order_posted = get_post($order_id);\n $this->wcfmmp_checkout_order_processed($order_id, $order_posted, $order);\n }\n }",
"function fn_order_status_history_change_order_status($status_to, $status_from, $order_info, $force_notification, $order_statuses, $place_order) {\n\n db_query(\"INSERT INTO ?:order_status_history values (\". $order_info['order_id'] . \",\". Tygh::$app['session']['auth']['user_id'] . \", '\".$status_to.\"' , '\".$status_from.\"', \" . time() .\")\");\n\n return true;\n}",
"public static function oldOrders(): void\n {\n OldOrderDataUpdate :: execute();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the feedback "updated" event. | public function updated(Feedback $feedback)
{
//
} | [
"public function updated()\n {\n // do something after update\n }",
"public function doEditFeedback()\n {\n }",
"function update_feedback_status() {\n\t\t$fid = $this->input->post('fbid');\n\t\t$fstt = $this->input->post('fbstatus');\n\t\t$data[\"updated\"] = $this->sadmin_model->updateFeedbackStatus($fid, $fstt);\n\t\t$data[\"feedback\"] = $this->sadmin_model->getFeedBack();\n\t\t$this->load->view(\"sadmin/feedback_software_processed\", $data);\n\t}",
"public function on_update() {}",
"public function _get_update_callback()\n {\n }",
"public function _get_update_callback()\n {\n }",
"public function afterUpdate()\n {\n $mailer = new SupportMailer();\n $email = $this->creator->email;\n $address = Settings::get('address');\n $vars = [\n 'ticket_number' => $this->hash_id,\n 'ticket_link' => $address.'/'.$this->hash_id,\n 'ticket_status' => $this->status->name,\n ];\n\n if ($this->status == 'Closed' || $this->status == 'Resolved') {\n $mailer->sendAfterTicketClosed($email, $vars);\n } else {\n if ($this->is_support == 1) {\n $mailer->sendAfterTicketUpdated($email, $vars);\n }\n }\n }",
"public function after_update() {}",
"public static function updated_notice() {\n\t\t?>\n\t\t<div id=\"message\" class=\"updated uci-message wc-connect\">\n\t\t\t<p><?php _e( 'Ultimate CSV Importer PRO data update complete. Thank you for updating to the latest version!', 'wp_ultimate_csv_importer_pro' ); ?></p>\n\t\t</div>\n\t\t<?php\n\t}",
"protected function onUpdateAjax() {}",
"public function update($record)\n\t{\n\t\treturn $this->open('feedback--update').\n\t\t\t\t\t $this->text($msg).\n\t\t\t\t\t $this->close();\n\t}",
"public function updating()\n {\n }",
"public function runOnUpdateEvent() {\r\n $this->modx->invokeEvent('OnContextUpdate',array(\r\n 'context' => &$this->context,\r\n 'properties' => $this->getProperties(),\r\n ));\r\n }",
"public function onUpdate(UpdateTrackerInterface $update);",
"protected function postUpdate() {}",
"public function update() {\n\n\t\t$feed = $this->fetch_feed();\n\t\t$option = $this->get_option();\n\n\t\tupdate_option(\n\t\t\t'wpforms_notifications',\n\t\t\t[\n\t\t\t\t'update' => time(),\n\t\t\t\t'feed' => $feed,\n\t\t\t\t'events' => $option['events'],\n\t\t\t\t'dismissed' => $option['dismissed'],\n\t\t\t]\n\t\t);\n\t}",
"public function notifyAboutNewFeedback()\n {\n $newFeedbacks = $this->newFeedbacks();\n if ($newFeedbacks->count() == 0) {\n return;\n }\n $this->notify(new OverdueFeedback($newFeedbacks));\n $this->markAllFeedbacksAsNotified($newFeedbacks);\n }",
"public function testUpdateNotification()\n {\n }",
"public function alm_filters_updated(){\n\t \tif( isset( $_GET[\"filter_updated\"] ) ) {\n\t\t \t$this->alm_filters_add_admin_notice('<i class=\"fa fa-check-square\" style=\"color: #46b450\";></i> '.__('Filter successfully updated.', 'ajax-load-more-filters'), 'success');\n\t\t }\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tests saveCredentials() and getUseridFromUsername() and getCredentials gives output via getCredentials | function test_credentials()
{
self::makeHtmlLogTitleStartCheck(__METHOD__);
$htmlIsCorrect = test::htmlIsCorrect();
$htmlIsFalse = test::htmlIsFalse();
$username = 'schf';
$id = '1231233123123';
$pubKey = 'TEST-24533456453-4g5h5345h-54h45h-45-6456-TEST';
$userid = _plugin_utility::getUseridFromUsername($username);
echo 'Check: saveCredentials: $username = '.$username.' and $id = '.$id.' and $pubKey = '.$pubKey.' <br />';
_plugin_utility::saveCredentials($username, $id, $pubKey);
$rs = _plugin_utility::getCredentials($userid, $id, $pubKey);
//INSERT INTO PUBLICKEYS (USERID,KEYVALUE) VALUES ('2', '23452345-346745856-673434');
echo 'Result via getCredentials:<br />';
var_dump($rs[0]);
$checkCredentialFound = $rs[0] ? $htmlIsCorrect : $htmlIsFalse ;
echo '<br />only the first result is shown... but result is '.$checkCredentialFound;
echo '<br />';
_plugin_utility::deleteCredentials($userid, $id, $pubKey);
$rs = _plugin_utility::getCredentials($userid, $id, $pubKey);
if($rs){
echo 'Still got some credentials after deleteCredentials , this is: '.$htmlIsFalse.'<br />';
}else{
echo 'Nothing found after deleteCredentials , this is: '.$htmlIsCorrect.'<br />';
}
test::htmlLineBreak();
} | [
"public function testCreateUserCredentialsTotp()\n {\n }",
"public function testCheckCredentials(){\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $result = $db->checkCredentials(\"owner@gmail.com\",\"owner\");\r\n $this->assertEquals(\"owner@gmail.com\",$result[\"emailId\"]);\r\n }",
"public function getCredentials();",
"function get_credentials()\n\t{\n\t\treturn \"{$this->username}:{$this->password}\";\n\t}",
"public function testUserCredentialsApi3()\n {\n }",
"public function testCheckCredentials()\n {\n $userData = new \\stdClass();\n $userData->name = \"johnsnow@gmail.com\";\n $userData->password = \"yT3u6\";\n\n $usersRepository = $this->em->getRepository(Users::class);\n $user = $usersRepository->checkCredentials(\n static::$kernel->getContainer()->get('security.password_encoder'),\n $userData\n );\n\n $this->assertArrayHasKey('idUser', $user);\n $this->assertArrayHasKey('userName', $user);\n }",
"public function testUserCredentialsOidc()\n {\n }",
"public function testGetAccountCredentials() {\n $api = new BugHerd_Api('email@address.com', 'password');\n $credentials = $api->getAccountCredentials();\n $this->assertEquals($credentials, array('email' => 'email@address.com', 'password' => 'password'));\n }",
"public function getCredentials ()\n\t{\n\t\t$this->loginMethod->getCredentials ();\n\t\t$this->updateCredentials ();\n\t}",
"public function testValidateCredentials()\n {\n $actual = $this->_adapter->validateCredentials(array(\n 'handle' => 'pmjones',\n 'passwd' => 'jones',\n ));\n \n Solar::dump($actual);\n \n $this->assertSame($actual, $this->_expect);\n }",
"function setCredentials($user, $pass);",
"public function testGetCredentials()\n {\n $jsonString = json_encode(['email' => 'glaserpower@gmail.com', 'password' => 'password']);\n $request = Request::create('/login_check', 'POST', [], [], [], [], $jsonString);\n\n $model = $this->guard->getCredentials($request);\n\n Assert::assertInstanceOf(CredentialEmailModel::class, $model);\n Assert::assertEquals('glaserpower@gmail.com', $model->getEmail());\n Assert::assertEquals('password', $model->getPassword());\n\n }",
"public function testCreateCredential()\n {\n }",
"public function testCommunicatorCredentials()\n {\n $communicatorCredentials = new CommunicatorCredentials('homer.simpson', 'donuts');\n\n $this->dataService->setCommunicatorCredentials($communicatorCredentials);\n\n $this->assertSame($communicatorCredentials, $this->dataService->getCommunicatorCredentials());\n }",
"public function testUserCredentialsEmbed()\n {\n }",
"public function updateCredentials() {\n foreach (['version', 'user', 'tpa_id', 'expires', 'action', 'flags', 'userdata', 'signature'] as $argumentName) {\n $getArguments[$argumentName] = GeneralUtility::_GP($argumentName);\n }\n\n if (!empty($getArguments['user'])\n && !empty($getArguments['signature'])\n && !empty($getArguments['expires'])\n && !empty($getArguments['version'])\n && !empty($getArguments['tpa_id'])\n && !empty($getArguments['action'])\n && !empty($getArguments['flags'])\n && !empty($getArguments['userdata'])) {\n\n $this->credentials['username'] = $getArguments['user'];\n $this->credentials['signature'] = TypeHandlingUtility::hex2bin($getArguments['signature']);\n $this->credentials['expires'] = $getArguments['expires'];\n $this->credentials['version'] = $getArguments['version'];\n $this->credentials['tpaId'] = $getArguments['tpa_id'];\n $this->credentials['action'] = $getArguments['action'];\n $this->credentials['flags'] = $getArguments['flags'];\n $this->credentials['userdata'] = $getArguments['userdata'];\n $this->valid = true;\n }\n }",
"public function testCheckCredentialsReturnsTrue()\n {\n Assert::assertTrue($this->guard->checkCredentials(new CredentialTokenModel('token'), new User()));\n }",
"public function testCheckCreds()\n {\n $api = new STASHAPI($this->apiid, $this->apipw, $this->baseUrl, false);\n\n $src = array(\"fileKey\" => $api->encryptString($this->accountPw . \"BADPW\", \"\", true), \"accountUsername\" => $this->accountUsername);\n $retCode = 0;\n $errMsg = \"\";\n $res = $api->checkCreds($src, $retCode, $errMsg);\n $errMsg = print_r($res, true) . PHP_EOL . \" Username: \" . $this->accountUsername . \" Password: \" . $this->accountPw;\n $this->assertTrue(isset($res['code']), $errMsg);\n $this->assertEquals(\"401\", $res['code'], $errMsg);\n $this->assertEquals(401, $retCode, $errMsg);\n $this->assertTrue(isset($res['message']), $errMsg);\n $this->assertEquals(\"Unauthorized\", $res['message'], $errMsg);\n\n $src = array(\"fileKey\" => $api->encryptString($this->accountPw, \"\", true), \"accountUsername\" => $this->accountUsername);\n $retCode = 0;\n $errMsg = \"\";\n $res = $api->checkCreds($src, $retCode, $errMsg);\n $errMsg = print_r($res, true) . PHP_EOL . \" Username: \" . $this->accountUsername . \" Password: \" . $this->accountPw;\n $this->assertTrue(isset($res['code']), $errMsg);\n $this->assertEquals(\"200\", $res['code'], $errMsg);\n $this->assertEquals(200, $retCode, $errMsg);\n $this->assertTrue(isset($res['message']), $errMsg);\n $this->assertEquals(\"OK\", $res['message'], $errMsg);\n }",
"public function testValidGetCredentials()\n {\n $request = Request::create('/api/login_check', 'POST', [],[],[],[], json_encode(['password' => 'asdfasdf', 'email' => 'blue@gmailcom']));\n $request->attributes->set('_route', 'api_login');\n\n $creds = $this->apiLoginGuard->getCredentials($request);\n\n Assert::assertEquals('asdfasdf', $creds['password']);\n Assert::assertEquals('blue@gmailcom', $creds['email']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HideMyWP::partial_filter() Filter partial HTML | function partial_filter($content){
if ($this->top_replace_old)
$content = str_replace($this->top_replace_old, $this->top_replace_new, $content);
if ($this->partial_replace_old)
$content = str_replace($this->partial_replace_old, $this->partial_replace_new, $content);
if ($this->partial_preg_replace_old)
$content = preg_replace($this->partial_preg_replace_old, $this->partial_preg_replace_new, $content);
return $content;
} | [
"function acf_allow_unfiltered_html() { }",
"function acf_allow_unfiltered_html()\n{\n}",
"function acf_allow_unfiltered_html() {\n\n\t// Check capability.\n\t$allow_unfiltered_html = current_user_can( 'unfiltered_html' );\n\n\t/**\n\t * Filters whether the current user is allowed to save unfiltered HTML.\n\t *\n\t * @date 9/1/19\n\t * @since 5.7.10\n\t *\n\t * @param bool allow_unfiltered_html The result.\n\t */\n\treturn apply_filters( 'acf/allow_unfiltered_html', $allow_unfiltered_html );\n}",
"function acf_allow_unfiltered_html() {\n\t\n\t// Check capability.\n\t$allow_unfiltered_html = current_user_can('unfiltered_html');\n\t\n\t/**\n\t * Filters whether the current user is allowed to save unfiltered HTML.\n\t *\n\t * @date\t9/1/19\n\t * @since\t5.7.10\n\t *\n\t * @param\tbool allow_unfiltered_html The result.\n\t */\n\treturn apply_filters( 'acf/allow_unfiltered_html', $allow_unfiltered_html );\n}",
"private function filter_content() {\n\t\tadd_filter( 'neve_top_bar_content', 'wptexturize' );\n\t\tadd_filter( 'neve_top_bar_content', 'convert_smilies' );\n\t\tadd_filter( 'neve_top_bar_content', 'convert_chars' );\n\t\tadd_filter( 'neve_top_bar_content', 'wpautop' );\n\t\tadd_filter( 'neve_top_bar_content', 'shortcode_unautop' );\n\t\tadd_filter( 'neve_top_bar_content', 'do_shortcode' );\n\t}",
"function BH_awpf_after_filter_content() {\r\n\r\n\techo '</div>';\r\n\r\n}",
"public function remove_content_filter() {\n\t\t// @todo also check if this page supports blocks.\n\t\tif ( is_page() ) {\n\t\t\tremove_filter( 'the_content', 'wpautop', 10 );\n\t\t\tadd_filter( 'the_content', array( $this, 'spineautop' ), 10 );\n\t\t}\n\t}",
"function wpv_show_hide_content_filter($sections) {\n\t$sections['content-filter'] = array(\n\t\t'name'\t\t=> __('Filter the results', 'wpv-views'),\n\t\t);\n\treturn $sections;\n}",
"function BH_shop_products_filter() {\r\n\r\n\tget_template_part( 'views/sidebar/sidebar-shop', 'products-filter' );\r\n\r\n}",
"public function addFilters ()\n\t\t{\n\t\t\tadd_action('wp_footer', array(&$this, 'printScript'));\n\t\t\tadd_filter('the_content', array(&$this, 'removeChars'));\n\t\t}",
"function MY_BEFORE_the_content ($content)\r\n{\r\nreturn $content . '<br /><b>My Before filter was here</b>';\r\n}",
"function filter_strip_all_tags() {\n return [\n 'filter' => FILTER_CALLBACK,\n 'options' => '\\wp_strip_all_tags',\n ];\n}",
"public function filter($content){ }",
"function BH_awpf_before_filter_content() {\r\n\r\n\techo '<div class=\"awpf-filters-toggle visible-xs\"><h3><span class=\"inactive\">' . __( 'Show product filters', 'BH' ) . '</span><span class=\"active\">' . __( 'Hide product filters', 'BH' ) . '</span></h3></div>';\r\n\techo '<div class=\"awpf-filters-wrapper\">';\r\n\r\n}",
"function filter_block_content($text, $allowed_html = 'post', $allowed_protocols = array())\n {\n }",
"private function filter(): void {\n $trigger = Trigger::current();\n $trigger->filter($this, \"filter_page\");\n\n $this->title_unfiltered = $this->title;\n $this->body_unfiltered = $this->body;\n\n $trigger->filter($this->title, array(\"markup_page_title\", \"markup_title\"), $this);\n $trigger->filter($this->body, array(\"markup_page_text\", \"markup_text\"), $this);\n }",
"private function filter(): void {\n $trigger = Trigger::current();\n $trigger->filter($this, \"filter_comment\");\n\n $this->body_unfiltered = $this->body;\n $trigger->filter($this->body, array(\"markup_comment_text\", \"markup_text\"));\n\n $config = Config::current();\n\n $group = (!empty($this->user_id) and !$this->user->no_results) ?\n $this->user->group :\n new Group($config->guest_group) ;\n\n if (\n $this->status != \"pingback\" and\n !$group->can(\"code_in_comments\")\n ) {\n $allowed = $config->module_comments[\"allowed_comment_html\"];\n $this->body = strip_tags(\n $this->body,\n \"<\".implode(\"><\", $allowed).\">\"\n );\n }\n\n $this->body = sanitize_html($this->body);\n }",
"public function filter($content) {}",
"protected function getFilterHtml()\n {\n ob_start();\n ?>\n <div class=\"qfb-filter qfb-box\">\n <div class=\"qfb-filter-inner qfb-cf\">\n <div class=\"qfb-filter-actions\">\n <span class=\"qfb-filter-action-remove\" title=\"<?php esc_attr_e('Remove', 'quform'); ?>\"><i class=\"fa fa-trash\"></i></span>\n <span class=\"qfb-filter-action-settings\" title=\"<?php esc_attr_e('Settings', 'quform'); ?>\"><i class=\"mdi mdi-settings\"></i></span>\n </div>\n <div class=\"qfb-filter-title\"></div>\n </div>\n </div>\n <?php\n return ob_get_clean();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use this method to get a list of profile pictures for a user. | public function getUserProfilePhotos($user_id, $offset = null, $limit = null)
{
$params = compact('user_id', 'offset', 'limit');
return $this->sendRequest('getUserProfilePhotos', $params);
} | [
"public function getUserPictures()\n {\n return $this->hasMany(UserPictures::className(), ['profile_id' => 'id']);\n }",
"public function getProfilePicture();",
"public function get_fb_my_images()\n {\n $token = User::where('id', Auth::user()->id)->first()->fb_user_token;\n $this->helper = $this->fb->getRedirectLoginHelper();\n if (isset($_GET['state'])) {\n $this->helper->getPersistentDataHandler()->set('state', $_GET['state']);\n }\n try {\n $profile_request = $this->fb->get('/me/photos/uploaded/?fields=link,picture&limit=500', $token);\n $profile = $profile_request->getGraphEdge()->asArray();\n return $profile;\n } catch (\\Facebook\\Exceptions\\FacebookResponseException $e) {\n // When Graph returns an error\n echo 'Graph returned an error: ' . $e->getMessage();\n session_destroy();\n // redirecting user back to app login page\n exit;\n } catch (\\Facebook\\Exceptions\\FacebookSDKException $e) {\n // When validation fails or other local issues\n echo 'Facebook SDK returned an error: ' . $e->getMessage();\n exit;\n }\n }",
"public function getPhotosPerUser()\n\t{\n\t\t$dao = $this->dao->getDAO(\"Image\");\n\t\treturn $dao->findByUserId($_SESSION['oUserProfile']->getId());\n\t}",
"public function getUserProfilePhotos( $userId , $offset = null , $limit = null ) {\n\n return DataTransformer::transform( $this->post( 'getUserProfilePhotos' , [\n 'user_id' => $userId,\n 'offset' => $offset,\n 'limit' => $limit\n ])->getResult() , UserProfilePhotos::class );\n\n }",
"public function list_all_user_photos()\n {\n $user = $this->createUserWithFoto();\n add_photo_to_user($user, base_path(self::AVATAR2_PATH));\n add_photo_to_user($user, base_path(self::AVATAR3_PATH));\n add_photo_to_user($user, base_path(self::AVATAR4_PATH));\n $this->signIn($user, 'api');\n $response = $this->json('GET', '/api/v1/user/' . $user->id . '/photos');\n $response->assertSuccessful();\n $response->assertJsonStructure([\n [\n 'id', 'storage','origin','path','person_id','created_at','updated_at'\n ],\n ]);\n }",
"public function getUserProfilePicture(){\r\n $this->initDb();\r\n $un = \"\";\r\n $ui = $this->getUserId();\r\n require_once($_SERVER['DOCUMENT_ROOT'] . \"/biznavi/application/user/class/user.class.php\");\r\n $user = new user($ui);\r\n return $user->getProfilePicture();\r\n }",
"public static function loadUserPics($userId)\n {\n $pictures = Db::getInstance()->getMany(\n \"SELECT * FROM `picture` WHERE `user_id` = \" . (int)$userId . \" ORDER BY `created_at` DESC\"\n );\n\n if (!$pictures) {\n return [];\n }\n\n $set = [];\n\n foreach ($pictures as $picture) {\n $set[] = new Picture($picture);\n }\n\n return $set;\n }",
"public function getUserProfilePhotos(GetUserProfilePhotosRequest $request): UserProfilePhotos\n {\n return UserProfilePhotos::fromPayload($this->call($request)->getPayload());\n }",
"public function get_images_user()\n {\n $this->db\n ->select('user_image')\n ->from('user');\n\n $query = $this->db->get();\n return $query->result_array();\n\n }",
"public function getProfilePhoto()\r\n\t{ \r\n\t\t$username = $this->user['username'];\r\n\t\t$get_prof_pic_query = mysqli_query($this->db, \"SELECT prof_pic FROM users WHERE username='$username';\");\r\n\t\t$row = mysqli_fetch_array($get_prof_pic_query);\r\n\t\treturn $row['prof_pic']; \r\n\t}",
"public function profilePics() {\n return $this->hasMany(UserProfilePic::class);\n }",
"public function getProfilePic() {\r\n $username = $this->user['username'];\r\n $stmt = $this->con->prepare(\"SELECT profile_pic FROM users WHERE username= ?\"); //Gets profile pic of that username\r\n $stmt->bind_param(\"s\", $username);\r\n $stmt->execute();\r\n $query = $stmt->get_result();\r\n\r\n $row = mysqli_fetch_array($query); //Stores profilepic in variable row\r\n return $row['profile_pic']; //returns profile pic\r\n }",
"public function getProfileCoverPhotos($userId) {\n\t\t$type = self::TYPE_PROFILE_COVER;\n\t\treturn $this->_getCoverPhotosOfType($userId, $type);\n\t}",
"public function profile_pictures()\n {\n return $this->morphMany( 'MyFamily\\Photo', 'imageable' );\n }",
"function fetch_profile_pic($iUserId, $sType, $sSize='small') {\n\n\t\t$aOutput['output'] = array('error'=>'', 'page'=>'', 'data'=>array());\n\t\t\n\t\tif (array_key_exists($sType, $this->aProfilePicUploadType)) {\n\t\t\t\n\t\t\tif($sPic = hasSetProfilePic($iUserId, $sType)) {\n\t\t\t\t$aOutput['output']['page'] = getImage('profile_pic', $sPic, $sSize);\n\t\t\t\t$aOutput['output']['data']['upload_type'] = 'url';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$aOutput['output'] = json_encode($aOutput['output']);\n\t\t$this->load->view('output', $aOutput);\n\t}",
"function handle_get_user_images($user)\n{\n\t$pics_table = TABLE_PICS;\n\n\t$db = connect_database();\n\n\t// FIXME: First, check that user exists!\n\n\t$res = $db->prepare(\"SELECT * FROM $pics_table WHERE owner=:user\");\n\t$input = array('user' => $user);\n\t$res->execute($input);\n\t\n\tif(!($res))\n\t{\n\t\theader('HTTP/1.1 500 Internal Server Error');\n\t\tdie(\"Database error\");\n\t}\n\n\tif($res->rowCount() == 0)\n\t{\n\t\theader('HTTP/1.1 404 Not Found');\n\t\tdie('User does not own any images');\n\t}\n\n\t$users = array();\n\tforeach($res as $row)\n\t{\n\t\tarray_push($users, $row['id']);\n\t}\n\techo json_encode($users);\n}",
"public function findAllUsersProfileAvatar()\r\n {\r\n $q = $this->createQueryBuilder('u')\r\n ->select('u, p, a')\r\n ->join('u.profile', 'p')\r\n ->join('u.avatar', 'a')\r\n ->getQuery();\r\n\r\n return $q->getResult();\r\n }",
"public function peopleGetPublicPhotos($user_id)\r\n\t\t{\r\n\t\t\treturn $this->people_service->getPublicPhotos($user_id);\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Include a view (as long as it exists) | function site_include_view( $path, $variables = array() ) {
$path = site_view_path( $path );
if ( file_exists( $path ) ) {
// if variables are set then make them usable
if ( ! empty( $variables ) ) {
extract( $variables );
}
// include file
include( $path );
}
} | [
"public static function includeView($view = null) {\n if (!empty($view) && file_exists($view)) {\n // load view from fully qualified path\n include $view;\n\n // success\n return true;\n }\n elseif (!empty($view)) {\n // determine path from view name\n $view = Config::get('framework', 'viewPath') . $view . '.php';\n\n if (file_exists($view)) {\n // load view from name\n include $view;\n\n // success\n return true;\n }\n else {\n // something has gone awry\n include Config::get('framework', 'viewPath') . '404.php';\n error_log('specified view not found: ' . $view);\n }\n }\n else {\n // using the current view\n $view = Config::get('framework', 'viewPath') . static::$VIEW . '.php';\n\n if (file_exists($view)) {\n // load current view\n include $view;\n\n // success\n return true;\n }\n else {\n // something has gone awry\n header(\"HTTP/1.0 404 Not Found\");\n include Config::get('framework', 'viewPath') . '404.php';\n error_log('current view not found: ' . $view);\n }\n }\n\n // failure\n return false;\n }",
"function include_view($view, $args = [])\n{\n if (!empty($args)) {\n extract($args);\n }\n\n include view_path().$view.'.php';\n}",
"public function includeAllViews()\n {\n $this->includeView($this->listViews());\n }",
"function includeView($name, $data = null)\n {\n if (is_array($data)) {\n extract($data);\n }\n include($_SERVER[\"DOCUMENT_ROOT\"] . \"/views/$name.php\");\n }",
"abstract public function addView(AbstractView $view);",
"public function RenderOnlyView($view)\n\t{\n\t\textract($this->_data);\n\t\t\n\t\trequire_once $view;\n\t}",
"abstract function additionalComposition(View $view);",
"function enable_view() {\r\n\t\t$this->use_view = true;\r\n\t}",
"protected function loadView()\n {\n }",
"public function addBasicView()\n {\n require_once 'view/header.php';\n require_once 'view/banner.php';\n require_once 'view/navbar.php';\n }",
"function dxw_get_view($view_name = '', $args = array())\n{\n\n // vars\n $path = dxw_get_path(\"views/{$view_name}.php\");\n\n if (file_exists($path)) {\n include $path;\n }\n}",
"private function includeViewDirectory() : void\n {\n if (!file_exists($this->viewDirectory) && defined('WP_DEBUG') && WP_DEBUG) {\n echo '<p class=\"uk-text-danger uk-text-bold uk-text-center\">File: ' . $this->viewDirectory . ' not found!</p>';\n return;\n }\n include $this->viewDirectory;\n }",
"protected function loadView()\n{\n}",
"private function _load_view()\n\t{\n\t\t$dir = $this->request->directory();\n\n\t\t$dir = empty($dir) ? NULL : $dir.DIRECTORY_SEPARATOR;\n\t\t$view_path = $dir.$this->request->controller().DIRECTORY_SEPARATOR.$this->request->action();\n\t\t$view_path = strtolower($view_path);\n\n\t\t$this->content = Kohana::find_file('views', $view_path)\n\t\t\t? View::factory($view_path) : NULL;\n\t}",
"function loadView($file, $params = array()) {\n \n if(!empty($params)) {\n extract($params);\n } \n \n include realpath(dirname(__FILE__)).'/../view/'.$file.'.php';\n}",
"function _get_view($view, $data = null) {\n $file = DD . \"/app/view/\" . $view . \".php\";\n if(file_exists($file)) {\n ob_start();\n if($data != null) {\n extract($data);\n }\n require $file;\n ob_end_flush();\n } else {\n trigger_error(_lang_get(\"settings.view_not_found\"), E_USER_ERROR);\n }\n}",
"public function includeView($file, $data){\n $path = $this->defaultViewPath.$file.'.php';\n $content = '';\n if(file_exists($path)){\n ob_start();\n extract($data);\n include_once($path);\n $content = ob_get_clean();\n }\n return $content;\n }",
"abstract protected function installViews(): void;",
"public function loadViews()\n {\n include VRAGEN_PLUGIN_INCLUDES_VIEWS_DIR . '/view_shortcodes.php';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the asset is included. | public function isIncluded()
{
return ! $this->excluded;
} | [
"public function hasAssets();",
"public function hasAssets()\n {\n return realpath($this->path.'/assets/') !== false;\n }",
"public function checkInclude()\n {\n return ($this->checkIncludePages() || $this->checkIncludePaths());\n }",
"public function hasIncludetags()\n {\n return $this->includetags !== null;\n }",
"public function isImported(): bool\n {\n return $this->importedAsset !== null;\n }",
"public function hasRequestedIncludes(): bool;",
"public function isAsset()\n {\n return $this['kind'] === 'ASSET';\n }",
"public function isUrlToAsset() {\n $url = $this->relativeUrl();\n return preg_match('/^static\\//i', $url);\n }",
"public function hasIncludeContext()\n {\n return isset($this->include_context);\n }",
"public function hasIncludes()\n\t{\n\t\tif ($this->document->hasIncludes() == true) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$source = $this->fileSystem->readTemplateFile($this->templateName);\n\n\t\tif (Template::getCache()->exists(md5($source)) && $this->hash === md5($source)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function has_file_been_included( string $file_name ) : bool\n{\n // Fetch all included files\n $included_files = get_included_files();\n\n // Check if the requested file has been included\n foreach($included_files as $included_file)\n {\n // If the file has been included, return 1\n if(basename($included_file) === $file_name)\n return 1;\n }\n\n // If the file has not been included, return 0\n return 0;\n}",
"public function getAssetIsFor()\n {\n return $this->asset_is_for;\n }",
"function isIncludedMain() {\r\n $main = realpath($this->mainpage);\r\n foreach( get_included_files() as $filename) {\r\n if ( $main == realpath($filename)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public static function is_sharethis_included() {\r\n\t\treturn GA_SHARETHIS_SCRIPTS_INCLUDED;\r\n\t}",
"public function hasRequestedIncludes(): bool\n {\n return (bool) count($this->requestedIncludes);\n }",
"public function isFilteringIncludedResources() : bool\n {\n return (null === $this->filteringIncluded) ? true : $this->filteringIncluded;\n }",
"private function _asset_is_defined($name = '', $version = 'default')\n\t{\n\t\tif(array_key_exists($name, $this->_assets))\n\t\t{\n\t\t\t$asset = $this->_assets[$name];\n\n\t\t\tif($asset['type'] != 'group')\n\t\t\t{\n\t\t\t\tif(array_key_exists($version, $asset['versions'])) return TRUE;\n\n\t\t\t\t// Asset itself is defined, but we don't have the necessary version!\n\t\t\t\tlog_message('debug', 'Sprinkle: [WARNING] asset \\''. $name .'\\' (version: '. $version .') not defined');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// It's a group and it's defined\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// If we got here, it means the asset is not defined. Bummer!\n\t\tlog_message('debug', 'Sprinkle: [WARNING] asset \\''. $name .'\\' (version: '. $version .') not defined');\n\t\treturn FALSE;\n\t}",
"function is_global_required_asset(string $asset, string $type)\n{\n return index_global_required_asset($asset, $type) !== null;\n}",
"public function assetRegistered($asset){\n\t\treturn array_key_exists($asset,$this->assets);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests enforce() when the default resource isolation policy is enabled and respected. | public function testEnforceResourcePolicyEnabledRespected() {
$_SERVER = array(
self::SITE => Isolation_Policy::SITE_CROSS_SITE,
self::MODE => Isolation_Policy::MODE_NAVIGATE,
self::DEST => Isolation_Policy::DEST_DOCUMENT,
'REQUEST_METHOD' => 'GET',
'REQUEST_URI' => '/',
);
$resource = new Default_Resource_Isolation_Policy( 'default-resource', 'Default Resource Isolation Policy' );
$setting = $this->createMock( Policies_Setting::class );
$setting
->method( 'get' )
->willReturn(
array(
$resource->slug => array( Isolation_Policy::STATUS_ENABLED ),
)
);
$policy_registry = new Policy_Registry();
$policies = new Policies( $policy_registry );
$enforcer = new Enforce_Policies( $policies, $setting );
$policy_registry->register( $resource );
try {
$enforcer->enforce();
$error = '';
} catch ( \Exception $e ) {
$error = $e->getMessage();
}
$this->assertSame( '', $error );
} | [
"public function testEnforceResourcePolicyEnabledViolated() {\n\t\t\t$_SERVER = array(\n\t\t\t\tself::SITE => Isolation_Policy::SITE_CROSS_SITE,\n\t\t\t\tself::MODE => Isolation_Policy::MODE_NAVIGATE,\n\t\t\t\tself::DEST => Isolation_Policy::DEST_DOCUMENT,\n\t\t\t\t'REQUEST_METHOD' => 'POST',\n\t\t\t\t'REQUEST_URI' => '/',\n\t\t\t);\n\n\t\t\t$resource = new Default_Resource_Isolation_Policy( 'default-resource', 'Default Resource Isolation Policy' );\n\n\t\t\t$setting = $this->createMock( Policies_Setting::class );\n\t\t\t$setting\n\t\t\t->method( 'get' )\n\t\t\t->willReturn(\n\t\t\t\tarray(\n\t\t\t\t\t$resource->slug => array( Isolation_Policy::STATUS_ENABLED ),\n\t\t\t\t)\n\t\t\t);\n\t\t$policy_registry = new Policy_Registry();\n\t\t$policies = new Policies( $policy_registry );\n\t\t$enforcer = new Enforce_Policies( $policies, $setting );\n\n\t\t$policy_registry->register( $resource );\n\n\t\ttry {\n\t\t\t$enforcer->enforce();\n\t\t\t$error = '';\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$error = $e->getMessage();\n\t\t}\n\n\t\t$this->assertSame( $resource->title . ' violated.', $error );\n\t}",
"public function testEnforceResourcePolicyReportRespected() {\n\t\t\t$_SERVER = array(\n\t\t\t\tself::SITE => Isolation_Policy::SITE_CROSS_SITE,\n\t\t\t\tself::MODE => Isolation_Policy::MODE_NAVIGATE,\n\t\t\t\tself::DEST => Isolation_Policy::DEST_DOCUMENT,\n\t\t\t\t'REQUEST_METHOD' => 'GET',\n\t\t\t\t'REQUEST_URI' => '/',\n\t\t\t);\n\n\t\t\t$resource = new Default_Resource_Isolation_Policy( 'default-resource', 'Default Resource Isolation Policy' );\n\n\t\t\t$setting = $this->createMock( Policies_Setting::class );\n\t\t\t$setting\n\t\t\t->method( 'get' )\n\t\t\t->willReturn(\n\t\t\t\tarray(\n\t\t\t\t\t$resource->slug => array( Isolation_Policy::STATUS_REPORT ),\n\t\t\t\t)\n\t\t\t);\n\t\t$policy_registry = new Policy_Registry();\n\t\t$policies = new Policies( $policy_registry );\n\t\t$enforcer = new Enforce_Policies( $policies, $setting );\n\n\t\t$policy_registry->register( $resource );\n\n\t\ttry {\n\t\t\t$enforcer->enforce();\n\t\t\t$error = '';\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$error = $e->getMessage();\n\t\t}\n\n\t\t$this->assertSame( '', $error );\n\t}",
"function getDefaultTransactionIsolation();",
"public function testSetTransactionIsolationLevel()\n {\n $transactionIsolationLevelPre = $this->fetchTransactionIsolationLevel();\n\n $expectedLevel = 'READ COMMITTED';\n $this->database->setTransactionIsolationLevel($expectedLevel);\n $transactionIsolationLevel = $this->fetchTransactionIsolationLevel();\n\n $this->assertSame($expectedLevel, $transactionIsolationLevel);\n\n $this->database->setTransactionIsolationLevel($transactionIsolationLevelPre);\n $transactionIsolationLevel = $this->fetchTransactionIsolationLevel();\n\n $this->assertSame($transactionIsolationLevelPre, $transactionIsolationLevel);\n }",
"public function testCreatePreventionPolicies()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"protected function setUp() {\n\t\t$this->navigation = new Default_Navigation_Isolation_Policy( 'default-navigation', 'Default Navigation Isolation Policy' );\n\t\t$this->resource = new Default_Resource_Isolation_Policy( 'default-resource', 'Default Resource Isolation Policy' );\n\t}",
"public function testSetTransactionIsolationLevel()\n {\n $sLevel = 'READ COMMITTED';\n\n $oDbLib = $this->getMock(\"dbLib\", array(\"execute\"));\n $oDbLib->expects($this->once())->method('execute')->with($this->equalTo('SET SESSION TRANSACTION ISOLATION LEVEL ' . $sLevel));\n\n $oLegacyDb = $this->getMock(\"oxLegacyDb\", array(\"getDb\"));\n $oLegacyDb->expects($this->once())->method('getDb')->with($this->equalTo(false))->will($this->returnValue($oDbLib));\n\n $oLegacyDb->setTransactionIsolationLevel($sLevel);\n }",
"public function testPolicyAccessors() {\n\n\t\t$autoLoader = new ClassAutoloader();\n\t\t$autoLoader->setPolicy(ClassAutoloader::POLICY_EXCEPTION);\n\t\t$autoLoader->setPolicy(ClassAutoloader::POLICY_SILENT);\n\n\t\t$this->assertSame(ClassAutoloader::POLICY_SILENT, $autoLoader->getPolicy());\n\t}",
"public function testQueryCombinedPreventionPolicies()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testUpdatePreventionPolicies()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function testGuaranteeWithoutSchema() {\n\n\t}",
"public function testCheckIntegrityWhenNotYetComputed () {\n $this->assertFalse($this->undoStore->checkIntegrity());\n }",
"private function checkPolicy()\n {\n if (!Gate::getPolicyFor($this->repo)) {\n Gate::policy(get_class($this->repo), $this->getPolicy());\n }\n\n return;\n }",
"public function getTransactionIsolation();",
"function getTransactionIsolation();",
"public function testReadClusterPolicy()\n {\n\n }",
"public function test_accept_policies() {\n global $DB;\n $this->resetAfterTest();\n $this->setAdminUser();\n\n $policy1 = helper::add_policy()->to_record();\n api::make_current($policy1->id);\n $policy2 = helper::add_policy()->to_record();\n api::make_current($policy2->id);\n $policy3 = helper::add_policy(['optional' => true])->to_record();\n api::make_current($policy3->id);\n\n // Accept policy on behalf of somebody else.\n $user1 = $this->getDataGenerator()->create_user();\n $this->assertEquals(0, $DB->get_field('user', 'policyagreed', ['id' => $user1->id]));\n\n // Accepting just compulsory policies is not enough, we want to hear explicitly about the optional one, too.\n api::accept_policies([$policy1->id, $policy2->id], $user1->id);\n $this->assertEquals(0, $DB->get_field('user', 'policyagreed', ['id' => $user1->id]));\n\n // Optional policy does not need to be accepted, but it must be answered explicitly.\n api::decline_policies([$policy3->id], $user1->id);\n $this->assertEquals(1, $DB->get_field('user', 'policyagreed', ['id' => $user1->id]));\n\n // Revoke previous agreement to a compulsory policy.\n api::revoke_acceptance($policy1->id, $user1->id);\n $this->assertEquals(0, $DB->get_field('user', 'policyagreed', ['id' => $user1->id]));\n\n // Accept policies for oneself.\n $user2 = $this->getDataGenerator()->create_user();\n $this->setUser($user2);\n\n $this->assertEquals(0, $DB->get_field('user', 'policyagreed', ['id' => $user2->id]));\n\n api::accept_policies([$policy1->id]);\n $this->assertEquals(0, $DB->get_field('user', 'policyagreed', ['id' => $user2->id]));\n\n api::accept_policies([$policy2->id]);\n $this->assertEquals(0, $DB->get_field('user', 'policyagreed', ['id' => $user2->id]));\n\n api::decline_policies([$policy3->id]);\n $this->assertEquals(1, $DB->get_field('user', 'policyagreed', ['id' => $user2->id]));\n\n api::accept_policies([$policy3->id]);\n $this->assertEquals(1, $DB->get_field('user', 'policyagreed', ['id' => $user2->id]));\n }",
"public function testMinimumRequirements()\n {\n $transaction = new Transaction();\n $transaction->setRegisteredAt(new DateTime());\n $transaction->setOrderNumber('T123');\n $this->em->persist($transaction);\n $this->em->flush();\n\n $this->assertGreaterThan(0, $transaction->getId());\n }",
"public function ensureTransaction(): void;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Item entities. | public function indexAction()
{
$em = $this->getDoctrine()->getEntityManager();
$entities = $em->getRepository('TouqInventoryBundle:Item')->findAll();
return $this->render('TouqInventoryBundle:Item:index.html.twig', array(
'entities' => $entities
));
} | [
"public function getAllItems()\n {\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function list () {\n return Item::orderBy('name', 'asc')->get();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $orderItems = $em->getRepository('AppBundle:OrderItem')->findAll();\n\n return $this->render('orderitem/index.html.twig', array(\n 'orderItems' => $orderItems,\n ));\n }",
"public function getItems(){\r\n\t\t// Build the query\r\n\t\t$query = 'select * from item';\r\n\t\t\r\n\t\t// Execute and return the results\r\n\t\t$query = $this->DB->prepare($query);\r\n\t\t$query->execute();\r\n\t\treturn $query->fetchAll(PDO::FETCH_ASSOC);\r\n\t}",
"public function listItems();",
"public function action_findAll() {\n // Get all the informations from the repository.\n $repo = new Repository_Inventory();\n $restaurantsInventory = $repo->getAll();\n \n // Transfert the information to the view.\n $view = View::factory('inventory/restaurantsInventory')\n ->set('restaurantsInventory', $restaurantsInventory);\n \n $this->template->title = __('Inventories');\n $this->template->content = $view;\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SoftlogoShopBundle:BasketItem')->findAll();\n\n return $this->render('SoftlogoShopBundle:BasketItem:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public static function getAllItems(){\n\t\t$sql = \"\n\t\tSELECT *\n\t\tFROM item\n\t\t\";\n\n\t\t// Make a PDO statement\n\t\t$statement = DB::prepare($sql);\n\n\t\t// Execute\n\t\tDB::execute($statement);\n\n\t\t// Get all the results of the statement into an array\n\t\t$results = $statement->fetchAll();\n\n\t\t// Loop array to get each row\n\t\t$template = '';\n\t\tforeach ($results as $heading => $row) {\n\t\t\t$template .=\n\t\t\t\t\t'<tr>\n\t\t\t\t\t\t<td>' . $row['name'] . '</td>\n\t\t\t\t\t\t<td>' . $row['price'] . '</td>\n\t\t\t\t\t\t<td>' . '<a href=\"edit_item.php?id=' . $row['id'] . '\">Edit</a></td>\n\t\t\t\t\t\t<td>' . '<a href=\"delete_item.php?id=' . $row['id'] . '\">Remove</a></td>\n\t\t\t\t\t</tr>';\n\t\t}\n\treturn $template;\n}",
"public function index() {\n\t\t/*$this->InventoryEntry->recursive = 0;\n\t\t$this->set('inventoryEntries', $this->paginate());*/\t\t\n\t\t\n\t\t$conditionsSubQuery['`InventoryItem`.`inventory_entry_id` <>'] = 0;\n\t\t$dbo = $this->InventoryEntry->getDataSource();\n\t\t$subQuery = $dbo->buildStatement(\n\t\t array(\n\t\t 'fields' => array('`InventoryItem`.`inventory_entry_id`'),\n\t\t 'table' => $dbo->fullTableName(ClassRegistry::init('Inventory.InventoryItem')),\n\t\t 'alias' => 'InventoryItem',\n\t\t 'limit' => null,\n\t\t 'offset' => null,\n\t\t 'joins' => array(),\n\t\t 'conditions' => $conditionsSubQuery,\n\t\t 'order' => null,\n\t\t 'group' => null\n\t\t ),\n\t\t $this->InventoryEntry\n\t\t);\n\t\t$subQuery = ' `InventoryEntry`.`id` IN (' . $subQuery . ') ';\n\t\t$subQueryExpression = $dbo->expression($subQuery);\t\t\n\t\t$conditions[] = $subQueryExpression;\n\t\t\n\t\t$inventoryEntries = $this->InventoryEntry->find('all', compact('conditions'));\n\t\t$this->set('inventoryEntries', $this->paginate($conditions));\t\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('OGInversaBundle:GalleryItem')->findAll();\n\n return array('entities' => $entities);\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function getEntityList();",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $roles_Items = $em->getRepository('AcmeUserBundle:Roles_Item')->findAll();\n\n return $this->render('roles_item/index.html.twig', array(\n 'roles_Items' => $roles_Items,\n ));\n }",
"public function actionList()\n {\n $searchModel = new HealthItemsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('list', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n abort_unless(Gate::allows('viewAny', InventoryItem::class), Response::HTTP_FORBIDDEN);\n return new InventoryItemCollection(InventoryItem::all());\n }",
"function view_items(){\n\t\t$querry=\"SELECT * FROM items\";\n\t\treturn $this->query($querry);\n\t}",
"public function getAllOrderItems()\n {\n }",
"public function listAction ( )\n {\n $model = $this->getModel($this->_modelName);\n $request = $this->getRequest();\n\n $this->view->items = $model->paginate($request->getParams());\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.