contenido\classes\Contenido_Category\Contenido_Category_Articles.class.php
Project:
Contenido Content Management System
Description:
Utility to get articles of category/categories as Article objects.
For now, this object will use objects "Article" and "ArticleCollection".
TODO: Method getNonStartArticlesInCategoryRange() must be fixed so order by condition is working correctly (works now just by category, not overall)
TODO: Somehow avoid ArticleCollection because it is too expensive.
TODO: Also take article specifications into account
TODO: Extend _buildQuery() to accept more order conditions
Requirements:
- Author
- Rudi Bieller
- Con_php_req
- 5.0
- Copyright
- four for business AG
- License
- http://www.contenido.org/license/LIZENZ.txt
- Link
- http://www.4fb.de
- Link
- http://www.contenido.org
- Package
- Contenido
- Since
- file available since contenido release 4.8.9
{@internal
created 2008-08-21
modified 2009-04-09: Timo Trautmann fixed inconsistence bug in getNonStartArticlesInCategory()
modified 2010-10-28 Ortwin Pinke, changed behaviour for $sOrderBy in getNonStartArticlesInCategory()
$Id: Contenido_Category_Articles.class.php 1235 2010-10-28 14:34:04Z oldperl $:
}}
- Version
- 0.2.0
\Contenido_Category_Articles
Package: DefaultBase class for Contenido_Category, Contenido_Categories, Contenido_Category_Language.
- Parent(s)
- \Contenido_Category_Base
- Author
- Rudi Bieller
- Copyright
- four for business AG
{@internal
created 2008-02-15
}}
- Version
- 0.9.0
Properties
Methods



_buildQuery(string $sCategorySelect, string $sOrderBy = "creationdate", string $sOrder = "ASC", int $iOnlineStatus = 2) : \unknown
Builds SQL query to be used to fetch articles of one/more category/categories
ParametersName | Type | Description |
---|
$sCategorySelect | string | Must bei either "idcat = 1" or "idcat IN(1,2,3)". Not very beautiful...
|
---|
$sOrderBy | string | |
---|
$sOrder | string | |
---|
$iOnlineStatus | int | |
---|
Returns 


getArticlesInCategory(int $iCategoryId, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false, int $iOnlineStatus = 2) : array
Return array with article-objects of a category.
ParametersName | Type | Description |
---|
$iCategoryId | int | |
---|
$sOrderBy | string | |
---|
$sOrder | string | |
---|
$bArticleIdAsKey | boolean | |
---|
$iOnlineStatus | int | 0-offline, 1-online, 2-both
|
---|
ReturnsType | Description |
---|
array | An array with Article objects |
ThrowsException | Description |
---|
\Exception | In case of a sql query that crashes |
Details- Access
- public



getArticlesInCategoryRange(array $aCategoryIds, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false, int $iOnlineStatus = 2) : array
Return array with article-objects of a category range.
ParametersName | Type | Description |
---|
$aCategoryIds | array | |
---|
$sOrderBy | string | |
---|
$sOrder | string | |
---|
$bArticleIdAsKey | boolean | |
---|
$iOnlineStatus | int | 0-offline, 1-online, 2-both
|
---|
ReturnsType | Description |
---|
array | An array with Article objects |
ThrowsException | Description |
---|
\Exception | In case of a sql query that crashes or wrong parameters |
Details- Access
- public



getNonStartArticlesInCategory(int $iCategoryId, string $sOrderBy = 'created', string $sOrderDirection = 'DESC', boolean $bArticleIdAsKey = false) : array
Return non start articles of a given category.
Remember to check for idart: if intval(idart) == 0, given idcat has no start article!
ParametersName | Type | Description |
---|
$iCategoryId | int | |
---|
$sOrderBy | string | Valid are fields of tbl. con_art_lang |
---|
$sOrderDirection | string | |
---|
$bArticleIdAsKey | boolean | |
---|
ReturnsType | Description |
---|
array | An array with Article objects if any were found |
Details- Access
- public



getNonStartArticlesInCategoryRange(array $aCategoryIds, string $sOrderBy = 'created', string $sOrderDirection = 'DESC', boolean $bArticleIdAsKey = false) : array
Return non start articles of a given category range.
Remember to check for idart: if intval(idart) == 0, given idcat has no start article!
Sortorder is applied to each category and not overall!
ParametersName | Type | Description |
---|
$aCategoryIds | array | |
---|
$sOrderBy | string | Valid are fields of tbl. con_art_lang |
---|
$sOrderDirection | string | |
---|
$bArticleIdAsKey | boolean | |
---|
ReturnsType | Description |
---|
array | An array with Article objects if any were found
TODO: must be fixed so order by condition is working correctly (works now just by category, not overall) |
Details- Access
- public



getOfflineArticlesInCategory(int $iCategoryId, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array
Return array with article-objects of a category that are offline.
ParametersName | Type | Description |
---|
$iCategoryId | int | |
---|
$sOrderBy | string | |
---|
$sOrder | string | |
---|
$bArticleIdAsKey | boolean | |
---|
ReturnsType | Description |
---|
array | An array with Article objects |
ThrowsException | Description |
---|
\Exception | In case of a sql query that crashes |
Details- Access
- public



getOfflineArticlesInCategoryRange(array $aCategoryIds, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array
Return array with offline article-objects of a category range.
ParametersName | Type | Description |
---|
$aCategoryIds | array | |
---|
$sOrderBy | string | |
---|
$sOrder | string | |
---|
$bArticleIdAsKey | boolean | |
---|
ReturnsType | Description |
---|
array | An array with Article objects |
ThrowsException | Description |
---|
\Exception | In case of a sql query that crashes |
Details- Access
- public



getOnlineArticlesInCategory(int $iCategoryId, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array
Return array with article-objects of a category that are online.
ParametersName | Type | Description |
---|
$iCategoryId | int | |
---|
$sOrderBy | string | |
---|
$sOrder | string | |
---|
$bArticleIdAsKey | boolean | |
---|
ReturnsType | Description |
---|
array | An array with Article objects |
ThrowsException | Description |
---|
\Exception | In case of a sql query that crashes |
Details- Access
- public



getOnlineArticlesInCategoryRange(array $aCategoryIds, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array
Return array with online article-objects of a category range.
ParametersName | Type | Description |
---|
$aCategoryIds | array | |
---|
$sOrderBy | string | |
---|
$sOrder | string | |
---|
$bArticleIdAsKey | boolean | |
---|
ReturnsType | Description |
---|
array | An array with Article objects |
ThrowsException | Description |
---|
\Exception | In case of a sql query that crashes |
Details- Access
- public



getStartArticleInCategory(int $iCategoryId) : \obj
Return start article of a given category.
Remember to check for idart: if intval(idart) == 0, given idcat has no start article!
ParametersName | Type | Description |
---|
$iCategoryId | int | |
---|
ReturnsType | Description |
---|
\obj | Article |
Details- Access
- public



getStartArticlesInCategoryRange(array $aCategoryIds, boolean $bArticleIdAsKey = false) : array
Return start articles of a given category range.
Remember to check for idart: if intval(idart) == 0, given idcat has no start article!
ParametersName | Type | Description |
---|
$aCategoryIds | array | |
---|
$bArticleIdAsKey | boolean | |
---|
ReturnsType | Description |
---|
array | An array with Article objects if any were found |
Details- Access
- public