Open mohahn opened 5 years ago
I tried to manually debug this. On line 324 in Library/Phalcon/Mvc/CassandraModel.php
I've inserted a print_r($dataTypes);
and get only
Array
(
[site_id] => 0
)
So the text
data type is not recognized. When I change it to varchar
in model, some (not all!) errors disappear, but even with create()
data is not written to Cassandra.
After changing some code in _exists()
method in above class to
$columnMap = $metaData->getColumnMap($this);
$mappedPrimary = $columnMap[$primaryKeys[0]];
if ($this->{$mappedPrimary} === null) {
return false;
}
$uniqueKey = $this->_uniqueKey;
if ($uniqueKey === null) {
$this->_uniqueKey = $primaryKeys[0] . ' = ?';
$this->_uniqueParams = [$this->{$mappedPrimary}];
$this->_uniqueTypes = [$bindDataTypes[$primaryKeys[0]]];
}
I get no error anymore in log, but still no data is sent to Cassandra. BTW: Phalcon is 3.4, Datastax PHP driver is version 1.3.2
My model looks like (columns in Cassandra table are named not in camel case but with underscore in name)
what works is the following (I get a correct user_id from table)
what does not work is
this gives me
I'm able to query data, but not able to store data in Cassandra!