1: <?php
2: /**
3: * This file contains the ISO3166 collection and item class.
4: *
5: * @package Core
6: * @subpackage GenericDB_Model
7: * @version SVN Revision $Rev:$
8: *
9: * @author Alexander Scheider
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: /**
19: * Isocode 3166 collection
20: *
21: * @package Core
22: * @subpackage GenericDB_Model
23: */
24: class cApiIso3166Collection extends ItemCollection {
25:
26: /**
27: * Create a new collection of items.
28: *
29: * @param string $select where clause to use for selection (see
30: * ItemCollection::select())
31: */
32: public function __construct($select = false) {
33: parent::__construct(cRegistry::getDbTableName('iso_3166'), 'iso');
34: $this->_setItemClass('cApiIso3166');
35:
36: if ($select !== false) {
37: $this->select($select);
38: }
39: }
40: }
41:
42: /**
43: * Iso 3166 item
44: *
45: * @package Core
46: * @subpackage GenericDB_Model
47: */
48: class cApiIso3166 extends Item {
49:
50: /**
51: * Constructor Function
52: *
53: * @param mixed $mId Specifies the ID of item to load
54: */
55: public function __construct($mId = false) {
56: parent::__construct(cRegistry::getDbTableName('iso_3166'), 'iso');
57: $this->setFilters(array(), array());
58: if ($mId !== false) {
59: $this->loadByPrimaryKey($mId);
60: }
61: }
62: }
63: