tflori/orm

just another orm...

View the Project on GitHub tflori/orm

Build Status Test Coverage Maintainability Latest Stable Version Total Downloads

» API Reference » ORM\Dbal\Type\DateTime

ORM\Dbal\Type\DateTime

Table of Contents

Abstract

Extends: ORM\Dbal\Type

Date and datetime data type

Constants

Name Value
DATE_REGEX '(\+|-)?\d{4,}-\d{2}-\d{2}'
TIME_REGEX '\d{2}:\d{2}:\d{2}(\.\d{1,6})?'
ZONE_REGEX '((\+|-)\d{1,2}(:?\d{2})?|Z)?'

Methods

ORM\Dbal\Type\DateTime::__construct

public function __construct(int $precision = null, bool $dateOnly = false)
DateTime constructor
Parameters
Parameter Type Description
$precision int  
$dateOnly bool  

ORM\Dbal\Type\DateTime::__construct

↑ top


ORM\Dbal\Type\DateTime::factory

public static function factory(
    \ORM\Dbal\Dbal $dbal, 
    array $columnDefinition, 
): static
Returns a new Type object

This method is only for types covered by mapping. Use fromDefinition instead for custom types.

Static   This method is static.
Returns static  
Parameters
Parameter Type Description
$dbal ORM\Dbal\Dbal  
$columnDefinition array  

ORM\Dbal\Type\DateTime::factory

↑ top


ORM\Dbal\Type\DateTime::fits

public static function fits(array $columnDefinition): bool
Check if this type fits to $columnDefinition
Static   This method is static.
Returns bool  
Parameters
Parameter Type Description
$columnDefinition array  

ORM\Dbal\Type\DateTime::fits

↑ top


ORM\Dbal\Type\DateTime::getPrecision

public function getPrecision(): int
Returns int  

ORM\Dbal\Type\DateTime::getPrecision

↑ top


ORM\Dbal\Type\DateTime::validate

public function validate(mixed $value): bool|\ORM\Dbal\Error
Check if $value is valid for this type
Returns bool|ORM\Dbal\Error  
Parameters
Parameter Type Description
$value mixed  

ORM\Dbal\Type\DateTime::validate

↑ top