anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
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-...
Update the row in the database.
protected function doUpdate(ConnectionInterface $con) { $selectCriteria = $this->buildPkeyCriteria(); $valuesCriteria = $this->buildCriteria(); return $selectCriteria->doUpdate($valuesCriteria, $con); }
For internal only. DO NOT USE IT.
public function deserialize($param) { if ($param === null) { return; } if (array_key_exists("InstanceId",$param) and $param["InstanceId"] !== null) { $this->InstanceId = $param["InstanceId"]; } if (array_key_exists("VirtualHost",$param) and $param["Vi...
Set up default permissions.
public function initializePermissions() { Loader::helper('clov_permissions', 'clov'); $page = $this->getCollectionObject(); ClovPermissionsHelper::setBaselinePermissions($page); // Project managers and employees can add new expenses. $clovGroups = Loader::package('clov')->getGroups(); $page->assignPer...
Run the database seeds.
public function run() { $newUser = new App\User(); $newUser->name ='mr_datawolf'; $newUser->email = 'patrickmoon@gmail.com'; $newUser->password = bcrypt('not4u2know'); $newUser->save(); }
================================================== Some helper functions and filters for theme
function default_menu(){ wp_nav_menu(array('menu' => 'Main Menu', 'fallback_cb' => 'default_page_menu', 'container' => 'nav', 'container_class' => 'mainmenu', 'menu_class' => 'menu clear')); }
Returns the path from the url.
public function getPath(string $url): string;
/ remove_tag Remove a tag from the given TestRun Usage TestRun.remove_tag Parameters ParameterData Type run_idinteger tag_namestring Result 0
function TestRun_remove_tag($run_id, $tag_name) { // Create call $call = new xmlrpcmsg('TestRun.remove_tag', array(new xmlrpcval($run_id, "int"), new xmlrpcval($tag_name, "string"))); // Do call and return value return do_call($call); }
Store a newly created resource in storage.
public function store(AppoinmentStoreRequest $request) { $validated = $request->validated(); //evaluate Appointment Services Logic $reservation = (new AppoinmentServices())->reservation($validated); if($reservation['status'] == 'error') { return back()->withInput()->wi...
fonction pour supprimer un commentaire
public function deleteComment($commentId) { $db = $this->dbconnect(); $deletedComment = $db->prepare('DELETE from comments WHERE id = ?'); $affectedLines = $deletedComment->execute(array($commentId)); return $affectedLines; }
Get URL for Redirect
public function getRedirectUrl($url) { return $this->context->link->getModuleLink($this->name, 'redirect', array('goto' => $url), Tools::usingSecureMode()); }
for hashing a code sent to email
public function verification_hash($code){ return hash('sha512', $code . config_item('encryption_key')); }
Return properties for JSON serialization
public function jsonSerialize(){ if( ! $this->isPersisted() ){ $properties = (object) get_object_vars($this); unset($properties->id); return $properties; } $properties = (object) get_object_vars($this); $pro...
Seed the application's database.
public function run() { Role::create(['name' => 'admin']); Role::create(['name' => 'user']); User::create([ 'name' => 'admin', 'email' => "admin@gmail.com", 'password' => Hash::make('password'), ])->assignRole(['admin', 'user']); User::cr...
Display the specified resource.
public function show(Price $price) { // }
A setter method when a form is submitted
public function getInfoAttribute($info) { return unserialize($info); }
Cast value from scalar to type
public function fromString(string $value): \DateTime { return new \DateTime($value); }
checks, if orm data type is defined
public function hasOrmType($ormDataType) { return isset($this->ormDataTypeInstance[$ormDataType]); }
Update the specified resource in storage.
public function update(CategoryRequests $request, $id) { $category = Category::findOrFail($id); $category->name = $request->input('name'); $category->parent_id = $request->input('parent_id'); $category->save(); return response()->json([ 'status'...
Show the application dashboard.
public function index() { return view('backend.index')->with('posts', \App\Post::all()); }
Edit a Canvas user
public function editUser($userID){ $this->path = "users/$userID"; return $this->put(); }
Returns the comments for a photo
function photos_comments_getList ($photo_id, $min_comment_date = NULL, $max_comment_date = NULL) { $params = array(); $params['method'] = 'flickr.photos.comments.getList'; $params['photo_id'] = $photo_id; if ($min_comment_date) $params['min_comment_date'] = $min_comment_date; if ($max_comment_date) $params['m...
Reads the $xmlPath file and returns an object.
function getObject($object, $xmlPath) { $i = 0; if (!file_exists($xmlPath)) return; $xml = domxml_open_file ($xmlPath); $node = $xml->document_element(); $ChildDomNode = $node->first_child(); while($ChildDomNode) { if ($ChildDomNode->type == XML_ELEMENT_NODE) ...
Create a new job instance.
public function __construct(User $user) { $this->user = $user; }
returns the part of speech for specified word EG: [base_path]/frontend_dev.php/words/pos?word=computer
public function executePos(sfWebRequest $request) { // NOTE -- changed this from `getGetParameter` to `getParameter.` // The former wasn't working for some reason, $headword was coming up empty // andyinabox - 2010-05-20 $headword = $request->getParameter("word"); $this->pos = Wordnik::getPartOfSpeech($hea...
Returns Customer_Company objects of all employees of this company
public function getEmployees() { if ( is_null($this->_employees) ){ $customers = $this->getTable()->getEmployees(); $objects = new splObjectStorage(); foreach ($customers AS $customer) { try { $ccust = new Yourdelivery_Model_Customer_Compa...
Add this Gateway to WooCommerce
function woocommerce_add_paycoingateway_gateway($methods) { $methods[] = 'WC_Gateway_PaycoinGateway'; return $methods; }
Returns the username used to authenticate the user.
public function getUsername() { return $this->username; }
/ Fungsi ini menginsertkan data ke dalam tabel pokemon. Parameter $data berisi data yang akan diinsertkan dalam bentuk associative array yang terdiri dari pasangan key=>value. Key adalan nama field, sedangkan value adalah nilai field
public function insert($data){ // TODO: Modif bagian ini $this->db->insert('pokemon', $data); }
manda todos los datos recogidos del formulario del producto seleccionado para actualizar el registro en la base de datos
public static function actualizarProductosModel($datosModel, $tabla){ $stmt = Conexion::conectar()->prepare("UPDATE $tabla SET codigo_producto = :codigo, nombre = :nombre, precio = :precio, fecha_agregado = :fecha, id_categoria = :categoria, foto = :foto WHERE id_producto = :id"); $stmt->bindParam(":id", $datos...
function Synchronizes properties from an import with the database.
public function sync($p_category_data, $p_object_id, $p_status = 1 /* isys_import_handler_cmdb::C__CREATE */) { $l_indicator = false; if (is_array($p_category_data) && isset($p_category_data['properties'])) { // Create category data identifier if needed: if ($p_status...
Update the specified resource in storage.
public function update($id) { $branch = Branches::find($id); $branch->branch_name = Input::get('branch_name'); $branch->phone = Input::get('phone'); $branch->save(); $branchesById = Branches::find($id); $branches = Branches::orderBy('branch_name','asc')->paginate(); return Redirect::route('branches.e...
Get modified object instance.
public function getModel(){ return $this->model; }
Remove redundant closeTag elements from the tail of a switch's cases For each remove duplicate nodes that are either siblings or descendants of a sibling
protected static function removeRedundantCloseTagElements(DOMDocument $ir) { $xpath = new DOMXPath($ir); foreach ($xpath->query('//closeTag') as $closeTag) { $id = $closeTag->getAttribute('id'); $query = 'following-sibling::*/descendant-or-self::closeTag[@id="' . $id . '"]'; foreach ($xpath->query($q...
Returns the agreement module
protected function getAgreementModule() { if (!$this->agreement_module) { $this->agreement_module = ActivityModule::byIdentifier('agreement'); } return $this->agreement_module; }
Make a grid builder.
protected function grid($id) { $grid = new Grid(new Attendee); $grid->model() ->orderBy('id', 'desc') ->where('event_id', $id) ->whereNotNull('canceled_at'); $grid->disableActions(); $grid->disableCreateButton(); $grid->disableRowSelector(); ...
Shows voltages in the nodes
static public function showVoltages($circuit, $return = false) { $text = "Operating point:\n\n"; foreach ($circuit->V as $k => $v) { $text .= 'V(' . $circuit->getNodeName($k) . ") \t\t = " . number_format($v, 6) . " V\n"; } return $return ? $text : print($text);...
Fonction pour poster des commentaires blog
public function postCommentBlog($id_membre, $id_chapitre, $commentaire) { if(!empty($commentaire)) { $comment = $this->chapitre->commenterBlog($id_membre, $id_chapitre, $commentaire); array_push(self::$erreurs, '<h2>Votre Message a bien été envoyé !</h2> <i class="far fa-...
Given an IPv6 address in octet notation, returns a pure hex string.
private static function IPv6ToRawHex( $ip ) { $ip = self::sanitizeIP( $ip ); if ( !$ip ) { return null; } $r_ip = ''; foreach ( explode( ':', $ip ) as $v ) { $r_ip .= str_pad( $v, 4, 0, STR_PAD_LEFT ); } return $r_ip; }
Overloading this method to show the Amazon id of the order instead of the name of the Magento store
public function getOrderStoreName() { if ($this->getOrder()) { $name = array(); if($this->getOrder()->getAmazonOrderId()){ $name = array( Mage::helper('amazonOrders')->__('Imported from Amazon'), "#" . $this->getOrder()->getAmazonOrderId() ); } if (count($na...
Installs the given Composer Packages into the application. Taken from
protected function requireComposerPackages($packages) { $composer = $this->option('composer'); if ($composer !== 'global') { $command = ['php', $composer, 'require']; } $command = array_merge( $command ?? ['composer', 'require'], is_array($packag...