From 963584aea49bd24eedc10e49d12115b71f1e6bc1 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 23 Dec 2019 21:14:48 -0500 Subject: [PATCH] [#13297] - Added new migration and table --- .../Migrations/FractalDatesMigration.php | 69 +++++++++++++++++++ tests/_data/fixtures/models/FractalDates.php | 27 ++++++++ 2 files changed, 96 insertions(+) create mode 100644 tests/_data/fixtures/Migrations/FractalDatesMigration.php create mode 100644 tests/_data/fixtures/models/FractalDates.php diff --git a/tests/_data/fixtures/Migrations/FractalDatesMigration.php b/tests/_data/fixtures/Migrations/FractalDatesMigration.php new file mode 100644 index 00000000000..18e07dae93e --- /dev/null +++ b/tests/_data/fixtures/Migrations/FractalDatesMigration.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Fixtures\Migrations; + +use Phalcon\Db\Adapter\AdapterInterface; + +class FractalDatesMigration +{ + public function __invoke(AdapterInterface $db) + { + $sql = <<execute($sql); + + $sql = <<execute($sql); + + $this->insert( + $db, + 1, + '14:15:16.444', + '2019-12-25 17:18:19.666', + '2019-12-25 20:21:22.888' + ); + } + + /** + * @param AdapterInterface $db + * @param int $id + * @param string|null $time + * @param string|null $dateTime + * @param string|null $timeStamp + */ + public function insert( + AdapterInterface $db, + int $id, + string $time = null, + string $dateTime = null, + string $timeStamp = null + ) { + if (0 === $id) { + $id = null; + } + $sql = <<execute($sql); + } +} diff --git a/tests/_data/fixtures/models/FractalDates.php b/tests/_data/fixtures/models/FractalDates.php new file mode 100644 index 00000000000..2d8f9660f20 --- /dev/null +++ b/tests/_data/fixtures/models/FractalDates.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Models; + +use Phalcon\Mvc\Model; + +class FractalDates extends Model +{ + public $id; + public $ftime; + public $fdatetime; + public $ftimestamp; + + public function initialize() + { + $this->setSource('fractal_dates'); + } +}