My horrible IRS experience… Part 1
Everyone has probably heard about the $8,000 in tax credits that are available to first time home buyers, right?
Right.
Ok, so I am a first time home buyer. I would like to get these tax credits, right?
Right.
I filled my amended tax return in June, do I have the $8,000?
No.
Let me start from the beginning…
We bought our house at the end of May. It needed some work (namely a completely new roof and new electrical line coming in), but we were ready to tackle it. We got a little bit of a discount from the previous owners (in the form of seller concessions), but we had to pay a good portion of it ourselves. The roof was going to be the worst part, it would turn out to be about $5,400 out of pocket.
Alright, sounds fine. Especially when there is this great tax credit being offered by the government for first time home buyers. We don’t have the money right now, but we can get this 0% loan (for 6 months) to cover it now, and we can make those payments until the money from the government arrives.
The roof needed to be done, it leaked, and it needed to be replaced a few years ago. We didn’t want to spend all of our savings/emergency money to cover it, so we opted for the loan.
A couple weeks after we bought the house (June 9th) I filled out the IRS amended tax return - Form 1040X - and the First Time Homebuyer Credit - Form 5405. I sent it in a week later (around June 15th) - the IRS received it around the 22nd.
Sounds all good, right? Wait a little while, and I should get a shiny check for $8,000. I could pay off the rest of the loan, and a bunch of stuff we had to buy in preparation for the baby.
Except, no. I received a letter from the IRS a few weeks later (letter dated July 6th).
“The First-Time Homebuyer Credit is not available until a home has been purchased. The date entered on the Form 5405 indicates you plan to purchase the home in the future. We cannot allow the credit until after you have acquired the home. Please resubmit your claim at that time.”
Shit! What? Did I fill out the form wrong?
I immediately looked at the PDF copy of what I had sent in (and boy am I glad I had that copy), and I became pissed.
Part 1, Section B: Date acquired: 05/29/09
Well, Since I didn’t even send the paperwork in until mid June, I have no idea why they said I was in error. I read the rest of the letter and called up the 1-800 number they provided for if I had any questions.
I was on hold for a long time. A very long time. For those of you who don’t know, the hold music at the IRS is pretty shitty. It’s classical, but it skips.
Anyway, eventually I got through to a very nice man. Lets call him Bob from Oakland.
Bob listened to my explanation, and did a little digging. He was able to bring up a copy of the forms that I submitted and agreed with me that the IRS was in error. He put me on hold for a little while to figure out what to do.
When Bob came back, he had a game plan. He told me that they had screwed up, and he would like to refer me (I still don’t know exactly to where), but I didn’t make the credentials that usually warrent a referal - but he would try. He recommended that I submit my paperwork again, with a note explaining the error the IRS had made, just in case his manager kicked back the referal.
Bob was a very nice guy. To be honest, I was actually extremely impressed with the customer service I received while on the phone.
So, the next morning I printed out the PDF copy of the form I had, hand wrote a note saying something to effect of “I own the house, the date has always been right. It’s past May. Gimme my money you little bastards”. Ok, maybe not that last bit, and I sent it in - again, with the proper paperwork included.
I got a response from them so quickly from the first submission, I figured I’d hear something pretty quick for the second. I waited til August. No news.
I decided it was time to call the 800 number again, and figure out what was going on.
This time I got Steve. Steve was also a very nice guy. I started off explaining that I had called before, I had filled a return, and I was wondering what was going on.
Steve looked into my file, and said “Well, we only got your amended return a few weeks ago, you’ll need to wait a while before it will be totally processed”.
Hold on a minute Steve. This was my SECOND submission. I want you to look some more at my file.
He did. He looked into it some more and noticed that my previous submission file had been closed out by some woman (not Bob). He realized that shouldn’t have happened, and put me on hold so he could figure some more things out. When he got back, he told me that he linked the two claims, and got approval from his manager to pass it on to the Taxpayer Advocate System. Fancy title. They would be getting back to me within 7 business days.
…8 business days later…
I called the 800 number back. This time I got Billy. I asked if I should just give him my information so he could bring up the file, but he said I should just tell him the story. 5 mins later: “Ok, What’s your information?”
(insert facepalm here).
Now, Billy turned out to be one of the best guys I talked to. Billy told me much of the same, but let me know that my file is one of the most poorly handled ones he’s seen. That made me feel good, almost proud.
Billy was about to say he wasn’t going to be able to do much for me, but I mentioned for the first time that this was causing me financial difficulty.
Immediately Billy decided to refer me again to the Taxpayer Advocate System, but this time he also gave me their number. Told me it was probably too late to call that night, but I could try Monday (it was a Friday). I told him I’d call after we hung up to at least find out their hours.
Billy apologized to me several times and wished me luck. I hung up and called the Taxpayer Advocates.
PS: The Taxpayer Advocates have the same shitty hold music as the IRS Customer Service people.
I actually got through that night, and I talked to a guy, we’ll call him Mike. Mike was a nice guy, and I told him my story. He asked for my information and I gave it to him. He was able to give me a pretty good background of how my file had been passed around. Mike said I might just have to wait a little while longer before an advocate could help me, since now the filings were taking 3-4 months to complete (previously 6-8 weeks), and mine wasn’t outside of that window yet, since my second filing was the date considered.
I decided to say the magic words - in fact I said them randomly, and not even in a sentence.
“Financial Hardship.”
“Excuse me sir?”
“I don’t know, but I was told if I say those words you’ll listen to me.”
Mike started listening, asking for how I was having a financial hardship. I explained that the money was going to help pay for the repairs on the house that I had a loan taken out for. I explained that we had made our budget, and we were ok for now, but without that money we would start to go into the red.
By the way, apparently financially planning, and knowing that you will be going into debt a month or two ahead of time isn’t “Financial Hardship”, you have to go into debt first before you can call it that. Yeah, fuck you government.
Anyway, Mike did say that if I asked him to - he could get me assigned to an Advocate immediately, even though he warned that I don’t make the qualifications. He said he felt I was not being handled well, and it could help, but at the same time the Advocate might not agree. In the end it was the Advocate’s decision, not his, to determine if they could help.
I told Mike, that I had send in the paperwork in June - the 2nd filing was because I was told to by the IRS, and that it wasn’t fair for my second filing date to be considered as the date. He looked more into it and said, that he felt maybe it would be worth the Advocate taking a look. An advocate should be in touch with me within 3 business days.
…4 business days later…
I hadn’t heard from the Advocate, so I called the number I was given by Billy again. This time I got Joe.
Now, at this point I was not a happy camper. I feel bad because I was a little short with Joe, but he was also a little short with me. Eventually I got Joe looking at my file, and he told me that I was assigned to an Advocate, and I should be getting a call shortly. Joe also apologized after looking at my file, saying it was poorly handled. Joe decided to give me my Advocate’s name, and his number.
Thank you Joe.
Joe told me my advocate would be in his office 7:30 - 4:30 Monday - Friday.
I called my advocate, we’ll call him Jimmy. Jimmy didn’t answer at first, so I left a voice mail explaining the situation. I thought I was screwed, but it turns out Jimmy actually called me back. He got information from me and told me he would look into it. He read parts of my file to me, and he said he would need to get copies of some paperwork from various IRS offices around the country (mostly places that I had called previously). He told me the whole process would take a while, since there was something still being transfered to the Fresno office. I asked him how long this would take, he told me it depended on if they audited me or not. Since I made less than $10,000 last year (yay being a grad student), my file would likely be flagged for closer examination for fraud. But, he told me, he would get back to me by the end of September.
End of September? ARE YOU FUCKING SERIOUS. FUCK YOU JIMMY.
I politely asked if there was anything I could do to speed things up, and he told me no.
I hung up, and decided I would call him again in about 2 weeks (which was the 7th), he told me paperwork was being looked at in the Fresno office, but nothing had been figured out yet. He told me he would get back to me by the end of the month with any information if any came by.
So, here I wait. I still don’t know the real status of my filing, and nobody really seems to care. It’s frustrating because I know if I owed THEM money, things would be moving a lot faster. I also am frustrated because THEY screwed up, and are taking their damn time fixing it.
Look, I know I’m not financially as screwed as many other people in this country, but it shouldn’t take this long to get this figured out. I am counting on that money to make sure I don’t run into financial problems in the next few months (the roof payment alone takes a big chunk out of the money we have to spend - and that was supposed to be paid for by this credit). The fact that I’m not already in debt means the IRS will take its damn time sorting this out.
The only good part about all of this is that apparently I am supposed to get the $8,000 plus interest. We’ll see if that actually happens.
As nice as that interest would be — does anyone have any ideas on how to make this get sorted out sooner?
Knowledge is Money
This is the first comic in a long time… It also doubles as an entry into poorerthanyou.com’s “Better Together: HP Laptop Bundle Giveaway“. The main concept is that knowledge is “money”. If you educate yourself about the credit system and methods to get out of debt, you will be better off in the long run.

Of course, if you are a keen personal finance person, you might notice some of the personalities that are in the comic ;).
Career Change… sort of.
I got an e-mail this morning from a site that linked to me. I got the 99th slot for “100 Best Blogs for Career-Minded Students“. Kinda cool I guess. I jumped to the site and read the little blurb about me.
Heh. Almost completely wrong.
A student at the Rochester Institute of Technology, this blogger is a computer science major with aspirations of being a programmer.
Not a big deal. In fact, I won’t even tell them to correct it, but I am not a computer science major (I am an Information Technology major). I am also an actual programmer. I do have a job, and I code things.
At least they got the RIT part right ;).
However, this e-mail kinda caused me to revisit a lot of things with this blog and with my life. So, lets start with the tagline to the blog…
Code Monkey and Grad Student Extraordinaire
I still like to consider myself a code monkey. So, thats still fine. Also, technically I am still a grad student… but that is only because I haven’t finished my capstone yet, but I am done with my coursework (although they do let me teach every once and a while). So that’s cool, but there is now a lot more.
I now work as a Lead Integration Analyst for the University of Rochester Medical Center (PS: Nothing I say on this blog reflects their opinions, or any other legal mumbo jumbo). This is a new direction for my career - a step away from web development, and a step towards back end programming.
Another major change is now I am a home-owner. What a crazy change! I spend my spare time fixing up the house or cleaning or changing things. It’s a very different process than what I’ve been used to.
Of course, the most major of changes coming up (not here yet!) is that I am a father. In the next few weeks we will have a newborn and that will take up most of our time. I am excited, and so is Jess. It’s going to be one hell of an experience.
So, I guess what it really comes down to is, I am going through a career change. I am no longer “just a student”, I am a Father, Programmer, Academic, and I guess: Adult.
My Cheesy Garlic Bread by Dave Morgan
I can’t quite come up with a good name. Dave’s Cheesy Garlic Bread is a little too generic, and Devmorgan’s Cheesy Garlic Bread is a little weird sounding.. so, I’ll go with My Cheesy Garlic Bread (by Dave Morgan).
No, this isn’t particularly geeky, and has nothing to do with technology or computers - but it’s my favorite thing to cook for people if I want to pretend to look like I can cook.
Start to Finish: About 45-50 mins
So, first things first.. Ingredients (makes about 8 pieces)
- 1 loaf of pane Italian bread
- 1.5 sticks of butter (or 2 if you want even LESS healthy. or 1 if you want more healthy)*
- Grated mozzarella cheese (I usually get away with the 16oz bag - can grate yourself though)
- 2 tablespoons of minced garlic (do it yourself, or buy the little glass jar at the store)
* = I make no claim that this is healthy no matter how much butter you do or don’t use.
Now, for the directions. Some variances can apply, I will note them. Also, some steps can be done concurrently, I bet you’re smart enough to figure out you can melt butter and slice bread at the same time ;).
- Pre-heat your oven to 375 degrees.
- Slice your bread
- Melt Your butter. I tend to melt half a stick first, put a tablespoon of garlic in, then melt the rest, and put the other tablespoon in. I used to do this in the microwave - now I actually do it in a sauce pan. I think the butter seems to get more of the garlic’s flavor this way. I could be wrong. Results may vary.
- Place your sliced bread on a cookie sheet (I wrap it with tin-foil to save on clean-up later).
- Now, use a spoon to scoop out the garlic from the pan and evenly distribute it onto the bread slices (I sometimes make one half of the tray more garlic heavy if some people don’t like garlic as much). Scoop all the loose garlic out first.
- Now pour the butter onto the bread. Pour slowly and let it soak into the bread. Use all the butter. It’s okay if some runs off the bread.
- Place the bread in the over for about 15 mins (this will start to make it a little more like toast).
- Pull the bread out and now place your cheese on the bread… liberally. Mound the cheese on each slice of bread. No, more than that. Even more.. Little more.. Alright, thats good.
- Bake for another 15-20 mins. Pull the bread out when the cheese starts to brown on the edges and a little on the top.
I tend to serve this with spaghetti or sometimes steak. It’s not healthy, but it is DELICIOUS. Plus, it’s ok if you make too much - it tastes pretty delicious out of the fridge the next day.
Seuss-ifying a Nursery
So, this past week has been one of painting - not so much of coding like usual…
Lots of painting.
I would like to thank Jess’ parents for coming up and helping us by painting our family room, office, and nursery. Having the help made getting so much work done possible.
This post however, is less about that particular bit of painting, but more about the amazing work that my sister Michelle was able to do when she came up this weekend. Now, my sister is artistic - but I never imagined how nicely our Dr. Seuss nursery would turn out.
First things first, we had to start with a blank canvas.

This is the side of the room on the left as you enter. Near the door.

This is the corner that is kitty corner to the door. The focal point in the room.
Now, this beautiful blue base was painted by Jess’ parents, and it came out great… but it doesn’t look much like a Dr. Seuss themed room, does it?
Buying a House
So, I’ve been gone for a little longer than I would like to admit. What it really comes down to is being busy. Of course. I have a real excuse though! I’m going to be getting married. I’m going to be a dad. I just bought a house. I just started a new job. Things are moving fast and I haven’t had time to write.

The front of our house
Now, I have more pictures - but they are on my camera, and well, I haven’t had any time since we closed to really do anything except work at U of R, travel, and work on the house. So, I can only share the ones that are on my phone.
I have gone from programmer to “house guy” lately, so I promise to update when I get some time. Maybe I’ll post details of some of my projects here.. hmm..
Damn it, get PISSED.
Time Warner Cable announced the other day that they are going to be placing low usage based caps on usage in select markets, one of which being Rochester, NY.
Hey, the twitterverse is already pissed. I’m pissed. But lets think about this for a moment.
Media-on-demand providers should be pissed. Their service requires that end users have expendable bandwidth. High Definition movies are over several gigs a piece.
Families and Roommates should be pissed. Every computer you have on the net will be consuming that bandwidth. I live with 2 friends, and yes we’re techies, but we each have a computer. We have an xbox media center (for watching movies and such), a wii (which we utilize the internet for games such as mario kart), and we all have iPod touches that we use day to day for various reasons. All of these go through our pipe. Just imagine if we played online games! My World of Warcraft addiction would start to cost me more than the monthly fee.
People with a home office should be pissed. It’s highly doubtful you have a business line into your home, especially if you do less than 50% of your work at home, so you will be affected. Sure, it depends on what you do in your office… but if you use services like Skype (for conference calls), or are involved transfering documents, all that data is counted as well.
Friends that come over with their laptops should be pissed. What happens when Steve your buddy from freshman year comes by to say hi and you have to tell him “Sorry dude, I can’t let you connect to my wifi… I’m at my limit.” or “sure, can you give me a buck or two to cover for your bandwidth?” Even worse, what happens when someone leeches your wifi?
Well, lets address some of the issues…
In Rochester, there is no real competition to Time Warner for broadband service. Frontier doesn’t have the infrastructure, and other services are just reselling Time Warner infrastructure.
Of course, ’shit ain’t free’, I agree, and I totally understand. However, a strange thing happens when companies become the only really shop in town… they charge more then they need to. Numbers that I have read vary, from 3 cents to 5 cents, but that is the approximate cost for Time Warner to have a gigabyte of data pass over their network. The means, at the high end of those numbers, it costs Time Warner two dollars for 40GB of data. Then, they are going to charge me a dollar for every gigabyte I go over? Does that seem fair to you? Ok Ok… Support costs? Fine. You know what though? The average person who will constantly go over, doesn’t use support… unless Time Warner screws up their network.
Should someone that barely uses the internet have to pay the same as me? No. I agree again. You know what? Offer people the choice. Usage based consumption, or all inclusive. Usage based should be cheaper, and it should be FAIR. You wanna set up low limits? Fine. But charge reasonable overages. Still worried about the “all inclusive” plan being abused by people who transfer truely massive amounts of data? Fine. Limit them. Write it in their contracts that consistantly going over 1TB of data transfer will cause their service to be discontinued - but let it be a truely masive amount, and only if it’s really a problem should it be addressed. There are better ways.
Really, the crux of the matter is this… You may not use all that bandwidth yet. You may even think one dollar of overages aren’t that bad. What needs to be realized though, is that our world is becoming a truely connected world. Data transfer is what is making much of this possible. Limiting access to this data will stifle our economy more, and will cause a decline in the utilization of the internet for all of its purposes… and believe it or not, thats a BAD thing.
Just remember, even reading this brings you a little bit closer to your cap. Don’t worry though, to be considerate I decided not to include any images that might needless cost you more.
April Fools Redux
I wasn’t able to get this post up yesterday, but I wanted to make sure I got it up today. Sorry for the interruption of the DyDL stuff. It’ll come out more soon.
This year we had another successful April Fools. Zack and I were able to pull off 2 fairly successful pranks. The two pranks this year were new course offering and course cancellation posters and implementation of upside-down-ternet.
So, lets start off with the simple one, the posters:

There was 23 total
Each one of the posters by themselves were mildly amusing, but when taken together, it provided for some hilarity. One thing that was requested last year was a list of all of the name tags we made, so this year I am providing a list of all the posters and where they were located (to the best of my reccolection).
Course Offerings:
Introduction to Hygiene (Men’s Bathroom Door)
(4002-039-01)
Course Description:
Learn about hygiene and why it affects you as a professional. Course is restricted to Computer Science majors until 4/13.
Advanced Googling (Posting Board)
(4002-501-04)
Course Description:
Students in this course will familiarize themselves with the advanced search functionality of google. Prerequisites: Introduction to Googling (4002-005) and Introduction to the Internet (4002-006)
Introduction to DOS gaming (Posting Board)
(4080-001-01)
Course Description:
An introduction to developing games for the new DOS platform. Topics include Virtual Memory management and writing BASIC
Introduction to the Internet (Posting Board)
(4002-006-01)
Course Description:
This course will discuss usage of applications such as Web Browsers and Chat Clients, and topics such as pr0n, games, and LOLcats.
Inventing Incomprehensible Jargon (Posting Board)
(4002-009-01)
Course Description:
BC IDK, WTF. People L2Talk. LOL Internets.
Gold Farming (Gaming Lab Door)
(4080-003-10)
Course Description:
Develop an understanding of the economics behind gold farming, as well as nurture skills in gold farming. Students must be taking less than 12 credit hours to take this course.
Introduction to ASCII porn (Posting Board)
(4002-002-69)
Course Description:
Topics include subjective determination of ASCII characters to their genitalia similarity, arranging multiple characters for genitalia, and using characters to describe sexual events.
Daemon Summoning (Airgapped Security Lab Door)
(4002-009-01)
Course Description:
Call on the powers of Rut and Baash to control first your machines, and then the world! A working knowledge of Linux and lesser daemons like the Oracle is helpful but not a prerequisite.
CAT5 Basket Weaving (Posting Board outside of Networking’s Main office)
(4002-007-01)
Course Description:
This trade skill course will train students in the fine art of basket weaving using only CAT5 cables.
Fundamentals of Notepad (Posting Board in Lobby area)
(4002-004-01)
Course Description:
Topics include: Creating a new file, Opening an existing file, Saving a file you just opened, Saving a file you just opened as another file, and Printing.
Advanced Topics in Notepad (Posting Board in Lobby area)
(4002-200-01)
Course Description:
Topics include: Copying text, Pasting text, Cutting text, Printing to a non-default printer, Word-wrap, Changing font, and using the Find command.
Designing VCR Programming Controls (Posting Board)
(4002-008-01)
Course Description:
Make VCRs not suck. Because you’re tired of your parents calling for help.
Course Cancellations:
Advanced Molecular Computing and Informatics (Medium Database Lab Door)
(4002-023-01)
Professor Thireos has been talking to someone for the past hour, and we don’t think he’ll make it to class on time.
Advanced Programming for New Media Kids (Media Lab near Bridge Door)
(4002-018-01)
Not enough interest.
“Alternative Medicines” to help Coding. (Lecture Room Door South Hallway)
(4002-021-01)
Professor Sonstein’s class will not be held until more snacks are available.
Cooking in a Digital Age (Lecture Room Door South Hallway)
(4002-017-01)
Professor Perry’s class has been canceled because there is not enough interest. Most students only eat fast food, pizza, and drink jolt or mountain dew anyway.
Being Big and Tough (Media Lab near Bridge Door)
(4002-016-01)
Professor Bogaard’s class has been canceled because his minivan broke down and he fainted and broke his chin.
Somber Programming (IMM Lab Door)
(4002-053-01)
Professor Jacobs is still sad he didn’t have a name tag last year, so in that memory, class will be postponed until tomorrow.
Flash Physics at the University Level (New Media Lab Door)
(4002-057-01)
Professor Kurtz was busy determining the rate at which a falling body falls. He should be out of the cast next Monday.
How to attract the opposite sex for INFOTECH (Lecture Room East Hallway)
(4002-100-10)
Has been canceled because no professors with course knowledge are available.
Fighting Shortness (IMM Lab Door)
(4002-023-01)
Professor Lawley and Oyzon’s team taught class will not be held today. Class will recommence when platform shoes become fashionable again.
Using Documentation for Programming (Big Database Lab Door)
(4002-067-01)
Professor Kang is out sick today. Apparently his friend, the javadoc, had the flu.
Drinking for Programmers (Medium Database Lab Door)
(4002-050-01)
Professors Whittington and Zilora have already decided that it’s 5 o’clock somewhere.

It was a blast putting them up
The second prank was much more involved. We implemeneted Upside-Down-Ternet in all three of the database labs. This prank took us late in to the night to try to figure out how to do it. We used a combination of ARP poisoning and DNS spoofing to make it happen.

Ok, Zack did most of the work
We ran into a few problems - that really show us how caring of pranksters we are. We had to modify the scripts we were using to allow for the students to continue to connect to class resources without disruption. It took us a while, and we had a few bugs, but we pulled it off.

If only it flipped flash too...
We had it running on and off for most of the day. During peak hours, having everyone redirected through our server bogged down the internet - so we had to turn it off, but we were able to turn it back on later. Towards the end of the day, Zack turned it into a Burleson-Net (a famous Oracle blogger) to make some of the database classes laugh.
Overall, a great day. I was able to see many student laughing, and many professors laughing as well.
DyDL - Part 3: Dynamic Binding with mysqli in PHP
So, before I sit back and talk about all of the actual methods on the MagicDB object, we need to talk about a problem that is specific to PHP and the mysqli extension.
Now, the basic idea I had was to build something that could generate prepared statements dynamically. This will (if done correctly) help protect against SQL injection, and ideally help speed up a few frequently run queries (as long as the SQL structure is always consistent). We need to select mysqli because it has the mysqli_stmt::prepare ( string $query ) function.
Ok, so, now we come to the binding parts of the process… and here is where it gets sticky. We are presented with these two methods:
mysqli_stmt::bind_param ( string $types , mixed &$var1 [, mixed &$... ] )
mysqli_stmt::bind_result ( mixed &$var1 [, mixed &$... ] )
This presents us with a problem. Notice how both methods (which are required for prepared statements) allow for multiple parameters. This is handy — wait.. really.. it’s never handy. I really don’t know why they designed it this way. In fact.. Damn those PHP people. OK.. so maybe I do know why, but it gets in to reference/value discussion.. so.. lets move on and just figure out a way to fix it.
In an ideal world, for being dynamic, the functions should be designed something more like this:
mysqli_stmt::bind_param ( string $types , array &$params )
mysqli_stmt::bind_result ( array &$results )
Instantly this becomes a lot better. Since the parameters/results are stored as an array, they can be dynamically generated and of any length. To address this concern, we need to tackle both functions a little bit differently. First off, the bind_param function:
I wrote a simple private function that is included in MagicDB that will accept a mysqli_stmt object, and a list of parameters. From it, the function will call the bind_param method with the proper values and return the statement object.
Now, lets discuss the major concern with this code. The data types of the parameter array that is passed in are used for truth. So, as a developer you need to be careful. This will not cause any security risks, but it may reject your parameter if the wrong data type is used. This is a known concern, but one that I am not worried about since I know to pass an int when I need an int. The beauty of this code is in the last couple lines. I use the php variable-variable-name functionality to generate a dynamic variable reference. I call each variable $bind#, and then assign the parameter to it. I then can use the & symbol to add the variable by reference to the array. Using the PHP function call_user_func_array, we can get around the multiple parameter problem by simple passing an object reference, a method name, and an array of parameters.
Now for the binding of the result. This code isn’t stored in a function, although it could be. It’s stored in my “get” method on the MagicDB object. Some variables are out of scope, but here is the snip.
So here, without getting into too much detail about how the get() function works, we want to return an object of the type that $object is. The object should have all the values populated with the results of the database. We bind the variables in the same manner that we bound the parameters in the previous function. Where it gets fancy is in the use of reflection. We get the type of the object, and pass it into what is called a ReflectionClass.
This will generate a generic class of the type we specify. We must then instantiate the object by calling newInstanceArgs() method. This allows us to pass an array with the parameters for the constructor. This is why the constructor is required in all of the data objects. We do this for each iteration of the fetch, and return the array of objects.
Sexy eh?
Next up we talk about the API and how the MagicDB functions actually work.








