From 108403f3b846f9ede6565c5343508a354b3236bc Mon Sep 17 00:00:00 2001 From: gnat Date: Mon, 10 Dec 2007 18:46:14 +0000 Subject: [PATCH] provide examples of testing model relations existance. --- .../dealing-with-relations.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/manual/docs/en/working-with-objects/dealing-with-relations.txt b/manual/docs/en/working-with-objects/dealing-with-relations.txt index 47707ce86..deddc4155 100644 --- a/manual/docs/en/working-with-objects/dealing-with-relations.txt +++ b/manual/docs/en/working-with-objects/dealing-with-relations.txt @@ -120,3 +120,17 @@ $user->unlink('Phonenumber', array(1, 3)); $user->Phonenumber->count(); // 1 + ++++ Working with related records + +++++ Testing the existance of a relation + +$obj = new Model(); +if(isset($obj->Relation())) { // returns false + ... +} +$obj->Relation = new Relation(); +if(isset($obj->Relation())) { // returns true + ... +} + \ No newline at end of file