Rightmove BLM 解析器

0.2.2 2014-12-09 23:31 UTC

This package is not auto-updated.

Last update: 2024-09-26 09:47:48 UTC


README

#MattCannon\Blm 使用 PHP 的 Rightmove BLM 解析器 - 请参阅 (http://mattcannon.github.io/rightmove/)[http://mattcannon.github.io/rightmove/]

##当前状态

  • Master:Build Status
  • Develop:Build Status

##需求

  • PHP 5.4+

##安装 使用 composer 安装此包,运行:composer require matt-cannon/blm:0.2.*

##使用 要使用解析器,您应该创建一个 Parser 类的新实例,然后设置 BLM 内容,或传入一个 BLM 文件的路径。要访问 BLM 中的数据,您应该调用 parseBlm()

$adapter = new \League\Flysystem\Adapter\Local('/data/');
$loader = new BlmFileLoader(new League\Flysystem\Filesystem($adapter),'BlmFile.blm');
$parser = new \MattCannon\Blm\Parser(new \Psr\Log\NullLogger(),$loader);
$data = $parser->parseBlm();

foreach($data as $property){
   var_dump($property);
}

您可以通过以下方式访问属性

<?php
$property = $collection->first();
echo $property->displayAddress;
echo $property->price;

##公共 API 要查看所有公共方法的完整列表,请查看 src/MattCannon/Blm/Interfaces 中的接口文件 - 如果这些文件中没有列出方法,则该方法可能已消失或其行为可能已更改,恕不另行通知。