Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

ServeyDynamic should always return a relation to Survey

  • bismark
  • bismark's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 5 months ago - 5 years 5 months ago #175590 by bismark
I use the following code to get a response record of a survey:
Code:
$surveyId = intval(Yii::app()->request->getParam('surveyId', 0));
$response = SurveyDynamic::model($surveyId)->findByPk(1);
var_dump($response->attributes);

now it would be fine to get the corresponding Survey by
Code:
$survey = $response->survey;

In SurveyDynamic-Model I only have access to the survey
Code:
if ($this->getbHaveToken()) {}

why this?
Last edit: 5 years 5 months ago by bismark. Reason: typo
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #175601 by DenisChenu

why this?

because we never need it

But you have it in Response : github.com/LimeSurvey/LimeSurvey/blob/c4...ls/Response.php#L174

In general i prefer to use Reponse

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • bismark
  • bismark's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 5 months ago #175623 by bismark
ok, ResponseModel has such a relation
that helped me
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose