modules/project/models/SpssExport.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Package
Default  

\Project_Model_SpssExport

Package: Project\Models
Project_Model_SpssExport
Parent(s)
\Scout_Model
Author
Evgeniy  

Constants

>VConstant  SPSS_CATEGORY = "category"
>VConstant  SPSS_BINARY = "binary"

Properties

>VPropertyprivate$Id2Num = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$Parts = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$Vals = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$Vars = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$aPhones = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$addForBinary = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$allocation = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$arrayMixedQuestions = array(3, 7, 8)
Default valuearray(3, 7, 8)Details
Type
n/a
>VPropertyprivate$arrayOpenDateTimes = array(\QuestionType::TYPE_OPEN_DATE, \QuestionType::TYPE_OPEN_DATE_SHORT, \QuestionType::TYPE_OPEN_TIME, \QuestionType::TYPE_OPEN_TIME_SHORT)
Default valuearray(\QuestionType::TYPE_OPEN_DATE, \QuestionType::TYPE_OPEN_DATE_SHORT, \QuestionType::TYPE_OPEN_TIME, \QuestionType::TYPE_OPEN_TIME_SHORT)Details
Type
n/a
>VPropertyprivate$arrayOpenQuestions = array(2, 13, 14, 15, 16, 17, 26, 29, 30)
Default valuearray(2, 13, 14, 15, 16, 17, 26, 29, 30)Details
Type
n/a
>VPropertyprivate$categories = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$categoryType = \Project_Model_SpssExport::SPSS_CATEGORY
Default value\Project_Model_SpssExport::SPSS_CATEGORYDetails
Type
n/a
>VPropertyprivate$cntPhones = 0
Default value0Details
Type
n/a
>VPropertyprivate$coords = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$db
Details
Type
n/a
>VPropertyprivate$encodedAnswers = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$encoding = 0
Default value0Details
Type
n/a
>VPropertyprivate$exportMode = "send"
Default value"send"Details
Type
n/a
>VPropertypublic$filename
Details
Type
n/a
>VPropertyprivate$filenameData = ""
Default value""Details
Type
n/a
>VPropertyprivate$filenameSps = ""
Default value""Details
Type
n/a
>VPropertyprivate$filenameXlsCSV = ""
Default value""Details
Type
n/a
>VPropertyprivate$filenameXlsData = ""
Default value""Details
Type
n/a
>VPropertyprivate$filenameXlsLabels = ""
Default value""Details
Type
n/a
>VPropertyprivate$filenameZip = ""
Default value""Details
Type
n/a
>VPropertypublic$inter_ids
Details
Type
n/a
>VPropertyprivate$maccabiLines = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$maxCategorizedAnswers = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$maxCountAnswers = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$naAnswers = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$naList = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$name
Details
Type
n/a
>VPropertyprivate$personalData = array()
Default valuearray()Details
Type
n/a
>VPropertypublic$proj
Details
Type
n/a
>VPropertyprivate$proj_id
Details
Type
n/a
>VPropertyprivate$proj_prefix
Details
Type
n/a
>VPropertyprivate$project
Details
Type
n/a
>VPropertyprivate$proofedAnswers = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$qs_id
Details
Type
n/a
>VPropertyprivate$qs_name
Details
Type
n/a
>VPropertyprivate$questions = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$respondentAnswersArray = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$respondentAnswersLines = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$spsBody = ""
Default value""Details
Type
n/a
>VPropertyprivate$strs = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$toNothing = array(" ", "\r", "\n", "\t")
Default valuearray(" ", "\r", "\n", "\t")Details
Type
n/a
>VPropertyprivate$toPipe = array()
Default valuearray()Details
Type
n/a
>VPropertypublic$translateLang
Details
Type
n/a
>VPropertyprivate$xperToCode = 4
Default value4Details
Type
n/a

Methods

methodpublic__construct( $inter_ids,  $proj_id,  $filename,  $qs_id, integer $xperToCode = 999) : void

Parameters
NameTypeDescription
$inter_ids
$proj_id
$filename
$qs_id
$xperToCodeinteger
Throws
ExceptionDescription
\Zend_Exception
methodprivatecalculateSurveyLengths() : array

Returns
TypeDescription
array
methodpublicgenerateData(string $type = "") : void

Generate Lines with respondents answers

Parameters
NameTypeDescription
$typestring
methodpublicgenerateHeaderPart() : string

Generate Header file part

Returns
TypeDescription
string
methodpublicgenerateSPS(string $type) : void

Generate text of SPS header file

Parameters
NameTypeDescription
$typestring

("spss" | "xls" |"bin")

methodpublicgenerateValPart() : void

Generate VAL block of SPS file

methodpublicgenerateVarPart() : void

Generate VAR block of SPS file

methodprivategetCodes() : array

get al code for current project

Returns
TypeDescription
array
methodpublicgetCoordList() : array

Returns
TypeDescription
array
methodprivategetMaxAnswersCount() : void

Calculate count of each answers. We use it for create correct count mX for multianswers question

methodprivategetMaxCategorizedAnswersCount() : void

Calculate count of categorized answers. We use it for create correct count mX for multianswers question with encoding

methodpublicgetNAList() : array

Get list of answers with na

Returns
TypeDescription
array
methodpublicgetPersonalData(integer $projType = 0) : \Array[id]=[name,address]

Get personal data for project

Parameters
NameTypeDescription
$projTypeinteger
Returns
TypeDescription
\Array[id]=[name,address]
methodprivategetPhones() : array

Returns
TypeDescription
array
methodpublicgetQuestionsList() : array

Get question slist

Returns
TypeDescription
array
methodpublicgetStrList() : array

Returns
TypeDescription
array
methodpublicsave(string $type = "spss", integer $encoding = 0) : array

Process export save data

Parameters
NameTypeDescription
$typestring
$encodinginteger
Returns
TypeDescription
array
Throws
ExceptionDescription
\Exception
methodpublicsaveCSV(integer $encoding = 0) : array

Save CST type

Parameters
NameTypeDescription
$encodinginteger
Returns
TypeDescription
array
methodpublicsaveCallLog() : \[type]

Save call log

Returns
TypeDescription
\[type][description]
methodpublicsaveLog() : void

Save spss export log

methodpublicsaveOpen() : array

save open type

Returns
TypeDescription
array
methodpublicsaveSummary() : void

Save sunnary of project

Throws
ExceptionDescription
\Exception
\Zend_Exception
methodpublicsetCategoryType( $type) : void

Parameters
NameTypeDescription
$type

::SPSS_CATEGORY | ::SPSS_BINARY

methodpublicsetExportLang( $lang) : void

Parameters
NameTypeDescription
$lang
methodpublicsetExportMode( $exportMode) : void

Parameters
NameTypeDescription
$exportMode
methodprivatetoExportFormat(array $respondentAnswers) : \array[respondent_id][question_num][answer_index]=(array)answer

Proceed array with respondent answers to format useful for continue export

Parameters
NameTypeDescription
$respondentAnswersarray
Returns
TypeDescription
\array[respondent_id][question_num][answer_index]=(array)answer
methodprivatetoLabels(array $listOfColumns = array()) : array

convert colums to labels

Parameters
NameTypeDescription
$listOfColumnsarray
Returns
TypeDescription
array
methodprivatetoSPSFormat(integer $q_type, boolean $encoding = false) : array

Parameters
NameTypeDescription
$q_typeinteger
$encodingboolean
Returns
TypeDescription
array
Documentation was generated by phpDocumentor 2.8.5.