<?php
class Dalten_Export_Api_Backend_RealitniProstor extends Dalten_Export_Api_Backend_Website
{
	public function listPhoto($sessionId, $nabidka_id)
	{
		$response = $this->_adapter->call(
			'listPhoto',
			array('session_id'=>(string) $sessionId, 'nabidka_id'=> (int) $nabidka_id)
		);
		return new Dalten_Data_ArrayObject($response);
	}

	public function addPhoto($sessionId, $nabidka_id, $photo)
	{
		$photo['data'] = $this->_adapter->setType($photo['data'], 'base64');

		$response = $this->_adapter->call(
			'addPhoto',
			array(
				'session_id'=>(string) $sessionId,
				'nabidka_id'=>(int) $nabidka_id,
				'photo'=> $photo
			)
		);
		return new Dalten_Data_ArrayObject($response);
	}

	public function delPhoto($sessionId, $photo_id)
	{
		$response = $this->_adapter->call(
			'delPhoto',
			array(
				'session_id'=>(string) $sessionId,
				'photo_id'=>(int) $photo_id
			)
		);
		return new Dalten_Data_ArrayObject($response);
	}
}