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

method to get Info #1

Open
kadnan opened this issue Dec 23, 2013 · 3 comments
Open

method to get Info #1

kadnan opened this issue Dec 23, 2013 · 3 comments

Comments

@kadnan
Copy link

kadnan commented Dec 23, 2013

I started this awesome library from today. Thankyou very much. One thing i badly miss that I could not find function to retrieve all info. Casting to array doesn't sound good specially when having issue to retrieve a single info as keys are being prepending * sign in keys(eg: *userId). For some weird reason I can't get it at all.

I am proposing a getter function named getInfo() for each class. This method will be introduced in Info classes for example UserInfo. By doing this it would be safe to retrieve protected variables easily.

Please suggest.

@TomiS
Copy link
Member

TomiS commented Jan 15, 2014

Hi @kadnan and sorry for late reply. I think your making a good point.

@mbeccati, do you have any points on this? Is this a good idea or should we introduce getters for each variable separately? Or something else?

@kadnan
Copy link
Author

kadnan commented Jan 15, 2014

For my own sake I introduced a getXInfo() method where X=Advertiser or Zone whatever. What I did that I returned an associative array with all parameters. If you think it's a good idea I could submit the patch

@kadnan
Copy link
Author

kadnan commented Jan 21, 2014

This is how add getInfo methods in all Info Interfaces, saves me to get into Array conversion to get values

public function getAdvertiserInfo()
    {
       return ["advertiserId"=>$this->advertiserId,"accountId"=>$this->accountId,"agencyId"=>$this->agencyId,"advertiserName"=>$this->advertiserName,"contactName"=>$this->contactName,'emailAddress' =>$this->emailAddress,"comments" =>$this->comments];
    }

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

No branches or pull requests

2 participants