To update model properties just set them and call save () method. As well values that needed to by changed could be passed as an array to the save () method.
```php
...
...
@@ -107,14 +115,14 @@ $user = user::byId (1);
$user->save($data);
```
**[Delete]**
###Delete
Use delete() method on any loaded object.
```php
$user=user::byId(1);
$user->delete();
```
**[Relations]**
###Relations
Currently dbObject supports only hasMany and hasOne relations only. To use them declare $relations array in the model class like:
```php
protected$relations=Array(
...
...
@@ -125,20 +133,18 @@ Currently dbObject supports only hasMany and hasOne relations only. To use them
After that you can get related object via variables and do their modification/removal/display:
```php
$user=user::byId(1);
// sql: select * from $persontable where id = $personValue
// sql: select from $persontable where id = $personValue
echo$user->person->firstName." ".$user->person->lastName." have the following products:\n";
// sql: select * from $product_table where userid = $userPrimaryKey
// sql: select from $product_table where userid = $userPrimaryKey