I don't understand what I'm doing incorrectly when trying to get just 1 column of data with a has_one relationship...
What I have is a page type with a GridField that allows users to assign people to it. After they're assigned their user ID is stored relating to that page, I need to use that ID to get their Firstname, Surname, Photo etc from the Member table and display it in the template.
These are the entries in the database for the GridField table storing assigned people.
+----+--------------+------------------+----------+----------+
| ID | ClassName | Role | MemberID | ShowID |
+----+--------------+------------------+----------+----------+
| 1 | ShowsContact | CG Supervisor | 5927 | 79 |
| 2 | ShowsContact | Dept Coordinator | 5927 | 79 |
| 3 | ShowsContact | CG Supervisor | 5927 | 79 |
| 4 | ShowsContact | CG Supervisor | 5927 | 78 |
| 5 | ShowsContact | VFX Editor | 7085 | 78 |
| 6 | ShowsContact | Unit PA | 6473 | 78 |
+----+--------------+------------------+----------+----------+
If I do:
return $this->ShowsContacts();
I can retrieve Role and MemberID in the template but I can't figure out how to just get the MemberID in the controller so I can search for that in Member and get that users details then display it in the template.
If I use anything like
$this->ShowsContacts() #...
it doesn't work. How do I get the MemberID in the controller?