Sarke
1
What is the difference between these two?
Post::model()->find();
Post::find();
Since the find() method does not access the specific model attributes, what is the point of using ::model()?
I always see it written the first way and only thing I can think of is that model() caches the AR meta info. Or am I missing?
joblo
(Joe)
2
find() is not a static method of the AR model.
So you have to create an instance first by Post::model()
Take a look at the implementation code
tri
(tri - Tommy Riboe)
3
It’s also worth to mention Post::model() will return the “class instance”, created on the first instantiation of the Post class.
/Tommy