Created
May 30, 2013 06:03
-
-
Save squidge/5675967 to your computer and use it in GitHub Desktop.
mongodm models
This file contains hidden or 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
class Base extends Model { | |
static $config = "default"; | |
} | |
class User extends Base { | |
static $collection = "user"; | |
protected static $attrs = array( | |
'first_name' => array( 'type' => 'string' ), | |
'last_name' => array( 'type' => 'string' ), | |
'contacts' => array( 'model' => 'App\Models\Contact', ' type' => 'references' ) | |
); | |
} | |
class Contact extends Base { | |
static $collection = 'contact'; | |
} | |
---- have also tried --- | |
class Contact extends Base { | |
static $collection = 'contact'; | |
protected static $attrs = array( | |
'user' => array( 'model' => 'App\Models\User', ' type' => 'reference' ) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment