Hi All
Currently I’m writing a class which extends from CActiveRecordBehavior:
class Test extends CActiveRecordBehavior
{
public function xyz(){ }
}
I noticed that there are two ways you can call the functions in this class (assume that User implements this behavior)
- from an instance object
$user = new User()
$user->xyz() ;
User::model()->xyz() ;
Both work, but what if this xyz function requires an initialized object with filled attributes, meaning the second call will fail.
First I thought the second call is equivalent to the first (a new instance), but it isn’t.
Can someone explain the differences, and how to forbid the second call ?
cheers
Luca