modules/postcollection/models/Category.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Package
Default  

\Postcollection_Model_Category

Package: Postcollection\Models

Properties

>VPropertyprivate$db
Details
Type
n/a
>VPropertyprivate$dbName = "scout_postcollection"
Default value"scout_postcollection"Details
Type
n/a
>VPropertyprivate$dbProj = "scout_project"
Default value"scout_project"Details
Type
n/a
>VPropertyprivate$log
Details
Type
n/a
>VPropertyprivate$prId
Details
Type
n/a
>VPropertyprivate$qsId
Details
Type
n/a
>VPropertyprivate$questionId
Details
Type
n/a

Methods

methodpublic__construct(integer $prId, integer $question_id = false) : void

Parameters
NameTypeDescription
$prIdinteger
$question_idinteger
methodpublicaddCategory(integer $categoryNum, string $categoryName, array $categoryTags) : void

Add new category

Parameters
NameTypeDescription
$categoryNuminteger
$categoryNamestring
$categoryTagsarray
methodpubliccheckNumber(integer $categoryNum) : integer

Check category nuber

Parameters
NameTypeDescription
$categoryNuminteger
Returns
TypeDescription
integer
methodpublicclearCategory(integer $categoryId) : void

To clear the category. All answers, encoded to the category move to not encoded list

Parameters
NameTypeDescription
$categoryIdinteger

// Id of category

methodpublicclearCategoryList(string $categoryIds) : void

Clear all categories from list. All answers, encoded to any categories from this list moved to not encoded list

Parameters
NameTypeDescription
$categoryIdsstring

// coma separated list of category Ids

methodpubliccopyAllFrom( $prId) : integer

Copy all categories from project/questionnaire. When Copy all exists categories has replaced by new

Parameters
NameTypeDescription
$prId
Returns
TypeDescription
integer$error_code
methodpubliccopyFrom(integer $fromProjectId, integer $fromQuestionId) : integer

Copy all categories from project/questionnaire/question. When Copy all exists categories has replaced by new

Parameters
NameTypeDescription
$fromProjectIdinteger
$fromQuestionIdinteger
Returns
TypeDescription
integer$error_code
methodpubliccreateCetegoryFromMix() : void

First criate category from Mix questions

methodpublicdeleteCategory(integer $categoryId, boolean $withClear = true) : integer

Delete category with clearing all encoded of without (in this case error may be raised due to CONSTRAINT)

Parameters
NameTypeDescription
$categoryIdinteger
$withClearboolean
Returns
TypeDescription
integerErrorCode
methodpublicdeleteCategoryList(string $categoryIds, boolean $withClear = true) : integer

Delete category with clearing all encoded of without (in this case error may be raised due to CONSTRAINT)

Parameters
NameTypeDescription
$categoryIdsstring

//coma separated list of category Id

$withClearboolean
Returns
TypeDescription
integerErrorCode
methodpublicfindById(integer $id) : void

First criate category from Mix questions

Parameters
NameTypeDescription
$idinteger

Category ID

methodpublicgetAllTags() : \array[Tags]

Return array of Tags

Returns
TypeDescription
\array[Tags]
methodpublicgetAnswersCount(integer $categoryId) : integer

Return count of answers encoded to choosed categoryId

Parameters
NameTypeDescription
$categoryIdinteger
Returns
TypeDescription
integer
methodpublicgetAnswersCountAll() : \array[categoryId]=countEncodedAnswers

Return array of count of answers indexed by categoryId

Returns
TypeDescription
\array[categoryId]=countEncodedAnswers
methodpublicgetAnswersList(integer $categoryId,  $questionId) : integer

Return answers encoded to choosed categoryId

Parameters
NameTypeDescription
$categoryIdinteger
$questionId
Returns
TypeDescription
integer
methodpublicgetCopyFrom( $question_id) : string

Return copy from P{}Q{}

Parameters
NameTypeDescription
$question_id
Returns
TypeDescription
string
methodpublicgetListAll() : \array[questionId][categoryNumber]=categoryRow

Return list of Caregories for questionnaire. Indexed by questionId and categoryNumber

Returns
TypeDescription
\array[questionId][categoryNumber]=categoryRow
methodpublicgetListByQuestion() : array

Return list of Caregories for one question. Indexed by categoryNumber

Returns
TypeDescription
array
methodpublicgetListExternal( $projectId,  $questionId) : void

Parameters
NameTypeDescription
$projectId
$questionId
methodpublicgetListNumByQuestion() : array

Return number of Caregories for one question. Indexed by categoryNumber

Returns
TypeDescription
array
methodprivategetMainQuestionery(integer $prId) : void

Return ID of Main questionnaire for Project

Parameters
NameTypeDescription
$prIdinteger

ProjectId

methodpublicgetMaxNumber() : integer

Return Max Number of Caregories.

Returns
TypeDescription
integer
methodpublicgetSource( $question_id) : \array[Tags]

Return array of Tags

Parameters
NameTypeDescription
$question_id
Returns
TypeDescription
\array[Tags]
methodpublicmergeCategory(integer $toCategory, integer $fromCategories) : void

Merege two categories

Parameters
NameTypeDescription
$toCategoryinteger
$fromCategoriesinteger
methodpublicupdateCategory(integer $categoryId, integer $categoryNum, string $categoryName, array $categoryTags) : integer

Update category

Parameters
NameTypeDescription
$categoryIdinteger
$categoryNuminteger
$categoryNamestring
$categoryTagsarray
Returns
TypeDescription
integer
Documentation was generated by phpDocumentor 2.8.5.