PHP code example of kenny1911 / doctrine-views-sync

1. Go to this page and download the library: Download kenny1911/doctrine-views-sync 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/ */

    

kenny1911 / doctrine-views-sync example snippets


use Doctrine\DBAL\Schema\View;

final readonly class UsersViewsProvider implements \Kenny1911\DoctrineViewsSync\ViewsProvider
{
    public function getViews() : iterable
    {
        yield new View(
            name: 'users_credentials',
            sql: 'SELECT id, username, password FROM users',
        );
    }
}
bash
php bin/console doctrine:views:drop
bash
php bin/console doctrine:views:sync