sorry I didn't mean for my tone to be so negative. ..
The correct style of coding is the one you are most familiar with so my intent was not to say "your stupid," and I was assuming this was for your own amusement and not part of a larger project which would require defining and following standards or doing any more than "get it done as simple as possible"
I have been told that when critiquing a piece of writing you are supposed to do this. So maybe this would be a good idea for this forum.
1) praise of positive things in the work
2) ask questions about the work for things reader doesn't udnerstand or wants to challenge
3) respond to question by author about what reader did and did not see or understand
3) positive criticism of the things reader would change or doesn't like
so...
1)
I will asssuming, as you said, that you wanted to keep everything object oriented, and like to organize that way, and require for sanity sake a standard coding practice. You broke things up into very logical pieces, your code is conceptually very easy to understand, and is written in a very straightforward and clear manner. The class names are meaningful as are the function names which define clear responsibility. The comments for auto code generation would also be very meaningful if looked at w/o the code present. You keep responsibility broken up so as not to create one or two functions with 5000 lines of business logic each.
Your usage example is not complicated and shows how easy your code is to use.
2)
Why write the usage around the :: singleton? Why not generate a NewsProvider object, and have the getNews() function just keep updating the instances internal array? Is there some reason why singleton is preferred?
Why bother using an internal array to store all variable in the class? Why not simply use object attributes? Even if you wanted to use the function interface to your class and not directly access attributes it seems redundant.
Why bother with the Vecktor class? Is it because all your other code is already written with it as an interface? You don't seem to be implementing any functionality other than is already available in an array. You do have a index to index swap() function but you seem to only use that for randomizing, which is already implemented in array() itself.
3)
Please respond with any specific questions you have of me/the forum.
4)
Since you have to get into php5 before you get actual protected variables, I wouldn't bother with the get() set() interface to your functions since its really non enforcable by php.
$obj->var_a = 'foo';
is almost the same typing as
$obj->setVarA('foo');
but requires less work before you can start using your code. A set() function is good for type checking and such. But since php is usually wrapped around Html Forms, most of the validation is done at that level before the info gets into your object, or so I have seen.
The use of Vecktor and NewsCollection is invisible to the user since you made your user interface of ::getNews() so simple, so since NewsProvider is manageing the whole thing in the first place I wouldn't bother getting any more complicated than you need behind that. Your code is nice and clean but noone but you will ever see it if another developer were to use your code. However I grant that if you are someone else wanted to extend this, the common use of Vektor subclasses would be desirable.
While I like the getHtml() of each. You are not seperating content and logic, since you spent a lot of trouble making nice OO code I would look into passing the getHtml() a template of some sort or somehow seperating the html from your code.