View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 12479 | Bug reports | Documentation | public | 2017-06-20 10:57 | 2026-11-19 22:23 |
| Reporter | DenisChenu | Assigned To | |||
| Priority | none | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Summary | 12479: Add DB property in models | ||||
| Description | DB property can be added in model to set default value : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Survey.php#L99 | ||||
| Steps To Reproduce | Maybe start by survey : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Survey.php#L19 And set all of this in real @property /**
I'm totally unsure of the result ;) | ||||
| Additional Information | I have to update too http://api.limesurvey.org/classes/remotecontrol_handle.html#method_set_survey_properties but link \Survey must go to Survey with properties | ||||
| Tags | No tags attached. | ||||
| Bug heat | 6 | ||||
| Complete LimeSurvey version number (& build) | |||||
| I will donate to the project if issue is resolved | |||||
| Browser | |||||
| Database type & version | |||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | |||||
| Git branch / Pull Request URL | |||||
|
And add all the inherited doc too |
|
|
Ok, thanks to Carsten : link is https://api.limesurvey.org/classes/Survey.html#property_format Then : seems better with @property than with @var . I'i unsure if we can use @property fo format (for example) because need a default ? I make a test . @t6nnp6nn : fo you have an advice ? |
|
|
I'm not sure What you want to achieve? by default gii does not generate it in suggested way for Yii1 nor Yii2. It only generates the Class phpDoc with @property. defining as class properties like /**
... changes how yii treats the properties in a way. EG: in survey model we have a * @property string $state now state can be accessed dierectly via $oSurvey->state But. If you add to class public $state; It is not the case with DB properties but anyway - it does not seem to be the default yii way. |
|
|
I just want something better here :) See https://api.limesurvey.org/classes/Survey.html#property_format and https://api.limesurvey.org/classes/Survey.html#property_htmlemail Using property : loosing string ? Or i made an error ? https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Survey.php#L96 I test with @var string $format A : All in one, G : Group by group, Q : question by question */ Maybe /*
? in description ? |
|
|
see put the docs in class docs and set default values in init() ? |
|
|
Don't like it, but if auto doc is better. @c_schmitz : https://api.limesurvey.org is up to date ? |
|
|
Don't like it why? |
|
|
Think it's more clear in class directly when looking at file |
|
|
What I suggest is the Yii way as far as I understand. As I said - defining a class property as you suggested makes Yii actually work differently (not just look differently) |
|
|
But we can always use use $Survey= new Survey; It's the DB property here :). I talk currently only for db property :). |
|
|
I also talk regarding the DB properties :) and by DB properties I mean the class properties that directly relate to DB columns. |
|
|
Then : DB properties are publicly accessible, no ? |
|
|
Yes, should be by Yii design |
|
|
Oh right, it's dynamic properties/attribute. You convinced me : “ put the docs in class docs and set default values in init()” seems the best solution :) |
|
|
:D |
|
|
In LimeSurvey 7 the database columns of the models are documented with @property tags in the class docblocks, as agreed here (started with PR #743). Closing as done. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2017-06-20 10:57 | DenisChenu | New Issue | |
| 2017-06-20 10:57 | DenisChenu | Status | new => assigned |
| 2017-06-20 10:57 | DenisChenu | Assigned To | => Mazi |
| 2017-06-20 10:58 | DenisChenu | Assigned To | Mazi => |
| 2017-06-20 10:58 | DenisChenu | Status | assigned => new |
| 2017-06-20 11:00 | DenisChenu | Note Added: 43950 | |
| 2017-06-26 12:15 | DenisChenu | Assigned To | => user14106 |
| 2017-06-26 12:15 | DenisChenu | Status | new => feedback |
| 2017-06-26 12:15 | DenisChenu | Note Added: 43976 | |
| 2017-07-03 13:50 |
|
Note Added: 44012 | |
| 2017-07-04 00:35 | DenisChenu | Note Added: 44019 | |
| 2017-07-04 00:35 | DenisChenu | Status | feedback => assigned |
| 2017-07-04 00:35 | DenisChenu | Status | assigned => feedback |
| 2017-07-04 08:43 |
|
Note Added: 44021 | |
| 2017-07-04 10:45 | DenisChenu | Note Added: 44022 | |
| 2017-07-04 10:45 | DenisChenu | Status | feedback => assigned |
| 2017-07-04 10:50 |
|
Note Added: 44023 | |
| 2017-07-04 11:13 | DenisChenu | Note Added: 44024 | |
| 2017-07-04 11:23 |
|
Note Added: 44025 | |
| 2017-07-04 11:32 | DenisChenu | Note Added: 44026 | |
| 2017-07-04 11:43 |
|
Note Added: 44027 | |
| 2017-07-04 12:34 | DenisChenu | Note Added: 44028 | |
| 2017-07-04 12:38 |
|
Note Added: 44029 | |
| 2017-07-04 12:59 | DenisChenu | Note Added: 44030 | |
| 2017-07-04 13:10 |
|
Note Added: 44031 | |
| 2017-07-04 13:49 |
|
Note Added: 44032 | |
| 2026-11-19 22:23 | c_schmitz | Note Added: 87732 | |
| 2026-11-19 22:23 | c_schmitz | Bug heat | 4 => 6 |
| 2026-11-19 22:23 | c_schmitz | Status | assigned => closed |
| 2026-11-19 22:23 | c_schmitz | Resolution | open => fixed |