public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } // First name, surname, name // if (ValidationC::should_test_property(CREATINGUSER_KEY_FIRST_NAME, $properties_dictionary, true, $limit_to_keys) && !CreatingUser::propertyIsValid(CREATINGUSER_KEY_FIRST_NAME, $properties_dictionary[CREATINGUSER_KEY_FIRST_NAME], $error)) { return false; } if (ValidationC::should_test_property(CREATINGUSER_KEY_SURNAME, $properties_dictionary, true, $limit_to_keys) && !CreatingUser::propertyIsValid(CREATINGUSER_KEY_SURNAME, $properties_dictionary[CREATINGUSER_KEY_SURNAME], $error)) { return false; } if (ValidationC::should_test_property(CREATINGUSER_KEY_NAME, $properties_dictionary, true, $limit_to_keys) && !CreatingUser::propertyIsValid(CREATINGUSER_KEY_NAME, $properties_dictionary[CREATINGUSER_KEY_NAME], $error)) { return false; } if (ValidationC::should_test_property(CREATINGUSER_KEY_GENDER, $properties_dictionary, true, $limit_to_keys) && !CreatingUser::propertyIsValid(CREATINGUSER_KEY_GENDER, $properties_dictionary[CREATINGUSER_KEY_GENDER], $error)) { return false; } $should_test_all_names = ValidationC::should_test_property(CREATINGUSER_KEY_FIRST_NAME, $properties_dictionary, true, $limit_to_keys) && ValidationC::should_test_property(CREATINGUSER_KEY_SURNAME, $properties_dictionary, true, $limit_to_keys) && ValidationC::should_test_property(CREATINGUSER_KEY_NAME, $properties_dictionary, true, $limit_to_keys); if ($should_test_all_names && (empty($properties_dictionary[CREATINGUSER_KEY_FIRST_NAME]) || isset($properties_dictionary[CREATINGUSER_KEY_SURNAME])) && isset($properties_dictionary[CREATINGUSER_KEY_NAME])) { // Set either first name and surname, or, just a name // $error = Error::withDomain(VALIDATION_ERROR_DOMAIN, VALIDATION_ERROR_CODE_INVALID_PROPERTY, 'When setting a name, set either ' . CREATINGUSER_KEY_FIRST_NAME . ' and ' . CREATINGUSER_KEY_SURNAME . ', or, just a ' . CREATINGUSER_KEY_NAME . '.'); return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(MULTIDIMENSIONED_IMAGE_KEY_URL_ICON, $properties_dictionary, true, $limit_to_keys) && !Event::propertyIsValid(MULTIDIMENSIONED_IMAGE_KEY_URL_ICON, $properties_dictionary[MULTIDIMENSIONED_IMAGE_KEY_URL_ICON], $error)) { // Icon url was not valid // return false; } if (ValidationC::should_test_property(MULTIDIMENSIONED_IMAGE_KEY_URL_SMALL, $properties_dictionary, true, $limit_to_keys) && !Event::propertyIsValid(MULTIDIMENSIONED_IMAGE_KEY_URL_SMALL, $properties_dictionary[MULTIDIMENSIONED_IMAGE_KEY_URL_SMALL], $error)) { // Small url was not valid // return false; } if (ValidationC::should_test_property(MULTIDIMENSIONED_IMAGE_KEY_URL_MEDIUM, $properties_dictionary, true, $limit_to_keys) && !Event::propertyIsValid(MULTIDIMENSIONED_IMAGE_KEY_URL_MEDIUM, $properties_dictionary[MULTIDIMENSIONED_IMAGE_KEY_URL_MEDIUM], $error)) { // Medium url was not valid // return false; } if (ValidationC::should_test_property(MULTIDIMENSIONED_IMAGE_KEY_URL_LARGE, $properties_dictionary, true, $limit_to_keys) && !Event::propertyIsValid(MULTIDIMENSIONED_IMAGE_KEY_URL_LARGE, $properties_dictionary[MULTIDIMENSIONED_IMAGE_KEY_URL_LARGE], $error)) { // Large url was not valid // return false; } if (ValidationC::should_test_property(MULTIDIMENSIONED_IMAGE_KEY_URL_ORIGINAL, $properties_dictionary, true, $limit_to_keys) && !Event::propertyIsValid(MULTIDIMENSIONED_IMAGE_KEY_URL_ORIGINAL, $properties_dictionary[MULTIDIMENSIONED_IMAGE_KEY_URL_ORIGINAL], $error)) { // Original url was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (isset($properties_dictionary[UNIVERSALLY_UNIQUE_OBJECT_KEY_IDENTIFICATION])) { $properties = array('rawIdentifier' => $properties_dictionary[UNIVERSALLY_UNIQUE_OBJECT_KEY_IDENTIFICATION]); if (ValidationC::should_test_property(UNIVERSALLY_UNIQUE_OBJECT_KEY_IDENTIFICATION, $properties_dictionary, true, $limit_to_keys) && !UniversallyUniqueIdentifier::isValid($properties, true, $error)) { // Identifier was not valid // return false; } } if (ValidationC::should_test_property(UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_CREATED, $properties_dictionary, true, $limit_to_keys) && !UniversallyUniqueObject::propertyIsValid(UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_CREATED, $properties_dictionary[UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_CREATED], $error)) { // Date created was not valid // return false; } if (ValidationC::should_test_property(UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_UPDATED, $properties_dictionary, true, $limit_to_keys) && !UniversallyUniqueObject::propertyIsValid(UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_UPDATED, $properties_dictionary[UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_UPDATED], $error)) { // Date updated was not valid // return false; } if (ValidationC::should_test_property(UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_CREATED, $properties_dictionary, true, $limit_to_keys) && ValidationC::should_test_property(UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_UPDATED, $properties_dictionary, true, $limit_to_keys)) { // Date updated cannot be before date created // if ($properties_dictionary[UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_CREATED] > $properties_dictionary[UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_UPDATED]) { // Updated was before created // $error = Error::withDomain(VALIDATION_ERROR_DOMAIN, VALIDATION_ERROR_CODE_INVALID_PROPERTY, UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_CREATED . ' was before ' . UNIVERSALLY_UNIQUE_OBJECT_KEY_DATE_UPDATED); return false; } } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(CONFINED_DATE_START, $properties_dictionary, true, $limit_to_keys) && !ConfinedDate::propertyIsValid(CONFINED_DATE_START, $properties_dictionary[CONFINED_DATE_START], $error)) { // Start date was not valid // return false; } if (ValidationC::should_test_property(CONFINED_DATE_END, $properties_dictionary, true, $limit_to_keys) && !ConfinedDate::propertyIsValid(CONFINED_DATE_END, $properties_dictionary[CONFINED_DATE_END], $error)) { // End date was not valid // return false; } if (ValidationC::should_test_property(CONFINED_DATE_START, $properties_dictionary, true, $limit_to_keys) && ValidationC::should_test_property(CONFINED_DATE_END, $properties_dictionary, true, $limit_to_keys)) { // Start is before end // if ($properties_dictionary[CONFINED_DATE_START] > $properties_dictionary[CONFINED_DATE_END]) { $error = Error::withDomain(VALIDATION_ERROR_DOMAIN, VALIDATION_ERROR_CODE_INVALID_PROPERTY, 'Start date must be before end.'); return false; } } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property('rawEmail', $properties_dictionary, true, $limit_to_keys) && !Email::propertyIsValid('rawEmail', $properties_dictionary[USER_KEY_EMAIL], $error)) { // Email was not valid // return false; } if (ValidationC::should_test_property('rawPassword', $properties_dictionary, true, $limit_to_keys) && !Password::propertyIsValid('rawPassword', $properties_dictionary[USER_KEY_PASSWORD], $error)) { // Password was not valid // return false; } if (isset($properties_dictionary[USER_KEY_NOTIFICATION_DEVICE_IDENTIFIERS])) { if (ValidationC::should_test_property(USER_KEY_NOTIFICATION_DEVICE_IDENTIFIERS, $properties_dictionary, true, $limit_to_keys) && !User::propertyIsValid(USER_KEY_NOTIFICATION_DEVICE_IDENTIFIERS, $properties_dictionary[USER_KEY_NOTIFICATION_DEVICE_IDENTIFIERS], $error)) { // Password was not valid // return false; } } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (ValidationC::should_test_property('rawEmail', $properties_dictionary, true, $limit_to_keys) && !Email::propertyIsValid('rawEmail', $properties_dictionary['rawEmail'], $error)) { // Email was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (ValidationC::should_test_property('rawIdentifier', $properties_dictionary, true, $limit_to_keys) && !UniversallyUniqueIdentifier::propertyIsValid('rawIdentifier', $properties_dictionary['rawIdentifier'], $error)) { // Identification was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(EVENT_SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_RANGE, $properties_dictionary, false, $limit_to_keys) && !Range::isValid($properties_dictionary[EVENT_SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_RANGE], $limit_to_keys, $error)) { // Attendees range was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(EVENT_TYPE_ANNIVERSARY_KEY_YEAR, $properties_dictionary, true, $limit_to_keys) && !EventTypeAnniversary::propertyIsValid(EVENT_TYPE_ANNIVERSARY_KEY_YEAR, $properties_dictionary[EVENT_TYPE_ANNIVERSARY_KEY_YEAR], $error)) { // Anniversary year was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(EVENT_TYPE_PARTY_LAUNCH_KEY_LAUNCH_ITEM_TITLE, $properties_dictionary, true, $limit_to_keys) && !EventTypePartyLaunch::propertyIsValid(EVENT_TYPE_PARTY_LAUNCH_KEY_LAUNCH_ITEM_TITLE, $properties_dictionary[EVENT_TYPE_PARTY_LAUNCH_KEY_LAUNCH_ITEM_TITLE], $error)) { // Launch item title was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(EVENT_TYPE_BIRTHDAY_KEY_DATE_OF_BIRTH, $properties_dictionary, true, $limit_to_keys) && !EventTypeBirthday::propertyIsValid(EVENT_TYPE_BIRTHDAY_KEY_DATE_OF_BIRTH, $properties_dictionary[EVENT_TYPE_BIRTHDAY_KEY_DATE_OF_BIRTH], $error)) { // DOB was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(RANGE_POSITION, $properties_dictionary, true, $limit_to_keys) && !Range::propertyIsValid(RANGE_POSITION, $properties_dictionary[RANGE_POSITION], $error)) { // Position was not valid // return false; } if (ValidationC::should_test_property(RANGE_LENGTH, $properties_dictionary, true, $limit_to_keys) && !Range::propertyIsValid(RANGE_LENGTH, $properties_dictionary[RANGE_LENGTH], $error)) { // Range was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_LOCATION, $properties_dictionary, false, $limit_to_keys) && !Location::isValid($properties_dictionary[SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_LOCATION], false, $error)) { // Location was not valid // return false; } if (ValidationC::should_test_property(SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_CONFINED_DATE, $properties_dictionary, false, $limit_to_keys) && !ConfinedDate::isValid($properties_dictionary[SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_CONFINED_DATE], false, $error)) { // Confined date was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypeAnniversary') { return EventTypeAnniversary::isValid($properties_dictionary, $limit_to_keys, $error); } else { if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypeAnniversaryWedding') { return EventTypeAnniversaryWedding::isValid($properties_dictionary, $limit_to_keys, $error); } else { if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypeBirthday') { return EventTypeBirthday::isValid($properties_dictionary, $limit_to_keys, $error); } else { if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypeCelebration') { return EventTypeCelebration::isValid($properties_dictionary, $limit_to_keys, $error); } else { if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypeGigMusic') { return EventTypeGigMusic::isValid($properties_dictionary, $limit_to_keys, $error); } else { if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypeGigComedy') { return EventTypeGigComedy::isValid($properties_dictionary, $limit_to_keys, $error); } else { if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypeParty') { return EventTypeParty::isValid($properties_dictionary, $limit_to_keys, $error); } else { if (ValidationC::should_test_property(EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME, $properties_dictionary, true, $limit_to_keys) && $properties_dictionary[EVENT_TYPE_FACTORY_KEY_EVENT_TYPE_NAME] === 'EventTypePartyLaunch') { return EventTypePartyLaunch::isValid($properties_dictionary, $limit_to_keys, $error); } else { $error = Error::withDomain(EVENT_TYPE_FACTORY_ERROR_DOMAIN, EVENT_TYPE_FACTORY_ERROR_CODE_INVALID_NAME, 'Invalid name.'); return false; } } } } } } } } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(LOCATION_KEY_COORDINATE_LATITUDE, $properties_dictionary, true, $limit_to_keys) && !Location::propertyIsValid(LOCATION_KEY_COORDINATE_LATITUDE, $properties_dictionary[LOCATION_KEY_COORDINATE_LATITUDE], $error)) { // Latitude was not valid // return false; } if (ValidationC::should_test_property(LOCATION_KEY_COORDINATE_LONGITUDE, $properties_dictionary, true, $limit_to_keys) && !Location::propertyIsValid(LOCATION_KEY_COORDINATE_LONGITUDE, $properties_dictionary[LOCATION_KEY_COORDINATE_LONGITUDE], $error)) { // Longitude was not valid // return false; } return true; }
public static function isValid(&$properties_dictionary, $limit_to_keys, &$error) { // Check each property is valid // if (!parent::isValid($properties_dictionary, $limit_to_keys, $error)) { return false; } if (ValidationC::should_test_property(EVENT_KEY_DRESS_CODE, $properties_dictionary, true, $limit_to_keys) && !Event::propertyIsValid(EVENT_KEY_DRESS_CODE, $properties_dictionary[EVENT_KEY_DRESS_CODE], $error)) { // Dress code was not valid // return false; } if (ValidationC::should_test_property(EVENT_KEY_PRIVACY, $properties_dictionary, true, $limit_to_keys) && !Event::propertyIsValid(EVENT_KEY_PRIVACY, $properties_dictionary[EVENT_KEY_PRIVACY], $error)) { // Privacy was not valid // return false; } }