I'm trying to get settings for a website from MongoDB via PhalconPHP, using an Phalcon\Mvc\Model. Here's my model:
namespace CMS4\Common\Model;
use Phalcon\Mvc\Model as MongoDocument;
class Settings extends MongoDocument
{
/**
*
* @var \MongoId
*/
protected $id;
/**
*
* @var int
*/
public $websiteId;
/**
*
* @var array[]
*/
public $leUserConfig;
public function initialize()
{
$this->setConnectionService('mongo');
}
/**
* By default that model will refer to `WebsiteSettings`, wherefore getSource is implemented
* @return string
*/
public function getSource()
{
return 'WebsiteSettings';
}
}
However, calling it via $test = Settings::find(); I get the following RuntimeException:
Call to undefined method ::gettype()
I guess this is used somewhere internally by PhalconPHP, but a quick glance at the source code led me nowhere. I'm out of ideas, please advise. If I need to provide more information, just say so.