From b044fefc91d12c6bc2c76957bb49692c6bfc041c Mon Sep 17 00:00:00 2001 From: Matthew Hailwood Date: Tue, 3 Oct 2017 16:18:37 +1300 Subject: [PATCH] Difference between a single array call vs multiple calls to exclude This table should best summarise the difference - 1 = row is visible, 0 = row is excluded | Name | SELECT * FROM Player WHERE (FirstName != 'A' OR LastName != 'B') | SELECT * FROM Player WHERE FirstName != 'A' AND LastName != 'B' | | A B | 0 | 0 | | A C | 1 | 0 | --- .../00_Model/01_Data_Model_and_ORM.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md b/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md index b02ef017c..4710be4ec 100644 --- a/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md +++ b/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md @@ -401,6 +401,15 @@ Remove both Sam and Sig.. 'FirstName' => 'Sam', 'Surname' => 'Minnée', )); + + // SELECT * FROM Player WHERE (FirstName != 'Sam' OR LastName != 'Minnée') + +Removing players with *either* the first name of Sam or the last name of Minnée requires multiple `->exclude` calls: + + :::php + $players = Player::get()->exclude('FirstName', 'Sam')->exclude('Surname', 'Minnée'); + + // SELECT * FROM Player WHERE FirstName != 'Sam' AND LastName != 'Minnée' And removing Sig and Sam with that are either age 17 or 43.