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: * Constructor to create an instance of this class.
26: *
27: * @param bool $select [optional]
28: * where clause to use for selection (see ItemCollection::select())
29: *
30: * @throws cDbException
31: * @throws cInvalidArgumentException
32: */
33: public function __construct($select = false) {
34: parent::__construct(cRegistry::getDbTableName('iso_3166'), 'iso');
35: $this->_setItemClass('cApiIso3166');
36:
37: if ($select !== false) {
38: $this->select($select);
39: }
40: }
41: }
42:
43: /**
44: * Iso 3166 item
45: *
46: * @package Core
47: * @subpackage GenericDB_Model
48: */
49: class cApiIso3166 extends Item {
50: /**
51: * Constructor to create an instance of this class.
52: *
53: * @param mixed $mId [optional]
54: * Specifies the ID of item to load
55: *
56: * @throws cDbException
57: * @throws cException
58: */
59: public function __construct($mId = false) {
60: parent::__construct(cRegistry::getDbTableName('iso_3166'), 'iso');
61: $this->setFilters(array(), array());
62: if ($mId !== false) {
63: $this->loadByPrimaryKey($mId);
64: }
65: }
66: }
67: