Skip to content

Commit

Permalink
Finishing the sendProperty request example.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Wyke committed Dec 7, 2015
1 parent 618241f commit ea85b4d
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 8 deletions.
144 changes: 144 additions & 0 deletions examples/sendProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,150 @@
//set the details for the request
$objRequest->network->network_id = NETWORK_ID;
$objRequest->branch->branch_id = BRANCH_ID;
$objRequest->branch->channel = Frozensheep\RightmoveADF\Values\Channels::Lettings;
//$objRequest->branch->overseas = false;
$objRequest->property->agent_ref = PROPERTY_REF;

//
//property details
//
$objRequest->property->published = true;
$objRequest->property->property_type = Frozensheep\RightmoveADF\Values\PropertyTypes::GroundFloorFlat;
$objRequest->property->status = Frozensheep\RightmoveADF\Values\Statuses::Available;
//$objRequest->property->new_home = false;
//$objRequest->property->student_property = true;
//$objRequest->property->house_flat_share = false;
//$objRequest->property->create_date = 'last Monday';
//$objRequest->property->update_date = 'now';
//$objRequest->property->date_available = 'next Tuesday';
//$objRequest->property->contract_months = 12;
//$objRequest->property->minimum_term = 6;
//$objRequest->property->let_type = Frozensheep\RightmoveADF\Values\LetTypes::LongTerm;

//
//address details
//
$objRequest->property->address->house_name_number = 'Old Trafford';
$objRequest->property->address->address_2 = 'Sir Matt Busby Way';
$objRequest->property->address->address_3 = '';
$objRequest->property->address->address_4 = '';
$objRequest->property->address->town = 'Manchester';
$objRequest->property->address->postcode_1 = 'M16';
$objRequest->property->address->postcode_2 = '0RA';
$objRequest->property->address->display_address = 'Sir Matt Busby Way';
//$objRequest->property->address->latitude = 53.462989;
//$objRequest->property->address->longitude = -2.291651;
//$objRequest->property->address->pov_latitude = 53.463438;
//$objRequest->property->address->pov_longitude = -2.2891147;
//$objRequest->property->address->pov_pitch = 100.0;
//$objRequest->property->address->pov_heading = 257.0;
//$objRequest->property->address->pov_zoom = 1;

//
//price details
//
$objRequest->property->price_information->price = 700.00;
//$objRequest->property->price_information->price_qualifier = Frozensheep\RightmoveADF\Values\PriceQualifiers::Defaults;
//$objRequest->property->price_information->deposit = 1100;
//$objRequest->property->price_information->administration_fee = 'Admin fee is equal to one weeks rent per person. Tenancy resigns are one week rent per person. All prices are exclusive of VAT.';
//$objRequest->property->price_information->rent_frequency = Frozensheep\RightmoveADF\Values\RentFrequencies::Monthly;
//$objRequest->property->price_information->tenure_type = Frozensheep\RightmoveADF\Values\TenureTypes::Freehold;
//$objRequest->property->price_information->auction = true;
//$objRequest->property->price_information->tenure_unexpired_years = 75;
//$objRequest->property->price_information->price_per_unit_area = 375;

//
//general details
//
$objRequest->property->details->summary = 'This is the property summary';
$objRequest->property->details->description = 'This is the full property description';
//$objRequest->property->details->features()[] = 'Feature 1';
//$objRequest->property->details->features()[] = 'Feature 2';
//$objRequest->property->details->features()[] = 'Feature 3...can have up to 10.';
$objRequest->property->details->bedrooms = 2;
//$objRequest->property->details->bathrooms = 2;
//$objRequest->property->details->reception_rooms = 1;
//$objRequest->property->details->parking()[] = Frozensheep\RightmoveADF\Values\Parkings::Allocated;
//$objRequest->property->details->parking()[] = Frozensheep\RightmoveADF\Values\Parkings::OnStreet;
//$objRequest->property->details->outside_space()[] = Frozensheep\RightmoveADF\Values\OutsideSpaces::CommunalGarden;
//$objRequest->property->details->outside_space()[] = Frozensheep\RightmoveADF\Values\OutsideSpaces::Terrace;
//$objRequest->property->details->year_built = 1909;
//$objRequest->property->details->internal_area = 1500;
//$objRequest->property->details->internal_area_unit = Frozensheep\RightmoveADF\Values\AreaUnits::SqFt;
//$objRequest->property->details->land_area = 4000;
//$objRequest->property->details->land_area_unit = Frozensheep\RightmoveADF\Values\AreaUnits::SqFt;
//$objRequest->property->details->floors = 3;
//$objRequest->property->details->entrance_floor = Frozensheep\RightmoveADF\Values\EntranceFloors::GroundFloor;
//$objRequest->property->details->condition = Frozensheep\RightmoveADF\Values\Conditions::Good;
//$objRequest->property->details->accessibility()[] = Frozensheep\RightmoveADF\Values\Accessibilites::LiftAccess;
//$objRequest->property->details->accessibility()[] = Frozensheep\RightmoveADF\Values\Accessibilites::WideDoorways;
//$objRequest->property->details->heating()[] = Frozensheep\RightmoveADF\Values\Heatings::AirConditioning;
//$objRequest->property->details->heating()[] = Frozensheep\RightmoveADF\Values\Heatings::Gas;
//$objRequest->property->details->heating()[] = Frozensheep\RightmoveADF\Values\Heatings::EcoFriendly;
//$objRequest->property->details->furnished_type = Frozensheep\RightmoveADF\Values\Furnishings::PartFurnished;
//$objRequest->property->details->pets_allowed = true;
//$objRequest->property->details->smokers_considered = true;
//$objRequest->property->details->housing_benefit_considered = true;
//$objRequest->property->details->sharers_considered = true;
//$objRequest->property->details->burglar_alarm = true;
//$objRequest->property->details->washing_machine = true;
//$objRequest->property->details->dishwasher = true;
//$objRequest->property->details->all_bills_inc = false;
//$objRequest->property->details->water_bill_inc = false;
//$objRequest->property->details->gas_bill_inc = false;
//$objRequest->property->details->electricity_bill_inc = false;
//$objRequest->property->details->oil_bill_inc = false;
//$objRequest->property->details->council_tax_inc = false;
//$objRequest->property->details->tv_licence_inc = false;
//$objRequest->property->details->sat_cable_tv_bill_inc = false;
//$objRequest->property->details->internet_bill_inc = false;
//$objRequest->property->details->business_for_sale = true;
//$objRequest->property->details->comm_use_class()[] = Frozensheep\RightmoveADF\Values\CommercialUseClasses::A1;
//$objRequest->property->details->comm_use_class()[] = Frozensheep\RightmoveADF\Values\CommercialUseClasses::A2;

//
//room definitions (up to 99)
//
$objLivingRoom = $objRequest->property->details->rooms()->create();
$objLivingRoom->room_name = 'Living Room';
//$objLivingRoom->room_description = 'A stylish modern layout with original polished wooden floors. South facing sash windows.';
//$objLivingRoom->room_length = 4.7;
//$objLivingRoom->room_width = 3.3;
//$objLivingRoom->room_dimension_unit = Frozensheep\RightmoveADF\Values\DimensionUnits::Metres;
//$objLivingRoom->room_dimension_text = 'Chimney breast reduces part of width to 2.9m.';
//$objLivingRoom->room_photo_urls()[] = 'http://lorempixel.com/800/600/';
//$objLivingRoom->room_photo_urls()[] = 'http://lorempixel.com/800/600/';

$objKitchen = $objRequest->property->details->rooms()->create();
$objKitchen->room_name = 'Kitchen';

$objDiningRoom = $objRequest->property->details->rooms()->create();
$objDiningRoom->room_name = 'Dining Room';

//
//media definitions (up to 999)
//
$objMedia1 = $objRequest->property->media()->create();
$objMedia1->media_type = Frozensheep\RightmoveADF\Values\MediaTypes::Image;
$objMedia1->media_url = 'http://lorempixel.com/800/600/city/1';
$objMedia1->caption = 'Front of house';
$objMedia1->sort_order = 1;
$objMedia1->media_update_date = 'now';

$objMedia2 = $objRequest->property->media()->create();
$objMedia2->media_type = Frozensheep\RightmoveADF\Values\MediaTypes::Image;
$objMedia2->media_url = 'http://lorempixel.com/800/600/city/2';

$objMedia3 = $objRequest->property->media()->create();
$objMedia3->media_type = Frozensheep\RightmoveADF\Values\MediaTypes::Image;
$objMedia3->media_url = 'http://lorempixel.com/800/600/city/3';

//
//principal (optional)
//
$objRequest->property->principal->principal_email_address = 'jacob@frozensheep.com';
$objRequest->property->principal->auto_email_when_live = true;
$objRequest->property->principal->auto_email_updates = true;

//send the request
$objResponse = $objRightmoveADF->send($objRequest);
Expand Down
6 changes: 3 additions & 3 deletions src/Groups/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class Property implements GroupInterface, \JsonSerializable {
'new_home' => array('type' => 'boolean'),
'student_property' => array('type' => 'boolean'),
'house_flat_share' => array('type' => 'boolean'),
'create_date' => array('type' => 'datetime', 'format' => 'd-m-Y H:i:s'),
'update_date' => array('type' => 'datetime', 'format' => 'd-m-Y H:i:s'),
'date_available' => array('type' => 'datetime', 'format' => 'd-m-Y'),
'create_date' => array('type' => 'datetime', 'format' => 'd-m-Y H:i:s', 'autoinit' => false),
'update_date' => array('type' => 'datetime', 'format' => 'd-m-Y H:i:s', 'autoinit' => false),
'date_available' => array('type' => 'datetime', 'format' => 'd-m-Y', 'autoinit' => false),
'contract_months' => array('type' => 'int'),
'minimum_term' => array('type' => 'int'),
'let_type' => array('type' => 'enum', 'class' => 'Frozensheep\RightmoveADF\Values\LetTypes'),
Expand Down
2 changes: 1 addition & 1 deletion src/Groups/Room.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ class Room implements GroupInterface, \JsonSerializable {
'room_width' => array('type' => 'number', 'min' => 0),
'room_dimension_unit' => array('type' => 'enum', 'class' => 'Frozensheep\RightmoveADF\Values\DimensionUnits'),
'room_dimension_text' => array('type' => 'string', 'max' => 120),
'room_photo_urls' => array('type' => 'objectarray', 'class' => 'Frozensheep\Synthesize\Type\String', 'max' => 10),
'room_photo_urls' => array('type' => 'objectarray', 'class' => 'Frozensheep\Synthesize\Type\StringObject', 'max' => 10),
);
}
8 changes: 4 additions & 4 deletions src/Values/Conditions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* This file contains the Conditons Enum class.
* This file contains the Conditions Enum class.
*
* @package Frozensheep\RightmoveADF
* @author Jacob Wyke <jacob@frozensheep.com>
Expand All @@ -13,14 +13,14 @@
use Frozensheep\RightmoveADF\Values\ValuesBase;

/**
* Conditons Enum Class
* Conditions Enum Class
*
* Class for the different Conditons.
* Class for the different Conditions.
*
* @package Frozensheep\RightmoveADF
*
*/
class Conditons extends ValuesBase {
class Conditions extends ValuesBase {

const Good = 1;
const SomeWorkNeeded = 2;
Expand Down

0 comments on commit ea85b4d

Please sign in to comment.