anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
Gets the specified package configuration
public function getConfig($package);
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request, [ 'short_description' => 'required', 'video' => 'required', ]); $lesson = new Lesson(); $lesson->title = $request->get('title'); $lesson->course_id = $request->get('id'); $lesson->s...
/ cleanAll() will clean up your session dir removing all 'sid_' files with a modified date older than the number of minutes passed in. This method is here as a convenience. You probably want to create a cron job that cleans this up on a daily basis.
function cleanAll($minutes = CLEAN_ALL_MINUTES) { $sessions = @scandir(SESSIONS_DIR); $sess_dir = rtrim(SESSIONS_DIR, '/').'/'; for($n=count($sessions),$i=0;$i<$n;$i++) { if($sessions[$i]!='.' && $sessions[$i]!='..') { $last_modified = @filemtime($sess_dir . $sessions...
Operation listsServicesServiceIdPut Update an existing Service.
public function listsServicesPut($service_id) { $input = Request::all(); $service = Services::findOrFail($service_id); $service->update(['name' => $input['name']]); if($service->save()){ return response()->json(['msg' => 'Updated service']); }else{ ...
Get the value of localisation
public function getLocalisation($localisation=null) { if ($localisation != null && is_array($this->entity) && count($this->entity)!=0) { $table_name = strtolower(get_class($this)); $query = "SELECT * FROM $table_name WHE...
curl calls the pageview pixel
protected function pixelPageView() { $url = $GLOBALS['ccttsUrl'] .'cctts_inc/ajax/ccReg.php'; $paramsArr = array('method=pixelPageView'); foreach ($this->ccttsParams as $key => $val) $paramsArr[] = "$key=$val"; $paramsStr = implode('&', $paramsArr); $result = $this->curlIt($url, $paramsStr); }
/ get_all_purchase_requests(): returns a 2D array of all purchase requests
function get_all_purchase_requests($db) { $sql = "SELECT * FROM purchase_requests"; $st= $db->prepare($sql); $st->execute(); $us = $st->fetchAll(); return $us; }
Form constructor for the Display Text configuration page.
function room_reservations_admin_settings_page($form, &$form_state) { $default_calendar_text = _room_reservations_get_variable('calendar_text'); $default_reserve_room_instructions_text = _room_reservations_get_variable('reserve_instructions'); $default_reserve_form_instructions_text = _room_reservations_g...
TODO:: make sure this is a AJAX Request
public function checkEmailExistsAjaxAction() { if(isset($_POST['Email']) && !empty($_POST['Email'])) { header('Content-type: text/plain'); if(UserModel::emailExists($this->filterString($_POST['Email'])) !== false) { echo 1; } else { echo 2;...
Get backup info by name, useful for backups with custom name.
public function get_backup_by_name( $name = '' ) { if ( ! empty( $name ) ) { return self::$dbo->querySingle( "SELECT * FROM snapshots WHERE name LIKE '$name'", true ); } return false; }
///////////////////////////// Whostage functions // /////////////////////////// Operation listsWhostageGet Fetch Drug Allergies (for select options).
public function listsWhostageget() { $response = Whostage::all(); return response()->json($response,200); }
Specifies the access control rules. This method is used by the 'accessControl' filter.
public function accessRules() { return array( array('allow', // allow all users to perform 'index' and 'view' actions 'users'=>array('admin'), ), array('deny', // deny all users 'users'=>array('*'), ), ); }
returns developer if in db, or adds and returns it if it isn't
function getOrAddDeveloper($gbDeveloper) { // get developer from db $developer = $this->getDeveloperByGBID($gbDeveloper->id); // if developer isn't in db if($developer == null) { // developer was not found, get from Giant Bomb $this->load->model('Gian...
Return the form metadata.
public static function get_big_sea_survey_definition() { return array( 'title' => 'Big Sea Survey', 'category' => 'Forms for specific surveying methods', 'description' => 'A dynamic form which allows a front page to define the number of transects to record across '. 'a set of zones and m...
check for session and cookie presence
public function view_notification() { $this->admin_header(); //check and confirm if the total url segment is 3 $url_segments = $this->uri->total_segments(); if ($url_segments == 3) { //retrieved the unreviewed property id $notification_id = $this->uri->segment(3); //retrieve from the databas...
Tests Transform_Unserialize_Serial>getReverse() with a chain
public function testGetReverse_Chain() { $mock = $this->getMock('Q\Transform', array('getReverse', 'process')); $mock->expects($this->once())->method('getReverse')->with($this->isInstanceOf('Q\Transform_Serialize_Serial'))->will($this->returnValue('reverse of mock transformer')); $...
Moves an existing list item to a new position. The position is in front of the item with the ID given in $ref or at the end of the list if $ref is null. // item ID list in database: 1, 2, 3, 4 $listManager>moveItem( 2, 4 ); // result: 1, 3, 2, 4 // item ID list in database: 1, 2, 3, 4 $listManager>moveItem( 2, null ); ...
public function moveItem( $id, $ref = null );
Finds the Follow model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Follow::findOne ( $id )) !== null) { return $model; } else { throw new NotFoundHttpException ( 'The requested page does not exist.' ); } }
Generate meta query for wc_get_orders.
private function get_orders_generate_customer_meta_query( $values, $relation = 'or' ) { $meta_query = array( 'relation' => strtoupper( $relation ), 'customer_emails' => array( 'key' => '_billing_email', 'value' => array(), 'compare' => 'IN', ), 'customer_ids' => array( 'key' => '...
Load JSON from master file
public function testAggregation() { $statistics = json_decode(file_get_contents(base_path('tests/database/yrkesstatistik_aggregated.json')), true); // Compare with master foreach (YrkesstatistikAggregated::all() as $count => $agg) { //dd($statistics[$count]['statistics']['entrie...
Indicates the type of answer data which Moodle expects to recieve; the scripted quesiton type always recieves the same, single answer.
public function get_expected_data() { return array('answer' => PARAM_RAW_TRIMMED); }
Manually set the result value
protected function result($value) { $this->setValue($value); return $this; }
Returns the question titles of all questions of a question block
function &getQuestionblockQuestions($questionblock_id) { global $ilDB; $titles = array(); $result = $ilDB->queryF("SELECT svy_question.title, svy_qblk_qst.question_fi, svy_qblk_qst.survey_fi FROM ". "svy_qblk, svy_qblk_qst, svy_question WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND " . ...
array( 'flag' => int 'flagIframe' => int )
protected function _setSearch($arr) { global $varsRequest; global $varsPluginAccountingPreference; if (FLAG_CHECK_UPDATE) { $this->checkStampReload(array( 'stampTarget' => $varsPluginAccountingPreference['jsonStampUpdate']['logFile'], 'flagSearch' => 1, )); } $vars = $this->getVars(array( ...
Alter hrefs in page if they point to nonhtmlpage files. Relative src will be made either absolute or root relative depending on the value of $base_for_relative. If root relative is used, then attempts will be made to lookup the redirect and detect the final destination.
public static function rewriteAnchorHrefsToBinaryFiles($query_path, array $url_base_alters, $file_path, $base_for_relative, $destination_base_url) { $attributes = [ 'href' => 'a[href], area[href]', 'longdesc' => 'img[longdesc]', ]; $filelink_count = 0; $report = []; foreach ($attributes ...
Add a boolean param
public function addBoolean(string $name, bool $default = false) { $this->add('boolean', $name, func_get_args()); }
Display the specified resource.
public function show(Team $team) { // generate resource $resource = new Item($team, new TeamTransformer(), 'teams'); return $this->jsonResponse($resource, 200); }
date calculation start here
function week_number($date) { return date("W", strtotime("$date + 1 day")); }
Sorts output rows according to ORDER BY fields
public function orderBy(array $fields, $order = null);
Enable / selected ad
public function enable() { $this->_access("put"); $status = $this->Assets_model->enable($this->input->post()); $this->_returnAjax($status); }
Boot real compiled field. Append children to parentroot.
public function create() { // Load only root elements. $this->loadRoots($this->elements, $this->roots); // Make sure that first element isn't child. If child then throw a exception about that. if ($this->elements[0]->isChild()) TypeRegression::cantBe('child', 'Fir...
Processes submits of the metadata entry form.
public function sendMetadataForm($data, $form) { // Specify array for the params to send to the API. Can't be associative and keyed by the xmlname // as the Dublin core specification allows for multiple of the same field. $apiParams = array(); // Loop through the defined fields grab...
Sets curl property and its settings.
private function setCurl($is_https = false) { // Init $this->curl = curl_init(); // Sets basic parameters curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($this->curl, CURLOPT_TIMEOUT, isset($this->request->settings['timeout']) ? $this->request->settings['time...
Lists all Examination models.
public function actionIndex() { $userId = Yii::$app->user->id; $searchModel = new ExaminationSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->query->AndWhere(['user_id' => $userId]); $dataProvider->query->orderBy('create_a...
Return an array containing the status of any modified files in the repository.
public static function getStatus($path) { if (!file_exists($path)) { throw new Exception( "Unable to get git status of $path. Path does not exist."); } if (!is_dir($path)) { throw new Exception( "Unable to get git status of $path. Path is not a directory."); } if (!self::isRepo($path)) { th...
Get formatters from config.
protected function getFormettersFromConfig($items): array { $formatters = []; if (!is_array($items)) { $items = [$items]; } foreach ($items as $item) { $formatter = $this->getFormatter($item); if ($formatter) { $formatters[$item] ...
Logs a message with the Warning Log Level
public static function critical($msg, $method=null) { try { $method = is_null($method) ? self::_get_caller() : $method; return static::write(\Additional_Log::L_CRITICAL, $msg, $method); } catch (Exception $e) { // ignore } }
fetch then return documents
public function get() { $this->composeQuery(); $result = $this->connection->client()->search($this->queryBody); $this->scrollId = array_get($result,'_scroll_id'); return array_get($result, 'hits.hits'); }
Method to get the response (shorthand alias)
public function response() { return $this->response; }
Remove the specified resource from storage.
public function destroy($id) { $renter = Renter::findOrFail($id); $renter->prev = 'yes'; $renter->prop_id = null; $renter->save(); $this->addLog(\Auth::user()->name.' deleted a renter.'); flash('Successfully deleted')->success(); return redirect()->back(); ...
Registers an event to be published when the aggregate is saved, containing the given payload and optional metadata.
protected function registerEvent($payload, $metadata = null) { if ($payload instanceof AbstractDomainEvent && null === $payload->aggregateId) { $payload->setAggregateId($this->getId()); } return $this->getEventContainer() ->addEvent($payload, $metadata); }
/ Link to authorization
public function Authorization() { return $this->service->RedirectToAuthorization(); }
calculate distance between two places
public function distance($lat1, $lng1, $lat2, $lng2, $miles = true) { $pi80 = M_PI / 180; $lat1 *= $pi80; $lng1 *= $pi80; $lat2 *= $pi80; $lng2 *= $pi80; $r = 6372.797; // mean radius of Earth in km $dlat = $lat2 - $lat1; $dlng = $lng2 - $lng1; $a...
Constructs a new DigestReader implementation, reading from the Reader $reader and hashing all data with the algorithm $hashAlgo.
public function __construct(Reader $reader, $hashAlgo) { $this->_base = $reader; $this->_resource = hash_init($hashAlgo); }
TODO: Implement getBadge() method.
public function getBadge() { }
Store a newly created resource in storage.
public function store(Request $request) { }
/ hook menu link menu doormat
function v2_mumm_menu_link__menu_doormat(&$variables) { $element = $variables ['element']; $sub_menu = ''; if ($element ['#below']) { $sub_menu = drupal_render($element ['#below']); } if ($element['#change_location']) { $output = '<a class="hidden-xs" data-trigger-toggle="change-location" title="' ...
Get the facade accessor.
protected static function getFacadeAccessor(): string { return 'autopresentermapper'; }
Publish a message to a topic using promises
public function publishAsync($topic,$payload) { return $this->getClient()->publishAsync([ 'Message' => json_encode($payload), 'TopicArn' => $this->getTopic($topic)['arn'], 'Subject' => $topic, ]); }
Test case to assert the log middleware definition is created correctly.
public function testGetLogMiddlewareDefinition() { $client = 'client'; $logMiddleware = $this->subject->getLogMiddlewareDefinition($client); $this->assertCount(3, $logMiddleware->getArguments()); $this->assertSame('%mapudo.guzzle.middleware.log_middleware.class%', $logMiddleware->ge...
/ Usage In the following example we generate a select field with three options. mdx:Render Outputs: mdx:Render o httidy Notice: the `options` method also accepts other formats besides an associative array. Take a look at the documentation of the [HtChoice]( class in order to learn more.
function testRender(){ #mdx:Render $select = new HtSelect("id_category"); $select->options([1=>'Category1',2=>'Category2',3=>'Category3']); #/mdx echo $select $this->expectOutputRegex("/select.*?id.*?name.*?option.*?1.*?Category1.*?3.*?Category3.*?select/s"); echo $select; }
verificando se existem dados para o modelo (POST).
static function password_expired_email() { $model = \Auth::$model; $user = $model::requested(); if (!$user->nil()) { if ($user->validate()) { password_expired_email($user) ? flash("Enviamos um e-mail para <small><b>$user->email</b></s...
Getter for private make_model
function getMake_model() { return $this->make_model; }
Display a listing of the resource.
public function index() { $listAdministrativeRegions = AdministrativeRegion::paginate(5); return view('admin.administrative-regions.index', \compact('listAdministrativeRegions')); }
Purpose: This function will make a SELECT DISTINCT on the makes. The result will be used to fill the html form select options for the select make dropdown in the UI. Inputs: None. Output: An associative array of results, or an exception.
public function findDistinctMake() { // Try to run the SQL query. try { $this->query = $this->db->query("SELECT DISTINCT make FROM inventory ORDER BY make;"); $result = $this->query->fetchAll(\PDO::FETCH_ASSOC); return $result; } catch(\PDOException $e) { ...
Returns an array of src's for a media background 's s by breakpoint. $img_size_prefix is expected to be a prefix for a set of registered image sizes, which has dimensions defined for each of Athena's responsive breakpoints. For example, if given a prefix 'bgimg', it is expected that bgimg, bgimgsm, bgimgmd, bgimglg, an...
function get_media_background_picture_srcs( $attachment_xs_id, $attachment_sm_id, $img_size_prefix ) { $bg_images = array(); if ( $attachment_sm_id ) { $bg_images = array_merge( $bg_images, array( 'xl' => get_attachment_src_by_size( $attachment_sm_id, $img_size_prefix . '-xl' ), 'lg' => get_attachmen...
Verify that there an implementation for the recorded protocol
public static function getInstance($oTicketingConfig, $bLoggingEnabled) { $sClass = 'Ticketing_Import_'.strtoupper($oTicketingConfig->protocol); if (!class_exists($sClass)) { throw new Exception("Invalid protocol in the current ticketing_config: {$oTicketingConfig->protocol}. There is no implementation of this p...
/ Function to get the routing details
public function onRouteFinish($e) { $matches = $e->getRouteMatch(); $controller = $matches->getParam('controller'); //var_dump($matches); }
Prepares a new query by setting the query, start offset and rows to return.
protected function set_query($query, $q) { // Set hightlighting. $query->setHighlight(true); foreach ($this->highlightfields as $field) { $query->addHighlightField($field); } $query->setHighlightFragsize(static::FRAG_SIZE); $query->setHighlightSimplePre(self::...
Standard modular info function.
function info() { $info=array(); $info['supports_advanced_import']=false; $info['product']='HTML website (page extraction and basic themeing)'; $info['import']=array( 'pages', ); return $info; }
Return label of a status
function LibStatut($statut,$mode=0) { global $langs; $langs->load('orders'); if ($mode == 0) { return $langs->trans($this->statuts[$statut]); } if ($mode == 1) { return $langs->trans($this->statutshort[$statut]); } if (...
Set post language status.
public function config( Array $post_status = array() ) { $post = get_post(); if ( empty( $post ) ) { return; } if ( ! count( $post_status ) ) { if ( $post->ID && ( is_single() || is_page() ) ) { $_post_status = get_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, true ); $statuses =...
Retrieve an item from the view config.
public function __invoke(string $key, $default = null) { $viewConfig = $this->config->split('view'); return $viewConfig->get($key, $default); }
fetches a list of regions for a given country OR subdivision $subdivision has a higher priority than country, if it is set, countryIdent is ignored.
public function getRegions($countryIdent = NULL, $subdivisionIdent = NULL) { $params = ''; if (NULL !== $countryIdent) { $params = '?land=' . $countryIdent; } if (NULL !== $subdivisionIdent) { $params = '?bundesland=' . $subdivisionIdent; } return $this->getData('/objekt/regionen' . $params); }
/ This script can be run at the command line via cron to search for all available jobs in US craigslist cities, input them into a database and email you the results. DB export is inside the folder for import.
function grab_feed($url){ //open our db connection $database="clscrape"; $con = mysql_connect('***.***.***.***','****','****'); //our associateive array of magical parsed xml jobs $arrFeeds = array(); //list of sites we want to search for jobs $sites = array("web/index.rss","eng/index.rss","sof/index.rss","sear...
set public status for storage id
public function setPublic($storageGroup, $storageId, $isPublic, $mimeType) { $publicFilename = $this->_getPublicFilename( $storageGroup, $storageId, $mimeType, $isPublic ); if ($isPublic) { if (empty($publicFilename)) { return FALSE; } if (!isset($this->_mimeTypeToExtension[$...
Display the specified resource.
public function show(Parking $parking) { return view('parkings.show', compact('parking')); }
Saves an Anonymous User into the database
public function saveAnonymousUser($completeName) { $stmt = $this->db->prepare("INSERT INTO anonymous_users(completeName) values (?)"); $stmt->execute(array($completeName)); return $this->db->lastInsertId(); }
Sets the start date of the survey
function setStartDate($start_date = "") { $this->start_date = $start_date; }
TODO: Implement isActive() method.
public function isActive() { }
Test Tests the actionIndex method error resonse.
public function test_actionIndexError() { $expected_output = "HTTP/1.1 424 \n" . "Content-type: application/json\n" . '{"errors":{"general":["Not a proper http method type, please send a FILE"]}}'; $this->assertControllerResponse('actionIndex', '/create/', $expected_output)...
Remove the following lines when you implement this test.
public function test_fail_login() { $_POST = array('name' => "customer2", 'password' => "123:"); $expected = json_encode(array("status" => 0, "message" => "Username or password is incorrect")); $this->expectOutputString($expected); $this->object->main(); }
Menentukan Grade berdasarkan Nilai Akhir
function grades($nilai) { if($nilai <= 100 ) { $grade = "A"; } if($nilai < 80 ) { $grade = "B"; } if($nilai < 70 ) { $grade = "C"; } if($nilai < 60 ) { $grade = "D"; } if($nilai < 50 ) { $grade = "E"; } return $grade; }
Perform a request and update $FreeHandles.
public function execute($Handle, array $Options) { // Validate $Handle if (! is_resource($Handle) ?: ! in_array($Handle, $this->FreeHandles)) { throw new InvalidArgumentException(0); } // Prepare handle elseif (! $result = @curl_setopt_array($Handle, $Options)) {...
Retrieve option values array
public function toOptionArray() { $options = array( array( 'label' => Mage::helper('chunit')->__('kg'), 'value' => 'kg' ), array( 'label' => Mage::helper('chunit')->__('gram'), 'value' => ...
Initiate Curl request and send back the result
function ProcessCurl($URL, $fieldString){ $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_URL, $URL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_...
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// / SETTERS //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public function setCommentId($comment_id) { $this->comment_id = $comment_id; }
Get the Grouping page category id
public function getCategoryId() { return $this->categoryId; }
Contexts with trailing characters. Leading characters are okay here since the numbers we will
public function testMatchesWithSurroundingLatinCharsAndLeadingPunctuation() { // insert start with punctuation, but trailing characters are still not allowed. $possibleOnlyContexts = array(); $possibleOnlyContexts[] = array('abc', 'def'); $possibleOnlyContexts[] = array('', 'def'); ...
sets the gender attribute
public function setGender($gender) { $this->gender = $gender; }
Function to validate the passed form based on the entered data
function validate_form($formtype, $formdata, $required_fields=array()) { $empty_fields = array(); $bool_result = TRUE; foreach($required_fields AS $required) { if(strpos($required, '*') !== FALSE){ #This is a checkbox group if(strpos($required, 'CHECKBOXES') !== FALSE) { $field_str = explode('*'...
Display a listing of the resource.
public function index(Request $request) { $users = User::with('state') ->sortable() ->filter($this->filterProps($request)) ->search($this->searchProps(),$request->search) ->whereRoleId(1) ->pagination($request); return view("user.view",compact('users')); ...
returns the company attribute
public function getCompany() { return $this->company; }
Return a sample for import header and content
public function sample() { return array( 'header' => 'groups', 'content' => 'groupalias;groupalias;groupalias' ); }
Checks the widgets array types and return an array of widget arrays for [estate, company, site]
public static function reArrangeWidgets($widgetsWithRoleWidget) { $resultWidgets = []; // Temporary order $tempCount = 1; foreach ($widgetsWithRoleWidget as $widgetWithRoleWidget) { // If it has a role_widget , store the order otherwise increase the tempCount if(!empty($widgetWithRoleWidget['role_widge...
/ Method to cancel an edit
public function cancelSectionCorporation() { JRequest::checkToken() or jExit(JText::_('JInvalid_Token')); // Initialize variables. $app = &JFactory::getApplication(); $modelName = $app->getUserState('com_eve.roles.model'); $app->setUserState('com_eve.roles.model', null); $app->setUserState('com_eve.secti...
Transform the resource into an array.
public function toArray() { $secretario = Profesor::find(config(fileContactos().'.secretario')); $director = Profesor::find(config(fileContactos().'.director')); return [ 'untitled1' => $secretario->fullName, 'untitled13' => $secretario->fullName, 'untitl...
Checks the database or filesystem for a cached result to the request.
private function getCached( $request ) { $request['SessionID'] = ''; // Unset SessionID $request['oauth_nonce'] = ''; // --\ $request['oauth_signature'] = ''; // |-Unset OAuth info $request['oauth_timestamp'] = ''; // --/ $reqhash = md5( serialize( $request ).$this->loginType ); $ex...
Test to see if an option is set.
public function __isset( $name ) { // Then behaviors foreach ( $this->_behaviorCache as $_behaviorName ) { if ( ( $_behavior = $this->asa( $_behaviorName ) ) instanceof IPSOptionContainer && $_behavior->contains( $name ) ) return $_behavior->getValue( $name ) !== null; } return parent::__isset( $name...
Goes through a row returned from a form escaping quotes and neutralising HTML insertions
function clean_form_data($formdata) { $clean_data = array(); foreach($formdata AS $key=>$value) { if(is_array($value)) { foreach($value AS $sub_key=>$sub_value) { if(is_array($sub_value)) { foreach($sub_value AS $sub_sub_key=>$sub_sub_value) { if(is_array($sub_sub_value)) { ...
Get soap clients for all good storages
protected function getClients(){ $clients = array(); $user = User::getInstance(); $uid = $user->getId(); $mac = $user->getMac(); if ($mac){ RESTClient::$from = $mac; }elseif ($uid){ RESTClient::$from = $uid; }else{ RESTClient...
chart for counting hair type
function gethair_type1($id){ $crud = new CRUD(); $crud->connect(); $crud -> sql("select *, COUNT(hair_type) from pigs_tbl where hair_type='1' "); $r = $crud->getResult(); foreach($r as $rs){ return $rs['COUNT(hair_type)']; } $crud->disconnect(); }
Logout Delete User info from Session, Cookie and reset cookie UUID.
function wf_logout() { $cookieName = Configure::read('Wildflower.cookie.name'); if ($this->Session->check($this->modelClass)) { // Generate an unique UUID $uuid = String::uuid(); $user = $this->WildUser->findByCookie($uuid); while (!empty($user)) { ...
Template function: Returns the list of merchants/places associated with an answer as
function pzdc_answer_merchants() { global $PraizedCommunity; return $PraizedCommunity->tpt_answer_merchants(); }
Define o valor do atributo sClasseEvento
public function setClasseEvento($sClasseEvento) { $this->sClasseEvento = $sClasseEvento; }
Make a show builder.
protected function detail($id) { $show = new Show(Engine::findOrFail($id)); $show->field('power_station_id', __('Power station id')) ->as(function ($userId) { $u = PowerStation::find($userId); if (!$u) return "-"; return $u->name; ...
Display the specified Earning.
public function show($id) { $earning = $this->earningRepository->findWithoutFail($id); if (empty($earning)) { Flash::error('Earning not found'); return redirect(route('earnings.index')); } return view('earnings.show')->with('earning', $earning); }
Method default yang diload saat controller dipanggil
public function actionIndex(){ $this->view("index.php"); }
Custom template tags for this theme. Social sharing buttons
function social_sharing_buttons() { $siteURL = site_url(); $pageURL = wp_get_shortlink(); // Get current page title $pageTitle = str_replace( ' ', '%20', get_the_title()); // Construct sharing URL without using any script $twitterURL = 'https://twitter.com/intent/tweet?text='.$pageTitle.'&amp;url='.$pageU...
Returns the data model based on the primary key given in the GET variable. If the data model is not found, an HTTP exception will be raised.
public function loadModel() { if($this->_model===null) { if(isset($_GET['id'])) { //$command = Yii::app()->db->createCommand('SELECT * FROM tbl_user'); // следующая строка НЕ добавит WHERE к SQL //$command-...