justimmo / php-sdk
PHP-SDK for the JUSTIMMO API
Requires
- php: >=8.1
- ext-curl: *
- ext-simplexml: *
- psr/log: ^1.0|^2.0|^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 1.x-dev
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.23
- 1.2.22
- 1.2.21
- 1.2.20
- 1.2.19
- 1.2.18
- 1.2.17
- 1.2.16
- 1.2.15
- 1.2.14
- 1.2.13
- 1.2.12
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.27
- 1.1.26
- 1.1.25
- 1.1.24
- 1.1.23
- 1.1.22
- 1.1.21
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27.1
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-main
This package is auto-updated.
Last update: 2026-11-09 16:32:09 UTC
README
Installation
Composer (recommended)
$ composer require justimmo/php-sdk "~1.2"
The wide constraint is on purpose: Composer installs the newest version your PHP can run. 1.4 and later need PHP 8.1, so an older PHP gets an older 1.x instead of a failed install.
Composer generates a vendor/autoload.php file. You can simply include this file
require_once __DIR__.'/vendor/autoload.php';
If composer is not available you can set it up
$ curl -s https://getcomposer.org/installer | php
For more install options please refer to the Composer Documentation
manually
- Download the latest stable release of php-sdk
- Download https://github.com/php-fig/log
- Extract php-sdk into your projects vendor folder
- Extract log into the src folder of php-sdk
require_once 'path_to_extraction/src/autoload.php';
Documentation
Usage Example
<?php use Justimmo\Api\JustimmoApi; use Psr\Log\NullLogger; use Justimmo\Model\RealtyQuery; use Justimmo\Cache\NullCache; use Justimmo\Model\Wrapper\V1\RealtyWrapper; use Justimmo\Model\Mapper\V1\RealtyMapper; $api = new JustimmoApi('username', 'password'); $mapper = new RealtyMapper(); $wrapper = new RealtyWrapper($mapper); $query = new RealtyQuery($api, $wrapper, $mapper); $realties = $query->filterByPrice(['min' => 500, 'max' => 1500]) ->filterByZipCode('1020') ->orderByPrice('desc') ->find(); foreach ($realties as $realty) { echo $realty->getTitle() . ' ' . $realty->getPropertyNumber(); //.... } //fetching Realty by PrimaryKey $query->findPk(12345);
Strict mode
The api ignores a filter it does not have, or a value it cannot take, and answers with an unfiltered list. A typo then looks like a working search. Since 1.5.0, strict mode rejects such a request with an exception instead of sending it. It is off by default:
$api->setStrict(true); // every query built on this api $query->strict(); // or one query $query->filterByPrice(1000); // throws: the price filter only takes a range $query->filterByPrice(['min' => 1000, 'max' => 1000]); // fine
In 2.0.0, strict mode is always on. What strict mode rejects today, 2.0.0 will reject too, so switching it on now shows what to change before the upgrade.
Since 1.6.0, a request which strict mode would reject emits a deprecation notice
(E_USER_DEPRECATED) while strict mode is off, and is sent as before. Your error log then shows
what to change, even without switching strict mode on.
Every exception the SDK throws for a call which fails, because the api does not answer, answers
with an error status, or sends a body the SDK cannot read, implements
Justimmo\Exception\JustimmoException. One catch (JustimmoException $e) catches them all.