PHRETS icon indicating copy to clipboard operation
PHRETS copied to clipboard

Wiki Documentation is Out of Date for PHRETS 2.0

Open ooglek opened this issue 9 years ago • 15 comments

The documentation for PHRETS 2.0 in the Wiki is not accurate. There are methods documented that no longer exist (such as GetMetadataTable, now GetTableMetadata) and methods that don't exist at all (such as GetAllLookupValues).

The documentation and examples are pretty important -- it'd be great to see those updated.

ooglek avatar Jan 09 '16 21:01 ooglek

Between the primary readme in the repo and phrets.readthedocs.org, the rest of the nuts and bolts should be provided by a decently modern IDE or editor. I don't disagree that the wiki needs updated (or at least clarified that it only pertains to version 1.x), but it's not been a terribly high priority.

troydavisson avatar Feb 02 '16 21:02 troydavisson

Less handy when you are developing on a remote server and not locally, or using VIM as your editor without a ton of addons.

I can read the code, but it would be nicer to have examples and function references that load nicely into Dash (or similar).

http://phrets.readthedocs.org/en/latest/functions/ <-- Empty http://phrets.readthedocs.org/en/latest/examples/ <-- very light

For example, how do I iterate through all the variables returned by $rets->GetSystemMetadata()? Merge $system->getXmlElements and $system->getXmlAttributes and loop through them, calling the "get{$varname}" method on $system. Stuff like that would have been nice to have known rather than figure out.

Other things, like Laravel's Illuminate Collection inclusions with inheritance are things I'm confident you have great reason to use, but unless the nuts and bolts are explained, and then know to go read the Laravel documentation on the Collection methods, the usefulness is lost.

ooglek avatar Feb 02 '16 22:02 ooglek

Oops, meant to comment, not close. Reopening.

ooglek avatar Feb 02 '16 22:02 ooglek

I would like to comment that at least noting that the information in the wiki is PHRETS 1.x is high priority, as it's wasted a number of human hours from myself and others to come to the conclusion that I was using PHRETS 2.2 and reading the wiki, which was 1.x.

It looks like we can travel to the wiki and just hit "Edit" and make our changes there, no?

brettalton avatar Feb 03 '16 17:02 brettalton

Dang, wasted all day trying to get these things to work, so how what is the new "GetSystemMetadata()"?

andrew-ok7 avatar Feb 07 '16 01:02 andrew-ok7

GetSystemMetadata() returns an object of "PHRETS\Models\Metadata\System" which extends Base.

In order to access the data contained in this object, this is what I do:

$system = $rets->GetSystemMetadata();
foreach(array_merge($system->getXmlElements(), $system->getXmlAttributes()) as $attr) {
    $f = 'get' . $attr; // prepend "get" since we cannot access anything directly or through a single method
    print "  " . $attr . ": " . $system->$f() . "\n"; // print out the result of e.g. $system->getSystemID 
}

The idea here is that the method getXmlElements returns the key names returned, Then getXmlAttributes returns another set, attributes about the system metadata.

In the end there are really just 5 methods that the object GetSystemMetadata returns:

  1. getSystemID
  2. getSystemDescription
  3. getTimeZoneOffset
  4. getComments
  5. getVersion

Hope that helps.

ooglek avatar Feb 07 '16 02:02 ooglek

Thanks I will give that a try, I started pulling apart RETSMD and realized that is made up of 1.0 so I went back and started looking that version over, which lead me to wonder - If 1.0 works, and is still being used for retsmd.com, then why is phrets 2.0 better? Thanks again, I will stick it out with 2.0 for a bit longer.

andrew-ok7 avatar Feb 07 '16 04:02 andrew-ok7

Hi Guys, I am a days old using phrets (using version 2.0), can you help me get some reference or sample codes using the CRUD functionality. The docs that i read was to confusing and some are not working in version 2.0. I just want to know how to add, edit, delete, update a listing from the RETS server via the PHRETS Framework. Is this possible or am I in the right track?

tjacobmas avatar Feb 25 '16 13:02 tjacobmas

@ooglek did you ever figure out a way to use something like GetAllLookupValues() in 2.0?

intrepidws avatar Apr 14 '17 00:04 intrepidws

@intrepidws Here's a gist I whipped up as an example of retrieving all lookup values for a Resource/Class https://gist.github.com/steveheinsch/287edd5ce26e608b06b20af384f4cc1e

steveheinsch avatar Apr 14 '17 18:04 steveheinsch

@intrepidws I did, I switched to LibRETS. There's a significant memory issue in PHRETS where one variable self-references the returned search object. Even after fixing that, PHRETS still uses so much memory with all of the Laravel framework "helpers" that I threw it out entirely. 😞

ooglek avatar Apr 16 '17 22:04 ooglek

@ooglek afaik that memory leak was fixed a few weeks ago when 2.3 was released as stable. Most of my largest requests pulling down all records now barely consume more than 5M max.

steveheinsch avatar Apr 16 '17 23:04 steveheinsch

@steveheinsch Thanks for that gist, very helpful.

@ooglek Thanks for letting me know.

intrepidws avatar Apr 17 '17 23:04 intrepidws

incredibly bad documentation for 2.0

approachings avatar Apr 07 '18 16:04 approachings

Perhaps you could contribute then.

intrepidws avatar Apr 08 '18 22:04 intrepidws