gepur-it/datetime_6_doctrine_type
Composer 安装命令:
composer require gepur-it/datetime_6_doctrine_type
包简介
Gepur ERP datetime(6) doctrine type
README 文档
README
How to write doctrine type "datetime(6)"
to your Symfony project
Add datetime(6): GepurIt\TinyintType\Datetime6DoctrineType to types of dbal in doctrine. See example:
# Doctrine Configuration doctrine: dbal: default_connection: default connections: default: .gitignore.gitignore some_other: datetime(6): class: GepurIt\Datetime6Type\Datetime6DoctrineType commented: false
SQL type = 'DATETIME(6)'.
Example of entity:
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; } }
统计信息
- 总下载量: 8.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-24