contenido\classes\Contenido_Category\Contenido_Category_Articles.class.php

Show: PublicProtectedPrivateinherited
Table of Contents
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: Default
Base 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

>VPropertyprotectedarray $aCfg
inherited
Inherited from: \Contenido_Category_Base::$$aCfg
Details
Type
array
Access
protected  
Inherited_from
\Contenido_Category_Base::$$aCfg  
>VPropertyprotectedboolean $bDbg
inherited
Inherited from: \Contenido_Category_Base::$$bDbg
Details
Type
boolean
Access
protected  
Inherited_from
\Contenido_Category_Base::$$bDbg  
>VPropertyprotected$iClient
Details
Type
n/a
>VPropertyprotected$iLang
Details
Type
n/a
>VPropertyprotected$oArticle
Details
Type
n/a
>VPropertyprotected$oArticleCollection
Details
Type
n/a
>VPropertyprotected\obj $oDb
inherited
Inherited from: \Contenido_Category_Base::$$oDb
Details
Type
\obj
Access
protected  
Inherited_from
\Contenido_Category_Base::$$oDb  
>VPropertyprotected\obj $oDbg
inherited
Inherited from: \Contenido_Category_Base::$$oDbg
Details
Type
\obj
Access
protected  
Inherited_from
\Contenido_Category_Base::$$oDbg  
>VPropertyprotectedstring $sDbgMode
inherited
Inherited from: \Contenido_Category_Base::$$sDbgMode
Details
Type
string
Access
protected  
Inherited_from
\Contenido_Category_Base::$$sDbgMode  

Methods

methodpublic__construct(\DB_Contenido $oDb, array $aCfg, int $iClient, int $iLang) : void

Constructor

Parameters
NameTypeDescription
$oDb\DB_Contenido
$aCfgarray
$iClientint
$iLangint
Details
Access
public  
Author
Rudi Bieller  
methodprivate_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

Parameters
NameTypeDescription
$sCategorySelectstring

Must bei either "idcat = 1" or "idcat IN(1,2,3)". Not very beautiful...

$sOrderBystring
$sOrderstring
$iOnlineStatusint
Returns
TypeDescription
\unknown
methodpublicgetArticlesInCategory(int $iCategoryId, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false, int $iOnlineStatus = 2) : array

Return array with article-objects of a category.

Parameters
NameTypeDescription
$iCategoryIdint
$sOrderBystring
$sOrderstring
$bArticleIdAsKeyboolean
$iOnlineStatusint

0-offline, 1-online, 2-both

Returns
TypeDescription
arrayAn array with Article objects
Throws
ExceptionDescription
\ExceptionIn case of a sql query that crashes
Details
Access
public  
methodpublicgetArticlesInCategoryRange(array $aCategoryIds, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false, int $iOnlineStatus = 2) : array

Return array with article-objects of a category range.

Parameters
NameTypeDescription
$aCategoryIdsarray
$sOrderBystring
$sOrderstring
$bArticleIdAsKeyboolean
$iOnlineStatusint

0-offline, 1-online, 2-both

Returns
TypeDescription
arrayAn array with Article objects
Throws
ExceptionDescription
\ExceptionIn case of a sql query that crashes or wrong parameters
Details
Access
public  
methodpublicgetCategoryByArticleId( $iArticleId) : void

Parameters
NameTypeDescription
$iArticleId
methodpublicgetClient() : void

methodpublicgetLang() : void

methodpublicgetNonStartArticlesInCategory(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!

Parameters
NameTypeDescription
$iCategoryIdint
$sOrderBystring

Valid are fields of tbl. con_art_lang

$sOrderDirectionstring
$bArticleIdAsKeyboolean
Returns
TypeDescription
arrayAn array with Article objects if any were found
Details
Access
public  
methodpublicgetNonStartArticlesInCategoryRange(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!

Parameters
NameTypeDescription
$aCategoryIdsarray
$sOrderBystring

Valid are fields of tbl. con_art_lang

$sOrderDirectionstring
$bArticleIdAsKeyboolean
Returns
TypeDescription
arrayAn 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  
methodpublicgetOfflineArticlesInCategory(int $iCategoryId, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array

Return array with article-objects of a category that are offline.

Parameters
NameTypeDescription
$iCategoryIdint
$sOrderBystring
$sOrderstring
$bArticleIdAsKeyboolean
Returns
TypeDescription
arrayAn array with Article objects
Throws
ExceptionDescription
\ExceptionIn case of a sql query that crashes
Details
Access
public  
methodpublicgetOfflineArticlesInCategoryRange(array $aCategoryIds, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array

Return array with offline article-objects of a category range.

Parameters
NameTypeDescription
$aCategoryIdsarray
$sOrderBystring
$sOrderstring
$bArticleIdAsKeyboolean
Returns
TypeDescription
arrayAn array with Article objects
Throws
ExceptionDescription
\ExceptionIn case of a sql query that crashes
Details
Access
public  
methodpublicgetOnlineArticlesInCategory(int $iCategoryId, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array

Return array with article-objects of a category that are online.

Parameters
NameTypeDescription
$iCategoryIdint
$sOrderBystring
$sOrderstring
$bArticleIdAsKeyboolean
Returns
TypeDescription
arrayAn array with Article objects
Throws
ExceptionDescription
\ExceptionIn case of a sql query that crashes
Details
Access
public  
methodpublicgetOnlineArticlesInCategoryRange(array $aCategoryIds, string $sOrderBy = "creationdate", string $sOrder = "ASC", boolean $bArticleIdAsKey = false) : array

Return array with online article-objects of a category range.

Parameters
NameTypeDescription
$aCategoryIdsarray
$sOrderBystring
$sOrderstring
$bArticleIdAsKeyboolean
Returns
TypeDescription
arrayAn array with Article objects
Throws
ExceptionDescription
\ExceptionIn case of a sql query that crashes
Details
Access
public  
methodpublicgetStartArticleInCategory(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!

Parameters
NameTypeDescription
$iCategoryIdint
Returns
TypeDescription
\objArticle
Details
Access
public  
methodpublicgetStartArticlesInCategoryRange(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!

Parameters
NameTypeDescription
$aCategoryIdsarray
$bArticleIdAsKeyboolean
Returns
TypeDescription
arrayAn array with Article objects if any were found
Details
Access
public  
methodpublicsetClient( $iClient) : void

Parameters
NameTypeDescription
$iClient
methodpublicsetDebug(boolean $bDebug = true, string $sDebugMode = 'visible') : void
inherited

Set internal property for debugging on/off and choose appropriate debug object

Inherited from: \Contenido_Category_Base::setDebug()
Parameters
NameTypeDescription
$bDebugboolean
$sDebugModestring
Details
Access
public  
Author
Rudi Bieller  
methodpublicsetLang( $iLang) : void

Parameters
NameTypeDescription
$iLang
Documentation was generated by phpDocumentor 2.0.0a12.