MrBaseball34 Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
YopixelAE Posted October 10, 2010 Share Posted October 10, 2010 I agree. By the way don't forget that smarty was not written, until last release, to play with object view. Maybe this impacts on presta team way of work.Cheers. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now