Commit 108403f3 authored by gnat's avatar gnat

provide examples of testing model relations existance.

parent e069f12c
...@@ -120,3 +120,17 @@ $user->unlink('Phonenumber', array(1, 3)); ...@@ -120,3 +120,17 @@ $user->unlink('Phonenumber', array(1, 3));
$user->Phonenumber->count(); // 1 $user->Phonenumber->count(); // 1
</code> </code>
+++ Working with related records
++++ Testing the existance of a relation
<code type="php">
$obj = new Model();
if(isset($obj->Relation())) { // returns false
...
}
$obj->Relation = new Relation();
if(isset($obj->Relation())) { // returns true
...
}
</code>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment