Hi all
I have a problem when use Mongodb, for exmaple I have a collection(model) look like
<?php
namespace Zphalcon\Models;
class Province extends ModelBase
{
public $id;
public $name;
public $nameEn;
public $nameGoogle;
}
And collection Province when running Shell db.province.find();
{ "_id" : 1, "name" : "Hà Nội", "nameGoogle" : "Hà Nội", "nameEn" : "Ha Noi" }
{ "_id" : 2, "name" : "Hồ Chí Minh", "nameGoogle" : "Hồ Chí Minh", "nameEn" : "Ho Chi Minh" }
{ "_id" : 3, "name" : "Đà Nẵng", "nameGoogle" : "Đà Nẵng", "nameEn" : "Da Nang" }
{ "_id" : 4, "name" : "Khánh Hòa", "nameGoogle" : "Khánh Hòa", "nameEn" : "Khanh Hoa" }
{ "_id" : 5, "name" : "An Giang", "nameGoogle" : "An Giang", "nameEn" : "An Giang" }
{ "_id" : 6, "name" : "Vũng Tàu", "nameGoogle" : "Vung Tau", "nameEn" : "Vung Tau" }
Then in Form I used such as like https://docs.phalcon.io/en/latest/reference/forms.html#initializing-forms
[...]
$this->add(new Select('province', Province::find(), array(
'using' => array('nameEn','name')
)));
Then I was recicive error
Catchable fatal error: Object of class Zphalcon\Models\Province could not be converted to string in /usr/share/nginx/html/master/apps/frontend/cache/volt/_usr_share_nginx_html
_master_apps_frontend_views_post_item.volt.php on line 79
If I use database is Mysql it will working. This is bug or not feauture MongoDb