PHP: 8.1
CakePHP: 4.4.
Postgres: 13
Problem: While generating entity Block
, after setting data, the val
property is always set to null
Table definition
create table blocks
(
id integer generated always as identity
val integer[]
);
Im trying to call createNewBlock method (Entity class is completely empty, just extends Cake\ORM\Entity):
class BlocksTable extends Table {
public function initialize(array $config): void {
$this->setTable('blocks');
$this->setEntityClass('App\Model\Entity\Block');
}
public function createNewBlock(int ...$val): Block {
return $this->newEntity([
'val' => $val
]);
}
}
And the result
App\Model\Entity\Block Object
(
[val] =>
)
I expected val to be an array but it's always set to null
So i was digging a little bit and dont know why method _buildPropertyMap from Cake\ORM\Marshaller returns columnType = string for column val
Is there any quick fix for that ?