Skip to content

Properties

Property model

The properties table is the core of immohive. Fields are split into logical groups:

Identity & type

Column Type Description
id INT AUTO_INCREMENT Primary key
slug VARCHAR(255) UNIQUE URL-friendly identifier (aanbod/detail.php?slug=…)
title VARCHAR(255) Display name
transaction_type ENUM sale or rent
property_type VARCHAR(50) house, apartment, garage, land, commercial, office
price DECIMAL(12,2) Asking price in EUR

Status

Column Type Description
status ENUM Site publication status — see Property statuses
sync_immoweb TINYINT(1) 1 = push this property to Immoweb
immoweb_id VARCHAR(100) Immoweb legacy ID returned after a successful publish
immoweb_status ENUM Sync state — see Immoweb sync statuses
publish_at DATETIME Scheduled publish moment (cron picks this up)
published_at DATETIME Actual moment the cron pushed it to Immoweb
market_status ENUM available, sold, rented, reserved — reported to Immoweb

Address

street, number, zip, city

Specs

Column Description
bedrooms Number of bedrooms
bathrooms Number of bathrooms
toilets Number of separate toilets
surface_living Habitable surface in m²
surface_land Plot surface in m²
build_year Year of construction
floors Number of floors in the building
floor_number Floor the unit is on (0 = ground). Mandatory for apartment on Immoweb.
garage / garden / terrace / elevator Boolean amenity flags

Energy

Column Description
epc_label EPC energy class: A+, A, B, C, D, E, F, G
epc_score Primary energy consumption in kWh/m²/year

Content

Column Description
description Free-text property description
features JSON array of feature strings, e.g. ["Alarm", "Solar panels"]

Property statuses

Controls visibility on the public website.

status Meaning
draft Not visible on the site; being prepared
published Visible on the public listing at /aanbod/
withdrawn Removed from the site; kept for historical reference

status and sync_immoweb are independent: a property can be published on the site but not pushed to Immoweb, or synced to Immoweb while still in draft.


Immoweb sync statuses

Tracks the state of the Immoweb Classifieds Pipeline push for each property where sync_immoweb = 1.

immoweb_status Meaning
pending Scheduled; not yet pushed (waiting for publish_at)
synced Successfully published or updated on Immoweb
failed Last push attempt failed; check immoweb_sync_log
withdraw_pending Withdrawal queued; cron will call the withdraw endpoint next run
withdrawn Successfully withdrawn from Immoweb

Immoweb publish workflow

flowchart TD
    A(["Admin sets\nsync_immoweb = 1\npublish_at = datetime"]) --> B
    B["immoweb_status = pending"]
    B --> C["Cron: publish.php\nruns every 5 min"]
    C --> D{publish_at\nreached?}
    D -->|No| C
    D -->|Yes| E["ConnectClient::publish()\nPOST /api/immoweb/upsert"]
    E --> F{Response OK?}
    F -->|Yes| G["Store referenceId\nCall getStatus()\nResolve legacyId"]
    G --> H["immoweb_status = synced\nimmoweb_id = legacyId\npublished_at = now"]
    H --> I(["Listing live on Immoweb"])
    F -->|No| J["immoweb_status = failed\nLog to immoweb_sync_log"]
    J -->|Fix & retry| E

Update flow

When a synced property is edited in admin and saved, the next cron run calls ConnectClient::update() (same /api/immoweb/upsert endpoint) using the existing immoweb_id.

Withdraw flow

  1. Admin sets immoweb_status = withdraw_pending (or site status → withdrawn)
  2. Cron detects withdraw_pending rows and calls ConnectClient::withdraw()
  3. On success: immoweb_status = withdrawn

connect.xact.be payload

ConnectClient::buildPayload() maps the properties row into the Immoweb Classifieds Pipeline format. Key mappings:

Immoweb field Source
offererEstateId id (string-cast)
transaction saleFOR_SALE, rentFOR_RENT
subtype property_type uppercased (HOUSE, APARTMENT, …)
price price
address street, number, zip, city
media.pictures SITE_URL . '/uploads/' . filename for each photo
specifications.bedroom.count bedrooms
energy.primaryEnergyConsumption epc_score
management.marketStatus market_status uppercased

Sync log

Every cron push (publish, update, withdraw) is recorded in immoweb_sync_log:

Column Description
property_id FK → properties.id
action publish, update, or withdraw
status success or failed
response Raw connect.xact.be response body
created_at Timestamp

Query recent failures:

SELECT p.title, l.action, l.response, l.created_at
FROM   immoweb_sync_log l
JOIN   properties p ON p.id = l.property_id
WHERE  l.status = 'failed'
ORDER  BY l.created_at DESC
LIMIT  20;

JSON API

The frontend consumes a thin JSON API at immohive/api/properties.php. Only published properties are returned.

Parameter Description
(none) Returns all published properties (default limit 100)
?id=5 Single property by ID
?slug=maison-gent Single property by slug
?type=rent Filter by transaction_type (sale / rent)
?ptype=apartment Filter by property_type
?city=Gent Filter by city (partial match)