Yii Framework Forum: getId() or getId - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

getId() or getId

#1 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 358
  • Joined: 23-July 09

Posted 25 October 2010 - 10:07 AM

Chapter 8, page 197 uses the following:

Yii::app()->user->getId()


which should just be:

Yii::app()->user->id

We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#2 User is offline   jefftulsa 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 168
  • Joined: 06-October 08
  • Location:Austin, TX

Posted 29 October 2010 - 03:29 PM

View PostBackslider, on 25 October 2010 - 10:07 AM, said:

Chapter 8, page 197 uses the following:

Yii::app()->user->getId()


which should just be:

Yii::app()->user->id




These are both valid and should return the same result. Were you seeing differences in the returned values between these two calls? The latter is just a convenient shorthand for the former.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users