Skip to content

Instantly share code, notes, and snippets.

@rmcvey
Created November 2, 2013 20:35
Show Gist options
  • Save rmcvey/7283200 to your computer and use it in GitHub Desktop.
Save rmcvey/7283200 to your computer and use it in GitHub Desktop.
Example usage of extending the Base_Mongo class. Read more here: http://www.php.net/manual/en/class.mongocollection.php
<?php
class MessageStorage extends Base_Mongo
{
protected $_database = 'some_database';
// this attribute must be defined
protected $_table = 'some_table';
// this is a hook into the constructor, if you want to add your own constructor, make sure you call parent::__construct() first
public function init()
{
// some code
}
}
$m = new MessageStorage();
$record = array('foo' => 'bar');
$m->insert($record);
util::debug($record);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment