PHP code example of gepur-it / datetime_6_doctrine_type

1. Go to this page and download the library: Download gepur-it/datetime_6_doctrine_type 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/ */

    

gepur-it / datetime_6_doctrine_type example snippets


namespace YourBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as JMS;
use Symfony\Component\Validator\Constraints as Assert;

/** Class EntityWithEmailField
  * @package YourBundle\Entity
  *
  * @ORM\Table(
  *     name="your_table_name",
  *     options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"}
  * )
  * @ORM\Entity(repositoryClass="YourBundle\Repository\EntityWithTynyintFieldRepository")
  */
class EntityWithDatetime6Field
{
    /**
     * @var integer
     *
     * @ORM\Column(name="created_at", type="datetime(6)", nullable=false)
     */
    protected $createdAt = 0;

    /**
     * @return \DateTime
     */
    public function getDirection(): \DateTime
    {
        return $this->createdAt;
    }

    /**
     * @param \DateTime $createdAt
     */
    public function setDirection(\DateTime $createdAt): \DateTime
    {
        $this->createdAt = $createdAt;
    }
}