Created
November 2, 2013 20:35
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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