Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make data objects immutable #12

Merged

Conversation

jkuchar
Copy link
Contributor

@jkuchar jkuchar commented Feb 15, 2016

closes #11

@@ -300,6 +293,7 @@ public function findByName($name, $city = null)

$records = new AresRecords();
foreach ($elements as $element) {
// TODO: What is this?
$record = new AresRecord();
$record->setCompanyId(strval($element->ico));
$record->setTaxId(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dfridrich please, could you give me a little advice, why should be here ares record incomplete?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because of searching records in Ares by name. I "virtually" created an instance of AresRecord because I wanted to return array of objects and not only simple array or XML. Search feature does not provide relevant information, e.g. address is not parsed.

Here is simple output of search query: http://wwwinfo.mfcr.cz/cgi-bin/ares/ares_es.cgi?obch_jm=Fridrich&obec=Ostrava&filtr=0

This is what I need to correctly create an instance with all relevant information: http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_res.cgi?ICO=73263753

But if you have an idea how to make it better I'm for it. I want this library to be as useful and clear as possible.

@dfridrich dfridrich merged commit 8770d92 into dfridrich:master Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

design: immutable AresRecord
2 participants