1
0
mirror of synced 2025-02-01 04:51:45 +03:00

provide examples of testing model relations existance.

This commit is contained in:
gnat 2007-12-10 18:46:14 +00:00
parent e069f12c6c
commit 108403f3b8

View File

@ -120,3 +120,17 @@ $user->unlink('Phonenumber', array(1, 3));
$user->Phonenumber->count(); // 1
</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>