I'm new to CakePHP, and still figuring out the basics. Right now I'm a bit mystified by the process to get one or more fields from a model (from inside another linked model).
So far, I have this:
$this->user->id = 123;
$this->User->read();
$field1 = $this->User->data['User']['field1'];
$field2 = $this->User->data['User']['field2'];
Which seems awfully verbose.
And this:
$this->user->id = 123;
$field1 = $this->User->field('field1');
$field1 = $this->User->field('field2');
Which seems less long, but results in two queries.
What I used to do in these situations, pre-Cake:
$this->User = new User(123);
$field1 = $this->User->field1;
$field2 = $this->User->field2;
or when I felt like typing:
this->User = new User(123);
$field1 = $this->User->getFieldOne();
$field2 = $this->User->getFieldTwo();
So, the question: am I missing some magic in CakePHP by which to accomplish this task, or do I have to live with typing a lot?