Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magic @property before class declaration #7

Closed
aleksanderd opened this issue May 19, 2015 · 2 comments
Closed

magic @property before class declaration #7

aleksanderd opened this issue May 19, 2015 · 2 comments
Assignees
Labels
type:enhancement Enhancement
Milestone

Comments

@aleksanderd
Copy link

Hi!

I just noticed a @Property which described before a class declarations do not rendered to result apidoc htmls :(

For example, even AR-model classes genereated by gii have such @Property comments for each db field, but they do not appers in the docs.

Other case is for AR-relations. If a model have a relation to (for ex) User model, there is a method like:

/**
     * @return \yii\db\ActiveQuery
     */
    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }

While the method $model->getUser() returns ActiveQuery, the magic property $model->user will return User class instance (see why). I think, it is enough reason to describe the method and property separately.

It is possible to put magic @Property comments/descriptions to the result docs indepenently from the getter/setter method?

Thank you!

@brandonkelly
Copy link
Contributor

Ditto for @method! And probably goes without saying, but any [[Class::property]] / [[Class::method()]] cross links should also be able to resolve to doc block-defined @property / @methods too.

@brandonkelly
Copy link
Contributor

Maybe also worth mentioning that there are cases where Yii’s own doc blocks are expecting this feature to exist. For example the [[scenario]] link in yii\base\Model::validate().

@samdark samdark removed this from the 2.0.x milestone Feb 15, 2019
@samdark samdark added this to the 2.1.4 milestone Mar 27, 2020
@samdark samdark closed this as completed in 4910ccd Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

4 participants