PHP code example of ursusarctosua / doctrine-timestamp
1. Go to this page and download the library: Download ursusarctosua/doctrine-timestamp 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/ */
ursusarctosua / doctrine-timestamp example snippets
use Doctrine\DBAL\Types\Type;
Type::addType('datetimetz', 'UrsusArctosUA\DoctrineTimestamp\DBAL\Types\DateTimeTzType');
$conn->getDatabasePlatform()
->registerDoctrineTypeMapping('mysql_datetimetz', 'datetimetz');
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
*/
class MyPersistentClass
{
/**
* @var \DateTimeInterface
* @ORM\Column(type="datetimetz")
*/
private $field;
}