Thanks for the reply. Your assistance is most appreciated.
Yes, I have tried this, and no it doesn't work within the model.
Presently, in the model, I have tried various iterations of:
function getMemberID() {
return $this->id;
// or
return $this->Model->id;
// or
return $this->Modelname->id;
// or
return $this->getID();
// or
return $this->Modelname->getID();
// or
return $this->getLastInsertID();
}
AND
var $getMemberID = $this->id;
// or
var $getMemberID = $this->Model->id;
// or
var $getMemberID = Modelname->id;
// or
var $getMemberID = $this->Model->getID();
// or
var $getMemberID = $this->Modelname->getID();
// anon...
All to no avail. The only remotely successful variation:
function getMemberID() {
return $this->id;
}
has returned null. The others, of course, are only going to produce
errors.
I am able to retrieve other fields from the same Model. Just not the
ID.
In my controller, I have:
$this->set ( 'memberid', $this->Member->getMemberID() );
to prepare the Model data for the view.
I'm flummoxed. This should be working flawlessly, and I get nothing
but null on a field I know has the data I'm looking for.
On Dec 19, 5:48 pm, Donkeybob <[email protected]> wrote:
> if your in the model . . .does this work? $this->Modelname->id;
>
> On Dec 19, 6:35 pm, Ken <[email protected]> wrote:
>
> > This is the worst kind of noob question, but I'm stumped. I've tried
> > $this->Modelname->getID();
> > $this->Modelname->getLastInsertID();
> > $this->data['Modelname']['id'];
>
> > a special method from the Wizard Component:
> > $this->Wizard->read('step.Modelname.id'); //by the way, this method
> > retrieves data for ANY field BUT id.
>
> > and no joy. I just want the current Model's record id. What am I
> > missing?
>
> > Any insight you may be able to offer will be most welcome. Thanks in
> > advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---