library doctrine-date-function-extension
nanaweb/doctrine-date-function-extension
- Wednesday, September 2, 2015
- by nanaweb
- Repository
- 0 Watchers
- 0 Stars
- 6,835 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 2 Forks
- 1 Open issues
- 4 Versions
- 3 % Grown
Doctrine.DateFunctionExtension
, (*1)
install
via composer, (*2)
$ composer require nanaweb/doctrine-date-function-extension:dev-master@dev
usage
NOTE: If your app is based on SQLite, please change namespaces below from "MySql" to "SQLite3"., (*3)
Doctrine
$config = new \Doctrine\ORM\Configuration();
$config->addCustomDatetimeFunction('month', '\Nanaweb\Doctrine\DateFunctionExtension\MySql\Month');
$config->addCustomDatetimeFunction('weekday', '\Nanaweb\Doctrine\DateFunctionExtension\MySql\Weekday');
$config->addCustomDatetimeFunction('year', '\Nanaweb\Doctrine\DateFunctionExtension\MySql\Year');
$config->addCustomDatetimeFunction('weekofyear', '\Nanaweb\Doctrine\DateFunctionExtension\MySql\WeekOfYear');
$em = EntityManager::create($dbParams, $config);
Symfony2
Configure functions in config.yml., (*4)
orm:
# ...
entity_managers:
default:
# ...
dql:
datetime_functions:
month: \Nanaweb\Doctrine\DateFunctionExtension\MySql\Month
weekday: \Nanaweb\Doctrine\DateFunctionExtension\MySql\Weekday
year: \Nanaweb\Doctrine\DateFunctionExtension\MySql\Year
weekofyear: \Nanaweb\Doctrine\DateFunctionExtension\MySql\WeekOfYear
dev-master
9999999-dev
Sources
Download
BSD-3-Clause
The Requires
The Development Requires
v0.9.1
0.9.1.0
Sources
Download
BSD-3-Clause
The Requires
The Development Requires
v0.9.0
0.9.0.0
Sources
Download
BSD-3-Clause
The Requires
The Development Requires
dev-common
dev-common
Sources
Download
BSD-3-Clause
The Requires
The Development Requires