1: <?php
2:
3: /**
4: * This file contains the ISO3166 collection and item class.
5: *
6: * @package Core
7: * @subpackage GenericDB_Model
8: * @author Alexander Scheider
9: * @copyright four for business AG <www.4fb.de>
10: * @license http://www.contenido.org/license/LIZENZ.txt
11: * @link http://www.4fb.de
12: * @link http://www.contenido.org
13: */
14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: /**
18: * Isocode 3166 collection
19: *
20: * @package Core
21: * @subpackage GenericDB_Model
22: */
23: class cApiIso3166Collection extends ItemCollection {
24:
25: /**
26: * Create a new collection of items.
27: *
28: * @param string $select [optional]
29: * where clause to use for selection (see ItemCollection::select())
30: */
31: public function __construct($select = false) {
32: parent::__construct(cRegistry::getDbTableName('iso_3166'), 'iso');
33: $this->_setItemClass('cApiIso3166');
34:
35: if ($select !== false) {
36: $this->select($select);
37: }
38: }
39: }
40:
41: /**
42: * Iso 3166 item
43: *
44: * @package Core
45: * @subpackage GenericDB_Model
46: */
47: class cApiIso3166 extends Item {
48:
49: /**
50: * Constructor Function
51: *
52: * @param mixed $mId [optional]
53: * 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: