Questionnaire class definition

This class has been auto-generated by the Doctrine ORM Framework

package Webenq_Models
author Bart Huttinga
subpackage
version SVN: $Id: Builder.php,v 1.2 2011/07/12 13:39:03 bart Exp $

 Methods

Sets the questionnaire title for a given language

addQuestionnaireTitle(string $language, string $title) : \Webenq_Model_Questionnaire
fluent This method is part of a fluent interface and will return the same instance

Parameters

$language

string

The language to set the title for

$title

string

The questionnaire title for the given language

Returns

Sets the questionnaire titles for every language

addQuestionnaireTitles(array $titles) : \Webenq_Model_Questionnaire
fluent This method is part of a fluent interface and will return the same instance

Parameters

$titles

array

Array with language codes as keys and questionnaire titles as values

Returns

countAnsweredQuestions()

countAnsweredQuestions(\Webenq_Model_Respondent $respondent) 

Parameters

$respondent

Fills questionnaire properties with data in the given array

fromArray(array $array, bool $deep) 
see \toArray()
see \Doctrine_Record::fromArray()

Parameters

$array

array

$deep

bool

getAnsweredQuestions()

getAnsweredQuestions(\Webenq_Model_Respondent $respondent) 
deprecated
todo This method has been renamed to countAnsweredQuestions, so this one should be removed when all calls have been renamed as well

Parameters

$respondent

getCurrentPage()

getCurrentPage(\Webenq_Model_Questionnaire $questionaire, \Webenq_Model_Respondent $respondent) 
Static

Parameters

$questionaire

$respondent

Returns an array with the question text in the first row and the answers in the following rows.

getDataAsSpreadsheetArray() : array

Each row contains the answers of one respondent.

Returns

array

Returns an array with ids as keys and titles as values

getKeyValuePairs(string $language) : array
Static

If a language is provided the corresponding translation of the title is used. If not provided, the current language is used. Else one of the preferred languages is used. Otherwise just any language.

Parameters

$language

string

Returns

array

Get the published state of a questionnaire

getPublishedState() : array

active is defined as: the questionnaire is activated and current time is between start and end date

Returns

array

Returns a questionnaire, based on the given id and language.

getQuestionnaire(int $id, string $language, int $page, \Webenq_Model_Respondent $respondent, $includeAnswers) : \Webenq_Model_Questionnaire
Static

Parameters

$id

int

$language

string

@obsolete?

$page

int

@obsolete

$respondent

\Webenq_Model_Respondent

@obsolete

$includeAnswers

Returns

getQuestionnaires()

getQuestionnaires($category, $id) 
Static

Parameters

$category

$id

getQuestionsAndAnswersAsArray()

getQuestionsAndAnswersAsArray() 

Returns the respondents for the current questionnaire

getRespondents() : \Doctrine_Collection

Returns

\Doctrine_Collection

Gets the questionnaire title in the given, current or preferred language.

getTitle(string $language) : string

Creates an empty translation if nothing was found and the questionnaire exists in the database.

Parameters

$language

string

Returns

stringTitle or empty string

Returns the total number of pages for the current questionnaire

getTotalPages(int $id) : int
Static

Parameters

$id

int

ID of the questionnaire

Returns

intNumber of pages

getTotalQuestions()

getTotalQuestions() 

Returns an xform

getXform() : \DOMDocument

Returns

Returns xform data

getXformData() : \DOMDocument

Returns

setTableDefinition()

setTableDefinition() 
Inherited
inherited_from \Webenq_Model_Base_Questionnaire::setTableDefinition()

setUp()

setUp() 
Inherited
inherited_from \Webenq_Model_Base_Questionnaire::setUp()

Fills array with questionnaire properties, and makes translations of the field title available for form element "multi-lingual with default language choice":

toArray(bool $deep, bool $prefixKey) : array
  • result['title']['default_language'] maps to the property 'default_language'
  • result['title']['en'] contains the English version, etc
see \fromArray()
see \Doctrine_Record::fromArray()

Parameters

$deep

bool

$prefixKey

bool

Not used

Returns

array

_getAnswerCell()

_getAnswerCell(\Webenq_Model_QuestionnaireQuestion $parent, \Webenq_Model_Respondent $respondent, array $row) 

Parameters

$parent

$respondent

$row

_getQuestionCell()

_getQuestionCell(\Webenq_Model_QuestionnaireQuestion $parent, array $row) 

Parameters

$parent

$row