Skip to content

Commit

Permalink
Updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
canni committed Dec 26, 2010
1 parent bc31a9c commit c112bbd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class User extends EMongoDocument
*/
public function getCollectionName()
{
return 'user';
return 'users';
}

/**
Expand Down
23 changes: 23 additions & 0 deletions examples/UserAddress.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
class UserAddress extends EMongoEmbeddedDocuemnt
{
public $city;
public $street;
public $apartment;
public $zip;

public function rules()
{
return array(
array('city, street, house', 'length', 'max'=>255),
array('house, apartment, zip', 'length', 'max'=>10),
);
}

public function attributeLabels()
{
return array(
'zip' => 'Postal Code',
);
}
}

0 comments on commit c112bbd

Please sign in to comment.