Jump to content

Please, consistency from the PS developers????


MrBaseball34

Recommended Posts

I've been writing a class to get real-time stock information and ran into a situation where I am needing to pass
some data to my class to modify.

I call my class function in and pass a member of $cat_products from category.php.
I also call my class function and pass a $product from products.php.

Seems you guys weren't consistent in handling these items the same way and that is rather stupid, in my opinion.

In category.php, the code:

foreach($cat_products as &$product) {
 // We are passing $product as a reference so any changes to it will
 // be reflected
 RealtimeStatus::checkStatus($product, "reference", $product['reference']);
}


has to pass $product as an ARRAY.

Whereby, in product.php, the code:

 // We are passing $product as a reference so any changes to it will
 // be reflected
 RealtimeStatus::checkStatus(&$product, "reference", $product->reference);


has to pass $product as an OBJECT.

In my RealtimeStatus::checkStatus function, I have to account for both situations and that is just absolutely ludicrous and extremely bad architecture.

When are you going to get more consistent in your handling of objects in this code? Everything should be either an object or an array, not one thing then the next.

Any comments????

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...