addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1light-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [php-49] Appropriate procedure for using on classes methods inside of another class?

From: Garrett B.
Sent on: Wednesday, July 18, 2012 10:14 AM
I would use dependency injection: 

     $admin->setPaginator(new Paginator());


Pass the single method it will be used in the Paginator (already instantiated)

On Wed, Jul 18, 2012 at 10:00 AM, Jd Daniel <[address removed]> wrote:

hey kids, I got a quick questions that I want to fly by everyone

I have two classes, class.admin.php and class.paginator.php, in order to use the pagination
functions on my return (paginator requires direct access to the limiter for SQL, and admin would
need to return the pagination along with its own data) I need these two classes in cooperation.

I was wondering the best / appropriate way to do this, whether to extend class.admin.php with
paginator, or whether to require class.paginator.php into class.admin.php? This will only be used
in a single method inside of my admin.

What do you think?

Jd Daniel
1932 1st Ave Suite 803, Seattle, WA 98101

[address removed] |
T.          [masked]
C.         [masked]

Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jd Daniel ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Jd Daniel, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

Our Sponsors

  • PluralSight

    PluralSight subscriptions for developer training

  • O'Reilly

    Disc Code: PCBW is good for 40% off print and 50% off ebooks and videos

  • JetBrains PhpStorm

    Occasional free licenses to raffle off at meetups

  • DynaTrace

    Find yourself, promote yourself, stay true to yourself.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy