PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
May 2, 2014 10:16
Morning room11, I'm having trouble implementing DataMapper.. The trouble is in mapping both in and out of the storage medium (mysql, relational db). Any good material for reference out there?
Mar 20, 2014 16:00
Morning room 11! Any Smarty experts in the house by any chance? After setting up a new development environment none of the Smarty templates will compile. Throws an unspecific 'SmartyCompilerException' on the first occurrence of any bit of smarty syntax
Feb 18, 2014 16:39
@PeeHaa the only cross-browser way is Flash. There is such a thing as HTML5 Clipboard API caniuse.com/#feat=clipboard
Feb 18, 2014 16:22
@Gordon You're right. Not something I wanna take for granted. Perhaps finder objects are the better way to go. Thanks
Feb 18, 2014 16:19
Imagine if I didn't have that service manager, oh the extra dependencies having separate finder objects for everything would introduce
Feb 18, 2014 16:17
not neccessarily, but if i'm going to break with SRP or the pattern as described in PoEAA it only makes sense to go with the solution that takes least effort in my specific case ;) just weighing my options
Feb 18, 2014 16:15
@Gordon Saving me the immense trouble of opening the mapper file to find out? Versus the configuration hassle (i use a zend style service manager) of having to register all these separate finder objects
Feb 18, 2014 16:11
For readability I'm going to go with tons of finder methods in one Mapper (breaking SRP) rather than stuff my file structure with classes like "MovieFinder", "AvailableMovieFinder", "MovieFinderForHomepage". Thanks for taking the time to answer!
Feb 18, 2014 16:06
Point taken Ronni!
Feb 18, 2014 16:05
@Orangepill My mappers aren't responsible for the creation of objects. Instead I pass in an instance of an object and let the mapper "fill it with data" accordingly
Feb 18, 2014 16:04
@RonniSkansing @Orangepill It sounded the same to me too, it's something i picked up in Fowlers PoEAA. I suppose orange is right and Fowler suggests to split it up in order not to break with SRP? You agree?
Feb 18, 2014 15:55
Morning room 11, am facing a Mapping dilemma, any help would be greatly appreciated. My domain logic is all done, now it comes to persistence as per Data Mapper pattern. First of all, I've decided not to implement a complicated query builder into my DBAL. Instead, I will write SQL queries (most of the select queries have JOINs) into a Mapper. Any objections so far?

Now, I'm confused as to which approach is most suitable. To write **finder methods in a mapper** or to write **finder objects**. Although surely there are, I don't see the benefits of using one over the other. Can anybody elabor
Feb 14, 2014 11:43
for end-users, that is
Feb 14, 2014 11:38
Im just guessing here, but it could well be a little mistake in that .htaccess file of yours that causes the 500 error. Try deleting(renaming) that and upload a file with phpinfo() in it to see if PHP is configured right
Feb 14, 2014 11:35
@Michel If your host (i take it it's not your own server) has a control panel like cPanel, it's probably easiest accessible through there
Feb 14, 2014 11:33
The location of the error log is defined in php.ini, look for error_log
Feb 14, 2014 11:25
Thanks, indeed, later on in the project the data for the same objects will be coming from an XML feed, suppose the mapper with SQL queries would be useless then. It's easy to pass it another mapper then, though. I'm just wondering if, regardless of the definition of a data mapper, it wouldnt be easier to just pass a mapper that works with XML instead in that case rather than extend the query builder
Feb 14, 2014 11:17
So, the query builder approach. Any arguments against writing SQL queries in the mapper?
Feb 14, 2014 11:10
Good day SO php peoples. In a MVC application using Data Mapper pattern (and MySQL for persistence), i'm dealing with domainobjects that load data from multiple tables, so the queries have JOINs. is it generally preferable to call an abstracted $db->select("..") function from the mapper or to directly write SQL queries in the mapper class?