d8d6118723d331dee2bfe6c3f150c0c464872e2b
[com.zyxware.civiwci.git] / CRM / Wci / BAO / EmbedCode.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM Widget Creation Interface (WCI) Version 1.0 |
5 +--------------------------------------------------------------------+
6 | Copyright Zyxware Technologies (c) 2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM WCI. |
9 | |
10 | CiviCRM WCI is free software; you can copy, modify, and distribute |
11 | it under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007. |
13 | |
14 | CiviCRM WCI is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License along with this program; if not, contact Zyxware |
21 | Technologies at info[AT]zyxware[DOT]com. |
22 +--------------------------------------------------------------------+
23 */
24
25 /**
26 *
27 * @package CRM
28 * @copyright CiviCRM LLC (c) 2004-2013
29 *
30 */
31 require_once 'CRM/Wci/DAO/NewEmbedCode.php';
32
33 class CRM_Wci_BAO_EmbedCode extends CRM_Wci_DAO_EmbedCode {
34
35 /**
36 * Returns widget id for the embed code
37 * Fields : id
38 * @return widget id
39 * @access public
40 */
41 public static function getWidgetId($embed_id) {
42
43 $widgetId = 0;
44 $query = "SELECT * FROM civicrm_wci_embed_code where id=".$embed_id;
45 $params = array();
46 $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_EmbedCode');
47 if ($dao->fetch()) {
48 $widgetId = $dao->widget_id;
49 }
50
51 return $widgetId;
52 }
53 }