You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
98
106
99
107
```php
@@ -107,14 +115,14 @@ $user = user::byId (1);
107
115
$user->save ($data);
108
116
```
109
117
110
-
**[Delete]**
118
+
###Delete
111
119
Use delete() method on any loaded object.
112
120
```php
113
121
$user = user::byId (1);
114
122
$user->delete ();
115
123
```
116
124
117
-
**[Relations]**
125
+
###Relations
118
126
Currently dbObject supports only hasMany and hasOne relations only. To use them declare $relations array in the model class like:
119
127
```php
120
128
protected $relations = Array (
@@ -125,20 +133,18 @@ Currently dbObject supports only hasMany and hasOne relations only. To use them
125
133
After that you can get related object via variables and do their modification/removal/display:
126
134
```php
127
135
$user = user::byId (1);
128
-
// sql: select * from $persontable where id = $personValue
136
+
// sql: select from $persontable where id = $personValue
129
137
echo $user->person->firstName . " " . $user->person->lastName . " have the following products:\n";
130
-
// sql: select * from $product_table where userid = $userPrimaryKey
138
+
// sql: select from $product_table where userid = $userPrimaryKey
0 commit comments