PHP code example of sunchaser / doctrine-pgsql-ip

1. Go to this page and download the library: Download sunchaser/doctrine-pgsql-ip 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/ */

    

sunchaser / doctrine-pgsql-ip example snippets


   
   
   use Doctrine\DBAL\Types\Type;
   use SunChaser\Doctrine\PgSql\InetType;
   use SunChaser\Doctrine\PgSql\CidrType;

   Type::addType(InetType::NAME, InetType::class);
   Type::addType(CidrType::NAME, CidrType::class);
   

   

   use Doctrine\DBAL\Connection;
   use SunChaser\Doctrine\PgSql\InetType;
   use SunChaser\Doctrine\PgSql\CidrType;
   
   /** @var Connection $conn */
   $conn->getDatabasePlatform()->registerDoctrineTypeMapping(InetType::PG_TYPE, InetType::NAME);
   $conn->getDatabasePlatform()->registerDoctrineTypeMapping(CidrType::PG_TYPE, CidrType::NAME);