public function setAttributeMetadataFromForm(AttributeForm $attributeForm)
 {
     assert('$attributeForm instanceof MultiSelectDropDownAttributeForm');
     $modelClassName = get_class($this->model);
     $attributeName = $attributeForm->attributeName;
     $attributeLabels = $attributeForm->attributeLabels;
     $defaultValueOrder = $attributeForm->defaultValueOrder;
     $elementType = $attributeForm->getAttributeTypeName();
     $partialTypeRule = $attributeForm->getModelAttributePartialRule();
     $isRequired = (bool) $attributeForm->isRequired;
     $isAudited = (bool) $attributeForm->isAudited;
     $customFieldDataName = $attributeForm->customFieldDataName;
     if ($customFieldDataName == null) {
         $customFieldDataName = ucfirst(strtolower($attributeForm->attributeName));
         //should we do something else instead?
     }
     $customFieldDataData = $attributeForm->customFieldDataData;
     $customFieldDataLabels = $attributeForm->customFieldDataLabels;
     $defaultValue = DropDownDefaultValueOrderUtil::getDefaultValueFromDefaultValueOrder($defaultValueOrder, $customFieldDataData);
     ModelMetadataUtil::addOrUpdateCustomFieldRelation($modelClassName, $attributeName, $attributeLabels, $defaultValue, $isRequired, $isAudited, $elementType, $customFieldDataName, $customFieldDataData, $customFieldDataLabels, 'OwnedMultipleValuesCustomField');
     if ($attributeForm->getCustomFieldDataId() != null) {
         foreach ($attributeForm->customFieldDataData as $order => $newValue) {
             if (isset($attributeForm->customFieldDataDataExistingValues[$order]) && $attributeForm->customFieldDataDataExistingValues[$order] != $newValue) {
                 MultipleValuesCustomField::updateValueByDataIdAndOldValueAndNewValue($attributeForm->getCustomFieldDataId(), $attributeForm->customFieldDataDataExistingValues[$order], $newValue);
             }
         }
     }
     $this->resolveDatabaseSchemaForModel($modelClassName);
 }
 public function setAttributeMetadataFromForm(AttributeForm $attributeForm)
 {
     assert('$attributeForm instanceof CurrencyValueAttributeForm');
     $modelClassName = get_class($this->model);
     $attributeName = $attributeForm->attributeName;
     $attributeLabels = $attributeForm->attributeLabels;
     $elementType = $attributeForm->getAttributeTypeName();
     $isRequired = (bool) $attributeForm->isRequired;
     $isAudited = (bool) $attributeForm->isAudited;
     ModelMetadataUtil::addOrUpdateRelation($modelClassName, $attributeName, $attributeLabels, $elementType, $isRequired, $isAudited, 'CurrencyValue');
     $this->resolveDatabaseSchemaForModel($modelClassName);
 }
 public function setAttributeMetadataFromForm(AttributeForm $attributeForm)
 {
     assert('$attributeForm instanceof DateTimeAttributeForm ||
                     $attributeForm instanceof DateAttributeForm');
     $modelClassName = get_class($this->model);
     $attributeName = $attributeForm->attributeName;
     $attributeLabels = $attributeForm->attributeLabels;
     $elementType = $attributeForm->getAttributeTypeName();
     $partialTypeRule = $attributeForm->getModelAttributePartialRule();
     $defaultValueCalculationType = $attributeForm->defaultValueCalculationType;
     $isRequired = (bool) $attributeForm->isRequired;
     $isAudited = (bool) $attributeForm->isAudited;
     $mixedRule = array('dateTimeDefault', 'value' => $defaultValueCalculationType);
     ModelMetadataUtil::addOrUpdateMember($modelClassName, $attributeName, $attributeLabels, null, null, null, null, null, $isRequired, $isAudited, $elementType, $partialTypeRule, $mixedRule);
     $this->resolveDatabaseSchemaForModel($modelClassName);
 }
 public function setAttributeMetadataFromForm(AttributeForm $attributeForm)
 {
     assert('$attributeForm instanceof DropDownAttributeForm');
     $modelClassName = get_class($this->model);
     $attributeName = $attributeForm->attributeName;
     $attributeLabels = $attributeForm->attributeLabels;
     $defaultValueOrder = $attributeForm->defaultValueOrder;
     $elementType = $attributeForm->getAttributeTypeName();
     $partialTypeRule = $attributeForm->getModelAttributePartialRule();
     $isRequired = (bool) $attributeForm->isRequired;
     $isAudited = (bool) $attributeForm->isAudited;
     $customFieldDataName = $attributeForm->customFieldDataName;
     if ($customFieldDataName == null) {
         $customFieldDataName = ucfirst(strtolower($attributeForm->attributeName));
         //should we do something else instead?
     }
     $customFieldDataData = $attributeForm->customFieldDataData;
     $customFieldDataLabels = $attributeForm->customFieldDataLabels;
     $defaultValue = DropDownDefaultValueOrderUtil::getDefaultValueFromDefaultValueOrder($defaultValueOrder, $customFieldDataData);
     ModelMetadataUtil::addOrUpdateCustomFieldRelation($modelClassName, $attributeName, $attributeLabels, $defaultValue, $isRequired, $isAudited, $elementType, $customFieldDataName, $customFieldDataData, $customFieldDataLabels);
     if ($attributeForm->getCustomFieldDataId() != null) {
         $oldAndNewValuePairs = array();
         foreach ($attributeForm->customFieldDataData as $order => $newValue) {
             if (isset($attributeForm->customFieldDataDataExistingValues[$order]) && $attributeForm->customFieldDataDataExistingValues[$order] != $newValue) {
                 CustomField::updateValueByDataIdAndOldValueAndNewValue($attributeForm->getCustomFieldDataId(), $attributeForm->customFieldDataDataExistingValues[$order], $newValue);
                 $oldValue = $attributeForm->customFieldDataDataExistingValues[$order];
                 $oldAndNewValuePairs[$oldValue] = $newValue;
             }
         }
         if (count($oldAndNewValuePairs) > 0) {
             DropDownDependencyDerivedAttributeDesignerUtil::updateValueInMappingByOldAndNewValue($modelClassName, $attributeName, $oldAndNewValuePairs, $attributeForm->customFieldDataDataExistingValues[$order], $newValue);
         }
         DropDownDependencyDerivedAttributeDesignerUtil::resolveValuesInMappingWhenValueWasRemoved($modelClassName, $attributeName, $attributeForm->customFieldDataData);
     }
     $this->resolveDatabaseSchemaForModel($modelClassName);
 }
Ejemplo n.º 5
0
 /**
  * Validates that attribute name does not already exist
  * on model.  Ignores check if this is an existing attribute
  * being modified since you can't modify the attribute name except
  * during attribute creation.
  */
 public function validateAttributeNameDoesNotExists()
 {
     assert('$this->modelClassName != null');
     $modelClassName = $this->modelClassName;
     $model = new $modelClassName();
     if ($model->isAttribute(ModelMetadataUtil::resolveName($this->attributeName))) {
         $this->addError('attributeName', Zurmo::t('DesignerModule', 'A field with this name is already used.'));
     }
 }
Ejemplo n.º 6
0
 /**
  * @depends testAttributeLabelsMergeCorrectlyWithExistingData
  */
 public function testSavingCustomFieldDataLabels()
 {
     $a = new A();
     $this->assertTrue($a->isAttribute('fruitCstm'));
     unset($a);
     $appleCustomField = new CustomField();
     $appleCustomField->value = 'apple';
     $appleCustomField->data = CustomFieldData::getByName('Fruit');
     $this->assertTrue($appleCustomField->save());
     $attributeLabels = array('en' => 'fruit');
     ModelMetadataUtil::addOrUpdateCustomFieldRelation('A', 'fruit', $attributeLabels, $appleCustomField, true, false, 'DropDown', 'Fruit', array('apple', 'grape', 'orange'), array('fr' => array('appleFr', 'grapeFr', 'orangeFr'), 'de' => array('', 'grape', '')), 'CustomField', false);
     $a = new A();
     $a->a = 1;
     $this->assertTrue($a->isAttribute('fruitCstm'));
     $this->assertTrue($a->validate());
     $this->assertEquals('apple', $a->fruitCstm->value);
     $compareData = array('fr' => array('appleFr', 'grapeFr', 'orangeFr'), 'de' => array('', 'grape', ''));
     $this->assertEquals($compareData, unserialize($a->fruitCstm->data->serializedLabels));
     unset($a);
     ModelMetadataUtil::removeAttribute('A', 'fruitCstm');
 }
 /**
  * @param string $attributeName
  */
 public function removeAttributeMetadata($attributeName)
 {
     assert('is_string($attributeName) && $attributeName != ""');
     $modelClassName = get_class($this->model);
     ModelMetadataUtil::removeAttribute($modelClassName, $attributeName);
 }
 public function setAttributeMetadataFromForm(AttributeForm $attributeForm)
 {
     $modelClassName = get_class($this->model);
     $attributeName = $attributeForm->attributeName;
     $attributeLabels = $attributeForm->attributeLabels;
     $elementType = $attributeForm->getAttributeTypeName();
     $isRequired = (bool) $attributeForm->isRequired;
     $isAudited = (bool) $attributeForm->isAudited;
     $contactStatesData = $attributeForm->contactStatesData;
     $contactStatesLabels = $attributeForm->contactStatesLabels;
     $startingStateOrder = (int) $attributeForm->startingStateOrder;
     $contactStatesDataExistingValues = $attributeForm->contactStatesDataExistingValues;
     if ($contactStatesDataExistingValues == null) {
         $contactStatesDataExistingValues = array();
     }
     if ($attributeForm instanceof ContactStateAttributeForm) {
         //update order on existing states.
         //delete removed states
         $states = ContactState::getAll('order');
         $stateNames = array();
         foreach ($states as $state) {
             if (in_array($state->name, $contactStatesData)) {
                 $stateNames[] = $state->name;
                 $state->order = array_search($state->name, $contactStatesData);
                 $state->serializedLabels = $this->makeSerializedLabelsByLabelsAndOrder($contactStatesLabels, (int) $state->order);
                 $saved = $state->save();
                 assert('$saved');
             } elseif (in_array($state->name, $contactStatesDataExistingValues)) {
                 $order = array_search($state->name, $contactStatesDataExistingValues);
                 $state->name = $contactStatesData[$order];
                 $state->order = $order;
                 $state->serializedLabels = $this->makeSerializedLabelsByLabelsAndOrder($contactStatesLabels, (int) $state->order);
                 $saved = $state->save();
                 assert('$saved');
                 $stateNames[] = $state->name;
             } else {
                 $stateNames[] = $state->name;
                 $state->delete();
             }
         }
         //add new states with correct order.
         foreach ($contactStatesData as $order => $name) {
             if (!in_array($name, $stateNames)) {
                 $state = new ContactState();
                 $state->name = $name;
                 $state->order = $order;
                 $state->serializedLabels = $this->makeSerializedLabelsByLabelsAndOrder($contactStatesLabels, (int) $order);
                 $saved = $state->save();
                 assert('$saved');
             }
         }
         //Set starting state by order.
         ContactsUtil::setStartingStateByOrder($startingStateOrder);
         ModelMetadataUtil::addOrUpdateRelation($modelClassName, $attributeName, $attributeLabels, $elementType, $isRequired, $isAudited, 'ContactState');
     } else {
         throw new NotSupportedException();
     }
 }
Ejemplo n.º 9
0
 /**
  * There was a bug if you had an existing model, then created a custom drop down, it would not show
  * any values.  This was resolved by making sure cached models constructDerived.  This test should pass now
  * that the fix is implemented.
  * @depends testGetRequiredDerivedLayoutAttributeTypes
  */
 public function testExistingModelsShowCustomFieldDataCorrectlyWhenAttributeIsAddedAsDatabaseColumn()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     //Create account
     $account = AccountTestHelper::createAccountByNameForOwner('test', $super);
     $accountId = $account->id;
     $account->forget();
     $originalMetadata = Account::getMetadata();
     $attributeLabels = array('en' => 'newRelation');
     ModelMetadataUtil::addOrUpdateCustomFieldRelation('Account', 'newRelation', $attributeLabels, null, false, false, 'DropDown', 'Things', array('thing 1', 'thing 2'), array('fr' => array('thing 1 fr', 'thing 2 fr')));
     $adapter = new ModelAttributesAdapter(new Account());
     $adapter->resolveDatabaseSchemaForModel('Account');
     $metadata = Account::getMetadata();
     $this->assertNotEquals($originalMetadata, $metadata);
     $this->assertEquals($originalMetadata['Account']['rules'], $metadata['Account']['rules']);
     $newRelation = $metadata['Account']['relations']['newRelationCstm'];
     $this->assertEquals(array(RedBeanModel::HAS_ONE, 'OwnedCustomField', RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'newRelationCstm'), $newRelation);
     $this->assertEquals('Things', $metadata['Account']['customFields']['newRelationCstm']);
     //on a new account, does the serialized data show correctly.
     $account = new Account();
     $this->assertEquals(array('thing 1', 'thing 2'), unserialize($account->newRelationCstm->data->serializedData));
     ForgetAllCacheUtil::forgetAllCaches();
     //retrieve account and make sure the serialized data shows correctly.
     //This will not be cached.
     $account = Account::getById($accountId);
     $this->assertNotNull($account->industry->data->serializedData);
     $this->assertEquals(array('thing 1', 'thing 2'), unserialize($account->newRelationCstm->data->serializedData));
     //This will pull from cached.  Clear the php cache first, which simulates a new page request without destroying
     //the persistent cache.
     RedBeanModelsCache::forgetAll(true);
     $account = Account::getById($accountId);
     //Test pulling a different CustomField first. This simulates caching the customField
     $this->assertEquals(array('thing 1', 'thing 2'), unserialize($account->newRelationCstm->data->serializedData));
 }
Ejemplo n.º 10
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$freeze = false;
     if (RedBeanDatabase::isFrozen()) {
         RedBeanDatabase::unfreeze();
         self::$freeze = true;
     }
     SecurityTestHelper::createSuperAdmin();
     SecurityTestHelper::createUsers();
     self::$super = User::getByUsername('super');
     Yii::app()->user->userModel = self::$super;
     $currencies = Currency::getAll();
     $currencyValue = new CurrencyValue();
     $currencyValue->value = 100;
     $currencyValue->currency = $currencies[0];
     $multiDropDownCustomFieldData = new CustomFieldData();
     $multiDropDownCustomFieldData->name = 'multiDropDown';
     $multiDropDownCustomFieldData->serializedData = serialize(array('Ten', 11, 'XII'));
     $saved = $multiDropDownCustomFieldData->save();
     assert('$saved');
     // Not Coding Standard
     $multiDropDownCustomFieldValue1 = new CustomFieldValue();
     $multiDropDownCustomFieldValue1->value = 'Ten';
     $multiDropDownCustomFieldValue2 = new CustomFieldValue();
     $multiDropDownCustomFieldValue2->value = 11;
     $multiDropDownCustomFieldValue3 = new CustomFieldValue();
     $multiDropDownCustomFieldValue3->value = 'XII';
     $tagCustomFieldData = new CustomFieldData();
     $tagCustomFieldData->name = 'tagCloud';
     $tagCustomFieldData->serializedData = serialize(array('Apache', 'PHP'));
     $saved = $tagCustomFieldData->save();
     assert('$saved');
     // Not Coding Standard
     $tagCustomFieldValue1 = new CustomFieldValue();
     $tagCustomFieldValue1->value = 'PHP';
     $tagCustomFieldValue2 = new CustomFieldValue();
     $tagCustomFieldValue2->value = 'Apache';
     $primaryEmail = new Email();
     $primaryEmail->emailAddress = "*****@*****.**";
     $primaryEmail->isInvalid = true;
     $primaryEmail->optOut = false;
     $secondaryEmail = new Email();
     $secondaryEmail->emailAddress = "*****@*****.**";
     $secondaryEmail->isInvalid = false;
     $secondaryEmail->optOut = true;
     $address = new Address();
     $address->street1 = "SomeStreet1";
     $address->street2 = "SomeStreet2";
     $address->city = "SomeCity";
     $address->state = "SomeState";
     $address->postalCode = 1111;
     $address->country = "SomeCountry";
     $likeContactState = new ContactState();
     $likeContactState->name = 'Customer';
     $likeContactState->order = 0;
     $users = User::getAll();
     $user = new User();
     $user->lastName = 'Kevin';
     $user->hash = 'rieWoy3aijohP6chaigaokohs1oovohf';
     $user->language = 'es';
     $user->timeZone = 'America/Chicago';
     $user->username = '******';
     $user->currency = $currencies[0];
     $user->manager = $users[0];
     //Custom attribute
     $attributeLabels = array('en' => 'test label en');
     ModelMetadataUtil::addOrUpdateMember('EmailTemplateModelTestItem', 'custom', $attributeLabels, null, null, null, null, null, false, false, 'Text', array(), null);
     $model = new EmailTemplateModelTestItem();
     $model->string = 'abc';
     $model->firstName = 'James';
     $model->lastName = 'Jackson';
     $model->phone = 1122334455;
     $model->boolean = true;
     $model->date = '2008-12-31';
     $model->dateTime = '2008-12-31 07:48:04';
     $model->textArea = 'Multiple Lines\\nOf Text';
     $model->url = 'http://www.zurmo.com/';
     $model->integer = 999;
     $model->float = 999.999;
     $model->currencyValue = $currencyValue;
     $model->dropDown->value = "DropdownSelectedValue";
     $model->radioDropDown->value = "RadioDropdownSelectedValue";
     $model->primaryEmail = $primaryEmail;
     $model->secondaryEmail = $secondaryEmail;
     $model->primaryAddress = $address;
     $model->likeContactState = $likeContactState;
     $model->user = $user;
     $model->multiDropDown->data = $multiDropDownCustomFieldData;
     $model->tagCloud->data = $tagCustomFieldData;
     $model->multiDropDown->values->add($multiDropDownCustomFieldValue1);
     $model->multiDropDown->values->add($multiDropDownCustomFieldValue2);
     $model->multiDropDown->values->add($multiDropDownCustomFieldValue3);
     $model->tagCloud->values->add($tagCustomFieldValue1);
     $model->tagCloud->values->add($tagCustomFieldValue2);
     $model->customCstm = 'text custom';
     $saved = $model->save();
     assert('$saved');
     // Not Coding Standard
     self::$emailTemplate = $model;
     self::$content = '[[STRING]] [[FIRST^NAME]] [[LAST^NAME]] [[PHONE]]';
     self::$compareContent = 'abc James Jackson 1122334455';
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // We need to unfreeze here as we are working with custom field values
     self::$freeze = false;
     if (RedBeanDatabase::isFrozen()) {
         RedBeanDatabase::unfreeze();
         self::$freeze = true;
     }
     SecurityTestHelper::createSuperAdmin();
     SecurityTestHelper::createUsers();
     self::$super = User::getByUsername('super');
     Yii::app()->user->userModel = self::$super;
     $currencies = Currency::getAll();
     $currencyValue1 = new CurrencyValue();
     $currencyValue1->value = 100;
     $currencyValue1->currency = $currencies[0];
     $multiDropDownCustomFieldData1 = new CustomFieldData();
     $multiDropDownCustomFieldData1->name = 'multiDropDown1';
     $multiDropDownCustomFieldData1->serializedData = serialize(array('Ten', 11, 'XII'));
     $saved = $multiDropDownCustomFieldData1->save();
     assert('$saved');
     // Not Coding Standard
     $multiDropDownCustomFieldValue1 = new CustomFieldValue();
     $multiDropDownCustomFieldValue1->value = 'Ten';
     $multiDropDownCustomFieldValue2 = new CustomFieldValue();
     $multiDropDownCustomFieldValue2->value = 11;
     $multiDropDownCustomFieldValue3 = new CustomFieldValue();
     $multiDropDownCustomFieldValue3->value = 'XII';
     $tagCustomFieldData1 = new CustomFieldData();
     $tagCustomFieldData1->name = 'tagCloud1';
     $tagCustomFieldData1->serializedData = serialize(array('Apache', 'PHP'));
     $saved = $tagCustomFieldData1->save();
     assert('$saved');
     // Not Coding Standard
     $tagCustomFieldValue1 = new CustomFieldValue();
     $tagCustomFieldValue1->value = 'PHP';
     $tagCustomFieldValue2 = new CustomFieldValue();
     $tagCustomFieldValue2->value = 'Apache';
     $primaryEmail1 = new Email();
     $primaryEmail1->emailAddress = "*****@*****.**";
     $primaryEmail1->isInvalid = true;
     $primaryEmail1->optOut = false;
     $secondaryEmail1 = new Email();
     $secondaryEmail1->emailAddress = "*****@*****.**";
     $secondaryEmail1->isInvalid = false;
     $secondaryEmail1->optOut = true;
     $address1 = new Address();
     $address1->street1 = "SomeStreet1";
     $address1->street2 = "SomeStreet2";
     $address1->city = "SomeCity";
     $address1->state = "SomeState";
     $address1->postalCode = 1111;
     $address1->country = "SomeCountry";
     $likeContactState1 = new ContactState();
     $likeContactState1->name = 'Customer';
     $likeContactState1->order = 0;
     $users = User::getAll();
     $user1 = new User();
     $user1->lastName = 'Kevin';
     $user1->hash = 'rieWoy3aijohP6chaigaokohs1oovohf';
     $user1->language = 'es';
     $user1->timeZone = 'America/Chicago';
     $user1->username = '******';
     $user1->currency = $currencies[0];
     $user1->manager = $users[0];
     //Custom attribute
     $attributeLabels = array('en' => 'test label en');
     ModelMetadataUtil::addOrUpdateMember('EmailTemplateModelTestItem', 'custom', $attributeLabels, null, null, null, null, null, false, false, 'Text', array(), null);
     $model = new EmailTemplateModelTestItem();
     $model->string = 'abc';
     $model->firstName = 'James';
     $model->lastName = 'Jackson';
     $model->phone = 1122334455;
     $model->boolean = true;
     $model->date = '2008-12-31';
     $model->dateTime = '2008-12-31 07:48:04';
     $model->textArea = 'Multiple Lines\\nOf Text';
     $model->url = 'http://www.zurmo.com/';
     $model->integer = 999;
     $model->float = 999.999;
     $model->currencyValue = $currencyValue1;
     $model->dropDown->value = "DropdownSelectedValue";
     $model->radioDropDown->value = "RadioDropdownSelectedValue";
     $model->primaryEmail = $primaryEmail1;
     $model->secondaryEmail = $secondaryEmail1;
     $model->primaryAddress = $address1;
     $model->likeContactState = $likeContactState1;
     $model->user = $user1;
     $model->multiDropDown->data = $multiDropDownCustomFieldData1;
     $model->tagCloud->data = $tagCustomFieldData1;
     $model->multiDropDown->values->add($multiDropDownCustomFieldValue1);
     $model->multiDropDown->values->add($multiDropDownCustomFieldValue2);
     $model->multiDropDown->values->add($multiDropDownCustomFieldValue3);
     $model->tagCloud->values->add($tagCustomFieldValue1);
     $model->tagCloud->values->add($tagCustomFieldValue2);
     $model->customCstm = 'text custom';
     $saved = $model->save();
     assert('$saved');
     // Not Coding Standard
     self::$emailTemplate = $model;
     // Update all values but do not save the model.
     $multiDropDownCustomFieldData2 = new CustomFieldData();
     $multiDropDownCustomFieldData2->name = 'multiDropDown2';
     $multiDropDownCustomFieldData2->serializedData = serialize(array('Thirteen', 14, 'XV'));
     $saved = $multiDropDownCustomFieldData2->save();
     assert('$saved');
     // Not Coding Standard
     $multiDropDownCustomFieldValue4 = new CustomFieldValue();
     $multiDropDownCustomFieldValue4->value = 'Thirteen';
     $multiDropDownCustomFieldValue5 = new CustomFieldValue();
     $multiDropDownCustomFieldValue5->value = 14;
     $multiDropDownCustomFieldValue6 = new CustomFieldValue();
     $multiDropDownCustomFieldValue6->value = 'XV';
     $tagCustomFieldData2 = new CustomFieldData();
     $tagCustomFieldData2->name = 'tagCloud2';
     $tagCustomFieldData2->serializedData = serialize(array('Nginx', 'Python'));
     $saved = $tagCustomFieldData2->save();
     assert('$saved');
     // Not Coding Standard
     $tagCustomFieldValue3 = new CustomFieldValue();
     $tagCustomFieldValue3->value = 'Python';
     $tagCustomFieldValue4 = new CustomFieldValue();
     $tagCustomFieldValue4->value = 'Nginx';
     self::$emailTemplate->string = 'def';
     self::$emailTemplate->firstName = 'Jane';
     self::$emailTemplate->lastName = 'Bond';
     self::$emailTemplate->phone = 66778899;
     self::$emailTemplate->boolean = false;
     self::$emailTemplate->date = '2009-12-31';
     self::$emailTemplate->dateTime = '2009-12-31 07:48:04';
     self::$emailTemplate->textArea = 'Multiple Lines\\nOf\\nText';
     self::$emailTemplate->url = 'http://www.zurmo.org/';
     self::$emailTemplate->integer = 888;
     self::$emailTemplate->float = 888.888;
     self::$emailTemplate->currencyValue->value = 99;
     self::$emailTemplate->dropDown->value = "DropdownSelectedVal";
     self::$emailTemplate->radioDropDown->value = "RadioDropdownSelectedVal";
     self::$emailTemplate->primaryEmail->emailAddress = "*****@*****.**";
     self::$emailTemplate->primaryEmail->isInvalid = false;
     self::$emailTemplate->primaryEmail->optOut = true;
     self::$emailTemplate->secondaryEmail->emailAddress = "*****@*****.**";
     self::$emailTemplate->secondaryEmail->isInvalid = true;
     self::$emailTemplate->secondaryEmail->optOut = false;
     self::$emailTemplate->primaryAddress->street1 = "SomeOtherStreet1";
     self::$emailTemplate->primaryAddress->street2 = "SomeOtherStreet2";
     self::$emailTemplate->primaryAddress->city = "SomeOtherCity";
     self::$emailTemplate->primaryAddress->state = "SomeOtherState";
     self::$emailTemplate->primaryAddress->postalCode = 2222;
     self::$emailTemplate->primaryAddress->country = "SomeOtherCountry";
     self::$emailTemplate->likeContactState->name = 'New';
     self::$emailTemplate->likeContactState->order = 1;
     self::$emailTemplate->user->lastName = 'Dean';
     self::$emailTemplate->user->hash = 'teo8eghaipaC5ahngahleiyaebofu6oo';
     self::$emailTemplate->user->language = 'en';
     self::$emailTemplate->user->timeZone = 'America/Denver';
     self::$emailTemplate->user->username = '******';
     self::$emailTemplate->multiDropDown->data = $multiDropDownCustomFieldData2;
     self::$emailTemplate->multiDropDown->values->remove($multiDropDownCustomFieldValue1);
     self::$emailTemplate->multiDropDown->values->remove($multiDropDownCustomFieldValue2);
     self::$emailTemplate->multiDropDown->values->remove($multiDropDownCustomFieldValue3);
     self::$emailTemplate->multiDropDown->values->add($multiDropDownCustomFieldValue4);
     self::$emailTemplate->multiDropDown->values->add($multiDropDownCustomFieldValue5);
     self::$emailTemplate->multiDropDown->values->add($multiDropDownCustomFieldValue6);
     self::$emailTemplate->tagCloud->data = $tagCustomFieldData2;
     self::$emailTemplate->tagCloud->values->remove($tagCustomFieldValue1);
     self::$emailTemplate->tagCloud->values->remove($tagCustomFieldValue2);
     self::$emailTemplate->tagCloud->values->add($tagCustomFieldValue3);
     self::$emailTemplate->tagCloud->values->add($tagCustomFieldValue4);
     self::$emailTemplate->customCstm = 'text custom changed';
     self::$content = 'Current: [[STRING]] [[FIRST^NAME]] [[LAST^NAME]] ' . '[[PHONE]] Old: [[WAS%STRING]] [[WAS%FIRST^NAME]] ' . '[[WAS%LAST^NAME]] [[WAS%PHONE]]';
     self::$compareContent = 'Current: def Jane Bond 66778899 Old: abc James ' . 'Jackson 1122334455';
 }