| 1 | <?php
|
| 2 |
|
| 3 | /**
|
| 4 | * =======================================
|
| 5 | * ###################################
|
| 6 | * SWIFT Framework
|
| 7 | *
|
| 8 | * @package SWIFT
|
| 9 | * @author Kayako Infotech Ltd.
|
| 10 | * @copyright Copyright (c) 2001-2009, Kayako Infotech Ltd.
|
| 11 | * @license http://www.kayako.com/license
|
| 12 | * @link http://www.kayako.com
|
| 13 | * @filesource
|
| 14 | * ###################################
|
| 15 | * =======================================
|
| 16 | */
|
| 17 |
|
| 18 | /**
|
| 19 | * The CustomFieldGroup API Controller
|
| 20 | *
|
| 21 | * @author Ruchi Kothari
|
| 22 | */
|
| 23 | class Controller_CustomFieldGroup extends Controller_api implements SWIFT_REST_Interface
|
| 24 | {
|
| 25 |
|
| 26 | /**
|
| 27 | * Constructor
|
| 28 | *
|
| 29 | * @author Ruchi Kothari
|
| 30 | * @return bool "true" on Success, "false" otherwise
|
| 31 | */
|
| 32 | public function __construct()
|
| 33 | {
|
| 34 | parent::__construct();
|
| 35 |
|
| 36 | return true;
|
| 37 | }
|
| 38 |
|
| 39 | /**
|
| 40 | * Destructor
|
| 41 | *
|
| 42 | * @author Ruchi Kothari
|
| 43 | * @return bool "true" on Success, "false" otherwise
|
| 44 | */
|
| 45 | public function __destruct()
|
| 46 | {
|
| 47 | parent::__destruct();
|
| 48 |
|
| 49 | return true;
|
| 50 | }
|
| 51 |
|
| 52 | /**
|
| 53 | * GetList
|
| 54 | *
|
| 55 | * @author Ruchi Kothari
|
| 56 | * @return bool "true" on Success, "false" otherwise
|
| 57 | * @throws SWIFT_Exception If the Class is not Loaded
|
| 58 | */
|
| 59 | public function GetList()
|
| 60 | {
|
| 61 | if (!$this->GetIsClassLoaded()) {
|
| 62 | throw new SWIFT_Exception(SWIFT_CLASSNOTLOADED);
|
| 63 |
|
| 64 | return false;
|
| 65 | }
|
| 66 | $this->Database->Query("SELECT * FROM " . TABLE_PREFIX . "customfieldgroups ORDER BY displayorder ASC");
|
| 67 |
|
| 68 | $this->XML->AddParentTag('customfieldgroups');
|
| 69 | while ($this->Database->NextRecord()) {
|
| 70 | $this->XML->AddTag('customfieldgroup', '', $this->Database->Record);
|
| 71 | }
|
| 72 | $this->XML->EndParentTag('customfieldgroups');
|
| 73 |
|
| 74 | $this->XML->EchoXML();
|
| 75 |
|
| 76 | return true;
|
| 77 | }
|
| 78 | }
|
| 79 | ?> |