Phalcon\Mvc\MongoCollection::bsonUnserialize PHP Method

bsonUnserialize() public method

Pass the values from the BSON document back to the object.
public bsonUnserialize ( array $data )
$data array
    public function bsonUnserialize(array $data)
    {
        $this->setDI(Di::getDefault());
        $this->_modelsManager = Di::getDefault()->getShared('collectionManager');
        foreach ($data as $key => $val) {
            $this->{$key} = $val;
        }
        if (method_exists($this, "afterFetch")) {
            $this->afterFetch();
        }
    }