 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Lorna Mitchell's Blog: Retrieving Product Attributes from Magento's V2 API
by Chris Cornutt July 12, 2010 @ 08:28:14
Lorna Mitchell has posted a sort of follow-up to her previous post about accessing the Magento A{I to pull information about products from the application. In this new post she takes it a step further and shows how to get attributes from those products.
I've been working with the API for Magento in recent weeks and I had a bit of a struggle explaining to the V2 API which attributes of a product I wanted to retrieve. Actually I had issues talking to the V2 API at all, but that's a different post so I'll skate over those for now. Instead I thought I'd share (or rather, record for the next time I have the same problem!) how to specify which attributes about a product to retrieve.
She figured out that you could use the info method for the product_catalog call and specify the attributes you want. Her code example shows how to fetch the title, description, a shorter description and the price of an item.
voice your opinion now!
magento product attribute tutorial api
Jani Hartikainen's Blog: What would make template engines actually useful?
by Chris Cornutt January 19, 2009 @ 08:44:10
In a recent blog post, Jani Hartikainen looks at a two things that might make templating tools a bit more useful - better than just dropping data into a template.
Most template engines simply wrap PHP (or some other language's) syntax into their own syntax, and maybe they look a little bit cleaner when mixed with HTML. Some may even provide useful features like automatic variable escaping to prevent XSS vulnerabilities. But does this actually significantly reduce the amount of code needed to write some common scenarios, or make it easier to read/manage the code?
His two things revolve some bits of more advanced functionality - automatic table display (given whatever data) and automatic filtering of the data to make of less hassle on the developer/template designer. He even mentions an interesting idea of putting callbacks or validation checks into the actual XML definition tags for forms.
voice your opinion now!
template engine useful filter table generte attribute callback
PHP in Action: Get links with XPath
by Chris Cornutt October 07, 2008 @ 08:43:33
In response to this tutorial over on the PHPro.org website a new post has been made to the PHP in Action blog with an "even cooler" way to do the same sort of DOM fetching - XPath.
I'm a little bit surprised at the claim [the tutorial makes] that it's the "correct" (only) way, since there's at least one more that I find even cooler: XPath. Admittedly, it's slower, yet it's a more powerful language.
A quick example is included, building up from a simple search for anchor tags up to a custom query looking for just the anchor tags with a class of "bookmark".
voice your opinion now!
xpath tutorial dom link find search anchor attribute
Arnold Daniels' Blog: An alternative way of EAV modeling
by Chris Cornutt July 31, 2008 @ 12:54:23
Arnold Daniels has posted some thoughts on a topics recently featured in a cover story by php|architect - EAV modeling.
I had seen this db structure in other project, but didn't know that it was called EAV. For those who don't read php|architect, EAV describes a method of saving a large set of attributes, only some of which apply to an individual entity. Normally you would create a table, with a row for each entity and save each attribute in a column. With EAV you save each attribute as a row.
He suggests two ways to do the modeling - the more "common" way and an alternative way that splits up the data types to make querying simpler (into scalars and arrays). A sample database structure and example query for it are included.
voice your opinion now!
eav modeling database attribute query common alternative method
DevShed: Inserting Comments and Accessing Nodes with the DOM XML Extension in PHP 5
by Chris Cornutt March 11, 2008 @ 15:40:21
DevShed continues their series looking at using the DOM extension in PHP5 to work with XML in your application. They've already looked at adding attributes and creating CDATA information in a new DOM document. This time they build on that and also include new methods - appending comment nodes and getting at XML nodes by their IDs.
I'm talking about the DOM XML extension, which allows you to handle XML documents by using the DOM API. Thus, if you're interested in learning how to put this extension to work for you quickly, look no further, because you've come to the right place. [...] In this third installment of the series, I'll be teaching you specifically how to append comment nodes to a given XML string and how to extract certain elements via their IDs.
They review the method to add attributes and CDATA to an XML document first. Then they cover the other two new topics - appending comment nodes and grabbing nodes by their ID attribute.
voice your opinion now!
dom extension php5 node cdata attribute id fetch tutorial
Christopher Jones' Blog: New PDO_OCI Attributes
by Chris Cornutt September 19, 2007 @ 09:37:00
Christopher Jones talkes about some updates that he's made to the default PDO functionality of PHP, adding in a few things like pre-fetching and methods to get the details of the database server you're using.
After PHP 5.2.4 shipped and a new release cycle began, I merged a couple of enhancements to PDO_OCI attribute handling. Specifically I added $dbh->getAttribute() support for ATTR_SERVER_VERSION, ATTR_SERVER_INFO, ATTR_CLIENT_VERSION and. ATTR_AUTOCOMMIT. At the moment these are only available in the PHP snapshots on http://snaps.php.net/. Let me know if there are any issues so they can be resolved before the next PHP release.
He gives examples of two things - the pre-fetching functionality, allowing for better optimization for a query, and the transaction management features, making it as simple as a try{} block to test the commit and rollback if needed.
He also mentions other properties/attributes included in the new release - ATTR_PERSISTENT, ATTR_TIMEOUT, ATTR_ORACLE_NULLS, ATTR_CASE and ATTR_ERRMODE, ATTR_SERVER_VERSION and ATTR_CLIENT_VERSION (the last two have examples).
voice your opinion now!
pdo oci oracle attribute prefetching transaction namagement pdo oci oracle attribute prefetching transaction namagement
|
Community Events
Don't see your event here? Let us know!
|