Fixed fields naming convention
Change-Id: I621cd3ac16700f35f4d1387c9f74eeff611beb2c
This commit is contained in:
parent
7bd426fac9
commit
03aed54fa0
|
@ -29,8 +29,8 @@ final class SummitGeoLocatedLocationValidationRulesFactory
|
|||
|
||||
if($update) {
|
||||
return array_merge([
|
||||
'address1' => 'sometimes|string',
|
||||
'address2' => 'sometimes|string',
|
||||
'address_1' => 'sometimes|string',
|
||||
'address_2' => 'sometimes|string',
|
||||
'zip_code' => 'sometimes|string',
|
||||
'city' => 'string|required_with:address1',
|
||||
'state' => 'string|required_with:address1',
|
||||
|
@ -45,8 +45,8 @@ final class SummitGeoLocatedLocationValidationRulesFactory
|
|||
}
|
||||
|
||||
return array_merge([
|
||||
'address1' => 'string|required_without:lng,lat',
|
||||
'address2' => 'sometimes|string',
|
||||
'address_1' => 'string|required_without:lng,lat',
|
||||
'address_2' => 'sometimes|string',
|
||||
'zip_code' => 'sometimes|string',
|
||||
'city' => 'string|required_without:lng,lat',
|
||||
'state' => 'string|required_without:lng,lat',
|
||||
|
|
|
@ -74,11 +74,11 @@ final class SummitLocationFactory
|
|||
* @return SummitGeoLocatedLocation
|
||||
*/
|
||||
private static function populateSummitGeoLocatedLocation(SummitGeoLocatedLocation $location, array $data){
|
||||
if(isset($data['address1']))
|
||||
$location->setAddress1(trim($data['address1']));
|
||||
if(isset($data['address_1']))
|
||||
$location->setAddress1(trim($data['address_1']));
|
||||
|
||||
if(isset($data['address2']))
|
||||
$location->setAddress2(trim($data['address2']));
|
||||
if(isset($data['address_2']))
|
||||
$location->setAddress2(trim($data['address_2']));
|
||||
|
||||
if(isset($data['zip_code']))
|
||||
$location->setZipCode(trim($data['zip_code']));
|
||||
|
|
|
@ -64,7 +64,7 @@ class SummitAbstractLocation extends SilverstripeBaseModel
|
|||
public static $metadata = [
|
||||
'name' => 'string',
|
||||
'description' => 'string',
|
||||
'type' => 'string',
|
||||
'type' => [ self::TypeExternal, self::TypeInternal],
|
||||
'order' => 'integer',
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue