Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ReportModelTestItem.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 
38  {
39  public function __toString()
40  {
41  try
42  {
43  $fullName = $this->getFullName();
44  if ($fullName == '')
45  {
46  return Zurmo::t('Core', '(Unnamed)');
47  }
48  return $fullName;
49  }
51  {
52  return '';
53  }
54  }
55 
60  protected static function getModifiedSignalAttribute()
61  {
62  return 'lastName';
63  }
64 
65  public function getFullName()
66  {
67  $fullName = array();
68  if ($this->firstName != '')
69  {
70  $fullName[] = $this->firstName;
71  }
72  if ($this->lastName != '')
73  {
74  $fullName[] = $this->lastName;
75  }
76  return join(' ' , $fullName);
77  }
78 
79  protected static function translatedAttributeLabels($language)
80  {
81  return array_merge(parent::translatedAttributeLabels($language),
82  array(
83  'likeContactState' => 'A name for a state'
84  )
85  );
86  }
87 
88  public static function getDefaultMetadata()
89  {
90  $metadata = parent::getDefaultMetadata();
91  $metadata[__CLASS__] = array(
92  'members' => array(
93  'firstName',
94  'lastName',
95  'boolean',
96  'date',
97  'dateTime',
98  'float',
99  'integer',
100  'nonReportable',
101  'phone',
102  'string',
103  'textArea',
104  'url',
105  ),
106  'relations' => array(
107  'currencyValue' => array(static::HAS_ONE, 'CurrencyValue', static::OWNED),
108  'dropDown' => array(static::HAS_ONE, 'OwnedCustomField', static::OWNED,
109  static::LINK_TYPE_SPECIFIC, 'dropDown'),
110  'dropDown2' => array(static::HAS_ONE, 'OwnedCustomField', static::OWNED,
111  static::LINK_TYPE_SPECIFIC, 'dropDown2'),
112  'radioDropDown' => array(static::HAS_ONE, 'OwnedCustomField', static::OWNED,
113  static::LINK_TYPE_SPECIFIC, 'radioDropDown'),
114  'multiDropDown' => array(static::HAS_ONE, 'OwnedMultipleValuesCustomField', static::OWNED,
115  static::LINK_TYPE_SPECIFIC, 'multiDropDown'),
116  'tagCloud' => array(static::HAS_ONE, 'OwnedMultipleValuesCustomField', static::OWNED,
117  static::LINK_TYPE_SPECIFIC, 'tagCloud'),
118  'hasOne' => array(static::HAS_ONE, 'ReportModelTestItem2', static::NOT_OWNED,
119  static::LINK_TYPE_SPECIFIC, 'hasOne'),
120  'hasOneAgain' => array(static::HAS_ONE, 'ReportModelTestItem2', static::NOT_OWNED,
121  static::LINK_TYPE_SPECIFIC, 'hasOneAgain'),
122  'hasMany' => array(static::HAS_MANY, 'ReportModelTestItem3'),
123  'hasOneAlso' => array(static::HAS_ONE, 'ReportModelTestItem4', static::NOT_OWNED,
124  static::LINK_TYPE_SPECIFIC, 'hasOneAlso'),
125  'primaryEmail' => array(static::HAS_ONE, 'Email', static::OWNED,
126  static::LINK_TYPE_SPECIFIC, 'primaryEmail'),
127  'primaryAddress' => array(static::HAS_ONE, 'Address', static::OWNED,
128  static::LINK_TYPE_SPECIFIC, 'primaryAddress'),
129  'secondaryEmail' => array(static::HAS_ONE, 'Email', static::OWNED,
130  static::LINK_TYPE_SPECIFIC, 'secondaryEmail'),
131  'nonReportable2' => array(static::MANY_MANY, 'ReportModelTestItem5'),
132  'reportedAsAttribute' => array(static::HAS_ONE, 'ReportModelTestItem6', static::NOT_OWNED),
133  'likeContactState' => array(static::HAS_ONE, 'ReportModelTestItem7', static::NOT_OWNED,
134  static::LINK_TYPE_SPECIFIC, 'likeContactState'),
135 
136  ),
137  'derivedRelationsViaCastedUpModel' => array(
138  'model5ViaItem' => array(static::MANY_MANY, 'ReportModelTestItem5', 'reportItems')
139  ),
140  'rules' => array(
141  array('firstName', 'type', 'type' => 'string'),
142  array('firstName', 'length', 'min' => 1, 'max' => 32),
143  array('lastName', 'required'),
144  array('lastName', 'type', 'type' => 'string'),
145  array('lastName', 'length', 'min' => 2, 'max' => 32),
146  array('boolean', 'boolean'),
147  array('date', 'type', 'type' => 'date'),
148  array('dateTime', 'type', 'type' => 'datetime'),
149  array('float', 'type', 'type' => 'float'),
150  array('integer', 'type', 'type' => 'integer'),
151  array('nonReportable', 'type', 'type' => 'string'),
152  array('nonReportable', 'length', 'min' => 1, 'max' => 64),
153  array('phone', 'type', 'type' => 'string'),
154  array('phone', 'length', 'min' => 1, 'max' => 14),
155  array('string', 'required'),
156  array('string', 'type', 'type' => 'string'),
157  array('string', 'length', 'min' => 1, 'max' => 64),
158  array('textArea', 'type', 'type' => 'string'),
159  array('url', 'url'),
160  ),
161  'elements' => array(
162  'currencyValue' => 'CurrencyValue',
163  'date' => 'Date',
164  'dateTime' => 'DateTime',
165  'dropDown' => 'DropDown',
166  'dropDown2' => 'DropDown',
167  'hasOne' => 'ImportModelTestItem2',
168  'hasOneAlso' => 'ImportModelTestItem4',
169  'likeContactState' => 'ContactState',
170  'phone' => 'Phone',
171  'primaryEmail' => 'EmailAddressInformation',
172  'secondaryEmail' => 'EmailAddressInformation',
173  'primaryAddress' => 'Address',
174  'textArea' => 'TextArea',
175  'radioDropDown' => 'RadioDropDown',
176  'multiDropDown' => 'MultiSelectDropDown',
177  'tagCloud' => 'TagCloud',
178  ),
179  'customFields' => array(
180  'dropDown' => 'ReportTestDropDown',
181  'radioDropDown' => 'ReportTestRadioDropDown',
182  'multiDropDown' => 'ReportTestMultiDropDown',
183  'tagCloud' => 'ReportTestTagCloud',
184  ),
185  );
186  return $metadata;
187  }
188 
189  public static function isTypeDeletable()
190  {
191  return true;
192  }
193 
194  public static function getModuleClassName()
195  {
196  return 'ReportsTestModule';
197  }
198 
199  public static function hasReadPermissionsOptimization()
200  {
201  return true;
202  }
203  }
204 ?>
Generated on Sun Oct 25 2020 07:10:32
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.