Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cApiAction
  • cApiActionCollection
  • cApiActionlog
  • cApiActionlogCollection
  • cApiArea
  • cApiAreaCollection
  • cApiArticle
  • cApiArticleCollection
  • cApiArticleLanguage
  • cApiArticleLanguageCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiDbfs
  • cApiDbfsCollection
  • cApiFile
  • cApiFileCollection
  • cApiFileInformation
  • cApiFileInformationCollection
  • cApiFrameFile
  • cApiFrameFileCollection
  • cApiFrontendGroup
  • cApiFrontendGroupCollection
  • cApiFrontendGroupMember
  • cApiFrontendGroupMemberCollection
  • cApiFrontendPermission
  • cApiFrontendPermissionCollection
  • cApiFrontendUser
  • cApiFrontendUserCollection
  • cApiGroup
  • cApiGroupCollection
  • cApiGroupMember
  • cApiGroupMemberCollection
  • cApiGroupProperty
  • cApiGroupPropertyCollection
  • cApiInUse
  • cApiInUseCollection
  • cApiIso3166
  • cApiIso3166Collection
  • cApiIso6392
  • cApiIso6392Collection
  • cApiKeyword
  • cApiKeywordCollection
  • cApiLanguage
  • cApiLanguageCollection
  • cApiLayout
  • cApiLayoutCollection
  • cApiMailLog
  • cApiMailLogCollection
  • cApiMailLogSuccess
  • cApiMailLogSuccessCollection
  • cApiMetaTag
  • cApiMetaTagCollection
  • cApiMetaType
  • cApiMetaTypeCollection
  • cApiModule
  • cApiModuleCollection
  • cApiNavMain
  • cApiNavMainCollection
  • cApiNavSub
  • cApiNavSubCollection
  • cApiOnlineUser
  • cApiOnlineUserCollection
  • cApiPathresolveCache
  • cApiPathresolveCacheCollection
  • cApiProperty
  • cApiPropertyCollection
  • cApiRight
  • cApiRightCollection
  • cApiStat
  • cApiStatCollection
  • cApiSystemProperty
  • cApiSystemPropertyCollection
  • cApiTemplate
  • cApiTemplateCollection
  • cApiTemplateConfiguration
  • cApiTemplateConfigurationCollection
  • cApiType
  • cApiTypeCollection
  • cApiUpload
  • cApiUploadCollection
  • cApiUploadMeta
  • cApiUploadMetaCollection
  • cApiUser
  • cApiUserCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the article collection and item class.
  4:  *
  5:  * @package          Core
  6:  * @subpackage       GenericDB_Model
  7:  * @version          SVN Revision $Rev:$
  8:  *
  9:  * @author           Timo Hummel
 10:  * @copyright        four for business AG <www.4fb.de>
 11:  * @license          http://www.contenido.org/license/LIZENZ.txt
 12:  * @link             http://www.4fb.de
 13:  * @link             http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: cInclude('includes', 'functions.str.php');
 19: 
 20: /**
 21:  * Article collection
 22:  *
 23:  * @package Core
 24:  * @subpackage GenericDB_Model
 25:  */
 26: class cApiArticleCollection extends ItemCollection {
 27: 
 28:     public function __construct($select = false) {
 29:         global $cfg;
 30:         parent::__construct($cfg['tab']['art'], 'idart');
 31:         $this->_setItemClass('cApiArticle');
 32: 
 33:         // set the join partners so that joins can be used via link() method
 34:         $this->_setJoinPartner('cApiClientCollection');
 35: 
 36:         if ($select !== false) {
 37:             $this->select($select);
 38:         }
 39:     }
 40: 
 41:     /**
 42:      * Creates an article item entry
 43:      *
 44:      * @param int $idclient
 45:      * @return cApiArticle
 46:      */
 47:     public function create($idclient) {
 48:         $item = parent::createNewItem();
 49: 
 50:         $item->set('idclient', (int) $idclient);
 51:         $item->store();
 52: 
 53:         return $item;
 54:     }
 55: 
 56:     /**
 57:      * Returns list of ids by given client id.
 58:      *
 59:      * @param int $idclient
 60:      * @return array
 61:      */
 62:     public function getIdsByClientId($idclient) {
 63:         $sql = "SELECT idart FROM `%s` WHERE idclient=%d";
 64:         $this->db->query($sql, $this->table, $idclient);
 65:         $list = array();
 66:         while ($this->db->next_record()) {
 67:             $list[] = $this->db->f('idart');
 68:         }
 69:         return $list;
 70:     }
 71: 
 72: }
 73: 
 74: /**
 75:  * Article item
 76:  *
 77:  * @package Core
 78:  * @subpackage GenericDB_Model
 79:  */
 80: class cApiArticle extends Item {
 81: 
 82:     /**
 83:      * Constructor Function
 84:      *
 85:      * @param mixed $mId Specifies the ID of item to load
 86:      */
 87:     public function __construct($mId = false) {
 88:         global $cfg;
 89:         parent::__construct($cfg['tab']['art'], 'idart');
 90:         $this->setFilters(array(), array());
 91:         if ($mId !== false) {
 92:             $this->loadByPrimaryKey($mId);
 93:         }
 94:     }
 95: 
 96:     /**
 97:      * Returns the link to the current object.
 98:      * @param integer $changeLangId change language id for URL (optional)
 99:      * @return string link
100:      */
101:     public function getLink($changeLangId = 0) {
102:         if ($this->isLoaded() === false) {
103:             return '';
104:         }
105: 
106:         $options = array();
107:         $options['idart'] = $this->get('idart');
108:         $options['lang'] = ($changeLangId == 0) ? cRegistry::getLanguageId() : $changeLangId;
109:         if ($changeLangId > 0) {
110:             $options['changelang'] = $changeLangId;
111:         }
112: 
113:         return cUri::getInstance()->build($options);
114:     }
115: 
116: }
117: 
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0