PHP code example of avkluchko / postgres-doctrine-extensions

1. Go to this page and download the library: Download avkluchko/postgres-doctrine-extensions 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/ */

    

avkluchko / postgres-doctrine-extensions example snippets


// src/Filters/SomeFilter.php
public class SomeFilter
{
    // ...
    protected function createCondition(string $year, string $field, string $operator, string $parameterName): string
    {
        return sprintf(
            'make_date(%s, cast(date_part(\'month\', %s) as integer), cast(date_part(\'day\', %s) as integer)) %s :%s',
            $year,
            $field,
            $field,
            $operator,
            $parameterName
        );
    }
}