Why are there parantheses in the expression Yii::app()

Sorry for asking this beginner question.

I don’t understand, why there are set parantheses () when calling Yii::app, for instance Yii::app()->user->setState('something',$_GET['something)

Thanks in advance for clarification.

Because it is a method.

But after the parantheses follows the object operator. How can I understand, that user is a property of a method called Yii::app() ?

The object operator is used to access properties or methods of an object.
Is Yii::app() an object?

Yii::app()->user->setState(...)

Ah, now I understand - the method Yii::app() returns an object - okay!
This would be easier to understand:

$app = Yii::app();
$app->user->setState(...)
2 Likes

Yes, you’ve got it right.

Thanks for answering me.