anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
Get all notifications for a given user | public function get_all(int $userid, int $fromid = 0): array {
// TODO currently only retrieves events for the current user context.
global $DB;
$events = $DB->get_records_select(self::TABLENAME,
'contextid = :contextid AND id > :fromid',
['contextid' => \context_user::in... |
Modifies the current Form Component by changing any properties that were passed in $structure. If a component supports special indices in $structure (for example a "fields" property) then that component may specify its own `modify()` method and manually process each of the specially supported keywords. For example, the... | public function modify(array $structure); |
Generated from protobuf field .grafeas.v1.InTotoProvenance provenance = 4; | public function setProvenance($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\InTotoProvenance::class);
$this->writeOneof(4, $var);
return $this;
} |
Create word context from a word | public function getWordContext() {
$word = $this->getRandomWord();
return new WordContext($word);
} |
Get the method type (Upstream Pay method), it can be primary or secondary. | public function getType(): string; |
Retorna o numero de linhas retornadas da consulta | public function getNumRows(){
return $this->instance->getNumRows();
} |
Transform the resource into an array. | public function toArray($request)
{
return [
'id' => $this->id,
'publishDate' => $this->created_at,
'previewImage' => $this->image_url,
'isFavourite' => user()->favoriteObjects->firstWhere('id', $this->id) ? true : false,
'objectType' ... |
match with given field value like password confirmation | public function confirm(string|int|bool $field, string $message): static
{
$field = Sanitization::input($field)->sanitize();
if ($field !== $this->field) $this->message($message);
return $this;
} |
System::getPhpExtensionVersion Gets php extension version. | public function getPhpExtensionVersion($extension)
{
return phpversion($extension);
} |
Generates the database and inserts dummy data. | public function generateDatabase()
{
$this->generateUserTable();
$this->generateEmployerTable();
$this->generateCandidateTable();
$this->generateGuidTable();
$this->generateWorkExperienceTable();
$this->generateShortListTable();
$this->generateQualTypeTable();... |
Display a listing of the resource. | public function index()
{
$restaurants = Hotel::restaurant()->get();
return view('backend/restaurant/index', compact('restaurants'));
} |
By the way, you can still create your own method in here... :) | public function getSync()
{
ini_set('memory_limit', '256M');
// echo "<pre>";
// print_r($this->compare());
// echo "</pre>";
$compare = $this->compare();
if($compare->dataIn){
$insert = collect($compare->dataIn);
... |
notifys an object about an event occured Based on the event happend, each object may decide how it reacts. If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup) | function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
{
global $tree;
switch ($a_event)
{
case "link":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
... |
====================== Query Scopes ====================== | public function scopePath($query, $path)
{
$slugs = collect(explode('/', $path));
$pages = self::whereIn($this->getTable().'.slug', $slugs)->get();
$target_slug = $slugs->pop();
$page = $pages->where('slug', $target_slug)->filter(function ($page) use ($slugs, $pages) {
... |
Specification: Publish price list prices for product abstracts. Uses the given IDs of the `fos_price_product_price_list` table. Merges created or updated prices to the existing ones. | public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void; |
Get the 'render' tokens to use for advanced rendering. This runs through all of the fields and arguments that are available and gets their values. This will then be used in one giant str_replace(). | function get_render_tokens() {
$tokens = array();
if (!empty($this->view->build_info['substitutions'])) {
$tokens = $this->view->build_info['substitutions'];
}
$count = 0;
foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
$token = '%' . ++$count;
... |
This method erases all block which id does not match given pattern | public function keepOnly($pattern){
$this->layout->keepOnly($pattern);
return $this;
} |
$res=mysql_query("select from products ORDER BY product_order") or die(mysql_error()); | public function get_all_productes()
{
$res=mysql_query("select * from products") or die(mysql_error());
return $res;
} |
Logout Logouts from Elvis with the given session id | public function logout(string $token): bool
{
// Call logout REST API
$response = Elvis::query($token, 'logout');
// Return null if login failed, otherwise the session id.
if (isset($response->logoutSuccess) && $response->logoutSuccess === true) {
return true;
} ... |
Store a newly created resource in storage. | public function cancelBrief(Request $request){
// dd($request->all());
if($request->registers_id){
$register = Register::where('id', $request->registers_id)->first();
$register->status = self::CANCEL;
if($register->save()) {
if(!empty($request->descrip... |
Gets the attribute name. | public function getName(): string; |
Test Request GET (orchestra)/users/view/1 | public function testGetSingleUserPage()
{
$this->be($this->user);
$response = $this->call('orchestra::users@view', array(1));
$this->assertInstanceOf('Laravel\Response', $response);
$this->assertEquals(200, $response->foundation->getStatusCode());
$this->assertEquals('orchestra::users.edit', $response->c... |
Media directory name for the temporary file storage pub/media/tmp | protected function getMediaDirTmpDir()
{
return $this->directoryList->getPath(DirectoryList::MEDIA) . DIRECTORY_SEPARATOR . 'tmp';
} |
Devuelve un array de los productos que vencieron. | function devolverProductosVencidos($consulta)
{
$conexion = mysqli_connect("localhost", "root", "", "inventariocasa");
$fecha = date("j-n-Y");
if (!$resultado = mysqli_query($conexion, $consulta)) {
die();
}
$datos = array();
$i = 0;
while ($row = $resu... |
Automatically create datagrid for master file table | private function generateDatagrid(&$simbio, $str_args) {
$_master_tables = $this->global['db_prefix'].$this->dbTable.' AS mst ';
if ($this->dbTable != 'unit_kerja') {
$this->relation['id_unit'] = array('table' => 'unit_kerja',
'display_field' => 'nama_unit', 'pk_field' => 'id_... |
get users for the given filter code | function get_users_by_filter($filterCode,$users_id = '')
{
log_message('debug', '_message/get_users_by_filter');
log_message('debug', '_message/get_users_by_filter:: [1] filterCode='.$filterCode);
switch($filterCode){
case "all_users":
return $this->get_types(array('invited_shopper','random_shopper','clo... |
Determines if the subscribed link has block objects. | public function hasBodyLines()
{
return count($this->getBodyLines()) > 0;
} |
Checks if the PHP Solr extension is available. | public function is_installed() {
return function_exists('solr_get_version');
} |
Hent info om filmen | public function getFilm(): Film
{
return $this->film;
} |
Create token password reset | public function request(RequestPasswordReset $request)
{
$user = User::where('email', $request->validated())->first();
if (!$user) return response()->error('Email tidak ditemukan', StatusCode::UNPROCESSABLE_ENTITY);
$resetPassword = PasswordReset::updateOrCreate(
['email' => $use... |
Decodes a base64 encoded data. | function base64_decode(string $data, bool $strict = false): string
{
error_clear_last();
$result = \base64_decode($data, $strict);
if ($result === false) {
throw UrlException::createFromPhpError();
}
return $result;
} |
Check if field conditionally hidden | function ppom_is_field_hidden_by_condition( $field_name ) {
if( !isset($_POST['ppom']['conditionally_hidden']) ) return false;
$ppom_is_hidden = false;
$ppom_hidden_fields = explode(",", $_POST['ppom']['conditionally_hidden']);
// Remove duplicates
$ppom_hidden_fields = array_unique( $ppom_hidden_fields );
... |
Update the specified resource in storage. | public function update(Request $request, Product $product)
{
$request->validate([
'category_id' => 'required',
'product_name' => 'required|string',
'product_code' => 'required',
]);
if($request->image != $product->image && $request->image != null... |
Show the specified resource. | public function show($id)
{
return view('models::show');
} |
Get a Type instance based on the type of the passed php variable. | public static function getTypeFromPHPVariable($variable)
{
if (is_object($variable)) {
if ($variable instanceof \DateTime) {
return self::getType('date');
} else if ($variable instanceof \MongoId) {
return self::getType('id');
}
} e... |
getPalette method returns a value between 15 depending on which paletter the user wants to plot the chart with. Here, we just read from Session variable and show it In your application, you could read this configuration from your User Configuration Manager, database, or global application settings | function getPalette() {
//Return
return (((!isset($_SESSION['palette'])) || ($_SESSION['palette']=="")) ? "2" : $_SESSION['palette']);
} |
Change Method. More information on this method is available here: | public function change()
{
$table = $this->table('user_groups');
$table->addColumn('user_id', 'integer');
$table->addColumn('group_id', 'integer')
->create();
$table = $this->table('user_groups');
$table->addForeignKey('user_id', 'users', 'id', ['delete'=> 'RES... |
Handle an incoming request. | public function handle($request,Closure $next,$var=null)
{
if ($var=="bb")
{
echo "<br> MyMiddleware";
}
else
{
return $next($request);
}
} |
Output login result in JSON format. | function output_json_results() {
global $result;
print json_encode($result);
die();
} |
This method performs the voting action for a game. | public function vote($id)
{
// Find our game and perform the vote.
$game = $this->findById($id);
// Check if we own this game already.
if (!empty($game) && $game['owned'] == 1) return false;
// Check if we are using the service.
if (XBOXAPP_OFFLINE === true) {
if (empty($game)) return fal... |
Starts a new file stack | public function restore()
{
$this->files = array();
} |
Function to get member record of specific member id | protected function MEMBER_getUserLastMemberId ($es_id, $user_id)
{
if (!$es_id || !$user_id) throw new Exception (self::EXCEPTION_MESSAGE_NO_SESSION);
$query = $this->db->select(
self::MEMBER_TABLE,
'collab_member_id',
array('collab_es_id' => $es_id, 'collab_uid' => $user_id),
__LINE__,
__FILE_... |
Converts a hexidecimal representation of a color (think: XHTML/CSS) into an RGB 3item array. | public function convertHexToRgb($hex)
{
list($r, $g, $b) = array(
$hex[0] . $hex[1],
$hex[2] . $hex[3],
$hex[4] . $hex[5]
);
return array(hexdec($r), hexdec($g), hexdec($b));
} |
/ Cuando tenemos que escribir un archivo ".json" tenemos que ver si hay algo previamente guardado | public function Escribir($filePath, $personaRecibida)
{
// -> primero lo tenemos que leer
try {
if (!(isset($filePath))) {
throw new Exception('No se recibió path al archivo');
echo "entro";
} else if (!(file_exists($filePath))) {
... |
Show the profile page belonging to the current vendor. | public function ShowVendorProfile()
{
$GLOBALS['BreadCrumbs'] = array(
array(
'name' => GetLang('Vendors'),
'link' => VendorLink()
),
array(
'name' => $this->vendor['vendorname'],
)
);
$title = isc_html_escape($this->vendor['vendorname']);
$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(G... |
Find the child hierarchy for the specified parent node. | public function findChildHierarchy($parentId)
{
return $this->getChildHierarchyQueryBuilder($parentId)->getQuery()->getResult();
} |
Check last modification header and terminates presenter if provided date is less or equal | private function handleLastModification($lastModified) {
if(!$this->getHttpContext()->isModified($lastModified)) {
$this->getHttpResponse()->setHeader('Content-length', 0);
$this->terminate();
}
} |
order page (index) (ajax) | public function actionIndex()
{
$model = new OrderForm;
if( Request::isAjaxRequest() ) {
$model->setAttributes( Request::getPosts() );
if( !$model->validate() ) {
\Framework::end( json_encode( [ 'status' => 'error', 'content' => $model->getMessages() ] ) );
}
$product = Product::model()->find... |
Return script link for $href | public function js($href)
{
return sprintf('<script src="%s"></script>', $this->url($href));
} |
To Return Chart Of Account Primary Key | public function getChartOfAccountId()
{
return $this->chartOfAccountId;
} |
config pour le site | public function details_entrepot_site($id)
{
$entrepot = Entrepot::findOrFail($id);
$entrepot_similaire = Entrepot::where('id', '!=', $id)
->where('status', 1)
->take(8)
->get();
$nb_entr = $entrepot_similaire->count();
return view('site.entrepot.... |
Get the services provided by the provider. | public function provides() {
return array();
} |
Returns sql where part and params. | public function get_sql($data, $logreader) {
global $DB;
$wherearray = array();
$where = array();
$params = array();
if ($logreader instanceof \logstore_standard\log\store) {
$db = $DB;
} else if ($logreader instanceof \logstore_database\log\store) {
... |
redirect to Appliacation route:: application/careerID | public function show($id)
{
} |
Return the file URL | abstract public function url($manipulation_name = ''); |
Get the current receiver | private function getTo(): ?array {
return $this->to;
} |
Process event and return result to subscribers. | public function fire(): array; |
Get user social id or null if it is not set | public function getUserId()
{
return $this->getUserAttribute(static::ATTRIBUTE_ID);
} |
Sets the Icontact Prospect Country Name attribute value. | public function setCountryName(string $country_name = null) : CNabuDataObject
{
$this->setValue('nb_icontact_prospect_country_name', $country_name);
return $this;
} |
Display the specified resource. | public function show($id)
{
return \App\FactorImpact::find($id);
} |
Sets the filters relative flag | public function relative($relative) {
if (is_bool($relative)) {
$this->relative = $relative;
}
return $this->relative;
} |
/ For a given Special Offer and an expiration date generate for each Recipient a Voucher Code | public function codeGeneration(Request $request)
{
$offer = new Offer([
'name' => $request->input('offer_name'),
'discount' => $request->input('discount'),
'expiry' => Carbon::createFromFormat('d/m/Y', $request->input('expiry')),
]);
$offer->save();
... |
Sets a callback to handle after the route callback. | public function after(callable $callback): Route
{
$current = $this->getOption('after_middlewares');
$current[] = $callback;
$this->setOption('_after_middlewares', $current);
return $this;
} |
/ This method is used when a user has added a restaurant Dont forget to add a query for type! | public function saveNewRestaurant(Restaurant $res){
$city = strtolower($res->getCity());
if ($city == 'göteborg' || $city == 'goteborg' || $city == 'gÖteborg'){
$city = 'gothenburg';
}
$res->setCity($city);
/*
* This is if we're going to add a search before the insert to check if the rest exists
$que... |
/ Delete all resources. | public function deleteAllResources() {
$this->resources = array();
} |
Base class for controllers | protected function isPostRequest() {
return $_SERVER['REQUEST_METHOD'] == 'POST';
} |
Check if the specified configuration key is defined | public function hasConfig($key); |
Loads the user info, how many favorites and how many replies, etc. the audio has. And adds it to the array. | public static function complete(array $audio) {
$has = function ($key) use ($audio) {
return array_key_exists($key, $audio);
};
if ($has('user_id')) {
$audio['user'] = Users::get($audio['user_id']);
unset($audio['user_id']);
}
if ($has('id'))... |
Return the group that owns this permission | public function group()
{
return $this->belongsTo('Bocapa\Permissions\Models\Group');
} |
Supprime le panier de la session | public function remove()
{
return $this->session->remove('cart');
} |
Get requiredbooleans set higher up in the form structure. | protected function isRequiredFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isRequired($key);
}
return null;
} |
The latest version for in place update. The current appliance can be updated to this version using the API or m4c CLI. Generated from protobuf field .google.cloud.vmmigration.v1.ApplianceVersion in_place_update = 2; | public function setInPlaceUpdate($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ApplianceVersion::class);
$this->in_place_update = $var;
return $this;
} |
Funciones Get y Set de la Clase clQuery | public function getStrPaginaSiguiente()
{
return $this->strPaginaSiguiente;
} |
Run the database seeds. | public function run()
{
$titles = ['Нижние модули', 'Верхние модули'];
foreach ($titles as $title) {
$title = [
'title' => $title,
];
\App\Models\TypeModules::create($title);
}
} |
STI 84189 Retorna as mensalidades vencidas | public function getMensalidadesVencidas($strContratos, $maiorDataRescisao) {
$sql = "
SELECT distinct
CASE
WHEN titnfloid IS NOT NULL THEN
(
SELECT
nflno_numero || '/' || nflserie AS nota
... |
Filter the query on the id_user_created column Example usage: $query>filterByIdUserCreated(1234); // WHERE id_user_created = 1234 $query>filterByIdUserCreated(array(12, 34)); // WHERE id_user_created IN (12, 34) $query>filterByIdUserCreated(array('min' => 12)); // WHERE id_user_created > 12 | public function filterByIdUserCreated($idUserCreated = null, $comparison = null)
{
if (is_array($idUserCreated)) {
$useMinMax = false;
if (isset($idUserCreated['min'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $idUserCreated['min'], Criteria::GR... |
Generate a test message. | protected function getMessage()
{
//return new \Swift_Message('Test subject', 'Test body.');
} |
/ Check the license key | public function getChecks()
{
$result = (version_compare(phpversion(), '5.2.8', '>=')) ? self::CHECK_OK : self::CHECK_ERROR;
$this->addResult('system', 'PHP version', $result, "PHP version 5.2.8 or higher is needed. A latest PHP version is always recommended.");
$current = ini_get('memory_l... |
Remove the specified resource from storage. | public function destroy($id)
{
$document = Document::find($id);
$document->file->delete();
$document->delete();
return response()->json([
'Документ №' . $document->id . ' удален'
]);
} |
lay du lieu form | public function toFormData()
{
$data = $this->toArray();
return $data;
} |
Store a newly created resource in storage. | public function store(Request $request)
{
//
/*$this->validate($request,[
'name' => 'required|max:255'
]);
$category = new Category;
$category->name = $request->name;
$category->save();
Session::flash('success', ' New Category has been created')... |
checks if can use cache | protected function useCache() {
if (isset($_COOKIE['nc']) && $_COOKIE['nc'] == 1) {
return FALSE;
}
if (isset($_GET['nc']) && $_GET['nc'] == 1) {
return FALSE;
}
return TRUE;
} |
Display a listing of the resource. | public function customerDataRequest()
{
return view($this->_config['view']);
} |
Register an updating model event with the dispatcher. | public static function updating($callback, $priority = 0)
{
static::registerModelEvent('updating', $callback, $priority);
} |
Gets the screenshot id's associated with the addon | public function getScreenshots() {
return ScreenshotManager::getScreenshotsFromAddon($this->id);
} |
Formats a Mysql DateTime string in the specified format. | public static function Date($Timestamp = '', $Format = '') {
// Was a mysqldatetime passed?
if (!is_numeric($Timestamp))
$Timestamp = self::ToTimestamp($Timestamp);
if (!$Timestamp)
$Timestamp = time(); // return ' '; Apr 22, 2009 - found a bug where "Draft Saved At X" returned... |
Test case for addVendorComplianceSurvey Create a vendorComplianceSurvey. | public function testAddVendorComplianceSurvey()
{
} |
Test Request GET (orchestra)/users/view/1 without auth | public function testGetSingleUserPageWithoutAuth()
{
$response = $this->call('orchestra::users@view', array(1));
$this->assertInstanceOf('Laravel\Redirect', $response);
$this->assertEquals(302, $response->foundation->getStatusCode());
$this->assertEquals(handles('orchestra::login'),
$response->foundati... |
Get source image url | public function getSrcMediaImage()
{
return $this->_designerHelper->getSrcMediaImage();
} |
Update record activity status. | function update_record_status($id, $status, $table, $key) {
$sql = "UPDATE ".TB_PREF.$table." SET inactive = "
. ((int)$status)." WHERE $key=".db_escape($id);
db_query($sql, "Can't update record status");
} |
/ DELETING TRANSACTION SAVING(TABUNGAN) DELETE SETORAN TUNAI | public function delete_setoran_tunai()
{
$trx_detail_id=$this->input->post('trx_detail_id');
$data_trx_account_saving=$this->model_transaction->get_trx_account_saving_by_trx_detail_id($trx_detail_id);
if(count($data_trx_account_saving)==1){
$data_trx_account_saving=$data_trx_account_saving[0];
$account_sav... |
Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. Allows throttling dispatch of tasks from this queue Generated from protobuf field .google.protobuf.DoubleValue max_tasks_per_second = 1; | public function setMaxTasksPerSecondUnwrapped($var)
{
$this->writeWrapperValue("max_tasks_per_second", $var);
return $this;} |
get the id of selected user to edit | public function deleteAction(){
$id = $this->filterInt($this->_params[0]);
$supplier = SupplierModel::getByPK($id);
if($supplier === FALSE){
$this->redirect('/suppliers');
}
$this->language->load('suppliers.messages');
if($supplier ->delete()){
... |
Begin querying the model on a given datasource. | public static function on($datasource = null)
{
// First we will just create a fresh instance of this model, and then we can
// set the datasource on the model so that it is be used for the queries.
$instance = new static;
$instance->setDatasource($datasource);
return $inst... |
Set icon paths Sets the URLs and file system paths for the social media icons, which can also be customized via filters. | private function setIconPaths()
{
// Directory URL and path
$plugin = CGIT_SOCIALIZE_PLUGIN;
$dir = 'icons';
$url = plugin_dir_url($plugin) . $dir;
$path = plugin_dir_path($plugin) . $dir;
// Apply filters for customization
$ext = apply_filters('cgit_socializ... |
Test to ensure a user receives their own profile data | public function testGetOwnProfile()
{
$url = "http://127.0.0.1/app_test.php/profile/view/bucky-barnes";
$username = 'profileBucky@gmail.com';
$password = 'password';
$response = \Httpful\Request::get($url)->basicAuth($username, $password)->send();
$this->assertEqu... |
Show the form for editing the specified resource. | public function edit(Category $category,$id)
{
$category=Category::get($id);
return view('admin.category.update',compact('category'));
} |
return parent::tableName(); // TODO: Change the autogenerated stub | public static function tableName()
{
return 'category';
} |
Set the value of DOCUMENT_PRODUCT_NCM | public function setDocumentProductNcm(int $document_product_ncm)
{
$this->collection->put('document_product_ncm', (string) $document_product_ncm);
} |
This is the delete. | public function handleGrievanceDelete($id)
{
$Grievance = new Grievance;
$re=$Grievance->deleteGrievance($id);
SentryHelper::setMessage('Grievance Deleted....');
return Redirect::to('grievance/list');
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.