Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ContactWebFormEntry.php
1 <?php
2  /*********************************************************************************
3  * Zurmo is a customer relationship management program developed by
4  * Zurmo, Inc. Copyright (C) 2017 Zurmo Inc.
5  *
6  * Zurmo is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  *
13  * Zurmo is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  *
23  * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
24  * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
25  *
26  * The interactive user interfaces in original and modified versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  *
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the Zurmo
32  * logo and Zurmo copyright notice. If the display of the logo is not reasonably
33  * feasible for technical reasons, the Appropriate Legal Notices must display the words
34  * "Copyright Zurmo Inc. 2017. All rights reserved".
35  ********************************************************************************/
36 
37  class ContactWebFormEntry extends Item
38  {
39  const STATUS_SUCCESS = 1;
40 
41  const STATUS_ERROR = 2;
42 
43  const STATUS_SUCCESS_MESSAGE = 'Success';
44 
45  const STATUS_ERROR_MESSAGE = 'Error';
46 
47  const HASH_INDEX_HIDDEN_FIELD = 'hashIndex';
48 
53  public static function getByName($name)
54  {
55  return ZurmoModelSearch::getModelsByFullName('ContactWebFormEntry', $name);
56  }
57 
62  protected static function translatedAttributeLabels($language)
63  {
64  return parent::translatedAttributeLabels($language);
65  }
66 
70  public static function getModuleClassName()
71  {
72  return 'ContactWebFormsModule';
73  }
74 
79  protected static function getLabel($language = null)
80  {
81  return Zurmo::t('ContactWebFormsModule', 'Contact Web Form Entry', array(), null, $language);
82  }
83 
88  protected static function getPluralLabel($language = null)
89  {
90  return Zurmo::t('ContactWebFormsModule', 'Contact Web Form Entries', array(), null, $language);
91  }
92 
96  public static function canSaveMetadata()
97  {
98  return true;
99  }
100 
104  public static function getDefaultMetadata()
105  {
106  $metadata = parent::getDefaultMetadata();
107  $metadata[__CLASS__] = array(
108  'members' => array(
109  'serializedData',
110  'status',
111  'message',
112  'hashIndex'
113  ),
114  'relations' => array(
115  'contact' => array(static::HAS_ONE, 'Contact'),
116  'contactWebForm' => array(static::HAS_ONE, 'ContactWebForm', static::NOT_OWNED,
117  static::LINK_TYPE_SPECIFIC, 'entries'),
118  ),
119  'rules' => array(
120  array('serializedData', 'type', 'type' => 'string'),
121  array('status', 'type', 'type' => 'integer'),
122  array('message', 'type', 'type' => 'string'),
123  array('hashIndex', 'type', 'type' => 'string'),
124  ),
125  'elements' => array(
126  ),
127  'defaultSortAttribute' => 'status',
128  'noAudit' => array('serializedData', 'hashIndex'),
129  );
130  return $metadata;
131  }
132 
136  public static function isTypeDeletable()
137  {
138  return true;
139  }
140 
144  public static function getRollUpRulesType()
145  {
146  return 'ContactWebFormEntry';
147  }
148 
152  public static function hasReadPermissionsOptimization()
153  {
154  return true;
155  }
156 
161  public static function getByHashIndex($hashIndex)
162  {
163  $modelClassName = get_called_class();
164  $tableName = $modelClassName::getTableName();
165  $columnName = self::getColumnNameByAttribute('hashIndex');
166  $beans = ZurmoRedBean::find($tableName, "$columnName = '$hashIndex'");
167  assert('count($beans) <= 1');
168  if (count($beans) == 0)
169  {
170  return null;
171  }
172  else
173  {
174  return static::makeModel(end($beans), $modelClassName);
175  }
176  }
177  }
178 ?>
static getModelsByFullName($modelClassName, $fullName)
static isTypeDeletable()
static getByName($name)
static canSaveMetadata()
static hasReadPermissionsOptimization()
static getByHashIndex($hashIndex)
static getRollUpRulesType()
static getDefaultMetadata()
static getLabel($language=null)
static getPluralLabel($language=null)
static translatedAttributeLabels($language)
Definition: Item.php:37
static getModuleClassName()
Generated on Thu Nov 26 2020 07:10:42
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.