xandros15
Repos
31
Followers
5

simple pagination for slim3

9
7

IRC bot on PHP

1
2

Events

Support PHP 7.4 and 8.1 at same time in 2.0.* ver.

If I use 2.0.2 version and run composer install I got error with softcreatr/jsonpath, because don't support 8.1 in ^0.7.

Easier fix would be just add softcreatr/jsonpath: ^0.5 | ^0.7 | ^0.8 into composer.json.

I'm in middle of migration, so I need to use php 7.4 and 8.1 at same time.

Created at 3 weeks ago
issue comment
Cannot save other value in tinyint(1) other than 0 or 1 on mariadb

It works correct, thanks ^^

Created at 1 month ago
opened issue
Cannot save other value in tinyint(1) other than 0 or 1 on mariadb

What steps will reproduce the problem?

Example code:

        $model = new Model($this->connection);// $connection is instance of Yiisoft\Db\Connection\ConnectionInterface
        $model->type = 5;
        $model->status = 4;
        $model->created_at = date('Y-m-d h:i:s');
        $model->updated_at = date('Y-m-d h:i:s');
        $model->save();
        $identifier = $model->primaryKey;
        $cmd = $this->connection->createCommand('SELECT * FROM ' . $model->tableName() . ' WHERE id = :id', [
            'id' => $identifier
        ]);
        $cmd->execute();
        var_dump($cmd->queryAll());

Example schema of model:

CREATE TABLE `model` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` tinyint(1) unsigned NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '0: disable, 1: pending, 2: active, 3: error',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

What is the expected result?

array(1) { [0]=> array(9) { ["id"]=> string(1) "4" ["type"]=> string(1) "5"  ["status"]=> string(1) "4" ["created_at"]=> string(19) "2023-01-29 03:24:48" ["updated_at"]=> string(19) "2023-01-29 03:24:48" } } 

What do you get instead?

array(1) { [0]=> array(9) { ["id"]=> string(1) "4" ["type"]=> string(1) "1"  ["status"]=> string(1) "1" ["created_at"]=> string(19) "2023-01-29 03:24:48" ["updated_at"]=> string(19) "2023-01-29 03:24:48" } } 

Additional info

| Q | A | ---------------- | --- | Version | 1.0.? | PHP version | 8.1.14 | MariaDB version | 10.3.37 | Operating system | Linux Mint 20.3

Created at 1 month ago
issue comment
MySQL wrong boolean type should be bit(1)

My mariadb database got column tinyint(1) where I'm holding numbers from 0-7. Because of that change when I'm trying to use ActiveRecord to save model with other values than 0 always got 1 in database. Is there any option to control value types as I want?

Created at 1 month ago