Tag Archives: PHP

Data fixture

A data fixture is a PHP script that sets data you want to reuse in your test. The script can be defined in a separate file or as a local test case method.

Use data fixtures to prepare a database for tests. The Integration Testing Framework (ITF) reverts the database to its initial state automatically. To set up a date fixture, use the @magentoDataFixture annotation.

Customer Attributes

Customer attributes provide the information that is required to support the order, fulfillment, and customer management processes. Because your business is unique, you might need fields in addition to those provided by the system. You can add custom attributes to the Account Information, Address Book, and Billing Information sections of the customer’s account. Customer address attributes can also be used in the Billing Information section during checkout, or when guests register for an account.

https://docs.magento.com/user-guide/v2.3/stores/attributes-customer.html

 

PHP Encapsulation

The wrapping up of data and methods into a single unit (called class) is known as encapsulation. Encapsulation is a protection mechanism for the data members and methods present inside the class. In the encapsulation technique, we are restricting the data members from access to outside world end-user.

In PHP, encapsulation utilized to make the code more secure and robust. Using encapsulation, we are hiding the real implementation of data from the user and also does not allow anyone to manipulate data members except by calling the desired operation.

 

Variable pools PHP

Variable pools are functional groupings of variables within Service Manager. There are currently four variable pools

Global

A global variable is visible to the entire system. It begins with $G. or $lo..

Local

A local variable is only visible to the RAD application in which it was defined. It begins with $L..

Parameter

A parameter variable is defined on a parameter command panel. It may contain a value passed in from another application. By convention, parameter variables are written in uppercase letters, such as $PHASE or $GROUP.LIST. Parameter variables are invisible to the debugger.

Thread

A thread variable is only visible to the thread in which it was defined. The same variable in different threads has different values, even when the threads are spawned by the same parent.

Defining Variable JavaScript

There are three ways of defining a variable in JavaScript:

Var
This is used to declare a variable and the value can be changed at a later time within the JavaScript code.

Const
We can also use this to declare/define a variable but the value, as the name implies, is constant throughout the JavaScript program and cannot be modified at a later time.

Let
This mostly implies that the values can be changed at a later time within the JavaScript code.

JavaScript Advantages

These are the advantages of JavaScript:

Enhanced Interaction
JavaScript adds interaction to otherwise static web pages and makes them react to users’ inputs.

Quick Feedback
There is no need for a web page to reload when running JavaScript. For example, form input validation.

Rich User Interface
JavaScript helps in making the UI of web applications look and feel much better.

Frameworks
JavaScript has countless frameworks and libraries that are extensively used for developing web applications and games of all kinds.