PHP code example of th3mouk / materialized-view-bundle

1. Go to this page and download the library: Download th3mouk/materialized-view-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

th3mouk / materialized-view-bundle example snippets


return [
    // ...
    Th3Mouk\MaterializedViewBundle\Th3MoukMaterializedViewBundle::class => ['all' => true],
];

use Th3Mouk\MaterializedView\Core\Definition\MaterializedViewDefinition;
use Th3Mouk\MaterializedViewBundle\Attribute\AsMaterializedViewProvider;

#[AsMaterializedViewProvider]
final class SalesByCategoryView
{
    public function definitions(): iterable
    {
        yield MaterializedViewDefinition::create('public.sales_by_category')
            ->fromSql(/* db/matviews/sales_by_category.sql */);
    }
}
bash
php -d memory_limit=512M bin/console matview:doctrine-lane --no-interaction