Tag Archives: Custom

Magento 2 Custom Query

use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');

$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();

$sql = "Select * FROM customer_entity" ;
$result = $connection->fetchAll($sql); 

Custom Wrappers

stream_wrapper_register(protocol, classname) Registers a protocol; implementation is part of the class

The class implements standard functionality like reading, writing, or changing the file position.

php_user_filter is a predefined class in php and is used in conjunction with user-defined filters.