Module to make Magento 2 great again. Old well-known Magneto 1 PHP Facade simplified interface to the Magento 2 objects without Adobe BS
\Mage:: Facades provide an old good static interface to Magento classes that are available in the application’s Mage service container (a place to store variables and objects to use them when needed). This means that we can use functions without making an object from a class. Facades provide a "static" interface to classes available in the application's service container. Mage ships with many facades provide access to all Magento 2 features.
Mage facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more flexibility than traditional magento methods.
Magento 2 sucks, and Mage is here to resolve this issue. Adobe killed Magento with the scum and overengenered bloatware. Mage adding additional nice development features not available with Magento 2 core.
We have decided to use a facade design pattern because the magento 2 system is very overengenered/complex and obfuscated - difficult to understand because the system has many interdependent classes. The mage::facade pattern hides the complexities of the Magento 2 system and provides a simpler interface to the developers. It typically involves a single wrapper class containing a set of members the client requires. These members access the system on behalf of the facade clients and hide the implementation details.
Magento 2 uses an outdated Zend_DB library and slow legacy ORM to interact with a database. Mage DB2 based on Laravel/DB makes interacting with databases extremely simple and fast using raw SQL, a fluent Laravel query builder, and the Eloquent ORM in conjunction with the Laragento package.
Also, Laravel collections provide a variety of extremely powerful methods for mapping and reducing data. For more information, check the awesome Laravel documentation. https://laravel.com/docs/11.x/queries
Get all dates from the order table
$orders = DB2::table('sales_order');
$users = DB2::table('users')
->select('name', 'email as user_email')
->get();
$users = DB2::table('users')
->join('contacts', 'users.id', '=', 'contacts.user_id')
->join('orders', 'users.id', '=', 'orders.user_id')
->select('users.*', 'contacts.phone', 'orders.price')
->get();
DB2::table('users')->insert([
['email' => '[email protected]', 'votes' => 0],
['email' => '[email protected]', 'votes' => 0],
]);